summaryrefslogtreecommitdiff
path: root/svtools/source
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2011-03-18 15:55:08 +0100
committerJan Holesovsky <kendy@suse.cz>2011-03-18 15:55:08 +0100
commit4fdd55226d2972e3a256426db3122ac23b0615c6 (patch)
tree23f5b3a68382d6d3b8db0cb5e2537ed74a228d7c /svtools/source
parentc3d5444d84e18fa82235bb9d419861ac5e54f544 (diff)
parente1028d9225bc47922c387aa462887c7643bc6c40 (diff)
Merge remote-tracking branch 'origin/integration/dev300_m101'
Conflicts: comphelper/source/misc/servicedecl.cxx i18npool/source/breakiterator/breakiteratorImpl.cxx l10ntools/scripts/localize.pl svl/source/items/itemset.cxx svl/source/memtools/svarray.cxx svl/source/numbers/zformat.cxx svtools/source/brwbox/brwbox1.cxx tools/source/stream/strmwnt.cxx vcl/inc/vcl/graphite_adaptors.hxx vcl/inc/vcl/graphite_layout.hxx vcl/inc/vcl/graphite_serverfont.hxx vcl/source/control/imgctrl.cxx vcl/source/gdi/outdev.cxx vcl/source/gdi/outdev3.cxx vcl/source/glyphs/gcach_ftyp.cxx vcl/source/glyphs/graphite_adaptors.cxx vcl/source/glyphs/graphite_layout.cxx vcl/source/window/winproc.cxx vcl/unx/source/fontmanager/fontconfig.cxx
Diffstat (limited to 'svtools/source')
-rw-r--r--svtools/source/brwbox/brwbox1.cxx340
-rw-r--r--svtools/source/brwbox/brwbox2.cxx322
-rw-r--r--svtools/source/brwbox/brwbox3.cxx14
-rw-r--r--svtools/source/brwbox/brwhead.cxx4
-rw-r--r--svtools/source/brwbox/datwin.cxx105
-rw-r--r--svtools/source/brwbox/datwin.hxx60
-rw-r--r--svtools/source/brwbox/ebbcontrols.cxx28
-rw-r--r--svtools/source/brwbox/editbrowsebox.cxx2
-rw-r--r--svtools/source/brwbox/editbrowsebox2.cxx8
-rw-r--r--svtools/source/brwbox/makefile.mk59
-rw-r--r--svtools/source/config/accessibilityoptions.cxx4
-rw-r--r--svtools/source/config/apearcfg.cxx103
-rw-r--r--svtools/source/config/colorcfg.cxx10
-rw-r--r--svtools/source/config/extcolorcfg.cxx2
-rw-r--r--svtools/source/config/fontsubstconfig.cxx2
-rw-r--r--svtools/source/config/htmlcfg.cxx44
-rw-r--r--svtools/source/config/itemholder2.cxx4
-rw-r--r--svtools/source/config/makefile.mk58
-rw-r--r--svtools/source/config/menuoptions.cxx13
-rw-r--r--svtools/source/config/miscopt.cxx6
-rw-r--r--svtools/source/config/printoptions.cxx6
-rw-r--r--svtools/source/config/test/makefile.mk61
-rw-r--r--svtools/source/contnr/cont_pch.cxx43
-rw-r--r--svtools/source/contnr/contentenumeration.cxx2
-rw-r--r--svtools/source/contnr/ctrdll.cxx76
-rw-r--r--svtools/source/contnr/fileview.cxx97
-rw-r--r--svtools/source/contnr/fileview.src4
-rw-r--r--svtools/source/contnr/imivctl.hxx278
-rw-r--r--svtools/source/contnr/imivctl1.cxx850
-rw-r--r--svtools/source/contnr/imivctl2.cxx182
-rw-r--r--svtools/source/contnr/ivctrl.cxx90
-rw-r--r--svtools/source/contnr/makefile.mk82
-rw-r--r--svtools/source/contnr/svicnvw.cxx102
-rw-r--r--svtools/source/contnr/svimpbox.cxx730
-rw-r--r--svtools/source/contnr/svimpicn.cxx662
-rw-r--r--svtools/source/contnr/svlbitm.cxx130
-rw-r--r--svtools/source/contnr/svlbox.cxx351
-rw-r--r--svtools/source/contnr/svtabbx.cxx166
-rw-r--r--svtools/source/contnr/svtreebx.cxx317
-rw-r--r--svtools/source/contnr/templwin.cxx83
-rw-r--r--svtools/source/contnr/templwin.hxx16
-rw-r--r--svtools/source/contnr/templwin.src4
-rw-r--r--svtools/source/contnr/tooltiplbox.cxx2
-rw-r--r--svtools/source/contnr/treelist.cxx314
-rwxr-xr-x[-rw-r--r--]svtools/source/control/asynclink.cxx14
-rw-r--r--svtools/source/control/calendar.cxx496
-rw-r--r--svtools/source/control/collatorres.cxx4
-rw-r--r--svtools/source/control/ctrlbox.cxx203
-rw-r--r--svtools/source/control/ctrldll.cxx75
-rw-r--r--svtools/source/control/ctrltool.cxx63
-rwxr-xr-x[-rw-r--r--]svtools/source/control/filectrl.cxx14
-rwxr-xr-x[-rw-r--r--]svtools/source/control/filectrl.src17
-rwxr-xr-x[-rw-r--r--]svtools/source/control/filectrl2.cxx2
-rwxr-xr-x[-rw-r--r--]svtools/source/control/fmtfield.cxx170
-rwxr-xr-x[-rw-r--r--]svtools/source/control/headbar.cxx302
-rw-r--r--svtools/source/control/indexentryres.cxx4
-rwxr-xr-x[-rw-r--r--]svtools/source/control/inettbc.cxx156
-rwxr-xr-xsvtools/source/control/makefile.mk87
-rwxr-xr-x[-rw-r--r--]svtools/source/control/prgsbar.cxx34
-rwxr-xr-x[-rw-r--r--]svtools/source/control/roadmap.cxx15
-rwxr-xr-x[-rw-r--r--]svtools/source/control/ruler.cxx369
-rwxr-xr-x[-rw-r--r--]svtools/source/control/scriptedtext.cxx5
-rwxr-xr-x[-rw-r--r--]svtools/source/control/scrwin.cxx44
-rwxr-xr-x[-rw-r--r--]svtools/source/control/stdctrl.cxx2
-rwxr-xr-x[-rw-r--r--]svtools/source/control/stdmenu.cxx107
-rwxr-xr-x[-rw-r--r--]svtools/source/control/svxbox.cxx132
-rw-r--r--svtools/source/control/tabbar.cxx481
-rwxr-xr-x[-rw-r--r--]svtools/source/control/taskbar.cxx27
-rwxr-xr-x[-rw-r--r--]svtools/source/control/taskbox.cxx25
-rwxr-xr-x[-rw-r--r--]svtools/source/control/taskmisc.cxx23
-rwxr-xr-x[-rw-r--r--]svtools/source/control/taskstat.cxx140
-rw-r--r--svtools/source/control/toolbarmenu.cxx42
-rw-r--r--svtools/source/control/toolbarmenuacc.cxx8
-rw-r--r--svtools/source/control/toolbarmenuimp.hxx2
-rw-r--r--svtools/source/control/valueacc.cxx38
-rw-r--r--svtools/source/control/valueimp.hxx12
-rw-r--r--svtools/source/control/valueset.cxx362
-rw-r--r--svtools/source/dialogs/addresstemplate.cxx13
-rw-r--r--svtools/source/dialogs/addresstemplate.src6
-rw-r--r--svtools/source/dialogs/colctrl.cxx100
-rw-r--r--svtools/source/dialogs/colrdlg.cxx30
-rw-r--r--svtools/source/dialogs/colrdlg.hrc2
-rw-r--r--svtools/source/dialogs/colrdlg.src22
-rw-r--r--svtools/source/dialogs/filedlg.cxx14
-rw-r--r--svtools/source/dialogs/filedlg2.cxx145
-rw-r--r--svtools/source/dialogs/filedlg2.hxx20
-rw-r--r--svtools/source/dialogs/filedlg2.src3
-rw-r--r--svtools/source/dialogs/formats.src2
-rw-r--r--svtools/source/dialogs/insdlg.cxx10
-rwxr-xr-xsvtools/source/dialogs/makefile.mk81
-rw-r--r--svtools/source/dialogs/mcvmath.cxx32
-rw-r--r--svtools/source/dialogs/mcvmath.hxx16
-rw-r--r--svtools/source/dialogs/printdlg.cxx787
-rw-r--r--svtools/source/dialogs/printdlg.hrc74
-rw-r--r--svtools/source/dialogs/printdlg.src289
-rw-r--r--svtools/source/dialogs/prnsetup.cxx14
-rw-r--r--svtools/source/dialogs/prnsetup.src4
-rw-r--r--svtools/source/dialogs/propctrl.cxx499
-rw-r--r--svtools/source/dialogs/propctrl.hxx109
-rw-r--r--svtools/source/dialogs/property.cxx172
-rw-r--r--svtools/source/dialogs/roadmapwizard.cxx10
-rw-r--r--svtools/source/dialogs/so3res.src5
-rw-r--r--svtools/source/dialogs/wizardmachine.cxx4
-rw-r--r--svtools/source/dialogs/wizdlg.cxx52
-rw-r--r--svtools/source/edit/editsyntaxhighlighter.cxx26
-rw-r--r--svtools/source/edit/makefile.mk71
-rw-r--r--svtools/source/edit/svmedit.cxx278
-rw-r--r--svtools/source/edit/svmedit2.cxx14
-rw-r--r--svtools/source/edit/sychconv.cxx20
-rw-r--r--svtools/source/edit/syntaxhighlight.cxx213
-rw-r--r--svtools/source/edit/textdat2.hxx138
-rw-r--r--svtools/source/edit/textdata.cxx76
-rw-r--r--svtools/source/edit/textdoc.cxx163
-rw-r--r--svtools/source/edit/textdoc.hxx62
-rw-r--r--svtools/source/edit/texteng.cxx678
-rw-r--r--svtools/source/edit/textund2.hxx32
-rw-r--r--svtools/source/edit/textundo.cxx75
-rw-r--r--svtools/source/edit/textundo.hxx8
-rw-r--r--svtools/source/edit/textview.cxx442
-rw-r--r--svtools/source/edit/txtattr.cxx2
-rw-r--r--svtools/source/edit/xtextedt.cxx86
-rw-r--r--svtools/source/filter.vcl/filter/FilterConfigCache.cxx2
-rw-r--r--svtools/source/filter.vcl/filter/FilterConfigItem.cxx6
-rw-r--r--svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx143
-rw-r--r--svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx20
-rw-r--r--svtools/source/filter.vcl/filter/dlgejpg.cxx98
-rw-r--r--svtools/source/filter.vcl/filter/dlgejpg.hxx74
-rw-r--r--svtools/source/filter.vcl/filter/dlgejpg.src101
-rw-r--r--svtools/source/filter.vcl/filter/dlgepng.cxx93
-rw-r--r--svtools/source/filter.vcl/filter/dlgepng.hrc35
-rw-r--r--svtools/source/filter.vcl/filter/dlgepng.hxx74
-rw-r--r--svtools/source/filter.vcl/filter/dlgepng.src89
-rw-r--r--svtools/source/filter.vcl/filter/dlgexpor.cxx444
-rw-r--r--svtools/source/filter.vcl/filter/dlgexpor.hrc58
-rw-r--r--svtools/source/filter.vcl/filter/dlgexpor.hxx129
-rw-r--r--svtools/source/filter.vcl/filter/dlgexpor.src276
-rw-r--r--svtools/source/filter.vcl/filter/exportdialog.cxx1513
-rwxr-xr-xsvtools/source/filter.vcl/filter/exportdialog.hrc99
-rwxr-xr-xsvtools/source/filter.vcl/filter/exportdialog.hxx216
-rw-r--r--svtools/source/filter.vcl/filter/exportdialog.src529
-rw-r--r--svtools/source/filter.vcl/filter/filter.cxx386
-rw-r--r--svtools/source/filter.vcl/filter/filter2.cxx874
-rw-r--r--svtools/source/filter.vcl/filter/makefile.mk97
-rw-r--r--svtools/source/filter.vcl/filter/sgfbram.cxx138
-rw-r--r--svtools/source/filter.vcl/filter/sgvmain.cxx213
-rw-r--r--svtools/source/filter.vcl/filter/sgvspln.cxx87
-rw-r--r--svtools/source/filter.vcl/filter/sgvtext.cxx374
-rw-r--r--svtools/source/filter.vcl/filter/strings.hrc27
-rw-r--r--svtools/source/filter.vcl/filter/strings.src58
-rw-r--r--svtools/source/filter.vcl/igif/decode.cxx50
-rw-r--r--svtools/source/filter.vcl/igif/decode.hxx32
-rw-r--r--svtools/source/filter.vcl/igif/gifread.cxx170
-rw-r--r--svtools/source/filter.vcl/igif/makefile.mk45
-rw-r--r--svtools/source/filter.vcl/ixbm/makefile.mk44
-rw-r--r--svtools/source/filter.vcl/ixbm/xbmread.cxx52
-rw-r--r--svtools/source/filter.vcl/ixpm/makefile.mk43
-rw-r--r--svtools/source/filter.vcl/ixpm/rgbtable.hxx6
-rw-r--r--svtools/source/filter.vcl/ixpm/xpmread.cxx164
-rw-r--r--svtools/source/filter.vcl/jpeg/jpeg.cxx58
-rw-r--r--svtools/source/filter.vcl/jpeg/jpeg.h5
-rw-r--r--svtools/source/filter.vcl/jpeg/jpegc.c14
-rw-r--r--svtools/source/filter.vcl/jpeg/makefile.mk48
-rw-r--r--svtools/source/filter.vcl/wmf/emfwr.cxx168
-rw-r--r--svtools/source/filter.vcl/wmf/emfwr.hxx30
-rw-r--r--svtools/source/filter.vcl/wmf/enhwmf.cxx224
-rw-r--r--svtools/source/filter.vcl/wmf/makefile.mk50
-rw-r--r--svtools/source/filter.vcl/wmf/winmtf.cxx94
-rw-r--r--svtools/source/filter.vcl/wmf/winmtf.hxx100
-rw-r--r--svtools/source/filter.vcl/wmf/winwmf.cxx100
-rw-r--r--svtools/source/filter.vcl/wmf/wmf.cxx32
-rw-r--r--svtools/source/filter.vcl/wmf/wmfwr.cxx134
-rw-r--r--svtools/source/filter.vcl/wmf/wmfwr.hxx56
-rw-r--r--svtools/source/graphic/descriptor.cxx2
-rw-r--r--svtools/source/graphic/descriptor.hxx2
-rw-r--r--svtools/source/graphic/grfattr.cxx8
-rw-r--r--svtools/source/graphic/grfcache.cxx136
-rw-r--r--svtools/source/graphic/grfcache.hxx42
-rw-r--r--svtools/source/graphic/grfmgr.cxx136
-rw-r--r--svtools/source/graphic/grfmgr2.cxx142
-rw-r--r--svtools/source/graphic/makefile.mk69
-rw-r--r--svtools/source/graphic/provider.cxx2
-rw-r--r--svtools/source/hatchwindow/hatchwindow.cxx6
-rw-r--r--svtools/source/hatchwindow/hatchwindowfactory.component38
-rw-r--r--svtools/source/hatchwindow/hatchwindowfactory.cxx41
-rw-r--r--svtools/source/hatchwindow/ipwin.cxx24
-rw-r--r--svtools/source/hatchwindow/ipwin.hxx8
-rw-r--r--svtools/source/hatchwindow/makefile.mk65
-rw-r--r--svtools/source/inc/filectrl.hrc7
-rw-r--r--svtools/source/inc/gifread.hxx66
-rw-r--r--svtools/source/inc/jpeg.hxx10
-rw-r--r--svtools/source/inc/msgrd.hxx6
-rw-r--r--svtools/source/inc/msgwr.hxx6
-rw-r--r--svtools/source/inc/property.hxx108
-rw-r--r--svtools/source/inc/sgfbram.hxx100
-rw-r--r--svtools/source/inc/sgffilt.hxx8
-rw-r--r--svtools/source/inc/sgvmain.hxx226
-rw-r--r--svtools/source/inc/sgvspln.hxx10
-rw-r--r--svtools/source/inc/svimpbox.hxx128
-rw-r--r--svtools/source/inc/svimpicn.hxx67
-rw-r--r--svtools/source/inc/xbmread.hxx6
-rw-r--r--svtools/source/inc/xpmread.hxx60
-rw-r--r--svtools/source/java/javainteractionhandler.cxx111
-rw-r--r--svtools/source/java/makefile.mk54
-rw-r--r--svtools/source/java/patchjavaerror.src91
-rw-r--r--svtools/source/misc/acceleratorexecute.cxx4
-rw-r--r--svtools/source/misc/cliplistener.cxx4
-rw-r--r--svtools/source/misc/dialogclosedlistener.cxx2
-rw-r--r--svtools/source/misc/dialogcontrolling.cxx2
-rw-r--r--svtools/source/misc/ehdl.cxx90
-rw-r--r--svtools/source/misc/ehdl.src3
-rw-r--r--svtools/source/misc/embedhlp.cxx43
-rw-r--r--svtools/source/misc/embedtransfer.cxx10
-rw-r--r--svtools/source/misc/errtxt.src515
-rw-r--r--svtools/source/misc/filterutils.cxx2
-rw-r--r--svtools/source/misc/helpagentwindow.cxx5
-rw-r--r--svtools/source/misc/imagemgr.cxx403
-rw-r--r--svtools/source/misc/imagemgr.src21
-rw-r--r--svtools/source/misc/imageresourceaccess.cxx2
-rw-r--r--svtools/source/misc/imap.cxx163
-rw-r--r--svtools/source/misc/imap2.cxx46
-rw-r--r--svtools/source/misc/imap3.cxx10
-rw-r--r--svtools/source/misc/itemdel.cxx4
-rwxr-xr-x[-rw-r--r--]svtools/source/misc/langtab.cxx4
-rw-r--r--svtools/source/misc/langtab.src8
-rwxr-xr-xsvtools/source/misc/makefile.mk88
-rw-r--r--svtools/source/misc/svtdata.cxx24
-rw-r--r--svtools/source/misc/templatefoldercache.cxx13
-rw-r--r--svtools/source/misc/transfer.cxx8
-rw-r--r--svtools/source/misc/transfer2.cxx15
-rw-r--r--svtools/source/misc/undo.src (renamed from svtools/source/filter.vcl/filter/dlgejpg.hrc)24
-rw-r--r--svtools/source/misc/unitconv.cxx10
-rw-r--r--svtools/source/misc/wallitem.cxx2
-rw-r--r--svtools/source/misc/xwindowitem.cxx4
-rw-r--r--svtools/source/plugapp/commtest.cxx262
-rw-r--r--svtools/source/plugapp/commtest.hrc34
-rw-r--r--svtools/source/plugapp/commtest.src59
-rw-r--r--svtools/source/plugapp/makefile.mk64
-rw-r--r--svtools/source/plugapp/testtool.src7
-rw-r--r--svtools/source/plugapp/ttprops.cxx14
-rw-r--r--svtools/source/productregistration/makefile.mk78
-rw-r--r--svtools/source/productregistration/productregistration.cxx19
-rw-r--r--svtools/source/productregistration/productregistration.uno.component34
-rw-r--r--svtools/source/productregistration/registrationdlg.cxx2
-rw-r--r--svtools/source/productregistration/registrationdlg.src4
-rw-r--r--svtools/source/svhtml/htmlkywd.cxx26
-rw-r--r--svtools/source/svhtml/htmlout.cxx34
-rw-r--r--svtools/source/svhtml/htmlsupp.cxx14
-rw-r--r--svtools/source/svhtml/makefile.mk51
-rw-r--r--svtools/source/svhtml/parhtml.cxx306
-rw-r--r--svtools/source/svrtf/makefile.mk49
-rw-r--r--svtools/source/svrtf/parrtf.cxx45
-rw-r--r--svtools/source/svrtf/rtfkey2.cxx1159
-rw-r--r--svtools/source/svrtf/rtfkeywd.cxx8
-rw-r--r--svtools/source/svrtf/rtfout.cxx14
-rw-r--r--svtools/source/svrtf/svparser.cxx66
-rwxr-xr-xsvtools/source/table/cellvalueconversion.cxx77
-rwxr-xr-x[-rw-r--r--]svtools/source/table/cellvalueconversion.hxx (renamed from svtools/source/inc/accessibletableimp.hxx)51
-rw-r--r--svtools/source/table/defaultinputhandler.cxx203
-rw-r--r--svtools/source/table/gridtablerenderer.cxx663
-rw-r--r--svtools/source/table/makefile.mk51
-rwxr-xr-xsvtools/source/table/mousefunction.cxx320
-rwxr-xr-xsvtools/source/table/mousefunction.hxx161
-rw-r--r--svtools/source/table/tablecontrol.cxx785
-rwxr-xr-x[-rw-r--r--]svtools/source/table/tablecontrol_impl.cxx2606
-rwxr-xr-x[-rw-r--r--]svtools/source/table/tablecontrol_impl.hxx315
-rw-r--r--svtools/source/table/tabledatawindow.cxx199
-rw-r--r--svtools/source/table/tabledatawindow.hxx92
-rw-r--r--svtools/source/table/tablegeometry.cxx132
-rw-r--r--svtools/source/table/tablegeometry.hxx40
-rw-r--r--svtools/source/toolpanel/drawerlayouter.cxx6
-rw-r--r--svtools/source/toolpanel/dummypanel.cxx4
-rw-r--r--svtools/source/toolpanel/dummypanel.hxx2
-rwxr-xr-xsvtools/source/toolpanel/makefile.mk64
-rw-r--r--svtools/source/toolpanel/paneltabbar.cxx14
-rw-r--r--svtools/source/toolpanel/tablayouter.cxx2
-rw-r--r--svtools/source/toolpanel/toolpaneldeck.cxx4
-rw-r--r--svtools/source/toolpanel/toolpaneldrawer.cxx18
-rw-r--r--svtools/source/toolpanel/toolpaneldrawer.hxx4
-rw-r--r--svtools/source/uno/addrtempuno.cxx4
-rw-r--r--svtools/source/uno/contextmenuhelper.cxx2
-rw-r--r--svtools/source/uno/framestatuslistener.cxx2
-rw-r--r--svtools/source/uno/generictoolboxcontroller.cxx4
-rw-r--r--svtools/source/uno/genericunodialog.cxx2
-rw-r--r--svtools/source/uno/makefile.mk61
-rw-r--r--svtools/source/uno/miscservices.cxx49
-rw-r--r--svtools/source/uno/statusbarcontroller.cxx4
-rw-r--r--svtools/source/uno/svtxgridcontrol.cxx1044
-rw-r--r--svtools/source/uno/svtxgridcontrol.hxx88
-rw-r--r--svtools/source/uno/toolboxcontroller.cxx7
-rw-r--r--svtools/source/uno/treecontrolpeer.cxx78
-rw-r--r--svtools/source/uno/treecontrolpeer.hxx2
-rw-r--r--svtools/source/uno/unocontroltablemodel.cxx980
-rw-r--r--svtools/source/uno/unocontroltablemodel.hxx240
-rw-r--r--svtools/source/uno/unoevent.cxx4
-rwxr-xr-xsvtools/source/uno/unogridcolumnfacade.cxx427
-rwxr-xr-xsvtools/source/uno/unogridcolumnfacade.hxx114
-rw-r--r--svtools/source/uno/unoiface.cxx20
-rw-r--r--svtools/source/uno/unoimap.cxx26
-rw-r--r--svtools/source/uno/wizard/makefile.mk48
-rw-r--r--svtools/source/uno/wizard/unowizard.cxx31
-rw-r--r--svtools/source/uno/wizard/wizardpagecontroller.cxx2
-rw-r--r--svtools/source/urlobj/inetimg.cxx22
-rw-r--r--svtools/source/urlobj/makefile.mk46
303 files changed, 17057 insertions, 19908 deletions
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index 2f05507a61b5..31e4a187574f 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -77,7 +77,7 @@ namespace
void BrowseBox::ConstructImpl( BrowserMode nMode )
{
OSL_TRACE( "BrowseBox: %p->ConstructImpl", this );
- bMultiSelection = FALSE;
+ bMultiSelection = sal_False;
pColSel = 0;
pDataWin = 0;
pVScroll = 0;
@@ -90,26 +90,26 @@ void BrowseBox::ConstructImpl( BrowserMode nMode )
InitSettings_Impl( this );
InitSettings_Impl( pDataWin );
- bBootstrapped = FALSE;
+ bBootstrapped = sal_False;
nDataRowHeight = 0;
nTitleLines = 1;
nFirstCol = 0;
nTopRow = 0;
nCurRow = BROWSER_ENDOFSELECTION;
nCurColId = 0;
- bResizing = FALSE;
- bSelect = FALSE;
- bSelecting = FALSE;
- bScrolling = FALSE;
- bSelectionIsVisible = FALSE;
- bNotToggleSel = FALSE;
- bRowDividerDrag = FALSE;
- bHit = FALSE;
- mbInteractiveRowHeight = FALSE;
- bHideSelect = FALSE;
+ bResizing = sal_False;
+ bSelect = sal_False;
+ bSelecting = sal_False;
+ bScrolling = sal_False;
+ bSelectionIsVisible = sal_False;
+ bNotToggleSel = sal_False;
+ bRowDividerDrag = sal_False;
+ bHit = sal_False;
+ mbInteractiveRowHeight = sal_False;
+ bHideSelect = sal_False;
bHideCursor = NO_CURSOR_HIDE;
nRowCount = 0;
- m_bFocusOnlyCursor = TRUE;
+ m_bFocusOnlyCursor = sal_True;
m_aCursorColor = COL_TRANSPARENT;
m_nCurrentMode = 0;
nControlAreaWidth = USHRT_MAX;
@@ -239,14 +239,14 @@ void BrowseBox::SetFont( const Font& rNewFont )
//-------------------------------------------------------------------
-ULONG BrowseBox::GetDefaultColumnWidth( const String& _rText ) const
+sal_uLong BrowseBox::GetDefaultColumnWidth( const String& _rText ) const
{
return GetDataWindow().GetTextWidth( _rText ) + GetDataWindow().GetTextWidth( '0' ) * 4;
}
//-------------------------------------------------------------------
-void BrowseBox::InsertHandleColumn( ULONG nWidth )
+void BrowseBox::InsertHandleColumn( sal_uLong nWidth )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -266,8 +266,8 @@ void BrowseBox::InsertHandleColumn( ULONG nWidth )
}
//-------------------------------------------------------------------
-void BrowseBox::InsertDataColumn( USHORT nItemId, const Image& rImage,
- long nWidth, HeaderBarItemBits nBits, USHORT nPos )
+void BrowseBox::InsertDataColumn( sal_uInt16 nItemId, const Image& rImage,
+ long nWidth, HeaderBarItemBits nBits, sal_uInt16 nPos )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -286,7 +286,7 @@ void BrowseBox::InsertDataColumn( USHORT nItemId, const Image& rImage,
if ( getDataWindow()->pHeaderBar )
{
// Handlecolumn nicht in der Headerbar
- USHORT nHeaderPos = nPos;
+ sal_uInt16 nHeaderPos = nPos;
if (nHeaderPos != HEADERBAR_APPEND && !GetColumnId(0))
nHeaderPos--;
getDataWindow()->pHeaderBar->InsertItem(
@@ -297,8 +297,8 @@ void BrowseBox::InsertDataColumn( USHORT nItemId, const Image& rImage,
//-------------------------------------------------------------------
-void BrowseBox::InsertDataColumn( USHORT nItemId, const XubString& rText,
- long nWidth, HeaderBarItemBits nBits, USHORT nPos )
+void BrowseBox::InsertDataColumn( sal_uInt16 nItemId, const XubString& rText,
+ long nWidth, HeaderBarItemBits nBits, sal_uInt16 nPos )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -318,7 +318,7 @@ void BrowseBox::InsertDataColumn( USHORT nItemId, const XubString& rText,
if ( getDataWindow()->pHeaderBar )
{
// Handlecolumn nicht in der Headerbar
- USHORT nHeaderPos = nPos;
+ sal_uInt16 nHeaderPos = nPos;
if (nHeaderPos != HEADERBAR_APPEND && !GetColumnId(0))
nHeaderPos--;
getDataWindow()->pHeaderBar->InsertItem(
@@ -329,9 +329,9 @@ void BrowseBox::InsertDataColumn( USHORT nItemId, const XubString& rText,
//-------------------------------------------------------------------
-void BrowseBox::InsertDataColumn( USHORT nItemId,
+void BrowseBox::InsertDataColumn( sal_uInt16 nItemId,
const Image& rImage, const XubString& rText,
- long nWidth, HeaderBarItemBits nBits, USHORT nPos,
+ long nWidth, HeaderBarItemBits nBits, sal_uInt16 nPos,
const String* pHelpText )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -352,7 +352,7 @@ void BrowseBox::InsertDataColumn( USHORT nItemId,
if ( getDataWindow()->pHeaderBar )
{
// Handlecolumn nicht in der Headerbar
- USHORT nHeaderPos = nPos;
+ sal_uInt16 nHeaderPos = nPos;
if (nHeaderPos != HEADERBAR_APPEND && !GetColumnId(0))
nHeaderPos--;
@@ -367,20 +367,20 @@ void BrowseBox::InsertDataColumn( USHORT nItemId,
ColumnInserted( nPos );
}
//-------------------------------------------------------------------
-USHORT BrowseBox::ToggleSelectedColumn()
+sal_uInt16 BrowseBox::ToggleSelectedColumn()
{
- USHORT nSelectedColId = USHRT_MAX;
+ sal_uInt16 nSelectedColId = USHRT_MAX;
if ( pColSel && pColSel->GetSelectCount() )
{
DoHideCursor( "ToggleSelectedColumn" );
ToggleSelection();
nSelectedColId = (*pCols)[ pColSel->FirstSelected() ]->GetId();
- pColSel->SelectAll(FALSE);
+ pColSel->SelectAll(sal_False);
}
return nSelectedColId;
}
// -----------------------------------------------------------------------------
-void BrowseBox::SetToggledSelectedColumn(USHORT _nSelectedColumnId)
+void BrowseBox::SetToggledSelectedColumn(sal_uInt16 _nSelectedColumnId)
{
if ( pColSel && _nSelectedColumnId != USHRT_MAX )
{
@@ -391,7 +391,7 @@ void BrowseBox::SetToggledSelectedColumn(USHORT _nSelectedColumnId)
}
}
// -----------------------------------------------------------------------------
-void BrowseBox::FreezeColumn( USHORT nItemId, BOOL bFreeze )
+void BrowseBox::FreezeColumn( sal_uInt16 nItemId, sal_Bool bFreeze )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -410,7 +410,7 @@ void BrowseBox::FreezeColumn( USHORT nItemId, BOOL bFreeze )
return;
// remark the column selection
- USHORT nSelectedColId = ToggleSelectedColumn();
+ sal_uInt16 nSelectedColId = ToggleSelectedColumn();
// freeze or unfreeze?
if ( bFreeze )
@@ -419,7 +419,7 @@ void BrowseBox::FreezeColumn( USHORT nItemId, BOOL bFreeze )
if ( nItemPos != 0 && !(*pCols)[ nItemPos-1 ]->IsFrozen() )
{
// move to the right of the last frozen column
- USHORT nFirstScrollable = FrozenColCount();
+ sal_uInt16 nFirstScrollable = FrozenColCount();
BrowserColumn *pColumn = (*pCols)[ nItemPos ];
BrowserColumns::iterator it = pCols->begin();
::std::advance( it, nItemPos );
@@ -440,7 +440,7 @@ void BrowseBox::FreezeColumn( USHORT nItemId, BOOL bFreeze )
if ( (sal_Int32)nItemPos != FrozenColCount()-1 )
{
// move to the leftmost scrollable colum
- USHORT nFirstScrollable = FrozenColCount();
+ sal_uInt16 nFirstScrollable = FrozenColCount();
BrowserColumn *pColumn = (*pCols)[ nItemPos ];
BrowserColumns::iterator it = pCols->begin();
::std::advance( it, nItemPos );
@@ -471,7 +471,7 @@ void BrowseBox::FreezeColumn( USHORT nItemId, BOOL bFreeze )
//-------------------------------------------------------------------
-void BrowseBox::SetColumnPos( USHORT nColumnId, USHORT nPos )
+void BrowseBox::SetColumnPos( sal_uInt16 nColumnId, sal_uInt16 nPos )
{
// never set pos of the handle-column
if ( nColumnId == 0 )
@@ -482,7 +482,7 @@ void BrowseBox::SetColumnPos( USHORT nColumnId, USHORT nPos )
return;
// get the position in the current array
- USHORT nOldPos = GetColumnPos( nColumnId );
+ sal_uInt16 nOldPos = GetColumnPos( nColumnId );
if ( nOldPos >= pCols->size() )
// not available!
return;
@@ -491,7 +491,7 @@ void BrowseBox::SetColumnPos( USHORT nColumnId, USHORT nPos )
if (nOldPos != nPos)
{
// remark the column selection
- USHORT nSelectedColId = ToggleSelectedColumn();
+ sal_uInt16 nSelectedColId = ToggleSelectedColumn();
// determine old column area
Size aDataWinSize( pDataWin->GetSizePixel() );
@@ -501,7 +501,7 @@ void BrowseBox::SetColumnPos( USHORT nColumnId, USHORT nPos )
Rectangle aFromRect( GetFieldRect( nColumnId) );
aFromRect.Right() += 2*MIN_COLUMNWIDTH;
- USHORT nNextPos = nOldPos + 1;
+ sal_uInt16 nNextPos = nOldPos + 1;
if ( nOldPos > nPos )
nNextPos = nOldPos - 1;
@@ -552,7 +552,7 @@ void BrowseBox::SetColumnPos( USHORT nColumnId, USHORT nPos )
// adjust header bar positions
if ( getDataWindow()->pHeaderBar )
{
- USHORT nNewPos = nPos;
+ sal_uInt16 nNewPos = nPos;
if ( !GetColumnId(0) )
--nNewPos;
getDataWindow()->pHeaderBar->MoveItem(nColumnId,nNewPos);
@@ -594,7 +594,7 @@ void BrowseBox::SetColumnPos( USHORT nColumnId, USHORT nPos )
//-------------------------------------------------------------------
-void BrowseBox::SetColumnMode( USHORT nColumnId, BrowserColumnMode nFlags )
+void BrowseBox::SetColumnMode( sal_uInt16 nColumnId, BrowserColumnMode nFlags )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -623,7 +623,7 @@ void BrowseBox::SetColumnMode( USHORT nColumnId, BrowserColumnMode nFlags )
//-------------------------------------------------------------------
-void BrowseBox::SetColumnTitle( USHORT nItemId, const String& rTitle )
+void BrowseBox::SetColumnTitle( sal_uInt16 nItemId, const String& rTitle )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -632,7 +632,7 @@ void BrowseBox::SetColumnTitle( USHORT nItemId, const String& rTitle )
return;
// get the position in the current array
- USHORT nItemPos = GetColumnPos( nItemId );
+ sal_uInt16 nItemPos = GetColumnPos( nItemId );
if ( nItemPos >= pCols->size() )
// not available!
return;
@@ -670,7 +670,7 @@ void BrowseBox::SetColumnTitle( USHORT nItemId, const String& rTitle )
//-------------------------------------------------------------------
-void BrowseBox::SetColumnWidth( USHORT nItemId, ULONG nWidth )
+void BrowseBox::SetColumnWidth( sal_uInt16 nItemId, sal_uLong nWidth )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -692,7 +692,7 @@ void BrowseBox::SetColumnWidth( USHORT nItemId, ULONG nWidth )
nMaxWidth -= getDataWindow()->bAutoSizeLastCol
? GetFieldRect(nItemId).Left()
: GetFrozenWidth();
- if ( ( (BrowserDataWin*)pDataWin )->bAutoSizeLastCol || nWidth > (ULONG)nMaxWidth )
+ if ( ( (BrowserDataWin*)pDataWin )->bAutoSizeLastCol || nWidth > (sal_uLong)nMaxWidth )
{
nWidth = nMaxWidth > 16 ? nMaxWidth : nOldWidth;
nWidth = QueryColumnResize( nItemId, nWidth );
@@ -703,11 +703,11 @@ void BrowseBox::SetColumnWidth( USHORT nItemId, ULONG nWidth )
// In AutoSizeLastColumn() wird SetColumnWidth mit nWidth==0xffff
// gerufen. Deshalb muss hier nochmal geprueft werden, ob sich die
// Breite tatsaechlich geaendert hat.
- if( (ULONG)nOldWidth == nWidth )
+ if( (sal_uLong)nOldWidth == nWidth )
return;
// soll die Aenderung sofort dargestellt werden?
- BOOL bUpdate = GetUpdateMode() &&
+ sal_Bool bUpdate = GetUpdateMode() &&
( (*pCols)[ nItemPos ]->IsFrozen() || nItemPos >= nFirstCol );
if ( bUpdate )
@@ -727,7 +727,7 @@ void BrowseBox::SetColumnWidth( USHORT nItemId, ULONG nWidth )
{
// X-Pos der veraenderten Spalte ermitteln
long nX = 0;
- for ( USHORT nCol = 0; nCol < nItemPos; ++nCol )
+ for ( sal_uInt16 nCol = 0; nCol < nItemPos; ++nCol )
{
BrowserColumn *pCol = (*pCols)[ nCol ];
if ( pCol->IsFrozen() || nCol >= nFirstCol )
@@ -736,18 +736,18 @@ void BrowseBox::SetColumnWidth( USHORT nItemId, ULONG nWidth )
// eigentliches scroll+invalidate
pDataWin->SetClipRegion();
- BOOL bSelVis = bSelectionIsVisible;
- bSelectionIsVisible = FALSE;
+ sal_Bool bSelVis = bSelectionIsVisible;
+ bSelectionIsVisible = sal_False;
if( GetBackground().IsScrollable() )
{
- Rectangle aScrRect( nX + std::min( (ULONG)nOldWidth, nWidth ), 0,
+ Rectangle aScrRect( nX + std::min( (sal_uLong)nOldWidth, nWidth ), 0,
GetSizePixel().Width() , // the header is longer than the datawin
pDataWin->GetPosPixel().Y() - 1 );
Control::Scroll( nWidth-nOldWidth, 0, aScrRect, SCROLL_FLAGS );
aScrRect.Bottom() = pDataWin->GetSizePixel().Height();
getDataWindow()->Scroll( nWidth-nOldWidth, 0, aScrRect, SCROLL_FLAGS );
- Rectangle aInvRect( nX, 0, nX + std::max( nWidth, (ULONG)nOldWidth ), USHRT_MAX );
+ Rectangle aInvRect( nX, 0, nX + std::max( nWidth, (sal_uLong)nOldWidth ), USHRT_MAX );
Control::Invalidate( aInvRect, INVALIDATE_NOCHILDREN );
( (BrowserDataWin*)pDataWin )->Invalidate( aInvRect );
}
@@ -785,7 +785,7 @@ void BrowseBox::AutoSizeLastColumn()
if ( getDataWindow()->bAutoSizeLastCol &&
getDataWindow()->GetUpdateMode() )
{
- USHORT nId = GetColumnId( (USHORT)pCols->size() - 1 );
+ sal_uInt16 nId = GetColumnId( (sal_uInt16)pCols->size() - 1 );
SetColumnWidth( nId, LONG_MAX );
ColumnResized( nId );
}
@@ -793,12 +793,12 @@ void BrowseBox::AutoSizeLastColumn()
//-------------------------------------------------------------------
-void BrowseBox::RemoveColumn( USHORT nItemId )
+void BrowseBox::RemoveColumn( sal_uInt16 nItemId )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
// Spaltenposition ermitteln
- USHORT nPos = GetColumnPos(nItemId);
+ sal_uInt16 nPos = GetColumnPos(nItemId);
if ( nPos >= ColCount() )
// nicht vorhanden
return;
@@ -892,7 +892,7 @@ void BrowseBox::RemoveColumns()
// Spaltenselektion korrigieren
if ( pColSel )
{
- pColSel->SelectAll(FALSE);
+ pColSel->SelectAll(sal_False);
pColSel->SetTotalRange( Range( 0, 0 ) );
}
@@ -950,11 +950,11 @@ void BrowseBox::RemoveColumns()
//-------------------------------------------------------------------
-String BrowseBox::GetColumnTitle( USHORT nId ) const
+String BrowseBox::GetColumnTitle( sal_uInt16 nId ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
- USHORT nItemPos = GetColumnPos( nId );
+ sal_uInt16 nItemPos = GetColumnPos( nId );
if ( nItemPos >= pCols->size() )
return String();
return (*pCols)[ nItemPos ]->Title();
@@ -969,11 +969,11 @@ long BrowseBox::GetRowCount() const
//-------------------------------------------------------------------
-USHORT BrowseBox::ColCount() const
+sal_uInt16 BrowseBox::ColCount() const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
- return (USHORT) pCols->size();
+ return (sal_uInt16) pCols->size();
}
//-------------------------------------------------------------------
@@ -1002,7 +1002,7 @@ void BrowseBox::SetDataRowHeight( long nPixel )
//-------------------------------------------------------------------
-void BrowseBox::SetTitleLines( USHORT nLines )
+void BrowseBox::SetTitleLines( sal_uInt16 nLines )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -1021,9 +1021,9 @@ long BrowseBox::ScrollColumns( long nCols )
// implicitly hides cursor while scrolling
StartScroll();
- bScrolling = TRUE;
- BOOL bScrollable = pDataWin->GetBackground().IsScrollable();
- BOOL bInvalidateView = FALSE;
+ bScrolling = sal_True;
+ sal_Bool bScrollable = pDataWin->GetBackground().IsScrollable();
+ sal_Bool bInvalidateView = sal_False;
// scrolling one column to the right?
if ( nCols == 1 )
@@ -1034,7 +1034,7 @@ long BrowseBox::ScrollColumns( long nCols )
if ( !bScrollable )
{
- bInvalidateView = TRUE;
+ bInvalidateView = sal_True;
}
else
{
@@ -1080,7 +1080,7 @@ long BrowseBox::ScrollColumns( long nCols )
if ( !bScrollable )
{
- bInvalidateView = TRUE;
+ bInvalidateView = sal_True;
}
else
{
@@ -1115,7 +1115,7 @@ long BrowseBox::ScrollColumns( long nCols )
pDataWin->GetSizePixel() ) );
}
- nFirstCol = nFirstCol + (USHORT)nCols;
+ nFirstCol = nFirstCol + (sal_uInt16)nCols;
aHScroll.SetThumbPos( nFirstCol - FrozenColCount() );
}
@@ -1147,7 +1147,7 @@ long BrowseBox::ScrollColumns( long nCols )
getDataWindow()->Update();
Update();
}
- bScrolling = FALSE;
+ bScrolling = sal_False;
EndScroll();
return nCols;
@@ -1171,8 +1171,8 @@ long BrowseBox::ScrollRows( long nRows )
if ( nNewTopRow == nTopRow )
return 0;
- USHORT nVisibleRows =
- (USHORT)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
+ sal_uInt16 nVisibleRows =
+ (sal_uInt16)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
VisibleRowsChanged(nNewTopRow, nVisibleRows);
@@ -1222,7 +1222,7 @@ long BrowseBox::ScrollPages( long )
//-------------------------------------------------------------------
-void BrowseBox::RowModified( long nRow, USHORT nColId )
+void BrowseBox::RowModified( long nRow, sal_uInt16 nColId )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -1237,7 +1237,7 @@ void BrowseBox::RowModified( long nRow, USHORT nColId )
else
{
// invalidate the specific field
- aRect = GetFieldRectPixel( nRow, nColId, FALSE );
+ aRect = GetFieldRectPixel( nRow, nColId, sal_False );
}
getDataWindow()->Invalidate( aRect );
}
@@ -1303,7 +1303,7 @@ void BrowseBox::Clear()
}
}
// -----------------------------------------------------------------------------
-void BrowseBox::RowInserted( long nRow, long nNumRows, BOOL bDoPaint, BOOL bKeepSelection )
+void BrowseBox::RowInserted( long nRow, long nNumRows, sal_Bool bDoPaint, sal_Bool bKeepSelection )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -1316,7 +1316,7 @@ void BrowseBox::RowInserted( long nRow, long nNumRows, BOOL bDoPaint, BOOL bKeep
return;
// adjust total row count
- BOOL bLastRow = nRow >= nRowCount;
+ sal_Bool bLastRow = nRow >= nRowCount;
nRowCount += nNumRows;
DoHideCursor( "RowInserted" );
@@ -1360,9 +1360,9 @@ void BrowseBox::RowInserted( long nRow, long nNumRows, BOOL bDoPaint, BOOL bKeep
// adjust the cursor
if ( nCurRow == BROWSER_ENDOFSELECTION )
- GoToRow( 0, FALSE, bKeepSelection );
+ GoToRow( 0, sal_False, bKeepSelection );
else if ( nRow <= nCurRow )
- GoToRow( nCurRow += nNumRows, FALSE, bKeepSelection );
+ GoToRow( nCurRow += nNumRows, sal_False, bKeepSelection );
// adjust the vertical scrollbar
if ( bDoPaint )
@@ -1409,7 +1409,7 @@ void BrowseBox::RowInserted( long nRow, long nNumRows, BOOL bDoPaint, BOOL bKeep
//-------------------------------------------------------------------
-void BrowseBox::RowRemoved( long nRow, long nNumRows, BOOL bDoPaint )
+void BrowseBox::RowRemoved( long nRow, long nNumRows, sal_Bool bDoPaint )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -1582,20 +1582,20 @@ void BrowseBox::RowRemoved( long nRow, long nNumRows, BOOL bDoPaint )
//-------------------------------------------------------------------
-BOOL BrowseBox::GoToRow( long nRow)
+sal_Bool BrowseBox::GoToRow( long nRow)
{
- return GoToRow(nRow, FALSE, FALSE);
+ return GoToRow(nRow, sal_False, sal_False);
}
//-------------------------------------------------------------------
-BOOL BrowseBox::GoToRowAndDoNotModifySelection( long nRow )
+sal_Bool BrowseBox::GoToRowAndDoNotModifySelection( long nRow )
{
- return GoToRow( nRow, FALSE, TRUE );
+ return GoToRow( nRow, sal_False, sal_True );
}
//-------------------------------------------------------------------
-BOOL BrowseBox::GoToRow( long nRow, BOOL bRowColMove, BOOL bKeepSelection )
+sal_Bool BrowseBox::GoToRow( long nRow, sal_Bool bRowColMove, sal_Bool bKeepSelection )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -1603,22 +1603,22 @@ BOOL BrowseBox::GoToRow( long nRow, BOOL bRowColMove, BOOL bKeepSelection )
// nothing to do?
if ( nRow == nCurRow && ( bMultiSelection || uRow.nSel == nRow ) )
- return TRUE;
+ return sal_True;
// out of range?
if ( nRow < 0 || nRow >= nRowCount )
- return FALSE;
+ return sal_False;
// nicht erlaubt?
if ( ( !bRowColMove && !IsCursorMoveAllowed( nRow, nCurColId ) ) )
- return FALSE;
+ return sal_False;
if ( getDataWindow()->bNoScrollBack && nRow < nTopRow )
nRow = nTopRow;
// compute the last visible row
Size aSz( pDataWin->GetSizePixel() );
- USHORT nVisibleRows = USHORT( aSz.Height() / GetDataRowHeight() - 1 );
+ sal_uInt16 nVisibleRows = sal_uInt16( aSz.Height() / GetDataRowHeight() - 1 );
long nLastRow = nTopRow + nVisibleRows;
// suspend Updates
@@ -1630,11 +1630,11 @@ BOOL BrowseBox::GoToRow( long nRow, BOOL bRowColMove, BOOL bKeepSelection )
DoHideCursor( "GoToRow" );
// must we scroll?
- BOOL bWasVisible = bSelectionIsVisible;
+ sal_Bool bWasVisible = bSelectionIsVisible;
if (! bMultiSelection)
{
if( !bKeepSelection )
- bSelectionIsVisible = FALSE;
+ bSelectionIsVisible = sal_False;
}
if ( nRow < nTopRow )
ScrollRows( nRow - nTopRow );
@@ -1676,46 +1676,46 @@ BOOL BrowseBox::GoToRow( long nRow, BOOL bRowColMove, BOOL bKeepSelection )
if ( !bSelecting )
Select();
else
- bSelect = TRUE;
+ bSelect = sal_True;
}
- return TRUE;
+ return sal_True;
}
//-------------------------------------------------------------------
-BOOL BrowseBox::GoToColumnId( USHORT nColId)
+sal_Bool BrowseBox::GoToColumnId( sal_uInt16 nColId)
{
- return GoToColumnId(nColId,TRUE,FALSE);
+ return GoToColumnId(nColId,sal_True,sal_False);
}
-BOOL BrowseBox::GoToColumnId( USHORT nColId, BOOL bMakeVisible, BOOL bRowColMove)
+sal_Bool BrowseBox::GoToColumnId( sal_uInt16 nColId, sal_Bool bMakeVisible, sal_Bool bRowColMove)
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
if (!bColumnCursor)
- return FALSE;
+ return sal_False;
// erlaubt?
if (!bRowColMove && !IsCursorMoveAllowed( nCurRow, nColId ) )
- return FALSE;
+ return sal_False;
- if ( nColId != nCurColId || (bMakeVisible && !IsFieldVisible(nCurRow, nColId, TRUE)))
+ if ( nColId != nCurColId || (bMakeVisible && !IsFieldVisible(nCurRow, nColId, sal_True)))
{
- USHORT nNewPos = GetColumnPos(nColId);
+ sal_uInt16 nNewPos = GetColumnPos(nColId);
BrowserColumn* pColumn = (nNewPos < pCols->size()) ? (*pCols)[ nNewPos ] : NULL;
DBG_ASSERT( pColumn, "no column object - invalid id?" );
if ( !pColumn )
- return FALSE;
+ return sal_False;
DoHideCursor( "GoToColumnId" );
nCurColId = nColId;
- USHORT nFirstPos = nFirstCol;
- USHORT nWidth = (USHORT)pColumn->Width();
- USHORT nLastPos = GetColumnAtXPosPixel(
- pDataWin->GetSizePixel().Width()-nWidth, FALSE );
- USHORT nFrozen = FrozenColCount();
+ sal_uInt16 nFirstPos = nFirstCol;
+ sal_uInt16 nWidth = (sal_uInt16)pColumn->Width();
+ sal_uInt16 nLastPos = GetColumnAtXPosPixel(
+ pDataWin->GetSizePixel().Width()-nWidth, sal_False );
+ sal_uInt16 nFrozen = FrozenColCount();
if ( bMakeVisible && nLastPos &&
nNewPos >= nFrozen && ( nNewPos < nFirstPos || nNewPos > nLastPos ) )
{
@@ -1728,35 +1728,35 @@ BOOL BrowseBox::GoToColumnId( USHORT nColId, BOOL bMakeVisible, BOOL bRowColMove
DoShowCursor( "GoToColumnId" );
if (!bRowColMove)
CursorMoved();
- return TRUE;
+ return sal_True;
}
- return TRUE;
+ return sal_True;
}
//-------------------------------------------------------------------
-BOOL BrowseBox::GoToRowColumnId( long nRow, USHORT nColId )
+sal_Bool BrowseBox::GoToRowColumnId( long nRow, sal_uInt16 nColId )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
// out of range?
if ( nRow < 0 || nRow >= nRowCount )
- return FALSE;
+ return sal_False;
if (!bColumnCursor)
- return FALSE;
+ return sal_False;
// nothing to do ?
if ( nRow == nCurRow && ( bMultiSelection || uRow.nSel == nRow ) &&
- nColId == nCurColId && IsFieldVisible(nCurRow, nColId, TRUE))
- return TRUE;
+ nColId == nCurColId && IsFieldVisible(nCurRow, nColId, sal_True))
+ return sal_True;
// erlaubt?
if (!IsCursorMoveAllowed(nRow, nColId))
- return FALSE;
+ return sal_False;
DoHideCursor( "GoToRowColumnId" );
- BOOL bMoved = GoToRow(nRow, TRUE) && GoToColumnId(nColId, TRUE, TRUE);
+ sal_Bool bMoved = GoToRow(nRow, sal_True) && GoToColumnId(nColId, sal_True, sal_True);
DoShowCursor( "GoToRowColumnId" );
if (bMoved)
@@ -1783,15 +1783,15 @@ void BrowseBox::SetNoSelection()
// unselect all
if ( bMultiSelection )
- uRow.pSel->SelectAll(FALSE);
+ uRow.pSel->SelectAll(sal_False);
else
uRow.nSel = BROWSER_ENDOFSELECTION;
if ( pColSel )
- pColSel->SelectAll(FALSE);
+ pColSel->SelectAll(sal_False);
if ( !bSelecting )
Select();
else
- bSelect = TRUE;
+ bSelect = sal_True;
// restore screen
OSL_TRACE( "BrowseBox: %p->ShowCursor", this );
@@ -1827,7 +1827,7 @@ void BrowseBox::SetSelection( const MultiSelection &rSel )
if ( !bSelecting )
Select();
else
- bSelect = TRUE;
+ bSelect = sal_True;
// restore screen
ToggleSelection();
@@ -1857,8 +1857,8 @@ void BrowseBox::SelectAll()
// select all rows
if ( pColSel )
- pColSel->SelectAll(FALSE);
- uRow.pSel->SelectAll(TRUE);
+ pColSel->SelectAll(sal_False);
+ uRow.pSel->SelectAll(sal_True);
// Handle-Column nicht highlighten
BrowserColumn *pFirstCol = (*pCols)[ 0 ];
@@ -1868,8 +1868,8 @@ void BrowseBox::SelectAll()
if ( !bHideSelect )
{
Rectangle aHighlightRect;
- USHORT nVisibleRows =
- (USHORT)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
+ sal_uInt16 nVisibleRows =
+ (sal_uInt16)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
for ( long nRow = Max( nTopRow, uRow.pSel->FirstSelected() );
nRow != BROWSER_ENDOFSELECTION && nRow < nTopRow + nVisibleRows;
nRow = uRow.pSel->NextSelected() )
@@ -1882,7 +1882,7 @@ void BrowseBox::SelectAll()
if ( !bSelecting )
Select();
else
- bSelect = TRUE;
+ bSelect = sal_True;
// restore screen
OSL_TRACE( "BrowseBox: %p->ShowCursor", this );
@@ -1912,7 +1912,7 @@ void BrowseBox::SelectAll()
//-------------------------------------------------------------------
-void BrowseBox::SelectRow( long nRow, BOOL _bSelect, BOOL bExpand )
+void BrowseBox::SelectRow( long nRow, sal_Bool _bSelect, sal_Bool bExpand )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -1920,7 +1920,7 @@ void BrowseBox::SelectRow( long nRow, BOOL _bSelect, BOOL bExpand )
{
// deselecting is impossible, selecting via cursor
if ( _bSelect )
- GoToRow(nRow, FALSE);
+ GoToRow(nRow, sal_False);
return;
}
@@ -1931,11 +1931,11 @@ void BrowseBox::SelectRow( long nRow, BOOL _bSelect, BOOL bExpand )
{
ToggleSelection();
if ( bMultiSelection )
- uRow.pSel->SelectAll(FALSE);
+ uRow.pSel->SelectAll(sal_False);
else
uRow.nSel = BROWSER_ENDOFSELECTION;
if ( pColSel )
- pColSel->SelectAll(FALSE);
+ pColSel->SelectAll(sal_False);
}
// set new selection
@@ -1963,7 +1963,7 @@ void BrowseBox::SelectRow( long nRow, BOOL _bSelect, BOOL bExpand )
if ( !bSelecting )
Select();
else
- bSelect = TRUE;
+ bSelect = sal_True;
// restore screen
OSL_TRACE( "BrowseBox: %p->ShowCursor", this );
@@ -1996,7 +1996,7 @@ long BrowseBox::GetSelectRowCount() const
//-------------------------------------------------------------------
-void BrowseBox::SelectColumnPos( USHORT nNewColPos, BOOL _bSelect, BOOL bMakeVisible )
+void BrowseBox::SelectColumnPos( sal_uInt16 nNewColPos, sal_Bool _bSelect, sal_Bool bMakeVisible )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -2018,10 +2018,10 @@ void BrowseBox::SelectColumnPos( USHORT nNewColPos, BOOL _bSelect, BOOL bMakeVis
OSL_TRACE( "BrowseBox: %p->HideCursor", this );
ToggleSelection();
if ( bMultiSelection )
- uRow.pSel->SelectAll(FALSE);
+ uRow.pSel->SelectAll(sal_False);
else
uRow.nSel = BROWSER_ENDOFSELECTION;
- pColSel->SelectAll(FALSE);
+ pColSel->SelectAll(sal_False);
if ( pColSel->Select( nNewColPos, _bSelect ) )
{
@@ -2029,7 +2029,7 @@ void BrowseBox::SelectColumnPos( USHORT nNewColPos, BOOL _bSelect, BOOL bMakeVis
// only highlight painted areas
pDataWin->Update();
- Rectangle aFieldRectPix( GetFieldRectPixel( nCurRow, nCurColId, FALSE ) );
+ Rectangle aFieldRectPix( GetFieldRectPixel( nCurRow, nCurColId, sal_False ) );
Rectangle aRect(
Point( aFieldRectPix.Left() - MIN_COLUMNWIDTH, 0 ),
Size( (*pCols)[ nNewColPos ]->Width(),
@@ -2038,7 +2038,7 @@ void BrowseBox::SelectColumnPos( USHORT nNewColPos, BOOL _bSelect, BOOL bMakeVis
if ( !bSelecting )
Select();
else
- bSelect = TRUE;
+ bSelect = sal_True;
if ( isAccessibleAlive() )
{
@@ -2062,12 +2062,12 @@ void BrowseBox::SelectColumnPos( USHORT nNewColPos, BOOL _bSelect, BOOL bMakeVis
//-------------------------------------------------------------------
-USHORT BrowseBox::GetSelectColumnCount() const
+sal_uInt16 BrowseBox::GetSelectColumnCount() const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
// while bAutoSelect (==!pColSel), 1 if any rows (yes rows!) else none
- return pColSel ? (USHORT) pColSel->GetSelectCount() :
+ return pColSel ? (sal_uInt16) pColSel->GetSelectCount() :
nCurRow >= 0 ? 1 : 0;
}
@@ -2085,7 +2085,7 @@ long BrowseBox::NextSelectedColumn( ) const
//-------------------------------------------------------------------
-long BrowseBox::FirstSelectedRow( BOOL bInverse )
+long BrowseBox::FirstSelectedRow( sal_Bool bInverse )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -2130,7 +2130,7 @@ bool BrowseBox::IsRowSelected( long nRow ) const
//-------------------------------------------------------------------
-bool BrowseBox::IsColumnSelected( USHORT nColumnId ) const
+bool BrowseBox::IsColumnSelected( sal_uInt16 nColumnId ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -2149,11 +2149,11 @@ sal_Bool BrowseBox::IsAllSelected() const
//-------------------------------------------------------------------
-BOOL BrowseBox::MakeFieldVisible
+sal_Bool BrowseBox::MakeFieldVisible
(
long nRow, // Zeilen-Nr des Feldes (beginnend mit 0)
- USHORT nColId, // Spalten-Id des Feldes
- BOOL bComplete // (== FALSE), TRUE => vollst"andig sichtbar machen
+ sal_uInt16 nColId, // Spalten-Id des Feldes
+ sal_Bool bComplete // (== sal_False), sal_True => vollst"andig sichtbar machen
)
/* [Beschreibung]
@@ -2164,11 +2164,11 @@ BOOL BrowseBox::MakeFieldVisible
[R"uckgabewert]
- BOOL TRUE
+ sal_Bool sal_True
Das angegebene Feld wurde sichtbar gemacht, bzw. war
bereits sichtbar.
- FALSE
+ sal_False
Das angegebene Feld konnte nicht sichtbar bzw. bei
'bComplete' nicht vollst"andig sichtbar gemacht werden.
*/
@@ -2178,16 +2178,16 @@ BOOL BrowseBox::MakeFieldVisible
if ( !bBootstrapped ||
( aTestSize.Width() == 0 && aTestSize.Height() == 0 ) )
- return FALSE;
+ return sal_False;
// ist es schon sichtbar?
- BOOL bVisible = IsFieldVisible( nRow, nColId, bComplete );
+ sal_Bool bVisible = IsFieldVisible( nRow, nColId, bComplete );
if ( bVisible )
- return TRUE;
+ return sal_True;
// Spaltenposition und Feld-Rechteck und Ausgabebereich berechnen
- USHORT nColPos = GetColumnPos( nColId );
- Rectangle aFieldRect = GetFieldRectPixel( nRow, nColId, FALSE );
+ sal_uInt16 nColPos = GetColumnPos( nColId );
+ Rectangle aFieldRect = GetFieldRectPixel( nRow, nColId, sal_False );
Rectangle aDataRect = Rectangle( Point(0, 0), pDataWin->GetSizePixel() );
// links au\serhalb?
@@ -2204,7 +2204,7 @@ BOOL BrowseBox::MakeFieldVisible
if ( ScrollColumns( 1 ) != 1 )
// nichts mehr zu scrollen
break;
- aFieldRect = GetFieldRectPixel( nRow, nColId, FALSE );
+ aFieldRect = GetFieldRectPixel( nRow, nColId, sal_False );
}
// oben au\serhalb?
@@ -2230,19 +2230,19 @@ BOOL BrowseBox::MakeFieldVisible
//-------------------------------------------------------------------
-BOOL BrowseBox::IsFieldVisible( long nRow, USHORT nColumnId,
- BOOL bCompletely ) const
+sal_Bool BrowseBox::IsFieldVisible( long nRow, sal_uInt16 nColumnId,
+ sal_Bool bCompletely ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
// durch frozen-Column verdeckt?
- USHORT nColPos = GetColumnPos( nColumnId );
+ sal_uInt16 nColPos = GetColumnPos( nColumnId );
if ( nColPos >= FrozenColCount() && nColPos < nFirstCol )
- return FALSE;
+ return sal_False;
Rectangle aRect( ImplFieldRectPixel( nRow, nColumnId ) );
if ( aRect.IsEmpty() )
- return FALSE;
+ return sal_False;
// get the visible area
Rectangle aOutRect( Point(0, 0), pDataWin->GetOutputSizePixel() );
@@ -2257,8 +2257,8 @@ BOOL BrowseBox::IsFieldVisible( long nRow, USHORT nColumnId,
//-------------------------------------------------------------------
-Rectangle BrowseBox::GetFieldRectPixel( long nRow, USHORT nColumnId,
- BOOL bRelToBrowser) const
+Rectangle BrowseBox::GetFieldRectPixel( long nRow, sal_uInt16 nColumnId,
+ sal_Bool bRelToBrowser) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -2280,7 +2280,7 @@ Rectangle BrowseBox::GetFieldRectPixel( long nRow, USHORT nColumnId,
//-------------------------------------------------------------------
-Rectangle BrowseBox::GetRowRectPixel( long nRow, BOOL bRelToBrowser ) const
+Rectangle BrowseBox::GetRowRectPixel( long nRow, sal_Bool bRelToBrowser ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -2309,13 +2309,13 @@ Rectangle BrowseBox::GetRowRectPixel( long nRow, BOOL bRelToBrowser ) const
//-------------------------------------------------------------------
-Rectangle BrowseBox::ImplFieldRectPixel( long nRow, USHORT nColumnId ) const
+Rectangle BrowseBox::ImplFieldRectPixel( long nRow, sal_uInt16 nColumnId ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
// compute the X-coordinte realtiv to DataWin by accumulation
long nColX = 0;
- USHORT nFrozenCols = FrozenColCount();
+ sal_uInt16 nFrozenCols = FrozenColCount();
size_t nCol;
for ( nCol = 0;
nCol < pCols->size() && (*pCols)[ nCol ]->GetId() != nColumnId;
@@ -2340,7 +2340,7 @@ Rectangle BrowseBox::ImplFieldRectPixel( long nRow, USHORT nColumnId ) const
//-------------------------------------------------------------------
-long BrowseBox::GetRowAtYPosPixel( long nY, BOOL bRelToBrowser ) const
+long BrowseBox::GetRowAtYPosPixel( long nY, sal_Bool bRelToBrowser ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -2361,7 +2361,7 @@ long BrowseBox::GetRowAtYPosPixel( long nY, BOOL bRelToBrowser ) const
//-------------------------------------------------------------------
-Rectangle BrowseBox::GetFieldRect( USHORT nColumnId ) const
+Rectangle BrowseBox::GetFieldRect( sal_uInt16 nColumnId ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -2370,7 +2370,7 @@ Rectangle BrowseBox::GetFieldRect( USHORT nColumnId ) const
//-------------------------------------------------------------------
-USHORT BrowseBox::GetColumnAtXPosPixel( long nX, BOOL ) const
+sal_uInt16 BrowseBox::GetColumnAtXPosPixel( long nX, sal_Bool ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -2391,7 +2391,7 @@ USHORT BrowseBox::GetColumnAtXPosPixel( long nX, BOOL ) const
//-------------------------------------------------------------------
-void BrowseBox::ReserveControlArea( USHORT nWidth )
+void BrowseBox::ReserveControlArea( sal_uInt16 nWidth )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -2431,9 +2431,9 @@ void BrowseBox::SetMode( BrowserMode nMode )
DBG_ASSERT( !( getDataWindow()->bAutoVScroll && getDataWindow()->bNoVScroll ),
"BrowseBox::SetMode: AutoVScroll *and* NoVScroll?" );
if ( getDataWindow()->bAutoHScroll )
- getDataWindow()->bNoHScroll = FALSE;
+ getDataWindow()->bNoHScroll = sal_False;
if ( getDataWindow()->bAutoVScroll )
- getDataWindow()->bNoVScroll = FALSE;
+ getDataWindow()->bNoVScroll = sal_False;
if ( getDataWindow()->bNoHScroll )
aHScroll.Hide();
@@ -2547,40 +2547,40 @@ void BrowseBox::SetMode( BrowserMode nMode )
//-------------------------------------------------------------------
-void BrowseBox::VisibleRowsChanged( long, USHORT )
+void BrowseBox::VisibleRowsChanged( long, sal_uInt16 )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
// Das alte Verhalten: NumRows automatisch korrigieren:
if ( nRowCount < GetRowCount() )
{
- RowInserted(nRowCount,GetRowCount() - nRowCount,FALSE);
+ RowInserted(nRowCount,GetRowCount() - nRowCount,sal_False);
}
else if ( nRowCount > GetRowCount() )
{
- RowRemoved(nRowCount-(nRowCount - GetRowCount()),nRowCount - GetRowCount(),FALSE);
+ RowRemoved(nRowCount-(nRowCount - GetRowCount()),nRowCount - GetRowCount(),sal_False);
}
}
//-------------------------------------------------------------------
-sal_Bool BrowseBox::IsCursorMoveAllowed( long, USHORT ) const
+sal_Bool BrowseBox::IsCursorMoveAllowed( long, sal_uInt16 ) const
/* [Beschreibung]
Diese virtuelle Methode wird immer gerufen bevor der Cursor direkt
- bewegt werden soll. Durch 'return FALSE' kann verhindert werden, da\s
+ bewegt werden soll. Durch 'return sal_False' kann verhindert werden, da\s
dies geschieht, wenn z.B. ein Datensatz irgendwelchen Rules widerspricht.
Diese Methode wird nicht gerufen, wenn die Cursorbewegung durch
ein L"oschen oder Einf"ugen (einer Zeile/Spalte) ausgel"ost wird, also
genaugenommen nur eine Cursor-Korrektur vorliegt.
- Die Basisimplementierung liefert derzeit immer TRUE.
+ Die Basisimplementierung liefert derzeit immer sal_True.
*/
{
- return TRUE;
+ return sal_True;
}
//-------------------------------------------------------------------
@@ -2698,10 +2698,10 @@ void BrowseBox::LoseFocus()
if ( !bKeepHighlight )
{
ToggleSelection();
- bSelectionIsVisible = FALSE;
+ bSelectionIsVisible = sal_False;
}
- bHasFocus = FALSE;
+ bHasFocus = sal_False;
}
Control::LoseFocus();
}
@@ -2717,12 +2717,12 @@ void BrowseBox::GetFocus()
{
if ( !bSelectionIsVisible )
{
- bSelectionIsVisible = TRUE;
+ bSelectionIsVisible = sal_True;
if ( bBootstrapped )
ToggleSelection();
}
- bHasFocus = TRUE;
+ bHasFocus = sal_True;
DoShowCursor( "GetFocus" );
}
Control::GetFocus();
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index c4dcc4d9d74b..9c9796baa90b 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -174,7 +174,7 @@ void BrowseBox::StateChanged( StateChangedType nStateChange )
}
else if ( STATE_CHANGE_INITSHOW == nStateChange )
{
- bBootstrapped = TRUE; // muss zuerst gesetzt werden!
+ bBootstrapped = sal_True; // muss zuerst gesetzt werden!
Resize();
if ( bMultiSelection )
@@ -187,8 +187,8 @@ void BrowseBox::StateChanged( StateChangedType nStateChange )
if ( HasFocus() )
{
- bSelectionIsVisible = TRUE;
- bHasFocus = TRUE;
+ bSelectionIsVisible = sal_True;
+ bHasFocus = sal_True;
}
UpdateScrollbars();
AutoSizeLastColumn();
@@ -282,7 +282,7 @@ void BrowseBox::RowHeightChanged()
//-------------------------------------------------------------------
-long BrowseBox::QueryColumnResize( USHORT, long nWidth )
+long BrowseBox::QueryColumnResize( sal_uInt16, long nWidth )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
return nWidth;
@@ -290,14 +290,14 @@ long BrowseBox::QueryColumnResize( USHORT, long nWidth )
//-------------------------------------------------------------------
-void BrowseBox::ColumnResized( USHORT )
+void BrowseBox::ColumnResized( sal_uInt16 )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
}
//-------------------------------------------------------------------
-void BrowseBox::ColumnMoved( USHORT )
+void BrowseBox::ColumnMoved( sal_uInt16 )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
}
@@ -326,7 +326,7 @@ void BrowseBox::EndScroll()
#pragma optimize( "", off )
#endif
-void BrowseBox::ToggleSelection( BOOL bForce )
+void BrowseBox::ToggleSelection( sal_Bool bForce )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -338,8 +338,8 @@ void BrowseBox::ToggleSelection( BOOL bForce )
return;
// only highlight painted areas!
- bNotToggleSel = TRUE;
- if ( FALSE && !getDataWindow()->bInPaint )
+ bNotToggleSel = sal_True;
+ if ( sal_False && !getDataWindow()->bInPaint )
pDataWin->Update();
// accumulate areas of rows to highlight
@@ -388,7 +388,7 @@ void BrowseBox::ToggleSelection( BOOL bForce )
{
Rectangle aRect( GetFieldRectPixel(nCurRow,
(*pCols)[ nColId ]->GetId(),
- FALSE ) );
+ sal_False ) );
aRect.Left() -= MIN_COLUMNWIDTH;
aRect.Right() += MIN_COLUMNWIDTH;
aRect.Top() = 0;
@@ -396,7 +396,7 @@ void BrowseBox::ToggleSelection( BOOL bForce )
pDataWin->Invalidate( aRect );
}
- bNotToggleSel = FALSE;
+ bNotToggleSel = sal_False;
}
#ifdef _MSC_VER
@@ -407,15 +407,15 @@ void BrowseBox::ToggleSelection( BOOL bForce )
void BrowseBox::DrawCursor()
{
- BOOL bReallyHide = FALSE;
+ sal_Bool bReallyHide = sal_False;
if ( SMART_CURSOR_HIDE == bHideCursor )
{
if ( !GetSelectRowCount() && !GetSelectColumnCount() )
- bReallyHide = TRUE;
+ bReallyHide = sal_True;
}
else if ( HARD_CURSOR_HIDE == bHideCursor )
{
- bReallyHide = TRUE;
+ bReallyHide = sal_True;
}
bReallyHide |= !bSelectionIsVisible || !IsUpdateMode() || bScrolling || nCurRow < 0;
@@ -433,7 +433,7 @@ void BrowseBox::DrawCursor()
Rectangle aCursor;
if ( bColumnCursor )
{
- aCursor = GetFieldRectPixel( nCurRow, nCurColId, FALSE );
+ aCursor = GetFieldRectPixel( nCurRow, nCurColId, sal_False );
aCursor.Left() -= MIN_COLUMNWIDTH;
aCursor.Right() += 1;
aCursor.Bottom() += 1;
@@ -475,11 +475,11 @@ void BrowseBox::DrawCursor()
//-------------------------------------------------------------------
-ULONG BrowseBox::GetColumnWidth( USHORT nId ) const
+sal_uLong BrowseBox::GetColumnWidth( sal_uInt16 nId ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
- USHORT nItemPos = GetColumnPos( nId );
+ sal_uInt16 nItemPos = GetColumnPos( nId );
if ( nItemPos >= pCols->size() )
return 0;
return (*pCols)[ nItemPos ]->Width();
@@ -487,7 +487,7 @@ ULONG BrowseBox::GetColumnWidth( USHORT nId ) const
//-------------------------------------------------------------------
-USHORT BrowseBox::GetColumnId( USHORT nPos ) const
+sal_uInt16 BrowseBox::GetColumnId( sal_uInt16 nPos ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -498,11 +498,11 @@ USHORT BrowseBox::GetColumnId( USHORT nPos ) const
//-------------------------------------------------------------------
-USHORT BrowseBox::GetColumnPos( USHORT nId ) const
+sal_uInt16 BrowseBox::GetColumnPos( sal_uInt16 nId ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
- for ( USHORT nPos = 0; nPos < pCols->size(); ++nPos )
+ for ( sal_uInt16 nPos = 0; nPos < pCols->size(); ++nPos )
if ( (*pCols)[ nPos ]->GetId() == nId )
return nPos;
return BROWSER_INVALIDID;
@@ -510,14 +510,14 @@ USHORT BrowseBox::GetColumnPos( USHORT nId ) const
//-------------------------------------------------------------------
-BOOL BrowseBox::IsFrozen( USHORT nColumnId ) const
+sal_Bool BrowseBox::IsFrozen( sal_uInt16 nColumnId ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
for ( size_t nPos = 0; nPos < pCols->size(); ++nPos )
if ( (*pCols)[ nPos ]->GetId() == nColumnId )
return (*pCols)[ nPos ]->IsFrozen();
- return FALSE;
+ return sal_False;
}
//-------------------------------------------------------------------
@@ -534,34 +534,34 @@ void BrowseBox::ExpandRowSelection( const BrowserMouseEvent& rEvt )
Range aJustifiedRange( aSelRange );
aJustifiedRange.Justify();
- BOOL bSelectThis = ( bSelect != aJustifiedRange.IsInside( rEvt.GetRow() ) );
+ sal_Bool bSelectThis = ( bSelect != aJustifiedRange.IsInside( rEvt.GetRow() ) );
if ( aJustifiedRange.IsInside( rEvt.GetRow() ) )
{
// down and up
while ( rEvt.GetRow() < aSelRange.Max() )
{ // ZTC/Mac bug - dont put these statemants together!
- SelectRow( aSelRange.Max(), bSelectThis, TRUE );
+ SelectRow( aSelRange.Max(), bSelectThis, sal_True );
--aSelRange.Max();
}
while ( rEvt.GetRow() > aSelRange.Max() )
{ // ZTC/Mac bug - dont put these statemants together!
- SelectRow( aSelRange.Max(), bSelectThis, TRUE );
+ SelectRow( aSelRange.Max(), bSelectThis, sal_True );
++aSelRange.Max();
}
}
else
{
// up and down
- BOOL bOldSelecting = bSelecting;
- bSelecting = TRUE;
+ sal_Bool bOldSelecting = bSelecting;
+ bSelecting = sal_True;
while ( rEvt.GetRow() < aSelRange.Max() )
{ // ZTC/Mac bug - dont put these statemants together!
--aSelRange.Max();
if ( !IsRowSelected( aSelRange.Max() ) )
{
- SelectRow( aSelRange.Max(), bSelectThis, TRUE );
- bSelect = TRUE;
+ SelectRow( aSelRange.Max(), bSelectThis, sal_True );
+ bSelect = sal_True;
}
}
while ( rEvt.GetRow() > aSelRange.Max() )
@@ -569,8 +569,8 @@ void BrowseBox::ExpandRowSelection( const BrowserMouseEvent& rEvt )
++aSelRange.Max();
if ( !IsRowSelected( aSelRange.Max() ) )
{
- SelectRow( aSelRange.Max(), bSelectThis, TRUE );
- bSelect = TRUE;
+ SelectRow( aSelRange.Max(), bSelectThis, sal_True );
+ bSelect = sal_True;
}
}
bSelecting = bOldSelecting;
@@ -580,9 +580,9 @@ void BrowseBox::ExpandRowSelection( const BrowserMouseEvent& rEvt )
}
else
if ( !bMultiSelection || !IsRowSelected( rEvt.GetRow() ) )
- SelectRow( rEvt.GetRow(), TRUE );
+ SelectRow( rEvt.GetRow(), sal_True );
- GoToRow( rEvt.GetRow(), FALSE );
+ GoToRow( rEvt.GetRow(), sal_False );
DoShowCursor( "ExpandRowSelection" );
}
@@ -595,21 +595,21 @@ void BrowseBox::Resize()
BrowseBox::StateChanged( STATE_CHANGE_INITSHOW );
if ( pCols->empty() )
{
- getDataWindow()->bResizeOnPaint = TRUE;
+ getDataWindow()->bResizeOnPaint = sal_True;
return;
}
- getDataWindow()->bResizeOnPaint = FALSE;
+ getDataWindow()->bResizeOnPaint = sal_False;
// calc the size of the scrollbars
// (we can't ask the scrollbars for their widths cause if we're zoomed they still have to be
// resized - which is done in UpdateScrollbars)
- ULONG nSBSize = GetSettings().GetStyleSettings().GetScrollBarSize();
+ sal_uLong nSBSize = GetSettings().GetStyleSettings().GetScrollBarSize();
if (IsZoom())
- nSBSize = (ULONG)(nSBSize * (double)GetZoom());
+ nSBSize = (sal_uLong)(nSBSize * (double)GetZoom());
DoHideCursor( "Resize" );
- USHORT nOldVisibleRows =
- (USHORT)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
+ sal_uInt16 nOldVisibleRows =
+ (sal_uInt16)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
// did we need a horiz. scroll bar oder gibt es eine Control Area?
if ( !getDataWindow()->bNoHScroll &&
@@ -632,8 +632,8 @@ void BrowseBox::Resize()
Point( 0, GetTitleHeight() ),
Size( nDataWidth, nDataHeight ) );
- USHORT nVisibleRows =
- (USHORT)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
+ sal_uInt16 nVisibleRows =
+ (sal_uInt16)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
// TopRow ist unveraendert, aber die Anzahl sichtbarer Zeilen hat sich
// geaendert
@@ -675,8 +675,8 @@ void BrowseBox::Paint( const Rectangle& rRect )
return;
BrowserColumn *pFirstCol = (*pCols)[ 0 ];
- BOOL bHandleCol = pFirstCol && pFirstCol->GetId() == 0;
- BOOL bHeaderBar = getDataWindow()->pHeaderBar != NULL;
+ sal_Bool bHandleCol = pFirstCol && pFirstCol->GetId() == 0;
+ sal_Bool bHeaderBar = getDataWindow()->pHeaderBar != NULL;
// draw delimitational lines
if ( !getDataWindow()->bNoHScroll )
@@ -723,7 +723,7 @@ void BrowseBox::Paint( const Rectangle& rRect )
{
ButtonFrame aButtonFrame( Point( nX, 0 ),
Size( pCol->Width()-1, GetTitleHeight()-1 ),
- pCol->Title(), FALSE, FALSE,
+ pCol->Title(), sal_False, sal_False,
0 != (BROWSER_COLUMN_TITLEABBREVATION&pCol->Flags()),
!IsEnabled());
aButtonFrame.Draw( *this );
@@ -768,9 +768,9 @@ void BrowseBox::PaintRow( OutputDevice&, const Rectangle& )
//-------------------------------------------------------------------
-void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
- BOOL bDrawSelection = (nFlags & WINDOW_DRAW_NOSELECTION) == 0;
+ sal_Bool bDrawSelection = (nFlags & WINDOW_DRAW_NOSELECTION) == 0;
// we need pixel coordinates
Size aRealSize = pDev->LogicToPixel(rSize);
@@ -859,7 +859,7 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
{
ButtonFrame aButtonFrame( aRealPos,
Size( pFirstCol->Width()-1, nTitleHeight-1 ),
- pFirstCol->Title(), FALSE, FALSE, FALSE, !IsEnabled());
+ pFirstCol->Title(), sal_False, sal_False, sal_False, !IsEnabled());
aButtonFrame.Draw( *pDev );
pDev->Push( PUSH_LINECOLOR );
@@ -882,7 +882,7 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
pDev->SetClipRegion( pDev->PixelToLogic( aRegion ) );
// do we have to paint the background
- BOOL bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && GetDataWindow().IsControlBackground();
+ sal_Bool bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && GetDataWindow().IsControlBackground();
if ( bBackground )
{
Rectangle aRect( aRealPos, aRealSize );
@@ -890,7 +890,7 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
pDev->DrawRect( aRect );
}
- ImplPaintData( *pDev, Rectangle( aRealPos, aRealSize ), TRUE, bDrawSelection );
+ ImplPaintData( *pDev, Rectangle( aRealPos, aRealSize ), sal_True, bDrawSelection );
// restore the column widths/data row height
nDataRowHeight = nOriginalHeight;
@@ -911,7 +911,7 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
//-------------------------------------------------------------------
-void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL _bForeignDevice, BOOL _bDrawSelections)
+void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, sal_Bool _bForeignDevice, sal_Bool _bDrawSelections)
{
Point aOverallAreaPos = _bForeignDevice ? _rRect.TopLeft() : Point(0,0);
Size aOverallAreaSize = _bForeignDevice ? _rRect.GetSize() : GetDataWindow().GetOutputSizePixel();
@@ -920,8 +920,8 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL
long nDataRowHeigt = GetDataRowHeight();
// compute relative rows to redraw
- ULONG nRelTopRow = _bForeignDevice ? 0 : ((ULONG)_rRect.Top() / nDataRowHeigt);
- ULONG nRelBottomRow = (ULONG)(_bForeignDevice ? aOverallAreaSize.Height() : _rRect.Bottom()) / nDataRowHeigt;
+ sal_uLong nRelTopRow = _bForeignDevice ? 0 : ((sal_uLong)_rRect.Top() / nDataRowHeigt);
+ sal_uLong nRelBottomRow = (sal_uLong)(_bForeignDevice ? aOverallAreaSize.Height() : _rRect.Bottom()) / nDataRowHeigt;
// cache frequently used values
Point aPos( aOverallAreaPos.X(), nRelTopRow * nDataRowHeigt + aOverallAreaPos.Y() );
@@ -939,18 +939,18 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL
Color aDelimiterLineColor( ::svtools::ColorConfig().GetColorValue( ::svtools::CALCGRID ).nColor );
// redraw the invalid fields
- for ( ULONG nRelRow = nRelTopRow;
- nRelRow <= nRelBottomRow && (ULONG)nTopRow+nRelRow < (ULONG)nRowCount;
+ for ( sal_uLong nRelRow = nRelTopRow;
+ nRelRow <= nRelBottomRow && (sal_uLong)nTopRow+nRelRow < (sal_uLong)nRowCount;
++nRelRow, aPos.Y() += nDataRowHeigt )
{
// get row
// Zur Sicherheit auf zul"assigen Bereich abfragen:
- DBG_ASSERT( (USHORT)(nTopRow+nRelRow) < nRowCount, "BrowseBox::ImplPaintData: invalid seek" );
- if ( (nTopRow+long(nRelRow)) < 0 || (USHORT)(nTopRow+nRelRow) >= nRowCount )
+ DBG_ASSERT( (sal_uInt16)(nTopRow+nRelRow) < nRowCount, "BrowseBox::ImplPaintData: invalid seek" );
+ if ( (nTopRow+long(nRelRow)) < 0 || (sal_uInt16)(nTopRow+nRelRow) >= nRowCount )
continue;
// prepare row
- ULONG nRow = nTopRow+nRelRow;
+ sal_uLong nRow = nTopRow+nRelRow;
if ( !SeekRow( nRow) ) {
OSL_FAIL("BrowseBox::ImplPaintData: SeekRow gescheitert");
}
@@ -964,7 +964,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL
Size( _rRect.GetSize().Width(), nDataRowHeigt ) );
PaintRow( _rOut, aRowRect );
- BOOL bRowSelected = _bDrawSelections
+ sal_Bool bRowSelected = _bDrawSelections
&& !bHideSelect
&& IsRowSelected( nRow );
if ( bRowSelected )
@@ -1000,7 +1000,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL
}
// prepare Column-AutoHighlight
- BOOL bColAutoHighlight = _bDrawSelections
+ sal_Bool bColAutoHighlight = _bDrawSelections
&& bColumnCursor
&& IsColumnSelected( pCol->GetId() );
if ( bColAutoHighlight )
@@ -1014,7 +1014,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL
_rOut.DrawRect( aFieldRect );
}
- if (!m_bFocusOnlyCursor && (pCol->GetId() == GetCurColumnId()) && (nRow == (ULONG)GetCurRow()))
+ if (!m_bFocusOnlyCursor && (pCol->GetId() == GetCurColumnId()) && (nRow == (sal_uLong)GetCurRow()))
DrawCursor();
// draw a single field
@@ -1040,7 +1040,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL
Region aClipToField(Rectangle(aPos, aFieldSize));
_rOut.SetClipRegion(aClipToField);
}
- pCol->Draw( *this, _rOut, aPos, FALSE );
+ pCol->Draw( *this, _rOut, aPos, sal_False );
if (_bForeignDevice)
_rOut.SetClipRegion();
}
@@ -1165,7 +1165,7 @@ void BrowseBox::PaintData( Window& rWin, const Rectangle& rRect )
Resize();
// MI: wer war das denn? Window::Update();
- ImplPaintData(rWin, rRect, FALSE, TRUE);
+ ImplPaintData(rWin, rRect, sal_False, sal_True);
}
//-------------------------------------------------------------------
@@ -1181,19 +1181,19 @@ void BrowseBox::UpdateScrollbars()
BrowserDataWin *pBDW = (BrowserDataWin*) pDataWin;
if ( pBDW->bInUpdateScrollbars )
{
- pBDW->bHadRecursion = TRUE;
+ pBDW->bHadRecursion = sal_True;
return;
}
- pBDW->bInUpdateScrollbars = TRUE;
+ pBDW->bInUpdateScrollbars = sal_True;
// the size of the corner window (and the width of the VSB/height of the HSB)
- ULONG nCornerSize = GetSettings().GetStyleSettings().GetScrollBarSize();
+ sal_uLong nCornerSize = GetSettings().GetStyleSettings().GetScrollBarSize();
if (IsZoom())
- nCornerSize = (ULONG)(nCornerSize * (double)GetZoom());
+ nCornerSize = (sal_uLong)(nCornerSize * (double)GetZoom());
// needs VScroll?
long nMaxRows = (pDataWin->GetSizePixel().Height()) / GetDataRowHeight();
- BOOL bNeedsVScroll = getDataWindow()->bAutoVScroll
+ sal_Bool bNeedsVScroll = getDataWindow()->bAutoVScroll
? nTopRow || ( nRowCount > nMaxRows )
: !getDataWindow()->bNoVScroll;
Size aDataWinSize = pDataWin->GetSizePixel();
@@ -1215,10 +1215,10 @@ void BrowseBox::UpdateScrollbars()
}
// needs HScroll?
- ULONG nLastCol = GetColumnAtXPosPixel( aDataWinSize.Width() - 1 );
+ sal_uLong nLastCol = GetColumnAtXPosPixel( aDataWinSize.Width() - 1 );
- USHORT nFrozenCols = FrozenColCount();
- BOOL bNeedsHScroll = getDataWindow()->bAutoHScroll
+ sal_uInt16 nFrozenCols = FrozenColCount();
+ sal_Bool bNeedsHScroll = getDataWindow()->bAutoHScroll
? ( nFirstCol > nFrozenCols ) || ( nLastCol <= pCols->size() )
: !getDataWindow()->bNoHScroll;
if ( !bNeedsHScroll )
@@ -1239,7 +1239,7 @@ void BrowseBox::UpdateScrollbars()
}
// adjust position and Width of horizontal scrollbar
- ULONG nHScrX = nControlAreaWidth == USHRT_MAX
+ sal_uLong nHScrX = nControlAreaWidth == USHRT_MAX
? 0
: nControlAreaWidth;
@@ -1290,7 +1290,7 @@ void BrowseBox::UpdateScrollbars()
// needs corner-window?
// (do that AFTER positioning BOTH scrollbars)
- ULONG nActualCorderWidth = 0;
+ sal_uLong nActualCorderWidth = 0;
if (aHScroll.IsVisible() && pVScroll && pVScroll->IsVisible() )
{
// if we have both scrollbars, the corner window fills the point of intersection of these two
@@ -1330,21 +1330,21 @@ void BrowseBox::UpdateScrollbars()
getDataWindow()->pHeaderBar->SetOffset( nWidth );
}
- pBDW->bInUpdateScrollbars = FALSE;
+ pBDW->bInUpdateScrollbars = sal_False;
if ( pBDW->bHadRecursion )
{
- pBDW->bHadRecursion = FALSE;
+ pBDW->bHadRecursion = sal_False;
UpdateScrollbars();
}
}
//-------------------------------------------------------------------
-void BrowseBox::SetUpdateMode( BOOL bUpdate )
+void BrowseBox::SetUpdateMode( sal_Bool bUpdate )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
- BOOL bWasUpdate = IsUpdateMode();
+ sal_Bool bWasUpdate = IsUpdateMode();
if ( bWasUpdate == bUpdate )
return;
@@ -1372,7 +1372,7 @@ void BrowseBox::SetUpdateMode( BOOL bUpdate )
//-------------------------------------------------------------------
-BOOL BrowseBox::GetUpdateMode() const
+sal_Bool BrowseBox::GetUpdateMode() const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -1395,7 +1395,7 @@ long BrowseBox::GetFrozenWidth() const
//-------------------------------------------------------------------
-void BrowseBox::ColumnInserted( USHORT nPos )
+void BrowseBox::ColumnInserted( sal_uInt16 nPos )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -1406,10 +1406,10 @@ void BrowseBox::ColumnInserted( USHORT nPos )
//-------------------------------------------------------------------
-USHORT BrowseBox::FrozenColCount() const
+sal_uInt16 BrowseBox::FrozenColCount() const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
- USHORT nCol;
+ sal_uInt16 nCol;
for ( nCol = 0;
nCol < pCols->size() && (*pCols)[ nCol ]->IsFrozen();
++nCol )
@@ -1498,7 +1498,7 @@ void BrowseBox::MouseButtonDown( const MouseEvent& rEvt )
if ( pCol->GetId() && Abs( nR - rEvtPos.X() ) < 2 )
{
// start resizing the column
- bResizing = TRUE;
+ bResizing = sal_True;
nResizeCol = nCol;
nDragX = nResizeX = rEvtPos.X();
SetPointer( Pointer( POINTER_HSPLIT ) );
@@ -1521,7 +1521,7 @@ void BrowseBox::MouseButtonDown( const MouseEvent& rEvt )
// event occurred out of data area
if ( rEvt.IsRight() )
pDataWin->Command(
- CommandEvent( Point( 1, LONG_MAX ), COMMAND_CONTEXTMENU, TRUE ) );
+ CommandEvent( Point( 1, LONG_MAX ), COMMAND_CONTEXTMENU, sal_True ) );
else
SetNoSelection();
}
@@ -1539,17 +1539,17 @@ void BrowseBox::MouseMove( const MouseEvent& rEvt )
Pointer aNewPointer;
- USHORT nX = 0;
+ sal_uInt16 nX = 0;
for ( size_t nCol = 0;
nCol < pCols->size() &&
- ( nX + (*pCols)[ nCol ]->Width() ) < USHORT(GetOutputSizePixel().Width());
+ ( nX + (*pCols)[ nCol ]->Width() ) < sal_uInt16(GetOutputSizePixel().Width());
++nCol )
// is this column visible?
if ( (*pCols)[ nCol ]->IsFrozen() || nCol >= nFirstCol )
{
// compute right end of column
BrowserColumn *pCol = (*pCols)[ nCol ];
- USHORT nR = (USHORT)(nX + pCol->Width() - 1);
+ sal_uInt16 nR = (sal_uInt16)(nX + pCol->Width() - 1);
// show resize-pointer?
if ( bResizing || ( pCol->GetId() &&
@@ -1564,8 +1564,8 @@ void BrowseBox::MouseMove( const MouseEvent& rEvt )
// erlaubte breite abholen und neues Delta
nDragX = Max( rEvt.GetPosPixel().X(), nMinResizeX );
long nDeltaX = nDragX - nResizeX;
- USHORT nId = GetColumnId(nResizeCol);
- ULONG nOldWidth = GetColumnWidth(nId);
+ sal_uInt16 nId = GetColumnId(nResizeCol);
+ sal_uLong nOldWidth = GetColumnWidth(nId);
nDragX = QueryColumnResize( GetColumnId(nResizeCol),
nOldWidth + nDeltaX )
+ nResizeX - nOldWidth;
@@ -1603,7 +1603,7 @@ void BrowseBox::MouseButtonUp( const MouseEvent & rEvt )
long nMaxX = pDataWin->GetSizePixel().Width();
nDragX = Min( nDragX, nMaxX );
long nDeltaX = nDragX - nResizeX;
- USHORT nId = GetColumnId(nResizeCol);
+ sal_uInt16 nId = GetColumnId(nResizeCol);
SetColumnWidth( GetColumnId(nResizeCol), GetColumnWidth(nId) + nDeltaX );
ColumnResized( nId );
}
@@ -1611,7 +1611,7 @@ void BrowseBox::MouseButtonUp( const MouseEvent & rEvt )
// end action
SetPointer( Pointer() );
ReleaseMouse();
- bResizing = FALSE;
+ bResizing = sal_False;
}
else
MouseButtonUp( BrowserMouseEvent( (BrowserDataWin*)pDataWin,
@@ -1623,8 +1623,8 @@ void BrowseBox::MouseButtonUp( const MouseEvent & rEvt )
//-------------------------------------------------------------------
-BOOL bExtendedMode = FALSE;
-BOOL bFieldMode = FALSE;
+sal_Bool bExtendedMode = sal_False;
+sal_Bool bFieldMode = sal_False;
void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
{
@@ -1639,14 +1639,14 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
if ( rEvt.GetRow() >= 0 )
{
GoToRow( rEvt.GetRow() );
- SelectRow( rEvt.GetRow(), TRUE, FALSE );
+ SelectRow( rEvt.GetRow(), sal_True, sal_False );
}
else
{
if ( bColumnCursor && rEvt.GetColumn() != 0 )
{
if ( rEvt.GetColumn() < pCols->size() )
- SelectColumnPos( rEvt.GetColumn(), TRUE, FALSE);
+ SelectColumnPos( rEvt.GetColumn(), sal_True, sal_False);
}
}
DoubleClick( rEvt );
@@ -1658,7 +1658,7 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
if ( rEvt.GetClicks() == 1 )
{
// initialise flags
- bHit = FALSE;
+ bHit = sal_False;
a1stPoint =
a2ndPoint = PixelToLogic( rEvt.GetPosPixel() );
@@ -1671,7 +1671,7 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
}
// while selecting, no cursor
- bSelecting = TRUE;
+ bSelecting = sal_True;
DoHideCursor( "MouseButtonDown" );
// DataRow?
@@ -1687,19 +1687,19 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
{
ToggleSelection();
if ( bMultiSelection )
- uRow.pSel->SelectAll(FALSE);
+ uRow.pSel->SelectAll(sal_False);
else
uRow.nSel = BROWSER_ENDOFSELECTION;
if ( pColSel )
- pColSel->SelectAll(FALSE);
- bSelect = TRUE;
+ pColSel->SelectAll(sal_False);
+ bSelect = sal_True;
}
// expanding mode?
if ( rEvt.GetMode() & MOUSE_RANGESELECT )
{
// select the further touched rows too
- bSelect = TRUE;
+ bSelect = sal_True;
ExpandRowSelection( rEvt );
return;
}
@@ -1708,7 +1708,7 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
else if ( IsRowSelected( rEvt.GetRow() ) )
{
// auf Drag&Drop warten
- bHit = TRUE;
+ bHit = sal_True;
bExtendedMode = MOUSE_MULTISELECT ==
( rEvt.GetMode() & MOUSE_MULTISELECT );
return;
@@ -1722,7 +1722,7 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
aSelRange = Range( rEvt.GetRow(), rEvt.GetRow() );
SelectRow( rEvt.GetRow(),
!uRow.pSel->IsSelected( rEvt.GetRow() ) );
- bSelect = TRUE;
+ bSelect = sal_True;
return;
}
}
@@ -1730,9 +1730,9 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
// select directly
SetNoSelection();
GoToRow( rEvt.GetRow() );
- SelectRow( rEvt.GetRow(), TRUE );
+ SelectRow( rEvt.GetRow(), sal_True );
aSelRange = Range( rEvt.GetRow(), rEvt.GetRow() );
- bSelect = TRUE;
+ bSelect = sal_True;
}
else // Column/Field-Selection
{
@@ -1740,14 +1740,14 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
if ( IsColumnSelected( rEvt.GetColumn() ) ||
IsRowSelected( rEvt.GetRow() ) )
{
- bHit = TRUE;
- bFieldMode = TRUE;
+ bHit = sal_True;
+ bFieldMode = sal_True;
return;
}
SetNoSelection();
GoToRowColumnId( rEvt.GetRow(), rEvt.GetColumnId() );
- bSelect = TRUE;
+ bSelect = sal_True;
}
}
else
@@ -1761,11 +1761,11 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
SelectAll();
}
else
- SelectColumnId( rEvt.GetColumnId(), TRUE, FALSE );
+ SelectColumnId( rEvt.GetColumnId(), sal_True, sal_False );
}
// ggf. Cursor wieder an
- bSelecting = FALSE;
+ bSelecting = sal_False;
DoShowCursor( "MouseButtonDown" );
if ( bSelect )
Select();
@@ -1791,7 +1791,7 @@ void BrowseBox::MouseButtonUp( const BrowserMouseEvent &rEvt )
{
aSelRange = Range( rEvt.GetRow(), rEvt.GetRow() );
if ( bExtendedMode )
- SelectRow( rEvt.GetRow(), FALSE );
+ SelectRow( rEvt.GetRow(), sal_False );
else
{
SetNoSelection();
@@ -1800,19 +1800,19 @@ void BrowseBox::MouseButtonUp( const BrowserMouseEvent &rEvt )
else
{
GoToRow( rEvt.GetRow() );
- SelectRow( rEvt.GetRow(), TRUE );
+ SelectRow( rEvt.GetRow(), sal_True );
}
}
- bSelect = TRUE;
- bExtendedMode = FALSE;
- bFieldMode = FALSE;
- bHit = FALSE;
+ bSelect = sal_True;
+ bExtendedMode = sal_False;
+ bFieldMode = sal_False;
+ bHit = sal_False;
}
// activate cursor
if ( bSelecting )
{
- bSelecting = FALSE;
+ bSelecting = sal_False;
DoShowCursor( "MouseButtonUp" );
if ( bSelect )
Select();
@@ -1829,16 +1829,16 @@ void BrowseBox::KeyInput( const KeyEvent& rEvt )
//-------------------------------------------------------------------
-BOOL BrowseBox::ProcessKey( const KeyEvent& rEvt )
+sal_Bool BrowseBox::ProcessKey( const KeyEvent& rEvt )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
- USHORT nCode = rEvt.GetKeyCode().GetCode();
- BOOL bShift = rEvt.GetKeyCode().IsShift();
- BOOL bCtrl = rEvt.GetKeyCode().IsMod1();
- BOOL bAlt = rEvt.GetKeyCode().IsMod2();
+ sal_uInt16 nCode = rEvt.GetKeyCode().GetCode();
+ sal_Bool bShift = rEvt.GetKeyCode().IsShift();
+ sal_Bool bCtrl = rEvt.GetKeyCode().IsMod1();
+ sal_Bool bAlt = rEvt.GetKeyCode().IsMod2();
- USHORT nId = BROWSER_NONE;
+ sal_uInt16 nId = BROWSER_NONE;
if ( !bAlt && !bCtrl && !bShift )
{
@@ -1900,12 +1900,12 @@ BOOL BrowseBox::ProcessKey( const KeyEvent& rEvt )
//-------------------------------------------------------------------
-void BrowseBox::Dispatch( USHORT nId )
+void BrowseBox::Dispatch( sal_uInt16 nId )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
long nRowsOnPage = pDataWin->GetSizePixel().Height() / GetDataRowHeight();
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
switch ( nId )
{
@@ -1916,11 +1916,11 @@ void BrowseBox::Dispatch( USHORT nId )
case BROWSER_CURSORDOWN:
if ( ( GetCurRow() + 1 ) < nRowCount )
- bDone = GoToRow( GetCurRow() + 1, FALSE );
+ bDone = GoToRow( GetCurRow() + 1, sal_False );
break;
case BROWSER_CURSORUP:
if ( GetCurRow() > 0 )
- bDone = GoToRow( GetCurRow() - 1, FALSE );
+ bDone = GoToRow( GetCurRow() - 1, sal_False );
break;
case BROWSER_SELECTHOME:
if ( GetRowCount() )
@@ -1928,7 +1928,7 @@ void BrowseBox::Dispatch( USHORT nId )
DoHideCursor( "BROWSER_SELECTHOME" );
for ( long nRow = GetCurRow(); nRow >= 0; --nRow )
SelectRow( nRow );
- GoToRow( 0, TRUE );
+ GoToRow( 0, sal_True );
DoShowCursor( "BROWSER_SELECTHOME" );
}
break;
@@ -1939,7 +1939,7 @@ void BrowseBox::Dispatch( USHORT nId )
long nRows = GetRowCount();
for ( long nRow = GetCurRow(); nRow < nRows; ++nRow )
SelectRow( nRow );
- GoToRow( GetRowCount() - 1, TRUE );
+ GoToRow( GetRowCount() - 1, sal_True );
DoShowCursor( "BROWSER_SELECTEND" );
}
break;
@@ -1950,12 +1950,12 @@ void BrowseBox::Dispatch( USHORT nId )
// deselect the current row, if it isn't the first
// and there is no other selected row above
long nRow = GetCurRow();
- BOOL bLocalSelect = ( !IsRowSelected( nRow ) ||
+ sal_Bool bLocalSelect = ( !IsRowSelected( nRow ) ||
GetSelectRowCount() == 1 || IsRowSelected( nRow - 1 ) );
- SelectRow( nRow, bLocalSelect, TRUE );
- bDone = GoToRow( GetCurRow() + 1 , FALSE );
+ SelectRow( nRow, bLocalSelect, sal_True );
+ bDone = GoToRow( GetCurRow() + 1 , sal_False );
if ( bDone )
- SelectRow( GetCurRow(), TRUE, TRUE );
+ SelectRow( GetCurRow(), sal_True, sal_True );
}
else
bDone = ScrollRows( 1 ) != 0;
@@ -1967,40 +1967,40 @@ void BrowseBox::Dispatch( USHORT nId )
// deselect the current row, if it isn't the first
// and there is no other selected row under
long nRow = GetCurRow();
- BOOL bLocalSelect = ( !IsRowSelected( nRow ) ||
+ sal_Bool bLocalSelect = ( !IsRowSelected( nRow ) ||
GetSelectRowCount() == 1 || IsRowSelected( nRow + 1 ) );
- SelectRow( nCurRow, bLocalSelect, TRUE );
- bDone = GoToRow( nRow - 1 , FALSE );
+ SelectRow( nCurRow, bLocalSelect, sal_True );
+ bDone = GoToRow( nRow - 1 , sal_False );
if ( bDone )
- SelectRow( GetCurRow(), TRUE, TRUE );
+ SelectRow( GetCurRow(), sal_True, sal_True );
}
break;
case BROWSER_CURSORPAGEDOWN:
- bDone = (BOOL)ScrollRows( nRowsOnPage );
+ bDone = (sal_Bool)ScrollRows( nRowsOnPage );
break;
case BROWSER_CURSORPAGEUP:
- bDone = (BOOL)ScrollRows( -nRowsOnPage );
+ bDone = (sal_Bool)ScrollRows( -nRowsOnPage );
break;
case BROWSER_CURSOREND:
if ( bColumnCursor )
{
- USHORT nNewId = GetColumnId(ColCount() -1);
+ sal_uInt16 nNewId = GetColumnId(ColCount() -1);
bDone = (nNewId != 0) && GoToColumnId( nNewId );
break;
}
case BROWSER_CURSORENDOFFILE:
- bDone = GoToRow( nRowCount - 1, FALSE );
+ bDone = GoToRow( nRowCount - 1, sal_False );
break;
case BROWSER_CURSORRIGHT:
if ( bColumnCursor )
{
- USHORT nNewPos = GetColumnPos( GetCurColumnId() ) + 1;
- USHORT nNewId = GetColumnId( nNewPos );
+ sal_uInt16 nNewPos = GetColumnPos( GetCurColumnId() ) + 1;
+ sal_uInt16 nNewId = GetColumnId( nNewPos );
if (nNewId != 0) // Am Zeilenende ?
bDone = GoToColumnId( nNewId );
else
{
- USHORT nColId = ( GetColumnId(0) == 0 ) ? GetColumnId(1) : GetColumnId(0);
+ sal_uInt16 nColId = ( GetColumnId(0) == 0 ) ? GetColumnId(1) : GetColumnId(0);
if ( GetRowCount() )
bDone = ( nCurRow < GetRowCount() - 1 ) && GoToRowColumnId( nCurRow + 1, nColId );
else if ( ColCount() )
@@ -2013,18 +2013,18 @@ void BrowseBox::Dispatch( USHORT nId )
case BROWSER_CURSORHOME:
if ( bColumnCursor )
{
- USHORT nNewId = GetColumnId(1);
+ sal_uInt16 nNewId = GetColumnId(1);
bDone = (nNewId != 0) && GoToColumnId( nNewId );
break;
}
case BROWSER_CURSORTOPOFFILE:
- bDone = GoToRow( 0, FALSE );
+ bDone = GoToRow( 0, sal_False );
break;
case BROWSER_CURSORLEFT:
if ( bColumnCursor )
{
- USHORT nNewPos = GetColumnPos( GetCurColumnId() ) - 1;
- USHORT nNewId = GetColumnId( nNewPos );
+ sal_uInt16 nNewPos = GetColumnPos( GetCurColumnId() ) - 1;
+ sal_uInt16 nNewId = GetColumnId( nNewPos );
if (nNewId != 0)
bDone = GoToColumnId( nNewId );
else
@@ -2040,13 +2040,13 @@ void BrowseBox::Dispatch( USHORT nId )
break;
case BROWSER_ENHANCESELECTION:
if ( GetRowCount() )
- SelectRow( GetCurRow(), !IsRowSelected( GetCurRow() ), TRUE );
- bDone = TRUE;
+ SelectRow( GetCurRow(), !IsRowSelected( GetCurRow() ), sal_True );
+ bDone = sal_True;
break;
case BROWSER_SELECT:
if ( GetRowCount() )
- SelectRow( GetCurRow(), !IsRowSelected( GetCurRow() ), FALSE );
- bDone = TRUE;
+ SelectRow( GetCurRow(), !IsRowSelected( GetCurRow() ), sal_False );
+ bDone = sal_True;
break;
case BROWSER_MOVECOLUMNLEFT:
case BROWSER_MOVECOLUMNRIGHT:
@@ -2054,20 +2054,20 @@ void BrowseBox::Dispatch( USHORT nId )
BrowserHeader* pHeaderBar = getDataWindow()->pHeaderBar;
if ( pHeaderBar && pHeaderBar->IsDragable() )
{
- USHORT nColId = GetCurColumnId();
- BOOL bColumnSelected = IsColumnSelected(nColId);
- USHORT nNewPos = GetColumnPos(nColId);
- BOOL bMoveAllowed = FALSE;
+ sal_uInt16 nColId = GetCurColumnId();
+ sal_Bool bColumnSelected = IsColumnSelected(nColId);
+ sal_uInt16 nNewPos = GetColumnPos(nColId);
+ sal_Bool bMoveAllowed = sal_False;
if ( BROWSER_MOVECOLUMNLEFT == nId && nNewPos > 1 )
- --nNewPos,bMoveAllowed = TRUE;
+ --nNewPos,bMoveAllowed = sal_True;
else if ( BROWSER_MOVECOLUMNRIGHT == nId && nNewPos < (ColCount()-1) )
- ++nNewPos,bMoveAllowed = TRUE;
+ ++nNewPos,bMoveAllowed = sal_True;
if ( bMoveAllowed )
{
SetColumnPos( nColId, nNewPos );
ColumnMoved( nColId );
- MakeFieldVisible(GetCurRow(),nColId,TRUE);
+ MakeFieldVisible(GetCurRow(),nColId,sal_True);
if ( bColumnSelected )
SelectColumnId(nColId);
}
@@ -2098,7 +2098,7 @@ void BrowseBox::SetCursorColor(const Color& _rCol)
DoShowCursor("SetCursorColor");
}
// -----------------------------------------------------------------------------
-Rectangle BrowseBox::calcHeaderRect(sal_Bool _bIsColumnBar,BOOL _bOnScreen)
+Rectangle BrowseBox::calcHeaderRect(sal_Bool _bIsColumnBar,sal_Bool _bOnScreen)
{
Window* pParent = NULL;
if ( !_bOnScreen )
@@ -2122,14 +2122,14 @@ Rectangle BrowseBox::calcHeaderRect(sal_Bool _bIsColumnBar,BOOL _bOnScreen)
return Rectangle(aTopLeft,Size(nWidth,nHeight));
}
// -----------------------------------------------------------------------------
-Rectangle BrowseBox::calcTableRect(BOOL _bOnScreen)
+Rectangle BrowseBox::calcTableRect(sal_Bool _bOnScreen)
{
Window* pParent = NULL;
if ( !_bOnScreen )
pParent = GetAccessibleParentWindow();
Rectangle aRect( GetWindowExtentsRelative( pParent ) );
- Rectangle aRowBar = calcHeaderRect(FALSE,pParent == NULL);
+ Rectangle aRowBar = calcHeaderRect(sal_False,pParent == NULL);
long nX = aRowBar.Right() - aRect.Left();
long nY = aRowBar.Top() - aRect.Top();
@@ -2138,7 +2138,7 @@ Rectangle BrowseBox::calcTableRect(BOOL _bOnScreen)
return Rectangle(aRowBar.TopRight(), Size(aSize.A() - nX, aSize.B() - nY - aHScroll.GetSizePixel().Height()) );
}
// -----------------------------------------------------------------------------
-Rectangle BrowseBox::GetFieldRectPixelAbs( sal_Int32 _nRowId,sal_uInt16 _nColId, BOOL /*_bIsHeader*/, BOOL _bOnScreen )
+Rectangle BrowseBox::GetFieldRectPixelAbs( sal_Int32 _nRowId,sal_uInt16 _nColId, sal_Bool /*_bIsHeader*/, sal_Bool _bOnScreen )
{
Window* pParent = NULL;
if ( !_bOnScreen )
diff --git a/svtools/source/brwbox/brwbox3.cxx b/svtools/source/brwbox/brwbox3.cxx
index 50634845a55f..929aa3303a77 100644
--- a/svtools/source/brwbox/brwbox3.cxx
+++ b/svtools/source/brwbox/brwbox3.cxx
@@ -173,7 +173,7 @@ sal_Int32 BrowseBox::GetAccessibleControlCount() const
Reference< XAccessible > BrowseBox::CreateAccessibleControl( sal_Int32 )
{
- DBG_ASSERT( FALSE, "BrowseBox::CreateAccessibleControl: to be overwritten!" );
+ DBG_ASSERT( sal_False, "BrowseBox::CreateAccessibleControl: to be overwritten!" );
return NULL;
}
// -----------------------------------------------------------------------------
@@ -193,7 +193,7 @@ sal_Bool BrowseBox::ConvertPointToCellAddress(
sal_Bool BrowseBox::ConvertPointToRowHeader( sal_Int32& rnRow, const Point& rPoint )
{
rnRow = GetRowAtYPosPixel(rPoint.Y());
- // USHORT nColumnId = GetColumnAtXPosPixel(rPoint.X());
+ // sal_uInt16 nColumnId = GetColumnAtXPosPixel(rPoint.X());
return rnRow != BROWSER_INVALIDID;// && nColumnId == 0;
}
// -----------------------------------------------------------------------------
@@ -398,7 +398,7 @@ void BrowseBox::GrabTableFocus()
GrabFocus();
}
// -----------------------------------------------------------------------------
-String BrowseBox::GetCellText(long, USHORT ) const
+String BrowseBox::GetCellText(long, sal_uInt16 ) const
{
DBG_ASSERT(0,"This method has to be implemented by the derived classes! BUG!!");
return String();
@@ -460,7 +460,7 @@ sal_Bool BrowseBox::IsCellFocusable() const
return sal_True;
}
// -----------------------------------------------------------------------------
-BOOL BrowseBox::GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn )
+sal_Bool BrowseBox::GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn )
{
return GoToRowColumnId( _nRow, GetColumnId( _nColumn ) );
}
@@ -532,13 +532,13 @@ sal_Bool BrowseBox::IsCellVisible( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) con
return IsFieldVisible( _nRow, GetColumnId( _nColumnPos ) );
}
// -----------------------------------------------------------------------------
-String BrowseBox::GetAccessibleCellText(long _nRow, USHORT _nColPos) const
+String BrowseBox::GetAccessibleCellText(long _nRow, sal_uInt16 _nColPos) const
{
return GetCellText( _nRow, GetColumnId( _nColPos ) );
}
// -----------------------------------------------------------------------------
-BOOL BrowseBox::GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector )
+sal_Bool BrowseBox::GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector )
{
return Control::GetGlyphBoundRects( rOrigin, rStr, nIndex, nLen, nBase, rVector );
}
@@ -553,7 +553,7 @@ void BrowseBox::GrabFocus()
Control::GrabFocus();
}
// -----------------------------------------------------------------------------
-Reference< XAccessible > BrowseBox::GetAccessible( BOOL bCreate )
+Reference< XAccessible > BrowseBox::GetAccessible( sal_Bool bCreate )
{
return Control::GetAccessible( bCreate );
}
diff --git a/svtools/source/brwbox/brwhead.cxx b/svtools/source/brwbox/brwhead.cxx
index d1fcaec5e9be..a0a0f01f8251 100644
--- a/svtools/source/brwbox/brwhead.cxx
+++ b/svtools/source/brwbox/brwhead.cxx
@@ -77,7 +77,7 @@ void BrowserHeader::EndDrag()
Update();
// not aborted?
- USHORT nId = GetCurItemId();
+ sal_uInt16 nId = GetCurItemId();
if ( nId )
{
// Handle-Column?
@@ -96,7 +96,7 @@ void BrowserHeader::EndDrag()
// column drag
// Hat sich die Position eigentlich veraendert
// Handlecolumn beruecksichtigen
- USHORT nOldPos = _pBrowseBox->GetColumnPos(nId),
+ sal_uInt16 nOldPos = _pBrowseBox->GetColumnPos(nId),
nNewPos = GetItemPos( nId );
if (!_pBrowseBox->GetColumnId(0)) // Handle
diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx
index be3ae263d34f..f944908c269d 100644
--- a/svtools/source/brwbox/datwin.cxx
+++ b/svtools/source/brwbox/datwin.cxx
@@ -57,7 +57,7 @@ void ButtonFrame::Draw( OutputDevice& rDev )
{
Window *pWin = (Window*) &rDev;
if( bPressed )
- pWin->DrawSelectionBackground( aRect, 0, TRUE, FALSE, FALSE );
+ pWin->DrawSelectionBackground( aRect, 0, sal_True, sal_False, sal_False );
}
else
{
@@ -74,10 +74,10 @@ void ButtonFrame::Draw( OutputDevice& rDev )
String aVal = rDev.GetEllipsisString(aText,aInnerRect.GetWidth() - 2*MIN_COLUMNWIDTH);
Font aFont( rDev.GetFont() );
- BOOL bOldTransp = aFont.IsTransparent();
+ sal_Bool bOldTransp = aFont.IsTransparent();
if ( !bOldTransp )
{
- aFont.SetTransparent( TRUE );
+ aFont.SetTransparent( sal_True );
rDev.SetFont( aFont );
}
@@ -92,7 +92,7 @@ void ButtonFrame::Draw( OutputDevice& rDev )
// restore settings
if ( !bOldTransp )
{
- aFont.SetTransparent(FALSE);
+ aFont.SetTransparent(sal_False);
rDev.SetFont( aFont );
}
if (m_bDrawDisabled)
@@ -113,14 +113,14 @@ void ButtonFrame::Draw( OutputDevice& rDev )
//-------------------------------------------------------------------
-BrowserColumn::BrowserColumn( USHORT nItemId, const class Image &rImage,
- const String& rTitle, ULONG nWidthPixel, const Fraction& rCurrentZoom,
+BrowserColumn::BrowserColumn( sal_uInt16 nItemId, const class Image &rImage,
+ const String& rTitle, sal_uLong nWidthPixel, const Fraction& rCurrentZoom,
HeaderBarItemBits nFlags )
: _nId( nItemId ),
_nWidth( nWidthPixel ),
_aImage( rImage ),
_aTitle( rTitle ),
- _bFrozen( FALSE ),
+ _bFrozen( sal_False ),
_nFlags( nFlags )
{
double n = (double)_nWidth;
@@ -135,7 +135,7 @@ BrowserColumn::~BrowserColumn()
//-------------------------------------------------------------------
-void BrowserColumn::SetWidth(ULONG nNewWidthPixel, const Fraction& rCurrentZoom)
+void BrowserColumn::SetWidth(sal_uLong nNewWidthPixel, const Fraction& rCurrentZoom)
{
_nWidth = nNewWidthPixel;
double n = (double)_nWidth;
@@ -146,13 +146,13 @@ void BrowserColumn::SetWidth(ULONG nNewWidthPixel, const Fraction& rCurrentZoom)
//-------------------------------------------------------------------
-void BrowserColumn::Draw( BrowseBox& rBox, OutputDevice& rDev, const Point& rPos, BOOL bCurs )
+void BrowserColumn::Draw( BrowseBox& rBox, OutputDevice& rDev, const Point& rPos, sal_Bool bCurs )
{
if ( _nId == 0 )
{
// paint handle column
ButtonFrame( rPos, Size( Width()-1, rBox.GetDataRowHeight()-1 ),
- String(), FALSE, bCurs,
+ String(), sal_False, bCurs,
0 != (BROWSER_COLUMN_TITLEABBREVATION&_nFlags) ).Draw( rDev );
Color aOldLineColor = rDev.GetLineColor();
rDev.SetLineColor( Color( COL_BLACK ) );
@@ -206,18 +206,18 @@ BrowserDataWin::BrowserDataWin( BrowseBox* pParent )
,pEventWin( pParent )
,pCornerWin( 0 )
,pDtorNotify( 0 )
- ,bInPaint( FALSE )
- ,bInCommand( FALSE )
- ,bNoScrollBack( FALSE )
- ,bNoHScroll( FALSE )
- ,bNoVScroll( FALSE )
- ,bUpdateMode( TRUE )
- ,bResizeOnPaint( FALSE )
- ,bUpdateOnUnlock( FALSE )
- ,bInUpdateScrollbars( FALSE )
- ,bHadRecursion( FALSE )
- ,bOwnDataChangedHdl( FALSE )
- ,bCallingDropCallback( FALSE )
+ ,bInPaint( sal_False )
+ ,bInCommand( sal_False )
+ ,bNoScrollBack( sal_False )
+ ,bNoHScroll( sal_False )
+ ,bNoVScroll( sal_False )
+ ,bUpdateMode( sal_True )
+ ,bResizeOnPaint( sal_False )
+ ,bUpdateOnUnlock( sal_False )
+ ,bInUpdateScrollbars( sal_False )
+ ,bHadRecursion( sal_False )
+ ,bOwnDataChangedHdl( sal_False )
+ ,bCallingDropCallback( sal_False )
,nUpdateLock( 0 )
,nCursorHidden( 0 )
,m_nDragRowDividerLimit( 0 )
@@ -231,7 +231,7 @@ BrowserDataWin::BrowserDataWin( BrowseBox* pParent )
BrowserDataWin::~BrowserDataWin()
{
if( pDtorNotify )
- *pDtorNotify = TRUE;
+ *pDtorNotify = sal_True;
for ( size_t i = 0, n = aInvalidRegion.size(); i < n; ++i )
delete aInvalidRegion[ i ];
@@ -247,14 +247,14 @@ void BrowserDataWin::LeaveUpdateLock()
if (bUpdateOnUnlock )
{
Control::Update();
- bUpdateOnUnlock = FALSE;
+ bUpdateOnUnlock = sal_False;
}
}
}
//-------------------------------------------------------------------
void InitSettings_Impl( Window *pWin,
- BOOL bFont, BOOL bForeground, BOOL bBackground )
+ sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings =
pWin->GetSettings().GetStyleSettings();
@@ -290,7 +290,7 @@ void BrowserDataWin::Update()
if ( !nUpdateLock )
Control::Update();
else
- bUpdateOnUnlock = TRUE;
+ bUpdateOnUnlock = sal_True;
}
//-------------------------------------------------------------------
@@ -301,9 +301,9 @@ void BrowserDataWin::DataChanged( const DataChangedEvent& rDCEvt )
{
if( !bOwnDataChangedHdl )
{
- InitSettings_Impl( this, TRUE, TRUE, TRUE );
+ InitSettings_Impl( this, sal_True, sal_True, sal_True );
Invalidate();
- InitSettings_Impl( GetParent(), TRUE, TRUE, TRUE );
+ InitSettings_Impl( GetParent(), sal_True, sal_True, sal_True );
GetParent()->Invalidate();
GetParent()->Resize();
}
@@ -322,9 +322,9 @@ void BrowserDataWin::Paint( const Rectangle& rRect )
aInvalidRegion.push_back( new Rectangle( rRect ) );
return;
}
- bInPaint = TRUE;
+ bInPaint = sal_True;
( (BrowseBox*) GetParent() )->PaintData( *this, rRect );
- bInPaint = FALSE;
+ bInPaint = sal_False;
DoOutstandingInvalidations();
}
else
@@ -356,7 +356,7 @@ BrowseEvent BrowserDataWin::CreateBrowseEvent( const Point& rPosPixel )
if ( nMouseX < nColX )
break;
}
- USHORT nColId = BROWSER_INVALIDID;
+ sal_uInt16 nColId = BROWSER_INVALIDID;
if ( nCol < pBox->pCols->size() )
nColId = (*pBox->pCols)[ nCol ]->GetId();
@@ -418,14 +418,14 @@ void BrowserDataWin::Command( const CommandEvent& rEvt )
return;
Point aEventPos( rEvt.GetMousePosPixel() );
- long nRow = pBox->GetRowAtYPosPixel( aEventPos.Y(), FALSE);
+ long nRow = pBox->GetRowAtYPosPixel( aEventPos.Y(), sal_False);
MouseEvent aMouseEvt( aEventPos, 1, MOUSE_SELECT, MOUSE_LEFT );
if ( COMMAND_CONTEXTMENU == rEvt.GetCommand() && rEvt.IsMouseEvent() &&
nRow < pBox->GetRowCount() && !pBox->IsRowSelected(nRow) )
{
- BOOL bDeleted = FALSE;
+ sal_Bool bDeleted = sal_False;
pDtorNotify = &bDeleted;
- bInCommand = TRUE;
+ bInCommand = sal_True;
MouseButtonDown( aMouseEvt );
if( bDeleted )
return;
@@ -433,20 +433,20 @@ void BrowserDataWin::Command( const CommandEvent& rEvt )
if( bDeleted )
return;
pDtorNotify = 0;
- bInCommand = FALSE;
+ bInCommand = sal_False;
}
aEventPos.Y() += GetParent()->GetTitleHeight();
CommandEvent aEvt( aEventPos, rEvt.GetCommand(),
rEvt.IsMouseEvent(), rEvt.GetData() );
- bInCommand = TRUE;
- BOOL bDeleted = FALSE;
+ bInCommand = sal_True;
+ sal_Bool bDeleted = sal_False;
pDtorNotify = &bDeleted;
GetParent()->Command( aEvt );
if( bDeleted )
return;
pDtorNotify = 0;
- bInCommand = FALSE;
+ bInCommand = sal_False;
if ( COMMAND_STARTDRAG == rEvt.GetCommand() )
MouseButtonUp( aMouseEvt );
@@ -456,7 +456,7 @@ void BrowserDataWin::Command( const CommandEvent& rEvt )
//-------------------------------------------------------------------
-BOOL BrowserDataWin::ImplRowDividerHitTest( const BrowserMouseEvent& _rEvent )
+sal_Bool BrowserDataWin::ImplRowDividerHitTest( const BrowserMouseEvent& _rEvent )
{
if ( ! ( GetParent()->IsInteractiveRowHeightEnabled()
&& ( _rEvent.GetRow() >= 0 )
@@ -464,7 +464,7 @@ BOOL BrowserDataWin::ImplRowDividerHitTest( const BrowserMouseEvent& _rEvent )
&& ( _rEvent.GetColumnId() == 0 )
)
)
- return FALSE;
+ return sal_False;
long nDividerDistance = GetParent()->GetDataRowHeight() - ( _rEvent.GetPosPixel().Y() % GetParent()->GetDataRowHeight() );
return ( nDividerDistance <= 4 );
@@ -564,7 +564,7 @@ void BrowserDataWin::StartRowDividerDrag( const Point& _rStartPos )
m_nDragRowDividerLimit = nDragRowDividerCurrentPos - nDataRowHeight;
- GetParent()->bRowDividerDrag = TRUE;
+ GetParent()->bRowDividerDrag = sal_True;
GetParent()->ImplStartTracking();
Rectangle aDragSplitRect( 0, m_nDragRowDividerLimit, GetOutputSizePixel().Width(), nDragRowDividerCurrentPos );
@@ -588,7 +588,7 @@ void BrowserDataWin::Tracking( const TrackingEvent& rTEvt )
if ( rTEvt.IsTrackingEnded() )
{
HideTracking();
- GetParent()->bRowDividerDrag = FALSE;
+ GetParent()->bRowDividerDrag = sal_False;
GetParent()->ImplEndTracking();
if ( !rTEvt.IsTrackingCanceled() )
@@ -639,7 +639,7 @@ void BrowserDataWin::RequestHelp( const HelpEvent& rHEvt )
//===================================================================
BrowseEvent::BrowseEvent( Window* pWindow,
- long nAbsRow, USHORT nColumn, USHORT nColumnId,
+ long nAbsRow, sal_uInt16 nColumn, sal_uInt16 nColumnId,
const Rectangle& rRect ):
pWin(pWindow),
nRow(nAbsRow),
@@ -660,7 +660,7 @@ BrowserMouseEvent::BrowserMouseEvent( BrowserDataWin *pWindow,
//-------------------------------------------------------------------
BrowserMouseEvent::BrowserMouseEvent( Window *pWindow, const MouseEvent& rEvt,
- long nAbsRow, USHORT nColumn, USHORT nColumnId,
+ long nAbsRow, sal_uInt16 nColumn, sal_uInt16 nColumnId,
const Rectangle& rRect ):
MouseEvent(rEvt),
BrowseEvent( pWindow, nAbsRow, nColumn, nColumnId, rRect )
@@ -687,7 +687,7 @@ BrowserExecuteDropEvent::BrowserExecuteDropEvent( BrowserDataWin *pWindow, const
//-------------------------------------------------------------------
-void BrowserDataWin::SetUpdateMode( BOOL bMode )
+void BrowserDataWin::SetUpdateMode( sal_Bool bMode )
{
DBG_ASSERT( !bUpdateMode || aInvalidRegion.empty(), "invalid region not empty" );
if ( bMode == bUpdateMode )
@@ -710,7 +710,7 @@ void BrowserDataWin::DoOutstandingInvalidations()
//-------------------------------------------------------------------
-void BrowserDataWin::Invalidate( USHORT nFlags )
+void BrowserDataWin::Invalidate( sal_uInt16 nFlags )
{
if ( !GetUpdateMode() )
{
@@ -725,7 +725,7 @@ void BrowserDataWin::Invalidate( USHORT nFlags )
//-------------------------------------------------------------------
-void BrowserDataWin::Invalidate( const Rectangle& rRect, USHORT nFlags )
+void BrowserDataWin::Invalidate( const Rectangle& rRect, sal_uInt16 nFlags )
{
if ( !GetUpdateMode() )
aInvalidRegion.push_back( new Rectangle( rRect ) );
@@ -737,20 +737,21 @@ void BrowserDataWin::Invalidate( const Rectangle& rRect, USHORT nFlags )
void BrowserScrollBar::Tracking( const TrackingEvent& rTEvt )
{
- ULONG nPos = GetThumbPos();
+ sal_uLong nPos = GetThumbPos();
if ( nPos != _nLastPos )
{
- if ( _nTip )
- Help::HideTip( _nTip );
-
String aTip( String::CreateFromInt32(nPos) );
aTip += '/';
if ( _pDataWin->GetRealRowCount().Len() )
aTip += _pDataWin->GetRealRowCount();
else
aTip += String::CreateFromInt32(GetRangeMax());
+
Rectangle aRect( GetPointerPosPixel(), Size( GetTextHeight(), GetTextWidth( aTip ) ) );
- _nTip = Help::ShowTip( this, aRect, aTip );
+ if ( _nTip )
+ Help::UpdateTip( _nTip, this, aRect, aTip );
+ else
+ _nTip = Help::ShowTip( this, aRect, aTip );
_nLastPos = nPos;
}
diff --git a/svtools/source/brwbox/datwin.hxx b/svtools/source/brwbox/datwin.hxx
index d32dbd69a4bf..1aeb06b6a085 100644
--- a/svtools/source/brwbox/datwin.hxx
+++ b/svtools/source/brwbox/datwin.hxx
@@ -50,18 +50,18 @@ class ButtonFrame
Rectangle aRect;
Rectangle aInnerRect;
String aText;
- BOOL bPressed;
- BOOL bCurs;
- BOOL bAbbr;
- BOOL m_bDrawDisabled;
+ sal_Bool bPressed;
+ sal_Bool bCurs;
+ sal_Bool bAbbr;
+ sal_Bool m_bDrawDisabled;
public:
ButtonFrame( const Point& rPt, const Size& rSz,
const String &rText,
- BOOL bPress = FALSE,
- BOOL bCursor = FALSE,
- BOOL bAbbreviate = TRUE,
- BOOL _bDrawDisabled = FALSE)
+ sal_Bool bPress = sal_False,
+ sal_Bool bCursor = sal_False,
+ sal_Bool bAbbreviate = sal_True,
+ sal_Bool _bDrawDisabled = sal_False)
:aRect( rPt, rSz )
,aInnerRect( Point( aRect.Left()+1, aRect.Top()+1 ),
Size( aRect.GetWidth()-2, aRect.GetHeight()-2 ) )
@@ -80,34 +80,34 @@ public:
class BrowserColumn
{
- USHORT _nId;
- ULONG _nOriginalWidth;
- ULONG _nWidth;
+ sal_uInt16 _nId;
+ sal_uLong _nOriginalWidth;
+ sal_uLong _nWidth;
Image _aImage;
String _aTitle;
- BOOL _bFrozen;
+ sal_Bool _bFrozen;
HeaderBarItemBits _nFlags;
public:
- BrowserColumn( USHORT nItemId, const Image &rImage,
- const String& rTitle, ULONG nWidthPixel, const Fraction& rCurrentZoom,
+ BrowserColumn( sal_uInt16 nItemId, const Image &rImage,
+ const String& rTitle, sal_uLong nWidthPixel, const Fraction& rCurrentZoom,
HeaderBarItemBits nFlags );
virtual ~BrowserColumn();
- USHORT GetId() const { return _nId; }
+ sal_uInt16 GetId() const { return _nId; }
- ULONG Width() { return _nWidth; }
+ sal_uLong Width() { return _nWidth; }
Image& GetImage() { return _aImage; }
String& Title() { return _aTitle; }
HeaderBarItemBits& Flags() { return _nFlags; }
- BOOL IsFrozen() const { return _bFrozen; }
- void Freeze( BOOL bFreeze = TRUE ) { _bFrozen = bFreeze; }
+ sal_Bool IsFrozen() const { return _bFrozen; }
+ void Freeze( sal_Bool bFreeze = sal_True ) { _bFrozen = bFreeze; }
virtual void Draw( BrowseBox& rBox, OutputDevice& rDev,
- const Point& rPos, BOOL bCurs );
+ const Point& rPos, sal_Bool bCurs );
- void SetWidth(ULONG nNewWidthPixel, const Fraction& rCurrentZoom);
+ void SetWidth(sal_uLong nNewWidthPixel, const Fraction& rCurrentZoom);
void ZoomChanged(const Fraction& rNewZoom);
};
@@ -122,7 +122,7 @@ public:
BrowserHeader* pHeaderBar; // only for BROWSER_HEADERBAR_NEW
Window* pEventWin; // Window of forwarded events
ScrollBarBox* pCornerWin; // Window in the corner btw the ScrollBars
- BOOL* pDtorNotify;
+ sal_Bool* pDtorNotify;
AutoTimer aMouseTimer; // recalls MouseMove on dragging out
MouseEvent aRepeatEvt; // a MouseEvent to repeat
Point aLastMousePos; // verhindert pseudo-MouseMoves
@@ -145,7 +145,7 @@ public:
bool bHadRecursion; // Rekursion war aufgetreten
bool bOwnDataChangedHdl; // dont change colors in DataChanged
bool bCallingDropCallback; // we're in a callback to AcceptDrop or ExecuteDrop curently
- USHORT nUpdateLock; // lock count, dont call Control::Update()!
+ sal_uInt16 nUpdateLock; // lock count, dont call Control::Update()!
short nCursorHidden; // new conuter for DoHide/ShowCursor
long m_nDragRowDividerLimit;
@@ -181,20 +181,20 @@ public:
{ return (BrowseBox*) Window::GetParent(); }
const String& GetRealRowCount() const { return aRealRowCount; }
- void SetUpdateMode( BOOL bMode );
+ void SetUpdateMode( sal_Bool bMode );
bool GetUpdateMode() const { return bUpdateMode; }
void EnterUpdateLock() { ++nUpdateLock; }
void LeaveUpdateLock();
void Update();
void DoOutstandingInvalidations();
- void Invalidate( USHORT nFlags = 0 );
- void Invalidate( const Rectangle& rRect, USHORT nFlags = 0 );
- void Invalidate( const Region& rRegion, USHORT nFlags = 0 )
+ void Invalidate( sal_uInt16 nFlags = 0 );
+ void Invalidate( const Rectangle& rRect, sal_uInt16 nFlags = 0 );
+ void Invalidate( const Region& rRegion, sal_uInt16 nFlags = 0 )
{ Control::Invalidate( rRegion, nFlags ); }
protected:
void StartRowDividerDrag( const Point& _rStartPos );
- BOOL ImplRowDividerHitTest( const BrowserMouseEvent& _rEvent );
+ sal_Bool ImplRowDividerHitTest( const BrowserMouseEvent& _rEvent );
};
//-------------------------------------------------------------------
@@ -210,8 +210,8 @@ inline void BrowserDataWin::Repaint()
class BrowserScrollBar: public ScrollBar
{
- ULONG _nTip;
- ULONG _nLastPos;
+ sal_uLong _nTip;
+ sal_uLong _nLastPos;
BrowserDataWin* _pDataWin;
public:
@@ -231,7 +231,7 @@ public:
//===================================================================
void InitSettings_Impl( Window *pWin,
- BOOL bFont = TRUE, BOOL bForeground = TRUE, BOOL bBackground = TRUE );
+ sal_Bool bFont = sal_True, sal_Bool bForeground = sal_True, sal_Bool bBackground = sal_True );
//===================================================================
diff --git a/svtools/source/brwbox/ebbcontrols.cxx b/svtools/source/brwbox/ebbcontrols.cxx
index 4dbf729de3ae..7b679aed53b2 100644
--- a/svtools/source/brwbox/ebbcontrols.cxx
+++ b/svtools/source/brwbox/ebbcontrols.cxx
@@ -81,7 +81,7 @@ namespace svt
nPos = 0;
if (nPos >= GetEntryCount())
nPos = GetEntryCount() - 1;
- SetText(GetEntry(sal::static_int_cast< USHORT >(nPos)));
+ SetText(GetEntry(sal::static_int_cast< sal_uInt16 >(nPos)));
return 1;
}
}
@@ -188,7 +188,7 @@ namespace svt
nPos = 0;
if (nPos >= GetEntryCount())
nPos = GetEntryCount() - 1;
- SelectEntryPos(sal::static_int_cast< USHORT >(nPos));
+ SelectEntryPos(sal::static_int_cast< sal_uInt16 >(nPos));
Select(); // for calling Modify
return 1;
}
@@ -312,7 +312,7 @@ namespace svt
}
//------------------------------------------------------------------
- void CheckBoxControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+ void CheckBoxControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
pBox->Draw(pDev,rPos,rSize,nFlags);
}
@@ -400,7 +400,7 @@ namespace svt
EditCellController::EditCellController( Edit* _pEdit )
:CellController( _pEdit )
,m_pEditImplementation( new EditImplementation( *_pEdit ) )
- ,m_bOwnImplementation( TRUE )
+ ,m_bOwnImplementation( sal_True )
{
}
@@ -408,7 +408,7 @@ namespace svt
EditCellController::EditCellController( MultiLineTextCell* _pEdit )
:CellController( _pEdit )
,m_pEditImplementation( new MultiLineEditImplementation( *_pEdit ) )
- ,m_bOwnImplementation( TRUE )
+ ,m_bOwnImplementation( sal_True )
{
}
@@ -416,7 +416,7 @@ namespace svt
EditCellController::EditCellController( IEditImplementation* _pImplementation )
:CellController( &_pImplementation->GetControl() )
,m_pEditImplementation( _pImplementation )
- ,m_bOwnImplementation( FALSE )
+ ,m_bOwnImplementation( sal_False )
{
}
@@ -553,21 +553,21 @@ namespace svt
//------------------------------------------------------------------
void MultiLineTextCell::Modify()
{
- GetTextEngine()->SetModified( TRUE );
+ GetTextEngine()->SetModified( sal_True );
MultiLineEdit::Modify();
}
//------------------------------------------------------------------
- BOOL MultiLineTextCell::dispatchKeyEvent( const KeyEvent& _rEvent )
+ sal_Bool MultiLineTextCell::dispatchKeyEvent( const KeyEvent& _rEvent )
{
Selection aOldSelection( GetSelection() );
- BOOL bWasModified = IsModified();
+ sal_Bool bWasModified = IsModified();
ClearModifyFlag( );
- BOOL bHandled = GetTextView()->KeyInput( _rEvent );
+ sal_Bool bHandled = GetTextView()->KeyInput( _rEvent );
- BOOL bIsModified = IsModified();
+ sal_Bool bIsModified = IsModified();
if ( bWasModified && !bIsModified )
// not sure whether this can really happen
SetModifyFlag();
@@ -580,9 +580,9 @@ namespace svt
if ( aNewSelection != aOldSelection // selection changed
|| bIsModified // or some other modification
)
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
//------------------------------------------------------------------
@@ -600,7 +600,7 @@ namespace svt
const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
const KeyCode& rKeyCode = pKeyEvent->GetKeyCode();
- USHORT nCode = rKeyCode.GetCode();
+ sal_uInt16 nCode = rKeyCode.GetCode();
if ( ( nCode == KEY_RETURN ) && ( rKeyCode.GetModifier() == KEY_MOD1 ) )
{
diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx
index ab426a421e6a..dc568cfec7e9 100644
--- a/svtools/source/brwbox/editbrowsebox.cxx
+++ b/svtools/source/brwbox/editbrowsebox.cxx
@@ -610,7 +610,7 @@ namespace svt
{
while ( GetSelectColumnCount( ) )
SelectColumnPos(
- sal::static_int_cast< USHORT >(FirstSelectedColumn()),
+ sal::static_int_cast< sal_uInt16 >(FirstSelectedColumn()),
sal_False );
Select();
}
diff --git a/svtools/source/brwbox/editbrowsebox2.cxx b/svtools/source/brwbox/editbrowsebox2.cxx
index 4add5d5a9094..1e30cf6fa9fa 100644
--- a/svtools/source/brwbox/editbrowsebox2.cxx
+++ b/svtools/source/brwbox/editbrowsebox2.cxx
@@ -43,7 +43,7 @@ namespace svt
using namespace ::com::sun::star::accessibility::AccessibleEventId;
// -----------------------------------------------------------------------------
-Reference< XAccessible > EditBrowseBox::CreateAccessibleCheckBoxCell(long _nRow, USHORT _nColumnPos,const TriState& eState,sal_Bool _bEnabled)
+Reference< XAccessible > EditBrowseBox::CreateAccessibleCheckBoxCell(long _nRow, sal_uInt16 _nColumnPos,const TriState& eState,sal_Bool _bEnabled)
{
Reference< XAccessible > xAccessible( GetAccessible() );
Reference< XAccessibleContext > xAccContext;
@@ -164,7 +164,7 @@ void EditBrowseBox::DetermineFocus( const sal_uInt16 _nGetFocusFlags )
)
{
long nRows = GetRowCount();
- USHORT nCols = ColCount();
+ sal_uInt16 nCols = ColCount();
if ( ( nRows > 0 ) && ( nCols > 0 ) )
{
@@ -196,7 +196,7 @@ Rectangle EditBrowseBox::GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nCol
if ( SeekRow(_nRow) )
{
CellController* pController = GetController(
- _nRow, GetColumnId( sal::static_int_cast< USHORT >(_nColumnPos) ) );
+ _nRow, GetColumnId( sal::static_int_cast< sal_uInt16 >(_nColumnPos) ) );
if ( pController )
aRect = pController->GetWindow().GetCharacterBounds(_nIndex);
}
@@ -209,7 +209,7 @@ sal_Int32 EditBrowseBox::GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumn
if ( SeekRow(_nRow) )
{
CellController* pController = GetController(
- _nRow, GetColumnId( sal::static_int_cast< USHORT >(_nColumnPos) ) );
+ _nRow, GetColumnId( sal::static_int_cast< sal_uInt16 >(_nColumnPos) ) );
if ( pController )
nRet = pController->GetWindow().GetIndexForPoint(_rPoint);
}
diff --git a/svtools/source/brwbox/makefile.mk b/svtools/source/brwbox/makefile.mk
deleted file mode 100644
index 724a2b530b1f..000000000000
--- a/svtools/source/brwbox/makefile.mk
+++ /dev/null
@@ -1,59 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=browse
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SRS1NAME=$(TARGET)
-SRC1FILES= editbrowsebox.src
-
-EXCEPTIONSFILES =\
- $(SLO)$/brwbox1.obj \
- $(SLO)$/brwbox2.obj \
- $(SLO)$/brwbox3.obj \
- $(SLO)$/brwhead.obj \
- $(SLO)$/datwin.obj \
- $(SLO)$/ebbcontrols.obj \
- $(SLO)$/editbrowsebox.obj \
- $(SLO)$/editbrowsebox2.obj
-
-SLOFILES= \
- $(EXCEPTIONSFILES)
-
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svtools/source/config/accessibilityoptions.cxx b/svtools/source/config/accessibilityoptions.cxx
index cad6edab0ba4..94cfd764a4d4 100644
--- a/svtools/source/config/accessibilityoptions.cxx
+++ b/svtools/source/config/accessibilityoptions.cxx
@@ -506,14 +506,14 @@ SvtAccessibilityOptions::SvtAccessibilityOptions()
}
++sm_nAccessibilityRefCount;
}
- //StartListening( *sm_pSingleImplConfig, TRUE );
+ //StartListening( *sm_pSingleImplConfig, sal_True );
}
// -----------------------------------------------------------------------
SvtAccessibilityOptions::~SvtAccessibilityOptions()
{
- //EndListening( *sm_pSingleImplConfig, TRUE );
+ //EndListening( *sm_pSingleImplConfig, sal_True );
::osl::MutexGuard aGuard( SingletonMutex::get() );
if( !--sm_nAccessibilityRefCount )
{
diff --git a/svtools/source/config/apearcfg.cxx b/svtools/source/config/apearcfg.cxx
index c4bc11a48fb8..7dc3ef20cfc8 100644
--- a/svtools/source/config/apearcfg.cxx
+++ b/svtools/source/config/apearcfg.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "apearcfg.hxx"
+#include <svtools/apearcfg.hxx>
#include "com/sun/star/uno/Any.hxx"
#include "tools/debug.hxx"
@@ -51,7 +51,6 @@ sal_Bool SvtTabAppearanceCfg::bInitialized = sal_False;
SvtTabAppearanceCfg::SvtTabAppearanceCfg()
:ConfigItem(OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common/View")))
- ,nLookNFeel ( DEFAULT_LOOKNFEEL )
,nDragMode ( DEFAULT_DRAGMODE )
,nScaleFactor ( DEFAULT_SCALEFACTOR )
,nSnapMode ( DEFAULT_SNAPMODE )
@@ -59,11 +58,9 @@ SvtTabAppearanceCfg::SvtTabAppearanceCfg()
#if defined( UNX )
,nAAMinPixelHeight ( DEFAULT_AAMINHEIGHT )
#endif
- ,bMenuMouseFollow(FALSE)
- ,bSingleLineTabCtrl(FALSE)
- ,bColoredTabCtrl(FALSE)
+ ,bMenuMouseFollow(sal_False)
#if defined( UNX )
- ,bFontAntialiasing ( TRUE )
+ ,bFontAntialiasing ( sal_True )
#endif
{
RTL_LOGFILE_CONTEXT(aLog, "svtools SvtTabAppearanceCfg::SvtTabAppearanceCfg()");
@@ -82,16 +79,13 @@ SvtTabAppearanceCfg::SvtTabAppearanceCfg()
switch(nProp)
{
case 0: *pValues >>= nScaleFactor; break; //"FontScaling",
- case 1: *pValues >>= nLookNFeel; break; //"LookAndFeel",
- case 2: *pValues >>= nDragMode; break; //"Window/Drag",
- case 3: bMenuMouseFollow = *(sal_Bool*)pValues->getValue(); break; //"Menu/FollowMouse",
- case 4: bSingleLineTabCtrl = *(sal_Bool*)pValues->getValue(); break; //"Dialog/SingleLineTab",
- case 5: bColoredTabCtrl = *(sal_Bool*)pValues->getValue(); break; //"Dialog/ColoredTab",
- case 6: *pValues >>= nSnapMode; break; //"Dialog/MousePositioning",
- case 7: *pValues >>= nMiddleMouse; break; //"Dialog/MiddleMouseButton",
+ case 1: *pValues >>= nDragMode; break; //"Window/Drag",
+ case 2: bMenuMouseFollow = *(sal_Bool*)pValues->getValue(); break; //"Menu/FollowMouse",
+ case 3: *pValues >>= nSnapMode; break; //"Dialog/MousePositioning",
+ case 4: *pValues >>= nMiddleMouse; break; //"Dialog/MiddleMouseButton",
#if defined( UNX )
- case 8: bFontAntialiasing = *(sal_Bool*)pValues->getValue(); break; // "FontAntialising/Enabled",
- case 9: *pValues >>= nAAMinPixelHeight; break; // "FontAntialising/MinPixelHeight",
+ case 5: bFontAntialiasing = *(sal_Bool*)pValues->getValue(); break; // "FontAntialising/Enabled",
+ case 6: *pValues >>= nAAMinPixelHeight; break; // "FontAntialising/MinPixelHeight",
#endif
}
}
@@ -111,16 +105,13 @@ const Sequence<OUString>& SvtTabAppearanceCfg::GetPropertyNames()
static const sal_Char* aPropNames[] =
{
"FontScaling" // 0
- ,"LookAndFeel" // 1
- ,"Window/Drag" // 2
- ,"Menu/FollowMouse" // 3
- ,"Dialog/SingleLineTab" // 4
- ,"Dialog/ColoredTab" // 5
- ,"Dialog/MousePositioning" // 6
- ,"Dialog/MiddleMouseButton" // 7
+ ,"Window/Drag" // 1
+ ,"Menu/FollowMouse" // 2
+ ,"Dialog/MousePositioning" // 3
+ ,"Dialog/MiddleMouseButton" // 4
#if defined( UNX )
- ,"FontAntiAliasing/Enabled" // 8
- ,"FontAntiAliasing/MinPixelHeight" // 9
+ ,"FontAntiAliasing/Enabled" // 5
+ ,"FontAntiAliasing/MinPixelHeight" // 6
#endif
};
const int nCount = SAL_N_ELEMENTS( aPropNames );
@@ -146,16 +137,13 @@ void SvtTabAppearanceCfg::Commit()
switch(nProp)
{
case 0: pValues[nProp] <<= nScaleFactor; break; // "FontScaling",
- case 1: pValues[nProp] <<= nLookNFeel; break; //"LookAndFeel",
- case 2: pValues[nProp] <<= nDragMode; break; //"Window/Drag",
- case 3: pValues[nProp].setValue(&bMenuMouseFollow, rType); break; //"Menu/FollowMouse",
- case 4: pValues[nProp].setValue(&bSingleLineTabCtrl, rType); break; //"Dialog/SingleLineTab",
- case 5: pValues[nProp].setValue(&bColoredTabCtrl, rType); break; //"Dialog/ColoredTab",
- case 6: pValues[nProp] <<= nSnapMode; break; //"Dialog/MousePositioning",
- case 7: pValues[nProp] <<= nMiddleMouse; break; //"Dialog/MiddleMouseButton",
+ case 1: pValues[nProp] <<= nDragMode; break; //"Window/Drag",
+ case 2: pValues[nProp].setValue(&bMenuMouseFollow, rType); break; //"Menu/FollowMouse",
+ case 3: pValues[nProp] <<= nSnapMode; break; //"Dialog/MousePositioning",
+ case 4: pValues[nProp] <<= nMiddleMouse; break; //"Dialog/MiddleMouseButton",
#if defined( UNX )
- case 8: pValues[nProp].setValue(&bFontAntialiasing, rType); break; // "FontAntialising/Enabled",
- case 9: pValues[nProp] <<= nAAMinPixelHeight; break; // "FontAntialising/MinPixelHeight",
+ case 5: pValues[nProp].setValue(&bFontAntialiasing, rType); break; // "FontAntialising/Enabled",
+ case 6: pValues[nProp] <<= nAAMinPixelHeight; break; // "FontAntialising/MinPixelHeight",
#endif
}
}
@@ -166,31 +154,25 @@ void SvtTabAppearanceCfg::Notify( const com::sun::star::uno::Sequence< rtl::OUSt
{
}
-void SvtTabAppearanceCfg::SetLookNFeel ( USHORT nSet )
-{
- nLookNFeel = nSet;
- SetModified();
-}
-
-void SvtTabAppearanceCfg::SetDragMode ( USHORT nSet )
+void SvtTabAppearanceCfg::SetDragMode ( sal_uInt16 nSet )
{
nDragMode = nSet;
SetModified();
}
-void SvtTabAppearanceCfg::SetScaleFactor ( USHORT nSet )
+void SvtTabAppearanceCfg::SetScaleFactor ( sal_uInt16 nSet )
{
nScaleFactor = nSet;
SetModified();
}
-void SvtTabAppearanceCfg::SetSnapMode ( USHORT nSet )
+void SvtTabAppearanceCfg::SetSnapMode ( sal_uInt16 nSet )
{
nSnapMode = nSet;
SetModified();
}
-void SvtTabAppearanceCfg::SetMiddleMouseButton ( USHORT nSet )
+void SvtTabAppearanceCfg::SetMiddleMouseButton ( sal_uInt16 nSet )
{
nMiddleMouse = nSet;
SetModified();
@@ -205,27 +187,8 @@ void SvtTabAppearanceCfg::SetApplicationDefaults ( Application* pApp )
// SetStandard...Styles() resets the UseSystemUIFonts flag,
// but we don't want to change it now, so save the flag before ...
- BOOL bUseSystemUIFonts = hAppStyle.GetUseSystemUIFonts();
-
- switch ( nLookNFeel )
- {
- case LookMotif:
- hAppStyle.SetStandardUnixStyles(); break;
-
- case LookOSTwo:
- hAppStyle.SetStandardOS2Styles(); break;
-
- case LookMacintosh:
- hAppStyle.SetStandardMacStyles(); break;
-
- case LookWindows:
- hAppStyle.SetStandardWinStyles(); break;
-
- case LookStardivision:
- default:
- hAppStyle.SetStandardStyles(); break;
- }
-
+ sal_Bool bUseSystemUIFonts = hAppStyle.GetUseSystemUIFonts();
+ hAppStyle.SetStandardStyles();
// and set it here
hAppStyle.SetUseSystemUIFonts( bUseSystemUIFonts );
@@ -243,7 +206,7 @@ void SvtTabAppearanceCfg::SetApplicationDefaults ( Application* pApp )
// Mouse Snap
MouseSettings hMouseSettings = hAppSettings.GetMouseSettings();
- ULONG nMouseOptions = hMouseSettings.GetOptions();
+ sal_uLong nMouseOptions = hMouseSettings.GetOptions();
nMouseOptions &= ! (MOUSE_OPTION_AUTOCENTERPOS | MOUSE_OPTION_AUTODEFBTNPOS);
@@ -264,20 +227,12 @@ void SvtTabAppearanceCfg::SetApplicationDefaults ( Application* pApp )
// Merge and Publish Settings
- ULONG nFollow = hMouseSettings.GetFollow();
+ sal_uLong nFollow = hMouseSettings.GetFollow();
if(bMenuMouseFollow)
nFollow |= MOUSE_FOLLOW_MENU;
else
nFollow &= ~MOUSE_FOLLOW_MENU;
hMouseSettings.SetFollow( nFollow );
- sal_uInt16 nTabStyle = 0;
- if(bSingleLineTabCtrl)
- nTabStyle |= STYLE_TABCONTROL_SINGLELINE;
-
- if(bColoredTabCtrl)
- nTabStyle |= STYLE_TABCONTROL_COLOR;
- hAppStyle.SetTabControlStyle(nTabStyle);
-
hAppSettings.SetMouseSettings( hMouseSettings );
diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx
index def2f621a56e..ebefe664dd18 100644
--- a/svtools/source/config/colorcfg.cxx
+++ b/svtools/source/config/colorcfg.cxx
@@ -514,7 +514,7 @@ ColorConfigValue ColorConfig::GetColorValue(ColorConfigEntry eEntry, sal_Bool bS
if(COL_AUTO == sal::static_int_cast<ColorData>(aRet.nColor))
aRet.nColor = ColorConfig::GetDefaultColor(eEntry).GetColor();
//#103495# don't allow grey between 40% and 60% as application background
- const UINT8 nRed = COLORDATA_RED( aRet.nColor);
+ const sal_uInt8 nRed = COLORDATA_RED( aRet.nColor);
if(eEntry == APPBACKGROUND &&
(nRed == COLORDATA_GREEN( aRet.nColor)) &&
(nRed == COLORDATA_BLUE( aRet.nColor)) &&
@@ -531,12 +531,12 @@ EditableColorConfig::EditableColorConfig() :
m_pImpl(new ColorConfig_Impl),
m_bModified(sal_False)
{
- m_pImpl->BlockBroadcasts(TRUE);
+ m_pImpl->BlockBroadcasts(sal_True);
}
EditableColorConfig::~EditableColorConfig()
{
- m_pImpl->BlockBroadcasts(FALSE);
+ m_pImpl->BlockBroadcasts(sal_False);
if(m_bModified)
m_pImpl->SetModified();
if(m_pImpl->IsModified())
@@ -614,12 +614,12 @@ void EditableColorConfig::Commit()
// -----------------------------------------------------------------------------
void EditableColorConfig::DisableBroadcast()
{
- m_pImpl->BlockBroadcasts(TRUE);
+ m_pImpl->BlockBroadcasts(sal_True);
}
// -----------------------------------------------------------------------------
void EditableColorConfig::EnableBroadcast()
{
- m_pImpl->BlockBroadcasts(FALSE);
+ m_pImpl->BlockBroadcasts(sal_False);
}
// -----------------------------------------------------------------------------
diff --git a/svtools/source/config/extcolorcfg.cxx b/svtools/source/config/extcolorcfg.cxx
index 42554b327448..59bb82aa2c56 100644
--- a/svtools/source/config/extcolorcfg.cxx
+++ b/svtools/source/config/extcolorcfg.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "extcolorcfg.hxx"
+#include <svtools/extcolorcfg.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/lang/Locale.hpp>
diff --git a/svtools/source/config/fontsubstconfig.cxx b/svtools/source/config/fontsubstconfig.cxx
index 0412049e5dea..95dce21ddd45 100644
--- a/svtools/source/config/fontsubstconfig.cxx
+++ b/svtools/source/config/fontsubstconfig.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "fontsubstconfig.hxx"
+#include <svtools/fontsubstconfig.hxx>
#include <svl/svarray.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/uno/Any.hxx>
diff --git a/svtools/source/config/htmlcfg.cxx b/svtools/source/config/htmlcfg.cxx
index 8647d7e5ad54..c3d5526a41fa 100644
--- a/svtools/source/config/htmlcfg.cxx
+++ b/svtools/source/config/htmlcfg.cxx
@@ -291,14 +291,14 @@ void SvxHtmlOptions::Notify( const com::sun::star::uno::Sequence< rtl::OUString
}
// -----------------------------------------------------------------------
-USHORT SvxHtmlOptions::GetFontSize(USHORT nPos) const
+sal_uInt16 SvxHtmlOptions::GetFontSize(sal_uInt16 nPos) const
{
if(nPos < HTML_FONT_COUNT)
- return (USHORT)pImp->aFontSizeArr[nPos];
+ return (sal_uInt16)pImp->aFontSizeArr[nPos];
return 0;
}
// -----------------------------------------------------------------------
-void SvxHtmlOptions::SetFontSize(USHORT nPos, USHORT nSize)
+void SvxHtmlOptions::SetFontSize(sal_uInt16 nPos, sal_uInt16 nSize)
{
if(nPos < HTML_FONT_COUNT)
{
@@ -312,7 +312,7 @@ void SvxHtmlOptions::SetFontSize(USHORT nPos, USHORT nSize)
// -----------------------------------------------------------------------
-BOOL SvxHtmlOptions::IsImportUnknown() const
+sal_Bool SvxHtmlOptions::IsImportUnknown() const
{
return 0 != (pImp->nFlags & HTMLCFG_UNKNOWN_TAGS) ;
}
@@ -320,7 +320,7 @@ BOOL SvxHtmlOptions::IsImportUnknown() const
// -----------------------------------------------------------------------
-void SvxHtmlOptions::SetImportUnknown(BOOL bSet)
+void SvxHtmlOptions::SetImportUnknown(sal_Bool bSet)
{
if(bSet)
pImp->nFlags |= HTMLCFG_UNKNOWN_TAGS;
@@ -332,15 +332,15 @@ void SvxHtmlOptions::SetImportUnknown(BOOL bSet)
// -----------------------------------------------------------------------
-USHORT SvxHtmlOptions::GetExportMode() const
+sal_uInt16 SvxHtmlOptions::GetExportMode() const
{
- return (USHORT)pImp->nExportMode;
+ return (sal_uInt16)pImp->nExportMode;
}
// -----------------------------------------------------------------------
-void SvxHtmlOptions::SetExportMode(USHORT nSet)
+void SvxHtmlOptions::SetExportMode(sal_uInt16 nSet)
{
if(nSet <= HTML_CFG_MAX )
{
@@ -353,7 +353,7 @@ void SvxHtmlOptions::SetExportMode(USHORT nSet)
// -----------------------------------------------------------------------
-BOOL SvxHtmlOptions::IsStarBasic() const
+sal_Bool SvxHtmlOptions::IsStarBasic() const
{
return 0 != (pImp->nFlags & HTMLCFG_STAR_BASIC) ;
}
@@ -361,7 +361,7 @@ BOOL SvxHtmlOptions::IsStarBasic() const
// -----------------------------------------------------------------------
-void SvxHtmlOptions::SetStarBasic(BOOL bSet)
+void SvxHtmlOptions::SetStarBasic(sal_Bool bSet)
{
if(bSet)
pImp->nFlags |= HTMLCFG_STAR_BASIC;
@@ -370,12 +370,12 @@ void SvxHtmlOptions::SetStarBasic(BOOL bSet)
SetModified();
}
-BOOL SvxHtmlOptions::IsSaveGraphicsLocal() const
+sal_Bool SvxHtmlOptions::IsSaveGraphicsLocal() const
{
return 0 != (pImp->nFlags & HTMLCFG_LOCAL_GRF) ;
}
-void SvxHtmlOptions::SetSaveGraphicsLocal(BOOL bSet)
+void SvxHtmlOptions::SetSaveGraphicsLocal(sal_Bool bSet)
{
if(bSet)
pImp->nFlags |= HTMLCFG_LOCAL_GRF;
@@ -384,9 +384,9 @@ void SvxHtmlOptions::SetSaveGraphicsLocal(BOOL bSet)
SetModified();
}
-BOOL SvxHtmlOptions::IsPrintLayoutExtension() const
+sal_Bool SvxHtmlOptions::IsPrintLayoutExtension() const
{
- BOOL bRet = 0 != (pImp->nFlags & HTMLCFG_PRINT_LAYOUT_EXTENSION);
+ sal_Bool bRet = 0 != (pImp->nFlags & HTMLCFG_PRINT_LAYOUT_EXTENSION);
switch( pImp->nExportMode )
{
case HTML_CFG_MSIE_40:
@@ -394,12 +394,12 @@ BOOL SvxHtmlOptions::IsPrintLayoutExtension() const
case HTML_CFG_WRITER :
break;
default:
- bRet = FALSE;
+ bRet = sal_False;
}
return bRet;
}
-void SvxHtmlOptions::SetPrintLayoutExtension(BOOL bSet)
+void SvxHtmlOptions::SetPrintLayoutExtension(sal_Bool bSet)
{
if(bSet)
pImp->nFlags |= HTMLCFG_PRINT_LAYOUT_EXTENSION;
@@ -408,12 +408,12 @@ void SvxHtmlOptions::SetPrintLayoutExtension(BOOL bSet)
SetModified();
}
-BOOL SvxHtmlOptions::IsIgnoreFontFamily() const
+sal_Bool SvxHtmlOptions::IsIgnoreFontFamily() const
{
return 0 != (pImp->nFlags & HTMLCFG_IGNORE_FONT_FAMILY) ;
}
-void SvxHtmlOptions::SetIgnoreFontFamily(BOOL bSet)
+void SvxHtmlOptions::SetIgnoreFontFamily(sal_Bool bSet)
{
if(bSet)
pImp->nFlags |= HTMLCFG_IGNORE_FONT_FAMILY;
@@ -422,12 +422,12 @@ void SvxHtmlOptions::SetIgnoreFontFamily(BOOL bSet)
SetModified();
}
-BOOL SvxHtmlOptions::IsStarBasicWarning() const
+sal_Bool SvxHtmlOptions::IsStarBasicWarning() const
{
return 0 != (pImp->nFlags & HTMLCFG_IS_BASIC_WARNING) ;
}
-void SvxHtmlOptions::SetStarBasicWarning(BOOL bSet)
+void SvxHtmlOptions::SetStarBasicWarning(sal_Bool bSet)
{
if(bSet)
pImp->nFlags |= HTMLCFG_IS_BASIC_WARNING;
@@ -465,12 +465,12 @@ SvxHtmlOptions* SvxHtmlOptions::Get()
return pOptions;
}
-BOOL SvxHtmlOptions::IsNumbersEnglishUS() const
+sal_Bool SvxHtmlOptions::IsNumbersEnglishUS() const
{
return 0 != (pImp->nFlags & HTMLCFG_NUMBERS_ENGLISH_US) ;
}
-void SvxHtmlOptions::SetNumbersEnglishUS(BOOL bSet)
+void SvxHtmlOptions::SetNumbersEnglishUS(sal_Bool bSet)
{
if(bSet)
pImp->nFlags |= HTMLCFG_NUMBERS_ENGLISH_US;
diff --git a/svtools/source/config/itemholder2.cxx b/svtools/source/config/itemholder2.cxx
index 227c50b2bc10..7f57664af5f1 100644
--- a/svtools/source/config/itemholder2.cxx
+++ b/svtools/source/config/itemholder2.cxx
@@ -37,10 +37,10 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <svtools/accessibilityoptions.hxx>
-#include <apearcfg.hxx>
+#include <svtools/apearcfg.hxx>
#include <svtools/menuoptions.hxx>
#include <svtools/colorcfg.hxx>
-#include <fontsubstconfig.hxx>
+#include <svtools/fontsubstconfig.hxx>
#include <svtools/helpopt.hxx>
#include <svtools/printoptions.hxx>
#include <unotools/options.hxx>
diff --git a/svtools/source/config/makefile.mk b/svtools/source/config/makefile.mk
deleted file mode 100644
index d3ba43de68ef..000000000000
--- a/svtools/source/config/makefile.mk
+++ /dev/null
@@ -1,58 +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.
-#
-#*************************************************************************
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=config
-
-ENABLE_EXCEPTIONS := TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/accessibilityoptions.obj \
- $(SLO)$/apearcfg.obj \
- $(SLO)$/colorcfg.obj \
- $(SLO)$/extcolorcfg.obj \
- $(SLO)$/fontsubstconfig.obj \
- $(SLO)$/helpopt.obj \
- $(SLO)$/htmlcfg.obj \
- $(SLO)$/itemholder2.obj \
- $(SLO)$/menuoptions.obj \
- $(SLO)$/miscopt.obj \
- $(SLO)$/optionsdrawinglayer.obj \
- $(SLO)$/printoptions.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svtools/source/config/menuoptions.cxx b/svtools/source/config/menuoptions.cxx
index 27ae8a346f3d..4abb7ba102df 100644
--- a/svtools/source/config/menuoptions.cxx
+++ b/svtools/source/config/menuoptions.cxx
@@ -313,9 +313,16 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames )
// We need values from ALL notified configuration keys.
DBG_ASSERT( !(seqPropertyNames.getLength()!=seqValues.getLength()), "SvtMenuOptions_Impl::Notify()\nI miss some values of configuration keys!\n" );
- sal_Bool bMenuIcons = true;
- sal_Bool bSystemMenuIcons = true;
- sal_Bool bMenuSettingsChanged = false;
+ sal_Bool bMenuSettingsChanged = sal_False;
+ sal_Bool bMenuIcons = sal_True;
+ sal_Bool bSystemMenuIcons = sal_True;
+ if (m_nMenuIcons == 2)
+ bMenuIcons = (sal_Bool)(Application::GetSettings().GetStyleSettings().GetUseImagesInMenus());
+ else
+ {
+ bSystemMenuIcons = sal_False;
+ bMenuIcons = m_nMenuIcons ? sal_True : sal_False;
+ }
// Step over list of property names and get right value from coreesponding value list to set it on internal members!
sal_Int32 nCount = seqPropertyNames.getLength();
diff --git a/svtools/source/config/miscopt.cxx b/svtools/source/config/miscopt.cxx
index 2fdb136e91b4..b16d383ad277 100644
--- a/svtools/source/config/miscopt.cxx
+++ b/svtools/source/config/miscopt.cxx
@@ -45,7 +45,7 @@
#include <rtl/logfile.hxx>
#include "itemholder2.hxx"
-#include <imgdef.hxx>
+#include <svtools/imgdef.hxx>
#include <vcl/svapp.hxx>
#include <list>
@@ -93,7 +93,7 @@ using namespace ::com::sun::star;
#define PROPERTYCOUNT 11
-#define VCL_TOOLBOX_STYLE_FLAT ((USHORT)0x0004) // from <vcl/toolbox.hxx>
+#define VCL_TOOLBOX_STYLE_FLAT ((sal_uInt16)0x0004) // from <vcl/toolbox.hxx>
//_________________________________________________________________________________________________________________
// private declarations!
@@ -889,7 +889,7 @@ sal_Int16 SvtMiscOptions::GetCurrentSymbolsSize() const
{
// Use system settings, we have to retrieve the toolbar icon size from the
// Application class
- ULONG nStyleIconSize = Application::GetSettings().GetStyleSettings().GetToolbarIconSize();
+ sal_uLong nStyleIconSize = Application::GetSettings().GetStyleSettings().GetToolbarIconSize();
if ( nStyleIconSize == STYLE_TOOLBAR_ICONSIZE_LARGE )
eOptSymbolsSize = SFX_SYMBOLS_SIZE_LARGE;
else
diff --git a/svtools/source/config/printoptions.cxx b/svtools/source/config/printoptions.cxx
index f76104c132c8..7f86d995f278 100644
--- a/svtools/source/config/printoptions.cxx
+++ b/svtools/source/config/printoptions.cxx
@@ -62,7 +62,7 @@
// - statics -
// -----------
-static USHORT aDPIArray[] = { 72, 96, 150, 200, 300, 600 };
+static sal_uInt16 aDPIArray[] = { 72, 96, 150, 200, 300, 600 };
#define DPI_COUNT (SAL_N_ELEMENTS(aDPIArray))
@@ -735,7 +735,7 @@ void SvtBasePrintOptions::GetPrinterOptions( PrinterOptions& rOptions ) const
rOptions.SetReducedGradientStepCount( GetReducedGradientStepCount() );
rOptions.SetReduceBitmaps( IsReduceBitmaps() );
rOptions.SetReducedBitmapMode( (PrinterBitmapMode) GetReducedBitmapMode() );
- rOptions.SetReducedBitmapResolution( aDPIArray[ Min( (USHORT) GetReducedBitmapResolution(), (USHORT)( DPI_COUNT - 1 ) ) ] );
+ rOptions.SetReducedBitmapResolution( aDPIArray[ Min( (sal_uInt16) GetReducedBitmapResolution(), (sal_uInt16)( DPI_COUNT - 1 ) ) ] );
rOptions.SetReducedBitmapIncludesTransparency( IsReducedBitmapIncludesTransparency() );
rOptions.SetConvertToGreyscales( IsConvertToGreyscales() );
}
@@ -758,7 +758,7 @@ void SvtBasePrintOptions::SetPrinterOptions( const PrinterOptions& rOptions )
SetReducedBitmapIncludesTransparency( rOptions.IsReducedBitmapIncludesTransparency() );
SetConvertToGreyscales( rOptions.IsConvertToGreyscales() );
- const USHORT nDPI = rOptions.GetReducedBitmapResolution();
+ const sal_uInt16 nDPI = rOptions.GetReducedBitmapResolution();
if( nDPI < aDPIArray[ 0 ] )
SetReducedBitmapResolution( 0 );
diff --git a/svtools/source/config/test/makefile.mk b/svtools/source/config/test/makefile.mk
deleted file mode 100644
index 3f1eaac0efda..000000000000
--- a/svtools/source/config/test/makefile.mk
+++ /dev/null
@@ -1,61 +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.
-#
-#*************************************************************************
-PRJ=..$/..$/..
-
-PRJNAME= svtools
-TARGET= test_configitems
-LIBTARGET= NO
-ENABLE_EXCEPTIONS= TRUE
-USE_DEFFILE= TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- application: "test" --------------------------------------------------
-
-APP1TARGET= test
-
-APP1OBJS= $(SLO)$/test.obj \
- $(SLO)$/dynamicmenuoptions.obj
-
-DEPOBJFILES=$(APP1OBJS)
-
-APP1STDLIBS= $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(COMPHELPERLIB) \
- $(UNOTOOLSLIB) \
- $(SALLIB) \
- $(TOOLSLIB) \
- $(VCLLIB)
-
-APP1DEPN= $(SLO)$/dynamicmenuoptions.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svtools/source/contnr/cont_pch.cxx b/svtools/source/contnr/cont_pch.cxx
deleted file mode 100644
index 3abdd131677a..000000000000
--- a/svtools/source/contnr/cont_pch.cxx
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- 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 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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-
-#include <sv.hxx>
-#include <svtools/treelist.hxx>
-#include <svtools/svtabbx.hxx>
-#include <svtools/svtreebx.hxx>
-#include <svtools/svicnvw.hxx>
-#include "svimpbox.hxx"
-#include "svimpicn.hxx"
-#include <svtools/svlbox.hxx>
-#include <svtools/svlbitm.hxx>
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/contnr/contentenumeration.cxx b/svtools/source/contnr/contentenumeration.cxx
index f17958fa8722..6e4f6441140c 100644
--- a/svtools/source/contnr/contentenumeration.cxx
+++ b/svtools/source/contnr/contentenumeration.cxx
@@ -31,7 +31,7 @@
#include "contentenumeration.hxx"
#include <svl/urlfilter.hxx>
#include <svtools/inettbc.hxx>
-#include "imagemgr.hxx"
+#include <svtools/imagemgr.hxx>
/** === begin UNO includes === **/
#include <com/sun/star/beans/XPropertySet.hpp>
diff --git a/svtools/source/contnr/ctrdll.cxx b/svtools/source/contnr/ctrdll.cxx
deleted file mode 100644
index 4560d5ea64a5..000000000000
--- a/svtools/source/contnr/ctrdll.cxx
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- 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 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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-
-#ifdef WIN
-#include <svwin.h>
-
-#include <sysdep.hxx>
-
-// Statische DLL-Verwaltungs-Variablen
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-
-/***************************************************************************
-|*
-|* LibMain()
-|*
-|* Beschreibung Initialisierungsfunktion der DLL
-|*
-***************************************************************************/
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-/***************************************************************************
-|*
-|* WEP()
-|*
-|* Beschreibung DLL-Deinitialisierung
-|*
-***************************************************************************/
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index 3a9efa5f9905..b95c889827b9 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -29,12 +29,11 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "fileview.hxx"
+#include <svtools/fileview.hxx>
#include <svtools/svtdata.hxx>
-#include "imagemgr.hxx"
+#include <svtools/imagemgr.hxx>
#include <svtools/headbar.hxx>
#include <svtools/svtabbx.hxx>
-
#include <svtools/svtools.hrc>
#include "fileview.hrc"
#include "contentenumeration.hxx"
@@ -190,7 +189,7 @@ private:
sal_Bool Kill( const OUString& rURL );
protected:
- virtual BOOL DoubleClickHdl();
+ virtual sal_Bool DoubleClickHdl();
virtual ::rtl::OUString GetAccessibleObjectDescription( ::svt::AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos ) const;
public:
@@ -199,7 +198,7 @@ public:
virtual void Resize();
virtual void KeyInput( const KeyEvent& rKEvt );
- virtual BOOL EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText );
+ virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText );
void ClearAll();
HeaderBar* GetHeaderBar() const { return mpHeaderBar; }
@@ -214,7 +213,7 @@ public:
DECL_LINK( ResetQuickSearch_Impl, Timer * );
virtual PopupMenu* CreateContextMenu( void );
- virtual void ExcecuteContextMenuAction( USHORT nSelectedPopentry );
+ virtual void ExcecuteContextMenuAction( sal_uInt16 nSelectedPopentry );
};
// class HashedEntry --------------------------------------------------
@@ -444,9 +443,9 @@ void NameTranslationList::Init()
aConfig.SetGroup( ByteString( pSection ) );
- USHORT nKeyCnt = aConfig.GetKeyCount();
+ sal_uInt16 nKeyCnt = aConfig.GetKeyCount();
- for( USHORT nCnt = 0 ; nCnt < nKeyCnt ; ++nCnt )
+ for( sal_uInt16 nCnt = 0 ; nCnt < nKeyCnt ; ++nCnt )
Insert( new NameTranslationEntry( aConfig.GetKeyName( nCnt ), aConfig.ReadKey( nCnt ) ) );
}
}
@@ -586,7 +585,7 @@ public:
String FolderInserted( const OUString& rURL,
const OUString& rTitle );
- ULONG GetEntryPos( const OUString& rURL );
+ sal_uLong GetEntryPos( const OUString& rURL );
inline void EnableContextMenu( sal_Bool bEnable );
inline void EnableDelete( sal_Bool bEnable );
@@ -935,7 +934,7 @@ PopupMenu* ViewTabListBox_Impl::CreateContextMenu( void )
// -----------------------------------------------------------------------
-void ViewTabListBox_Impl::ExcecuteContextMenuAction( USHORT nSelectedPopupEntry )
+void ViewTabListBox_Impl::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry )
{
switch ( nSelectedPopupEntry )
{
@@ -953,7 +952,7 @@ void ViewTabListBox_Impl::ExcecuteContextMenuAction( USHORT nSelectedPopupEntry
void ViewTabListBox_Impl::ClearAll()
{
- for ( USHORT i = 0; i < GetEntryCount(); ++i )
+ for ( sal_uInt16 i = 0; i < GetEntryCount(); ++i )
delete (SvtContentEntry*)GetEntry(i)->GetUserData();
Clear();
}
@@ -1029,10 +1028,10 @@ void ViewTabListBox_Impl::DeleteEntries()
}
// -----------------------------------------------------------------------
-BOOL ViewTabListBox_Impl::EditedEntry( SvLBoxEntry* pEntry,
+sal_Bool ViewTabListBox_Impl::EditedEntry( SvLBoxEntry* pEntry,
const XubString& rNewText )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
OUString aURL;
SvtContentEntry* pData = (SvtContentEntry*)pEntry->GetUserData();
@@ -1077,7 +1076,7 @@ BOOL ViewTabListBox_Impl::EditedEntry( SvLBoxEntry* pEntry,
pData->maURL = aURL;
pEntry->SetUserData( pData );
- bRet = TRUE;
+ bRet = sal_True;
}
}
catch( Exception const & )
@@ -1115,7 +1114,7 @@ void ViewTabListBox_Impl::DoQuickSearch( const xub_Unicode& rChar )
SvLBoxEntry* pEntry = GetEntry( mnSearchIndex );
if ( pEntry )
{
- SelectAll( FALSE );
+ SelectAll( sal_False );
Select( pEntry );
SetCurEntry( pEntry );
MakeVisible( pEntry );
@@ -1131,10 +1130,10 @@ void ViewTabListBox_Impl::DoQuickSearch( const xub_Unicode& rChar )
}
// -----------------------------------------------------------------------
-BOOL ViewTabListBox_Impl::DoubleClickHdl()
+sal_Bool ViewTabListBox_Impl::DoubleClickHdl()
{
SvHeaderTabListBox::DoubleClickHdl();
- return FALSE;
+ return sal_False;
// this means "do no additional handling". Especially this means that the SvImpLBox does not
// recognize that the entry at the double click position change after the handler call (which is
// the case if in the handler, our content was replaced)
@@ -1280,7 +1279,7 @@ void SvtFileView::OpenFolder( const Sequence< OUString >& aContents )
{
mpImp->mpView->ClearAll();
const OUString* pFileProperties = aContents.getConstArray();
- UINT32 i, nCount = aContents.getLength();
+ sal_uInt32 i, nCount = aContents.getLength();
for ( i = 0; i < nCount; ++i )
{
String aRow( pFileProperties[i] );
@@ -1312,7 +1311,7 @@ void SvtFileView::OpenFolder( const Sequence< OUString >& aContents )
// detect image
sal_Bool bDoInsert = sal_True;
INetURLObject aObj( aImageURL.Len() > 0 ? aImageURL : aURL );
- Image aImage = SvFileInformationManager::GetImage( aObj, FALSE );
+ Image aImage = SvFileInformationManager::GetImage( aObj, sal_False );
if ( bDoInsert )
{
@@ -1360,7 +1359,7 @@ sal_Bool SvtFileView::CreateNewFolder( const String& rNewFolder )
String sTitle = aObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET );
String sEntry = mpImp->FolderInserted( sURL, sTitle );
SvLBoxEntry* pEntry = mpImp->mpView->InsertEntry( sEntry, mpImp->maFolderImage, mpImp->maFolderImage );
- SvtContentEntry* pUserData = new SvtContentEntry( sURL, TRUE );
+ SvtContentEntry* pUserData = new SvtContentEntry( sURL, sal_True );
pEntry->SetUserData( pUserData );
mpImp->mpView->MakeVisible( pEntry );
bRet = sal_True;
@@ -1411,16 +1410,16 @@ sal_Bool SvtFileView::GetParentURL( String& rParentURL ) const
// -----------------------------------------------------------------------
-sal_uInt32 SvtFileView::GetHelpId( ) const
+const rtl::OString& SvtFileView::GetHelpId( ) const
{
return mpImp->mpView->GetHelpId( );
}
// -----------------------------------------------------------------------
-void SvtFileView::SetHelpId( sal_uInt32 nHelpId )
+void SvtFileView::SetHelpId( const rtl::OString& rHelpId )
{
- mpImp->mpView->SetHelpId( nHelpId );
+ mpImp->mpView->SetHelpId( rHelpId );
}
// -----------------------------------------------------------------------
@@ -1546,7 +1545,7 @@ void SvtFileView::CancelRunningAsyncAction()
void SvtFileView::SetNoSelection()
{
- mpImp->mpView->SelectAll( FALSE );
+ mpImp->mpView->SelectAll( sal_False );
}
// -----------------------------------------------------------------------
@@ -1581,7 +1580,7 @@ void SvtFileView::SetDoubleClickHdl( const Link& rHdl )
// -----------------------------------------------------------------------
-ULONG SvtFileView::GetSelectionCount() const
+sal_uLong SvtFileView::GetSelectionCount() const
{
return mpImp->mpView->GetSelectionCount();
}
@@ -1653,7 +1652,7 @@ void SvtFileView::EndInplaceEditing( bool _bCancel )
IMPL_LINK( SvtFileView, HeaderSelect_Impl, HeaderBar*, pBar )
{
DBG_ASSERT( pBar, "no headerbar" );
- USHORT nItemID = pBar->GetCurItemId();
+ sal_uInt16 nItemID = pBar->GetCurItemId();
HeaderBarItemBits nBits;
@@ -1674,7 +1673,7 @@ IMPL_LINK( SvtFileView, HeaderSelect_Impl, HeaderBar*, pBar )
nBits = pBar->GetItemBits( nItemID );
- BOOL bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
+ sal_Bool bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
if ( bUp )
{
@@ -1698,10 +1697,10 @@ IMPL_LINK( SvtFileView, HeaderEndDrag_Impl, HeaderBar*, pBar )
if ( !pBar->IsItemMode() )
{
Size aSize;
- USHORT nTabs = pBar->GetItemCount();
+ sal_uInt16 nTabs = pBar->GetItemCount();
long nTmpSize = 0;
- for ( USHORT i = 1; i <= nTabs; ++i )
+ for ( sal_uInt16 i = 1; i <= nTabs; ++i )
{
long nWidth = pBar->GetItemSize(i);
aSize.Width() = nWidth + nTmpSize;
@@ -1724,14 +1723,14 @@ String SvtFileView::GetConfigString() const
sRet += String::CreateFromInt32( mpImp->mnSortColumn );
sRet += ';';
HeaderBarItemBits nBits = pBar->GetItemBits( mpImp->mnSortColumn );
- BOOL bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
+ sal_Bool bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
sRet += bUp ? '1' : '0';
sRet += ';';
- USHORT nCount = pBar->GetItemCount();
- for ( USHORT i = 0; i < nCount; ++i )
+ sal_uInt16 nCount = pBar->GetItemCount();
+ for ( sal_uInt16 i = 0; i < nCount; ++i )
{
- USHORT nId = pBar->GetItemId(i);
+ sal_uInt16 nId = pBar->GetItemId(i);
sRet += String::CreateFromInt32( nId );
sRet += ';';
sRet += String::CreateFromInt32( pBar->GetItemSize( nId ) );
@@ -1748,9 +1747,9 @@ void SvtFileView::SetConfigString( const String& rCfgStr )
HeaderBar* pBar = mpImp->mpView->GetHeaderBar();
DBG_ASSERT( pBar, "invalid headerbar" );
- USHORT nIdx = 0;
- mpImp->mnSortColumn = (USHORT)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32();
- BOOL bUp = (BOOL)(USHORT)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32();
+ sal_uInt16 nIdx = 0;
+ mpImp->mnSortColumn = (sal_uInt16)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32();
+ sal_Bool bUp = (sal_Bool)(sal_uInt16)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32();
HeaderBarItemBits nBits = pBar->GetItemBits( mpImp->mnSortColumn );
if ( bUp )
@@ -1767,7 +1766,7 @@ void SvtFileView::SetConfigString( const String& rCfgStr )
while ( nIdx != STRING_NOTFOUND )
{
- USHORT nItemId = (USHORT)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32();
+ sal_uInt16 nItemId = (sal_uInt16)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32();
pBar->SetItemSize( nItemId, rCfgStr.GetToken( 0, ';', nIdx ).ToInt32() );
}
@@ -2161,7 +2160,7 @@ void SvtFileView_Impl::OpenFolder_Impl()
{
::osl::MutexGuard aGuard( maMutex );
- mpView->SetUpdateMode( FALSE );
+ mpView->SetUpdateMode( sal_False );
mpView->ClearAll();
std::vector< SortingData_Impl* >::iterator aIt;
@@ -2184,7 +2183,7 @@ void SvtFileView_Impl::OpenFolder_Impl()
InitSelection();
++mnSuspendSelectCallback;
- mpView->SetUpdateMode( TRUE );
+ mpView->SetUpdateMode( sal_True );
--mnSuspendSelectCallback;
ResetCursor();
@@ -2196,9 +2195,9 @@ void SvtFileView_Impl::ResetCursor()
// deselect
SvLBoxEntry* pEntry = mpView->FirstSelected();
if ( pEntry )
- mpView->Select( pEntry, FALSE );
+ mpView->Select( pEntry, sal_False );
// set cursor to the first entry
- mpView->SetCursor( mpView->First(), TRUE );
+ mpView->SetCursor( mpView->First(), sal_True );
mpView->Update();
}
@@ -2330,10 +2329,10 @@ void SvtFileView_Impl::CreateDisplayText_Impl()
::svtools::VolumeInfo aVolInfo( (*aIt)->mbIsVolume, (*aIt)->mbIsRemote,
(*aIt)->mbIsRemoveable, (*aIt)->mbIsFloppy,
(*aIt)->mbIsCompactDisc );
- (*aIt)->maImage = SvFileInformationManager::GetFolderImage( aVolInfo, FALSE );
+ (*aIt)->maImage = SvFileInformationManager::GetFolderImage( aVolInfo, sal_False );
}
else
- (*aIt)->maImage = SvFileInformationManager::GetFileImage( INetURLObject( (*aIt)->maTargetURL ), FALSE );
+ (*aIt)->maImage = SvFileInformationManager::GetFileImage( INetURLObject( (*aIt)->maTargetURL ), sal_False );
}
}
@@ -2418,7 +2417,7 @@ void SvtFileView_Impl::CreateVector_Impl( const Sequence < OUString > &rList )
// detect the image
INetURLObject aObj( pEntry->maImageURL.getLength() ? pEntry->maImageURL : pEntry->maTargetURL );
- pEntry->maImage = SvFileInformationManager::GetImage( aObj, FALSE );
+ pEntry->maImage = SvFileInformationManager::GetImage( aObj, sal_False );
maContent.push_back( pEntry );
}
@@ -2449,7 +2448,7 @@ void SvtFileView_Impl::Resort_Impl( sal_Int16 nColumn, sal_Bool bAscending )
if ( !mbIsFirstResort )
{
- ULONG nPos = GetEntryPos( aEntryURL );
+ sal_uLong nPos = GetEntryPos( aEntryURL );
if ( nPos < mpView->GetEntryCount() )
{
pEntry = mpView->GetEntry( nPos );
@@ -2538,7 +2537,7 @@ sal_Bool CompareSortingData_Impl( SortingData_Impl* const aOne, SortingData_Impl
}
}
- // when the two elements are equal, we must not return TRUE (which would
+ // when the two elements are equal, we must not return sal_True (which would
// happen if we just return ! ( a < b ) when not sorting ascending )
if ( bEqual )
return sal_False;
@@ -2628,7 +2627,7 @@ String SvtFileView_Impl::FolderInserted( const OUString& rURL, const OUString& r
::svtools::VolumeInfo aVolInfo;
pData->maType = SvFileInformationManager::GetFolderDescription( aVolInfo );
- pData->maImage = SvFileInformationManager::GetFolderImage( aVolInfo, FALSE );
+ pData->maImage = SvFileInformationManager::GetFolderImage( aVolInfo, sal_False );
OUString aValue;
OUString aTab( RTL_CONSTASCII_USTRINGPARAM( "\t" ));
@@ -2657,12 +2656,12 @@ String SvtFileView_Impl::FolderInserted( const OUString& rURL, const OUString& r
}
// -----------------------------------------------------------------------
-ULONG SvtFileView_Impl::GetEntryPos( const OUString& rURL )
+sal_uLong SvtFileView_Impl::GetEntryPos( const OUString& rURL )
{
::osl::MutexGuard aGuard( maMutex );
std::vector< SortingData_Impl* >::iterator aIt;
- ULONG nPos = 0;
+ sal_uLong nPos = 0;
for ( aIt = maContent.begin(); aIt != maContent.end(); ++aIt )
{
diff --git a/svtools/source/contnr/fileview.src b/svtools/source/contnr/fileview.src
index c8f5e6aa1911..a7e82cf15881 100644
--- a/svtools/source/contnr/fileview.src
+++ b/svtools/source/contnr/fileview.src
@@ -110,6 +110,7 @@ Menu RID_FILEVIEW_CONTEXTMENU
ModalDialog DLG_SVT_QUERYDELETE
{
+ HelpID = "svtools:ModalDialog:DLG_SVT_QUERYDELETE";
SVLook = TRUE ;
OutputSize = TRUE ;
Moveable = TRUE ;
@@ -142,6 +143,7 @@ ModalDialog DLG_SVT_QUERYDELETE
PushButton BTN_YES
{
+ HelpID = "svtools:PushButton:DLG_SVT_QUERYDELETE:BTN_YES";
Pos = MAP_APPFONT ( 6 , 47 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
@@ -151,6 +153,7 @@ ModalDialog DLG_SVT_QUERYDELETE
PushButton BTN_ALL
{
+ HelpID = "svtools:PushButton:DLG_SVT_QUERYDELETE:BTN_ALL";
Pos = MAP_APPFONT ( 59 , 47 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
@@ -160,6 +163,7 @@ ModalDialog DLG_SVT_QUERYDELETE
PushButton BTN_NO
{
+ HelpID = "svtools:PushButton:DLG_SVT_QUERYDELETE:BTN_NO";
Pos = MAP_APPFONT ( 112 , 47 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx
index 4a7b54c6fed3..517f0f6b66f1 100644
--- a/svtools/source/contnr/imivctl.hxx
+++ b/svtools/source/contnr/imivctl.hxx
@@ -38,7 +38,7 @@
#include <limits.h>
-#include "ivctrl.hxx"
+#include <svtools/ivctrl.hxx>
#include <svl/svarray.hxx>
class IcnCursor_Impl;
@@ -56,7 +56,7 @@ class IcnGridMap_Impl;
#define F_VER_SBARSIZE_WITH_HBAR 0x0001
#define F_HOR_SBARSIZE_WITH_VBAR 0x0002
-#define F_PAINTED 0x0004 // TRUE nach erstem Paint
+#define F_PAINTED 0x0004 // sal_True nach erstem Paint
#define F_ADD_MODE 0x0008
#define F_SELECTING_RECT 0x0020
#define F_DOWN_CTRL 0x0080
@@ -105,11 +105,11 @@ enum IcnViewFieldType
//
struct LocalFocus
{
- BOOL bOn;
+ sal_Bool bOn;
Rectangle aRect;
Color aPenColor;
- LocalFocus() { bOn = FALSE; }
+ LocalFocus() { bOn = sal_False; }
};
///////////////////////////////////////////////////////////////////////////////
@@ -129,18 +129,18 @@ private:
public:
EntryList_Impl(
SvxIconChoiceCtrl_Impl*,
- USHORT _nInitSize = 1024,
- USHORT _nReSize = 1024 );
+ sal_uInt16 _nInitSize = 1024,
+ sal_uInt16 _nReSize = 1024 );
EntryList_Impl(
SvxIconChoiceCtrl_Impl*,
- USHORT _nBlockSize,
- USHORT _nInitSize,
- USHORT _nReSize );
+ sal_uInt16 _nBlockSize,
+ sal_uInt16 _nInitSize,
+ sal_uInt16 _nReSize );
~EntryList_Impl();
void Clear();
- void Insert( SvxIconChoiceCtrlEntry* pEntry, ULONG nPos );
- SvxIconChoiceCtrlEntry* Remove( ULONG nPos );
+ void Insert( SvxIconChoiceCtrlEntry* pEntry, sal_uLong nPos );
+ SvxIconChoiceCtrlEntry* Remove( sal_uLong nPos );
void Remove( SvxIconChoiceCtrlEntry* pEntry );
};
@@ -155,7 +155,7 @@ class SvxIconChoiceCtrl_Impl
friend class EntryList_Impl;
friend class IcnGridMap_Impl;
- BOOL bChooseWithCursor;
+ sal_Bool bChooseWithCursor;
EntryList_Impl aEntries;
ScrollBar aVerSBar;
ScrollBar aHorSBar;
@@ -185,12 +185,12 @@ class SvxIconChoiceCtrl_Impl
IcnViewEdit_Impl* pEdit;
WinBits nWinBits;
long nMaxBoundHeight; // Hoehe des hoechsten BoundRects
- USHORT nFlags;
- USHORT nCurTextDrawFlags;
- ULONG nUserEventAdjustScrBars;
- ULONG nUserEventShowCursor;
+ sal_uInt16 nFlags;
+ sal_uInt16 nCurTextDrawFlags;
+ sal_uLong nUserEventAdjustScrBars;
+ sal_uLong nUserEventShowCursor;
SvxIconChoiceCtrlEntry* pCurHighlightFrame;
- BOOL bHighlightFramePressed;
+ sal_Bool bHighlightFramePressed;
SvxIconChoiceCtrlEntry* pHead; // Eintrag oben links
SvxIconChoiceCtrlEntry* pCursor;
SvxIconChoiceCtrlEntry* pPrevDropTarget;
@@ -208,16 +208,16 @@ class SvxIconChoiceCtrl_Impl
SvxIconChoiceCtrlEntry* pCurEditedEntry;
SvxIconChoiceCtrlTextMode eTextMode;
SelectionMode eSelectionMode;
- ULONG nSelectionCount;
+ sal_uLong nSelectionCount;
SvxIconChoiceCtrlPositionMode ePositionMode;
- BOOL bBoundRectsDirty;
- BOOL bUpdateMode;
- BOOL bEntryEditingEnabled;
- BOOL bInDragDrop;
+ sal_Bool bBoundRectsDirty;
+ sal_Bool bUpdateMode;
+ sal_Bool bEntryEditingEnabled;
+ sal_Bool bInDragDrop;
- void ShowCursor( BOOL bShow );
+ void ShowCursor( sal_Bool bShow );
- void ImpArrange( BOOL bKeepPredecessors = FALSE );
+ void ImpArrange( sal_Bool bKeepPredecessors = sal_False );
void AdjustVirtSize( const Rectangle& );
void ResetVirtSize();
void CheckScrollBars();
@@ -232,16 +232,16 @@ class SvxIconChoiceCtrl_Impl
DECL_LINK( VisRectChangedHdl, void* );
DECL_LINK( CallSelectHdlHdl, void* );
- void AdjustScrollBars( BOOL bVirtSizeGrowedOnly = FALSE);
+ void AdjustScrollBars( sal_Bool bVirtSizeGrowedOnly = sal_False);
void PositionScrollBars( long nRealWidth, long nRealHeight );
long GetScrollBarPageSize( long nVisibleRange ) const { return ((nVisibleRange*75)/100); }
long GetScrollBarLineSize() const { return nMaxBoundHeight / 2; }
- BOOL HandleScrollCommand( const CommandEvent& rCmd );
+ sal_Bool HandleScrollCommand( const CommandEvent& rCmd );
void ToDocPos( Point& rPosPixel ) { rPosPixel -= pView->GetMapMode().GetOrigin(); }
void InitScrollBarBox();
SvxIconChoiceCtrlEntry* FindNewCursor();
void ToggleSelection( SvxIconChoiceCtrlEntry* );
- void DeselectAllBut( SvxIconChoiceCtrlEntry*, BOOL bPaintSync=FALSE );
+ void DeselectAllBut( SvxIconChoiceCtrlEntry*, sal_Bool bPaintSync=sal_False );
void Center( SvxIconChoiceCtrlEntry* pEntry ) const;
void StopEditTimer() { aEditTimer.Stop(); }
void StartEditTimer() { aEditTimer.Start(); }
@@ -250,13 +250,13 @@ class SvxIconChoiceCtrl_Impl
void SelectRect(
SvxIconChoiceCtrlEntry* pEntry1,
SvxIconChoiceCtrlEntry* pEntry2,
- BOOL bAdd = TRUE,
+ sal_Bool bAdd = sal_True,
SvPtrarr* pOtherRects = 0 );
void SelectRange(
SvxIconChoiceCtrlEntry* pStart,
SvxIconChoiceCtrlEntry* pEnd,
- BOOL bAdd = TRUE );
+ sal_Bool bAdd = sal_True );
void AddSelectedRect( const Rectangle& );
void AddSelectedRect(
@@ -272,27 +272,27 @@ class SvxIconChoiceCtrl_Impl
Point AdjustAtGrid(
const Rectangle& rCenterRect, // "Schwerpunkt" des Objekts (typ. Bmp-Rect)
const Rectangle& rBoundRect ) const;
- ULONG GetPredecessorGrid( const Point& rDocPos) const;
+ sal_uLong GetPredecessorGrid( const Point& rDocPos) const;
void InitPredecessors();
void ClearPredecessors();
- BOOL CheckVerScrollBar();
- BOOL CheckHorScrollBar();
+ sal_Bool CheckVerScrollBar();
+ sal_Bool CheckHorScrollBar();
void CancelUserEvents();
- void EntrySelected( SvxIconChoiceCtrlEntry* pEntry, BOOL bSelect,
- BOOL bSyncPaint );
+ void EntrySelected( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bSelect,
+ sal_Bool bSyncPaint );
void SaveSelection( List** );
- void RepaintEntries( USHORT nEntryFlagsMask );
+ void RepaintEntries( sal_uInt16 nEntryFlagsMask );
void SetListPositions();
void SetDefaultTextSize();
- BOOL IsAutoArrange() const {
- return (BOOL)(ePositionMode == IcnViewPositionModeAutoArrange); }
- BOOL IsAutoAdjust() const {
- return (BOOL)(ePositionMode == IcnViewPositionModeAutoAdjust); }
+ sal_Bool IsAutoArrange() const {
+ return (sal_Bool)(ePositionMode == IcnViewPositionModeAutoArrange); }
+ sal_Bool IsAutoAdjust() const {
+ return (sal_Bool)(ePositionMode == IcnViewPositionModeAutoAdjust); }
void DocRectChanged() { aDocRectChangedTimer.Start(); }
void VisRectChanged() { aVisRectChangedTimer.Start(); }
- void SetOrigin( const Point&, BOOL bDoNotUpdateWallpaper = FALSE );
+ void SetOrigin( const Point&, sal_Bool bDoNotUpdateWallpaper = sal_False );
DECL_LINK( TextEditEndedHdl, IcnViewEdit_Impl* );
@@ -300,7 +300,7 @@ class SvxIconChoiceCtrl_Impl
void HideFocus ();
void DrawFocusRect ( OutputDevice* pOut );
- BOOL IsMnemonicChar( sal_Unicode cChar, ULONG& rPos ) const;
+ sal_Bool IsMnemonicChar( sal_Unicode cChar, sal_uLong& rPos ) const;
public:
@@ -312,52 +312,52 @@ public:
SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pView, WinBits nWinStyle );
~SvxIconChoiceCtrl_Impl();
- BOOL SetChoiceWithCursor ( BOOL bDo = TRUE ) { BOOL bOld=bChooseWithCursor; bChooseWithCursor = bDo; return bOld; }
- void Clear( BOOL bInCtor = FALSE );
+ sal_Bool SetChoiceWithCursor ( sal_Bool bDo = sal_True ) { sal_Bool bOld=bChooseWithCursor; bChooseWithCursor = bDo; return bOld; }
+ void Clear( sal_Bool bInCtor = sal_False );
void SetStyle( WinBits nWinStyle );
WinBits GetStyle() const { return nWinBits; }
- void InsertEntry( SvxIconChoiceCtrlEntry*, ULONG nPos, const Point* pPos=0 );
+ void InsertEntry( SvxIconChoiceCtrlEntry*, sal_uLong nPos, const Point* pPos=0 );
void CreateAutoMnemonics( MnemonicGenerator* _pGenerator = NULL );
void RemoveEntry( SvxIconChoiceCtrlEntry* pEntry );
void FontModified();
- void SelectAll( BOOL bSelect = TRUE, BOOL bPaint = TRUE );
+ void SelectAll( sal_Bool bSelect = sal_True, sal_Bool bPaint = sal_True );
void SelectEntry(
SvxIconChoiceCtrlEntry*,
- BOOL bSelect,
- BOOL bCallHdl = TRUE,
- BOOL bAddToSelection = FALSE,
- BOOL bSyncPaint = FALSE );
+ sal_Bool bSelect,
+ sal_Bool bCallHdl = sal_True,
+ sal_Bool bAddToSelection = sal_False,
+ sal_Bool bSyncPaint = sal_False );
void Paint( const Rectangle& rRect );
- BOOL MouseButtonDown( const MouseEvent& );
- BOOL MouseButtonUp( const MouseEvent& );
- BOOL MouseMove( const MouseEvent&);
- BOOL RequestHelp( const HelpEvent& rHEvt );
+ sal_Bool MouseButtonDown( const MouseEvent& );
+ sal_Bool MouseButtonUp( const MouseEvent& );
+ sal_Bool MouseMove( const MouseEvent&);
+ sal_Bool RequestHelp( const HelpEvent& rHEvt );
void SetCursor_Impl(
SvxIconChoiceCtrlEntry* pOldCursor,
SvxIconChoiceCtrlEntry* pNewCursor,
- BOOL bMod1,
- BOOL bShift,
- BOOL bPaintSync = FALSE);
- BOOL KeyInput( const KeyEvent& );
+ sal_Bool bMod1,
+ sal_Bool bShift,
+ sal_Bool bPaintSync = sal_False);
+ sal_Bool KeyInput( const KeyEvent& );
void Resize();
void GetFocus();
void LoseFocus();
- void SetUpdateMode( BOOL bUpdate );
- BOOL GetUpdateMode() const { return bUpdateMode; }
- void PaintEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL bIsBackgroundPainted=FALSE );
+ void SetUpdateMode( sal_Bool bUpdate );
+ sal_Bool GetUpdateMode() const { return bUpdateMode; }
+ void PaintEntry( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bIsBackgroundPainted=sal_False );
void PaintEntry(
SvxIconChoiceCtrlEntry*,
const Point&,
OutputDevice* pOut = 0,
- BOOL bIsBackgroundPainted = FALSE);
+ sal_Bool bIsBackgroundPainted = sal_False);
void PaintEntryVirtOutDev( SvxIconChoiceCtrlEntry* );
void SetEntryPos(
SvxIconChoiceCtrlEntry* pEntry,
const Point& rPos,
- BOOL bAdjustRow = FALSE,
- BOOL bCheckScrollBars = FALSE,
- BOOL bKeepGridMap = FALSE );
+ sal_Bool bAdjustRow = sal_False,
+ sal_Bool bCheckScrollBars = sal_False,
+ sal_Bool bKeepGridMap = sal_False );
void InvalidateEntry( SvxIconChoiceCtrlEntry* );
IcnViewFieldType GetItem( SvxIconChoiceCtrlEntry*, const Point& rAbsPos );
@@ -367,25 +367,25 @@ public:
SvxIconChoiceCtrlEntry* GetCurEntry() const { return pCursor; }
void SetCursor(
SvxIconChoiceCtrlEntry*,
- // TRUE == bei Single-Selection die Sel. mitfuehren
- BOOL bSyncSingleSelection = TRUE,
- BOOL bShowFocusAsync = FALSE );
+ // sal_True == bei Single-Selection die Sel. mitfuehren
+ sal_Bool bSyncSingleSelection = sal_True,
+ sal_Bool bShowFocusAsync = sal_False );
- SvxIconChoiceCtrlEntry* GetEntry( const Point& rDocPos, BOOL bHit = FALSE );
+ SvxIconChoiceCtrlEntry* GetEntry( const Point& rDocPos, sal_Bool bHit = sal_False );
SvxIconChoiceCtrlEntry* GetNextEntry( const Point& rDocPos, SvxIconChoiceCtrlEntry* pCurEntry );
SvxIconChoiceCtrlEntry* GetPrevEntry( const Point& rDocPos, SvxIconChoiceCtrlEntry* pCurEntry );
Point GetEntryPos( SvxIconChoiceCtrlEntry* );
- void MakeEntryVisible( SvxIconChoiceCtrlEntry* pEntry, BOOL bBound = TRUE );
+ void MakeEntryVisible( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bBound = sal_True );
- void Arrange(BOOL bKeepPredecessors = FALSE, long nSetMaxVirtWidth =0, long nSetMaxVirtHeight =0 );
+ void Arrange(sal_Bool bKeepPredecessors = sal_False, long nSetMaxVirtWidth =0, long nSetMaxVirtHeight =0 );
Rectangle CalcFocusRect( SvxIconChoiceCtrlEntry* );
Rectangle CalcBmpRect( SvxIconChoiceCtrlEntry*, const Point* pPos = 0 );
Rectangle CalcTextRect(
SvxIconChoiceCtrlEntry*,
const Point* pPos = 0,
- BOOL bForInplaceEdit = FALSE,
+ sal_Bool bForInplaceEdit = sal_False,
const String* pStr = 0 );
long CalcBoundingWidth( SvxIconChoiceCtrlEntry* ) const;
@@ -402,44 +402,44 @@ public:
void RecalcAllBoundingRectsSmart();
const Rectangle& GetEntryBoundRect( SvxIconChoiceCtrlEntry* );
void InvalidateBoundingRect( SvxIconChoiceCtrlEntry* );
- void InvalidateBoundingRect( Rectangle& rRect ) { rRect.Right() = LONG_MAX; bBoundRectsDirty = TRUE; }
- BOOL IsBoundingRectValid( const Rectangle& rRect ) const { return (BOOL)( rRect.Right() != LONG_MAX ); }
+ void InvalidateBoundingRect( Rectangle& rRect ) { rRect.Right() = LONG_MAX; bBoundRectsDirty = sal_True; }
+ sal_Bool IsBoundingRectValid( const Rectangle& rRect ) const { return (sal_Bool)( rRect.Right() != LONG_MAX ); }
void PaintEmphasis(
const Rectangle& rRect1,
const Rectangle& rRect2,
- BOOL bSelected,
- BOOL bDropTarget,
- BOOL bCursored,
+ sal_Bool bSelected,
+ sal_Bool bDropTarget,
+ sal_Bool bCursored,
OutputDevice* pOut,
- BOOL bIsBackgroundPainted = FALSE);
+ sal_Bool bIsBackgroundPainted = sal_False);
void PaintItem(
const Rectangle& rRect,
IcnViewFieldType eItem,
SvxIconChoiceCtrlEntry* pEntry,
- USHORT nPaintFlags,
+ sal_uInt16 nPaintFlags,
OutputDevice* pOut,
const String* pStr = 0,
::vcl::ControlLayoutData* _pLayoutData = NULL );
- // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == TRUE
+ // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == sal_True
void CheckBoundingRects() { if (bBoundRectsDirty) RecalcAllBoundingRectsSmart(); }
// berechnet alle invalidierten BoundingRects neu
void UpdateBoundingRects();
- void ShowTargetEmphasis( SvxIconChoiceCtrlEntry* pEntry, BOOL bShow );
+ void ShowTargetEmphasis( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bShow );
void PrepareCommandEvent( const CommandEvent& );
void Command( const CommandEvent& rCEvt );
void ToTop( SvxIconChoiceCtrlEntry* );
- ULONG GetSelectionCount() const;
+ sal_uLong GetSelectionCount() const;
void SetGrid( const Size& );
Size GetMinGrid() const;
- ULONG GetGridCount(
+ sal_uLong GetGridCount(
const Size& rSize,
- BOOL bCheckScrBars,
- BOOL bSmartScrBar ) const;
- void Scroll( long nDeltaX, long nDeltaY, BOOL bScrollBar = FALSE );
+ sal_Bool bCheckScrBars,
+ sal_Bool bSmartScrBar ) const;
+ void Scroll( long nDeltaX, long nDeltaY, sal_Bool bScrollBar = sal_False );
const Size& GetItemSize( SvxIconChoiceCtrlEntry*, IcnViewFieldType ) const;
void HideDDIcon();
@@ -448,67 +448,67 @@ public:
SvxIconChoiceCtrlEntry* pRefEntry,
const Point& rPos );
- BOOL IsOver(
+ sal_Bool IsOver(
SvPtrarr* pSelectedRectList,
const Rectangle& rEntryBoundRect ) const;
void SelectRect(
const Rectangle&,
- BOOL bAdd = TRUE,
+ sal_Bool bAdd = sal_True,
SvPtrarr* pOtherRects = 0 );
void CalcScrollOffsets(
const Point& rRefPosPixel,
long& rX,
long& rY,
- BOOL bDragDrop = FALSE,
- USHORT nBorderWidth = 10 );
+ sal_Bool bDragDrop = sal_False,
+ sal_uInt16 nBorderWidth = 10 );
- BOOL IsTextHit( SvxIconChoiceCtrlEntry* pEntry, const Point& rDocPos );
+ sal_Bool IsTextHit( SvxIconChoiceCtrlEntry* pEntry, const Point& rDocPos );
void MakeVisible(
const Rectangle& rDocPos,
- BOOL bInScrollBarEvent=FALSE,
- BOOL bCallRectChangedHdl = TRUE );
+ sal_Bool bInScrollBarEvent=sal_False,
+ sal_Bool bCallRectChangedHdl = sal_True );
void AdjustEntryAtGrid( SvxIconChoiceCtrlEntry* pStart = 0 );
void SetEntryTextMode( SvxIconChoiceCtrlTextMode, SvxIconChoiceCtrlEntry* pEntry = 0 );
SvxIconChoiceCtrlTextMode GetTextMode( const SvxIconChoiceCtrlEntry* pEntry = 0 ) const;
void ShowEntryFocusRect( const SvxIconChoiceCtrlEntry* pEntry );
- void EnableEntryEditing( BOOL bEnable ) { bEntryEditingEnabled = bEnable; }
- BOOL IsEntryEditingEnabled() const { return bEntryEditingEnabled; }
- BOOL IsEntryEditing() const { return (BOOL)(pCurEditedEntry!=0); }
+ void EnableEntryEditing( sal_Bool bEnable ) { bEntryEditingEnabled = bEnable; }
+ sal_Bool IsEntryEditingEnabled() const { return bEntryEditingEnabled; }
+ sal_Bool IsEntryEditing() const { return (sal_Bool)(pCurEditedEntry!=0); }
void EditEntry( SvxIconChoiceCtrlEntry* pEntry );
- void StopEntryEditing( BOOL bCancel );
- void LockEntryPos( SvxIconChoiceCtrlEntry* pEntry, BOOL bLock );
- ULONG GetEntryCount() const { return aEntries.Count(); }
- SvxIconChoiceCtrlEntry* GetEntry( ULONG nPos ) const { return (SvxIconChoiceCtrlEntry*)aEntries.GetObject(nPos); }
- SvxIconChoiceCtrlEntry* GetFirstSelectedEntry( ULONG& ) const;
- SvxIconChoiceCtrlEntry* GetNextSelectedEntry( ULONG& ) const;
+ void StopEntryEditing( sal_Bool bCancel );
+ void LockEntryPos( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bLock );
+ sal_uLong GetEntryCount() const { return aEntries.Count(); }
+ SvxIconChoiceCtrlEntry* GetEntry( sal_uLong nPos ) const { return (SvxIconChoiceCtrlEntry*)aEntries.GetObject(nPos); }
+ SvxIconChoiceCtrlEntry* GetFirstSelectedEntry( sal_uLong& ) const;
+ SvxIconChoiceCtrlEntry* GetNextSelectedEntry( sal_uLong& ) const;
SvxIconChoiceCtrlEntry* GetHdlEntry() const { return pHdlEntry; }
void SetHdlEntry( SvxIconChoiceCtrlEntry* pEntry ) { pHdlEntry = pEntry; }
SvxIconChoiceCtrlTextMode GetEntryTextModeSmart( const SvxIconChoiceCtrlEntry* pEntry ) const;
void SetSelectionMode( SelectionMode eMode ) { eSelectionMode=eMode; }
SelectionMode GetSelectionMode() const { return eSelectionMode; }
- BOOL AreEntriesMoved() const { return (BOOL)((nFlags & F_MOVED_ENTRIES)!=0); }
- void SetEntriesMoved( BOOL bMoved )
+ sal_Bool AreEntriesMoved() const { return (sal_Bool)((nFlags & F_MOVED_ENTRIES)!=0); }
+ void SetEntriesMoved( sal_Bool bMoved )
{
if( bMoved ) nFlags |= F_MOVED_ENTRIES;
else nFlags &= ~(F_MOVED_ENTRIES);
}
- ULONG GetEntryListPos( SvxIconChoiceCtrlEntry* ) const;
- void SetEntryListPos( SvxIconChoiceCtrlEntry* pEntry, ULONG nNewPos );
+ sal_uLong GetEntryListPos( SvxIconChoiceCtrlEntry* ) const;
+ void SetEntryListPos( SvxIconChoiceCtrlEntry* pEntry, sal_uLong nNewPos );
void SetEntryImageSize( const Size& rSize ) { aImageSize = rSize; }
- void SetEntryFlags( SvxIconChoiceCtrlEntry* pEntry, USHORT nFlags );
- SvxIconChoiceCtrlEntry* GoLeftRight( SvxIconChoiceCtrlEntry*, BOOL bRight );
- SvxIconChoiceCtrlEntry* GoUpDown( SvxIconChoiceCtrlEntry*, BOOL bDown );
+ void SetEntryFlags( SvxIconChoiceCtrlEntry* pEntry, sal_uInt16 nFlags );
+ SvxIconChoiceCtrlEntry* GoLeftRight( SvxIconChoiceCtrlEntry*, sal_Bool bRight );
+ SvxIconChoiceCtrlEntry* GoUpDown( SvxIconChoiceCtrlEntry*, sal_Bool bDown );
void InitSettings();
Rectangle GetOutputRect() const;
- BOOL ArePredecessorsSet() const { return (BOOL)(pHead != 0); }
+ sal_Bool ArePredecessorsSet() const { return (sal_Bool)(pHead != 0); }
SvxIconChoiceCtrlEntry* GetPredecessorHead() const { return pHead; }
void SetEntryPredecessor(SvxIconChoiceCtrlEntry* pEntry,SvxIconChoiceCtrlEntry* pPredecessor);
- BOOL GetEntryPredecessor(SvxIconChoiceCtrlEntry* pEntry,SvxIconChoiceCtrlEntry** ppPredecessor);
+ sal_Bool GetEntryPredecessor(SvxIconChoiceCtrlEntry* pEntry,SvxIconChoiceCtrlEntry** ppPredecessor);
// liefert gueltige Ergebnisse nur im AutoArrange-Modus!
SvxIconChoiceCtrlEntry* FindEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry, const Point& );
@@ -516,24 +516,24 @@ public:
SvxIconChoiceCtrlPositionMode GetPositionMode() const { return ePositionMode;}
void Flush();
- void SetColumn( USHORT nIndex, const SvxIconChoiceCtrlColumnInfo& );
- const SvxIconChoiceCtrlColumnInfo* GetColumn( USHORT nIndex ) const;
- const SvxIconChoiceCtrlColumnInfo* GetItemColumn( USHORT nSubItem, long& rLeft ) const;
+ void SetColumn( sal_uInt16 nIndex, const SvxIconChoiceCtrlColumnInfo& );
+ const SvxIconChoiceCtrlColumnInfo* GetColumn( sal_uInt16 nIndex ) const;
+ const SvxIconChoiceCtrlColumnInfo* GetItemColumn( sal_uInt16 nSubItem, long& rLeft ) const;
Rectangle GetDocumentRect() const { return Rectangle( Point(), aVirtOutputSize ); }
Rectangle GetVisibleRect() const { return GetOutputRect(); }
- void SetEntryHighlightFrame( SvxIconChoiceCtrlEntry* pEntry,BOOL bKeepHighlightFlags=FALSE );
+ void SetEntryHighlightFrame( SvxIconChoiceCtrlEntry* pEntry,sal_Bool bKeepHighlightFlags=sal_False );
void HideEntryHighlightFrame();
void DrawHighlightFrame( OutputDevice* pOut,
- const Rectangle& rBmpRect, BOOL bHide );
+ const Rectangle& rBmpRect, sal_Bool bHide );
void StopSelectTimer() { aCallSelectHdlTimer.Stop(); }
void Tracking( const TrackingEvent& rTEvt );
Point GetPopupMenuPosPixel() const;
- BOOL HandleShortCutKey( const KeyEvent& rKeyEvent );
+ sal_Bool HandleShortCutKey( const KeyEvent& rKeyEvent );
- void CallEventListeners( ULONG nEvent, void* pData = NULL );
+ void CallEventListeners( sal_uLong nEvent, void* pData = NULL );
inline ::svt::IAccessibleFactory&
GetAccessibleFactory() { return aAccFactory.getFactory(); }
@@ -555,12 +555,12 @@ class IcnCursor_Impl
void ImplCreate();
void Create() { if( !pColumns ) ImplCreate(); }
- USHORT GetSortListPos( SvPtrarr* pList, long nValue, int bVertical);
- SvxIconChoiceCtrlEntry* SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom,USHORT nPref,
- BOOL bDown, BOOL bSimple );
+ sal_uInt16 GetSortListPos( SvPtrarr* pList, long nValue, int bVertical);
+ SvxIconChoiceCtrlEntry* SearchCol(sal_uInt16 nCol,sal_uInt16 nTop,sal_uInt16 nBottom,sal_uInt16 nPref,
+ sal_Bool bDown, sal_Bool bSimple );
- SvxIconChoiceCtrlEntry* SearchRow(USHORT nRow,USHORT nRight,USHORT nLeft,USHORT nPref,
- BOOL bRight, BOOL bSimple );
+ SvxIconChoiceCtrlEntry* SearchRow(sal_uInt16 nRow,sal_uInt16 nRight,sal_uInt16 nLeft,sal_uInt16 nPref,
+ sal_Bool bRight, sal_Bool bSimple );
public:
IcnCursor_Impl( SvxIconChoiceCtrl_Impl* pOwner );
@@ -568,9 +568,9 @@ public:
void Clear();
// fuer Cursortravelling usw.
- SvxIconChoiceCtrlEntry* GoLeftRight( SvxIconChoiceCtrlEntry*, BOOL bRight );
- SvxIconChoiceCtrlEntry* GoUpDown( SvxIconChoiceCtrlEntry*, BOOL bDown );
- SvxIconChoiceCtrlEntry* GoPageUpDown( SvxIconChoiceCtrlEntry*, BOOL bDown );
+ SvxIconChoiceCtrlEntry* GoLeftRight( SvxIconChoiceCtrlEntry*, sal_Bool bRight );
+ SvxIconChoiceCtrlEntry* GoUpDown( SvxIconChoiceCtrlEntry*, sal_Bool bDown );
+ SvxIconChoiceCtrlEntry* GoPageUpDown( SvxIconChoiceCtrlEntry*, sal_Bool bDown );
// Erzeugt fuer jede Zeile (Hoehe=nGridDY) eine nach BoundRect.Left()
// sortierte Liste der Eintraege, die in ihr stehen. Eine Liste kann
@@ -582,7 +582,7 @@ public:
// ----------------------------------------------------------------------------------------------
-typedef ULONG GridId;
+typedef sal_uLong GridId;
#define GRID_NOT_FOUND ((GridId)ULONG_MAX)
@@ -590,14 +590,14 @@ class IcnGridMap_Impl
{
Rectangle _aLastOccupiedGrid;
SvxIconChoiceCtrl_Impl* _pView;
- BOOL* _pGridMap;
- USHORT _nGridCols, _nGridRows;
+ sal_Bool* _pGridMap;
+ sal_uInt16 _nGridCols, _nGridRows;
void Expand();
void Create_Impl();
void Create() { if(!_pGridMap) Create_Impl(); }
- void GetMinMapSize( USHORT& rDX, USHORT& rDY ) const;
+ void GetMinMapSize( sal_uInt16& rDX, sal_uInt16& rDY ) const;
public:
IcnGridMap_Impl(SvxIconChoiceCtrl_Impl* pView);
@@ -605,22 +605,22 @@ public:
void Clear();
- GridId GetGrid( const Point& rDocPos, BOOL* pbClipped = 0 );
- GridId GetGrid( USHORT nGridX, USHORT nGridY );
- GridId GetUnoccupiedGrid( BOOL bOccupyFound=TRUE );
+ GridId GetGrid( const Point& rDocPos, sal_Bool* pbClipped = 0 );
+ GridId GetGrid( sal_uInt16 nGridX, sal_uInt16 nGridY );
+ GridId GetUnoccupiedGrid( sal_Bool bOccupyFound=sal_True );
- void OccupyGrids( const Rectangle&, BOOL bOccupy = TRUE );
- void OccupyGrids( const SvxIconChoiceCtrlEntry*, BOOL bOccupy = TRUE );
- void OccupyGrid( GridId nId, BOOL bOccupy = TRUE )
+ void OccupyGrids( const Rectangle&, sal_Bool bOccupy = sal_True );
+ void OccupyGrids( const SvxIconChoiceCtrlEntry*, sal_Bool bOccupy = sal_True );
+ void OccupyGrid( GridId nId, sal_Bool bOccupy = sal_True )
{
- DBG_ASSERT(!_pGridMap || nId<(ULONG)(_nGridCols*_nGridRows),"OccupyGrid: Bad GridId");
- if(_pGridMap && nId < (ULONG)(_nGridCols *_nGridRows) )
+ DBG_ASSERT(!_pGridMap || nId<(sal_uLong)(_nGridCols*_nGridRows),"OccupyGrid: Bad GridId");
+ if(_pGridMap && nId < (sal_uLong)(_nGridCols *_nGridRows) )
_pGridMap[ nId ] = bOccupy;
}
Rectangle GetGridRect( GridId );
- void GetGridCoord( GridId, USHORT& rGridX, USHORT& rGridY );
- static ULONG GetGridCount( const Size& rSizePixel, USHORT nGridWidth, USHORT nGridHeight );
+ void GetGridCoord( GridId, sal_uInt16& rGridX, sal_uInt16& rGridY );
+ static sal_uLong GetGridCount( const Size& rSizePixel, sal_uInt16 nGridWidth, sal_uInt16 nGridHeight );
void OutputSizeChanged();
};
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index fb3f11060adf..640f6c5ae923 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -41,7 +41,7 @@
#include <vcl/mnemonic.hxx>
#include <vcl/controllayout.hxx>
-#include "ivctrl.hxx"
+#include <svtools/ivctrl.hxx>
#include "imivctl.hxx"
#include <svtools/svmedit.hxx>
@@ -69,7 +69,7 @@ struct SvxIconChoiceCtrlEntry_Impl
: _pEntry( pEntry), _aPos( rBoundRect.TopLeft()) {}
};
-static BOOL bEndScrollInvalidate = TRUE;
+static sal_Bool bEndScrollInvalidate = sal_True;
class IcnViewEdit_Impl : public MultiLineEdit
{
@@ -77,9 +77,9 @@ class IcnViewEdit_Impl : public MultiLineEdit
Accelerator aAccReturn;
Accelerator aAccEscape;
Timer aTimer;
- BOOL bCanceled;
- BOOL bAlreadyInCallback;
- BOOL bGrabFocus;
+ sal_Bool bCanceled;
+ sal_Bool bAlreadyInCallback;
+ sal_Bool bGrabFocus;
void CallCallBackHdl_Impl();
DECL_LINK( Timeout_Impl, Timer * );
@@ -98,9 +98,9 @@ public:
~IcnViewEdit_Impl();
virtual void KeyInput( const KeyEvent& rKEvt );
virtual long PreNotify( NotifyEvent& rNEvt );
- BOOL EditingCanceled() const { return bCanceled; }
- void StopEditing( BOOL bCancel = FALSE );
- BOOL IsGrabFocus() const { return bGrabFocus; }
+ sal_Bool EditingCanceled() const { return bCanceled; }
+ void StopEditing( sal_Bool bCancel = sal_False );
+ sal_Bool IsGrabFocus() const { return bGrabFocus; }
};
SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pCurView,
@@ -112,7 +112,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pCurView,
aImageSize( 32, 32 ),
pColumns( 0 )
{
- bChooseWithCursor=FALSE;
+ bChooseWithCursor=sal_False;
pEntryPaintDev = 0;
pCurEditedEntry = 0;
pCurHighlightFrame = 0;
@@ -123,10 +123,10 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pCurView,
pHdlEntry = 0;
pHead = NULL;
pCursor = NULL;
- bUpdateMode = TRUE;
- bEntryEditingEnabled = FALSE;
- bInDragDrop = FALSE;
- bHighlightFramePressed = FALSE;
+ bUpdateMode = sal_True;
+ bEntryEditingEnabled = sal_False;
+ bInDragDrop = sal_False;
+ bHighlightFramePressed = sal_False;
eSelectionMode = MULTIPLE_SELECTION;
pView = pCurView;
pZOrderList = new List; //SvPtrarr;
@@ -166,7 +166,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pCurView,
aVisRectChangedTimer.SetTimeout( 50 );
aVisRectChangedTimer.SetTimeoutHdl(LINK(this,SvxIconChoiceCtrl_Impl,VisRectChangedHdl));
- Clear( TRUE );
+ Clear( sal_True );
SetGrid( Size(100, 70) );
}
@@ -190,17 +190,17 @@ SvxIconChoiceCtrl_Impl::~SvxIconChoiceCtrl_Impl()
ClearColumnList();
}
-void SvxIconChoiceCtrl_Impl::Clear( BOOL bInCtor )
+void SvxIconChoiceCtrl_Impl::Clear( sal_Bool bInCtor )
{
- StopEntryEditing( TRUE );
+ StopEntryEditing( sal_True );
nSelectionCount = 0;
DELETEZ(pDraggedSelection);
- bInDragDrop = FALSE;
+ bInDragDrop = sal_False;
pCurHighlightFrame = 0;
StopEditTimer();
CancelUserEvents();
- ShowCursor( FALSE );
- bBoundRectsDirty = FALSE;
+ ShowCursor( sal_False );
+ bBoundRectsDirty = sal_False;
nMaxBoundHeight = 0;
nFlags &= ~(F_PAINTED | F_MOVED_ENTRIES);
@@ -224,8 +224,8 @@ void SvxIconChoiceCtrl_Impl::Clear( BOOL bInCtor )
pView->Invalidate(INVALIDATE_NOCHILDREN);
}
AdjustScrollBars();
- ULONG nCount = aEntries.Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ sal_uLong nCount = aEntries.Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pCur = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur );
delete pCur;
@@ -254,19 +254,19 @@ void SvxIconChoiceCtrl_Impl::SetStyle( WinBits nWinStyle )
IMPL_LINK( SvxIconChoiceCtrl_Impl, ScrollUpDownHdl, ScrollBar*, pScrollBar )
{
- StopEntryEditing( TRUE );
+ StopEntryEditing( sal_True );
// Pfeil hoch: delta=-1; Pfeil runter: delta=+1
- Scroll( 0, pScrollBar->GetDelta(), TRUE );
- bEndScrollInvalidate = TRUE;
+ Scroll( 0, pScrollBar->GetDelta(), sal_True );
+ bEndScrollInvalidate = sal_True;
return 0;
}
IMPL_LINK( SvxIconChoiceCtrl_Impl, ScrollLeftRightHdl, ScrollBar*, pScrollBar )
{
- StopEntryEditing( TRUE );
+ StopEntryEditing( sal_True );
// Pfeil links: delta=-1; Pfeil rechts: delta=+1
- Scroll( pScrollBar->GetDelta(), 0, TRUE );
- bEndScrollInvalidate = TRUE;
+ Scroll( pScrollBar->GetDelta(), 0, sal_True );
+ bEndScrollInvalidate = sal_True;
return 0;
}
@@ -288,11 +288,11 @@ void SvxIconChoiceCtrl_Impl::FontModified()
DELETEZ(pDDTempDev);
DELETEZ(pEntryPaintDev);
SetDefaultTextSize();
- ShowCursor( FALSE );
- ShowCursor( TRUE );
+ ShowCursor( sal_False );
+ ShowCursor( sal_True );
}
-void SvxIconChoiceCtrl_Impl::InsertEntry( SvxIconChoiceCtrlEntry* pEntry, ULONG nPos,
+void SvxIconChoiceCtrl_Impl::InsertEntry( SvxIconChoiceCtrlEntry* pEntry, sal_uLong nPos,
const Point* pPos )
{
StopEditTimer();
@@ -309,13 +309,13 @@ void SvxIconChoiceCtrl_Impl::InsertEntry( SvxIconChoiceCtrlEntry* pEntry, ULONG
{
Size aSize( CalcBoundingSize( pEntry ) );
SetBoundingRect_Impl( pEntry, *pPos, aSize );
- SetEntryPos( pEntry, *pPos, FALSE, TRUE, TRUE /*keep grid map*/ );
+ SetEntryPos( pEntry, *pPos, sal_False, sal_True, sal_True /*keep grid map*/ );
pEntry->nFlags |= ICNVIEW_FLAG_POS_MOVED;
- SetEntriesMoved( TRUE );
+ SetEntriesMoved( sal_True );
}
else
{
- // wenn der UpdateMode TRUE ist, wollen wir nicht pauschal alle
+ // wenn der UpdateMode sal_True ist, wollen wir nicht pauschal alle
// BoundRects auf 'zu ueberpruefen' setzen, sondern nur das des
// neuen Eintrags. Deshalb kein InvalidateBoundingRect aufrufen!
pEntry->aRect.Right() = LONG_MAX;
@@ -342,8 +342,8 @@ void SvxIconChoiceCtrl_Impl::CreateAutoMnemonics( MnemonicGenerator* _pGenerator
pAutoDeleteOwnGenerator.reset( _pGenerator );
}
- ULONG nEntryCount = GetEntryCount();
- ULONG i;
+ sal_uLong nEntryCount = GetEntryCount();
+ sal_uLong i;
// insert texts in generator
for( i = 0; i < nEntryCount; ++i )
@@ -376,8 +376,8 @@ void SvxIconChoiceCtrl_Impl::SetListPositions()
if( nFlags & F_ENTRYLISTPOS_VALID )
return;
- ULONG nCount = aEntries.Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ sal_uLong nCount = aEntries.Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur );
pEntry->nPos = nCur;
@@ -387,14 +387,14 @@ void SvxIconChoiceCtrl_Impl::SetListPositions()
void SvxIconChoiceCtrl_Impl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry )
{
- BOOL bSyncSingleSelection;
+ sal_Bool bSyncSingleSelection;
// bei Single-Selection wird die Selektion beim Umsetzen des Cursors
// mitgefuehrt. Das soll aber nur erfolgen, wenn ueberhaupt ein
// Eintrag selektiert ist.
if( GetSelectionCount() )
- bSyncSingleSelection = TRUE;
+ bSyncSingleSelection = sal_True;
else
- bSyncSingleSelection = FALSE;
+ bSyncSingleSelection = sal_False;
if( pEntry == pCurHighlightFrame )
pCurHighlightFrame = 0;
@@ -402,7 +402,7 @@ void SvxIconChoiceCtrl_Impl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry )
if( bInDragDrop )
{
DELETEZ(pDraggedSelection);
- bInDragDrop = FALSE;
+ bInDragDrop = sal_False;
}
if( pEntry->IsSelected() )
@@ -419,25 +419,25 @@ void SvxIconChoiceCtrl_Impl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry )
pAnchor = 0;
if( pEntry->IsSelected() )
nSelectionCount--;
- BOOL bEntryBoundValid = IsBoundingRectValid( pEntry->aRect );
+ sal_Bool bEntryBoundValid = IsBoundingRectValid( pEntry->aRect );
if( bEntryBoundValid )
pView->Invalidate( pEntry->aRect );
- BOOL bSetNewCursor = FALSE;
+ sal_Bool bSetNewCursor = sal_False;
SvxIconChoiceCtrlEntry* pNewCursor = NULL;
if( pEntry == pCursor )
{
- bSetNewCursor = TRUE;
+ bSetNewCursor = sal_True;
pNewCursor = FindNewCursor();
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
pCursor = 0;
}
- BOOL bCurEntryPosValid = (nFlags & F_ENTRYLISTPOS_VALID) ? TRUE : FALSE;
+ sal_Bool bCurEntryPosValid = (nFlags & F_ENTRYLISTPOS_VALID) ? sal_True : sal_False;
if( bCurEntryPosValid && aEntries.GetObject(aEntries.Count()-1) != pEntry )
nFlags &= ~F_ENTRYLISTPOS_VALID;
- ULONG nPos = pZOrderList->GetPos( (void*)pEntry );
+ sal_uLong nPos = pZOrderList->GetPos( (void*)pEntry );
pZOrderList->Remove( nPos );
if( bCurEntryPosValid )
{
@@ -455,12 +455,12 @@ void SvxIconChoiceCtrl_Impl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry )
{
// Fokusrechteck asynchron einblenden, um das Loeschen einer
// Multiselektion zu beschleunigen.
- SetCursor( pNewCursor, bSyncSingleSelection, TRUE );
+ SetCursor( pNewCursor, bSyncSingleSelection, sal_True );
}
}
-void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL bSelect,
- BOOL bCallHdl, BOOL bAdd, BOOL bSyncPaint )
+void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bSelect,
+ sal_Bool bCallHdl, sal_Bool bAdd, sal_Bool bSyncPaint )
{
if( eSelectionMode == NO_SELECTION )
return;
@@ -477,7 +477,7 @@ void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL b
if( pEntry->IsSelected() != bSelect )
{
pHdlEntry = pEntry;
- USHORT nEntryFlags = pEntry->GetFlags();
+ sal_uInt16 nEntryFlags = pEntry->GetFlags();
if( bSelect )
{
nEntryFlags |= ICNVIEW_FLAG_SELECTED;
@@ -498,8 +498,8 @@ void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL b
}
}
-void SvxIconChoiceCtrl_Impl::EntrySelected( SvxIconChoiceCtrlEntry* pEntry, BOOL bSelect,
- BOOL bSyncPaint )
+void SvxIconChoiceCtrl_Impl::EntrySelected( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bSelect,
+ sal_Bool bSyncPaint )
{
// bei SingleSelection dafuer sorgen, dass der Cursor immer
// auf dem (einzigen) selektierten Eintrag steht. Aber nur,
@@ -519,7 +519,7 @@ void SvxIconChoiceCtrl_Impl::EntrySelected( SvxIconChoiceCtrlEntry* pEntry, BOOL
if( bUpdateMode )
{
if( pEntry == pCursor )
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
if( pView->IsTracking() && (bSelect || !pView->HasBackground()) ) // beim Tracken immer synchron
PaintEntry( pEntry );
else if( bSyncPaint ) // synchron & mit virtuellem OutDev!
@@ -529,7 +529,7 @@ void SvxIconChoiceCtrl_Impl::EntrySelected( SvxIconChoiceCtrlEntry* pEntry, BOOL
pView->Invalidate( CalcFocusRect( pEntry ) );
}
if( pEntry == pCursor )
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
// #i101012# emit vcl event LISTBOX_SELECT only in case that the given entry is selected.
@@ -544,8 +544,8 @@ void SvxIconChoiceCtrl_Impl::ResetVirtSize()
StopEditTimer();
aVirtOutputSize.Width() = 0;
aVirtOutputSize.Height() = 0;
- const ULONG nCount = aEntries.Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ const sal_uLong nCount = aEntries.Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pCur = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur );
pCur->ClearFlags( ICNVIEW_FLAG_POS_MOVED );
@@ -567,8 +567,8 @@ void SvxIconChoiceCtrl_Impl::ResetVirtSize()
if( aVirtOutputSize.Width() < aRealOutputSize.Width() ||
aVirtOutputSize.Height() < aRealOutputSize.Height() )
{
- ULONG nGridCount = IcnGridMap_Impl::GetGridCount(
- aRealOutputSize, (USHORT)nGridDX, (USHORT)nGridDY );
+ sal_uLong nGridCount = IcnGridMap_Impl::GetGridCount(
+ aRealOutputSize, (sal_uInt16)nGridDX, (sal_uInt16)nGridDY );
if( nGridCount < nCount )
{
if( nWinBits & WB_ALIGN_TOP )
@@ -616,11 +616,11 @@ void SvxIconChoiceCtrl_Impl::AdjustVirtSize( const Rectangle& rRect )
void SvxIconChoiceCtrl_Impl::InitPredecessors()
{
DBG_ASSERT(!pHead,"SvxIconChoiceCtrl_Impl::InitPredecessors() >> Already initialized");
- ULONG nCount = aEntries.Count();
+ sal_uLong nCount = aEntries.Count();
if( nCount )
{
SvxIconChoiceCtrlEntry* pPrev = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( 0 );
- for( ULONG nCur = 1; nCur <= nCount; nCur++ )
+ for( sal_uLong nCur = 1; nCur <= nCount; nCur++ )
{
pPrev->ClearFlags( ICNVIEW_FLAG_POS_LOCKED | ICNVIEW_FLAG_POS_MOVED |
ICNVIEW_FLAG_PRED_SET);
@@ -645,8 +645,8 @@ void SvxIconChoiceCtrl_Impl::ClearPredecessors()
{
if( pHead )
{
- ULONG nCount = aEntries.Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ sal_uLong nCount = aEntries.Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pCur = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur );
pCur->pflink = 0;
@@ -657,7 +657,7 @@ void SvxIconChoiceCtrl_Impl::ClearPredecessors()
}
}
-void SvxIconChoiceCtrl_Impl::Arrange( BOOL bKeepPredecessors, long nSetMaxVirtWidth, long nSetMaxVirtHeight )
+void SvxIconChoiceCtrl_Impl::Arrange( sal_Bool bKeepPredecessors, long nSetMaxVirtWidth, long nSetMaxVirtHeight )
{
if ( nSetMaxVirtWidth != 0 )
nMaxVirtWidth = nSetMaxVirtWidth;
@@ -672,23 +672,23 @@ void SvxIconChoiceCtrl_Impl::Arrange( BOOL bKeepPredecessors, long nSetMaxVirtWi
ImpArrange( bKeepPredecessors );
}
-void SvxIconChoiceCtrl_Impl::ImpArrange( BOOL bKeepPredecessors )
+void SvxIconChoiceCtrl_Impl::ImpArrange( sal_Bool bKeepPredecessors )
{
static Point aEmptyPoint;
- BOOL bOldUpdate = bUpdateMode;
+ sal_Bool bOldUpdate = bUpdateMode;
Rectangle aCurOutputArea( GetOutputRect() );
if( (nWinBits & WB_SMART_ARRANGE) && aCurOutputArea.TopLeft() != aEmptyPoint )
- bUpdateMode = FALSE;
+ bUpdateMode = sal_False;
aAutoArrangeTimer.Stop();
nFlags &= ~F_MOVED_ENTRIES;
nFlags |= F_ARRANGING;
StopEditTimer();
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
ResetVirtSize();
if( !bKeepPredecessors )
ClearPredecessors();
- bBoundRectsDirty = FALSE;
+ bBoundRectsDirty = sal_False;
SetOrigin( Point() );
VisRectChanged();
RecalcAllBoundingRectsSmart();
@@ -701,12 +701,12 @@ void SvxIconChoiceCtrl_Impl::ImpArrange( BOOL bKeepPredecessors )
MakeVisible( aCurOutputArea );
SetUpdateMode( bOldUpdate );
}
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect )
{
- bEndScrollInvalidate = FALSE;
+ bEndScrollInvalidate = sal_False;
#if defined(OV_DRAWGRID)
Color aOldColor ( pView->GetLineColor() );
@@ -755,14 +755,14 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect )
if( !pCursor )
{
// set cursor to item with focus-flag
- BOOL bfound = FALSE;
- for ( ULONG i = 0; i < pView->GetEntryCount() && !bfound; i++)
+ sal_Bool bfound = sal_False;
+ for ( sal_uLong i = 0; i < pView->GetEntryCount() && !bfound; i++)
{
SvxIconChoiceCtrlEntry* pEntry = pView->GetEntry ( i );
if( pEntry->IsFocused() )
{
pCursor = pEntry;
- bfound=TRUE;
+ bfound=sal_True;
}
}
@@ -774,31 +774,31 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect )
if ( pView->HasFocus() )
GetFocus();
- ULONG nCount = pZOrderList->Count();
+ sal_uLong nCount = pZOrderList->Count();
if( !nCount )
return;
- BOOL bResetClipRegion = FALSE;
+ sal_Bool bResetClipRegion = sal_False;
if( !pView->IsClipRegion() )
{
Rectangle aOutputArea( GetOutputRect() );
- bResetClipRegion = TRUE;
+ bResetClipRegion = sal_True;
pView->SetClipRegion( aOutputArea );
}
- const USHORT nListInitSize = aEntries.Count() > USHRT_MAX ?
- USHRT_MAX : (USHORT)aEntries.Count();
+ const sal_uInt16 nListInitSize = aEntries.Count() > USHRT_MAX ?
+ USHRT_MAX : (sal_uInt16)aEntries.Count();
List* pNewZOrderList = new List( nListInitSize );
List* pPaintedEntries = new List( nListInitSize );
- ULONG nPos = 0;
+ sal_uLong nPos = 0;
while( nCount )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pZOrderList->GetObject(nPos ));
const Rectangle& rBoundRect = GetEntryBoundRect( pEntry );
if( rRect.IsOver( rBoundRect ) )
{
- PaintEntry( pEntry, rBoundRect.TopLeft(), pView, TRUE );
+ PaintEntry( pEntry, rBoundRect.TopLeft(), pView, sal_True );
// Eintraege, die neu gezeichnet werden, auf Top setzen
pPaintedEntries->Insert( pEntry, LIST_APPEND );
}
@@ -813,7 +813,7 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect )
nCount = pPaintedEntries->Count();
if( nCount )
{
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
pZOrderList->Insert( pPaintedEntries->GetObject(nCur), LIST_APPEND);
}
delete pPaintedEntries;
@@ -822,20 +822,20 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect )
pView->SetClipRegion();
}
-void SvxIconChoiceCtrl_Impl::RepaintEntries( USHORT nEntryFlagsMask )
+void SvxIconChoiceCtrl_Impl::RepaintEntries( sal_uInt16 nEntryFlagsMask )
{
- const ULONG nCount = pZOrderList->Count();
+ const sal_uLong nCount = pZOrderList->Count();
if( !nCount )
return;
- BOOL bResetClipRegion = FALSE;
+ sal_Bool bResetClipRegion = sal_False;
Rectangle aOutRect( GetOutputRect() );
if( !pView->IsClipRegion() )
{
- bResetClipRegion = TRUE;
+ bResetClipRegion = sal_True;
pView->SetClipRegion( aOutRect );
}
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pZOrderList->GetObject(nCur));
if( pEntry->GetFlags() & nEntryFlagsMask )
@@ -871,28 +871,28 @@ IcnViewFieldType SvxIconChoiceCtrl_Impl::GetItem( SvxIconChoiceCtrlEntry* pEntry
return IcnViewFieldTypeDontknow;
}
-BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt)
+sal_Bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt)
{
- BOOL bHandled = TRUE;
- bHighlightFramePressed = FALSE;
+ sal_Bool bHandled = sal_True;
+ bHighlightFramePressed = sal_False;
StopEditTimer();
- BOOL bGotFocus = (BOOL)(!pView->HasFocus() && !(nWinBits & WB_NOPOINTERFOCUS));
+ sal_Bool bGotFocus = (sal_Bool)(!pView->HasFocus() && !(nWinBits & WB_NOPOINTERFOCUS));
if( !(nWinBits & WB_NOPOINTERFOCUS) )
pView->GrabFocus();
Point aDocPos( rMEvt.GetPosPixel() );
if(aDocPos.X()>=aOutputSize.Width() || aDocPos.Y()>=aOutputSize.Height())
- return FALSE;
+ return sal_False;
ToDocPos( aDocPos );
- SvxIconChoiceCtrlEntry* pEntry = GetEntry( aDocPos, TRUE );
+ SvxIconChoiceCtrlEntry* pEntry = GetEntry( aDocPos, sal_True );
if( pEntry )
- MakeEntryVisible( pEntry, FALSE );
+ MakeEntryVisible( pEntry, sal_False );
if( rMEvt.IsShift() && eSelectionMode != SINGLE_SELECTION )
{
if( pEntry )
- SetCursor_Impl( pCursor, pEntry, rMEvt.IsMod1(), rMEvt.IsShift(), TRUE);
- return TRUE;
+ SetCursor_Impl( pCursor, pEntry, rMEvt.IsMod1(), rMEvt.IsShift(), sal_True);
+ return sal_True;
}
if( pAnchor && (rMEvt.IsShift() || rMEvt.IsMod1())) // Tastaturselektion?
@@ -923,7 +923,7 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt)
if( !pEntry && !(nWinBits & WB_NODRAGSELECTION))
pView->StartTracking( STARTTRACK_SCROLLREPEAT );
- return TRUE;
+ return sal_True;
}
else
{
@@ -945,17 +945,17 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt)
pView->StartTracking( STARTTRACK_SCROLLREPEAT );
}
else
- bHandled = FALSE;
+ bHandled = sal_False;
return bHandled;
}
}
- BOOL bSelected = pEntry->IsSelected();
- BOOL bEditingEnabled = IsEntryEditingEnabled();
+ sal_Bool bSelected = pEntry->IsSelected();
+ sal_Bool bEditingEnabled = IsEntryEditingEnabled();
if( rMEvt.GetClicks() == 2 )
{
DeselectAllBut( pEntry );
- SelectEntry( pEntry, TRUE, TRUE, FALSE, TRUE );
+ SelectEntry( pEntry, sal_True, sal_True, sal_False, sal_True );
pHdlEntry = pEntry;
pView->ClickIcon();
}
@@ -986,8 +986,8 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt)
if( rMEvt.IsLeft() && (nWinBits & WB_HIGHLIGHTFRAME) )
{
pCurHighlightFrame = 0; // Neues painten des Frames erzwingen
- bHighlightFramePressed = TRUE;
- SetEntryHighlightFrame( pEntry, TRUE );
+ bHighlightFramePressed = sal_True;
+ SetEntryHighlightFrame( pEntry, sal_True );
}
}
else
@@ -996,9 +996,9 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt)
{
if( !bSelected )
{
- DeselectAllBut( pEntry, TRUE /* Synchron painten */ );
+ DeselectAllBut( pEntry, sal_True /* Synchron painten */ );
SetCursor( pEntry );
- SelectEntry( pEntry, TRUE, TRUE, FALSE, TRUE );
+ SelectEntry( pEntry, sal_True, sal_True, sal_False, sal_True );
}
else
{
@@ -1018,13 +1018,13 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt)
return bHandled;
}
-BOOL SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt )
+sal_Bool SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt )
{
- BOOL bHandled = FALSE;
+ sal_Bool bHandled = sal_False;
if( rMEvt.IsRight() && (nFlags & (F_DOWN_CTRL | F_DOWN_DESELECT) ))
{
nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT);
- bHandled = TRUE;
+ bHandled = sal_True;
}
Point aDocPos( rMEvt.GetPosPixel() );
@@ -1037,59 +1037,59 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt )
// Ctrl & MultiSelection
ToggleSelection( pDocEntry );
SetCursor( pDocEntry );
- bHandled = TRUE;
+ bHandled = sal_True;
}
else if( nFlags & F_DOWN_DESELECT )
{
DeselectAllBut( pDocEntry );
SetCursor( pDocEntry );
- SelectEntry( pDocEntry, TRUE, TRUE, FALSE, TRUE );
- bHandled = TRUE;
+ SelectEntry( pDocEntry, sal_True, sal_True, sal_False, sal_True );
+ bHandled = sal_True;
}
}
nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT);
if( nFlags & F_START_EDITTIMER_IN_MOUSEUP )
{
- bHandled = TRUE;
+ bHandled = sal_True;
StartEditTimer();
nFlags &= ~F_START_EDITTIMER_IN_MOUSEUP;
}
if((nWinBits & WB_HIGHLIGHTFRAME) && bHighlightFramePressed && pCurHighlightFrame)
{
- bHandled = TRUE;
+ bHandled = sal_True;
SvxIconChoiceCtrlEntry* pEntry = pCurHighlightFrame;
pCurHighlightFrame = 0; // Neues painten des Frames erzwingen
- bHighlightFramePressed = FALSE;
- SetEntryHighlightFrame( pEntry, TRUE );
+ bHighlightFramePressed = sal_False;
+ SetEntryHighlightFrame( pEntry, sal_True );
pHdlEntry = pCurHighlightFrame;
pView->ClickIcon();
// set focus on Icon
SvxIconChoiceCtrlEntry* pOldCursor = pCursor;
- SetCursor_Impl( pOldCursor, pHdlEntry, FALSE, FALSE, TRUE );
+ SetCursor_Impl( pOldCursor, pHdlEntry, sal_False, sal_False, sal_True );
pHdlEntry = 0;
}
return bHandled;
}
-BOOL SvxIconChoiceCtrl_Impl::MouseMove( const MouseEvent& rMEvt )
+sal_Bool SvxIconChoiceCtrl_Impl::MouseMove( const MouseEvent& rMEvt )
{
const Point aDocPos( pView->PixelToLogic(rMEvt.GetPosPixel()) );
if( pView->IsTracking() )
- return FALSE;
+ return sal_False;
else if( nWinBits & WB_HIGHLIGHTFRAME )
{
- SvxIconChoiceCtrlEntry* pEntry = GetEntry( aDocPos, TRUE );
+ SvxIconChoiceCtrlEntry* pEntry = GetEntry( aDocPos, sal_True );
SetEntryHighlightFrame( pEntry );
}
else
- return FALSE;
- return TRUE;
+ return sal_False;
+ return sal_True;
}
void SvxIconChoiceCtrl_Impl::Tracking( const TrackingEvent& rTEvt )
@@ -1113,7 +1113,7 @@ void SvxIconChoiceCtrl_Impl::Tracking( const TrackingEvent& rTEvt )
long nScrollDX, nScrollDY;
- CalcScrollOffsets( aPosPixel, nScrollDX, nScrollDY, FALSE );
+ CalcScrollOffsets( aPosPixel, nScrollDX, nScrollDY, sal_False );
if( nScrollDX || nScrollDY )
{
pView->HideTracking();
@@ -1123,7 +1123,7 @@ void SvxIconChoiceCtrl_Impl::Tracking( const TrackingEvent& rTEvt )
if( aRect != aCurSelectionRect )
{
pView->HideTracking();
- BOOL bAdd = (nFlags & F_ADD_MODE) ? TRUE : FALSE;
+ sal_Bool bAdd = (nFlags & F_ADD_MODE) ? sal_True : sal_False;
SelectRect( aRect, bAdd, &aSelectedRectList );
}
pView->ShowTracking( aRect, SHOWTRACK_SMALL | SHOWTRACK_CLIP );
@@ -1131,25 +1131,25 @@ void SvxIconChoiceCtrl_Impl::Tracking( const TrackingEvent& rTEvt )
}
void SvxIconChoiceCtrl_Impl::SetCursor_Impl( SvxIconChoiceCtrlEntry* pOldCursor,
- SvxIconChoiceCtrlEntry* pNewCursor, BOOL bMod1, BOOL bShift, BOOL bPaintSync )
+ SvxIconChoiceCtrlEntry* pNewCursor, sal_Bool bMod1, sal_Bool bShift, sal_Bool bPaintSync )
{
if( pNewCursor )
{
SvxIconChoiceCtrlEntry* pFilterEntry = 0;
- BOOL bDeselectAll = FALSE;
+ sal_Bool bDeselectAll = sal_False;
if( eSelectionMode != SINGLE_SELECTION )
{
if( !bMod1 && !bShift )
- bDeselectAll = TRUE;
+ bDeselectAll = sal_True;
else if( bShift && !bMod1 && !pAnchor )
{
- bDeselectAll = TRUE;
+ bDeselectAll = sal_True;
pFilterEntry = pOldCursor;
}
}
if( bDeselectAll )
DeselectAllBut( pFilterEntry, bPaintSync );
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
MakeEntryVisible( pNewCursor );
SetCursor( pNewCursor );
if( bMod1 && !bShift )
@@ -1171,41 +1171,41 @@ void SvxIconChoiceCtrl_Impl::SetCursor_Impl( SvxIconChoiceCtrlEntry* pOldCursor,
}
else
{
- SelectEntry( pCursor, TRUE, TRUE, FALSE, bPaintSync );
+ SelectEntry( pCursor, sal_True, sal_True, sal_False, bPaintSync );
aCurSelectionRect = GetEntryBoundRect( pCursor );
}
}
}
-BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
+sal_Bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
{
StopEditTimer();
- BOOL bMod2 = rKEvt.GetKeyCode().IsMod2();
+ sal_Bool bMod2 = rKEvt.GetKeyCode().IsMod2();
sal_Unicode cChar = rKEvt.GetCharCode();
- ULONG nPos = (ULONG)-1;
+ sal_uLong nPos = (sal_uLong)-1;
if ( bMod2 && cChar && IsMnemonicChar( cChar, nPos ) )
{
// shortcut is clicked
SvxIconChoiceCtrlEntry* pNewCursor = GetEntry( nPos );
SvxIconChoiceCtrlEntry* pOldCursor = pCursor;
if ( pNewCursor != pOldCursor )
- SetCursor_Impl( pOldCursor, pNewCursor, FALSE, FALSE, FALSE );
- return TRUE;
+ SetCursor_Impl( pOldCursor, pNewCursor, sal_False, sal_False, sal_False );
+ return sal_True;
}
if ( bMod2 )
// no actions with <ALT>
- return FALSE;
+ return sal_False;
- BOOL bKeyUsed = TRUE;
- BOOL bMod1 = rKEvt.GetKeyCode().IsMod1();
- BOOL bShift = rKEvt.GetKeyCode().IsShift();
+ sal_Bool bKeyUsed = sal_True;
+ sal_Bool bMod1 = rKEvt.GetKeyCode().IsMod1();
+ sal_Bool bShift = rKEvt.GetKeyCode().IsShift();
if( eSelectionMode == SINGLE_SELECTION || eSelectionMode == NO_SELECTION)
{
- bShift = FALSE;
- bMod1 = FALSE;
+ bShift = sal_False;
+ bMod1 = sal_False;
}
if( bMod1 )
@@ -1214,7 +1214,7 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
SvxIconChoiceCtrlEntry* pNewCursor;
SvxIconChoiceCtrlEntry* pOldCursor = pCursor;
- USHORT nCode = rKEvt.GetKeyCode().GetCode();
+ sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
switch( nCode )
{
case KEY_UP:
@@ -1223,10 +1223,10 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
{
MakeEntryVisible( pCursor );
if( nCode == KEY_UP )
- pNewCursor = pImpCursor->GoUpDown(pCursor,FALSE);
+ pNewCursor = pImpCursor->GoUpDown(pCursor,sal_False);
else
- pNewCursor = pImpCursor->GoPageUpDown(pCursor,FALSE);
- SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE );
+ pNewCursor = pImpCursor->GoPageUpDown(pCursor,sal_False);
+ SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True );
if( !pNewCursor )
{
Rectangle aRect( GetEntryBoundRect( pCursor ) );
@@ -1253,10 +1253,10 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
if( pCursor )
{
if( nCode == KEY_DOWN )
- pNewCursor=pImpCursor->GoUpDown( pCursor,TRUE );
+ pNewCursor=pImpCursor->GoUpDown( pCursor,sal_True );
else
- pNewCursor=pImpCursor->GoPageUpDown( pCursor,TRUE );
- SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE );
+ pNewCursor=pImpCursor->GoPageUpDown( pCursor,sal_True );
+ SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True );
if ( bChooseWithCursor && pNewCursor != NULL)
{
@@ -1271,8 +1271,8 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
case KEY_RIGHT:
if( pCursor )
{
- pNewCursor=pImpCursor->GoLeftRight(pCursor,TRUE );
- SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE );
+ pNewCursor=pImpCursor->GoLeftRight(pCursor,sal_True );
+ SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True );
}
break;
@@ -1280,8 +1280,8 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
if( pCursor )
{
MakeEntryVisible( pCursor );
- pNewCursor = pImpCursor->GoLeftRight(pCursor,FALSE );
- SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE );
+ pNewCursor = pImpCursor->GoLeftRight(pCursor,sal_False );
+ SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True );
if( !pNewCursor )
{
Rectangle aRect( GetEntryBoundRect(pCursor));
@@ -1299,7 +1299,7 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
if( !bMod1 && !bShift )
EditTimeoutHdl( 0 );
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_F8:
@@ -1311,7 +1311,7 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
nFlags |= F_ADD_MODE;
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_SPACE:
@@ -1319,12 +1319,12 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
{
if( !bMod1 )
{
- //SelectAll( FALSE );
+ //SelectAll( sal_False );
SetNoSelection();
ClearSelectedRectList();
// click Icon with spacebar
- SetEntryHighlightFrame( GetCurEntry(), TRUE );
+ SetEntryHighlightFrame( GetCurEntry(), sal_True );
pView->ClickIcon();
pHdlEntry = pCurHighlightFrame;
pCurHighlightFrame=0;
@@ -1353,9 +1353,9 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
case KEY_DIVIDE :
case KEY_A:
if( bMod1 && (eSelectionMode != SINGLE_SELECTION))
- SelectAll( TRUE );
+ SelectAll( sal_True );
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_SUBTRACT:
@@ -1363,7 +1363,7 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
if( bMod1 )
SetNoSelection();
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_RETURN:
@@ -1373,14 +1373,14 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
/*pView->*/EditEntry( pCursor );
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_END:
if( pCursor )
{
pNewCursor = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( aEntries.Count() - 1 );
- SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE );
+ SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True );
}
break;
@@ -1388,12 +1388,12 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
if( pCursor )
{
pNewCursor = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( 0 );
- SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE );
+ SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True );
}
break;
default:
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
}
return bKeyUsed;
@@ -1419,7 +1419,7 @@ void SvxIconChoiceCtrl_Impl::PositionScrollBars( long nRealWidth, long nRealHeig
aVerSBar.SetPosPixel( aPos );
}
-void SvxIconChoiceCtrl_Impl::AdjustScrollBars( BOOL )
+void SvxIconChoiceCtrl_Impl::AdjustScrollBars( sal_Bool )
{
Rectangle aOldOutRect( GetOutputRect() );
long nVirtHeight = aVirtOutputSize.Height();
@@ -1451,7 +1451,7 @@ void SvxIconChoiceCtrl_Impl::AdjustScrollBars( BOOL )
sal_Bool bNoVerSBar = ( nWinBits & WB_NOVSCROLL ) != 0;
sal_Bool bNoHorSBar = ( nWinBits & WB_NOHSCROLL ) != 0;
- USHORT nResult = 0;
+ sal_uInt16 nResult = 0;
if( nVirtHeight )
{
// activate ver scrollbar ?
@@ -1589,23 +1589,23 @@ void SvxIconChoiceCtrl_Impl::Resize()
VisRectChanged();
}
-BOOL SvxIconChoiceCtrl_Impl::CheckHorScrollBar()
+sal_Bool SvxIconChoiceCtrl_Impl::CheckHorScrollBar()
{
if( !pZOrderList || !aHorSBar.IsVisible() )
- return FALSE;
+ return sal_False;
const MapMode& rMapMode = pView->GetMapMode();
Point aOrigin( rMapMode.GetOrigin() );
if(!( nWinBits & WB_HSCROLL) && !aOrigin.X() )
{
long nWidth = aOutputSize.Width();
- const ULONG nCount = pZOrderList->Count();
+ const sal_uLong nCount = pZOrderList->Count();
long nMostRight = 0;
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pZOrderList->GetObject(nCur);
long nRight = GetEntryBoundRect(pEntry).Right();
if( nRight > nWidth )
- return FALSE;
+ return sal_False;
if( nRight > nMostRight )
nMostRight = nRight;
}
@@ -1622,28 +1622,28 @@ BOOL SvxIconChoiceCtrl_Impl::CheckHorScrollBar()
aSize.Height() += nHorSBarHeight;
aVerSBar.SetSizePixel( aSize );
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL SvxIconChoiceCtrl_Impl::CheckVerScrollBar()
+sal_Bool SvxIconChoiceCtrl_Impl::CheckVerScrollBar()
{
if( !pZOrderList || !aVerSBar.IsVisible() )
- return FALSE;
+ return sal_False;
const MapMode& rMapMode = pView->GetMapMode();
Point aOrigin( rMapMode.GetOrigin() );
if(!( nWinBits & WB_VSCROLL) && !aOrigin.Y() )
{
long nDeepest = 0;
long nHeight = aOutputSize.Height();
- const ULONG nCount = pZOrderList->Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ const sal_uLong nCount = pZOrderList->Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pZOrderList->GetObject(nCur);
long nBottom = GetEntryBoundRect(pEntry).Bottom();
if( nBottom > nHeight )
- return FALSE;
+ return sal_False;
if( nBottom > nDeepest )
nDeepest = nBottom;
}
@@ -1660,9 +1660,9 @@ BOOL SvxIconChoiceCtrl_Impl::CheckVerScrollBar()
aSize.Width() += nVerSBarWidth;
aHorSBar.SetSizePixel( aSize );
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
@@ -1685,7 +1685,7 @@ void SvxIconChoiceCtrl_Impl::GetFocus()
if( pCursor )
{
pCursor->SetFlags( ICNVIEW_FLAG_FOCUSED );
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
}
@@ -1694,7 +1694,7 @@ void SvxIconChoiceCtrl_Impl::LoseFocus()
StopEditTimer();
if( pCursor )
pCursor->ClearFlags( ICNVIEW_FLAG_FOCUSED );
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
// HideFocus ();
// pView->Invalidate ( aFocus.aRect );
@@ -1702,7 +1702,7 @@ void SvxIconChoiceCtrl_Impl::LoseFocus()
RepaintEntries( ICNVIEW_FLAG_SELECTED );
}
-void SvxIconChoiceCtrl_Impl::SetUpdateMode( BOOL bUpdate )
+void SvxIconChoiceCtrl_Impl::SetUpdateMode( sal_Bool bUpdate )
{
if( bUpdate != bUpdateMode )
{
@@ -1717,7 +1717,7 @@ void SvxIconChoiceCtrl_Impl::SetUpdateMode( BOOL bUpdate )
}
}
-void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL bIsBackgroundPainted )
+void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bIsBackgroundPainted )
{
Point aPos( GetEntryPos( pEntry ) );
PaintEntry( pEntry, aPos, 0, bIsBackgroundPainted );
@@ -1726,8 +1726,8 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL bI
// Prios der Emphasis: bDropTarget => bCursored => bSelected
void SvxIconChoiceCtrl_Impl::PaintEmphasis(
const Rectangle& rTextRect, const Rectangle& rImageRect,
- BOOL bSelected, BOOL bDropTarget, BOOL bCursored, OutputDevice* pOut,
- BOOL bIsBackgroundPainted )
+ sal_Bool bSelected, sal_Bool bDropTarget, sal_Bool bCursored, OutputDevice* pOut,
+ sal_Bool bIsBackgroundPainted )
{
static Color aTransparent( COL_TRANSPARENT );
@@ -1747,14 +1747,14 @@ void SvxIconChoiceCtrl_Impl::PaintEmphasis(
const StyleSettings& rSettings = pOut->GetSettings().GetStyleSettings();
Color aOldFillColor( pOut->GetFillColor() );
- BOOL bSolidTextRect = FALSE;
- BOOL bSolidImageRect = FALSE;
+ sal_Bool bSolidTextRect = sal_False;
+ sal_Bool bSolidImageRect = sal_False;
if( bDropTarget && ( eSelectionMode != NO_SELECTION ) )
{
pOut->SetFillColor( rSettings.GetHighlightColor() );
- bSolidTextRect = TRUE;
- bSolidImageRect = TRUE;
+ bSolidTextRect = sal_True;
+ bSolidImageRect = sal_True;
}
else
{
@@ -1767,7 +1767,7 @@ void SvxIconChoiceCtrl_Impl::PaintEmphasis(
const Color& rFillColor = pView->GetFont().GetFillColor();
pOut->SetFillColor( rFillColor );
if( rFillColor != aTransparent )
- bSolidTextRect = TRUE;
+ bSolidTextRect = sal_True;
}
}
}
@@ -1807,14 +1807,14 @@ void SvxIconChoiceCtrl_Impl::PaintEmphasis(
void SvxIconChoiceCtrl_Impl::PaintItem( const Rectangle& rRect,
- IcnViewFieldType eItem, SvxIconChoiceCtrlEntry* pEntry, USHORT nPaintFlags,
+ IcnViewFieldType eItem, SvxIconChoiceCtrlEntry* pEntry, sal_uInt16 nPaintFlags,
OutputDevice* pOut, const String* pStr, ::vcl::ControlLayoutData* _pLayoutData )
{
if( eItem == IcnViewFieldTypeText )
{
String aText;
if( !pStr )
- aText = pView->GetEntryText( pEntry, FALSE );
+ aText = pView->GetEntryText( pEntry, sal_False );
else
aText = *pStr;
@@ -1830,7 +1830,7 @@ void SvxIconChoiceCtrl_Impl::PaintItem( const Rectangle& rRect,
{
Color aBkgColor( pOut->GetBackground().GetColor() );
Color aFontColor;
- USHORT nColor = ( aBkgColor.GetRed() + aBkgColor.GetGreen() + aBkgColor.GetBlue() ) / 3;
+ sal_uInt16 nColor = ( aBkgColor.GetRed() + aBkgColor.GetGreen() + aBkgColor.GetBlue() ) / 3;
if ( nColor > 127 )
aFontColor.SetColor ( COL_BLACK );
else
@@ -1908,19 +1908,19 @@ void SvxIconChoiceCtrl_Impl::PaintEntryVirtOutDev( SvxIconChoiceCtrlEntry* pEntr
void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const Point& rPos,
- OutputDevice* pOut, BOOL bIsBackgroundPainted )
+ OutputDevice* pOut, sal_Bool bIsBackgroundPainted )
{
if( !pOut )
pOut = pView;
- BOOL bSelected = FALSE;
+ sal_Bool bSelected = sal_False;
if( eSelectionMode != NO_SELECTION )
bSelected = pEntry->IsSelected();
- BOOL bCursored = pEntry->IsCursored();
- BOOL bDropTarget = pEntry->IsDropTarget();
- BOOL bNoEmphasis = pEntry->IsBlockingEmphasis();
+ sal_Bool bCursored = pEntry->IsCursored();
+ sal_Bool bDropTarget = pEntry->IsDropTarget();
+ sal_Bool bNoEmphasis = pEntry->IsBlockingEmphasis();
Font aTempFont( pOut->GetFont() );
@@ -1932,8 +1932,8 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P
}
*/
- String aEntryText( pView->GetEntryText( pEntry, FALSE ) );
- Rectangle aTextRect( CalcTextRect(pEntry,&rPos,FALSE,&aEntryText));
+ String aEntryText( pView->GetEntryText( pEntry, sal_False ) );
+ Rectangle aTextRect( CalcTextRect(pEntry,&rPos,sal_False,&aEntryText));
Rectangle aBmpRect( CalcBmpRect(pEntry, &rPos ) );
sal_Bool bShowSelection =
@@ -1973,14 +1973,14 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P
pOut->SetFillColor( );
}
- BOOL bResetClipRegion = FALSE;
+ sal_Bool bResetClipRegion = sal_False;
if( !pView->IsClipRegion() && (aVerSBar.IsVisible() || aHorSBar.IsVisible()) )
{
Rectangle aOutputArea( GetOutputRect() );
if( aOutputArea.IsOver(aTextRect) || aOutputArea.IsOver(aBmpRect) )
{
pView->SetClipRegion( aOutputArea );
- bResetClipRegion = TRUE;
+ bResetClipRegion = sal_True;
}
}
@@ -1996,10 +1996,10 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P
#endif
sal_Bool bLargeIconMode = WB_ICON == ( nWinBits & (VIEWMODE_MASK) );
- USHORT nBmpPaintFlags = PAINTFLAG_VER_CENTERED;
+ sal_uInt16 nBmpPaintFlags = PAINTFLAG_VER_CENTERED;
if ( bLargeIconMode )
nBmpPaintFlags |= PAINTFLAG_HOR_CENTERED;
- USHORT nTextPaintFlags = bLargeIconMode ? PAINTFLAG_HOR_CENTERED : PAINTFLAG_VER_CENTERED;
+ sal_uInt16 nTextPaintFlags = bLargeIconMode ? PAINTFLAG_HOR_CENTERED : PAINTFLAG_VER_CENTERED;
if( !bNoEmphasis )
PaintEmphasis(aTextRect,aBmpRect,bSelected,bDropTarget,bCursored,pOut,bIsBackgroundPainted);
@@ -2015,7 +2015,7 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P
// Highlight-Frame zeichnen
if( pEntry == pCurHighlightFrame && !bNoEmphasis )
- DrawHighlightFrame( pOut, CalcFocusRect( pEntry ), FALSE );
+ DrawHighlightFrame( pOut, CalcFocusRect( pEntry ), sal_False );
pOut->SetFont( aTempFont );
if( bResetClipRegion )
@@ -2023,15 +2023,15 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P
}
void SvxIconChoiceCtrl_Impl::SetEntryPos( SvxIconChoiceCtrlEntry* pEntry, const Point& rPos,
- BOOL bAdjustAtGrid, BOOL bCheckScrollBars, BOOL bKeepGridMap )
+ sal_Bool bAdjustAtGrid, sal_Bool bCheckScrollBars, sal_Bool bKeepGridMap )
{
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
Rectangle aBoundRect( GetEntryBoundRect( pEntry ));
pView->Invalidate( aBoundRect );
ToTop( pEntry );
if( !IsAutoArrange() )
{
- BOOL bAdjustVirtSize = FALSE;
+ sal_Bool bAdjustVirtSize = sal_False;
if( rPos != aBoundRect.TopLeft() )
{
Point aGridOffs(
@@ -2042,7 +2042,7 @@ void SvxIconChoiceCtrl_Impl::SetEntryPos( SvxIconChoiceCtrlEntry* pEntry, const
aBoundRect.SetPos( rPos );
pEntry->aRect = aBoundRect;
pEntry->aGridRect.SetPos( rPos + aGridOffs );
- bAdjustVirtSize = TRUE;
+ bAdjustVirtSize = sal_True;
}
if( bAdjustAtGrid )
{
@@ -2061,7 +2061,7 @@ void SvxIconChoiceCtrl_Impl::SetEntryPos( SvxIconChoiceCtrlEntry* pEntry, const
Point aNewPos( AdjustAtGrid( aCenterRect, rBoundRect ) );
Rectangle aNewBoundRect( aNewPos, pEntry->aRect.GetSize());
AdjustVirtSize( aNewBoundRect );
- bAdjustVirtSize = FALSE;
+ bAdjustVirtSize = sal_False;
}
AdjustEntryAtGrid( pEntry );
ToTop( pEntry );
@@ -2081,7 +2081,7 @@ void SvxIconChoiceCtrl_Impl::SetEntryPos( SvxIconChoiceCtrlEntry* pEntry, const
SetEntryPredecessor( pEntry, pPrev );
aAutoArrangeTimer.Start();
}
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
void SvxIconChoiceCtrl_Impl::SetNoSelection()
@@ -2090,16 +2090,16 @@ void SvxIconChoiceCtrl_Impl::SetNoSelection()
if( !(nFlags & F_CLEARING_SELECTION ))
{
nFlags |= F_CLEARING_SELECTION;
- DeselectAllBut( 0, TRUE );
+ DeselectAllBut( 0, sal_True );
nFlags &= ~F_CLEARING_SELECTION;
}
}
-SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetEntry( const Point& rDocPos, BOOL bHit )
+SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetEntry( const Point& rDocPos, sal_Bool bHit )
{
CheckBoundingRects();
// Z-Order-Liste vom Ende her absuchen
- ULONG nCount = pZOrderList->Count();
+ sal_uLong nCount = pZOrderList->Count();
while( nCount )
{
nCount--;
@@ -2130,11 +2130,11 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetNextEntry( const Point& rDocP
{
CheckBoundingRects();
SvxIconChoiceCtrlEntry* pTarget = 0;
- const ULONG nStartPos = pZOrderList->GetPos( (void*)pCurEntry );
+ const sal_uLong nStartPos = pZOrderList->GetPos( (void*)pCurEntry );
if( nStartPos != LIST_ENTRY_NOTFOUND )
{
- const ULONG nCount = pZOrderList->Count();
- for( ULONG nCur = nStartPos+1; nCur < nCount; nCur++ )
+ const sal_uLong nCount = pZOrderList->Count();
+ for( sal_uLong nCur = nStartPos+1; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pZOrderList->GetObject(nCur));
if( pEntry->aRect.IsInside( rDocPos ) )
@@ -2151,7 +2151,7 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetPrevEntry( const Point& rDocP
{
CheckBoundingRects();
SvxIconChoiceCtrlEntry* pTarget = 0;
- ULONG nStartPos = pZOrderList->GetPos( (void*)pCurEntry );
+ sal_uLong nStartPos = pZOrderList->GetPos( (void*)pCurEntry );
if( nStartPos != LIST_ENTRY_NOTFOUND && nStartPos != 0 )
{
nStartPos--;
@@ -2173,7 +2173,7 @@ Point SvxIconChoiceCtrl_Impl::GetEntryPos( SvxIconChoiceCtrlEntry* pEntry )
return pEntry->aRect.TopLeft();
}
-void SvxIconChoiceCtrl_Impl::MakeEntryVisible( SvxIconChoiceCtrlEntry* pEntry, BOOL bBound )
+void SvxIconChoiceCtrl_Impl::MakeEntryVisible( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bBound )
{
if ( bBound )
{
@@ -2227,7 +2227,7 @@ Rectangle SvxIconChoiceCtrl_Impl::CalcBmpRect( SvxIconChoiceCtrlEntry* pEntry, c
}
Rectangle SvxIconChoiceCtrl_Impl::CalcTextRect( SvxIconChoiceCtrlEntry* pEntry,
- const Point* pEntryPos, BOOL bEdit, const String* pStr )
+ const Point* pEntryPos, sal_Bool bEdit, const String* pStr )
{
String aEntryText;
if( !pStr )
@@ -2345,8 +2345,8 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRects()
{
nMaxBoundHeight = 0;
pZOrderList->Clear();
- ULONG nCount = aEntries.Count();
- ULONG nCur;
+ sal_uLong nCount = aEntries.Count();
+ sal_uLong nCur;
SvxIconChoiceCtrlEntry* pEntry;
if( !IsAutoArrange() || !pHead )
@@ -2371,7 +2371,7 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRects()
nCur++;
}
}
- bBoundRectsDirty = FALSE;
+ bBoundRectsDirty = sal_False;
AdjustScrollBars();
}
@@ -2379,9 +2379,9 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRectsSmart()
{
nMaxBoundHeight = 0;
pZOrderList->Clear();
- ULONG nCur;
+ sal_uLong nCur;
SvxIconChoiceCtrlEntry* pEntry;
- const ULONG nCount = aEntries.Count();
+ const sal_uLong nCount = aEntries.Count();
if( !IsAutoArrange() || !pHead )
{
@@ -2424,8 +2424,8 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRectsSmart()
void SvxIconChoiceCtrl_Impl::UpdateBoundingRects()
{
- const ULONG nCount = aEntries.Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ const sal_uLong nCount = aEntries.Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur );
GetEntryBoundRect( pEntry );
@@ -2441,7 +2441,7 @@ void SvxIconChoiceCtrl_Impl::FindBoundingRect( SvxIconChoiceCtrlEntry* pEntry )
return;
}
Size aSize( CalcBoundingSize( pEntry ) );
- Point aPos(pGridMap->GetGridRect(pGridMap->GetUnoccupiedGrid(TRUE)).TopLeft());
+ Point aPos(pGridMap->GetGridRect(pGridMap->GetUnoccupiedGrid(sal_True)).TopLeft());
SetBoundingRect_Impl( pEntry, aPos, aSize );
}
@@ -2456,33 +2456,33 @@ void SvxIconChoiceCtrl_Impl::SetBoundingRect_Impl( SvxIconChoiceCtrlEntry* pEntr
}
-void SvxIconChoiceCtrl_Impl::SetCursor( SvxIconChoiceCtrlEntry* pEntry, BOOL bSyncSingleSelection,
- BOOL bShowFocusAsync )
+void SvxIconChoiceCtrl_Impl::SetCursor( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bSyncSingleSelection,
+ sal_Bool bShowFocusAsync )
{
if( pEntry == pCursor )
{
if( pCursor && eSelectionMode == SINGLE_SELECTION && bSyncSingleSelection &&
!pCursor->IsSelected() )
- SelectEntry( pCursor, TRUE, TRUE );
+ SelectEntry( pCursor, sal_True, sal_True );
return;
}
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
SvxIconChoiceCtrlEntry* pOldCursor = pCursor;
pCursor = pEntry;
if( pOldCursor )
{
pOldCursor->ClearFlags( ICNVIEW_FLAG_FOCUSED );
if( eSelectionMode == SINGLE_SELECTION && bSyncSingleSelection )
- SelectEntry( pOldCursor, FALSE, TRUE ); // alten Cursor deselektieren
+ SelectEntry( pOldCursor, sal_False, sal_True ); // alten Cursor deselektieren
}
if( pCursor )
{
ToTop( pCursor );
pCursor->SetFlags( ICNVIEW_FLAG_FOCUSED );
if( eSelectionMode == SINGLE_SELECTION && bSyncSingleSelection )
- SelectEntry( pCursor, TRUE, TRUE );
+ SelectEntry( pCursor, sal_True, sal_True );
if( !bShowFocusAsync )
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
else
{
if( !nUserEventShowCursor )
@@ -2494,7 +2494,7 @@ void SvxIconChoiceCtrl_Impl::SetCursor( SvxIconChoiceCtrlEntry* pEntry, BOOL bSy
}
-void SvxIconChoiceCtrl_Impl::ShowCursor( BOOL bShow )
+void SvxIconChoiceCtrl_Impl::ShowCursor( sal_Bool bShow )
{
if( !pCursor || !bShow || !pView->HasFocus() )
{
@@ -2533,7 +2533,7 @@ void SvxIconChoiceCtrl_Impl::ShowDDIcon( SvxIconChoiceCtrlEntry* pRefEntry, cons
DELETEZ(pDDDev);
DELETEZ(pDDBufDev);
}
- BOOL bSelected = pRefEntry->IsSelected();
+ sal_Bool bSelected = pRefEntry->IsSelected();
pRefEntry->ClearFlags( ICNVIEW_FLAG_SELECTED );
if( !pDDDev )
{
@@ -2670,16 +2670,16 @@ void SvxIconChoiceCtrl_Impl::InvalidateBoundingRect( SvxIconChoiceCtrlEntry* pEn
}
-BOOL SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd )
+sal_Bool SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd )
{
Rectangle aDocRect( GetDocumentRect() );
Rectangle aVisRect( GetVisibleRect() );
if( aVisRect.IsInside( aDocRect ))
- return FALSE;
+ return sal_False;
Size aDocSize( aDocRect.GetSize() );
Size aVisSize( aVisRect.GetSize() );
- BOOL bHor = aDocSize.Width() > aVisSize.Width();
- BOOL bVer = aDocSize.Height() > aVisSize.Height();
+ sal_Bool bHor = aDocSize.Width() > aVisSize.Width();
+ sal_Bool bVer = aDocSize.Height() > aVisSize.Height();
long nScrollDX = 0, nScrollDY = 0;
@@ -2688,7 +2688,7 @@ BOOL SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd )
case COMMAND_STARTAUTOSCROLL:
{
pView->EndTracking();
- USHORT nScrollFlags = 0;
+ sal_uInt16 nScrollFlags = 0;
if( bHor )
nScrollFlags |= AUTOSCROLL_HORZ;
if( bVer )
@@ -2696,7 +2696,7 @@ BOOL SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd )
if( nScrollFlags )
{
pView->StartAutoScroll( nScrollFlags );
- return TRUE;
+ return sal_True;
}
}
break;
@@ -2706,7 +2706,7 @@ BOOL SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd )
const CommandWheelData* pData = rCmd.GetWheelData();
if( pData && (COMMAND_WHEEL_SCROLL == pData->GetMode()) && !pData->IsHorz() )
{
- ULONG nScrollLines = pData->GetScrollLines();
+ sal_uLong nScrollLines = pData->GetScrollLines();
if( nScrollLines == COMMAND_WHEEL_PAGESCROLL )
{
nScrollDY = GetScrollBarPageSize( aVisSize.Width() );
@@ -2741,9 +2741,9 @@ BOOL SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd )
aVisRect.Left() -= nScrollDX;
aVisRect.Right() -= nScrollDX;
MakeVisible( aVisRect );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
@@ -2770,7 +2770,7 @@ void SvxIconChoiceCtrl_Impl::ToTop( SvxIconChoiceCtrlEntry* pEntry )
{
if( pZOrderList->GetObject( pZOrderList->Count() - 1 ) != pEntry )
{
- ULONG nPos = pZOrderList->GetPos( (void*)pEntry );
+ sal_uLong nPos = pZOrderList->GetPos( (void*)pEntry );
pZOrderList->Remove( nPos );
pZOrderList->Insert( pEntry, LIST_APPEND );
}
@@ -2790,10 +2790,10 @@ void SvxIconChoiceCtrl_Impl::ClipAtVirtOutRect( Rectangle& rRect ) const
// rRect: Bereich des Dokumentes (in Dokumentkoordinaten), der
// sichtbar gemacht werden soll.
-// bScrBar == TRUE: Das Rect wurde aufgrund eines ScrollBar-Events berechnet
+// bScrBar == sal_True: Das Rect wurde aufgrund eines ScrollBar-Events berechnet
-void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, BOOL bScrBar,
- BOOL bCallRectChangedHdl )
+void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, sal_Bool bScrBar,
+ sal_Bool bCallRectChangedHdl )
{
Rectangle aVirtRect( rRect );
ClipAtVirtOutRect( aVirtRect );
@@ -2839,7 +2839,7 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, BOOL bScrBar,
{
HideDDIcon();
pView->Update();
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
}
// Origin fuer SV invertieren (damit wir in
@@ -2847,7 +2847,7 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, BOOL bScrBar,
aOrigin *= -1;
SetOrigin( aOrigin );
- BOOL bScrollable = pView->GetBackground().IsScrollable();
+ sal_Bool bScrollable = pView->GetBackground().IsScrollable();
if( pView->HasBackground() && !bScrollable )
{
Rectangle aRect( GetOutputRect());
@@ -2879,7 +2879,7 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, BOOL bScrBar,
}
if( GetUpdateMode() )
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
// pruefen, ob ScrollBars noch benoetigt werden
CheckScrollBars();
@@ -2900,15 +2900,15 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindNewCursor()
SvxIconChoiceCtrlEntry* pNewCursor;
if( pCursor )
{
- pNewCursor = pImpCursor->GoLeftRight( pCursor, FALSE );
+ pNewCursor = pImpCursor->GoLeftRight( pCursor, sal_False );
if( !pNewCursor )
{
- pNewCursor = pImpCursor->GoLeftRight( pCursor, TRUE );
+ pNewCursor = pImpCursor->GoLeftRight( pCursor, sal_True );
if( !pNewCursor )
{
- pNewCursor = pImpCursor->GoUpDown( pCursor, FALSE );
+ pNewCursor = pImpCursor->GoUpDown( pCursor, sal_False );
if( !pNewCursor )
- pNewCursor = pImpCursor->GoUpDown( pCursor, TRUE );
+ pNewCursor = pImpCursor->GoUpDown( pCursor, sal_True );
}
}
}
@@ -2918,7 +2918,7 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindNewCursor()
return pNewCursor;
}
-ULONG SvxIconChoiceCtrl_Impl::GetSelectionCount() const
+sal_uLong SvxIconChoiceCtrl_Impl::GetSelectionCount() const
{
if( (nWinBits & WB_HIGHLIGHTFRAME) && pCurHighlightFrame )
return 1;
@@ -2927,27 +2927,27 @@ ULONG SvxIconChoiceCtrl_Impl::GetSelectionCount() const
void SvxIconChoiceCtrl_Impl::ToggleSelection( SvxIconChoiceCtrlEntry* pEntry )
{
- BOOL bSel;
+ sal_Bool bSel;
if( pEntry->IsSelected() )
- bSel = FALSE;
+ bSel = sal_False;
else
- bSel = TRUE;
- SelectEntry( pEntry, bSel, TRUE, TRUE );
+ bSel = sal_True;
+ SelectEntry( pEntry, bSel, sal_True, sal_True );
}
void SvxIconChoiceCtrl_Impl::DeselectAllBut( SvxIconChoiceCtrlEntry* pThisEntryNot,
- BOOL bPaintSync )
+ sal_Bool bPaintSync )
{
ClearSelectedRectList();
//
// !!!!!!! Todo: Evtl. Z-Orderlist abarbeiten !!!!!!!
//
- ULONG nCount = aEntries.Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ sal_uLong nCount = aEntries.Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur );
if( pEntry != pThisEntryNot && pEntry->IsSelected() )
- SelectEntry( pEntry, FALSE, TRUE, TRUE, bPaintSync );
+ SelectEntry( pEntry, sal_False, sal_True, sal_True, bPaintSync );
}
pAnchor = 0;
nFlags &= (~F_ADD_MODE);
@@ -3083,7 +3083,7 @@ void SvxIconChoiceCtrl_Impl::Center( SvxIconChoiceCtrlEntry* pEntry ) const
// Die Deltas entsprechen Offsets, um die die View auf dem Doc verschoben wird
// links, hoch: Offsets < 0
// rechts, runter: Offsets > 0
-void SvxIconChoiceCtrl_Impl::Scroll( long nDeltaX, long nDeltaY, BOOL bScrollBar )
+void SvxIconChoiceCtrl_Impl::Scroll( long nDeltaX, long nDeltaY, sal_Bool bScrollBar )
{
const MapMode& rMapMode = pView->GetMapMode();
Point aOrigin( rMapMode.GetOrigin() );
@@ -3136,7 +3136,7 @@ static Rectangle GetHotSpot( const Rectangle& rRect )
}
void SvxIconChoiceCtrl_Impl::SelectRect( SvxIconChoiceCtrlEntry* pEntry1, SvxIconChoiceCtrlEntry* pEntry2,
- BOOL bAdd, SvPtrarr* pOtherRects )
+ sal_Bool bAdd, SvPtrarr* pOtherRects )
{
DBG_ASSERT(pEntry1 && pEntry2,"SelectEntry: Invalid Entry-Ptr");
Rectangle aRect( GetEntryBoundRect( pEntry1 ) );
@@ -3144,7 +3144,7 @@ void SvxIconChoiceCtrl_Impl::SelectRect( SvxIconChoiceCtrlEntry* pEntry1, SvxIco
SelectRect( aRect, bAdd, pOtherRects );
}
-void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, BOOL bAdd,
+void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, sal_Bool bAdd,
SvPtrarr* pOtherRects )
{
aCurSelectionRect = rRect;
@@ -3152,53 +3152,53 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, BOOL bAdd,
return;
// Flag setzen, damit im Select kein ToTop gerufen wird
- BOOL bAlreadySelectingRect = nFlags & F_SELECTING_RECT ? TRUE : FALSE;
+ sal_Bool bAlreadySelectingRect = nFlags & F_SELECTING_RECT ? sal_True : sal_False;
nFlags |= F_SELECTING_RECT;
CheckBoundingRects();
pView->Update();
- const ULONG nCount = pZOrderList->Count();
+ const sal_uLong nCount = pZOrderList->Count();
Rectangle aRect( rRect );
aRect.Justify();
- BOOL bCalcOverlap = (bAdd && pOtherRects && pOtherRects->Count()) ? TRUE : FALSE;
+ sal_Bool bCalcOverlap = (bAdd && pOtherRects && pOtherRects->Count()) ? sal_True : sal_False;
- BOOL bResetClipRegion = FALSE;
+ sal_Bool bResetClipRegion = sal_False;
if( !pView->IsClipRegion() )
{
- bResetClipRegion = TRUE;
+ bResetClipRegion = sal_True;
pView->SetClipRegion( GetOutputRect() );
}
- for( ULONG nPos = 0; nPos < nCount; nPos++ )
+ for( sal_uLong nPos = 0; nPos < nCount; nPos++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pZOrderList->GetObject(nPos ));
if( !IsBoundingRectValid( pEntry->aRect ))
FindBoundingRect( pEntry );
Rectangle aBoundRect( GetHotSpot( pEntry->aRect ) );
- BOOL bSelected = pEntry->IsSelected();
+ sal_Bool bSelected = pEntry->IsSelected();
- BOOL bOverlaps;
+ sal_Bool bOverlaps;
if( bCalcOverlap )
bOverlaps = IsOver( pOtherRects, aBoundRect );
else
- bOverlaps = FALSE;
- BOOL bOver = aRect.IsOver( aBoundRect );
+ bOverlaps = sal_False;
+ sal_Bool bOver = aRect.IsOver( aBoundRect );
if( bOver && !bOverlaps )
{
// Ist im neuen Selektionsrechteck und in keinem alten
// => selektieren
if( !bSelected )
- SelectEntry( pEntry, TRUE, TRUE, TRUE );
+ SelectEntry( pEntry, sal_True, sal_True, sal_True );
}
else if( !bAdd )
{
// ist ausserhalb des Selektionsrechtecks
// => Selektion entfernen
if( bSelected )
- SelectEntry( pEntry, FALSE, TRUE, TRUE );
+ SelectEntry( pEntry, sal_False, sal_True, sal_True );
}
else if( bAdd && bOverlaps )
{
@@ -3218,19 +3218,19 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, BOOL bAdd,
{
// Schnittmenge zwischen alten Rects & aktuellem Rect desel.
if( bSelected )
- SelectEntry( pEntry, FALSE, TRUE, TRUE );
+ SelectEntry( pEntry, sal_False, sal_True, sal_True );
}
else
{
// Eintrag eines alten Rects selektieren
if( !bSelected )
- SelectEntry( pEntry, TRUE, TRUE, TRUE );
+ SelectEntry( pEntry, sal_True, sal_True, sal_True );
}
}
else if( !bOver && bSelected )
{
// Der Eintrag liegt voellig ausserhalb und wird deshalb desel.
- SelectEntry( pEntry, FALSE, TRUE, TRUE );
+ SelectEntry( pEntry, sal_False, sal_True, sal_True );
}
}
@@ -3245,13 +3245,13 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, BOOL bAdd,
void SvxIconChoiceCtrl_Impl::SelectRange(
SvxIconChoiceCtrlEntry* pStart,
SvxIconChoiceCtrlEntry* pEnd,
- BOOL bAdd )
+ sal_Bool bAdd )
{
- ULONG nFront = GetEntryListPos( pStart );
- ULONG nBack = GetEntryListPos( pEnd );
- ULONG nFirst = std::min( nFront, nBack );
- ULONG nLast = std::max( nFront, nBack );
- ULONG i;
+ sal_uLong nFront = GetEntryListPos( pStart );
+ sal_uLong nBack = GetEntryListPos( pEnd );
+ sal_uLong nFirst = std::min( nFront, nBack );
+ sal_uLong nLast = std::max( nFront, nBack );
+ sal_uLong i;
SvxIconChoiceCtrlEntry* pEntry;
if ( ! bAdd )
@@ -3262,7 +3262,7 @@ void SvxIconChoiceCtrl_Impl::SelectRange(
{
pEntry = GetEntry( i );
if( pEntry->IsSelected() )
- SelectEntry( pEntry, FALSE, TRUE, TRUE, TRUE );
+ SelectEntry( pEntry, sal_False, sal_True, sal_True, sal_True );
}
}
@@ -3271,33 +3271,33 @@ void SvxIconChoiceCtrl_Impl::SelectRange(
{
pEntry = GetEntry( i );
if( ! pEntry->IsSelected() )
- SelectEntry( pEntry, TRUE, TRUE, TRUE, TRUE );
+ SelectEntry( pEntry, sal_True, sal_True, sal_True, sal_True );
}
if ( ! bAdd )
{
// deselect everything behind the last entry if not in
// adding mode
- ULONG nEnd = GetEntryCount();
+ sal_uLong nEnd = GetEntryCount();
for ( ; i<nEnd; i++ )
{
pEntry = GetEntry( i );
if( pEntry->IsSelected() )
- SelectEntry( pEntry, FALSE, TRUE, TRUE, TRUE );
+ SelectEntry( pEntry, sal_False, sal_True, sal_True, sal_True );
}
}
}
-BOOL SvxIconChoiceCtrl_Impl::IsOver( SvPtrarr* pRectList, const Rectangle& rBoundRect ) const
+sal_Bool SvxIconChoiceCtrl_Impl::IsOver( SvPtrarr* pRectList, const Rectangle& rBoundRect ) const
{
- const USHORT nCount = pRectList->Count();
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ const sal_uInt16 nCount = pRectList->Count();
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
Rectangle* pRect = (Rectangle*)pRectList->GetObject( nCur );
if( rBoundRect.IsOver( *pRect ))
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
void SvxIconChoiceCtrl_Impl::AddSelectedRect( SvxIconChoiceCtrlEntry* pEntry1,
@@ -3318,8 +3318,8 @@ void SvxIconChoiceCtrl_Impl::AddSelectedRect( const Rectangle& rRect )
void SvxIconChoiceCtrl_Impl::ClearSelectedRectList()
{
- const USHORT nCount = aSelectedRectList.Count();
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ const sal_uInt16 nCount = aSelectedRectList.Count();
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
Rectangle* pRect = (Rectangle*)aSelectedRectList.GetObject( nCur );
delete pRect;
@@ -3328,7 +3328,7 @@ void SvxIconChoiceCtrl_Impl::ClearSelectedRectList()
}
void SvxIconChoiceCtrl_Impl::CalcScrollOffsets( const Point& rPosPixel,
- long& rX, long& rY, BOOL isInDragDrop, USHORT nBorderWidth)
+ long& rX, long& rY, sal_Bool isInDragDrop, sal_uInt16 nBorderWidth)
{
// Scrolling der View, falls sich der Mauszeiger im Grenzbereich des
// Fensters befindet
@@ -3336,8 +3336,8 @@ void SvxIconChoiceCtrl_Impl::CalcScrollOffsets( const Point& rPosPixel,
long nPixelToScrollY = 0;
Size aWndSize = aOutputSize;
- nBorderWidth = (USHORT)(Min( (long)(aWndSize.Height()-1), (long)nBorderWidth ));
- nBorderWidth = (USHORT)(Min( (long)(aWndSize.Width()-1), (long)nBorderWidth ));
+ nBorderWidth = (sal_uInt16)(Min( (long)(aWndSize.Height()-1), (long)nBorderWidth ));
+ nBorderWidth = (sal_uInt16)(Min( (long)(aWndSize.Width()-1), (long)nBorderWidth ));
if ( rPosPixel.X() < nBorderWidth )
{
@@ -3398,16 +3398,16 @@ void SvxIconChoiceCtrl_Impl::PrepareCommandEvent( const CommandEvent& rCEvt )
StopEditTimer();
SvxIconChoiceCtrlEntry* pEntry = pView->GetEntry( rCEvt.GetMousePosPixel() );
if( (nFlags & F_DOWN_CTRL) && pEntry && !pEntry->IsSelected() )
- SelectEntry( pEntry, TRUE, TRUE );
+ SelectEntry( pEntry, sal_True, sal_True );
nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT);
}
-BOOL SvxIconChoiceCtrl_Impl::IsTextHit( SvxIconChoiceCtrlEntry* pEntry, const Point& rDocPos )
+sal_Bool SvxIconChoiceCtrl_Impl::IsTextHit( SvxIconChoiceCtrlEntry* pEntry, const Point& rDocPos )
{
Rectangle aRect( CalcTextRect( pEntry ));
if( aRect.IsInside( rDocPos ) )
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
IMPL_LINK(SvxIconChoiceCtrl_Impl, EditTimeoutHdl, Timer*, EMPTYARG )
@@ -3433,8 +3433,8 @@ void SvxIconChoiceCtrl_Impl::AdjustEntryAtGrid( SvxIconChoiceCtrlEntry* pStart )
{
SvPtrarr aLists;
pImpCursor->CreateGridAjustData( aLists, pStart );
- const USHORT nCount = aLists.Count();
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ const sal_uInt16 nCount = aLists.Count();
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
AdjustAtGrid( *(SvPtrarr*)aLists[ nCur ], pStart );
IcnCursor_Impl::DestroyGridAdjustData( aLists );
CheckScrollBars();
@@ -3446,18 +3446,18 @@ void SvxIconChoiceCtrl_Impl::AdjustAtGrid( const SvPtrarr& rRow, SvxIconChoiceCt
if( !rRow.Count() )
return;
- BOOL bGo;
+ sal_Bool bGo;
if( !pStart )
- bGo = TRUE;
+ bGo = sal_True;
else
- bGo = FALSE;
+ bGo = sal_False;
long nCurRight = 0;
- for( USHORT nCur = 0; nCur < rRow.Count(); nCur++ )
+ for( sal_uInt16 nCur = 0; nCur < rRow.Count(); nCur++ )
{
SvxIconChoiceCtrlEntry* pCur = (SvxIconChoiceCtrlEntry*)rRow[ nCur ];
if( !bGo && pCur == pStart )
- bGo = TRUE;
+ bGo = sal_True;
//SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pCur);
// Massgebend (fuer unser Auge) ist die Bitmap, da sonst
@@ -3521,7 +3521,7 @@ void SvxIconChoiceCtrl_Impl::SetEntryTextMode( SvxIconChoiceCtrlTextMode eMode,
if( eTextMode == IcnShowTextDontKnow )
eTextMode = IcnShowTextShort;
eTextMode = eMode;
- Arrange( TRUE );
+ Arrange( sal_True );
}
}
else
@@ -3575,20 +3575,20 @@ void SvxIconChoiceCtrl_Impl::ShowFocus ( Rectangle& rRect )
{
Color aBkgColor ( pView->GetBackground().GetColor() );
Color aPenColor;
- USHORT nColor = ( aBkgColor.GetRed() + aBkgColor.GetGreen() + aBkgColor.GetBlue() ) / 3;
+ sal_uInt16 nColor = ( aBkgColor.GetRed() + aBkgColor.GetGreen() + aBkgColor.GetBlue() ) / 3;
if ( nColor > 128 )
aPenColor.SetColor ( COL_BLACK );
else
aPenColor.SetColor( COL_WHITE );
- aFocus.bOn = TRUE;
+ aFocus.bOn = sal_True;
aFocus.aPenColor = aPenColor;
aFocus.aRect = rRect;
}
void SvxIconChoiceCtrl_Impl::HideFocus ()
{
- aFocus.bOn = FALSE;
+ aFocus.bOn = sal_False;
}
void SvxIconChoiceCtrl_Impl::DrawFocusRect ( OutputDevice* pOut )
@@ -3608,12 +3608,12 @@ void SvxIconChoiceCtrl_Impl::DrawFocusRect ( OutputDevice* pOut )
pOut->DrawPolyLine ( aPolygon, aLineInfo );
}
-BOOL SvxIconChoiceCtrl_Impl::IsMnemonicChar( sal_Unicode cChar, ULONG& rPos ) const
+sal_Bool SvxIconChoiceCtrl_Impl::IsMnemonicChar( sal_Unicode cChar, sal_uLong& rPos ) const
{
sal_Bool bRet = sal_False;
const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetUILocaleI18nHelper();
- ULONG nEntryCount = GetEntryCount();
- for ( ULONG i = 0; i < nEntryCount; ++i )
+ sal_uLong nEntryCount = GetEntryCount();
+ for ( sal_uLong i = 0; i < nEntryCount; ++i )
{
if ( rI18nHelper.MatchMnemonic( GetEntry( i )->GetText(), cChar ) )
{
@@ -3639,7 +3639,7 @@ IMPL_LINK(SvxIconChoiceCtrl_Impl, UserEventHdl, void*, nId )
else if( nId == EVENTID_SHOW_CURSOR )
{
nUserEventShowCursor = 0;
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
return 0;
}
@@ -3661,12 +3661,12 @@ void SvxIconChoiceCtrl_Impl::CancelUserEvents()
void SvxIconChoiceCtrl_Impl::InvalidateEntry( SvxIconChoiceCtrlEntry* pEntry )
{
if( pEntry == pCursor )
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
pView->Invalidate( pEntry->aRect );
Center( pEntry );
pView->Invalidate( pEntry->aRect );
if( pEntry == pCursor )
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
void SvxIconChoiceCtrl_Impl::EditEntry( SvxIconChoiceCtrlEntry* pEntry )
@@ -3675,13 +3675,13 @@ void SvxIconChoiceCtrl_Impl::EditEntry( SvxIconChoiceCtrlEntry* pEntry )
if( !pEntry )
return;
- StopEntryEditing( TRUE );
+ StopEntryEditing( sal_True );
DELETEZ(pEdit);
SetNoSelection();
pCurEditedEntry = pEntry;
- String aEntryText( pView->GetEntryText( pEntry, TRUE ) );
- Rectangle aRect( CalcTextRect( pEntry, 0, TRUE, &aEntryText ) );
+ String aEntryText( pView->GetEntryText( pEntry, sal_True ) );
+ Rectangle aRect( CalcTextRect( pEntry, 0, sal_True, &aEntryText ) );
MakeVisible( aRect );
Point aPos( aRect.TopLeft() );
aPos = pView->GetPixelPos( aPos );
@@ -3722,7 +3722,7 @@ IMPL_LINK( SvxIconChoiceCtrl_Impl, TextEditEndedHdl, IcnViewEdit_Impl*, EMPTYARG
if( pView->EditedEntry( pCurEditedEntry, aText, pEdit->EditingCanceled() ) )
InvalidateEntry( pCurEditedEntry );
if( !GetSelectionCount() )
- SelectEntry( pCurEditedEntry, TRUE );
+ SelectEntry( pCurEditedEntry, sal_True );
pEdit->Hide();
if( pEdit->IsGrabFocus() )
@@ -3733,13 +3733,13 @@ IMPL_LINK( SvxIconChoiceCtrl_Impl, TextEditEndedHdl, IcnViewEdit_Impl*, EMPTYARG
return 0;
}
-void SvxIconChoiceCtrl_Impl::StopEntryEditing( BOOL bCancel )
+void SvxIconChoiceCtrl_Impl::StopEntryEditing( sal_Bool bCancel )
{
if( pEdit )
pEdit->StopEditing( bCancel );
}
-void SvxIconChoiceCtrl_Impl::LockEntryPos( SvxIconChoiceCtrlEntry* pEntry, BOOL bLock )
+void SvxIconChoiceCtrl_Impl::LockEntryPos( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bLock )
{
if( bLock )
pEntry->SetFlags( ICNVIEW_FLAG_POS_LOCKED );
@@ -3747,7 +3747,7 @@ void SvxIconChoiceCtrl_Impl::LockEntryPos( SvxIconChoiceCtrlEntry* pEntry, BOOL
pEntry->ClearFlags( ICNVIEW_FLAG_POS_LOCKED );
}
-SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry( ULONG& rPos ) const
+SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry( sal_uLong& rPos ) const
{
if( !GetSelectionCount() )
return 0;
@@ -3758,10 +3758,10 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry( ULONG& rP
return pCurHighlightFrame;
}
- ULONG nCount = aEntries.Count();
+ sal_uLong nCount = aEntries.Count();
if( !pHead )
{
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur );
if( pEntry->IsSelected() )
@@ -3793,14 +3793,14 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry( ULONG& rP
}
// kein Round Robin!
-SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetNextSelectedEntry( ULONG& rStartPos ) const
+SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetNextSelectedEntry( sal_uLong& rStartPos ) const
{
- ULONG nCount = aEntries.Count();
+ sal_uLong nCount = aEntries.Count();
if( rStartPos > nCount || !GetSelectionCount() )
return 0;
if( !pHead )
{
- for( ULONG nCur = rStartPos+1; nCur < nCount; nCur++ )
+ for( sal_uLong nCur = rStartPos+1; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur );
if( pEntry->IsSelected() )
@@ -3829,15 +3829,15 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetNextSelectedEntry( ULONG& rSt
return 0;
}
-void SvxIconChoiceCtrl_Impl::SelectAll( BOOL bSelect, BOOL bPaint )
+void SvxIconChoiceCtrl_Impl::SelectAll( sal_Bool bSelect, sal_Bool bPaint )
{
- bPaint = TRUE;
+ bPaint = sal_True;
- ULONG nCount = aEntries.Count();
- for( ULONG nCur = 0; nCur < nCount && (bSelect || GetSelectionCount() ); nCur++ )
+ sal_uLong nCount = aEntries.Count();
+ for( sal_uLong nCur = 0; nCur < nCount && (bSelect || GetSelectionCount() ); nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur );
- SelectEntry( pEntry, bSelect, TRUE, TRUE, bPaint );
+ SelectEntry( pEntry, bSelect, sal_True, sal_True, bPaint );
}
nFlags &= (~F_ADD_MODE);
pAnchor = 0;
@@ -3847,7 +3847,7 @@ void SvxIconChoiceCtrl_Impl::SaveSelection( List** ppList )
{
if( !*ppList )
*ppList = new List;
- ULONG nPos;
+ sal_uLong nPos;
SvxIconChoiceCtrlEntry* pEntry = GetFirstSelectedEntry( nPos );
while( pEntry && GetSelectionCount() != (*ppList)->Count() )
{
@@ -3860,12 +3860,12 @@ IcnViewEdit_Impl::IcnViewEdit_Impl( SvtIconChoiceCtrl* pParent, const Point& rPo
const Size& rSize, const XubString& rData, const Link& rNotifyEditEnd ) :
MultiLineEdit( pParent, (pParent->GetStyle() & WB_ICON) ? WB_CENTER : WB_LEFT),
aCallBackHdl( rNotifyEditEnd ),
- bCanceled( FALSE ),
- bAlreadyInCallback( FALSE ),
- bGrabFocus( FALSE )
+ bCanceled( sal_False ),
+ bAlreadyInCallback( sal_False ),
+ bGrabFocus( sal_False )
{
Font aFont( pParent->GetPointFont() );
- aFont.SetTransparent( FALSE );
+ aFont.SetTransparent( sal_False );
SetControlFont( aFont );
if( !pParent->HasFontFillColor() )
{
@@ -3905,7 +3905,7 @@ void IcnViewEdit_Impl::CallCallBackHdl_Impl()
aTimer.Stop();
if ( !bAlreadyInCallback )
{
- bAlreadyInCallback = TRUE;
+ bAlreadyInCallback = sal_True;
GetpApp()->RemoveAccel( &aAccReturn );
GetpApp()->RemoveAccel( &aAccEscape );
Hide();
@@ -3921,16 +3921,16 @@ IMPL_LINK( IcnViewEdit_Impl, Timeout_Impl, Timer*, EMPTYARG )
IMPL_LINK( IcnViewEdit_Impl, ReturnHdl_Impl, Accelerator*, EMPTYARG )
{
- bCanceled = FALSE;
- bGrabFocus = TRUE;
+ bCanceled = sal_False;
+ bGrabFocus = sal_True;
CallCallBackHdl_Impl();
return 1;
}
IMPL_LINK( IcnViewEdit_Impl, EscapeHdl_Impl, Accelerator*, EMPTYARG )
{
- bCanceled = TRUE;
- bGrabFocus = TRUE;
+ bCanceled = sal_True;
+ bGrabFocus = sal_True;
CallCallBackHdl_Impl();
return 1;
}
@@ -3938,19 +3938,19 @@ IMPL_LINK( IcnViewEdit_Impl, EscapeHdl_Impl, Accelerator*, EMPTYARG )
void IcnViewEdit_Impl::KeyInput( const KeyEvent& rKEvt )
{
KeyCode aCode = rKEvt.GetKeyCode();
- USHORT nCode = aCode.GetCode();
+ sal_uInt16 nCode = aCode.GetCode();
switch ( nCode )
{
case KEY_ESCAPE:
- bCanceled = TRUE;
- bGrabFocus = TRUE;
+ bCanceled = sal_True;
+ bGrabFocus = sal_True;
CallCallBackHdl_Impl();
break;
case KEY_RETURN:
- bCanceled = FALSE;
- bGrabFocus = TRUE;
+ bCanceled = sal_False;
+ bGrabFocus = sal_True;
CallCallBackHdl_Impl();
break;
@@ -3966,7 +3966,7 @@ long IcnViewEdit_Impl::PreNotify( NotifyEvent& rNEvt )
if ( !bAlreadyInCallback &&
((!Application::GetFocusWindow()) || !IsChild(Application::GetFocusWindow())))
{
- bCanceled = FALSE;
+ bCanceled = sal_False;
aTimer.SetTimeout(10);
aTimer.SetTimeoutHdl(LINK(this,IcnViewEdit_Impl,Timeout_Impl));
aTimer.Start();
@@ -3975,7 +3975,7 @@ long IcnViewEdit_Impl::PreNotify( NotifyEvent& rNEvt )
return 0;
}
-void IcnViewEdit_Impl::StopEditing( BOOL bCancel )
+void IcnViewEdit_Impl::StopEditing( sal_Bool bCancel )
{
if ( !bAlreadyInCallback )
{
@@ -3984,22 +3984,22 @@ void IcnViewEdit_Impl::StopEditing( BOOL bCancel )
}
}
-ULONG SvxIconChoiceCtrl_Impl::GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const
+sal_uLong SvxIconChoiceCtrl_Impl::GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const
{
if( !(nFlags & F_ENTRYLISTPOS_VALID ))
((SvxIconChoiceCtrl_Impl*)this)->SetListPositions();
return pEntry->nPos;
}
-void SvxIconChoiceCtrl_Impl::SetEntryListPos( SvxIconChoiceCtrlEntry* pListEntry, ULONG nNewPos )
+void SvxIconChoiceCtrl_Impl::SetEntryListPos( SvxIconChoiceCtrlEntry* pListEntry, sal_uLong nNewPos )
{
- ULONG nCurPos = GetEntryListPos( pListEntry );
+ sal_uLong nCurPos = GetEntryListPos( pListEntry );
if( nCurPos == nNewPos )
return;
aEntries.List::Remove( nCurPos );
aEntries.List::Insert( (void*)pListEntry, nNewPos );
// Eintragspositionen anpassen
- ULONG nStart, nEnd;
+ sal_uLong nStart, nEnd;
if( nNewPos < nCurPos )
{
nStart = nNewPos;
@@ -4017,19 +4017,19 @@ void SvxIconChoiceCtrl_Impl::SetEntryListPos( SvxIconChoiceCtrlEntry* pListEntry
}
}
-void SvxIconChoiceCtrl_Impl::SetEntryFlags( SvxIconChoiceCtrlEntry* pEntry, USHORT nEntryFlags )
+void SvxIconChoiceCtrl_Impl::SetEntryFlags( SvxIconChoiceCtrlEntry* pEntry, sal_uInt16 nEntryFlags )
{
pEntry->nFlags = nEntryFlags;
if( nEntryFlags & ICNVIEW_FLAG_POS_MOVED )
nFlags |= F_MOVED_ENTRIES;
}
-SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pStart, BOOL bRight )
+SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pStart, sal_Bool bRight )
{
return pImpCursor->GoLeftRight( pStart, bRight );
}
-SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pStart, BOOL bDown )
+SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pStart, sal_Bool bDown )
{
return pImpCursor->GoUpDown( pStart, bDown );
}
@@ -4080,14 +4080,14 @@ void SvxIconChoiceCtrl_Impl::InitSettings()
}
}
-EntryList_Impl::EntryList_Impl( SvxIconChoiceCtrl_Impl* pOwner, USHORT _nInitSize , USHORT _nReSize ) :
+EntryList_Impl::EntryList_Impl( SvxIconChoiceCtrl_Impl* pOwner, sal_uInt16 _nInitSize , sal_uInt16 _nReSize ) :
List( _nInitSize, _nReSize ),
_pOwner( pOwner )
{
_pOwner->pHead = 0;
}
-EntryList_Impl::EntryList_Impl( SvxIconChoiceCtrl_Impl* pOwner, USHORT _nBlockSize, USHORT _nInitSize, USHORT _nReSize ) :
+EntryList_Impl::EntryList_Impl( SvxIconChoiceCtrl_Impl* pOwner, sal_uInt16 _nBlockSize, sal_uInt16 _nInitSize, sal_uInt16 _nReSize ) :
List( _nBlockSize, _nInitSize, _nReSize ),
_pOwner( pOwner )
{
@@ -4105,14 +4105,14 @@ void EntryList_Impl::Clear()
List::Clear();
}
-void EntryList_Impl::Insert( SvxIconChoiceCtrlEntry* pEntry, ULONG nPos )
+void EntryList_Impl::Insert( SvxIconChoiceCtrlEntry* pEntry, sal_uLong nPos )
{
List::Insert( pEntry, nPos );
if( _pOwner->pHead )
pEntry->SetBacklink( _pOwner->pHead->pblink );
}
-SvxIconChoiceCtrlEntry* EntryList_Impl::Remove( ULONG nPos )
+SvxIconChoiceCtrlEntry* EntryList_Impl::Remove( sal_uLong nPos )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)List::Remove( nPos );
DBG_ASSERT(pEntry,"EntryList_Impl::Remove > Entry not found");
@@ -4146,14 +4146,14 @@ void EntryList_Impl::Removed_Impl( SvxIconChoiceCtrlEntry* pEntry )
void SvxIconChoiceCtrl_Impl::SetPositionMode( SvxIconChoiceCtrlPositionMode eMode )
{
- ULONG nCur;
+ sal_uLong nCur;
if( eMode == ePositionMode )
return;
SvxIconChoiceCtrlPositionMode eOldMode = ePositionMode;
ePositionMode = eMode;
- ULONG nCount = aEntries.Count();
+ sal_uLong nCount = aEntries.Count();
if( eOldMode == IcnViewPositionModeAutoArrange )
{
@@ -4222,12 +4222,12 @@ void SvxIconChoiceCtrl_Impl::SetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry
if( pEntry == pPredecessor )
return;
- ULONG nPos1 = GetEntryListPos( pEntry );
+ sal_uLong nPos1 = GetEntryListPos( pEntry );
if( !pHead )
{
if( pPredecessor )
{
- ULONG nPos2 = GetEntryListPos( pPredecessor );
+ sal_uLong nPos2 = GetEntryListPos( pPredecessor );
if( nPos1 == (nPos2 + 1) )
return; // ist schon Vorgaenger
}
@@ -4241,16 +4241,16 @@ void SvxIconChoiceCtrl_Impl::SetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry
if( !pPredecessor && pHead == pEntry )
return; // ist schon der Erste
- BOOL bSetHead = FALSE;
+ sal_Bool bSetHead = sal_False;
if( !pPredecessor )
{
- bSetHead = TRUE;
+ bSetHead = sal_True;
pPredecessor = pHead->pblink;
}
if( pEntry == pHead )
{
pHead = pHead->pflink;
- bSetHead = FALSE;
+ bSetHead = sal_False;
}
if( pEntry != pPredecessor )
{
@@ -4263,12 +4263,12 @@ void SvxIconChoiceCtrl_Impl::SetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry
aAutoArrangeTimer.Start();
}
-BOOL SvxIconChoiceCtrl_Impl::GetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry,
+sal_Bool SvxIconChoiceCtrl_Impl::GetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry,
SvxIconChoiceCtrlEntry** ppPredecessor )
{
*ppPredecessor = 0;
if( !pHead )
- return FALSE;
+ return sal_False;
DBG_ASSERT(pEntry->pblink,"GetEntryPredecessor: Backward link not set");
DBG_ASSERT(pEntry->pflink,"GetEntryPredecessor: Forward link not set");
@@ -4276,14 +4276,14 @@ BOOL SvxIconChoiceCtrl_Impl::GetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry
{
SvxIconChoiceCtrlEntry* pFirst = (SvxIconChoiceCtrlEntry*)aEntries.GetObject(0);
if( pFirst != pEntry )
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
*ppPredecessor = pEntry->pblink;
if( !(pEntry->nFlags & ICNVIEW_FLAG_PRED_SET) &&
(GetEntryListPos( *ppPredecessor ) + 1) == GetEntryListPos( pEntry ))
- return FALSE;
- return TRUE;
+ return sal_False;
+ return sal_True;
}
SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry,
@@ -4292,8 +4292,8 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindEntryPredecessor( SvxIconCho
Point aPos( rPosTopLeft ); //TopLeft
Rectangle aCenterRect( CalcBmpRect( pEntry, &aPos ));
Point aNewPos( aCenterRect.Center() );
- ULONG nGrid = GetPredecessorGrid( aNewPos );
- ULONG nCount = aEntries.Count();
+ sal_uLong nGrid = GetPredecessorGrid( aNewPos );
+ sal_uLong nCount = aEntries.Count();
if( nGrid == ULONG_MAX )
return 0;
if( nGrid >= nCount )
@@ -4303,26 +4303,26 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindEntryPredecessor( SvxIconCho
SvxIconChoiceCtrlEntry* pCur = pHead; // Grid 0
// todo: Liste von hinten aufrollen wenn nGrid > nCount/2
- for( ULONG nCur = 0; nCur < nGrid; nCur++ )
+ for( sal_uLong nCur = 0; nCur < nGrid; nCur++ )
pCur = pCur->pflink;
return pCur;
}
-ULONG SvxIconChoiceCtrl_Impl::GetPredecessorGrid( const Point& rPos) const
+sal_uLong SvxIconChoiceCtrl_Impl::GetPredecessorGrid( const Point& rPos) const
{
Point aPos( rPos );
aPos.X() -= LROFFS_WINBORDER;
aPos.Y() -= TBOFFS_WINBORDER;
- USHORT nMaxCol = (USHORT)(aVirtOutputSize.Width() / nGridDX);
+ sal_uInt16 nMaxCol = (sal_uInt16)(aVirtOutputSize.Width() / nGridDX);
if( nMaxCol )
nMaxCol--;
- USHORT nGridX = (USHORT)(aPos.X() / nGridDX);
+ sal_uInt16 nGridX = (sal_uInt16)(aPos.X() / nGridDX);
if( nGridX > nMaxCol )
nGridX = nMaxCol;
- USHORT nGridY = (USHORT)(aPos.Y() / nGridDY);
- USHORT nGridsX = (USHORT)(aOutputSize.Width() / nGridDX);
- ULONG nGrid = (nGridY * nGridsX) + nGridX;
+ sal_uInt16 nGridY = (sal_uInt16)(aPos.Y() / nGridDY);
+ sal_uInt16 nGridsX = (sal_uInt16)(aOutputSize.Width() / nGridDX);
+ sal_uLong nGrid = (nGridY * nGridsX) + nGridX;
long nMiddle = (nGridX * nGridDX) + (nGridDX / 2);
if( rPos.X() < nMiddle )
{
@@ -4342,27 +4342,27 @@ void SvxIconChoiceCtrl_Impl::Flush()
}
}
-BOOL SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt )
+sal_Bool SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt )
{
if ( !(rHEvt.GetMode() & HELPMODE_QUICK ) )
- return FALSE;
+ return sal_False;
Point aPos( pView->ScreenToOutputPixel(rHEvt.GetMousePosPixel() ) );
aPos -= pView->GetMapMode().GetOrigin();
- SvxIconChoiceCtrlEntry* pEntry = GetEntry( aPos, TRUE );
+ SvxIconChoiceCtrlEntry* pEntry = GetEntry( aPos, sal_True );
if ( !pEntry )
- return FALSE;
+ return sal_False;
String sQuickHelpText = pEntry->GetQuickHelpText();
- String aEntryText( pView->GetEntryText( pEntry, FALSE ) );
- Rectangle aTextRect( CalcTextRect( pEntry, 0, FALSE, &aEntryText ) );
+ String aEntryText( pView->GetEntryText( pEntry, sal_False ) );
+ Rectangle aTextRect( CalcTextRect( pEntry, 0, sal_False, &aEntryText ) );
if ( ( !aTextRect.IsInside( aPos ) || !aEntryText.Len() ) && !sQuickHelpText.Len() )
- return FALSE;
+ return sal_False;
Rectangle aOptTextRect( aTextRect );
aOptTextRect.Bottom() = LONG_MAX;
- USHORT nNewFlags = nCurTextDrawFlags;
+ sal_uInt16 nNewFlags = nCurTextDrawFlags;
nNewFlags &= ~( TEXT_DRAW_CLIP | TEXT_DRAW_ENDELLIPSIS );
aOptTextRect = pView->GetTextRect( aOptTextRect, aEntryText, nNewFlags );
if ( aOptTextRect != aTextRect || sQuickHelpText.Len() > 0 )
@@ -4383,7 +4383,7 @@ BOOL SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt )
Help::ShowQuickHelp( (Window*)pView, aOptTextRect, sHelpText, QUICKHELP_LEFT | QUICKHELP_VCENTER );
}
- return TRUE;
+ return sal_True;
}
void SvxIconChoiceCtrl_Impl::ClearColumnList()
@@ -4391,8 +4391,8 @@ void SvxIconChoiceCtrl_Impl::ClearColumnList()
if( !pColumns )
return;
- const USHORT nCount = pColumns->Count();
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ const sal_uInt16 nCount = pColumns->Count();
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlColumnInfo* pInfo = (SvxIconChoiceCtrlColumnInfo*)
pColumns->GetObject( nCur );
@@ -4401,7 +4401,7 @@ void SvxIconChoiceCtrl_Impl::ClearColumnList()
DELETEZ(pColumns);
}
-void SvxIconChoiceCtrl_Impl::SetColumn( USHORT nIndex, const SvxIconChoiceCtrlColumnInfo& rInfo)
+void SvxIconChoiceCtrl_Impl::SetColumn( sal_uInt16 nIndex, const SvxIconChoiceCtrlColumnInfo& rInfo)
{
if( !pColumns )
pColumns = new SvPtrarr;
@@ -4431,22 +4431,22 @@ void SvxIconChoiceCtrl_Impl::SetColumn( USHORT nIndex, const SvxIconChoiceCtrlCo
Arrange( IsAutoArrange() );
}
-const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetColumn( USHORT nIndex ) const
+const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetColumn( sal_uInt16 nIndex ) const
{
if( !pColumns || nIndex >= pColumns->Count() )
return 0;
return (const SvxIconChoiceCtrlColumnInfo*)pColumns->GetObject( nIndex );
}
-const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetItemColumn( USHORT nSubItem,
+const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetItemColumn( sal_uInt16 nSubItem,
long& rLeft ) const
{
rLeft = 0;
if( !pColumns )
return 0;
- const USHORT nCount = pColumns->Count();
+ const sal_uInt16 nCount = pColumns->Count();
const SvxIconChoiceCtrlColumnInfo* pCol = 0;
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
pCol = (const SvxIconChoiceCtrlColumnInfo*)pColumns->GetObject( nCur );
if( !pCol || pCol->GetSubItem() == nSubItem )
@@ -4457,7 +4457,7 @@ const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetItemColumn( USHORT
}
void SvxIconChoiceCtrl_Impl::DrawHighlightFrame(
- OutputDevice* pOut, const Rectangle& rBmpRect, BOOL bHide )
+ OutputDevice* pOut, const Rectangle& rBmpRect, sal_Bool bHide )
{
Rectangle aBmpRect( rBmpRect );
long nBorder = 2;
@@ -4473,7 +4473,7 @@ void SvxIconChoiceCtrl_Impl::DrawHighlightFrame(
else
{
DecorationView aDecoView( pOut );
- USHORT nDecoFlags;
+ sal_uInt16 nDecoFlags;
if ( bHighlightFramePressed )
nDecoFlags = FRAME_HIGHLIGHT_TESTBACKGROUND | FRAME_HIGHLIGHT_IN;
else
@@ -4483,20 +4483,20 @@ void SvxIconChoiceCtrl_Impl::DrawHighlightFrame(
}
void SvxIconChoiceCtrl_Impl::SetEntryHighlightFrame( SvxIconChoiceCtrlEntry* pEntry,
- BOOL bKeepHighlightFlags )
+ sal_Bool bKeepHighlightFlags )
{
if( pEntry == pCurHighlightFrame )
return;
if( !bKeepHighlightFlags )
- bHighlightFramePressed = FALSE;
+ bHighlightFramePressed = sal_False;
HideEntryHighlightFrame();
pCurHighlightFrame = pEntry;
if( pEntry )
{
Rectangle aBmpRect( CalcFocusRect(pEntry) );
- DrawHighlightFrame( pView, aBmpRect, FALSE );
+ DrawHighlightFrame( pView, aBmpRect, sal_False );
}
}
@@ -4508,7 +4508,7 @@ void SvxIconChoiceCtrl_Impl::HideEntryHighlightFrame()
SvxIconChoiceCtrlEntry* pEntry = pCurHighlightFrame;
pCurHighlightFrame = 0;
Rectangle aBmpRect( CalcFocusRect(pEntry) );
- DrawHighlightFrame( pView, aBmpRect, TRUE );
+ DrawHighlightFrame( pView, aBmpRect, sal_True );
}
void SvxIconChoiceCtrl_Impl::CallSelectHandler( SvxIconChoiceCtrlEntry* )
@@ -4549,7 +4549,7 @@ Point SvxIconChoiceCtrl_Impl::GetPopupMenuPosPixel() const
SvxIconChoiceCtrlEntry* pEntry = GetCurEntry();
if( !pEntry || !pEntry->IsSelected() )
{
- ULONG nNext;
+ sal_uLong nNext;
pEntry = GetFirstSelectedEntry( nNext );
}
if( pEntry )
@@ -4561,14 +4561,14 @@ Point SvxIconChoiceCtrl_Impl::GetPopupMenuPosPixel() const
return aResult;
}
-void SvxIconChoiceCtrl_Impl::SetOrigin( const Point& rPos, BOOL bDoNotUpdateWallpaper )
+void SvxIconChoiceCtrl_Impl::SetOrigin( const Point& rPos, sal_Bool bDoNotUpdateWallpaper )
{
MapMode aMapMode( pView->GetMapMode() );
aMapMode.SetOrigin( rPos );
pView->SetMapMode( aMapMode );
if( !bDoNotUpdateWallpaper )
{
- BOOL bScrollable = pView->GetBackground().IsScrollable();
+ sal_Bool bScrollable = pView->GetBackground().IsScrollable();
if( pView->HasBackground() && !bScrollable )
{
Rectangle aRect( GetOutputRect());
@@ -4579,8 +4579,8 @@ void SvxIconChoiceCtrl_Impl::SetOrigin( const Point& rPos, BOOL bDoNotUpdateWall
}
}
-ULONG SvxIconChoiceCtrl_Impl::GetGridCount( const Size& rSize, BOOL bCheckScrBars,
- BOOL bSmartScrBar ) const
+sal_uLong SvxIconChoiceCtrl_Impl::GetGridCount( const Size& rSize, sal_Bool bCheckScrBars,
+ sal_Bool bSmartScrBar ) const
{
Size aSize( rSize );
if( bCheckScrBars && aHorSBar.IsVisible() )
@@ -4598,19 +4598,19 @@ ULONG SvxIconChoiceCtrl_Impl::GetGridCount( const Size& rSize, BOOL bCheckScrBar
if( aSize.Height() < 0 )
aSize.Height() = 0;
- return IcnGridMap_Impl::GetGridCount( aSize, (USHORT)nGridDX, (USHORT)nGridDY );
+ return IcnGridMap_Impl::GetGridCount( aSize, (sal_uInt16)nGridDX, (sal_uInt16)nGridDY );
}
-BOOL SvxIconChoiceCtrl_Impl::HandleShortCutKey( const KeyEvent& rKEvt )
+sal_Bool SvxIconChoiceCtrl_Impl::HandleShortCutKey( const KeyEvent& rKEvt )
{
StopEditTimer();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
DBG_ASSERT( rKEvt.GetKeyCode().IsMod2(), "*SvxIconChoiceCtrl_Impl::HandleShortCutKey(): no <ALT> pressed!?" );
sal_Unicode cChar = rKEvt.GetCharCode();
- ULONG nPos = (ULONG)-1;
+ sal_uLong nPos = (sal_uLong)-1;
if( cChar && IsMnemonicChar( cChar, nPos ) )
{
@@ -4619,7 +4619,7 @@ BOOL SvxIconChoiceCtrl_Impl::HandleShortCutKey( const KeyEvent& rKEvt )
SvxIconChoiceCtrlEntry* pOldCursor = pCursor;
if( pNewCursor != pOldCursor )
{
- SetCursor_Impl( pOldCursor, pNewCursor, FALSE, FALSE, FALSE );
+ SetCursor_Impl( pOldCursor, pNewCursor, sal_False, sal_False, sal_False );
if( pNewCursor != NULL )
{
@@ -4629,13 +4629,13 @@ BOOL SvxIconChoiceCtrl_Impl::HandleShortCutKey( const KeyEvent& rKEvt )
pCurHighlightFrame = NULL;
}
}
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
}
-void SvxIconChoiceCtrl_Impl::CallEventListeners( ULONG nEvent, void* pData )
+void SvxIconChoiceCtrl_Impl::CallEventListeners( sal_uLong nEvent, void* pData )
{
pView->CallImplEventListeners( nEvent, pData );
}
diff --git a/svtools/source/contnr/imivctl2.cxx b/svtools/source/contnr/imivctl2.cxx
index 43b03f569d5d..93e2990d6658 100644
--- a/svtools/source/contnr/imivctl2.cxx
+++ b/svtools/source/contnr/imivctl2.cxx
@@ -48,14 +48,14 @@ IcnCursor_Impl::~IcnCursor_Impl()
delete[] pRows;
}
-USHORT IcnCursor_Impl::GetSortListPos( SvPtrarr* pList, long nValue,
+sal_uInt16 IcnCursor_Impl::GetSortListPos( SvPtrarr* pList, long nValue,
int bVertical )
{
- USHORT nCount = (USHORT)pList->Count();
+ sal_uInt16 nCount = (sal_uInt16)pList->Count();
if( !nCount )
return 0;
- USHORT nCurPos = 0;
+ sal_uInt16 nCurPos = 0;
long nPrevValue = LONG_MIN;
while( nCount )
{
@@ -67,7 +67,7 @@ USHORT IcnCursor_Impl::GetSortListPos( SvPtrarr* pList, long nValue,
else
nCurValue = rRect.Left();
if( nValue >= nPrevValue && nValue <= nCurValue )
- return (USHORT)nCurPos;
+ return (sal_uInt16)nCurPos;
nPrevValue = nCurValue;
nCount--;
nCurPos++;
@@ -85,8 +85,8 @@ void IcnCursor_Impl::ImplCreate()
pColumns = new SvPtrarr[ nCols ];
pRows = new SvPtrarr[ nRows ];
- ULONG nCount = pView->aEntries.Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ sal_uLong nCount = pView->aEntries.Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( nCur );
// const Rectangle& rRect = pView->GetEntryBoundRect( pEntry );
@@ -100,10 +100,10 @@ void IcnCursor_Impl::ImplCreate()
if( nX >= nCols )
nX = sal::static_int_cast< short >(nCols - 1);
- USHORT nIns = GetSortListPos( &pColumns[nX], rRect.Top(), TRUE );
+ sal_uInt16 nIns = GetSortListPos( &pColumns[nX], rRect.Top(), sal_True );
pColumns[ nX ].Insert( pEntry, nIns );
- nIns = GetSortListPos( &pRows[nY], rRect.Left(), FALSE );
+ nIns = GetSortListPos( &pRows[nY], rRect.Left(), sal_False );
pRows[ nY ].Insert( pEntry, nIns );
pEntry->nX = nX;
@@ -128,12 +128,12 @@ void IcnCursor_Impl::Clear()
}
}
-SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom,
- USHORT, BOOL bDown, BOOL bSimple )
+SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(sal_uInt16 nCol,sal_uInt16 nTop,sal_uInt16 nBottom,
+ sal_uInt16, sal_Bool bDown, sal_Bool bSimple )
{
DBG_ASSERT(pCurEntry,"SearchCol: No reference entry");
SvPtrarr* pList = &(pColumns[ nCol ]);
- const USHORT nCount = pList->Count();
+ const sal_uInt16 nCount = pList->Count();
if( !nCount )
return 0;
@@ -141,7 +141,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(USHORT nCol,USHORT nTop,USHORT
if( bSimple )
{
- USHORT nListPos = pList->GetPos( pCurEntry );
+ sal_uInt16 nListPos = pList->GetPos( pCurEntry );
DBG_ASSERT(nListPos!=0xffff,"Entry not in Col-List");
if( bDown )
{
@@ -174,18 +174,18 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(USHORT nCol,USHORT nTop,USHORT
if( nTop > nBottom )
{
- USHORT nTemp = nTop;
+ sal_uInt16 nTemp = nTop;
nTop = nBottom;
nBottom = nTemp;
}
long nMinDistance = LONG_MAX;
SvxIconChoiceCtrlEntry* pResult = 0;
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pList->GetObject( nCur ));
if( pEntry != pCurEntry )
{
- USHORT nY = pEntry->nY;
+ sal_uInt16 nY = pEntry->nY;
if( nY >= nTop && nY <= nBottom )
{
const Rectangle& rRect = pView->GetEntryBoundRect( pEntry );
@@ -203,12 +203,12 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(USHORT nCol,USHORT nTop,USHORT
return pResult;
}
-SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight,
- USHORT, BOOL bRight, BOOL bSimple )
+SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(sal_uInt16 nRow,sal_uInt16 nLeft,sal_uInt16 nRight,
+ sal_uInt16, sal_Bool bRight, sal_Bool bSimple )
{
DBG_ASSERT(pCurEntry,"SearchRow: No reference entry");
SvPtrarr* pList = &(pRows[ nRow ]);
- const USHORT nCount = pList->Count();
+ const sal_uInt16 nCount = pList->Count();
if( !nCount )
return 0;
@@ -216,7 +216,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(USHORT nRow,USHORT nLeft,USHOR
if( bSimple )
{
- USHORT nListPos = pList->GetPos( pCurEntry );
+ sal_uInt16 nListPos = pList->GetPos( pCurEntry );
DBG_ASSERT(nListPos!=0xffff,"Entry not in Row-List");
if( bRight )
{
@@ -249,18 +249,18 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(USHORT nRow,USHORT nLeft,USHOR
}
if( nRight < nLeft )
{
- USHORT nTemp = nRight;
+ sal_uInt16 nTemp = nRight;
nRight = nLeft;
nLeft = nTemp;
}
long nMinDistance = LONG_MAX;
SvxIconChoiceCtrlEntry* pResult = 0;
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pList->GetObject( nCur ));
if( pEntry != pCurEntry )
{
- USHORT nX = pEntry->nX;
+ sal_uInt16 nX = pEntry->nX;
if( nX >= nLeft && nX <= nRight )
{
const Rectangle& rRect = pView->GetEntryBoundRect( pEntry );
@@ -282,7 +282,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(USHORT nRow,USHORT nLeft,USHOR
/*
Sucht ab dem uebergebenen Eintrag den naechsten rechts- bzw.
- linksstehenden. Suchverfahren am Beispiel bRight = TRUE:
+ linksstehenden. Suchverfahren am Beispiel bRight = sal_True:
c
b c
@@ -297,21 +297,21 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(USHORT nRow,USHORT nLeft,USHOR
a,b,c : 2., 3., 4. Suchrechteck
*/
-SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pCtrlEntry, BOOL bRight )
+SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pCtrlEntry, sal_Bool bRight )
{
SvxIconChoiceCtrlEntry* pResult;
pCurEntry = pCtrlEntry;
Create();
- USHORT nY = pCtrlEntry->nY;
- USHORT nX = pCtrlEntry->nX;
+ sal_uInt16 nY = pCtrlEntry->nY;
+ sal_uInt16 nX = pCtrlEntry->nX;
DBG_ASSERT(nY< nRows,"GoLeftRight:Bad column");
DBG_ASSERT(nX< nCols,"GoLeftRight:Bad row");
// Nachbar auf gleicher Zeile ?
if( bRight )
pResult = SearchRow(
- nY, nX, sal::static_int_cast< USHORT >(nCols-1), nX, TRUE, TRUE );
+ nY, nX, sal::static_int_cast< sal_uInt16 >(nCols-1), nX, sal_True, sal_True );
else
- pResult = SearchRow( nY, nX ,0, nX, FALSE, TRUE );
+ pResult = SearchRow( nY, nX ,0, nX, sal_False, sal_True );
if( pResult )
return pResult;
@@ -329,11 +329,11 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pCt
nLastCol = -1; // 0-1
}
- USHORT nRowMin = nY;
- USHORT nRowMax = nY;
+ sal_uInt16 nRowMin = nY;
+ sal_uInt16 nRowMax = nY;
do
{
- SvxIconChoiceCtrlEntry* pEntry = SearchCol((USHORT)nCurCol,nRowMin,nRowMax,nY,TRUE, FALSE);
+ SvxIconChoiceCtrlEntry* pEntry = SearchCol((sal_uInt16)nCurCol,nRowMin,nRowMax,nY,sal_True, sal_False);
if( pEntry )
return pEntry;
if( nRowMin )
@@ -345,7 +345,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pCt
return 0;
}
-SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( SvxIconChoiceCtrlEntry* pStart, BOOL bDown)
+SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( SvxIconChoiceCtrlEntry* pStart, sal_Bool bDown)
{
if( pView->IsAutoArrange() && !(pView->nWinBits & WB_ALIGN_TOP) )
{
@@ -367,7 +367,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( SvxIconChoiceCtrlEntry* pS
nNewPos = 0;
}
if( nPos != nNewPos )
- return (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( (ULONG)nNewPos );
+ return (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( (sal_uLong)nNewPos );
return 0;
}
long nOpt = pView->GetEntryBoundRect( pStart ).Top();
@@ -405,11 +405,11 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( SvxIconChoiceCtrlEntry* pS
return 0;
}
-SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pCtrlEntry, BOOL bDown)
+SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pCtrlEntry, sal_Bool bDown)
{
if( pView->IsAutoArrange() && !(pView->nWinBits & WB_ALIGN_TOP) )
{
- ULONG nPos = pView->GetEntryListPos( pCtrlEntry );
+ sal_uLong nPos = pView->GetEntryListPos( pCtrlEntry );
if( bDown && nPos < (pView->aEntries.Count() - 1) )
return (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( nPos + 1 );
else if( !bDown && nPos > 0 )
@@ -420,17 +420,17 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pCtrlE
SvxIconChoiceCtrlEntry* pResult;
pCurEntry = pCtrlEntry;
Create();
- USHORT nY = pCtrlEntry->nY;
- USHORT nX = pCtrlEntry->nX;
+ sal_uInt16 nY = pCtrlEntry->nY;
+ sal_uInt16 nX = pCtrlEntry->nX;
DBG_ASSERT(nY<nRows,"GoUpDown:Bad column");
DBG_ASSERT(nX<nCols,"GoUpDown:Bad row");
// Nachbar in gleicher Spalte ?
if( bDown )
pResult = SearchCol(
- nX, nY, sal::static_int_cast< USHORT >(nRows-1), nY, TRUE, TRUE );
+ nX, nY, sal::static_int_cast< sal_uInt16 >(nRows-1), nY, sal_True, sal_True );
else
- pResult = SearchCol( nX, nY ,0, nY, FALSE, TRUE );
+ pResult = SearchCol( nX, nY ,0, nY, sal_False, sal_True );
if( pResult )
return pResult;
@@ -448,11 +448,11 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pCtrlE
nLastRow = -1; // 0-1
}
- USHORT nColMin = nX;
- USHORT nColMax = nX;
+ sal_uInt16 nColMin = nX;
+ sal_uInt16 nColMax = nX;
do
{
- SvxIconChoiceCtrlEntry* pEntry = SearchRow((USHORT)nCurRow,nColMin,nColMax,nX,TRUE, FALSE);
+ SvxIconChoiceCtrlEntry* pEntry = SearchRow((sal_uInt16)nCurRow,nColMin,nColMax,nX,sal_True, sal_False);
if( pEntry )
return pEntry;
if( nColMin )
@@ -494,23 +494,23 @@ void IcnCursor_Impl::CreateGridAjustData( SvPtrarr& rLists, SvxIconChoiceCtrlEnt
{
if( !pRefEntry )
{
- USHORT nGridRows = (USHORT)(pView->aVirtOutputSize.Height() / pView->nGridDY);
+ sal_uInt16 nGridRows = (sal_uInt16)(pView->aVirtOutputSize.Height() / pView->nGridDY);
nGridRows++; // wg. Abrundung!
if( !nGridRows )
return;
- for( USHORT nCurList = 0; nCurList < nGridRows; nCurList++ )
+ for( sal_uInt16 nCurList = 0; nCurList < nGridRows; nCurList++ )
{
SvPtrarr* pRow = new SvPtrarr;
rLists.Insert( (void*)pRow, nCurList );
}
- const ULONG nCount = pView->aEntries.Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ const sal_uLong nCount = pView->aEntries.Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( nCur );
const Rectangle& rRect = pView->GetEntryBoundRect( pEntry );
short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / pView->nGridDY );
- USHORT nIns = GetSortListPos((SvPtrarr*)rLists[nY],rRect.Left(),FALSE);
+ sal_uInt16 nIns = GetSortListPos((SvPtrarr*)rLists[nY],rRect.Left(),sal_False);
((SvPtrarr*)rLists[ nY ])->Insert( pEntry, nIns );
}
}
@@ -523,8 +523,8 @@ void IcnCursor_Impl::CreateGridAjustData( SvPtrarr& rLists, SvxIconChoiceCtrlEnt
short nRefRow = (short)( ((rRefRect.Top()+rRefRect.Bottom())/2) / pView->nGridDY );
SvPtrarr* pRow = new SvPtrarr;
rLists.Insert( (void*)pRow, 0 );
- ULONG nCount = pView->aEntries.Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ sal_uLong nCount = pView->aEntries.Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( nCur );
Rectangle rRect( pView->CalcBmpRect(pEntry) );
@@ -532,7 +532,7 @@ void IcnCursor_Impl::CreateGridAjustData( SvPtrarr& rLists, SvxIconChoiceCtrlEnt
short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / pView->nGridDY );
if( nY == nRefRow )
{
- USHORT nIns = GetSortListPos( pRow, rRect.Left(), FALSE );
+ sal_uInt16 nIns = GetSortListPos( pRow, rRect.Left(), sal_False );
pRow->Insert( pEntry, nIns );
}
}
@@ -542,8 +542,8 @@ void IcnCursor_Impl::CreateGridAjustData( SvPtrarr& rLists, SvxIconChoiceCtrlEnt
//static
void IcnCursor_Impl::DestroyGridAdjustData( SvPtrarr& rLists )
{
- const USHORT nCount = rLists.Count();
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ const sal_uInt16 nCount = rLists.Count();
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
SvPtrarr* pArr = (SvPtrarr*)rLists[ nCur ];
delete pArr;
@@ -570,16 +570,16 @@ void IcnGridMap_Impl::Expand()
Create_Impl();
else
{
- USHORT nNewGridRows = _nGridRows;
- USHORT nNewGridCols = _nGridCols;
+ sal_uInt16 nNewGridRows = _nGridRows;
+ sal_uInt16 nNewGridCols = _nGridCols;
if( _pView->nWinBits & WB_ALIGN_TOP )
nNewGridRows += 50;
else
nNewGridCols += 50;
- BOOL* pNewGridMap = new BOOL[nNewGridRows*nNewGridCols];
- memset( pNewGridMap, 0, nNewGridRows * nNewGridCols * sizeof(BOOL) );
- memcpy( pNewGridMap, _pGridMap, _nGridRows * _nGridCols * sizeof(BOOL) );
+ sal_Bool* pNewGridMap = new sal_Bool[nNewGridRows*nNewGridCols];
+ memset( pNewGridMap, 0, nNewGridRows * nNewGridCols * sizeof(sal_Bool) );
+ memcpy( pNewGridMap, _pGridMap, _nGridRows * _nGridCols * sizeof(sal_Bool) );
delete[] _pGridMap;
_pGridMap = pNewGridMap;
_nGridRows = nNewGridRows;
@@ -598,15 +598,15 @@ void IcnGridMap_Impl::Create_Impl()
else
_nGridCols += 50;
- _pGridMap = new BOOL[ _nGridRows * _nGridCols];
+ _pGridMap = new sal_Bool[ _nGridRows * _nGridCols];
memset( (void*)_pGridMap, 0, _nGridRows * _nGridCols );
- const ULONG nCount = _pView->aEntries.Count();
- for( ULONG nCur=0; nCur < nCount; nCur++ )
+ const sal_uLong nCount = _pView->aEntries.Count();
+ for( sal_uLong nCur=0; nCur < nCount; nCur++ )
OccupyGrids( (SvxIconChoiceCtrlEntry*)_pView->aEntries.GetObject( nCur ));
}
-void IcnGridMap_Impl::GetMinMapSize( USHORT& rDX, USHORT& rDY ) const
+void IcnGridMap_Impl::GetMinMapSize( sal_uInt16& rDX, sal_uInt16& rDY ) const
{
long nX, nY;
if( _pView->nWinBits & WB_ALIGN_TOP )
@@ -644,11 +644,11 @@ void IcnGridMap_Impl::GetMinMapSize( USHORT& rDX, USHORT& rDY ) const
if( !nDY )
nDY++;
- rDX = (USHORT)nDX;
- rDY = (USHORT)nDY;
+ rDX = (sal_uInt16)nDX;
+ rDY = (sal_uInt16)nDY;
}
-GridId IcnGridMap_Impl::GetGrid( USHORT nGridX, USHORT nGridY )
+GridId IcnGridMap_Impl::GetGrid( sal_uInt16 nGridX, sal_uInt16 nGridY )
{
Create();
if( _pView->nWinBits & WB_ALIGN_TOP )
@@ -657,7 +657,7 @@ GridId IcnGridMap_Impl::GetGrid( USHORT nGridX, USHORT nGridY )
return nGridY + ( nGridX * _nGridRows );
}
-GridId IcnGridMap_Impl::GetGrid( const Point& rDocPos, BOOL* pbClipped )
+GridId IcnGridMap_Impl::GetGrid( const Point& rDocPos, sal_Bool* pbClipped )
{
Create();
@@ -667,28 +667,28 @@ GridId IcnGridMap_Impl::GetGrid( const Point& rDocPos, BOOL* pbClipped )
nY -= TBOFFS_WINBORDER;
nX /= _pView->nGridDX;
nY /= _pView->nGridDY;
- BOOL bClipped = FALSE;
+ sal_Bool bClipped = sal_False;
if( nX >= _nGridCols )
{
nX = _nGridCols - 1;
- bClipped = TRUE;
+ bClipped = sal_True;
}
if( nY >= _nGridRows )
{
nY = _nGridRows - 1;
- bClipped = TRUE;
+ bClipped = sal_True;
}
- GridId nId = GetGrid( (USHORT)nX, (USHORT)nY );
+ GridId nId = GetGrid( (sal_uInt16)nX, (sal_uInt16)nY );
if( pbClipped )
*pbClipped = bClipped;
- DBG_ASSERT(nId <(ULONG)(_nGridCols*_nGridRows),"GetGrid failed");
+ DBG_ASSERT(nId <(sal_uLong)(_nGridCols*_nGridRows),"GetGrid failed");
return nId;
}
Rectangle IcnGridMap_Impl::GetGridRect( GridId nId )
{
Create();
- USHORT nGridX, nGridY;
+ sal_uInt16 nGridX, nGridY;
GetGridCoord( nId, nGridX, nGridY );
const long nLeft = nGridX * _pView->nGridDX+ LROFFS_WINBORDER;
const long nTop = nGridY * _pView->nGridDY + TBOFFS_WINBORDER;
@@ -698,28 +698,28 @@ Rectangle IcnGridMap_Impl::GetGridRect( GridId nId )
nTop + _pView->nGridDY );
}
-GridId IcnGridMap_Impl::GetUnoccupiedGrid( BOOL bOccupyFound )
+GridId IcnGridMap_Impl::GetUnoccupiedGrid( sal_Bool bOccupyFound )
{
Create();
- ULONG nStart = 0;
- BOOL bExpanded = FALSE;
+ sal_uLong nStart = 0;
+ sal_Bool bExpanded = sal_False;
while( 1 )
{
- const ULONG nCount = (USHORT)(_nGridCols * _nGridRows);
- for( ULONG nCur = nStart; nCur < nCount; nCur++ )
+ const sal_uLong nCount = (sal_uInt16)(_nGridCols * _nGridRows);
+ for( sal_uLong nCur = nStart; nCur < nCount; nCur++ )
{
if( !_pGridMap[ nCur ] )
{
if( bOccupyFound )
- _pGridMap[ nCur ] = TRUE;
+ _pGridMap[ nCur ] = sal_True;
return (GridId)nCur;
}
}
DBG_ASSERT(!bExpanded,"ExpandGrid failed");
if( bExpanded )
return 0; // prevent never ending loop
- bExpanded = TRUE;
+ bExpanded = sal_True;
Expand();
nStart = nCount;
}
@@ -730,7 +730,7 @@ GridId IcnGridMap_Impl::GetUnoccupiedGrid( BOOL bOccupyFound )
// Bounding-Rect, kann aber zu kleinen Ueberlappungen fuehren
#define OCCUPY_CENTER
-void IcnGridMap_Impl::OccupyGrids( const SvxIconChoiceCtrlEntry* pEntry, BOOL bOccupy )
+void IcnGridMap_Impl::OccupyGrids( const SvxIconChoiceCtrlEntry* pEntry, sal_Bool bOccupy )
{
if( !_pGridMap || !_pView->IsBoundingRectValid( pEntry->aRect ))
return;
@@ -742,7 +742,7 @@ void IcnGridMap_Impl::OccupyGrids( const SvxIconChoiceCtrlEntry* pEntry, BOOL bO
}
-void IcnGridMap_Impl::OccupyGrids( const Rectangle& rRect, BOOL bUsed )
+void IcnGridMap_Impl::OccupyGrids( const Rectangle& rRect, sal_Bool bUsed )
{
if( !_pGridMap )
return;
@@ -756,17 +756,17 @@ void IcnGridMap_Impl::OccupyGrids( const Rectangle& rRect, BOOL bUsed )
else
_aLastOccupiedGrid.SetEmpty();
- BOOL bTopLeftClipped, bBottomRightClipped;
+ sal_Bool bTopLeftClipped, bBottomRightClipped;
GridId nIdTL = GetGrid( rRect.TopLeft(), &bTopLeftClipped );
GridId nIdBR = GetGrid( rRect.BottomRight(), &bBottomRightClipped );
if( bTopLeftClipped && bBottomRightClipped )
return;
- USHORT nX1,nX2,nY1,nY2;
+ sal_uInt16 nX1,nX2,nY1,nY2;
GetGridCoord( nIdTL, nX1, nY1 );
GetGridCoord( nIdBR, nX2, nY2 );
- USHORT nTemp;
+ sal_uInt16 nTemp;
if( nX1 > nX2 )
{
nTemp = nX1;
@@ -795,20 +795,20 @@ void IcnGridMap_Impl::Clear()
}
}
-ULONG IcnGridMap_Impl::GetGridCount( const Size& rSizePixel, USHORT nDX, USHORT nDY)
+sal_uLong IcnGridMap_Impl::GetGridCount( const Size& rSizePixel, sal_uInt16 nDX, sal_uInt16 nDY)
{
long ndx = (rSizePixel.Width() - LROFFS_WINBORDER) / nDX;
if( ndx < 0 ) ndx *= -1;
long ndy = (rSizePixel.Height() - TBOFFS_WINBORDER) / nDY;
if( ndy < 0 ) ndy *= -1;
- return (ULONG)(ndx * ndy);
+ return (sal_uLong)(ndx * ndy);
}
void IcnGridMap_Impl::OutputSizeChanged()
{
if( _pGridMap )
{
- USHORT nCols, nRows;
+ sal_uInt16 nCols, nRows;
GetMinMapSize( nCols, nRows );
if( _pView->nWinBits & WB_ALIGN_TOP )
{
@@ -830,18 +830,18 @@ void IcnGridMap_Impl::OutputSizeChanged()
// Independendly of the views alignment (TOP or LEFT) the gridmap
// should contain the data in a continues region, to make it possible
// to copy the whole block if the gridmap needs to be expanded.
-void IcnGridMap_Impl::GetGridCoord( GridId nId, USHORT& rGridX, USHORT& rGridY )
+void IcnGridMap_Impl::GetGridCoord( GridId nId, sal_uInt16& rGridX, sal_uInt16& rGridY )
{
Create();
if( _pView->nWinBits & WB_ALIGN_TOP )
{
- rGridX = (USHORT)(nId % _nGridCols);
- rGridY = (USHORT)(nId / _nGridCols);
+ rGridX = (sal_uInt16)(nId % _nGridCols);
+ rGridY = (sal_uInt16)(nId / _nGridCols);
}
else
{
- rGridX = (USHORT)(nId / _nGridRows);
- rGridY = (USHORT)(nId % _nGridRows);
+ rGridX = (sal_uInt16)(nId / _nGridRows);
+ rGridY = (sal_uInt16)(nId % _nGridRows);
}
}
diff --git a/svtools/source/contnr/ivctrl.cxx b/svtools/source/contnr/ivctrl.cxx
index 1bd17f9d584c..f26de38cc1ab 100644
--- a/svtools/source/contnr/ivctrl.cxx
+++ b/svtools/source/contnr/ivctrl.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "ivctrl.hxx"
+#include <svtools/ivctrl.hxx>
#include "imivctl.hxx"
#include <vcl/bitmapex.hxx>
#include <vcl/controllayout.hxx>
@@ -42,7 +42,7 @@ using namespace ::com::sun::star::accessibility;
|
\*****************************************************************************/
-SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( const String& rText, const Image& rImage, USHORT _nFlags )
+SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( const String& rText, const Image& rImage, sal_uInt16 _nFlags )
{
aText = rText;
aImage = rImage;
@@ -54,7 +54,7 @@ SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( const String& rText, const Image
pflink = 0;
}
-SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( USHORT _nFlags )
+SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( sal_uInt16 _nFlags )
{
pUserData = NULL;
@@ -64,7 +64,7 @@ SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( USHORT _nFlags )
pflink = 0;
}
-void SvxIconChoiceCtrlEntry::SetMoved( BOOL bMoved )
+void SvxIconChoiceCtrlEntry::SetMoved( sal_Bool bMoved )
{
if( bMoved )
nFlags |= ICNVIEW_FLAG_POS_MOVED;
@@ -72,7 +72,7 @@ void SvxIconChoiceCtrlEntry::SetMoved( BOOL bMoved )
nFlags &= ~ICNVIEW_FLAG_POS_MOVED;
}
-void SvxIconChoiceCtrlEntry::LockPos( BOOL bLock )
+void SvxIconChoiceCtrlEntry::LockPos( sal_Bool bLock )
{
if( bLock )
nFlags |= ICNVIEW_FLAG_POS_LOCKED;
@@ -108,7 +108,7 @@ SvtIconChoiceCtrl::SvtIconChoiceCtrl( Window* pParent, WinBits nWinStyle ) :
_pCurKeyEvent ( NULL ),
_pImp ( new SvxIconChoiceCtrl_Impl( this, nWinStyle ) ),
- _bAutoFontColor ( FALSE )
+ _bAutoFontColor ( sal_False )
{
SetLineColor();
@@ -123,7 +123,7 @@ SvtIconChoiceCtrl::SvtIconChoiceCtrl( Window* pParent, const ResId& rResId ) :
_pCurKeyEvent ( NULL ),
_pImp ( new SvxIconChoiceCtrl_Impl( this, WB_BORDER ) ),
- _bAutoFontColor ( FALSE )
+ _bAutoFontColor ( sal_False )
{
SetLineColor();
@@ -138,14 +138,14 @@ SvtIconChoiceCtrl::~SvtIconChoiceCtrl()
delete _pImp;
}
-SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( ULONG nPos, const Point* pPos, USHORT nFlags )
+SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( sal_uLong nPos, const Point* pPos, sal_uInt16 nFlags )
{
SvxIconChoiceCtrlEntry* pEntry = new SvxIconChoiceCtrlEntry( nFlags );
_pImp->InsertEntry( pEntry, nPos, pPos );
return pEntry;
}
-SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const String& rText, const Image& rImage, ULONG nPos, const Point* pPos, USHORT nFlags )
+SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const String& rText, const Image& rImage, sal_uLong nPos, const Point* pPos, sal_uInt16 nFlags )
{
SvxIconChoiceCtrlEntry* pEntry = new SvxIconChoiceCtrlEntry( rText, rImage, nFlags);
@@ -154,14 +154,14 @@ SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const String& rText, con
return pEntry;
}
-BOOL SvtIconChoiceCtrl::EditedEntry( SvxIconChoiceCtrlEntry*, const XubString&, BOOL )
+sal_Bool SvtIconChoiceCtrl::EditedEntry( SvxIconChoiceCtrlEntry*, const XubString&, sal_Bool )
{
- return TRUE;
+ return sal_True;
}
-BOOL SvtIconChoiceCtrl::EditingEntry( SvxIconChoiceCtrlEntry* )
+sal_Bool SvtIconChoiceCtrl::EditingEntry( SvxIconChoiceCtrlEntry* )
{
- return TRUE;
+ return sal_True;
}
void SvtIconChoiceCtrl::DrawEntryImage( SvxIconChoiceCtrlEntry* pEntry, const Point& rPos, OutputDevice& rDev )
@@ -169,29 +169,29 @@ void SvtIconChoiceCtrl::DrawEntryImage( SvxIconChoiceCtrlEntry* pEntry, const Po
rDev.DrawImage( rPos, pEntry->GetImage() );
}
-String SvtIconChoiceCtrl::GetEntryText( SvxIconChoiceCtrlEntry* pEntry, BOOL )
+String SvtIconChoiceCtrl::GetEntryText( SvxIconChoiceCtrlEntry* pEntry, sal_Bool )
{
return pEntry->GetText();
}
-BOOL SvtIconChoiceCtrl::HasBackground() const
+sal_Bool SvtIconChoiceCtrl::HasBackground() const
{
- return FALSE;
+ return sal_False;
}
-BOOL SvtIconChoiceCtrl::HasFont() const
+sal_Bool SvtIconChoiceCtrl::HasFont() const
{
- return FALSE;
+ return sal_False;
}
-BOOL SvtIconChoiceCtrl::HasFontTextColor() const
+sal_Bool SvtIconChoiceCtrl::HasFontTextColor() const
{
- return TRUE;
+ return sal_True;
}
-BOOL SvtIconChoiceCtrl::HasFontFillColor() const
+sal_Bool SvtIconChoiceCtrl::HasFontFillColor() const
{
- return TRUE;
+ return sal_True;
}
void SvtIconChoiceCtrl::Paint( const Rectangle& rRect )
@@ -223,7 +223,7 @@ void SvtIconChoiceCtrl::ArrangeIcons()
Size aFullSize;
Rectangle aEntryRect;
- for ( ULONG i = 0; i < GetEntryCount(); i++ )
+ for ( sal_uLong i = 0; i < GetEntryCount(); i++ )
{
SvxIconChoiceCtrlEntry* pEntry = GetEntry ( i );
aEntryRect = _pImp->GetEntryBoundRect ( pEntry );
@@ -231,14 +231,14 @@ void SvtIconChoiceCtrl::ArrangeIcons()
aFullSize.setWidth ( aFullSize.getWidth()+aEntryRect.GetWidth() );
}
- _pImp->Arrange ( FALSE, aFullSize.getWidth() );
+ _pImp->Arrange ( sal_False, aFullSize.getWidth() );
}
else if ( GetStyle() & WB_ALIGN_LEFT )
{
Size aFullSize;
Rectangle aEntryRect;
- for ( ULONG i = 0; i < GetEntryCount(); i++ )
+ for ( sal_uLong i = 0; i < GetEntryCount(); i++ )
{
SvxIconChoiceCtrlEntry* pEntry = GetEntry ( i );
aEntryRect = _pImp->GetEntryBoundRect ( pEntry );
@@ -246,13 +246,13 @@ void SvtIconChoiceCtrl::ArrangeIcons()
aFullSize.setHeight ( aFullSize.getHeight()+aEntryRect.GetHeight() );
}
- _pImp->Arrange ( FALSE, 0, aFullSize.getHeight() );
+ _pImp->Arrange ( sal_False, 0, aFullSize.getHeight() );
}
else
{
_pImp->Arrange();
}
- _pImp->Arrange( FALSE, 0, 1000 );
+ _pImp->Arrange( sal_False, 0, 1000 );
}
void SvtIconChoiceCtrl::Resize()
{
@@ -288,7 +288,7 @@ void SvtIconChoiceCtrl::GetFocus()
{
_pImp->GetFocus();
Control::GetFocus();
- ULONG nPos;
+ sal_uLong nPos;
SvxIconChoiceCtrlEntry* pSelectedEntry = GetSelectedEntry ( nPos );
if ( pSelectedEntry )
_pImp->CallEventListeners( VCLEVENT_LISTBOX_SELECT, pSelectedEntry );
@@ -300,7 +300,7 @@ void SvtIconChoiceCtrl::LoseFocus()
Control::LoseFocus();
}
-void SvtIconChoiceCtrl::SetUpdateMode( BOOL bUpdate )
+void SvtIconChoiceCtrl::SetUpdateMode( sal_Bool bUpdate )
{
Control::SetUpdateMode( bUpdate );
_pImp->SetUpdateMode( bUpdate );
@@ -322,7 +322,7 @@ void SvtIconChoiceCtrl::SetPointFont( const Font& rFont )
_pImp->FontModified();
}
}
-SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetEntry( const Point& rPixPos, BOOL bHit ) const
+SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetEntry( const Point& rPixPos, sal_Bool bHit ) const
{
Point aPos( rPixPos );
aPos -= GetMapMode().GetOrigin();
@@ -353,25 +353,25 @@ SvxIconChoiceCtrlTextMode SvtIconChoiceCtrl::GetEntryTextMode( const SvxIconChoi
return _pImp->GetEntryTextModeSmart( pEntry );
}
-SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetNextEntry( const Point& rPixPos, SvxIconChoiceCtrlEntry* pCurEntry, BOOL ) const
+SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetNextEntry( const Point& rPixPos, SvxIconChoiceCtrlEntry* pCurEntry, sal_Bool ) const
{
Point aPos( rPixPos );
aPos -= GetMapMode().GetOrigin();
return ((SvtIconChoiceCtrl*)this)->_pImp->GetNextEntry( aPos, pCurEntry );
}
-SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetPrevEntry( const Point& rPixPos, SvxIconChoiceCtrlEntry* pCurEntry, BOOL ) const
+SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetPrevEntry( const Point& rPixPos, SvxIconChoiceCtrlEntry* pCurEntry, sal_Bool ) const
{
Point aPos( rPixPos );
aPos -= GetMapMode().GetOrigin();
return ((SvtIconChoiceCtrl*)this)->_pImp->GetPrevEntry( aPos, pCurEntry );
}
-ULONG SvtIconChoiceCtrl::GetEntryCount() const
+sal_uLong SvtIconChoiceCtrl::GetEntryCount() const
{
return _pImp->GetEntryCount();
}
-SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetEntry( ULONG nPos ) const
+SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetEntry( sal_uLong nPos ) const
{
return _pImp->GetEntry( nPos );
}
@@ -391,30 +391,30 @@ void SvtIconChoiceCtrl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry )
_pImp->RemoveEntry( pEntry );
}
-SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetSelectedEntry( ULONG& rPos ) const
+SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetSelectedEntry( sal_uLong& rPos ) const
{
return _pImp->GetFirstSelectedEntry( rPos );
}
void SvtIconChoiceCtrl::ClickIcon()
{
- ULONG nPos;
+ sal_uLong nPos;
GetSelectedEntry ( nPos );
_aClickIconHdl.Call( this );
}
-BOOL SvtIconChoiceCtrl::IsEntryEditing() const
+sal_Bool SvtIconChoiceCtrl::IsEntryEditing() const
{
return _pImp->IsEntryEditing();
}
-BOOL SvtIconChoiceCtrl::SetChoiceWithCursor ( BOOL bDo )
+sal_Bool SvtIconChoiceCtrl::SetChoiceWithCursor ( sal_Bool bDo )
{
return _pImp->SetChoiceWithCursor (bDo);
}
void SvtIconChoiceCtrl::KeyInput( const KeyEvent& rKEvt )
{
- BOOL bKeyUsed = DoKeyInput( rKEvt );
+ sal_Bool bKeyUsed = DoKeyInput( rKEvt );
if ( !bKeyUsed )
{
_pCurKeyEvent = (KeyEvent*)&rKEvt;
@@ -422,17 +422,17 @@ void SvtIconChoiceCtrl::KeyInput( const KeyEvent& rKEvt )
_pCurKeyEvent = NULL;
}
}
-BOOL SvtIconChoiceCtrl::DoKeyInput( const KeyEvent& rKEvt )
+sal_Bool SvtIconChoiceCtrl::DoKeyInput( const KeyEvent& rKEvt )
{
// unter OS/2 bekommen wir auch beim Editieren Key-Up/Down
if( IsEntryEditing() )
- return TRUE;
+ return sal_True;
_pCurKeyEvent = (KeyEvent*)&rKEvt;
- BOOL bHandled = _pImp->KeyInput( rKEvt );
+ sal_Bool bHandled = _pImp->KeyInput( rKEvt );
_pCurKeyEvent = NULL;
return bHandled;
}
-ULONG SvtIconChoiceCtrl::GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const
+sal_uLong SvtIconChoiceCtrl::GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const
{
return _pImp->GetEntryListPos( pEntry );
}
@@ -537,7 +537,7 @@ void SvtIconChoiceCtrl::SetSelectionMode( SelectionMode eMode )
_pImp->SetSelectionMode( eMode );
}
-BOOL SvtIconChoiceCtrl::HandleShortCutKey( const KeyEvent& r )
+sal_Bool SvtIconChoiceCtrl::HandleShortCutKey( const KeyEvent& r )
{
return _pImp->HandleShortCutKey( r );
}
@@ -591,7 +591,7 @@ void SvtIconChoiceCtrl::SetNoSelection()
_pImp->SetNoSelection();
}
-void SvtIconChoiceCtrl::CallImplEventListeners(ULONG nEvent, void* pData)
+void SvtIconChoiceCtrl::CallImplEventListeners(sal_uLong nEvent, void* pData)
{
CallEventListeners(nEvent, pData);
}
diff --git a/svtools/source/contnr/makefile.mk b/svtools/source/contnr/makefile.mk
deleted file mode 100644
index 777297b33e9c..000000000000
--- a/svtools/source/contnr/makefile.mk
+++ /dev/null
@@ -1,82 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=svcontnr
-
-PROJECTPCH4DLL=TRUE
-PROJECTPCH=cont_pch
-PROJECTPCHSOURCE=cont_pch
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-EXCEPTIONSFILES=\
- $(SLO)$/contentenumeration.obj \
- $(SLO)$/fileview.obj \
- $(SLO)$/imivctl1.obj \
- $(SLO)$/imivctl2.obj \
- $(SLO)$/ivctrl.obj \
- $(SLO)$/svicnvw.obj \
- $(SLO)$/svimpbox.obj \
- $(SLO)$/svimpicn.obj \
- $(SLO)$/svlbitm.obj \
- $(SLO)$/svlbox.obj \
- $(SLO)$/svtabbx.obj \
- $(SLO)$/svtreebx.obj \
- $(SLO)$/templwin.obj \
- $(SLO)$/tooltiplbox.obj
-
-SLOFILES= $(EXCEPTIONSFILES) \
- $(SLO)$/treelist.obj
-
-SRS1NAME=$(TARGET)
-SRC1FILES =\
- fileview.src \
- templwin.src \
- svcontnr.src
-
-HXX1TARGET= svcontnr
-HXX1EXT= hxx
-HXX1FILES= $(PRJ)$/inc$/svlbox.hxx \
- $(PRJ)$/inc$/svlbitm.hxx \
- $(PRJ)$/inc$/svtreebx.hxx \
- $(PRJ)$/inc$/svicnvw.hxx \
- $(PRJ)$/inc$/svtabbx.hxx \
- $(PRJ)$/inc$/treelist.hxx
-HXX1EXCL= -E:*include*
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svtools/source/contnr/svicnvw.cxx b/svtools/source/contnr/svicnvw.cxx
index 03a1a13b0b6d..6fd401533267 100644
--- a/svtools/source/contnr/svicnvw.cxx
+++ b/svtools/source/contnr/svicnvw.cxx
@@ -48,7 +48,6 @@ SvIcnVwDataEntry::~SvIcnVwDataEntry()
SvIconView::SvIconView( Window* pParent, WinBits nWinStyle ) :
SvLBox( pParent, nWinStyle | WB_BORDER )
{
- nWinBits = nWinStyle;
nIcnVwFlags = 0;
pImp = new SvImpIconView( this, GetModel(), nWinStyle | WB_ICON );
pImp->mpViewData = 0;
@@ -70,8 +69,6 @@ SvIconView::SvIconView( Window* pParent , const ResId& rResId ) :
SetBackground( Wallpaper( rStyleSettings.GetFieldColor() ) );
SetDefaultFont();
pImp->SetSelectionMode( GetSelectionMode() );
- pImp->SetWindowBits( nWindowStyle );
- nWinBits = nWindowStyle;
}
SvIconView::~SvIconView()
@@ -107,7 +104,7 @@ void SvIconView::DisconnectFromModel()
SvLBoxEntry* SvIconView::InsertEntry( const XubString& rText,
- SvLBoxEntry* pParent, BOOL bChildsOnDemand, ULONG nPos )
+ SvLBoxEntry* pParent, sal_Bool bChildsOnDemand, sal_uLong nPos )
{
SvLBoxEntry* pEntry = CreateEntry(
rText, aCollapsedEntryBmp, aExpandedEntryBmp );
@@ -123,7 +120,7 @@ SvLBoxEntry* SvIconView::InsertEntry( const XubString& rText,
SvLBoxEntry* SvIconView::InsertEntry( const XubString& rText,
const Image& rExpEntryBmp,
const Image& rCollEntryBmp,
- SvLBoxEntry* pParent, BOOL bChildsOnDemand, ULONG nPos)
+ SvLBoxEntry* pParent, sal_Bool bChildsOnDemand, sal_uLong nPos)
{
SvLBoxEntry* pEntry = CreateEntry(
rText, rCollEntryBmp, rExpEntryBmp );
@@ -219,7 +216,7 @@ SvLBoxEntry* SvIconView::CloneEntry( SvLBoxEntry* pSource )
}
-USHORT SvIconView::IsA()
+sal_uInt16 SvIconView::IsA()
{
return SV_LISTBOX_ID_ICONVIEW;
}
@@ -227,7 +224,7 @@ USHORT SvIconView::IsA()
void SvIconView::RequestingChilds( SvLBoxEntry* pParent )
{
if ( !pParent->HasChilds() )
- InsertEntry( String::CreateFromAscii("<dummy>"), pParent, FALSE, LIST_APPEND );
+ InsertEntry( String::CreateFromAscii("<dummy>"), pParent, sal_False, LIST_APPEND );
}
void SvIconView::Paint( const Rectangle& rRect )
@@ -257,7 +254,7 @@ void SvIconView::KeyInput( const KeyEvent& rKEvt )
return;
nImpFlags |= SVLBOX_IS_TRAVELSELECT;
- BOOL bKeyUsed = pImp->KeyInput( rKEvt );
+ sal_Bool bKeyUsed = pImp->KeyInput( rKEvt );
if ( !bKeyUsed )
SvLBox::KeyInput( rKEvt );
nImpFlags &= ~SVLBOX_IS_TRAVELSELECT;
@@ -281,7 +278,7 @@ void SvIconView::LoseFocus()
SvLBox::LoseFocus();
}
-void SvIconView::SetUpdateMode( BOOL bUpdate )
+void SvIconView::SetUpdateMode( sal_Bool bUpdate )
{
Control::SetUpdateMode( bUpdate );
if ( bUpdate )
@@ -320,7 +317,7 @@ void SvIconView::ModelHasInsertedTree( SvListEntry* pEntry )
}
void SvIconView::ModelIsMoving(SvListEntry* pSource,
- SvListEntry* /* pTargetParent */ , ULONG /* nChildPos */ )
+ SvListEntry* /* pTargetParent */ , sal_uLong /* nChildPos */ )
{
pImp->MovingEntry( (SvLBoxEntry*)pSource );
}
@@ -349,7 +346,7 @@ void SvIconView::ModelHasEntryInvalidated( SvListEntry* pEntry )
pImp->ModelHasEntryInvalidated( pEntry );
}
-void SvIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow )
+void SvIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool bShow )
{
pImp->ShowTargetEmphasis( pEntry, bShow );
}
@@ -361,10 +358,10 @@ Point SvIconView::GetEntryPosition( SvLBoxEntry* pEntry ) const
void SvIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos)
{
- pImp->SetEntryPosition( pEntry, rPos, FALSE, TRUE );
+ pImp->SetEntryPosition( pEntry, rPos, sal_False, sal_True );
}
-void SvIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, BOOL bAdjustAtGrid )
+void SvIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, sal_Bool bAdjustAtGrid )
{
pImp->SetEntryPosition( pEntry, rPos, bAdjustAtGrid );
}
@@ -372,7 +369,7 @@ void SvIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, BOOL
void SvIconView::SetFont( const Font& rFont )
{
Font aTempFont( rFont );
- aTempFont.SetTransparent( TRUE );
+ aTempFont.SetTransparent( sal_True );
SvLBox::SetFont( aTempFont );
RecalcViewData();
pImp->ChangedFont();
@@ -388,7 +385,7 @@ SvLBoxEntry* SvIconView::GetDropTarget( const Point& rPos )
return pImp->GetDropTarget( rPos );
}
-SvLBoxEntry* SvIconView::GetEntry( const Point& rPixPos, BOOL ) const
+SvLBoxEntry* SvIconView::GetEntry( const Point& rPixPos, sal_Bool ) const
{
Point aPos( rPixPos );
aPos -= GetMapMode().GetOrigin();
@@ -401,10 +398,11 @@ SvLBoxEntry* SvIconView::GetEntryFromLogicPos( const Point& rDocPos ) const
}
-void SvIconView::SetWindowBits( WinBits nWinStyle )
+void SvIconView::StateChanged( StateChangedType i_nStateChange )
{
- nWinBits = nWinStyle;
- pImp->SetWindowBits( nWinStyle );
+ SvLBox::StateChanged( i_nStateChange );
+ if ( i_nStateChange == STATE_CHANGE_STYLE )
+ pImp->SetStyle( GetStyle() );
}
void SvIconView::PaintEntry( SvLBoxEntry* pEntry )
@@ -440,10 +438,10 @@ void SvIconView::SetSelectionMode( SelectionMode eSelectMode )
pImp->SetSelectionMode( eSelectMode );
}
-BOOL SvIconView::Select( SvLBoxEntry* pEntry, BOOL bSelect )
+sal_Bool SvIconView::Select( SvLBoxEntry* pEntry, sal_Bool bSelect )
{
EndEditing();
- BOOL bRetVal = SvListView::Select( pEntry, bSelect );
+ sal_Bool bRetVal = SvListView::Select( pEntry, bSelect );
if( bRetVal )
{
pImp->EntrySelected( pEntry, bSelect );
@@ -453,7 +451,7 @@ BOOL SvIconView::Select( SvLBoxEntry* pEntry, BOOL bSelect )
return bRetVal;
}
-void SvIconView::SelectAll( BOOL bSelect, BOOL )
+void SvIconView::SelectAll( sal_Bool bSelect, sal_Bool )
{
SvLBoxEntry* pEntry = pImp->GetCurParent();
pEntry = FirstChild( pEntry );
@@ -467,6 +465,7 @@ void SvIconView::SelectAll( BOOL bSelect, BOOL )
void SvIconView::SetCurEntry( SvLBoxEntry* _pEntry )
{
pImp->SetCursor( _pEntry );
+ OnCurrentEntryChanged();
}
SvLBoxEntry* SvIconView::GetCurEntry() const
@@ -477,7 +476,7 @@ SvLBoxEntry* SvIconView::GetCurEntry() const
void SvIconView::Arrange()
{
#ifdef DBG_UTIL
- USHORT n=1;
+ sal_uInt16 n=1;
if( n == 1 && n-1 == 0 )
{
pImp->Arrange();
@@ -497,20 +496,20 @@ void SvIconView::SetSpaceBetweenEntries( long nX, long nY )
pImp->SetSpaceBetweenEntries( nX, nY );
}
-BOOL SvIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
- SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos )
+sal_Bool SvIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos )
{
return pImp->NotifyMoving(pTarget,pEntry,rpNewParent,rNewChildPos);
}
-BOOL SvIconView::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
- SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos )
+sal_Bool SvIconView::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos )
{
return pImp->NotifyCopying(pTarget,pEntry,rpNewParent,rNewChildPos);
}
-void SvIconView::EnableInplaceEditing( BOOL bEnable )
+void SvIconView::EnableInplaceEditing( sal_Bool bEnable )
{
SvLBox::EnableInplaceEditing( bEnable );
}
@@ -523,7 +522,7 @@ void SvIconView::EditingRequest( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
Selection aSel( SELECTION_MIN, SELECTION_MAX );
if ( EditingEntry( pEntry, aSel ) )
{
- SelectAll( FALSE );
+ SelectAll( sal_False );
EditItemText( pEntry, (SvLBoxString*)pItem, aSel );
}
}
@@ -536,7 +535,7 @@ void SvIconView::EditItemText( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
DBG_ASSERT(pEntry&&pItem,"EditItemText:Params?");
pCurEdEntry = pEntry;
pCurEdItem = pItem;
- Rectangle aRect( pImp->CalcTextRect( pEntry, (SvLBoxString*)pItem,0,TRUE ));
+ Rectangle aRect( pImp->CalcTextRect( pEntry, (SvLBoxString*)pItem,0,sal_True ));
aRect.Bottom() += 4;
pImp->MakeVisible( aRect ); // vor der Umrechnung in Pixel-Koord. rufen!
@@ -548,9 +547,6 @@ void SvIconView::EditItemText( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
aRect.Bottom() += 2; // sieht huebscher aus
-#ifdef WIN
- aRect.Bottom() += 4;
-#endif
#ifdef OS2
#if OS2_SINGLE_LINE_EDIT
@@ -566,7 +562,7 @@ void SvIconView::EditItemText( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
#endif
#endif // OS2
- EditText( ((SvLBoxString*)pItem)->GetText(), aRect, rSel, TRUE );
+ EditText( ((SvLBoxString*)pItem)->GetText(), aRect, rSel, sal_True );
}
void SvIconView::EditEntry( SvLBoxEntry* pEntry )
@@ -581,7 +577,7 @@ void SvIconView::EditEntry( SvLBoxEntry* pEntry )
Selection aSel( SELECTION_MIN, SELECTION_MAX );
if( EditingEntry( pEntry, aSel ) )
{
- SelectAll( FALSE );
+ SelectAll( sal_False );
EditItemText( pEntry, pItem, aSel );
}
}
@@ -601,14 +597,14 @@ void SvIconView::EditedText( const XubString& rStr )
}
-BOOL SvIconView::EditingEntry( SvLBoxEntry*, Selection& )
+sal_Bool SvIconView::EditingEntry( SvLBoxEntry*, Selection& )
{
- return TRUE;
+ return sal_True;
}
-BOOL SvIconView::EditedEntry( SvLBoxEntry*, const XubString& )
+sal_Bool SvIconView::EditedEntry( SvLBoxEntry*, const XubString& )
{
- return TRUE;
+ return sal_True;
}
@@ -661,9 +657,9 @@ Region SvIconView::GetDragRegion() const
return aRegion;
}
-ULONG SvIconView::GetSelectionCount() const
+sal_uLong SvIconView::GetSelectionCount() const
{
- return (ULONG)(pImp->GetSelectionCount());
+ return (sal_uLong)(pImp->GetSelectionCount());
}
void SvIconView::SetGrid( long nDX, long nDY )
@@ -671,18 +667,18 @@ void SvIconView::SetGrid( long nDX, long nDY )
pImp->SetGrid( nDX, nDY );
}
-void SvIconView::ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
- SvListEntry* pEntry2, ULONG nPos )
+void SvIconView::ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry1,
+ SvListEntry* pEntry2, sal_uLong nPos )
{
SvLBox::ModelNotification( nActionId, pEntry1, pEntry2, nPos );
switch( nActionId )
{
case LISTACTION_RESORTING:
- SetUpdateMode( FALSE );
+ SetUpdateMode( sal_False );
break;
case LISTACTION_RESORTED:
- SetUpdateMode( TRUE );
+ SetUpdateMode( sal_True );
Arrange();
break;
@@ -694,9 +690,9 @@ void SvIconView::ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
}
-void SvIconView::Scroll( long nDeltaX, long nDeltaY, USHORT )
+void SvIconView::Scroll( long nDeltaX, long nDeltaY, sal_uInt16 )
{
- pImp->Scroll( nDeltaX, nDeltaY, FALSE );
+ pImp->Scroll( nDeltaX, nDeltaY, sal_False );
}
void SvIconView::PrepareCommandEvent( const CommandEvent& rCEvt )
@@ -707,7 +703,7 @@ void SvIconView::PrepareCommandEvent( const CommandEvent& rCEvt )
void SvIconView::StartDrag( sal_Int8 nAction, const Point& rPos )
{
pImp->SttDrag( rPos );
- SvLBoxEntry* pEntry = GetEntry( rPos, TRUE );
+ SvLBoxEntry* pEntry = GetEntry( rPos, sal_True );
pImp->mpViewData = pEntry;
SvLBox::StartDrag( nAction, rPos );
}
@@ -753,14 +749,14 @@ void SvIconView::HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos )
pImp->HideShowDDIcon( pRefEntry, rPos );
}
-void SvIconView::SelectRect( const Rectangle& rRect, BOOL bAdd,
+void SvIconView::SelectRect( const Rectangle& rRect, sal_Bool bAdd,
SvPtrarr* pRects, short nOffs )
{
pImp->SelectRect( rRect, bAdd, pRects, nOffs );
}
void SvIconView::CalcScrollOffsets( const Point& rRefPosPixel, long& rX, long& rY,
- BOOL b, USHORT nBorderWidth )
+ sal_Bool b, sal_uInt16 nBorderWidth )
{
pImp->CalcScrollOffsets( rRefPosPixel, rX, rY, b, nBorderWidth );
}
@@ -784,7 +780,7 @@ void SvIconView::AdjustAtGrid( SvLBoxEntry* pEntry )
pImp->AdjustAtGrid( pEntry );
}
-void SvIconView::LockEntryPos( SvLBoxEntry* pEntry, BOOL bLock )
+void SvIconView::LockEntryPos( SvLBoxEntry* pEntry, sal_Bool bLock )
{
SvIcnVwDataEntry* pViewData = (SvIcnVwDataEntry*)GetViewData( pEntry );
if( bLock )
@@ -793,7 +789,7 @@ void SvIconView::LockEntryPos( SvLBoxEntry* pEntry, BOOL bLock )
pViewData->ClearVwFlags( ICNVW_FLAG_POS_LOCKED );
}
-BOOL SvIconView::IsEntryPosLocked( const SvLBoxEntry* pEntry ) const
+sal_Bool SvIconView::IsEntryPosLocked( const SvLBoxEntry* pEntry ) const
{
const SvIcnVwDataEntry* pViewData = (const SvIcnVwDataEntry*)GetViewData( (SvListEntry*)pEntry );
return pViewData->IsEntryPosLocked();
@@ -809,14 +805,14 @@ SvIconViewTextMode SvIconView::GetTextMode( const SvLBoxEntry* pEntry ) const
return pImp->GetTextMode( pEntry );
}
-SvLBoxEntry* SvIconView::GetNextEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, BOOL ) const
+SvLBoxEntry* SvIconView::GetNextEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, sal_Bool ) const
{
Point aPos( rPixPos );
aPos -= GetMapMode().GetOrigin();
return ((SvIconView*)this)->pImp->GetNextEntry( aPos, pCurEntry );
}
-SvLBoxEntry* SvIconView::GetPrevEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, BOOL ) const
+SvLBoxEntry* SvIconView::GetPrevEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, sal_Bool ) const
{
Point aPos( rPixPos );
aPos -= GetMapMode().GetOrigin();
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 9c5b4a56df30..69e9d12ace50 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -30,13 +30,10 @@
#include "precompiled_svtools.hxx"
#include <vcl/svapp.hxx>
#include <vcl/salnativewidgets.hxx>
-
#include <vcl/help.hxx>
-#include <tabbar.hxx>
+#include <svtools/tabbar.hxx>
-#ifndef _STACK_
#include <stack>
-#endif
#define _SVTREEBX_CXX
#include <svtools/svtreebx.hxx>
@@ -44,10 +41,8 @@
#include <svimpbox.hxx>
#include <rtl/instance.hxx>
#include <svtools/svtdata.hxx>
-
+#include <tools/wintypes.hxx>
#include <svtools/svtools.hrc>
-
-// #102891# --------------------
#include <comphelper/processfactory.hxx>
#define NODE_BMP_TABDIST_NOTVALID -2000000
@@ -75,8 +70,8 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvLBoxTreeList* pLBTree, WinBits n
pView = pLBView;
pTree = pLBTree;
aSelEng.SetFunctionSet( (FunctionSet*)&aFctSet );
- aSelEng.ExpandSelectionOnMouseMove( FALSE );
- SetWindowBits( nWinStyle );
+ aSelEng.ExpandSelectionOnMouseMove( sal_False );
+ SetStyle( nWinStyle );
SetSelectionMode( SINGLE_SELECTION );
SetDragDropMode( 0 );
@@ -101,7 +96,7 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvLBoxTreeList* pLBTree, WinBits n
nYoffsNodeBmp = 0;
nNodeBmpWidth = 0;
- bAsyncBeginDrag = FALSE;
+ bAsyncBeginDrag = sal_False;
aAsyncBeginDragTimer.SetTimeout( 0 );
aAsyncBeginDragTimer.SetTimeoutHdl( LINK(this,SvImpLBox,BeginDragHdl));
// Button-Animation in Listbox
@@ -119,11 +114,11 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvLBoxTreeList* pLBTree, WinBits n
pMostRightEntry = 0;
nCurUserEvent = 0xffffffff;
- bUpdateMode = TRUE;
- bInVScrollHdl = FALSE;
+ bUpdateMode = sal_True;
+ bInVScrollHdl = sal_False;
nFlags |= F_FILLING;
- bSubLstOpRet = bSubLstOpLR = bContextMenuHandling = bIsCellFocusEnabled = FALSE;
+ bSubLstOpRet = bSubLstOpLR = bContextMenuHandling = bIsCellFocusEnabled = sal_False;
}
SvImpLBox::~SvImpLBox()
@@ -165,7 +160,7 @@ short SvImpLBox::UpdateContextBmpWidthVector( SvLBoxEntry* pEntry, short nWidth
{
DBG_ASSERT( pView->pModel, "View and Model aren't valid!" );
- USHORT nDepth = pView->pModel->GetDepth( pEntry );
+ sal_uInt16 nDepth = pView->pModel->GetDepth( pEntry );
// initialize vector if necessary
std::vector< short >::size_type nSize = aContextBmpWidthVector.size();
while ( nDepth > nSize )
@@ -213,7 +208,7 @@ void SvImpLBox::UpdateContextBmpWidthVectorFromMovedEntry( SvLBoxEntry* pEntry )
void SvImpLBox::UpdateContextBmpWidthMax( SvLBoxEntry* pEntry )
{
- USHORT nDepth = pView->pModel->GetDepth( pEntry );
+ sal_uInt16 nDepth = pView->pModel->GetDepth( pEntry );
if( aContextBmpWidthVector.size() < 1 )
return;
short nWidth = aContextBmpWidthVector[ nDepth ];
@@ -244,11 +239,11 @@ void SvImpLBox::CalcCellFocusRect( SvLBoxEntry* pEntry, Rectangle& rRect )
}
}
-void SvImpLBox::SetWindowBits( WinBits nWinStyle )
+void SvImpLBox::SetStyle( WinBits i_nWinStyle )
{
- nWinBits = nWinStyle;
- if((nWinStyle & WB_SIMPLEMODE) && aSelEng.GetSelectionMode()==MULTIPLE_SELECTION)
- aSelEng.AddAlways( TRUE );
+ m_nStyle = i_nWinStyle;
+ if ( ( m_nStyle & WB_SIMPLEMODE) && ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION ) )
+ aSelEng.AddAlways( sal_True );
}
void SvImpLBox::SetExtendedWindowBits( ExtendedWinBits _nBits )
@@ -335,11 +330,11 @@ IMPL_LINK( SvImpLBox, ScrollUpDownHdl, ScrollBar *, pScrollBar )
nFlags &= (~F_FILLING);
- bInVScrollHdl = TRUE;
+ bInVScrollHdl = sal_True;
if( pView->IsEditingActive() )
{
- pView->EndEditing( TRUE ); // Cancel
+ pView->EndEditing( sal_True ); // Cancel
pView->Update();
}
BeginScroll();
@@ -349,7 +344,7 @@ IMPL_LINK( SvImpLBox, ScrollUpDownHdl, ScrollBar *, pScrollBar )
if( nDelta == 1 )
CursorDown();
else
- PageDown( (USHORT) nDelta );
+ PageDown( (sal_uInt16) nDelta );
}
else
{
@@ -357,9 +352,9 @@ IMPL_LINK( SvImpLBox, ScrollUpDownHdl, ScrollBar *, pScrollBar )
if( nDelta == 1 )
CursorUp();
else
- PageUp( (USHORT) nDelta );
+ PageUp( (sal_uInt16) nDelta );
}
- bInVScrollHdl = FALSE;
+ bInVScrollHdl = sal_False;
return 0;
}
@@ -371,13 +366,13 @@ void SvImpLBox::CursorDown()
{
nFlags &= (~F_FILLING);
pView->NotifyScrolling( -1 );
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
pView->Update();
pStartEntry = pNextFirstToDraw;
Rectangle aArea( GetVisibleArea() );
pView->Scroll( 0, -(pView->GetEntryHeight()), aArea, SCROLL_NOCHILDREN );
pView->Update();
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
pView->NotifyScrolled();
}
}
@@ -390,31 +385,31 @@ void SvImpLBox::CursorUp()
nFlags &= (~F_FILLING);
long nEntryHeight = pView->GetEntryHeight();
pView->NotifyScrolling( 1 );
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
pView->Update();
pStartEntry = pPrevFirstToDraw;
Rectangle aArea( GetVisibleArea() );
aArea.Bottom() -= nEntryHeight;
pView->Scroll( 0, nEntryHeight, aArea, SCROLL_NOCHILDREN );
pView->Update();
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
pView->NotifyScrolled();
}
}
-void SvImpLBox::PageDown( USHORT nDelta )
+void SvImpLBox::PageDown( sal_uInt16 nDelta )
{
- USHORT nRealDelta = nDelta;
+ sal_uInt16 nRealDelta = nDelta;
if( !nDelta )
return;
SvLBoxEntry* pNext;
pNext = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nRealDelta ));
- if( (ULONG)pNext == (ULONG)pStartEntry )
+ if( (sal_uLong)pNext == (sal_uLong)pStartEntry )
return;
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
nFlags &= (~F_FILLING);
pView->Update();
@@ -438,21 +433,21 @@ void SvImpLBox::PageDown( USHORT nDelta )
pView->NotifyScrolled();
}
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
-void SvImpLBox::PageUp( USHORT nDelta )
+void SvImpLBox::PageUp( sal_uInt16 nDelta )
{
- USHORT nRealDelta = nDelta;
+ sal_uInt16 nRealDelta = nDelta;
if( !nDelta )
return;
SvLBoxEntry* pPrev = (SvLBoxEntry*)(pView->PrevVisible( pStartEntry, nRealDelta ));
- if( (ULONG)pPrev == (ULONG)pStartEntry )
+ if( (sal_uLong)pPrev == (sal_uLong)pStartEntry )
return;
nFlags &= (~F_FILLING);
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
pView->Update();
pStartEntry = pPrev;
@@ -472,10 +467,10 @@ void SvImpLBox::PageUp( USHORT nDelta )
pView->NotifyScrolled();
}
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
-void SvImpLBox::KeyUp( BOOL bPageUp, BOOL bNotifyScroll )
+void SvImpLBox::KeyUp( sal_Bool bPageUp, sal_Bool bNotifyScroll )
{
if( !aVerSBar.IsVisible() )
return;
@@ -509,7 +504,7 @@ void SvImpLBox::KeyUp( BOOL bPageUp, BOOL bNotifyScroll )
}
-void SvImpLBox::KeyDown( BOOL bPageDown, BOOL bNotifyScroll )
+void SvImpLBox::KeyDown( sal_Bool bPageDown, sal_Bool bNotifyScroll )
{
if( !aVerSBar.IsVisible() )
return;
@@ -584,15 +579,15 @@ void SvImpLBox::InvalidateEntry( SvLBoxEntry* pEntry )
}
if( !(nFlags & F_IN_PAINT ))
{
- BOOL bHasFocusRect = FALSE;
+ sal_Bool bHasFocusRect = sal_False;
if( pEntry==pCursor && pView->HasFocus() )
{
- bHasFocusRect = TRUE;
- ShowCursor( FALSE );
+ bHasFocusRect = sal_True;
+ ShowCursor( sal_False );
}
InvalidateEntry( GetEntryLine( pEntry ) );
if( bHasFocusRect )
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
}
@@ -617,7 +612,7 @@ void SvImpLBox::RecalcFocusRect()
// Setzt Cursor. Passt bei SingleSelection die Selektion an
//
-void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect )
+void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect )
{
SvViewDataEntry* pViewDataNewCur = 0;
if( pEntry )
@@ -640,18 +635,18 @@ void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect )
SvLBoxEntry* pOldCursor = pCursor;
if( pCursor && pEntry != pCursor )
{
- pView->SetEntryFocus( pCursor, FALSE );
+ pView->SetEntryFocus( pCursor, sal_False );
if( bSimpleTravel )
- pView->Select( pCursor, FALSE );
+ pView->Select( pCursor, sal_False );
pView->HideFocus();
}
pCursor = pEntry;
if( pCursor )
{
- pViewDataNewCur->SetFocus( TRUE );
+ pViewDataNewCur->SetFocus( sal_True );
if(!bForceNoSelect && bSimpleTravel && !(nFlags & F_DESEL_ALL) && GetUpdateMode())
{
- pView->Select( pCursor, TRUE );
+ pView->Select( pCursor, sal_True );
}
// Mehrfachselektion: Im Cursor-Move selektieren, wenn
// nicht im Add-Mode (Ctrl-F8)
@@ -660,11 +655,11 @@ void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect )
!(nFlags & F_DESEL_ALL) && !aSelEng.IsAddMode() &&
!bForceNoSelect )
{
- pView->Select( pCursor, TRUE );
+ pView->Select( pCursor, sal_True );
}
else
{
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
if( pAnchor )
@@ -674,9 +669,11 @@ void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect )
}
}
nFlags &= (~F_DESEL_ALL);
+
+ pView->OnCurrentEntryChanged();
}
-void SvImpLBox::ShowCursor( BOOL bShow )
+void SvImpLBox::ShowCursor( sal_Bool bShow )
{
if( !bShow || !pCursor || !pView->HasFocus() )
{
@@ -701,8 +698,8 @@ void SvImpLBox::ShowCursor( BOOL bShow )
-void SvImpLBox::UpdateAll( BOOL bInvalidateCompleteView,
- BOOL bUpdateVerScrollBar )
+void SvImpLBox::UpdateAll( sal_Bool bInvalidateCompleteView,
+ sal_Bool bUpdateVerScrollBar )
{
if( bUpdateVerScrollBar )
FindMostRight(0);
@@ -711,8 +708,8 @@ void SvImpLBox::UpdateAll( BOOL bInvalidateCompleteView,
FillView();
ShowVerSBar();
if( bSimpleTravel && pCursor && pView->HasFocus() )
- pView->Select( pCursor, TRUE );
- ShowCursor( TRUE );
+ pView->Select( pCursor, sal_True );
+ ShowCursor( sal_True );
if( bInvalidateCompleteView )
pView->Invalidate();
else
@@ -726,7 +723,7 @@ IMPL_LINK_INLINE_START( SvImpLBox, ScrollLeftRightHdl, ScrollBar *, pScrollBar )
{
if( pView->IsEditingActive() )
{
- pView->EndEditing( TRUE ); // Cancel
+ pView->EndEditing( sal_True ); // Cancel
pView->Update();
}
pView->nFocusWidth = -1;
@@ -743,7 +740,7 @@ void SvImpLBox::KeyLeftRight( long nDelta )
BeginScroll();
nFlags &= (~F_FILLING);
pView->NotifyScrolling( 0 ); // 0 == horizontales Scrolling
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
// neuen Origin berechnen
long nPos = aHorSBar.GetThumbPos();
@@ -761,7 +758,7 @@ void SvImpLBox::KeyLeftRight( long nDelta )
else
pView->Invalidate();
RecalcFocusRect();
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
pView->NotifyScrolled();
}
@@ -780,8 +777,8 @@ SvLBoxEntry* SvImpLBox::GetClickedEntry( const Point& rPoint ) const
if( pView->GetEntryCount() == 0 || !pStartEntry || !pView->GetEntryHeight())
return 0;
- USHORT nClickedEntry = (USHORT)(rPoint.Y() / pView->GetEntryHeight() );
- USHORT nTemp = nClickedEntry;
+ sal_uInt16 nClickedEntry = (sal_uInt16)(rPoint.Y() / pView->GetEntryHeight() );
+ sal_uInt16 nTemp = nClickedEntry;
SvLBoxEntry* pEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nTemp ));
return pEntry;
}
@@ -790,13 +787,13 @@ SvLBoxEntry* SvImpLBox::GetClickedEntry( const Point& rPoint ) const
// prueft, ob der Eintrag "richtig" getroffen wurde
// (Focusrect+ ContextBitmap bei TreeListBox)
//
-BOOL SvImpLBox::EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPosPixel,long nLine)
+sal_Bool SvImpLBox::EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPosPixel,long nLine)
{
- BOOL bRet;
+ sal_Bool bRet;
// bei "besonderen" Entries (mit CheckButtons usw.) sind wir
// nicht so pingelig
if( pEntry->ItemCount() >= 3 )
- return TRUE;
+ return sal_True;
Rectangle aRect( pView->GetFocusRect( pEntry, nLine ));
aRect.Right() = GetOutputSize().Width() - pView->GetMapMode().GetOrigin().X();
@@ -809,9 +806,9 @@ BOOL SvImpLBox::EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPosPixel,long n
Point aPos( rPosPixel );
aPos -= pView->GetMapMode().GetOrigin();
if( aRect.IsInside( aPos ) )
- bRet = TRUE;
+ bRet = sal_True;
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
@@ -824,8 +821,8 @@ SvLBoxEntry* SvImpLBox::GetEntry( const Point& rPoint ) const
|| !pView->GetEntryHeight())
return 0;
- USHORT nClickedEntry = (USHORT)(rPoint.Y() / pView->GetEntryHeight() );
- USHORT nTemp = nClickedEntry;
+ sal_uInt16 nClickedEntry = (sal_uInt16)(rPoint.Y() / pView->GetEntryHeight() );
+ sal_uInt16 nTemp = nClickedEntry;
SvLBoxEntry* pEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nTemp ));
if( nTemp != nClickedEntry )
pEntry = 0;
@@ -833,7 +830,7 @@ SvLBoxEntry* SvImpLBox::GetEntry( const Point& rPoint ) const
}
-SvLBoxEntry* SvImpLBox::MakePointVisible(const Point& rPoint,BOOL bNotifyScroll)
+SvLBoxEntry* SvImpLBox::MakePointVisible(const Point& rPoint,sal_Bool bNotifyScroll)
{
if( !pCursor )
return 0;
@@ -848,19 +845,19 @@ SvLBoxEntry* SvImpLBox::MakePointVisible(const Point& rPoint,BOOL bNotifyScroll)
pEntry = (SvLBoxEntry*)(pView->NextVisible( pCursor ));
if( pEntry && pEntry != pCursor )
- pView->SetEntryFocus( pCursor, FALSE );
+ pView->SetEntryFocus( pCursor, sal_False );
if( nY < 0 )
- KeyUp( FALSE, bNotifyScroll );
+ KeyUp( sal_False, bNotifyScroll );
else
- KeyDown( FALSE, bNotifyScroll );
+ KeyDown( sal_False, bNotifyScroll );
}
else
{
pEntry = GetClickedEntry( rPoint );
if( !pEntry )
{
- USHORT nSteps = 0xFFFF;
+ sal_uInt16 nSteps = 0xFFFF;
// LastVisible ist noch nicht implementiert!
pEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nSteps ));
}
@@ -869,7 +866,7 @@ SvLBoxEntry* SvImpLBox::MakePointVisible(const Point& rPoint,BOOL bNotifyScroll)
if( pEntry != pCursor &&
aSelEng.GetSelectionMode() == SINGLE_SELECTION
)
- pView->Select( pCursor, FALSE );
+ pView->Select( pCursor, sal_False );
}
}
return pEntry;
@@ -897,11 +894,11 @@ void SvImpLBox::Paint( const Rectangle& rRect )
SvLBoxEntry* pFirst = pView->First();
if( pFirst != pStartEntry )
{
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
pStartEntry = pView->First();
aVerSBar.SetThumbPos( 0 );
StopUserEvent();
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
nCurUserEvent = Application::PostUserEvent(LINK(this,SvImpLBox,MyUserEvent),(void*)1);
return;
}
@@ -919,8 +916,8 @@ void SvImpLBox::Paint( const Rectangle& rRect )
long nEntryHeight = pView->GetEntryHeight();
// Bereich der zu zeichnenden Entries berechnen
- USHORT nStartLine = (USHORT)( rRect.Top() / nEntryHeight );
- USHORT nCount = (USHORT)( nRectHeight / nEntryHeight );
+ sal_uInt16 nStartLine = (sal_uInt16)( rRect.Top() / nEntryHeight );
+ sal_uInt16 nCount = (sal_uInt16)( nRectHeight / nEntryHeight );
nCount += 2; // keine Zeile vergessen
long nY = nStartLine * nEntryHeight;
@@ -935,15 +932,15 @@ void SvImpLBox::Paint( const Rectangle& rRect )
// erst die Linien Zeichnen, dann clippen!
pView->SetClipRegion();
- if( nWinBits & ( WB_HASLINES | WB_HASLINESATROOT ) )
+ if( m_nStyle & ( WB_HASLINES | WB_HASLINESATROOT ) )
DrawNet();
pView->SetClipRegion( aClipRegion );
- for( USHORT n=0; n< nCount && pEntry; n++ )
+ for( sal_uInt16 n=0; n< nCount && pEntry; n++ )
{
/*long nMaxRight=*/
- pView->PaintEntry1( pEntry, nY, 0xffff, TRUE );
+ pView->PaintEntry1( pEntry, nY, 0xffff, sal_True );
nY += nEntryHeight;
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
@@ -951,8 +948,8 @@ void SvImpLBox::Paint( const Rectangle& rRect )
if ( !pCursor && ( ( nExtendedWinBits & EWB_NO_AUTO_CURENTRY ) == 0 ) )
{
// do not select if multiselection or explicit set
- BOOL bNotSelect = ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION )
- || ( ( nWinBits & WB_NOINITIALSELECTION ) == WB_NOINITIALSELECTION );
+ sal_Bool bNotSelect = ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION )
+ || ( ( m_nStyle & WB_NOINITIALSELECTION ) == WB_NOINITIALSELECTION );
SetCursor( pStartEntry, bNotSelect );
}
@@ -967,17 +964,17 @@ void SvImpLBox::Paint( const Rectangle& rRect )
nFlags &= (~F_IN_PAINT);
}
-void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop )
+void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop )
{
if( !pEntry )
return;
- BOOL bInView = IsEntryInView( pEntry );
+ sal_Bool bInView = IsEntryInView( pEntry );
if( bInView && (!bMoveToTop || pStartEntry == pEntry) )
return; // ist schon sichtbar
- if( pStartEntry || (nWinBits & WB_FORCE_MAKEVISIBLE) )
+ if( pStartEntry || (m_nStyle & WB_FORCE_MAKEVISIBLE) )
nFlags &= (~F_FILLING);
if( !bInView )
{
@@ -989,7 +986,7 @@ void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop )
if( !pView->IsExpanded( pParent ) )
{
#ifdef DBG_UTIL
- BOOL bRet =
+ sal_Bool bRet =
#endif
pView->Expand( pParent );
DBG_ASSERT(bRet,"Not expanded!");
@@ -1003,10 +1000,10 @@ void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop )
}
pStartEntry = pEntry;
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
FillView();
aVerSBar.SetThumbPos( (long)(pView->GetVisiblePos( pStartEntry )) );
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
pView->Invalidate();
}
@@ -1022,21 +1019,21 @@ void SvImpLBox::RepaintSelectionItems()
if( nNodeBmpTabDistance == NODE_BMP_TABDIST_NOTVALID )
SetNodeBmpTabDistance();
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
long nEntryHeight = pView->GetEntryHeight();
- ULONG nCount = nVisibleCount;
+ sal_uLong nCount = nVisibleCount;
long nY = 0;
SvLBoxEntry* pEntry = pStartEntry;
- for( ULONG n=0; n< nCount && pEntry; n++ )
+ for( sal_uLong n=0; n< nCount && pEntry; n++ )
{
pView->PaintEntry1( pEntry, nY, 0xffff ); //wg. ItemsetBrowser SV_LBOXTAB_SHOW_SELECTION );
nY += nEntryHeight;
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
@@ -1072,7 +1069,7 @@ void SvImpLBox::DrawNet()
SvLBoxTab* pFirstDynamicTab = pView->GetFirstDynamicTab();
while( pTree->GetDepth( pEntry ) > 0 )
pEntry = pView->GetParent( pEntry );
- USHORT nOffs = (USHORT)(pView->GetVisiblePos( pStartEntry ) -
+ sal_uInt16 nOffs = (sal_uInt16)(pView->GetVisiblePos( pStartEntry ) -
pView->GetVisiblePos( pEntry ));
long nY = 0;
nY -= ( nOffs * nEntryHeight );
@@ -1087,12 +1084,12 @@ void SvImpLBox::DrawNet()
aCol = rStyleSettings.GetShadowColor();
pView->SetLineColor( aCol );
Point aPos1, aPos2;
- USHORT nDistance;
- ULONG nMax = nVisibleCount + nOffs + 1;
+ sal_uInt16 nDistance;
+ sal_uLong nMax = nVisibleCount + nOffs + 1;
const Image& rExpandedNodeBitmap = GetExpandedNodeBmp();
- for( ULONG n=0; n< nMax && pEntry; n++ )
+ for( sal_uLong n=0; n< nMax && pEntry; n++ )
{
if( pView->IsExpanded(pEntry) )
{
@@ -1108,14 +1105,14 @@ void SvImpLBox::DrawNet()
pChild = pView->FirstChild( pEntry );
DBG_ASSERT(pChild,"Child?");
pChild = pTree->LastSibling( pChild );
- nDistance = (USHORT)(pView->GetVisiblePos(pChild) -
+ nDistance = (sal_uInt16)(pView->GetVisiblePos(pChild) -
pView->GetVisiblePos(pEntry));
aPos2 = aPos1;
aPos2.Y() += nDistance * nEntryHeight;
pView->DrawLine( aPos1, aPos2 );
}
// Sichtbar im Control ?
- if( n>= nOffs && ((nWinBits & WB_HASLINESATROOT) || !pTree->IsAtRootDepth(pEntry)))
+ if( n>= nOffs && ((m_nStyle & WB_HASLINESATROOT) || !pTree->IsAtRootDepth(pEntry)))
{
// kann aPos1 recyclet werden ?
if( !pView->IsExpanded(pEntry) )
@@ -1137,7 +1134,7 @@ void SvImpLBox::DrawNet()
nY += nEntryHeight;
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
- if( nWinBits & WB_HASLINESATROOT )
+ if( m_nStyle & WB_HASLINESATROOT )
{
pEntry = pView->First();
aPos1.X() = pView->GetTabPos( pEntry, pFirstDynamicTab);
@@ -1163,7 +1160,7 @@ static long GetOptSize( TabBar* pTabBar )
return pTabBar->CalcWindowSizePixel().Width();
}
-void SvImpLBox::PositionScrollBars( Size& rSize, USHORT nMask )
+void SvImpLBox::PositionScrollBars( Size& rSize, sal_uInt16 nMask )
{
long nOverlap = 0;
@@ -1221,30 +1218,31 @@ void SvImpLBox::PositionScrollBars( Size& rSize, USHORT nMask )
}
// nResult: Bit0 == VerSBar Bit1 == HorSBar
-USHORT SvImpLBox::AdjustScrollBars( Size& rSize )
+sal_uInt16 SvImpLBox::AdjustScrollBars( Size& rSize )
{
long nEntryHeight = pView->GetEntryHeight();
if( !nEntryHeight )
return 0;
- USHORT nResult = 0;
+ sal_uInt16 nResult = 0;
Size aOSize( pView->Control::GetOutputSizePixel() );
- BOOL bVerSBar = ( pView->nWindowStyle & WB_VSCROLL ) != 0;
- BOOL bHorBar = FALSE;
+ const WinBits nWindowStyle = pView->GetStyle();
+ sal_Bool bVerSBar = ( nWindowStyle & WB_VSCROLL ) != 0;
+ sal_Bool bHorBar = sal_False;
long nMaxRight = aOSize.Width(); //GetOutputSize().Width();
Point aOrigin( pView->GetMapMode().GetOrigin() );
aOrigin.X() *= -1;
nMaxRight += aOrigin.X() - 1;
long nVis = nMostRight - aOrigin.X();
if( pTabBar || (
- (pView->nWindowStyle & WB_HSCROLL) &&
+ (nWindowStyle & WB_HSCROLL) &&
(nVis < nMostRight || nMaxRight < nMostRight) ))
- bHorBar = TRUE;
+ bHorBar = sal_True;
// Anzahl aller nicht eingeklappten Eintraege
- ULONG nTotalCount = pView->GetVisibleCount();
+ sal_uLong nTotalCount = pView->GetVisibleCount();
// Anzahl in der View sichtbarer Eintraege
nVisibleCount = aOSize.Height() / nEntryHeight;
@@ -1257,9 +1255,9 @@ USHORT SvImpLBox::AdjustScrollBars( Size& rSize )
nMaxRight -= nVerSBarWidth;
if( !bHorBar )
{
- if( (pView->nWindowStyle & WB_HSCROLL) &&
+ if( (nWindowStyle & WB_HSCROLL) &&
(nVis < nMostRight || nMaxRight < nMostRight) )
- bHorBar = TRUE;
+ bHorBar = sal_True;
}
}
@@ -1322,7 +1320,7 @@ USHORT SvImpLBox::AdjustScrollBars( Size& rSize )
nTemp = nNewThumbPos - nTemp;
if( pView->IsEditingActive() )
{
- pView->EndEditing( TRUE ); // Cancel
+ pView->EndEditing( sal_True ); // Cancel
pView->Update();
}
pView->nFocusWidth = -1;
@@ -1378,23 +1376,23 @@ void SvImpLBox::FillView()
{
if( !pStartEntry )
{
- USHORT nVisibleViewCount = (USHORT)(pView->GetVisibleCount());
- USHORT nTempThumb = (USHORT)aVerSBar.GetThumbPos();
+ sal_uInt16 nVisibleViewCount = (sal_uInt16)(pView->GetVisibleCount());
+ sal_uInt16 nTempThumb = (sal_uInt16)aVerSBar.GetThumbPos();
if( nTempThumb >= nVisibleViewCount )
nTempThumb = nVisibleViewCount - 1;
pStartEntry = (SvLBoxEntry*)(pView->GetEntryAtVisPos(nTempThumb));
}
if( pStartEntry )
{
- USHORT nLast = (USHORT)(pView->GetVisiblePos( (SvLBoxEntry*)(pView->LastVisible())));
- USHORT nThumb = (USHORT)(pView->GetVisiblePos( pStartEntry ));
- USHORT nCurDispEntries = nLast-nThumb+1;
+ sal_uInt16 nLast = (sal_uInt16)(pView->GetVisiblePos( (SvLBoxEntry*)(pView->LastVisible())));
+ sal_uInt16 nThumb = (sal_uInt16)(pView->GetVisiblePos( pStartEntry ));
+ sal_uInt16 nCurDispEntries = nLast-nThumb+1;
if( nCurDispEntries < nVisibleCount )
{
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
// Fenster fuellen, indem der Thumb schrittweise
// nach oben bewegt wird
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
SvLBoxEntry* pTemp = pStartEntry;
while( nCurDispEntries < nVisibleCount && pTemp )
{
@@ -1404,13 +1402,13 @@ void SvImpLBox::FillView()
nThumb--;
pStartEntry = pTemp;
nCurDispEntries++;
- bFound = TRUE;
+ bFound = sal_True;
}
}
if( bFound )
{
aVerSBar.SetThumbPos( nThumb );
- ShowCursor( TRUE ); // Focusrect neu berechnen
+ ShowCursor( sal_True ); // Focusrect neu berechnen
pView->Invalidate();
}
}
@@ -1422,11 +1420,11 @@ void SvImpLBox::FillView()
void SvImpLBox::ShowVerSBar()
{
- BOOL bVerBar = ( pView->nWindowStyle & WB_VSCROLL ) != 0;
- ULONG nVis = 0;
+ sal_Bool bVerBar = ( pView->GetStyle() & WB_VSCROLL ) != 0;
+ sal_uLong nVis = 0;
if( !bVerBar )
nVis = pView->GetVisibleCount();
- if( bVerBar || (nVisibleCount && nVis > (ULONG)(nVisibleCount-1)) )
+ if( bVerBar || (nVisibleCount && nVis > (sal_uLong)(nVisibleCount-1)) )
{
if( !aVerSBar.IsVisible() )
{
@@ -1495,18 +1493,18 @@ void SvImpLBox::SyncVerThumb()
aVerSBar.SetThumbPos( 0 );
}
-BOOL SvImpLBox::IsEntryInView( SvLBoxEntry* pEntry ) const
+sal_Bool SvImpLBox::IsEntryInView( SvLBoxEntry* pEntry ) const
{
// Parent eingeklappt
if( !pView->IsEntryVisible(pEntry) )
- return FALSE;
+ return sal_False;
long nY = GetEntryLine( pEntry );
if( nY < 0 )
- return FALSE;
+ return sal_False;
long nMax = nVisibleCount * pView->GetEntryHeight();
if( nY >= nMax )
- return FALSE;
- return TRUE;
+ return sal_False;
+ return sal_True;
}
@@ -1549,10 +1547,10 @@ void SvImpLBox::IndentChanged( short /* nIndentPixel */ ) {}
void SvImpLBox::EntryExpanded( SvLBoxEntry* pEntry )
{
- // SelAllDestrAnch( FALSE, TRUE ); //DeselectAll();
+ // SelAllDestrAnch( sal_False, sal_True ); //DeselectAll();
if( GetUpdateMode() )
{
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
long nY = GetEntryLine( pEntry );
if( IsLineVisible(nY) )
{
@@ -1564,7 +1562,7 @@ void SvImpLBox::EntryExpanded( SvLBoxEntry* pEntry )
// die Thumb-Position korrigiert werden.
SyncVerThumb();
ShowVerSBar();
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
}
@@ -1573,7 +1571,7 @@ void SvImpLBox::EntryCollapsed( SvLBoxEntry* pEntry )
if( !pView->IsEntryVisible( pEntry ) )
return;
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
if( !pMostRightEntry || pTree->IsChild( pEntry,pMostRightEntry ) )
{
@@ -1583,13 +1581,13 @@ void SvImpLBox::EntryCollapsed( SvLBoxEntry* pEntry )
if( pStartEntry )
{
long nOldThumbPos = aVerSBar.GetThumbPos();
- ULONG nVisList = pView->GetVisibleCount();
+ sal_uLong nVisList = pView->GetVisibleCount();
aVerSBar.SetRange( Range(0, nVisList-1) );
long nNewThumbPos = aVerSBar.GetThumbPos();
if( nNewThumbPos != nOldThumbPos )
{
pStartEntry = pView->First();
- USHORT nDistance = (USHORT)nNewThumbPos;
+ sal_uInt16 nDistance = (sal_uInt16)nNewThumbPos;
if( nDistance )
pStartEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry,
nDistance));
@@ -1605,9 +1603,9 @@ void SvImpLBox::EntryCollapsed( SvLBoxEntry* pEntry )
SetCursor( pEntry );
if( GetUpdateMode() )
ShowVerSBar();
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
if( GetUpdateMode() && pCursor )
- pView->Select( pCursor, TRUE );
+ pView->Select( pCursor, sal_True );
}
void SvImpLBox::CollapsingEntry( SvLBoxEntry* pEntry )
@@ -1615,7 +1613,7 @@ void SvImpLBox::CollapsingEntry( SvLBoxEntry* pEntry )
if( !pView->IsEntryVisible( pEntry ) || !pStartEntry )
return;
- SelAllDestrAnch( FALSE, TRUE ); // deselectall
+ SelAllDestrAnch( sal_False, sal_True ); // deselectall
// ist der eingeklappte Parent sichtbar ?
long nY = GetEntryLine( pEntry );
@@ -1658,13 +1656,13 @@ void SvImpLBox::SetNodeBmpTabDistance()
//
// korrigiert bei SingleSelection den Cursor
//
-void SvImpLBox::EntrySelected( SvLBoxEntry* pEntry, BOOL bSelect )
+void SvImpLBox::EntrySelected( SvLBoxEntry* pEntry, sal_Bool bSelect )
{
if( nFlags & F_IGNORE_SELECT )
return;
/*
- if( (nWinBits & WB_HIDESELECTION) && pEntry && !pView->HasFocus() )
+ if( (m_nStyle & WB_HIDESELECTION) && pEntry && !pView->HasFocus() )
{
SvViewData* pViewData = pView->GetViewData( pEntry );
pViewData->SetCursored( bSelect );
@@ -1685,9 +1683,9 @@ void SvImpLBox::EntrySelected( SvLBoxEntry* pEntry, BOOL bSelect )
long nY = GetEntryLine( pEntry );
if( IsLineVisible( nY ) )
{
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
pView->PaintEntry1( pEntry, nY, 0xffff ); // wg. ItemsetBrowser SV_LBOXTAB_SHOW_SELECTION );
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
}
}
@@ -1731,14 +1729,14 @@ void SvImpLBox::RemovingEntry( SvLBoxEntry* pEntry )
if( pCursor && pCursor == pEntry )
{
if( bSimpleTravel )
- pView->Select( pCursor, FALSE );
- ShowCursor( FALSE ); // Focus-Rect weg
+ pView->Select( pCursor, sal_False );
+ ShowCursor( sal_False ); // Focus-Rect weg
// NextSibling, weil auch Childs des Cursors geloescht werden
pTemp = pView->NextSibling( pCursor );
if( !pTemp )
pTemp = (SvLBoxEntry*)(pView->PrevVisible( pCursor ));
- SetCursor( pTemp, TRUE );
+ SetCursor( pTemp, sal_True );
}
if( pStartEntry && pStartEntry == pEntry )
{
@@ -1771,10 +1769,10 @@ void SvImpLBox::EntryRemoved()
if( !pStartEntry )
pStartEntry = pTree->First();
if( !pCursor )
- SetCursor( pStartEntry, TRUE );
+ SetCursor( pStartEntry, sal_True );
if( pCursor && (bSimpleTravel || !pView->GetSelectionCount() ))
- pView->Select( pCursor, TRUE );
+ pView->Select( pCursor, sal_True );
if( GetUpdateMode())
{
@@ -1802,9 +1800,9 @@ void SvImpLBox::EntryRemoved()
MakeVisible( pCursor );
}
else
- pView->Select( pCursor, TRUE );
+ pView->Select( pCursor, sal_True );
}
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
nFlags &= (~F_REMOVED_RECALC_MOST_RIGHT);
}
@@ -1813,12 +1811,12 @@ void SvImpLBox::EntryRemoved()
void SvImpLBox::MovingEntry( SvLBoxEntry* pEntry )
{
int bDeselAll = nFlags & F_DESEL_ALL;
- SelAllDestrAnch( FALSE, TRUE ); // DeselectAll();
+ SelAllDestrAnch( sal_False, sal_True ); // DeselectAll();
if( !bDeselAll )
nFlags &= (~F_DESEL_ALL);
if( pEntry == pCursor )
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
if( IsEntryInView( pEntry ) )
pView->Invalidate();
if( pEntry == pStartEntry )
@@ -1851,8 +1849,8 @@ void SvImpLBox::EntryMoved( SvLBoxEntry* pEntry )
pStartEntry = pView->First();
aVerSBar.SetRange( Range(0, pView->GetVisibleCount()-1));
- USHORT nFirstPos = (USHORT)pTree->GetAbsPos( pStartEntry );
- USHORT nNewPos = (USHORT)pTree->GetAbsPos( pEntry );
+ sal_uInt16 nFirstPos = (sal_uInt16)pTree->GetAbsPos( pStartEntry );
+ sal_uInt16 nNewPos = (sal_uInt16)pTree->GetAbsPos( pEntry );
FindMostRight(0);
if( nNewPos < nFirstPos ) //!!!Notloesung
pStartEntry = pEntry;
@@ -1861,7 +1859,7 @@ void SvImpLBox::EntryMoved( SvLBoxEntry* pEntry )
if( pEntry == pCursor )
{
if( pView->IsEntryVisible( pCursor ) )
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
else
{
SvLBoxEntry* pParent = pEntry;
@@ -1891,16 +1889,16 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry )
return;
int bDeselAll = nFlags & F_DESEL_ALL;
if( bDeselAll )
- SelAllDestrAnch( FALSE, TRUE );
+ SelAllDestrAnch( sal_False, sal_True );
else
DestroyAnchor();
// nFlags &= (~F_DESEL_ALL);
-// ShowCursor( FALSE ); // falls sich Cursor nach unten verschiebt
+// ShowCursor( sal_False ); // falls sich Cursor nach unten verschiebt
long nY = GetEntryLine( pEntry );
- BOOL bEntryVisible = IsLineVisible( nY );
+ sal_Bool bEntryVisible = IsLineVisible( nY );
if( bEntryVisible )
{
- ShowCursor( FALSE ); // falls sich Cursor nach unten verschiebt
+ ShowCursor( sal_False ); // falls sich Cursor nach unten verschiebt
nY -= pView->GetEntryHeight(); // wg. Linien
InvalidateEntriesFrom( nY );
}
@@ -1909,9 +1907,9 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry )
// pruefen, ob die View komplett gefuellt ist. Wenn
// nicht, dann pStartEntry und den Cursor anpassen
// (automatisches scrollen)
- USHORT nLast = (USHORT)(pView->GetVisiblePos( (SvLBoxEntry*)(pView->LastVisible())));
- USHORT nThumb = (USHORT)(pView->GetVisiblePos( pStartEntry ));
- USHORT nCurDispEntries = nLast-nThumb+1;
+ sal_uInt16 nLast = (sal_uInt16)(pView->GetVisiblePos( (SvLBoxEntry*)(pView->LastVisible())));
+ sal_uInt16 nThumb = (sal_uInt16)(pView->GetVisiblePos( pStartEntry ));
+ sal_uInt16 nCurDispEntries = nLast-nThumb+1;
if( nCurDispEntries < nVisibleCount )
{
// beim naechsten Paint-Event setzen
@@ -1926,7 +1924,7 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry )
// die Linien invalidieren
/*
if( (bEntryVisible || bPrevEntryVisible) &&
- (nWinBits & ( WB_HASLINES | WB_HASLINESATROOT )) )
+ (m_nStyle & ( WB_HASLINES | WB_HASLINESATROOT )) )
{
SvLBoxTab* pTab = pView->GetFirstDynamicTab();
if( pTab )
@@ -1944,7 +1942,7 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry )
aVerSBar.SetRange( Range(0, pView->GetVisibleCount()-1));
SyncVerThumb(); // falls vor Thumb eingefuegt wurde
ShowVerSBar();
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
if( pStartEntry != pView->First() && (nFlags & F_FILLING) )
pView->Update();
}
@@ -1959,7 +1957,7 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry )
// ****** Steuerung der Controlanimation
-BOOL SvImpLBox::ButtonDownCheckCtrl(const MouseEvent& rMEvt, SvLBoxEntry* pEntry,
+sal_Bool SvImpLBox::ButtonDownCheckCtrl(const MouseEvent& rMEvt, SvLBoxEntry* pEntry,
long nY )
{
SvLBoxItem* pItem = pView->GetItem(pEntry,rMEvt.GetPosPixel().X(),&pActiveTab);
@@ -1970,18 +1968,18 @@ BOOL SvImpLBox::ButtonDownCheckCtrl(const MouseEvent& rMEvt, SvLBoxEntry* pEntry
if( pCursor == pActiveEntry )
pView->HideFocus();
pView->CaptureMouse();
- pActiveButton->SetStateHilighted( TRUE );
+ pActiveButton->SetStateHilighted( sal_True );
pView->PaintEntry1( pActiveEntry, nY,
SV_LBOXTAB_PUSHABLE | SV_LBOXTAB_ADJUST_CENTER |
SV_LBOXTAB_ADJUST_RIGHT );
- return TRUE;
+ return sal_True;
}
else
pActiveButton = 0;
- return FALSE;
+ return sal_False;
}
-BOOL SvImpLBox::MouseMoveCheckCtrl( const MouseEvent& rMEvt, SvLBoxEntry* pEntry)
+sal_Bool SvImpLBox::MouseMoveCheckCtrl( const MouseEvent& rMEvt, SvLBoxEntry* pEntry)
{
if( pActiveButton )
{
@@ -1992,7 +1990,7 @@ BOOL SvImpLBox::MouseMoveCheckCtrl( const MouseEvent& rMEvt, SvLBoxEntry* pEntry
{
if( !pActiveButton->IsStateHilighted() )
{
- pActiveButton->SetStateHilighted(TRUE );
+ pActiveButton->SetStateHilighted(sal_True );
nY = GetEntryLine( pActiveEntry );
pView->PaintEntry1( pActiveEntry, nY,
SV_LBOXTAB_PUSHABLE | SV_LBOXTAB_ADJUST_CENTER |
@@ -2003,24 +2001,24 @@ BOOL SvImpLBox::MouseMoveCheckCtrl( const MouseEvent& rMEvt, SvLBoxEntry* pEntry
{
if( pActiveButton->IsStateHilighted() )
{
- pActiveButton->SetStateHilighted(FALSE );
+ pActiveButton->SetStateHilighted(sal_False );
nY = GetEntryLine( pActiveEntry );
pView->PaintEntry1( pActiveEntry, nY, SV_LBOXTAB_PUSHABLE );
}
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL SvImpLBox::ButtonUpCheckCtrl( const MouseEvent& rMEvt )
+sal_Bool SvImpLBox::ButtonUpCheckCtrl( const MouseEvent& rMEvt )
{
if( pActiveButton )
{
pView->ReleaseMouse();
SvLBoxEntry* pEntry = GetClickedEntry( rMEvt.GetPosPixel() );
long nY = GetEntryLine( pActiveEntry );
- pActiveButton->SetStateHilighted( FALSE );
+ pActiveButton->SetStateHilighted( sal_False );
long nMouseX = rMEvt.GetPosPixel().X();
if( pEntry == pActiveEntry &&
pView->GetItem( pActiveEntry, nMouseX ) == pActiveButton )
@@ -2029,26 +2027,26 @@ BOOL SvImpLBox::ButtonUpCheckCtrl( const MouseEvent& rMEvt )
SV_LBOXTAB_PUSHABLE | SV_LBOXTAB_ADJUST_CENTER |
SV_LBOXTAB_ADJUST_RIGHT );
if( pCursor == pActiveEntry )
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
pActiveButton = 0;
pActiveEntry = 0;
pActiveTab = 0;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// ******* Steuerung Plus/Minus-Button zum Expandieren/Kollabieren
-// FALSE == kein Expand/Collapse-Button getroffen
-BOOL SvImpLBox::IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) const
+// sal_False == kein Expand/Collapse-Button getroffen
+sal_Bool SvImpLBox::IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) const
{
if( !pEntry->HasChilds() && !pEntry->HasChildsOnDemand() )
- return FALSE;
+ return sal_False;
SvLBoxTab* pFirstDynamicTab = pView->GetFirstDynamicTab();
if( !pFirstDynamicTab )
- return FALSE;
+ return sal_False;
long nMouseX = rPosPixel.X();
// in Doc-Koords umrechnen
@@ -2058,26 +2056,26 @@ BOOL SvImpLBox::IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) cons
long nX = pView->GetTabPos( pEntry, pFirstDynamicTab);
nX += nNodeBmpTabDistance;
if( nMouseX < nX )
- return FALSE;
+ return sal_False;
nX += nNodeBmpWidth;
if( nMouseX > nX )
- return FALSE;
- return TRUE;
+ return sal_False;
+ return sal_True;
}
-// FALSE == hit no node button
-BOOL SvImpLBox::ButtonDownCheckExpand( const MouseEvent& rMEvt, SvLBoxEntry* pEntry, long /* nY */ )
+// sal_False == hit no node button
+sal_Bool SvImpLBox::ButtonDownCheckExpand( const MouseEvent& rMEvt, SvLBoxEntry* pEntry, long /* nY */ )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( pView->IsEditingActive() && pEntry == pView->pEdEntry )
// inplace editing -> nothing to do
- bRet = TRUE;
+ bRet = sal_True;
else if ( IsNodeButton( rMEvt.GetPosPixel(), pEntry ) )
{
if ( pView->IsExpanded( pEntry ) )
{
- pView->EndEditing( TRUE );
+ pView->EndEditing( sal_True );
pView->Collapse( pEntry );
}
else
@@ -2085,7 +2083,7 @@ BOOL SvImpLBox::ButtonDownCheckExpand( const MouseEvent& rMEvt, SvLBoxEntry* pEn
// you can expand an entry, which is in editing
pView->Expand( pEntry );
}
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -2152,7 +2150,7 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt )
{
// neu selektieren & tschuess
if( !bSimpleTravel && !aSelEng.IsAlwaysAdding())
- SelAllDestrAnch( FALSE, TRUE ); // DeselectAll();
+ SelAllDestrAnch( sal_False, sal_True ); // DeselectAll();
SetCursor( pEntry );
return;
@@ -2165,7 +2163,7 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt )
pView->Expand( pEntry );
if( pEntry == pCursor ) // nur wenn Entryitem angeklickt wurde
// (Nodebutton ist kein Entryitem!)
- pView->Select( pCursor, TRUE );
+ pView->Select( pCursor, sal_True );
return;
}
}
@@ -2173,7 +2171,7 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt )
else
{
// CheckButton? (TreeListBox: Check + Info)
- if( ButtonDownCheckCtrl(rMEvt, pEntry, nY) == TRUE)
+ if( ButtonDownCheckCtrl(rMEvt, pEntry, nY) == sal_True)
return;
// Inplace-Editing?
}
@@ -2214,31 +2212,32 @@ void SvImpLBox::MouseMove( const MouseEvent& rMEvt)
return;
}
-BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
+sal_Bool SvImpLBox::KeyInput( const KeyEvent& rKEvt)
{
aEditTimer.Stop();
const KeyCode& rKeyCode = rKEvt.GetKeyCode();
if( rKeyCode.IsMod2() )
- return FALSE; // Alt-Taste nicht auswerten
+ return sal_False; // Alt-Taste nicht auswerten
nFlags &= (~F_FILLING);
if( !pCursor )
pCursor = pStartEntry;
if( !pCursor )
- return FALSE;
+ return sal_False;
- BOOL bKeyUsed = TRUE;
+ sal_Bool bKeyUsed = sal_True;
- USHORT nDelta = (USHORT)aVerSBar.GetPageSize();
- USHORT aCode = rKeyCode.GetCode();
+ sal_uInt16 nDelta = (sal_uInt16)aVerSBar.GetPageSize();
+ sal_uInt16 aCode = rKeyCode.GetCode();
- BOOL bShift = rKeyCode.IsShift();
- BOOL bMod1 = rKeyCode.IsMod1();
+ sal_Bool bShift = rKeyCode.IsShift();
+ sal_Bool bMod1 = rKeyCode.IsMod1();
SvLBoxEntry* pNewCursor;
+ const WinBits nWindowStyle = pView->GetStyle();
switch( aCode )
{
case KEY_UP:
@@ -2265,7 +2264,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
aSelEng.CursorPosChanging( bShift, bMod1 );
SetCursor( pNewCursor, bMod1 ); // no selection, when Ctrl is on
if( !IsEntryInView( pNewCursor ) )
- KeyUp( FALSE );
+ KeyUp( sal_False );
}
break;
@@ -2298,13 +2297,13 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
else
{
if( pCursor )
- pView->Select( pCursor, FALSE );
- KeyDown( FALSE );
+ pView->Select( pCursor, sal_False );
+ KeyDown( sal_False );
SetCursor( pNewCursor, bMod1 ); // no selection, when Ctrl is on
}
}
else
- KeyDown( FALSE ); // weil ScrollBar-Range evtl. noch
+ KeyDown( sal_False ); // weil ScrollBar-Range evtl. noch
// scrollen erlaubt
break;
@@ -2317,11 +2316,11 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
if ( nCurTabPos < ( pView->TabCount() - 1 /*!2*/ ) )
{
++nCurTabPos;
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
CallEventListeners( VCLEVENT_LISTBOX_SELECT, pCursor );
}
}
- else if( pView->nWindowStyle & WB_HSCROLL )
+ else if( nWindowStyle & WB_HSCROLL )
{
long nThumb = aHorSBar.GetThumbPos();
nThumb += aHorSBar.GetLineSize();
@@ -2337,7 +2336,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
}
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
}
@@ -2348,11 +2347,11 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
if ( nCurTabPos > FIRST_ENTRY_TAB )
{
--nCurTabPos;
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
CallEventListeners( VCLEVENT_LISTBOX_SELECT, pCursor );
}
}
- else if ( pView->nWindowStyle & WB_HSCROLL )
+ else if ( nWindowStyle & WB_HSCROLL )
{
long nThumb = aHorSBar.GetThumbPos();
nThumb -= aHorSBar.GetLineSize();
@@ -2380,7 +2379,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
else if( bSubLstOpLR && IsExpandable() )
pView->Collapse( pCursor );
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
}
@@ -2397,19 +2396,19 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
if( nDelta )
{
- DBG_ASSERT(pNewCursor&&(ULONG)pNewCursor!=(ULONG)pCursor,"Cursor?");
+ DBG_ASSERT(pNewCursor&&(sal_uLong)pNewCursor!=(sal_uLong)pCursor,"Cursor?");
aSelEng.CursorPosChanging( bShift, bMod1 );
if( IsEntryInView( pNewCursor ) )
SetCursor( pNewCursor );
else
{
SetCursor( pNewCursor );
- KeyUp( TRUE );
+ KeyUp( sal_True );
}
}
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_PAGEDOWN:
@@ -2425,21 +2424,21 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
if( nDelta )
{
- DBG_ASSERT(pNewCursor&&(ULONG)pNewCursor!=(ULONG)pCursor,"Cursor?");
+ DBG_ASSERT(pNewCursor&&(sal_uLong)pNewCursor!=(sal_uLong)pCursor,"Cursor?");
aSelEng.CursorPosChanging( bShift, bMod1 );
if( IsEntryInView( pNewCursor ) )
SetCursor( pNewCursor );
else
{
SetCursor( pNewCursor );
- KeyDown( TRUE );
+ KeyDown( sal_True );
}
}
else
- KeyDown( FALSE ); // siehe KEY_DOWN
+ KeyDown( sal_False ); // siehe KEY_DOWN
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_SPACE:
@@ -2454,19 +2453,23 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
else if ( !bShift /*&& !bMod1*/ )
{
if ( aSelEng.IsAddMode() )
+ {
// toggle selection
pView->Select( pCursor, !pView->IsSelected( pCursor ) );
- else
+ }
+ else if ( !pView->IsSelected( pCursor ) )
{
- SelAllDestrAnch( FALSE );
- pView->Select( pCursor, TRUE );
+ SelAllDestrAnch( sal_False );
+ pView->Select( pCursor, sal_True );
}
+ else
+ bKeyUsed = sal_False;
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_RETURN:
@@ -2478,7 +2481,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
pView->Expand( pCursor );
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_F2:
@@ -2488,20 +2491,20 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
EditTimerCall( 0 );
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_F8:
if( bShift && pView->GetSelectionMode()==MULTIPLE_SELECTION &&
- !(nWinBits & WB_SIMPLEMODE))
+ !(m_nStyle & WB_SIMPLEMODE))
{
if( aSelEng.IsAlwaysAdding() )
- aSelEng.AddAlways( FALSE );
+ aSelEng.AddAlways( sal_False );
else
- aSelEng.AddAlways( TRUE );
+ aSelEng.AddAlways( sal_True );
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_ADD:
@@ -2511,7 +2514,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
pView->Expand( pCursor );
if( bMod1 )
{
- USHORT nRefDepth = pTree->GetDepth( pCursor );
+ sal_uInt16 nRefDepth = pTree->GetDepth( pCursor );
SvLBoxEntry* pCur = pTree->Next( pCursor );
while( pCur && pTree->GetDepth(pCur) > nRefDepth )
{
@@ -2522,14 +2525,14 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
}
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_A:
if( bMod1 )
- SelAllDestrAnch( TRUE );
-// else
-// bKeyUsed = FALSE; #105907# assume user wants to use quicksearch with key "a", so key is handled!
+ SelAllDestrAnch( sal_True );
+ else
+ bKeyUsed = sal_False;
break;
case KEY_SUBTRACT:
@@ -2543,7 +2546,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
SvLBoxEntry* pParentToCollapse = (SvLBoxEntry*)pTree->GetRootLevelParent(pCursor);
if( pParentToCollapse )
{
- USHORT nRefDepth;
+ sal_uInt16 nRefDepth;
// Sonderbehandlung Explorer: Befindet sich auf der
// Root nur ein Eintrag,dann den Root-Entry nicht
// einklappen
@@ -2573,21 +2576,21 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
}
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_DIVIDE :
if( bMod1 )
- SelAllDestrAnch( TRUE );
+ SelAllDestrAnch( sal_True );
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_COMMA :
if( bMod1 )
- SelAllDestrAnch( FALSE );
+ SelAllDestrAnch( sal_False );
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_HOME :
@@ -2600,14 +2603,14 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
if( pNewCursor && pNewCursor != pCursor )
{
-// SelAllDestrAnch( FALSE );
+// SelAllDestrAnch( sal_False );
aSelEng.CursorPosChanging( bShift, bMod1 );
SetCursor( pNewCursor );
if( !IsEntryInView( pNewCursor ) )
MakeVisible( pNewCursor );
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_END :
@@ -2620,14 +2623,14 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
if( pNewCursor && pNewCursor != pCursor)
{
-// SelAllDestrAnch( FALSE );
+// SelAllDestrAnch( sal_False );
aSelEng.CursorPosChanging( bShift, bMod1 );
SetCursor( pNewCursor );
if( !IsEntryInView( pNewCursor ) )
MakeVisible( pNewCursor );
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_ESCAPE:
@@ -2636,14 +2639,19 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
case KEY_BACKSPACE:
// #105907# must not be handled because this quits dialogs and does other magic things...
// if there are other single keys which should not be handled, they can be added here
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
default:
- if( bMod1 || rKeyCode.GetGroup() == KEYGROUP_FKEYS )
- // #105907# CTRL or Function key is pressed, assume user don't want to use quicksearch...
- // if there are groups of keys which should not be handled, they can be added here
- bKeyUsed = FALSE;
+ // is there any reason why we should eat the events here? The only place where this is called
+ // is from SvTreeListBox::KeyInput. If we set bKeyUsed to sal_True here, then the key input
+ // is just silenced. However, we want SvLBox::KeyInput to get a chance, to do the QuickSelection
+ // handling.
+ // (The old code here which intentionally set bKeyUsed to TRUE said this was because of "quick search"
+ // handling, but actually there was no quick search handling anymore. We just re-implemented it.)
+ // #i31275# / 2009-06-16 / frank.schoenheit@sun.com
+ bKeyUsed = sal_False;
+ break;
}
return bKeyUsed;
}
@@ -2652,13 +2660,13 @@ void SvImpLBox::GetFocus()
{
if( pCursor )
{
- pView->SetEntryFocus( pCursor, TRUE );
- ShowCursor( TRUE );
+ pView->SetEntryFocus( pCursor, sal_True );
+ ShowCursor( sal_True );
// auskommentiert wg. deselectall
// if( bSimpleTravel && !pView->IsSelected(pCursor) )
-// pView->Select( pCursor, TRUE );
+// pView->Select( pCursor, sal_True );
}
- if( nWinBits & WB_HIDESELECTION )
+ if( m_nStyle & WB_HIDESELECTION )
{
SvLBoxEntry* pEntry = pView->FirstSelected();
while( pEntry )
@@ -2673,7 +2681,7 @@ void SvImpLBox::GetFocus()
SvViewData* pViewData = pView->GetViewData( pEntry );
if( pViewData->IsCursored() )
{
- pViewData->SetCursored( FALSE );
+ pViewData->SetCursored( sal_False );
InvalidateEntry( pEntry );
}
pEntry = pView->GetModel()->Next( pEntry );
@@ -2688,16 +2696,16 @@ void SvImpLBox::LoseFocus()
{
aEditTimer.Stop();
if( pCursor )
- pView->SetEntryFocus( pCursor,FALSE );
- ShowCursor( FALSE );
+ pView->SetEntryFocus( pCursor,sal_False );
+ ShowCursor( sal_False );
- if( nWinBits & WB_HIDESELECTION )
+ if( m_nStyle & WB_HIDESELECTION )
{
SvLBoxEntry* pEntry = pView->FirstSelected();
while( pEntry )
{
//SvViewData* pViewData = pView->GetViewData( pEntry );
- //pViewData->SetCursored( TRUE );
+ //pViewData->SetCursored( sal_True );
InvalidateEntry( pEntry );
pEntry = pView->NextSelected( pEntry );
}
@@ -2709,7 +2717,7 @@ void SvImpLBox::LoseFocus()
// SelectionEngine
// ********************************************************************
-inline void SvImpLBox::SelectEntry( SvLBoxEntry* pEntry, BOOL bSelect )
+inline void SvImpLBox::SelectEntry( SvLBoxEntry* pEntry, sal_Bool bSelect )
{
pView->Select( pEntry, bSelect );
}
@@ -2755,7 +2763,7 @@ void ImpLBSelEng::CreateCursor()
*/
-BOOL ImpLBSelEng::SetCursorAtPoint(const Point& rPoint, BOOL bDontSelectAtCursor)
+sal_Bool ImpLBSelEng::SetCursorAtPoint(const Point& rPoint, sal_Bool bDontSelectAtCursor)
{
SvLBoxEntry* pNewCursor = pImp->MakePointVisible( rPoint );
if( pNewCursor != pImp->pCursor )
@@ -2766,19 +2774,19 @@ BOOL ImpLBSelEng::SetCursorAtPoint(const Point& rPoint, BOOL bDontSelectAtCursor
// bei SimpleTravel wird in SetCursor selektiert und
// der Select-Handler gerufen
//if( !bDontSelectAtCursor && !pImp->bSimpleTravel )
- // pImp->SelectEntry( pNewCursor, TRUE );
+ // pImp->SelectEntry( pNewCursor, sal_True );
pImp->SetCursor( pNewCursor, bDontSelectAtCursor );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL ImpLBSelEng::IsSelectionAtPoint( const Point& rPoint )
+sal_Bool ImpLBSelEng::IsSelectionAtPoint( const Point& rPoint )
{
SvLBoxEntry* pEntry = pImp->MakePointVisible( rPoint );
if( pEntry )
return pView->IsSelected(pEntry);
- return FALSE;
+ return sal_False;
}
void ImpLBSelEng::DeselectAtPoint( const Point& rPoint )
@@ -2786,7 +2794,7 @@ void ImpLBSelEng::DeselectAtPoint( const Point& rPoint )
SvLBoxEntry* pEntry = pImp->MakePointVisible( rPoint );
if( !pEntry )
return;
- pImp->SelectEntry( pEntry, FALSE );
+ pImp->SelectEntry( pEntry, sal_False );
}
/*
@@ -2795,13 +2803,13 @@ void ImpLBSelEng::SelectAtPoint( const Point& rPoint )
SvLBoxEntry* pEntry = pImp->MakePointVisible( rPoint );
if( !pEntry )
return;
- pImp->SelectEntry( pEntry, TRUE );
+ pImp->SelectEntry( pEntry, sal_True );
}
*/
void ImpLBSelEng::DeselectAll()
{
- pImp->SelAllDestrAnch( FALSE, FALSE ); // SelectionEngine nicht resetten!
+ pImp->SelAllDestrAnch( sal_False, sal_False ); // SelectionEngine nicht resetten!
pImp->nFlags &= (~F_DESEL_ALL);
}
@@ -2812,9 +2820,9 @@ void ImpLBSelEng::DeselectAll()
void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCursor)
{
SvLBoxEntry* pEntry;
- ULONG nAnchorVisPos = pView->GetVisiblePos( pAnchor );
- ULONG nOldVisPos = pView->GetVisiblePos( pOldCursor );
- ULONG nNewVisPos = pView->GetVisiblePos( pNewCursor );
+ sal_uLong nAnchorVisPos = pView->GetVisiblePos( pAnchor );
+ sal_uLong nOldVisPos = pView->GetVisiblePos( pOldCursor );
+ sal_uLong nNewVisPos = pView->GetVisiblePos( pNewCursor );
if( nOldVisPos > nAnchorVisPos ||
( nAnchorVisPos==nOldVisPos && nNewVisPos > nAnchorVisPos) )
@@ -2824,11 +2832,11 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs
pEntry = pOldCursor;
while( pEntry && pEntry != pNewCursor )
{
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
if( pEntry )
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
return;
}
@@ -2837,20 +2845,20 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs
pEntry = pAnchor;
while( pEntry && pEntry != pOldCursor )
{
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
if( pEntry )
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
pEntry = pNewCursor;
while( pEntry && pEntry != pAnchor )
{
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
if( pEntry )
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
return;
}
@@ -2860,11 +2868,11 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
while( pEntry && pEntry != pOldCursor )
{
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
if( pEntry )
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
return;
}
}
@@ -2875,11 +2883,11 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs
pEntry = pNewCursor;
while( pEntry && pEntry != pOldCursor )
{
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
if( pEntry )
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
return;
}
@@ -2888,19 +2896,19 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs
pEntry = pOldCursor;
while( pEntry && pEntry != pAnchor )
{
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
if( pEntry )
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
pEntry = pAnchor;
while( pEntry && pEntry != pNewCursor )
{
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
if( pEntry )
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
return;
}
@@ -2909,7 +2917,7 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs
pEntry = pOldCursor;
while( pEntry && pEntry != pNewCursor )
{
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
return;
@@ -2917,8 +2925,8 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs
}
}
-void SvImpLBox::SelAllDestrAnch( BOOL bSelect, BOOL bDestroyAnchor,
- BOOL bSingleSelToo )
+void SvImpLBox::SelAllDestrAnch( sal_Bool bSelect, sal_Bool bDestroyAnchor,
+ sal_Bool bSingleSelToo )
{
SvLBoxEntry* pEntry;
nFlags &= (~F_DESEL_ALL);
@@ -2926,7 +2934,7 @@ void SvImpLBox::SelAllDestrAnch( BOOL bSelect, BOOL bDestroyAnchor,
{
if( pCursor && !pView->IsSelected( pCursor ))
{
- pView->Select( pCursor, TRUE );
+ pView->Select( pCursor, sal_True );
}
return;
}
@@ -2944,7 +2952,7 @@ void SvImpLBox::SelAllDestrAnch( BOOL bSelect, BOOL bDestroyAnchor,
if( !bSelect && pView->GetSelectionCount()==1 && pCursor &&
pView->IsSelected( pCursor ))
{
- pView->Select( pCursor, FALSE );
+ pView->Select( pCursor, sal_False );
if( bDestroyAnchor )
DestroyAnchor(); // Anker loeschen & SelectionEngine zuruecksetzen
else
@@ -2955,8 +2963,8 @@ void SvImpLBox::SelAllDestrAnch( BOOL bSelect, BOOL bDestroyAnchor,
if( bSimpleTravel && !pCursor && !GetUpdateMode() )
nFlags |= F_DESEL_ALL;
- ShowCursor( FALSE );
- BOOL bUpdate = GetUpdateMode();
+ ShowCursor( sal_False );
+ sal_Bool bUpdate = GetUpdateMode();
nFlags |= F_IGNORE_SELECT; // EntryInserted soll nix tun
pEntry = pTree->First();
@@ -2979,18 +2987,18 @@ void SvImpLBox::SelAllDestrAnch( BOOL bSelect, BOOL bDestroyAnchor,
DestroyAnchor(); // Anker loeschen & SelectionEngine zuruecksetzen
else
pAnchor = 0; // internen Anker immer loeschen
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
void SvImpLBox::SetSelectionMode( SelectionMode eSelMode )
{
aSelEng.SetSelectionMode( eSelMode);
if( eSelMode == SINGLE_SELECTION )
- bSimpleTravel = TRUE;
+ bSimpleTravel = sal_True;
else
- bSimpleTravel = FALSE;
- if( (nWinBits & WB_SIMPLEMODE) && (eSelMode == MULTIPLE_SELECTION) )
- aSelEng.AddAlways( TRUE );
+ bSimpleTravel = sal_False;
+ if( (m_nStyle & WB_SIMPLEMODE) && (eSelMode == MULTIPLE_SELECTION) )
+ aSelEng.AddAlways( sal_True );
}
// ***********************************************************************
@@ -3001,13 +3009,13 @@ void SvImpLBox::SetDragDropMode( DragDropMode eDDMode )
{
if( eDDMode && eDDMode != SV_DRAGDROP_APP_DROP )
{
- aSelEng.ExpandSelectionOnMouseMove( FALSE );
- aSelEng.EnableDrag( TRUE );
+ aSelEng.ExpandSelectionOnMouseMove( sal_False );
+ aSelEng.EnableDrag( sal_True );
}
else
{
- aSelEng.ExpandSelectionOnMouseMove( TRUE );
- aSelEng.EnableDrag( FALSE );
+ aSelEng.ExpandSelectionOnMouseMove( sal_True );
+ aSelEng.EnableDrag( sal_False );
}
}
@@ -3055,7 +3063,7 @@ void SvImpLBox::PaintDDCursor( SvLBoxEntry* pInsertionPos )
// Delete all submenus of a PopupMenu, recursively
void lcl_DeleteSubPopups(PopupMenu* pPopup)
{
- for(USHORT i = 0; i < pPopup->GetItemCount(); i++)
+ for(sal_uInt16 i = 0; i < pPopup->GetItemCount(); i++)
{
PopupMenu* pSubPopup = pPopup->GetPopupMenu( pPopup->GetItemId( i ));
if(pSubPopup)
@@ -3066,35 +3074,22 @@ void lcl_DeleteSubPopups(PopupMenu* pPopup)
}
}
-bool SvImpLBox::Command( const CommandEvent& rCEvt )
+void SvImpLBox::Command( const CommandEvent& rCEvt )
{
- USHORT nCommand = rCEvt.GetCommand();
+ sal_uInt16 nCommand = rCEvt.GetCommand();
if( nCommand == COMMAND_CONTEXTMENU )
aEditTimer.Stop();
// Rollmaus-Event?
- if ( ( ( nCommand == COMMAND_WHEEL )
- || ( nCommand == COMMAND_STARTAUTOSCROLL )
- || ( nCommand == COMMAND_AUTOSCROLL )
- )
- && pView->HandleScrollCommand( rCEvt, &aHorSBar, &aVerSBar )
- )
- {
- return true;
- }
-
- if ( ( nCommand == COMMAND_CONTEXTMENU )
- && !bContextMenuHandling
- )
- {
- return false;
- }
+ if( ( ( nCommand == COMMAND_WHEEL ) || ( nCommand == COMMAND_STARTAUTOSCROLL ) || ( nCommand == COMMAND_AUTOSCROLL ) )
+ && pView->HandleScrollCommand( rCEvt, &aHorSBar, &aVerSBar ) )
+ return;
if( bContextMenuHandling && nCommand == COMMAND_CONTEXTMENU )
{
Point aPopupPos;
- BOOL bClickedIsFreePlace = FALSE;
+ sal_Bool bClickedIsFreePlace = sal_False;
std::stack<SvLBoxEntry*> aSelRestore;
if( rCEvt.IsMouseEvent() )
@@ -3105,7 +3100,7 @@ bool SvImpLBox::Command( const CommandEvent& rCEvt )
SvLBoxEntry* pClickedEntry = GetEntry( aPopupPos );
if( pClickedEntry )
{ // mouse in non empty area
- BOOL bClickedIsSelected = FALSE;
+ sal_Bool bClickedIsSelected = sal_False;
// collect the currently selected entries
SvLBoxEntry* pSelected = pView->FirstSelected();
@@ -3118,30 +3113,32 @@ bool SvImpLBox::Command( const CommandEvent& rCEvt )
// if the entry which the user clicked at is not selected
if( !bClickedIsSelected )
{ // deselect all other and select the clicked one
- pView->SelectAll( FALSE );
+ pView->SelectAll( sal_False );
pView->SetCursor( pClickedEntry );
}
}
else if( aSelEng.GetSelectionMode() == SINGLE_SELECTION )
{//modified by BerryJia for fixing Bug102739 2002-9-9 17:00(Beijing Time)
- bClickedIsFreePlace = TRUE;
- INT32 nSelectedEntries = pView->GetSelectionCount();
+ bClickedIsFreePlace = sal_True;
+ sal_Int32 nSelectedEntries = pView->GetSelectionCount();
SvLBoxEntry* pSelected = pView->FirstSelected();
- for(USHORT nSel = 0; nSel < nSelectedEntries; nSel++ )
+ for(sal_uInt16 nSel = 0; nSel < nSelectedEntries; nSel++ )
{
aSelRestore.push(pSelected);
pSelected = pView->NextSelected( pSelected );
}
- pView->SelectAll( FALSE );
+ pView->SelectAll( sal_False );
}
else
{ // deselect all
- pView->SelectAll( FALSE );
+ pView->SelectAll( sal_False );
}
+
+
}
else
{ // key event (or at least no mouse event)
- INT32 nSelectionCount = pView->GetSelectionCount();
+ sal_Int32 nSelectionCount = pView->GetSelectionCount();
if( nSelectionCount )
{ // now allways take first visible as base for positioning the menu
@@ -3172,7 +3169,7 @@ bool SvImpLBox::Command( const CommandEvent& rCEvt )
if( pPopup )
{
// do action for selected entry in popup menu
- USHORT nMenuAction = pPopup->Execute( pView, aPopupPos );
+ sal_uInt16 nMenuAction = pPopup->Execute( pView, aPopupPos );
if ( nMenuAction )
pView->ExcecuteContextMenuAction( nMenuAction );
lcl_DeleteSubPopups(pPopup);
@@ -3186,7 +3183,7 @@ bool SvImpLBox::Command( const CommandEvent& rCEvt )
SvLBoxEntry* pEntry = aSelRestore.top();
//#i19717# the entry is maybe already deleted
bool bFound = false;
- for(ULONG nEntry = 0; nEntry < pView->GetEntryCount(); nEntry++)
+ for(sal_uLong nEntry = 0; nEntry < pView->GetEntryCount(); nEntry++)
if(pEntry == pView->GetEntry(nEntry))
{
bFound = true;
@@ -3197,18 +3194,15 @@ bool SvImpLBox::Command( const CommandEvent& rCEvt )
aSelRestore.pop();
}
}
- return true;
}
-
- const Point& rPos = rCEvt.GetMousePosPixel();
- if( rPos.X() < aOutputSize.Width() && rPos.Y() < aOutputSize.Height() )
- aSelEng.Command( rCEvt );
-
- // strictly, this is not correct. However, it leads to a behavior compatible to the one at the time
- // when this method did have a void return value ...
- // A proper solution would be to give the EditEngine::Command also a boolean return value, and forward
- // this (or false) to our caller
- return true;
+#ifndef NOCOMMAND
+ else
+ {
+ const Point& rPos = rCEvt.GetMousePosPixel();
+ if( rPos.X() < aOutputSize.Width() && rPos.Y() < aOutputSize.Height() )
+ aSelEng.Command( rCEvt );
+ }
+#endif
}
void SvImpLBox::BeginScroll()
@@ -3248,12 +3242,12 @@ void SvImpLBox::SetCurEntry( SvLBoxEntry* pEntry )
if ( ( aSelEng.GetSelectionMode() != SINGLE_SELECTION )
&& ( aSelEng.GetSelectionMode() != NO_SELECTION )
)
- SelAllDestrAnch( FALSE, TRUE, FALSE );
+ SelAllDestrAnch( sal_False, sal_True, sal_False );
if ( pEntry )
MakeVisible( pEntry );
SetCursor( pEntry );
if ( pEntry && ( aSelEng.GetSelectionMode() != NO_SELECTION ) )
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
}
IMPL_LINK( SvImpLBox, EditTimerCall, Timer *, EMPTYARG )
@@ -3275,21 +3269,21 @@ IMPL_LINK( SvImpLBox, EditTimerCall, Timer *, EMPTYARG )
SvLBoxEntry* pEntry = GetCurEntry();
if( pEntry )
{
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
pView->ImplEditEntry( pEntry );
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
}
return 0;
}
-BOOL SvImpLBox::RequestHelp( const HelpEvent& rHEvt )
+sal_Bool SvImpLBox::RequestHelp( const HelpEvent& rHEvt )
{
if( rHEvt.GetMode() & HELPMODE_QUICK )
{
Point aPos( pView->ScreenToOutputPixel( rHEvt.GetMousePosPixel() ));
if( !GetVisibleArea().IsInside( aPos ))
- return FALSE;
+ return sal_False;
SvLBoxEntry* pEntry = GetEntry( aPos );
if( pEntry )
@@ -3298,18 +3292,18 @@ BOOL SvImpLBox::RequestHelp( const HelpEvent& rHEvt )
SvLBoxTab* pTab;
SvLBoxString* pItem = (SvLBoxString*)(pView->GetItem( pEntry, aPos.X(), &pTab ));
if( !pItem || pItem->IsA() != SV_ITEM_ID_LBOXSTRING )
- return FALSE;
+ return sal_False;
aPos = GetEntryPosition( pEntry );
aPos.X() = pView->GetTabPos( pEntry, pTab ); //pTab->GetPos();
Size aSize( pItem->GetSize( pView, pEntry ) );
SvLBoxTab* pNextTab = NextTab( pTab );
- BOOL bItemClipped = FALSE;
+ sal_Bool bItemClipped = sal_False;
// wurde das Item von seinem rechten Nachbarn abgeschnitten?
if( pNextTab && pView->GetTabPos(pEntry,pNextTab) < aPos.X()+aSize.Width() )
{
aSize.Width() = pNextTab->GetPos() - pTab->GetPos();
- bItemClipped = TRUE;
+ bItemClipped = sal_True;
}
Rectangle aItemRect( aPos, aSize );
@@ -3330,19 +3324,19 @@ BOOL SvImpLBox::RequestHelp( const HelpEvent& rHEvt )
Help::ShowQuickHelp( pView, aItemRect,
pItem->GetText(), QUICKHELP_LEFT | QUICKHELP_VCENTER );
- return TRUE;
+ return sal_True;
}
}
}
- return FALSE;
+ return sal_False;
}
SvLBoxTab* SvImpLBox::NextTab( SvLBoxTab* pTab )
{
- USHORT nTabCount = pView->TabCount();
+ sal_uInt16 nTabCount = pView->TabCount();
if( nTabCount <= 1 )
return 0;
- for( USHORT nTab=0; nTab < (nTabCount-1); nTab++)
+ for( sal_uInt16 nTab=0; nTab < (nTabCount-1); nTab++)
{
if( pView->aTabs[nTab]==pTab )
return (SvLBoxTab*)(pView->aTabs[nTab+1]);
@@ -3360,28 +3354,28 @@ void SvImpLBox::RepaintScrollBars()
{
}
-void SvImpLBox::SetUpdateMode( BOOL bMode )
+void SvImpLBox::SetUpdateMode( sal_Bool bMode )
{
if( bUpdateMode != bMode )
{
bUpdateMode = bMode;
if( bUpdateMode )
- UpdateAll( FALSE );
+ UpdateAll( sal_False );
}
}
-void SvImpLBox::SetUpdateModeFast( BOOL bMode )
+void SvImpLBox::SetUpdateModeFast( sal_Bool bMode )
{
if( bUpdateMode != bMode )
{
bUpdateMode = bMode;
if( bUpdateMode )
- UpdateAll( FALSE, FALSE );
+ UpdateAll( sal_False, sal_False );
}
}
-BOOL SvImpLBox::SetMostRight( SvLBoxEntry* pEntry )
+sal_Bool SvImpLBox::SetMostRight( SvLBoxEntry* pEntry )
{
if( pView->nTreeFlags & TREEFLAG_RECALCTABS )
{
@@ -3390,8 +3384,8 @@ BOOL SvImpLBox::SetMostRight( SvLBoxEntry* pEntry )
nFlags &= ~F_IGNORE_CHANGED_TABS;
}
- USHORT nLastTab = pView->aTabs.Count() - 1;
- USHORT nLastItem = pEntry->ItemCount() - 1;
+ sal_uInt16 nLastTab = pView->aTabs.Count() - 1;
+ sal_uInt16 nLastItem = pEntry->ItemCount() - 1;
if( nLastTab != USHRT_MAX && nLastItem != USHRT_MAX )
{
if( nLastItem < nLastTab )
@@ -3417,10 +3411,10 @@ BOOL SvImpLBox::SetMostRight( SvLBoxEntry* pEntry )
{
nMostRight = nRight;
pMostRightEntry = pEntry;
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
void SvImpLBox::FindMostRight( SvLBoxEntry* pEntryToIgnore )
@@ -3454,8 +3448,8 @@ void SvImpLBox::FindMostRight_Impl( SvLBoxEntry* pParent, SvLBoxEntry* pEntryToI
if( !pList )
return;
- ULONG nCount = pList->Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ sal_uLong nCount = pList->Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvLBoxEntry* pChild = (SvLBoxEntry*)pList->GetObject( nCur );
if( pChild != pEntryToIgnore )
@@ -3560,7 +3554,7 @@ const Image& SvImpLBox::GetDefaultCollapsedNodeImage( )
}
// -----------------------------------------------------------------------
-void SvImpLBox::CallEventListeners( ULONG nEvent, void* pData )
+void SvImpLBox::CallEventListeners( sal_uLong nEvent, void* pData )
{
if ( pView )
pView->CallImplEventListeners( nEvent, pData);
@@ -3568,14 +3562,14 @@ void SvImpLBox::CallEventListeners( ULONG nEvent, void* pData )
// -----------------------------------------------------------------------
-bool SvImpLBox::SetCurrentTabPos( USHORT _nNewPos )
+bool SvImpLBox::SetCurrentTabPos( sal_uInt16 _nNewPos )
{
bool bRet = false;
if ( pView && _nNewPos < ( pView->TabCount() - 2 ) )
{
nCurTabPos = _nNewPos;
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
bRet = true;
}
diff --git a/svtools/source/contnr/svimpicn.cxx b/svtools/source/contnr/svimpicn.cxx
index 3ad775fd071f..eab15f65647c 100644
--- a/svtools/source/contnr/svimpicn.cxx
+++ b/svtools/source/contnr/svimpicn.cxx
@@ -97,30 +97,30 @@
#undef TEXT_DRAW_WORDBREAK
#endif
-// #define TEXT_DRAW_DISABLE ((USHORT)0x0001)
-// #define TEXT_DRAW_3DLOOK ((USHORT)0x0002)
-// #define TEXT_DRAW_MNEMONIC ((USHORT)0x0004)
-#define TEXT_DRAW_LEFT ((USHORT)0x0010)
-#define TEXT_DRAW_CENTER ((USHORT)0x0020)
-#define TEXT_DRAW_RIGHT ((USHORT)0x0040)
-#define TEXT_DRAW_TOP ((USHORT)0x0080)
-#define TEXT_DRAW_VCENTER ((USHORT)0x0100)
-#define TEXT_DRAW_BOTTOM ((USHORT)0x0200)
-#define TEXT_DRAW_ENDELLIPSIS ((USHORT)0x0400)
-#define TEXT_DRAW_PATHELLIPSIS ((USHORT)0x0800)
-#define TEXT_DRAW_CLIP ((USHORT)0x1000)
-#define TEXT_DRAW_MULTILINE ((USHORT)0x2000)
-#define TEXT_DRAW_WORDBREAK ((USHORT)0x4000)
+// #define TEXT_DRAW_DISABLE ((sal_uInt16)0x0001)
+// #define TEXT_DRAW_3DLOOK ((sal_uInt16)0x0002)
+// #define TEXT_DRAW_MNEMONIC ((sal_uInt16)0x0004)
+#define TEXT_DRAW_LEFT ((sal_uInt16)0x0010)
+#define TEXT_DRAW_CENTER ((sal_uInt16)0x0020)
+#define TEXT_DRAW_RIGHT ((sal_uInt16)0x0040)
+#define TEXT_DRAW_TOP ((sal_uInt16)0x0080)
+#define TEXT_DRAW_VCENTER ((sal_uInt16)0x0100)
+#define TEXT_DRAW_BOTTOM ((sal_uInt16)0x0200)
+#define TEXT_DRAW_ENDELLIPSIS ((sal_uInt16)0x0400)
+#define TEXT_DRAW_PATHELLIPSIS ((sal_uInt16)0x0800)
+#define TEXT_DRAW_CLIP ((sal_uInt16)0x1000)
+#define TEXT_DRAW_MULTILINE ((sal_uInt16)0x2000)
+#define TEXT_DRAW_WORDBREAK ((sal_uInt16)0x4000)
XubString GetEllipsisString( OutputDevice* pDev,
const XubString& rStr, long nMaxWidth,
- USHORT nStyle = TEXT_DRAW_ENDELLIPSIS )
+ sal_uInt16 nStyle = TEXT_DRAW_ENDELLIPSIS )
{
XubString aStr = rStr;
if ( nStyle & TEXT_DRAW_ENDELLIPSIS )
{
- USHORT nIndex = pDev->GetTextBreak( rStr, nMaxWidth );
+ sal_uInt16 nIndex = pDev->GetTextBreak( rStr, nMaxWidth );
if ( nIndex != STRING_LEN )
{
aStr.Erase( nIndex );
@@ -148,11 +148,11 @@ class TextLineInfo
{
private:
long mnWidth;
- USHORT mnIndex;
- USHORT mnLen;
+ sal_uInt16 mnIndex;
+ sal_uInt16 mnLen;
public:
- TextLineInfo( long nWidth, USHORT nIndex, USHORT nLen )
+ TextLineInfo( long nWidth, sal_uInt16 nIndex, sal_uInt16 nLen )
{
mnWidth = nWidth;
mnIndex = nIndex;
@@ -160,8 +160,8 @@ public:
}
long GetWidth() const { return mnWidth; }
- USHORT GetIndex() const { return mnIndex; }
- USHORT GetLen() const { return mnLen; }
+ sal_uInt16 GetIndex() const { return mnIndex; }
+ sal_uInt16 GetLen() const { return mnLen; }
};
#define MULTITEXTLINEINFO_RESIZE 16
@@ -171,8 +171,8 @@ class MultiTextLineInfo
{
private:
PTextLineInfo* mpLines;
- USHORT mnLines;
- USHORT mnSize;
+ sal_uInt16 mnLines;
+ sal_uInt16 mnSize;
public:
MultiTextLineInfo();
@@ -181,9 +181,9 @@ public:
void AddLine( TextLineInfo* pLine );
void Clear();
- TextLineInfo* GetLine( USHORT nLine ) const
+ TextLineInfo* GetLine( sal_uInt16 nLine ) const
{ return mpLines[nLine]; }
- USHORT Count() const { return mnLines; }
+ sal_uInt16 Count() const { return mnLines; }
private:
MultiTextLineInfo( const MultiTextLineInfo& );
@@ -199,7 +199,7 @@ MultiTextLineInfo::MultiTextLineInfo()
MultiTextLineInfo::~MultiTextLineInfo()
{
- for ( USHORT i = 0; i < mnLines; i++ )
+ for ( sal_uInt16 i = 0; i < mnLines; i++ )
delete mpLines[i];
delete [] mpLines;
}
@@ -220,7 +220,7 @@ void MultiTextLineInfo::AddLine( TextLineInfo* pLine )
void MultiTextLineInfo::Clear()
{
- for ( USHORT i = 0; i < mnLines; i++ )
+ for ( sal_uInt16 i = 0; i < mnLines; i++ )
delete mpLines[i];
mnLines = 0;
}
@@ -229,7 +229,7 @@ void MultiTextLineInfo::Clear()
long GetTextLines( OutputDevice* pDev, MultiTextLineInfo& rLineInfo,
long nWidth, const XubString& rStr,
- USHORT nStyle = TEXT_DRAW_WORDBREAK )
+ sal_uInt16 nStyle = TEXT_DRAW_WORDBREAK )
{
rLineInfo.Clear();
if ( !rStr.Len() )
@@ -237,20 +237,20 @@ long GetTextLines( OutputDevice* pDev, MultiTextLineInfo& rLineInfo,
if ( nWidth <= 0 )
nWidth = 1;
- USHORT nStartPos = 0; // Start-Position der Zeile
- USHORT nLastLineLen = 0; // Zeilenlaenge bis zum vorherigen Wort
- USHORT nLastWordPos = 0; // Position des letzten Wortanfangs
- USHORT i = 0;
- USHORT nPos; // StartPositon der Zeile (nur Temp)
- USHORT nLen; // Laenge der Zeile (nur Temp)
- USHORT nStrLen = rStr.Len();
+ sal_uInt16 nStartPos = 0; // Start-Position der Zeile
+ sal_uInt16 nLastLineLen = 0; // Zeilenlaenge bis zum vorherigen Wort
+ sal_uInt16 nLastWordPos = 0; // Position des letzten Wortanfangs
+ sal_uInt16 i = 0;
+ sal_uInt16 nPos; // StartPositon der Zeile (nur Temp)
+ sal_uInt16 nLen; // Laenge der Zeile (nur Temp)
+ sal_uInt16 nStrLen = rStr.Len();
long nMaxLineWidth = 0; // Maximale Zeilenlaenge
long nLineWidth; // Aktuelle Zeilenlaenge
long nLastLineWidth = 0; // Zeilenlaenge der letzten Zeile
xub_Unicode c;
xub_Unicode c2;
const xub_Unicode* pStr = rStr.GetBuffer();
- BOOL bHardBreak = FALSE;
+ sal_Bool bHardBreak = sal_False;
do
{
@@ -258,9 +258,9 @@ long GetTextLines( OutputDevice* pDev, MultiTextLineInfo& rLineInfo,
// Auf Zeilenende ermitteln
if ( (c == _CR) || (c == _LF) )
- bHardBreak = TRUE;
+ bHardBreak = sal_True;
else
- bHardBreak = FALSE;
+ bHardBreak = sal_False;
// Testen, ob ein Wortende erreicht ist
if ( bHardBreak || (i == nStrLen) ||
@@ -375,9 +375,9 @@ long GetTextLines( OutputDevice* pDev, MultiTextLineInfo& rLineInfo,
// -----------------------------------------------------------------------
-USHORT GetTextLines( OutputDevice* pDev, const Rectangle& rRect,
+sal_uInt16 GetTextLines( OutputDevice* pDev, const Rectangle& rRect,
const XubString& rStr,
- USHORT nStyle = TEXT_DRAW_WORDBREAK,
+ sal_uInt16 nStyle = TEXT_DRAW_WORDBREAK,
long* pMaxWidth = NULL )
{
MultiTextLineInfo aMultiLineInfo;
@@ -392,10 +392,10 @@ USHORT GetTextLines( OutputDevice* pDev, const Rectangle& rRect,
Rectangle GetTextRect( OutputDevice* pDev, const Rectangle& rRect,
const XubString& rStr,
- USHORT nStyle = TEXT_DRAW_WORDBREAK )
+ sal_uInt16 nStyle = TEXT_DRAW_WORDBREAK )
{
Rectangle aRect = rRect;
- USHORT nLines;
+ sal_uInt16 nLines;
long nWidth = rRect.GetWidth();
long nMaxWidth;
long nTextHeight;
@@ -404,13 +404,13 @@ Rectangle GetTextRect( OutputDevice* pDev, const Rectangle& rRect,
{
MultiTextLineInfo aMultiLineInfo;
TextLineInfo* pLineInfo;
- USHORT nFormatLines;
+ sal_uInt16 nFormatLines;
nMaxWidth = 0;
GetTextLines( pDev, aMultiLineInfo, nWidth, rStr, nStyle );
nFormatLines = aMultiLineInfo.Count();
nTextHeight = pDev->GetTextHeight();
- nLines = (USHORT)(aRect.GetHeight()/nTextHeight);
+ nLines = (sal_uInt16)(aRect.GetHeight()/nTextHeight);
if ( nFormatLines <= nLines )
nLines = nFormatLines;
else
@@ -420,7 +420,7 @@ Rectangle GetTextRect( OutputDevice* pDev, const Rectangle& rRect,
else
nMaxWidth = nWidth;
}
- for ( USHORT i = 0; i < nLines; i++ )
+ for ( sal_uInt16 i = 0; i < nLines; i++ )
{
pLineInfo = aMultiLineInfo.GetLine( i );
if ( pLineInfo->GetWidth() > nMaxWidth )
@@ -462,7 +462,7 @@ Rectangle GetTextRect( OutputDevice* pDev, const Rectangle& rRect,
// -----------------------------------------------------------------------
void DrawText( OutputDevice* pDev, const Rectangle& rRect,
- const XubString& rStr, USHORT nStyle = 0 )
+ const XubString& rStr, sal_uInt16 nStyle = 0 )
{
if ( !rStr.Len() || rRect.IsEmpty() )
return;
@@ -484,10 +484,10 @@ void DrawText( OutputDevice* pDev, const Rectangle& rRect,
TextLineInfo* pLineInfo;
long nTextHeight = pDev->GetTextHeight();
long nMaxTextWidth;
- USHORT i;
- USHORT nLines = (USHORT)(nHeight/nTextHeight);
- USHORT nFormatLines;
- BOOL bIsClipRegion = FALSE;
+ sal_uInt16 i;
+ sal_uInt16 nLines = (sal_uInt16)(nHeight/nTextHeight);
+ sal_uInt16 nFormatLines;
+ sal_Bool bIsClipRegion = sal_False;
nMaxTextWidth = GetTextLines( pDev, aMultiLineInfo, nWidth, rStr, nStyle );
nFormatLines = aMultiLineInfo.Count();
@@ -608,7 +608,7 @@ void DrawText( OutputDevice* pDev, const Rectangle& rRect,
if ( nStyle & TEXT_DRAW_CLIP )
{
- BOOL bIsClipRegion = pDev->IsClipRegion();
+ sal_Bool bIsClipRegion = pDev->IsClipRegion();
if ( bIsClipRegion )
{
Region aOldRegion = pDev->GetClipRegion();
@@ -646,7 +646,7 @@ class ImpIcnCursor
SvImpIconView* pView;
SvPtrarr* pColumns;
SvPtrarr* pRows;
- BOOL* pGridMap;
+ sal_Bool* pGridMap;
long nGridDX, nGridDY;
long nGridCols, nGridRows;
long nCols;
@@ -658,34 +658,34 @@ class ImpIcnCursor
void ImplCreate();
void Create() { if( !pColumns ) ImplCreate(); }
- USHORT GetSortListPos( SvPtrarr* pList, long nValue, int bVertical);
- SvLBoxEntry* SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom,USHORT nPref,
- BOOL bDown, BOOL bSimple );
- SvLBoxEntry* SearchRow(USHORT nRow,USHORT nRight,USHORT nLeft,USHORT nPref,
- BOOL bRight, BOOL bSimple );
+ sal_uInt16 GetSortListPos( SvPtrarr* pList, long nValue, int bVertical);
+ SvLBoxEntry* SearchCol(sal_uInt16 nCol,sal_uInt16 nTop,sal_uInt16 nBottom,sal_uInt16 nPref,
+ sal_Bool bDown, sal_Bool bSimple );
+ SvLBoxEntry* SearchRow(sal_uInt16 nRow,sal_uInt16 nRight,sal_uInt16 nLeft,sal_uInt16 nPref,
+ sal_Bool bRight, sal_Bool bSimple );
void CreateGridMap();
- // Rueckgabe FALSE: Eintrag liegt nicht in der GridMap. rGridx,y werden
+ // Rueckgabe sal_False: Eintrag liegt nicht in der GridMap. rGridx,y werden
// dann an nGridCols, nGridRows geclippt
- BOOL GetGrid( const Point& rDocPos, USHORT& rGridX, USHORT& rGridY ) const;
- void SetGridUsed( USHORT nDX, USHORT nDY, BOOL bUsed )
+ sal_Bool GetGrid( const Point& rDocPos, sal_uInt16& rGridX, sal_uInt16& rGridY ) const;
+ void SetGridUsed( sal_uInt16 nDX, sal_uInt16 nDY, sal_Bool bUsed )
{
pGridMap[ (nDY * nGridCols) + nDX ] = bUsed;
}
public:
ImpIcnCursor( SvImpIconView* pOwner );
~ImpIcnCursor();
- void Clear( BOOL bGridToo = TRUE );
+ void Clear( sal_Bool bGridToo = sal_True );
// fuer Cursortravelling usw.
- SvLBoxEntry* GoLeftRight( SvLBoxEntry*, BOOL bRight );
- SvLBoxEntry* GoUpDown( SvLBoxEntry*, BOOL bDown );
+ SvLBoxEntry* GoLeftRight( SvLBoxEntry*, sal_Bool bRight );
+ SvLBoxEntry* GoUpDown( SvLBoxEntry*, sal_Bool bDown );
- // Rueckgaebe: FALSE == Das leere Rect steht hinter dem letzten
+ // Rueckgaebe: sal_False == Das leere Rect steht hinter dem letzten
// Eintrag; d.h. beim naechsten Einfuegen ergibt sich das naechste
// leere Rechteck durch Addition. Hinweis: Das Rechteck kann dann
// ausserhalb des View-Space liegen
- BOOL FindEmptyGridRect( Rectangle& rRect );
+ sal_Bool FindEmptyGridRect( Rectangle& rRect );
// Erzeugt fuer jede Zeile (Hoehe=nGridDY) eine nach BoundRect.Left()
// sortierte Liste der Eintraege, die in ihr stehen. Eine Liste kann
@@ -693,14 +693,14 @@ public:
// muessen mit DestroyGridAdjustData geloescht werden
void CreateGridAjustData( SvPtrarr& pLists, SvLBoxEntry* pRow=0);
static void DestroyGridAdjustData( SvPtrarr& rLists );
- void SetGridUsed( const Rectangle&, BOOL bUsed = TRUE );
+ void SetGridUsed( const Rectangle&, sal_Bool bUsed = sal_True );
};
SvImpIconView::SvImpIconView( SvIconView* pCurView, SvLBoxTreeList* pTree,
- WinBits nWinStyle ) :
+ WinBits i_nWinStyle ) :
aVerSBar( pCurView, WB_DRAG | WB_VSCROLL ),
aHorSBar( pCurView, WB_DRAG | WB_HSCROLL )
{
@@ -708,7 +708,7 @@ SvImpIconView::SvImpIconView( SvIconView* pCurView, SvLBoxTreeList* pTree,
pModel = pTree;
pCurParent = 0;
pZOrderList = new SvPtrarr;
- SetWindowBits( nWinStyle );
+ SetStyle( i_nWinStyle );
nHorDist = 0;
nVerDist = 0;
nFlags = 0;
@@ -732,7 +732,7 @@ SvImpIconView::SvImpIconView( SvIconView* pCurView, SvLBoxTreeList* pTree,
aEditTimer.SetTimeout( 800 );
aEditTimer.SetTimeoutHdl(LINK(this,SvImpIconView,EditTimeoutHdl));
- Clear( TRUE );
+ Clear( sal_True );
}
SvImpIconView::~SvImpIconView()
@@ -747,14 +747,14 @@ SvImpIconView::~SvImpIconView()
ClearSelectedRectList();
}
-void SvImpIconView::Clear( BOOL bInCtor )
+void SvImpIconView::Clear( sal_Bool bInCtor )
{
StopEditTimer();
CancelUserEvent();
nMaxBmpWidth = 0;
nMaxBmpHeight = 0;
nMaxTextWidth = 0;
- bMustRecalcBoundingRects = FALSE;
+ bMustRecalcBoundingRects = sal_False;
nMaxBoundHeight = 0;
//XXX
@@ -777,30 +777,29 @@ void SvImpIconView::Clear( BOOL bInCtor )
AdjustScrollBars();
}
-void SvImpIconView::SetWindowBits( WinBits nWinStyle )
+void SvImpIconView::SetStyle( const WinBits i_nWinStyle )
{
- nWinBits = nWinStyle;
nViewMode = VIEWMODE_TEXT;
- if( nWinStyle & WB_NAME )
+ if( i_nWinStyle & WB_NAME )
nViewMode = VIEWMODE_NAME;
- if( nWinStyle & WB_ICON )
+ if( i_nWinStyle & WB_ICON )
nViewMode = VIEWMODE_ICON;
}
IMPL_LINK( SvImpIconView, ScrollUpDownHdl, ScrollBar *, pScrollBar )
{
- pView->EndEditing( TRUE );
+ pView->EndEditing( sal_True );
// Pfeil hoch: delta=-1; Pfeil runter: delta=+1
- Scroll( 0, pScrollBar->GetDelta(), TRUE );
+ Scroll( 0, pScrollBar->GetDelta(), sal_True );
return 0;
}
IMPL_LINK( SvImpIconView, ScrollLeftRightHdl, ScrollBar *, pScrollBar )
{
- pView->EndEditing( TRUE );
+ pView->EndEditing( sal_True );
// Pfeil links: delta=-1; Pfeil rechts: delta=+1
- Scroll( pScrollBar->GetDelta(), 0, TRUE );
+ Scroll( pScrollBar->GetDelta(), 0, sal_True );
return 0;
}
@@ -840,7 +839,7 @@ void SvImpIconView::CheckSizes( SvLBoxEntry* pEntry,
{
nMaxTextWidth = aSize.Width();
if( !(nFlags & F_GRIDMODE ) )
- bMustRecalcBoundingRects = TRUE;
+ bMustRecalcBoundingRects = sal_True;
}
}
SvLBoxContextBmp* pBmpItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
@@ -852,14 +851,14 @@ void SvImpIconView::CheckSizes( SvLBoxEntry* pEntry,
nMaxBmpWidth = aSize.Width();
nMaxBmpWidth += (2*LROFFS_ICON);
if( !(nFlags & F_GRIDMODE ) )
- bMustRecalcBoundingRects = TRUE;
+ bMustRecalcBoundingRects = sal_True;
}
if( aSize.Height() > nMaxBmpHeight )
{
nMaxBmpHeight = aSize.Height();
nMaxBmpHeight += (2*TBOFFS_ICON);;
if( !(nFlags & F_GRIDMODE ) )
- bMustRecalcBoundingRects = TRUE;
+ bMustRecalcBoundingRects = sal_True;
}
}
}
@@ -872,9 +871,9 @@ void SvImpIconView::EntryInserted( SvLBoxEntry* pEntry )
DBG_ASSERT(pZOrderList->GetPos(pEntry)==0xffff,"EntryInserted:ZOrder?");
pZOrderList->Insert( pEntry, pZOrderList->Count() );
if( nFlags & F_GRIDMODE )
- pImpCursor->Clear( FALSE );
+ pImpCursor->Clear( sal_False );
else
- pImpCursor->Clear( TRUE );
+ pImpCursor->Clear( sal_True );
SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
CheckSizes( pEntry, pViewData );
if( pView->IsUpdateMode() )
@@ -904,11 +903,11 @@ void SvImpIconView::RemovingEntry( SvLBoxEntry* pEntry )
if( pEntry == pCursor )
{
SvLBoxEntry* pNewCursor = GetNewCursor();
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
pCursor = 0; // damit er nicht deselektiert wird
SetCursor( pNewCursor );
}
- USHORT nPos = pZOrderList->GetPos( (void*)pEntry );
+ sal_uInt16 nPos = pZOrderList->GetPos( (void*)pEntry );
pZOrderList->Remove( nPos, 1 );
pImpCursor->Clear();
}
@@ -951,7 +950,7 @@ void SvImpIconView::MovingEntry( SvLBoxEntry* pEntry )
void SvImpIconView::EntryMoved( SvLBoxEntry* pEntry )
{
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
if( pModel->GetParent(pEntry)==pCurParent )
{
@@ -979,9 +978,9 @@ void SvImpIconView::EntryMoved( SvLBoxEntry* pEntry )
SetCursor( pNextCursor );
}
pImpCursor->Clear();
- USHORT nPos = pZOrderList->GetPos( (void*)pEntry );
+ sal_uInt16 nPos = pZOrderList->GetPos( (void*)pEntry );
pZOrderList->Remove( nPos, 1 );
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
// wenn er nochmal in dieser View auftaucht, muss sein
// Bounding-Rect neu berechnet werden
InvalidateBoundingRect( pViewData->aRect );
@@ -1006,7 +1005,7 @@ void SvImpIconView::CollapsingEntry( SvLBoxEntry* )
{
}
-void SvImpIconView::EntrySelected( SvLBoxEntry* pEntry, BOOL bSelect )
+void SvImpIconView::EntrySelected( SvLBoxEntry* pEntry, sal_Bool bSelect )
{
if( pModel->GetParent(pEntry) != pCurParent )
return;
@@ -1026,13 +1025,13 @@ void SvImpIconView::EntrySelected( SvLBoxEntry* pEntry, BOOL bSelect )
if( pView->IsUpdateMode() )
{
if( pEntry == pCursor )
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
if( nFlags & F_RUBBERING )
PaintEntry( pEntry );
else
pView->Invalidate( GetBoundingRect( pEntry ) );
if( pEntry == pCursor )
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
}
@@ -1124,7 +1123,7 @@ void SvImpIconView::ResetVirtSize()
StopEditTimer();
aVirtOutputSize.Width() = 0;
aVirtOutputSize.Height() = 0;
- BOOL bLockedEntryFound = FALSE;
+ sal_Bool bLockedEntryFound = sal_False;
nFlags &= (~F_GRID_INSERT);
SvLBoxEntry* pCur = pModel->FirstChild( pCurParent );
while( pCur )
@@ -1137,7 +1136,7 @@ void SvImpIconView::ResetVirtSize()
FindBoundingRect( pCur, pViewData );
else
AdjustVirtSize( pViewData->aRect );
- bLockedEntryFound = TRUE;
+ bLockedEntryFound = sal_True;
}
else
InvalidateBoundingRect( pViewData->aRect );
@@ -1191,16 +1190,16 @@ void SvImpIconView::Arrange()
void SvImpIconView::ImpArrange()
{
StopEditTimer();
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
ResetVirtSize();
- bMustRecalcBoundingRects = FALSE;
+ bMustRecalcBoundingRects = sal_False;
MapMode aMapMode( pView->GetMapMode());
aMapMode.SetOrigin( Point() );
pView->SetMapMode( aMapMode );
CheckAllSizes();
RecalcAllBoundingRectsSmart();
pView->Invalidate();
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
void SvImpIconView::Paint( const Rectangle& rRect )
@@ -1242,14 +1241,14 @@ void SvImpIconView::Paint( const Rectangle& rRect )
if( !pCursor )
pCursor = pModel->FirstChild( pCurParent );
- USHORT nCount = pZOrderList->Count();
+ sal_uInt16 nCount = pZOrderList->Count();
if( !nCount )
return;
SvPtrarr* pNewZOrderList = new SvPtrarr;
SvPtrarr* pPaintedEntries = new SvPtrarr;
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
while( nCount )
{
SvLBoxEntry* pEntry = (SvLBoxEntry*)(pZOrderList->GetObject(nPos ));
@@ -1272,7 +1271,7 @@ void SvImpIconView::Paint( const Rectangle& rRect )
nCount = pPaintedEntries->Count();
if( nCount )
{
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
pZOrderList->Insert( pPaintedEntries->GetObject( nCur ),pZOrderList->Count());
}
delete pPaintedEntries;
@@ -1282,7 +1281,7 @@ void SvImpIconView::Paint( const Rectangle& rRect )
PaintResizeRect( aRect );
}
-BOOL SvImpIconView::GetResizeRect( Rectangle& rRect )
+sal_Bool SvImpIconView::GetResizeRect( Rectangle& rRect )
{
if( aHorSBar.IsVisible() && aVerSBar.IsVisible() )
{
@@ -1293,9 +1292,9 @@ BOOL SvImpIconView::GetResizeRect( Rectangle& rRect )
aOrigin.Y() += aOutputSize.Height();
rRect.SetPos( aOrigin );
rRect.SetSize( Size( nVerSBarWidth, nHorSBarHeight));
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
void SvImpIconView::PaintResizeRect( const Rectangle& rRect )
@@ -1355,7 +1354,7 @@ void SvImpIconView::MouseButtonDown( const MouseEvent& rMEvt)
{
if( !rMEvt.IsMod1() ) // Ctrl
{
- pView->SelectAll( FALSE );
+ pView->SelectAll( sal_False );
ClearSelectedRectList();
}
else
@@ -1367,8 +1366,8 @@ void SvImpIconView::MouseButtonDown( const MouseEvent& rMEvt)
return;
}
- BOOL bSelected = pView->IsSelected( pEntry );
- BOOL bEditingEnabled = pView->IsInplaceEditingEnabled();
+ sal_Bool bSelected = pView->IsSelected( pEntry );
+ sal_Bool bEditingEnabled = pView->IsInplaceEditingEnabled();
if( rMEvt.GetClicks() == 2 )
{
@@ -1392,7 +1391,7 @@ void SvImpIconView::MouseButtonDown( const MouseEvent& rMEvt)
{
DeselectAllBut( pEntry );
SetCursor( pEntry );
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
if( bEditingEnabled && bSelected && !rMEvt.GetModifier() &&
rMEvt.IsLeft() && IsTextHit( pEntry, aDocPos ) )
{
@@ -1407,7 +1406,7 @@ void SvImpIconView::MouseButtonDown( const MouseEvent& rMEvt)
{
DeselectAllBut( pEntry );
SetCursor( pEntry );
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
}
else
{
@@ -1442,7 +1441,7 @@ void SvImpIconView::MouseButtonUp( const MouseEvent& rMEvt )
nFlags &= ~(F_RUBBERING | F_ADD_MODE);
}
- SvLBoxEntry* pEntry = pView->GetEntry( rMEvt.GetPosPixel(), TRUE );
+ SvLBoxEntry* pEntry = pView->GetEntry( rMEvt.GetPosPixel(), sal_True );
if( pEntry )
{
if( nFlags & F_DOWN_CTRL )
@@ -1455,7 +1454,7 @@ void SvImpIconView::MouseButtonUp( const MouseEvent& rMEvt )
{
DeselectAllBut( pEntry );
SetCursor( pEntry );
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
}
}
@@ -1491,12 +1490,12 @@ void SvImpIconView::MouseMove( const MouseEvent& rMEvt )
long nScrollDX, nScrollDY;
- CalcScrollOffsets(rMEvt.GetPosPixel(),nScrollDX,nScrollDY,FALSE );
- BOOL bSelRectHidden = FALSE;
+ CalcScrollOffsets(rMEvt.GetPosPixel(),nScrollDX,nScrollDY,sal_False );
+ sal_Bool bSelRectHidden = sal_False;
if( nScrollDX || nScrollDY )
{
HideSelectionRect();
- bSelRectHidden = TRUE;
+ bSelRectHidden = sal_True;
pView->Scroll( nScrollDX, nScrollDY );
}
Point aDocPos( rMEvt.GetPosPixel() );
@@ -1505,8 +1504,8 @@ void SvImpIconView::MouseMove( const MouseEvent& rMEvt )
if( aRect != aCurSelectionRect )
{
HideSelectionRect();
- bSelRectHidden = TRUE;
- BOOL bAdd = (nFlags & F_ADD_MODE) ? TRUE : FALSE;
+ bSelRectHidden = sal_True;
+ sal_Bool bAdd = (nFlags & F_ADD_MODE) ? sal_True : sal_False;
SelectRect( aRect, bAdd, &aSelectedRectList );
}
if( bSelRectHidden )
@@ -1514,32 +1513,32 @@ void SvImpIconView::MouseMove( const MouseEvent& rMEvt )
}
}
-BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt )
+sal_Bool SvImpIconView::KeyInput( const KeyEvent& rKEvt )
{
StopEditTimer();
- BOOL bKeyUsed = TRUE;
- BOOL bMod1 = rKEvt.GetKeyCode().IsMod1();
- BOOL bInAddMode = (BOOL)((nFlags & F_ADD_MODE) != 0);
+ sal_Bool bKeyUsed = sal_True;
+ sal_Bool bMod1 = rKEvt.GetKeyCode().IsMod1();
+ sal_Bool bInAddMode = (sal_Bool)((nFlags & F_ADD_MODE) != 0);
int bDeselAll = (pView->GetSelectionMode() != SINGLE_SELECTION) &&
!bInAddMode;
SvLBoxEntry* pNewCursor;
- USHORT nCode = rKEvt.GetKeyCode().GetCode();
+ sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
switch( nCode )
{
case KEY_UP:
if( pCursor )
{
MakeVisible( pCursor );
- pNewCursor = pImpCursor->GoUpDown(pCursor,FALSE);
+ pNewCursor = pImpCursor->GoUpDown(pCursor,sal_False);
if( pNewCursor )
{
if( bDeselAll )
- pView->SelectAll( FALSE );
- ShowCursor( FALSE );
+ pView->SelectAll( sal_False );
+ ShowCursor( sal_False );
MakeVisible( pNewCursor );
SetCursor( pNewCursor );
if( !bInAddMode )
- pView->Select( pCursor, TRUE );
+ pView->Select( pCursor, sal_True );
}
else
{
@@ -1557,17 +1556,17 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt )
case KEY_DOWN:
if( pCursor )
{
- pNewCursor=pImpCursor->GoUpDown( pCursor,TRUE );
+ pNewCursor=pImpCursor->GoUpDown( pCursor,sal_True );
if( pNewCursor )
{
MakeVisible( pCursor );
if( bDeselAll )
- pView->SelectAll( FALSE );
- ShowCursor( FALSE );
+ pView->SelectAll( sal_False );
+ ShowCursor( sal_False );
MakeVisible( pNewCursor );
SetCursor( pNewCursor );
if( !bInAddMode )
- pView->Select( pCursor, TRUE );
+ pView->Select( pCursor, sal_True );
}
}
break;
@@ -1575,17 +1574,17 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt )
case KEY_RIGHT:
if( pCursor )
{
- pNewCursor=pImpCursor->GoLeftRight(pCursor,TRUE );
+ pNewCursor=pImpCursor->GoLeftRight(pCursor,sal_True );
if( pNewCursor )
{
MakeVisible( pCursor );
if( bDeselAll )
- pView->SelectAll( FALSE );
- ShowCursor( FALSE );
+ pView->SelectAll( sal_False );
+ ShowCursor( sal_False );
MakeVisible( pNewCursor );
SetCursor( pNewCursor );
if( !bInAddMode )
- pView->Select( pCursor, TRUE );
+ pView->Select( pCursor, sal_True );
}
}
break;
@@ -1594,16 +1593,16 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt )
if( pCursor )
{
MakeVisible( pCursor );
- pNewCursor = pImpCursor->GoLeftRight(pCursor,FALSE );
+ pNewCursor = pImpCursor->GoLeftRight(pCursor,sal_False );
if( pNewCursor )
{
if( bDeselAll )
- pView->SelectAll( FALSE );
- ShowCursor( FALSE );
+ pView->SelectAll( sal_False );
+ ShowCursor( sal_False );
MakeVisible( pNewCursor );
SetCursor( pNewCursor );
if( !bInAddMode )
- pView->Select( pCursor, TRUE );
+ pView->Select( pCursor, sal_True );
}
else
{
@@ -1622,7 +1621,7 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt )
if( nFlags & F_RUBBERING )
{
HideSelectionRect();
- pView->SelectAll( FALSE );
+ pView->SelectAll( sal_False );
nFlags &= ~F_RUBBERING;
}
break;
@@ -1663,13 +1662,13 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt )
case KEY_ADD:
case KEY_DIVIDE :
if( bMod1 )
- pView->SelectAll( TRUE );
+ pView->SelectAll( sal_True );
break;
case KEY_SUBTRACT:
case KEY_COMMA :
if( bMod1 )
- pView->SelectAll( FALSE );
+ pView->SelectAll( sal_False );
break;
case KEY_RETURN:
@@ -1681,7 +1680,7 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt )
break;
default:
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
}
return bKeyUsed;
@@ -1694,11 +1693,6 @@ void SvImpIconView::PositionScrollBars( long nRealWidth, long nRealHeight )
Point aPos( 0, nRealHeight );
aPos.Y() -= nHorSBarHeight;
-#ifdef WIN
- // vom linken und unteren Rand ein Pixel abschneiden
- aPos.Y()++;
- aPos.X()--;
-#endif
#ifdef OS2
aPos.Y()++;
#endif
@@ -1709,7 +1703,7 @@ void SvImpIconView::PositionScrollBars( long nRealWidth, long nRealHeight )
aPos.X() = nRealWidth; aPos.Y() = 0;
aPos.X() -= nVerSBarWidth;
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
aPos.X()++;
aPos.Y()--;
#endif
@@ -1751,10 +1745,10 @@ void SvImpIconView::AdjustScrollBars()
else
nVisibleHeight = nRealHeight;
- bool bVerSBar = (pView->nWindowStyle & WB_VSCROLL) ? true : false;
- bool bHorSBar = (pView->nWindowStyle & WB_HSCROLL) ? true : false;
+ bool bVerSBar = (pView->GetStyle() & WB_VSCROLL) ? true : false;
+ bool bHorSBar = (pView->GetStyle() & WB_HSCROLL) ? true : false;
- USHORT nResult = 0;
+ sal_uInt16 nResult = 0;
if( nVirtHeight )
{
// activate ver scrollbar ?
@@ -1801,7 +1795,7 @@ void SvImpIconView::AdjustScrollBars()
// size ver scrollbar
long nThumb = aVerSBar.GetThumbPos();
Size aSize( nVerSBarWidth, nRealHeight );
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
aSize.Height() += 2;
#endif
#ifdef OS2
@@ -1826,7 +1820,7 @@ void SvImpIconView::AdjustScrollBars()
nThumb = aHorSBar.GetThumbPos();
aSize.Width() = nRealWidth;
aSize.Height() = nHorSBarHeight;
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
aSize.Width()++;
#endif
#ifdef OS2
@@ -1834,7 +1828,7 @@ void SvImpIconView::AdjustScrollBars()
if( nResult & 0x0001 ) // vertikale Scrollbar ?
aSize.Width()--;
#endif
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
if( nResult & 0x0001 ) // vertikale Scrollbar ?
{
aSize.Width()++;
@@ -1860,7 +1854,7 @@ void SvImpIconView::AdjustScrollBars()
nRealWidth++;
#endif
aOutputSize.Width() = nRealWidth;
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
if( nResult & 0x0002 ) // hor scrollbar ?
nRealHeight++; // weil unterer Rand geclippt wird
#endif
@@ -1894,23 +1888,23 @@ void SvImpIconView::Resize()
#endif
}
-BOOL SvImpIconView::CheckHorScrollBar()
+sal_Bool SvImpIconView::CheckHorScrollBar()
{
if( !pZOrderList || !aHorSBar.IsVisible() )
- return FALSE;
+ return sal_False;
const MapMode& rMapMode = pView->GetMapMode();
Point aOrigin( rMapMode.GetOrigin() );
- if(!(pView->nWindowStyle & WB_HSCROLL) && !aOrigin.X() )
+ if(!(pView->GetStyle() & WB_HSCROLL) && !aOrigin.X() )
{
long nWidth = aOutputSize.Width();
- USHORT nCount = pZOrderList->Count();
+ sal_uInt16 nCount = pZOrderList->Count();
long nMostRight = 0;
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
SvLBoxEntry* pEntry = (SvLBoxEntry*)pZOrderList->operator[](nCur);
long nRight = GetBoundingRect(pEntry).Right();
if( nRight > nWidth )
- return FALSE;
+ return sal_False;
if( nRight > nMostRight )
nMostRight = nRight;
}
@@ -1927,28 +1921,28 @@ BOOL SvImpIconView::CheckHorScrollBar()
aSize.Height() += nHorSBarHeight;
aVerSBar.SetSizePixel( aSize );
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL SvImpIconView::CheckVerScrollBar()
+sal_Bool SvImpIconView::CheckVerScrollBar()
{
if( !pZOrderList || !aVerSBar.IsVisible() )
- return FALSE;
+ return sal_False;
const MapMode& rMapMode = pView->GetMapMode();
Point aOrigin( rMapMode.GetOrigin() );
- if(!(pView->nWindowStyle & WB_VSCROLL) && !aOrigin.Y() )
+ if(!(pView->GetStyle() & WB_VSCROLL) && !aOrigin.Y() )
{
long nDeepest = 0;
long nHeight = aOutputSize.Height();
- USHORT nCount = pZOrderList->Count();
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ sal_uInt16 nCount = pZOrderList->Count();
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
SvLBoxEntry* pEntry = (SvLBoxEntry*)pZOrderList->operator[](nCur);
long nBottom = GetBoundingRect(pEntry).Bottom();
if( nBottom > nHeight )
- return FALSE;
+ return sal_False;
if( nBottom > nDeepest )
nDeepest = nBottom;
}
@@ -1965,9 +1959,9 @@ BOOL SvImpIconView::CheckVerScrollBar()
aSize.Width() += nVerSBarWidth;
aHorSBar.SetSizePixel( aSize );
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
@@ -1984,8 +1978,8 @@ void SvImpIconView::GetFocus()
{
if( pCursor )
{
- pView->SetEntryFocus( pCursor, TRUE );
- ShowCursor( TRUE );
+ pView->SetEntryFocus( pCursor, sal_True );
+ ShowCursor( sal_True );
}
}
@@ -1993,8 +1987,8 @@ void SvImpIconView::LoseFocus()
{
StopEditTimer();
if( pCursor )
- pView->SetEntryFocus( pCursor,FALSE );
- ShowCursor( FALSE );
+ pView->SetEntryFocus( pCursor,sal_False );
+ ShowCursor( sal_False );
}
void SvImpIconView::UpdateAll()
@@ -2010,8 +2004,8 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, SvIcnVwDataEntry* pViewData
PaintEntry( pEntry, aPos, pViewData );
}
-void SvImpIconView::PaintEmphasis( const Rectangle& rRect, BOOL bSelected,
- BOOL bCursored, OutputDevice* pOut )
+void SvImpIconView::PaintEmphasis( const Rectangle& rRect, sal_Bool bSelected,
+ sal_Bool bCursored, OutputDevice* pOut )
{
// HACK fuer D&D
if( nFlags & F_NO_EMPHASIS )
@@ -2049,7 +2043,7 @@ void SvImpIconView::PaintEmphasis( const Rectangle& rRect, BOOL bSelected,
}
void SvImpIconView::PaintItem( const Rectangle& rRect,
- SvLBoxItem* pItem, SvLBoxEntry* pEntry, USHORT nPaintFlags,
+ SvLBoxItem* pItem, SvLBoxEntry* pEntry, sal_uInt16 nPaintFlags,
OutputDevice* pOut )
{
if( nViewMode == VIEWMODE_ICON && pItem->IsA() == SV_ITEM_ID_LBOXSTRING )
@@ -2087,8 +2081,8 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos,
SvLBoxString* pStringItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
- BOOL bSelected = pViewData->IsSelected();
- BOOL bCursored = pViewData->IsCursored();
+ sal_Bool bSelected = pViewData->IsSelected();
+ sal_Bool bCursored = pViewData->IsCursored();
Font aTempFont( pOut->GetFont() );
// waehrend D&D nicht die Fontfarbe wechseln, da sonst auch die
@@ -2100,7 +2094,7 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos,
aNewFont.SetColor( rStyleSettings.GetHighlightTextColor() );
pOut->SetFont( aNewFont );
}
- Rectangle aTextRect( CalcTextRect(pEntry,pStringItem,&rPos,FALSE,pViewData));
+ Rectangle aTextRect( CalcTextRect(pEntry,pStringItem,&rPos,sal_False,pViewData));
Rectangle aBmpRect( CalcBmpRect(pEntry, &rPos, pViewData ) );
switch( nViewMode )
@@ -2110,7 +2104,7 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos,
PaintEmphasis( aBmpRect, bSelected, bCursored, pOut );
PaintItem( aBmpRect, pBmpItem, pEntry,
PAINTFLAG_HOR_CENTERED | PAINTFLAG_VER_CENTERED, pOut );
- PaintEmphasis( aTextRect, bSelected, FALSE, pOut );
+ PaintEmphasis( aTextRect, bSelected, sal_False, pOut );
PaintItem( aTextRect, pStringItem, pEntry, PAINTFLAG_HOR_CENTERED, pOut );
break;
@@ -2118,7 +2112,7 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos,
pBmpItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
PaintEmphasis( aBmpRect, bSelected, bCursored, pOut );
PaintItem( aBmpRect, pBmpItem, pEntry, PAINTFLAG_VER_CENTERED, pOut );
- PaintEmphasis( aTextRect, bSelected, FALSE, pOut );
+ PaintEmphasis( aTextRect, bSelected, sal_False, pOut );
PaintItem( aTextRect, pStringItem, pEntry,PAINTFLAG_VER_CENTERED, pOut );
break;
@@ -2131,11 +2125,11 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos,
}
void SvImpIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos,
- BOOL bAdjustAtGrid, BOOL bCheckScrollBars )
+ sal_Bool bAdjustAtGrid, sal_Bool bCheckScrollBars )
{
if( pModel->GetParent(pEntry) == pCurParent )
{
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
Rectangle aBoundRect( GetBoundingRect( pEntry, pViewData ));
pView->Invalidate( aBoundRect );
@@ -2161,7 +2155,7 @@ void SvImpIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos,
CheckScrollBars();
PaintEntry( pEntry, pViewData );
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
}
@@ -2172,7 +2166,7 @@ void SvImpIconView::ViewDataInitialized( SvLBoxEntry*)
void SvImpIconView::ModelHasEntryInvalidated( SvListEntry* pEntry )
{
if( pEntry == pCursor )
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
pView->Invalidate( pViewData->aRect );
@@ -2185,7 +2179,7 @@ void SvImpIconView::ModelHasEntryInvalidated( SvListEntry* pEntry )
ViewDataInitialized( (SvLBoxEntry*)pEntry );
pView->Invalidate( pViewData->aRect );
if( pEntry == pCursor )
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
@@ -2207,9 +2201,9 @@ void SvImpIconView::SetSelectionMode( SelectionMode )
{
}
-BOOL SvImpIconView::IsEntryInView( SvLBoxEntry* )
+sal_Bool SvImpIconView::IsEntryInView( SvLBoxEntry* )
{
- return FALSE;
+ return sal_False;
}
SvLBoxEntry* SvImpIconView::GetDropTarget( const Point& rPos )
@@ -2227,7 +2221,7 @@ SvLBoxEntry* SvImpIconView::GetEntry( const Point& rDocPos )
CheckBoundingRects();
SvLBoxEntry* pTarget = 0;
// Z-Order-Liste vom Ende her absuchen
- USHORT nCount = pZOrderList->Count();
+ sal_uInt16 nCount = pZOrderList->Count();
while( nCount )
{
nCount--;
@@ -2246,11 +2240,11 @@ SvLBoxEntry* SvImpIconView::GetNextEntry( const Point& rDocPos, SvLBoxEntry* pCu
{
CheckBoundingRects();
SvLBoxEntry* pTarget = 0;
- USHORT nStartPos = pZOrderList->GetPos( (void*)pCurEntry );
+ sal_uInt16 nStartPos = pZOrderList->GetPos( (void*)pCurEntry );
if( nStartPos != USHRT_MAX )
{
- USHORT nCount = pZOrderList->Count();
- for( USHORT nCur = nStartPos+1; nCur < nCount; nCur++ )
+ sal_uInt16 nCount = pZOrderList->Count();
+ for( sal_uInt16 nCur = nStartPos+1; nCur < nCount; nCur++ )
{
SvLBoxEntry* pEntry = (SvLBoxEntry*)(pZOrderList->GetObject(nCur));
SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
@@ -2268,7 +2262,7 @@ SvLBoxEntry* SvImpIconView::GetPrevEntry( const Point& rDocPos, SvLBoxEntry* pCu
{
CheckBoundingRects();
SvLBoxEntry* pTarget = 0;
- USHORT nStartPos = pZOrderList->GetPos( (void*)pCurEntry );
+ sal_uInt16 nStartPos = pZOrderList->GetPos( (void*)pCurEntry );
if( nStartPos != USHRT_MAX && nStartPos != 0 )
{
nStartPos--;
@@ -2348,7 +2342,7 @@ Rectangle SvImpIconView::CalcBmpRect( SvLBoxEntry* pEntry, const Point* pPos,
}
Rectangle SvImpIconView::CalcTextRect( SvLBoxEntry* pEntry,
- SvLBoxString* pItem, const Point* pPos, BOOL bForInplaceEdit,
+ SvLBoxString* pItem, const Point* pPos, sal_Bool bForInplaceEdit,
SvIcnVwDataEntry* pViewData )
{
long nBmpHeight, nBmpWidth;
@@ -2501,7 +2495,7 @@ void SvImpIconView::RecalcAllBoundingRects()
pZOrderList->Insert( pEntry, pZOrderList->Count() );
pEntry = pModel->NextSibling( pEntry );
}
- bMustRecalcBoundingRects = FALSE;
+ bMustRecalcBoundingRects = sal_False;
AdjustScrollBars();
}
@@ -2580,26 +2574,26 @@ void SvImpIconView::SetCursor( SvLBoxEntry* pEntry )
if( pEntry == pCursor )
return;
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
if( pCursor )
{
- pView->SetEntryFocus( pCursor, FALSE );
+ pView->SetEntryFocus( pCursor, sal_False );
if( pView->GetSelectionMode() == SINGLE_SELECTION )
- pView->Select( pCursor, FALSE );
+ pView->Select( pCursor, sal_False );
}
pCursor = pEntry;
ToTop( pCursor );
if( pCursor )
{
- pView->SetEntryFocus(pCursor, TRUE );
+ pView->SetEntryFocus(pCursor, sal_True );
if( pView->GetSelectionMode() == SINGLE_SELECTION )
- pView->Select( pCursor, TRUE );
- ShowCursor( TRUE );
+ pView->Select( pCursor, sal_True );
+ ShowCursor( sal_True );
}
}
-void SvImpIconView::ShowCursor( BOOL bShow )
+void SvImpIconView::ShowCursor( sal_Bool bShow )
{
if( !pCursor || !bShow || !pView->HasFocus() )
{
@@ -2638,7 +2632,7 @@ void SvImpIconView::ShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPosPix )
DELETEZ(pDDDev);
DELETEZ(pDDBufDev);
}
- BOOL bSelected = pView->SvListView::Select( pRefEntry, FALSE );
+ sal_Bool bSelected = pView->SvListView::Select( pRefEntry, sal_False );
if( !pDDDev )
{
if( pDDBufDev )
@@ -2676,7 +2670,7 @@ void SvImpIconView::ShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPosPix )
PaintEntry( pRefEntry, aPos );
nFlags &= ~F_NO_EMPHASIS;
if( bSelected )
- pView->SvListView::Select( pRefEntry, TRUE );
+ pView->SvListView::Select( pRefEntry, sal_True );
}
void SvImpIconView::HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPosPix )
@@ -2767,12 +2761,12 @@ void SvImpIconView::HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPosPix
pDDDev->GetOutputSizePixel(),
*pDDTempDev );
- BOOL bSelected = pView->SvListView::Select( pRefEntry, FALSE );
+ sal_Bool bSelected = pView->SvListView::Select( pRefEntry, sal_False );
if( bSelected )
- pView->SvListView::Select( pRefEntry, TRUE );
+ pView->SvListView::Select( pRefEntry, sal_True );
}
-void SvImpIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL )
+void SvImpIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool )
{
CheckBoundingRects();
Rectangle aRect;
@@ -2792,8 +2786,8 @@ void SvImpIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL )
ImpDrawXORRect( aRect );
}
-BOOL SvImpIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
- SvLBoxEntry*& rpNewPar, ULONG& rNewChildPos )
+sal_Bool SvImpIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewPar, sal_uLong& rNewChildPos )
{
if( pTarget == pCurParent && pModel->GetParent(pEntry) == pCurParent )
{
@@ -2803,14 +2797,14 @@ BOOL SvImpIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
Size aSize( pViewData->aRect.GetSize() );
Point aNewPos = FindNextEntryPos( aSize );
AdjustVirtSize( Rectangle( aNewPos, aSize ) );
- SetEntryPosition( pEntry, aNewPos, FALSE, TRUE );
- return FALSE;
+ SetEntryPosition( pEntry, aNewPos, sal_False, sal_True );
+ return sal_False;
}
return pView->SvLBox::NotifyMoving(pTarget,pEntry,rpNewPar,rNewChildPos);
}
-BOOL SvImpIconView::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
- SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos )
+sal_Bool SvImpIconView::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos )
{
return pView->SvLBox::NotifyCopying(pTarget,pEntry,rpNewParent,rNewChildPos);
}
@@ -2847,9 +2841,9 @@ void SvImpIconView::PrepareCommandEvent( const Point& rPt )
aMouseMoveTimer.Stop();
StopEditTimer();
nFlags |= F_CMD_ARRIVED;
- SvLBoxEntry* pEntry = pView->GetEntry( rPt, TRUE );
+ SvLBoxEntry* pEntry = pView->GetEntry( rPt, sal_True );
if( (nFlags & F_DOWN_CTRL) && pEntry && !pView->IsSelected(pEntry) )
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT);
}
@@ -2858,12 +2852,12 @@ void SvImpIconView::SttDrag( const Point& rPos )
PrepareCommandEvent( rPos );
nFlags |= F_DRAG_SOURCE;
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
}
void SvImpIconView::EndDrag()
{
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
nFlags &= (~F_DRAG_SOURCE);
}
@@ -2872,7 +2866,7 @@ void SvImpIconView::ToTop( SvLBoxEntry* pEntry )
DBG_ASSERT(pZOrderList->GetPos(pEntry)!=0xffff,"ToTop:ZOrder?");
if( pZOrderList->GetObject( pZOrderList->Count() -1 ) != pEntry )
{
- USHORT nPos = pZOrderList->GetPos( (void*)pEntry );
+ sal_uInt16 nPos = pZOrderList->GetPos( (void*)pEntry );
pZOrderList->Remove( nPos, 1 );
pZOrderList->Insert( pEntry, pZOrderList->Count() );
}
@@ -2899,9 +2893,9 @@ void SvImpIconView::ClipAtVirtOutRect( Rectangle& rRect ) const
// rRect: Bereich des Dokumentes (in Dokumentkoordinaten), der
// sichtbar gemacht werden soll.
-// bScrBar == TRUE: Das Rect wurde aufgrund eines ScrollBar-Events berechnet
+// bScrBar == sal_True: Das Rect wurde aufgrund eines ScrollBar-Events berechnet
-void SvImpIconView::MakeVisible( const Rectangle& rRect, BOOL bScrBar )
+void SvImpIconView::MakeVisible( const Rectangle& rRect, sal_Bool bScrBar )
{
Rectangle aRect( rRect );
ClipAtVirtOutRect( aRect );
@@ -2955,7 +2949,7 @@ void SvImpIconView::MakeVisible( const Rectangle& rRect, BOOL bScrBar )
pView->SetMapMode( aMapMode );
// in umgekehrte Richtung scrollen!
- pView->Control::Scroll( -nDx, -nDy, aOutputArea, TRUE );
+ pView->Control::Scroll( -nDx, -nDy, aOutputArea, sal_True );
if( aHorSBar.IsVisible() || aVerSBar.IsVisible() )
{
if( !bScrBar )
@@ -2979,15 +2973,15 @@ SvLBoxEntry* SvImpIconView::GetNewCursor()
SvLBoxEntry* pNewCursor;
if( pCursor )
{
- pNewCursor = pImpCursor->GoLeftRight( pCursor, FALSE );
+ pNewCursor = pImpCursor->GoLeftRight( pCursor, sal_False );
if( !pNewCursor )
{
- pNewCursor = pImpCursor->GoLeftRight( pCursor, TRUE );
+ pNewCursor = pImpCursor->GoLeftRight( pCursor, sal_True );
if( !pNewCursor )
{
- pNewCursor = pImpCursor->GoUpDown( pCursor, FALSE );
+ pNewCursor = pImpCursor->GoUpDown( pCursor, sal_False );
if( !pNewCursor )
- pNewCursor = pImpCursor->GoUpDown( pCursor, TRUE );
+ pNewCursor = pImpCursor->GoUpDown( pCursor, sal_True );
}
}
}
@@ -2998,9 +2992,9 @@ SvLBoxEntry* SvImpIconView::GetNewCursor()
}
-USHORT SvImpIconView:: GetSelectionCount() const
+sal_uInt16 SvImpIconView:: GetSelectionCount() const
{
- USHORT nSelected = 0;
+ sal_uInt16 nSelected = 0;
SvLBoxEntry* pEntry = pModel->FirstChild( pCurParent);
while( pEntry )
{
@@ -3014,11 +3008,11 @@ USHORT SvImpIconView:: GetSelectionCount() const
void SvImpIconView::ToggleSelection( SvLBoxEntry* pEntry )
{
- BOOL bSel;
+ sal_Bool bSel;
if( pView->IsSelected( pEntry ) )
- bSel = FALSE;
+ bSel = sal_False;
else
- bSel = TRUE;
+ bSel = sal_True;
pView->Select( pEntry, bSel );
}
@@ -3029,7 +3023,7 @@ void SvImpIconView::DeselectAllBut( SvLBoxEntry* pThisEntryNot )
while( pEntry )
{
if( pEntry != pThisEntryNot && pView->IsSelected( pEntry ))
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
pEntry = pModel->NextSibling( pEntry );
}
}
@@ -3059,14 +3053,14 @@ ImpIcnCursor::~ImpIcnCursor()
delete pGridMap;
}
-USHORT ImpIcnCursor::GetSortListPos( SvPtrarr* pList, long nValue,
+sal_uInt16 ImpIcnCursor::GetSortListPos( SvPtrarr* pList, long nValue,
int bVertical )
{
- USHORT nCount = (USHORT)pList->Count();
+ sal_uInt16 nCount = (sal_uInt16)pList->Count();
if( !nCount )
return 0;
- USHORT nCurPos = 0;
+ sal_uInt16 nCurPos = 0;
long nPrevValue = LONG_MIN;
while( nCount )
{
@@ -3078,7 +3072,7 @@ USHORT ImpIcnCursor::GetSortListPos( SvPtrarr* pList, long nValue,
else
nCurValue = rRect.Left();
if( nValue >= nPrevValue && nValue <= nCurValue )
- return (USHORT)nCurPos;
+ return (sal_uInt16)nCurPos;
nPrevValue = nCurValue;
nCount--;
nCurPos++;
@@ -3114,10 +3108,10 @@ void ImpIcnCursor::ImplCreate()
if( nX >= nCols )
nX = sal::static_int_cast< short >(nCols - 1);
- USHORT nIns = GetSortListPos( &pColumns[nX], rRect.Top(), TRUE );
+ sal_uInt16 nIns = GetSortListPos( &pColumns[nX], rRect.Top(), sal_True );
pColumns[ nX ].Insert( pEntry, nIns );
- nIns = GetSortListPos( &pRows[nY], rRect.Left(), FALSE );
+ nIns = GetSortListPos( &pRows[nY], rRect.Left(), sal_False );
pRows[ nY ].Insert( pEntry, nIns );
pViewData->nX = nX;
@@ -3161,7 +3155,7 @@ void ImpIcnCursor::CreateGridMap()
//XXX
//nGridRows += 50; // in fuenfziger-Schritten
- pGridMap = new BOOL[ nGridRows*nGridCols];
+ pGridMap = new sal_Bool[ nGridRows*nGridCols];
memset( (void*)pGridMap, 0, nGridRows*nGridCols );
SvLBoxTreeList* pModel = pView->pModel;
@@ -3180,49 +3174,49 @@ void ImpIcnCursor::CreateGridMap()
}
}
-BOOL ImpIcnCursor::GetGrid( const Point& rDocPos, USHORT& rGridX, USHORT& rGridY ) const
+sal_Bool ImpIcnCursor::GetGrid( const Point& rDocPos, sal_uInt16& rGridX, sal_uInt16& rGridY ) const
{
Point aPos( rDocPos );
aPos.X() -= LROFFS_WINBORDER;
aPos.Y() -= TBOFFS_WINBORDER;
- rGridX = (USHORT)(aPos.X() / nGridDX);
- rGridY = (USHORT)(aPos.Y() / nGridDY);
- BOOL bInGrid = TRUE;
+ rGridX = (sal_uInt16)(aPos.X() / nGridDX);
+ rGridY = (sal_uInt16)(aPos.Y() / nGridDY);
+ sal_Bool bInGrid = sal_True;
if( rGridX >= nGridCols )
{
- rGridX = sal::static_int_cast< USHORT >(nGridCols - 1);
- bInGrid = FALSE;
+ rGridX = sal::static_int_cast< sal_uInt16 >(nGridCols - 1);
+ bInGrid = sal_False;
}
if( rGridY >= nGridRows )
{
- rGridY = sal::static_int_cast< USHORT >(nGridRows - 1);
+ rGridY = sal::static_int_cast< sal_uInt16 >(nGridRows - 1);
if( !bInGrid )
- return FALSE; // beide Koordinaten nicht im Grid
+ return sal_False; // beide Koordinaten nicht im Grid
}
- return TRUE;
+ return sal_True;
}
-void ImpIcnCursor::SetGridUsed( const Rectangle& rRect, BOOL bUsed )
+void ImpIcnCursor::SetGridUsed( const Rectangle& rRect, sal_Bool bUsed )
{
CreateGridMap();
- USHORT nTLX, nTLY, nBRX, nBRY;
+ sal_uInt16 nTLX, nTLY, nBRX, nBRY;
- BOOL bTLInGrid = GetGrid( rRect.TopLeft(), nTLX, nTLY );
- BOOL bBRInGrid = GetGrid( rRect.BottomRight(), nBRX, nBRY );
+ sal_Bool bTLInGrid = GetGrid( rRect.TopLeft(), nTLX, nTLY );
+ sal_Bool bBRInGrid = GetGrid( rRect.BottomRight(), nBRX, nBRY );
if( !bTLInGrid && !bBRInGrid )
return;
- for( USHORT nCurY = nTLY; nCurY <= nBRY; nCurY++ )
+ for( sal_uInt16 nCurY = nTLY; nCurY <= nBRY; nCurY++ )
{
- for( USHORT nCurX = nTLX; nCurX <= nBRX; nCurX++ )
+ for( sal_uInt16 nCurX = nTLX; nCurX <= nBRX; nCurX++ )
{
SetGridUsed( nCurX, nCurY, bUsed );
}
}
}
-void ImpIcnCursor::Clear( BOOL bGridToo )
+void ImpIcnCursor::Clear( sal_Bool bGridToo )
{
if( pColumns )
{
@@ -3242,12 +3236,12 @@ void ImpIcnCursor::Clear( BOOL bGridToo )
}
}
-SvLBoxEntry* ImpIcnCursor::SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom,
- USHORT, BOOL bDown, BOOL bSimple )
+SvLBoxEntry* ImpIcnCursor::SearchCol(sal_uInt16 nCol,sal_uInt16 nTop,sal_uInt16 nBottom,
+ sal_uInt16, sal_Bool bDown, sal_Bool bSimple )
{
DBG_ASSERT(pCurEntry,"SearchCol: No reference entry");
SvPtrarr* pList = &(pColumns[ nCol ]);
- USHORT nCount = pList->Count();
+ sal_uInt16 nCount = pList->Count();
if( !nCount )
return 0;
@@ -3255,7 +3249,7 @@ SvLBoxEntry* ImpIcnCursor::SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom,
if( bSimple )
{
- USHORT nListPos = pList->GetPos( pCurEntry );
+ sal_uInt16 nListPos = pList->GetPos( pCurEntry );
DBG_ASSERT(nListPos!=0xffff,"Entry not in Col-List");
if( bDown )
{
@@ -3288,19 +3282,19 @@ SvLBoxEntry* ImpIcnCursor::SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom,
if( nTop > nBottom )
{
- USHORT nTemp = nTop;
+ sal_uInt16 nTemp = nTop;
nTop = nBottom;
nBottom = nTemp;
}
long nMinDistance = LONG_MAX;
SvLBoxEntry* pResult = 0;
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
SvLBoxEntry* pEntry = (SvLBoxEntry*)(pList->GetObject( nCur ));
if( pEntry != pCurEntry )
{
SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pEntry);
- USHORT nY = pViewData->nY;
+ sal_uInt16 nY = pViewData->nY;
if( nY >= nTop && nY <= nBottom )
{
const Rectangle& rRect = pView->GetBoundingRect( pEntry );
@@ -3318,12 +3312,12 @@ SvLBoxEntry* ImpIcnCursor::SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom,
return pResult;
}
-SvLBoxEntry* ImpIcnCursor::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight,
- USHORT, BOOL bRight, BOOL bSimple )
+SvLBoxEntry* ImpIcnCursor::SearchRow(sal_uInt16 nRow,sal_uInt16 nLeft,sal_uInt16 nRight,
+ sal_uInt16, sal_Bool bRight, sal_Bool bSimple )
{
DBG_ASSERT(pCurEntry,"SearchRow: No reference entry");
SvPtrarr* pList = &(pRows[ nRow ]);
- USHORT nCount = pList->Count();
+ sal_uInt16 nCount = pList->Count();
if( !nCount )
return 0;
@@ -3331,7 +3325,7 @@ SvLBoxEntry* ImpIcnCursor::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight,
if( bSimple )
{
- USHORT nListPos = pList->GetPos( pCurEntry );
+ sal_uInt16 nListPos = pList->GetPos( pCurEntry );
DBG_ASSERT(nListPos!=0xffff,"Entry not in Row-List");
if( bRight )
{
@@ -3364,19 +3358,19 @@ SvLBoxEntry* ImpIcnCursor::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight,
}
if( nRight < nLeft )
{
- USHORT nTemp = nRight;
+ sal_uInt16 nTemp = nRight;
nRight = nLeft;
nLeft = nTemp;
}
long nMinDistance = LONG_MAX;
SvLBoxEntry* pResult = 0;
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
SvLBoxEntry* pEntry = (SvLBoxEntry*)(pList->GetObject( nCur ));
if( pEntry != pCurEntry )
{
SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pEntry);
- USHORT nX = pViewData->nX;
+ sal_uInt16 nX = pViewData->nX;
if( nX >= nLeft && nX <= nRight )
{
const Rectangle& rRect = pView->GetBoundingRect( pEntry );
@@ -3398,7 +3392,7 @@ SvLBoxEntry* ImpIcnCursor::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight,
/*
Sucht ab dem uebergebenen Eintrag den naechsten rechts- bzw.
- linksstehenden. Suchverfahren am Beispiel bRight = TRUE:
+ linksstehenden. Suchverfahren am Beispiel bRight = sal_True:
c
b c
@@ -3413,22 +3407,22 @@ SvLBoxEntry* ImpIcnCursor::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight,
a,b,c : 2., 3., 4. Suchrechteck
*/
-SvLBoxEntry* ImpIcnCursor::GoLeftRight( SvLBoxEntry* pIcnEntry, BOOL bRight )
+SvLBoxEntry* ImpIcnCursor::GoLeftRight( SvLBoxEntry* pIcnEntry, sal_Bool bRight )
{
SvLBoxEntry* pResult;
pCurEntry = pIcnEntry;
Create();
SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pIcnEntry);
- USHORT nY = pViewData->nY;
- USHORT nX = pViewData->nX;
+ sal_uInt16 nY = pViewData->nY;
+ sal_uInt16 nX = pViewData->nX;
DBG_ASSERT(nY< nRows,"GoLeftRight:Bad column");
DBG_ASSERT(nX< nCols,"GoLeftRight:Bad row");
// Nachbar auf gleicher Zeile ?
if( bRight )
pResult = SearchRow(
- nY, nX, sal::static_int_cast< USHORT >(nCols-1), nX, TRUE, TRUE );
+ nY, nX, sal::static_int_cast< sal_uInt16 >(nCols-1), nX, sal_True, sal_True );
else
- pResult = SearchRow( nY, nX ,0, nX, FALSE, TRUE );
+ pResult = SearchRow( nY, nX ,0, nX, sal_False, sal_True );
if( pResult )
return pResult;
@@ -3446,11 +3440,11 @@ SvLBoxEntry* ImpIcnCursor::GoLeftRight( SvLBoxEntry* pIcnEntry, BOOL bRight )
nLastCol = -1; // 0-1
}
- USHORT nRowMin = nY;
- USHORT nRowMax = nY;
+ sal_uInt16 nRowMin = nY;
+ sal_uInt16 nRowMax = nY;
do
{
- SvLBoxEntry* pEntry = SearchCol((USHORT)nCurCol,nRowMin,nRowMax,nY,TRUE, FALSE);
+ SvLBoxEntry* pEntry = SearchCol((sal_uInt16)nCurCol,nRowMin,nRowMax,nY,sal_True, sal_False);
if( pEntry )
return pEntry;
if( nRowMin )
@@ -3462,23 +3456,23 @@ SvLBoxEntry* ImpIcnCursor::GoLeftRight( SvLBoxEntry* pIcnEntry, BOOL bRight )
return 0;
}
-SvLBoxEntry* ImpIcnCursor::GoUpDown( SvLBoxEntry* pIcnEntry, BOOL bDown)
+SvLBoxEntry* ImpIcnCursor::GoUpDown( SvLBoxEntry* pIcnEntry, sal_Bool bDown)
{
SvLBoxEntry* pResult;
pCurEntry = pIcnEntry;
Create();
SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pIcnEntry);
- USHORT nY = pViewData->nY;
- USHORT nX = pViewData->nX;
+ sal_uInt16 nY = pViewData->nY;
+ sal_uInt16 nX = pViewData->nX;
DBG_ASSERT(nY<nRows,"GoUpDown:Bad column");
DBG_ASSERT(nX<nCols,"GoUpDown:Bad row");
// Nachbar in gleicher Spalte ?
if( bDown )
pResult = SearchCol(
- nX, nY, sal::static_int_cast< USHORT >(nRows-1), nY, TRUE, TRUE );
+ nX, nY, sal::static_int_cast< sal_uInt16 >(nRows-1), nY, sal_True, sal_True );
else
- pResult = SearchCol( nX, nY ,0, nY, FALSE, TRUE );
+ pResult = SearchCol( nX, nY ,0, nY, sal_False, sal_True );
if( pResult )
return pResult;
@@ -3496,11 +3490,11 @@ SvLBoxEntry* ImpIcnCursor::GoUpDown( SvLBoxEntry* pIcnEntry, BOOL bDown)
nLastRow = -1; // 0-1
}
- USHORT nColMin = nX;
- USHORT nColMax = nX;
+ sal_uInt16 nColMin = nX;
+ sal_uInt16 nColMax = nX;
do
{
- SvLBoxEntry* pEntry = SearchRow((USHORT)nCurRow,nColMin,nColMax,nX,TRUE, FALSE);
+ SvLBoxEntry* pEntry = SearchRow((sal_uInt16)nCurRow,nColMin,nColMax,nX,sal_True, sal_False);
if( pEntry )
return pEntry;
if( nColMin )
@@ -3548,26 +3542,26 @@ void ImpIcnCursor::SetDeltas()
}
}
-BOOL ImpIcnCursor::FindEmptyGridRect( Rectangle& rRect )
+sal_Bool ImpIcnCursor::FindEmptyGridRect( Rectangle& rRect )
{
CreateGridMap();
- USHORT nCount = (USHORT)(nGridCols * nGridRows);
+ sal_uInt16 nCount = (sal_uInt16)(nGridCols * nGridRows);
if( !nCount )
- return FALSE;
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ return sal_False;
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
if( !pGridMap[ nCur ] )
{
- USHORT nCol = (USHORT)(nCur % nGridCols);
- USHORT nRow = (USHORT)(nCur / nGridCols);
+ sal_uInt16 nCol = (sal_uInt16)(nCur % nGridCols);
+ sal_uInt16 nRow = (sal_uInt16)(nCur / nGridCols);
rRect.Top() = nRow * nGridDY + TBOFFS_WINBORDER;
rRect.Bottom() = rRect.Top() + nGridDY;
rRect.Left() = nCol * nGridDX+ LROFFS_WINBORDER;
rRect.Right() = rRect.Left() + nGridDX;
- SetGridUsed( nCol, nRow, TRUE );
+ SetGridUsed( nCol, nRow, sal_True );
DBG_ASSERT(pGridMap[nCur],"SetGridUsed failed");
- return TRUE;
+ return sal_True;
}
}
// Gridmap ist voll: Um eine Zeile erweitern
@@ -3575,19 +3569,19 @@ BOOL ImpIcnCursor::FindEmptyGridRect( Rectangle& rRect )
rRect.Bottom() = rRect.Top() + nGridDY;
rRect.Left() = LROFFS_WINBORDER;
rRect.Right() = rRect.Left() + nGridDX;
- return FALSE;
+ return sal_False;
}
void ImpIcnCursor::CreateGridAjustData( SvPtrarr& rLists, SvLBoxEntry* pRefEntry)
{
if( !pRefEntry )
{
- USHORT nAdjustRows = (USHORT)(pView->aVirtOutputSize.Height() / pView->nGridDY);
+ sal_uInt16 nAdjustRows = (sal_uInt16)(pView->aVirtOutputSize.Height() / pView->nGridDY);
nAdjustRows++; // wg. Abrundung!
if( !nAdjustRows )
return;
- for( USHORT nCurList = 0; nCurList < nAdjustRows; nCurList++ )
+ for( sal_uInt16 nCurList = 0; nCurList < nAdjustRows; nCurList++ )
{
SvPtrarr* pRow = new SvPtrarr;
rLists.Insert( (void*)pRow, nCurList );
@@ -3597,7 +3591,7 @@ void ImpIcnCursor::CreateGridAjustData( SvPtrarr& rLists, SvLBoxEntry* pRefEntry
{
const Rectangle& rRect = pView->GetBoundingRect( pEntry );
short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / pView->nGridDY );
- USHORT nIns = GetSortListPos((SvPtrarr*)rLists[nY],rRect.Left(),FALSE);
+ sal_uInt16 nIns = GetSortListPos((SvPtrarr*)rLists[nY],rRect.Left(),sal_False);
((SvPtrarr*)rLists[ nY ])->Insert( pEntry, nIns );
pEntry = pView->pModel->NextSibling( pEntry );
}
@@ -3621,7 +3615,7 @@ void ImpIcnCursor::CreateGridAjustData( SvPtrarr& rLists, SvLBoxEntry* pRefEntry
short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / pView->nGridDY );
if( nY == nRefRow )
{
- USHORT nIns = GetSortListPos( pRow, rRect.Left(), FALSE );
+ sal_uInt16 nIns = GetSortListPos( pRow, rRect.Left(), sal_False );
pRow->Insert( pEntry, nIns );
}
pEntry = pView->pModel->NextSibling( pEntry );
@@ -3632,8 +3626,8 @@ void ImpIcnCursor::CreateGridAjustData( SvPtrarr& rLists, SvLBoxEntry* pRefEntry
//static
void ImpIcnCursor::DestroyGridAdjustData( SvPtrarr& rLists )
{
- USHORT nCount = rLists.Count();
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ sal_uInt16 nCount = rLists.Count();
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
SvPtrarr* pArr = (SvPtrarr*)rLists[ nCur ];
delete pArr;
@@ -3690,7 +3684,7 @@ void SvImpIconView::Center( SvLBoxEntry* pEntry,
// Die Deltas entsprechen Offsets, um die die View auf dem Doc verschoben wird
// links, hoch: Offsets < 0
// rechts, runter: Offsets > 0
-void SvImpIconView::Scroll( long nDeltaX, long nDeltaY, BOOL bScrollBar )
+void SvImpIconView::Scroll( long nDeltaX, long nDeltaY, sal_Bool bScrollBar )
{
const MapMode& rMapMode = pView->GetMapMode();
Point aOrigin( rMapMode.GetOrigin() );
@@ -3728,7 +3722,7 @@ Rectangle SvImpIconView::CalcFocusRect( SvLBoxEntry* pEntry )
}
-void SvImpIconView::SelectRect( const Rectangle& rRect, BOOL bAdd,
+void SvImpIconView::SelectRect( const Rectangle& rRect, sal_Bool bAdd,
SvPtrarr* pOtherRects, short nBorderOffs )
{
if( !pZOrderList || !pZOrderList->Count() )
@@ -3736,7 +3730,7 @@ void SvImpIconView::SelectRect( const Rectangle& rRect, BOOL bAdd,
CheckBoundingRects();
pView->Update();
- USHORT nCount = pZOrderList->Count();
+ sal_uInt16 nCount = pZOrderList->Count();
Rectangle aRect( rRect );
aRect.Justify();
@@ -3747,9 +3741,9 @@ void SvImpIconView::SelectRect( const Rectangle& rRect, BOOL bAdd,
aRect.Top() -= nBorderOffs;
aRect.Bottom() += nBorderOffs;
}
- BOOL bCalcOverlap = (bAdd && pOtherRects && pOtherRects->Count()) ? TRUE : FALSE;
+ sal_Bool bCalcOverlap = (bAdd && pOtherRects && pOtherRects->Count()) ? sal_True : sal_False;
- for( USHORT nPos = 0; nPos < nCount; nPos++ )
+ for( sal_uInt16 nPos = 0; nPos < nCount; nPos++ )
{
SvLBoxEntry* pEntry = (SvLBoxEntry*)(pZOrderList->GetObject(nPos ));
@@ -3758,28 +3752,28 @@ void SvImpIconView::SelectRect( const Rectangle& rRect, BOOL bAdd,
if( !IsBoundingRectValid( pViewData->aRect ))
FindBoundingRect( pEntry, pViewData );
const Rectangle& rBoundRect = pViewData->aRect;
- BOOL bSelected = pViewData->IsSelected();
+ sal_Bool bSelected = pViewData->IsSelected();
- BOOL bOverlaps;
+ sal_Bool bOverlaps;
if( bCalcOverlap )
bOverlaps = IsOver( pOtherRects, rBoundRect );
else
- bOverlaps = FALSE;
- BOOL bOver = aRect.IsOver( rBoundRect );
+ bOverlaps = sal_False;
+ sal_Bool bOver = aRect.IsOver( rBoundRect );
if( bOver && !bOverlaps )
{
// Ist im neuen Selektionsrechteck und in keinem alten
// => selektieren
if( !bSelected )
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
}
else if( !bAdd )
{
// ist ausserhalb des Selektionsrechtecks
// => Selektion entfernen
if( bSelected )
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
}
else if( bAdd && bOverlaps )
{
@@ -3799,34 +3793,34 @@ void SvImpIconView::SelectRect( const Rectangle& rRect, BOOL bAdd,
{
// Schnittmenge zwischen alten Rects & aktuellem Rect desel.
if( bSelected )
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
}
else
{
// Eintrag eines alten Rects selektieren
if( !bSelected )
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
}
}
else if( !bOver && bSelected )
{
// Der Eintrag liegt voellig ausserhalb und wird deshalb desel.
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
}
}
pView->Update();
}
-BOOL SvImpIconView::IsOver( SvPtrarr* pRectList, const Rectangle& rBoundRect ) const
+sal_Bool SvImpIconView::IsOver( SvPtrarr* pRectList, const Rectangle& rBoundRect ) const
{
- USHORT nCount = pRectList->Count();
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ sal_uInt16 nCount = pRectList->Count();
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
Rectangle* pRect = (Rectangle*)pRectList->GetObject( nCur );
if( rBoundRect.IsOver( *pRect ))
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
void SvImpIconView::AddSelectedRect( const Rectangle& rRect, short nBorderOffs )
@@ -3845,8 +3839,8 @@ void SvImpIconView::AddSelectedRect( const Rectangle& rRect, short nBorderOffs )
void SvImpIconView::ClearSelectedRectList()
{
- USHORT nCount = aSelectedRectList.Count();
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ sal_uInt16 nCount = aSelectedRectList.Count();
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
Rectangle* pRect = (Rectangle*)aSelectedRectList.GetObject( nCur );
delete pRect;
@@ -3884,7 +3878,7 @@ void SvImpIconView::ImpDrawXORRect( const Rectangle& rRect )
}
void SvImpIconView::CalcScrollOffsets( const Point& rPosPixel,
- long& rX, long& rY, BOOL bInDragDrop, USHORT nBorderWidth)
+ long& rX, long& rY, sal_Bool bInDragDrop, sal_uInt16 nBorderWidth)
{
// Scrolling der View, falls sich der Mauszeiger im Grenzbereich des
// Fensters befindet
@@ -3892,8 +3886,8 @@ void SvImpIconView::CalcScrollOffsets( const Point& rPosPixel,
long nPixelToScrollY = 0;
Size aWndSize = aOutputSize;
- nBorderWidth = (USHORT)(Min( (long)(aWndSize.Height()-1), (long)nBorderWidth ));
- nBorderWidth = (USHORT)(Min( (long)(aWndSize.Width()-1), (long)nBorderWidth ));
+ nBorderWidth = (sal_uInt16)(Min( (long)(aWndSize.Height()-1), (long)nBorderWidth ));
+ nBorderWidth = (sal_uInt16)(Min( (long)(aWndSize.Width()-1), (long)nBorderWidth ));
if ( rPosPixel.X() < nBorderWidth )
{
@@ -3945,16 +3939,16 @@ void SvImpIconView::EndTracking()
}
}
-BOOL SvImpIconView::IsTextHit( SvLBoxEntry* pEntry, const Point& rDocPos )
+sal_Bool SvImpIconView::IsTextHit( SvLBoxEntry* pEntry, const Point& rDocPos )
{
SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
if( pItem )
{
Rectangle aRect( CalcTextRect( pEntry, pItem ));
if( aRect.IsInside( rDocPos ) )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
IMPL_LINK(SvImpIconView, EditTimeoutHdl, Timer*, EMPTYARG )
@@ -3979,8 +3973,8 @@ void SvImpIconView::AdjustAtGrid( SvLBoxEntry* pStart )
{
SvPtrarr aLists;
pImpCursor->CreateGridAjustData( aLists, pStart );
- USHORT nCount = aLists.Count();
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ sal_uInt16 nCount = aLists.Count();
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
AdjustAtGrid( *(SvPtrarr*)aLists[ nCur ], pStart );
}
@@ -3994,18 +3988,18 @@ void SvImpIconView::AdjustAtGrid( const SvPtrarr& rRow, SvLBoxEntry* pStart )
if( !rRow.Count() )
return;
- BOOL bGo;
+ sal_Bool bGo;
if( !pStart )
- bGo = TRUE;
+ bGo = sal_True;
else
- bGo = FALSE;
+ bGo = sal_False;
long nCurRight = 0;
- for( USHORT nCur = 0; nCur < rRow.Count(); nCur++ )
+ for( sal_uInt16 nCur = 0; nCur < rRow.Count(); nCur++ )
{
SvLBoxEntry* pCur = (SvLBoxEntry*)rRow[ nCur ];
if( !bGo && pCur == pStart )
- bGo = TRUE;
+ bGo = sal_True;
SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pCur);
// Massgebend (fuer das menschliche Auge) ist die Bitmap, da sonst
diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx
index 3fa940603aa4..a8b1a62bb4e6 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -43,20 +43,20 @@
struct SvLBoxButtonData_Impl
{
SvLBoxEntry* pEntry;
- BOOL bDefaultImages;
- BOOL bShowRadioButton;
+ sal_Bool bDefaultImages;
+ sal_Bool bShowRadioButton;
- SvLBoxButtonData_Impl() : pEntry( NULL ), bDefaultImages( FALSE ), bShowRadioButton( FALSE ) {}
+ SvLBoxButtonData_Impl() : pEntry( NULL ), bDefaultImages( sal_False ), bShowRadioButton( sal_False ) {}
};
DBG_NAME(SvLBoxButtonData)
-void SvLBoxButtonData::InitData( BOOL bImagesFromDefault, bool _bRadioBtn, const Control* pCtrl )
+void SvLBoxButtonData::InitData( sal_Bool bImagesFromDefault, bool _bRadioBtn, const Control* pCtrl )
{
pImpl = new SvLBoxButtonData_Impl;
- bDataOk = FALSE;
+ bDataOk = sal_False;
eState = SV_BUTTON_UNCHECKED;
pImpl->bDefaultImages = bImagesFromDefault;
pImpl->bShowRadioButton = ( _bRadioBtn != false );
@@ -69,21 +69,21 @@ SvLBoxButtonData::SvLBoxButtonData( const Control* pControlForSettings )
{
DBG_CTOR(SvLBoxButtonData,0);
- InitData( TRUE, false, pControlForSettings );
+ InitData( sal_True, false, pControlForSettings );
}
SvLBoxButtonData::SvLBoxButtonData( const Control* pControlForSettings, bool _bRadioBtn )
{
DBG_CTOR(SvLBoxButtonData,0);
- InitData( TRUE, _bRadioBtn, pControlForSettings );
+ InitData( sal_True, _bRadioBtn, pControlForSettings );
}
SvLBoxButtonData::SvLBoxButtonData()
{
DBG_CTOR(SvLBoxButtonData,0);
- InitData( FALSE, false );
+ InitData( sal_False, false );
}
SvLBoxButtonData::~SvLBoxButtonData()
@@ -102,11 +102,11 @@ void SvLBoxButtonData::CallLink()
aLink.Call( this );
}
-USHORT SvLBoxButtonData::GetIndex( USHORT nItemState )
+sal_uInt16 SvLBoxButtonData::GetIndex( sal_uInt16 nItemState )
{
DBG_CHKTHIS(SvLBoxButtonData,0);
nItemState &= 0x000F;
- USHORT nIdx;
+ sal_uInt16 nIdx;
switch( nItemState )
{
case SV_ITEMSTATE_UNCHECKED:
@@ -133,18 +133,18 @@ void SvLBoxButtonData::SetWidthAndHeight()
Size aSize = aBmps[0].GetSizePixel();
nWidth = aSize.Width();
nHeight = aSize.Height();
- bDataOk = TRUE;
+ bDataOk = sal_True;
}
-void SvLBoxButtonData::StoreButtonState( SvLBoxEntry* pActEntry, USHORT nItemFlags )
+void SvLBoxButtonData::StoreButtonState( SvLBoxEntry* pActEntry, sal_uInt16 nItemFlags )
{
DBG_CHKTHIS(SvLBoxButtonData,0);
pImpl->pEntry = pActEntry;
eState = ConvertToButtonState( nItemFlags );
}
-SvButtonState SvLBoxButtonData::ConvertToButtonState( USHORT nItemFlags ) const
+SvButtonState SvLBoxButtonData::ConvertToButtonState( sal_uInt16 nItemFlags ) const
{
DBG_CHKTHIS(SvLBoxButtonData,0);
nItemFlags &= (SV_ITEMSTATE_UNCHECKED |
@@ -195,12 +195,12 @@ void SvLBoxButtonData::SetDefaultImages( const Control* pCtrl )
}
}
-BOOL SvLBoxButtonData::HasDefaultImages( void ) const
+sal_Bool SvLBoxButtonData::HasDefaultImages( void ) const
{
return pImpl->bDefaultImages;
}
-BOOL SvLBoxButtonData::IsRadio() {
+sal_Bool SvLBoxButtonData::IsRadio() {
return pImpl->bShowRadioButton;
}
@@ -210,7 +210,7 @@ BOOL SvLBoxButtonData::IsRadio() {
DBG_NAME(SvLBoxString);
-SvLBoxString::SvLBoxString( SvLBoxEntry* pEntry,USHORT nFlags,const XubString& rStr) :
+SvLBoxString::SvLBoxString( SvLBoxEntry* pEntry,sal_uInt16 nFlags,const XubString& rStr) :
SvLBoxItem( pEntry, nFlags )
{
DBG_CTOR(SvLBoxString,0);
@@ -227,19 +227,19 @@ SvLBoxString::~SvLBoxString()
DBG_DTOR(SvLBoxString,0);
}
-USHORT SvLBoxString::IsA()
+sal_uInt16 SvLBoxString::IsA()
{
DBG_CHKTHIS(SvLBoxString,0);
return SV_ITEM_ID_LBOXSTRING;
}
-void SvLBoxString::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
+void SvLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */,
SvLBoxEntry* _pEntry)
{
DBG_CHKTHIS(SvLBoxString,0);
if ( _pEntry )
{
- USHORT nStyle = rDev.IsEnabled() ? 0 : TEXT_DRAW_DISABLE;
+ sal_uInt16 nStyle = rDev.IsEnabled() ? 0 : TEXT_DRAW_DISABLE;
if ( rDev.IsEntryMnemonicsEnabled() )
nStyle |= TEXT_DRAW_MNEMONIC;
rDev.DrawText( Rectangle(rPos,GetSize(&rDev,_pEntry)),aStr,nStyle);
@@ -282,7 +282,7 @@ void SvLBoxString::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
DBG_NAME(SvLBoxBmp);
-SvLBoxBmp::SvLBoxBmp( SvLBoxEntry* pEntry, USHORT nFlags, Image aBitmap ) :
+SvLBoxBmp::SvLBoxBmp( SvLBoxEntry* pEntry, sal_uInt16 nFlags, Image aBitmap ) :
SvLBoxItem( pEntry, nFlags )
{
DBG_CTOR(SvLBoxBmp,0);
@@ -299,7 +299,7 @@ SvLBoxBmp::~SvLBoxBmp()
DBG_DTOR(SvLBoxBmp,0);
}
-USHORT SvLBoxBmp::IsA()
+sal_uInt16 SvLBoxBmp::IsA()
{
DBG_CHKTHIS(SvLBoxBmp,0);
return SV_ITEM_ID_LBOXBMP;
@@ -320,11 +320,11 @@ void SvLBoxBmp::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
pViewData->aSize = aBmp.GetSizePixel();
}
-void SvLBoxBmp::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
+void SvLBoxBmp::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */,
SvLBoxEntry* )
{
DBG_CHKTHIS(SvLBoxBmp,0);
- USHORT nStyle = rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE;
+ sal_uInt16 nStyle = rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE;
rDev.DrawImage( rPos, aBmp ,nStyle);
}
@@ -347,7 +347,7 @@ void SvLBoxBmp::Clone( SvLBoxItem* pSource )
DBG_NAME(SvLBoxButton);
SvLBoxButton::SvLBoxButton( SvLBoxEntry* pEntry, SvLBoxButtonKind eTheKind,
- USHORT nFlags, SvLBoxButtonData* pBData )
+ sal_uInt16 nFlags, SvLBoxButtonData* pBData )
: SvLBoxItem( pEntry, nFlags )
{
DBG_CTOR(SvLBoxButton,0);
@@ -371,13 +371,13 @@ SvLBoxButton::~SvLBoxButton()
DBG_DTOR(SvLBoxButton,0);
}
-USHORT SvLBoxButton::IsA()
+sal_uInt16 SvLBoxButton::IsA()
{
DBG_CHKTHIS(SvLBoxButton,0);
return SV_ITEM_ID_LBOXBUTTON;
}
-void SvLBoxButton::Check(SvLBox*, SvLBoxEntry*, BOOL bOn)
+void SvLBoxButton::Check(SvLBox*, SvLBoxEntry*, sal_Bool bOn)
{
DBG_CHKTHIS(SvLBoxButton,0);
if ( bOn != IsStateChecked() )
@@ -389,7 +389,7 @@ void SvLBoxButton::Check(SvLBox*, SvLBoxEntry*, BOOL bOn)
}
}
-BOOL SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry )
+sal_Bool SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry )
{
DBG_CHKTHIS(SvLBoxButton,0);
if ( CheckModification() )
@@ -401,30 +401,30 @@ BOOL SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry )
pData->StoreButtonState( pEntry, nItemFlags );
pData->CallLink();
}
- return FALSE;
+ return sal_False;
}
-void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
- SvLBoxEntry* )
+void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */,
+ SvLBoxEntry* /*pEntry*/ )
{
DBG_CHKTHIS(SvLBoxButton,0);
- USHORT nIndex = eKind == SvLBoxButtonKind_staticImage
+ sal_uInt16 nIndex = eKind == SvLBoxButtonKind_staticImage
? SV_BMP_STATICIMAGE : pData->GetIndex( nItemFlags );
- USHORT nStyle = eKind != SvLBoxButtonKind_disabledCheckbox &&
+ sal_uInt16 nStyle = eKind != SvLBoxButtonKind_disabledCheckbox &&
rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE;
///
//Native drawing
///
- BOOL bNativeOK = FALSE;
- Window *pWin = NULL;
- if( rDev.GetOutDevType() == OUTDEV_WINDOW )
- pWin = (Window*) &rDev;
+ sal_Bool bNativeOK = sal_False;
+ ControlType eCtrlType = (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX;
+ if ( nIndex != SV_BMP_STATICIMAGE && rDev.IsNativeControlSupported( eCtrlType, PART_ENTIRE_CONTROL) )
- if ( nIndex != SV_BMP_STATICIMAGE && pWin && pWin->IsNativeControlSupported( (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX, PART_ENTIRE_CONTROL) )
{
+ Size aSize(pData->Width(), pData->Height());
+ ImplAdjustBoxSize( aSize, eCtrlType, &rDev );
ImplControlValue aControlValue;
- Rectangle aCtrlRegion( rPos, Size(pData->Width(), pData->Height()) );
+ Rectangle aCtrlRegion( rPos, aSize );
ControlState nState = 0;
//states CTRL_STATE_DEFAULT, CTRL_STATE_PRESSED and CTRL_STATE_ROLLOVER are not implemented
@@ -438,8 +438,8 @@ void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
else if ( IsStateTristate() )
aControlValue.setTristateVal( BUTTONVALUE_MIXED );
- bNativeOK = pWin->DrawNativeControl( (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX, PART_ENTIRE_CONTROL,
- aCtrlRegion, nState, aControlValue, rtl::OUString() );
+ bNativeOK = rDev.DrawNativeControl( eCtrlType, PART_ENTIRE_CONTROL,
+ aCtrlRegion, nState, aControlValue, rtl::OUString() );
}
if( !bNativeOK)
@@ -458,13 +458,47 @@ void SvLBoxButton::Clone( SvLBoxItem* pSource )
pData = ((SvLBoxButton*)pSource)->pData;
}
+void SvLBoxButton::ImplAdjustBoxSize( Size& io_rSize, ControlType i_eType, Window* i_pParent )
+{
+ if ( i_pParent->IsNativeControlSupported( i_eType, PART_ENTIRE_CONTROL) )
+ {
+ ImplControlValue aControlValue;
+ Rectangle aCtrlRegion( Point( 0, 0 ), io_rSize );
+ ControlState nState = CTRL_STATE_ENABLED;
+
+ aControlValue.setTristateVal( BUTTONVALUE_ON );
+
+ Rectangle aNativeBounds, aNativeContent;
+ bool bNativeOK = i_pParent->GetNativeControlRegion( i_eType,
+ PART_ENTIRE_CONTROL,
+ aCtrlRegion,
+ nState,
+ aControlValue,
+ rtl::OUString(),
+ aNativeBounds,
+ aNativeContent );
+ if( bNativeOK )
+ {
+ Size aContentSize( aNativeContent.GetSize() );
+ // leave a little space around the box image (looks better
+ if( aContentSize.Height() + 2 > io_rSize.Height() )
+ io_rSize.Height() = aContentSize.Height() + 2;
+ }
+ }
+}
+
void SvLBoxButton::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
SvViewDataItem* pViewData )
{
DBG_CHKTHIS(SvLBoxButton,0);
if( !pViewData )
pViewData = pView->GetViewDataItem( pEntry, this );
- pViewData->aSize = Size( pData->Width(), pData->Height() );
+ Size aSize( pData->Width(), pData->Height() );
+
+ ControlType eCtrlType = (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX;
+ if ( eKind != SvLBoxButtonKind_staticImage && pView )
+ ImplAdjustBoxSize( aSize, eCtrlType, pView );
+ pViewData->aSize = aSize;
}
bool SvLBoxButton::CheckModification() const
@@ -483,14 +517,14 @@ struct SvLBoxContextBmp_Impl
Image m_aImage1;
Image m_aImage2;
- USHORT m_nB2IndicatorFlags;
+ sal_uInt16 m_nB2IndicatorFlags;
};
// ***************************************************************
DBG_NAME(SvLBoxContextBmp)
-SvLBoxContextBmp::SvLBoxContextBmp( SvLBoxEntry* pEntry, USHORT nItemFlags,
- Image aBmp1, Image aBmp2, USHORT nEntryFlags )
+SvLBoxContextBmp::SvLBoxContextBmp( SvLBoxEntry* pEntry, sal_uInt16 nItemFlags,
+ Image aBmp1, Image aBmp2, sal_uInt16 nEntryFlags )
:SvLBoxItem( pEntry, nItemFlags )
,m_pImpl( new SvLBoxContextBmp_Impl )
{
@@ -514,13 +548,13 @@ SvLBoxContextBmp::~SvLBoxContextBmp()
DBG_DTOR(SvLBoxContextBmp,0);
}
-USHORT SvLBoxContextBmp::IsA()
+sal_uInt16 SvLBoxContextBmp::IsA()
{
DBG_CHKTHIS(SvLBoxContextBmp,0);
return SV_ITEM_ID_LBOXCONTEXTBMP;
}
-BOOL SvLBoxContextBmp::SetModeImages( const Image& _rBitmap1, const Image& _rBitmap2 )
+sal_Bool SvLBoxContextBmp::SetModeImages( const Image& _rBitmap1, const Image& _rBitmap2 )
{
DBG_CHKTHIS(SvLBoxContextBmp,0);
@@ -548,7 +582,7 @@ void SvLBoxContextBmp::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
}
void SvLBoxContextBmp::Paint( const Point& _rPos, SvLBox& _rDev,
- USHORT _nViewDataEntryFlags, SvLBoxEntry* _pEntry )
+ sal_uInt16 _nViewDataEntryFlags, SvLBoxEntry* _pEntry )
{
DBG_CHKTHIS(SvLBoxContextBmp,0);
@@ -557,7 +591,7 @@ void SvLBoxContextBmp::Paint( const Point& _rPos, SvLBox& _rDev,
sal_Bool _bSemiTransparent = _pEntry && ( 0 != ( SV_ENTRYFLAG_SEMITRANSPARENT & _pEntry->GetFlags( ) ) );
// draw
- USHORT nStyle = _rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE;
+ sal_uInt16 nStyle = _rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE;
if ( _bSemiTransparent )
nStyle |= IMAGE_DRAW_SEMITRANSPARENT;
_rDev.DrawImage( _rPos, rImage, nStyle);
diff --git a/svtools/source/contnr/svlbox.cxx b/svtools/source/contnr/svlbox.cxx
index 67b20b3108c5..94e26128bb22 100644
--- a/svtools/source/contnr/svlbox.cxx
+++ b/svtools/source/contnr/svlbox.cxx
@@ -32,7 +32,7 @@
/*
Todo:
- Anker loeschen in SelectionEngine bei manuellem Selektieren
- - SelectAll( FALSE ), nur die deselektierten Entries repainten
+ - SelectAll( sal_False ), nur die deselektierten Entries repainten
*/
#include <string.h>
@@ -76,14 +76,14 @@ SvInplaceEdit::SvInplaceEdit
Edit( pParent, WB_LEFT ),
aCallBackHdl ( rNotifyEditEnd ),
- bCanceled ( FALSE ),
- bAlreadyInCallBack ( FALSE )
+ bCanceled ( sal_False ),
+ bAlreadyInCallBack ( sal_False )
{
DBG_CTOR(SvInplaceEdit,0);
Font aFont( pParent->GetFont() );
- aFont.SetTransparent( FALSE );
+ aFont.SetTransparent( sal_False );
Color aColor( pParent->GetBackground().GetColor() );
aFont.SetFillColor(aColor );
SetFont( aFont );
@@ -119,7 +119,7 @@ SvInplaceEdit::~SvInplaceEdit()
IMPL_LINK_INLINE_START( SvInplaceEdit, ReturnHdl_Impl, Accelerator *, EMPTYARG )
{
DBG_CHKTHIS(SvInplaceEdit,0);
- bCanceled = FALSE;
+ bCanceled = sal_False;
CallCallBackHdl_Impl();
return 1;
}
@@ -128,7 +128,7 @@ IMPL_LINK_INLINE_END( SvInplaceEdit, ReturnHdl_Impl, Accelerator *, EMPTYARG )
IMPL_LINK_INLINE_START( SvInplaceEdit, EscapeHdl_Impl, Accelerator *, EMPTYARG )
{
DBG_CHKTHIS(SvInplaceEdit,0);
- bCanceled = TRUE;
+ bCanceled = sal_True;
CallCallBackHdl_Impl();
return 1;
}
@@ -137,16 +137,16 @@ IMPL_LINK_INLINE_END( SvInplaceEdit, EscapeHdl_Impl, Accelerator *, EMPTYARG )
void SvInplaceEdit::KeyInput( const KeyEvent& rKEvt )
{
DBG_CHKTHIS(SvInplaceEdit,0);
- USHORT nCode = rKEvt.GetKeyCode().GetCode();
+ sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
switch ( nCode )
{
case KEY_ESCAPE:
- bCanceled = TRUE;
+ bCanceled = sal_True;
CallCallBackHdl_Impl();
break;
case KEY_RETURN:
- bCanceled = FALSE;
+ bCanceled = sal_False;
CallCallBackHdl_Impl();
break;
@@ -155,7 +155,7 @@ void SvInplaceEdit::KeyInput( const KeyEvent& rKEvt )
}
}
-void SvInplaceEdit::StopEditing( BOOL bCancel )
+void SvInplaceEdit::StopEditing( sal_Bool bCancel )
{
DBG_CHKTHIS(SvInplaceEdit,0);
if ( !bAlreadyInCallBack )
@@ -170,7 +170,7 @@ void SvInplaceEdit::LoseFocus()
DBG_CHKTHIS(SvInplaceEdit,0);
if ( !bAlreadyInCallBack )
{
- bCanceled = FALSE;
+ bCanceled = sal_False;
aTimer.SetTimeout(10);
aTimer.SetTimeoutHdl(LINK(this,SvInplaceEdit,Timeout_Impl));
aTimer.Start();
@@ -191,12 +191,12 @@ void SvInplaceEdit::CallCallBackHdl_Impl()
aTimer.Stop();
if ( !bAlreadyInCallBack )
{
- bAlreadyInCallBack = TRUE;
+ bAlreadyInCallBack = sal_True;
GetpApp()->RemoveAccel( &aAccReturn );
GetpApp()->RemoveAccel( &aAccEscape );
Hide();
aCallBackHdl.Call( this );
- // bAlreadyInCallBack = FALSE;
+ // bAlreadyInCallBack = sal_False;
}
}
@@ -267,12 +267,12 @@ SvInplaceEdit2::SvInplaceEdit2
const String& rData,
const Link& rNotifyEditEnd,
const Selection& rSelection,
- BOOL bMulti
+ sal_Bool bMulti
) :
aCallBackHdl ( rNotifyEditEnd ),
- bCanceled ( FALSE ),
- bAlreadyInCallBack ( FALSE ),
+ bCanceled ( sal_False ),
+ bAlreadyInCallBack ( sal_False ),
bMultiLine ( bMulti )
{
@@ -284,7 +284,7 @@ SvInplaceEdit2::SvInplaceEdit2
pEdit = new MyEdit_Impl( pParent, this );
Font aFont( pParent->GetFont() );
- aFont.SetTransparent( FALSE );
+ aFont.SetTransparent( sal_False );
Color aColor( pParent->GetBackground().GetColor() );
aFont.SetFillColor(aColor );
pEdit->SetFont( aFont );
@@ -332,7 +332,7 @@ void SvInplaceEdit2::Hide()
IMPL_LINK_INLINE_START( SvInplaceEdit2, ReturnHdl_Impl, Accelerator *, EMPTYARG )
{
DBG_CHKTHIS(SvInplaceEdit2,0);
- bCanceled = FALSE;
+ bCanceled = sal_False;
CallCallBackHdl_Impl();
return 1;
}
@@ -341,35 +341,35 @@ IMPL_LINK_INLINE_END( SvInplaceEdit2, ReturnHdl_Impl, Accelerator *, EMPTYARG )
IMPL_LINK_INLINE_START( SvInplaceEdit2, EscapeHdl_Impl, Accelerator *, EMPTYARG )
{
DBG_CHKTHIS(SvInplaceEdit2,0);
- bCanceled = TRUE;
+ bCanceled = sal_True;
CallCallBackHdl_Impl();
return 1;
}
IMPL_LINK_INLINE_END( SvInplaceEdit2, EscapeHdl_Impl, Accelerator *, EMPTYARG )
-BOOL SvInplaceEdit2::KeyInput( const KeyEvent& rKEvt )
+sal_Bool SvInplaceEdit2::KeyInput( const KeyEvent& rKEvt )
{
DBG_CHKTHIS(SvInplaceEdit2,0);
KeyCode aCode = rKEvt.GetKeyCode();
- USHORT nCode = aCode.GetCode();
+ sal_uInt16 nCode = aCode.GetCode();
switch ( nCode )
{
case KEY_ESCAPE:
- bCanceled = TRUE;
+ bCanceled = sal_True;
CallCallBackHdl_Impl();
- return TRUE;
+ return sal_True;
case KEY_RETURN:
- bCanceled = FALSE;
+ bCanceled = sal_False;
CallCallBackHdl_Impl();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-void SvInplaceEdit2::StopEditing( BOOL bCancel )
+void SvInplaceEdit2::StopEditing( sal_Bool bCancel )
{
DBG_CHKTHIS(SvInplaceEdit2,0);
if ( !bAlreadyInCallBack )
@@ -386,7 +386,7 @@ void SvInplaceEdit2::LoseFocus()
&& ((!Application::GetFocusWindow()) || !pEdit->IsChild( Application::GetFocusWindow()) )
)
{
- bCanceled = FALSE;
+ bCanceled = sal_False;
aTimer.SetTimeout(10);
aTimer.SetTimeoutHdl(LINK(this,SvInplaceEdit2,Timeout_Impl));
aTimer.Start();
@@ -407,7 +407,7 @@ void SvInplaceEdit2::CallCallBackHdl_Impl()
aTimer.Stop();
if ( !bAlreadyInCallBack )
{
- bAlreadyInCallBack = TRUE;
+ bAlreadyInCallBack = sal_True;
GetpApp()->RemoveAccel( &aAccReturn );
GetpApp()->RemoveAccel( &aAccEscape );
pEdit->Hide();
@@ -434,7 +434,7 @@ SvLBoxTab::SvLBoxTab()
nFlags = 0;
}
-SvLBoxTab::SvLBoxTab( long nPosition, USHORT nTabFlags )
+SvLBoxTab::SvLBoxTab( long nPosition, sal_uInt16 nTabFlags )
{
DBG_CTOR(SvLBoxTab,0);
nPos = nPosition;
@@ -493,7 +493,7 @@ long SvLBoxTab::CalcOffset( const String& rStr, const OutputDevice& rOutDev )
long nWidth;
if ( nFlags & SV_LBOXTAB_ADJUST_NUMERIC )
{
- USHORT nPos = rStr.Search( '.' );
+ sal_uInt16 nPos = rStr.Search( '.' );
if ( nPos == STRING_NOTFOUND )
nPos = rStr.Search( ',' );
if ( nPos == STRING_NOTFOUND )
@@ -517,7 +517,7 @@ long SvLBoxTab::CalcOffset( const String& rStr, const OutputDevice& rOutDev )
DBG_NAME(SvLBoxItem);
-SvLBoxItem::SvLBoxItem( SvLBoxEntry*, USHORT )
+SvLBoxItem::SvLBoxItem( SvLBoxEntry*, sal_uInt16 )
{
DBG_CTOR(SvLBoxItem,0);
}
@@ -542,7 +542,7 @@ const Size& SvLBoxItem::GetSize( SvLBox* pView,SvLBoxEntry* pEntry )
const Size& SvLBoxItem::GetSize( SvLBoxEntry* pEntry, SvViewDataEntry* pViewData)
{
DBG_CHKTHIS(SvLBoxItem,0);
- USHORT nItemPos = pEntry->GetPos( this );
+ sal_uInt16 nItemPos = pEntry->GetPos( this );
SvViewDataItem* pItemData = pViewData->pItemData+nItemPos;
return pItemData->aSize;
}
@@ -583,7 +583,7 @@ SvLBoxEntry::~SvLBoxEntry()
void SvLBoxEntry::DeleteItems_Impl()
{
DBG_CHKTHIS(SvLBoxEntry,0);
- USHORT nCount = aItems.Count();
+ sal_uInt16 nCount = aItems.Count();
while( nCount )
{
nCount--;
@@ -606,8 +606,8 @@ void SvLBoxEntry::Clone( SvListEntry* pSource )
SvListEntry::Clone( pSource );
SvLBoxItem* pNewItem;
DeleteItems_Impl();
- USHORT nCount = ((SvLBoxEntry*)pSource)->ItemCount();
- USHORT nCurPos = 0;
+ sal_uInt16 nCount = ((SvLBoxEntry*)pSource)->ItemCount();
+ sal_uInt16 nCurPos = 0;
while( nCurPos < nCount )
{
SvLBoxItem* pItem = ((SvLBoxEntry*)pSource)->GetItem( nCurPos );
@@ -620,7 +620,7 @@ void SvLBoxEntry::Clone( SvListEntry* pSource )
nEntryFlags = ((SvLBoxEntry*)pSource)->nEntryFlags;
}
-void SvLBoxEntry::EnableChildsOnDemand( BOOL bEnable )
+void SvLBoxEntry::EnableChildsOnDemand( sal_Bool bEnable )
{
DBG_CHKTHIS(SvLBoxEntry,0);
if ( bEnable )
@@ -629,7 +629,7 @@ void SvLBoxEntry::EnableChildsOnDemand( BOOL bEnable )
nEntryFlags &= (~SV_ENTRYFLAG_CHILDS_ON_DEMAND);
}
-void SvLBoxEntry::ReplaceItem( SvLBoxItem* pNewItem, USHORT nPos )
+void SvLBoxEntry::ReplaceItem( SvLBoxItem* pNewItem, sal_uInt16 nPos )
{
DBG_CHKTHIS(SvLBoxEntry,0);
DBG_ASSERT(pNewItem,"ReplaceItem:No Item");
@@ -642,10 +642,10 @@ void SvLBoxEntry::ReplaceItem( SvLBoxItem* pNewItem, USHORT nPos )
}
}
-SvLBoxItem* SvLBoxEntry::GetFirstItem( USHORT nId )
+SvLBoxItem* SvLBoxEntry::GetFirstItem( sal_uInt16 nId )
{
- USHORT nCount = aItems.Count();
- USHORT nCur = 0;
+ sal_uInt16 nCount = aItems.Count();
+ sal_uInt16 nCur = 0;
SvLBoxItem* pItem;
while( nCur < nCount )
{
@@ -684,6 +684,7 @@ SvLBox_Impl::SvLBox_Impl( SvLBox& _rBox )
,m_bEntryMnemonicsEnabled( false )
,m_pLink( NULL )
,m_aMnemonicEngine( _rBox )
+ ,m_aQuickSelectionEngine( _rBox )
{
}
@@ -698,7 +699,6 @@ SvLBox::SvLBox( Window* pParent, WinBits nWinStyle ) :
DropTargetHelper( this ), DragSourceHelper( this ), eSelMode( NO_SELECTION )
{
DBG_CTOR(SvLBox,0);
- nWindowStyle = nWinStyle;
nDragOptions = DND_ACTION_COPYMOVE | DND_ACTION_LINK;
nImpFlags = 0;
pTargetEntry = 0;
@@ -723,7 +723,6 @@ SvLBox::SvLBox( Window* pParent, const ResId& rResId ) :
DBG_CTOR(SvLBox,0);
pTargetEntry = 0;
nImpFlags = 0;
- nWindowStyle = 0;
pLBoxImpl = new SvLBox_Impl( *this );
nDragOptions = DND_ACTION_COPYMOVE | DND_ACTION_LINK;
nDragDropMode = 0;
@@ -801,7 +800,7 @@ bool SvLBox::IsEntryMnemonicsEnabled() const
return pLBoxImpl->m_bEntryMnemonicsEnabled;
}
-USHORT SvLBox::IsA()
+sal_uInt16 SvLBox::IsA()
{
DBG_CHKTHIS(SvLBox,0);
return SVLISTBOX_ID_LBOX;
@@ -814,17 +813,17 @@ IMPL_LINK_INLINE_START( SvLBox, CloneHdl_Impl, SvListEntry*, pEntry )
}
IMPL_LINK_INLINE_END( SvLBox, CloneHdl_Impl, SvListEntry*, pEntry )
-ULONG SvLBox::Insert( SvLBoxEntry* pEntry, SvLBoxEntry* pParent, ULONG nPos )
+sal_uLong SvLBox::Insert( SvLBoxEntry* pEntry, SvLBoxEntry* pParent, sal_uLong nPos )
{
DBG_CHKTHIS(SvLBox,0);
- ULONG nInsPos = pModel->Insert( pEntry, pParent, nPos );
+ sal_uLong nInsPos = pModel->Insert( pEntry, pParent, nPos );
return nInsPos;
}
-ULONG SvLBox::Insert( SvLBoxEntry* pEntry,ULONG nRootPos )
+sal_uLong SvLBox::Insert( SvLBoxEntry* pEntry,sal_uLong nRootPos )
{
DBG_CHKTHIS(SvLBox,0);
- ULONG nInsPos = pModel->Insert( pEntry, nRootPos );
+ sal_uLong nInsPos = pModel->Insert( pEntry, nRootPos );
return nInsPos;
}
@@ -852,48 +851,48 @@ void SvLBox::DeselectHdl()
aDeselectHdl.Call( this );
}
-BOOL SvLBox::DoubleClickHdl()
+sal_Bool SvLBox::DoubleClickHdl()
{
DBG_CHKTHIS(SvLBox,0);
aDoubleClickHdl.Call( this );
- return TRUE;
+ return sal_True;
}
-BOOL SvLBox::CheckDragAndDropMode( SvLBox* pSource, sal_Int8 nAction )
+sal_Bool SvLBox::CheckDragAndDropMode( SvLBox* pSource, sal_Int8 nAction )
{
DBG_CHKTHIS(SvLBox,0);
if ( pSource == this )
{
if ( !(nDragDropMode & (SV_DRAGDROP_CTRL_MOVE | SV_DRAGDROP_CTRL_COPY) ) )
- return FALSE; // D&D innerhalb der Liste gesperrt
+ return sal_False; // D&D innerhalb der Liste gesperrt
if( DND_ACTION_MOVE == nAction )
{
if ( !(nDragDropMode & SV_DRAGDROP_CTRL_MOVE) )
- return FALSE; // kein lokales Move
+ return sal_False; // kein lokales Move
}
else
{
if ( !(nDragDropMode & SV_DRAGDROP_CTRL_COPY))
- return FALSE; // kein lokales Copy
+ return sal_False; // kein lokales Copy
}
}
else
{
if ( !(nDragDropMode & SV_DRAGDROP_APP_DROP ) )
- return FALSE; // kein Drop
+ return sal_False; // kein Drop
if ( DND_ACTION_MOVE == nAction )
{
if ( !(nDragDropMode & SV_DRAGDROP_APP_MOVE) )
- return FALSE; // kein globales Move
+ return sal_False; // kein globales Move
}
else
{
if ( !(nDragDropMode & SV_DRAGDROP_APP_COPY))
- return FALSE; // kein globales Copy
+ return sal_False; // kein globales Copy
}
}
- return TRUE;
+ return sal_True;
}
@@ -919,19 +918,19 @@ void SvLBox::NotifyRemoving( SvLBoxEntry* )
- Entry wird an das Ende der Target-Childlist gehaengt
*/
#ifdef DBG_UTIL
-BOOL SvLBox::NotifyMoving(
+sal_Bool SvLBox::NotifyMoving(
SvLBoxEntry* pTarget, // D&D-Drop-Position in this->GetModel()
SvLBoxEntry* pEntry, // Zu verschiebender Entry aus
// GetSourceListBox()->GetModel()
SvLBoxEntry*& rpNewParent, // Neuer Target-Parent
- ULONG& rNewChildPos) // Position in Childlist des Target-Parents
+ sal_uLong& rNewChildPos) // Position in Childlist des Target-Parents
#else
-BOOL SvLBox::NotifyMoving(
+sal_Bool SvLBox::NotifyMoving(
SvLBoxEntry* pTarget, // D&D-Drop-Position in this->GetModel()
SvLBoxEntry*, // Zu verschiebender Entry aus
// GetSourceListBox()->GetModel()
SvLBoxEntry*& rpNewParent, // Neuer Target-Parent
- ULONG& rNewChildPos) // Position in Childlist des Target-Parents
+ sal_uLong& rNewChildPos) // Position in Childlist des Target-Parents
#endif
{
DBG_CHKTHIS(SvLBox,0);
@@ -940,7 +939,7 @@ BOOL SvLBox::NotifyMoving(
{
rpNewParent = 0;
rNewChildPos = 0;
- return TRUE;
+ return sal_True;
}
if ( !pTarget->HasChilds() && !pTarget->HasChildsOnDemand() )
{
@@ -959,15 +958,15 @@ BOOL SvLBox::NotifyMoving(
else
rNewChildPos = LIST_APPEND;
}
- return TRUE;
+ return sal_True;
}
-BOOL SvLBox::NotifyCopying(
+sal_Bool SvLBox::NotifyCopying(
SvLBoxEntry* pTarget, // D&D-Drop-Position in this->GetModel()
SvLBoxEntry* pEntry, // Zu kopierender Entry aus
// GetSourceListBox()->GetModel()
SvLBoxEntry*& rpNewParent, // Neuer Target-Parent
- ULONG& rNewChildPos) // Position in Childlist des Target-Parents
+ sal_uLong& rNewChildPos) // Position in Childlist des Target-Parents
{
DBG_CHKTHIS(SvLBox,0);
return NotifyMoving(pTarget,pEntry,rpNewParent,rNewChildPos);
@@ -977,7 +976,7 @@ BOOL SvLBox::NotifyCopying(
{
rpNewParent = 0;
rNewChildPos = 0;
- return TRUE;
+ return sal_True;
}
if ( !pTarget->HasChilds() && !pTarget->HasChildsOnDemand() )
{
@@ -994,7 +993,7 @@ BOOL SvLBox::NotifyCopying(
else
rNewChildPos = LIST_APPEND;
}
- return TRUE;
+ return sal_True;
*/
}
@@ -1008,13 +1007,13 @@ SvLBoxEntry* SvLBox::CloneEntry( SvLBoxEntry* pSource )
// Rueckgabe: Alle Entries wurden kopiert
-BOOL SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget )
+sal_Bool SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget )
{
DBG_CHKTHIS(SvLBox,0);
nCurEntrySelPos = 0; // Selektionszaehler fuer NotifyMoving/Copying
- BOOL bSuccess = TRUE;
+ sal_Bool bSuccess = sal_True;
SvTreeEntryList aList;
- BOOL bClone = (BOOL)( (ULONG)(pSource->GetModel()) != (ULONG)GetModel() );
+ sal_Bool bClone = (sal_Bool)( (sal_uLong)(pSource->GetModel()) != (sal_uLong)GetModel() );
Link aCloneLink( pModel->GetCloneLink() );
pModel->SetCloneLink( LINK(this, SvLBox, CloneHdl_Impl ));
@@ -1025,7 +1024,7 @@ BOOL SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget )
while ( pSourceEntry )
{
// Childs werden automatisch mitkopiert
- pSource->SelectChilds( pSourceEntry, FALSE );
+ pSource->SelectChilds( pSourceEntry, sal_False );
aList.Insert( pSourceEntry, LIST_APPEND );
pSourceEntry = pSource->NextSelected( pSourceEntry );
}
@@ -1034,13 +1033,13 @@ BOOL SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget )
while ( pSourceEntry )
{
SvLBoxEntry* pNewParent = 0;
- ULONG nInsertionPos = LIST_APPEND;
- BOOL bOk=NotifyCopying(pTarget,pSourceEntry,pNewParent,nInsertionPos);
+ sal_uLong nInsertionPos = LIST_APPEND;
+ sal_Bool bOk=NotifyCopying(pTarget,pSourceEntry,pNewParent,nInsertionPos);
if ( bOk )
{
if ( bClone )
{
- ULONG nCloneCount = 0;
+ sal_uLong nCloneCount = 0;
pSourceEntry = (SvLBoxEntry*)
pModel->Clone( (SvListEntry*)pSourceEntry, nCloneCount );
pModel->InsertTree( (SvListEntry*)pSourceEntry,
@@ -1048,15 +1047,15 @@ BOOL SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget )
}
else
{
- ULONG nListPos = pModel->Copy( (SvListEntry*)pSourceEntry,
+ sal_uLong nListPos = pModel->Copy( (SvListEntry*)pSourceEntry,
(SvListEntry*)pNewParent, nInsertionPos );
pSourceEntry = GetEntry( pNewParent, nListPos );
}
}
else
- bSuccess = FALSE;
+ bSuccess = sal_False;
- if( bOk == (BOOL)2 ) // !!!HACK verschobenen Entry sichtbar machen?
+ if( bOk == (sal_Bool)2 ) // !!!HACK verschobenen Entry sichtbar machen?
MakeVisible( pSourceEntry );
pSourceEntry = (SvLBoxEntry*)aList.Next();
@@ -1066,18 +1065,18 @@ BOOL SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget )
}
// Rueckgabe: Alle Entries wurden verschoben
-BOOL SvLBox::MoveSelection( SvLBox* pSource, SvLBoxEntry* pTarget )
+sal_Bool SvLBox::MoveSelection( SvLBox* pSource, SvLBoxEntry* pTarget )
{
return MoveSelectionCopyFallbackPossible( pSource, pTarget, sal_False );
}
-BOOL SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pTarget, sal_Bool bAllowCopyFallback )
+sal_Bool SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pTarget, sal_Bool bAllowCopyFallback )
{
DBG_CHKTHIS(SvLBox,0);
nCurEntrySelPos = 0; // Selektionszaehler fuer NotifyMoving/Copying
- BOOL bSuccess = TRUE;
+ sal_Bool bSuccess = sal_True;
SvTreeEntryList aList;
- BOOL bClone = (BOOL)( (ULONG)(pSource->GetModel()) != (ULONG)GetModel() );
+ sal_Bool bClone = (sal_Bool)( (sal_uLong)(pSource->GetModel()) != (sal_uLong)GetModel() );
Link aCloneLink( pModel->GetCloneLink() );
if ( bClone )
pModel->SetCloneLink( LINK(this, SvLBox, CloneHdl_Impl ));
@@ -1086,7 +1085,7 @@ BOOL SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pT
while ( pSourceEntry )
{
// Childs werden automatisch mitbewegt
- pSource->SelectChilds( pSourceEntry, FALSE );
+ pSource->SelectChilds( pSourceEntry, sal_False );
aList.Insert( pSourceEntry, LIST_APPEND );
pSourceEntry = pSource->NextSelected( pSourceEntry );
}
@@ -1095,7 +1094,7 @@ BOOL SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pT
while ( pSourceEntry )
{
SvLBoxEntry* pNewParent = 0;
- ULONG nInsertionPos = LIST_APPEND;
+ sal_uLong nInsertionPos = LIST_APPEND;
sal_Bool bOk = NotifyMoving(pTarget,pSourceEntry,pNewParent,nInsertionPos);
sal_Bool bCopyOk = bOk;
if ( !bOk && bAllowCopyFallback )
@@ -1108,7 +1107,7 @@ BOOL SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pT
{
if ( bClone )
{
- ULONG nCloneCount = 0;
+ sal_uLong nCloneCount = 0;
pSourceEntry = (SvLBoxEntry*)
pModel->Clone( (SvListEntry*)pSourceEntry, nCloneCount );
pModel->InsertTree( (SvListEntry*)pSourceEntry,
@@ -1125,9 +1124,9 @@ BOOL SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pT
}
}
else
- bSuccess = FALSE;
+ bSuccess = sal_False;
- if( bOk == (BOOL)2 ) // !!!HACK verschobenen Entry sichtbar machen?
+ if( bOk == (sal_Bool)2 ) // !!!HACK verschobenen Entry sichtbar machen?
MakeVisible( pSourceEntry );
pSourceEntry = (SvLBoxEntry*)aList.Next();
@@ -1148,7 +1147,7 @@ void SvLBox::RemoveSelection()
aList.Insert( pEntry );
if ( pEntry->HasChilds() )
// Remove loescht Childs automatisch
- SelectChilds( pEntry, FALSE );
+ SelectChilds( pEntry, sal_False );
pEntry = NextSelected( pEntry );
}
pEntry = (SvLBoxEntry*)aList.First();
@@ -1181,8 +1180,8 @@ void SvLBox::RecalcViewData()
SvLBoxEntry* pEntry = First();
while( pEntry )
{
- USHORT nCount = pEntry->ItemCount();
- USHORT nCurPos = 0;
+ sal_uInt16 nCount = pEntry->ItemCount();
+ sal_uInt16 nCurPos = 0;
while ( nCurPos < nCount )
{
SvLBoxItem* pItem = pEntry->GetItem( nCurPos );
@@ -1206,7 +1205,7 @@ void SvLBox::StateChanged( StateChangedType eType )
Control::StateChanged( eType );
}
-void SvLBox::ImplShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow)
+void SvLBox::ImplShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool bShow)
{
DBG_CHKTHIS(SvLBox,0);
if ( bShow && (nImpFlags & SVLBOX_TARGEMPH_VIS) )
@@ -1220,37 +1219,43 @@ void SvLBox::ImplShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow)
nImpFlags &= ~SVLBOX_TARGEMPH_VIS;
}
-void SvLBox::ShowTargetEmphasis( SvLBoxEntry*, BOOL /* bShow */ )
+void SvLBox::ShowTargetEmphasis( SvLBoxEntry*, sal_Bool /* bShow */ )
{
DBG_CHKTHIS(SvLBox,0);
}
-BOOL SvLBox::Expand( SvLBoxEntry* )
+sal_Bool SvLBox::Expand( SvLBoxEntry* )
{
DBG_CHKTHIS(SvLBox,0);
- return TRUE;
+ return sal_True;
}
-BOOL SvLBox::Collapse( SvLBoxEntry* )
+sal_Bool SvLBox::Collapse( SvLBoxEntry* )
{
DBG_CHKTHIS(SvLBox,0);
- return TRUE;
+ return sal_True;
}
-BOOL SvLBox::Select( SvLBoxEntry*, BOOL )
+sal_Bool SvLBox::Select( SvLBoxEntry*, sal_Bool )
{
DBG_CHKTHIS(SvLBox,0);
- return FALSE;
+ return sal_False;
}
-ULONG SvLBox::SelectChilds( SvLBoxEntry* , BOOL )
+sal_uLong SvLBox::SelectChilds( SvLBoxEntry* , sal_Bool )
{
DBG_CHKTHIS(SvLBox,0);
return 0;
}
-void SvLBox::SelectAll( BOOL /* bSelect */ , BOOL /* bPaint */ )
+void SvLBox::OnCurrentEntryChanged()
+{
+ if ( !pLBoxImpl->m_bDoingQuickSelection )
+ pLBoxImpl->m_aQuickSelectionEngine.Reset();
+}
+
+void SvLBox::SelectAll( sal_Bool /* bSelect */ , sal_Bool /* bPaint */ )
{
DBG_CHKTHIS(SvLBox,0);
}
@@ -1279,9 +1284,9 @@ void SvLBox::FillEntryPath( SvLBoxEntry* pEntry, ::std::deque< sal_Int32 >& _rPa
if ( pEntry )
{
SvLBoxEntry* pParentEntry = GetParent( pEntry );
- while ( TRUE )
+ while ( sal_True )
{
- ULONG i, nCount = GetLevelChildCount( pParentEntry );
+ sal_uLong i, nCount = GetLevelChildCount( pParentEntry );
for ( i = 0; i < nCount; ++i )
{
SvLBoxEntry* pTemp = GetEntry( pParentEntry, i );
@@ -1311,11 +1316,11 @@ String SvLBox::GetEntryText( SvLBoxEntry* ) const
return String();
}
-ULONG SvLBox::GetLevelChildCount( SvLBoxEntry* _pParent ) const
+sal_uLong SvLBox::GetLevelChildCount( SvLBoxEntry* _pParent ) const
{
DBG_CHKTHIS(SvLBox,0);
- ULONG nCount = 0;
+ sal_uLong nCount = 0;
SvLBoxEntry* pEntry = FirstChild( _pParent );
while ( pEntry )
{
@@ -1354,8 +1359,8 @@ void SvLBox::InitViewData( SvViewData* pData, SvListEntry* pEntry )
pEntryData->pItemData = new SvViewDataItem[ pInhEntry->ItemCount() ];
SvViewDataItem* pItemData = pEntryData->pItemData;
pEntryData->nItmCnt = pInhEntry->ItemCount(); // Anzahl Items fuer delete
- USHORT nCount = pInhEntry->ItemCount();
- USHORT nCurPos = 0;
+ sal_uInt16 nCount = pInhEntry->ItemCount();
+ sal_uInt16 nCurPos = 0;
while( nCurPos < nCount )
{
SvLBoxItem* pItem = pInhEntry->GetItem( nCurPos );
@@ -1367,10 +1372,10 @@ void SvLBox::InitViewData( SvViewData* pData, SvListEntry* pEntry )
-void SvLBox::EnableSelectionAsDropTarget( BOOL bEnable, BOOL bWithChilds )
+void SvLBox::EnableSelectionAsDropTarget( sal_Bool bEnable, sal_Bool bWithChilds )
{
DBG_CHKTHIS(SvLBox,0);
- USHORT nRefDepth;
+ sal_uInt16 nRefDepth;
SvLBoxEntry* pTemp;
SvLBoxEntry* pSelEntry = FirstSelected();
@@ -1421,11 +1426,11 @@ SvLBoxEntry* SvLBox::GetDropTarget( const Point& )
void SvLBox::EditText( const String& rStr, const Rectangle& rRect,
const Selection& rSel )
{
- EditText( rStr, rRect, rSel, FALSE );
+ EditText( rStr, rRect, rSel, sal_False );
}
void SvLBox::EditText( const String& rStr, const Rectangle& rRect,
- const Selection& rSel, BOOL bMulti )
+ const Selection& rSel, sal_Bool bMulti )
{
DBG_CHKTHIS(SvLBox,0);
if( pEdCtrl )
@@ -1467,11 +1472,11 @@ void SvLBox::CancelTextEditing()
{
DBG_CHKTHIS(SvLBox,0);
if ( pEdCtrl )
- pEdCtrl->StopEditing( TRUE );
+ pEdCtrl->StopEditing( sal_True );
nImpFlags &= (~SVLBOX_IN_EDT);
}
-void SvLBox::EndEditing( BOOL bCancel )
+void SvLBox::EndEditing( sal_Bool bCancel )
{
DBG_CHKTHIS(SvLBox,0);
if( pEdCtrl )
@@ -1534,15 +1539,14 @@ void SvLBox::KeyInput( const KeyEvent& rKEvt )
Control::KeyInput( rKEvt );
}
-const void* SvLBox::FirstSearchEntry( String& _rEntryText )
+const void* SvLBox::FirstSearchEntry( String& _rEntryText ) const
{
SvLBoxEntry* pEntry = GetCurEntry();
if ( pEntry )
pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( NextSearchEntry( pEntry, _rEntryText ) ) );
else
{
- if ( !pEntry )
- pEntry = FirstSelected();
+ pEntry = FirstSelected();
if ( !pEntry )
pEntry = First();
}
@@ -1553,11 +1557,23 @@ const void* SvLBox::FirstSearchEntry( String& _rEntryText )
return pEntry;
}
-const void* SvLBox::NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText )
+const void* SvLBox::NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) const
{
SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pCurrentSearchEntry ) );
- pEntry = Next( pEntry );
+ if ( ( ( GetChildCount( pEntry ) > 0 )
+ || ( pEntry->HasChildsOnDemand() )
+ )
+ && !IsExpanded( pEntry )
+ )
+ {
+ pEntry = NextSibling( pEntry );
+ }
+ else
+ {
+ pEntry = Next( pEntry );
+ }
+
if ( !pEntry )
pEntry = First();
@@ -1571,28 +1587,61 @@ void SvLBox::SelectSearchEntry( const void* _pEntry )
{
SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pEntry ) );
DBG_ASSERT( pEntry, "SvLBox::SelectSearchEntry: invalid entry!" );
- if ( pEntry )
+ if ( !pEntry )
return;
- SelectAll( FALSE );
+ SelectAll( sal_False );
SetCurEntry( pEntry );
Select( pEntry );
}
-void SvLBox::ExecuteSearchEntry( const void* /*_pEntry*/ )
+void SvLBox::ExecuteSearchEntry( const void* /*_pEntry*/ ) const
{
// nothing to do here, we have no "execution"
}
+::vcl::StringEntryIdentifier SvLBox::CurrentEntry( String& _out_entryText ) const
+{
+ // always accept the current entry if there is one
+ SvLBoxEntry* pCurrentEntry( GetCurEntry() );
+ if ( pCurrentEntry )
+ {
+ _out_entryText = GetEntryText( pCurrentEntry );
+ return pCurrentEntry;
+ }
+ return FirstSearchEntry( _out_entryText );
+}
+
+::vcl::StringEntryIdentifier SvLBox::NextEntry( ::vcl::StringEntryIdentifier _currentEntry, String& _out_entryText ) const
+{
+ return NextSearchEntry( _currentEntry, _out_entryText );
+}
+
+void SvLBox::SelectEntry( ::vcl::StringEntryIdentifier _entry )
+{
+ SelectSearchEntry( _entry );
+}
+
bool SvLBox::HandleKeyInput( const KeyEvent& _rKEvt )
{
- if ( !IsEntryMnemonicsEnabled() )
- return false;
+ if ( IsEntryMnemonicsEnabled()
+ && pLBoxImpl->m_aMnemonicEngine.HandleKeyEvent( _rKEvt )
+ )
+ return true;
+
+ if ( ( GetStyle() & WB_QUICK_SEARCH ) != 0 )
+ {
+ pLBoxImpl->m_bDoingQuickSelection = true;
+ const bool bHandled = pLBoxImpl->m_aQuickSelectionEngine.HandleKeyEvent( _rKEvt );
+ pLBoxImpl->m_bDoingQuickSelection = false;
+ if ( bHandled )
+ return true;
+ }
- return pLBoxImpl->m_aMnemonicEngine.HandleKeyEvent( _rKEvt );
+ return false;
}
-SvLBoxEntry* SvLBox::GetEntry( const Point&, BOOL ) const
+SvLBoxEntry* SvLBox::GetEntry( const Point&, sal_Bool ) const
{
DBG_CHKTHIS(SvLBox,0);
return 0;
@@ -1601,15 +1650,15 @@ SvLBoxEntry* SvLBox::GetEntry( const Point&, BOOL ) const
void SvLBox::ModelHasEntryInvalidated( SvListEntry* pEntry )
{
DBG_CHKTHIS(SvLBox,0);
- USHORT nCount = ((SvLBoxEntry*)pEntry)->ItemCount();
- for( USHORT nIdx = 0; nIdx < nCount; nIdx++ )
+ sal_uInt16 nCount = ((SvLBoxEntry*)pEntry)->ItemCount();
+ for( sal_uInt16 nIdx = 0; nIdx < nCount; nIdx++ )
{
SvLBoxItem* pItem = ((SvLBoxEntry*)pEntry)->GetItem( nIdx );
pItem->InitViewData( this, (SvLBoxEntry*)pEntry, 0 );
}
}
-void SvLBox::SetInUseEmphasis( SvLBoxEntry* pEntry, BOOL bInUse )
+void SvLBox::SetInUseEmphasis( SvLBoxEntry* pEntry, sal_Bool bInUse )
{
DBG_CHKTHIS(SvLBox,0);
DBG_ASSERT(pEntry,"SetInUseEmphasis:No Entry");
@@ -1631,7 +1680,7 @@ void SvLBox::SetInUseEmphasis( SvLBoxEntry* pEntry, BOOL bInUse )
}
}
-void SvLBox::SetCursorEmphasis( SvLBoxEntry* pEntry, BOOL bCursored )
+void SvLBox::SetCursorEmphasis( SvLBoxEntry* pEntry, sal_Bool bCursored )
{
DBG_CHKTHIS(SvLBox,0);
DBG_ASSERT(pEntry,"SetInUseEmphasis:No Entry");
@@ -1646,7 +1695,7 @@ void SvLBox::SetCursorEmphasis( SvLBoxEntry* pEntry, BOOL bCursored )
}
}
-BOOL SvLBox::HasCursorEmphasis( SvLBoxEntry* pEntry ) const
+sal_Bool SvLBox::HasCursorEmphasis( SvLBoxEntry* pEntry ) const
{
DBG_CHKTHIS(SvLBox,0);
DBG_ASSERT(pEntry,"SetInUseEmphasis:No Entry");
@@ -1665,11 +1714,11 @@ void SvLBox::ReadDragServerInfo(const Point&, SvLBoxDDInfo* )
DBG_CHKTHIS(SvLBox,0);
}
-BOOL SvLBox::EditingCanceled() const
+sal_Bool SvLBox::EditingCanceled() const
{
if( pEdCtrl && pEdCtrl->EditingCanceled() )
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
@@ -1681,7 +1730,7 @@ sal_Int8 SvLBox::AcceptDrop( const AcceptDropEvent& rEvt )
if( rEvt.mbLeaving || !CheckDragAndDropMode( pDDSource, rEvt.mnAction ) )
{
- ImplShowTargetEmphasis( pTargetEntry, FALSE );
+ ImplShowTargetEmphasis( pTargetEntry, sal_False );
}
else if( !nDragDropMode )
{
@@ -1708,12 +1757,12 @@ sal_Int8 SvLBox::AcceptDrop( const AcceptDropEvent& rEvt )
// **** Emphasis zeichnen ****
if( DND_ACTION_NONE == nRet )
- ImplShowTargetEmphasis( pTargetEntry, FALSE );
+ ImplShowTargetEmphasis( pTargetEntry, sal_False );
else if( pEntry != pTargetEntry || !(nImpFlags & SVLBOX_TARGEMPH_VIS) )
{
- ImplShowTargetEmphasis( pTargetEntry, FALSE );
+ ImplShowTargetEmphasis( pTargetEntry, sal_False );
pTargetEntry = pEntry;
- ImplShowTargetEmphasis( pTargetEntry, TRUE );
+ ImplShowTargetEmphasis( pTargetEntry, sal_True );
}
}
return nRet;
@@ -1725,9 +1774,9 @@ sal_Int8 SvLBox::ExecuteDrop( const ExecuteDropEvent& rEvt, SvLBox* pSourceView
sal_Int8 nRet = DND_ACTION_NONE;
DBG_ASSERT( pSourceView, "SvLBox::ExecuteDrop(): no source view" );
- pSourceView->EnableSelectionAsDropTarget( TRUE, TRUE );
+ pSourceView->EnableSelectionAsDropTarget( sal_True, sal_True );
- ImplShowTargetEmphasis( pTargetEntry, FALSE );
+ ImplShowTargetEmphasis( pTargetEntry, sal_False );
pDDTarget = this;
SvLBoxDDInfo aDDInfo;
@@ -1823,8 +1872,8 @@ void SvLBox::StartDrag( sal_Int8, const Point& rPosPixel )
pDDSource = this;
pDDTarget = 0;
- BOOL bOldUpdateMode = Control::IsUpdateMode();
- Control::SetUpdateMode( TRUE );
+ sal_Bool bOldUpdateMode = Control::IsUpdateMode();
+ Control::SetUpdateMode( sal_True );
Update();
Control::SetUpdateMode( bOldUpdateMode );
@@ -1832,8 +1881,8 @@ void SvLBox::StartDrag( sal_Int8, const Point& rPosPixel )
// Wichtig: Wenn im DropHandler die Selektion der
// SourceListBox veraendert wird, muessen vorher die Eintraege
// als DropTargets wieder freigeschaltet werden:
- // (GetSourceListBox()->EnableSelectionAsDropTarget( TRUE, TRUE );)
- EnableSelectionAsDropTarget( FALSE, TRUE /* with Childs */ );
+ // (GetSourceListBox()->EnableSelectionAsDropTarget( sal_True, sal_True );)
+ EnableSelectionAsDropTarget( sal_False, sal_True /* with Childs */ );
pContainer->StartDrag( this, nDragOptions, GetDragFinishedHdl() );
}
@@ -1844,18 +1893,18 @@ nAction
#endif
)
{
- EnableSelectionAsDropTarget( TRUE, TRUE );
+ EnableSelectionAsDropTarget( sal_True, sal_True );
#ifndef UNX
if( (nAction == DND_ACTION_MOVE) && ( (pDDTarget &&
- ((ULONG)(pDDTarget->GetModel())!=(ULONG)(this->GetModel()))) ||
+ ((sal_uLong)(pDDTarget->GetModel())!=(sal_uLong)(this->GetModel()))) ||
!pDDTarget ))
{
RemoveSelection();
}
#endif
- ImplShowTargetEmphasis( pTargetEntry, FALSE );
+ ImplShowTargetEmphasis( pTargetEntry, sal_False );
pDDSource = 0;
pDDTarget = 0;
pTargetEntry = 0;
@@ -1868,10 +1917,10 @@ DragDropMode SvLBox::NotifyStartDrag( TransferDataContainer&, SvLBoxEntry* )
return (DragDropMode)0xffff;
}
-BOOL SvLBox::NotifyAcceptDrop( SvLBoxEntry* )
+sal_Bool SvLBox::NotifyAcceptDrop( SvLBoxEntry* )
{
DBG_CHKTHIS(SvLBox,0);
- return TRUE;
+ return sal_True;
}
// handler and methods for Drag - finished handler.
@@ -1888,20 +1937,20 @@ namespace
void SvLBox::AddBoxToDDList_Impl( const SvLBox& rB )
{
- ULONG nVal = (ULONG)&rB;
+ sal_uLong nVal = (sal_uLong)&rB;
SortLBoxes::get().Insert( nVal );
}
void SvLBox::RemoveBoxFromDDList_Impl( const SvLBox& rB )
{
- ULONG nVal = (ULONG)&rB;
+ sal_uLong nVal = (sal_uLong)&rB;
SortLBoxes::get().Remove( nVal );
}
IMPL_STATIC_LINK( SvLBox, DragFinishHdl_Impl, sal_Int8*, pAction )
{
- ULONG nVal = (ULONG)pThis;
- USHORT nFnd;
+ sal_uLong nVal = (sal_uLong)pThis;
+ sal_uInt16 nFnd;
SvULongsSort &rSortLBoxes = SortLBoxes::get();
if( rSortLBoxes.Seek_Entry( nVal, &nFnd ) )
{
diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx
index db6a3dd0d3c5..4b1c00e4c873 100644
--- a/svtools/source/contnr/svtabbx.cxx
+++ b/svtools/source/contnr/svtabbx.cxx
@@ -72,7 +72,7 @@ void SvTabListBox::SetTabs()
*/
// alle anderen Tabs an Liste haengen
- for( USHORT nCurTab = 1; nCurTab < nTabCount; nCurTab++ )
+ for( sal_uInt16 nCurTab = 1; nCurTab < nTabCount; nCurTab++ )
{
SvLBoxTab* pTab = pTabList+nCurTab;
AddTab( pTab->GetPos(), pTab->nFlags );
@@ -87,10 +87,10 @@ void SvTabListBox::InitEntry( SvLBoxEntry* pEntry, const XubString& rStr,
XubString aToken;
const xub_Unicode* pCurToken = aCurEntry.GetBuffer();
- USHORT nCurTokenLen;
+ sal_uInt16 nCurTokenLen;
const xub_Unicode* pNextToken = GetToken( pCurToken, nCurTokenLen );
- USHORT nCount = nTabCount; nCount--;
- for( USHORT nToken = 0; nToken < nCount; nToken++ )
+ sal_uInt16 nCount = nTabCount; nCount--;
+ for( sal_uInt16 nToken = 0; nToken < nCount; nToken++ )
{
if( pCurToken && nCurTokenLen )
// aToken.Assign( pCurToken, nCurTokenLen );
@@ -144,7 +144,7 @@ void SvTabListBox::SetTabs( long* pTabs, MapUnit eMapUnit )
return;
delete [] pTabList;
- USHORT nCount = (USHORT)(*pTabs);
+ sal_uInt16 nCount = (sal_uInt16)(*pTabs);
pTabList = new SvLBoxTab[ nCount ];
nTabCount = nCount;
@@ -152,7 +152,7 @@ void SvTabListBox::SetTabs( long* pTabs, MapUnit eMapUnit )
MapMode aMMDest( MAP_PIXEL );
pTabs++;
- for( USHORT nIdx = 0; nIdx < nCount; nIdx++, pTabs++ )
+ for( sal_uInt16 nIdx = 0; nIdx < nCount; nIdx++, pTabs++ )
{
Size aSize( *pTabs, 0 );
aSize = LogicToLogic( aSize, &aMMSource, &aMMDest );
@@ -165,7 +165,7 @@ void SvTabListBox::SetTabs( long* pTabs, MapUnit eMapUnit )
Invalidate();
}
-void SvTabListBox::SetTab( USHORT nTab,long nValue,MapUnit eMapUnit )
+void SvTabListBox::SetTab( sal_uInt16 nTab,long nValue,MapUnit eMapUnit )
{
DBG_ASSERT(nTab<nTabCount,"Invalid Tab-Pos");
if( nTab < nTabCount )
@@ -184,8 +184,8 @@ void SvTabListBox::SetTab( USHORT nTab,long nValue,MapUnit eMapUnit )
}
SvLBoxEntry* SvTabListBox::InsertEntry( const XubString& rText, SvLBoxEntry* pParent,
- BOOL /*bChildsOnDemand*/,
- ULONG nPos, void* pUserData,
+ sal_Bool /*bChildsOnDemand*/,
+ sal_uLong nPos, void* pUserData,
SvLBoxButtonKind )
{
return InsertEntryToColumn( rText, pParent, nPos, 0xffff, pUserData );
@@ -195,15 +195,15 @@ SvLBoxEntry* SvTabListBox::InsertEntry( const XubString& rText,
const Image& rExpandedEntryBmp,
const Image& rCollapsedEntryBmp,
SvLBoxEntry* pParent,
- BOOL /*bChildsOnDemand*/,
- ULONG nPos, void* pUserData,
+ sal_Bool /*bChildsOnDemand*/,
+ sal_uLong nPos, void* pUserData,
SvLBoxButtonKind )
{
return InsertEntryToColumn( rText, rExpandedEntryBmp, rCollapsedEntryBmp,
pParent, nPos, 0xffff, pUserData );
}
-SvLBoxEntry* SvTabListBox::InsertEntryToColumn(const XubString& rStr,SvLBoxEntry* pParent,ULONG nPos,USHORT nCol,
+SvLBoxEntry* SvTabListBox::InsertEntryToColumn(const XubString& rStr,SvLBoxEntry* pParent,sal_uLong nPos,sal_uInt16 nCol,
void* pUser )
{
XubString aStr;
@@ -217,7 +217,7 @@ SvLBoxEntry* SvTabListBox::InsertEntryToColumn(const XubString& rStr,SvLBoxEntry
}
aStr += rStr;
XubString aFirstStr( aStr );
- USHORT nEnd = aFirstStr.Search( '\t' );
+ sal_uInt16 nEnd = aFirstStr.Search( '\t' );
if( nEnd != STRING_NOTFOUND )
{
aFirstStr.Erase( nEnd );
@@ -226,12 +226,12 @@ SvLBoxEntry* SvTabListBox::InsertEntryToColumn(const XubString& rStr,SvLBoxEntry
}
else
aCurEntry.Erase();
- return SvTreeListBox::InsertEntry( aFirstStr, pParent, FALSE, nPos, pUser );
+ return SvTreeListBox::InsertEntry( aFirstStr, pParent, sal_False, nPos, pUser );
}
SvLBoxEntry* SvTabListBox::InsertEntryToColumn( const XubString& rStr,
const Image& rExpandedEntryBmp, const Image& rCollapsedEntryBmp,
- SvLBoxEntry* pParent,ULONG nPos,USHORT nCol, void* pUser )
+ SvLBoxEntry* pParent,sal_uLong nPos,sal_uInt16 nCol, void* pUser )
{
XubString aStr;
if( nCol != 0xffff )
@@ -244,7 +244,7 @@ SvLBoxEntry* SvTabListBox::InsertEntryToColumn( const XubString& rStr,
}
aStr += rStr;
XubString aFirstStr( aStr );
- USHORT nEnd = aFirstStr.Search( '\t' );
+ sal_uInt16 nEnd = aFirstStr.Search( '\t' );
if( nEnd != STRING_NOTFOUND )
{
aFirstStr.Erase( nEnd );
@@ -257,11 +257,11 @@ SvLBoxEntry* SvTabListBox::InsertEntryToColumn( const XubString& rStr,
return SvTreeListBox::InsertEntry(
aFirstStr,
rExpandedEntryBmp, rCollapsedEntryBmp,
- pParent, FALSE, nPos, pUser );
+ pParent, sal_False, nPos, pUser );
}
-SvLBoxEntry* SvTabListBox::InsertEntryToColumn( const XubString& rStr, ULONG nPos,
- USHORT nCol, void* pUser )
+SvLBoxEntry* SvTabListBox::InsertEntryToColumn( const XubString& rStr, sal_uLong nPos,
+ sal_uInt16 nCol, void* pUser )
{
return InsertEntryToColumn( rStr,0,nPos, nCol, pUser );
}
@@ -271,14 +271,14 @@ String SvTabListBox::GetEntryText( SvLBoxEntry* pEntry ) const
return GetEntryText( pEntry, 0xffff );
}
-String SvTabListBox::GetEntryText( SvLBoxEntry* pEntry, USHORT nCol ) const
+String SvTabListBox::GetEntryText( SvLBoxEntry* pEntry, sal_uInt16 nCol ) const
{
DBG_ASSERT(pEntry,"GetEntryText:Invalid Entry");
XubString aResult;
if( pEntry )
{
- USHORT nCount = pEntry->ItemCount();
- USHORT nCur = 0;
+ sal_uInt16 nCount = pEntry->ItemCount();
+ sal_uInt16 nCur = 0;
while( nCur < nCount )
{
SvLBoxItem* pStr = pEntry->GetItem( nCur );
@@ -303,19 +303,19 @@ String SvTabListBox::GetEntryText( SvLBoxEntry* pEntry, USHORT nCol ) const
return aResult;
}
-String SvTabListBox::GetEntryText( ULONG nPos, USHORT nCol ) const
+String SvTabListBox::GetEntryText( sal_uLong nPos, sal_uInt16 nCol ) const
{
SvLBoxEntry* pEntry = GetEntryOnPos( nPos );
return GetEntryText( pEntry, nCol );
}
-void SvTabListBox::SetEntryText( const XubString& rStr, ULONG nPos, USHORT nCol )
+void SvTabListBox::SetEntryText( const XubString& rStr, sal_uLong nPos, sal_uInt16 nCol )
{
SvLBoxEntry* pEntry = SvTreeListBox::GetEntry( nPos );
SetEntryText( rStr, pEntry, nCol );
}
-void SvTabListBox::SetEntryText( const XubString& rStr, SvLBoxEntry* pEntry, USHORT nCol )
+void SvTabListBox::SetEntryText( const XubString& rStr, SvLBoxEntry* pEntry, sal_uInt16 nCol )
{
DBG_ASSERT(pEntry,"SetEntryText:Invalid Entry");
if( !pEntry )
@@ -325,14 +325,14 @@ void SvTabListBox::SetEntryText( const XubString& rStr, SvLBoxEntry* pEntry, USH
if ( sOldText == rStr )
return;
- USHORT nTextColumn = nCol;
+ sal_uInt16 nTextColumn = nCol;
const xub_Unicode* pCurToken = rStr.GetBuffer();
- USHORT nCurTokenLen;
+ sal_uInt16 nCurTokenLen;
const xub_Unicode* pNextToken = GetToken( pCurToken, nCurTokenLen );
XubString aTemp;
- USHORT nCount = pEntry->ItemCount();
- USHORT nCur = 0;
+ sal_uInt16 nCount = pEntry->ItemCount();
+ sal_uInt16 nCur = 0;
while( nCur < nCount )
{
SvLBoxItem* pStr = pEntry->GetItem( nCur );
@@ -372,7 +372,7 @@ void SvTabListBox::SetEntryText( const XubString& rStr, SvLBoxEntry* pEntry, USH
delete pData;
}
-String SvTabListBox::GetCellText( ULONG nPos, USHORT nCol ) const
+String SvTabListBox::GetCellText( sal_uLong nPos, sal_uInt16 nCol ) const
{
SvLBoxEntry* pEntry = GetEntryOnPos( nPos );
DBG_ASSERT( pEntry, "SvTabListBox::GetCellText(): Invalid Entry" );
@@ -386,9 +386,9 @@ String SvTabListBox::GetCellText( ULONG nPos, USHORT nCol ) const
return aResult;
}
-ULONG SvTabListBox::GetEntryPos( const XubString& rStr, USHORT nCol )
+sal_uLong SvTabListBox::GetEntryPos( const XubString& rStr, sal_uInt16 nCol )
{
- ULONG nPos = 0;
+ sal_uLong nPos = 0;
SvLBoxEntry* pEntry = First();
while( pEntry )
{
@@ -401,9 +401,9 @@ ULONG SvTabListBox::GetEntryPos( const XubString& rStr, USHORT nCol )
return 0xffffffff;
}
-ULONG SvTabListBox::GetEntryPos( const SvLBoxEntry* pEntry ) const
+sal_uLong SvTabListBox::GetEntryPos( const SvLBoxEntry* pEntry ) const
{
- ULONG nPos = 0;
+ sal_uLong nPos = 0;
SvLBoxEntry* pTmpEntry = First();
while( pTmpEntry )
{
@@ -421,7 +421,7 @@ void SvTabListBox::Resize()
}
// static
-const xub_Unicode* SvTabListBox::GetToken( const xub_Unicode* pPtr, USHORT& rLen )
+const xub_Unicode* SvTabListBox::GetToken( const xub_Unicode* pPtr, sal_uInt16& rLen )
{
if( !pPtr || *pPtr == 0 )
{
@@ -429,7 +429,7 @@ const xub_Unicode* SvTabListBox::GetToken( const xub_Unicode* pPtr, USHORT& rLen
return 0;
}
xub_Unicode c = *pPtr;
- USHORT nLen = 0;
+ sal_uInt16 nLen = 0;
while( c != '\t' && c != 0 )
{
pPtr++;
@@ -444,15 +444,15 @@ const xub_Unicode* SvTabListBox::GetToken( const xub_Unicode* pPtr, USHORT& rLen
return pPtr;
}
-String SvTabListBox::GetTabEntryText( ULONG nPos, USHORT nCol ) const
+String SvTabListBox::GetTabEntryText( sal_uLong nPos, sal_uInt16 nCol ) const
{
SvLBoxEntry* pEntry = SvTreeListBox::GetEntry( nPos );
DBG_ASSERT( pEntry, "GetTabEntryText(): Invalid entry " );
XubString aResult;
if ( pEntry )
{
- USHORT nCount = pEntry->ItemCount();
- USHORT nCur = ( 0 == nCol && IsCellFocusEnabled() ) ? GetCurrentTabPos() : 0;
+ sal_uInt16 nCount = pEntry->ItemCount();
+ sal_uInt16 nCur = ( 0 == nCol && IsCellFocusEnabled() ) ? GetCurrentTabPos() : 0;
while( nCur < nCount )
{
SvLBoxItem* pStr = pEntry->GetItem( nCur );
@@ -482,10 +482,10 @@ String SvTabListBox::GetTabEntryText( ULONG nPos, USHORT nCol ) const
return aResult;
}
-SvLBoxEntry* SvTabListBox::GetEntryOnPos( ULONG _nEntryPos ) const
+SvLBoxEntry* SvTabListBox::GetEntryOnPos( sal_uLong _nEntryPos ) const
{
SvLBoxEntry* pEntry = NULL;
- ULONG i, nPos = 0, nCount = GetLevelChildCount( NULL );
+ sal_uLong i, nPos = 0, nCount = GetLevelChildCount( NULL );
for ( i = 0; i < nCount; ++i )
{
SvLBoxEntry* pParent = GetEntry(i);
@@ -506,9 +506,9 @@ SvLBoxEntry* SvTabListBox::GetEntryOnPos( ULONG _nEntryPos ) const
return pEntry;
}
-SvLBoxEntry* SvTabListBox::GetChildOnPos( SvLBoxEntry* _pParent, ULONG _nEntryPos, ULONG& _rPos ) const
+SvLBoxEntry* SvTabListBox::GetChildOnPos( SvLBoxEntry* _pParent, sal_uLong _nEntryPos, sal_uLong& _rPos ) const
{
- ULONG i, nCount = GetLevelChildCount( _pParent );
+ sal_uLong i, nCount = GetLevelChildCount( _pParent );
for ( i = 0; i < nCount; ++i )
{
SvLBoxEntry* pParent = GetEntry( _pParent, i );
@@ -526,33 +526,33 @@ SvLBoxEntry* SvTabListBox::GetChildOnPos( SvLBoxEntry* _pParent, ULONG _nEntryPo
return NULL;
}
-void SvTabListBox::SetTabJustify( USHORT nTab, SvTabJustify eJustify)
+void SvTabListBox::SetTabJustify( sal_uInt16 nTab, SvTabJustify eJustify)
{
if( nTab >= nTabCount )
return;
SvLBoxTab* pTab = &(pTabList[ nTab ]);
- USHORT nFlags = pTab->nFlags;
+ sal_uInt16 nFlags = pTab->nFlags;
nFlags &= (~MYTABMASK);
- nFlags |= (USHORT)eJustify;
+ nFlags |= (sal_uInt16)eJustify;
pTab->nFlags = nFlags;
SvTreeListBox::nTreeFlags |= TREEFLAG_RECALCTABS;
if( IsUpdateMode() )
Invalidate();
}
-SvTabJustify SvTabListBox::GetTabJustify( USHORT nTab ) const
+SvTabJustify SvTabListBox::GetTabJustify( sal_uInt16 nTab ) const
{
SvTabJustify eResult = AdjustLeft;
if( nTab >= nTabCount )
return eResult;
SvLBoxTab* pTab = &(pTabList[ nTab ]);
- USHORT nFlags = pTab->nFlags;
+ sal_uInt16 nFlags = pTab->nFlags;
nFlags &= MYTABMASK;
eResult = (SvTabJustify)nFlags;
return eResult;
}
-long SvTabListBox::GetLogicTab( USHORT nTab )
+long SvTabListBox::GetLogicTab( sal_uInt16 nTab )
{
if( SvTreeListBox::nTreeFlags & TREEFLAG_RECALCTABS )
((SvTabListBox*)this)->SetTabs();
@@ -580,7 +580,7 @@ SvHeaderTabListBox::SvHeaderTabListBox( Window* pParent, WinBits nWinStyle ) :
SvTabListBox( pParent, nWinStyle ),
- m_bFirstPaint ( TRUE ),
+ m_bFirstPaint ( sal_True ),
m_pImpl ( new ::svt::SvHeaderTabListBoxImpl ),
m_pAccessible ( NULL )
{
@@ -592,7 +592,7 @@ SvHeaderTabListBox::SvHeaderTabListBox( Window* pParent, const ResId& rResId ) :
SvTabListBox( pParent, rResId ),
- m_bFirstPaint ( TRUE ),
+ m_bFirstPaint ( sal_True ),
m_pImpl ( new ::svt::SvHeaderTabListBoxImpl ),
m_pAccessible ( NULL )
{
@@ -611,7 +611,7 @@ void SvHeaderTabListBox::Paint( const Rectangle& rRect )
{
if ( m_bFirstPaint )
{
- m_bFirstPaint = FALSE;
+ m_bFirstPaint = sal_False;
RepaintScrollBars();
}
SvTabListBox::Paint( rRect );
@@ -630,14 +630,14 @@ void SvHeaderTabListBox::InitHeaderBar( HeaderBar* pHeaderBar )
// -----------------------------------------------------------------------
-sal_Bool SvHeaderTabListBox::IsItemChecked( SvLBoxEntry* pEntry, USHORT nCol ) const
+sal_Bool SvHeaderTabListBox::IsItemChecked( SvLBoxEntry* pEntry, sal_uInt16 nCol ) const
{
SvButtonState eState = SV_BUTTON_UNCHECKED;
SvLBoxButton* pItem = (SvLBoxButton*)( pEntry->GetItem( nCol + 1 ) );
if ( pItem && ( (SvLBoxItem*)pItem )->IsA() == SV_ITEM_ID_LBOXBUTTON )
{
- USHORT nButtonFlags = pItem->GetButtonFlags();
+ sal_uInt16 nButtonFlags = pItem->GetButtonFlags();
eState = pCheckButtonData->ConvertToButtonState( nButtonFlags );
}
@@ -647,7 +647,7 @@ sal_Bool SvHeaderTabListBox::IsItemChecked( SvLBoxEntry* pEntry, USHORT nCol ) c
// -----------------------------------------------------------------------
SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn(
- const XubString& rStr, ULONG nPos, USHORT nCol, void* pUserData )
+ const XubString& rStr, sal_uLong nPos, sal_uInt16 nCol, void* pUserData )
{
SvLBoxEntry* pEntry = SvTabListBox::InsertEntryToColumn( rStr, nPos, nCol, pUserData );
RecalculateAccessibleChildren();
@@ -657,7 +657,7 @@ SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn(
// -----------------------------------------------------------------------
SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn(
- const XubString& rStr, SvLBoxEntry* pParent, ULONG nPos, USHORT nCol, void* pUserData )
+ const XubString& rStr, SvLBoxEntry* pParent, sal_uLong nPos, sal_uInt16 nCol, void* pUserData )
{
SvLBoxEntry* pEntry = SvTabListBox::InsertEntryToColumn( rStr, pParent, nPos, nCol, pUserData );
RecalculateAccessibleChildren();
@@ -668,7 +668,7 @@ SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn(
SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn(
const XubString& rStr, const Image& rExpandedEntryBmp, const Image& rCollapsedEntryBmp,
- SvLBoxEntry* pParent, ULONG nPos, USHORT nCol, void* pUserData )
+ SvLBoxEntry* pParent, sal_uLong nPos, sal_uInt16 nCol, void* pUserData )
{
SvLBoxEntry* pEntry = SvTabListBox::InsertEntryToColumn(
rStr, rExpandedEntryBmp, rCollapsedEntryBmp, pParent, nPos, nCol, pUserData );
@@ -678,19 +678,19 @@ SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn(
// -----------------------------------------------------------------------
-ULONG SvHeaderTabListBox::Insert(
- SvLBoxEntry* pEnt, SvLBoxEntry* pPar, ULONG nPos )
+sal_uLong SvHeaderTabListBox::Insert(
+ SvLBoxEntry* pEnt, SvLBoxEntry* pPar, sal_uLong nPos )
{
- ULONG n = SvTabListBox::Insert( pEnt, pPar, nPos );
+ sal_uLong n = SvTabListBox::Insert( pEnt, pPar, nPos );
RecalculateAccessibleChildren();
return n;
}
// -----------------------------------------------------------------------
-ULONG SvHeaderTabListBox::Insert( SvLBoxEntry* pEntry, ULONG nRootPos )
+sal_uLong SvHeaderTabListBox::Insert( SvLBoxEntry* pEntry, sal_uLong nRootPos )
{
- ULONG nPos = SvTabListBox::Insert( pEntry, nRootPos );
+ sal_uLong nPos = SvTabListBox::Insert( pEntry, nRootPos );
RecalculateAccessibleChildren();
return nPos;
}
@@ -762,7 +762,7 @@ sal_Bool SvHeaderTabListBox::IsCellCheckBox( long _nRow, sal_uInt16 _nColumn, Tr
SvLBoxEntry* pEntry = GetEntry( _nRow );
if ( pEntry )
{
- USHORT nItemCount = pEntry->ItemCount();
+ sal_uInt16 nItemCount = pEntry->ItemCount();
if ( nItemCount > ( _nColumn + 1 ) )
{
SvLBoxButton* pItem = (SvLBoxButton*)( pEntry->GetItem( _nColumn + 1 ) );
@@ -798,8 +798,8 @@ sal_Int32 SvHeaderTabListBox::GetCurrRow() const
SvLBoxEntry* pEntry = GetCurEntry();
if ( pEntry )
{
- ULONG nCount = GetEntryCount();
- for ( ULONG i = 0; i < nCount; ++i )
+ sal_uLong nCount = GetEntryCount();
+ for ( sal_uLong i = 0; i < nCount; ++i )
{
if ( pEntry == GetEntry(i) )
{
@@ -838,13 +838,13 @@ sal_Bool SvHeaderTabListBox::IsCellFocusable() const
return IsCellFocusEnabled();
}
// -----------------------------------------------------------------------
-BOOL SvHeaderTabListBox::GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn )
+sal_Bool SvHeaderTabListBox::GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn )
{
- sal_Bool bRet = ( IsCellFocusEnabled() == TRUE );
+ sal_Bool bRet = ( IsCellFocusEnabled() == sal_True );
if ( bRet )
{
// first set cursor to _nRow
- SetCursor( GetEntry( _nRow ), TRUE );
+ SetCursor( GetEntry( _nRow ), sal_True );
// then set the focus into _nColumn
bRet = ( SetCurrentTabPos( _nColumn ) == true );
}
@@ -853,22 +853,22 @@ BOOL SvHeaderTabListBox::GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn )
// -----------------------------------------------------------------------
void SvHeaderTabListBox::SetNoSelection()
{
- SvLBox::SelectAll( FALSE );
+ SvLBox::SelectAll( sal_False );
}
// -----------------------------------------------------------------------
void SvHeaderTabListBox::SelectAll()
{
- SvLBox::SelectAll( TRUE );
+ SvLBox::SelectAll( sal_True );
}
// -----------------------------------------------------------------------
-void SvHeaderTabListBox::SelectAll( BOOL bSelect, BOOL bPaint )
+void SvHeaderTabListBox::SelectAll( sal_Bool bSelect, sal_Bool bPaint )
{
- // overwritten just to disambiguate the SelectAll() from the base' class SelectAll( BOOl, BOOL )
+ // overwritten just to disambiguate the SelectAll() from the base' class SelectAll( BOOl, sal_Bool )
SvTabListBox::SelectAll( bSelect, bPaint );
}
// -----------------------------------------------------------------------
-void SvHeaderTabListBox::SelectRow( long _nRow, BOOL _bSelect, BOOL )
+void SvHeaderTabListBox::SelectRow( long _nRow, sal_Bool _bSelect, sal_Bool )
{
Select( GetEntry( _nRow ), _bSelect );
}
@@ -895,7 +895,7 @@ bool SvHeaderTabListBox::IsRowSelected( long _nRow ) const
// -----------------------------------------------------------------------
sal_Bool SvHeaderTabListBox::IsColumnSelected( long ) const
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
void SvHeaderTabListBox::GetAllSelectedRows( ::com::sun::star::uno::Sequence< sal_Int32 >& ) const
@@ -911,12 +911,12 @@ sal_Bool SvHeaderTabListBox::IsCellVisible( sal_Int32, sal_uInt16 ) const
return sal_True;
}
// -----------------------------------------------------------------------
-String SvHeaderTabListBox::GetAccessibleCellText( long _nRow, USHORT _nColumnPos ) const
+String SvHeaderTabListBox::GetAccessibleCellText( long _nRow, sal_uInt16 _nColumnPos ) const
{
return ::rtl::OUString( GetTabEntryText( _nRow, _nColumnPos ) );
}
// -----------------------------------------------------------------------
-Rectangle SvHeaderTabListBox::calcHeaderRect( sal_Bool _bIsColumnBar, BOOL _bOnScreen )
+Rectangle SvHeaderTabListBox::calcHeaderRect( sal_Bool _bIsColumnBar, sal_Bool _bOnScreen )
{
Rectangle aRect;
if ( _bIsColumnBar )
@@ -930,7 +930,7 @@ Rectangle SvHeaderTabListBox::calcHeaderRect( sal_Bool _bIsColumnBar, BOOL _bOnS
return aRect;
}
// -----------------------------------------------------------------------
-Rectangle SvHeaderTabListBox::calcTableRect( BOOL _bOnScreen )
+Rectangle SvHeaderTabListBox::calcTableRect( sal_Bool _bOnScreen )
{
Window* pParent = NULL;
if ( !_bOnScreen )
@@ -940,14 +940,14 @@ Rectangle SvHeaderTabListBox::calcTableRect( BOOL _bOnScreen )
return aRect;
}
// -----------------------------------------------------------------------
-Rectangle SvHeaderTabListBox::GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumn, BOOL _bIsHeader, BOOL _bOnScreen )
+Rectangle SvHeaderTabListBox::GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumn, sal_Bool _bIsHeader, sal_Bool _bOnScreen )
{
DBG_ASSERT( !_bIsHeader || 0 == _nRow, "invalid parameters" );
Rectangle aRect;
SvLBoxEntry* pEntry = GetEntry( _nRow );
if ( pEntry )
{
- aRect = _bIsHeader ? calcHeaderRect( sal_True, FALSE ) : GetBoundingRect( pEntry );
+ aRect = _bIsHeader ? calcHeaderRect( sal_True, sal_False ) : GetBoundingRect( pEntry );
Point aTopLeft = aRect.TopLeft();
DBG_ASSERT( m_pImpl->m_pHeaderBar->GetItemCount() > _nColumn, "invalid column" );
Rectangle aItemRect = m_pImpl->m_pHeaderBar->GetItemRect( m_pImpl->m_pHeaderBar->GetItemId( _nColumn ) );
@@ -1105,7 +1105,7 @@ sal_Bool SvHeaderTabListBox::ConvertPointToColumnHeader( sal_uInt16&, const Poin
}
case ::svt::BBTYPE_COLUMNHEADERCELL:
{
- aRetText = m_pImpl->m_pHeaderBar->GetItemText( m_pImpl->m_pHeaderBar->GetItemId( (USHORT)_nPos ) );
+ aRetText = m_pImpl->m_pHeaderBar->GetItemText( m_pImpl->m_pHeaderBar->GetItemId( (sal_uInt16)_nPos ) );
break;
}
@@ -1224,7 +1224,7 @@ void SvHeaderTabListBox::GrabTableFocus()
GrabFocus();
}
// -----------------------------------------------------------------------
-BOOL SvHeaderTabListBox::GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector )
+sal_Bool SvHeaderTabListBox::GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector )
{
return Control::GetGlyphBoundRects( rOrigin, rStr, nIndex, nLen, nBase, rVector );
}
@@ -1239,7 +1239,7 @@ void SvHeaderTabListBox::GrabFocus()
Control::GrabFocus();
}
// -----------------------------------------------------------------------
-Reference< XAccessible > SvHeaderTabListBox::GetAccessible( BOOL bCreate )
+Reference< XAccessible > SvHeaderTabListBox::GetAccessible( sal_Bool bCreate )
{
return Control::GetAccessible( bCreate );
}
@@ -1283,7 +1283,7 @@ Rectangle SvHeaderTabListBox::GetFieldCharacterBounds(sal_Int32,sal_Int32,sal_In
// -----------------------------------------------------------------------------
sal_Int32 SvHeaderTabListBox::GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint)
{
- String sText = GetAccessibleCellText( _nRow, static_cast< USHORT >( _nColumnPos ) );
+ String sText = GetAccessibleCellText( _nRow, static_cast< sal_uInt16 >( _nColumnPos ) );
MetricVector aRects;
if ( GetGlyphBoundRects(Point(0,0),sText,0,STRING_LEN,0,aRects) )
{
diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx
index 96c91a3b8992..12ac258dd31c 100644
--- a/svtools/source/contnr/svtreebx.cxx
+++ b/svtools/source/contnr/svtreebx.cxx
@@ -61,10 +61,10 @@ DBG_NAME(SvTreeListBox)
#define SV_LBOX_DEFAULT_INDENT_PIXEL 20
SvTreeListBox::SvTreeListBox( Window* pParent, WinBits nWinStyle )
- : SvLBox(pParent,nWinStyle )
+ : SvLBox( pParent, nWinStyle )
{
DBG_CTOR(SvTreeListBox,0);
- InitTreeView( nWinStyle );
+ InitTreeView();
SetSublistOpenWithLeftRight();
}
@@ -74,13 +74,13 @@ SvTreeListBox::SvTreeListBox( Window* pParent , const ResId& rResId )
{
DBG_CTOR(SvTreeListBox,0);
- InitTreeView( 0 );
+ InitTreeView();
Resize();
SetSublistOpenWithLeftRight();
}
-void SvTreeListBox::InitTreeView( WinBits nWinStyle )
+void SvTreeListBox::InitTreeView()
{
DBG_CHKTHIS(SvTreeListBox,0);
pCheckButtonData = NULL;
@@ -98,15 +98,15 @@ void SvTreeListBox::InitTreeView( WinBits nWinStyle )
nTreeFlags = TREEFLAG_RECALCTABS;
nIndent = SV_LBOX_DEFAULT_INDENT_PIXEL;
nEntryHeightOffs = SV_ENTRYHEIGHTOFFS_PIXEL;
- pImp = new SvImpLBox( this, GetModel(), nWinStyle );
+ pImp = new SvImpLBox( this, GetModel(), GetStyle() );
aContextBmpMode = SVLISTENTRYFLAG_EXPANDED;
nContextBmpWidthMax = 0;
SetFont( GetFont() );
SetSpaceBetweenEntries( 0 );
SetLineColor();
- InitSettings( TRUE, TRUE, TRUE );
- SetWindowBits( nWinStyle );
+ InitSettings( sal_True, sal_True, sal_True );
+ ImplInitStyle();
SetTabs();
}
@@ -145,28 +145,28 @@ void SvTreeListBox::DisconnectFromModel()
}
-USHORT SvTreeListBox::IsA()
+sal_uInt16 SvTreeListBox::IsA()
{
DBG_CHKTHIS(SvTreeListBox,0);
return SV_LISTBOX_ID_TREEBOX;
}
-void SvTreeListBox::SetSublistOpenWithReturn( BOOL b )
+void SvTreeListBox::SetSublistOpenWithReturn( sal_Bool b )
{
pImp->bSubLstOpRet = b;
}
-BOOL SvTreeListBox::IsSublistOpenWithReturn() const
+sal_Bool SvTreeListBox::IsSublistOpenWithReturn() const
{
return pImp->bSubLstOpRet;
}
-void SvTreeListBox::SetSublistOpenWithLeftRight( BOOL b )
+void SvTreeListBox::SetSublistOpenWithLeftRight( sal_Bool b )
{
pImp->bSubLstOpLR = b;
}
-BOOL SvTreeListBox::IsSublistOpenWithLeftRight() const
+sal_Bool SvTreeListBox::IsSublistOpenWithLeftRight() const
{
return pImp->bSubLstOpLR;
}
@@ -175,12 +175,12 @@ void SvTreeListBox::Resize()
{
DBG_CHKTHIS(SvTreeListBox,0);
if( IsEditingActive() )
- EndEditing( TRUE );
+ EndEditing( sal_True );
SvLBox::Resize();
pImp->Resize();
nFocusWidth = -1;
- pImp->ShowCursor( FALSE );
- pImp->ShowCursor( TRUE );
+ pImp->ShowCursor( sal_False );
+ pImp->ShowCursor( sal_True );
}
/* Faelle:
@@ -220,11 +220,12 @@ void SvTreeListBox::SetTabs()
{
DBG_CHKTHIS(SvTreeListBox,0);
if( IsEditingActive() )
- EndEditing( TRUE );
+ EndEditing( sal_True );
nTreeFlags &= (~TREEFLAG_RECALCTABS);
nFocusWidth = -1;
- BOOL bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0;
- BOOL bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT |
+ const WinBits nStyle( GetStyle() );
+ sal_Bool bHasButtons = (nStyle & WB_HASBUTTONS)!=0;
+ sal_Bool bHasButtonsAtRoot = (nStyle & (WB_HASLINESATROOT |
WB_HASBUTTONSATROOT))!=0;
long nStartPos = TAB_STARTPOS;
long nNodeWidthPixel = GetExpandedNodeBmp().GetSizePixel().Width();
@@ -349,8 +350,8 @@ String SvTreeListBox::SearchEntryText( SvLBoxEntry* pEntry ) const
DBG_CHKTHIS(SvTreeListBox,0);
DBG_ASSERT( pEntry, "SvTreeListBox::SearchEntryText(): no entry" );
String sRet;
- USHORT nCount = pEntry->ItemCount();
- USHORT nCur = 0;
+ sal_uInt16 nCount = pEntry->ItemCount();
+ sal_uInt16 nCur = 0;
SvLBoxItem* pItem;
while( nCur < nCount )
{
@@ -396,7 +397,7 @@ IMPL_LINK_INLINE_END( SvTreeListBox, CheckButtonClick, SvLBoxButtonData *, pData
SvLBoxEntry* SvTreeListBox::InsertEntry(
const XubString& aText,
SvLBoxEntry* pParent,
- BOOL bChildsOnDemand, ULONG nPos,
+ sal_Bool bChildsOnDemand, sal_uLong nPos,
void* pUser,
SvLBoxButtonKind eButtonKind
)
@@ -430,7 +431,7 @@ SvLBoxEntry* SvTreeListBox::InsertEntry(
SvLBoxEntry* SvTreeListBox::InsertEntry( const XubString& aText,
const Image& aExpEntryBmp, const Image& aCollEntryBmp,
- SvLBoxEntry* pParent, BOOL bChildsOnDemand, ULONG nPos, void* pUser,
+ SvLBoxEntry* pParent, sal_Bool bChildsOnDemand, sal_uLong nPos, void* pUser,
SvLBoxButtonKind eButtonKind )
{
DBG_CHKTHIS(SvTreeListBox,0);
@@ -513,7 +514,7 @@ void SvTreeListBox::ImpEntryInserted( SvLBoxEntry* pEntry )
SvLBoxEntry* pParent = (SvLBoxEntry*)pModel->GetParent( pEntry );
if( pParent )
{
- USHORT nFlags = pParent->GetFlags();
+ sal_uInt16 nFlags = pParent->GetFlags();
nFlags &= ~SV_ENTRYFLAG_NO_NODEBMP;
pParent->SetFlags( nFlags );
}
@@ -575,7 +576,7 @@ SvButtonState SvTreeListBox::GetCheckButtonState( SvLBoxEntry* pEntry ) const
SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
if(!pItem)
return SV_BUTTON_TRISTATE;
- USHORT nButtonFlags = pItem->GetButtonFlags();
+ sal_uInt16 nButtonFlags = pItem->GetButtonFlags();
eState = pCheckButtonData->ConvertToButtonState( nButtonFlags );
}
return eState;
@@ -626,7 +627,7 @@ SvLBoxEntry* SvTreeListBox::CloneEntry( SvLBoxEntry* pSource )
return pClone;
}
-void SvTreeListBox::ShowExpandBitmapOnCursor( BOOL bYes )
+void SvTreeListBox::ShowExpandBitmapOnCursor( sal_Bool bYes )
{
DBG_CHKTHIS(SvTreeListBox,0);
if( bYes )
@@ -719,19 +720,19 @@ void SvTreeListBox::SetNodeBitmaps( const Image& rCollapsedNodeBmp, const Image&
SetTabs();
}
-BOOL SvTreeListBox::EditingEntry( SvLBoxEntry*, Selection& )
+sal_Bool SvTreeListBox::EditingEntry( SvLBoxEntry*, Selection& )
{
DBG_CHKTHIS(SvTreeListBox,0);
- return TRUE;
+ return sal_True;
}
-BOOL SvTreeListBox::EditedEntry( SvLBoxEntry* /*pEntry*/,const XubString& /*rNewText*/)
+sal_Bool SvTreeListBox::EditedEntry( SvLBoxEntry* /*pEntry*/,const XubString& /*rNewText*/)
{
DBG_CHKTHIS(SvTreeListBox,0);
- return TRUE;
+ return sal_True;
}
-void SvTreeListBox::EnableInplaceEditing( BOOL bOn )
+void SvTreeListBox::EnableInplaceEditing( sal_Bool bOn )
{
DBG_CHKTHIS(SvTreeListBox,0);
SvLBox::EnableInplaceEditing( bOn );
@@ -747,7 +748,7 @@ void SvTreeListBox::KeyInput( const KeyEvent& rKEvt )
nImpFlags |= SVLBOX_IS_TRAVELSELECT;
#ifdef OVDEBUG
- USHORT nCode = rKEvt.GetKeyCode().GetCode();
+ sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
switch ( nCode )
{
case KEY_F1:
@@ -771,7 +772,7 @@ void SvTreeListBox::RequestingChilds( SvLBoxEntry* pParent )
{
DBG_CHKTHIS(SvTreeListBox,0);
if( !pParent->HasChilds() )
- InsertEntry( String::CreateFromAscii("<dummy>"), pParent, FALSE, LIST_APPEND );
+ InsertEntry( String::CreateFromAscii("<dummy>"), pParent, sal_False, LIST_APPEND );
}
void SvTreeListBox::GetFocus()
@@ -815,7 +816,7 @@ void SvTreeListBox::ModelHasCleared()
SvLBox::ModelHasCleared();
}
-void SvTreeListBox::ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL /* bShow */ )
+void SvTreeListBox::ShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool /* bShow */ )
{
DBG_CHKTHIS(SvTreeListBox,0);
pImp->PaintDDCursor( pEntry );
@@ -839,13 +840,13 @@ void SvTreeListBox::ScrollOutputArea( short nDeltaEntries )
long nTemp = nThumb + nVis;
if( nDeltaEntries > (nMax - nTemp) )
nDeltaEntries = (short)(nMax - nTemp);
- pImp->PageDown( (USHORT)nDeltaEntries );
+ pImp->PageDown( (sal_uInt16)nDeltaEntries );
}
else
{
if( nDeltaEntries > nThumb )
nDeltaEntries = (short)nThumb;
- pImp->PageUp( (USHORT)nDeltaEntries );
+ pImp->PageUp( (sal_uInt16)nDeltaEntries );
}
pImp->SyncVerThumb();
NotifyEndScroll();
@@ -889,8 +890,8 @@ void SvTreeListBox::SetEntryHeight( SvLBoxEntry* pEntry )
{
DBG_CHKTHIS(SvTreeListBox,0);
short nHeight, nHeightMax=0;
- USHORT nCount = pEntry->ItemCount();
- USHORT nCur = 0;
+ sal_uInt16 nCount = pEntry->ItemCount();
+ sal_uInt16 nCur = 0;
SvViewDataEntry* pViewData = GetViewDataEntry( pEntry );
while( nCur < nCount )
{
@@ -909,7 +910,7 @@ void SvTreeListBox::SetEntryHeight( SvLBoxEntry* pEntry )
}
}
-void SvTreeListBox::SetEntryHeight( short nHeight, BOOL bAlways )
+void SvTreeListBox::SetEntryHeight( short nHeight, sal_Bool bAlways )
{
DBG_CHKTHIS(SvTreeListBox,0);
@@ -950,12 +951,12 @@ void SvTreeListBox::AdjustEntryHeight( const Font& rFont )
}
}
-BOOL SvTreeListBox::Expand( SvLBoxEntry* pParent )
+sal_Bool SvTreeListBox::Expand( SvLBoxEntry* pParent )
{
DBG_CHKTHIS(SvTreeListBox,0);
pHdlEntry = pParent;
- BOOL bExpanded = FALSE;
- USHORT nFlags;
+ sal_Bool bExpanded = sal_False;
+ sal_uInt16 nFlags;
if( pParent->HasChildsOnDemand() )
RequestingChilds( pParent );
@@ -964,7 +965,7 @@ BOOL SvTreeListBox::Expand( SvLBoxEntry* pParent )
nImpFlags |= SVLBOX_IS_EXPANDING;
if( ExpandingHdl() )
{
- bExpanded = TRUE;
+ bExpanded = sal_True;
SvListView::Expand( pParent );
pImp->EntryExpanded( pParent );
pHdlEntry = pParent;
@@ -992,16 +993,16 @@ BOOL SvTreeListBox::Expand( SvLBoxEntry* pParent )
return bExpanded;
}
-BOOL SvTreeListBox::Collapse( SvLBoxEntry* pParent )
+sal_Bool SvTreeListBox::Collapse( SvLBoxEntry* pParent )
{
DBG_CHKTHIS(SvTreeListBox,0);
nImpFlags &= ~SVLBOX_IS_EXPANDING;
pHdlEntry = pParent;
- BOOL bCollapsed = FALSE;
+ sal_Bool bCollapsed = sal_False;
if( ExpandingHdl() )
{
- bCollapsed = TRUE;
+ bCollapsed = sal_True;
pImp->CollapsingEntry( pParent );
SvListView::Collapse( pParent );
pImp->EntryCollapsed( pParent );
@@ -1018,11 +1019,11 @@ BOOL SvTreeListBox::Collapse( SvLBoxEntry* pParent )
return bCollapsed;
}
-BOOL SvTreeListBox::Select( SvLBoxEntry* pEntry, BOOL bSelect )
+sal_Bool SvTreeListBox::Select( SvLBoxEntry* pEntry, sal_Bool bSelect )
{
DBG_CHKTHIS(SvTreeListBox,0);
DBG_ASSERT(pEntry,"Select: Null-Ptr");
- BOOL bRetVal = SvListView::Select( pEntry, bSelect );
+ sal_Bool bRetVal = SvListView::Select( pEntry, bSelect );
DBG_ASSERT(IsSelected(pEntry)==bSelect,"Select failed");
if( bRetVal )
{
@@ -1039,14 +1040,14 @@ BOOL SvTreeListBox::Select( SvLBoxEntry* pEntry, BOOL bSelect )
return bRetVal;
}
-ULONG SvTreeListBox::SelectChilds( SvLBoxEntry* pParent, BOOL bSelect )
+sal_uLong SvTreeListBox::SelectChilds( SvLBoxEntry* pParent, sal_Bool bSelect )
{
DBG_CHKTHIS(SvTreeListBox,0);
pImp->DestroyAnchor();
- ULONG nRet = 0;
+ sal_uLong nRet = 0;
if( !pParent->HasChilds() )
return 0;
- USHORT nRefDepth = pModel->GetDepth( pParent );
+ sal_uInt16 nRefDepth = pModel->GetDepth( pParent );
SvLBoxEntry* pChild = FirstChild( pParent );
do {
nRet++;
@@ -1056,19 +1057,19 @@ ULONG SvTreeListBox::SelectChilds( SvLBoxEntry* pParent, BOOL bSelect )
return nRet;
}
-void SvTreeListBox::SelectAll( BOOL bSelect, BOOL )
+void SvTreeListBox::SelectAll( sal_Bool bSelect, sal_Bool )
{
DBG_CHKTHIS(SvTreeListBox,0);
pImp->SelAllDestrAnch(
bSelect,
- TRUE, // Anker loeschen,
- TRUE ); // auch bei SINGLE_SELECTION den Cursor deselektieren
+ sal_True, // Anker loeschen,
+ sal_True ); // auch bei SINGLE_SELECTION den Cursor deselektieren
}
void SvTreeListBox::ModelHasInsertedTree( SvListEntry* pEntry )
{
DBG_CHKTHIS(SvTreeListBox,0);
- USHORT nRefDepth = pModel->GetDepth( (SvLBoxEntry*)pEntry );
+ sal_uInt16 nRefDepth = pModel->GetDepth( (SvLBoxEntry*)pEntry );
SvLBoxEntry* pTmp = (SvLBoxEntry*)pEntry;
do
{
@@ -1087,7 +1088,7 @@ void SvTreeListBox::ModelHasInserted( SvListEntry* pEntry )
void SvTreeListBox::ModelIsMoving(SvListEntry* pSource,
SvListEntry* /* pTargetParent */,
- ULONG /* nChildPos */ )
+ sal_uLong /* nChildPos */ )
{
DBG_CHKTHIS(SvTreeListBox,0);
pImp->MovingEntry( (SvLBoxEntry*)pSource );
@@ -1109,9 +1110,11 @@ void SvTreeListBox::ModelIsRemoving( SvListEntry* pEntry )
NotifyRemoving( (SvLBoxEntry*)pEntry );
}
-void SvTreeListBox::ModelHasRemoved( SvListEntry* /* pEntry */ )
+void SvTreeListBox::ModelHasRemoved( SvListEntry* pEntry )
{
DBG_CHKTHIS(SvTreeListBox,0);
+ if ( pEntry == pHdlEntry)
+ pHdlEntry = NULL;
pImp->EntryRemoved();
}
@@ -1134,7 +1137,7 @@ void SvTreeListBox::SetFont( const Font& rFont )
{
DBG_CHKTHIS(SvTreeListBox,0);
Font aTempFont( rFont );
- aTempFont.SetTransparent( TRUE );
+ aTempFont.SetTransparent( sal_True );
Control::SetFont( aTempFont );
AdjustEntryHeight( aTempFont );
// immer Invalidieren, sonst fallen wir
@@ -1171,13 +1174,13 @@ void SvTreeListBox::MouseMove( const MouseEvent& rMEvt )
}
-void SvTreeListBox::SetUpdateMode( BOOL bUpdate )
+void SvTreeListBox::SetUpdateMode( sal_Bool bUpdate )
{
DBG_CHKTHIS(SvTreeListBox,0);
pImp->SetUpdateMode( bUpdate );
}
-void SvTreeListBox::SetUpdateModeFast( BOOL bUpdate )
+void SvTreeListBox::SetUpdateModeFast( sal_Bool bUpdate )
{
DBG_CHKTHIS(SvTreeListBox,0);
pImp->SetUpdateModeFast( bUpdate );
@@ -1197,7 +1200,7 @@ void SvTreeListBox::SetSpaceBetweenEntries( short nOffsLogic )
}
}
-void SvTreeListBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect )
+void SvTreeListBox::SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect )
{
DBG_CHKTHIS(SvTreeListBox,0);
pImp->SetCursor(pEntry, bForceNoSelect);
@@ -1234,7 +1237,7 @@ void SvTreeListBox::MakeVisible( SvLBoxEntry* pEntry )
pImp->MakeVisible(pEntry);
}
-void SvTreeListBox::MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop )
+void SvTreeListBox::MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop )
{
pImp->MakeVisible( pEntry, bMoveToTop );
}
@@ -1255,11 +1258,11 @@ void SvTreeListBox::EditItemText( SvLBoxEntry* pEntry, SvLBoxString* pItem,
DBG_ASSERT(pEntry&&pItem,"EditItemText: Bad params");
if( IsSelected( pEntry ))
{
- pImp->ShowCursor( FALSE );
- SvListView::Select( pEntry, FALSE );
+ pImp->ShowCursor( sal_False );
+ SvListView::Select( pEntry, sal_False );
PaintEntry( pEntry );
- SvListView::Select( pEntry, TRUE );
- pImp->ShowCursor( TRUE );
+ SvListView::Select( pEntry, sal_True );
+ pImp->ShowCursor( sal_True );
}
pEdEntry = pEntry;
pEdItem = pItem;
@@ -1272,7 +1275,7 @@ void SvTreeListBox::EditItemText( SvLBoxEntry* pEntry, SvLBoxString* pItem,
aPos.X() = GetTabPos( pEntry, pTab );
long nOutputWidth = pImp->GetOutputSize().Width();
Size aSize( nOutputWidth - aPos.X(), aItemSize.Height() );
- USHORT nPos = aTabs.GetPos( pTab );
+ sal_uInt16 nPos = aTabs.GetPos( pTab );
if( nPos+1 < aTabs.Count() )
{
SvLBoxTab* pRightTab = (SvLBoxTab*)aTabs.GetObject( nPos + 1 );
@@ -1318,8 +1321,8 @@ void SvTreeListBox::ImplEditEntry( SvLBoxEntry* pEntry )
bool bIsMouseTriggered = nClickX >= 0;
SvLBoxString* pItem = NULL;
- USHORT nCount = pEntry->ItemCount();
- for( USHORT i = 0 ; i < nCount ; i++ )
+ sal_uInt16 nCount = pEntry->ItemCount();
+ for( sal_uInt16 i = 0 ; i < nCount ; i++ )
{
SvLBoxItem* pTmpItem = pEntry->GetItem( i );
if( pTmpItem->IsA() != SV_ITEM_ID_LBOXSTRING )
@@ -1348,7 +1351,7 @@ void SvTreeListBox::ImplEditEntry( SvLBoxEntry* pEntry )
Selection aSel( SELECTION_MIN, SELECTION_MAX );
if( pItem && EditingEntry( pEntry, aSel ) )
{
- SelectAll( FALSE );
+ SelectAll( sal_False );
MakeVisible( pEntry );
EditItemText( pEntry, pItem, aSel );
}
@@ -1394,7 +1397,7 @@ void SvTreeListBox::EditingRequest( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
Selection aSel( SELECTION_MIN, SELECTION_MAX );
if( EditingEntry( pEntry, aSel ) )
{
- SelectAll( FALSE );
+ SelectAll( sal_False );
EditItemText( pEntry, (SvLBoxString*)pItem, aSel );
}
}
@@ -1408,7 +1411,7 @@ SvLBoxEntry* SvTreeListBox::GetDropTarget( const Point& rPos )
// Scrollen
if( rPos.Y() < 12 )
{
- SvLBox::ImplShowTargetEmphasis( SvLBox::pTargetEntry, FALSE );
+ SvLBox::ImplShowTargetEmphasis( SvLBox::pTargetEntry, sal_False );
ScrollOutputArea( +1 );
}
else
@@ -1416,7 +1419,7 @@ SvLBoxEntry* SvTreeListBox::GetDropTarget( const Point& rPos )
Size aSize( pImp->GetOutputSize() );
if( rPos.Y() > aSize.Height() - 12 )
{
- SvLBox::ImplShowTargetEmphasis( SvLBox::pTargetEntry, FALSE );
+ SvLBox::ImplShowTargetEmphasis( SvLBox::pTargetEntry, sal_False );
ScrollOutputArea( -1 );
}
}
@@ -1433,7 +1436,7 @@ SvLBoxEntry* SvTreeListBox::GetDropTarget( const Point& rPos )
}
-SvLBoxEntry* SvTreeListBox::GetEntry( const Point& rPos, BOOL bHit ) const
+SvLBoxEntry* SvTreeListBox::GetEntry( const Point& rPos, sal_Bool bHit ) const
{
DBG_CHKTHIS(SvTreeListBox,0);
SvLBoxEntry* pEntry = pImp->GetEntry( rPos );
@@ -1452,12 +1455,14 @@ SvLBoxEntry* SvTreeListBox::GetCurEntry() const
return pImp->GetCurEntry();
}
-void SvTreeListBox::SetWindowBits( WinBits nWinStyle )
+void SvTreeListBox::ImplInitStyle()
{
DBG_CHKTHIS(SvTreeListBox,0);
- nWindowStyle = nWinStyle;
+
+ const WinBits nWindowStyle = GetStyle();
+
nTreeFlags |= TREEFLAG_RECALCTABS;
- if( nWinStyle & WB_SORT )
+ if( nWindowStyle & WB_SORT )
{
GetModel()->SetSortMode( SortAscending );
GetModel()->SetCompareHdl( LINK(this,SvTreeListBox,DefaultCompare));
@@ -1468,9 +1473,9 @@ void SvTreeListBox::SetWindowBits( WinBits nWinStyle )
GetModel()->SetCompareHdl( Link() );
}
#ifdef OS2
- nWinStyle |= WB_VSCROLL;
+ nWindowStyle |= WB_VSCROLL;
#endif
- pImp->SetWindowBits( nWinStyle );
+ pImp->SetStyle( nWindowStyle );
pImp->Resize();
Invalidate();
}
@@ -1494,21 +1499,21 @@ void SvTreeListBox::InvalidateEntry( SvLBoxEntry* pEntry )
}
-long SvTreeListBox::PaintEntry(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags)
+long SvTreeListBox::PaintEntry(SvLBoxEntry* pEntry,long nLine,sal_uInt16 nTabFlags)
{
return PaintEntry1(pEntry,nLine,nTabFlags);
}
#define SV_TAB_BORDER 8
-long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags,
- BOOL bHasClipRegion )
+long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,sal_uInt16 nTabFlags,
+ sal_Bool bHasClipRegion )
{
DBG_CHKTHIS(SvTreeListBox,0);
Rectangle aRect; // multi purpose
- BOOL bHorSBar = pImp->HasHorScrollBar();
+ sal_Bool bHorSBar = pImp->HasHorScrollBar();
PreparePaint( pEntry );
pImp->UpdateContextBmpWidthMax( pEntry );
@@ -1533,11 +1538,12 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags,
Color aBackupColor = GetFillColor();
bool bCurFontIsSel = false;
- BOOL bInUse = pEntry->HasInUseEmphasis();
+ sal_Bool bInUse = pEntry->HasInUseEmphasis();
// wenn eine ClipRegion von aussen gesetzt wird, dann
// diese nicht zuruecksetzen
- BOOL bResetClipRegion = !bHasClipRegion;
- BOOL bHideSelection = ((nWindowStyle & WB_HIDESELECTION) && !HasFocus())!=0;
+ const WinBits nWindowStyle = GetStyle();
+ const sal_Bool bResetClipRegion = !bHasClipRegion;
+ const sal_Bool bHideSelection = ((nWindowStyle & WB_HIDESELECTION) && !HasFocus())!=0;
const StyleSettings& rSettings = GetSettings().GetStyleSettings();
Font aHighlightFont( GetFont() );
@@ -1549,24 +1555,24 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags,
if( !bHasClipRegion && nWindowStyle & WB_HSCROLL )
{
SetClipRegion( Region(pImp->GetClipRegionRect()) );
- bHasClipRegion = TRUE;
+ bHasClipRegion = sal_True;
}
SvViewDataEntry* pViewDataEntry = GetViewDataEntry( pEntry );
- USHORT nTabCount = aTabs.Count();
- USHORT nItemCount = pEntry->ItemCount();
- USHORT nCurTab = 0;
- USHORT nCurItem = 0;
+ sal_uInt16 nTabCount = aTabs.Count();
+ sal_uInt16 nItemCount = pEntry->ItemCount();
+ sal_uInt16 nCurTab = 0;
+ sal_uInt16 nCurItem = 0;
while( nCurTab < nTabCount && nCurItem < nItemCount )
{
SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject( nCurTab );
- USHORT nNextTab = nCurTab + 1;
+ sal_uInt16 nNextTab = nCurTab + 1;
SvLBoxTab* pNextTab = nNextTab < nTabCount ? (SvLBoxTab*)aTabs.GetObject(nNextTab) : 0;
SvLBoxItem* pItem = nCurItem < nItemCount ? pEntry->GetItem(nCurItem) : 0;
- USHORT nFlags = pTab->nFlags;
+ sal_uInt16 nFlags = pTab->nFlags;
Size aSize( pItem->GetSize( pViewDataEntry, nCurItem ));
long nTabPos = GetTabPos( pEntry, pTab );
@@ -1592,7 +1598,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags,
if( !bHasClipRegion && nX + aSize.Width() >= nMaxRight )
{
SetClipRegion( Region(pImp->GetClipRegionRect()) );
- bHasClipRegion = TRUE;
+ bHasClipRegion = sal_True;
}
aEntryPos.X() = nX;
aEntryPos.Y() = nLine;
@@ -1602,7 +1608,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags,
Wallpaper aWallpaper = GetBackground();
int bSelTab = nFlags & SV_LBOXTAB_SHOW_SELECTION;
- USHORT nItemType = pItem->IsA();
+ sal_uInt16 nItemType = pItem->IsA();
if ( pViewDataEntry->IsSelected() && bSelTab && !pViewDataEntry->IsCursored() )
{
@@ -1716,7 +1722,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags,
SetFont( aBackupFont );
}
- USHORT nFirstDynTabPos;
+ sal_uInt16 nFirstDynTabPos;
SvLBoxTab* pFirstDynamicTab = GetFirstDynamicTab( nFirstDynTabPos );
long nDynTabPos = GetTabPos( pEntry, pFirstDynamicTab );
nDynTabPos += pImp->nNodeBmpTabDistance;
@@ -1730,7 +1736,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags,
{
// ersten festen Tab suchen, und pruefen ob die Node-Bitmap
// in ihn hineinragt
- USHORT nNextTab = nFirstDynTabPos;
+ sal_uInt16 nNextTab = nFirstDynTabPos;
SvLBoxTab* pNextTab;
do
{
@@ -1760,12 +1766,12 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags,
}
aPos.Y() += (nTempEntryHeight - pImg->GetSizePixel().Height()) / 2;
- USHORT nStyle = 0;
+ sal_uInt16 nStyle = 0;
if ( !IsEnabled() )
nStyle |= IMAGE_DRAW_DISABLE;
//native
- BOOL bNativeOK = FALSE;
+ sal_Bool bNativeOK = sal_False;
if ( IsNativeControlSupported( CTRL_LISTNODE, PART_ENTIRE_CONTROL) )
{
ImplControlValue aControlValue;
@@ -1820,7 +1826,7 @@ Rectangle SvTreeListBox::GetFocusRect( SvLBoxEntry* pEntry, long nLine )
long nRealWidth = pImp->GetOutputSize().Width();
nRealWidth -= GetMapMode().GetOrigin().X();
- USHORT nCurTab;
+ sal_uInt16 nCurTab;
SvLBoxTab* pTab = GetFirstTab( SV_LBOXTAB_SHOW_SELECTION, nCurTab );
long nTabPos = 0;
if( pTab )
@@ -1838,7 +1844,7 @@ Rectangle SvTreeListBox::GetFocusRect( SvLBoxEntry* pEntry, long nLine )
nNextTabPos += 50;
}
- BOOL bUserSelection = (BOOL)( nTreeFlags & TREEFLAG_USESEL ) != 0;
+ sal_Bool bUserSelection = (sal_Bool)( nTreeFlags & TREEFLAG_USESEL ) != 0;
if( !bUserSelection )
{
if( pTab && nCurTab < pEntry->ItemCount() )
@@ -1863,7 +1869,7 @@ Rectangle SvTreeListBox::GetFocusRect( SvLBoxEntry* pEntry, long nLine )
// wenn erster SelTab != 0, dann muessen wir auch rechnen
if( nFocusWidth == -1 || nFirstSelTab )
{
- USHORT nLastTab;
+ sal_uInt16 nLastTab;
SvLBoxTab* pLastTab = GetLastTab(SV_LBOXTAB_SHOW_SELECTION,nLastTab);
nLastTab++;
if( nLastTab < aTabs.Count() ) // gibts noch einen ?
@@ -1911,23 +1917,23 @@ long SvTreeListBox::GetTabPos( SvLBoxEntry* pEntry, SvLBoxTab* pTab)
long nPos = pTab->GetPos();
if( pTab->IsDynamic() )
{
- USHORT nDepth = pModel->GetDepth( pEntry );
- nDepth = nDepth * (USHORT)nIndent;
+ sal_uInt16 nDepth = pModel->GetDepth( pEntry );
+ nDepth = nDepth * (sal_uInt16)nIndent;
nPos += (long)nDepth;
}
return nPos;
}
SvLBoxItem* SvTreeListBox::GetItem_Impl( SvLBoxEntry* pEntry, long nX,
- SvLBoxTab** ppTab, USHORT nEmptyWidth )
+ SvLBoxTab** ppTab, sal_uInt16 nEmptyWidth )
{
DBG_CHKTHIS(SvTreeListBox,0);
SvLBoxItem* pItemClicked = 0;
- USHORT nTabCount = aTabs.Count();
- USHORT nItemCount = pEntry->ItemCount();
+ sal_uInt16 nTabCount = aTabs.Count();
+ sal_uInt16 nItemCount = pEntry->ItemCount();
SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(0);
SvLBoxItem* pItem = pEntry->GetItem(0);
- USHORT nNextItem = 1;
+ sal_uInt16 nNextItem = 1;
nX -= GetMapMode().GetOrigin().X();
long nRealWidth = pImp->GetOutputSize().Width();
nRealWidth -= GetMapMode().GetOrigin().X();
@@ -1996,9 +2002,9 @@ SvLBoxItem* SvTreeListBox::GetFirstDynamicItem( SvLBoxEntry* pEntry )
SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(0);
SvLBoxItem* pItem = pEntry->GetItem(0);
- USHORT nTabCount = aTabs.Count();
+ sal_uInt16 nTabCount = aTabs.Count();
- USHORT nNext = 1;
+ sal_uInt16 nNext = 1;
while ( !pTab->IsDynamic() && nNext < nTabCount )
{
pItem = pEntry->GetItem( nNext );
@@ -2008,7 +2014,7 @@ SvLBoxItem* SvTreeListBox::GetFirstDynamicItem( SvLBoxEntry* pEntry )
return pItem;
}
-void SvTreeListBox::AddTab(long nTabPos,USHORT nFlags,void* pUserData )
+void SvTreeListBox::AddTab(long nTabPos,sal_uInt16 nFlags,void* pUserData )
{
DBG_CHKTHIS(SvTreeListBox,0);
nFocusWidth = -1;
@@ -2017,7 +2023,7 @@ void SvTreeListBox::AddTab(long nTabPos,USHORT nFlags,void* pUserData )
aTabs.Insert( pTab, aTabs.Count() );
if( nTreeFlags & TREEFLAG_USESEL )
{
- USHORT nPos = aTabs.Count() - 1;
+ sal_uInt16 nPos = aTabs.Count() - 1;
if( nPos >= nFirstSelTab && nPos <= nLastSelTab )
pTab->nFlags |= SV_LBOXTAB_SHOW_SELECTION;
else
@@ -2029,11 +2035,11 @@ void SvTreeListBox::AddTab(long nTabPos,USHORT nFlags,void* pUserData )
-SvLBoxTab* SvTreeListBox::GetFirstDynamicTab( USHORT& rPos ) const
+SvLBoxTab* SvTreeListBox::GetFirstDynamicTab( sal_uInt16& rPos ) const
{
DBG_CHKTHIS(SvTreeListBox,0);
- USHORT nCurTab = 0;
- USHORT nTabCount = aTabs.Count();
+ sal_uInt16 nCurTab = 0;
+ sal_uInt16 nTabCount = aTabs.Count();
while( nCurTab < nTabCount )
{
SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(nCurTab);
@@ -2049,21 +2055,21 @@ SvLBoxTab* SvTreeListBox::GetFirstDynamicTab( USHORT& rPos ) const
SvLBoxTab* SvTreeListBox::GetFirstDynamicTab() const
{
- USHORT nDummy;
+ sal_uInt16 nDummy;
return GetFirstDynamicTab( nDummy );
}
SvLBoxTab* SvTreeListBox::GetTab( SvLBoxEntry* pEntry, SvLBoxItem* pItem) const
{
DBG_CHKTHIS(SvTreeListBox,0);
- USHORT nPos = pEntry->GetPos( pItem );
+ sal_uInt16 nPos = pEntry->GetPos( pItem );
return (SvLBoxTab*)aTabs.GetObject( nPos );
}
void SvTreeListBox::ClearTabList()
{
DBG_CHKTHIS(SvTreeListBox,0);
- USHORT nTabCount = aTabs.Count();
+ sal_uInt16 nTabCount = aTabs.Count();
while( nTabCount )
{
nTabCount--;
@@ -2107,7 +2113,7 @@ void SvTreeListBox::NotifyInvalidating()
DBG_CHKTHIS(SvTreeListBox,0);
}
-void SvTreeListBox::Invalidate( USHORT nInvalidateFlags )
+void SvTreeListBox::Invalidate( sal_uInt16 nInvalidateFlags )
{
DBG_CHKTHIS(SvTreeListBox,0);
if( nFocusWidth == -1 )
@@ -2118,7 +2124,7 @@ void SvTreeListBox::Invalidate( USHORT nInvalidateFlags )
pImp->Invalidate();
}
-void SvTreeListBox::Invalidate( const Rectangle& rRect, USHORT nInvalidateFlags )
+void SvTreeListBox::Invalidate( const Rectangle& rRect, sal_uInt16 nInvalidateFlags )
{
DBG_CHKTHIS(SvTreeListBox,0);
if( nFocusWidth == -1 )
@@ -2129,11 +2135,11 @@ void SvTreeListBox::Invalidate( const Rectangle& rRect, USHORT nInvalidateFlags
}
-void SvTreeListBox::SetHighlightRange( USHORT nStart, USHORT nEnd)
+void SvTreeListBox::SetHighlightRange( sal_uInt16 nStart, sal_uInt16 nEnd)
{
DBG_CHKTHIS(SvTreeListBox,0);
- USHORT nTemp;
+ sal_uInt16 nTemp;
nTreeFlags |= TREEFLAG_USESEL;
if( nStart > nEnd )
{
@@ -2156,12 +2162,12 @@ void SvTreeListBox::RemoveHighlightRange()
Invalidate();
}
-ULONG SvTreeListBox::GetAscInsertionPos(SvLBoxEntry*,SvLBoxEntry*)
+sal_uLong SvTreeListBox::GetAscInsertionPos(SvLBoxEntry*,SvLBoxEntry*)
{
return LIST_APPEND;
}
-ULONG SvTreeListBox::GetDescInsertionPos(SvLBoxEntry*,SvLBoxEntry*)
+sal_uLong SvTreeListBox::GetDescInsertionPos(SvLBoxEntry*,SvLBoxEntry*)
{
DBG_CHKTHIS(SvTreeListBox,0);
return LIST_APPEND;
@@ -2185,8 +2191,8 @@ Region SvTreeListBox::GetDragRegion() const
void SvTreeListBox::Command( const CommandEvent& rCEvt )
{
DBG_CHKTHIS(SvTreeListBox,0);
- if ( !pImp->Command( rCEvt ) )
- SvLBox::Command( rCEvt );
+ // FIXME gnumake2 resync to DEV300_m84
+ pImp->Command( rCEvt );
}
@@ -2207,10 +2213,10 @@ void SvTreeListBox::RemoveParentKeepChilds( SvLBoxEntry* pParent )
pModel->Remove( pParent );
}
-SvLBoxTab* SvTreeListBox::GetFirstTab( USHORT nFlagMask, USHORT& rPos )
+SvLBoxTab* SvTreeListBox::GetFirstTab( sal_uInt16 nFlagMask, sal_uInt16& rPos )
{
- USHORT nTabCount = aTabs.Count();
- for( USHORT nPos = 0; nPos < nTabCount; nPos++ )
+ sal_uInt16 nTabCount = aTabs.Count();
+ for( sal_uInt16 nPos = 0; nPos < nTabCount; nPos++ )
{
SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject( nPos );
if( (pTab->nFlags & nFlagMask) )
@@ -2223,17 +2229,17 @@ SvLBoxTab* SvTreeListBox::GetFirstTab( USHORT nFlagMask, USHORT& rPos )
return 0;
}
-SvLBoxTab* SvTreeListBox::GetLastTab( USHORT nFlagMask, USHORT& rTabPos )
+SvLBoxTab* SvTreeListBox::GetLastTab( sal_uInt16 nFlagMask, sal_uInt16& rTabPos )
{
short nTabCount = (short)aTabs.Count();
if( nTabCount )
{
for( short nPos = nTabCount-1; nPos >= 0; nPos-- )
{
- SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject( (USHORT)nPos );
+ SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject( (sal_uInt16)nPos );
if( (pTab->nFlags & nFlagMask) )
{
- rTabPos = (USHORT)nPos;
+ rTabPos = (sal_uInt16)nPos;
return pTab;
}
}
@@ -2242,12 +2248,12 @@ SvLBoxTab* SvTreeListBox::GetLastTab( USHORT nFlagMask, USHORT& rTabPos )
return 0;
}
-void SvTreeListBox::SetAddMode( BOOL bAdd )
+void SvTreeListBox::SetAddMode( sal_Bool bAdd )
{
pImp->SetAddMode( bAdd );
}
-BOOL SvTreeListBox::IsAddMode() const
+sal_Bool SvTreeListBox::IsAddMode() const
{
return pImp->IsAddMode();
}
@@ -2272,8 +2278,8 @@ IMPL_LINK( SvTreeListBox, DefaultCompare, SvSortData*, pData )
return pImp->pIntlWrapper->getCaseCollator()->compareString( aLeft, aRight );
}
-void SvTreeListBox::ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
- SvListEntry* pEntry2, ULONG nPos )
+void SvTreeListBox::ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry1,
+ SvListEntry* pEntry2, sal_uLong nPos )
{
if( nActionId == LISTACTION_CLEARING )
CancelTextEditing();
@@ -2301,14 +2307,14 @@ void SvTreeListBox::ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
break;
case LISTACTION_RESORTING:
- SetUpdateMode( FALSE );
+ SetUpdateMode( sal_False );
break;
case LISTACTION_RESORTED:
// nach Sortierung den ersten Eintrag anzeigen, dabei die
// Selektion erhalten.
- MakeVisible( (SvLBoxEntry*)pModel->First(), TRUE );
- SetUpdateMode( TRUE );
+ MakeVisible( (SvLBoxEntry*)pModel->First(), sal_True );
+ SetUpdateMode( sal_True );
break;
case LISTACTION_CLEARED:
@@ -2322,8 +2328,9 @@ void SvTreeListBox::ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
long SvTreeListBox::GetTextOffset() const
{
DBG_CHKTHIS(SvTreeListBox,0);
- BOOL bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0;
- BOOL bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT |
+ const WinBits nWindowStyle = GetStyle();
+ sal_Bool bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0;
+ sal_Bool bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT |
WB_HASBUTTONSATROOT))!=0;
long nStartPos = TAB_STARTPOS;
long nNodeWidthPixel = GetExpandedNodeBmp().GetSizePixel().Width();
@@ -2401,12 +2408,12 @@ void SvTreeListBox::EndSelection()
pImp->EndSelection();
}
-BOOL SvTreeListBox::IsNodeButton( const Point& rPos ) const
+sal_Bool SvTreeListBox::IsNodeButton( const Point& rPos ) const
{
SvLBoxEntry* pEntry = GetEntry( rPos );
if( pEntry )
return pImp->IsNodeButton( rPos, pEntry );
- return FALSE;
+ return sal_False;
}
void SvTreeListBox::RepaintScrollBars() const
@@ -2424,7 +2431,7 @@ ScrollBar *SvTreeListBox::GetHScroll()
return &((SvTreeListBox*)this)->pImp->aHorSBar;
}
-void SvTreeListBox::EnableAsyncDrag( BOOL b )
+void SvTreeListBox::EnableAsyncDrag( sal_Bool b )
{
pImp->EnableAsyncDrag( b );
}
@@ -2462,9 +2469,9 @@ void SvTreeListBox::DataChanged( const DataChangedEvent& rDCEvt )
{
if( (rDCEvt.GetType()==DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) )
{
- nEntryHeight = 0; // _together_ with TRUE of 1. par (bFont) of InitSettings() a zero-height
+ nEntryHeight = 0; // _together_ with sal_True of 1. par (bFont) of InitSettings() a zero-height
// forces complete recalc of heights!
- InitSettings( TRUE, TRUE, TRUE );
+ InitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
else
@@ -2474,9 +2481,11 @@ void SvTreeListBox::DataChanged( const DataChangedEvent& rDCEvt )
void SvTreeListBox::StateChanged( StateChangedType i_nStateChange )
{
SvLBox::StateChanged( i_nStateChange );
+ if ( i_nStateChange == STATE_CHANGE_STYLE )
+ ImplInitStyle();
}
-void SvTreeListBox::InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground)
+void SvTreeListBox::InitSettings(sal_Bool bFont,sal_Bool bForeground,sal_Bool bBackground)
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
if( bFont )
@@ -2503,17 +2512,17 @@ void SvTreeListBox::InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground)
pCheckButtonData->SetDefaultImages( this );
}
-BOOL SvTreeListBox::IsCellFocusEnabled() const
+sal_Bool SvTreeListBox::IsCellFocusEnabled() const
{
return pImp->IsCellFocusEnabled();
}
-bool SvTreeListBox::SetCurrentTabPos( USHORT _nNewPos )
+bool SvTreeListBox::SetCurrentTabPos( sal_uInt16 _nNewPos )
{
return pImp->SetCurrentTabPos( _nNewPos );
}
-USHORT SvTreeListBox::GetCurrentTabPos() const
+sal_uInt16 SvTreeListBox::GetCurrentTabPos() const
{
return pImp->GetCurrentTabPos();
}
@@ -2535,7 +2544,7 @@ PopupMenu* SvTreeListBox::CreateContextMenu( void )
return NULL;
}
-void SvTreeListBox::ExcecuteContextMenuAction( USHORT )
+void SvTreeListBox::ExcecuteContextMenuAction( sal_uInt16 )
{
DBG_WARNING( "SvTreeListBox::ExcecuteContextMenuAction(): now there's happening nothing!" );
}
@@ -2544,17 +2553,17 @@ void SvTreeListBox::EnableContextMenuHandling( void )
{
DBG_ASSERT( pImp, "-SvTreeListBox::EnableContextMenuHandling(): No implementation!" );
- pImp->bContextMenuHandling = TRUE;
+ pImp->bContextMenuHandling = sal_True;
}
-void SvTreeListBox::EnableContextMenuHandling( BOOL b )
+void SvTreeListBox::EnableContextMenuHandling( sal_Bool b )
{
DBG_ASSERT( pImp, "-SvTreeListBox::EnableContextMenuHandling(): No implementation!" );
pImp->bContextMenuHandling = b;
}
-BOOL SvTreeListBox::IsContextMenuHandlingEnabled( void ) const
+sal_Bool SvTreeListBox::IsContextMenuHandlingEnabled( void ) const
{
DBG_ASSERT( pImp, "-SvTreeListBox::IsContextMenuHandlingEnabled(): No implementation!" );
@@ -2619,7 +2628,7 @@ void SvTreeListBox::EnableCellFocus()
pImp->EnableCellFocus();
}
-void SvTreeListBox::CallImplEventListeners(ULONG nEvent, void* pData)
+void SvTreeListBox::CallImplEventListeners(sal_uLong nEvent, void* pData)
{
CallEventListeners(nEvent, pData);
}
diff --git a/svtools/source/contnr/templwin.cxx b/svtools/source/contnr/templwin.cxx
index 9cd0add24eda..ea768918e460 100644
--- a/svtools/source/contnr/templwin.cxx
+++ b/svtools/source/contnr/templwin.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
#include "templwin.hxx"
-#include "templdlg.hxx"
+#include <svtools/templdlg.hxx>
#include <svtools/svtdata.hxx>
#include <svtools/langhelp.hxx>
#include <unotools/pathoptions.hxx>
@@ -37,18 +37,17 @@
#include <unotools/extendedsecurityoptions.hxx>
#include <svtools/xtextedt.hxx>
#include <svl/inettype.hxx>
-#include "imagemgr.hxx"
+#include <svtools/imagemgr.hxx>
#include <svtools/miscopt.hxx>
-#include "templatefoldercache.hxx"
-#include "imgdef.hxx"
-#include "txtattr.hxx"
+#include <svtools/templatefoldercache.hxx>
+#include <svtools/imgdef.hxx>
+#include <svtools/txtattr.hxx>
#include <svtools/svtools.hrc>
#include "templwin.hrc"
#include <svtools/helpid.hrc>
#include <unotools/pathoptions.hxx>
#include <unotools/viewoptions.hxx>
#include <unotools/ucbhelper.hxx>
-
#include "unotools/configmgr.hxx"
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -83,7 +82,7 @@
#include <vcl/svapp.hxx>
#include <vcl/split.hxx>
#include <vcl/msgbox.hxx>
-#include "DocumentInfoPreview.hxx"
+#include <svtools/DocumentInfoPreview.hxx>
#include <vcl/mnemonic.hxx>
#include <ucbhelper/content.hxx>
@@ -123,7 +122,7 @@ extern ::rtl::OUString CreateExactSizeText_Impl( sal_Int64 nSize ); // fileview.
struct FolderHistory
{
String m_sURL;
- ULONG m_nGroup;
+ sal_uLong m_nGroup;
FolderHistory( const String& _rURL, sal_Int32 _nGroup ) :
m_sURL( _rURL ), m_nGroup( _nGroup ) {}
@@ -135,7 +134,7 @@ ODocumentInfoPreview::ODocumentInfoPreview( Window* pParent ,WinBits _nBits) : W
{
m_pEditWin = new SvtExtendedMultiLineEdit_Impl(this,_nBits);
m_pEditWin->Show();
- m_pEditWin->EnableCursor( FALSE );
+ m_pEditWin->EnableCursor( sal_False );
m_pInfoTable = new SvtDocInfoTable_Impl();
// detect application language
m_aLocale = SvtPathOptions().GetLocale();
@@ -184,7 +183,7 @@ void ODocumentInfoPreview::fill(
if (!i_xDocProps.is()) throw RuntimeException();
::rtl::OUString aStr;
- m_pEditWin->SetAutoScroll( FALSE );
+ m_pEditWin->SetAutoScroll( sal_False );
aStr = i_xDocProps->getTitle();
if (aStr.getLength()) {
@@ -238,7 +237,7 @@ void ODocumentInfoPreview::fill(
// size
if ( i_rURL.Len() > 0 )
{
- ULONG nDocSize = ::utl::UCBContentHelper::GetSize( i_rURL );
+ sal_uLong nDocSize = ::utl::UCBContentHelper::GetSize( i_rURL );
m_pEditWin->InsertEntry(
m_pInfoTable->GetString( DI_SIZE ),
CreateExactSizeText_Impl( nDocSize ) );
@@ -286,7 +285,7 @@ void ODocumentInfoPreview::fill(
}
m_pEditWin->SetSelection( Selection( 0, 0 ) );
- m_pEditWin->SetAutoScroll( TRUE );
+ m_pEditWin->SetAutoScroll( sal_True );
}
// -----------------------------------------------------------------------------
@@ -341,7 +340,7 @@ SvtIconWindow_Impl::SvtIconWindow_Impl( Window* pParent ) :
aIconCtrl.SetAccessibleName( String( RTL_CONSTASCII_USTRINGPARAM("Groups") ) );
aIconCtrl.SetHelpId( HID_TEMPLATEDLG_ICONCTRL );
- aIconCtrl.SetChoiceWithCursor( TRUE );
+ aIconCtrl.SetChoiceWithCursor( sal_True );
aIconCtrl.SetSelectionMode( SINGLE_SELECTION );
aIconCtrl.Show();
@@ -413,7 +412,7 @@ SvtIconWindow_Impl::SvtIconWindow_Impl( Window* pParent ) :
SvtIconWindow_Impl::~SvtIconWindow_Impl()
{
- for ( ULONG i = 0; i < aIconCtrl.GetEntryCount(); ++i )
+ for ( sal_uLong i = 0; i < aIconCtrl.GetEntryCount(); ++i )
{
SvxIconChoiceCtrlEntry* pEntry = aIconCtrl.GetEntry( i );
delete (String*)pEntry->GetUserData();
@@ -423,7 +422,7 @@ SvtIconWindow_Impl::~SvtIconWindow_Impl()
SvxIconChoiceCtrlEntry* SvtIconWindow_Impl::GetEntry( const String& rURL ) const
{
SvxIconChoiceCtrlEntry* pEntry = NULL;
- for ( ULONG i = 0; i < aIconCtrl.GetEntryCount(); ++i )
+ for ( sal_uLong i = 0; i < aIconCtrl.GetEntryCount(); ++i )
{
SvxIconChoiceCtrlEntry* pTemp = aIconCtrl.GetEntry( i );
String aURL( *( (String*)pTemp->GetUserData() ) );
@@ -461,7 +460,7 @@ String SvtIconWindow_Impl::GetCursorPosIconURL() const
String SvtIconWindow_Impl::GetSelectedIconURL() const
{
- ULONG nPos;
+ sal_uLong nPos;
SvxIconChoiceCtrlEntry* pEntry = aIconCtrl.GetSelectedEntry( nPos );
String aURL;
if ( pEntry )
@@ -471,7 +470,7 @@ String SvtIconWindow_Impl::GetSelectedIconURL() const
String SvtIconWindow_Impl::GetSelectedIconText() const
{
- ULONG nPos;
+ sal_uLong nPos;
return MnemonicGenerator::EraseAllMnemonicChars( aIconCtrl.GetSelectedEntry( nPos )->GetText() );
}
@@ -489,9 +488,9 @@ void SvtIconWindow_Impl::InvalidateIconControl()
aIconCtrl.Invalidate();
}
-ULONG SvtIconWindow_Impl::GetCursorPos() const
+sal_uLong SvtIconWindow_Impl::GetCursorPos() const
{
- ULONG nPos = ~ULONG(0);
+ sal_uLong nPos = ~sal_uLong(0);
SvxIconChoiceCtrlEntry* pCursorEntry = aIconCtrl.GetCursor( );
if ( pCursorEntry )
@@ -500,15 +499,15 @@ ULONG SvtIconWindow_Impl::GetCursorPos() const
return nPos;
}
-ULONG SvtIconWindow_Impl::GetSelectEntryPos() const
+sal_uLong SvtIconWindow_Impl::GetSelectEntryPos() const
{
- ULONG nPos;
+ sal_uLong nPos;
if ( !aIconCtrl.GetSelectedEntry( nPos ) )
- nPos = ~ULONG(0);
+ nPos = ~sal_uLong(0);
return nPos;
}
-void SvtIconWindow_Impl::SetCursorPos( ULONG nPos )
+void SvtIconWindow_Impl::SetCursorPos( sal_uLong nPos )
{
SvxIconChoiceCtrlEntry* pEntry = aIconCtrl.GetEntry( nPos );
aIconCtrl.SetCursor( pEntry );
@@ -525,7 +524,7 @@ long SvtIconWindow_Impl::CalcHeight() const
{
// calculate the required height of the IconControl
long nHeight = 0;
- ULONG nCount = aIconCtrl.GetEntryCount();
+ sal_uLong nCount = aIconCtrl.GetEntryCount();
if ( nCount > 0 )
// bottom of the last icon
nHeight = aIconCtrl.GetEntry(nCount-1)->GetBoundRect().Bottom();
@@ -544,9 +543,9 @@ sal_Bool SvtIconWindow_Impl::IsRootURL( const String& rURL ) const
rURL == aSamplesFolderRootURL;
}
-ULONG SvtIconWindow_Impl::GetRootPos( const String& rURL ) const
+sal_uLong SvtIconWindow_Impl::GetRootPos( const String& rURL ) const
{
- ULONG nPos = ~ULONG(0);
+ sal_uLong nPos = ~sal_uLong(0);
if ( aNewDocumentRootURL.Match( rURL ) == STRING_MATCH )
nPos = 0;
else if ( aTemplateRootURL.Match( rURL ) == STRING_MATCH )
@@ -645,7 +644,7 @@ Sequence< ::rtl::OUString > SvtFileViewWindow_Impl::GetNewDocContents() const
::rtl::OUString aImageURL;
::rtl::OUString aTargetFrame;
- UINT32 i, nCount = aDynamicMenuEntries.getLength();
+ sal_uInt32 i, nCount = aDynamicMenuEntries.getLength();
::rtl::OUString sSeparator( ASCII_STR("private:separator") );
::rtl::OUString sSlotURL( ASCII_STR("slot:5500") );
@@ -787,7 +786,7 @@ void SvtExtendedMultiLineEdit_Impl::InsertEntry( const String& rTitle, const Str
aText += rTitle;
aText += ':';
InsertText( aText );
- ULONG nPara = GetParagraphCount() - 1;
+ sal_uLong nPara = GetParagraphCount() - 1;
SetAttrib( TextAttribFontWeight( WEIGHT_BOLD ), nPara, 0, aText.Len() );
aText = '\n';
@@ -967,7 +966,7 @@ void SvtFrameWindow_Impl::OpenFile( const String& rURL, sal_Bool bPreview, sal_B
// disabling must be done here, does not work in ctor because
// execute of the dialog will overwrite it
// ( own execute method would help )
- pTextWin->EnableInput( FALSE, TRUE );
+ pTextWin->EnableInput( sal_False, sal_True );
if ( pTextWin->IsReallyVisible() )
{
sal_Bool b = sal_True;
@@ -1123,7 +1122,7 @@ IMPL_LINK ( SvtTemplateWindow , IconClickHdl_Impl, SvtIconChoiceCtrl *, EMPTYARG
{
pFileWin->OpenRoot( aURL );
pIconWin->InvalidateIconControl();
- aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, FALSE );
+ aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, sal_False );
}
return 0;
}
@@ -1160,10 +1159,10 @@ IMPL_LINK ( SvtTemplateWindow , FileDblClickHdl_Impl, SvtFileView *, EMPTYARG )
IMPL_LINK ( SvtTemplateWindow , NewFolderHdl_Impl, SvtFileView *, EMPTYARG )
{
pFrameWin->OpenFile( String(), sal_True, sal_False, sal_False );
- aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, FALSE );
+ aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, sal_False );
String sURL = pFileWin->GetFolderURL();
- ULONG nPos = pIconWin->GetRootPos( sURL );
+ sal_uLong nPos = pIconWin->GetRootPos( sURL );
AppendHistoryURL( sURL, nPos );
aNewFolderHdl.Call( this );
@@ -1234,7 +1233,7 @@ void SvtTemplateWindow::PrintFile( const String& rURL )
// ------------------------------------------------------------------------
-void SvtTemplateWindow::AppendHistoryURL( const String& rURL, ULONG nGroup )
+void SvtTemplateWindow::AppendHistoryURL( const String& rURL, sal_uLong nGroup )
{
sal_Bool bInsert = sal_True;
if ( !pHistoryList )
@@ -1269,7 +1268,7 @@ void SvtTemplateWindow::OpenHistory()
// ------------------------------------------------------------------------
-void SvtTemplateWindow::DoAction( USHORT nAction )
+void SvtTemplateWindow::DoAction( sal_uInt16 nAction )
{
switch( nAction )
{
@@ -1318,16 +1317,16 @@ void SvtTemplateWindow::InitToolBoxes()
aSize.Height() += 4;
aFrameWinTB.SetPosSizePixel( Point( pFrameWin->GetPosPixel().X() + 2, 2 ), aSize );
- BOOL bFlat = ( SvtMiscOptions().GetToolboxStyle() == TOOLBOX_STYLE_FLAT );
+ sal_Bool bFlat = ( SvtMiscOptions().GetToolboxStyle() == TOOLBOX_STYLE_FLAT );
if ( bFlat )
{
aFileViewTB.SetOutStyle( TOOLBOX_STYLE_FLAT );
aFrameWinTB.SetOutStyle( TOOLBOX_STYLE_FLAT );
}
- aFileViewTB.EnableItem( TI_DOCTEMPLATE_BACK, FALSE );
- aFileViewTB.EnableItem( TI_DOCTEMPLATE_PREV, FALSE );
- aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, FALSE );
+ aFileViewTB.EnableItem( TI_DOCTEMPLATE_BACK, sal_False );
+ aFileViewTB.EnableItem( TI_DOCTEMPLATE_PREV, sal_False );
+ aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, sal_False );
Link aLink = LINK( this, SvtTemplateWindow, ClickHdl_Impl );
aFileViewTB.SetClickHdl( aLink );
@@ -1339,7 +1338,7 @@ void SvtTemplateWindow::InitToolBoxes()
void SvtTemplateWindow::InitToolBoxImages()
{
SvtMiscOptions aMiscOpt;
- BOOL bLarge = aMiscOpt.AreCurrentSymbolsLarge();
+ sal_Bool bLarge = aMiscOpt.AreCurrentSymbolsLarge();
aFileViewTB.SetItemImage( TI_DOCTEMPLATE_BACK, Image( SvtResId(
bLarge ? IMG_SVT_DOCTEMPLATE_BACK_LARGE
@@ -1370,13 +1369,13 @@ void SvtTemplateWindow::UpdateIcons()
long SvtTemplateWindow::PreNotify( NotifyEvent& rNEvt )
{
- USHORT nType = rNEvt.GetType();
+ sal_uInt16 nType = rNEvt.GetType();
long nRet = 0;
if ( EVENT_KEYINPUT == nType && rNEvt.GetKeyEvent() )
{
const KeyCode& rKeyCode = rNEvt.GetKeyEvent()->GetKeyCode();
- USHORT nCode = rKeyCode.GetCode();
+ sal_uInt16 nCode = rKeyCode.GetCode();
if ( KEY_BACKSPACE == nCode && !rKeyCode.GetModifier() && pFileWin->HasChildPathFocus() )
{
@@ -1579,7 +1578,7 @@ void SvtTemplateWindow::ReadViewSettings()
// the selected view (details or preview)
pFrameWin->ToggleView( TI_DOCTEMPLATE_DOCINFO == nSelectedView );
- aFrameWinTB.CheckItem( (sal_uInt16)nSelectedView, TRUE );
+ aFrameWinTB.CheckItem( (sal_uInt16)nSelectedView, sal_True );
// the split ratio
sal_Int32 nSplitFileAndFrameSize = aSplitWin.GetItemSize( FILEWIN_ID ) + aSplitWin.GetItemSize( FRAMEWIN_ID );
diff --git a/svtools/source/contnr/templwin.hxx b/svtools/source/contnr/templwin.hxx
index b74dfb9a2366..161df3184de3 100644
--- a/svtools/source/contnr/templwin.hxx
+++ b/svtools/source/contnr/templwin.hxx
@@ -33,8 +33,8 @@
#include <vcl/toolbox.hxx>
#include <vcl/window.hxx>
#include <svtools/headbar.hxx>
-#include "fileview.hxx"
-#include "ivctrl.hxx"
+#include <svtools/fileview.hxx>
+#include <svtools/ivctrl.hxx>
#include <svtools/svmedit2.hxx>
#include <svl/restrictedpaths.hxx>
#include <com/sun/star/frame/XDispatch.hpp>
@@ -95,13 +95,13 @@ public:
String GetCursorPosIconURL() const;
String GetIconText( const String& rURL ) const;
void InvalidateIconControl();
- void SetCursorPos( ULONG nPos );
- ULONG GetCursorPos() const;
- ULONG GetSelectEntryPos() const;
+ void SetCursorPos( sal_uLong nPos );
+ sal_uLong GetCursorPos() const;
+ sal_uLong GetSelectEntryPos() const;
void SetFocus();
long CalcHeight() const;
sal_Bool IsRootURL( const String& rURL ) const;
- ULONG GetRootPos( const String& rURL ) const;
+ sal_uLong GetRootPos( const String& rURL ) const;
void UpdateIcons();
inline sal_Bool ProcessKeyEvent( const KeyEvent& rKEvt );
@@ -269,9 +269,9 @@ private:
DECL_LINK( ResizeHdl_Impl, SplitWindow* ); // used for split and initial setting of toolbar pos
void PrintFile( const String& rURL );
- void AppendHistoryURL( const String& rURL, ULONG nGroup );
+ void AppendHistoryURL( const String& rURL, sal_uLong nGroup );
void OpenHistory();
- void DoAction( USHORT nAction );
+ void DoAction( sal_uInt16 nAction );
void InitToolBoxes();
void InitToolBoxImages();
void UpdateIcons();
diff --git a/svtools/source/contnr/templwin.src b/svtools/source/contnr/templwin.src
index 162202408437..076963d2e7c3 100644
--- a/svtools/source/contnr/templwin.src
+++ b/svtools/source/contnr/templwin.src
@@ -28,7 +28,7 @@
// includes ------------------------------------------------------------------
#include "templwin.hrc"
-#include "controldims.hrc"
+#include <svtools/controldims.hrc>
#include <svtools/helpid.hrc>
#include <svtools/svtools.hrc>
@@ -215,12 +215,14 @@ ModalDialog DLG_DOCTEMPLATE
};
PushButton BTN_DOCTEMPLATE_MANAGE
{
+ HelpID = "svtools:PushButton:DLG_DOCTEMPLATE:BTN_DOCTEMPLATE_MANAGE";
Pos = MAP_APPFONT( 6, 230 );
Size = MAP_APPFONT( 50, 14 );
Text [ en-US ] = "Organi~ze...";
};
PushButton BTN_DOCTEMPLATE_EDIT
{
+ HelpID = "svtools:PushButton:DLG_DOCTEMPLATE:BTN_DOCTEMPLATE_EDIT";
Pos = MAP_APPFONT( 59, 230 );
Size = MAP_APPFONT( 50, 14 );
Text [ en-US ] = "~Edit";
diff --git a/svtools/source/contnr/tooltiplbox.cxx b/svtools/source/contnr/tooltiplbox.cxx
index 9a148336adbe..fb610e826f3a 100644
--- a/svtools/source/contnr/tooltiplbox.cxx
+++ b/svtools/source/contnr/tooltiplbox.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "tooltiplbox.hxx"
+#include <svtools/tooltiplbox.hxx>
#include <vcl/help.hxx>
// ============================================================================
diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx
index 7bb25e9c065e..f78b13fb04ad 100644
--- a/svtools/source/contnr/treelist.cxx
+++ b/svtools/source/contnr/treelist.cxx
@@ -82,7 +82,7 @@ void SvListEntry::SetListPositions()
if( pChilds )
{
SvListEntry *pEntry = (SvListEntry*)pChilds->First();
- ULONG nCur = 0;
+ sal_uLong nCur = 0;
while ( pEntry )
{
pEntry->nListPos &= 0x80000000;
@@ -132,16 +132,6 @@ void SvTreeEntryList::DestroyAll()
}
-
-
-#if defined (WIN) && defined (MSC)
-// siehe BugId 42896: Die Funktionen Prev, PrevVisible, Next, NextVisible
-// (andere?) funktionieren nicht mit Optimierung.
-#pragma optimize ("", off)
-#endif
-
-
-
/*************************************************************************
|*
|* SvTreeList::
@@ -151,7 +141,7 @@ void SvTreeEntryList::DestroyAll()
SvTreeList::SvTreeList()
{
nEntryCount = 0;
- bAbsPositionsValid = FALSE;
+ bAbsPositionsValid = sal_False;
nRefCount = 1;
pRootItem = new SvListEntry;
eSortMode = SortNone;
@@ -179,11 +169,11 @@ SvTreeList::~SvTreeList()
|*
*************************************************************************/
-void SvTreeList::Broadcast( USHORT nActionId, SvListEntry* pEntry1,
- SvListEntry* pEntry2, ULONG nPos )
+void SvTreeList::Broadcast( sal_uInt16 nActionId, SvListEntry* pEntry1,
+ SvListEntry* pEntry2, sal_uLong nPos )
{
- ULONG nViewCount = aViewList.Count();
- for( ULONG nCurView = 0; nCurView < nViewCount; nCurView++ )
+ sal_uLong nViewCount = aViewList.Count();
+ for( sal_uLong nCurView = 0; nCurView < nViewCount; nCurView++ )
{
SvListView* pView = (SvListView*)aViewList.GetObject( nCurView );
if( pView )
@@ -193,7 +183,7 @@ void SvTreeList::Broadcast( USHORT nActionId, SvListEntry* pEntry1,
void SvTreeList::InsertView( SvListView* pView)
{
- ULONG nPos = aViewList.GetPos( pView );
+ sal_uLong nPos = aViewList.GetPos( pView );
if ( nPos == LIST_ENTRY_NOTFOUND )
{
aViewList.Insert( pView, LIST_APPEND );
@@ -203,7 +193,7 @@ void SvTreeList::InsertView( SvListView* pView)
void SvTreeList::RemoveView( SvListView* pView )
{
- ULONG nPos = aViewList.GetPos( pView );
+ sal_uLong nPos = aViewList.GetPos( pView );
if ( nPos != LIST_ENTRY_NOTFOUND )
{
aViewList.Remove( pView );
@@ -213,15 +203,15 @@ void SvTreeList::RemoveView( SvListView* pView )
// Ein Entry ist sichtbar, wenn alle Parents expandiert sind
-BOOL SvTreeList::IsEntryVisible( const SvListView* pView, SvListEntry* pEntry ) const
+sal_Bool SvTreeList::IsEntryVisible( const SvListView* pView, SvListEntry* pEntry ) const
{
DBG_ASSERT(pView&&pEntry,"IsVisible:Invalid Params");
- BOOL bRetVal=FALSE;
+ sal_Bool bRetVal=sal_False;
do
{
if ( pEntry == pRootItem )
{
- bRetVal=TRUE;
+ bRetVal=sal_True;
break;
}
pEntry = pEntry->pParent;
@@ -229,10 +219,10 @@ BOOL SvTreeList::IsEntryVisible( const SvListView* pView, SvListEntry* pEntry )
return bRetVal;
}
-USHORT SvTreeList::GetDepth( SvListEntry* pEntry ) const
+sal_uInt16 SvTreeList::GetDepth( SvListEntry* pEntry ) const
{
DBG_ASSERT(pEntry&&pEntry!=pRootItem,"GetDepth:Bad Entry");
- USHORT nDepth = 0;
+ sal_uInt16 nDepth = 0;
while( pEntry->pParent != pRootItem )
{
nDepth++;
@@ -273,20 +263,20 @@ void SvTreeList::Clear()
|*
*************************************************************************/
-BOOL SvTreeList::IsChild( SvListEntry* pParent, SvListEntry* pChild ) const
+sal_Bool SvTreeList::IsChild( SvListEntry* pParent, SvListEntry* pChild ) const
{
if ( !pParent )
pParent = pRootItem;
- BOOL bIsChild = FALSE;
+ sal_Bool bIsChild = sal_False;
SvTreeEntryList* pList = pParent->pChilds;
if ( !pList )
- return FALSE;
+ return sal_False;
SvListEntry* pActualChild = (SvListEntry*)(pList->First());
while( !bIsChild && pActualChild )
{
if ( pActualChild == pChild )
- bIsChild = TRUE;
+ bIsChild = sal_True;
else
{
if ( pActualChild->pChilds )
@@ -297,7 +287,7 @@ BOOL SvTreeList::IsChild( SvListEntry* pParent, SvListEntry* pChild ) const
return bIsChild;
}
-ULONG SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG nListPos)
+sal_uLong SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,sal_uLong nListPos)
{
// pDest darf Null sein!
DBG_ASSERT(pSrcEntry,"Entry?");
@@ -312,7 +302,7 @@ ULONG SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG n
if ( pSrcEntry == pTargetParent )
return pSrcEntry->GetChildListPos();
- bAbsPositionsValid = FALSE;
+ bAbsPositionsValid = sal_False;
SvTreeEntryList* pDstList = pTargetParent->pChilds;
SvTreeEntryList* pSrcList = pSrcEntry->pParent->pChilds;
@@ -341,20 +331,20 @@ ULONG SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG n
// Listenpositionen in Zielliste korrigieren
SetListPositions( pDstList );
- if ( pSrcList && (ULONG)pSrcList != (ULONG)pDstList )
+ if ( pSrcList && (sal_uLong)pSrcList != (sal_uLong)pDstList )
SetListPositions( pSrcList );
#ifdef CHECK_INTEGRITY
CheckIntegrity();
#endif
- ULONG nRetVal = pDstList->GetPos( pSrcEntry );
+ sal_uLong nRetVal = pDstList->GetPos( pSrcEntry );
DBG_ASSERT(nRetVal==pSrcEntry->GetChildListPos(),"ListPos not valid");
Broadcast( LISTACTION_MOVED,pSrcEntry,pTargetParent,nRetVal);
return nRetVal;
}
-ULONG SvTreeList::Copy(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG nListPos)
+sal_uLong SvTreeList::Copy(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,sal_uLong nListPos)
{
// pDest darf Null sein!
DBG_ASSERT(pSrcEntry,"Entry?");
@@ -363,9 +353,9 @@ ULONG SvTreeList::Copy(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG n
if ( !pTargetParent->pChilds )
pTargetParent->pChilds = new SvTreeEntryList;
- bAbsPositionsValid = FALSE;
+ bAbsPositionsValid = sal_False;
- ULONG nCloneCount = 0;
+ sal_uLong nCloneCount = 0;
SvListEntry* pClonedEntry = Clone( pSrcEntry, nCloneCount );
nEntryCount += nCloneCount;
@@ -378,7 +368,7 @@ ULONG SvTreeList::Copy(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG n
CheckIntegrity();
#endif
Broadcast( LISTACTION_INSERTED_TREE, pClonedEntry );
- ULONG nRetVal = pDstList->GetPos( pClonedEntry );
+ sal_uLong nRetVal = pDstList->GetPos( pClonedEntry );
return nRetVal;
}
@@ -393,7 +383,7 @@ CheckIntegrity();
void SvTreeList::Move( SvListEntry* pSrcEntry, SvListEntry* pDstEntry )
{
SvListEntry* pParent;
- ULONG nPos;
+ sal_uLong nPos;
if ( !pDstEntry )
{
@@ -418,7 +408,7 @@ void SvTreeList::Move( SvListEntry* pSrcEntry, SvListEntry* pDstEntry )
void SvTreeList::Copy( SvListEntry* pSrcEntry, SvListEntry* pDstEntry )
{
SvListEntry* pParent;
- ULONG nPos;
+ sal_uLong nPos;
if ( !pDstEntry )
{
@@ -441,7 +431,7 @@ void SvTreeList::Copy( SvListEntry* pSrcEntry, SvListEntry* pDstEntry )
void SvTreeList::InsertTree( SvListEntry* pSrcEntry, SvListEntry* pDstEntry)
{
SvListEntry* pParent;
- ULONG nPos;
+ sal_uLong nPos;
if ( !pDstEntry )
{
@@ -458,7 +448,7 @@ void SvTreeList::InsertTree( SvListEntry* pSrcEntry, SvListEntry* pDstEntry)
void SvTreeList::InsertTree(SvListEntry* pSrcEntry,
- SvListEntry* pTargetParent,ULONG nListPos)
+ SvListEntry* pTargetParent,sal_uLong nListPos)
{
DBG_ASSERT(pSrcEntry,"InsertTree:Entry?");
if ( !pSrcEntry )
@@ -472,7 +462,7 @@ void SvTreeList::InsertTree(SvListEntry* pSrcEntry,
// Sortierung beruecksichtigen
GetInsertionPos( pSrcEntry, pTargetParent, nListPos );
- bAbsPositionsValid = FALSE;
+ bAbsPositionsValid = sal_False;
pSrcEntry->pParent = pTargetParent; // Parent umsetzen
SvTreeEntryList* pDstList = pTargetParent->pChilds;
@@ -507,7 +497,7 @@ SvListEntry* SvTreeList::CreateEntry() const
|*
*************************************************************************/
-SvListEntry* SvTreeList::Clone( SvListEntry* pEntry, ULONG& nCloneCount ) const
+SvListEntry* SvTreeList::Clone( SvListEntry* pEntry, sal_uLong& nCloneCount ) const
{
SvListEntry* pClonedEntry = CloneEntry( pEntry );
nCloneCount = 1;
@@ -525,7 +515,7 @@ SvListEntry* SvTreeList::Clone( SvListEntry* pEntry, ULONG& nCloneCount ) const
SvTreeEntryList* SvTreeList::CloneChilds( SvTreeEntryList* pChilds,
SvListEntry* pNewParent,
- ULONG& nCloneCount ) const
+ sal_uLong& nCloneCount ) const
{
DBG_ASSERT(pChilds->Count(),"Childs?");
SvTreeEntryList* pClonedChilds = new SvTreeEntryList;
@@ -555,16 +545,16 @@ SvTreeEntryList* SvTreeList::CloneChilds( SvTreeEntryList* pChilds,
|*
*************************************************************************/
-ULONG SvTreeList::GetChildCount( SvListEntry* pParent ) const
+sal_uLong SvTreeList::GetChildCount( SvListEntry* pParent ) const
{
if ( !pParent )
return GetEntryCount();
if ( !pParent || !pParent->pChilds)
return 0;
- ULONG nCount = 0;
- USHORT nRefDepth = GetDepth( pParent );
- USHORT nActDepth = nRefDepth;
+ sal_uLong nCount = 0;
+ sal_uInt16 nRefDepth = GetDepth( pParent );
+ sal_uInt16 nActDepth = nRefDepth;
do
{
pParent = Next( pParent, &nActDepth );
@@ -580,16 +570,16 @@ ULONG SvTreeList::GetChildCount( SvListEntry* pParent ) const
|*
*************************************************************************/
-ULONG SvTreeList::GetVisibleChildCount(const SvListView* pView, SvListEntry* pParent) const
+sal_uLong SvTreeList::GetVisibleChildCount(const SvListView* pView, SvListEntry* pParent) const
{
DBG_ASSERT(pView,"GetVisChildCount:No View");
if ( !pParent )
pParent = pRootItem;
if ( !pParent || !pView->IsExpanded(pParent) || !pParent->pChilds )
return 0;
- ULONG nCount = 0;
- USHORT nRefDepth = GetDepth( pParent );
- USHORT nActDepth = nRefDepth;
+ sal_uLong nCount = 0;
+ sal_uInt16 nRefDepth = GetDepth( pParent );
+ sal_uInt16 nActDepth = nRefDepth;
do
{
pParent = NextVisible( pView, pParent, &nActDepth );
@@ -599,16 +589,16 @@ ULONG SvTreeList::GetVisibleChildCount(const SvListView* pView, SvListEntry* pPa
return nCount;
}
-ULONG SvTreeList::GetChildSelectionCount(const SvListView* pView,SvListEntry* pParent) const
+sal_uLong SvTreeList::GetChildSelectionCount(const SvListView* pView,SvListEntry* pParent) const
{
DBG_ASSERT(pView,"GetChildSelCount:No View");
if ( !pParent )
pParent = pRootItem;
if ( !pParent || !pParent->pChilds)
return 0;
- ULONG nCount = 0;
- USHORT nRefDepth = GetDepth( pParent );
- USHORT nActDepth = nRefDepth;
+ sal_uLong nCount = 0;
+ sal_uInt16 nRefDepth = GetDepth( pParent );
+ sal_uInt16 nActDepth = nRefDepth;
do
{
pParent = Next( pParent, &nActDepth );
@@ -639,22 +629,22 @@ SvListEntry* SvTreeList::First() const
|* SvTreeList::Next
|*
*************************************************************************/
-SvListEntry* SvTreeList::Next( SvListEntry* pActEntry, USHORT* pDepth ) const
+SvListEntry* SvTreeList::Next( SvListEntry* pActEntry, sal_uInt16* pDepth ) const
{
DBG_ASSERT( pActEntry && pActEntry->pParent, "SvTreeList::Next: invalid entry/parent!" );
if ( !pActEntry || !pActEntry->pParent )
return NULL;
- USHORT nDepth = 0;
- int bWithDepth = FALSE;
+ sal_uInt16 nDepth = 0;
+ int bWithDepth = sal_False;
if ( pDepth )
{
nDepth = *pDepth;
- bWithDepth = TRUE;
+ bWithDepth = sal_True;
}
SvTreeEntryList* pActualList = pActEntry->pParent->pChilds;
- ULONG nActualPos = pActEntry->GetChildListPos();
+ sal_uLong nActualPos = pActEntry->GetChildListPos();
if ( pActEntry->pChilds /* && pActEntry->pChilds->Count() */ )
{
@@ -699,20 +689,20 @@ SvListEntry* SvTreeList::Next( SvListEntry* pActEntry, USHORT* pDepth ) const
|* SvTreeList::Prev
|*
*************************************************************************/
-SvListEntry* SvTreeList::Prev( SvListEntry* pActEntry, USHORT* pDepth ) const
+SvListEntry* SvTreeList::Prev( SvListEntry* pActEntry, sal_uInt16* pDepth ) const
{
DBG_ASSERT(pActEntry!=0,"Entry?");
- USHORT nDepth = 0;
- int bWithDepth = FALSE;
+ sal_uInt16 nDepth = 0;
+ int bWithDepth = sal_False;
if ( pDepth )
{
nDepth = *pDepth;
- bWithDepth = TRUE;
+ bWithDepth = sal_True;
}
SvTreeEntryList* pActualList = pActEntry->pParent->pChilds;
- ULONG nActualPos = pActEntry->GetChildListPos();
+ sal_uLong nActualPos = pActEntry->GetChildListPos();
if ( nActualPos > 0 )
{
@@ -748,7 +738,7 @@ SvListEntry* SvTreeList::Prev( SvListEntry* pActEntry, USHORT* pDepth ) const
|*
*************************************************************************/
-SvListEntry* SvTreeList::Last( USHORT* /* nDepth */ ) const
+SvListEntry* SvTreeList::Last( sal_uInt16* /* nDepth */ ) const
{
SvTreeEntryList* pActList = pRootItem->pChilds;
// if ( pActList->Count() == 0 )
@@ -770,7 +760,7 @@ SvListEntry* SvTreeList::Last( USHORT* /* nDepth */ ) const
|*
*************************************************************************/
-ULONG SvTreeList::GetVisiblePos( const SvListView* pView, SvListEntry* pEntry ) const
+sal_uLong SvTreeList::GetVisiblePos( const SvListView* pView, SvListEntry* pEntry ) const
{
DBG_ASSERT(pView&&pEntry,"View/Entry?");
@@ -790,7 +780,7 @@ ULONG SvTreeList::GetVisiblePos( const SvListView* pView, SvListEntry* pEntry )
|*
*************************************************************************/
-ULONG SvTreeList::GetVisibleCount( const SvListView* pView ) const
+sal_uLong SvTreeList::GetVisibleCount( const SvListView* pView ) const
{
DBG_ASSERT(pView,"GetVisCount:No View");
if( !pView->HasViewData() )
@@ -798,7 +788,7 @@ ULONG SvTreeList::GetVisibleCount( const SvListView* pView ) const
if ( pView->nVisibleCount )
return pView->nVisibleCount;
- ULONG nPos = 0;
+ sal_uLong nPos = 0;
SvListEntry* pEntry = First(); // erster Eintrag immer sichtbar
while ( pEntry )
{
@@ -814,7 +804,7 @@ ULONG SvTreeList::GetVisibleCount( const SvListView* pView ) const
}
#endif
((SvListView*)pView)->nVisibleCount = nPos;
- ((SvListView*)pView)->bVisPositionsValid = TRUE;
+ ((SvListView*)pView)->bVisPositionsValid = sal_True;
return nPos;
}
@@ -828,22 +818,22 @@ ULONG SvTreeList::GetVisibleCount( const SvListView* pView ) const
// Funktion geht aus Geschwindigkeitsgruenden davon aus,
// das der uebergebene Eintrag bereits sichtbar ist
-SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pActEntry,USHORT* pActDepth) const
+SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pActEntry,sal_uInt16* pActDepth) const
{
DBG_ASSERT(pView,"NextVisible:No View");
if ( !pActEntry )
return 0;
- USHORT nDepth = 0;
- int bWithDepth = FALSE;
+ sal_uInt16 nDepth = 0;
+ int bWithDepth = sal_False;
if ( pActDepth )
{
nDepth = *pActDepth;
- bWithDepth = TRUE;
+ bWithDepth = sal_True;
}
SvTreeEntryList* pActualList = pActEntry->pParent->pChilds;
- ULONG nActualPos = pActEntry->GetChildListPos();
+ sal_uLong nActualPos = pActEntry->GetChildListPos();
if ( pView->IsExpanded(pActEntry) )
{
@@ -894,20 +884,20 @@ SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pActEn
// Funktion geht aus Geschwindigkeitsgruenden davon aus,
// das der uebergebene Eintrag bereits sichtbar ist
-SvListEntry* SvTreeList::PrevVisible(const SvListView* pView, SvListEntry* pActEntry, USHORT* pActDepth) const
+SvListEntry* SvTreeList::PrevVisible(const SvListView* pView, SvListEntry* pActEntry, sal_uInt16* pActDepth) const
{
DBG_ASSERT(pView&&pActEntry,"PrevVis:View/Entry?");
- USHORT nDepth = 0;
- int bWithDepth = FALSE;
+ sal_uInt16 nDepth = 0;
+ int bWithDepth = sal_False;
if ( pActDepth )
{
nDepth = *pActDepth;
- bWithDepth = TRUE;
+ bWithDepth = sal_True;
}
SvTreeEntryList* pActualList = pActEntry->pParent->pChilds;
- ULONG nActualPos = pActEntry->GetChildListPos();
+ sal_uLong nActualPos = pActEntry->GetChildListPos();
if ( nActualPos > 0 )
{
@@ -943,7 +933,7 @@ SvListEntry* SvTreeList::PrevVisible(const SvListView* pView, SvListEntry* pActE
|*
*************************************************************************/
-SvListEntry* SvTreeList::LastVisible( const SvListView* pView, USHORT* pDepth) const
+SvListEntry* SvTreeList::LastVisible( const SvListView* pView, sal_uInt16* pDepth) const
{
DBG_ASSERT(pView,"LastVis:No View");
SvListEntry* pEntry = Last();
@@ -960,20 +950,20 @@ SvListEntry* SvTreeList::LastVisible( const SvListView* pView, USHORT* pDepth) c
|*
*************************************************************************/
-SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pEntry,USHORT& nDelta) const
+SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pEntry,sal_uInt16& nDelta) const
{
DBG_ASSERT(pView&&pEntry&&IsEntryVisible(pView,pEntry),"NextVis:Wrong Prms/!Vis");
- ULONG nVisPos = GetVisiblePos( pView, pEntry );
+ sal_uLong nVisPos = GetVisiblePos( pView, pEntry );
// nDelta Eintraege vorhanden ?
// Beispiel: 0,1,2,3,4,5,6,7,8,9 nVisPos=5 nDelta=7
// nNewDelta = 10-nVisPos-1 == 4
if ( nVisPos+nDelta >= pView->nVisibleCount )
{
- nDelta = (USHORT)(pView->nVisibleCount-nVisPos);
+ nDelta = (sal_uInt16)(pView->nVisibleCount-nVisPos);
nDelta--;
}
- USHORT nDeltaTmp = nDelta;
+ sal_uInt16 nDeltaTmp = nDelta;
while( nDeltaTmp )
{
pEntry = NextVisible( pView, pEntry );
@@ -989,17 +979,17 @@ SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pEntry
|*
*************************************************************************/
-SvListEntry* SvTreeList::PrevVisible( const SvListView* pView, SvListEntry* pEntry, USHORT& nDelta ) const
+SvListEntry* SvTreeList::PrevVisible( const SvListView* pView, SvListEntry* pEntry, sal_uInt16& nDelta ) const
{
DBG_ASSERT(pView&&pEntry&&IsEntryVisible(pView,pEntry),"PrevVis:Parms/!Vis");
- ULONG nVisPos = GetVisiblePos( pView, pEntry );
+ sal_uLong nVisPos = GetVisiblePos( pView, pEntry );
// nDelta Eintraege vorhanden ?
// Beispiel: 0,1,2,3,4,5,6,7,8,9 nVisPos=8 nDelta=20
// nNewDelta = nNewVisPos
if ( nDelta > nVisPos )
- nDelta = (USHORT)nVisPos;
- USHORT nDeltaTmp = nDelta;
+ nDelta = (sal_uInt16)nVisPos;
+ sal_uInt16 nDeltaTmp = nDelta;
while( nDeltaTmp )
{
pEntry = PrevVisible( pView, pEntry );
@@ -1045,8 +1035,8 @@ SvListEntry* SvTreeList::NextSibling( SvListEntry* pEntry ) const
if( !pEntry )
return 0;
SvTreeEntryList* pList = pEntry->pParent->pChilds;
-// ULONG nPos = pList->GetPos( pEntry );
- ULONG nPos = pEntry->GetChildListPos();
+// sal_uLong nPos = pList->GetPos( pEntry );
+ sal_uLong nPos = pEntry->GetChildListPos();
nPos++;
pEntry = (SvListEntry*)(pList->GetObject( nPos ));
return pEntry;
@@ -1059,8 +1049,8 @@ SvListEntry* SvTreeList::PrevSibling( SvListEntry* pEntry ) const
return 0;
SvTreeEntryList* pList = pEntry->pParent->pChilds;
- // ULONG nPos = pList->GetPos( pEntry );
- ULONG nPos = pEntry->GetChildListPos();
+ // sal_uLong nPos = pList->GetPos( pEntry );
+ sal_uLong nPos = pEntry->GetChildListPos();
if ( nPos == 0 )
return 0;
nPos--;
@@ -1134,7 +1124,7 @@ SvListEntry* SvTreeList::LastSelected( const SvListView* pView ) const
|* SvTreeList::Insert
|*
*************************************************************************/
-ULONG SvTreeList::Insert( SvListEntry* pEntry,SvListEntry* pParent,ULONG nPos )
+sal_uLong SvTreeList::Insert( SvListEntry* pEntry,SvListEntry* pParent,sal_uLong nPos )
{
DBG_ASSERT( pEntry,"Entry?");
@@ -1153,7 +1143,7 @@ ULONG SvTreeList::Insert( SvListEntry* pEntry,SvListEntry* pParent,ULONG nPos )
// Sortierung beruecksichtigen
GetInsertionPos( pEntry, pParent, nPos );
- bAbsPositionsValid = FALSE;
+ bAbsPositionsValid = sal_False;
pEntry->pParent = pParent;
pList->Insert( pEntry, nPos );
@@ -1176,7 +1166,7 @@ CheckIntegrity();
|*
*************************************************************************/
-ULONG SvTreeList::GetAbsPos( SvListEntry* pEntry) const
+sal_uLong SvTreeList::GetAbsPos( SvListEntry* pEntry) const
{
if ( !bAbsPositionsValid )
((SvTreeList*)this)->SetAbsolutePositions();
@@ -1191,7 +1181,7 @@ ULONG SvTreeList::GetAbsPos( SvListEntry* pEntry) const
void SvTreeList::SetAbsolutePositions()
{
- ULONG nPos = 0;
+ sal_uLong nPos = 0;
SvListEntry* pEntry = First();
while ( pEntry )
{
@@ -1199,7 +1189,7 @@ void SvTreeList::SetAbsolutePositions()
nPos++;
pEntry = Next( pEntry );
}
- bAbsPositionsValid = TRUE;
+ bAbsPositionsValid = sal_True;
#ifdef CHECK_INTEGRITY
CheckIntegrity();
#endif
@@ -1226,7 +1216,7 @@ void SvTreeList::Expand( SvListView* pView, SvListEntry* pEntry )
// wenn Parent sichtbar dann Statusdaten invalidieren
if ( pView->IsExpanded( pParent ) )
{
- pView->bVisPositionsValid = FALSE;
+ pView->bVisPositionsValid = sal_False;
pView->nVisibleCount = 0;
}
#ifdef CHECK_INTEGRITY
@@ -1255,7 +1245,7 @@ void SvTreeList::Collapse( SvListView* pView, SvListEntry* pEntry )
if ( pView->IsExpanded(pParent) )
{
pView->nVisibleCount = 0;
- pView->bVisPositionsValid = FALSE;
+ pView->bVisPositionsValid = sal_False;
}
#ifdef CHECK_INTEGRITY
CheckIntegrity();
@@ -1269,14 +1259,14 @@ CheckIntegrity();
|*
*************************************************************************/
-BOOL SvTreeList::Select( SvListView* pView, SvListEntry* pEntry, BOOL bSelect )
+sal_Bool SvTreeList::Select( SvListView* pView, SvListEntry* pEntry, sal_Bool bSelect )
{
DBG_ASSERT(pView&&pEntry,"Select:View/Entry?");
SvViewData* pViewData = pView->GetViewData( pEntry );
if ( bSelect )
{
if ( pViewData->IsSelected() || !pViewData->IsSelectable() )
- return FALSE;
+ return sal_False;
else
{
pViewData->nFlags |= SVLISTENTRYFLAG_SELECTED;
@@ -1286,7 +1276,7 @@ BOOL SvTreeList::Select( SvListView* pView, SvListEntry* pEntry, BOOL bSelect )
else
{
if ( !pViewData->IsSelected() )
- return FALSE;
+ return sal_False;
else
{
pViewData->nFlags &= ~( SVLISTENTRYFLAG_SELECTED );
@@ -1296,7 +1286,7 @@ BOOL SvTreeList::Select( SvListView* pView, SvListEntry* pEntry, BOOL bSelect )
#ifdef CHECK_INTEGRITY
CheckIntegrity();
#endif
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -1304,7 +1294,7 @@ CheckIntegrity();
|* SvTreeList::Remove
|*
*************************************************************************/
-BOOL SvTreeList::Remove( SvListEntry* pEntry )
+sal_Bool SvTreeList::Remove( SvListEntry* pEntry )
{
DBG_ASSERT(pEntry,"Cannot remove root, use clear");
@@ -1315,22 +1305,22 @@ BOOL SvTreeList::Remove( SvListEntry* pEntry )
// Explorer aus der View Eintraege, die er nicht in die View
// eingefuegt hat. Da sich der Kunde fuer ein platzendes
// Office nichts kaufen kann, fange ich diesen Fall ab.
- return FALSE;
+ return sal_False;
}
Broadcast( LISTACTION_REMOVING, pEntry );
- ULONG nRemoved = 1 + GetChildCount(pEntry);
- bAbsPositionsValid = FALSE;
+ sal_uLong nRemoved = 1 + GetChildCount(pEntry);
+ bAbsPositionsValid = sal_False;
SvListEntry* pParent = pEntry->pParent;
SvTreeEntryList* pList = pParent->pChilds;
DBG_ASSERT(pList,"Remove:No Childlist");
- BOOL bLastEntry = FALSE;
+ sal_Bool bLastEntry = sal_False;
if ( pEntry->HasChildListPos() )
{
- ULONG nListPos = pEntry->GetChildListPos();
- bLastEntry = (nListPos == (pList->Count()-1) ) ? TRUE : FALSE;
+ sal_uLong nListPos = pEntry->GetChildListPos();
+ bLastEntry = (nListPos == (pList->Count()-1) ) ? sal_True : sal_False;
pList->Remove( nListPos );
}
else
@@ -1360,7 +1350,7 @@ CheckIntegrity();
Broadcast( LISTACTION_REMOVED, pEntry );
delete pEntry; // loescht auch alle Childs
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -1369,7 +1359,7 @@ CheckIntegrity();
|*
*************************************************************************/
-ULONG SvTreeList::SelectChilds(SvListView* pView, SvListEntry* pParent,BOOL bSelect )
+sal_uLong SvTreeList::SelectChilds(SvListView* pView, SvListEntry* pParent,sal_Bool bSelect )
{
DBG_ASSERT(pView&&pParent,"SelChilds:View/Parent?");
if ( !pParent->pChilds )
@@ -1377,9 +1367,9 @@ ULONG SvTreeList::SelectChilds(SvListView* pView, SvListEntry* pParent,BOOL bSel
if ( pParent->pChilds->Count() == 0 )
return 0;
- USHORT nRefDepth = GetDepth( pParent );
- USHORT nDepth = nRefDepth;
- ULONG nCount = 0;
+ sal_uInt16 nRefDepth = GetDepth( pParent );
+ sal_uInt16 nDepth = nRefDepth;
+ sal_uLong nCount = 0;
pParent = Next( pParent );
do
{
@@ -1394,7 +1384,7 @@ CheckIntegrity();
return nCount;
}
-void SvTreeList::SelectAll( SvListView* pView, BOOL bSelect )
+void SvTreeList::SelectAll( SvListView* pView, sal_Bool bSelect )
{
DBG_ASSERT(pView,"SelectAll:NoView");
SvListEntry* pEntry = First();
@@ -1418,7 +1408,7 @@ CheckIntegrity();
}
-SvListEntry* SvTreeList::GetEntryAtAbsPos( ULONG nAbsPos ) const
+SvListEntry* SvTreeList::GetEntryAtAbsPos( sal_uLong nAbsPos ) const
{
SvListEntry* pEntry = First();
while ( nAbsPos && pEntry )
@@ -1429,7 +1419,7 @@ SvListEntry* SvTreeList::GetEntryAtAbsPos( ULONG nAbsPos ) const
return pEntry;
}
-SvListEntry* SvTreeList::GetEntryAtVisPos( const SvListView* pView, ULONG nVisPos ) const
+SvListEntry* SvTreeList::GetEntryAtVisPos( const SvListView* pView, sal_uLong nVisPos ) const
{
DBG_ASSERT(pView,"GetEntryAtVisPos:No View");
SvListEntry* pEntry = First();
@@ -1450,7 +1440,7 @@ void SvTreeList::SetListPositions( SvTreeEntryList* pList )
pEntry->pParent->InvalidateChildrensListPositions();
}
/*
- ULONG nListPos = 0;
+ sal_uLong nListPos = 0;
SvListEntry* pEntry = (SvListEntry*)(pList->First());
while( pEntry )
{
@@ -1467,13 +1457,13 @@ void SvTreeList::InvalidateEntry( SvListEntry* pEntry )
Broadcast( LISTACTION_INVALIDATE_ENTRY, pEntry );
}
-BOOL SvTreeList::IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const
+sal_Bool SvTreeList::IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const
{
if ( !pParent )
pParent = pRootItem;
- BOOL bIsChild = FALSE;
+ sal_Bool bIsChild = sal_False;
if ( pParent->pChilds )
- bIsChild = (BOOL)(pParent->pChilds->GetPos(pChild) != LIST_ENTRY_NOTFOUND);
+ bIsChild = (sal_Bool)(pParent->pChilds->GetPos(pChild) != LIST_ENTRY_NOTFOUND);
return bIsChild;
}
@@ -1481,7 +1471,7 @@ BOOL SvTreeList::IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const
void lcl_CheckList( SvTreeEntryList* pList )
{
SvListEntry* pEntry = (SvListEntry*)(pList->First());
- ULONG nPos = 0;
+ sal_uLong nPos = 0;
while ( pEntry )
{
DBG_ASSERT(pEntry->GetChildListPos()==nPos,"Wrong ListPos");
@@ -1492,7 +1482,7 @@ void lcl_CheckList( SvTreeEntryList* pList )
void SvTreeList::CheckIntegrity() const
{
- ULONG nMyEntryCount = 0;
+ sal_uLong nMyEntryCount = 0;
if ( pRootItem->pChilds )
{
lcl_CheckList( pRootItem->pChilds );
@@ -1543,7 +1533,7 @@ SvListView::SvListView( SvTreeList* pModell )
pModel = 0;
nSelectionCount = 0;
nVisibleCount = 0;
- bVisPositionsValid = FALSE;
+ bVisPositionsValid = sal_False;
SetModel( pModell );
}
@@ -1553,7 +1543,7 @@ SvListView::SvListView()
pModel = 0;
nSelectionCount = 0;
nVisibleCount = 0;
- bVisPositionsValid = FALSE;
+ bVisPositionsValid = sal_False;
}
@@ -1587,7 +1577,7 @@ void SvListView::InitTable()
pEntry = pModel->pRootItem;
pViewData = new SvViewData;
pViewData->nFlags = SVLISTENTRYFLAG_EXPANDED;
- aDataTable.Insert( (ULONG)pEntry, pViewData );
+ aDataTable.Insert( (sal_uLong)pEntry, pViewData );
// Jetzt alle anderen Entries
pEntry = pModel->First();
while( pEntry )
@@ -1595,7 +1585,7 @@ void SvListView::InitTable()
pViewData = CreateViewData( pEntry );
DBG_ASSERT(pViewData,"InitTable:No ViewData");
InitViewData( pViewData, pEntry );
- aDataTable.Insert( (ULONG)pEntry, pViewData );
+ aDataTable.Insert( (sal_uLong)pEntry, pViewData );
pEntry = pModel->Next( pEntry );
}
}
@@ -1623,25 +1613,25 @@ void SvListView::Clear()
ClearTable();
nSelectionCount = 0;
nVisibleCount = 0;
- bVisPositionsValid = FALSE;
+ bVisPositionsValid = sal_False;
if( pModel )
{
// RootEntry einfuegen
SvListEntry* pEntry = pModel->pRootItem;
SvViewData* pViewData = new SvViewData;
pViewData->nFlags = SVLISTENTRYFLAG_EXPANDED;
- aDataTable.Insert( (ULONG)pEntry, pViewData );
+ aDataTable.Insert( (sal_uLong)pEntry, pViewData );
}
}
void SvListView::SetModel( SvTreeList* pNewModel )
{
DBG_CHKTHIS(SvListView,0);
- BOOL bBroadcastCleared = FALSE;
+ sal_Bool bBroadcastCleared = sal_False;
if ( pModel )
{
pModel->RemoveView( this );
- bBroadcastCleared = TRUE;
+ bBroadcastCleared = sal_True;
ModelNotification( LISTACTION_CLEARING,0,0,0 );
if ( pModel->GetRefCount() == 0 )
delete pModel;
@@ -1670,7 +1660,7 @@ void SvListView::ModelHasInsertedTree( SvListEntry* )
}
void SvListView::ModelIsMoving( SvListEntry* /* pSource */ ,
- SvListEntry* /* pTargetParent */ , ULONG /* nPos */ )
+ SvListEntry* /* pTargetParent */ , sal_uLong /* nPos */ )
{
DBG_CHKTHIS(SvListView,0);
}
@@ -1696,28 +1686,28 @@ void SvListView::ModelHasEntryInvalidated( SvListEntry*)
DBG_CHKTHIS(SvListView,0);
}
-void SvListView::ActionMoving( SvListEntry* pEntry,SvListEntry*,ULONG)
+void SvListView::ActionMoving( SvListEntry* pEntry,SvListEntry*,sal_uLong)
{
DBG_CHKTHIS(SvListView,0);
SvListEntry* pParent = pEntry->pParent;
DBG_ASSERT(pParent,"Model not consistent");
if( pParent != pModel->pRootItem && pParent->pChilds->Count() == 1 )
{
- SvViewData* pViewData = (SvViewData*)aDataTable.Get( (ULONG)pParent );
+ SvViewData* pViewData = (SvViewData*)aDataTable.Get( (sal_uLong)pParent );
pViewData->nFlags &= (~SVLISTENTRYFLAG_EXPANDED);
}
// vorlaeufig
nVisibleCount = 0;
- bVisPositionsValid = FALSE;
+ bVisPositionsValid = sal_False;
}
void SvListView::ActionMoved( SvListEntry* /* pEntry */ ,
SvListEntry* /* pTargetPrnt */ ,
- ULONG /* nChildPos */ )
+ sal_uLong /* nChildPos */ )
{
DBG_CHKTHIS(SvListView,0);
nVisibleCount = 0;
- bVisPositionsValid = FALSE;
+ bVisPositionsValid = sal_False;
}
void SvListView::ActionInserted( SvListEntry* pEntry )
@@ -1727,14 +1717,14 @@ void SvListView::ActionInserted( SvListEntry* pEntry )
SvViewData* pData = CreateViewData( pEntry );
InitViewData( pData, pEntry );
#ifdef DBG_UTIL
- BOOL bSuccess =
+ sal_Bool bSuccess =
#endif
- aDataTable.Insert( (ULONG)pEntry, pData );
+ aDataTable.Insert( (sal_uLong)pEntry, pData );
DBG_ASSERT(bSuccess,"Entry already in View");
if ( nVisibleCount && pModel->IsEntryVisible( this, pEntry ))
{
nVisibleCount = 0;
- bVisPositionsValid = FALSE;
+ bVisPositionsValid = sal_False;
}
}
@@ -1744,18 +1734,18 @@ void SvListView::ActionInsertedTree( SvListEntry* pEntry )
if ( pModel->IsEntryVisible( this, pEntry ))
{
nVisibleCount = 0;
- bVisPositionsValid = FALSE;
+ bVisPositionsValid = sal_False;
}
// ueber Entry und seine Childs iterieren
SvListEntry* pCurEntry = pEntry;
- USHORT nRefDepth = pModel->GetDepth( pCurEntry );
+ sal_uInt16 nRefDepth = pModel->GetDepth( pCurEntry );
while( pCurEntry )
{
- DBG_ASSERT(aDataTable.Get((ULONG)pCurEntry)==0,"Entry already in Table");
+ DBG_ASSERT(aDataTable.Get((sal_uLong)pCurEntry)==0,"Entry already in Table");
SvViewData* pViewData = CreateViewData( pCurEntry );
DBG_ASSERT(pViewData,"No ViewData");
InitViewData( pViewData, pEntry );
- aDataTable.Insert( (ULONG)pCurEntry, pViewData );
+ aDataTable.Insert( (sal_uLong)pCurEntry, pViewData );
pCurEntry = pModel->Next( pCurEntry );
if ( pCurEntry && pModel->GetDepth(pCurEntry) <= nRefDepth)
pCurEntry = 0;
@@ -1770,9 +1760,9 @@ void SvListView::RemoveViewData( SvListEntry* pParent )
SvListEntry* pCur = (SvListEntry*)pChilds->First();
while( pCur )
{
- SvViewData* pViewData = (SvViewData*)aDataTable.Get((ULONG)pCur);
+ SvViewData* pViewData = (SvViewData*)aDataTable.Get((sal_uLong)pCur);
delete pViewData;
- aDataTable.Remove( (ULONG)pCur );
+ aDataTable.Remove( (sal_uLong)pCur );
if( pCur->HasChilds())
RemoveViewData( pCur );
pCur = (SvListEntry*)pChilds->Next();
@@ -1787,12 +1777,12 @@ void SvListView::ActionRemoving( SvListEntry* pEntry )
DBG_CHKTHIS(SvListView,0);
DBG_ASSERT(pEntry,"Remove:No Entry");
- SvViewData* pViewData = (SvViewData*)aDataTable.Get( (ULONG)pEntry );
- ULONG nSelRemoved = 0;
+ SvViewData* pViewData = (SvViewData*)aDataTable.Get( (sal_uLong)pEntry );
+ sal_uLong nSelRemoved = 0;
if ( pViewData->IsSelected() )
nSelRemoved = 1 + pModel->GetChildSelectionCount( this, pEntry );
nSelectionCount -= nSelRemoved;
- ULONG nVisibleRemoved = 0;
+ sal_uLong nVisibleRemoved = 0;
if ( pModel->IsEntryVisible( this, pEntry ) )
nVisibleRemoved = 1 + pModel->GetVisibleChildCount( this, pEntry );
if( nVisibleCount )
@@ -1805,18 +1795,18 @@ void SvListView::ActionRemoving( SvListEntry* pEntry )
#endif
nVisibleCount -= nVisibleRemoved;
}
- bVisPositionsValid = FALSE;
+ bVisPositionsValid = sal_False;
- pViewData = (SvViewData*)aDataTable.Get((ULONG)pEntry);
+ pViewData = (SvViewData*)aDataTable.Get((sal_uLong)pEntry);
delete pViewData;
- aDataTable.Remove( (ULONG)pEntry );
+ aDataTable.Remove( (sal_uLong)pEntry );
RemoveViewData( pEntry );
SvListEntry* pCurEntry = pEntry->pParent;
if ( pCurEntry && pCurEntry != pModel->pRootItem &&
pCurEntry->pChilds->Count() == 1 )
{
- pViewData = (SvViewData*)aDataTable.Get((ULONG)pCurEntry);
+ pViewData = (SvViewData*)aDataTable.Get((sal_uLong)pCurEntry);
pViewData->nFlags &= (~SVLISTENTRYFLAG_EXPANDED);
}
}
@@ -1832,8 +1822,8 @@ void SvListView::ActionClear()
Clear();
}
-void SvListView::ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
- SvListEntry* pEntry2, ULONG nPos )
+void SvListView::ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry1,
+ SvListEntry* pEntry2, sal_uLong nPos )
{
DBG_CHKTHIS(SvListView,0);
switch( nActionId )
@@ -1873,7 +1863,7 @@ void SvListView::ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
ModelHasEntryInvalidated( pEntry1 );
break;
case LISTACTION_RESORTED:
- bVisPositionsValid = FALSE;
+ bVisPositionsValid = sal_False;
break;
case LISTACTION_RESORTING:
break;
@@ -1901,7 +1891,7 @@ StringCompare SvTreeList::Compare( SvListEntry* pLeft, SvListEntry* pRight) cons
void SvTreeList::Resort()
{
Broadcast( LISTACTION_RESORTING );
- bAbsPositionsValid = FALSE;
+ bAbsPositionsValid = sal_False;
ResortChilds( pRootItem );
Broadcast( LISTACTION_RESORTED );
}
@@ -1915,11 +1905,11 @@ void SvTreeList::ResortChilds( SvListEntry* pParent )
List aList( *pChildList );
pChildList->Clear();
- ULONG nCount = aList.Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ sal_uLong nCount = aList.Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvListEntry* pCurEntry = (SvListEntry*)aList.GetObject( nCur );
- ULONG nListPos = LIST_APPEND;
+ sal_uLong nListPos = LIST_APPEND;
GetInsertionPos( pCurEntry, pParent, nListPos );
pChildList->Insert( pCurEntry, nListPos );
if( pCurEntry->pChilds )
@@ -1929,7 +1919,7 @@ void SvTreeList::ResortChilds( SvListEntry* pParent )
}
void SvTreeList::GetInsertionPos( SvListEntry* pEntry, SvListEntry* pParent,
- ULONG& rPos )
+ sal_uLong& rPos )
{
DBG_ASSERT(pEntry,"No Entry");
diff --git a/svtools/source/control/asynclink.cxx b/svtools/source/control/asynclink.cxx
index 758999d61dcd..9a48cf0c73a1 100644..100755
--- a/svtools/source/control/asynclink.cxx
+++ b/svtools/source/control/asynclink.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include <asynclink.hxx>
+#include <svtools/asynclink.hxx>
#include <osl/mutex.hxx>
#include <tools/debug.hxx>
#include <vcl/timer.hxx>
@@ -43,11 +43,11 @@ void AsynchronLink::CreateMutex()
if( !_pMutex ) _pMutex = new osl::Mutex;
}
-void AsynchronLink::Call( void* pObj, BOOL
+void AsynchronLink::Call( void* pObj, sal_Bool
#ifdef DBG_UTIL
bAllowDoubles
#endif
-, BOOL bUseTimer )
+, sal_Bool bUseTimer )
{
#ifdef DBG_UTIL
if ( bUseTimer || !_bInCall )
@@ -93,7 +93,7 @@ AsynchronLink::~AsynchronLink()
Application::RemoveUserEvent( _nEventId );
}
delete _pTimer;
- if( _pDeleted ) *_pDeleted = TRUE;
+ if( _pDeleted ) *_pDeleted = sal_True;
delete _pMutex;
}
@@ -126,13 +126,13 @@ void AsynchronLink::ClearPendingCall()
void AsynchronLink::Call_Impl( void* pArg )
{
- _bInCall = TRUE;
- BOOL bDeleted = FALSE;
+ _bInCall = sal_True;
+ sal_Bool bDeleted = sal_False;
_pDeleted = &bDeleted;
_aLink.Call( pArg );
if( !bDeleted )
{
- _bInCall = FALSE;
+ _bInCall = sal_False;
_pDeleted = 0;
}
}
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index 0fba66e132a8..4a0bc4112264 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -46,7 +46,7 @@
#define _SV_CALENDAR_CXX
#include <svtools/svtools.hrc>
#include <svtools/svtdata.hxx>
-#include <calendar.hxx>
+#include <svtools/calendar.hxx>
// =======================================================================
@@ -63,12 +63,12 @@
#define WEEKNUMBER_HEIGHT 85
-#define CALENDAR_HITTEST_DAY ((USHORT)0x0001)
-#define CALENDAR_HITTEST_WEEK ((USHORT)0x0002)
-#define CALENDAR_HITTEST_MONTHTITLE ((USHORT)0x0004)
-#define CALENDAR_HITTEST_PREV ((USHORT)0x0008)
-#define CALENDAR_HITTEST_NEXT ((USHORT)0x0010)
-#define CALENDAR_HITTEST_OUTSIDE ((USHORT)0x1000)
+#define CALENDAR_HITTEST_DAY ((sal_uInt16)0x0001)
+#define CALENDAR_HITTEST_WEEK ((sal_uInt16)0x0002)
+#define CALENDAR_HITTEST_MONTHTITLE ((sal_uInt16)0x0004)
+#define CALENDAR_HITTEST_PREV ((sal_uInt16)0x0008)
+#define CALENDAR_HITTEST_NEXT ((sal_uInt16)0x0010)
+#define CALENDAR_HITTEST_OUTSIDE ((sal_uInt16)0x1000)
#define MENU_YEAR_COUNT 3
@@ -83,7 +83,7 @@ struct ImplDateInfo
XubString maText;
Color* mpTextColor;
Color* mpFrameColor;
- USHORT mnFlags;
+ sal_uInt16 mnFlags;
ImplDateInfo( const XubString& rText ) :
maText( rText )
@@ -95,7 +95,7 @@ DECLARE_TABLE( ImplDateTable, ImplDateInfo* )
// =======================================================================
-static void ImplCalendarSelectDate( Table* pTable, const Date& rDate, BOOL bSelect )
+static void ImplCalendarSelectDate( Table* pTable, const Date& rDate, sal_Bool bSelect )
{
if ( bSelect )
pTable->Insert( rDate.GetDate(), TABLE_DATE_SELECTED );
@@ -108,7 +108,7 @@ static void ImplCalendarSelectDate( Table* pTable, const Date& rDate, BOOL bSele
static void ImplCalendarSelectDateRange( Table* pTable,
const Date& rStartDate,
const Date& rEndDate,
- BOOL bSelect )
+ sal_Bool bSelect )
{
Date aStartDate = rStartDate;
Date aEndDate = rEndDate;
@@ -209,24 +209,24 @@ void Calendar::ImplInit( WinBits nWinStyle )
mnFirstYear = 0;
mnLastYear = 0;
mnRequestYear = 0;
- mbCalc = TRUE;
- mbFormat = TRUE;
- mbDrag = FALSE;
- mbSelection = FALSE;
- mbMultiSelection = FALSE;
- mbWeekSel = FALSE;
- mbUnSel = FALSE;
- mbMenuDown = FALSE;
- mbSpinDown = FALSE;
- mbPrevIn = FALSE;
- mbNextIn = FALSE;
- mbDirect = FALSE;
- mbInSelChange = FALSE;
- mbTravelSelect = FALSE;
- mbScrollDateRange = FALSE;
- mbSelLeft = FALSE;
- mbAllSel = FALSE;
- mbDropPos = FALSE;
+ mbCalc = sal_True;
+ mbFormat = sal_True;
+ mbDrag = sal_False;
+ mbSelection = sal_False;
+ mbMultiSelection = sal_False;
+ mbWeekSel = sal_False;
+ mbUnSel = sal_False;
+ mbMenuDown = sal_False;
+ mbSpinDown = sal_False;
+ mbPrevIn = sal_False;
+ mbNextIn = sal_False;
+ mbDirect = sal_False;
+ mbInSelChange = sal_False;
+ mbTravelSelect = sal_False;
+ mbScrollDateRange = sal_False;
+ mbSelLeft = sal_False;
+ mbAllSel = sal_False;
+ mbDropPos = sal_False;
::rtl::OUString aGregorian( RTL_CONSTASCII_USTRINGPARAM( "gregorian"));
maCalendarWrapper.loadCalendar( aGregorian,
@@ -253,14 +253,14 @@ void Calendar::ImplInit( WinBits nWinStyle )
}
SetFirstDate( maCurDate );
- ImplCalendarSelectDate( mpSelectTable, maCurDate, TRUE );
+ ImplCalendarSelectDate( mpSelectTable, maCurDate, sal_True );
// Sonstige Strings erzeugen
maDayText = XubString( SvtResId( STR_SVT_CALENDAR_DAY ) );
maWeekText = XubString( SvtResId( STR_SVT_CALENDAR_WEEK ) );
// Tagestexte anlegen
- for ( USHORT i = 0; i < 31; i++ )
+ for ( sal_uInt16 i = 0; i < 31; i++ )
mpDayText[i] = new UniString( UniString::CreateFromInt32( i+1 ) );
maDragScrollTimer.SetTimeoutHdl( STATIC_LINK( this, Calendar, ScrollHdl ) );
@@ -339,7 +339,7 @@ Calendar::~Calendar()
if ( mpRestoreSelectTable )
delete mpRestoreSelectTable;
- for ( USHORT i = 0; i < 31; i++ )
+ for ( sal_uInt16 i = 0; i < 31; i++ )
delete mpDayText[i];
}
@@ -347,7 +347,7 @@ Calendar::~Calendar()
void Calendar::SetMinimumNumberOfDaysInWeek( sal_Int16 nDays )
{
- ImplUpdate( TRUE );
+ ImplUpdate( sal_True );
maCalendarWrapper.setMinimumNumberOfDaysForFirstWeek( nDays);
}
@@ -355,7 +355,7 @@ void Calendar::SetMinimumNumberOfDaysInWeek( sal_Int16 nDays )
void Calendar::SetWeekStart( sal_Int16 nDay )
{
- ImplUpdate( TRUE );
+ ImplUpdate( sal_True );
switch (nDay)
{
case i18n::Weekdays::SUNDAY :
@@ -530,23 +530,23 @@ void Calendar::ImplFormat()
nDay %= 7;
}
- mbCalc = FALSE;
+ mbCalc = sal_False;
}
// Anzahl Tage berechnen
DayOfWeek eStartDay = ImplGetWeekStart();
- USHORT nWeekDay;
+ sal_uInt16 nWeekDay;
Date aTempDate = GetFirstMonth();
maFirstDate = aTempDate;
- nWeekDay = (USHORT)aTempDate.GetDayOfWeek();
- nWeekDay = (nWeekDay+(7-(USHORT)eStartDay)) % 7;
- maFirstDate -= (ULONG)nWeekDay;
+ nWeekDay = (sal_uInt16)aTempDate.GetDayOfWeek();
+ nWeekDay = (nWeekDay+(7-(sal_uInt16)eStartDay)) % 7;
+ maFirstDate -= (sal_uLong)nWeekDay;
mnDayCount = nWeekDay;
- USHORT nDaysInMonth;
- USHORT nMonthCount = (USHORT)(mnMonthPerLine*mnLines);
- for ( USHORT i = 0; i < nMonthCount; i++ )
+ sal_uInt16 nDaysInMonth;
+ sal_uInt16 nMonthCount = (sal_uInt16)(mnMonthPerLine*mnLines);
+ for ( sal_uInt16 i = 0; i < nMonthCount; i++ )
{
nDaysInMonth = aTempDate.GetDaysInMonth();
mnDayCount += nDaysInMonth;
@@ -556,8 +556,8 @@ void Calendar::ImplFormat()
aTempDate2--;
nDaysInMonth = aTempDate2.GetDaysInMonth();
aTempDate2 -= nDaysInMonth-1;
- nWeekDay = (USHORT)aTempDate2.GetDayOfWeek();
- nWeekDay = (nWeekDay+(7-(USHORT)eStartDay)) % 7;
+ nWeekDay = (sal_uInt16)aTempDate2.GetDayOfWeek();
+ nWeekDay = (nWeekDay+(7-(sal_uInt16)eStartDay)) % 7;
mnDayCount += 42-nDaysInMonth-nWeekDay;
// Farben festlegen
@@ -575,8 +575,8 @@ void Calendar::ImplFormat()
}
// DateInfo besorgen
- USHORT nNewFirstYear = maFirstDate.GetYear();
- USHORT nNewLastYear = GetLastDate().GetYear();
+ sal_uInt16 nNewFirstYear = maFirstDate.GetYear();
+ sal_uInt16 nNewLastYear = GetLastDate().GetYear();
if ( mnFirstYear )
{
if ( nNewFirstYear < mnFirstYear )
@@ -601,12 +601,12 @@ void Calendar::ImplFormat()
}
mnRequestYear = 0;
- mbFormat = FALSE;
+ mbFormat = sal_False;
}
// -----------------------------------------------------------------------
-USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const
+sal_uInt16 Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const
{
if ( mbFormat )
return 0;
@@ -620,7 +620,7 @@ USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const
long nY;
long nOffX;
long nYMonth;
- USHORT nDay;
+ sal_uInt16 nDay;
DayOfWeek eStartDay = ImplGetWeekStart();
rDate = GetFirstMonth();
@@ -637,7 +637,7 @@ USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const
if ( (rPos.X() < nX) && (rPos.Y() < nYMonth) )
return 0;
- USHORT nDaysInMonth = rDate.GetDaysInMonth();
+ sal_uInt16 nDaysInMonth = rDate.GetDaysInMonth();
// Entsprechender Monat gefunden
if ( (rPos.X() > nX) && (rPos.Y() < nYMonth) &&
@@ -651,8 +651,8 @@ USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const
long nDayY = nY+mnDaysOffY;
if ( rPos.Y() < nDayY )
return 0;
- USHORT nDayIndex = (USHORT)rDate.GetDayOfWeek();
- nDayIndex = (nDayIndex+(7-(USHORT)eStartDay)) % 7;
+ sal_uInt16 nDayIndex = (sal_uInt16)rDate.GetDayOfWeek();
+ nDayIndex = (nDayIndex+(7-(sal_uInt16)eStartDay)) % 7;
if ( (i == 0) && (j == 0) )
{
Date aTempDate = rDate;
@@ -693,9 +693,9 @@ USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const
}
if ( (i == mnLines-1) && (j == mnMonthPerLine-1) )
{
- USHORT nWeekDay = (USHORT)rDate.GetDayOfWeek();
- nWeekDay = (nWeekDay+(7-(USHORT)eStartDay)) % 7;
- USHORT nDayCount = 42-nDaysInMonth-nWeekDay;
+ sal_uInt16 nWeekDay = (sal_uInt16)rDate.GetDayOfWeek();
+ nWeekDay = (nWeekDay+(7-(sal_uInt16)eStartDay)) % 7;
+ sal_uInt16 nDayCount = 42-nDaysInMonth-nWeekDay;
Date aTempDate = rDate;
aTempDate += nDaysInMonth;
for ( nDay = 1; nDay <= nDayCount; nDay++ )
@@ -738,7 +738,7 @@ USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const
// -----------------------------------------------------------------------
static void ImplDrawSpinArrow( OutputDevice* pDev, const Rectangle& rRect,
- BOOL bPrev )
+ sal_Bool bPrev )
{
long i;
long n;
@@ -783,7 +783,7 @@ static void ImplDrawSpinArrow( OutputDevice* pDev, const Rectangle& rRect,
// -----------------------------------------------------------------------
-void Calendar::ImplDrawSpin( BOOL bDrawPrev, BOOL bDrawNext )
+void Calendar::ImplDrawSpin( sal_Bool bDrawPrev, sal_Bool bDrawNext )
{
if ( !bDrawPrev && !bDrawNext )
return;
@@ -797,7 +797,7 @@ void Calendar::ImplDrawSpin( BOOL bDrawPrev, BOOL bDrawNext )
aOutRect.Top() += 3;
aOutRect.Right() -= 3;
aOutRect.Bottom() -= 3;
- ImplDrawSpinArrow( this, aOutRect, TRUE );
+ ImplDrawSpinArrow( this, aOutRect, sal_True );
}
if ( bDrawNext )
{
@@ -806,33 +806,33 @@ void Calendar::ImplDrawSpin( BOOL bDrawPrev, BOOL bDrawNext )
aOutRect.Top() += 3;
aOutRect.Right() -= 3;
aOutRect.Bottom() -= 3;
- ImplDrawSpinArrow( this, aOutRect, FALSE );
+ ImplDrawSpinArrow( this, aOutRect, sal_False );
}
}
// -----------------------------------------------------------------------
void Calendar::ImplDrawDate( long nX, long nY,
- USHORT nDay, USHORT nMonth, USHORT nYear,
+ sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear,
DayOfWeek eDayOfWeek,
- BOOL bBack, BOOL bOther, ULONG nToday )
+ sal_Bool bBack, sal_Bool bOther, sal_uLong nToday )
{
ImplDateInfo* pDateInfo;
Color* pTextColor = NULL;
const String& rDay = *(mpDayText[nDay-1]);
Rectangle aDateRect( nX, nY, nX+mnDayWidth-1, nY+mnDayHeight-1 );
- BOOL bSel = FALSE;
- BOOL bFocus = FALSE;
+ sal_Bool bSel = sal_False;
+ sal_Bool bFocus = sal_False;
// Aktueller Tag
if ( (nDay == maCurDate.GetDay()) &&
(nMonth == maCurDate.GetMonth()) &&
(nYear == maCurDate.GetYear()) )
- bFocus = TRUE;
+ bFocus = sal_True;
if ( mpSelectTable )
{
if ( mpSelectTable->IsKeyValid( Date( nDay, nMonth, nYear ).GetDate() ) )
- bSel = TRUE;
+ bSel = sal_True;
}
// Dateinfo ermitteln
@@ -870,11 +870,11 @@ void Calendar::ImplDrawDate( long nX, long nY,
// Font ermitteln
Font aOldFont = GetFont();
- BOOL bBoldFont = FALSE;
+ sal_Bool bBoldFont = sal_False;
if ( (mnWinStyle & WB_BOLDTEXT) &&
pDateInfo && (pDateInfo->mnFlags & DIB_BOLD) )
{
- bBoldFont = TRUE;
+ bBoldFont = sal_True;
Font aFont = aOldFont;
if ( aFont.GetWeight() < WEIGHT_BOLD )
aFont.SetWeight( WEIGHT_BOLD );
@@ -966,7 +966,7 @@ void Calendar::ImplDrawDate( long nX, long nY,
// -----------------------------------------------------------------------
-void Calendar::ImplDraw( BOOL bPaint )
+void Calendar::ImplDraw( sal_Bool bPaint )
{
ImplFormat();
@@ -980,10 +980,10 @@ void Calendar::ImplDraw( BOOL bPaint )
long nDeltaY;
long nDayX;
long nDayY;
- ULONG nToday = Date().GetDate();
- USHORT nDay;
- USHORT nMonth;
- USHORT nYear;
+ sal_uLong nToday = Date().GetDate();
+ sal_uInt16 nDay;
+ sal_uInt16 nMonth;
+ sal_uInt16 nYear;
Date aDate = GetFirstMonth();
DayOfWeek eStartDay = ImplGetWeekStart();
@@ -1120,7 +1120,7 @@ void Calendar::ImplDraw( BOOL bPaint )
nDayX -= mnWeekWidth;
nDayY = nY+mnDaysOffY;
maCalendarWrapper.setGregorianDateTime( aDate);
- for ( USHORT nWeekCount = 0; nWeekCount < 6; nWeekCount++ )
+ for ( sal_uInt16 nWeekCount = 0; nWeekCount < 6; nWeekCount++ )
{
sal_Int16 nWeek = maCalendarWrapper.getValue( i18n::CalendarFieldIndex::WEEK_OF_YEAR);
String aWeekText( String::CreateFromInt32( nWeek));
@@ -1134,7 +1134,7 @@ void Calendar::ImplDraw( BOOL bPaint )
}
// Tage ausgeben
- USHORT nDaysInMonth = aDate.GetDaysInMonth();
+ sal_uInt16 nDaysInMonth = aDate.GetDaysInMonth();
nDayX = nX+mnDaysOffX;
nDayY = nY+mnDaysOffY;
if ( !bPaint )
@@ -1143,8 +1143,8 @@ void Calendar::ImplDraw( BOOL bPaint )
nDayX+(7*mnDayWidth)-1, nDayY+(6*mnDayHeight)-1 );
Erase( aClearRect );
}
- USHORT nDayIndex = (USHORT)aDate.GetDayOfWeek();
- nDayIndex = (nDayIndex+(7-(USHORT)eStartDay)) % 7;
+ sal_uInt16 nDayIndex = (sal_uInt16)aDate.GetDayOfWeek();
+ nDayIndex = (nDayIndex+(7-(sal_uInt16)eStartDay)) % 7;
if ( (i == 0) && (j == 0) )
{
Date aTempDate = aDate;
@@ -1154,15 +1154,15 @@ void Calendar::ImplDraw( BOOL bPaint )
nDeltaX = nDayX + (nDay*mnDayWidth);
ImplDrawDate( nDeltaX, nDayY, nDay+aTempDate.GetDay(),
aTempDate.GetMonth(), aTempDate.GetYear(),
- (DayOfWeek)((nDay+(USHORT)eStartDay)%7), FALSE, TRUE, nToday );
+ (DayOfWeek)((nDay+(sal_uInt16)eStartDay)%7), sal_False, sal_True, nToday );
}
}
for ( nDay = 1; nDay <= nDaysInMonth; nDay++ )
{
nDeltaX = nDayX + (nDayIndex*mnDayWidth);
ImplDrawDate( nDeltaX, nDayY, nDay, nMonth, nYear,
- (DayOfWeek)((nDayIndex+(USHORT)eStartDay)%7),
- FALSE, FALSE, nToday );
+ (DayOfWeek)((nDayIndex+(sal_uInt16)eStartDay)%7),
+ sal_False, sal_False, nToday );
if ( nDayIndex == 6 )
{
nDayIndex = 0;
@@ -1173,9 +1173,9 @@ void Calendar::ImplDraw( BOOL bPaint )
}
if ( (i == mnLines-1) && (j == mnMonthPerLine-1) )
{
- USHORT nWeekDay = (USHORT)aDate.GetDayOfWeek();
- nWeekDay = (nWeekDay+(7-(USHORT)eStartDay)) % 7;
- USHORT nDayCount = 42-nDaysInMonth-nWeekDay;
+ sal_uInt16 nWeekDay = (sal_uInt16)aDate.GetDayOfWeek();
+ nWeekDay = (nWeekDay+(7-(sal_uInt16)eStartDay)) % 7;
+ sal_uInt16 nDayCount = 42-nDaysInMonth-nWeekDay;
Date aTempDate = aDate;
aTempDate += nDaysInMonth;
for ( nDay = 1; nDay <= nDayCount; nDay++ )
@@ -1183,8 +1183,8 @@ void Calendar::ImplDraw( BOOL bPaint )
nDeltaX = nDayX + (nDayIndex*mnDayWidth);
ImplDrawDate( nDeltaX, nDayY, nDay,
aTempDate.GetMonth(), aTempDate.GetYear(),
- (DayOfWeek)((nDayIndex+(USHORT)eStartDay)%7),
- FALSE, TRUE, nToday );
+ (DayOfWeek)((nDayIndex+(sal_uInt16)eStartDay)%7),
+ sal_False, sal_True, nToday );
if ( nDayIndex == 6 )
{
nDayIndex = 0;
@@ -1216,10 +1216,10 @@ void Calendar::ImplUpdateDate( const Date& rDate )
Rectangle aDateRect( GetDateRect( rDate ) );
if ( !aDateRect.IsEmpty() )
{
- BOOL bOther = (rDate < GetFirstMonth()) || (rDate > GetLastMonth());
+ sal_Bool bOther = (rDate < GetFirstMonth()) || (rDate > GetLastMonth());
ImplDrawDate( aDateRect.Left(), aDateRect.Top(),
rDate.GetDay(), rDate.GetMonth(), rDate.GetYear(),
- rDate.GetDayOfWeek(), TRUE, bOther );
+ rDate.GetDayOfWeek(), sal_True, bOther );
}
}
}
@@ -1230,7 +1230,7 @@ void Calendar::ImplUpdateSelection( Table* pOld )
{
Table* pNew = mpSelectTable;
void* p;
- ULONG nKey;
+ sal_uLong nKey;
p = pOld->First();
while ( p )
@@ -1261,8 +1261,8 @@ void Calendar::ImplUpdateSelection( Table* pOld )
// -----------------------------------------------------------------------
-void Calendar::ImplMouseSelect( const Date& rDate, USHORT nHitTest,
- BOOL bMove, BOOL bExpand, BOOL bExtended )
+void Calendar::ImplMouseSelect( const Date& rDate, sal_uInt16 nHitTest,
+ sal_Bool bMove, sal_Bool bExpand, sal_Bool bExtended )
{
Table* pOldSel = new Table( *mpSelectTable );
Date aOldDate = maCurDate;
@@ -1298,35 +1298,35 @@ void Calendar::ImplMouseSelect( const Date& rDate, USHORT nHitTest,
{
if ( mbSelLeft )
{
- ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), aTempDate, FALSE );
- ImplCalendarSelectDateRange( mpSelectTable, maAnchorDate, Date( 31, 12, 9999 ), FALSE );
+ ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), aTempDate, sal_False );
+ ImplCalendarSelectDateRange( mpSelectTable, maAnchorDate, Date( 31, 12, 9999 ), sal_False );
}
else
{
- ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), maAnchorDate, FALSE );
- ImplCalendarSelectDateRange( mpSelectTable, aTempDate, Date( 31, 12, 9999 ), FALSE );
+ ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), maAnchorDate, sal_False );
+ ImplCalendarSelectDateRange( mpSelectTable, aTempDate, Date( 31, 12, 9999 ), sal_False );
}
}
- ImplCalendarSelectDateRange( mpSelectTable, aTempDate, maAnchorDate, TRUE );
+ ImplCalendarSelectDateRange( mpSelectTable, aTempDate, maAnchorDate, sal_True );
}
else if ( bExtended && !(mnWinStyle & WB_RANGESELECT) )
{
maAnchorDate = aTempDate;
if ( IsDateSelected( aTempDate ) )
{
- mbUnSel = TRUE;
- ImplCalendarSelectDate( mpSelectTable, aTempDate, FALSE );
+ mbUnSel = sal_True;
+ ImplCalendarSelectDate( mpSelectTable, aTempDate, sal_False );
}
else
{
- ImplCalendarSelectDate( mpSelectTable, aTempDate, TRUE );
+ ImplCalendarSelectDate( mpSelectTable, aTempDate, sal_True );
}
}
else
{
maAnchorDate = aTempDate;
ImplCalendarClearSelectDate( mpSelectTable );
- ImplCalendarSelectDate( mpSelectTable, aTempDate, TRUE );
+ ImplCalendarSelectDate( mpSelectTable, aTempDate, sal_True );
}
mpRestoreSelectTable = new Table( *mpSelectTable );
@@ -1335,9 +1335,9 @@ void Calendar::ImplMouseSelect( const Date& rDate, USHORT nHitTest,
else
{
if ( aTempDate < maCurDate )
- mbSelLeft = TRUE;
+ mbSelLeft = sal_True;
else
- mbSelLeft = FALSE;
+ mbSelLeft = sal_False;
if ( !(nHitTest & CALENDAR_HITTEST_DAY) )
aTempDate = maOldCurDate;
if ( !bMove )
@@ -1345,19 +1345,19 @@ void Calendar::ImplMouseSelect( const Date& rDate, USHORT nHitTest,
if ( aTempDate != maCurDate )
{
maCurDate = aTempDate;
- ImplCalendarSelectDate( mpSelectTable, aOldDate, FALSE );
- ImplCalendarSelectDate( mpSelectTable, maCurDate, TRUE );
+ ImplCalendarSelectDate( mpSelectTable, aOldDate, sal_False );
+ ImplCalendarSelectDate( mpSelectTable, maCurDate, sal_True );
}
}
- BOOL bNewSel = *pOldSel != *mpSelectTable;
+ sal_Bool bNewSel = *pOldSel != *mpSelectTable;
if ( (maCurDate != aOldDate) || bNewSel )
{
if ( bNewSel )
{
- mbInSelChange = TRUE;
+ mbInSelChange = sal_True;
SelectionChanging();
- mbInSelChange = FALSE;
+ mbInSelChange = sal_False;
}
HideFocus();
if ( bNewSel )
@@ -1373,7 +1373,7 @@ void Calendar::ImplMouseSelect( const Date& rDate, USHORT nHitTest,
// -----------------------------------------------------------------------
-void Calendar::ImplUpdate( BOOL bCalcNew )
+void Calendar::ImplUpdate( sal_Bool bCalcNew )
{
if ( IsReallyVisible() && IsUpdateMode() )
{
@@ -1383,8 +1383,8 @@ void Calendar::ImplUpdate( BOOL bCalcNew )
{
if ( mbDirect )
{
- mbFormat = TRUE;
- ImplDraw( FALSE );
+ mbFormat = sal_True;
+ ImplDraw( sal_False );
return;
}
else
@@ -1393,8 +1393,8 @@ void Calendar::ImplUpdate( BOOL bCalcNew )
}
if ( bCalcNew )
- mbCalc = TRUE;
- mbFormat = TRUE;
+ mbCalc = sal_True;
+ mbFormat = sal_True;
}
// -----------------------------------------------------------------------
@@ -1409,7 +1409,7 @@ void Calendar::ImplInvertDropPos()
// -----------------------------------------------------------------------
-void Calendar::ImplScroll( BOOL bPrev )
+void Calendar::ImplScroll( sal_Bool bPrev )
{
Date aNewFirstMonth = GetFirstMonth();
if ( bPrev )
@@ -1419,9 +1419,9 @@ void Calendar::ImplScroll( BOOL bPrev )
}
else
aNewFirstMonth += aNewFirstMonth.GetDaysInMonth();
- mbDirect = TRUE;
+ mbDirect = sal_True;
SetFirstDate( aNewFirstMonth );
- mbDirect = FALSE;
+ mbDirect = sal_False;
}
// -----------------------------------------------------------------------
@@ -1433,12 +1433,12 @@ void Calendar::ImplShowMenu( const Point& rPos, const Date& rDate )
Date aOldFirstDate = GetFirstMonth();
PopupMenu aPopupMenu;
PopupMenu* pYearPopupMenus[MENU_YEAR_COUNT];
- USHORT nMonthOff;
- USHORT nCurItemId;
- USHORT nYear = rDate.GetYear()-1;
- USHORT i;
- USHORT j;
- USHORT nYearIdCount = 1000;
+ sal_uInt16 nMonthOff;
+ sal_uInt16 nCurItemId;
+ sal_uInt16 nYear = rDate.GetYear()-1;
+ sal_uInt16 i;
+ sal_uInt16 j;
+ sal_uInt16 nYearIdCount = 1000;
nMonthOff = (rDate.GetYear()-aOldFirstDate.GetYear())*12;
if ( aOldFirstDate.GetMonth() < rDate.GetMonth() )
@@ -1459,9 +1459,9 @@ void Calendar::ImplShowMenu( const Point& rPos, const Date& rDate )
nYearIdCount += 1000;
}
- mbMenuDown = TRUE;
+ mbMenuDown = sal_True;
nCurItemId = aPopupMenu.Execute( this, rPos );
- mbMenuDown = FALSE;
+ mbMenuDown = sal_False;
// Menu zerstoeren
aPopupMenu.SetPopupMenu( 2, NULL );
@@ -1473,10 +1473,10 @@ void Calendar::ImplShowMenu( const Point& rPos, const Date& rDate )
if ( nCurItemId )
{
- USHORT nTempMonthOff = nMonthOff % 12;
- USHORT nTempYearOff = nMonthOff / 12;
- USHORT nNewMonth = nCurItemId % 1000;
- USHORT nNewYear = nYear+((nCurItemId-1000)/1000);
+ sal_uInt16 nTempMonthOff = nMonthOff % 12;
+ sal_uInt16 nTempYearOff = nMonthOff / 12;
+ sal_uInt16 nNewMonth = nCurItemId % 1000;
+ sal_uInt16 nNewYear = nYear+((nCurItemId-1000)/1000);
if ( nTempMonthOff < nNewMonth )
nNewMonth = nNewMonth - nTempMonthOff;
else
@@ -1491,10 +1491,10 @@ void Calendar::ImplShowMenu( const Point& rPos, const Date& rDate )
// -----------------------------------------------------------------------
-void Calendar::ImplTracking( const Point& rPos, BOOL bRepeat )
+void Calendar::ImplTracking( const Point& rPos, sal_Bool bRepeat )
{
Date aTempDate = maCurDate;
- USHORT nHitTest = ImplHitTest( rPos, aTempDate );
+ sal_uInt16 nHitTest = ImplHitTest( rPos, aTempDate );
if ( mbSpinDown )
{
@@ -1503,29 +1503,29 @@ void Calendar::ImplTracking( const Point& rPos, BOOL bRepeat )
if ( bRepeat && (mbPrevIn || mbNextIn) )
{
- mbScrollDateRange = TRUE;
+ mbScrollDateRange = sal_True;
ImplScroll( mbPrevIn );
- mbScrollDateRange = FALSE;
+ mbScrollDateRange = sal_False;
}
}
else
- ImplMouseSelect( aTempDate, nHitTest, TRUE, FALSE, FALSE );
+ ImplMouseSelect( aTempDate, nHitTest, sal_True, sal_False, sal_False );
}
// -----------------------------------------------------------------------
-void Calendar::ImplEndTracking( BOOL bCancel )
+void Calendar::ImplEndTracking( sal_Bool bCancel )
{
- BOOL bSelection = mbSelection;
- BOOL bSpinDown = mbSpinDown;
+ sal_Bool bSelection = mbSelection;
+ sal_Bool bSpinDown = mbSpinDown;
- mbDrag = FALSE;
- mbSelection = FALSE;
- mbMultiSelection = FALSE;
- mbUnSel = FALSE;
- mbSpinDown = FALSE;
- mbPrevIn = FALSE;
- mbNextIn = FALSE;
+ mbDrag = sal_False;
+ mbSelection = sal_False;
+ mbMultiSelection = sal_False;
+ mbUnSel = sal_False;
+ mbSpinDown = sal_False;
+ mbPrevIn = sal_False;
+ mbNextIn = sal_False;
if ( bCancel )
{
@@ -1554,15 +1554,15 @@ void Calendar::ImplEndTracking( BOOL bCancel )
if ( !bCancel )
{
// Feststellen, ob wir sichtbaren Bereich scrollen sollen
- ULONG nSelCount = mpSelectTable->Count();
+ sal_uLong nSelCount = mpSelectTable->Count();
if ( nSelCount )
{
Date aFirstSelDate( mpSelectTable->GetObjectKey( 0 ) );
Date aLastSelDate( mpSelectTable->GetObjectKey( nSelCount-1 ) );
if ( aLastSelDate < GetFirstMonth() )
- ImplScroll( TRUE );
+ ImplScroll( sal_True );
else if ( GetLastMonth() < aFirstSelDate )
- ImplScroll( FALSE );
+ ImplScroll( sal_False );
}
}
@@ -1584,13 +1584,13 @@ void Calendar::ImplEndTracking( BOOL bCancel )
IMPL_STATIC_LINK( Calendar, ScrollHdl, Timer*, EMPTYARG )
{
- BOOL bPrevIn = (pThis->mnDragScrollHitTest & CALENDAR_HITTEST_PREV) != 0;
- BOOL bNextIn = (pThis->mnDragScrollHitTest & CALENDAR_HITTEST_NEXT) != 0;
+ sal_Bool bPrevIn = (pThis->mnDragScrollHitTest & CALENDAR_HITTEST_PREV) != 0;
+ sal_Bool bNextIn = (pThis->mnDragScrollHitTest & CALENDAR_HITTEST_NEXT) != 0;
if( bNextIn || bPrevIn )
{
- pThis->mbScrollDateRange = TRUE;
+ pThis->mbScrollDateRange = sal_True;
pThis->ImplScroll( bPrevIn );
- pThis->mbScrollDateRange = FALSE;
+ pThis->mbScrollDateRange = sal_False;
}
return 0;
}
@@ -1602,7 +1602,7 @@ void Calendar::MouseButtonDown( const MouseEvent& rMEvt )
if ( rMEvt.IsLeft() && !mbMenuDown )
{
Date aTempDate = maCurDate;
- USHORT nHitTest = ImplHitTest( rMEvt.GetPosPixel(), aTempDate );
+ sal_uInt16 nHitTest = ImplHitTest( rMEvt.GetPosPixel(), aTempDate );
if ( nHitTest )
{
if ( nHitTest & CALENDAR_HITTEST_MONTHTITLE )
@@ -1615,10 +1615,10 @@ void Calendar::MouseButtonDown( const MouseEvent& rMEvt )
mbNextIn = (nHitTest & CALENDAR_HITTEST_NEXT) != 0;
if ( mbPrevIn || mbNextIn )
{
- mbSpinDown = TRUE;
- mbScrollDateRange = TRUE;
+ mbSpinDown = sal_True;
+ mbScrollDateRange = sal_True;
ImplScroll( mbPrevIn );
- mbScrollDateRange = FALSE;
+ mbScrollDateRange = sal_False;
// Hier muss BUTTONREPEAT stehen, also nicht wieder
// auf SCROLLREPEAT aendern, sondern mit TH abklaeren,
// warum es evtl. anders sein sollte (71775)
@@ -1637,16 +1637,16 @@ void Calendar::MouseButtonDown( const MouseEvent& rMEvt )
if ( !mbSelection )
{
- mbDrag = TRUE;
+ mbDrag = sal_True;
StartTracking();
}
mbMultiSelection = (mnWinStyle & (WB_MULTISELECT | WB_RANGESELECT)) != 0;
if ( (nHitTest & CALENDAR_HITTEST_DAY) && mbMultiSelection )
- mbWeekSel = TRUE;
+ mbWeekSel = sal_True;
else
- mbWeekSel = FALSE;
- ImplMouseSelect( aTempDate, nHitTest, FALSE, rMEvt.IsShift(), rMEvt.IsMod1() );
+ mbWeekSel = sal_False;
+ ImplMouseSelect( aTempDate, nHitTest, sal_False, rMEvt.IsShift(), rMEvt.IsMod1() );
}
}
}
@@ -1663,7 +1663,7 @@ void Calendar::MouseButtonDown( const MouseEvent& rMEvt )
void Calendar::MouseButtonUp( const MouseEvent& rMEvt )
{
if ( rMEvt.IsLeft() && mbSelection )
- ImplEndTracking( FALSE );
+ ImplEndTracking( sal_False );
else
Control::MouseButtonUp( rMEvt );
}
@@ -1673,7 +1673,7 @@ void Calendar::MouseButtonUp( const MouseEvent& rMEvt )
void Calendar::MouseMove( const MouseEvent& rMEvt )
{
if ( mbSelection && rMEvt.GetButtons() )
- ImplTracking( rMEvt.GetPosPixel(), FALSE );
+ ImplTracking( rMEvt.GetPosPixel(), sal_False );
else
Control::MouseMove( rMEvt );
}
@@ -1695,9 +1695,9 @@ void Calendar::Tracking( const TrackingEvent& rTEvt )
void Calendar::KeyInput( const KeyEvent& rKEvt )
{
Date aNewDate = maCurDate;
- BOOL bMultiSel = (mnWinStyle & (WB_RANGESELECT | WB_MULTISELECT)) != 0;
- BOOL bExpand = rKEvt.GetKeyCode().IsShift();
- BOOL bExtended = rKEvt.GetKeyCode().IsMod1();
+ sal_Bool bMultiSel = (mnWinStyle & (WB_RANGESELECT | WB_MULTISELECT)) != 0;
+ sal_Bool bExpand = rKEvt.GetKeyCode().IsShift();
+ sal_Bool bExtended = rKEvt.GetKeyCode().IsMod1();
switch ( rKEvt.GetKeyCode().GetCode() )
{
@@ -1742,13 +1742,13 @@ void Calendar::KeyInput( const KeyEvent& rKEvt )
{
if ( !bExpand )
{
- BOOL bDateSel = IsDateSelected( maCurDate );
+ sal_Bool bDateSel = IsDateSelected( maCurDate );
SelectDate( maCurDate, !bDateSel );
- mbSelLeft = FALSE;
+ mbSelLeft = sal_False;
SelectionChanging();
- mbTravelSelect = TRUE;
+ mbTravelSelect = sal_True;
Select();
- mbTravelSelect = FALSE;
+ mbTravelSelect = sal_False;
}
}
else
@@ -1771,23 +1771,23 @@ void Calendar::KeyInput( const KeyEvent& rKEvt )
{
if ( mbSelLeft )
{
- ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), aNewDate, FALSE );
- ImplCalendarSelectDateRange( mpSelectTable, maAnchorDate, Date( 31, 12, 9999 ), FALSE );
+ ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), aNewDate, sal_False );
+ ImplCalendarSelectDateRange( mpSelectTable, maAnchorDate, Date( 31, 12, 9999 ), sal_False );
}
else
{
- ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), maAnchorDate, FALSE );
- ImplCalendarSelectDateRange( mpSelectTable, aNewDate, Date( 31, 12, 9999 ), FALSE );
+ ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), maAnchorDate, sal_False );
+ ImplCalendarSelectDateRange( mpSelectTable, aNewDate, Date( 31, 12, 9999 ), sal_False );
}
}
- ImplCalendarSelectDateRange( mpSelectTable, aNewDate, maAnchorDate, TRUE );
- mbDirect = TRUE;
+ ImplCalendarSelectDateRange( mpSelectTable, aNewDate, maAnchorDate, sal_True );
+ mbDirect = sal_True;
SetCurDate( aNewDate );
- mbDirect = FALSE;
+ mbDirect = sal_False;
maAnchorDate = aOldAnchorDate;
- mbInSelChange = TRUE;
+ mbInSelChange = sal_True;
SelectionChanging();
- mbInSelChange = FALSE;
+ mbInSelChange = sal_False;
ImplUpdateSelection( pOldSel );
delete pOldSel;
}
@@ -1796,15 +1796,15 @@ void Calendar::KeyInput( const KeyEvent& rKEvt )
if ( mnWinStyle & WB_RANGESELECT )
{
SetNoSelection();
- SelectDate( aNewDate, TRUE );
+ SelectDate( aNewDate, sal_True );
}
- mbDirect = TRUE;
+ mbDirect = sal_True;
SetCurDate( aNewDate );
- mbDirect = FALSE;
+ mbDirect = sal_False;
}
- mbTravelSelect = TRUE;
+ mbTravelSelect = sal_True;
Select();
- mbTravelSelect = FALSE;
+ mbTravelSelect = sal_False;
}
}
@@ -1812,7 +1812,7 @@ void Calendar::KeyInput( const KeyEvent& rKEvt )
void Calendar::Paint( const Rectangle& )
{
- ImplDraw( TRUE );
+ ImplDraw( sal_True );
}
// -----------------------------------------------------------------------
@@ -1835,7 +1835,7 @@ void Calendar::LoseFocus()
void Calendar::Resize()
{
- ImplUpdate( TRUE );
+ ImplUpdate( sal_True );
Control::Resize();
}
@@ -1881,8 +1881,8 @@ void Calendar::RequestHelp( const HelpEvent& rHEvt )
if ( rHEvt.GetMode() & HELPMODE_QUICK )
{
maCalendarWrapper.setGregorianDateTime( aDate);
- USHORT nWeek = (USHORT) maCalendarWrapper.getValue( i18n::CalendarFieldIndex::WEEK_OF_YEAR);
- USHORT nMonth = aDate.GetMonth();
+ sal_uInt16 nWeek = (sal_uInt16) maCalendarWrapper.getValue( i18n::CalendarFieldIndex::WEEK_OF_YEAR);
+ sal_uInt16 nMonth = aDate.GetMonth();
XubString aStr( maDayText );
aStr.AppendAscii( ": " );
aStr.Append( XubString::CreateFromInt32( aDate.GetDayOfYear() ) );
@@ -1919,7 +1919,7 @@ void Calendar::Command( const CommandEvent& rCEvt )
if ( !mbSelection && rCEvt.IsMouseEvent() )
{
Date aTempDate = maCurDate;
- USHORT nHitTest = ImplHitTest( rCEvt.GetMousePosPixel(), aTempDate );
+ sal_uInt16 nHitTest = ImplHitTest( rCEvt.GetMousePosPixel(), aTempDate );
if ( nHitTest & CALENDAR_HITTEST_MONTHTITLE )
{
ImplShowMenu( rCEvt.GetMousePosPixel(), aTempDate );
@@ -1937,7 +1937,7 @@ void Calendar::Command( const CommandEvent& rCEvt )
{
while ( nNotchDelta < 0 )
{
- ImplScroll( TRUE );
+ ImplScroll( sal_True );
nNotchDelta++;
}
}
@@ -1945,7 +1945,7 @@ void Calendar::Command( const CommandEvent& rCEvt )
{
while ( nNotchDelta > 0 )
{
- ImplScroll( FALSE );
+ ImplScroll( sal_False );
nNotchDelta--;
}
}
@@ -2020,7 +2020,7 @@ void Calendar::Select()
// -----------------------------------------------------------------------
-void Calendar::SelectDate( const Date& rDate, BOOL bSelect )
+void Calendar::SelectDate( const Date& rDate, sal_Bool bSelect )
{
if ( !rDate.IsValid() )
return;
@@ -2044,7 +2044,7 @@ void Calendar::SelectDate( const Date& rDate, BOOL bSelect )
// -----------------------------------------------------------------------
void Calendar::SelectDateRange( const Date& rStartDate, const Date& rEndDate,
- BOOL bSelect )
+ sal_Bool bSelect )
{
if ( !rStartDate.IsValid() || !rEndDate.IsValid() )
return;
@@ -2087,21 +2087,21 @@ void Calendar::SetNoSelection()
// -----------------------------------------------------------------------
-BOOL Calendar::IsDateSelected( const Date& rDate ) const
+sal_Bool Calendar::IsDateSelected( const Date& rDate ) const
{
return mpSelectTable->IsKeyValid( rDate.GetDate() );
}
// -----------------------------------------------------------------------
-ULONG Calendar::GetSelectDateCount() const
+sal_uLong Calendar::GetSelectDateCount() const
{
return mpSelectTable->Count();
}
// -----------------------------------------------------------------------
-Date Calendar::GetSelectDate( ULONG nIndex ) const
+Date Calendar::GetSelectDate( sal_uLong nIndex ) const
{
if ( nIndex < mpSelectTable->Count() )
return Date( mpSelectTable->GetObjectKey( nIndex ) );
@@ -2121,18 +2121,18 @@ void Calendar::SetCurDate( const Date& rNewDate )
if ( maCurDate != rNewDate )
{
- BOOL bUpdate = IsVisible() && IsUpdateMode();
+ sal_Bool bUpdate = IsVisible() && IsUpdateMode();
Date aOldDate = maCurDate;
maCurDate = rNewDate;
maAnchorDate = maCurDate;
if ( !(mnWinStyle & (WB_RANGESELECT | WB_MULTISELECT)) )
{
- ImplCalendarSelectDate( mpSelectTable, aOldDate, FALSE );
- ImplCalendarSelectDate( mpSelectTable, maCurDate, TRUE );
+ ImplCalendarSelectDate( mpSelectTable, aOldDate, sal_False );
+ ImplCalendarSelectDate( mpSelectTable, maCurDate, sal_True );
}
else if ( !HasFocus() )
- bUpdate = FALSE;
+ bUpdate = sal_False;
// Aktuelles Datum noch in den sichtbaren Bereich verschieben
if ( mbFormat || (maCurDate < GetFirstMonth()) )
@@ -2177,7 +2177,7 @@ void Calendar::SetFirstDate( const Date& rNewFirstDate )
if ( maFirstDate != rNewFirstDate )
{
maFirstDate = Date( 1, rNewFirstDate.GetMonth(), rNewFirstDate.GetYear() );
- mbDropPos = FALSE;
+ mbDropPos = sal_False;
ImplUpdate();
}
}
@@ -2202,8 +2202,8 @@ Date Calendar::GetFirstMonth() const
Date Calendar::GetLastMonth() const
{
Date aDate = GetFirstMonth();
- USHORT nMonthCount = GetMonthCount();
- for ( USHORT i = 0; i < nMonthCount; i++ )
+ sal_uInt16 nMonthCount = GetMonthCount();
+ for ( sal_uInt16 i = 0; i < nMonthCount; i++ )
aDate += aDate.GetDaysInMonth();
aDate--;
return aDate;
@@ -2211,39 +2211,39 @@ Date Calendar::GetLastMonth() const
// -----------------------------------------------------------------------
-USHORT Calendar::GetMonthCount() const
+sal_uInt16 Calendar::GetMonthCount() const
{
if ( mbFormat )
return 1;
else
- return (USHORT)(mnMonthPerLine*mnLines);
+ return (sal_uInt16)(mnMonthPerLine*mnLines);
}
// -----------------------------------------------------------------------
-BOOL Calendar::GetDropDate( Date& rDate ) const
+sal_Bool Calendar::GetDropDate( Date& rDate ) const
{
if( mbDropPos )
{
rDate = maDropDate;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Calendar::GetDate( const Point& rPos, Date& rDate ) const
+sal_Bool Calendar::GetDate( const Point& rPos, Date& rDate ) const
{
Date aDate = maCurDate;
- USHORT nHitTest = ImplHitTest( rPos, aDate );
+ sal_uInt16 nHitTest = ImplHitTest( rPos, aDate );
if ( nHitTest & CALENDAR_HITTEST_DAY )
{
rDate = aDate;
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -2257,8 +2257,8 @@ Rectangle Calendar::GetDateRect( const Date& rDate ) const
long nX;
long nY;
- ULONG nDaysOff;
- USHORT nDayIndex;
+ sal_uLong nDaysOff;
+ sal_uInt16 nDayIndex;
Date aDate = GetFirstMonth();
if ( rDate < aDate )
@@ -2275,13 +2275,13 @@ Rectangle Calendar::GetDateRect( const Date& rDate ) const
Date aLastDate = GetLastMonth();
if ( rDate > aLastDate )
{
- USHORT nWeekDay = (USHORT)aLastDate.GetDayOfWeek();
- nWeekDay = (nWeekDay+(7-(USHORT)ImplGetWeekStart())) % 7;
+ sal_uInt16 nWeekDay = (sal_uInt16)aLastDate.GetDayOfWeek();
+ nWeekDay = (nWeekDay+(7-(sal_uInt16)ImplGetWeekStart())) % 7;
aLastDate -= nWeekDay;
aRect = GetDateRect( aLastDate );
nDaysOff = rDate-aLastDate;
nDayIndex = 0;
- for ( USHORT i = 0; i <= nDaysOff; i++ )
+ for ( sal_uInt16 i = 0; i <= nDaysOff; i++ )
{
if ( aLastDate == rDate )
{
@@ -2308,7 +2308,7 @@ Rectangle Calendar::GetDateRect( const Date& rDate ) const
nX = 0;
for ( long j = 0; j < mnMonthPerLine; j++ )
{
- USHORT nDaysInMonth = aDate.GetDaysInMonth();
+ sal_uInt16 nDaysInMonth = aDate.GetDaysInMonth();
// Monat gerufen
if ( (aDate.GetMonth() == rDate.GetMonth()) &&
@@ -2316,9 +2316,9 @@ Rectangle Calendar::GetDateRect( const Date& rDate ) const
{
long nDayX = nX+mnDaysOffX;
long nDayY = nY+mnDaysOffY;
- nDayIndex = (USHORT)aDate.GetDayOfWeek();
- nDayIndex = (nDayIndex+(7-(USHORT)ImplGetWeekStart())) % 7;
- for ( USHORT nDay = 1; nDay <= nDaysInMonth; nDay++ )
+ nDayIndex = (sal_uInt16)aDate.GetDayOfWeek();
+ nDayIndex = (nDayIndex+(7-(sal_uInt16)ImplGetWeekStart())) % 7;
+ for ( sal_uInt16 nDay = 1; nDay <= nDaysInMonth; nDay++ )
{
if ( nDay == rDate.GetDay() )
{
@@ -2385,13 +2385,13 @@ void Calendar::SetSundayColor( const Color& rColor )
void Calendar::AddDateInfo( const Date& rDate, const String& rText,
const Color* pTextColor, const Color* pFrameColor,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
if ( !mpDateTable )
mpDateTable = new ImplDateTable( 256, 256 );
- BOOL bChanged = FALSE;
- ULONG nKey = rDate.GetDate();
+ sal_Bool bChanged = sal_False;
+ sal_uLong nKey = rDate.GetDate();
ImplDateInfo* pDateInfo = mpDateTable->Get( nKey );
if ( pDateInfo )
pDateInfo->maText = rText;
@@ -2407,13 +2407,13 @@ void Calendar::AddDateInfo( const Date& rDate, const String& rText,
if ( *(pDateInfo->mpTextColor) != *pTextColor )
{
*(pDateInfo->mpTextColor) = *pTextColor;
- bChanged = TRUE;
+ bChanged = sal_True;
}
}
else
{
pDateInfo->mpTextColor = new Color( *pTextColor );
- bChanged = TRUE;
+ bChanged = sal_True;
}
}
else
@@ -2422,7 +2422,7 @@ void Calendar::AddDateInfo( const Date& rDate, const String& rText,
{
delete pDateInfo->mpTextColor;
pDateInfo->mpTextColor = NULL;
- bChanged = TRUE;
+ bChanged = sal_True;
}
}
if ( pFrameColor )
@@ -2432,13 +2432,13 @@ void Calendar::AddDateInfo( const Date& rDate, const String& rText,
if ( *(pDateInfo->mpFrameColor) != *pFrameColor )
{
*(pDateInfo->mpFrameColor) = *pFrameColor;
- bChanged = TRUE;
+ bChanged = sal_True;
}
}
else
{
pDateInfo->mpFrameColor = new Color( *pFrameColor );
- bChanged = TRUE;
+ bChanged = sal_True;
}
}
else
@@ -2447,13 +2447,13 @@ void Calendar::AddDateInfo( const Date& rDate, const String& rText,
{
delete pDateInfo->mpFrameColor;
pDateInfo->mpFrameColor = NULL;
- bChanged = TRUE;
+ bChanged = sal_True;
}
}
if ( pDateInfo->mnFlags != nFlags )
{
pDateInfo->mnFlags = nFlags;
- bChanged = TRUE;
+ bChanged = sal_True;
}
if ( bChanged )
@@ -2484,7 +2484,7 @@ void Calendar::ClearDateInfo()
ImplDateInfo* pDateInfo = mpDateTable->First();
while ( pDateInfo )
{
- ULONG nKey = mpDateTable->GetCurKey();
+ sal_uLong nKey = mpDateTable->GetCurKey();
mpDateTable->Remove( nKey );
Date aDate( nKey );
ImplUpdateDate( aDate );
@@ -2503,7 +2503,7 @@ XubString Calendar::GetDateInfoText( const Date& rDate )
XubString aRet;
if ( mpDateTable )
{
- ULONG nKey = rDate.GetDate();
+ sal_uLong nKey = rDate.GetDate();
ImplDateInfo* pDateInfo = mpDateTable->Get( nKey );
if ( pDateInfo )
aRet = pDateInfo->maText;
@@ -2513,7 +2513,7 @@ XubString Calendar::GetDateInfoText( const Date& rDate )
// -----------------------------------------------------------------------
-BOOL Calendar::ShowDropPos( const Point& rPos, Date& rDate )
+sal_Bool Calendar::ShowDropPos( const Point& rPos, Date& rDate )
{
Date aTempDate = maCurDate;
mnDragScrollHitTest = ImplHitTest( rPos, aTempDate );
@@ -2535,12 +2535,12 @@ BOOL Calendar::ShowDropPos( const Point& rPos, Date& rDate )
if( mbDropPos )
ImplInvertDropPos();
maDropDate = aTempDate;
- mbDropPos = TRUE;
+ mbDropPos = sal_True;
ImplInvertDropPos();
}
rDate = maDropDate;
- return TRUE;
+ return sal_True;
}
}
}
@@ -2548,7 +2548,7 @@ BOOL Calendar::ShowDropPos( const Point& rPos, Date& rDate )
maDragScrollTimer.Stop();
HideDropPos();
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -2558,7 +2558,7 @@ void Calendar::HideDropPos()
if ( mbDropPos )
{
ImplInvertDropPos();
- mbDropPos = FALSE;
+ mbDropPos = sal_False;
}
}
@@ -2571,7 +2571,7 @@ void Calendar::StartSelection()
maOldCurDate = maCurDate;
mpOldSelectTable = new Table( *mpSelectTable );
- mbSelection = TRUE;
+ mbSelection = sal_True;
}
// -----------------------------------------------------------------------
@@ -2583,12 +2583,12 @@ void Calendar::EndSelection()
if ( !mbSelection )
ReleaseMouse();
- mbDrag = FALSE;
- mbSelection = FALSE;
- mbMultiSelection = FALSE;
- mbSpinDown = FALSE;
- mbPrevIn = FALSE;
- mbNextIn = FALSE;
+ mbDrag = sal_False;
+ mbSelection = sal_False;
+ mbMultiSelection = sal_False;
+ mbSpinDown = sal_False;
+ mbPrevIn = sal_False;
+ mbNextIn = sal_False;
}
}
@@ -2669,8 +2669,8 @@ public:
void SetCalendar( Calendar* pCalendar )
{ mpCalendar = pCalendar; }
- PushButton* EnableTodayBtn( BOOL bEnable );
- PushButton* EnableNoneBtn( BOOL bEnable );
+ PushButton* EnableTodayBtn( sal_Bool bEnable );
+ PushButton* EnableNoneBtn( sal_Bool bEnable );
void ArrangeButtons();
long Notify( NotifyEvent& rNEvt );
@@ -2698,7 +2698,7 @@ ImplCFieldFloatWin::~ImplCFieldFloatWin()
// -----------------------------------------------------------------------
-PushButton* ImplCFieldFloatWin::EnableTodayBtn( BOOL bEnable )
+PushButton* ImplCFieldFloatWin::EnableTodayBtn( sal_Bool bEnable )
{
if ( bEnable )
{
@@ -2730,7 +2730,7 @@ PushButton* ImplCFieldFloatWin::EnableTodayBtn( BOOL bEnable )
// -----------------------------------------------------------------------
-PushButton* ImplCFieldFloatWin::EnableNoneBtn( BOOL bEnable )
+PushButton* ImplCFieldFloatWin::EnableNoneBtn( sal_Bool bEnable )
{
if ( bEnable )
{
@@ -2849,8 +2849,8 @@ CalendarField::CalendarField( Window* pParent, WinBits nWinStyle ) :
mpFloatWin = NULL;
mpCalendar = NULL;
mnCalendarStyle = 0;
- mbToday = FALSE;
- mbNone = FALSE;
+ mbToday = sal_False;
+ mbNone = sal_False;
}
// -----------------------------------------------------------------------
@@ -2862,8 +2862,8 @@ CalendarField::CalendarField( Window* pParent, const ResId& rResId ) :
mpFloatWin = NULL;
mpCalendar = NULL;
mnCalendarStyle = 0;
- mbToday = FALSE;
- mbNone = FALSE;
+ mbToday = sal_False;
+ mbNone = sal_False;
}
// -----------------------------------------------------------------------
@@ -2949,7 +2949,7 @@ void CalendarField::Select()
// -----------------------------------------------------------------------
-BOOL CalendarField::ShowDropDown( BOOL bShow )
+sal_Bool CalendarField::ShowDropDown( sal_Bool bShow )
{
if ( bShow )
{
@@ -2994,7 +2994,7 @@ BOOL CalendarField::ShowDropDown( BOOL bShow )
mpCalendar->EndSelection();
EndDropDown();
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
diff --git a/svtools/source/control/collatorres.cxx b/svtools/source/control/collatorres.cxx
index 20b7865db569..7be2700b45c1 100644
--- a/svtools/source/control/collatorres.cxx
+++ b/svtools/source/control/collatorres.cxx
@@ -31,9 +31,7 @@
#include "precompiled_svtools.hxx"
#include <svtools/svtdata.hxx>
#include <svtools/svtools.hrc>
-
-
-#include <collatorres.hxx>
+#include <svtools/collatorres.hxx>
// -------------------------------------------------------------------------
//
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 2699af857710..431b9c0122ab 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -39,9 +39,9 @@
#include <svtools/svtdata.hxx>
#include <svtools/svtools.hrc>
-#include <ctrlbox.hxx>
-#include <ctrltool.hxx>
-#include <borderhelper.hxx>
+#include <svtools/ctrlbox.hxx>
+#include <svtools/ctrltool.hxx>
+#include <svtools/borderhelper.hxx>
#include <vcl/i18nhelp.hxx>
#include <vcl/fontcapabilities.hxx>
@@ -66,10 +66,10 @@ using namespace ::com::sun::star;
struct ImplColorListData
{
Color aColor;
- BOOL bColor;
+ sal_Bool bColor;
- ImplColorListData() : aColor( COL_BLACK ) { bColor = FALSE; }
- ImplColorListData( const Color& rColor ) : aColor( rColor ) { bColor = TRUE; }
+ ImplColorListData() : aColor( COL_BLACK ) { bColor = sal_False; }
+ ImplColorListData( const Color& rColor ) : aColor( rColor ) { bColor = sal_True; }
};
// -----------------------------------------------------------------------
@@ -81,7 +81,7 @@ void ColorListBox::ImplInit()
aImageSize.Height() = GetTextHeight();
aImageSize.Height() -= 2;
- EnableUserDraw( TRUE );
+ EnableUserDraw( sal_True );
SetUserItemSize( aImageSize );
}
@@ -120,7 +120,7 @@ ColorListBox::~ColorListBox()
// -----------------------------------------------------------------------
-USHORT ColorListBox::InsertEntry( const XubString& rStr, USHORT nPos )
+sal_uInt16 ColorListBox::InsertEntry( const XubString& rStr, sal_uInt16 nPos )
{
nPos = ListBox::InsertEntry( rStr, nPos );
if ( nPos != LISTBOX_ERROR )
@@ -143,8 +143,8 @@ USHORT ColorListBox::InsertEntry( const XubString& rStr, USHORT nPos )
// -----------------------------------------------------------------------
-USHORT ColorListBox::InsertEntry( const Color& rColor, const XubString& rStr,
- USHORT nPos )
+sal_uInt16 ColorListBox::InsertEntry( const Color& rColor, const XubString& rStr,
+ sal_uInt16 nPos )
{
nPos = ListBox::InsertEntry( rStr, nPos );
if ( nPos != LISTBOX_ERROR )
@@ -175,7 +175,7 @@ void ColorListBox::InsertAutomaticEntry()
// -----------------------------------------------------------------------
-void ColorListBox::RemoveEntry( USHORT nPos )
+void ColorListBox::RemoveEntry( sal_uInt16 nPos )
{
ListBox::RemoveEntry( nPos );
if ( nPos < pColorList->size() )
@@ -207,7 +207,7 @@ void ColorListBox::CopyEntries( const ColorListBox& rBox )
for ( size_t n = 0; n < nCount; n++ )
{
ImplColorListData* pData = (*rBox.pColorList)[ n ];
- USHORT nPos = InsertEntry( rBox.GetEntry( n ), LISTBOX_APPEND );
+ sal_uInt16 nPos = InsertEntry( rBox.GetEntry( n ), LISTBOX_APPEND );
if ( nPos != LISTBOX_ERROR )
{
if ( nPos < pColorList->size() )
@@ -226,9 +226,9 @@ void ColorListBox::CopyEntries( const ColorListBox& rBox )
// -----------------------------------------------------------------------
-USHORT ColorListBox::GetEntryPos( const Color& rColor ) const
+sal_uInt16 ColorListBox::GetEntryPos( const Color& rColor ) const
{
- for( USHORT n = (USHORT) pColorList->size(); n; )
+ for( sal_uInt16 n = (sal_uInt16) pColorList->size(); n; )
{
ImplColorListData* pData = (*pColorList)[ --n ];
if ( pData->bColor && ( pData->aColor == rColor ) )
@@ -239,7 +239,7 @@ USHORT ColorListBox::GetEntryPos( const Color& rColor ) const
// -----------------------------------------------------------------------
-Color ColorListBox::GetEntryColor( USHORT nPos ) const
+Color ColorListBox::GetEntryColor( sal_uInt16 nPos ) const
{
Color aColor;
ImplColorListData* pData = ( nPos < pColorList->size() ) ? (*pColorList)[ nPos ] : NULL;
@@ -266,13 +266,13 @@ void ColorListBox::UserDraw( const UserDrawEvent& rUDEvt )
rUDEvt.GetDevice()->SetLineColor( rUDEvt.GetDevice()->GetTextColor() );
rUDEvt.GetDevice()->DrawRect( Rectangle( aPos, aImageSize ) );
rUDEvt.GetDevice()->Pop();
- ListBox::DrawEntry( rUDEvt, FALSE, TRUE, FALSE );
+ ListBox::DrawEntry( rUDEvt, sal_False, sal_True, sal_False );
}
else
- ListBox::DrawEntry( rUDEvt, FALSE, TRUE, TRUE );
+ ListBox::DrawEntry( rUDEvt, sal_False, sal_True, sal_True );
}
else
- ListBox::DrawEntry( rUDEvt, TRUE, TRUE, FALSE );
+ ListBox::DrawEntry( rUDEvt, sal_True, sal_True, sal_False );
}
// =======================================================================
@@ -288,7 +288,7 @@ struct ImpLineListData
long nLine1;
long nLine2;
long nDistance;
- USHORT nStyle;
+ sal_uInt16 nStyle;
};
// -----------------------------------------------------------------------
@@ -301,9 +301,9 @@ inline const Color& LineListBox::GetPaintColor( void ) const
// -----------------------------------------------------------------------
-inline void lclDrawPolygon( OutputDevice& rDev, const basegfx::B2DPolygon& rPolygon, long nWidth, USHORT nDashing )
+inline void lclDrawPolygon( OutputDevice& rDev, const basegfx::B2DPolygon& rPolygon, long nWidth, sal_uInt16 nDashing )
{
- USHORT nOldAA = rDev.GetAntialiasing();
+ sal_uInt16 nOldAA = rDev.GetAntialiasing();
rDev.SetAntialiasing( nOldAA & !ANTIALIASING_ENABLE_B2DDRAW );
Color aOldColor = rDev.GetFillColor( );
@@ -337,7 +337,7 @@ inline void lclDrawPolygon( OutputDevice& rDev, const basegfx::B2DPolygon& rPoly
namespace svtools
{
- basegfx::B2DPolyPolygon ApplyLineDashing( const basegfx::B2DPolygon& rPolygon, USHORT nDashing, MapUnit eUnit )
+ basegfx::B2DPolyPolygon ApplyLineDashing( const basegfx::B2DPolygon& rPolygon, sal_uInt16 nDashing, MapUnit eUnit )
{
::std::vector < double >aPattern;
switch ( nDashing )
@@ -390,7 +390,7 @@ namespace svtools
}
void DrawLine( OutputDevice& rDev, const Point& rP1, const Point& rP2,
- sal_uInt32 nWidth, USHORT nDashing )
+ sal_uInt32 nWidth, sal_uInt16 nDashing )
{
basegfx::B2DPolygon aPolygon;
aPolygon.append( basegfx::B2DPoint( rP1.X(), rP1.Y() ) );
@@ -400,7 +400,7 @@ namespace svtools
}
void LineListBox::ImpGetLine( long nLine1, long nLine2, long nDistance,
- USHORT nStyle, Bitmap& rBmp, XubString& rStr )
+ sal_uInt16 nStyle, Bitmap& rBmp, XubString& rStr )
{
Size aSize = GetOutputSizePixel();
aSize.Width() -= 20;
@@ -539,7 +539,7 @@ LineListBox::~LineListBox()
// -----------------------------------------------------------------------
-USHORT LineListBox::InsertEntry( const XubString& rStr, USHORT nPos )
+sal_uInt16 LineListBox::InsertEntry( const XubString& rStr, sal_uInt16 nPos )
{
nPos = ListBox::InsertEntry( rStr, nPos );
if ( nPos != LISTBOX_ERROR ) {
@@ -556,8 +556,8 @@ USHORT LineListBox::InsertEntry( const XubString& rStr, USHORT nPos )
// -----------------------------------------------------------------------
-USHORT LineListBox::InsertEntry( long nLine1, long nLine2, long nDistance,
- USHORT nStyle, USHORT nPos )
+sal_uInt16 LineListBox::InsertEntry( long nLine1, long nLine2, long nDistance,
+ sal_uInt16 nStyle, sal_uInt16 nPos )
{
XubString aStr;
Bitmap aBmp;
@@ -584,7 +584,7 @@ USHORT LineListBox::InsertEntry( long nLine1, long nLine2, long nDistance,
// -----------------------------------------------------------------------
-void LineListBox::RemoveEntry( USHORT nPos )
+void LineListBox::RemoveEntry( sal_uInt16 nPos )
{
ListBox::RemoveEntry( nPos );
@@ -612,8 +612,8 @@ void LineListBox::Clear()
// -----------------------------------------------------------------------
-USHORT LineListBox::GetEntryPos( long nLine1, long nLine2,
- long nDistance, USHORT nStyle ) const
+sal_uInt16 LineListBox::GetEntryPos( long nLine1, long nLine2,
+ long nDistance, sal_uInt16 nStyle ) const
{
for ( size_t i = 0, n = pLineList->size(); i < n; ++i ) {
ImpLineListData* pData = (*pLineList)[ i ];
@@ -624,7 +624,7 @@ USHORT LineListBox::GetEntryPos( long nLine1, long nLine2,
&& (pData->nDistance == nDistance)
&& (pData->nStyle == nStyle)
) {
- return (USHORT)i;
+ return (sal_uInt16)i;
}
}
}
@@ -633,7 +633,7 @@ USHORT LineListBox::GetEntryPos( long nLine1, long nLine2,
// -----------------------------------------------------------------------
-long LineListBox::GetEntryLine1( USHORT nPos ) const
+long LineListBox::GetEntryLine1( sal_uInt16 nPos ) const
{
ImpLineListData* pData = (nPos < pLineList->size()) ? (*pLineList)[ nPos ] : NULL;
return ( pData ) ? pData->nLine1 : 0;
@@ -641,7 +641,7 @@ long LineListBox::GetEntryLine1( USHORT nPos ) const
// -----------------------------------------------------------------------
-long LineListBox::GetEntryLine2( USHORT nPos ) const
+long LineListBox::GetEntryLine2( sal_uInt16 nPos ) const
{
ImpLineListData* pData = (nPos < pLineList->size()) ? (*pLineList)[ nPos ] : NULL;
return ( pData ) ? pData->nLine2 : 0;
@@ -649,7 +649,7 @@ long LineListBox::GetEntryLine2( USHORT nPos ) const
// -----------------------------------------------------------------------
-long LineListBox::GetEntryDistance( USHORT nPos ) const
+long LineListBox::GetEntryDistance( sal_uInt16 nPos ) const
{
ImpLineListData* pData = (nPos < pLineList->size()) ? (*pLineList)[ nPos ] : NULL;
return ( pData ) ? pData->nDistance : 0;
@@ -657,7 +657,7 @@ long LineListBox::GetEntryDistance( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT LineListBox::GetEntryStyle( USHORT nPos ) const
+sal_uInt16 LineListBox::GetEntryStyle( sal_uInt16 nPos ) const
{
ImpLineListData* pData = (nPos < pLineList->size()) ? (*pLineList)[ nPos ] : NULL;
return ( pData ) ? pData->nStyle : STYLE_SOLID;
@@ -677,35 +677,34 @@ void LineListBox::UpdateLineColors( void )
Bitmap aBmp;
// exchange entries which containing lines
- SetUpdateMode( FALSE );
+ SetUpdateMode( sal_False );
- USHORT nSelEntry = GetSelectEntryPos();
+ sal_uInt16 nSelEntry = GetSelectEntryPos();
for( size_t n = 0 ; n < nCount ; ++n )
{
ImpLineListData* pData = (*pLineList)[ n ];
if( pData )
{
// exchange listbox data
- ListBox::RemoveEntry( USHORT( n ) );
+ ListBox::RemoveEntry( sal_uInt16( n ) );
ImpGetLine( pData->nLine1, pData->nLine2, pData->nDistance,
pData->nStyle, aBmp, aStr );
- ListBox::InsertEntry( aStr, aBmp, USHORT( n ) );
}
}
if( nSelEntry != LISTBOX_ENTRY_NOTFOUND )
SelectEntryPos( nSelEntry );
- SetUpdateMode( TRUE );
+ SetUpdateMode( sal_True );
Invalidate();
}
}
// -----------------------------------------------------------------------
-BOOL LineListBox::UpdatePaintLineColor( void )
+sal_Bool LineListBox::UpdatePaintLineColor( void )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
const StyleSettings& rSettings = GetSettings().GetStyleSettings();
Color aNewCol( rSettings.GetWindowColor().IsDark()? rSettings.GetLabelTextColor() : aColor );
@@ -734,10 +733,10 @@ void LineListBox::DataChanged( const DataChangedEvent& rDCEvt )
struct ImplFontNameListData
{
FontInfo maInfo;
- USHORT mnType;
+ sal_uInt16 mnType;
ImplFontNameListData( const FontInfo& rInfo,
- USHORT nType ) :
+ sal_uInt16 nType ) :
maInfo( rInfo ),
mnType( nType )
{}
@@ -750,8 +749,8 @@ FontNameBox::FontNameBox( Window* pParent, WinBits nWinStyle ) :
{
InitBitmaps();
mpFontList = NULL;
- mbWYSIWYG = FALSE;
- mbSymbols = FALSE;
+ mbWYSIWYG = sal_False;
+ mbSymbols = sal_False;
}
// -------------------------------------------------------------------
@@ -761,8 +760,8 @@ FontNameBox::FontNameBox( Window* pParent, const ResId& rResId ) :
{
InitBitmaps();
mpFontList = NULL;
- mbWYSIWYG = FALSE;
- mbSymbols = FALSE;
+ mbWYSIWYG = sal_False;
+ mbSymbols = sal_False;
}
// -------------------------------------------------------------------
@@ -817,14 +816,14 @@ void FontNameBox::Fill( const FontList* pList )
mpFontList = new ImplFontList;
// insert fonts
- USHORT nFontCount = pList->GetFontNameCount();
- for ( USHORT i = 0; i < nFontCount; i++ )
+ sal_uInt16 nFontCount = pList->GetFontNameCount();
+ for ( sal_uInt16 i = 0; i < nFontCount; i++ )
{
const FontInfo& rFontInfo = pList->GetFontName( i );
- ULONG nIndex = InsertEntry( rFontInfo.GetName() );
+ sal_uLong nIndex = InsertEntry( rFontInfo.GetName() );
if ( nIndex != LISTBOX_ERROR )
{
- USHORT nType = pList->GetFontNameType( i );
+ sal_uInt16 nType = pList->GetFontNameType( i );
ImplFontNameListData* pData = new ImplFontNameListData( rFontInfo, nType );
if ( nIndex < mpFontList->size() ) {
ImplFontList::iterator it = mpFontList->begin();
@@ -845,7 +844,7 @@ void FontNameBox::Fill( const FontList* pList )
// -------------------------------------------------------------------
-void FontNameBox::EnableWYSIWYG( BOOL bEnable )
+void FontNameBox::EnableWYSIWYG( sal_Bool bEnable )
{
if ( bEnable != mbWYSIWYG )
{
@@ -857,7 +856,7 @@ void FontNameBox::EnableWYSIWYG( BOOL bEnable )
// -------------------------------------------------------------------
-void FontNameBox::EnableSymbols( BOOL bEnable )
+void FontNameBox::EnableSymbols( sal_Bool bEnable )
{
if ( bEnable != mbSymbols )
{
@@ -1738,7 +1737,7 @@ void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt )
{
ImplFontNameListData* pData = (*mpFontList)[ rUDEvt.GetItemId() ];
const FontInfo& rInfo = pData->maInfo;
- USHORT nType = pData->mnType;
+ sal_uInt16 nType = pData->mnType;
Point aTopLeft = rUDEvt.GetRect().TopLeft();
long nX = aTopLeft.X();
long nH = rUDEvt.GetRect().GetHeight();
@@ -1976,11 +1975,11 @@ void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt )
}
rUDEvt.GetDevice()->SetFont( aOldFont );
- DrawEntry( rUDEvt, FALSE, FALSE); // draw seperator
+ DrawEntry( rUDEvt, sal_False, sal_False); // draw seperator
}
else
{
- DrawEntry( rUDEvt, TRUE, TRUE );
+ DrawEntry( rUDEvt, sal_True, sal_True );
}
}
@@ -2032,12 +2031,12 @@ void FontStyleBox::Modify()
CharClass aChrCls( ::comphelper::getProcessServiceFactory(),
GetSettings().GetLocale() );
XubString aStr = GetText();
- USHORT nEntryCount = GetEntryCount();
+ sal_uInt16 nEntryCount = GetEntryCount();
if ( GetEntryPos( aStr ) == COMBOBOX_ENTRY_NOTFOUND )
{
aChrCls.toUpper( aStr );
- for ( USHORT i = 0; i < nEntryCount; i++ )
+ for ( sal_uInt16 i = 0; i < nEntryCount; i++ )
{
XubString aEntryText = GetEntry( i );
aChrCls.toUpper( aEntryText );
@@ -2061,7 +2060,7 @@ void FontStyleBox::Fill( const XubString& rName, const FontList* pList )
// else aLastStyle will overwritten
// store prior selection position and clear box
XubString aOldText = GetText();
- USHORT nPos = GetEntryPos( aOldText );
+ sal_uInt16 nPos = GetEntryPos( aOldText );
Clear();
// does a font with this name already exist?
@@ -2072,11 +2071,11 @@ void FontStyleBox::Fill( const XubString& rName, const FontList* pList )
FontWeight eLastWeight = WEIGHT_DONTKNOW;
FontItalic eLastItalic = ITALIC_NONE;
FontWidth eLastWidth = WIDTH_DONTKNOW;
- BOOL bNormal = FALSE;
- BOOL bItalic = FALSE;
- BOOL bBold = FALSE;
- BOOL bBoldItalic = FALSE;
- BOOL bInsert = FALSE;
+ sal_Bool bNormal = sal_False;
+ sal_Bool bItalic = sal_False;
+ sal_Bool bBold = sal_False;
+ sal_Bool bBoldItalic = sal_False;
+ sal_Bool bInsert = sal_False;
FontInfo aInfo;
while ( hFontInfo )
{
@@ -2096,16 +2095,16 @@ void FontStyleBox::Fill( const XubString& rName, const FontList* pList )
if ( eWeight <= WEIGHT_NORMAL )
{
if ( eItalic != ITALIC_NONE )
- bItalic = TRUE;
+ bItalic = sal_True;
else
- bNormal = TRUE;
+ bNormal = sal_True;
}
else
{
if ( eItalic != ITALIC_NONE )
- bBoldItalic = TRUE;
+ bBoldItalic = sal_True;
else
- bBold = TRUE;
+ bBold = sal_True;
}
// For wrong StyleNames we replace this with the correct once
@@ -2139,11 +2138,11 @@ void FontStyleBox::Fill( const XubString& rName, const FontList* pList )
}
if ( !bItalic && (aStyleText == pList->GetItalicStr()) )
- bItalic = TRUE;
+ bItalic = sal_True;
else if ( !bBold && (aStyleText == pList->GetBoldStr()) )
- bBold = TRUE;
+ bBold = sal_True;
else if ( !bBoldItalic && (aStyleText == pList->GetBoldItalicStr()) )
- bBoldItalic = TRUE;
+ bBoldItalic = sal_True;
hFontInfo = pList->GetNextFontInfo( hFontInfo );
}
@@ -2222,15 +2221,15 @@ FontSizeBox::~FontSizeBox()
void FontSizeBox::ImplInit()
{
- EnableAutocomplete( FALSE );
+ EnableAutocomplete( sal_False );
- bRelativeMode = FALSE;
- bPtRelative = FALSE;
- bRelative = FALSE;
- bStdSize = FALSE;
+ bRelativeMode = sal_False;
+ bPtRelative = sal_False;
+ bRelative = sal_False;
+ bStdSize = sal_False;
pFontList = NULL;
- SetShowTrailingZeros( FALSE );
+ SetShowTrailingZeros( sal_False );
SetDecimalDigits( 1 );
SetMin( 20 );
SetMax( 9999 );
@@ -2266,24 +2265,24 @@ void FontSizeBox::Modify()
XubString aStr = GetText();
aStr.EraseLeadingChars();
- BOOL bNewMode = bRelative;
- BOOL bOldPtRelMode = bPtRelative;
+ sal_Bool bNewMode = bRelative;
+ sal_Bool bOldPtRelMode = bPtRelative;
if ( bRelative )
{
- bPtRelative = FALSE;
+ bPtRelative = sal_False;
const xub_Unicode* pStr = aStr.GetBuffer();
while ( *pStr )
{
if ( ((*pStr < '0') || (*pStr > '9')) && (*pStr != '%') )
{
if ( ('-' == *pStr || '+' == *pStr) && !bPtRelative )
- bPtRelative = TRUE;
+ bPtRelative = sal_True;
else if ( bPtRelative && 'p' == *pStr && 't' == *++pStr )
;
else
{
- bNewMode = FALSE;
+ bNewMode = sal_False;
break;
}
}
@@ -2294,14 +2293,14 @@ void FontSizeBox::Modify()
{
if ( STRING_NOTFOUND != aStr.Search( '%' ) )
{
- bNewMode = TRUE;
- bPtRelative = FALSE;
+ bNewMode = sal_True;
+ bPtRelative = sal_False;
}
if ( '-' == aStr.GetChar( 0 ) || '+' == aStr.GetChar( 0 ) )
{
- bNewMode = TRUE;
- bPtRelative = TRUE;
+ bNewMode = sal_True;
+ bPtRelative = sal_True;
}
}
@@ -2342,24 +2341,24 @@ void FontSizeBox::Fill( const FontInfo* pInfo, const FontList* pList )
// for standard sizes we don't need to bother
if ( bStdSize && GetEntryCount() && aFontSizeNames.IsEmpty() )
return;
- bStdSize = TRUE;
+ bStdSize = sal_True;
}
else
- bStdSize = FALSE;
+ bStdSize = sal_False;
Selection aSelection = GetSelection();
XubString aStr = GetText();
Clear();
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
if ( !aFontSizeNames.IsEmpty() )
{
if ( pAry == pList->GetStdSizeAry() )
{
// for scalable fonts all font size names
- ULONG nCount = aFontSizeNames.Count();
- for( ULONG i = 0; i < nCount; i++ )
+ sal_uLong nCount = aFontSizeNames.Count();
+ for( sal_uLong i = 0; i < nCount; i++ )
{
String aSizeName = aFontSizeNames.GetIndexName( i );
long nSize = aFontSizeNames.GetIndexSize( i );
@@ -2402,9 +2401,9 @@ void FontSizeBox::Fill( const FontInfo* pInfo, const FontList* pList )
// -----------------------------------------------------------------------
-void FontSizeBox::EnableRelativeMode( USHORT nMin, USHORT nMax, USHORT nStep )
+void FontSizeBox::EnableRelativeMode( sal_uInt16 nMin, sal_uInt16 nMax, sal_uInt16 nStep )
{
- bRelativeMode = TRUE;
+ bRelativeMode = sal_True;
nRelMin = nMin;
nRelMax = nMax;
nRelStep = nStep;
@@ -2415,7 +2414,7 @@ void FontSizeBox::EnableRelativeMode( USHORT nMin, USHORT nMax, USHORT nStep )
void FontSizeBox::EnablePtRelativeMode( short nMin, short nMax, short nStep )
{
- bRelativeMode = TRUE;
+ bRelativeMode = sal_True;
nPtRelMin = nMin;
nPtRelMax = nMax;
nPtRelStep = nStep;
@@ -2424,7 +2423,7 @@ void FontSizeBox::EnablePtRelativeMode( short nMin, short nMax, short nStep )
// -----------------------------------------------------------------------
-void FontSizeBox::SetRelative( BOOL bNewRelative )
+void FontSizeBox::SetRelative( sal_Bool bNewRelative )
{
if ( bRelativeMode )
{
@@ -2434,8 +2433,8 @@ void FontSizeBox::SetRelative( BOOL bNewRelative )
if ( bNewRelative )
{
- bRelative = TRUE;
- bStdSize = FALSE;
+ bRelative = sal_True;
+ bStdSize = sal_False;
if ( bPtRelative )
{
@@ -2463,7 +2462,7 @@ void FontSizeBox::SetRelative( BOOL bNewRelative )
SetUnit( FUNIT_CUSTOM );
Clear();
- USHORT i = nRelMin;
+ sal_uInt16 i = nRelMin;
while ( i <= nRelMax )
{
InsertValue( i );
@@ -2473,7 +2472,7 @@ void FontSizeBox::SetRelative( BOOL bNewRelative )
}
else
{
- bRelative = bPtRelative = FALSE;
+ bRelative = bPtRelative = sal_False;
SetDecimalDigits( 1 );
SetMin( 20 );
SetMax( 9999 );
@@ -2513,7 +2512,7 @@ void FontSizeBox::SetValue( sal_Int64 nNewValue, FieldUnit eInUnit )
mnLastValue = nTempValue;
SetText( aName );
mnFieldValue = mnLastValue;
- SetEmptyFieldValueData( FALSE );
+ SetEmptyFieldValueData( sal_False );
return;
}
}
@@ -2530,7 +2529,7 @@ void FontSizeBox::SetValue( sal_Int64 nNewValue )
// -----------------------------------------------------------------------
-sal_Int64 FontSizeBox::GetValue( USHORT nPos, FieldUnit eOutUnit ) const
+sal_Int64 FontSizeBox::GetValue( sal_uInt16 nPos, FieldUnit eOutUnit ) const
{
if ( !bRelative )
{
diff --git a/svtools/source/control/ctrldll.cxx b/svtools/source/control/ctrldll.cxx
deleted file mode 100644
index 8d6f236ab86b..000000000000
--- a/svtools/source/control/ctrldll.cxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- 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 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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-
-#ifdef WIN
-#include <svwin.h>
-
-#include <sysdep.hxx>
-
-// Statische DLL-Verwaltungs-Variablen
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-/***************************************************************************
-|*
-|* LibMain()
-|*
-|* Beschreibung Initialisierungsfunktion der DLL
-|*
-***************************************************************************/
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-/***************************************************************************
-|*
-|* WEP()
-|*
-|* Beschreibung DLL-Deinitialisierung
-|*
-***************************************************************************/
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx
index 23f26d8bdaee..e65614a2c26f 100644
--- a/svtools/source/control/ctrltool.cxx
+++ b/svtools/source/control/ctrltool.cxx
@@ -39,10 +39,9 @@
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
#include <sal/macros.h>
-
#include <svtools/svtools.hrc>
#include <svtools/svtdata.hxx>
-#include <ctrltool.hxx>
+#include <svtools/ctrltool.hxx>
// =======================================================================
@@ -118,7 +117,7 @@ class ImplFontListNameInfo
private:
XubString maSearchName;
ImplFontListFontInfo* mpFirst;
- USHORT mnType;
+ sal_uInt16 mnType;
ImplFontListNameInfo( const XubString& rSearchName ) :
maSearchName( rSearchName )
@@ -164,7 +163,7 @@ static void ImplMakeSearchStringFromName( XubString& rStr )
// -----------------------------------------------------------------------
-ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, ULONG* pIndex ) const
+ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLong* pIndex ) const
{
// Wenn kein Eintrag in der Liste oder der Eintrag groesser ist als
// der Letzte, dann hinten dranhaengen. Wir vergleichen erst mit dem
@@ -172,7 +171,7 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, ULONG* p
// und somit die Wahrscheinlichkeit das hinten angehaengt werden muss
// sehr gross ist.
StringCompare eComp;
- ULONG nCnt = Count();
+ sal_uLong nCnt = Count();
if ( !nCnt )
{
if ( pIndex )
@@ -196,9 +195,9 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, ULONG* p
// Fonts in der Liste suchen
ImplFontListNameInfo* pCompareData;
ImplFontListNameInfo* pFoundData = NULL;
- ULONG nLow = 0;
- ULONG nHigh = nCnt-1;
- ULONG nMid;
+ sal_uLong nLow = 0;
+ sal_uLong nHigh = nCnt-1;
+ sal_uLong nMid;
do
{
@@ -247,12 +246,12 @@ ImplFontListNameInfo* FontList::ImplFindByName( const XubString& rStr ) const
// -----------------------------------------------------------------------
-void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll,
- BOOL bInsertData )
+void FontList::ImplInsertFonts( OutputDevice* pDevice, sal_Bool bAll,
+ sal_Bool bInsertData )
{
rtl_TextEncoding eSystemEncoding = gsl_getSystemTextEncoding();
- USHORT nType;
+ sal_uInt16 nType;
if ( pDevice->GetOutDevType() != OUTDEV_PRINTER )
nType = FONTLIST_FONTNAMETYPE_SCREEN;
else
@@ -260,7 +259,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll,
// Alle Fonts vom Device abfragen
int n = pDevice->GetDevFontCount();
- USHORT i;
+ sal_uInt16 i;
for( i = 0; i < n; i++ )
{
FontInfo aFontInfo = pDevice->GetDevFont( i );
@@ -272,7 +271,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll,
XubString aSearchName = aFontInfo.GetName();
ImplFontListNameInfo* pData;
- ULONG nIndex;
+ sal_uLong nIndex;
ImplMakeSearchString( aSearchName );
pData = ImplFind( aSearchName, &nIndex );
@@ -292,7 +291,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll,
{
if ( bInsertData )
{
- BOOL bInsert = TRUE;
+ sal_Bool bInsert = sal_True;
ImplFontListFontInfo* pPrev = NULL;
ImplFontListFontInfo* pTemp = pData->mpFirst;
ImplFontListFontInfo* pNewInfo = new ImplFontListFontInfo( aFontInfo, pDevice );
@@ -313,7 +312,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll,
pTemp->mpNext = pTemp2;
}
delete pNewInfo;
- bInsert = FALSE;
+ bInsert = sal_False;
}
break;
@@ -345,8 +344,8 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll,
// =======================================================================
-FontList::FontList( OutputDevice* pDevice, OutputDevice* pDevice2, BOOL bAll ) :
- List( 4096, sal::static_int_cast< USHORT >(pDevice->GetDevFontCount()), 32 )
+FontList::FontList( OutputDevice* pDevice, OutputDevice* pDevice2, sal_Bool bAll ) :
+ List( 4096, sal::static_int_cast< sal_uInt16 >(pDevice->GetDevFontCount()), 32 )
{
// Variablen initialisieren
mpDev = pDevice;
@@ -363,14 +362,14 @@ FontList::FontList( OutputDevice* pDevice, OutputDevice* pDevice2, BOOL bAll ) :
maBlack = XubString( SvtResId( STR_SVT_STYLE_BLACK ) );
maBlackItalic = XubString( SvtResId( STR_SVT_STYLE_BLACK_ITALIC ) );
- ImplInsertFonts( pDevice, bAll, TRUE );
+ ImplInsertFonts( pDevice, bAll, sal_True );
// Gegebenenfalls muessen wir mit den Bildschirmfonts vergleichen,
// damit dort die eigentlich doppelten auf Equal mappen koennen
- BOOL bCompareWindow = FALSE;
+ sal_Bool bCompareWindow = sal_False;
if ( !pDevice2 && (pDevice->GetOutDevType() == OUTDEV_PRINTER) )
{
- bCompareWindow = TRUE;
+ bCompareWindow = sal_True;
pDevice2 = Application::GetDefaultDevice();
}
@@ -528,12 +527,12 @@ XubString FontList::GetFontMapText( const FontInfo& rInfo ) const
}
// search for synthetic style
- USHORT nType = pData->mnType;
+ sal_uInt16 nType = pData->mnType;
const XubString& rStyleName = rInfo.GetStyleName();
if ( rStyleName.Len() )
{
- BOOL bNotSynthetic = FALSE;
- BOOL bNoneAvailable = FALSE;
+ sal_Bool bNotSynthetic = sal_False;
+ sal_Bool bNoneAvailable = sal_False;
FontWeight eWeight = rInfo.GetWeight();
FontItalic eItalic = rInfo.GetItalic();
ImplFontListFontInfo* pFontInfo = pData->mpFirst;
@@ -542,7 +541,7 @@ XubString FontList::GetFontMapText( const FontInfo& rInfo ) const
if ( (eWeight == pFontInfo->GetWeight()) &&
(eItalic == pFontInfo->GetItalic()) )
{
- bNotSynthetic = TRUE;
+ bNotSynthetic = sal_True;
break;
}
@@ -599,7 +598,7 @@ XubString FontList::GetFontMapText( const FontInfo& rInfo ) const
// -----------------------------------------------------------------------
-USHORT FontList::GetFontNameType( const XubString& rFontName ) const
+sal_uInt16 FontList::GetFontNameType( const XubString& rFontName ) const
{
ImplFontListNameInfo* pData = ImplFindByName( rFontName );
if ( pData )
@@ -747,14 +746,14 @@ FontInfo FontList::Get( const XubString& rName,
// -----------------------------------------------------------------------
-BOOL FontList::IsAvailable( const XubString& rName ) const
+sal_Bool FontList::IsAvailable( const XubString& rName ) const
{
return (ImplFindByName( rName ) != 0);
}
// -----------------------------------------------------------------------
-const FontInfo& FontList::GetFontName( USHORT nFont ) const
+const FontInfo& FontList::GetFontName( sal_uInt16 nFont ) const
{
DBG_ASSERT( nFont < GetFontNameCount(), "FontList::GetFontName(): nFont >= Count" );
@@ -764,7 +763,7 @@ const FontInfo& FontList::GetFontName( USHORT nFont ) const
// -----------------------------------------------------------------------
-USHORT FontList::GetFontNameType( USHORT nFont ) const
+sal_uInt16 FontList::GetFontNameType( sal_uInt16 nFont ) const
{
DBG_ASSERT( nFont < GetFontNameCount(), "FontList::GetFontNameType(): nFont >= Count" );
@@ -830,8 +829,8 @@ const long* FontList::GetSizeAry( const FontInfo& rInfo ) const
MapMode aMap( MAP_10TH_INCH, Point(), Fraction( 1, 72 ), Fraction( 1, 72 ) );
pDevice->SetMapMode( aMap );
- USHORT i;
- USHORT nRealCount = 0;
+ sal_uInt16 i;
+ sal_uInt16 nRealCount = 0;
long nOldHeight = 0;
((FontList*)this)->mpSizeAry = new long[nDevSizeCount+1];
for ( i = 0; i < nDevSizeCount; i++ )
@@ -968,7 +967,7 @@ String FontSizeNames::Size2Name( long nValue ) const
//------------------------------------------------------------------------
-String FontSizeNames::GetIndexName( ULONG nIndex ) const
+String FontSizeNames::GetIndexName( sal_uLong nIndex ) const
{
String aStr;
@@ -980,7 +979,7 @@ String FontSizeNames::GetIndexName( ULONG nIndex ) const
//------------------------------------------------------------------------
-long FontSizeNames::GetIndexSize( ULONG nIndex ) const
+long FontSizeNames::GetIndexSize( sal_uLong nIndex ) const
{
if ( nIndex >= mnElem )
return 0;
diff --git a/svtools/source/control/filectrl.cxx b/svtools/source/control/filectrl.cxx
index 1a1d539d0120..c8d506ad2a9a 100644..100755
--- a/svtools/source/control/filectrl.cxx
+++ b/svtools/source/control/filectrl.cxx
@@ -32,7 +32,7 @@
#define _SV_FIELCTRL_CXX
#include <tools/urlobj.hxx>
#include <svtools/svtdata.hxx>
-#include <filectrl.hxx>
+#include <svtools/filectrl.hxx>
#include <filectrl.hrc>
// =======================================================================
@@ -46,12 +46,12 @@ FileControl::FileControl( Window* pParent, WinBits nStyle, FileControlMode nFlag
mnInternalFlags( FILECTRL_ORIGINALBUTTONTEXT )
{
maButton.SetClickHdl( LINK( this, FileControl, ButtonHdl ) );
- mbOpenDlg = TRUE;
+ mbOpenDlg = sal_True;
maButton.Show();
maEdit.Show();
- SetCompoundControl( TRUE );
+ SetCompoundControl( sal_True );
SetStyle( ImplInitStyle( GetStyle() ) );
}
@@ -155,7 +155,7 @@ void FileControl::Resize()
if( mnInternalFlags & FILECTRL_INRESIZE )
return;
- mnInternalFlags |= FILECTRL_INRESIZE;//InResize = TRUE
+ mnInternalFlags |= FILECTRL_INRESIZE;//InResize = sal_True
Size aOutSz = GetOutputSizePixel();
long nButtonTextWidth = maButton.GetTextWidth( maButtonText );
@@ -164,7 +164,7 @@ void FileControl::Resize()
( mnFlags & FILECTRL_RESIZEBUTTONBYPATHLEN
? ( maEdit.GetTextWidth( maEdit.GetText() )
<= aOutSz.Width() - nButtonTextWidth - ButtonBorder )
- : TRUE ) )
+ : sal_True ) )
)
{
maButton.SetText( maButtonText );
@@ -180,7 +180,7 @@ void FileControl::Resize()
maEdit.SetPosSizePixel( 0, 0, aOutSz.Width()-nButtonWidth, aOutSz.Height() );
maButton.SetPosSizePixel( aOutSz.Width()-nButtonWidth, 0, nButtonWidth, aOutSz.Height() );
- mnInternalFlags &= ~FILECTRL_INRESIZE; //InResize = FALSE
+ mnInternalFlags &= ~FILECTRL_INRESIZE; //InResize = sal_False
}
// -----------------------------------------------------------------------
@@ -201,7 +201,7 @@ void FileControl::GetFocus()
// -----------------------------------------------------------------------
-void FileControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+void FileControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
WinBits nOldEditStyle = GetEdit().GetStyle();
if ( GetStyle() & WB_BORDER )
diff --git a/svtools/source/control/filectrl.src b/svtools/source/control/filectrl.src
index de6cb8409ff4..5703004dd946 100644..100755
--- a/svtools/source/control/filectrl.src
+++ b/svtools/source/control/filectrl.src
@@ -30,3 +30,20 @@ String STR_FILECTRL_BUTTONTEXT
{
Text [ en-US ] = "Browse..." ;
};
+
+String STR_TABBAR_PUSHBUTTON_MOVET0HOME
+{
+ Text [ en-US ] = "Move To Home" ;
+};
+String STR_TABBAR_PUSHBUTTON_MOVELEFT
+{
+ Text [ en-US ] = "Move Left" ;
+};
+String STR_TABBAR_PUSHBUTTON_MOVERIGHT
+{
+ Text [ en-US ] = "Move Right" ;
+};
+String STR_TABBAR_PUSHBUTTON_MOVETOEND
+{
+ Text [ en-US ] = "Move To End" ;
+}; \ No newline at end of file
diff --git a/svtools/source/control/filectrl2.cxx b/svtools/source/control/filectrl2.cxx
index 8cfe2c97f5ac..805b400599c8 100644..100755
--- a/svtools/source/control/filectrl2.cxx
+++ b/svtools/source/control/filectrl2.cxx
@@ -30,7 +30,7 @@
#include "precompiled_svtools.hxx"
// this file contains code from filectrl.cxx which needs to be compiled with enabled exception hanling
-#include <filectrl.hxx>
+#include <svtools/filectrl.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
#include <vcl/unohelp.hxx>
diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx
index 68072ce2d388..9c1ba517367c 100644..100755
--- a/svtools/source/control/fmtfield.cxx
+++ b/svtools/source/control/fmtfield.cxx
@@ -306,7 +306,7 @@ namespace validation
//==============================================================================
SvNumberFormatter* FormattedField::StaticFormatter::s_cFormatter = NULL;
-ULONG FormattedField::StaticFormatter::s_nReferences = 0;
+sal_uLong FormattedField::StaticFormatter::s_nReferences = 0;
//------------------------------------------------------------------------------
SvNumberFormatter* FormattedField::StaticFormatter::GetFormatter()
@@ -346,13 +346,13 @@ DBG_NAME(FormattedField);
m_aLastSelection(0,0) \
,m_dMinValue(0) \
,m_dMaxValue(0) \
- ,m_bHasMin(FALSE) \
- ,m_bHasMax(FALSE) \
- ,m_bStrictFormat(TRUE) \
- ,m_bValueDirty(TRUE) \
- ,m_bEnableEmptyField(TRUE) \
- ,m_bAutoColor(FALSE) \
- ,m_bEnableNaN(FALSE) \
+ ,m_bHasMin(sal_False) \
+ ,m_bHasMax(sal_False) \
+ ,m_bStrictFormat(sal_True) \
+ ,m_bValueDirty(sal_True) \
+ ,m_bEnableEmptyField(sal_True) \
+ ,m_bAutoColor(sal_False) \
+ ,m_bEnableNaN(sal_False) \
,m_dCurrentValue(0) \
,m_dDefaultValue(0) \
,m_nFormatKey(0) \
@@ -360,12 +360,12 @@ DBG_NAME(FormattedField);
,m_dSpinSize(1) \
,m_dSpinFirst(-1000000) \
,m_dSpinLast(1000000) \
- ,m_bTreatAsNumber(TRUE) \
+ ,m_bTreatAsNumber(sal_True) \
,m_pLastOutputColor(NULL) \
,m_bUseInputStringForFormatting(false)
//------------------------------------------------------------------------------
-FormattedField::FormattedField(Window* pParent, WinBits nStyle, SvNumberFormatter* pInitialFormatter, INT32 nFormatKey)
+FormattedField::FormattedField(Window* pParent, WinBits nStyle, SvNumberFormatter* pInitialFormatter, sal_Int32 nFormatKey)
:SpinField(pParent, nStyle)
,INIT_MEMBERS()
{
@@ -379,7 +379,7 @@ FormattedField::FormattedField(Window* pParent, WinBits nStyle, SvNumberFormatte
}
//------------------------------------------------------------------------------
-FormattedField::FormattedField(Window* pParent, const ResId& rResId, SvNumberFormatter* pInitialFormatter, INT32 nFormatKey)
+FormattedField::FormattedField(Window* pParent, const ResId& rResId, SvNumberFormatter* pInitialFormatter, sal_Int32 nFormatKey)
:SpinField(pParent, rResId)
,INIT_MEMBERS()
{
@@ -409,7 +409,7 @@ void FormattedField::SetValidateText(const XubString& rText, const String* pErro
if (pErrorText)
ImplSetTextImpl(*pErrorText, NULL);
else
- ImplSetValue(m_dDefaultValue, TRUE);
+ ImplSetValue(m_dDefaultValue, sal_True);
}
//------------------------------------------------------------------------------
@@ -418,7 +418,7 @@ void FormattedField::SetText(const XubString& rStr)
DBG_CHKTHIS(FormattedField, NULL);
SpinField::SetText(rStr);
- m_bValueDirty = TRUE;
+ m_bValueDirty = sal_True;
}
//------------------------------------------------------------------------------
@@ -427,7 +427,7 @@ void FormattedField::SetText( const XubString& rStr, const Selection& rNewSelect
DBG_CHKTHIS(FormattedField, NULL);
SpinField::SetText( rStr, rNewSelection );
- m_bValueDirty = TRUE;
+ m_bValueDirty = sal_True;
}
//------------------------------------------------------------------------------
@@ -456,8 +456,8 @@ void FormattedField::SetTextFormatted(const XubString& rStr)
Selection aSel(GetSelection());
Selection aNewSel(aSel);
aNewSel.Justify();
- USHORT nNewLen = sFormatted.Len();
- USHORT nCurrentLen = GetText().Len();
+ sal_uInt16 nNewLen = sFormatted.Len();
+ sal_uInt16 nCurrentLen = GetText().Len();
if ((nNewLen > nCurrentLen) && (aNewSel.Max() == nCurrentLen))
{ // the new text is longer and the cursor was behind the last char (of the old text)
if (aNewSel.Min() == 0)
@@ -465,7 +465,7 @@ void FormattedField::SetTextFormatted(const XubString& rStr)
aNewSel.Max() = nNewLen;
if (!nCurrentLen)
{ // there wasn't really a previous selection (as there was no previous text), we're setting a new one -> check the selection options
- ULONG nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions();
+ sal_uLong nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions();
if (nSelOptions & SELECTION_OPTION_SHOWFIRST)
{ // selection should be from right to left -> swap min and max
aNewSel.Min() = aNewSel.Max();
@@ -484,7 +484,7 @@ void FormattedField::SetTextFormatted(const XubString& rStr)
else
aNewSel = aSel; // don't use the justified version
SpinField::SetText(sFormatted, aNewSel);
- m_bValueDirty = FALSE;
+ m_bValueDirty = sal_False;
}
//------------------------------------------------------------------------------
@@ -493,13 +493,13 @@ String FormattedField::GetTextValue() const
if (m_bValueDirty)
{
((FormattedField*)this)->m_sCurrentTextValue = GetText();
- ((FormattedField*)this)->m_bValueDirty = FALSE;
+ ((FormattedField*)this)->m_bValueDirty = sal_False;
}
return m_sCurrentTextValue;
}
//------------------------------------------------------------------------------
-void FormattedField::EnableNotANumber( BOOL _bEnable )
+void FormattedField::EnableNotANumber( sal_Bool _bEnable )
{
if ( m_bEnableNaN == _bEnable )
return;
@@ -508,7 +508,7 @@ void FormattedField::EnableNotANumber( BOOL _bEnable )
}
//------------------------------------------------------------------------------
-void FormattedField::SetAutoColor(BOOL _bAutomatic)
+void FormattedField::SetAutoColor(sal_Bool _bAutomatic)
{
if (_bAutomatic == m_bAutoColor)
return;
@@ -530,7 +530,7 @@ void FormattedField::Modify()
if (!IsStrictFormat())
{
- m_bValueDirty = TRUE;
+ m_bValueDirty = sal_True;
SpinField::Modify();
return;
}
@@ -540,7 +540,7 @@ void FormattedField::Modify()
{
m_sLastValidText = sCheck;
m_aLastSelection = GetSelection();
- m_bValueDirty = TRUE;
+ m_bValueDirty = sal_True;
}
else
{
@@ -570,8 +570,8 @@ void FormattedField::ImplSetTextImpl(const XubString& rNew, Selection* pNewSel)
Selection aSel(GetSelection());
aSel.Justify();
- USHORT nNewLen = rNew.Len();
- USHORT nCurrentLen = GetText().Len();
+ sal_uInt16 nNewLen = rNew.Len();
+ sal_uInt16 nCurrentLen = GetText().Len();
if ((nNewLen > nCurrentLen) && (aSel.Max() == nCurrentLen))
{ // new new text is longer and the cursor is behind the last char
@@ -580,7 +580,7 @@ void FormattedField::ImplSetTextImpl(const XubString& rNew, Selection* pNewSel)
aSel.Max() = nNewLen;
if (!nCurrentLen)
{ // there wasn't really a previous selection (as there was no previous text), we're setting a new one -> check the selection options
- ULONG nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions();
+ sal_uLong nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions();
if (nSelOptions & SELECTION_OPTION_SHOWFIRST)
{ // selection should be from right to left -> swap min and max
aSel.Min() = aSel.Max();
@@ -599,7 +599,7 @@ void FormattedField::ImplSetTextImpl(const XubString& rNew, Selection* pNewSel)
SpinField::SetText(rNew, aSel);
}
- m_bValueDirty = TRUE;
+ m_bValueDirty = sal_True;
// muss nicht stimmen, aber sicherheitshalber ...
}
@@ -613,12 +613,12 @@ long FormattedField::PreNotify(NotifyEvent& rNEvt)
}
//------------------------------------------------------------------------------
-void FormattedField::ImplSetFormatKey(ULONG nFormatKey)
+void FormattedField::ImplSetFormatKey(sal_uLong nFormatKey)
{
DBG_CHKTHIS(FormattedField, NULL);
m_nFormatKey = nFormatKey;
- BOOL bNeedFormatter = (m_pFormatter == NULL) && (nFormatKey != 0);
+ sal_Bool bNeedFormatter = (m_pFormatter == NULL) && (nFormatKey != 0);
if (bNeedFormatter)
{
ImplGetFormatter(); // damit wird ein Standard-Formatter angelegt
@@ -633,16 +633,16 @@ void FormattedField::ImplSetFormatKey(ULONG nFormatKey)
}
//------------------------------------------------------------------------------
-void FormattedField::SetFormatKey(ULONG nFormatKey)
+void FormattedField::SetFormatKey(sal_uLong nFormatKey)
{
DBG_CHKTHIS(FormattedField, NULL);
- BOOL bNoFormatter = (m_pFormatter == NULL);
+ sal_Bool bNoFormatter = (m_pFormatter == NULL);
ImplSetFormatKey(nFormatKey);
FormatChanged((bNoFormatter && (m_pFormatter != NULL)) ? FCT_FORMATTER : FCT_KEYONLY);
}
//------------------------------------------------------------------------------
-void FormattedField::SetFormatter(SvNumberFormatter* pFormatter, BOOL bResetFormat)
+void FormattedField::SetFormatter(SvNumberFormatter* pFormatter, sal_Bool bResetFormat)
{
DBG_CHKTHIS(FormattedField, NULL);
@@ -676,7 +676,7 @@ void FormattedField::SetFormatter(SvNumberFormatter* pFormatter, BOOL bResetForm
LanguageType aNewLang = pDefaultEntry ? pDefaultEntry->GetLanguage() : LANGUAGE_DONTKNOW;
// den alten Format-String in die neue Sprache konvertieren
- USHORT nCheckPos;
+ sal_uInt16 nCheckPos;
short nType;
pFormatter->PutandConvertEntry(sOldFormat, nCheckPos, nType, nDestKey, aOldLang, aNewLang);
m_nFormatKey = nDestKey;
@@ -698,47 +698,47 @@ void FormattedField::GetFormat(XubString& rFormatString, LanguageType& eLang) co
}
//------------------------------------------------------------------------------
-BOOL FormattedField::SetFormat(const XubString& rFormatString, LanguageType eLang)
+sal_Bool FormattedField::SetFormat(const XubString& rFormatString, LanguageType eLang)
{
DBG_CHKTHIS(FormattedField, NULL);
sal_uInt32 nNewKey = ImplGetFormatter()->TestNewString(rFormatString, eLang);
if (nNewKey == NUMBERFORMAT_ENTRY_NOT_FOUND)
{
- USHORT nCheckPos;
+ sal_uInt16 nCheckPos;
short nType;
XubString rFormat(rFormatString);
if (!ImplGetFormatter()->PutEntry(rFormat, nCheckPos, nType, nNewKey, eLang))
- return FALSE;
+ return sal_False;
DBG_ASSERT(nNewKey != NUMBERFORMAT_ENTRY_NOT_FOUND, "FormattedField::SetFormatString : PutEntry returned an invalid key !");
}
if (nNewKey != m_nFormatKey)
SetFormatKey(nNewKey);
- return TRUE;
+ return sal_True;
}
//------------------------------------------------------------------------------
-BOOL FormattedField::GetThousandsSep() const
+sal_Bool FormattedField::GetThousandsSep() const
{
DBG_ASSERT(!ImplGetFormatter()->IsTextFormat(m_nFormatKey),
"FormattedField::GetThousandsSep : your'e sure what your'e doing when setting the precision of a text format ?");
- BOOL bThousand, IsRed;
- USHORT nPrecision, nAnzLeading;
+ sal_Bool bThousand, IsRed;
+ sal_uInt16 nPrecision, nAnzLeading;
ImplGetFormatter()->GetFormatSpecialInfo(m_nFormatKey, bThousand, IsRed, nPrecision, nAnzLeading);
return bThousand;
}
//------------------------------------------------------------------------------
-void FormattedField::SetThousandsSep(BOOL _bUseSeparator)
+void FormattedField::SetThousandsSep(sal_Bool _bUseSeparator)
{
DBG_ASSERT(!ImplGetFormatter()->IsTextFormat(m_nFormatKey),
"FormattedField::SetThousandsSep : your'e sure what your'e doing when setting the precision of a text format ?");
// get the current settings
- BOOL bThousand, IsRed;
- USHORT nPrecision, nAnzLeading;
+ sal_Bool bThousand, IsRed;
+ sal_uInt16 nPrecision, nAnzLeading;
ImplGetFormatter()->GetFormatSpecialInfo(m_nFormatKey, bThousand, IsRed, nPrecision, nAnzLeading);
if (bThousand == _bUseSeparator)
return;
@@ -751,7 +751,7 @@ void FormattedField::SetThousandsSep(BOOL _bUseSeparator)
// generate a new format ...
ImplGetFormatter()->GenerateFormat(sFmtDescription, m_nFormatKey, eLang, _bUseSeparator, IsRed, nPrecision, nAnzLeading);
// ... and introduce it to the formatter
- USHORT nCheckPos;
+ sal_uInt16 nCheckPos;
sal_uInt32 nNewKey;
short nType;
ImplGetFormatter()->PutEntry(sFmtDescription, nCheckPos, nType, nNewKey, eLang);
@@ -762,27 +762,27 @@ void FormattedField::SetThousandsSep(BOOL _bUseSeparator)
}
//------------------------------------------------------------------------------
-USHORT FormattedField::GetDecimalDigits() const
+sal_uInt16 FormattedField::GetDecimalDigits() const
{
DBG_ASSERT(!ImplGetFormatter()->IsTextFormat(m_nFormatKey),
"FormattedField::GetDecimalDigits : your'e sure what your'e doing when setting the precision of a text format ?");
- BOOL bThousand, IsRed;
- USHORT nPrecision, nAnzLeading;
+ sal_Bool bThousand, IsRed;
+ sal_uInt16 nPrecision, nAnzLeading;
ImplGetFormatter()->GetFormatSpecialInfo(m_nFormatKey, bThousand, IsRed, nPrecision, nAnzLeading);
return nPrecision;
}
//------------------------------------------------------------------------------
-void FormattedField::SetDecimalDigits(USHORT _nPrecision)
+void FormattedField::SetDecimalDigits(sal_uInt16 _nPrecision)
{
DBG_ASSERT(!ImplGetFormatter()->IsTextFormat(m_nFormatKey),
"FormattedField::SetDecimalDigits : your'e sure what your'e doing when setting the precision of a text format ?");
// get the current settings
- BOOL bThousand, IsRed;
- USHORT nPrecision, nAnzLeading;
+ sal_Bool bThousand, IsRed;
+ sal_uInt16 nPrecision, nAnzLeading;
ImplGetFormatter()->GetFormatSpecialInfo(m_nFormatKey, bThousand, IsRed, nPrecision, nAnzLeading);
if (nPrecision == _nPrecision)
return;
@@ -795,7 +795,7 @@ void FormattedField::SetDecimalDigits(USHORT _nPrecision)
// generate a new format ...
ImplGetFormatter()->GenerateFormat(sFmtDescription, m_nFormatKey, eLang, bThousand, IsRed, _nPrecision, nAnzLeading);
// ... and introduce it to the formatter
- USHORT nCheckPos;
+ sal_uInt16 nCheckPos;
sal_uInt32 nNewKey;
short nType;
ImplGetFormatter()->PutEntry(sFmtDescription, nCheckPos, nType, nNewKey, eLang);
@@ -831,7 +831,7 @@ void FormattedField::Commit()
{ // consider the field as modified
Modify();
// but we have the most recent value now
- m_bValueDirty = FALSE;
+ m_bValueDirty = sal_False;
}
}
@@ -845,7 +845,7 @@ void FormattedField::ReFormat()
double dValue = GetValue();
if ( m_bEnableNaN && ::rtl::math::isNan( dValue ) )
return;
- ImplSetValue( dValue, TRUE );
+ ImplSetValue( dValue, sal_True );
}
else
SetTextFormatted(GetTextValue());
@@ -860,7 +860,7 @@ long FormattedField::Notify(NotifyEvent& rNEvt)
if ((rNEvt.GetType() == EVENT_KEYINPUT) && !IsReadOnly())
{
const KeyEvent& rKEvt = *rNEvt.GetKeyEvent();
- USHORT nMod = rKEvt.GetKeyCode().GetModifier();
+ sal_uInt16 nMod = rKEvt.GetKeyCode().GetModifier();
switch ( rKEvt.GetKeyCode().GetCode() )
{
case KEY_UP:
@@ -901,7 +901,7 @@ long FormattedField::Notify(NotifyEvent& rNEvt)
{
if (TreatingAsNumber())
{
- ImplSetValue(m_dCurrentValue, TRUE);
+ ImplSetValue(m_dCurrentValue, sal_True);
Modify();
}
else
@@ -912,7 +912,7 @@ long FormattedField::Notify(NotifyEvent& rNEvt)
else
SetTextFormatted(m_sDefaultText);
}
- m_bValueDirty = FALSE;
+ m_bValueDirty = sal_False;
}
}
else
@@ -931,7 +931,7 @@ void FormattedField::SetMinValue(double dMin)
DBG_ASSERT(m_bTreatAsNumber, "FormattedField::SetMinValue : only to be used in numeric mode !");
m_dMinValue = dMin;
- m_bHasMin = TRUE;
+ m_bHasMin = sal_True;
// fuer die Ueberpruefung des aktuellen Wertes an der neuen Grenze -> ImplSetValue
ReFormat();
}
@@ -943,7 +943,7 @@ void FormattedField::SetMaxValue(double dMax)
DBG_ASSERT(m_bTreatAsNumber, "FormattedField::SetMaxValue : only to be used in numeric mode !");
m_dMaxValue = dMax;
- m_bHasMax = TRUE;
+ m_bHasMax = sal_True;
// fuer die Ueberpruefung des aktuellen Wertes an der neuen Grenze -> ImplSetValue
ReFormat();
}
@@ -957,7 +957,7 @@ void FormattedField::SetTextValue(const XubString& rText)
}
//------------------------------------------------------------------------------
-void FormattedField::EnableEmptyField(BOOL bEnable)
+void FormattedField::EnableEmptyField(sal_Bool bEnable)
{
DBG_CHKTHIS(FormattedField, NULL);
if (bEnable == m_bEnableEmptyField)
@@ -965,11 +965,11 @@ void FormattedField::EnableEmptyField(BOOL bEnable)
m_bEnableEmptyField = bEnable;
if (!m_bEnableEmptyField && GetText().Len()==0)
- ImplSetValue(m_dCurrentValue, TRUE);
+ ImplSetValue(m_dCurrentValue, sal_True);
}
//------------------------------------------------------------------------------
-void FormattedField::ImplSetValue(double dVal, BOOL bForce)
+void FormattedField::ImplSetValue(double dVal, sal_Bool bForce)
{
DBG_CHKTHIS(FormattedField, NULL);
@@ -982,7 +982,7 @@ void FormattedField::ImplSetValue(double dVal, BOOL bForce)
DBG_ASSERT(ImplGetFormatter() != NULL, "FormattedField::ImplSetValue : can't set a value without a formatter !");
- m_bValueDirty = FALSE;
+ m_bValueDirty = sal_False;
m_dCurrentValue = dVal;
String sNewText;
@@ -1003,23 +1003,23 @@ void FormattedField::ImplSetValue(double dVal, BOOL bForce)
}
ImplSetTextImpl(sNewText, NULL);
- m_bValueDirty = FALSE;
+ m_bValueDirty = sal_False;
DBG_ASSERT(CheckText(sNewText), "FormattedField::ImplSetValue : formatted string doesn't match the criteria !");
}
//------------------------------------------------------------------------------
-BOOL FormattedField::ImplGetValue(double& dNewVal)
+sal_Bool FormattedField::ImplGetValue(double& dNewVal)
{
DBG_CHKTHIS(FormattedField, NULL);
dNewVal = m_dCurrentValue;
if (!m_bValueDirty)
- return TRUE;
+ return sal_True;
dNewVal = m_dDefaultValue;
String sText(GetText());
if (!sText.Len())
- return TRUE;
+ return sal_True;
DBG_ASSERT(ImplGetFormatter() != NULL, "FormattedField::ImplGetValue : can't give you a current value without a formatter !");
@@ -1035,7 +1035,7 @@ BOOL FormattedField::ImplGetValue(double& dNewVal)
// the language of our format
LanguageType eLanguage = m_pFormatter->GetEntry(m_nFormatKey)->GetLanguage();
// the default number format for this language
- ULONG nStandardNumericFormat = m_pFormatter->GetStandardFormat(NUMBERFORMAT_NUMBER, eLanguage);
+ sal_uLong nStandardNumericFormat = m_pFormatter->GetStandardFormat(NUMBERFORMAT_NUMBER, eLanguage);
sal_uInt32 nTempFormat = nStandardNumericFormat;
double dTemp;
@@ -1049,14 +1049,14 @@ BOOL FormattedField::ImplGetValue(double& dNewVal)
// which equals 300 percent.
}
if (!ImplGetFormatter()->IsNumberFormat(sText, nFormatKey, dNewVal))
- return FALSE;
+ return sal_False;
if (m_bHasMin && (dNewVal<m_dMinValue))
dNewVal = m_dMinValue;
if (m_bHasMax && (dNewVal>m_dMaxValue))
dNewVal = m_dMaxValue;
- return TRUE;
+ return sal_True;
}
//------------------------------------------------------------------------------
@@ -1079,7 +1079,7 @@ double FormattedField::GetValue()
m_dCurrentValue = m_dDefaultValue;
}
- m_bValueDirty = FALSE;
+ m_bValueDirty = sal_False;
return m_dCurrentValue;
}
@@ -1166,7 +1166,7 @@ void DoubleNumericField::FormatChanged(FORMAT_CHANGE_TYPE nWhat)
}
//------------------------------------------------------------------------------
-BOOL DoubleNumericField::CheckText(const XubString& sText) const
+sal_Bool DoubleNumericField::CheckText(const XubString& sText) const
{
// We'd like to implement this using the NumberFormatter::IsNumberFormat, but unfortunately, this doesn't
// recognize fragments of numbers (like, for instance "1e", which happens during entering e.g. "1e10")
@@ -1174,19 +1174,19 @@ BOOL DoubleNumericField::CheckText(const XubString& sText) const
#ifdef REGEXP_SUPPORT
if (!sText.Len())
- return TRUE;
+ return sal_True;
String sForceComplete = '_';
sForceComplete += sText;
sForceComplete += '_';
- USHORT nStart = 0, nEnd = sForceComplete.Len();
- BOOL bFound = m_pConformanceTester->SearchFrwrd(sForceComplete, &nStart, &nEnd);
+ sal_uInt16 nStart = 0, nEnd = sForceComplete.Len();
+ sal_Bool bFound = m_pConformanceTester->SearchFrwrd(sForceComplete, &nStart, &nEnd);
if (bFound && (nStart == 0) && (nEnd == sForceComplete.Len()))
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
#else
return m_pNumberValidator->isValidNumericFragment( sText );
#endif
@@ -1252,9 +1252,9 @@ void DoubleNumericField::ResetConformanceTester()
//------------------------------------------------------------------------------
DoubleCurrencyField::DoubleCurrencyField(Window* pParent, WinBits nStyle)
:FormattedField(pParent, nStyle)
- ,m_bChangingFormat(FALSE)
+ ,m_bChangingFormat(sal_False)
{
- m_bPrependCurrSym = FALSE;
+ m_bPrependCurrSym = sal_False;
// initialize with a system currency format
m_sCurrencySymbol = SvtSysLocale().GetLocaleData().getCurrSymbol();
@@ -1264,9 +1264,9 @@ DoubleCurrencyField::DoubleCurrencyField(Window* pParent, WinBits nStyle)
//------------------------------------------------------------------------------
DoubleCurrencyField::DoubleCurrencyField(Window* pParent, const ResId& rResId)
:FormattedField(pParent, rResId)
- ,m_bChangingFormat(FALSE)
+ ,m_bChangingFormat(sal_False)
{
- m_bPrependCurrSym = FALSE;
+ m_bPrependCurrSym = sal_False;
// initialize with a system currency format
m_sCurrencySymbol = SvtSysLocale().GetLocaleData().getCurrSymbol();
@@ -1313,7 +1313,7 @@ void DoubleCurrencyField::setCurrencySymbol(const String& _sSymbol)
}
//------------------------------------------------------------------------------
-void DoubleCurrencyField::setPrependCurrSym(BOOL _bPrepend)
+void DoubleCurrencyField::setPrependCurrSym(sal_Bool _bPrepend)
{
if (m_bPrependCurrSym == _bPrepend)
return;
@@ -1330,8 +1330,8 @@ void DoubleCurrencyField::UpdateCurrencyFormat()
XubString sOldFormat;
LanguageType eLanguage;
GetFormat(sOldFormat, eLanguage);
- BOOL bThSep = GetThousandsSep();
- USHORT nDigits = GetDecimalDigits();
+ sal_Bool bThSep = GetThousandsSep();
+ sal_uInt16 nDigits = GetDecimalDigits();
// build a new format string with the base class' and my own settings
Locale aLocale;
@@ -1391,9 +1391,9 @@ void DoubleCurrencyField::UpdateCurrencyFormat()
}
// set this new basic format
- m_bChangingFormat = TRUE;
+ m_bChangingFormat = sal_True;
SetFormat(sNewFormat, eLanguage);
- m_bChangingFormat = FALSE;
+ m_bChangingFormat = sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx
index 38c233b27699..2b22996c0486 100644..100755
--- a/svtools/source/control/headbar.cxx
+++ b/svtools/source/control/headbar.cxx
@@ -42,10 +42,10 @@
struct ImplHeadItem
{
- USHORT mnId;
+ sal_uInt16 mnId;
HeaderBarItemBits mnBits;
long mnSize;
- ULONG mnHelpId;
+ rtl::OString maHelpId;
Image maImage;
XubString maOutText;
XubString maText;
@@ -65,8 +65,8 @@ struct ImplHeadItem
#define HEADERBAR_DRAGOFF 4
#define HEADERBAR_DRAGOUTOFF 15
-#define HEAD_HITTEST_ITEM ((USHORT)0x0001)
-#define HEAD_HITTEST_DIVIDER ((USHORT)0x0002)
+#define HEAD_HITTEST_ITEM ((sal_uInt16)0x0001)
+#define HEAD_HITTEST_DIVIDER ((sal_uInt16)0x0002)
// =======================================================================
@@ -84,20 +84,20 @@ void HeaderBar::ImplInit( WinBits nWinStyle )
mnMouseOff = 0;
mnCurItemId = 0;
mnItemDragPos = HEADERBAR_ITEM_NOTFOUND;
- mbDrag = FALSE;
- mbItemDrag = FALSE;
- mbOutDrag = FALSE;
- mbItemMode = FALSE;
+ mbDrag = sal_False;
+ mbItemDrag = sal_False;
+ mbOutDrag = sal_False;
+ mbItemMode = sal_False;
// StyleBits auswerten
if ( nWinStyle & WB_DRAG )
- mbDragable = TRUE;
+ mbDragable = sal_True;
else
- mbDragable = FALSE;
+ mbDragable = sal_False;
if ( nWinStyle & WB_BUTTONSTYLE )
- mbButtonStyle = TRUE;
+ mbButtonStyle = sal_True;
else
- mbButtonStyle = FALSE;
+ mbButtonStyle = sal_False;
if ( nWinStyle & WB_BORDER )
{
mnBorderOff1 = 1;
@@ -109,7 +109,7 @@ void HeaderBar::ImplInit( WinBits nWinStyle )
mnBorderOff2 = 1;
}
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
}
// -----------------------------------------------------------------------
@@ -143,8 +143,8 @@ HeaderBar::~HeaderBar()
// -----------------------------------------------------------------------
-void HeaderBar::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void HeaderBar::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -181,7 +181,7 @@ void HeaderBar::ImplInitSettings( BOOL bFont,
// -----------------------------------------------------------------------
-long HeaderBar::ImplGetItemPos( USHORT nPos ) const
+long HeaderBar::ImplGetItemPos( sal_uInt16 nPos ) const
{
long nX = -mnOffset;
for ( size_t i = 0; i < nPos; i++ )
@@ -191,7 +191,7 @@ long HeaderBar::ImplGetItemPos( USHORT nPos ) const
// -----------------------------------------------------------------------
-Rectangle HeaderBar::ImplGetItemRect( USHORT nPos ) const
+Rectangle HeaderBar::ImplGetItemRect( sal_uInt16 nPos ) const
{
Rectangle aRect( ImplGetItemPos( nPos ), 0, 0, mnDY-1 );
aRect.Right() = aRect.Left() + (*mpItemList)[ nPos ]->mnSize - 1;
@@ -203,12 +203,12 @@ Rectangle HeaderBar::ImplGetItemRect( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT HeaderBar::ImplHitTest( const Point& rPos,
- long& nMouseOff, USHORT& nPos ) const
+sal_uInt16 HeaderBar::ImplHitTest( const Point& rPos,
+ long& nMouseOff, sal_uInt16& nPos ) const
{
ImplHeadItem* pItem;
- size_t nCount = (USHORT)mpItemList->size();
- BOOL bLastFixed = TRUE;
+ size_t nCount = (sal_uInt16)mpItemList->size();
+ sal_Bool bLastFixed = sal_True;
long nX = -mnOffset;
for ( size_t i = 0; i < nCount; i++ )
@@ -217,7 +217,7 @@ USHORT HeaderBar::ImplHitTest( const Point& rPos,
if ( rPos.X() < (nX+pItem->mnSize) )
{
- USHORT nMode;
+ sal_uInt16 nMode;
if ( !bLastFixed && (rPos.X() < (nX+HEADERBAR_SPLITOFF)) )
{
@@ -245,9 +245,9 @@ USHORT HeaderBar::ImplHitTest( const Point& rPos,
}
if ( pItem->mnBits & HIB_FIXED )
- bLastFixed = TRUE;
+ bLastFixed = sal_True;
else
- bLastFixed = FALSE;
+ bLastFixed = sal_False;
nX += pItem->mnSize;
}
@@ -268,7 +268,7 @@ USHORT HeaderBar::ImplHitTest( const Point& rPos,
// -----------------------------------------------------------------------
-void HeaderBar::ImplInvertDrag( USHORT nStartPos, USHORT nEndPos )
+void HeaderBar::ImplInvertDrag( sal_uInt16 nStartPos, sal_uInt16 nEndPos )
{
Rectangle aRect1 = ImplGetItemRect( nStartPos );
Rectangle aRect2 = ImplGetItemRect( nEndPos );
@@ -317,10 +317,10 @@ void HeaderBar::ImplInvertDrag( USHORT nStartPos, USHORT nEndPos )
// -----------------------------------------------------------------------
void HeaderBar::ImplDrawItem( OutputDevice* pDev,
- USHORT nPos, BOOL bHigh, BOOL bDrag,
+ sal_uInt16 nPos, sal_Bool bHigh, sal_Bool bDrag,
const Rectangle& rItemRect,
const Rectangle* pRect,
- ULONG )
+ sal_uLong )
{
Rectangle aRect = rItemRect;
@@ -374,9 +374,9 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev,
// avoid 3D borders
Color aSelectionTextColor( COL_TRANSPARENT );
if( bHigh )
- DrawSelectionBackground( aRect, 1, TRUE, FALSE, FALSE, &aSelectionTextColor );
+ DrawSelectionBackground( aRect, 1, sal_True, sal_False, sal_False, &aSelectionTextColor );
else if ( !mbButtonStyle || (nBits & HIB_FLAT) )
- DrawSelectionBackground( aRect, 0, TRUE, FALSE, FALSE, &aSelectionTextColor );
+ DrawSelectionBackground( aRect, 0, sal_True, sal_False, sal_False, &aSelectionTextColor );
// Wenn kein Platz, dann brauchen wir auch nichts ausgeben
if ( aRect.GetWidth() < 1 )
@@ -403,14 +403,14 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev,
}
// Text auf entsprechende Laenge kuerzen
- BOOL bLeftText = FALSE;
+ sal_Bool bLeftText = sal_False;
long nMaxTxtWidth = aRect.GetWidth()-(HEADERBAR_TEXTOFF*2)-nArrowWidth;
if ( nBits & (HIB_LEFTIMAGE | HIB_RIGHTIMAGE) )
nMaxTxtWidth -= aImageSize.Width();
long nTxtWidth = aTxtSize.Width();
if ( nTxtWidth > nMaxTxtWidth )
{
- bLeftText = TRUE;
+ bLeftText = sal_True;
// 3 == Len of "..."
pItem->maOutText.AppendAscii( "..." );
do
@@ -544,7 +544,7 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev,
}
if ( nImagePos+aImageSize.Width() <= aRect.Right() )
{
- USHORT nStyle = 0;
+ sal_uInt16 nStyle = 0;
if ( !IsEnabled() )
nStyle |= IMAGE_DRAW_DISABLE;
pDev->DrawImage( Point( nImagePos, nImagePosY ), pItem->maImage, nStyle );
@@ -567,11 +567,11 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev,
}
// Feststellen, ob Platz genug ist, das Item zu malen
- BOOL bDraw = TRUE;
+ sal_Bool bDraw = sal_True;
if ( nArrowX < aRect.Left()+HEADERBAR_TEXTOFF )
- bDraw = FALSE;
+ bDraw = sal_False;
else if ( nArrowX+HEAD_ARROWSIZE2 > aRect.Right() )
- bDraw = FALSE;
+ bDraw = sal_False;
if ( bDraw )
{
@@ -630,7 +630,7 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev,
// -----------------------------------------------------------------------
-void HeaderBar::ImplDrawItem( USHORT nPos, BOOL bHigh, BOOL bDrag,
+void HeaderBar::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHigh, sal_Bool bDrag,
const Rectangle* pRect )
{
Rectangle aRect = ImplGetItemRect( nPos );
@@ -639,7 +639,7 @@ void HeaderBar::ImplDrawItem( USHORT nPos, BOOL bHigh, BOOL bDrag,
// -----------------------------------------------------------------------
-void HeaderBar::ImplUpdate( USHORT nPos, BOOL bEnd, BOOL bDirect )
+void HeaderBar::ImplUpdate( sal_uInt16 nPos, sal_Bool bEnd, sal_Bool bDirect )
{
if ( IsVisible() && IsUpdateMode() )
{
@@ -667,7 +667,7 @@ void HeaderBar::ImplUpdate( USHORT nPos, BOOL bEnd, BOOL bDirect )
ImplDrawItem( i );
if ( bEnd )
{
- Rectangle aRect = ImplGetItemRect( (USHORT)mpItemList->size() );
+ Rectangle aRect = ImplGetItemRect( (sal_uInt16)mpItemList->size() );
aRect.Left() = aRect.Right();
aRect.Right() = mnDX-1;
if ( aRect.Left() < aRect.Right() )
@@ -683,31 +683,31 @@ void HeaderBar::ImplUpdate( USHORT nPos, BOOL bEnd, BOOL bDirect )
// -----------------------------------------------------------------------
-void HeaderBar::ImplStartDrag( const Point& rMousePos, BOOL bCommand )
+void HeaderBar::ImplStartDrag( const Point& rMousePos, sal_Bool bCommand )
{
- USHORT nPos;
- USHORT nHitTest = ImplHitTest( rMousePos, mnMouseOff, nPos );
+ sal_uInt16 nPos;
+ sal_uInt16 nHitTest = ImplHitTest( rMousePos, mnMouseOff, nPos );
if ( nHitTest )
{
- mbDrag = FALSE;
+ mbDrag = sal_False;
ImplHeadItem* pItem = (*mpItemList)[ nPos ];
if ( nHitTest & HEAD_HITTEST_DIVIDER )
- mbDrag = TRUE;
+ mbDrag = sal_True;
else
{
if ( ((pItem->mnBits & HIB_CLICKABLE) && !(pItem->mnBits & HIB_FLAT)) ||
(mbDragable && !(pItem->mnBits & HIB_FIXEDPOS)) )
{
- mbItemMode = TRUE;
- mbDrag = TRUE;
+ mbItemMode = sal_True;
+ mbDrag = sal_True;
if ( bCommand )
{
if ( mbDragable )
- mbItemDrag = TRUE;
+ mbItemDrag = sal_True;
else
{
- mbItemMode = FALSE;
- mbDrag = FALSE;
+ mbItemMode = sal_False;
+ mbDrag = sal_False;
}
}
}
@@ -724,7 +724,7 @@ void HeaderBar::ImplStartDrag( const Point& rMousePos, BOOL bCommand )
if ( mbDrag )
{
- mbOutDrag = FALSE;
+ mbOutDrag = sal_False;
mnCurItemId = pItem->mnId;
mnItemDragPos = nPos;
StartTracking();
@@ -732,7 +732,7 @@ void HeaderBar::ImplStartDrag( const Point& rMousePos, BOOL bCommand )
mnDragPos = mnStartPos;
StartDrag();
if ( mbItemMode )
- ImplDrawItem( nPos, TRUE, mbItemDrag );
+ ImplDrawItem( nPos, sal_True, mbItemDrag );
else
{
Rectangle aSizeRect( mnDragPos, 0, mnDragPos, mnDragSize+mnDY );
@@ -748,17 +748,17 @@ void HeaderBar::ImplStartDrag( const Point& rMousePos, BOOL bCommand )
void HeaderBar::ImplDrag( const Point& rMousePos )
{
- BOOL bNewOutDrag;
- USHORT nPos = GetItemPos( mnCurItemId );
+ sal_Bool bNewOutDrag;
+ sal_uInt16 nPos = GetItemPos( mnCurItemId );
mnDragPos = rMousePos.X()-mnMouseOff;
if ( mbItemMode )
{
Rectangle aItemRect = ImplGetItemRect( nPos );
if ( aItemRect.IsInside( rMousePos ) )
- bNewOutDrag = FALSE;
+ bNewOutDrag = sal_False;
else
- bNewOutDrag = TRUE;
+ bNewOutDrag = sal_True;
// Evt. ItemDrag anschalten
if ( bNewOutDrag && mbDragable && !mbItemDrag &&
@@ -766,24 +766,24 @@ void HeaderBar::ImplDrag( const Point& rMousePos )
{
if ( (rMousePos.Y() >= aItemRect.Top()) && (rMousePos.Y() <= aItemRect.Bottom()) )
{
- mbItemDrag = TRUE;
- ImplDrawItem( nPos, TRUE, mbItemDrag );
+ mbItemDrag = sal_True;
+ ImplDrawItem( nPos, sal_True, mbItemDrag );
}
}
- USHORT nOldItemDragPos = mnItemDragPos;
+ sal_uInt16 nOldItemDragPos = mnItemDragPos;
if ( mbItemDrag )
{
if ( (rMousePos.Y() < -HEADERBAR_DRAGOUTOFF) || (rMousePos.Y() > mnDY+HEADERBAR_DRAGOUTOFF) )
- bNewOutDrag = TRUE;
+ bNewOutDrag = sal_True;
else
- bNewOutDrag = FALSE;
+ bNewOutDrag = sal_False;
if ( bNewOutDrag )
mnItemDragPos = HEADERBAR_ITEM_NOTFOUND;
else
{
- USHORT nTempId = GetItemId( Point( rMousePos.X(), 2 ) );
+ sal_uInt16 nTempId = GetItemId( Point( rMousePos.X(), 2 ) );
if ( nTempId )
mnItemDragPos = GetItemPos( nTempId );
else
@@ -827,7 +827,7 @@ void HeaderBar::ImplDrag( const Point& rMousePos )
(mnItemDragPos != nPos) &&
(mnItemDragPos != HEADERBAR_ITEM_NOTFOUND) )
{
- ImplDrawItem( mnItemDragPos, FALSE, TRUE );
+ ImplDrawItem( mnItemDragPos, sal_False, sal_True );
ImplInvertDrag( nPos, mnItemDragPos );
}
}
@@ -853,7 +853,7 @@ void HeaderBar::ImplDrag( const Point& rMousePos )
// -----------------------------------------------------------------------
-void HeaderBar::ImplEndDrag( BOOL bCancel )
+void HeaderBar::ImplEndDrag( sal_Bool bCancel )
{
HideTracking();
@@ -861,7 +861,7 @@ void HeaderBar::ImplEndDrag( BOOL bCancel )
{
if ( mbItemMode && (!mbOutDrag || mbItemDrag) )
{
- USHORT nPos = GetItemPos( mnCurItemId );
+ sal_uInt16 nPos = GetItemPos( mnCurItemId );
ImplDrawItem( nPos );
}
@@ -869,7 +869,7 @@ void HeaderBar::ImplEndDrag( BOOL bCancel )
}
else
{
- USHORT nPos = GetItemPos( mnCurItemId );
+ sal_uInt16 nPos = GetItemPos( mnCurItemId );
if ( mbItemMode )
{
if ( mbItemDrag )
@@ -898,18 +898,18 @@ void HeaderBar::ImplEndDrag( BOOL bCancel )
{
ImplHeadItem* pItem = (*mpItemList)[ nPos ];
pItem->mnSize += nDelta;
- ImplUpdate( nPos, TRUE );
+ ImplUpdate( nPos, sal_True );
}
}
}
- mbDrag = FALSE;
+ mbDrag = sal_False;
EndDrag();
mnCurItemId = 0;
mnItemDragPos = HEADERBAR_ITEM_NOTFOUND;
- mbOutDrag = FALSE;
- mbItemMode = FALSE;
- mbItemDrag = FALSE;
+ mbOutDrag = sal_False;
+ mbItemMode = sal_False;
+ mbItemDrag = sal_False;
}
// -----------------------------------------------------------------------
@@ -921,23 +921,23 @@ void HeaderBar::MouseButtonDown( const MouseEvent& rMEvt )
if ( rMEvt.GetClicks() == 2 )
{
long nTemp;
- USHORT nPos;
- USHORT nHitTest = ImplHitTest( rMEvt.GetPosPixel(), nTemp, nPos );
+ sal_uInt16 nPos;
+ sal_uInt16 nHitTest = ImplHitTest( rMEvt.GetPosPixel(), nTemp, nPos );
if ( nHitTest )
{
ImplHeadItem* pItem = (*mpItemList)[ nPos ];
if ( nHitTest & HEAD_HITTEST_DIVIDER )
- mbItemMode = FALSE;
+ mbItemMode = sal_False;
else
- mbItemMode = TRUE;
+ mbItemMode = sal_True;
mnCurItemId = pItem->mnId;
DoubleClick();
- mbItemMode = FALSE;
+ mbItemMode = sal_False;
mnCurItemId = 0;
}
}
else
- ImplStartDrag( rMEvt.GetPosPixel(), FALSE );
+ ImplStartDrag( rMEvt.GetPosPixel(), sal_False );
}
}
@@ -946,9 +946,9 @@ void HeaderBar::MouseButtonDown( const MouseEvent& rMEvt )
void HeaderBar::MouseMove( const MouseEvent& rMEvt )
{
long nTemp1;
- USHORT nTemp2;
+ sal_uInt16 nTemp2;
PointerStyle eStyle = POINTER_ARROW;
- USHORT nHitTest = ImplHitTest( rMEvt.GetPosPixel(), nTemp1, nTemp2 );
+ sal_uInt16 nHitTest = ImplHitTest( rMEvt.GetPosPixel(), nTemp1, nTemp2 );
if ( nHitTest & HEAD_HITTEST_DIVIDER )
eStyle = POINTER_HSIZEBAR;
@@ -987,20 +987,20 @@ void HeaderBar::Paint( const Rectangle& rRect )
}
}
- USHORT nCurItemPos;
+ sal_uInt16 nCurItemPos;
if ( mbDrag )
nCurItemPos = GetItemPos( mnCurItemId );
else
nCurItemPos = HEADERBAR_ITEM_NOTFOUND;
- USHORT nItemCount = (USHORT)mpItemList->size();
- for ( USHORT i = 0; i < nItemCount; i++ )
- ImplDrawItem( i, (i == nCurItemPos) ? TRUE : FALSE, FALSE, &rRect );
+ sal_uInt16 nItemCount = (sal_uInt16)mpItemList->size();
+ for ( sal_uInt16 i = 0; i < nItemCount; i++ )
+ ImplDrawItem( i, (i == nCurItemPos) ? sal_True : sal_False, sal_False, &rRect );
}
// -----------------------------------------------------------------------
void HeaderBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- ULONG nFlags )
+ sal_uLong nFlags )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -1046,7 +1046,7 @@ void HeaderBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
aItemRect.Right() = 16000;
Region aRegion( aRect );
pDev->SetClipRegion( aRegion );
- ImplDrawItem( pDev, i, FALSE, FALSE, aItemRect, &aRect, nFlags );
+ ImplDrawItem( pDev, i, sal_False, sal_False, aItemRect, &aRect, nFlags );
pDev->SetClipRegion();
}
@@ -1070,7 +1070,7 @@ void HeaderBar::Command( const CommandEvent& rCEvt )
{
if ( rCEvt.IsMouseEvent() && (rCEvt.GetCommand() == COMMAND_STARTDRAG) && !mbDrag )
{
- ImplStartDrag( rCEvt.GetMousePosPixel(), TRUE );
+ ImplStartDrag( rCEvt.GetMousePosPixel(), sal_True );
return;
}
@@ -1081,7 +1081,7 @@ void HeaderBar::Command( const CommandEvent& rCEvt )
void HeaderBar::RequestHelp( const HelpEvent& rHEvt )
{
- USHORT nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
+ sal_uInt16 nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
if ( nItemId )
{
if ( rHEvt.GetMode() & (HELPMODE_QUICK | HELPMODE_BALLOON) )
@@ -1118,13 +1118,13 @@ void HeaderBar::RequestHelp( const HelpEvent& rHEvt )
}
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
- ULONG nHelpId = GetHelpId( nItemId );
- if ( nHelpId )
+ rtl::OUString aHelpId( rtl::OStringToOUString( GetHelpId( nItemId ), RTL_TEXTENCODING_UTF8 ) );
+ if ( aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pHelp->Start( nHelpId, this );
+ pHelp->Start( aHelpId, this );
return;
}
}
@@ -1144,17 +1144,17 @@ void HeaderBar::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
}
@@ -1170,7 +1170,7 @@ void HeaderBar::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
}
@@ -1218,8 +1218,8 @@ void HeaderBar::DoubleClick()
// -----------------------------------------------------------------------
-void HeaderBar::InsertItem( USHORT nItemId, const Image& rImage,
- long nSize, HeaderBarItemBits nBits, USHORT nPos )
+void HeaderBar::InsertItem( sal_uInt16 nItemId, const Image& rImage,
+ long nSize, HeaderBarItemBits nBits, sal_uInt16 nPos )
{
DBG_ASSERT( nItemId, "HeaderBar::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == HEADERBAR_ITEM_NOTFOUND,
@@ -1241,13 +1241,13 @@ void HeaderBar::InsertItem( USHORT nItemId, const Image& rImage,
}
// Ausgabe updaten
- ImplUpdate( nPos, TRUE );
+ ImplUpdate( nPos, sal_True );
}
// -----------------------------------------------------------------------
-void HeaderBar::InsertItem( USHORT nItemId, const XubString& rText,
- long nSize, HeaderBarItemBits nBits, USHORT nPos )
+void HeaderBar::InsertItem( sal_uInt16 nItemId, const XubString& rText,
+ long nSize, HeaderBarItemBits nBits, sal_uInt16 nPos )
{
DBG_ASSERT( nItemId, "HeaderBar::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == HEADERBAR_ITEM_NOTFOUND,
@@ -1258,7 +1258,6 @@ void HeaderBar::InsertItem( USHORT nItemId, const XubString& rText,
pItem->mnId = nItemId;
pItem->mnBits = nBits;
pItem->mnSize = nSize;
- pItem->mnHelpId = 0;
pItem->maText = rText;
pItem->mpUserData = 0;
if ( nPos < mpItemList->size() ) {
@@ -1270,15 +1269,15 @@ void HeaderBar::InsertItem( USHORT nItemId, const XubString& rText,
}
// Ausgabe updaten
- ImplUpdate( nPos, TRUE );
+ ImplUpdate( nPos, sal_True );
}
// -----------------------------------------------------------------------
-void HeaderBar::InsertItem( USHORT nItemId,
+void HeaderBar::InsertItem( sal_uInt16 nItemId,
const Image& rImage, const XubString& rText,
long nSize, HeaderBarItemBits nBits,
- USHORT nPos )
+ sal_uInt16 nPos )
{
DBG_ASSERT( nItemId, "HeaderBar::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == HEADERBAR_ITEM_NOTFOUND,
@@ -1289,7 +1288,6 @@ void HeaderBar::InsertItem( USHORT nItemId,
pItem->mnId = nItemId;
pItem->mnBits = nBits;
pItem->mnSize = nSize;
- pItem->mnHelpId = 0;
pItem->maImage = rImage;
pItem->maText = rText;
pItem->mpUserData = 0;
@@ -1302,14 +1300,14 @@ void HeaderBar::InsertItem( USHORT nItemId,
}
// Ausgabe updaten
- ImplUpdate( nPos, TRUE );
+ ImplUpdate( nPos, sal_True );
}
// -----------------------------------------------------------------------
-void HeaderBar::RemoveItem( USHORT nItemId )
+void HeaderBar::RemoveItem( sal_uInt16 nItemId )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
{
if ( nPos < mpItemList->size() ) {
@@ -1318,15 +1316,14 @@ void HeaderBar::RemoveItem( USHORT nItemId )
delete *it;
mpItemList->erase( it );
}
- ImplUpdate( nPos, TRUE );
}
}
// -----------------------------------------------------------------------
-void HeaderBar::MoveItem( USHORT nItemId, USHORT nNewPos )
+void HeaderBar::MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
{
if ( nPos != nNewPos )
@@ -1340,7 +1337,6 @@ void HeaderBar::MoveItem( USHORT nItemId, USHORT nNewPos )
it = mpItemList->begin();
::std::advance( it, nPos );
mpItemList->insert( it, pItem );
- ImplUpdate( nPos, TRUE );
}
}
}
@@ -1355,7 +1351,7 @@ void HeaderBar::Clear()
}
mpItemList->clear();
- ImplUpdate( 0, TRUE );
+ ImplUpdate( 0, sal_True );
}
// -----------------------------------------------------------------------
@@ -1371,26 +1367,26 @@ void HeaderBar::SetOffset( long nNewOffset )
// -----------------------------------------------------------------------
-USHORT HeaderBar::GetItemCount() const
+sal_uInt16 HeaderBar::GetItemCount() const
{
- return (USHORT)mpItemList->size();
+ return (sal_uInt16)mpItemList->size();
}
// -----------------------------------------------------------------------
-USHORT HeaderBar::GetItemPos( USHORT nItemId ) const
+sal_uInt16 HeaderBar::GetItemPos( sal_uInt16 nItemId ) const
{
for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
ImplHeadItem* pItem = (*mpItemList)[ i ];
if ( pItem->mnId == nItemId )
- return (USHORT)i;
+ return (sal_uInt16)i;
}
return HEADERBAR_ITEM_NOTFOUND;
}
// -----------------------------------------------------------------------
-USHORT HeaderBar::GetItemId( USHORT nPos ) const
+sal_uInt16 HeaderBar::GetItemId( sal_uInt16 nPos ) const
{
ImplHeadItem* pItem = (nPos < mpItemList->size() ) ? (*mpItemList)[ nPos ] : NULL;
if ( pItem )
@@ -1401,7 +1397,7 @@ USHORT HeaderBar::GetItemId( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT HeaderBar::GetItemId( const Point& rPos ) const
+sal_uInt16 HeaderBar::GetItemId( const Point& rPos ) const
{
for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
if ( ImplGetItemRect( i ).IsInside( rPos ) ) {
@@ -1413,10 +1409,10 @@ USHORT HeaderBar::GetItemId( const Point& rPos ) const
// -----------------------------------------------------------------------
-Rectangle HeaderBar::GetItemRect( USHORT nItemId ) const
+Rectangle HeaderBar::GetItemRect( sal_uInt16 nItemId ) const
{
Rectangle aRect;
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
aRect = ImplGetItemRect( nPos );
return aRect;
@@ -1424,25 +1420,25 @@ Rectangle HeaderBar::GetItemRect( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void HeaderBar::SetItemSize( USHORT nItemId, long nNewSize )
+void HeaderBar::SetItemSize( sal_uInt16 nItemId, long nNewSize )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
{
ImplHeadItem* pItem = (*mpItemList)[ nPos ];
if ( pItem->mnSize != nNewSize )
{
pItem->mnSize = nNewSize;
- ImplUpdate( nPos, TRUE );
+ ImplUpdate( nPos, sal_True );
}
}
}
// -----------------------------------------------------------------------
-long HeaderBar::GetItemSize( USHORT nItemId ) const
+long HeaderBar::GetItemSize( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->mnSize;
else
@@ -1451,9 +1447,9 @@ long HeaderBar::GetItemSize( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void HeaderBar::SetItemBits( USHORT nItemId, HeaderBarItemBits nNewBits )
+void HeaderBar::SetItemBits( sal_uInt16 nItemId, HeaderBarItemBits nNewBits )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
{
ImplHeadItem* pItem = (*mpItemList)[ nPos ];
@@ -1467,9 +1463,9 @@ void HeaderBar::SetItemBits( USHORT nItemId, HeaderBarItemBits nNewBits )
// -----------------------------------------------------------------------
-HeaderBarItemBits HeaderBar::GetItemBits( USHORT nItemId ) const
+HeaderBarItemBits HeaderBar::GetItemBits( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->mnBits;
else
@@ -1478,9 +1474,9 @@ HeaderBarItemBits HeaderBar::GetItemBits( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void HeaderBar::SetItemData( USHORT nItemId, void* pNewData )
+void HeaderBar::SetItemData( sal_uInt16 nItemId, void* pNewData )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
{
(*mpItemList)[ nPos ]->mpUserData = pNewData;
@@ -1490,9 +1486,9 @@ void HeaderBar::SetItemData( USHORT nItemId, void* pNewData )
// -----------------------------------------------------------------------
-void* HeaderBar::GetItemData( USHORT nItemId ) const
+void* HeaderBar::GetItemData( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->mpUserData;
else
@@ -1501,9 +1497,9 @@ void* HeaderBar::GetItemData( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void HeaderBar::SetItemImage( USHORT nItemId, const Image& rImage )
+void HeaderBar::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
{
(*mpItemList)[ nPos ]->maImage = rImage;
@@ -1513,9 +1509,9 @@ void HeaderBar::SetItemImage( USHORT nItemId, const Image& rImage )
// -----------------------------------------------------------------------
-Image HeaderBar::GetItemImage( USHORT nItemId ) const
+Image HeaderBar::GetItemImage( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->maImage;
else
@@ -1524,9 +1520,9 @@ Image HeaderBar::GetItemImage( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void HeaderBar::SetItemText( USHORT nItemId, const XubString& rText )
+void HeaderBar::SetItemText( sal_uInt16 nItemId, const XubString& rText )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
{
(*mpItemList)[ nPos ]->maText = rText;
@@ -1536,9 +1532,9 @@ void HeaderBar::SetItemText( USHORT nItemId, const XubString& rText )
// -----------------------------------------------------------------------
-XubString HeaderBar::GetItemText( USHORT nItemId ) const
+XubString HeaderBar::GetItemText( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->maText;
else
@@ -1547,26 +1543,26 @@ XubString HeaderBar::GetItemText( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void HeaderBar::SetHelpText( USHORT nItemId, const XubString& rText )
+void HeaderBar::SetHelpText( sal_uInt16 nItemId, const XubString& rText )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
(*mpItemList)[ nPos ]->maHelpText = rText;
}
// -----------------------------------------------------------------------
-XubString HeaderBar::GetHelpText( USHORT nItemId ) const
+XubString HeaderBar::GetHelpText( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
{
ImplHeadItem* pItem = (*mpItemList)[ nPos ];
- if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
+ if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
+ pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return pItem->maHelpText;
@@ -1577,22 +1573,22 @@ XubString HeaderBar::GetHelpText( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void HeaderBar::SetHelpId( USHORT nItemId, ULONG nHelpId )
+void HeaderBar::SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
- (*mpItemList)[ nPos ]->mnHelpId = nHelpId;
+ (*mpItemList)[ nPos ]->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
-ULONG HeaderBar::GetHelpId( USHORT nItemId ) const
+rtl::OString HeaderBar::GetHelpId( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
+ rtl::OString aRet;
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
- return (*mpItemList)[ nPos ]->mnHelpId;
- else
- return 0;
+ return (*mpItemList)[ nPos ]->maHelpId;
+ return aRet;
}
// -----------------------------------------------------------------------
diff --git a/svtools/source/control/indexentryres.cxx b/svtools/source/control/indexentryres.cxx
index 4bc40eb8edeb..a62320ce99ac 100644
--- a/svtools/source/control/indexentryres.cxx
+++ b/svtools/source/control/indexentryres.cxx
@@ -31,9 +31,7 @@
#include "precompiled_svtools.hxx"
#include <svtools/svtdata.hxx>
#include <svtools/svtools.hrc>
-
-
-#include <indexentryres.hxx>
+#include <svtools/indexentryres.hxx>
// -------------------------------------------------------------------------
//
diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx
index 6d1cd75c4f74..0dcb4fb4ce23 100644..100755
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -34,7 +34,6 @@
#include <sys/types.h>
#endif
-
#include <svtools/inettbc.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Reference.hxx>
@@ -42,16 +41,13 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
-
-#include <com/sun/star/task/XInteractionHandler.hdl>
+#include <com/sun/star/task/XInteractionHandler.hpp>
#include <com/sun/star/ucb/NumberedSortingInfo.hpp>
#include <com/sun/star/ucb/XAnyCompareFactory.hpp>
#include <com/sun/star/ucb/XProgressHandler.hpp>
#include <com/sun/star/ucb/XContentAccess.hpp>
#include <com/sun/star/ucb/XSortedDynamicResultSetFactory.hpp>
-
#include <comphelper/processfactory.hxx>
-
#include <vcl/toolbox.hxx>
#include <osl/thread.hxx>
#include <osl/mutex.hxx>
@@ -69,9 +65,8 @@
#include <ucbhelper/content.hxx>
#include <unotools/localfilehelper.hxx>
#include <unotools/ucbhelper.hxx>
-
#include "iodlg.hrc"
-#include <asynclink.hxx>
+#include <svtools/asynclink.hxx>
#include <svl/urlfilter.hxx>
#include <vector>
@@ -122,17 +117,17 @@ class SvtMatchContext_Impl : public ::osl::Thread
String aBaseURL;
String aText;
SvtURLBox* pBox;
- BOOL bStop;
- BOOL bOnlyDirectories;
- BOOL bNoSelection;
+ sal_Bool bStop;
+ sal_Bool bOnlyDirectories;
+ sal_Bool bNoSelection;
DECL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void* );
virtual void SAL_CALL onTerminated( );
virtual void SAL_CALL run();
virtual void SAL_CALL Cancel();
- void Insert( const String& rCompletion, const String& rURL, BOOL bForce = FALSE);
- void ReadFolder( const String& rURL, const String& rMatch, BOOL bSmart );
+ void Insert( const String& rCompletion, const String& rURL, sal_Bool bForce = sal_False);
+ void ReadFolder( const String& rURL, const String& rMatch, sal_Bool bSmart );
void FillPicklist( SvStringsDtor& rPickList );
public:
@@ -158,9 +153,9 @@ SvtMatchContext_Impl::SvtMatchContext_Impl(
SvtURLBox* pBoxP, const String& rText )
: aLink( STATIC_LINK( this, SvtMatchContext_Impl, Select_Impl ) )
, aBaseURL( pBoxP->aBaseURL )
- , aText( rText )
+ , aText( rText )
, pBox( pBoxP )
- , bStop( FALSE )
+ , bStop( sal_False )
, bOnlyDirectories( pBoxP->bOnlyDirectories )
, bNoSelection( pBoxP->bNoSelection )
{
@@ -205,7 +200,7 @@ void SvtMatchContext_Impl::FillPicklist( SvStringsDtor& rPickList )
seqPropertySet[nProperty].Value >>= sTitle;
aURL.SetURL( sTitle );
const StringPtr pStr = new String( aURL.GetMainURL( INetURLObject::DECODE_WITH_CHARSET ) );
- rPickList.Insert( pStr, (USHORT) nItem );
+ rPickList.Insert( pStr, (sal_uInt16) nItem );
break;
}
}
@@ -222,7 +217,7 @@ void SAL_CALL SvtMatchContext_Impl::Cancel()
//-------------------------------------------------------------------------
void SvtMatchContext_Impl::Stop()
{
- bStop = TRUE;
+ bStop = sal_True;
if( isRunning() )
terminate();
@@ -252,7 +247,7 @@ IMPL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void*, )
}
SvtURLBox* pBox = pThis->pBox;
- pBox->bAutoCompleteMode = TRUE;
+ pBox->bAutoCompleteMode = sal_True;
// did we filter completions which otherwise would have been valid?
// (to be filled below)
@@ -261,7 +256,7 @@ IMPL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void*, )
// insert all completed strings into the listbox
pBox->Clear();
- for( USHORT nPos = 0; nPos<pThis->pCompletions->Count(); nPos++ )
+ for( sal_uInt16 nPos = 0; nPos<pThis->pCompletions->Count(); nPos++ )
{
String sCompletion( *(*pThis->pCompletions)[nPos] );
@@ -331,12 +326,12 @@ IMPL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void*, )
//-------------------------------------------------------------------------
void SvtMatchContext_Impl::Insert( const String& rCompletion,
const String& rURL,
- BOOL bForce )
+ sal_Bool bForce )
{
if( !bForce )
{
// avoid doubles
- for( USHORT nPos = pCompletions->Count(); nPos--; )
+ for( sal_uInt16 nPos = pCompletions->Count(); nPos--; )
if( *(*pCompletions)[ nPos ] == rCompletion )
return;
}
@@ -350,7 +345,7 @@ void SvtMatchContext_Impl::Insert( const String& rCompletion,
//-------------------------------------------------------------------------
void SvtMatchContext_Impl::ReadFolder( const String& rURL,
const String& rMatch,
- BOOL bSmart )
+ sal_Bool bSmart )
{
// check folder to scan
if( !UCBContentHelper::IsFolder( rURL ) )
@@ -375,7 +370,7 @@ void SvtMatchContext_Impl::ReadFolder( const String& rURL,
String aNewText( aText );
aNewText += '/';
- Insert( aNewText, rURL, TRUE );
+ Insert( aNewText, rURL, sal_True );
return;
}
@@ -419,7 +414,7 @@ void SvtMatchContext_Impl::ReadFolder( const String& rURL,
uno::Reference< XDynamicResultSet > xDynResultSet;
ResultSetInclude eInclude = INCLUDE_FOLDERS_AND_DOCUMENTS;
if ( bOnlyDirectories )
- eInclude = INCLUDE_FOLDERS_ONLY;
+ eInclude = INCLUDE_FOLDERS_ONLY;
xDynResultSet = aCnt.createDynamicCursor( aProps, eInclude );
@@ -501,7 +496,7 @@ void SvtMatchContext_Impl::ReadFolder( const String& rURL,
if ( bIsFolder )
aInput += aDelimiter;
- Insert( aInput, aObj.GetMainURL( INetURLObject::NO_DECODE ), TRUE );
+ Insert( aInput, aObj.GetMainURL( INetURLObject::NO_DECODE ), sal_True );
}
}
}
@@ -570,7 +565,7 @@ String SvtURLBox::ParseSmart( String aText, String aBaseURL, String aWorkDir )
aObj.setFinalSlash();
// take base URL and append current input
- bool bWasAbsolute = FALSE;
+ bool bWasAbsolute = sal_False;
#ifdef UNX
// don't support FSYS_MAC under Unix, because here ':' is a valid character for a filename
INetURLObject::FSysStyle eStyle = static_cast< INetURLObject::FSysStyle >( INetURLObject::FSYS_VOS | INetURLObject::FSYS_UNX | INetURLObject::FSYS_DOS );
@@ -611,7 +606,7 @@ void SvtMatchContext_Impl::run()
pURLs->Remove( 0, pURLs->Count() );
// check for input
- USHORT nTextLen = aText.Len();
+ sal_uInt16 nTextLen = aText.Len();
if ( !nTextLen )
return;
@@ -647,7 +642,7 @@ void SvtMatchContext_Impl::run()
{
// if text input is a directory, it must be part of the match list! Until then it is scanned
if ( UCBContentHelper::IsFolder( aMainURL ) && aURLObject.hasFinalSlash() )
- Insert( aText, aMatch );
+ Insert( aText, aMatch );
else
// otherwise the parent folder will be taken
aURLObject.removeSegment();
@@ -663,7 +658,7 @@ void SvtMatchContext_Impl::run()
// don't scan history picklist if only directories are allowed, picklist contains only files
return;
- BOOL bFull = FALSE;
+ sal_Bool bFull = sal_False;
int nCount = aPickList.Count();
INetURLObject aCurObj;
@@ -672,11 +667,12 @@ void SvtMatchContext_Impl::run()
aObj.SetSmartProtocol( eSmartProt == INET_PROT_NOT_VALID ? INET_PROT_HTTP : eSmartProt );
for( ;; )
{
- for( USHORT nPos = 0; schedule() && nPos < nCount; nPos++ )
+ for( sal_uInt16 nPos = 0; schedule() && nPos < nCount; nPos++ )
{
aCurObj.SetURL( *aPickList.GetObject( nPos ) );
aCurObj.SetSmartURL( aCurObj.GetURLNoPass());
aCurMainURL = aCurObj.GetMainURL( INetURLObject::NO_DECODE );
+
if( eProt != INET_PROT_NOT_VALID && aCurObj.GetProtocol() != eProt )
continue;
@@ -701,7 +697,7 @@ void SvtMatchContext_Impl::run()
{
// try if text matches the scheme
String aScheme( INetURLObject::GetScheme( aCurObj.GetProtocol() ) );
- if ( aText.CompareTo( aScheme, aText.Len() ) == COMPARE_EQUAL && aText.Len() < aScheme.Len() )
+ if ( aText.CompareIgnoreCaseToAscii( aScheme, aText.Len() ) == COMPARE_EQUAL && aText.Len() < aScheme.Len() )
{
if( bFull )
aMatch = aCurObj.GetMainURL( INetURLObject::NO_DECODE );
@@ -720,7 +716,7 @@ void SvtMatchContext_Impl::run()
aCurString.Erase( 0, aScheme.Len() );
}
- if( aText.CompareTo( aCurString, aText.Len() )== COMPARE_EQUAL )
+ if( aText.CompareIgnoreCaseToAscii( aCurString, aText.Len() )== COMPARE_EQUAL )
{
if( bFull )
aMatch = aCurObj.GetMainURL( INetURLObject::NO_DECODE );
@@ -761,7 +757,7 @@ void SvtMatchContext_Impl::run()
}
if( !bFull )
- bFull = TRUE;
+ bFull = sal_True;
else
break;
}
@@ -772,7 +768,7 @@ void SvtMatchContext_Impl::run()
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
-void SvtURLBox::TryAutoComplete( BOOL bForce )
+void SvtURLBox::TryAutoComplete( sal_Bool bForce )
{
if( Application::AnyInput( INPUT_KEYBOARD ) ) return;
@@ -781,7 +777,7 @@ void SvtURLBox::TryAutoComplete( BOOL bForce )
Selection aSelection( GetSelection() );
if( aSelection.Max() != aCurText.Len() && !bForce )
return;
- USHORT nLen = (USHORT)aSelection.Min();
+ sal_uInt16 nLen = (sal_uInt16)aSelection.Min();
aCurText.Erase( nLen );
if( aCurText.Len() && bIsAutoCompleteEnabled )
{
@@ -799,13 +795,13 @@ SvtURLBox::SvtURLBox( Window* pParent, INetProtocol eSmart )
: ComboBox( pParent , WB_DROPDOWN | WB_AUTOSIZE | WB_AUTOHSCROLL ),
pCtx( 0 ),
eSmartProtocol( eSmart ),
- bAutoCompleteMode( FALSE ),
- bOnlyDirectories( FALSE ),
- bTryAutoComplete( FALSE ),
- bCtrlClick( FALSE ),
- bHistoryDisabled( FALSE ),
- bNoSelection( FALSE ),
- bIsAutoCompleteEnabled( TRUE )
+ bAutoCompleteMode( sal_False ),
+ bOnlyDirectories( sal_False ),
+ bTryAutoComplete( sal_False ),
+ bCtrlClick( sal_False ),
+ bHistoryDisabled( sal_False ),
+ bNoSelection( sal_False ),
+ bIsAutoCompleteEnabled( sal_True )
{
ImplInit();
@@ -820,13 +816,13 @@ SvtURLBox::SvtURLBox( Window* pParent, WinBits _nStyle, INetProtocol eSmart )
: ComboBox( pParent, _nStyle ),
pCtx( 0 ),
eSmartProtocol( eSmart ),
- bAutoCompleteMode( FALSE ),
- bOnlyDirectories( FALSE ),
- bTryAutoComplete( FALSE ),
- bCtrlClick( FALSE ),
- bHistoryDisabled( FALSE ),
- bNoSelection( FALSE ),
- bIsAutoCompleteEnabled( TRUE )
+ bAutoCompleteMode( sal_False ),
+ bOnlyDirectories( sal_False ),
+ bTryAutoComplete( sal_False ),
+ bCtrlClick( sal_False ),
+ bHistoryDisabled( sal_False ),
+ bNoSelection( sal_False ),
+ bIsAutoCompleteEnabled( sal_True )
{
ImplInit();
}
@@ -836,13 +832,13 @@ SvtURLBox::SvtURLBox( Window* pParent, const ResId& _rResId, INetProtocol eSmart
: ComboBox( pParent , _rResId ),
pCtx( 0 ),
eSmartProtocol( eSmart ),
- bAutoCompleteMode( FALSE ),
- bOnlyDirectories( FALSE ),
- bTryAutoComplete( FALSE ),
- bCtrlClick( FALSE ),
- bHistoryDisabled( FALSE ),
- bNoSelection( FALSE ),
- bIsAutoCompleteEnabled( TRUE )
+ bAutoCompleteMode( sal_False ),
+ bOnlyDirectories( sal_False ),
+ bTryAutoComplete( sal_False ),
+ bCtrlClick( sal_False ),
+ bHistoryDisabled( sal_False ),
+ bNoSelection( sal_False ),
+ bIsAutoCompleteEnabled( sal_True )
{
ImplInit();
}
@@ -851,8 +847,10 @@ SvtURLBox::SvtURLBox( Window* pParent, const ResId& _rResId, INetProtocol eSmart
void SvtURLBox::ImplInit()
{
pImp = new SvtURLBox_Impl();
- SetHelpId( SID_OPENURL );
- EnableAutocomplete( FALSE );
+
+ if ( GetHelpId().getLength() == 0 )
+ SetHelpId( ".uno:OpenURL" );
+ EnableAutocomplete( sal_False );
SetText( String() );
@@ -934,7 +932,7 @@ void SvtURLBox::UpdatePicklistForSmartProtocol_Impl()
if ( aURL.Len() && ( !pImp->pUrlFilter || pImp->pUrlFilter->isUrlAllowed( aURL ) ) )
{
- BOOL bFound = (aURL.GetChar(aURL.Len()-1) == '/' );
+ sal_Bool bFound = (aURL.GetChar(aURL.Len()-1) == '/' );
if ( !bFound )
{
String aUpperURL( aURL );
@@ -964,7 +962,7 @@ void SvtURLBox::UpdatePicklistForSmartProtocol_Impl()
}
//-------------------------------------------------------------------------
-BOOL SvtURLBox::ProcessKey( const KeyCode& rKey )
+sal_Bool SvtURLBox::ProcessKey( const KeyCode& rKey )
{
// every key input stops the current matching thread
if( pCtx )
@@ -982,7 +980,7 @@ BOOL SvtURLBox::ProcessKey( const KeyCode& rKey )
if ( bAutoCompleteMode )
{
// reset picklist
- bAutoCompleteMode = FALSE;
+ bAutoCompleteMode = sal_False;
Selection aSelection( GetSelection() );
SetSelection( Selection( aSelection.Min(), aSelection.Min() ) );
if ( bOnlyDirectories )
@@ -993,19 +991,19 @@ BOOL SvtURLBox::ProcessKey( const KeyCode& rKey )
}
bCtrlClick = rKey.IsMod1();
- BOOL bHandled = FALSE;
+ sal_Bool bHandled = sal_False;
if ( GetOpenHdl().IsSet() )
{
- bHandled = TRUE;
+ bHandled = sal_True;
GetOpenHdl().Call(this);
}
else if ( GetSelectHdl().IsSet() )
{
- bHandled = TRUE;
+ bHandled = sal_True;
GetSelectHdl().Call(this);
}
- bCtrlClick = FALSE;
+ bCtrlClick = sal_False;
ClearModifyFlag();
return bHandled;
@@ -1013,9 +1011,9 @@ BOOL SvtURLBox::ProcessKey( const KeyCode& rKey )
else if ( aCode == KEY_RETURN && !GetText().Len() && GetOpenHdl().IsSet() )
{
// for file dialog
- bAutoCompleteMode = FALSE;
+ bAutoCompleteMode = sal_False;
GetOpenHdl().Call(this);
- return TRUE;
+ return sal_True;
}
else if( aCode == KEY_ESCAPE )
{
@@ -1031,15 +1029,15 @@ BOOL SvtURLBox::ProcessKey( const KeyCode& rKey )
}
else
{
- return FALSE;
+ return sal_False;
}
- bAutoCompleteMode = FALSE;
- return TRUE;
+ bAutoCompleteMode = sal_False;
+ return sal_True;
}
else
{
- return FALSE;
+ return sal_False;
}
}
@@ -1060,15 +1058,15 @@ long SvtURLBox::PreNotify( NotifyEvent& rNEvt )
KeyCode aCode( rKey.GetCode() );
if( ProcessKey( rKey ) )
{
- return TRUE;
+ return sal_True;
}
else if( ( aCode == KEY_UP || aCode == KEY_DOWN ) && !rKey.IsMod2() )
{
Selection aSelection( GetSelection() );
- USHORT nLen = (USHORT)aSelection.Min();
+ sal_uInt16 nLen = (sal_uInt16)aSelection.Min();
GetSubEdit()->KeyInput( rEvent );
SetSelection( Selection( nLen, GetText().Len() ) );
- return TRUE;
+ return sal_True;
}
if ( MatchesPlaceHolder( GetText() ) )
@@ -1087,7 +1085,7 @@ IMPL_LINK( SvtURLBox, AutoCompleteHdl_Impl, void*, EMPTYARG )
{
if ( GetSubEdit()->GetAutocompleteAction() == AUTOCOMPLETE_KEYINPUT )
{
- TryAutoComplete( FALSE );
+ TryAutoComplete( sal_False );
return 1L;
}
@@ -1126,7 +1124,7 @@ void SvtURLBox::Select()
}
//-------------------------------------------------------------------------
-void SvtURLBox::SetOnlyDirectories( BOOL bDir )
+void SvtURLBox::SetOnlyDirectories( sal_Bool bDir )
{
bOnlyDirectories = bDir;
if ( bOnlyDirectories )
@@ -1134,7 +1132,7 @@ void SvtURLBox::SetOnlyDirectories( BOOL bDir )
}
//-------------------------------------------------------------------------
-void SvtURLBox::SetNoURLSelection( BOOL bSet )
+void SvtURLBox::SetNoURLSelection( sal_Bool bSet )
{
bNoSelection = bSet;
}
@@ -1151,7 +1149,7 @@ String SvtURLBox::GetURL()
// try to get the right case preserving URL from the list of URLs
if ( pImp->pCompletions && pImp->pURLs )
{
- for( USHORT nPos=0; nPos<pImp->pCompletions->Count(); nPos++ )
+ for( sal_uInt16 nPos=0; nPos<pImp->pCompletions->Count(); nPos++ )
{
#ifdef DBG_UTIL
String aTmp( *(*pImp->pCompletions)[ nPos ] );
@@ -1232,7 +1230,7 @@ String SvtURLBox::GetURL()
//-------------------------------------------------------------------------
void SvtURLBox::DisableHistory()
{
- bHistoryDisabled = TRUE;
+ bHistoryDisabled = sal_True;
UpdatePicklistForSmartProtocol_Impl();
}
@@ -1307,7 +1305,7 @@ sal_Bool SvtURLBox_Impl::TildeParsing(
return sal_False; // no such user
#else
pPasswd = getpwnam( OUStringToOString( OUString( aUserName ), RTL_TEXTENCODING_ASCII_US ).getStr() );
- if( pPasswd )
+ if( pPasswd )
aParseTilde = String::CreateFromAscii( pPasswd->pw_dir );
else
return sal_False; // no such user
diff --git a/svtools/source/control/makefile.mk b/svtools/source/control/makefile.mk
deleted file mode 100755
index b855501e1133..000000000000
--- a/svtools/source/control/makefile.mk
+++ /dev/null
@@ -1,87 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=ctrl
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SRS1NAME=$(TARGET)
-SRC1FILES=\
- ctrltool.src \
- ctrlbox.src \
- calendar.src \
- filectrl.src
-
-EXCEPTIONSFILES=\
- $(SLO)$/asynclink.obj \
- $(SLO)$/calendar.obj \
- $(SLO)$/ctrlbox.obj \
- $(SLO)$/ctrltool.obj \
- $(SLO)$/filectrl.obj \
- $(SLO)$/filectrl2.obj \
- $(SLO)$/fileurlbox.obj \
- $(SLO)$/fixedhyper.obj \
- $(SLO)$/fmtfield.obj \
- $(SLO)$/headbar.obj \
- $(SLO)$/hyperlabel.obj \
- $(SLO)$/inettbc.obj \
- $(SLO)$/prgsbar.obj \
- $(SLO)$/roadmap.obj \
- $(SLO)$/ruler.obj \
- $(SLO)$/scriptedtext.obj \
- $(SLO)$/scrwin.obj \
- $(SLO)$/stdctrl.obj \
- $(SLO)$/stdmenu.obj \
- $(SLO)$/svxbox.obj \
- $(SLO)$/tabbar.obj \
- $(SLO)$/taskbar.obj \
- $(SLO)$/taskbox.obj \
- $(SLO)$/taskmisc.obj \
- $(SLO)$/taskstat.obj \
- $(SLO)$/toolbarmenu.obj \
- $(SLO)$/toolbarmenuacc.obj \
- $(SLO)$/urlcontrol.obj \
- $(SLO)$/valueacc.obj \
- $(SLO)$/valueset.obj
-
-SLOFILES=\
- $(EXCEPTIONSFILES) \
- $(SLO)$/collatorres.obj \
- $(SLO)$/indexentryres.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svtools/source/control/prgsbar.cxx b/svtools/source/control/prgsbar.cxx
index 500a3a5c4227..b8df51152bbe 100644..100755
--- a/svtools/source/control/prgsbar.cxx
+++ b/svtools/source/control/prgsbar.cxx
@@ -33,7 +33,7 @@
#include <tools/debug.hxx>
#include <vcl/status.hxx>
-#include <prgsbar.hxx>
+#include <svtools/prgsbar.hxx>
// =======================================================================
@@ -45,9 +45,9 @@
void ProgressBar::ImplInit()
{
mnPercent = 0;
- mbCalcNew = TRUE;
+ mbCalcNew = sal_True;
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
}
static WinBits clearProgressBarBorder( Window* pParent, WinBits nOrgStyle )
@@ -86,8 +86,8 @@ ProgressBar::~ProgressBar()
// -----------------------------------------------------------------------
-void ProgressBar::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void ProgressBar::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -109,8 +109,8 @@ void ProgressBar::ImplInitSettings( BOOL bFont,
{
if( (GetStyle() & WB_BORDER) )
SetBorderStyle( WINDOW_BORDER_REMOVEBORDER );
- EnableChildTransparentMode( TRUE );
- SetPaintTransparent( TRUE );
+ EnableChildTransparentMode( sal_True );
+ SetPaintTransparent( sal_True );
SetBackground();
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
}
@@ -148,18 +148,18 @@ void ProgressBar::ImplInitSettings( BOOL bFont,
// -----------------------------------------------------------------------
-void ProgressBar::ImplDrawProgress( USHORT nOldPerc, USHORT nNewPerc )
+void ProgressBar::ImplDrawProgress( sal_uInt16 nOldPerc, sal_uInt16 nNewPerc )
{
if ( mbCalcNew )
{
- mbCalcNew = FALSE;
+ mbCalcNew = sal_False;
Size aSize = GetOutputSizePixel();
mnPrgsHeight = aSize.Height()-(PROGRESSBAR_WIN_OFFSET*2);
mnPrgsWidth = (mnPrgsHeight*2)/3;
maPos.Y() = PROGRESSBAR_WIN_OFFSET;
long nMaxWidth = (aSize.Width()-(PROGRESSBAR_WIN_OFFSET*2)+PROGRESSBAR_OFFSET);
- USHORT nMaxCount = (USHORT)(nMaxWidth / (mnPrgsWidth+PROGRESSBAR_OFFSET));
+ sal_uInt16 nMaxCount = (sal_uInt16)(nMaxWidth / (mnPrgsWidth+PROGRESSBAR_OFFSET));
if ( nMaxCount <= 1 )
nMaxCount = 1;
else
@@ -188,20 +188,20 @@ void ProgressBar::Paint( const Rectangle& )
void ProgressBar::Resize()
{
- mbCalcNew = TRUE;
+ mbCalcNew = sal_True;
if ( IsReallyVisible() )
Invalidate();
}
// -----------------------------------------------------------------------
-void ProgressBar::SetValue( USHORT nNewPercent )
+void ProgressBar::SetValue( sal_uInt16 nNewPercent )
{
DBG_ASSERTWARNING( nNewPercent <= 100, "StatusBar::SetProgressValue(): nPercent > 100" );
if ( nNewPercent < mnPercent )
{
- mbCalcNew = TRUE;
+ mbCalcNew = sal_True;
mnPercent = nNewPercent;
if ( IsReallyVisible() )
{
@@ -224,19 +224,19 @@ void ProgressBar::StateChanged( StateChangedType nType )
if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Invalidate();
}
else
*/
if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
@@ -250,7 +250,7 @@ void ProgressBar::DataChanged( const DataChangedEvent& rDCEvt )
if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE) )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
diff --git a/svtools/source/control/roadmap.cxx b/svtools/source/control/roadmap.cxx
index 90952d7c0ce4..14f8446e2ecb 100644..100755
--- a/svtools/source/control/roadmap.cxx
+++ b/svtools/source/control/roadmap.cxx
@@ -28,14 +28,13 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include <roadmap.hxx>
+#include <svtools/roadmap.hxx>
#ifndef _STRING_HXX
#define _STRING_HXX
#endif
#include <vector>
-
#include <algorithm>
#include <vcl/bitmap.hxx>
#include <tools/color.hxx>
@@ -123,9 +122,9 @@ namespace svt
void SetClickHdl( const Link& rLink );
const Link& GetClickHdl() const;
- void SetZOrder( RoadmapItem* pRefRoadmapHyperLabel, USHORT nFlags );
- void Enable( BOOL bEnable = TRUE);
- BOOL IsEnabled() const;
+ void SetZOrder( RoadmapItem* pRefRoadmapHyperLabel, sal_uInt16 nFlags );
+ void Enable( sal_Bool bEnable = sal_True);
+ sal_Bool IsEnabled() const;
void GrabFocus();
bool Contains( const Window* _pWindow ) const;
@@ -887,7 +886,7 @@ namespace svt
}
//---------------------------------------------------------------------
- void RoadmapItem::SetZOrder( RoadmapItem* pRefRoadmapHyperLabel, USHORT nFlags )
+ void RoadmapItem::SetZOrder( RoadmapItem* pRefRoadmapHyperLabel, sal_uInt16 nFlags )
{
if (pRefRoadmapHyperLabel == NULL)
mpDescription->SetZOrder( NULL, nFlags); //WINDOW_ZORDER_FIRST );
@@ -896,14 +895,14 @@ namespace svt
}
//---------------------------------------------------------------------
- void RoadmapItem::Enable( BOOL _bEnable)
+ void RoadmapItem::Enable( sal_Bool _bEnable)
{
mpID->Enable(_bEnable);
mpDescription->Enable(_bEnable);
}
//---------------------------------------------------------------------
- BOOL RoadmapItem::IsEnabled() const
+ sal_Bool RoadmapItem::IsEnabled() const
{
return mpID->IsEnabled();
}
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 73e59373ea19..51e4fed41eb1 100644..100755
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -33,11 +33,10 @@
#include <tools/debug.hxx>
#include <vcl/svapp.hxx>
#include <tools/poly.hxx>
-
#include <vcl/i18nhelp.hxx>
#define _SV_RULER_CXX
-#include <ruler.hxx>
+#include <svtools/ruler.hxx>
// =======================================================================
@@ -107,15 +106,15 @@ private:
long nNullOff;
long nMargin1;
long nMargin2;
- USHORT nLines;
- USHORT nArrows;
- USHORT nBorders;
- USHORT nIndents;
- USHORT nTabs;
- USHORT nMargin1Style;
- USHORT nMargin2Style;
- BOOL bAutoPageWidth;
- BOOL bTextRTL;
+ sal_uInt16 nLines;
+ sal_uInt16 nArrows;
+ sal_uInt16 nBorders;
+ sal_uInt16 nIndents;
+ sal_uInt16 nTabs;
+ sal_uInt16 nMargin1Style;
+ sal_uInt16 nMargin2Style;
+ sal_Bool bAutoPageWidth;
+ sal_Bool bTextRTL;
#ifdef _SV_RULER_CXX
public:
@@ -134,7 +133,7 @@ struct ImplRulerUnitData
long nTick2; // Tick fuer halbe Werte
long nTick3; // Tick fuer Zahlenausgabe
long n100THMM; // Teiler fuer Einheit
- USHORT nUnitDigits; // Anzahl Nachkommastellen
+ sal_uInt16 nUnitDigits; // Anzahl Nachkommastellen
sal_Char aUnitStr[8]; // Einheiten-String
};
@@ -159,13 +158,13 @@ struct ImplRulerHitTest
{
long nPos;
RulerType eType;
- USHORT nAryPos;
- USHORT mnDragSize;
- BOOL bSize;
- BOOL bSizeBar;
- BOOL bExpandTest;
+ sal_uInt16 nAryPos;
+ sal_uInt16 mnDragSize;
+ sal_Bool bSize;
+ sal_Bool bSizeBar;
+ sal_Bool bExpandTest;
ImplRulerHitTest() :
- bExpandTest( FALSE ) {}
+ bExpandTest( sal_False ) {}
};
// =======================================================================
@@ -175,7 +174,7 @@ ImplRulerData::ImplRulerData()
memset( this, 0, sizeof( ImplRulerData ) );
// PageBreite == EditWinBreite
- bAutoPageWidth = TRUE;
+ bAutoPageWidth = sal_True;
}
// -----------------------------------------------------------------------
@@ -250,7 +249,7 @@ void Ruler::ImplInit( WinBits nWinBits )
// --- RTL --- no UI mirroring for horizontal rulers, because
// the document is also not mirrored
- EnableRTL( FALSE );
+ EnableRTL( sal_False );
}
// Variablen initialisieren
@@ -274,13 +273,13 @@ void Ruler::ImplInit( WinBits nWinBits )
mnExtraModifier = 0; // Modifier-Tasten beim Click im Extrafeld
mnCharWidth = 371;
mnLineHeight = 551;
- mbCalc = TRUE; // Muessen Pagebreiten neu berechnet werden
- mbFormat = TRUE; // Muss neu ausgegeben werden
- mbDrag = FALSE; // Sind wir im Drag-Modus
- mbDragDelete = FALSE; // Wird Maus beim Draggen unten rausgezogen
- mbDragCanceled = FALSE; // Wurde Dragging abgebrochen
- mbAutoWinWidth = TRUE; // EditWinBreite == RulerBreite
- mbActive = TRUE; // Ist Lineal aktiv
+ mbCalc = sal_True; // Muessen Pagebreiten neu berechnet werden
+ mbFormat = sal_True; // Muss neu ausgegeben werden
+ mbDrag = sal_False; // Sind wir im Drag-Modus
+ mbDragDelete = sal_False; // Wird Maus beim Draggen unten rausgezogen
+ mbDragCanceled = sal_False; // Wurde Dragging abgebrochen
+ mbAutoWinWidth = sal_True; // EditWinBreite == RulerBreite
+ mbActive = sal_True; // Ist Lineal aktiv
mnUpdateFlags = 0; // Was soll im Update-Handler upgedatet werden
mpData = mpSaveData; // Wir zeigen auf die normalen Daten
meExtraType = RULER_EXTRA_DONTKNOW; // Was im ExtraFeld dargestellt wird
@@ -304,7 +303,7 @@ void Ruler::ImplInit( WinBits nWinBits )
mnBorderWidth = 0;
// Einstellungen setzen
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
// Default-Groesse setzen
long nDefHeight = GetTextHeight() + RULER_OFF*2 + RULER_TEXTOFF*2 + mnBorderWidth;
@@ -314,6 +313,7 @@ void Ruler::ImplInit( WinBits nWinBits )
else
aDefSize.Width() = nDefHeight;
SetOutputSizePixel( aDefSize );
+ SetType(WINDOW_RULER);
}
// -----------------------------------------------------------------------
@@ -402,7 +402,7 @@ void Ruler::ImplVDrawText( long nX, long nY, const String& rText )
// -----------------------------------------------------------------------
-void Ruler::ImplInvertLines( BOOL bErase )
+void Ruler::ImplInvertLines( sal_Bool bErase )
{
// Positionslinien
if ( mpData->nLines && mbActive && !mbDrag && !mbFormat &&
@@ -422,7 +422,7 @@ void Ruler::ImplInvertLines( BOOL bErase )
aRect.Right() = nY;
// Linien ausgeben
- for ( USHORT i = 0; i < mpData->nLines; i++ )
+ for ( sal_uInt16 i = 0; i < mpData->nLines; i++ )
{
n = mpData->pLines[i].nPos+nNullWinOff;
if ( (n >= nRulX1) && (n < nRulX2) )
@@ -474,7 +474,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
long nTickWidth;
long nX;
long nY;
- BOOL bNoTicks = FALSE;
+ sal_Bool bNoTicks = sal_False;
//Amelia
long nTickUnit = 0;
@@ -500,7 +500,8 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
aPixSize = maVirDev.LogicToPixel( Size( nTick3, nTick3 ), maMapMode );
// Groessenvorberechnung
- BOOL bVertRight = FALSE;
+ // Sizes calculation
+ sal_Bool bVertRight = sal_False;
if ( mnWinStyle & WB_HORZ )
nTickWidth = aPixSize.Width();
else
@@ -509,7 +510,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
if ( mnWinStyle & WB_RIGHT_ALIGNED )
{
aFont.SetOrientation( 2700 );
- bVertRight = TRUE;
+ bVertRight = sal_True;
}
else
aFont.SetOrientation( 900 );
@@ -518,7 +519,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
}
long nMaxWidth = maVirDev.PixelToLogic( Size( mpData->nPageWidth, 0 ), maMapMode ).Width();
if ( nMaxWidth < 0 )
- nMaxWidth *= -1;
+ nMaxWidth = -nMaxWidth;
// Amelia
if (( mnUnitIndex == RULER_UNIT_CHAR ) || ( mnUnitIndex == RULER_UNIT_LINE ))
nMaxWidth /= nTickUnit;
@@ -535,7 +536,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
while ( nTickWidth < nTxtWidth+nTextOff )
{
long nOldMulti = nMulti;
- if ( !nTickWidth )
+ if ( !nTickWidth ) //If nTickWidth equals 0
nMulti *= 10;
else if ( nMulti < 10 )
nMulti++;
@@ -550,7 +551,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
// koennen
if ( nMulti < nOldMulti )
{
- bNoTicks = TRUE;
+ bNoTicks = sal_True;
break;
}
@@ -657,7 +658,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
}
}
// #i49017# with some zoom factors the value nTick can overflow
- if( ((ULONG)nTick + (ULONG)nTickCount) > (ULONG)LONG_MAX)
+ if( ((sal_uLong)nTick + (sal_uLong)nTickCount) > (sal_uLong)LONG_MAX)
break;
nTick += nTickCount;
}
@@ -668,7 +669,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
void Ruler::ImplDrawArrows( long nCenter )
{
- USHORT i;
+ sal_uInt16 i;
long n1;
long n2;
long n3;
@@ -676,7 +677,7 @@ void Ruler::ImplDrawArrows( long nCenter )
long nLogWidth;
String aStr;
String aStr2;
- BOOL bDrawUnit;
+ sal_Bool bDrawUnit;
long nTxtWidth;
long nTxtHeight2 = GetTextHeight()/2;
@@ -701,14 +702,14 @@ void Ruler::ImplDrawArrows( long nCenter )
nLogWidth = (nLogWidth / aImplRulerUnitTab[mnUnitIndex].n100THMM) * 1000;
else
nLogWidth = (nLogWidth*1000) / aImplRulerUnitTab[mnUnitIndex].n100THMM;
- aStr = rI18nHelper.GetNum( nLogWidth, aImplRulerUnitTab[mnUnitIndex].nUnitDigits, TRUE, FALSE );
+ aStr = rI18nHelper.GetNum( nLogWidth, aImplRulerUnitTab[mnUnitIndex].nUnitDigits, sal_True, sal_False );
// Einheit an den String haengen
aStr2 = aStr;
aStr2.AppendAscii( aImplRulerUnitTab[mnUnitIndex].aUnitStr );
// Textbreite ermitteln
- bDrawUnit = TRUE;
+ bDrawUnit = sal_True;
nTxtWidth = GetTextWidth( aStr2 );
if ( nTxtWidth < mpData->pArrows[i].nWidth-10 )
aStr = aStr2;
@@ -716,7 +717,7 @@ void Ruler::ImplDrawArrows( long nCenter )
{
nTxtWidth = GetTextWidth( aStr );
if ( nTxtWidth > mpData->pArrows[i].nWidth-10 )
- bDrawUnit = FALSE;
+ bDrawUnit = sal_False;
}
// Ist genuegen Platz fuer Einheiten-String vorhanden
@@ -760,7 +761,7 @@ void Ruler::ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom
long n2;
long nTemp1;
long nTemp2;
- USHORT i;
+ sal_uInt16 i;
for ( i = 0; i < mpData->nBorders; i++ )
{
@@ -878,12 +879,12 @@ void Ruler::ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom
// -----------------------------------------------------------------------
-void Ruler::ImplDrawIndent( const Polygon& rPoly, USHORT nStyle )
+void Ruler::ImplDrawIndent( const Polygon& rPoly, sal_uInt16 nStyle )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
Point aPos1;
Point aPos2;
- USHORT nIndentStyle = nStyle & RULER_INDENT_STYLE;
+ sal_uInt16 nIndentStyle = nStyle & RULER_INDENT_STYLE;
if ( nStyle & RULER_STYLE_INVISIBLE )
return;
@@ -967,7 +968,7 @@ void Ruler::ImplDrawIndent( const Polygon& rPoly, USHORT nStyle )
void Ruler::ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom )
{
- USHORT j;
+ sal_uInt16 j;
long n;
long nIndentHeight = (mnVirHeight/2) - 1;
long nIndentWidth2 = nIndentHeight-3;
@@ -978,8 +979,8 @@ void Ruler::ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom
if ( mpData->pIndents[j].nStyle & RULER_STYLE_INVISIBLE )
continue;
- USHORT nStyle = mpData->pIndents[j].nStyle;
- USHORT nIndentStyle = nStyle & RULER_INDENT_STYLE;
+ sal_uInt16 nStyle = mpData->pIndents[j].nStyle;
+ sal_uInt16 nIndentStyle = nStyle & RULER_INDENT_STYLE;
n = mpData->pIndents[j].nPos+mpData->nNullVirOff;
@@ -1011,7 +1012,7 @@ void Ruler::ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom
if(0 == (mnWinStyle & WB_HORZ))
{
Point aTmp;
- for(USHORT i = 0; i < 5; i++)
+ for(sal_uInt16 i = 0; i < 5; i++)
{
aTmp = aPoly[i];
Point aSet(nVirBottom - aTmp.Y(), aTmp.X());
@@ -1026,9 +1027,9 @@ void Ruler::ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom
// -----------------------------------------------------------------------
-static void ImplCenterTabPos( Point& rPos, USHORT nTabStyle )
+static void ImplCenterTabPos( Point& rPos, sal_uInt16 nTabStyle )
{
- BOOL bRTL = 0 != (nTabStyle & RULER_TAB_RTL);
+ sal_Bool bRTL = 0 != (nTabStyle & RULER_TAB_RTL);
nTabStyle &= RULER_TAB_STYLE;
rPos.Y() += RULER_TAB_HEIGHT/2;
if ( (!bRTL && nTabStyle == RULER_TAB_LEFT) ||( bRTL && nTabStyle == RULER_TAB_RIGHT))
@@ -1038,7 +1039,7 @@ static void ImplCenterTabPos( Point& rPos, USHORT nTabStyle )
}
// -----------------------------------------------------------------------
-void lcl_RotateRect_Impl(Rectangle& rRect, const long nReference, BOOL bRightAligned)
+void lcl_RotateRect_Impl(Rectangle& rRect, const long nReference, sal_Bool bRightAligned)
{
if(!rRect.IsEmpty())
{
@@ -1058,13 +1059,13 @@ void lcl_RotateRect_Impl(Rectangle& rRect, const long nReference, BOOL bRightAli
// -----------------------------------------------------------------------
static void ImplDrawRulerTab( OutputDevice* pDevice,
- const Point& rPos, USHORT nStyle, WinBits nWinBits )
+ const Point& rPos, sal_uInt16 nStyle, WinBits nWinBits )
{
if ( nStyle & RULER_STYLE_INVISIBLE )
return;
- USHORT nTabStyle = nStyle & RULER_TAB_STYLE;
- BOOL bRTL = 0 != (nStyle & RULER_TAB_RTL);
+ sal_uInt16 nTabStyle = nStyle & RULER_TAB_STYLE;
+ sal_Bool bRTL = 0 != (nStyle & RULER_TAB_RTL);
Rectangle aRect1, aRect2, aRect3;
aRect3.SetEmpty();
if ( nTabStyle == RULER_TAB_DEFAULT )
@@ -1122,7 +1123,7 @@ static void ImplDrawRulerTab( OutputDevice* pDevice,
}
if( 0 == (nWinBits&WB_HORZ) )
{
- BOOL bRightAligned = 0 != (nWinBits&WB_RIGHT_ALIGNED);
+ sal_Bool bRightAligned = 0 != (nWinBits&WB_RIGHT_ALIGNED);
lcl_RotateRect_Impl(aRect1, rPos.Y(), bRightAligned);
lcl_RotateRect_Impl(aRect2, rPos.Y(), bRightAligned);
lcl_RotateRect_Impl(aRect3, rPos.Y(), bRightAligned);
@@ -1136,7 +1137,7 @@ static void ImplDrawRulerTab( OutputDevice* pDevice,
// -----------------------------------------------------------------------
-void Ruler::ImplDrawTab( OutputDevice* pDevice, const Point& rPos, USHORT nStyle )
+void Ruler::ImplDrawTab( OutputDevice* pDevice, const Point& rPos, sal_uInt16 nStyle )
{
if ( nStyle & RULER_STYLE_INVISIBLE )
return;
@@ -1156,7 +1157,7 @@ void Ruler::ImplDrawTab( OutputDevice* pDevice, const Point& rPos, USHORT nStyle
void Ruler::ImplDrawTabs( long nMin, long nMax, long nVirTop, long nVirBottom )
{
- for ( USHORT i = 0; i < mpData->nTabs; i++ )
+ for ( sal_uInt16 i = 0; i < mpData->nTabs; i++ )
{
if ( mpData->pTabs[i].nStyle & RULER_STYLE_INVISIBLE )
continue;
@@ -1172,8 +1173,8 @@ void Ruler::ImplDrawTabs( long nMin, long nMax, long nVirTop, long nVirBottom )
// -----------------------------------------------------------------------
-void Ruler::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void Ruler::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -1262,7 +1263,7 @@ void Ruler::ImplCalc()
mpData->nRulWidth = mnHeight-nRulWinOff;
}
- mbCalc = FALSE;
+ mbCalc = sal_False;
}
// -----------------------------------------------------------------------
@@ -1302,7 +1303,7 @@ void Ruler::ImplFormat()
return;
Size aVirDevSize;
- BOOL b3DLook = !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO);
+ sal_Bool b3DLook = !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO);
// initialize VirtualDevice
if ( mnWinStyle & WB_HORZ )
@@ -1316,7 +1317,7 @@ void Ruler::ImplFormat()
aVirDevSize.Width() = mnVirHeight;
}
if ( aVirDevSize != maVirDev.GetOutputSizePixel() )
- maVirDev.SetOutputSizePixel( aVirDevSize, TRUE );
+ maVirDev.SetOutputSizePixel( aVirDevSize, sal_True );
else
maVirDev.Erase();
@@ -1456,12 +1457,12 @@ void Ruler::ImplFormat()
ImplDrawArrows( nVirTop+((nVirBottom-nVirTop)/2) );
// Wir haben formatiert
- mbFormat = FALSE;
+ mbFormat = sal_False;
}
// -----------------------------------------------------------------------
-void Ruler::ImplInitExtraField( BOOL bUpdate )
+void Ruler::ImplInitExtraField( sal_Bool bUpdate )
{
// Extra-Field beruecksichtigen
if ( mnWinStyle & WB_EXTRAFIELD )
@@ -1491,8 +1492,8 @@ void Ruler::ImplInitExtraField( BOOL bUpdate )
if ( bUpdate )
{
- mbCalc = TRUE;
- mbFormat = TRUE;
+ mbCalc = sal_True;
+ mbFormat = sal_True;
Invalidate();
}
}
@@ -1530,17 +1531,17 @@ void Ruler::ImplDraw()
DrawOutDev( aOffPos, aVirDevSize, Point(), aVirDevSize, maVirDev );
// Positionslinien neu malen
- ImplInvertLines( TRUE );
+ ImplInvertLines( sal_True );
}
}
// -----------------------------------------------------------------------
-void Ruler::ImplDrawExtra( BOOL bPaint )
+void Ruler::ImplDrawExtra( sal_Bool bPaint )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
Rectangle aRect = maExtraRect;
- BOOL bEraseRect = FALSE;
+ sal_Bool bEraseRect = sal_False;
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
{
@@ -1563,14 +1564,14 @@ void Ruler::ImplDrawExtra( BOOL bPaint )
SetFillColor( rStyleSettings.GetFaceColor() );
else
SetFillColor( rStyleSettings.GetWindowColor() );
- bEraseRect = TRUE;
+ bEraseRect = sal_True;
}
else
{
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) && (mnExtraStyle & RULER_STYLE_HIGHLIGHT) )
{
SetFillColor( rStyleSettings.GetCheckedColor() );
- bEraseRect = TRUE;
+ bEraseRect = sal_True;
}
}
@@ -1594,7 +1595,7 @@ void Ruler::ImplDrawExtra( BOOL bPaint )
}
else if ( meExtraType == RULER_EXTRA_TAB )
{
- USHORT nTabStyle = mnExtraStyle & RULER_TAB_STYLE;
+ sal_uInt16 nTabStyle = mnExtraStyle & RULER_TAB_STYLE;
if(mpData->bTextRTL)
nTabStyle |= RULER_TAB_RTL;
Point aCenter = aRect.Center();
@@ -1621,7 +1622,7 @@ void Ruler::ImplDrawExtra( BOOL bPaint )
// -----------------------------------------------------------------------
-void Ruler::ImplUpdate( BOOL bMustCalc )
+void Ruler::ImplUpdate( sal_Bool bMustCalc )
{
// Hier schon Linien loeschen, damit Sie vor dem Neuberechnen schon
// geloscht sind, da danach die alten Positionen nicht mehr bestimmt
@@ -1631,8 +1632,8 @@ void Ruler::ImplUpdate( BOOL bMustCalc )
// Flags setzen
if ( bMustCalc )
- mbCalc = TRUE;
- mbFormat = TRUE;
+ mbCalc = sal_True;
+ mbFormat = sal_True;
// Wenn wir am Draggen sind, wird nach dem Drag-Handler automatisch
// das Lineal neu upgedatet
@@ -1650,11 +1651,11 @@ void Ruler::ImplUpdate( BOOL bMustCalc )
// -----------------------------------------------------------------------
-BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
- BOOL bRequireStyle, USHORT nRequiredStyle ) const
+sal_Bool Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
+ sal_Bool bRequireStyle, sal_uInt16 nRequiredStyle ) const
{
- USHORT i;
- USHORT nStyle;
+ sal_uInt16 i;
+ sal_uInt16 nStyle;
long nHitBottom;
long nX;
long nY;
@@ -1662,10 +1663,10 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
long n2;
if ( !mbActive )
- return FALSE;
+ return sal_False;
// Position ermitteln
- BOOL bIsHori = 0 != (mnWinStyle & WB_HORZ);
+ sal_Bool bIsHori = 0 != (mnWinStyle & WB_HORZ);
if ( bIsHori )
{
nX = rPos.X();
@@ -1681,8 +1682,8 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
// --> FME 2004-08-05 #i32608#
pHitTest->nAryPos = 0;
pHitTest->mnDragSize = 0;
- pHitTest->bSize = FALSE;
- pHitTest->bSizeBar = FALSE;
+ pHitTest->bSize = sal_False;
+ pHitTest->bSizeBar = sal_False;
// <--
// Damit ueberstehende Tabs und Einzuege mit beruecksichtigt werden
@@ -1700,7 +1701,7 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
{
pHitTest->nPos = 0;
pHitTest->eType = RULER_TYPE_OUTSIDE;
- return FALSE;
+ return sal_False;
}
nX -= mpData->nNullVirOff;
@@ -1746,7 +1747,7 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
{
pHitTest->eType = RULER_TYPE_TAB;
pHitTest->nAryPos = i-1;
- return TRUE;
+ return sal_True;
}
}
}
@@ -1787,7 +1788,7 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
{
pHitTest->eType = RULER_TYPE_INDENT;
pHitTest->nAryPos = i-1;
- return TRUE;
+ return sal_True;
}
}
}
@@ -1798,7 +1799,7 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
{
pHitTest->nPos = 0;
pHitTest->eType = RULER_TYPE_OUTSIDE;
- return FALSE;
+ return sal_False;
}
// Danach die Spalten testen
@@ -1833,7 +1834,7 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
{
if ( nStyle & RULER_BORDER_MOVEABLE )
{
- pHitTest->bSizeBar = TRUE;
+ pHitTest->bSizeBar = sal_True;
pHitTest->mnDragSize = RULER_DRAGSIZE_MOVE;
}
}
@@ -1853,25 +1854,25 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
if ( nX <= n1+nMOff )
{
- pHitTest->bSize = TRUE;
+ pHitTest->bSize = sal_True;
pHitTest->mnDragSize = RULER_DRAGSIZE_1;
}
else if ( nX >= n2-nMOff )
{
- pHitTest->bSize = TRUE;
+ pHitTest->bSize = sal_True;
pHitTest->mnDragSize = RULER_DRAGSIZE_2;
}
else
{
if ( nStyle & RULER_BORDER_MOVEABLE )
{
- pHitTest->bSizeBar = TRUE;
+ pHitTest->bSizeBar = sal_True;
pHitTest->mnDragSize = RULER_DRAGSIZE_MOVE;
}
}
}
- return TRUE;
+ return sal_True;
}
}
}
@@ -1885,8 +1886,8 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
if ( (nX >= n1 - nMarginTolerance) && (nX <= n1 + nMarginTolerance) )
{
pHitTest->eType = RULER_TYPE_MARGIN1;
- pHitTest->bSize = TRUE;
- return TRUE;
+ pHitTest->bSize = sal_True;
+ return sal_True;
}
}
if ( (mpData->nMargin2Style & (RULER_MARGIN_SIZEABLE | RULER_STYLE_INVISIBLE)) == RULER_MARGIN_SIZEABLE )
@@ -1895,8 +1896,8 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
if ( (nX >= n1 - nMarginTolerance) && (nX <= n1 + nMarginTolerance) )
{
pHitTest->eType = RULER_TYPE_MARGIN2;
- pHitTest->bSize = TRUE;
- return TRUE;
+ pHitTest->bSize = sal_True;
+ return sal_True;
}
}
@@ -1941,28 +1942,28 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
{
pHitTest->eType = RULER_TYPE_TAB;
pHitTest->nAryPos = i-1;
- return TRUE;
+ return sal_True;
}
}
}
}
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType,
+sal_Bool Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType,
ImplRulerHitTest* pHitTest ) const
{
Point aPos = rPos;
- BOOL bRequiredStyle = FALSE;
- USHORT nRequiredStyle = 0;
+ sal_Bool bRequiredStyle = sal_False;
+ sal_uInt16 nRequiredStyle = 0;
if (eDragType == RULER_TYPE_INDENT)
{
- bRequiredStyle = TRUE;
+ bRequiredStyle = sal_True;
nRequiredStyle = RULER_INDENT_BOTTOM;
}
@@ -1982,7 +1983,7 @@ BOOL Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType,
if ( ImplHitTest( aPos, pHitTest, bRequiredStyle, nRequiredStyle ) )
{
if ( (pHitTest->eType == eDragType) || (eDragType == RULER_TYPE_DONTKNOW) )
- return TRUE;
+ return sal_True;
}
}
@@ -1998,7 +1999,7 @@ BOOL Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType,
if ( ImplHitTest( aPos, pHitTest, bRequiredStyle, nRequiredStyle ) )
{
if ( (pHitTest->eType == eDragType) || (eDragType == RULER_TYPE_DONTKNOW) )
- return TRUE;
+ return sal_True;
}
}
@@ -2014,25 +2015,25 @@ BOOL Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType,
if ( ImplHitTest( aPos, pHitTest ) )
{
if ( (pHitTest->eType == eDragType) || (eDragType == RULER_TYPE_DONTKNOW) )
- return TRUE;
+ return sal_True;
}
}
// Auf DontKnow setzen
pHitTest->eType = RULER_TYPE_DONTKNOW;
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Ruler::ImplStartDrag( ImplRulerHitTest* pHitTest, USHORT nModifier )
+sal_Bool Ruler::ImplStartDrag( ImplRulerHitTest* pHitTest, sal_uInt16 nModifier )
{
// Wenn eine Spalte angeklick wurde, die weder verschiebar noch
// in der Groesse aenderbar ist, brauchen wir auch kein Drag ausloesen
if ( (pHitTest->eType == RULER_TYPE_BORDER) &&
!pHitTest->bSize && !pHitTest->bSizeBar )
- return FALSE;
+ return sal_False;
// Dragdaten setzen
meDragType = pHitTest->eType;
@@ -2049,10 +2050,10 @@ BOOL Ruler::ImplStartDrag( ImplRulerHitTest* pHitTest, USHORT nModifier )
// Wenn der Handler das Draggen erlaubt, dann das Draggen
// initialisieren
ImplInvertLines();
- mbDrag = TRUE;
+ mbDrag = sal_True;
mnStartDragPos = mnDragPos;
StartTracking();
- return TRUE;
+ return sal_True;
}
else
{
@@ -2065,7 +2066,7 @@ BOOL Ruler::ImplStartDrag( ImplRulerHitTest* pHitTest, USHORT nModifier )
mpData = mpSaveData;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -2104,18 +2105,18 @@ void Ruler::ImplDrag( const Point& rPos )
nX -= mpData->nNullVirOff;
// Wenn oberhalb oder links vom Lineal, dann alte Werte
- mbDragDelete = FALSE;
+ mbDragDelete = sal_False;
if ( nY < 0 )
{
if ( !mbDragCanceled )
{
// Daten wiederherstellen
- mbDragCanceled = TRUE;
+ mbDragCanceled = sal_True;
ImplRulerData aTempData;
aTempData = *mpDragData;
*mpDragData = *mpSaveData;
- mbCalc = TRUE;
- mbFormat = TRUE;
+ mbCalc = sal_True;
+ mbFormat = sal_True;
// Handler rufen
mnDragPos = mnStartDragPos;
@@ -2136,11 +2137,11 @@ void Ruler::ImplDrag( const Point& rPos )
}
else
{
- mbDragCanceled = FALSE;
+ mbDragCanceled = sal_False;
// +2, damit nicht so schnell die Tabs geloescht werden
if ( nY > nOutHeight+2 )
- mbDragDelete = TRUE;
+ mbDragDelete = sal_True;
mnDragPos = nX;
@@ -2165,7 +2166,7 @@ void Ruler::ImplEndDrag()
else
*mpSaveData = *mpDragData;
mpData = mpSaveData;
- mbDrag = FALSE;
+ mbDrag = sal_False;
// Handler rufen
EndDrag();
@@ -2175,8 +2176,8 @@ void Ruler::ImplEndDrag()
mnDragPos = 0;
mnDragAryPos = 0;
mnDragSize = 0;
- mbDragCanceled = FALSE;
- mbDragDelete = FALSE;
+ mbDragCanceled = sal_False;
+ mbDragDelete = sal_False;
mnDragModifier = 0;
mnDragScroll = 0;
mnStartDragPos = 0;
@@ -2213,8 +2214,8 @@ void Ruler::MouseButtonDown( const MouseEvent& rMEvt )
if ( rMEvt.IsLeft() && !IsTracking() )
{
Point aMousePos = rMEvt.GetPosPixel();
- USHORT nMouseClicks = rMEvt.GetClicks();
- USHORT nMouseModifier = rMEvt.GetModifier();
+ sal_uInt16 nMouseClicks = rMEvt.GetClicks();
+ sal_uInt16 nMouseModifier = rMEvt.GetModifier();
// Gegebenenfalls Lineal updaten (damit mit den richtigen Daten
// gearbeitet wird und die Anzeige auch zur Bearbeitung passt)
@@ -2320,8 +2321,8 @@ void Ruler::Tracking( const TrackingEvent& rTEvt )
// Bei Abbruch, den alten Status wieder herstellen
if ( rTEvt.IsTrackingCanceled() )
{
- mbDragCanceled = TRUE;
- mbFormat = TRUE;
+ mbDragCanceled = sal_True;
+ mbFormat = sal_True;
}
ImplEndDrag();
@@ -2370,7 +2371,7 @@ void Ruler::Paint( const Rectangle& )
}
// Imhalt vom Extrafeld ausgeben
- ImplDrawExtra( TRUE );
+ ImplDrawExtra( sal_True );
}
if ( mnWinStyle & WB_BORDER )
@@ -2435,7 +2436,7 @@ void Ruler::Resize()
}
// Hier schon Linien loeschen
- BOOL bVisible = IsReallyVisible();
+ sal_Bool bVisible = IsReallyVisible();
if ( bVisible && mpData->nLines )
{
ImplInvertLines();
@@ -2443,7 +2444,7 @@ void Ruler::Resize()
if ( !mnUpdateEvtId )
mnUpdateEvtId = Application::PostUserEvent( LINK( this, Ruler, ImplUpdateHdl ), NULL );
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
// Wenn sich die Hoehe bzw. Breite aendert, dann muessen besimmte Werte
// neu berechnet werden
@@ -2451,15 +2452,15 @@ void Ruler::Resize()
ImplInitExtraField( mpData->bTextRTL );
if ( nNewHeight )
{
- mbCalc = TRUE;
+ mbCalc = sal_True;
mnVirHeight = nNewHeight - mnBorderWidth - (RULER_OFF*2);
}
else
{
if ( mpData->bAutoPageWidth )
- ImplUpdate( TRUE );
+ ImplUpdate( sal_True );
else if ( mbAutoWinWidth )
- mbCalc = TRUE;
+ mbCalc = sal_True;
}
// Wenn Ruler eine Groesse hat, dann Groesse vom VirtualDevice setzen
@@ -2533,17 +2534,17 @@ void Ruler::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
}
@@ -2560,8 +2561,8 @@ void Ruler::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- mbFormat = TRUE;
- ImplInitSettings( TRUE, TRUE, TRUE );
+ mbFormat = sal_True;
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
}
@@ -2573,7 +2574,7 @@ long Ruler::StartDrag()
if ( maStartDragHdl.IsSet() )
return maStartDragHdl.Call( this );
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -2615,9 +2616,9 @@ void Ruler::ExtraDown()
void Ruler::Activate()
{
- mbActive = TRUE;
+ mbActive = sal_True;
- // Positionslinien wieder anzeigen (erst hinter mbActive=TRUE rufen, da
+ // Positionslinien wieder anzeigen (erst hinter mbActive=sal_True rufen, da
// von ImplInvertLines() ausgewertet wird). Das Zeichnen der Linien
// wird verzoegert, damit im vermutlich noch nicht gepainteten Zustand
// Linien gezeichnet werden.
@@ -2630,25 +2631,25 @@ void Ruler::Activate()
void Ruler::Deactivate()
{
- // Positionslinien loeschen (schon vor mbActive=FALSE rufen, da
+ // Positionslinien loeschen (schon vor mbActive=sal_False rufen, da
// von ImplInvertLines() ausgewertet wird)
ImplInvertLines();
- mbActive = FALSE;
+ mbActive = sal_False;
}
// -----------------------------------------------------------------------
-BOOL Ruler::StartDocDrag( const MouseEvent& rMEvt, RulerType eDragType )
+sal_Bool Ruler::StartDocDrag( const MouseEvent& rMEvt, RulerType eDragType )
{
if ( !mbDrag )
{
Point aMousePos = rMEvt.GetPosPixel();
- USHORT nMouseClicks = rMEvt.GetClicks();
- USHORT nMouseModifier = rMEvt.GetModifier();
+ sal_uInt16 nMouseClicks = rMEvt.GetClicks();
+ sal_uInt16 nMouseModifier = rMEvt.GetModifier();
ImplRulerHitTest aHitTest;
if(eDragType != RULER_TYPE_DONTKNOW)
- aHitTest.bExpandTest = TRUE;
+ aHitTest.bExpandTest = sal_True;
// Gegebenenfalls Lineal updaten (damit mit den richtigen Daten
// gearbeitet wird und die Anzeige auch zur Bearbeitung passt)
@@ -2697,17 +2698,17 @@ BOOL Ruler::StartDocDrag( const MouseEvent& rMEvt, RulerType eDragType )
mnDragPos = 0;
mnDragAryPos = 0;
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
RulerType Ruler::GetDocType( const Point& rPos, RulerType eDragType,
- USHORT* pAryPos ) const
+ sal_uInt16* pAryPos ) const
{
ImplRulerHitTest aHitTest;
@@ -2741,7 +2742,7 @@ void Ruler::CancelDrag()
// -----------------------------------------------------------------------
-RulerType Ruler::GetType( const Point& rPos, USHORT* pAryPos ) const
+RulerType Ruler::GetType( const Point& rPos, sal_uInt16* pAryPos ) const
{
ImplRulerHitTest aHitTest;
@@ -2768,14 +2769,14 @@ void Ruler::SetWinPos( long nNewOff, long nNewWidth )
{
// Gegebenenfalls werden die Breiten automatisch berechnet
if ( !nNewWidth )
- mbAutoWinWidth = TRUE;
+ mbAutoWinWidth = sal_True;
else
- mbAutoWinWidth = FALSE;
+ mbAutoWinWidth = sal_False;
// Werte setzen (werden in ImplFormat gegebenenfalls mitberechnet)
mnWinOff = nNewOff;
mnWinWidth = nNewWidth;
- ImplUpdate( TRUE );
+ ImplUpdate( sal_True );
}
// -----------------------------------------------------------------------
@@ -2788,14 +2789,14 @@ void Ruler::SetPagePos( long nNewOff, long nNewWidth )
// Gegebenenfalls werden die Breiten automatisch berechnet
if ( !nNewWidth )
- mpData->bAutoPageWidth = TRUE;
+ mpData->bAutoPageWidth = sal_True;
else
- mpData->bAutoPageWidth = FALSE;
+ mpData->bAutoPageWidth = sal_False;
// Werte setzen (werden in ImplFormat gegebenenfalls mitberechnet)
mpData->nPageOff = nNewOff;
mpData->nPageWidth = nNewWidth;
- ImplUpdate( TRUE );
+ ImplUpdate( sal_True );
}
// -----------------------------------------------------------------------
@@ -2885,14 +2886,14 @@ void Ruler::SetZoom( const Fraction& rNewZoom )
// -----------------------------------------------------------------------
-void Ruler::SetExtraType( RulerExtra eNewExtraType, USHORT nStyle )
+void Ruler::SetExtraType( RulerExtra eNewExtraType, sal_uInt16 nStyle )
{
if ( mnWinStyle & WB_EXTRAFIELD )
{
meExtraType = eNewExtraType;
mnExtraStyle = nStyle;
if ( IsReallyVisible() && IsUpdateMode() )
- ImplDrawExtra( FALSE );
+ ImplDrawExtra( sal_False );
}
}
@@ -2909,7 +2910,7 @@ void Ruler::SetNullOffset( long nPos )
// -----------------------------------------------------------------------
-void Ruler::SetMargin1( long nPos, USHORT nMarginStyle )
+void Ruler::SetMargin1( long nPos, sal_uInt16 nMarginStyle )
{
if ( (mpData->nMargin1 != nPos) || (mpData->nMargin1Style != nMarginStyle) )
{
@@ -2921,7 +2922,7 @@ void Ruler::SetMargin1( long nPos, USHORT nMarginStyle )
// -----------------------------------------------------------------------
-void Ruler::SetMargin2( long nPos, USHORT nMarginStyle )
+void Ruler::SetMargin2( long nPos, sal_uInt16 nMarginStyle )
{
DBG_ASSERT( (nPos >= mpData->nMargin1) ||
(mpData->nMargin1Style & RULER_STYLE_INVISIBLE) ||
@@ -2938,12 +2939,12 @@ void Ruler::SetMargin2( long nPos, USHORT nMarginStyle )
// -----------------------------------------------------------------------
-void Ruler::SetLines( USHORT n, const RulerLine* pLineAry )
+void Ruler::SetLines( sal_uInt16 n, const RulerLine* pLineAry )
{
// To determine if what has changed
if ( mpData->nLines == n )
{
- USHORT i = n;
+ sal_uInt16 i = n;
const RulerLine* pAry1 = mpData->pLines;
const RulerLine* pAry2 = pLineAry;
while ( i )
@@ -2960,11 +2961,11 @@ void Ruler::SetLines( USHORT n, const RulerLine* pLineAry )
}
// New values and new share issue
- BOOL bMustUpdate;
+ sal_Bool bMustUpdate;
if ( IsReallyVisible() && IsUpdateMode() )
- bMustUpdate = TRUE;
+ bMustUpdate = sal_True;
else
- bMustUpdate = FALSE;
+ bMustUpdate = sal_False;
// Delete old lines
if ( bMustUpdate )
@@ -2998,7 +2999,7 @@ void Ruler::SetLines( USHORT n, const RulerLine* pLineAry )
// -----------------------------------------------------------------------
-void Ruler::SetArrows( USHORT n, const RulerArrow* pArrowAry )
+void Ruler::SetArrows( sal_uInt16 n, const RulerArrow* pArrowAry )
{
if ( !n || !pArrowAry )
{
@@ -3018,7 +3019,7 @@ void Ruler::SetArrows( USHORT n, const RulerArrow* pArrowAry )
}
else
{
- USHORT i = n;
+ sal_uInt16 i = n;
const RulerArrow* pAry1 = mpData->pArrows;
const RulerArrow* pAry2 = pArrowAry;
while ( i )
@@ -3044,7 +3045,7 @@ void Ruler::SetArrows( USHORT n, const RulerArrow* pArrowAry )
// -----------------------------------------------------------------------
-void Ruler::SetBorders( USHORT n, const RulerBorder* pBrdAry )
+void Ruler::SetBorders( sal_uInt16 n, const RulerBorder* pBrdAry )
{
if ( !n || !pBrdAry )
{
@@ -3064,7 +3065,7 @@ void Ruler::SetBorders( USHORT n, const RulerBorder* pBrdAry )
}
else
{
- USHORT i = n;
+ sal_uInt16 i = n;
const RulerBorder* pAry1 = mpData->pBorders;
const RulerBorder* pAry2 = pBrdAry;
while ( i )
@@ -3089,7 +3090,7 @@ void Ruler::SetBorders( USHORT n, const RulerBorder* pBrdAry )
// -----------------------------------------------------------------------
-void Ruler::SetIndents( USHORT n, const RulerIndent* pIndentAry )
+void Ruler::SetIndents( sal_uInt16 n, const RulerIndent* pIndentAry )
{
if ( !n || !pIndentAry )
@@ -3110,7 +3111,7 @@ void Ruler::SetIndents( USHORT n, const RulerIndent* pIndentAry )
}
else
{
- USHORT i = n;
+ sal_uInt16 i = n;
const RulerIndent* pAry1 = mpData->pIndents;
const RulerIndent* pAry2 = pIndentAry;
while ( i )
@@ -3134,7 +3135,7 @@ void Ruler::SetIndents( USHORT n, const RulerIndent* pIndentAry )
// -----------------------------------------------------------------------
-void Ruler::SetTabs( USHORT n, const RulerTab* pTabAry )
+void Ruler::SetTabs( sal_uInt16 n, const RulerTab* pTabAry )
{
if ( !n || !pTabAry )
{
@@ -3154,7 +3155,7 @@ void Ruler::SetTabs( USHORT n, const RulerTab* pTabAry )
}
else
{
- USHORT i = n;
+ sal_uInt16 i = n;
const RulerTab* pAry1 = mpData->pTabs;
const RulerTab* pAry2 = pTabAry;
while ( i )
@@ -3183,17 +3184,17 @@ void Ruler::SetStyle( WinBits nStyle )
if ( mnWinStyle != nStyle )
{
mnWinStyle = nStyle;
- ImplInitExtraField( TRUE );
+ ImplInitExtraField( sal_True );
}
}
// -----------------------------------------------------------------------
-void Ruler::DrawTab( OutputDevice* pDevice, const Point& rPos, USHORT nStyle )
+void Ruler::DrawTab( OutputDevice* pDevice, const Point& rPos, sal_uInt16 nStyle )
{
/*const StyleSettings& rStyleSettings =*/ pDevice->GetSettings().GetStyleSettings();
Point aPos( rPos );
- USHORT nTabStyle = nStyle & (RULER_TAB_STYLE | RULER_TAB_RTL);
+ sal_uInt16 nTabStyle = nStyle & (RULER_TAB_STYLE | RULER_TAB_RTL);
pDevice->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
pDevice->SetLineColor();
@@ -3203,13 +3204,13 @@ void Ruler::DrawTab( OutputDevice* pDevice, const Point& rPos, USHORT nStyle )
pDevice->Pop();
}
-void Ruler::SetTextRTL(BOOL bRTL)
+void Ruler::SetTextRTL(sal_Bool bRTL)
{
if(mpData->bTextRTL != bRTL)
{
mpData->bTextRTL = bRTL;
if ( IsReallyVisible() && IsUpdateMode() )
- ImplInitExtraField( TRUE );
+ ImplInitExtraField( sal_True );
}
}
@@ -3217,22 +3218,22 @@ long Ruler::GetPageOffset() const { return mpData->nPageOff; }
long Ruler::GetPageWidth() const { return mpData->nPageWidth; }
long Ruler::GetNullOffset() const { return mpData->nNullOff; }
long Ruler::GetMargin1() const { return mpData->nMargin1; }
-USHORT Ruler::GetMargin1Style() const { return mpData->nMargin1Style; }
+sal_uInt16 Ruler::GetMargin1Style() const { return mpData->nMargin1Style; }
long Ruler::GetMargin2() const { return mpData->nMargin2; }
-USHORT Ruler::GetMargin2Style() const { return mpData->nMargin2Style; }
-USHORT Ruler::GetLineCount() const { return mpData->nLines; }
+sal_uInt16 Ruler::GetMargin2Style() const { return mpData->nMargin2Style; }
+sal_uInt16 Ruler::GetLineCount() const { return mpData->nLines; }
const RulerLine* Ruler::GetLines() const { return mpData->pLines; }
-USHORT Ruler::GetArrowCount() const { return mpData->nArrows; }
+sal_uInt16 Ruler::GetArrowCount() const { return mpData->nArrows; }
const RulerArrow* Ruler::GetArrows() const { return mpData->pArrows; }
-USHORT Ruler::GetBorderCount() const { return mpData->nBorders; }
+sal_uInt16 Ruler::GetBorderCount() const { return mpData->nBorders; }
const RulerBorder* Ruler::GetBorders() const { return mpData->pBorders; }
-USHORT Ruler::GetIndentCount() const { return mpData->nIndents; }
+sal_uInt16 Ruler::GetIndentCount() const { return mpData->nIndents; }
const RulerIndent* Ruler::GetIndents() const { return mpData->pIndents; }
void Ruler::DrawTicks()
{
- mbFormat = TRUE;
+ mbFormat = sal_True;
ImplDraw();
}
diff --git a/svtools/source/control/scriptedtext.cxx b/svtools/source/control/scriptedtext.cxx
index f311ddf67612..98f6c05ac0d7 100644..100755
--- a/svtools/source/control/scriptedtext.cxx
+++ b/svtools/source/control/scriptedtext.cxx
@@ -28,8 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "scriptedtext.hxx"
-
+#include <svtools/scriptedtext.hxx>
#include <vector>
#include <rtl/ustring.hxx>
#include <vcl/outdev.hxx>
@@ -235,7 +234,7 @@ void SvtScriptedTextHelper_Impl::CalculateBreaks( const uno::Reference< i18n::XB
nScript = i18n::ScriptType::LATIN;
while( (nScript != i18n::ScriptType::WEAK) && (nCharIx == nNextCharIx) )
{
- nNextCharIx = mrOutDevice.HasGlyphs( GetFont( nScript ), maText, sal::static_int_cast< USHORT >(nCharIx), sal::static_int_cast< USHORT >(nNextPos - nCharIx) );
+ nNextCharIx = mrOutDevice.HasGlyphs( GetFont( nScript ), maText, sal::static_int_cast< sal_uInt16 >(nCharIx), sal::static_int_cast< sal_uInt16 >(nNextPos - nCharIx) );
if( nCharIx == nNextCharIx )
++nScript;
}
diff --git a/svtools/source/control/scrwin.cxx b/svtools/source/control/scrwin.cxx
index dc007438583b..4d937981bea9 100644..100755
--- a/svtools/source/control/scrwin.cxx
+++ b/svtools/source/control/scrwin.cxx
@@ -30,16 +30,16 @@
#include "precompiled_svtools.hxx"
#define _SVT_SCRWIN_CXX
-#include <scrwin.hxx>
+#include <svtools/scrwin.hxx>
//===================================================================
void ScrollableWindow::ImpInitialize( ScrollableWindowFlags nFlags )
{
- bHandleDragging = (BOOL) ( nFlags & SCRWIN_THUMBDRAGGING );
+ bHandleDragging = (sal_Bool) ( nFlags & SCRWIN_THUMBDRAGGING );
bVCenter = (nFlags & SCRWIN_VCENTER) == SCRWIN_VCENTER;
bHCenter = (nFlags & SCRWIN_HCENTER) == SCRWIN_HCENTER;
- bScrolling = FALSE;
+ bScrolling = sal_False;
// set the handlers for the scrollbars
aVScroll.SetScrollHdl( LINK(this, ScrollableWindow, ScrollHdl) );
@@ -140,7 +140,7 @@ IMPL_LINK( ScrollableWindow, EndScrollHdl, ScrollBar *, pScroll )
{
// notify the start of scrolling, if not already scrolling
if ( !bScrolling )
- StartScroll(), bScrolling = TRUE;
+ StartScroll(), bScrolling = sal_True;
// get the delta in logic coordinates
Size aDelta( PixelToLogic( Size( aHScroll.GetDelta(), aVScroll.GetDelta() ) ) );
@@ -155,7 +155,7 @@ IMPL_LINK( ScrollableWindow, EndScrollHdl, ScrollBar *, pScroll )
}
// notify the end of scrolling
- bScrolling = FALSE;
+ bScrolling = sal_False;
EndScroll( aDelta.Width(), aDelta.Height() );
return 0;
}
@@ -166,7 +166,7 @@ IMPL_LINK( ScrollableWindow, ScrollHdl, ScrollBar *, pScroll )
{
// notify the start of scrolling, if not already scrolling
if ( !bScrolling )
- StartScroll(), bScrolling = TRUE;
+ StartScroll(), bScrolling = sal_True;
if ( bHandleDragging )
{
@@ -190,25 +190,25 @@ void ScrollableWindow::Resize()
// determine the size of the output-area and if we need scrollbars
const long nScrSize = GetSettings().GetStyleSettings().GetScrollBarSize();
- BOOL bVVisible = FALSE; // by default no vertical-ScrollBar
- BOOL bHVisible = FALSE; // by default no horizontal-ScrollBar
- BOOL bChanged; // determines if a visiblility was changed
+ sal_Bool bVVisible = sal_False; // by default no vertical-ScrollBar
+ sal_Bool bHVisible = sal_False; // by default no horizontal-ScrollBar
+ sal_Bool bChanged; // determines if a visiblility was changed
do
{
- bChanged = FALSE;
+ bChanged = sal_False;
// does we need a vertical ScrollBar
if ( aOutPixSz.Width() < aTotPixSz.Width() && !bHVisible )
- { bHVisible = TRUE;
+ { bHVisible = sal_True;
aOutPixSz.Height() -= nScrSize;
- bChanged = TRUE;
+ bChanged = sal_True;
}
// does we need a horizontal ScrollBar
if ( aOutPixSz.Height() < aTotPixSz.Height() && !bVVisible )
- { bVVisible = TRUE;
+ { bVVisible = sal_True;
aOutPixSz.Width() -= nScrSize;
- bChanged = TRUE;
+ bChanged = sal_True;
}
}
@@ -356,10 +356,10 @@ void ScrollableWindow::SetVisibleSize( const Size& rNewSize )
Window::GetOutputSizePixel().Height());
Size aWill( aWish.GetIntersection(aMax).GetSize() );
- BOOL bHScroll = FALSE;
+ sal_Bool bHScroll = sal_False;
const long nScrSize = GetSettings().GetStyleSettings().GetScrollBarSize();
if ( aWill.Width() < aWish.GetSize().Width() )
- { bHScroll = TRUE;
+ { bHScroll = sal_True;
aWill.Height() =
Min( aWill.Height()+nScrSize, aMax.GetSize().Height() );
}
@@ -374,7 +374,7 @@ void ScrollableWindow::SetVisibleSize( const Size& rNewSize )
//-------------------------------------------------------------------
-BOOL ScrollableWindow::MakeVisible( const Rectangle& rTarget, BOOL bSloppy )
+sal_Bool ScrollableWindow::MakeVisible( const Rectangle& rTarget, sal_Bool bSloppy )
{
Rectangle aTarget;
Rectangle aTotRect( Point(0, 0), PixelToLogic( aTotPixSz ) );
@@ -437,7 +437,7 @@ BOOL ScrollableWindow::MakeVisible( const Rectangle& rTarget, BOOL bSloppy )
// is the area already visible?
Rectangle aVisArea( GetVisibleArea() );
if ( aVisArea.IsInside(rTarget) )
- return TRUE;
+ return sal_True;
// is there somewhat to scroll?
if ( aVisArea.TopLeft() != aTarget.TopLeft() )
@@ -466,7 +466,7 @@ Rectangle ScrollableWindow::GetVisibleArea() const
//-------------------------------------------------------------------
-void ScrollableWindow::SetLineSize( ULONG nHorz, ULONG nVert )
+void ScrollableWindow::SetLineSize( sal_uLong nHorz, sal_uLong nVert )
{
Size aPixSz( LogicToPixel( Size(nHorz, nVert) ) );
nColumnPixW = aPixSz.Width();
@@ -477,7 +477,7 @@ void ScrollableWindow::SetLineSize( ULONG nHorz, ULONG nVert )
//-------------------------------------------------------------------
-void ScrollableWindow::Scroll( long nDeltaX, long nDeltaY, USHORT )
+void ScrollableWindow::Scroll( long nDeltaX, long nDeltaY, sal_uInt16 )
{
if ( !bScrolling )
StartScroll();
@@ -562,8 +562,8 @@ void ScrollableWindow::ScrollLines( long nLinesX, long nLinesY )
//-------------------------------------------------------------------
-void ScrollableWindow::ScrollPages( long nPagesX, ULONG nOverlapX,
- long nPagesY, ULONG nOverlapY )
+void ScrollableWindow::ScrollPages( long nPagesX, sal_uLong nOverlapX,
+ long nPagesY, sal_uLong nOverlapY )
{
Size aOutSz( GetVisibleArea().GetSize() );
Scroll( nPagesX * aOutSz.Width() + (nPagesX>0 ? 1 : -1) * nOverlapX,
diff --git a/svtools/source/control/stdctrl.cxx b/svtools/source/control/stdctrl.cxx
index 55aa20209699..d2cd0aa75099 100644..100755
--- a/svtools/source/control/stdctrl.cxx
+++ b/svtools/source/control/stdctrl.cxx
@@ -81,7 +81,7 @@ namespace svt
// make it transparent
SetControlBackground();
SetBackground();
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
}
// -----------------------------------------------------------------------
diff --git a/svtools/source/control/stdmenu.cxx b/svtools/source/control/stdmenu.cxx
index 13a9cdacfc5e..539ce156bbb7 100644..100755
--- a/svtools/source/control/stdmenu.cxx
+++ b/svtools/source/control/stdmenu.cxx
@@ -30,13 +30,10 @@
#include "precompiled_svtools.hxx"
#include <string.h>
-
#include <vcl/svapp.hxx>
-
#include <vcl/i18nhelp.hxx>
-
-#include <ctrltool.hxx>
-#include <stdmenu.hxx>
+#include <svtools/ctrltool.hxx>
+#include <svtools/stdmenu.hxx>
// ========================================================================
@@ -80,13 +77,13 @@ void FontNameMenu::Fill( const FontList* pList )
const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetUILocaleI18nHelper();
// more than 100 fonts reduces the speed of opening the menu.
// So only the first 100 fonts will be displayed.
- USHORT nFontCount = ::std::min( pList->GetFontNameCount(), static_cast< USHORT >(100) );
- for ( USHORT i = 0; i < nFontCount; i++ )
+ sal_uInt16 nFontCount = ::std::min( pList->GetFontNameCount(), static_cast< sal_uInt16 >(100) );
+ for ( sal_uInt16 i = 0; i < nFontCount; i++ )
{
const XubString& rName = pList->GetFontName( i ).GetName();
// sort with the I18nHelper
- USHORT j = GetItemCount();
+ sal_uInt16 j = GetItemCount();
while ( j )
{
XubString aText = GetItemText( GetItemId( j-1 ) );
@@ -107,11 +104,11 @@ void FontNameMenu::SetCurName( const XubString& rName )
maCurName = rName;
// Menueintrag checken
- USHORT nChecked = 0;
- USHORT nItemCount = GetItemCount();
- for( USHORT i = 0; i < nItemCount; i++ )
+ sal_uInt16 nChecked = 0;
+ sal_uInt16 nItemCount = GetItemCount();
+ for( sal_uInt16 i = 0; i < nItemCount; i++ )
{
- USHORT nItemId = GetItemId( i );
+ sal_uInt16 nItemId = GetItemId( i );
if ( IsItemChecked( nItemId ) )
nChecked = nItemId;
@@ -119,13 +116,13 @@ void FontNameMenu::SetCurName( const XubString& rName )
XubString aText = GetItemText( nItemId );
if ( aText == maCurName )
{
- CheckItem( nItemId, TRUE );
+ CheckItem( nItemId, sal_True );
return;
}
}
if ( nChecked )
- CheckItem( nChecked, FALSE );
+ CheckItem( nChecked, sal_False );
}
// ========================================================================
@@ -145,7 +142,7 @@ FontStyleMenu::~FontStyleMenu()
void FontStyleMenu::Select()
{
- USHORT nCurId = GetCurItemId();
+ sal_uInt16 nCurId = GetCurItemId();
if ( (nCurId >= FONTSTYLEMENU_FIRSTID) && (nCurId <= FONTSTYLEMENU_LASTID) )
{
@@ -160,7 +157,7 @@ void FontStyleMenu::Select()
void FontStyleMenu::Highlight()
{
- USHORT nCurId = GetCurItemId();
+ sal_uInt16 nCurId = GetCurItemId();
if ( (nCurId >= FONTSTYLEMENU_FIRSTID) && (nCurId <= FONTSTYLEMENU_LASTID) )
{
@@ -175,22 +172,22 @@ void FontStyleMenu::Highlight()
// -----------------------------------------------------------------------
-BOOL FontStyleMenu::ImplIsAlreadyInserted( const XubString& rStyleName, USHORT nCount )
+sal_Bool FontStyleMenu::ImplIsAlreadyInserted( const XubString& rStyleName, sal_uInt16 nCount )
{
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
if ( GetItemText( i+FONTSTYLEMENU_FIRSTID ) == rStyleName )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
void FontStyleMenu::Fill( const XubString& rName, const FontList* pList )
{
- USHORT nItemId = GetItemId( 0 );
+ sal_uInt16 nItemId = GetItemId( 0 );
while ( (nItemId >= FONTSTYLEMENU_FIRSTID) &&
(nItemId <= FONTSTYLEMENU_LASTID) )
{
@@ -203,16 +200,16 @@ void FontStyleMenu::Fill( const XubString& rName, const FontList* pList )
if ( hFontInfo )
{
XubString aStyleText;
- USHORT nPos = 0;
- USHORT nId = FONTSTYLEMENU_FIRSTID;
+ sal_uInt16 nPos = 0;
+ sal_uInt16 nId = FONTSTYLEMENU_FIRSTID;
FontWeight eLastWeight = WEIGHT_DONTKNOW;
FontItalic eLastItalic = ITALIC_NONE;
FontWidth eLastWidth = WIDTH_DONTKNOW;
- BOOL bNormal = FALSE;
- BOOL bItalic = FALSE;
- BOOL bBold = FALSE;
- BOOL bBoldItalic = FALSE;
- BOOL bInsert = FALSE;
+ sal_Bool bNormal = sal_False;
+ sal_Bool bItalic = sal_False;
+ sal_Bool bBold = sal_False;
+ sal_Bool bBoldItalic = sal_False;
+ sal_Bool bInsert = sal_False;
FontInfo aInfo;
while ( hFontInfo )
{
@@ -237,16 +234,16 @@ void FontStyleMenu::Fill( const XubString& rName, const FontList* pList )
if ( eWeight <= WEIGHT_NORMAL )
{
if ( eItalic != ITALIC_NONE )
- bItalic = TRUE;
+ bItalic = sal_True;
else
- bNormal = TRUE;
+ bNormal = sal_True;
}
else
{
if ( eItalic != ITALIC_NONE )
- bBoldItalic = TRUE;
+ bBoldItalic = sal_True;
else
- bBold = TRUE;
+ bBold = sal_True;
}
// For wrong StyleNames we replace this with the correct once
@@ -280,11 +277,11 @@ void FontStyleMenu::Fill( const XubString& rName, const FontList* pList )
}
if ( !bItalic && (aStyleText == pList->GetItalicStr()) )
- bItalic = TRUE;
+ bItalic = sal_True;
else if ( !bBold && (aStyleText == pList->GetBoldStr()) )
- bBold = TRUE;
+ bBold = sal_True;
else if ( !bBoldItalic && (aStyleText == pList->GetBoldItalicStr()) )
- bBoldItalic = TRUE;
+ bBoldItalic = sal_True;
hFontInfo = pList->GetNextFontInfo( hFontInfo );
}
@@ -349,11 +346,11 @@ void FontStyleMenu::SetCurStyle( const XubString& rStyle )
maCurStyle = rStyle;
// Menueintrag checken
- USHORT nChecked = 0;
- USHORT nItemCount = GetItemCount();
- for( USHORT i = 0; i < nItemCount; i++ )
+ sal_uInt16 nChecked = 0;
+ sal_uInt16 nItemCount = GetItemCount();
+ for( sal_uInt16 i = 0; i < nItemCount; i++ )
{
- USHORT nItemId = GetItemId( i );
+ sal_uInt16 nItemId = GetItemId( i );
if ( (nItemId < FONTSTYLEMENU_FIRSTID) ||
(nItemId > FONTSTYLEMENU_LASTID) )
@@ -365,13 +362,13 @@ void FontStyleMenu::SetCurStyle( const XubString& rStyle )
XubString aText = GetItemText( nItemId );
if ( aText == maCurStyle )
{
- CheckItem( nItemId, TRUE );
+ CheckItem( nItemId, sal_True );
return;
}
}
if ( nChecked )
- CheckItem( nChecked, FALSE );
+ CheckItem( nChecked, sal_False );
}
// ========================================================================
@@ -395,7 +392,7 @@ FontSizeMenu::~FontSizeMenu()
void FontSizeMenu::Select()
{
- const USHORT nCurItemId = GetCurItemId();
+ const sal_uInt16 nCurItemId = GetCurItemId();
mnCurHeight = mpHeightAry[ nCurItemId - 1 ];
maSelectHdl.Call( this );
}
@@ -405,7 +402,7 @@ void FontSizeMenu::Select()
void FontSizeMenu::Highlight()
{
const long nTempHeight = mnCurHeight;
- const USHORT nCurItemId = GetCurItemId();
+ const sal_uInt16 nCurItemId = GetCurItemId();
if ( !nCurItemId )
mnCurHeight = 0;
else
@@ -429,11 +426,11 @@ void FontSizeMenu::Fill( const FontInfo& rInfo, const FontList* pList )
const long* pTempAry;
const long* pAry = pList->GetSizeAry( rInfo );
- USHORT nSizeCount = 0;
+ sal_uInt16 nSizeCount = 0;
while ( pAry[nSizeCount] )
nSizeCount++;
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
// first insert font size names (for simplified/traditional chinese)
FontSizeNames aFontSizeNames( Application::GetSettings().GetUILanguage() );
@@ -443,8 +440,8 @@ void FontSizeMenu::Fill( const FontInfo& rInfo, const FontList* pList )
if ( pAry == pList->GetStdSizeAry() )
{
// for scalable fonts all font size names
- ULONG nCount = aFontSizeNames.Count();
- for( ULONG i = 0; i < nCount; i++ )
+ sal_uLong nCount = aFontSizeNames.Count();
+ for( sal_uLong i = 0; i < nCount; i++ )
{
String aSizeName = aFontSizeNames.GetIndexName( i );
long nSize = aFontSizeNames.GetIndexSize( i );
@@ -478,7 +475,7 @@ void FontSizeMenu::Fill( const FontInfo& rInfo, const FontList* pList )
{
mpHeightAry[nPos] = *pTempAry;
nPos++; // Id is nPos+1
- InsertItem( nPos, rI18nHelper.GetNum( *pTempAry, 1, TRUE, FALSE ), MIB_RADIOCHECK | MIB_AUTOCHECK );
+ InsertItem( nPos, rI18nHelper.GetNum( *pTempAry, 1, sal_True, sal_False ), MIB_RADIOCHECK | MIB_AUTOCHECK );
pTempAry++;
}
@@ -492,16 +489,16 @@ void FontSizeMenu::SetCurHeight( long nHeight )
mnCurHeight = nHeight;
// check menue item
- XubString aHeight = Application::GetSettings().GetUILocaleI18nHelper().GetNum( nHeight, 1, TRUE, FALSE );
- USHORT nChecked = 0;
- USHORT nItemCount = GetItemCount();
- for( USHORT i = 0; i < nItemCount; i++ )
+ XubString aHeight = Application::GetSettings().GetUILocaleI18nHelper().GetNum( nHeight, 1, sal_True, sal_False );
+ sal_uInt16 nChecked = 0;
+ sal_uInt16 nItemCount = GetItemCount();
+ for( sal_uInt16 i = 0; i < nItemCount; i++ )
{
- USHORT nItemId = GetItemId( i );
+ sal_uInt16 nItemId = GetItemId( i );
if ( mpHeightAry[i] == nHeight )
{
- CheckItem( nItemId, TRUE );
+ CheckItem( nItemId, sal_True );
return;
}
@@ -510,7 +507,7 @@ void FontSizeMenu::SetCurHeight( long nHeight )
}
if ( nChecked )
- CheckItem( nChecked, FALSE );
+ CheckItem( nChecked, sal_False );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/control/svxbox.cxx b/svtools/source/control/svxbox.cxx
index 7bb17b83ea9e..23c738df7dac 100644..100755
--- a/svtools/source/control/svxbox.cxx
+++ b/svtools/source/control/svxbox.cxx
@@ -43,17 +43,17 @@ SV_IMPL_PTRARR(SvxEntryLst, SvxBoxEntry*)
SvxBoxEntry::SvxBoxEntry() :
nId(LISTBOX_ENTRY_NOTFOUND),
- bModified(FALSE),
- bNew(FALSE)
+ bModified(sal_False),
+ bNew(sal_False)
{
}
-SvxBoxEntry::SvxBoxEntry(const String& aNam, USHORT nIdx) :
+SvxBoxEntry::SvxBoxEntry(const String& aNam, sal_uInt16 nIdx) :
aName(aNam),
nId(nIdx),
- bModified(FALSE),
- bNew(FALSE)
+ bModified(sal_False),
+ bNew(sal_False)
{
}
@@ -96,8 +96,8 @@ SvxListBox::~SvxListBox()
void SvxListBox::InitListBox()
{
// Verwaltung fuer die Stringlist aus der Resource aufbauen
- USHORT nSize = GetEntryCount();
- for(USHORT i=0; i < nSize; ++i)
+ sal_uInt16 nSize = GetEntryCount();
+ for(sal_uInt16 i=0; i < nSize; ++i)
{ const SvxBoxEntry* pTmp = new SvxBoxEntry(ListBox::GetEntry(i), i);
const SvxBoxEntry* &rpTmp = pTmp;
aEntryLst.Insert(rpTmp, aEntryLst.Count());
@@ -111,7 +111,7 @@ void SvxListBox::InitListBox()
void SvxListBox::InsertNewEntry(const SvxBoxEntry& rEntry)
{
SvxBoxEntry* pNew = new SvxBoxEntry(rEntry);
- pNew->bNew = TRUE;
+ pNew->bNew = sal_True;
InsertSorted(pNew);
}
@@ -119,7 +119,7 @@ void SvxListBox::InsertNewEntry(const SvxBoxEntry& rEntry)
Beschreibung: Eintrag in die ListBox aufnehmen
--------------------------------------------------------------------*/
-void SvxListBox::InsertEntry(const SvxBoxEntry& rEntry, USHORT nPos)
+void SvxListBox::InsertEntry(const SvxBoxEntry& rEntry, sal_uInt16 nPos)
{
if(nPos != LISTBOX_ENTRY_NOTFOUND)
{
@@ -136,7 +136,7 @@ void SvxListBox::InsertEntry(const SvxBoxEntry& rEntry, USHORT nPos)
Beschreibung: Eintrag aus der Liste loeschen
--------------------------------------------------------------------*/
-void SvxListBox::RemoveEntry(USHORT nPos)
+void SvxListBox::RemoveEntry(sal_uInt16 nPos)
{
if(nPos >= aEntryLst.Count())
return;
@@ -160,7 +160,7 @@ void SvxListBox::RemoveEntry(USHORT nPos)
void SvxListBox::RemoveEntry(const SvxBoxEntry& rEntry)
{
- USHORT nPos = ListBox::GetEntryPos(rEntry.aName);
+ sal_uInt16 nPos = ListBox::GetEntryPos(rEntry.aName);
RemoveEntry(nPos);
}
@@ -179,7 +179,7 @@ void SvxListBox::Clear()
Beschreibung: Position by Name
--------------------------------------------------------------------*/
-USHORT SvxListBox::GetEntryPos(const SvxBoxEntry& rEntry) const
+sal_uInt16 SvxListBox::GetEntryPos(const SvxBoxEntry& rEntry) const
{
return ListBox::GetEntryPos(rEntry.aName);
}
@@ -188,7 +188,7 @@ USHORT SvxListBox::GetEntryPos(const SvxBoxEntry& rEntry) const
Beschreibung: Rund um die Entries
--------------------------------------------------------------------*/
-const SvxBoxEntry& SvxListBox::GetSvxBoxEntry(USHORT nPos) const
+const SvxBoxEntry& SvxListBox::GetSvxBoxEntry(sal_uInt16 nPos) const
{
if(nPos < aEntryLst.Count())
return *aEntryLst[nPos];
@@ -200,13 +200,13 @@ const SvxBoxEntry& SvxListBox::GetSvxBoxEntry(USHORT nPos) const
Beschreibung: aktullen Eintrag zurueckgeben
--------------------------------------------------------------------*/
-const SvxBoxEntry& SvxListBox::GetSelectSvxBoxEntry(USHORT nSelId) const
+const SvxBoxEntry& SvxListBox::GetSelectSvxBoxEntry(sal_uInt16 nSelId) const
{
String aName(ListBox::GetSelectEntry(nSelId));
if(aName.Len() > 0)
{
- for (USHORT i=0; i < aEntryLst.Count(); i++)
+ for (sal_uInt16 i=0; i < aEntryLst.Count(); i++)
{
if(aEntryLst[i]->aName == aName )
return *aEntryLst[i];
@@ -219,11 +219,11 @@ const SvxBoxEntry& SvxListBox::GetSelectSvxBoxEntry(USHORT nSelId) const
Beschreibung: modifizierte Eintraege
--------------------------------------------------------------------*/
-USHORT SvxListBox::GetModifiedCount() const
+sal_uInt16 SvxListBox::GetModifiedCount() const
{
- USHORT nMod = 0;
- USHORT nSize = aEntryLst.Count();
- for(USHORT i=0; i < nSize; ++i)
+ sal_uInt16 nMod = 0;
+ sal_uInt16 nSize = aEntryLst.Count();
+ for(sal_uInt16 i=0; i < nSize; ++i)
{ if(aEntryLst[i]->bModified)
nMod++;
}
@@ -234,7 +234,7 @@ USHORT SvxListBox::GetModifiedCount() const
Beschreibung: Modifizierte Eintraege behandeln
--------------------------------------------------------------------*/
-void SvxListBox::ModifyEntry(USHORT nPos, const String& rName)
+void SvxListBox::ModifyEntry(sal_uInt16 nPos, const String& rName)
{
if(nPos >= aEntryLst.Count())
return;
@@ -242,7 +242,7 @@ void SvxListBox::ModifyEntry(USHORT nPos, const String& rName)
SvxBoxEntry* pEntry = aEntryLst[nPos];
aEntryLst.Remove(nPos, 1);
aEntryLst[nPos]->aName = rName;
- aEntryLst[nPos]->bModified = TRUE;
+ aEntryLst[nPos]->bModified = sal_True;
ListBox::RemoveEntry(nPos);
InsertSorted(pEntry);
@@ -252,11 +252,11 @@ void SvxListBox::ModifyEntry(USHORT nPos, const String& rName)
Beschreibung: alle modifizierten Eintraege bahandeln
--------------------------------------------------------------------*/
-const SvxBoxEntry& SvxListBox::GetModifiedEntry(USHORT nPos) const
+const SvxBoxEntry& SvxListBox::GetModifiedEntry(sal_uInt16 nPos) const
{
- USHORT nSize = aEntryLst.Count();
- USHORT nMod = 0;
- for(USHORT i=0; i < nSize; ++i)
+ sal_uInt16 nSize = aEntryLst.Count();
+ sal_uInt16 nMod = 0;
+ for(sal_uInt16 i=0; i < nSize; ++i)
{ if(aEntryLst[i]->bModified)
{ if(nMod == nPos)
return *aEntryLst[i];
@@ -270,13 +270,13 @@ const SvxBoxEntry& SvxListBox::GetModifiedEntry(USHORT nPos) const
Beschreibung: geloeschte Eintraege
--------------------------------------------------------------------*/
-USHORT SvxListBox::GetRemovedCount() const
+sal_uInt16 SvxListBox::GetRemovedCount() const
{
return aDelEntryLst.Count();
}
-const SvxBoxEntry& SvxListBox::GetRemovedEntry(USHORT nPos) const
+const SvxBoxEntry& SvxListBox::GetRemovedEntry(sal_uInt16 nPos) const
{
if(nPos < aDelEntryLst.Count())
return *aDelEntryLst[nPos];
@@ -288,11 +288,11 @@ const SvxBoxEntry& SvxListBox::GetRemovedEntry(USHORT nPos) const
Beschreibung: Neue Entries begutachten
--------------------------------------------------------------------*/
-USHORT SvxListBox::GetNewCount() const
+sal_uInt16 SvxListBox::GetNewCount() const
{
- USHORT nNew = 0;
- USHORT nSize = aEntryLst.Count();
- for(USHORT i=0; i < nSize; ++i)
+ sal_uInt16 nNew = 0;
+ sal_uInt16 nSize = aEntryLst.Count();
+ for(sal_uInt16 i=0; i < nSize; ++i)
{ if(aEntryLst[i]->bNew)
nNew++;
}
@@ -303,11 +303,11 @@ USHORT SvxListBox::GetNewCount() const
Beschreibung: Alle neuen Eintraege ueberpruefen
--------------------------------------------------------------------*/
-const SvxBoxEntry& SvxListBox::GetNewEntry(USHORT nPos) const
+const SvxBoxEntry& SvxListBox::GetNewEntry(sal_uInt16 nPos) const
{
- USHORT nSize = aEntryLst.Count();
- USHORT nNew = 0;
- for(USHORT i=0; i < nSize; ++i)
+ sal_uInt16 nSize = aEntryLst.Count();
+ sal_uInt16 nNew = 0;
+ for(sal_uInt16 i=0; i < nSize; ++i)
{ if(aEntryLst[i]->bNew)
{ if(nNew == nPos)
return *aEntryLst[i];
@@ -324,7 +324,7 @@ const SvxBoxEntry& SvxListBox::GetNewEntry(USHORT nPos) const
void SvxListBox::InsertSorted(SvxBoxEntry* pEntry)
{
ListBox::InsertEntry(pEntry->aName);
- USHORT nPos = ListBox::GetEntryPos(pEntry->aName);
+ sal_uInt16 nPos = ListBox::GetEntryPos(pEntry->aName);
aEntryLst.C40_INSERT(SvxBoxEntry, pEntry, nPos);
}
@@ -332,7 +332,7 @@ void SvxListBox::InsertSorted(SvxBoxEntry* pEntry)
Beschreibung: ComboBoxen mit Verwaltungseinheit
--------------------------------------------------------------------*/
-SvxComboBox::SvxComboBox(Window* pParent, WinBits nBits, USHORT nStyleBits) :
+SvxComboBox::SvxComboBox(Window* pParent, WinBits nBits, sal_uInt16 nStyleBits) :
ComboBox(pParent, nBits),
nStyle(nStyleBits)
{
@@ -340,7 +340,7 @@ SvxComboBox::SvxComboBox(Window* pParent, WinBits nBits, USHORT nStyleBits) :
}
-SvxComboBox::SvxComboBox(Window* pParent, const ResId& rId, USHORT nStyleBits ):
+SvxComboBox::SvxComboBox(Window* pParent, const ResId& rId, sal_uInt16 nStyleBits ):
ComboBox(pParent, rId),
nStyle(nStyleBits)
{
@@ -364,8 +364,8 @@ SvxComboBox::~SvxComboBox()
void SvxComboBox::InitComboBox()
{
// Verwaltung fuer die Stringlist aus der Resource aufbauen
- USHORT nSize = GetEntryCount();
- for(USHORT i=0; i < nSize; ++i)
+ sal_uInt16 nSize = GetEntryCount();
+ for(sal_uInt16 i=0; i < nSize; ++i)
{ const SvxBoxEntry* pTmp = new SvxBoxEntry(ComboBox::GetEntry(i), i);
const SvxBoxEntry* &rpTmp = pTmp;
aEntryLst.Insert(rpTmp, aEntryLst.Count());
@@ -379,7 +379,7 @@ void SvxComboBox::InitComboBox()
void SvxComboBox::InsertNewEntry(const SvxBoxEntry& rEntry)
{
SvxBoxEntry* pNew = new SvxBoxEntry(rEntry);
- pNew->bNew = TRUE;
+ pNew->bNew = sal_True;
InsertSorted(pNew);
}
@@ -396,7 +396,7 @@ void SvxComboBox::InsertEntry(const SvxBoxEntry& rEntry)
Beschreibung: Eintrag aus der Liste loeschen
--------------------------------------------------------------------*/
-void SvxComboBox::RemoveEntry(USHORT nPos)
+void SvxComboBox::RemoveEntry(sal_uInt16 nPos)
{
if(nPos >= aEntryLst.Count())
return;
@@ -420,7 +420,7 @@ void SvxComboBox::RemoveEntry(USHORT nPos)
void SvxComboBox::RemoveEntry(const SvxBoxEntry& rEntry)
{
- USHORT nPos = ComboBox::GetEntryPos(rEntry.aName);
+ sal_uInt16 nPos = ComboBox::GetEntryPos(rEntry.aName);
RemoveEntry(nPos);
}
@@ -440,7 +440,7 @@ void SvxComboBox::Clear()
Beschreibung: Position by Name
--------------------------------------------------------------------*/
-USHORT SvxComboBox::GetEntryPos(const SvxBoxEntry& rEntry) const
+sal_uInt16 SvxComboBox::GetEntryPos(const SvxBoxEntry& rEntry) const
{
return ComboBox::GetEntryPos(rEntry.aName);
}
@@ -449,7 +449,7 @@ USHORT SvxComboBox::GetEntryPos(const SvxBoxEntry& rEntry) const
Beschreibung: Rund um die Entries
--------------------------------------------------------------------*/
-const SvxBoxEntry& SvxComboBox::GetEntry(USHORT nPos) const
+const SvxBoxEntry& SvxComboBox::GetEntry(sal_uInt16 nPos) const
{
if(nPos < aEntryLst.Count())
return *aEntryLst[nPos];
@@ -461,11 +461,11 @@ const SvxBoxEntry& SvxComboBox::GetEntry(USHORT nPos) const
Beschreibung: modifizierte Eintraege
--------------------------------------------------------------------*/
-USHORT SvxComboBox::GetModifiedCount() const
+sal_uInt16 SvxComboBox::GetModifiedCount() const
{
- USHORT nMod = 0;
- USHORT nSize = aEntryLst.Count();
- for(USHORT i=0; i < nSize; ++i)
+ sal_uInt16 nMod = 0;
+ sal_uInt16 nSize = aEntryLst.Count();
+ for(sal_uInt16 i=0; i < nSize; ++i)
{ if(aEntryLst[i]->bModified)
nMod++;
}
@@ -476,7 +476,7 @@ USHORT SvxComboBox::GetModifiedCount() const
Beschreibung: Modifizierte Eintraege behandeln
--------------------------------------------------------------------*/
-void SvxComboBox::ModifyEntry(USHORT nPos, const String& rName)
+void SvxComboBox::ModifyEntry(sal_uInt16 nPos, const String& rName)
{
if(nPos >= aEntryLst.Count())
return;
@@ -484,7 +484,7 @@ void SvxComboBox::ModifyEntry(USHORT nPos, const String& rName)
SvxBoxEntry* pEntry = aEntryLst[nPos];
aEntryLst.Remove(nPos, 1);
aEntryLst[nPos]->aName = rName;
- aEntryLst[nPos]->bModified = TRUE;
+ aEntryLst[nPos]->bModified = sal_True;
ComboBox::RemoveEntry(nPos);
InsertSorted(pEntry);
@@ -494,11 +494,11 @@ void SvxComboBox::ModifyEntry(USHORT nPos, const String& rName)
Beschreibung: alle modifizierten Eintraege bahandeln
--------------------------------------------------------------------*/
-const SvxBoxEntry& SvxComboBox::GetModifiedEntry(USHORT nPos) const
+const SvxBoxEntry& SvxComboBox::GetModifiedEntry(sal_uInt16 nPos) const
{
- USHORT nSize = aEntryLst.Count();
- USHORT nMod = 0;
- for(USHORT i=0; i < nSize; ++i)
+ sal_uInt16 nSize = aEntryLst.Count();
+ sal_uInt16 nMod = 0;
+ for(sal_uInt16 i=0; i < nSize; ++i)
{ if(aEntryLst[i]->bModified)
{ if(nMod == nPos)
return *aEntryLst[i];
@@ -512,13 +512,13 @@ const SvxBoxEntry& SvxComboBox::GetModifiedEntry(USHORT nPos) const
Beschreibung: geloeschte Eintraege
--------------------------------------------------------------------*/
-USHORT SvxComboBox::GetRemovedCount() const
+sal_uInt16 SvxComboBox::GetRemovedCount() const
{
return aDelEntryLst.Count();
}
-const SvxBoxEntry& SvxComboBox::GetRemovedEntry(USHORT nPos) const
+const SvxBoxEntry& SvxComboBox::GetRemovedEntry(sal_uInt16 nPos) const
{
if(nPos < aDelEntryLst.Count())
return *aDelEntryLst[nPos];
@@ -530,11 +530,11 @@ const SvxBoxEntry& SvxComboBox::GetRemovedEntry(USHORT nPos) const
Beschreibung: Neue Entries begutachten
--------------------------------------------------------------------*/
-USHORT SvxComboBox::GetNewCount() const
+sal_uInt16 SvxComboBox::GetNewCount() const
{
- USHORT nNew = 0;
- USHORT nSize = aEntryLst.Count();
- for(USHORT i=0; i < nSize; ++i)
+ sal_uInt16 nNew = 0;
+ sal_uInt16 nSize = aEntryLst.Count();
+ for(sal_uInt16 i=0; i < nSize; ++i)
{ if(aEntryLst[i]->bNew)
nNew++;
}
@@ -545,11 +545,11 @@ USHORT SvxComboBox::GetNewCount() const
Beschreibung: Alle neuen Eintraege ueberpruefen
--------------------------------------------------------------------*/
-const SvxBoxEntry& SvxComboBox::GetNewEntry(USHORT nPos) const
+const SvxBoxEntry& SvxComboBox::GetNewEntry(sal_uInt16 nPos) const
{
- USHORT nSize = aEntryLst.Count();
- USHORT nNew = 0;
- for(USHORT i=0; i < nSize; ++i)
+ sal_uInt16 nSize = aEntryLst.Count();
+ sal_uInt16 nNew = 0;
+ for(sal_uInt16 i=0; i < nSize; ++i)
{ if(aEntryLst[i]->bNew)
{ if(nNew == nPos)
return *aEntryLst[i];
@@ -566,7 +566,7 @@ const SvxBoxEntry& SvxComboBox::GetNewEntry(USHORT nPos) const
void SvxComboBox::InsertSorted(SvxBoxEntry* pEntry)
{
ComboBox::InsertEntry(pEntry->aName);
- USHORT nPos = ComboBox::GetEntryPos(pEntry->aName);
+ sal_uInt16 nPos = ComboBox::GetEntryPos(pEntry->aName);
aEntryLst.C40_INSERT(SvxBoxEntry, pEntry, nPos);
}
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 75c02afda571..9b61f88562da 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "tabbar.hxx"
+#include <svtools/tabbar.hxx>
#include <tools/time.hxx>
#include <tools/debug.hxx>
#include <tools/poly.hxx>
@@ -38,11 +38,11 @@
#include <vcl/decoview.hxx>
#include <vcl/button.hxx>
#include <vcl/edit.hxx>
+#include <vcl/image.hxx>
#include "svtaccessiblefactory.hxx"
-
-#include "svtools/svtools.hrc"
-#include "svtools/svtdata.hxx"
-
+#include <filectrl.hrc>
+#include <svtools/svtdata.hxx>
+#include <svtools/svtools.hrc>
#include <limits>
// =======================================================================
@@ -52,36 +52,35 @@
#define TABBAR_DRAG_SCROLLOFF 5
#define TABBAR_MINSIZE 5
-const USHORT ADDNEWPAGE_AREAWIDTH = 10;
+const sal_uInt16 ADDNEWPAGE_AREAWIDTH = 10;
// =======================================================================
struct ImplTabBarItem
{
- USHORT mnId;
+ sal_uInt16 mnId;
TabBarPageBits mnBits;
XubString maText;
XubString maHelpText;
Rectangle maRect;
long mnWidth;
- ULONG mnHelpId;
- BOOL mbShort;
- BOOL mbSelect;
- BOOL mbEnable;
+ rtl::OString maHelpId;
+ sal_Bool mbShort;
+ sal_Bool mbSelect;
+ sal_Bool mbEnable;
Color maTabBgColor;
Color maTabTextColor;
- ImplTabBarItem( USHORT nItemId, const XubString& rText,
+ ImplTabBarItem( sal_uInt16 nItemId, const XubString& rText,
TabBarPageBits nPageBits ) :
maText( rText )
{
mnId = nItemId;
mnBits = nPageBits;
mnWidth = 0;
- mnHelpId = 0;
- mbShort = FALSE;
- mbSelect = FALSE;
- mbEnable = TRUE;
+ mbShort = sal_False;
+ mbSelect = sal_False;
+ mbEnable = sal_True;
maTabBgColor = Color( COL_AUTO );
maTabTextColor = Color( COL_AUTO );
}
@@ -128,7 +127,7 @@ long ImplTabButton::PreNotify( NotifyEvent& rNEvt )
if ( GetParent()->IsInEditMode() )
{
GetParent()->EndEditMode();
- return TRUE;
+ return sal_True;
}
}
@@ -245,7 +244,7 @@ class TabBarEdit : public Edit
{
private:
Timer maLoseFocusTimer;
- BOOL mbPostEvt;
+ sal_Bool mbPostEvt;
DECL_LINK( ImplEndEditHdl, void* );
DECL_LINK( ImplEndTimerHdl, void* );
@@ -255,8 +254,8 @@ public:
TabBar* GetParent() const { return (TabBar*)Window::GetParent(); }
- void SetPostEvent() { mbPostEvt = TRUE; }
- void ResetPostEvent() { mbPostEvt = FALSE; }
+ void SetPostEvent() { mbPostEvt = sal_True; }
+ void ResetPostEvent() { mbPostEvt = sal_False; }
virtual long PreNotify( NotifyEvent& rNEvt );
virtual void LoseFocus();
@@ -267,7 +266,7 @@ public:
TabBarEdit::TabBarEdit( TabBar* pParent, WinBits nWinStyle ) :
Edit( pParent, nWinStyle )
{
- mbPostEvt = FALSE;
+ mbPostEvt = sal_False;
}
// -----------------------------------------------------------------------
@@ -283,19 +282,19 @@ long TabBarEdit::PreNotify( NotifyEvent& rNEvt )
{
if ( !mbPostEvt )
{
- if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)FALSE ) )
- mbPostEvt = TRUE;
+ if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)sal_False ) )
+ mbPostEvt = sal_True;
}
- return TRUE;
+ return sal_True;
}
else if ( pKEvt->GetKeyCode().GetCode() == KEY_ESCAPE )
{
if ( !mbPostEvt )
{
- if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)TRUE ) )
- mbPostEvt = TRUE;
+ if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)sal_True ) )
+ mbPostEvt = sal_True;
}
- return TRUE;
+ return sal_True;
}
}
}
@@ -309,8 +308,8 @@ void TabBarEdit::LoseFocus()
{
if ( !mbPostEvt )
{
- if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)FALSE ) )
- mbPostEvt = TRUE;
+ if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)sal_False ) )
+ mbPostEvt = sal_True;
}
Edit::LoseFocus();
@@ -325,7 +324,7 @@ IMPL_LINK( TabBarEdit, ImplEndEditHdl, void*, pCancel )
// We need this query, because the edit get a losefous event,
// when it shows the context menu or the insert symbol dialog
- if ( !HasFocus() && HasChildPathFocus( TRUE ) )
+ if ( !HasFocus() && HasChildPathFocus( sal_True ) )
{
maLoseFocusTimer.SetTimeout( 30 );
maLoseFocusTimer.SetTimeoutHdl( LINK( this, TabBarEdit, ImplEndTimerHdl ) );
@@ -346,10 +345,10 @@ IMPL_LINK( TabBarEdit, ImplEndTimerHdl, void*, EMPTYARG )
// We need this query, because the edit get a losefous event,
// when it shows the context menu or the insert symbol dialog
- if ( HasChildPathFocus( TRUE ) )
+ if ( HasChildPathFocus( sal_True ) )
maLoseFocusTimer.Start();
else
- GetParent()->EndEditMode( TRUE );
+ GetParent()->EndEditMode( sal_True );
return 0;
}
@@ -374,7 +373,7 @@ struct TabBar_Impl
const sal_uInt16 TabBar::APPEND = ::std::numeric_limits<sal_uInt16>::max();
const sal_uInt16 TabBar::PAGE_NOT_FOUND = ::std::numeric_limits<sal_uInt16>::max();
-const sal_uInt16 TabBar::INSERT_TAB_POS = ::std::numeric_limits<USHORT>::max() - 1;
+const sal_uInt16 TabBar::INSERT_TAB_POS = ::std::numeric_limits<sal_uInt16>::max() - 1;
void TabBar::ImplInit( WinBits nWinStyle )
{
@@ -398,25 +397,35 @@ void TabBar::ImplInit( WinBits nWinStyle )
mnDropPos = 0;
mnSwitchId = 0;
mnEditId = 0;
- mbFormat = TRUE;
- mbFirstFormat = TRUE;
- mbSizeFormat = TRUE;
- mbAutoMaxWidth = TRUE;
- mbInSwitching = FALSE;
- mbAutoEditMode = FALSE;
- mbEditCanceled = FALSE;
- mbDropPos = FALSE;
- mbInSelect = FALSE;
- mbSelColor = FALSE;
- mbSelTextColor = FALSE;
- mbMirrored = FALSE;
+ mbFormat = sal_True;
+ mbFirstFormat = sal_True;
+ mbSizeFormat = sal_True;
+ mbAutoMaxWidth = sal_True;
+ mbInSwitching = sal_False;
+ mbAutoEditMode = sal_False;
+ mbEditCanceled = sal_False;
+ mbDropPos = sal_False;
+ mbInSelect = sal_False;
+ mbSelColor = sal_False;
+ mbSelTextColor = sal_False;
+ mbMirrored = sal_False;
if ( nWinStyle & WB_3DTAB )
mnOffY++;
ImplInitControls();
+
+ if(mpFirstBtn)
+ mpFirstBtn->SetAccessibleName(String(SvtResId(STR_TABBAR_PUSHBUTTON_MOVET0HOME)));
+ if(mpPrevBtn)
+ mpPrevBtn->SetAccessibleName( String(SvtResId(STR_TABBAR_PUSHBUTTON_MOVELEFT)));
+ if(mpNextBtn)
+ mpNextBtn->SetAccessibleName(String(SvtResId(STR_TABBAR_PUSHBUTTON_MOVERIGHT)));
+ if(mpLastBtn)
+ mpLastBtn->SetAccessibleName( String(SvtResId(STR_TABBAR_PUSHBUTTON_MOVETOEND)));
+
SetSizePixel( Size( 100, CalcWindowSizePixel().Height() ) );
- ImplInitSettings( TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True );
}
// -----------------------------------------------------------------------
@@ -432,7 +441,7 @@ TabBar::TabBar( Window* pParent, WinBits nWinStyle ) :
TabBar::~TabBar()
{
- EndEditMode( TRUE );
+ EndEditMode( sal_True );
// Controls loeschen
if ( mpPrevBtn )
@@ -480,7 +489,7 @@ ImplTabBarItem* TabBar::next()
// -----------------------------------------------------------------------
-void TabBar::ImplInitSettings( BOOL bFont, BOOL bBackground )
+void TabBar::ImplInitSettings( sal_Bool bFont, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -554,12 +563,12 @@ void TabBar::ImplGetColors( Color& rFaceColor, Color& rFaceTextColor,
// -----------------------------------------------------------------------
-BOOL TabBar::ImplCalcWidth()
+sal_Bool TabBar::ImplCalcWidth()
{
// Groessen muessen nur ermittelt werden, wenn sich Text aendert oder
// wenn der Font geaendert wurde
if ( !mbSizeFormat )
- return FALSE;
+ return sal_False;
// Breiten der Tabs mit dem fetten Font ermitteln
Font aFont = GetFont();
@@ -582,28 +591,28 @@ BOOL TabBar::ImplCalcWidth()
else
mnCurMaxWidth = 0;
- BOOL bChanged = FALSE;
+ sal_Bool bChanged = sal_False;
for ( size_t i = 0, n = mpItemList->size(); i < n; ++i )
{
ImplTabBarItem* pItem = (*mpItemList)[ i ];
long nNewWidth = GetTextWidth( pItem->maText );
if ( mnCurMaxWidth && (nNewWidth > mnCurMaxWidth) )
{
- pItem->mbShort = TRUE;
+ pItem->mbShort = sal_True;
nNewWidth = mnCurMaxWidth;
}
else
- pItem->mbShort = FALSE;
+ pItem->mbShort = sal_False;
nNewWidth += TABBAR_OFFSET_X+TABBAR_OFFSET_X2;
if ( pItem->mnWidth != nNewWidth )
{
pItem->mnWidth = nNewWidth;
if ( !pItem->maRect.IsEmpty() )
- bChanged = TRUE;
+ bChanged = sal_True;
}
}
- mbSizeFormat = FALSE;
- mbFormat = TRUE;
+ mbSizeFormat = sal_False;
+ mbFormat = sal_True;
return bChanged;
}
@@ -616,7 +625,7 @@ void TabBar::ImplFormat()
if ( !mbFormat )
return;
- USHORT n = 0;
+ sal_uInt16 n = 0;
long x = mnOffX;
for ( size_t i = 0, nL = mpItemList->size(); i < nL; ++i )
{
@@ -650,7 +659,7 @@ void TabBar::ImplFormat()
n++;
}
- mbFormat = FALSE;
+ mbFormat = sal_False;
// Button enablen/disablen
ImplEnableControls();
@@ -658,13 +667,13 @@ void TabBar::ImplFormat()
// -----------------------------------------------------------------------
-USHORT TabBar::ImplGetLastFirstPos()
+sal_uInt16 TabBar::ImplGetLastFirstPos()
{
- USHORT nCount = (USHORT)(mpItemList->size());
+ sal_uInt16 nCount = (sal_uInt16)(mpItemList->size());
if ( !nCount || mbSizeFormat || mbFormat )
return 0;
- USHORT nLastFirstPos = nCount-1;
+ sal_uInt16 nLastFirstPos = nCount-1;
long nWinWidth = mnLastOffX-mnOffX-TABBAR_OFFSET_X-ADDNEWPAGE_AREAWIDTH;
long nWidth = (*mpItemList)[ nLastFirstPos ]->mnWidth;
while ( nLastFirstPos && (nWidth < nWinWidth) )
@@ -672,7 +681,7 @@ USHORT TabBar::ImplGetLastFirstPos()
nLastFirstPos--;
nWidth += (*mpItemList)[ nLastFirstPos ]->mnWidth;
}
- if ( (nLastFirstPos != (USHORT)(mpItemList->size()-1)) &&
+ if ( (nLastFirstPos != (sal_uInt16)(mpItemList->size()-1)) &&
(nWidth > nWinWidth) )
nLastFirstPos++;
return nLastFirstPos;
@@ -754,7 +763,7 @@ void TabBar::ImplEnableControls()
return;
// Buttons enablen/disblen
- BOOL bEnableBtn = mnFirstPos > 0;
+ sal_Bool bEnableBtn = mnFirstPos > 0;
if ( mpFirstBtn )
mpFirstBtn->Enable( bEnableBtn );
if ( mpPrevBtn )
@@ -769,7 +778,7 @@ void TabBar::ImplEnableControls()
// -----------------------------------------------------------------------
-void TabBar::ImplShowPage( USHORT nPos )
+void TabBar::ImplShowPage( sal_uInt16 nPos )
{
// Breite berechnen
long nWidth = GetOutputSizePixel().Width();
@@ -782,7 +791,7 @@ void TabBar::ImplShowPage( USHORT nPos )
{
while ( pItem->maRect.Right() > nWidth )
{
- USHORT nNewPos = mnFirstPos+1;
+ sal_uInt16 nNewPos = mnFirstPos+1;
SetFirstPageId( GetPageId( nNewPos ) );
ImplFormat();
if ( nNewPos != mnFirstPos )
@@ -797,7 +806,7 @@ IMPL_LINK( TabBar, ImplClickHdl, ImplTabButton*, pBtn )
{
EndEditMode();
- USHORT nNewPos = mnFirstPos;
+ sal_uInt16 nNewPos = mnFirstPos;
if ( pBtn == mpFirstBtn )
nNewPos = 0;
@@ -808,13 +817,13 @@ IMPL_LINK( TabBar, ImplClickHdl, ImplTabButton*, pBtn )
}
else if ( pBtn == mpNextBtn )
{
- USHORT nCount = GetPageCount();
+ sal_uInt16 nCount = GetPageCount();
if ( mnFirstPos < nCount )
nNewPos = mnFirstPos+1;
}
else
{
- USHORT nCount = GetPageCount();
+ sal_uInt16 nCount = GetPageCount();
if ( nCount )
nNewPos = nCount-1;
}
@@ -829,7 +838,7 @@ IMPL_LINK( TabBar, ImplClickHdl, ImplTabButton*, pBtn )
void TabBar::MouseMove( const MouseEvent& rMEvt )
{
if ( rMEvt.IsLeaveWindow() )
- mbInSelect = FALSE;
+ mbInSelect = sal_False;
Window::MouseMove( rMEvt );
}
@@ -847,14 +856,14 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
}
ImplTabBarItem* pItem;
- USHORT nSelId = GetPageId( rMEvt.GetPosPixel() );
+ sal_uInt16 nSelId = GetPageId( rMEvt.GetPosPixel() );
if ( !rMEvt.IsLeft() )
{
Window::MouseButtonDown( rMEvt );
if ( (nSelId > 0) && (nSelId != mnCurPageId) )
{
- USHORT nPos = GetPagePos( nSelId );
+ sal_uInt16 nPos = GetPagePos( nSelId );
pItem = (*mpItemList)[ nPos ];
if ( pItem->mbEnable )
@@ -866,7 +875,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
ImplActivatePage();
ImplSelect();
}
- mbInSelect = TRUE;
+ mbInSelect = sal_True;
}
}
return;
@@ -882,8 +891,8 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
{
if ( nSelId )
{
- USHORT nPos = GetPagePos( nSelId );
- BOOL bSelectTab = FALSE;
+ sal_uInt16 nPos = GetPagePos( nSelId );
+ sal_Bool bSelectTab = sal_False;
pItem = (*mpItemList)[ nPos ];
if ( pItem->mbEnable )
@@ -893,15 +902,15 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
if ( nSelId != mnCurPageId )
{
SelectPage( nSelId, !IsPageSelected( nSelId ) );
- bSelectTab = TRUE;
+ bSelectTab = sal_True;
}
}
else if ( mnWinStyle & (WB_MULTISELECT | WB_RANGESELECT) )
{
- bSelectTab = TRUE;
- USHORT n;
- BOOL bSelect;
- USHORT nCurPos = GetPagePos( mnCurPageId );
+ bSelectTab = sal_True;
+ sal_uInt16 n;
+ sal_Bool bSelect;
+ sal_uInt16 nCurPos = GetPagePos( mnCurPageId );
if ( nPos <= nCurPos )
{
// Alle Tabs bis zur angeklickten Tab deselektieren
@@ -912,9 +921,9 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
{
pItem = (*mpItemList)[ n ];
if ( n < nPos )
- bSelect = FALSE;
+ bSelect = sal_False;
else
- bSelect = TRUE;
+ bSelect = sal_True;
if ( pItem->mbSelect != bSelect )
{
@@ -932,16 +941,16 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
// Alle Tabs von der aktuellen bis zur angeklickten
// Tab selektieren und alle Tabs von der angeklickten
// Tab bis zur letzten Tab deselektieren
- USHORT nCount = (USHORT)mpItemList->size();
+ sal_uInt16 nCount = (sal_uInt16)mpItemList->size();
n = nCurPos;
while ( n < nCount )
{
pItem = (*mpItemList)[ n ];
if ( n <= nPos )
- bSelect = TRUE;
+ bSelect = sal_True;
else
- bSelect = FALSE;
+ bSelect = sal_False;
if ( pItem->mbSelect != bSelect )
{
@@ -965,7 +974,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
}
else
ImplShowPage( nPos );
- mbInSelect = TRUE;
+ mbInSelect = sal_True;
return;
}
@@ -975,7 +984,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
// Gegebenenfalls den Double-Click-Handler rufen
if ( !rMEvt.GetModifier() && (!nSelId || (nSelId == mnCurPageId)) )
{
- USHORT nOldCurId = mnCurPageId;
+ sal_uInt16 nOldCurId = mnCurPageId;
mnCurPageId = nSelId;
DoubleClick();
// Abfrage, da im DoubleClick-Handler die aktuelle Seite
@@ -993,7 +1002,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
// Nur Select ausfuehren, wenn noch nicht aktuelle Page
if ( nSelId != mnCurPageId )
{
- USHORT nPos = GetPagePos( nSelId );
+ sal_uInt16 nPos = GetPagePos( nSelId );
pItem = (*mpItemList)[ nPos ];
if ( pItem->mbEnable )
@@ -1001,9 +1010,9 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
if ( !pItem->mbSelect )
{
// Muss invalidiert werden
- BOOL bUpdate = FALSE;
+ sal_Bool bUpdate = sal_False;
if ( IsReallyVisible() && IsUpdateMode() )
- bUpdate = TRUE;
+ bUpdate = sal_True;
// Alle selektierten Items deselektieren
for ( size_t i = 0, n = mpItemList->size(); i < n; ++i )
@@ -1011,7 +1020,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
pItem = (*mpItemList)[ i ];
if ( pItem->mbSelect || (pItem->mnId == mnCurPageId) )
{
- pItem->mbSelect = FALSE;
+ pItem->mbSelect = sal_False;
if ( bUpdate )
Invalidate( pItem->maRect );
}
@@ -1028,7 +1037,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
}
else
ImplShowPage( nPos );
- mbInSelect = TRUE;
+ mbInSelect = sal_True;
}
return;
@@ -1042,7 +1051,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
void TabBar::MouseButtonUp( const MouseEvent& rMEvt )
{
- mbInSelect = FALSE;
+ mbInSelect = sal_False;
Window::MouseButtonUp( rMEvt );
}
@@ -1242,7 +1251,8 @@ public:
void drawPlusImage()
{
- Image aPlusImg( SvtResId(BMP_LIST_ADD) );
+ SvtResId id( BMP_LIST_ADD );
+ Image aPlusImg( id );
// Center the image within the bounding rectangle.
Size aSize = aPlusImg.GetSizePixel();
Point pt = maRect.TopLeft();
@@ -1323,7 +1333,7 @@ private:
void TabBar::Paint( const Rectangle& )
{
// Items berechnen und ausgeben
- USHORT nItemCount = (USHORT)mpItemList->size();
+ sal_uInt16 nItemCount = (sal_uInt16)mpItemList->size();
if (!nItemCount)
return;
@@ -1456,7 +1466,7 @@ void TabBar::Resize()
// Scroll-Buttons anordnen
long nHeight = aNewSize.Height();
// Font in der groesse Anpassen?
- ImplInitSettings( TRUE, FALSE );
+ ImplInitSettings( sal_True, sal_False );
long nX = mbMirrored ? (aNewSize.Width()-nHeight) : 0;
long nXDiff = mbMirrored ? -nHeight : nHeight;
@@ -1502,7 +1512,7 @@ void TabBar::Resize()
}
// Neu formatieren
- mbSizeFormat = TRUE;
+ mbSizeFormat = sal_True;
if ( IsReallyVisible() )
{
if ( ImplCalcWidth() )
@@ -1518,7 +1528,7 @@ void TabBar::Resize()
void TabBar::RequestHelp( const HelpEvent& rHEvt )
{
- USHORT nItemId = GetPageId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
+ sal_uInt16 nItemId = GetPageId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
if ( nItemId )
{
if ( rHEvt.GetMode() & HELPMODE_BALLOON )
@@ -1539,13 +1549,13 @@ void TabBar::RequestHelp( const HelpEvent& rHEvt )
}
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
- ULONG nHelpId = GetHelpId( nItemId );
- if ( nHelpId )
+ rtl::OUString aHelpId( rtl::OStringToOUString( GetHelpId( nItemId ), RTL_TEXTENCODING_UTF8 ) );
+ if ( aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pHelp->Start( nHelpId, this );
+ pHelp->Start( aHelpId, this );
return;
}
}
@@ -1554,7 +1564,7 @@ void TabBar::RequestHelp( const HelpEvent& rHEvt )
// wenn dieser abgeschnitten oder nicht voll sichtbar ist
if ( rHEvt.GetMode() & (HELPMODE_QUICK | HELPMODE_BALLOON) )
{
- USHORT nPos = GetPagePos( nItemId );
+ sal_uInt16 nPos = GetPagePos( nItemId );
ImplTabBarItem* pItem = (*mpItemList)[ nPos ];
if ( pItem->mbShort ||
(pItem->maRect.Right()-TABBAR_OFFSET_X-5 > mnLastOffX) )
@@ -1596,14 +1606,14 @@ void TabBar::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( TRUE, FALSE );
+ ImplInitSettings( sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
Invalidate();
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_True );
Invalidate();
}
else if ( nType == STATE_CHANGE_MIRRORING )
@@ -1629,7 +1639,7 @@ void TabBar::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True );
Invalidate();
}
}
@@ -1693,7 +1703,7 @@ long TabBar::ImplDeactivatePage()
void TabBar::ImplPrePaint()
{
- USHORT nItemCount = (USHORT)mpItemList->size();
+ sal_uInt16 nItemCount = (sal_uInt16)mpItemList->size();
if (!nItemCount)
return;
@@ -1706,7 +1716,7 @@ void TabBar::ImplPrePaint()
// sichtbar wird
if ( mbFirstFormat )
{
- mbFirstFormat = FALSE;
+ mbFirstFormat = sal_False;
if ( mnCurPageId && (mnFirstPos == 0) && !mbDropPos )
{
@@ -1715,9 +1725,9 @@ void TabBar::ImplPrePaint()
{
// mbDropPos setzen (bzw. misbrauchen) um Invalidate()
// zu unterbinden
- mbDropPos = TRUE;
+ mbDropPos = sal_True;
SetFirstPageId( mnCurPageId );
- mbDropPos = FALSE;
+ mbDropPos = sal_False;
if ( mnFirstPos != 0 )
ImplFormat();
}
@@ -1725,10 +1735,10 @@ void TabBar::ImplPrePaint()
}
}
-ImplTabBarItem* TabBar::ImplGetLastTabBarItem( USHORT nItemCount )
+ImplTabBarItem* TabBar::ImplGetLastTabBarItem( sal_uInt16 nItemCount )
{
// letzten sichtbaren Eintrag suchen
- USHORT n = mnFirstPos+1;
+ sal_uInt16 n = mnFirstPos+1;
if ( n >= nItemCount )
n = nItemCount-1;
ImplTabBarItem* pItem = seek( n );
@@ -1772,7 +1782,7 @@ long TabBar::DeactivatePage()
if ( maDeactivatePageHdl.IsSet() )
return maDeactivatePageHdl.Call( this );
else
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -1782,7 +1792,7 @@ long TabBar::StartRenaming()
if ( maStartRenamingHdl.IsSet() )
return maStartRenamingHdl.Call( this );
else
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -1792,7 +1802,7 @@ long TabBar::AllowRenaming()
if ( maAllowRenamingHdl.IsSet() )
return maAllowRenamingHdl.Call( this );
else
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -1811,8 +1821,8 @@ void TabBar::Mirror()
// -----------------------------------------------------------------------
-void TabBar::InsertPage( USHORT nPageId, const XubString& rText,
- TabBarPageBits nBits, USHORT nPos )
+void TabBar::InsertPage( sal_uInt16 nPageId, const XubString& rText,
+ TabBarPageBits nBits, sal_uInt16 nPos )
{
DBG_ASSERT( nPageId, "TabBar::InsertPage(): PageId == 0" );
DBG_ASSERT( GetPagePos( nPageId ) == PAGE_NOT_FOUND,
@@ -1828,7 +1838,6 @@ void TabBar::InsertPage( USHORT nPageId, const XubString& rText,
} else {
mpItemList->push_back( pItem );
}
- mbSizeFormat = TRUE;
// CurPageId gegebenenfalls setzen
if ( !mnCurPageId )
@@ -1843,9 +1852,9 @@ void TabBar::InsertPage( USHORT nPageId, const XubString& rText,
// -----------------------------------------------------------------------
-Color TabBar::GetTabBgColor( USHORT nPageId ) const
+Color TabBar::GetTabBgColor( sal_uInt16 nPageId ) const
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
return (*mpItemList)[ nPos ]->maTabBgColor;
@@ -1853,9 +1862,9 @@ Color TabBar::GetTabBgColor( USHORT nPageId ) const
return Color( COL_AUTO );
}
-void TabBar::SetTabBgColor( USHORT nPageId, const Color& aTabBgColor )
+void TabBar::SetTabBgColor( sal_uInt16 nPageId, const Color& aTabBgColor )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
ImplTabBarItem* pItem;
if ( nPos != PAGE_NOT_FOUND )
{
@@ -1878,9 +1887,9 @@ void TabBar::SetTabBgColor( USHORT nPageId, const Color& aTabBgColor )
// -----------------------------------------------------------------------
-void TabBar::RemovePage( USHORT nPageId )
+void TabBar::RemovePage( sal_uInt16 nPageId )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
// Existiert Item
if ( nPos != PAGE_NOT_FOUND )
@@ -1897,7 +1906,6 @@ void TabBar::RemovePage( USHORT nPageId )
::std::advance( it, nPos );
delete *it;
mpItemList->erase( it );
- mbFormat = TRUE;
// Leiste neu ausgeben
if ( IsReallyVisible() && IsUpdateMode() )
@@ -1909,9 +1917,9 @@ void TabBar::RemovePage( USHORT nPageId )
// -----------------------------------------------------------------------
-void TabBar::MovePage( USHORT nPageId, USHORT nNewPos )
+void TabBar::MovePage( sal_uInt16 nPageId, sal_uInt16 nNewPos )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
Pair aPair( nPos, nNewPos );
if ( nPos < nNewPos )
@@ -1935,7 +1943,6 @@ void TabBar::MovePage( USHORT nPageId, USHORT nNewPos )
} else {
mpItemList->push_back( pItem );
}
- mbFormat = TRUE;
// Leiste neu ausgeben
if ( IsReallyVisible() && IsUpdateMode() )
@@ -1956,7 +1963,7 @@ void TabBar::Clear()
mpItemList->clear();
// Items aus der Liste loeschen
- mbSizeFormat = TRUE;
+ mbSizeFormat = sal_True;
mnCurPageId = 0;
mnFirstPos = 0;
maCurrentItemList = 0;
@@ -1970,9 +1977,9 @@ void TabBar::Clear()
// -----------------------------------------------------------------------
-void TabBar::EnablePage( USHORT nPageId, BOOL bEnable )
+void TabBar::EnablePage( sal_uInt16 nPageId, sal_Bool bEnable )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
{
@@ -1993,21 +2000,21 @@ void TabBar::EnablePage( USHORT nPageId, BOOL bEnable )
// -----------------------------------------------------------------------
-BOOL TabBar::IsPageEnabled( USHORT nPageId ) const
+sal_Bool TabBar::IsPageEnabled( sal_uInt16 nPageId ) const
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
return (*mpItemList)[ nPos ]->mbEnable;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void TabBar::SetPageBits( USHORT nPageId, TabBarPageBits nBits )
+void TabBar::SetPageBits( sal_uInt16 nPageId, TabBarPageBits nBits )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
{
@@ -2026,37 +2033,37 @@ void TabBar::SetPageBits( USHORT nPageId, TabBarPageBits nBits )
// -----------------------------------------------------------------------
-TabBarPageBits TabBar::GetPageBits( USHORT nPageId ) const
+TabBarPageBits TabBar::GetPageBits( sal_uInt16 nPageId ) const
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
return (*mpItemList)[ nPos ]->mnBits;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-USHORT TabBar::GetPageCount() const
+sal_uInt16 TabBar::GetPageCount() const
{
- return (USHORT)mpItemList->size();
+ return (sal_uInt16)mpItemList->size();
}
// -----------------------------------------------------------------------
-USHORT TabBar::GetPageId( USHORT nPos ) const
+sal_uInt16 TabBar::GetPageId( sal_uInt16 nPos ) const
{
return ( nPos < mpItemList->size() ) ? (*mpItemList)[ nPos ]->mnId : 0;
}
// -----------------------------------------------------------------------
-USHORT TabBar::GetPagePos( USHORT nPageId ) const
+sal_uInt16 TabBar::GetPagePos( sal_uInt16 nPageId ) const
{
for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
if ( (*mpItemList)[ i ]->mnId == nPageId ) {
- return USHORT( i );
+ return sal_uInt16( i );
}
}
return PAGE_NOT_FOUND;
@@ -2085,9 +2092,9 @@ sal_uInt16 TabBar::GetPageId( const Point& rPos, bool bCheckInsTab ) const
// -----------------------------------------------------------------------
-Rectangle TabBar::GetPageRect( USHORT nPageId ) const
+Rectangle TabBar::GetPageRect( sal_uInt16 nPageId ) const
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
return (*mpItemList)[ nPos ]->maRect;
@@ -2097,9 +2104,9 @@ Rectangle TabBar::GetPageRect( USHORT nPageId ) const
// -----------------------------------------------------------------------
-void TabBar::SetCurPageId( USHORT nPageId )
+void TabBar::SetCurPageId( sal_uInt16 nPageId )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
// Wenn Item nicht existiert, dann nichts machen
if ( nPos != PAGE_NOT_FOUND )
@@ -2110,9 +2117,9 @@ void TabBar::SetCurPageId( USHORT nPageId )
return;
// Muss invalidiert werden
- BOOL bUpdate = FALSE;
+ sal_Bool bUpdate = sal_False;
if ( IsReallyVisible() && IsUpdateMode() )
- bUpdate = TRUE;
+ bUpdate = sal_True;
ImplTabBarItem* pItem = (*mpItemList)[ nPos ];
ImplTabBarItem* pOldItem;
@@ -2126,14 +2133,14 @@ void TabBar::SetCurPageId( USHORT nPageId )
// deselktieren, wenn dies die einzige selektierte Seite ist
if ( !pItem->mbSelect && pOldItem )
{
- USHORT nSelPageCount = GetSelectPageCount();
+ sal_uInt16 nSelPageCount = GetSelectPageCount();
if ( nSelPageCount == 1 )
- pOldItem->mbSelect = FALSE;
- pItem->mbSelect = TRUE;
+ pOldItem->mbSelect = sal_False;
+ pItem->mbSelect = sal_True;
}
mnCurPageId = nPageId;
- mbFormat = TRUE;
+ mbFormat = sal_True;
// Dafuer sorgen, das aktuelle Page sichtbar wird
if ( IsReallyVisible() )
@@ -2155,7 +2162,7 @@ void TabBar::SetCurPageId( USHORT nPageId )
while ( (mbMirrored ? (pItem->maRect.Left() < mnOffX) : (pItem->maRect.Right() > nWidth)) ||
pItem->maRect.IsEmpty() )
{
- USHORT nNewPos = mnFirstPos+1;
+ sal_uInt16 nNewPos = mnFirstPos+1;
// Dafuer sorgen, das min. die aktuelle TabPages als
// erste TabPage sichtbar ist
if ( nNewPos >= nPos )
@@ -2186,12 +2193,12 @@ void TabBar::SetCurPageId( USHORT nPageId )
// -----------------------------------------------------------------------
-void TabBar::MakeVisible( USHORT nPageId )
+void TabBar::MakeVisible( sal_uInt16 nPageId )
{
if ( !IsReallyVisible() )
return;
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
// Wenn Item nicht existiert, dann nichts machen
if ( nPos != PAGE_NOT_FOUND )
@@ -2209,14 +2216,14 @@ void TabBar::MakeVisible( USHORT nPageId )
if ( mbFormat || pItem->maRect.IsEmpty() )
{
- mbFormat = TRUE;
+ mbFormat = sal_True;
ImplFormat();
}
while ( (pItem->maRect.Right() > nWidth) ||
pItem->maRect.IsEmpty() )
{
- USHORT nNewPos = mnFirstPos+1;
+ sal_uInt16 nNewPos = mnFirstPos+1;
// Dafuer sorgen, das min. die aktuelle TabPages als
// erste TabPage sichtbar ist
if ( nNewPos >= nPos )
@@ -2238,11 +2245,11 @@ void TabBar::MakeVisible( USHORT nPageId )
// -----------------------------------------------------------------------
-void TabBar::SetFirstPageId( USHORT nPageId )
+void TabBar::SetFirstPageId( sal_uInt16 nPageId )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
- // Wenn Item nicht existiert, dann FALSE zurueckgeben
+ // Wenn Item nicht existiert, dann sal_False zurueckgeben
if ( nPos != PAGE_NOT_FOUND )
{
if ( nPos != mnFirstPos )
@@ -2250,8 +2257,8 @@ void TabBar::SetFirstPageId( USHORT nPageId )
// Dafuer sorgen, das nach Moeglichkteit soviele Pages wie
// moeglich sichtbar sind
ImplFormat();
- USHORT nLastFirstPos = ImplGetLastFirstPos();
- USHORT nNewPos;
+ sal_uInt16 nLastFirstPos = ImplGetLastFirstPos();
+ sal_uInt16 nNewPos;
if ( nPos > nLastFirstPos )
nNewPos = nLastFirstPos;
else
@@ -2260,7 +2267,7 @@ void TabBar::SetFirstPageId( USHORT nPageId )
if ( nNewPos != mnFirstPos )
{
mnFirstPos = nNewPos;
- mbFormat = TRUE;
+ mbFormat = sal_True;
// Leiste neu ausgeben (Achtung: mbDropPos beachten, da wenn
// dieses Flag gesetzt ist, wird direkt gepaintet)
@@ -2273,9 +2280,9 @@ void TabBar::SetFirstPageId( USHORT nPageId )
// -----------------------------------------------------------------------
-void TabBar::SelectPage( USHORT nPageId, BOOL bSelect )
+void TabBar::SelectPage( sal_uInt16 nPageId, sal_Bool bSelect )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
{
@@ -2294,10 +2301,10 @@ void TabBar::SelectPage( USHORT nPageId, BOOL bSelect )
// -----------------------------------------------------------------------
-void TabBar::SelectPageRange( BOOL bSelect, USHORT nStartPos, USHORT nEndPos )
+void TabBar::SelectPageRange( sal_Bool bSelect, sal_uInt16 nStartPos, sal_uInt16 nEndPos )
{
Rectangle aPaintRect;
- USHORT nPos = nStartPos;
+ sal_uInt16 nPos = nStartPos;
ImplTabBarItem* pItem = seek( nPos );
while ( pItem && (nPos <= nEndPos) )
{
@@ -2318,9 +2325,9 @@ void TabBar::SelectPageRange( BOOL bSelect, USHORT nStartPos, USHORT nEndPos )
// -----------------------------------------------------------------------
-USHORT TabBar::GetSelectPage( USHORT nSelIndex ) const
+sal_uInt16 TabBar::GetSelectPage( sal_uInt16 nSelIndex ) const
{
- USHORT nSelected = 0;
+ sal_uInt16 nSelected = 0;
for ( size_t i = 0, n = mpItemList->size(); i < n; ++i )
{
ImplTabBarItem* pItem = (*mpItemList)[ i ];
@@ -2336,9 +2343,9 @@ USHORT TabBar::GetSelectPage( USHORT nSelIndex ) const
// -----------------------------------------------------------------------
-USHORT TabBar::GetSelectPageCount() const
+sal_uInt16 TabBar::GetSelectPageCount() const
{
- USHORT nSelected = 0;
+ sal_uInt16 nSelected = 0;
for ( size_t i = 0, n = mpItemList->size(); i < n; ++i )
{
ImplTabBarItem* pItem = (*mpItemList)[ i ];
@@ -2351,22 +2358,22 @@ USHORT TabBar::GetSelectPageCount() const
// -----------------------------------------------------------------------
-BOOL TabBar::IsPageSelected( USHORT nPageId ) const
+sal_Bool TabBar::IsPageSelected( sal_uInt16 nPageId ) const
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
return (*mpItemList)[ nPos ]->mbSelect;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL TabBar::StartEditMode( USHORT nPageId )
+sal_Bool TabBar::StartEditMode( sal_uInt16 nPageId )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( mpEdit || (nPos == PAGE_NOT_FOUND) || (mnLastOffX < 8) )
- return FALSE;
+ return sal_False;
mnEditId = nPageId;
if ( StartRenaming() )
@@ -2418,23 +2425,23 @@ BOOL TabBar::StartEditMode( USHORT nPageId )
mpEdit->GrabFocus();
mpEdit->SetSelection( Selection( 0, mpEdit->GetText().Len() ) );
mpEdit->Show();
- return TRUE;
+ return sal_True;
}
else
{
mnEditId = 0;
- return FALSE;
+ return sal_False;
}
}
// -----------------------------------------------------------------------
-void TabBar::EndEditMode( BOOL bCancel )
+void TabBar::EndEditMode( sal_Bool bCancel )
{
if ( mpEdit )
{
// call hdl
- BOOL bEnd = TRUE;
+ sal_Bool bEnd = sal_True;
mbEditCanceled = bCancel;
maEditText = mpEdit->GetText();
mpEdit->SetPostEvent();
@@ -2444,9 +2451,9 @@ void TabBar::EndEditMode( BOOL bCancel )
if ( nAllowRenaming == TABBAR_RENAMING_YES )
SetPageText( mnEditId, maEditText );
else if ( nAllowRenaming == TABBAR_RENAMING_NO )
- bEnd = FALSE;
+ bEnd = sal_False;
else // nAllowRenaming == TABBAR_RENAMING_CANCEL
- mbEditCanceled = TRUE;
+ mbEditCanceled = sal_True;
}
// renaming not allowed, than reset edit data
@@ -2466,30 +2473,30 @@ void TabBar::EndEditMode( BOOL bCancel )
// reset
maEditText.Erase();
- mbEditCanceled = FALSE;
+ mbEditCanceled = sal_False;
}
}
// -----------------------------------------------------------------------
-void TabBar::SetMirrored( BOOL bMirrored )
+void TabBar::SetMirrored( sal_Bool bMirrored )
{
if( mbMirrored != bMirrored )
{
mbMirrored = bMirrored;
- mbSizeFormat = TRUE;
+ mbSizeFormat = sal_True;
ImplInitControls(); // for button images
Resize(); // recalculates control positions
Mirror();
}
}
-void TabBar::SetEffectiveRTL( BOOL bRTL )
+void TabBar::SetEffectiveRTL( sal_Bool bRTL )
{
SetMirrored( bRTL != Application::GetSettings().GetLayoutRTL() );
}
-BOOL TabBar::IsEffectiveRTL() const
+sal_Bool TabBar::IsEffectiveRTL() const
{
return IsMirrored() != Application::GetSettings().GetLayoutRTL();
}
@@ -2501,7 +2508,7 @@ void TabBar::SetMaxPageWidth( long nMaxWidth )
if ( mnMaxPageWidth != nMaxWidth )
{
mnMaxPageWidth = nMaxWidth;
- mbSizeFormat = TRUE;
+ mbSizeFormat = sal_True;
// Leiste neu ausgeben
if ( IsReallyVisible() && IsUpdateMode() )
@@ -2516,7 +2523,7 @@ void TabBar::SetSelectColor()
if ( mbSelColor )
{
maSelColor = Color( COL_TRANSPARENT );
- mbSelColor = FALSE;
+ mbSelColor = sal_False;
Invalidate();
}
}
@@ -2530,7 +2537,7 @@ void TabBar::SetSelectColor( const Color& rColor )
if ( mbSelColor )
{
maSelColor = Color( COL_TRANSPARENT );
- mbSelColor = FALSE;
+ mbSelColor = sal_False;
Invalidate();
}
}
@@ -2539,7 +2546,7 @@ void TabBar::SetSelectColor( const Color& rColor )
if ( maSelColor != rColor )
{
maSelColor = rColor;
- mbSelColor = TRUE;
+ mbSelColor = sal_True;
Invalidate();
}
}
@@ -2552,7 +2559,7 @@ void TabBar::SetSelectTextColor()
if ( mbSelTextColor )
{
maSelTextColor = Color( COL_TRANSPARENT );
- mbSelTextColor = FALSE;
+ mbSelTextColor = sal_False;
Invalidate();
}
}
@@ -2566,7 +2573,7 @@ void TabBar::SetSelectTextColor( const Color& rColor )
if ( mbSelTextColor )
{
maSelTextColor = Color( COL_TRANSPARENT );
- mbSelTextColor = FALSE;
+ mbSelTextColor = sal_False;
Invalidate();
}
}
@@ -2575,7 +2582,7 @@ void TabBar::SetSelectTextColor( const Color& rColor )
if ( maSelTextColor != rColor )
{
maSelTextColor = rColor;
- mbSelTextColor = TRUE;
+ mbSelTextColor = sal_True;
Invalidate();
}
}
@@ -2583,13 +2590,13 @@ void TabBar::SetSelectTextColor( const Color& rColor )
// -----------------------------------------------------------------------
-void TabBar::SetPageText( USHORT nPageId, const XubString& rText )
+void TabBar::SetPageText( sal_uInt16 nPageId, const XubString& rText )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
{
(*mpItemList)[ nPos ]->maText = rText;
- mbSizeFormat = TRUE;
+ mbSizeFormat = sal_True;
// Leiste neu ausgeben
if ( IsReallyVisible() && IsUpdateMode() )
@@ -2601,9 +2608,9 @@ void TabBar::SetPageText( USHORT nPageId, const XubString& rText )
// -----------------------------------------------------------------------
-XubString TabBar::GetPageText( USHORT nPageId ) const
+XubString TabBar::GetPageText( sal_uInt16 nPageId ) const
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
return (*mpItemList)[ nPos ]->maText;
else
@@ -2612,26 +2619,26 @@ XubString TabBar::GetPageText( USHORT nPageId ) const
// -----------------------------------------------------------------------
-void TabBar::SetHelpText( USHORT nPageId, const XubString& rText )
+void TabBar::SetHelpText( sal_uInt16 nPageId, const XubString& rText )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
(*mpItemList)[ nPos ]->maHelpText = rText;
}
// -----------------------------------------------------------------------
-XubString TabBar::GetHelpText( USHORT nPageId ) const
+XubString TabBar::GetHelpText( sal_uInt16 nPageId ) const
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
{
ImplTabBarItem* pItem = (*mpItemList)[ nPos ];
- if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
+ if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
+ pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return pItem->maHelpText;
@@ -2642,22 +2649,22 @@ XubString TabBar::GetHelpText( USHORT nPageId ) const
// -----------------------------------------------------------------------
-void TabBar::SetHelpId( USHORT nPageId, ULONG nHelpId )
+void TabBar::SetHelpId( sal_uInt16 nPageId, const rtl::OString& rHelpId )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
- (*mpItemList)[ nPos ]->mnHelpId = nHelpId;
+ (*mpItemList)[ nPos ]->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
-ULONG TabBar::GetHelpId( USHORT nPageId ) const
+rtl::OString TabBar::GetHelpId( sal_uInt16 nPageId ) const
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
+ rtl::OString aRet;
if ( nPos != PAGE_NOT_FOUND )
- return (*mpItemList)[ nPos ]->mnHelpId;
- else
- return 0;
+ return (*mpItemList)[ nPos ]->maHelpId;
+ return aRet;
}
// -----------------------------------------------------------------------
@@ -2674,10 +2681,10 @@ long TabBar::GetMinSize() const
// -----------------------------------------------------------------------
-BOOL TabBar::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
+sal_Bool TabBar::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
{
if ( !(mnWinStyle & WB_DRAG) || (rCEvt.GetCommand() != COMMAND_STARTDRAG) )
- return FALSE;
+ return sal_False;
// Testen, ob angeklickte Seite selektiert ist. Falls dies nicht
// der Fall ist, setzen wir ihn als aktuellen Eintrag. Falls Drag and
@@ -2687,11 +2694,11 @@ BOOL TabBar::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
// da der Select schon den Bereich gescrollt haben kann
if ( rCEvt.IsMouseEvent() && !mbInSelect )
{
- USHORT nSelId = GetPageId( rCEvt.GetMousePosPixel() );
+ sal_uInt16 nSelId = GetPageId( rCEvt.GetMousePosPixel() );
// Falls kein Eintrag angeklickt wurde, starten wir kein Dragging
if ( !nSelId )
- return FALSE;
+ return sal_False;
// Testen, ob Seite selektiertiert ist. Falls nicht, als aktuelle
// Seite setzen und Select rufen.
@@ -2705,34 +2712,34 @@ BOOL TabBar::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
ImplSelect();
}
else
- return FALSE;
+ return sal_False;
}
}
- mbInSelect = FALSE;
+ mbInSelect = sal_False;
Region aRegion;
// Region zuweisen
rRegion = aRegion;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-USHORT TabBar::ShowDropPos( const Point& rPos )
+sal_uInt16 TabBar::ShowDropPos( const Point& rPos )
{
ImplTabBarItem* pItem;
- USHORT nDropId;
- USHORT nNewDropPos;
- USHORT nItemCount = (USHORT)mpItemList->size();
+ sal_uInt16 nDropId;
+ sal_uInt16 nNewDropPos;
+ sal_uInt16 nItemCount = (sal_uInt16)mpItemList->size();
short nScroll = 0;
if ( rPos.X() > mnLastOffX-TABBAR_DRAG_SCROLLOFF )
{
pItem = (*mpItemList)[ mpItemList->size()-1 ];
if ( !pItem->maRect.IsEmpty() && (rPos.X() > pItem->maRect.Right()) )
- nNewDropPos = (USHORT)mpItemList->size();
+ nNewDropPos = (sal_uInt16)mpItemList->size();
else
{
nNewDropPos = mnFirstPos+1;
@@ -2768,12 +2775,12 @@ USHORT TabBar::ShowDropPos( const Point& rPos )
if ( mbDropPos )
HideDropPos();
- mbDropPos = TRUE;
+ mbDropPos = sal_True;
mnDropPos = nNewDropPos;
if ( nScroll )
{
- USHORT nOldFirstPos = mnFirstPos;
+ sal_uInt16 nOldFirstPos = mnFirstPos;
SetFirstPageId( GetPageId( mnFirstPos+nScroll ) );
// Direkt ausgeben, da kein Paint bei Drag and Drop moeglich
@@ -2790,7 +2797,7 @@ USHORT TabBar::ShowDropPos( const Point& rPos )
Color aBlackColor( COL_BLACK );
long nX;
long nY = (maWinSize.Height()/2)-1;
- USHORT nCurPos = GetPagePos( mnCurPageId );
+ sal_uInt16 nCurPos = GetPagePos( mnCurPageId );
SetLineColor( aBlackColor );
if ( mnDropPos < nItemCount )
@@ -2834,7 +2841,7 @@ void TabBar::HideDropPos()
long nX;
long nY1 = (maWinSize.Height()/2)-3;
long nY2 = nY1 + 5;
- USHORT nItemCount = (USHORT)mpItemList->size();
+ sal_uInt16 nItemCount = (sal_uInt16)mpItemList->size();
if ( mnDropPos < nItemCount )
{
@@ -2861,17 +2868,17 @@ void TabBar::HideDropPos()
SetClipRegion();
}
- mbDropPos = FALSE;
+ mbDropPos = sal_False;
mnDropPos = 0;
}
}
// -----------------------------------------------------------------------
-BOOL TabBar::SwitchPage( const Point& rPos )
+sal_Bool TabBar::SwitchPage( const Point& rPos )
{
- BOOL bSwitch = FALSE;
- USHORT nSwitchId = GetPageId( rPos );
+ sal_Bool bSwitch = sal_False;
+ sal_uInt16 nSwitchId = GetPageId( rPos );
if ( !nSwitchId )
EndSwitchPage();
else
@@ -2888,16 +2895,16 @@ BOOL TabBar::SwitchPage( const Point& rPos )
{
if ( Time::GetSystemTicks() > mnSwitchTime+500 )
{
- mbInSwitching = TRUE;
+ mbInSwitching = sal_True;
if ( ImplDeactivatePage() )
{
SetCurPageId( mnSwitchId );
Update();
ImplActivatePage();
ImplSelect();
- bSwitch = TRUE;
+ bSwitch = sal_True;
}
- mbInSwitching = FALSE;
+ mbInSwitching = sal_False;
}
}
}
diff --git a/svtools/source/control/taskbar.cxx b/svtools/source/control/taskbar.cxx
index 8298374fb40b..8d3a6abce18f 100644..100755
--- a/svtools/source/control/taskbar.cxx
+++ b/svtools/source/control/taskbar.cxx
@@ -32,10 +32,9 @@
#define _TASKBAR_CXX
#include <tools/debug.hxx>
-
#include <vcl/floatwin.hxx>
-#include <taskbar.hxx>
+#include <svtools/taskbar.hxx>
// =======================================================================
@@ -77,9 +76,9 @@ TaskBar::TaskBar( Window* pParent, WinBits nWinStyle ) :
mnOldStatusWidth = 0;
mnLines = 1;
mnWinBits = nWinStyle;
- mbStatusText = FALSE;
- mbShowItems = FALSE;
- mbAutoHide = FALSE;
+ mbStatusText = sal_False;
+ mbShowItems = sal_False;
+ mbAutoHide = sal_False;
ImplInitSettings();
}
@@ -310,13 +309,13 @@ void TaskBar::Resize()
if ( pTempButtonBar )
{
- USHORT i = 0;
- BOOL bVisibleItems = FALSE;
+ sal_uInt16 i = 0;
+ sal_Bool bVisibleItems = sal_False;
while ( i < pTempButtonBar->GetItemCount() )
{
if ( pTempButtonBar->IsItemVisible( pTempButtonBar->GetItemId( i ) ) )
{
- bVisibleItems = TRUE;
+ bVisibleItems = sal_True;
break;
}
i++;
@@ -465,14 +464,14 @@ void TaskBar::Format()
// -----------------------------------------------------------------------
-void TaskBar::SetLines( USHORT nLines )
+void TaskBar::SetLines( sal_uInt16 nLines )
{
mnLines = nLines;
}
// -----------------------------------------------------------------------
-void TaskBar::EnableAutoHide( BOOL bAutoHide )
+void TaskBar::EnableAutoHide( sal_Bool bAutoHide )
{
mbAutoHide = bAutoHide;
@@ -494,14 +493,14 @@ void TaskBar::ShowStatusText( const String& rText )
{
if ( !mbStatusText )
{
- mbStatusText = TRUE;
+ mbStatusText = sal_True;
if ( mpStatusBar->AreItemsVisible() )
{
- mbShowItems = TRUE;
+ mbShowItems = sal_True;
mpStatusBar->HideItems();
}
else
- mbShowItems = TRUE;
+ mbShowItems = sal_True;
maOldText = mpStatusBar->GetText();
Resize();
mpStatusBar->SetText( rText );
@@ -519,7 +518,7 @@ void TaskBar::HideStatusText()
{
if ( mbStatusText && mpStatusBar )
{
- mbStatusText = FALSE;
+ mbStatusText = sal_False;
mpStatusBar->SetText( maOldText );
Resize();
if ( mbShowItems )
diff --git a/svtools/source/control/taskbox.cxx b/svtools/source/control/taskbox.cxx
index 21cf187b6cea..0215c1835f1d 100644..100755
--- a/svtools/source/control/taskbox.cxx
+++ b/svtools/source/control/taskbox.cxx
@@ -34,8 +34,7 @@
#include <tools/debug.hxx>
#include <vcl/image.hxx>
#include <vcl/help.hxx>
-
-#include <taskbar.hxx>
+#include <svtools/taskbar.hxx>
// =======================================================================
@@ -58,7 +57,7 @@ TaskToolBox::TaskToolBox( Window* pParent, WinBits nWinStyle ) :
mnMaxTextWidth = 0;
mnActiveItemId = 0;
mnSmallItem = TOOLBOX_ITEM_NOTFOUND;
- mbMinActivate = FALSE;
+ mbMinActivate = sal_False;
SetAlign( WINDOWALIGN_BOTTOM );
SetButtonType( BUTTON_SYMBOLTEXT );
@@ -77,14 +76,14 @@ TaskToolBox::~TaskToolBox()
// -----------------------------------------------------------------------
-void TaskToolBox::ActivateTaskItem( USHORT nItemId, BOOL bMinActivate )
+void TaskToolBox::ActivateTaskItem( sal_uInt16 nItemId, sal_Bool bMinActivate )
{
if ( nItemId )
{
if ( nItemId != mnActiveItemId )
{
if ( mnActiveItemId )
- CheckItem( mnActiveItemId, FALSE );
+ CheckItem( mnActiveItemId, sal_False );
CheckItem( nItemId );
mnActiveItemId = nItemId;
}
@@ -93,11 +92,11 @@ void TaskToolBox::ActivateTaskItem( USHORT nItemId, BOOL bMinActivate )
if ( !bMinActivate )
return;
- mbMinActivate = TRUE;
+ mbMinActivate = sal_True;
}
ActivateTask();
- mbMinActivate = FALSE;
+ mbMinActivate = sal_False;
}
}
@@ -183,8 +182,8 @@ void TaskToolBox::RequestHelp( const HelpEvent& rHEvt )
void TaskToolBox::Select()
{
- USHORT nItemId = GetCurItemId();
- ActivateTaskItem( nItemId, TRUE );
+ sal_uInt16 nItemId = GetCurItemId();
+ ActivateTaskItem( nItemId, sal_True );
}
// -----------------------------------------------------------------------
@@ -225,7 +224,7 @@ void TaskToolBox::ImplFormatTaskToolBox()
}
// Eintraege aus der ToolBox entfernen, die ersetzt werden
- USHORT nBtnPos = (mnUpdateNewPos*2);
+ sal_uInt16 nBtnPos = (mnUpdateNewPos*2);
while ( nBtnPos < GetItemCount() )
RemoveItem( nBtnPos );
if ( mnUpdateNewPos <= (mnActiveItemId-1) )
@@ -256,7 +255,7 @@ void TaskToolBox::ImplFormatTaskToolBox()
while ( (nTxtWidth > mnMaxTextWidth) && (aText.Len() > 3) );
}
- USHORT nItemId = i+1;
+ sal_uInt16 nItemId = i+1;
if ( aText.EqualsAscii( "..." ) )
InsertItem( nItemId, pItem->maImage, TIB_LEFT );
else
@@ -271,7 +270,7 @@ void TaskToolBox::ImplFormatTaskToolBox()
if ( mnNewActivePos+1 != mnActiveItemId )
{
if ( mnActiveItemId )
- CheckItem( mnActiveItemId, FALSE );
+ CheckItem( mnActiveItemId, sal_False );
mnActiveItemId = mnNewActivePos+1;
CheckItem( mnActiveItemId );
}
@@ -290,7 +289,7 @@ void TaskToolBox::StartUpdateTask()
// -----------------------------------------------------------------------
void TaskToolBox::UpdateTask( const Image& rImage, const String& rText,
- BOOL bActive )
+ sal_Bool bActive )
{
ImplTaskItem* pItem = ( mnUpdatePos < mpItemList->size() ) ? (*mpItemList)[ mnUpdatePos ] : NULL;
if ( pItem )
diff --git a/svtools/source/control/taskmisc.cxx b/svtools/source/control/taskmisc.cxx
index 8c367a7d135a..1476cacb76fb 100644..100755
--- a/svtools/source/control/taskmisc.cxx
+++ b/svtools/source/control/taskmisc.cxx
@@ -33,8 +33,7 @@
#include <tools/debug.hxx>
#include <vcl/help.hxx>
-
-#include <taskbar.hxx>
+#include <svtools/taskbar.hxx>
// =======================================================================
@@ -74,9 +73,9 @@ WindowArrange::~WindowArrange()
// -----------------------------------------------------------------------
-static USHORT ImplCeilSqareRoot( USHORT nVal )
+static sal_uInt16 ImplCeilSqareRoot( sal_uInt16 nVal )
{
- USHORT i;
+ sal_uInt16 i;
// Ueberlauf verhindern
if ( nVal > 0xFE * 0xFE )
@@ -104,19 +103,19 @@ static void ImplPosSizeWindow( Window* pWindow,
void WindowArrange::ImplTile( const Rectangle& rRect )
{
- USHORT nCount = (USHORT)mpWinList->Count();
+ sal_uInt16 nCount = (sal_uInt16)mpWinList->Count();
if ( nCount < 3 )
{
ImplVert( rRect );
return;
}
- USHORT i;
- USHORT j;
- USHORT nCols;
- USHORT nRows;
- USHORT nActRows;
- USHORT nOffset;
+ sal_uInt16 i;
+ sal_uInt16 j;
+ sal_uInt16 nCols;
+ sal_uInt16 nRows;
+ sal_uInt16 nActRows;
+ sal_uInt16 nOffset;
long nOverWidth;
long nOverHeight;
Window* pWindow;
@@ -354,7 +353,7 @@ void WindowArrange::ImplCascade( const Rectangle& rRect )
// -----------------------------------------------------------------------
-void WindowArrange::Arrange( USHORT nType, const Rectangle& rRect )
+void WindowArrange::Arrange( sal_uInt16 nType, const Rectangle& rRect )
{
if ( !mpWinList->Count() )
return;
diff --git a/svtools/source/control/taskstat.cxx b/svtools/source/control/taskstat.cxx
index 03c5199391a4..b94aae25a88f 100644..100755
--- a/svtools/source/control/taskstat.cxx
+++ b/svtools/source/control/taskstat.cxx
@@ -37,9 +37,8 @@
#include <vcl/help.hxx>
#include <vcl/svapp.hxx>
#include <unotools/calendarwrapper.hxx>
-
#include <unotools/syslocale.hxx>
-#include <taskbar.hxx>
+#include <svtools/taskbar.hxx>
// =======================================================================
@@ -51,43 +50,43 @@
struct ImplTaskSBFldItem
{
TaskStatusFieldItem maItem;
- USHORT mnId;
+ sal_uInt16 mnId;
long mnOffX;
};
// =======================================================================
-BOOL ITaskStatusNotify::MouseButtonDown( USHORT, const MouseEvent& )
+sal_Bool ITaskStatusNotify::MouseButtonDown( sal_uInt16, const MouseEvent& )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL ITaskStatusNotify::MouseButtonUp( USHORT, const MouseEvent& )
+sal_Bool ITaskStatusNotify::MouseButtonUp( sal_uInt16, const MouseEvent& )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL ITaskStatusNotify::MouseMove( USHORT, const MouseEvent& )
+sal_Bool ITaskStatusNotify::MouseMove( sal_uInt16, const MouseEvent& )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL ITaskStatusNotify::Command( USHORT, const CommandEvent& )
+sal_Bool ITaskStatusNotify::Command( sal_uInt16, const CommandEvent& )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL ITaskStatusNotify::UpdateHelp( USHORT )
+sal_Bool ITaskStatusNotify::UpdateHelp( sal_uInt16 )
{
- return FALSE;
+ return sal_False;
}
// =======================================================================
@@ -115,7 +114,7 @@ TaskStatusFieldItem::TaskStatusFieldItem( ITaskStatusNotify* pNotify,
const Image& rImage,
const XubString& rQuickHelpText,
const XubString& rHelpText,
- USHORT nFlags ) :
+ sal_uInt16 nFlags ) :
mpNotify( pNotify ),
maImage( rImage ),
maQuickHelpText( rQuickHelpText ),
@@ -155,8 +154,8 @@ TaskStatusBar::TaskStatusBar( Window* pParent, WinBits nWinStyle ) :
mnItemWidth = 0;
mnFieldWidth = 0;
mnFieldFlags = 0;
- mbFlashItems = FALSE;
- mbOutInterval = FALSE;
+ mbFlashItems = sal_False;
+ mbOutInterval = sal_False;
maTimer.SetTimeoutHdl( LINK( this, TaskStatusBar, ImplTimerHdl ) );
}
@@ -179,9 +178,9 @@ TaskStatusBar::~TaskStatusBar()
IMPL_LINK( TaskStatusBar, ImplTimerHdl, Timer*, EMPTYARG )
{
- BOOL bUpdate = ImplUpdateClock();
+ sal_Bool bUpdate = ImplUpdateClock();
if ( ImplUpdateFlashItems() )
- bUpdate = TRUE;
+ bUpdate = sal_True;
if ( bUpdate )
SetItemData( TASKSTATUSBAR_STATUSFIELDID, NULL );
@@ -190,7 +189,7 @@ IMPL_LINK( TaskStatusBar, ImplTimerHdl, Timer*, EMPTYARG )
// -----------------------------------------------------------------------
-ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( USHORT nItemId ) const
+ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( sal_uInt16 nItemId ) const
{
if ( !mpFieldItemList )
return NULL;
@@ -205,11 +204,11 @@ ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( USHORT nItemId ) const
// -----------------------------------------------------------------------
-ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( const Point& rPos, BOOL& rFieldRect ) const
+ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( const Point& rPos, sal_Bool& rFieldRect ) const
{
if ( GetItemId( rPos ) == TASKSTATUSBAR_STATUSFIELDID )
{
- rFieldRect = TRUE;
+ rFieldRect = sal_True;
if ( mpFieldItemList )
{
@@ -223,14 +222,14 @@ ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( const Point& rPos, BOOL& rFi
}
}
else
- rFieldRect = FALSE;
+ rFieldRect = sal_False;
return NULL;
}
// -----------------------------------------------------------------------
-BOOL TaskStatusBar::ImplUpdateClock()
+sal_Bool TaskStatusBar::ImplUpdateClock()
{
if ( mnFieldFlags & TASKSTATUSFIELD_CLOCK )
{
@@ -240,55 +239,55 @@ BOOL TaskStatusBar::ImplUpdateClock()
(aTime.GetHour() != maTime.GetHour()) )
{
maTime = aTime;
- maTimeText = SvtSysLocale().GetLocaleData().getTime( aTime, FALSE, FALSE );
- return TRUE;
+ maTimeText = SvtSysLocale().GetLocaleData().getTime( aTime, sal_False, sal_False );
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL TaskStatusBar::ImplUpdateFlashItems()
+sal_Bool TaskStatusBar::ImplUpdateFlashItems()
{
if ( mbFlashItems )
{
if ( mbOutInterval )
{
maTimer.SetTimeout( 900 );
- mbOutInterval = FALSE;
+ mbOutInterval = sal_False;
}
else
{
maTimer.SetTimeout( 700 );
- mbOutInterval = TRUE;
+ mbOutInterval = sal_True;
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void TaskStatusBar::ImplUpdateField( BOOL bItems )
+void TaskStatusBar::ImplUpdateField( sal_Bool bItems )
{
maTimer.Stop();
if ( bItems )
{
mnItemWidth = 0;
- mbFlashItems = FALSE;
- mbOutInterval = FALSE;
+ mbFlashItems = sal_False;
+ mbOutInterval = sal_False;
for ( size_t i = 0, n = mpFieldItemList->size(); i < n; ++i ) {
ImplTaskSBFldItem* pItem = (*mpFieldItemList)[ i ];
mnItemWidth += TASKSTATUSBAR_IMAGEOFFX;
pItem->mnOffX = mnItemWidth;
mnItemWidth += pItem->maItem.GetImage().GetSizePixel().Width();
if ( pItem->maItem.GetFlags() & TASKSTATUSFIELDITEM_FLASH ) {
- mbFlashItems = TRUE;
+ mbFlashItems = sal_True;
}
}
}
@@ -296,7 +295,7 @@ void TaskStatusBar::ImplUpdateField( BOOL bItems )
{
if ( mnFieldFlags & TASKSTATUSFIELD_CLOCK )
{
- XubString aStr = SvtSysLocale().GetLocaleData().getTime( Time( 23, 59, 59 ), FALSE, FALSE );
+ XubString aStr = SvtSysLocale().GetLocaleData().getTime( Time( 23, 59, 59 ), sal_False, sal_False );
mnClockWidth = GetTextWidth( aStr )+(TASKSTATUSBAR_CLOCXOFFX*2);
}
else
@@ -314,7 +313,7 @@ void TaskStatusBar::ImplUpdateField( BOOL bItems )
{
mnFieldWidth = nNewWidth;
long nOffset = GetItemOffset( TASKSTATUSBAR_STATUSFIELDID );
- USHORT nItemPos = GetItemPos( TASKSTATUSBAR_STATUSFIELDID );
+ sal_uInt16 nItemPos = GetItemPos( TASKSTATUSBAR_STATUSFIELDID );
InsertItem( TASKSTATUSBAR_STATUSFIELDID, nNewWidth, SIB_RIGHT | SIB_IN | SIB_USERDRAW, nOffset, nItemPos );
}
else
@@ -329,7 +328,7 @@ void TaskStatusBar::ImplUpdateField( BOOL bItems )
if ( mbFlashItems || (mnFieldFlags & TASKSTATUSFIELD_CLOCK) )
{
ImplUpdateClock();
- mbOutInterval = TRUE;
+ mbOutInterval = sal_True;
ImplUpdateFlashItems();
maTimer.Start();
}
@@ -339,12 +338,12 @@ void TaskStatusBar::ImplUpdateField( BOOL bItems )
void TaskStatusBar::MouseButtonDown( const MouseEvent& rMEvt )
{
- BOOL bFieldRect;
- BOOL bBaseClass = FALSE;
+ sal_Bool bFieldRect;
+ sal_Bool bBaseClass = sal_False;
ImplTaskSBFldItem* pItem = ImplGetFieldItem( rMEvt.GetPosPixel(), bFieldRect );
ITaskStatusNotify* pNotify = mpNotify;
- USHORT nItemId = 0;
+ sal_uInt16 nItemId = 0;
if ( bFieldRect )
nItemId = TASKSTATUSBAR_CLOCKID;
@@ -366,12 +365,12 @@ void TaskStatusBar::MouseButtonDown( const MouseEvent& rMEvt )
void TaskStatusBar::MouseButtonUp( const MouseEvent& rMEvt )
{
- BOOL bFieldRect;
- BOOL bBaseClass = FALSE;
+ sal_Bool bFieldRect;
+ sal_Bool bBaseClass = sal_False;
ImplTaskSBFldItem* pItem = ImplGetFieldItem( rMEvt.GetPosPixel(), bFieldRect );
ITaskStatusNotify* pNotify = mpNotify;
- USHORT nItemId = 0;
+ sal_uInt16 nItemId = 0;
if ( bFieldRect )
nItemId = TASKSTATUSBAR_CLOCKID;
@@ -393,12 +392,12 @@ void TaskStatusBar::MouseButtonUp( const MouseEvent& rMEvt )
void TaskStatusBar::MouseMove( const MouseEvent& rMEvt )
{
- BOOL bFieldRect;
- BOOL bBaseClass = FALSE;
+ sal_Bool bFieldRect;
+ sal_Bool bBaseClass = sal_False;
ImplTaskSBFldItem* pItem = ImplGetFieldItem( rMEvt.GetPosPixel(), bFieldRect );
ITaskStatusNotify* pNotify = mpNotify;
- USHORT nItemId = 0;
+ sal_uInt16 nItemId = 0;
if ( bFieldRect )
nItemId = TASKSTATUSBAR_CLOCKID;
@@ -420,12 +419,12 @@ void TaskStatusBar::MouseMove( const MouseEvent& rMEvt )
void TaskStatusBar::Command( const CommandEvent& rCEvt )
{
- BOOL bFieldRect;
- BOOL bBaseClass = FALSE;
+ sal_Bool bFieldRect;
+ sal_Bool bBaseClass = sal_False;
ImplTaskSBFldItem* pItem = ImplGetFieldItem( rCEvt.GetMousePosPixel(), bFieldRect );
ITaskStatusNotify* pNotify = mpNotify;
- USHORT nItemId = 0;
+ sal_uInt16 nItemId = 0;
if ( bFieldRect )
nItemId = TASKSTATUSBAR_CLOCKID;
@@ -447,12 +446,12 @@ void TaskStatusBar::Command( const CommandEvent& rCEvt )
void TaskStatusBar::RequestHelp( const HelpEvent& rHEvt )
{
- BOOL bFieldRect;
+ sal_Bool bFieldRect;
ImplTaskSBFldItem* pItem = ImplGetFieldItem( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ), bFieldRect );
if ( bFieldRect )
{
ITaskStatusNotify* pNotify = mpNotify;
- USHORT nItemId = 0;
+ sal_uInt16 nItemId = 0;
if ( pItem )
{
@@ -502,13 +501,13 @@ void TaskStatusBar::RequestHelp( const HelpEvent& rHEvt )
{
if ( pItem )
{
- ULONG nHelpId = pItem->maItem.GetHelpId();
- if ( nHelpId )
+ rtl::OUString aHelpId( rtl::OStringToOUString( pItem->maItem.GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
+ if ( aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pHelp->Start( nHelpId, this );
+ pHelp->Start( aHelpId, this );
return;
}
}
@@ -557,28 +556,28 @@ void TaskStatusBar::UserDraw( const UserDrawEvent& rUDEvt )
// -----------------------------------------------------------------------
-void TaskStatusBar::InsertStatusField( long, USHORT,
- USHORT nFlags )
+void TaskStatusBar::InsertStatusField( long, sal_uInt16,
+ sal_uInt16 nFlags )
{
mnFieldFlags = nFlags;
- ImplUpdateField( FALSE );
+ ImplUpdateField( sal_False );
}
// -----------------------------------------------------------------------
-void TaskStatusBar::SetFieldFlags( USHORT nFlags )
+void TaskStatusBar::SetFieldFlags( sal_uInt16 nFlags )
{
if ( mnFieldFlags != nFlags )
{
mnFieldFlags = nFlags;
- ImplUpdateField( FALSE );
+ ImplUpdateField( sal_False );
}
}
// -----------------------------------------------------------------------
-void TaskStatusBar::AddStatusFieldItem( USHORT nItemId, const TaskStatusFieldItem& rItem,
- USHORT nPos )
+void TaskStatusBar::AddStatusFieldItem( sal_uInt16 nItemId, const TaskStatusFieldItem& rItem,
+ sal_uInt16 nPos )
{
DBG_ASSERT( nItemId, "TaskStatusBar::AddStatusFieldItem() - Item is 0" );
DBG_ASSERT( !ImplGetFieldItem( nItemId ), "TaskStatusBar::AddStatusFieldItem() - Item-Id already exist" );
@@ -598,27 +597,27 @@ void TaskStatusBar::AddStatusFieldItem( USHORT nItemId, const TaskStatusFieldIte
mpFieldItemList->push_back( pItem );
}
- ImplUpdateField( TRUE );
+ ImplUpdateField( sal_True );
}
// -----------------------------------------------------------------------
-void TaskStatusBar::ModifyStatusFieldItem( USHORT nItemId, const TaskStatusFieldItem& rItem )
+void TaskStatusBar::ModifyStatusFieldItem( sal_uInt16 nItemId, const TaskStatusFieldItem& rItem )
{
ImplTaskSBFldItem* pItem = ImplGetFieldItem( nItemId );
if ( pItem )
{
- BOOL bUpdate = (pItem->maItem.GetImage() != rItem.GetImage()) ||
+ sal_Bool bUpdate = (pItem->maItem.GetImage() != rItem.GetImage()) ||
(pItem->maItem.GetFlags() != rItem.GetFlags());
pItem->maItem = rItem;
if ( bUpdate )
- ImplUpdateField( TRUE );
+ ImplUpdateField( sal_True );
}
}
// -----------------------------------------------------------------------
-void TaskStatusBar::RemoveStatusFieldItem( USHORT nItemId )
+void TaskStatusBar::RemoveStatusFieldItem( sal_uInt16 nItemId )
{
ImplTaskSBFldItem* pItem = ImplGetFieldItem( nItemId );
if ( pItem )
@@ -633,22 +632,21 @@ void TaskStatusBar::RemoveStatusFieldItem( USHORT nItemId )
break;
}
}
- ImplUpdateField( TRUE );
}
}
// -----------------------------------------------------------------------
-BOOL TaskStatusBar::GetStatusFieldItem( USHORT nItemId, TaskStatusFieldItem& rItem ) const
+sal_Bool TaskStatusBar::GetStatusFieldItem( sal_uInt16 nItemId, TaskStatusFieldItem& rItem ) const
{
ImplTaskSBFldItem* pItem = ImplGetFieldItem( nItemId );
if ( pItem )
{
rItem = pItem->maItem;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index a24673fe4bb5..fcb749cdc0d8 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -164,7 +164,7 @@ const Reference< XAccessibleContext >& ToolbarMenuEntry::GetAccessible( bool bCr
{
if( mpControl )
{
- mxAccContext = Reference< XAccessibleContext >( mpControl->GetAccessible( TRUE ), UNO_QUERY );
+ mxAccContext = Reference< XAccessibleContext >( mpControl->GetAccessible( sal_True ), UNO_QUERY );
}
else
{
@@ -912,7 +912,7 @@ void ToolbarMenu::appendSeparator()
ValueSet* ToolbarMenu::createEmptyValueSetControl()
{
ValueSet* pSet = new ValueSet( this, WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NOBORDER | WB_NO_DIRECTSELECT );
- pSet->EnableFullItemMode( FALSE );
+ pSet->EnableFullItemMode( sal_False );
pSet->SetColor( GetControlBackground() );
pSet->SetHighlightHdl( LINK( this, ToolbarMenu, HighlightHdl ) );
return pSet;
@@ -996,7 +996,7 @@ void ToolbarMenu::implHighlightEntry( int nHighlightEntry, bool bHighlight )
if( bHighlight && IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM ) )
{
bDrawItemRect = false;
- if( FALSE == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM,
+ if( sal_False == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM,
aItemRect,
CTRL_STATE_SELECTED | ( pEntry->mbEnabled? CTRL_STATE_ENABLED: 0 ),
ImplControlValue(),
@@ -1086,7 +1086,7 @@ void ToolbarMenu::implHighlightEntry( const MouseEvent& rMEvt, bool bMBDown )
Size aOutSz = GetOutputSizePixel();
if ( ( nMouseY >= 0 ) && ( nMouseY < aOutSz.Height() ) )
{
- bool bHighlighted = FALSE;
+ bool bHighlighted = sal_False;
const int nEntryCount = mpImpl->maEntryVector.size();
int nEntry;
@@ -1161,11 +1161,11 @@ static bool implCheckSubControlCursorMove( Control* pControl, bool bUp, int& nLa
ValueSet* pValueSet = dynamic_cast< ValueSet* >( pControl );
if( pValueSet )
{
- USHORT nItemPos = pValueSet->GetItemPos( pValueSet->GetSelectItemId() );
+ sal_uInt16 nItemPos = pValueSet->GetItemPos( pValueSet->GetSelectItemId() );
if( nItemPos != VALUESET_ITEM_NOTFOUND )
{
- const USHORT nColCount = pValueSet->GetColCount();
- const USHORT nLine = nItemPos / nColCount;
+ const sal_uInt16 nColCount = pValueSet->GetColCount();
+ const sal_uInt16 nLine = nItemPos / nColCount;
nLastColumn = nItemPos - (nLine * nColCount);
@@ -1175,7 +1175,7 @@ static bool implCheckSubControlCursorMove( Control* pControl, bool bUp, int& nLa
}
else
{
- const USHORT nLineCount = (pValueSet->GetItemCount() + nColCount - 1) / nColCount;
+ const sal_uInt16 nLineCount = (pValueSet->GetItemCount() + nColCount - 1) / nColCount;
return (nLine+1) < nLineCount;
}
}
@@ -1264,19 +1264,19 @@ ToolbarMenuEntry* ToolbarMenu::implCursorUpDown( bool bUp, bool bHomeEnd )
// --------------------------------------------------------------------
-void ToolbarMenu_Impl::implHighlightControl( USHORT nCode, Control* pControl )
+void ToolbarMenu_Impl::implHighlightControl( sal_uInt16 nCode, Control* pControl )
{
ValueSet* pValueSet = dynamic_cast< ValueSet* >( pControl );
if( pValueSet )
{
- const USHORT nItemCount = pValueSet->GetItemCount();
- USHORT nItemPos = VALUESET_ITEM_NOTFOUND;
+ const sal_uInt16 nItemCount = pValueSet->GetItemCount();
+ sal_uInt16 nItemPos = VALUESET_ITEM_NOTFOUND;
switch( nCode )
{
case KEY_UP:
{
- const USHORT nColCount = pValueSet->GetColCount();
- const USHORT nLastLine = nItemCount / nColCount;
+ const sal_uInt16 nColCount = pValueSet->GetColCount();
+ const sal_uInt16 nLastLine = nItemCount / nColCount;
nItemPos = std::min( ((nLastLine-1) * nColCount) + mnLastColumn, nItemCount-1 );
break;
}
@@ -1300,7 +1300,7 @@ void ToolbarMenu_Impl::implHighlightControl( USHORT nCode, Control* pControl )
void ToolbarMenu::KeyInput( const KeyEvent& rKEvent )
{
Control* pForwardControl = 0;
- USHORT nCode = rKEvent.GetKeyCode().GetCode();
+ sal_uInt16 nCode = rKEvent.GetKeyCode().GetCode();
switch ( nCode )
{
case KEY_UP:
@@ -1377,7 +1377,7 @@ void ToolbarMenu::KeyInput( const KeyEvent& rKEvent )
// --------------------------------------------------------------------
static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRect, bool i_bHighlight )
{
- BOOL bNativeOk = FALSE;
+ sal_Bool bNativeOk = sal_False;
if( i_pWindow->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) )
{
ImplControlValue aControlValue;
@@ -1394,13 +1394,13 @@ static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRec
{
const StyleSettings& rSettings = i_pWindow->GetSettings().GetStyleSettings();
Color aColor( i_bHighlight ? rSettings.GetMenuHighlightTextColor() : rSettings.GetHighlightColor() );
- i_pWindow->DrawSelectionBackground( i_rRect, 0, i_bHighlight, TRUE, FALSE, 2, NULL, &aColor );
+ i_pWindow->DrawSelectionBackground( i_rRect, 0, i_bHighlight, sal_True, sal_False, 2, NULL, &aColor );
}
}
void ToolbarMenu::implPaint( ToolbarMenuEntry* pThisOnly, bool bHighlighted )
{
- USHORT nBorder = 0; long nStartY = 0; // from Menu implementations, needed when we support native menu background & scrollable menu
+ sal_uInt16 nBorder = 0; long nStartY = 0; // from Menu implementations, needed when we support native menu background & scrollable menu
long nFontHeight = GetTextHeight();
// long nExtra = nFontHeight/4;
@@ -1450,9 +1450,9 @@ void ToolbarMenu::implPaint( ToolbarMenuEntry* pThisOnly, bool bHighlighted )
{
long nTextOffsetY = ((pEntry->maSize.Height()-nFontHeight)/2);
- USHORT nTextStyle = 0;
- USHORT nSymbolStyle = 0;
- USHORT nImageStyle = 0;
+ sal_uInt16 nTextStyle = 0;
+ sal_uInt16 nSymbolStyle = 0;
+ sal_uInt16 nImageStyle = 0;
if( !pEntry->mbEnabled )
{
@@ -1565,7 +1565,7 @@ void ToolbarMenu::implPaint( ToolbarMenuEntry* pThisOnly, bool bHighlighted )
aTmpPos.X() = aPos.X() + (bTitle ? 4 : mpImpl->mnTextPos);
aTmpPos.Y() = aPos.Y();
aTmpPos.Y() += nTextOffsetY;
- USHORT nStyle = nTextStyle|TEXT_DRAW_MNEMONIC;
+ sal_uInt16 nStyle = nTextStyle|TEXT_DRAW_MNEMONIC;
DrawCtrlText( aTmpPos, pEntry->maText, 0, pEntry->maText.Len(), nStyle, NULL, NULL ); // pVector, pDisplayText );
}
diff --git a/svtools/source/control/toolbarmenuacc.cxx b/svtools/source/control/toolbarmenuacc.cxx
index 1650c99e7d52..340fbeacb008 100644
--- a/svtools/source/control/toolbarmenuacc.cxx
+++ b/svtools/source/control/toolbarmenuacc.cxx
@@ -214,7 +214,7 @@ sal_Int32 SAL_CALL ToolbarMenuAcc::getAccessibleIndexInParent() throw (RuntimeEx
Window* pParent = mpParent->mrMenu.GetParent();
if( pParent )
{
- for( USHORT i = 0, nCount = pParent->GetChildCount(); i < nCount ; i++ )
+ for( sal_uInt16 i = 0, nCount = pParent->GetChildCount(); i < nCount ; i++ )
{
if( pParent->GetChild( i ) == &mpParent->mrMenu )
return i;
@@ -253,7 +253,7 @@ OUString SAL_CALL ToolbarMenuAcc::getAccessibleName() throw (RuntimeException)
if( !aRet.getLength() )
{
- Window* pLabel = mpParent->mrMenu.GetLabeledBy();
+ Window* pLabel = mpParent->mrMenu.GetAccessibleRelationLabeledBy();
if( pLabel && pLabel != &mpParent->mrMenu )
aRet = OutputDevice::GetNonMnemonicString( pLabel->GetText() );
}
@@ -474,7 +474,7 @@ Any SAL_CALL ToolbarMenuAcc::getAccessibleKeyBinding() throw (RuntimeException)
sal_Int32 SAL_CALL ToolbarMenuAcc::getForeground() throw (RuntimeException)
{
ThrowIfDisposed();
- UINT32 nColor = Application::GetSettings().GetStyleSettings().GetMenuTextColor().GetColor();
+ sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetMenuTextColor().GetColor();
return static_cast<sal_Int32>(nColor);
}
@@ -483,7 +483,7 @@ sal_Int32 SAL_CALL ToolbarMenuAcc::getForeground() throw (RuntimeException)
sal_Int32 SAL_CALL ToolbarMenuAcc::getBackground() throw (RuntimeException)
{
ThrowIfDisposed();
- UINT32 nColor = Application::GetSettings().GetStyleSettings().GetMenuColor().GetColor();
+ sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetMenuColor().GetColor();
return static_cast<sal_Int32>(nColor);
}
diff --git a/svtools/source/control/toolbarmenuimp.hxx b/svtools/source/control/toolbarmenuimp.hxx
index 0df8c8e78045..f6c60d3d2193 100644
--- a/svtools/source/control/toolbarmenuimp.hxx
+++ b/svtools/source/control/toolbarmenuimp.hxx
@@ -309,7 +309,7 @@ struct ToolbarMenu_Impl
ToolbarMenuEntry* implGetEntry( int nEntry ) const;
void notifyHighlightedEntry();
- void implHighlightControl( USHORT nCode, Control* pControl );
+ void implHighlightControl( sal_uInt16 nCode, Control* pControl );
};
}
diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx
index 7b77bb1e0933..e558a72ae33a 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -227,7 +227,7 @@ uno::Reference< accessibility::XAccessible > SAL_CALL ValueSetAcc::getAccessible
ThrowIfDisposed();
const SolarMutexGuard aSolarGuard;
uno::Reference< accessibility::XAccessible > xRet;
- ValueSetItem* pItem = getItem (sal::static_int_cast< USHORT >(i));
+ ValueSetItem* pItem = getItem (sal::static_int_cast< sal_uInt16 >(i));
if( pItem )
xRet = pItem->GetAccessible( mbIsTransientChildrenDisabled );
@@ -267,7 +267,7 @@ sal_Int32 SAL_CALL ValueSetAcc::getAccessibleIndexInParent()
{
sal_Bool bFound = sal_False;
- for( USHORT i = 0, nCount = pParent->GetChildCount(); ( i < nCount ) && !bFound; i++ )
+ for( sal_uInt16 i = 0, nCount = pParent->GetChildCount(); ( i < nCount ) && !bFound; i++ )
{
if( pParent->GetChild( i ) == mpParent )
{
@@ -319,7 +319,7 @@ sal_Int16 SAL_CALL ValueSetAcc::getAccessibleRole()
if ( !aRet.Len() )
{
- Window* pLabel = mpParent->GetLabeledBy();
+ Window* pLabel = mpParent->GetAccessibleRelationLabeledBy();
if ( pLabel && pLabel != mpParent )
aRet = OutputDevice::GetNonMnemonicString( pLabel->GetText() );
}
@@ -452,10 +452,10 @@ uno::Reference< accessibility::XAccessible > SAL_CALL ValueSetAcc::getAccessible
{
ThrowIfDisposed();
const SolarMutexGuard aSolarGuard;
- const USHORT nItemId = mpParent->GetItemId( Point( aPoint.X, aPoint.Y ) );
+ const sal_uInt16 nItemId = mpParent->GetItemId( Point( aPoint.X, aPoint.Y ) );
uno::Reference< accessibility::XAccessible > xRet;
- if( ((USHORT)-1) != nItemId )
+ if( ((sal_uInt16)-1) != nItemId )
{
const size_t nItemPos = mpParent->GetItemPos( nItemId );
@@ -561,7 +561,7 @@ sal_Int32 SAL_CALL ValueSetAcc::getForeground( )
throw (uno::RuntimeException)
{
ThrowIfDisposed();
- UINT32 nColor = Application::GetSettings().GetStyleSettings().GetWindowTextColor().GetColor();
+ sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetWindowTextColor().GetColor();
return static_cast<sal_Int32>(nColor);
}
@@ -571,7 +571,7 @@ sal_Int32 SAL_CALL ValueSetAcc::getBackground( )
throw (uno::RuntimeException)
{
ThrowIfDisposed();
- UINT32 nColor = Application::GetSettings().GetStyleSettings().GetWindowColor().GetColor();
+ sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetWindowColor().GetColor();
return static_cast<sal_Int32>(nColor);
}
@@ -582,7 +582,7 @@ void SAL_CALL ValueSetAcc::selectAccessibleChild( sal_Int32 nChildIndex )
{
ThrowIfDisposed();
const SolarMutexGuard aSolarGuard;
- ValueSetItem* pItem = getItem (sal::static_int_cast< USHORT >(nChildIndex));
+ ValueSetItem* pItem = getItem (sal::static_int_cast< sal_uInt16 >(nChildIndex));
if(pItem != NULL)
{
@@ -600,7 +600,7 @@ sal_Bool SAL_CALL ValueSetAcc::isAccessibleChildSelected( sal_Int32 nChildIndex
{
ThrowIfDisposed();
const SolarMutexGuard aSolarGuard;
- ValueSetItem* pItem = getItem (sal::static_int_cast< USHORT >(nChildIndex));
+ ValueSetItem* pItem = getItem (sal::static_int_cast< sal_uInt16 >(nChildIndex));
sal_Bool bRet = sal_False;
if (pItem != NULL)
@@ -639,7 +639,7 @@ sal_Int32 SAL_CALL ValueSetAcc::getSelectedAccessibleChildCount()
const SolarMutexGuard aSolarGuard;
sal_Int32 nRet = 0;
- for( USHORT i = 0, nCount = getItemCount(); i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = getItemCount(); i < nCount; i++ )
{
ValueSetItem* pItem = getItem (i);
@@ -659,7 +659,7 @@ uno::Reference< accessibility::XAccessible > SAL_CALL ValueSetAcc::getSelectedAc
const SolarMutexGuard aSolarGuard;
uno::Reference< accessibility::XAccessible > xRet;
- for( USHORT i = 0, nCount = getItemCount(), nSel = 0; ( i < nCount ) && !xRet.is(); i++ )
+ for( sal_uInt16 i = 0, nCount = getItemCount(), nSel = 0; ( i < nCount ) && !xRet.is(); i++ )
{
ValueSetItem* pItem = getItem(i);
@@ -736,9 +736,9 @@ void SAL_CALL ValueSetAcc::disposing (void)
}
-USHORT ValueSetAcc::getItemCount (void) const
+sal_uInt16 ValueSetAcc::getItemCount (void) const
{
- USHORT nCount = mpParent->ImplGetVisibleItemCount();
+ sal_uInt16 nCount = mpParent->ImplGetVisibleItemCount();
// When the None-Item is visible then increase the number of items by
// one.
if (HasNoneField())
@@ -747,7 +747,7 @@ USHORT ValueSetAcc::getItemCount (void) const
}
-ValueSetItem* ValueSetAcc::getItem (USHORT nIndex) const
+ValueSetItem* ValueSetAcc::getItem (sal_uInt16 nIndex) const
{
ValueSetItem* pItem = NULL;
@@ -761,7 +761,7 @@ ValueSetItem* ValueSetAcc::getItem (USHORT nIndex) const
nIndex -= 1;
}
if (pItem == NULL)
- pItem = mpParent->ImplGetVisibleItem (static_cast<USHORT>(nIndex));
+ pItem = mpParent->ImplGetVisibleItem (static_cast<sal_uInt16>(nIndex));
return pItem;
}
@@ -937,9 +937,9 @@ sal_Int32 SAL_CALL ValueItemAcc::getAccessibleIndexInParent()
{
bool bDone = false;
- USHORT nCount = mpParent->mrParent.ImplGetVisibleItemCount();
+ sal_uInt16 nCount = mpParent->mrParent.ImplGetVisibleItemCount();
ValueSetItem* pItem;
- for (USHORT i=0; i<nCount && !bDone; i++)
+ for (sal_uInt16 i=0; i<nCount && !bDone; i++)
{
// Guard the retrieval of the i-th child with a try/catch block
// just in case the number of children changes in the mean time.
@@ -1228,7 +1228,7 @@ uno::Any SAL_CALL ValueItemAcc::getAccessibleKeyBinding()
sal_Int32 SAL_CALL ValueItemAcc::getForeground( )
throw (uno::RuntimeException)
{
- UINT32 nColor = Application::GetSettings().GetStyleSettings().GetWindowTextColor().GetColor();
+ sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetWindowTextColor().GetColor();
return static_cast<sal_Int32>(nColor);
}
@@ -1237,7 +1237,7 @@ sal_Int32 SAL_CALL ValueItemAcc::getForeground( )
sal_Int32 SAL_CALL ValueItemAcc::getBackground( )
throw (uno::RuntimeException)
{
- UINT32 nColor;
+ sal_uInt32 nColor;
if (mpParent && mpParent->meType == VALUESETITEM_COLOR)
nColor = mpParent->maColor.GetColor();
else
diff --git a/svtools/source/control/valueimp.hxx b/svtools/source/control/valueimp.hxx
index 3df14947481f..7e5ccc196a55 100644
--- a/svtools/source/control/valueimp.hxx
+++ b/svtools/source/control/valueimp.hxx
@@ -81,8 +81,8 @@ class ValueSet;
struct ValueSetItem
{
ValueSet& mrParent;
- USHORT mnId;
- USHORT mnBits;
+ sal_uInt16 mnId;
+ sal_uInt16 mnBits;
ValueSetItemType meType;
Image maImage;
Color maColor;
@@ -138,7 +138,7 @@ public:
~ValueSetAcc();
void FireAccessibleEvent( short nEventId, const ::com::sun::star::uno::Any& rOldValue, const ::com::sun::star::uno::Any& rNewValue );
- BOOL HasAccessibleListeners() const { return( mxEventListeners.size() > 0 ); }
+ sal_Bool HasAccessibleListeners() const { return( mxEventListeners.size() > 0 ); }
static ValueSetAcc* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxData ) throw();
@@ -217,7 +217,7 @@ private:
/** Return the number of items. This takes the None-Item into account.
*/
- USHORT getItemCount (void) const;
+ sal_uInt16 getItemCount (void) const;
/** Return the item associated with the given index. The None-Item is
taken into account which, when present, is taken to be the first
@@ -228,7 +228,7 @@ private:
@return
Returns NULL when the given index is out of range.
*/
- ValueSetItem* getItem (USHORT nIndex) const;
+ ValueSetItem* getItem (sal_uInt16 nIndex) const;
/** Check whether or not the object has been disposed (or is in the
state of beeing disposed). If that is the case then
@@ -283,7 +283,7 @@ public:
void ParentDestroyed();
void FireAccessibleEvent( short nEventId, const ::com::sun::star::uno::Any& rOldValue, const ::com::sun::star::uno::Any& rNewValue );
- BOOL HasAccessibleListeners() const { return( mxEventListeners.size() > 0 ); }
+ sal_Bool HasAccessibleListeners() const { return( mxEventListeners.size() > 0 ); }
static ValueItemAcc* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxData ) throw();
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 87888d148f53..c3be233cb917 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -70,21 +70,21 @@ void ValueSet::ImplInit()
mnUserVisLines = 0;
mnSpacing = 0;
mnFrameStyle = 0;
- mbFormat = TRUE;
- mbHighlight = FALSE ;
- mbSelection = FALSE;
- mbNoSelection = TRUE;
- mbDrawSelection = TRUE;
- mbBlackSel = FALSE;
- mbDoubleSel = FALSE;
- mbScroll = FALSE;
- mbDropPos = FALSE;
- mbFullMode = TRUE;
+ mbFormat = sal_True;
+ mbHighlight = sal_False ;
+ mbSelection = sal_False;
+ mbNoSelection = sal_True;
+ mbDrawSelection = sal_True;
+ mbBlackSel = sal_False;
+ mbDoubleSel = sal_False;
+ mbScroll = sal_False;
+ mbDropPos = sal_False;
+ mbFullMode = sal_True;
// #106446#, #106601# force mirroring of virtual device
maVirDev.EnableRTL( GetParent()->IsRTLEnabled() );
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
}
// -----------------------------------------------------------------------
@@ -116,7 +116,7 @@ ValueSet::ValueSet( Window* pParent, const ResId& rResId, bool bDisableTransient
ValueSet::~ValueSet()
{
::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent>
- xComponent (GetAccessible(FALSE), ::com::sun::star::uno::UNO_QUERY);
+ xComponent (GetAccessible(sal_False), ::com::sun::star::uno::UNO_QUERY);
if (xComponent.is())
xComponent->dispose ();
@@ -153,8 +153,8 @@ void ValueSet::ImplDeleteItems()
// -----------------------------------------------------------------------
-void ValueSet::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void ValueSet::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -312,7 +312,7 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem )
aPos.X() += (aRectSize.Width()-aImageSize.Width())/2;
aPos.Y() += (aRectSize.Height()-aImageSize.Height())/2;
- USHORT nImageStyle = 0;
+ sal_uInt16 nImageStyle = 0;
if( !IsEnabled() )
nImageStyle |= IMAGE_DRAW_DISABLE;
@@ -422,7 +422,7 @@ void ValueSet::Format()
{
if ( mnUserItemWidth )
{
- mnCols = (USHORT)((aWinSize.Width()-nScrBarWidth+nSpace) / (mnUserItemWidth+nSpace));
+ mnCols = (sal_uInt16)((aWinSize.Width()-nScrBarWidth+nSpace) / (mnUserItemWidth+nSpace));
if ( !mnCols )
mnCols = 1;
}
@@ -433,7 +433,7 @@ void ValueSet::Format()
mnCols = mnUserCols;
// Zeilenanzahl berechnen
- mbScroll = FALSE;
+ mbScroll = sal_False;
mnLines = (long)mpImpl->mpItemList->size() / mnCols;
if ( mpImpl->mpItemList->size() % mnCols )
mnLines++;
@@ -452,13 +452,13 @@ void ValueSet::Format()
else
mnVisLines = mnLines;
if ( mnLines > mnVisLines )
- mbScroll = TRUE;
+ mbScroll = sal_True;
if ( mnLines <= mnVisLines )
mnFirstLine = 0;
else
{
- if ( mnFirstLine > (USHORT)(mnLines-mnVisLines) )
- mnFirstLine = (USHORT)(mnLines-mnVisLines);
+ if ( mnFirstLine > (sal_uInt16)(mnLines-mnVisLines) )
+ mnFirstLine = (sal_uInt16)(mnLines-mnVisLines);
}
// Itemgroessen berechnen
@@ -489,7 +489,7 @@ void ValueSet::Format()
// Init VirDev
maVirDev.SetSettings( GetSettings() );
maVirDev.SetBackground( GetBackground() );
- maVirDev.SetOutputSizePixel( aWinSize, TRUE );
+ maVirDev.SetOutputSizePixel( aWinSize, sal_True );
// Bei zu kleinen Items machen wir nichts
long nMinHeight = 2;
@@ -532,17 +532,17 @@ void ValueSet::Format()
(aHighColor.GetBlue() > 0x80)) ||
((aHighColor.GetRed() == 0x80) && (aHighColor.GetGreen() == 0x80) &&
(aHighColor.GetBlue() == 0x80)) )
- mbBlackSel = TRUE;
+ mbBlackSel = sal_True;
else
- mbBlackSel = FALSE;
+ mbBlackSel = sal_False;
// Wenn die Items groesser sind, dann die Selektion doppelt so breit
// zeichnen
if ( (nStyle & WB_DOUBLEBORDER) &&
((nItemWidth >= 25) && (nItemHeight >= 20)) )
- mbDoubleSel = TRUE;
+ mbDoubleSel = sal_True;
else
- mbDoubleSel = FALSE;
+ mbDoubleSel = sal_False;
// Calculate offsets
long nStartX;
@@ -584,8 +584,8 @@ void ValueSet::Format()
}
// draw items
- ULONG nFirstItem = mnFirstLine * mnCols;
- ULONG nLastItem = nFirstItem + (mnVisLines * mnCols);
+ sal_uLong nFirstItem = mnFirstLine * mnCols;
+ sal_uLong nLastItem = nFirstItem + (mnVisLines * mnCols);
if ( !mbFullMode )
{
@@ -601,7 +601,7 @@ void ValueSet::Format()
if ( (i >= nFirstItem) && (i < nLastItem) )
{
- const BOOL bWasEmpty = pItem->maRect.IsEmpty();
+ const sal_Bool bWasEmpty = pItem->maRect.IsEmpty();
pItem->maRect.Left() = x;
pItem->maRect.Top() = y;
@@ -664,7 +664,7 @@ void ValueSet::Format()
}
// Jetzt haben wir formatiert und warten auf das naechste
- mbFormat = FALSE;
+ mbFormat = sal_False;
// ScrollBar loeschen
if ( pDelScrBar )
@@ -706,13 +706,13 @@ void ValueSet::ImplDrawSelect()
if ( !IsReallyVisible() )
return;
- BOOL bFocus = HasFocus();
- BOOL bDrawSel;
+ sal_Bool bFocus = HasFocus();
+ sal_Bool bDrawSel;
if ( (mbNoSelection && !mbHighlight) || (!mbDrawSelection && mbHighlight) )
- bDrawSel = FALSE;
+ bDrawSel = sal_False;
else
- bDrawSel = TRUE;
+ bDrawSel = sal_True;
if ( !bFocus &&
((mbNoSelection && !mbHighlight) || (!mbDrawSelection && mbHighlight)) )
@@ -722,7 +722,7 @@ void ValueSet::ImplDrawSelect()
return;
}
- USHORT nItemId = mnSelItemId;
+ sal_uInt16 nItemId = mnSelItemId;
for( int stage = 0; stage < 2; stage++ )
{
@@ -895,12 +895,12 @@ void ValueSet::ImplDrawSelect()
// -----------------------------------------------------------------------
-void ValueSet::ImplHideSelect( USHORT nItemId )
+void ValueSet::ImplHideSelect( sal_uInt16 nItemId )
{
Rectangle aRect;
- USHORT nItemPos = GetItemPos( nItemId );
- if ( nItemPos != sal::static_int_cast<USHORT>(LIST_ENTRY_NOTFOUND) )
+ sal_uInt16 nItemPos = GetItemPos( nItemId );
+ if ( nItemPos != sal::static_int_cast<sal_uInt16>(LIST_ENTRY_NOTFOUND) )
aRect = (*mpImpl->mpItemList)[ nItemPos ]->maRect;
else
{
@@ -919,42 +919,42 @@ void ValueSet::ImplHideSelect( USHORT nItemId )
// -----------------------------------------------------------------------
-void ValueSet::ImplHighlightItem( USHORT nItemId, BOOL bIsSelection )
+void ValueSet::ImplHighlightItem( sal_uInt16 nItemId, sal_Bool bIsSelection )
{
if ( mnHighItemId != nItemId )
{
// Alten merken, um vorherige Selektion zu entfernen
- USHORT nOldItem = mnHighItemId;
+ sal_uInt16 nOldItem = mnHighItemId;
mnHighItemId = nItemId;
// Wenn keiner selektiert ist, dann Selektion nicht malen
if ( !bIsSelection && mbNoSelection )
- mbDrawSelection = FALSE;
+ mbDrawSelection = sal_False;
// Neu ausgeben und alte Selection wegnehmen
ImplHideSelect( nOldItem );
ImplDrawSelect();
- mbDrawSelection = TRUE;
+ mbDrawSelection = sal_True;
}
}
// -----------------------------------------------------------------------
-void ValueSet::ImplDrawDropPos( BOOL bShow )
+void ValueSet::ImplDrawDropPos( sal_Bool bShow )
{
if ( (mnDropPos != VALUESET_ITEM_NOTFOUND) && !mpImpl->mpItemList->empty() )
{
size_t nItemPos = mnDropPos;
- USHORT nItemId1;
- USHORT nItemId2 = 0;
- BOOL bRight;
+ sal_uInt16 nItemId1;
+ sal_uInt16 nItemId2 = 0;
+ sal_Bool bRight;
if ( nItemPos >= mpImpl->mpItemList->size() )
{
nItemPos = mpImpl->mpItemList->size() - 1;
- bRight = TRUE;
+ bRight = sal_True;
}
else
- bRight = FALSE;
+ bRight = sal_False;
nItemId1 = GetItemId( nItemPos );
if ( (nItemId1 != mnSelItemId) && (nItemId1 != mnHighItemId) )
@@ -993,7 +993,7 @@ void ValueSet::ImplDrawDropPos( BOOL bShow )
Point aPos = aRect1.RightCenter();
nX = aPos.X()-2;
nY = aPos.Y();
- for ( USHORT i = 0; i < 4; i++ )
+ for ( sal_uInt16 i = 0; i < 4; i++ )
DrawLine( Point( nX-i, nY-i ), Point( nX-i, nY+i ) );
}
if ( !aRect2.IsEmpty() )
@@ -1001,7 +1001,7 @@ void ValueSet::ImplDrawDropPos( BOOL bShow )
Point aPos = aRect2.LeftCenter();
nX = aPos.X()+2;
nY = aPos.Y();
- for ( USHORT i = 0; i < 4; i++ )
+ for ( sal_uInt16 i = 0; i < 4; i++ )
DrawLine( Point( nX+i, nY-i ), Point( nX+i, nY+i ) );
}
}
@@ -1086,7 +1086,7 @@ void ValueSet::ImplDraw()
// -----------------------------------------------------------------------
-BOOL ValueSet::ImplScroll( const Point& rPos )
+sal_Bool ValueSet::ImplScroll( const Point& rPos )
{
Size aOutSize = GetOutputSizePixel();
long nScrBarWidth;
@@ -1097,10 +1097,10 @@ BOOL ValueSet::ImplScroll( const Point& rPos )
nScrBarWidth = 0;
if ( !mbScroll || (rPos.X() < 0) || (rPos.X() > aOutSize.Width()-nScrBarWidth) )
- return FALSE;
+ return sal_False;
long nScrollOffset;
- USHORT nOldLine = mnFirstLine;
+ sal_uInt16 nOldLine = mnFirstLine;
const Rectangle& rTopRect = (*mpImpl->mpItemList)[ mnFirstLine * mnCols ]->maRect;
if ( rTopRect.GetHeight() <= 16 )
nScrollOffset = VALUESET_SCROLL_OFFSET/2;
@@ -1113,7 +1113,7 @@ BOOL ValueSet::ImplScroll( const Point& rPos )
mnFirstLine--;
}
if ( (mnFirstLine == nOldLine) &&
- (mnFirstLine < (USHORT)(mnLines-mnVisLines)) && (rPos.Y() < aOutSize.Height()) )
+ (mnFirstLine < (sal_uInt16)(mnLines-mnVisLines)) && (rPos.Y() < aOutSize.Height()) )
{
long nBottomPos = (*mpImpl->mpItemList)[ (mnFirstLine+mnVisLines-1)*mnCols ]->maRect.Bottom();
if ( (rPos.Y() >= nBottomPos-nScrollOffset) && (rPos.Y() <= nBottomPos) )
@@ -1122,17 +1122,17 @@ BOOL ValueSet::ImplScroll( const Point& rPos )
if ( mnFirstLine != nOldLine )
{
- mbFormat = TRUE;
+ mbFormat = sal_True;
ImplDraw();
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-size_t ValueSet::ImplGetItem( const Point& rPos, BOOL bMove ) const
+size_t ValueSet::ImplGetItem( const Point& rPos, sal_Bool bMove ) const
{
if ( mpNoneItem )
{
@@ -1194,9 +1194,9 @@ ValueSetItem* ValueSet::ImplGetFirstItem()
// -----------------------------------------------------------------------
-USHORT ValueSet::ImplGetVisibleItemCount() const
+sal_uInt16 ValueSet::ImplGetVisibleItemCount() const
{
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
for( size_t n = 0, nItemCount = mpImpl->mpItemList->size(); n < nItemCount; n++ )
{
@@ -1211,10 +1211,10 @@ USHORT ValueSet::ImplGetVisibleItemCount() const
// -----------------------------------------------------------------------
-ValueSetItem* ValueSet::ImplGetVisibleItem( USHORT nVisiblePos )
+ValueSetItem* ValueSet::ImplGetVisibleItem( sal_uInt16 nVisiblePos )
{
ValueSetItem* pRet = NULL;
- USHORT nFoundPos = 0;
+ sal_uInt16 nFoundPos = 0;
for( sal_Int32 n = 0, nItemCount = mpImpl->mpItemList->size(); ( n < nItemCount ) && !pRet; n++ )
{
@@ -1231,7 +1231,7 @@ ValueSetItem* ValueSet::ImplGetVisibleItem( USHORT nVisiblePos )
void ValueSet::ImplFireAccessibleEvent( short nEventId, const ::com::sun::star::uno::Any& rOldValue, const ::com::sun::star::uno::Any& rNewValue )
{
- ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( FALSE ) );
+ ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( sal_False ) );
if( pAcc )
pAcc->FireAccessibleEvent( nEventId, rOldValue, rNewValue );
@@ -1239,9 +1239,9 @@ void ValueSet::ImplFireAccessibleEvent( short nEventId, const ::com::sun::star::
// -----------------------------------------------------------------------
-BOOL ValueSet::ImplHasAccessibleListeners()
+sal_Bool ValueSet::ImplHasAccessibleListeners()
{
- ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( FALSE ) );
+ ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( sal_False ) );
return( pAcc && pAcc->HasAccessibleListeners() );
}
@@ -1249,11 +1249,11 @@ BOOL ValueSet::ImplHasAccessibleListeners()
IMPL_LINK( ValueSet,ImplScrollHdl, ScrollBar*, pScrollBar )
{
- USHORT nNewFirstLine = (USHORT)pScrollBar->GetThumbPos();
+ sal_uInt16 nNewFirstLine = (sal_uInt16)pScrollBar->GetThumbPos();
if ( nNewFirstLine != mnFirstLine )
{
mnFirstLine = nNewFirstLine;
- mbFormat = TRUE;
+ mbFormat = sal_True;
ImplDraw();
}
return 0;
@@ -1263,13 +1263,13 @@ IMPL_LINK( ValueSet,ImplScrollHdl, ScrollBar*, pScrollBar )
IMPL_LINK( ValueSet,ImplTimerHdl, Timer*, EMPTYARG )
{
- ImplTracking( GetPointerPosPixel(), TRUE );
+ ImplTracking( GetPointerPosPixel(), sal_True );
return 0;
}
// -----------------------------------------------------------------------
-void ValueSet::ImplTracking( const Point& rPos, BOOL bRepeat )
+void ValueSet::ImplTracking( const Point& rPos, sal_Bool bRepeat )
{
if ( bRepeat || mbSelection )
{
@@ -1288,22 +1288,22 @@ void ValueSet::ImplTracking( const Point& rPos, BOOL bRepeat )
if ( pItem && (pItem->meType != VALUESETITEM_SPACE) )
{
if( GetStyle() & WB_MENUSTYLEVALUESET )
- mbHighlight = TRUE;
+ mbHighlight = sal_True;
ImplHighlightItem( pItem->mnId );
}
else
{
if( GetStyle() & WB_MENUSTYLEVALUESET )
- mbHighlight = TRUE;
+ mbHighlight = sal_True;
- ImplHighlightItem( mnSelItemId, FALSE );
+ ImplHighlightItem( mnSelItemId, sal_False );
}
}
// -----------------------------------------------------------------------
-void ValueSet::ImplEndTracking( const Point& rPos, BOOL bCancel )
+void ValueSet::ImplEndTracking( const Point& rPos, sal_Bool bCancel )
{
ValueSetItem* pItem;
@@ -1318,15 +1318,15 @@ void ValueSet::ImplEndTracking( const Point& rPos, BOOL bCancel )
SelectItem( pItem->mnId );
if ( !mbSelection && !(GetStyle() & WB_NOPOINTERFOCUS) )
GrabFocus();
- mbHighlight = FALSE;
- mbSelection = FALSE;
+ mbHighlight = sal_False;
+ mbSelection = sal_False;
Select();
}
else
{
- ImplHighlightItem( mnSelItemId, FALSE );
- mbHighlight = FALSE;
- mbSelection = FALSE;
+ ImplHighlightItem( mnSelItemId, sal_False );
+ mbHighlight = sal_False;
+ mbSelection = sal_False;
}
}
@@ -1339,7 +1339,7 @@ void ValueSet::MouseButtonDown( const MouseEvent& rMEvt )
ValueSetItem* pItem = ImplGetItem( ImplGetItem( rMEvt.GetPosPixel() ) );
if ( mbSelection )
{
- mbHighlight = TRUE;
+ mbHighlight = sal_True;
if ( pItem && (pItem->meType != VALUESETITEM_SPACE) )
{
mnOldItemId = mnSelItemId;
@@ -1356,7 +1356,7 @@ void ValueSet::MouseButtonDown( const MouseEvent& rMEvt )
if ( (pItem->mnBits & VIB_NODOUBLECLICK) || (rMEvt.GetClicks() == 1) )
{
mnOldItemId = mnSelItemId;
- mbHighlight = TRUE;
+ mbHighlight = sal_True;
mnHighItemId = mnSelItemId;
ImplHighlightItem( pItem->mnId );
StartTracking( STARTTRACK_SCROLLREPEAT );
@@ -1378,7 +1378,7 @@ void ValueSet::MouseButtonUp( const MouseEvent& rMEvt )
{
// Wegen SelectionMode
if ( rMEvt.IsLeft() && mbSelection )
- ImplEndTracking( rMEvt.GetPosPixel(), FALSE );
+ ImplEndTracking( rMEvt.GetPosPixel(), sal_False );
else
Control::MouseButtonUp( rMEvt );
}
@@ -1389,7 +1389,7 @@ void ValueSet::MouseMove( const MouseEvent& rMEvt )
{
// Wegen SelectionMode
if ( mbSelection || (GetStyle() & WB_MENUSTYLEVALUESET) )
- ImplTracking( rMEvt.GetPosPixel(), FALSE );
+ ImplTracking( rMEvt.GetPosPixel(), sal_False );
Control::MouseMove( rMEvt );
}
@@ -1427,7 +1427,7 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt )
nCalcPos = nCurPos;
//switch off selection mode if key travelling is used
- BOOL bDefault = FALSE;
+ sal_Bool bDefault = sal_False;
switch ( rKEvt.GetKeyCode().GetCode() )
{
case KEY_HOME:
@@ -1515,7 +1515,7 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt )
}
}
else if ( nCalcPos >= ( nLineCount * mnCols ) )
- nItemPos = sal::static_int_cast< USHORT >(
+ nItemPos = sal::static_int_cast< sal_uInt16 >(
nCalcPos - ( nLineCount * mnCols ));
else
{
@@ -1557,7 +1557,7 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt )
if ( nCalcPos == VALUESET_ITEM_NONEITEM )
nItemPos = mnCurCol;
else if ( nCalcPos + ( nLineCount * mnCols ) <= nLastItem )
- nItemPos = sal::static_int_cast< USHORT >(
+ nItemPos = sal::static_int_cast< sal_uInt16 >(
nCalcPos + ( nLineCount * mnCols ));
else
{
@@ -1590,14 +1590,14 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt )
//no break;
default:
Control::KeyInput( rKEvt );
- bDefault = TRUE;
+ bDefault = sal_True;
break;
}
if(!bDefault)
EndSelection();
if ( nItemPos != VALUESET_ITEM_NOTFOUND )
{
- USHORT nItemId;
+ sal_uInt16 nItemId;
if ( nItemPos != VALUESET_ITEM_NONEITEM )
nItemId = GetItemId( nItemPos );
else
@@ -1654,7 +1654,7 @@ void ValueSet::GetFocus()
Control::GetFocus();
// Tell the accessible object that we got the focus.
- ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( FALSE ) );
+ ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( sal_False ) );
if( pAcc )
pAcc->GetFocus();
}
@@ -1671,7 +1671,7 @@ void ValueSet::LoseFocus()
Control::LoseFocus();
// Tell the accessible object that we lost the focus.
- ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( FALSE ) );
+ ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( sal_False ) );
if( pAcc )
pAcc->LoseFocus();
}
@@ -1680,7 +1680,7 @@ void ValueSet::LoseFocus()
void ValueSet::Resize()
{
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
Control::Resize();
@@ -1739,23 +1739,23 @@ void ValueSet::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
else if ( (nType == STATE_CHANGE_STYLE) || (nType == STATE_CHANGE_ENABLE) )
{
- mbFormat = TRUE;
- ImplInitSettings( FALSE, FALSE, TRUE );
+ mbFormat = sal_True;
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
}
@@ -1772,8 +1772,8 @@ void ValueSet::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- mbFormat = TRUE;
- ImplInitSettings( TRUE, TRUE, TRUE );
+ mbFormat = sal_True;
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
}
@@ -1800,7 +1800,7 @@ void ValueSet::UserDraw( const UserDrawEvent& )
// -----------------------------------------------------------------------
-void ValueSet::InsertItem( USHORT nItemId, const Image& rImage, size_t nPos )
+void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage, size_t nPos )
{
DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
@@ -1818,14 +1818,14 @@ void ValueSet::InsertItem( USHORT nItemId, const Image& rImage, size_t nPos )
mpImpl->mpItemList->push_back( pItem );
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
// -----------------------------------------------------------------------
-void ValueSet::InsertItem( USHORT nItemId, const Color& rColor, size_t nPos )
+void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor, size_t nPos )
{
DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
@@ -1843,14 +1843,14 @@ void ValueSet::InsertItem( USHORT nItemId, const Color& rColor, size_t nPos )
mpImpl->mpItemList->push_back( pItem );
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
// -----------------------------------------------------------------------
-void ValueSet::InsertItem( USHORT nItemId, const Image& rImage,
+void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage,
const XubString& rText, size_t nPos )
{
DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
@@ -1870,14 +1870,14 @@ void ValueSet::InsertItem( USHORT nItemId, const Image& rImage,
mpImpl->mpItemList->push_back( pItem );
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
// -----------------------------------------------------------------------
-void ValueSet::InsertItem( USHORT nItemId, const Color& rColor,
+void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor,
const XubString& rText, size_t nPos )
{
DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
@@ -1897,14 +1897,14 @@ void ValueSet::InsertItem( USHORT nItemId, const Color& rColor,
mpImpl->mpItemList->push_back( pItem );
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
// -----------------------------------------------------------------------
-void ValueSet::InsertItem( USHORT nItemId, size_t nPos )
+void ValueSet::InsertItem( sal_uInt16 nItemId, size_t nPos )
{
DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
@@ -1921,14 +1921,14 @@ void ValueSet::InsertItem( USHORT nItemId, size_t nPos )
mpImpl->mpItemList->push_back( pItem );
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
// -----------------------------------------------------------------------
-void ValueSet::InsertSpace( USHORT nItemId, size_t nPos )
+void ValueSet::InsertSpace( sal_uInt16 nItemId, size_t nPos )
{
DBG_ASSERT( nItemId, "ValueSet::InsertSpace(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
@@ -1945,14 +1945,14 @@ void ValueSet::InsertSpace( USHORT nItemId, size_t nPos )
mpImpl->mpItemList->push_back( pItem );
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
// -----------------------------------------------------------------------
-void ValueSet::RemoveItem( USHORT nItemId )
+void ValueSet::RemoveItem( sal_uInt16 nItemId )
{
size_t nPos = GetItemPos( nItemId );
@@ -1973,10 +1973,10 @@ void ValueSet::RemoveItem( USHORT nItemId )
mnOldItemId = 0;
mnHighItemId = 0;
mnSelItemId = 0;
- mbNoSelection = TRUE;
+ mbNoSelection = sal_True;
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2010,9 +2010,9 @@ void ValueSet::CopyItems( const ValueSet& rValueSet )
mnOldItemId = 0;
mnHighItemId = 0;
mnSelItemId = 0;
- mbNoSelection = TRUE;
+ mbNoSelection = sal_True;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2029,9 +2029,9 @@ void ValueSet::Clear()
mnOldItemId = 0;
mnHighItemId = 0;
mnSelItemId = 0;
- mbNoSelection = TRUE;
+ mbNoSelection = sal_True;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2045,7 +2045,7 @@ size_t ValueSet::GetItemCount() const
// -----------------------------------------------------------------------
-size_t ValueSet::GetItemPos( USHORT nItemId ) const
+size_t ValueSet::GetItemPos( sal_uInt16 nItemId ) const
{
for ( size_t i = 0, n = mpImpl->mpItemList->size(); i < n; ++i ) {
ValueSetItem* pItem = (*mpImpl->mpItemList)[ i ];
@@ -2058,14 +2058,14 @@ size_t ValueSet::GetItemPos( USHORT nItemId ) const
// -----------------------------------------------------------------------
-USHORT ValueSet::GetItemId( size_t nPos ) const
+sal_uInt16 ValueSet::GetItemId( size_t nPos ) const
{
return ( nPos < mpImpl->mpItemList->size() ) ? (*mpImpl->mpItemList)[ nPos ]->mnId : 0 ;
}
// -----------------------------------------------------------------------
-USHORT ValueSet::GetItemId( const Point& rPos ) const
+sal_uInt16 ValueSet::GetItemId( const Point& rPos ) const
{
size_t nItemPos = ImplGetItem( rPos );
if ( nItemPos != VALUESET_ITEM_NOTFOUND )
@@ -2076,7 +2076,7 @@ USHORT ValueSet::GetItemId( const Point& rPos ) const
// -----------------------------------------------------------------------
-Rectangle ValueSet::GetItemRect( USHORT nItemId ) const
+Rectangle ValueSet::GetItemRect( sal_uInt16 nItemId ) const
{
size_t nPos = GetItemPos( nItemId );
@@ -2088,19 +2088,19 @@ Rectangle ValueSet::GetItemRect( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ValueSet::EnableFullItemMode( BOOL bFullMode )
+void ValueSet::EnableFullItemMode( sal_Bool bFullMode )
{
mbFullMode = bFullMode;
}
// -----------------------------------------------------------------------
-void ValueSet::SetColCount( USHORT nNewCols )
+void ValueSet::SetColCount( sal_uInt16 nNewCols )
{
if ( mnUserCols != nNewCols )
{
mnUserCols = nNewCols;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2108,12 +2108,12 @@ void ValueSet::SetColCount( USHORT nNewCols )
// -----------------------------------------------------------------------
-void ValueSet::SetLineCount( USHORT nNewLines )
+void ValueSet::SetLineCount( sal_uInt16 nNewLines )
{
if ( mnUserVisLines != nNewLines )
{
mnUserVisLines = nNewLines;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2126,7 +2126,7 @@ void ValueSet::SetItemWidth( long nNewItemWidth )
if ( mnUserItemWidth != nNewItemWidth )
{
mnUserItemWidth = nNewItemWidth;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2139,7 +2139,7 @@ void ValueSet::SetItemHeight( long nNewItemHeight )
if ( mnUserItemHeight != nNewItemHeight )
{
mnUserItemHeight = nNewItemHeight;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2147,12 +2147,12 @@ void ValueSet::SetItemHeight( long nNewItemHeight )
// -----------------------------------------------------------------------
-void ValueSet::SetFirstLine( USHORT nNewLine )
+void ValueSet::SetFirstLine( sal_uInt16 nNewLine )
{
if ( mnFirstLine != nNewLine )
{
mnFirstLine = nNewLine;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2160,7 +2160,7 @@ void ValueSet::SetFirstLine( USHORT nNewLine )
// -----------------------------------------------------------------------
-void ValueSet::SelectItem( USHORT nItemId )
+void ValueSet::SelectItem( sal_uInt16 nItemId )
{
size_t nItemPos = 0;
@@ -2175,31 +2175,31 @@ void ValueSet::SelectItem( USHORT nItemId )
if ( (mnSelItemId != nItemId) || mbNoSelection )
{
- USHORT nOldItem = mnSelItemId ? mnSelItemId : 1;
+ sal_uInt16 nOldItem = mnSelItemId ? mnSelItemId : 1;
mnSelItemId = nItemId;
- mbNoSelection = FALSE;
+ mbNoSelection = sal_False;
- BOOL bNewOut;
- BOOL bNewLine;
+ sal_Bool bNewOut;
+ sal_Bool bNewLine;
if ( !mbFormat && IsReallyVisible() && IsUpdateMode() )
- bNewOut = TRUE;
+ bNewOut = sal_True;
else
- bNewOut = FALSE;
- bNewLine = FALSE;
+ bNewOut = sal_False;
+ bNewLine = sal_False;
// Gegebenenfalls in den sichtbaren Bereich scrollen
if ( mbScroll && nItemId )
{
- USHORT nNewLine = (USHORT)(nItemPos / mnCols);
+ sal_uInt16 nNewLine = (sal_uInt16)(nItemPos / mnCols);
if ( nNewLine < mnFirstLine )
{
mnFirstLine = nNewLine;
- bNewLine = TRUE;
+ bNewLine = sal_True;
}
- else if ( nNewLine > (USHORT)(mnFirstLine+mnVisLines-1) )
+ else if ( nNewLine > (sal_uInt16)(mnFirstLine+mnVisLines-1) )
{
- mnFirstLine = (USHORT)(nNewLine-mnVisLines+1);
- bNewLine = TRUE;
+ mnFirstLine = (sal_uInt16)(nNewLine-mnVisLines+1);
+ bNewLine = sal_True;
}
}
@@ -2209,7 +2209,7 @@ void ValueSet::SelectItem( USHORT nItemId )
{
// Falls sich der sichtbare Bereich geaendert hat,
// alles neu ausgeben
- mbFormat = TRUE;
+ mbFormat = sal_True;
ImplDraw();
}
else
@@ -2291,9 +2291,9 @@ void ValueSet::SelectItem( USHORT nItemId )
void ValueSet::SetNoSelection()
{
- mbNoSelection = TRUE;
- mbHighlight = FALSE;
- mbSelection = FALSE;
+ mbNoSelection = sal_True;
+ mbHighlight = sal_False;
+ mbSelection = sal_False;
if ( IsReallyVisible() && IsUpdateMode() )
ImplDraw();
@@ -2301,7 +2301,7 @@ void ValueSet::SetNoSelection()
// -----------------------------------------------------------------------
-void ValueSet::SetItemBits( USHORT nItemId, USHORT nItemBits )
+void ValueSet::SetItemBits( sal_uInt16 nItemId, sal_uInt16 nItemBits )
{
size_t nPos = GetItemPos( nItemId );
@@ -2311,7 +2311,7 @@ void ValueSet::SetItemBits( USHORT nItemId, USHORT nItemBits )
// -----------------------------------------------------------------------
-USHORT ValueSet::GetItemBits( USHORT nItemId ) const
+sal_uInt16 ValueSet::GetItemBits( sal_uInt16 nItemId ) const
{
size_t nPos = GetItemPos( nItemId );
@@ -2323,7 +2323,7 @@ USHORT ValueSet::GetItemBits( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ValueSet::SetItemImage( USHORT nItemId, const Image& rImage )
+void ValueSet::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
{
size_t nPos = GetItemPos( nItemId );
@@ -2340,12 +2340,12 @@ void ValueSet::SetItemImage( USHORT nItemId, const Image& rImage )
Invalidate( pItem->maRect );
}
else
- mbFormat = TRUE;
+ mbFormat = sal_True;
}
// -----------------------------------------------------------------------
-Image ValueSet::GetItemImage( USHORT nItemId ) const
+Image ValueSet::GetItemImage( sal_uInt16 nItemId ) const
{
size_t nPos = GetItemPos( nItemId );
@@ -2357,7 +2357,7 @@ Image ValueSet::GetItemImage( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ValueSet::SetItemColor( USHORT nItemId, const Color& rColor )
+void ValueSet::SetItemColor( sal_uInt16 nItemId, const Color& rColor )
{
size_t nPos = GetItemPos( nItemId );
@@ -2374,12 +2374,12 @@ void ValueSet::SetItemColor( USHORT nItemId, const Color& rColor )
Invalidate( pItem->maRect );
}
else
- mbFormat = TRUE;
+ mbFormat = sal_True;
}
// -----------------------------------------------------------------------
-Color ValueSet::GetItemColor( USHORT nItemId ) const
+Color ValueSet::GetItemColor( sal_uInt16 nItemId ) const
{
size_t nPos = GetItemPos( nItemId );
@@ -2391,7 +2391,7 @@ Color ValueSet::GetItemColor( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ValueSet::SetItemData( USHORT nItemId, void* pData )
+void ValueSet::SetItemData( sal_uInt16 nItemId, void* pData )
{
size_t nPos = GetItemPos( nItemId );
@@ -2409,13 +2409,13 @@ void ValueSet::SetItemData( USHORT nItemId, void* pData )
Invalidate( pItem->maRect );
}
else
- mbFormat = TRUE;
+ mbFormat = sal_True;
}
}
// -----------------------------------------------------------------------
-void* ValueSet::GetItemData( USHORT nItemId ) const
+void* ValueSet::GetItemData( sal_uInt16 nItemId ) const
{
size_t nPos = GetItemPos( nItemId );
@@ -2427,7 +2427,7 @@ void* ValueSet::GetItemData( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ValueSet::SetItemText( USHORT nItemId, const XubString& rText )
+void ValueSet::SetItemText( sal_uInt16 nItemId, const XubString& rText )
{
size_t nPos = GetItemPos( nItemId );
@@ -2448,7 +2448,7 @@ void ValueSet::SetItemText( USHORT nItemId, const XubString& rText )
if ( !mbFormat && IsReallyVisible() && IsUpdateMode() )
{
- USHORT nTempId = mnSelItemId;
+ sal_uInt16 nTempId = mnSelItemId;
if ( mbHighlight )
nTempId = mnHighItemId;
@@ -2470,7 +2470,7 @@ void ValueSet::SetItemText( USHORT nItemId, const XubString& rText )
// -----------------------------------------------------------------------
-XubString ValueSet::GetItemText( USHORT nItemId ) const
+XubString ValueSet::GetItemText( sal_uInt16 nItemId ) const
{
size_t nPos = GetItemPos( nItemId );
@@ -2485,20 +2485,20 @@ XubString ValueSet::GetItemText( USHORT nItemId ) const
void ValueSet::SetColor( const Color& rColor )
{
maColor = rColor;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
ImplDraw();
}
// -----------------------------------------------------------------------
-void ValueSet::SetExtraSpacing( USHORT nNewSpacing )
+void ValueSet::SetExtraSpacing( sal_uInt16 nNewSpacing )
{
if ( GetStyle() & WB_ITEMBORDER )
{
mnSpacing = nNewSpacing;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2509,8 +2509,8 @@ void ValueSet::SetExtraSpacing( USHORT nNewSpacing )
void ValueSet::StartSelection()
{
mnOldItemId = mnSelItemId;
- mbHighlight = TRUE;
- mbSelection = TRUE;
+ mbHighlight = sal_True;
+ mbSelection = sal_True;
mnHighItemId = mnSelItemId;
}
@@ -2524,17 +2524,17 @@ void ValueSet::EndSelection()
EndTracking( ENDTRACK_CANCEL );
ImplHighlightItem( mnSelItemId );
- mbHighlight = FALSE;
+ mbHighlight = sal_False;
}
- mbSelection = FALSE;
+ mbSelection = sal_False;
}
// -----------------------------------------------------------------------
-BOOL ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
+sal_Bool ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
{
if ( rCEvt.GetCommand() != COMMAND_STARTDRAG )
- return FALSE;
+ return sal_False;
// Gegebenenfalls eine vorhandene Aktion abbrechen
EndSelection();
@@ -2543,7 +2543,7 @@ BOOL ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
// der Fall ist, setzen wir ihn als aktuellen Eintrag. Falls Drag and
// Drop auch mal ueber Tastatur ausgeloest werden kann, testen wir
// dies nur bei einer Mausaktion.
- USHORT nSelId;
+ sal_uInt16 nSelId;
if ( rCEvt.IsMouseEvent() )
nSelId = GetItemId( rCEvt.GetMousePosPixel() );
else
@@ -2551,7 +2551,7 @@ BOOL ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
// Falls kein Eintrag angeklickt wurde, starten wir kein Dragging
if ( !nSelId )
- return FALSE;
+ return sal_False;
// Testen, ob Seite selektiertiert ist. Falls nicht, als aktuelle
// Seite setzen und Select rufen.
@@ -2567,13 +2567,13 @@ BOOL ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
// Region zuweisen
rRegion = aRegion;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, USHORT nDesireCols,
- USHORT nDesireLines )
+Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, sal_uInt16 nDesireCols,
+ sal_uInt16 nDesireLines )
{
size_t nCalcCols = nDesireCols;
size_t nCalcLines = nDesireLines;
@@ -2655,7 +2655,7 @@ Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, USHORT nDesireCols,
// -----------------------------------------------------------------------
-Size ValueSet::CalcItemSizePixel( const Size& rItemSize, BOOL bOut ) const
+Size ValueSet::CalcItemSizePixel( const Size& rItemSize, sal_Bool bOut ) const
{
Size aSize = rItemSize;
@@ -2699,15 +2699,15 @@ long ValueSet::GetScrollWidth() const
// -----------------------------------------------------------------------
-USHORT ValueSet::ShowDropPos( const Point& rPos )
+sal_uInt16 ValueSet::ShowDropPos( const Point& rPos )
{
- mbDropPos = TRUE;
+ mbDropPos = sal_True;
// Gegebenenfalls scrollen
ImplScroll( rPos );
// DropPosition ermitteln
- size_t nPos = ImplGetItem( rPos, TRUE );
+ size_t nPos = ImplGetItem( rPos, sal_True );
if ( nPos == VALUESET_ITEM_NONEITEM )
nPos = 0;
else if ( nPos == VALUESET_ITEM_NOTFOUND )
@@ -2729,9 +2729,9 @@ USHORT ValueSet::ShowDropPos( const Point& rPos )
if ( nPos != mnDropPos )
{
- ImplDrawDropPos( FALSE );
+ ImplDrawDropPos( sal_False );
mnDropPos = nPos;
- ImplDrawDropPos( TRUE );
+ ImplDrawDropPos( sal_True );
}
return mnDropPos;
@@ -2743,8 +2743,8 @@ void ValueSet::HideDropPos()
{
if ( mbDropPos )
{
- ImplDrawDropPos( FALSE );
- mbDropPos = FALSE;
+ ImplDrawDropPos( sal_False );
+ mbDropPos = sal_False;
}
}
diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx
index 2bfba531453d..5f3f46aa669d 100644
--- a/svtools/source/dialogs/addresstemplate.cxx
+++ b/svtools/source/dialogs/addresstemplate.cxx
@@ -30,9 +30,7 @@
#include "precompiled_svtools.hxx"
#include <stdio.h>
-
-
-#include "addresstemplate.hxx"
+#include <svtools/addresstemplate.hxx>
#include "addresstemplate.hrc"
#include <svtools/svtools.hrc>
#include <svtools/helpid.hrc>
@@ -44,7 +42,7 @@
#include <vcl/waitobj.hxx>
#include <vcl/msgbox.hxx>
#include <toolkit/helper/vclunohelper.hxx>
-#include <cppuhelper/extract.hxx>
+#include <comphelper/extract.hxx>
#include <comphelper/interaction.hxx>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <com/sun/star/awt/XWindow.hpp>
@@ -58,10 +56,9 @@
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
-#include "localresaccess.hxx"
+#include <svtools/localresaccess.hxx>
#include "svl/filenotation.hxx"
#include <tools/urlobj.hxx>
-
#include <algorithm>
// .......................................................................
@@ -594,9 +591,9 @@ void AssignmentPersistentData::Commit()
for (sal_Int32 column=0; column<2; ++column)
{
// the label
- m_pImpl->pFieldLabels[row * 2 + column] = new FixedText(&m_aFieldsFrame, SvtResId((USHORT)(FT_FIELD_BASE + row * 2 + column)));
+ m_pImpl->pFieldLabels[row * 2 + column] = new FixedText(&m_aFieldsFrame, SvtResId((sal_uInt16)(FT_FIELD_BASE + row * 2 + column)));
// the listbox
- m_pImpl->pFields[row * 2 + column] = new ListBox(&m_aFieldsFrame, SvtResId((USHORT)(LB_FIELD_BASE + row * 2 + column)));
+ m_pImpl->pFields[row * 2 + column] = new ListBox(&m_aFieldsFrame, SvtResId((sal_uInt16)(LB_FIELD_BASE + row * 2 + column)));
m_pImpl->pFields[row * 2 + column]->SetDropDownLineCount(15);
m_pImpl->pFields[row * 2 + column]->SetSelectHdl(LINK(this, AddressBookSourceDialog, OnFieldSelect));
diff --git a/svtools/source/dialogs/addresstemplate.src b/svtools/source/dialogs/addresstemplate.src
index 52a663f5b3ae..0e4845949dca 100644
--- a/svtools/source/dialogs/addresstemplate.src
+++ b/svtools/source/dialogs/addresstemplate.src
@@ -27,12 +27,13 @@
#include <svtools/svtools.hrc>
#include "addresstemplate.hrc"
-#include "controldims.hrc"
+#include <svtools/controldims.hrc>
#define FIELD_ROW_HEIGHT 17
ModalDialog DLG_ADDRESSBOOKSOURCE
{
+ HelpID = "svtools:ModalDialog:DLG_ADDRESSBOOKSOURCE";
SVLook = TRUE ;
OutputSize = TRUE ;
Size = MAP_APPFONT ( 300 , 88 + FIELD_ROW_HEIGHT * FIELD_PAIRS_VISIBLE ) ;
@@ -58,6 +59,7 @@ ModalDialog DLG_ADDRESSBOOKSOURCE
};
ComboBox CB_DATASOURCE
{
+ HelpID = "svtools:ComboBox:DLG_ADDRESSBOOKSOURCE:CB_DATASOURCE";
SVLook = TRUE ;
Pos = MAP_APPFONT ( 105, 13 ) ;
Size = MAP_APPFONT ( 96, 55 ) ;
@@ -67,6 +69,7 @@ ModalDialog DLG_ADDRESSBOOKSOURCE
};
PushButton PB_ADMINISTATE_DATASOURCES
{
+ HelpID = "svtools:PushButton:DLG_ADDRESSBOOKSOURCE:PB_ADMINISTATE_DATASOURCES";
Text [ en-US ] = "~Address Data Source...";
SVLook = TRUE ;
Pos = MAP_APPFONT ( 204, 13 ) ;
@@ -84,6 +87,7 @@ ModalDialog DLG_ADDRESSBOOKSOURCE
};
ComboBox CB_TABLE
{
+ HelpID = "svtools:ComboBox:DLG_ADDRESSBOOKSOURCE:CB_TABLE";
SVLook = TRUE ;
Pos = MAP_APPFONT ( 105, 30 ) ;
Size = MAP_APPFONT ( 96, 55 ) ;
diff --git a/svtools/source/dialogs/colctrl.cxx b/svtools/source/dialogs/colctrl.cxx
index 65e9a207d76f..d98e0bd780b9 100644
--- a/svtools/source/dialogs/colctrl.cxx
+++ b/svtools/source/dialogs/colctrl.cxx
@@ -86,19 +86,19 @@ void SvColorControl::CreateBitmap()
if( pWriteAccess )
{
- USHORT nX = (USHORT) aSize.Width();
- USHORT nY = (USHORT) aSize.Height();
+ sal_uInt16 nX = (sal_uInt16) aSize.Width();
+ sal_uInt16 nY = (sal_uInt16) aSize.Height();
- UINT16 nHue, nSat;
+ sal_uInt16 nHue, nSat;
ColorHSB aColHSB( 0, 0, mnLuminance );
- for( USHORT i = 0; i < nY; i++ )
+ for( sal_uInt16 i = 0; i < nY; i++ )
{
- nSat = (UINT16) FRound( 100 - ( 100.0 * i + 0.5 ) / nY );
+ nSat = (sal_uInt16) FRound( 100 - ( 100.0 * i + 0.5 ) / nY );
- for( USHORT j = 0; j < nX; j++ )
+ for( sal_uInt16 j = 0; j < nX; j++ )
{
- nHue = (UINT16) FRound( ( 360.0 * j + 0.5 ) / nX );
+ nHue = (sal_uInt16) FRound( ( 360.0 * j + 0.5 ) / nX );
aColHSB.SetHue( nHue );
aColHSB.SetSat( nSat );
@@ -162,7 +162,7 @@ void SvColorControl::MouseButtonDown( const MouseEvent& rMEvt )
{
if( rMEvt.IsLeft() && !rMEvt.IsShift() )
{
- //ShowPointer( FALSE );
+ //ShowPointer( sal_False );
CaptureMouse();
ShowPosition( rMEvt.GetPosPixel() );
Modify();
@@ -172,7 +172,7 @@ void SvColorControl::MouseButtonDown( const MouseEvent& rMEvt )
// -----------------------------------------------------------------------
void SvColorControl::MouseButtonUp( const MouseEvent& )
{
- //ShowPointer( TRUE );
+ //ShowPointer( sal_True );
if( IsMouseCaptured() )
ReleaseMouse();
}
@@ -220,16 +220,16 @@ void SvColorControl::Modify()
}
// -----------------------------------------------------------------------
-void SvColorControl::SetColor( const ColorHSB& rCol, BOOL bSetColor )
+void SvColorControl::SetColor( const ColorHSB& rCol, sal_Bool bSetColor )
{
if( bSetColor )
maColor = rCol.GetRGB();
if( mpBitmap )
{
- USHORT nX = (USHORT) mpBitmap->GetSizePixel().Width();
- USHORT nY = (USHORT) mpBitmap->GetSizePixel().Height();
- INT16 nZ = rCol.GetBri();
+ sal_uInt16 nX = (sal_uInt16) mpBitmap->GetSizePixel().Width();
+ sal_uInt16 nY = (sal_uInt16) mpBitmap->GetSizePixel().Height();
+ sal_Int16 nZ = rCol.GetBri();
SetLuminance( nZ );
nX = rCol.GetHue() * nX / 360; // Farbe
@@ -246,7 +246,7 @@ void SvColorControl::SetColor( const Color& rCol )
if( mpBitmap )
{
ColorHSB aColHsb( rCol );
- SetColor( aColHsb, FALSE );
+ SetColor( aColHsb, sal_False );
}
}
@@ -333,7 +333,7 @@ void ColorPreviewControl::SetColor( const Color& rCol )
// -----------------------------------------------------------------------
ColorMixingControl::ColorMixingControl( Window* pParent, WinBits nStyle,
- USHORT nRows, USHORT nColumns ) :
+ sal_uInt16 nRows, sal_uInt16 nColumns ) :
ValueSet ( pParent, nStyle ),
mnRows ( nRows ),
mnColumns ( nColumns )
@@ -343,7 +343,7 @@ ColorMixingControl::ColorMixingControl( Window* pParent, WinBits nStyle,
// -----------------------------------------------------------------------
ColorMixingControl::ColorMixingControl( Window* pParent, const ResId& rResId,
- USHORT nRows, USHORT nColumns ) :
+ sal_uInt16 nRows, sal_uInt16 nColumns ) :
ValueSet ( pParent, rResId ),
mnRows ( nRows ),
mnColumns ( nColumns )
@@ -364,7 +364,7 @@ void ColorMixingControl::Initialize()
Color aColor;
String aStr;
- for( USHORT i = 1; i <= mnRows * mnColumns; i++ )
+ for( sal_uInt16 i = 1; i <= mnRows * mnColumns; i++ )
{
InsertItem( i, aColor, aStr );
}
@@ -377,30 +377,30 @@ void ColorMixingControl::Initialize()
}
// -----------------------------------------------------------------------
-Color ColorMixingControl::CalcDifferenceColor( USHORT nCol1, USHORT nCol2,
- USHORT nSteps )
+Color ColorMixingControl::CalcDifferenceColor( sal_uInt16 nCol1, sal_uInt16 nCol2,
+ sal_uInt16 nSteps )
{
// Die Berechnung ist noch etwas ungenau, daher sollte besser mit floats
// gearbeitet werden... (muss !!!)
Color aColor( GetItemColor( nCol1 ) );
Color aColor2( GetItemColor( nCol2 ) );
- aColor.SetRed( (UINT8) ( ( aColor2.GetRed() - aColor.GetRed() ) / nSteps ) );
- aColor.SetGreen( (UINT8) ( ( aColor2.GetGreen() - aColor.GetGreen() ) / nSteps ) );
- aColor.SetBlue( (UINT8) ( ( aColor2.GetBlue() - aColor.GetBlue() ) / nSteps ) );
+ aColor.SetRed( (sal_uInt8) ( ( aColor2.GetRed() - aColor.GetRed() ) / nSteps ) );
+ aColor.SetGreen( (sal_uInt8) ( ( aColor2.GetGreen() - aColor.GetGreen() ) / nSteps ) );
+ aColor.SetBlue( (sal_uInt8) ( ( aColor2.GetBlue() - aColor.GetBlue() ) / nSteps ) );
return( aColor );
}
// -----------------------------------------------------------------------
-void ColorMixingControl::FillRow( USHORT nRow )
+void ColorMixingControl::FillRow( sal_uInt16 nRow )
{
- USHORT nCol1 = nRow * mnColumns + 1;
- USHORT nCol2 = ( nRow + 1 ) * mnColumns;
+ sal_uInt16 nCol1 = nRow * mnColumns + 1;
+ sal_uInt16 nCol2 = ( nRow + 1 ) * mnColumns;
Color aColor( GetItemColor( nCol1 ) );
Color aDiffColor( CalcDifferenceColor( nCol1, nCol2, mnColumns - 1 ) );
- for( USHORT i = nCol1 + 1; i < nCol2; i++ )
+ for( sal_uInt16 i = nCol1 + 1; i < nCol2; i++ )
{
aColor.SetRed( aColor.GetRed() + aDiffColor.GetRed() );
aColor.SetGreen( aColor.GetGreen() + aDiffColor.GetGreen() );
@@ -412,14 +412,14 @@ void ColorMixingControl::FillRow( USHORT nRow )
}
// -----------------------------------------------------------------------
-void ColorMixingControl::FillColumn( USHORT nColumn )
+void ColorMixingControl::FillColumn( sal_uInt16 nColumn )
{
- USHORT nCol1 = nColumn + 1;
- USHORT nCol2 = nColumn + ( mnRows - 1 ) * mnColumns + 1;
+ sal_uInt16 nCol1 = nColumn + 1;
+ sal_uInt16 nCol2 = nColumn + ( mnRows - 1 ) * mnColumns + 1;
Color aColor( GetItemColor( nCol1 ) );
Color aDiffColor( CalcDifferenceColor( nCol1, nCol2, mnRows - 1 ) );
- for( USHORT i = nCol1 + mnColumns; i < nCol2; i = i + mnColumns )
+ for( sal_uInt16 i = nCol1 + mnColumns; i < nCol2; i = i + mnColumns )
{
aColor.SetRed( aColor.GetRed() + aDiffColor.GetRed() );
aColor.SetGreen( aColor.GetGreen() + aDiffColor.GetGreen() );
@@ -431,13 +431,13 @@ void ColorMixingControl::FillColumn( USHORT nColumn )
}
// -----------------------------------------------------------------------
-void ColorMixingControl::SetRows( USHORT nRows )
+void ColorMixingControl::SetRows( sal_uInt16 nRows )
{
mnRows = nRows;
}
// -----------------------------------------------------------------------
-void ColorMixingControl::SetColumns( USHORT nColumns )
+void ColorMixingControl::SetColumns( sal_uInt16 nColumns )
{
mnColumns = nColumns;
}
@@ -448,8 +448,8 @@ void ColorMixingControl::SetColor( CMCPosition ePos, const Color& rCol )
if( rCol != maColor[ ePos ] )
{
maColor[ ePos ] = rCol;
- USHORT nPos = 0;
- USHORT nColumn = 0;
+ sal_uInt16 nPos = 0;
+ sal_uInt16 nColumn = 0;
String aStr( GetRGBString( rCol ) );
switch( ePos )
@@ -480,7 +480,7 @@ void ColorMixingControl::SetColor( CMCPosition ePos, const Color& rCol )
SetItemText( nPos, aStr );
FillColumn( nColumn );
- for( USHORT i = 0; i < mnRows; i++ )
+ for( sal_uInt16 i = 0; i < mnRows; i++ )
FillRow( i );
}
}
@@ -500,7 +500,7 @@ String ColorMixingControl::GetRGBString( const Color& rColor )
CMCPosition ColorMixingControl::GetCMCPosition() const
{
CMCPosition ePos = CMC_OTHER;
- USHORT nPos = GetSelectItemId();
+ sal_uInt16 nPos = GetSelectItemId();
if( nPos == 1 )
ePos = CMC_TOPLEFT;
@@ -531,8 +531,8 @@ CMCPosition ColorMixingControl::GetCMCPosition() const
ColorHSB::ColorHSB( const Color& rColor )
{
- UINT8 c[3];
- UINT8 cMax, cMin;
+ sal_uInt8 c[3];
+ sal_uInt8 cMax, cMin;
c[0] = rColor.GetRed();
c[1] = rColor.GetGreen();
@@ -553,7 +553,7 @@ ColorHSB::ColorHSB( const Color& rColor )
if( c[2] < cMin )
cMin = c[2];
- UINT8 cDelta = cMax - cMin;
+ sal_uInt8 cDelta = cMax - cMin;
// Saturation = max - min / max
if( mnBri > 0 )
@@ -585,7 +585,7 @@ ColorHSB::ColorHSB( const Color& rColor )
if( dHue < 0.0 )
dHue += 360.0;
- mnHue = (UINT16) dHue;
+ mnHue = (sal_uInt16) dHue;
}
}
@@ -597,8 +597,8 @@ ColorHSB::ColorHSB( const Color& rColor )
Color ColorHSB::GetRGB() const
{
- UINT8 cR,cG,cB;
- UINT8 nB = (UINT8) ( mnBri * 255 / 100 );
+ sal_uInt8 cR,cG,cB;
+ sal_uInt8 nB = (sal_uInt8) ( mnBri * 255 / 100 );
if( mnSat == 0 )
{
@@ -610,20 +610,20 @@ Color ColorHSB::GetRGB() const
{
double dH = mnHue;
double f;
- UINT16 n;
+ sal_uInt16 n;
if( dH == 360.0 )
dH = 0.0;
dH /= 60.0;
- n = (UINT16) dH;
+ n = (sal_uInt16) dH;
f = dH - n;
// #107375# Doing the calculation completely in floating
// point, the former optimization gave sometimes negative
// results for c and was pointless anyway
- UINT8 a = static_cast<UINT8>( nB * ( 100.0 - mnSat ) / 100.0 );
- UINT8 b = static_cast<UINT8>( nB * ( 100.0 - mnSat * f ) / 100.0 );
- UINT8 c = static_cast<UINT8>( nB * ( 100.0 - mnSat * ( 1.0 - f ) ) / 100.0 );
+ sal_uInt8 a = static_cast<sal_uInt8>( nB * ( 100.0 - mnSat ) / 100.0 );
+ sal_uInt8 b = static_cast<sal_uInt8>( nB * ( 100.0 - mnSat * f ) / 100.0 );
+ sal_uInt8 c = static_cast<sal_uInt8>( nB * ( 100.0 - mnSat * ( 1.0 - f ) ) / 100.0 );
switch( n )
{
@@ -663,11 +663,11 @@ ColorCMYK::ColorCMYK( const Color& rColor )
Color ColorCMYK::GetRGB() const
{
int nTmp = Max( 0, 255 - ( mnCyan + mnKey ) );
- UINT8 cR = (UINT8) nTmp;
+ sal_uInt8 cR = (sal_uInt8) nTmp;
nTmp = Max( 0, 255 - ( mnMagenta + mnKey ) );
- UINT8 cG = (UINT8) nTmp;
+ sal_uInt8 cG = (sal_uInt8) nTmp;
nTmp = Max( 0, 255 - ( mnYellow + mnKey ) );
- UINT8 cB = (UINT8) nTmp;
+ sal_uInt8 cB = (sal_uInt8) nTmp;
return( Color( cR, cG, cB ) );
}
diff --git a/svtools/source/dialogs/colrdlg.cxx b/svtools/source/dialogs/colrdlg.cxx
index de973dcbcd4a..5e94c0529760 100644
--- a/svtools/source/dialogs/colrdlg.cxx
+++ b/svtools/source/dialogs/colrdlg.cxx
@@ -159,7 +159,7 @@ const Color& SvColorDialog::GetColor() const
// -----------------------------------------------------------------------
IMPL_LINK( SvColorDialog, ColorModifyHdl, void *, p )
{
- UINT16 n = 0x00; // 1 == RGB, 2 == CMYK, 4 == HSB
+ sal_uInt16 n = 0x00; // 1 == RGB, 2 == CMYK, 4 == HSB
if( p == &maCtlColor )
{
@@ -172,19 +172,19 @@ IMPL_LINK( SvColorDialog, ColorModifyHdl, void *, p )
}
else if( p == &maNumRed )
{
- maColor.SetRed( (UINT8)maNumRed.GetValue() );
+ maColor.SetRed( (sal_uInt8)maNumRed.GetValue() );
maCtlColor.SetColor( maColor );
n = 6;
}
else if( p == &maNumGreen )
{
- maColor.SetGreen( (UINT8)maNumGreen.GetValue() );
+ maColor.SetGreen( (sal_uInt8)maNumGreen.GetValue() );
maCtlColor.SetColor( maColor );
n = 6;
}
else if( p == &maNumBlue )
{
- maColor.SetBlue( (UINT8)maNumBlue.GetValue() );
+ maColor.SetBlue( (sal_uInt8)maNumBlue.GetValue() );
maCtlColor.SetColor( maColor );
n = 6;
}
@@ -193,9 +193,9 @@ IMPL_LINK( SvColorDialog, ColorModifyHdl, void *, p )
p == &maNumLuminance )
{
- ColorHSB aColorHSB( (UINT16) maNumHue.GetValue(),
- (UINT16) maNumSaturation.GetValue(),
- (UINT16) maNumLuminance.GetValue() );
+ ColorHSB aColorHSB( (sal_uInt16) maNumHue.GetValue(),
+ (sal_uInt16) maNumSaturation.GetValue(),
+ (sal_uInt16) maNumLuminance.GetValue() );
maCtlColor.SetColor( aColorHSB );
maColor = maCtlColor.GetColor();
n = 3;
@@ -210,10 +210,10 @@ IMPL_LINK( SvColorDialog, ColorModifyHdl, void *, p )
long aYellow = (long) ( (double)maNumYellow.GetValue() * 255.0 / 100.0 + 0.5 );
long aKey = (long) ( (double)maNumKey.GetValue() * 255.0 / 100.0 + 0.5 );
- ColorCMYK aColorCMYK( (UINT16) aCyan,
- (UINT16) aMagenta,
- (UINT16) aYellow,
- (UINT16) aKey );
+ ColorCMYK aColorCMYK( (sal_uInt16) aCyan,
+ (sal_uInt16) aMagenta,
+ (sal_uInt16) aYellow,
+ (sal_uInt16) aKey );
maColor = aColorCMYK.GetRGB();
maCtlColor.SetColor( maColor );
n = 5;
@@ -273,7 +273,7 @@ IMPL_LINK( SvColorDialog, ClickBtnHdl, void *, p )
}
else if( p == &maBtn2 )
{
- USHORT nPos = maColMixCtrl.GetSelectItemId();
+ sal_uInt16 nPos = maColMixCtrl.GetSelectItemId();
maColor = maColMixCtrl.GetItemColor( nPos );
maCtlColor.SetColor( maColor );
ColorModifyHdl( &maCtlColor );
@@ -285,7 +285,7 @@ IMPL_LINK( SvColorDialog, ClickBtnHdl, void *, p )
// -----------------------------------------------------------------------
IMPL_LINK( SvColorDialog, ClickMixCtrlHdl, void *, EMPTYARG )
{
- USHORT nPos = maColMixCtrl.GetSelectItemId();
+ sal_uInt16 nPos = maColMixCtrl.GetSelectItemId();
CMCPosition ePos = maColMixCtrl.GetCMCPosition();
if( ePos != CMC_OTHER )
@@ -303,12 +303,12 @@ IMPL_LINK( SvColorDialog, ClickMixCtrlHdl, void *, EMPTYARG )
// -----------------------------------------------------------------------
IMPL_LINK( SvColorDialog, SelectMixCtrlHdl, void *, EMPTYARG )
{
- //USHORT nPos = maColMixCtrl.GetSelectItemId();
+ //sal_uInt16 nPos = maColMixCtrl.GetSelectItemId();
//maFtRGB.SetText( maColMixCtrl.GetItemText( nPos ) );
CMCPosition ePos = maColMixCtrl.GetCMCPosition();
if( ePos == CMC_OTHER )
- maBtn1.Enable( FALSE );
+ maBtn1.Enable( sal_False );
else
maBtn1.Enable();
diff --git a/svtools/source/dialogs/colrdlg.hrc b/svtools/source/dialogs/colrdlg.hrc
index 41329df6e366..b1e785bd2f17 100644
--- a/svtools/source/dialogs/colrdlg.hrc
+++ b/svtools/source/dialogs/colrdlg.hrc
@@ -65,3 +65,5 @@
#define BTN_CANCEL 1
#define BTN_HELP 1
+//IAccessibility2 Implementation 2009-----
+#define STR_COLORDES 3001
diff --git a/svtools/source/dialogs/colrdlg.src b/svtools/source/dialogs/colrdlg.src
index 34df3c11eeaa..c0b4f33db69a 100644
--- a/svtools/source/dialogs/colrdlg.src
+++ b/svtools/source/dialogs/colrdlg.src
@@ -29,6 +29,7 @@
#define DIFF 3
ModalDialog DLG_COLOR
{
+ HelpID = "svtools:ModalDialog:DLG_COLOR";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 260 , 165 + DIFF ) ;
@@ -93,6 +94,7 @@ ModalDialog DLG_COLOR
};
MetricField NUM_CYAN
{
+ HelpID = "svtools:MetricField:DLG_COLOR:NUM_CYAN";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 109 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -106,6 +108,7 @@ ModalDialog DLG_COLOR
};
MetricField NUM_MAGENTA
{
+ HelpID = "svtools:MetricField:DLG_COLOR:NUM_MAGENTA";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 122 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -119,6 +122,7 @@ ModalDialog DLG_COLOR
};
MetricField NUM_YELLOW
{
+ HelpID = "svtools:MetricField:DLG_COLOR:NUM_YELLOW";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 135 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -132,6 +136,7 @@ ModalDialog DLG_COLOR
};
MetricField NUM_KEY
{
+ HelpID = "svtools:MetricField:DLG_COLOR:NUM_KEY";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 148 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -163,6 +168,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_RED
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_RED";
Border = TRUE ;
Pos = MAP_APPFONT ( 106 , 122 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -174,6 +180,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_GREEN
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_GREEN";
Border = TRUE ;
Pos = MAP_APPFONT ( 106 , 135 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -185,6 +192,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_BLUE
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_BLUE";
Border = TRUE ;
Pos = MAP_APPFONT ( 106 , 148 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -202,6 +210,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_HUE
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_HUE";
Border = TRUE ;
Pos = MAP_APPFONT ( 171 , 122 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -219,6 +228,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_SATURATION
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_SATURATION";
Border = TRUE ;
Pos = MAP_APPFONT ( 171 , 135 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -236,6 +246,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_LUMINANCE
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_LUMINANCE";
Border = TRUE ;
Pos = MAP_APPFONT ( 171 , 148 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -247,6 +258,7 @@ ModalDialog DLG_COLOR
};
PushButton BTN_1
{
+ HelpID = "svtools:PushButton:DLG_COLOR:BTN_1";
Pos = MAP_APPFONT ( 80 , 109 ) ;
Size = MAP_APPFONT ( 17 , 12 ) ;
Text = "~<--" ;
@@ -254,6 +266,7 @@ ModalDialog DLG_COLOR
};
PushButton BTN_2
{
+ HelpID = "svtools:PushButton:DLG_COLOR:BTN_2";
Pos = MAP_APPFONT ( 100 , 109 ) ;
Size = MAP_APPFONT ( 17 , 12 ) ;
Text = "--~>" ;
@@ -264,13 +277,18 @@ ModalDialog DLG_COLOR
Border = TRUE ;
Pos = MAP_APPFONT ( 200 , 109 ) ;
Size = MAP_APPFONT ( 26 , 51 + DIFF ) ;
- TabStop = TRUE ;
+ TabStop = FALSE ;
};
Control CTL_PREVIEW
{
Border = TRUE ;
Pos = MAP_APPFONT ( 229 , 109 ) ;
Size = MAP_APPFONT ( 26 , 51 + DIFF ) ;
- TabStop = TRUE ;
+ TabStop = FALSE ;
};
};
+
+String STR_COLORDES
+{
+ Text [ en-US ] = "RGB(%1, %2, %3) Hue:%4 Saturation:%5 Brightness:%6";
+}; \ No newline at end of file
diff --git a/svtools/source/dialogs/filedlg.cxx b/svtools/source/dialogs/filedlg.cxx
index bbcd2964773d..e1a7548ba170 100644
--- a/svtools/source/dialogs/filedlg.cxx
+++ b/svtools/source/dialogs/filedlg.cxx
@@ -29,10 +29,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include <filedlg.hxx>
+#include <svtools/filedlg.hxx>
#include <filedlg2.hxx>
-PathDialog::PathDialog( Window* _pParent, WinBits nStyle, BOOL bCreateDir ) :
+PathDialog::PathDialog( Window* _pParent, WinBits nStyle, sal_Bool bCreateDir ) :
ModalDialog( _pParent, WB_STDMODAL | nStyle )
{
pImpFileDlg = new ImpSvFileDlg;
@@ -71,7 +71,7 @@ long PathDialog::OK()
if( aOKHdlLink.IsSet() )
return aOKHdlLink.Call( this );
else
- return TRUE;
+ return sal_True;
}
@@ -81,7 +81,7 @@ FileDialog::FileDialog( Window* _pParent, WinBits nStyle ) :
// Dadurch dass hier bei VCL nicht der CTOR mit ResType verwendet wird,
// wurde im PathDialog-CTOR leider ein ImpPathDialog angelegt...
// So zwar scheisse, aber der Dialog ist eh' nur ein Hack:
- pImpFileDlg->CreateDialog( this, nStyle, WINDOW_FILEDIALOG, FALSE );
+ pImpFileDlg->CreateDialog( this, nStyle, WINDOW_FILEDIALOG, sal_False );
}
FileDialog::~FileDialog()
@@ -123,17 +123,17 @@ void FileDialog::FilterSelect()
aFilterHdlLink.Call( this );
}
-USHORT FileDialog::GetFilterCount() const
+sal_uInt16 FileDialog::GetFilterCount() const
{
return ((ImpFileDialog*)pImpFileDlg->GetDialog())->GetFilterCount();
}
-UniString FileDialog::GetFilterName( USHORT nPos ) const
+UniString FileDialog::GetFilterName( sal_uInt16 nPos ) const
{
return ((ImpFileDialog*)pImpFileDlg->GetDialog())->GetFilterName( nPos );
}
-UniString FileDialog::GetFilterType( USHORT nPos ) const
+UniString FileDialog::GetFilterType( sal_uInt16 nPos ) const
{
return ((ImpFileDialog*)pImpFileDlg->GetDialog())->GetFilterType( nPos );
}
diff --git a/svtools/source/dialogs/filedlg2.cxx b/svtools/source/dialogs/filedlg2.cxx
index 3b96dd8649a6..a6ccff12a506 100644
--- a/svtools/source/dialogs/filedlg2.cxx
+++ b/svtools/source/dialogs/filedlg2.cxx
@@ -34,10 +34,9 @@
#include <vcl/edit.hxx>
#include <vcl/lstbox.hxx>
#include <svtools/svtdata.hxx>
-
#include <filedlg2.hxx>
-#include <filedlg.hxx>
-#include <filedlg2.hrc>
+#include <svtools/filedlg.hxx>
+#include <svtools/filedlg2.hrc>
#include <vcl/msgbox.hxx>
#include <osl/security.hxx>
#include <comphelper/string.hxx>
@@ -66,17 +65,17 @@ typedef ::std::vector< UniString* > UniStringList;
// #define STD_BTN_WIDTH 90
// #define STD_BTN_HEIGHT 35
-#define INITCONTROL( p, ControlClass, nBits, aPos, aSize, aTitel, nHelpId ) \
+#define INITCONTROL( p, ControlClass, nBits, aPos, aSize, aTitel, rHelpId ) \
p = new ControlClass( GetPathDialog(), WinBits( nBits ) ); \
- p->SetHelpId( nHelpId ); \
+ p->SetHelpId( rHelpId ); \
p->SetPosSizePixel( aPos, aSize ); \
p->SetText( aTitel ); \
p->Show();
-inline BOOL IsPrintable( sal_Unicode c )
+inline sal_Bool IsPrintable( sal_Unicode c )
{
- return c >= 32 && c != 127 ? TRUE : FALSE;
+ return c >= 32 && c != 127 ? sal_True : sal_False;
}
long
@@ -89,10 +88,10 @@ KbdListBox::PreNotify( NotifyEvent& rNEvt )
if ( IsPrintable ( cCharCode ) )
{
- USHORT nCurrentPos = GetSelectEntryPos();
- USHORT nEntries = GetEntryCount();
+ sal_uInt16 nCurrentPos = GetSelectEntryPos();
+ sal_uInt16 nEntries = GetEntryCount();
- for ( USHORT i = 1; i < nEntries; i++ )
+ for ( sal_uInt16 i = 1; i < nEntries; i++ )
{
UniString aEntry = GetEntry ( (i + nCurrentPos) % nEntries );
aEntry.EraseLeadingChars( ' ' );
@@ -117,7 +116,7 @@ KbdListBox::PreNotify( NotifyEvent& rNEvt )
return ListBox::PreNotify ( rNEvt );
}
-ImpPathDialog::ImpPathDialog( PathDialog* pDlg, RESOURCE_TYPE nType, BOOL bCreateDir )
+ImpPathDialog::ImpPathDialog( PathDialog* pDlg, RESOURCE_TYPE nType, sal_Bool bCreateDir )
{
pSvPathDialog = pDlg;
nDirCount = 0;
@@ -218,10 +217,10 @@ void ImpPathDialog::InitControls()
aPnt.X() = 2 * a6Siz.Width() + aEDSiz.Width();
aPnt.Y() = a6Siz.Height();
INITCONTROL( pOkBtn, PushButton, WB_DEFBUTTON,
- aPnt, aBtnSiz, aOkStr, 0 );
+ aPnt, aBtnSiz, aOkStr, "" );
aPnt.Y() += aBtnSiz.Height() + a3Siz.Height();
INITCONTROL( pCancelBtn, CancelButton, 0,
- aPnt, aBtnSiz, aCancelStr, 0 );
+ aPnt, aBtnSiz, aCancelStr, "" );
aPnt.Y() += aBtnSiz.Height() + a3Siz.Height();
INITCONTROL( pNewDirBtn, PushButton, WB_DEFBUTTON,
aPnt, aBtnSiz, aNewDirStr, HID_FILEDLG_NEWDIR );
@@ -282,14 +281,14 @@ IMPL_LINK( ImpPathDialog, SelectHdl, ListBox *, p )
UniString aEntry( pDirList->GetSelectEntry() );
aEntry.EraseLeadingChars( ' ' );
- USHORT nPos = aEntry.Search( '/' );
+ sal_uInt16 nPos = aEntry.Search( '/' );
aEntry.Erase( nPos );
// build the absolute path to the selected item
DirEntry aNewPath;
aNewPath.ToAbs();
- USHORT nCurPos = pDirList->GetSelectEntryPos();
+ sal_uInt16 nCurPos = pDirList->GetSelectEntryPos();
// Wird nach oben gewechselt
if( nCurPos < nDirCount )
@@ -316,7 +315,7 @@ IMPL_LINK( ImpPathDialog, ClickHdl, Button*, pBtn )
// Ja, dann kompletten Pfad mit Filenamen merken und Dialog beenden
aPath = aFile;
aPath.ToAbs();
- GetPathDialog()->EndDialog( TRUE );
+ GetPathDialog()->EndDialog( sal_True );
}
else
{
@@ -333,7 +332,7 @@ IMPL_LINK( ImpPathDialog, ClickHdl, Button*, pBtn )
else
if ( pBtn == pCancelBtn )
{
- GetPathDialog()->EndDialog( FALSE );
+ GetPathDialog()->EndDialog( sal_False );
}
else
if ( pBtn == pHomeBtn )
@@ -375,7 +374,7 @@ IMPL_LINK( ImpPathDialog, DblClickHdl, ListBox*, pBox )
UniString aEntry( pBox->GetSelectEntry() );
aEntry.EraseLeadingChars( ' ' );
- USHORT nPos = aEntry.Search( '/' );
+ sal_uInt16 nPos = aEntry.Search( '/' );
aEntry.Erase( nPos );
// build the absolute path to the selected item
@@ -383,7 +382,7 @@ IMPL_LINK( ImpPathDialog, DblClickHdl, ListBox*, pBox )
aNewPath.ToAbs();
if( pBox == pDirList )
{
- USHORT nCurPos = pDirList->GetSelectEntryPos();
+ sal_uInt16 nCurPos = pDirList->GetSelectEntryPos();
// Wenn es schon das aktuelle ist, dann mache nichts
if( nCurPos == nDirCount-1 )
@@ -404,22 +403,22 @@ IMPL_LINK( ImpPathDialog, DblClickHdl, ListBox*, pBox )
{
// Neuen Pfad setzen und Listboxen updaten
aPath = aNewPath;
- if( !aPath.SetCWD( TRUE ) )
+ if( !aPath.SetCWD( sal_True ) )
{
ErrorBox aBox( GetPathDialog(),
WB_OK_CANCEL | WB_DEF_OK,
UniString( SvtResId( STR_FILEDLG_CANTCHDIR ) ) );
if( aBox.Execute() == RET_CANCEL )
- GetPathDialog()->EndDialog( FALSE );
+ GetPathDialog()->EndDialog( sal_False );
}
- UpdateEntries( TRUE );
+ UpdateEntries( sal_True );
}
pSvPathDialog->LeaveWait();
return 0;
}
-void ImpPathDialog::UpdateEntries( const BOOL )
+void ImpPathDialog::UpdateEntries( const sal_Bool )
{
UniString aTabString;
DirEntry aTmpPath;
@@ -427,10 +426,10 @@ void ImpPathDialog::UpdateEntries( const BOOL )
nDirCount = aTmpPath.Level();
- pDirList->SetUpdateMode( FALSE );
+ pDirList->SetUpdateMode( sal_False );
pDirList->Clear();
- for( USHORT i = nDirCount; i > 0; i-- )
+ for( sal_uInt16 i = nDirCount; i > 0; i-- )
{
UniString aName( aTabString );
aName += aTmpPath[i-1].GetName();
@@ -444,13 +443,13 @@ void ImpPathDialog::UpdateEntries( const BOOL )
Dir aDir( aCurrent, FSYS_KIND_DIR|FSYS_KIND_FILE );
- USHORT nEntries = aDir.Count();
+ sal_uInt16 nEntries = aDir.Count();
if( nEntries )
{
UniStringList aSortDirList;
const comphelper::string::NaturalStringSorter& rSorter =
::vcl::unohelper::getNaturalStringSorterForAppLocale();
- for ( USHORT n = 0; n < nEntries; n++ )
+ for ( sal_uInt16 n = 0; n < nEntries; n++ )
{
DirEntry& rEntry = aDir[n];
UniString aName( rEntry.GetName() );
@@ -491,7 +490,7 @@ void ImpPathDialog::UpdateDirs( const DirEntry& rTmpPath )
pDirList->SetTopEntry( nDirCount > 1
? nDirCount - 2
: nDirCount - 1 );
- pDirList->SetUpdateMode( TRUE );
+ pDirList->SetUpdateMode( sal_True );
pDirList->Invalidate();
pDirList->Update();
@@ -502,10 +501,10 @@ void ImpPathDialog::UpdateDirs( const DirEntry& rTmpPath )
pEdit->SetText( aDirName );
}
-BOOL ImpPathDialog::IsFileOk( const DirEntry& rDirEntry )
+sal_Bool ImpPathDialog::IsFileOk( const DirEntry& rDirEntry )
{
if( FileStat( rDirEntry ).GetKind() & (FSYS_KIND_WILD | FSYS_KIND_DEV) )
- return FALSE;
+ return sal_False;
else
{
// Datei vorhanden ?
@@ -519,7 +518,7 @@ BOOL ImpPathDialog::IsFileOk( const DirEntry& rDirEntry )
if( aQuery.Execute() == RET_YES )
rDirEntry.MakeDir();
else
- return FALSE;
+ return sal_False;
}
if( !FileStat( rDirEntry ).IsKind( FSYS_KIND_DIR ) )
{
@@ -529,7 +528,7 @@ BOOL ImpPathDialog::IsFileOk( const DirEntry& rDirEntry )
aBoxText.AppendAscii( "]" );
InfoBox aBox( GetPathDialog(), aBoxText );
aBox.Execute();
- return FALSE;
+ return sal_False;
}
}
return GetPathDialog()->OK() != 0;
@@ -539,8 +538,8 @@ BOOL ImpPathDialog::IsFileOk( const DirEntry& rDirEntry )
void ImpPathDialog::PreExecute()
{
// Neues Verzeichnis setzen und Listboxen updaten
- aPath.SetCWD( TRUE );
- UpdateEntries( TRUE );
+ aPath.SetCWD( sal_True );
+ UpdateEntries( sal_True );
// Zusaetzliche Buttons anordnen
Point aPos;
@@ -563,8 +562,8 @@ void ImpPathDialog::PreExecute()
long nMaxWidth = 0;
// Maximale Breite ermitteln
- USHORT nChilds = GetPathDialog()->GetChildCount();
- USHORT n;
+ sal_uInt16 nChilds = GetPathDialog()->GetChildCount();
+ sal_uInt16 n;
for ( n = nOwnChilds; n < nChilds; n++ )
{
Window* pChild = GetPathDialog()->GetChild( n );
@@ -624,11 +623,11 @@ void ImpPathDialog::PreExecute()
DirEntry aTmpDirEntry;
Dir aDir( aTmpDirEntry, FSYS_KIND_BLOCK );
- USHORT nCount = aDir.Count(), i;
+ sal_uInt16 nCount = aDir.Count(), i;
for( i = 0; i < nCount; ++i )
{
DirEntry& rEntry = aDir[i];
- UniString aStr = rEntry.GetFull( FSYS_STYLE_HOST, FALSE );
+ UniString aStr = rEntry.GetFull( FSYS_STYLE_HOST, sal_False );
UniString aVolume = rEntry.GetVolume() ;
aStr.ToUpperAscii();
@@ -674,8 +673,8 @@ void ImpPathDialog::SetPath( UniString const & rPath )
// Neue Maske und neues Verzeichnis setzen, und Listboxen updaten
pEdit->SetText( rPath );
- aFile.SetCWD( TRUE );
- UpdateEntries( TRUE );
+ aFile.SetCWD( sal_True );
+ UpdateEntries( sal_True );
pSvPathDialog->LeaveWait();
}
@@ -697,7 +696,7 @@ UniString ImpPathDialog::GetPath() const
ImpFileDialog::ImpFileDialog( PathDialog* pDlg, WinBits nWinBits, RESOURCE_TYPE nType ) :
- ImpPathDialog( pDlg, nType, FALSE )
+ ImpPathDialog( pDlg, nType, sal_False )
{
bOpen = (nWinBits & WB_SAVEAS) == 0;
@@ -777,10 +776,10 @@ void ImpFileDialog::InitControls()
const long nButtonStartX = 2*nW+20+15;
INITCONTROL( pOkBtn, PushButton, WB_DEFBUTTON,
Point(nButtonStartX, 10), Size(STD_BTN_WIDTH, STD_BTN_HEIGHT),
- Button::GetStandardText( BUTTON_OK ), 0 );
+ Button::GetStandardText( BUTTON_OK ), "" );
INITCONTROL( pCancelBtn, CancelButton, 0,
Point(nButtonStartX, 45 ), Size(STD_BTN_WIDTH, STD_BTN_HEIGHT),
- Button::GetStandardText( BUTTON_CANCEL ), 0 );
+ Button::GetStandardText( BUTTON_CANCEL ), "" );
pLoadBtn = 0;
@@ -836,7 +835,7 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox )
UniString aEntry( pBox->GetSelectEntry() );
aEntry.EraseLeadingChars( ' ' );
- USHORT nPos = aEntry.Search( '/' );
+ sal_uInt16 nPos = aEntry.Search( '/' );
aEntry.Erase( nPos );
// build the absolute path to the selected item
@@ -846,7 +845,7 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox )
if( ( pDirList != pFileList ) && ( pBox == pDirList ) )
{
// SVLOOK
- USHORT nCurPos = pDirList->GetSelectEntryPos();
+ sal_uInt16 nCurPos = pDirList->GetSelectEntryPos();
// Wenn es schon das aktuelle ist, dann mache nichts
if( nCurPos == nDirCount-1 )
@@ -875,7 +874,7 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox )
{
// dann kompletten Pfad mit Filenamen merken und Dialog beenden
aPath = aNewPath;
- GetFileDialog()->EndDialog( TRUE );
+ GetFileDialog()->EndDialog( sal_True );
}
}
@@ -888,15 +887,15 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox )
{
// Neuen Pfad setzen und Listboxen updaten
aPath = aNewPath;
- if( !aPath.SetCWD( TRUE ) )
+ if( !aPath.SetCWD( sal_True ) )
{
if( ErrorBox( GetFileDialog(), WB_OK_CANCEL|WB_DEF_OK,
UniString( SvtResId( STR_FILEDLG_CANTCHDIR ) ) ).Execute() == RET_CANCEL )
{
- GetFileDialog()->EndDialog( FALSE );
+ GetFileDialog()->EndDialog( sal_False );
}
}
- UpdateEntries( TRUE );
+ UpdateEntries( sal_True );
GetFileDialog()->FileSelect();
}
@@ -913,7 +912,7 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox )
}
pEdit->SetText( aMask() );
- UpdateEntries( FALSE );
+ UpdateEntries( sal_False );
GetFileDialog()->FilterSelect();
}
@@ -934,7 +933,7 @@ IMPL_LINK( ImpFileDialog, ClickHdl, Button*, pBtn )
// Ja, dann kompletten Pfad mit Filenamen merken und Dialog beenden
aPath = aFile;
aPath.ToAbs();
- GetFileDialog()->EndDialog( TRUE );
+ GetFileDialog()->EndDialog( sal_True );
}
else
{
@@ -949,19 +948,19 @@ IMPL_LINK( ImpFileDialog, ClickHdl, Button*, pBtn )
// Neue Maske und neues Verzeichnis setzen, und Listboxen updaten
pEdit->SetText( aMask() );
- aFile.SetCWD( TRUE );
- UpdateEntries( TRUE );
+ aFile.SetCWD( sal_True );
+ UpdateEntries( sal_True );
GetFileDialog()->LeaveWait();
}
}
else if( pBtn == pCancelBtn )
- GetFileDialog()->EndDialog( FALSE );
+ GetFileDialog()->EndDialog( sal_False );
return 0;
}
-void ImpFileDialog::UpdateEntries( const BOOL bWithDirs )
+void ImpFileDialog::UpdateEntries( const sal_Bool bWithDirs )
{
GetFileDialog()->EnterWait();
@@ -972,16 +971,16 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs )
if( pFileList )
{
- pFileList->SetUpdateMode( FALSE );
+ pFileList->SetUpdateMode( sal_False );
pFileList->Clear();
}
if( bWithDirs && (pDirList != pFileList) )
{
- pDirList->SetUpdateMode( FALSE );
+ pDirList->SetUpdateMode( sal_False );
pDirList->Clear();
- for( USHORT i = nDirCount; i > 0; i-- )
+ for( sal_uInt16 i = nDirCount; i > 0; i-- )
{
UniString aEntryStr( aTabString );
aEntryStr += aTmpPath[i-1].GetName();
@@ -1000,10 +999,10 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs )
DirEntry aCurrent;
aCurrent.ToAbs();
Dir aDir( aCurrent, FSYS_KIND_DIR|FSYS_KIND_FILE );
- USHORT nEntries = aDir.Count();
+ sal_uInt16 nEntries = aDir.Count();
// TempMask, weil Vergleich case-sensitiv
- BOOL bMatchCase = FALSE; //aCurrent.IsCaseSensitive();
+ sal_Bool bMatchCase = sal_False; //aCurrent.IsCaseSensitive();
UniString aWildCard( aMask.GetWildCard() );
if ( !bMatchCase )
aWildCard.ToLowerAscii();
@@ -1013,7 +1012,7 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs )
UniStringList aSortDirList;
const comphelper::string::NaturalStringSorter& rSorter =
::vcl::unohelper::getNaturalStringSorterForAppLocale();
- for ( USHORT n = 0; n < nEntries; n++ )
+ for ( sal_uInt16 n = 0; n < nEntries; n++ )
{
DirEntry& rEntry = aDir[n];
UniString aName( rEntry.GetName() );
@@ -1075,7 +1074,7 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs )
pFileList->SelectEntryPos( 1 );
else
pFileList->SetNoSelection();
- pFileList->SetUpdateMode( TRUE );
+ pFileList->SetUpdateMode( sal_True );
pFileList->Invalidate();
pFileList->Update();
}
@@ -1094,14 +1093,14 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs )
GetFileDialog()->LeaveWait();
}
-BOOL ImpFileDialog::IsFileOk( const DirEntry& rDirEntry )
+sal_Bool ImpFileDialog::IsFileOk( const DirEntry& rDirEntry )
{
if( FileStat( rDirEntry ).GetKind() & (FSYS_KIND_WILD | FSYS_KIND_DEV) )
- return FALSE;
+ return sal_False;
if( FileStat( rDirEntry ).GetKind() & FSYS_KIND_DIR )
{
if( pFileList )
- return FALSE;
+ return sal_False;
}
else if( bOpen )
{
@@ -1115,7 +1114,7 @@ BOOL ImpFileDialog::IsFileOk( const DirEntry& rDirEntry )
InfoBox aBox( GetFileDialog(),
aErrorString );
aBox.Execute();
- return FALSE;
+ return sal_False;
}
}
else
@@ -1131,7 +1130,7 @@ BOOL ImpFileDialog::IsFileOk( const DirEntry& rDirEntry )
WinBits( WB_YES_NO | WB_DEF_NO ),
aQueryString );
if( aBox.Execute() != RET_YES )
- return FALSE;
+ return sal_False;
}
}
return GetFileDialog()->OK() != 0;
@@ -1160,9 +1159,9 @@ void ImpFileDialog::SetPath( UniString const & rPath )
pEdit->SetText( rPath );
}
- aFile.SetCWD( TRUE );
+ aFile.SetCWD( sal_True );
- UpdateEntries( TRUE );
+ UpdateEntries( sal_True );
GetFileDialog()->LeaveWait();
}
@@ -1217,7 +1216,7 @@ void ImpFileDialog::SetCurFilter( const UniString& rFilter )
for ( size_t i = 0, n = aFilterList.size(); i < n; ++i ) {
if ( aFilterList[ i ]->aName == rFilter ) {
- pTypeList->SelectEntryPos( USHORT( i ) );
+ pTypeList->SelectEntryPos( sal_uInt16( i ) );
return;
}
}
@@ -1251,7 +1250,7 @@ void ImpFileDialog::PreExecute()
if( pTypeList )
{
- USHORT nCurType = pTypeList->GetSelectEntryPos();
+ sal_uInt16 nCurType = pTypeList->GetSelectEntryPos();
if( nCurType < aFilterList.size() )
{
UniString aFilterListMask = aFilterList[ nCurType ]->aMask;
@@ -1291,7 +1290,7 @@ UniString ImpFileDialog::ExtendFileName( DirEntry aEntry ) const
UniString aPostfix; // hier kommt die ausgesuchte Extension herein
// ist ein Filter mit Extension gesetzt?
- USHORT nChosenFilterPos = pTypeList->GetSelectEntryPos();
+ sal_uInt16 nChosenFilterPos = pTypeList->GetSelectEntryPos();
if( nChosenFilterPos != LISTBOX_ENTRY_NOTFOUND )
{
UniString aExtensionMask = GetFileDialog()->GetFilterType( nChosenFilterPos );
@@ -1344,7 +1343,7 @@ UniString ImpFileDialog::ExtendFileName( DirEntry aEntry ) const
}
-void ImpSvFileDlg::CreateDialog( PathDialog* pSvDlg, WinBits nStyle, RESOURCE_TYPE nType, BOOL bCreate )
+void ImpSvFileDlg::CreateDialog( PathDialog* pSvDlg, WinBits nStyle, RESOURCE_TYPE nType, sal_Bool bCreate )
{
delete pDlg;
if ( nType == WINDOW_PATHDIALOG )
diff --git a/svtools/source/dialogs/filedlg2.hxx b/svtools/source/dialogs/filedlg2.hxx
index 99a002440e1c..e65bebe6f155 100644
--- a/svtools/source/dialogs/filedlg2.hxx
+++ b/svtools/source/dialogs/filedlg2.hxx
@@ -91,17 +91,17 @@ private:
PushButton* pHomeBtn;
PushButton* pNewDirBtn;
- USHORT nOwnChilds;
+ sal_uInt16 nOwnChilds;
DirEntry aPath; // aktuell angewaehlter Pfad
- USHORT nDirCount; // Anzahl der Verzeichnis-
+ sal_uInt16 nDirCount; // Anzahl der Verzeichnis-
// Verschachtelungen
protected:
- virtual void UpdateEntries( const BOOL bWithDirs );
+ virtual void UpdateEntries( const sal_Bool bWithDirs );
void UpdateDirs( const DirEntry& rTmpPath );
- BOOL IsFileOk( const DirEntry& rDirEntry );
+ sal_Bool IsFileOk( const DirEntry& rDirEntry );
void InitControls();
DECL_LINK( SelectHdl, ListBox * );
@@ -109,7 +109,7 @@ protected:
DECL_LINK( ClickHdl, Button * );
public:
- ImpPathDialog( PathDialog* pDlg, RESOURCE_TYPE nType, BOOL bCreateDir );
+ ImpPathDialog( PathDialog* pDlg, RESOURCE_TYPE nType, sal_Bool bCreateDir );
virtual ~ImpPathDialog();
virtual void SetPath( const String& rPath );
@@ -138,9 +138,9 @@ private:
WildCard aMask; // aktuelle Maske
ImpFilterList aFilterList; // Filterliste
- USHORT nCurFilter; // aktueller Filter
+ sal_uInt16 nCurFilter; // aktueller Filter
- BOOL bOpen; // TRUE = Open; FALSE = SAVEAS
+ sal_Bool bOpen; // sal_True = Open; sal_False = SAVEAS
protected:
void InitControls();
@@ -151,8 +151,8 @@ protected:
DECL_LINK( DblClickHdl, ListBox * );
DECL_LINK( ClickHdl, Button * );
- virtual void UpdateEntries( const BOOL bWithDirs );
- BOOL IsFileOk( const DirEntry& rDirEntry );
+ virtual void UpdateEntries( const sal_Bool bWithDirs );
+ sal_Bool IsFileOk( const DirEntry& rDirEntry );
public:
ImpFileDialog( PathDialog* pDlg, WinBits nStyle, RESOURCE_TYPE nType );
@@ -205,7 +205,7 @@ public:
~ImpSvFileDlg() { delete pDlg; }
ImpPathDialog* GetDialog() const { return pDlg; }
- void CreateDialog( PathDialog* pCreateFrom, WinBits nStyle, RESOURCE_TYPE nType, BOOL bCreate );
+ void CreateDialog( PathDialog* pCreateFrom, WinBits nStyle, RESOURCE_TYPE nType, sal_Bool bCreate );
void SetOkButtonText( const String& rText ) { pDlg->SetOkButtonText( rText ); } // ihr habts ja nicht anders gewollt
void SetCancelButtonText( const String& rText ) { pDlg->SetCancelButtonText( rText ); }
diff --git a/svtools/source/dialogs/filedlg2.src b/svtools/source/dialogs/filedlg2.src
index 47277de88a52..629d4699b309 100644
--- a/svtools/source/dialogs/filedlg2.src
+++ b/svtools/source/dialogs/filedlg2.src
@@ -25,7 +25,8 @@
*
************************************************************************/
-#include <filedlg2.hrc>
+#include <svtools/filedlg2.hrc>
+
String STR_FILEDLG_SELECT
{
Text [ en-US ] = "Select Directory" ;
diff --git a/svtools/source/dialogs/formats.src b/svtools/source/dialogs/formats.src
index 7587eedd6b86..0477cd1bc4ca 100644
--- a/svtools/source/dialogs/formats.src
+++ b/svtools/source/dialogs/formats.src
@@ -25,7 +25,7 @@
*
************************************************************************/
-#include "sores.hxx"
+#include <svtools/sores.hxx>
String STR_FORMAT_STRING
{
diff --git a/svtools/source/dialogs/insdlg.cxx b/svtools/source/dialogs/insdlg.cxx
index f2002ed27179..9d060f4e8a01 100644
--- a/svtools/source/dialogs/insdlg.cxx
+++ b/svtools/source/dialogs/insdlg.cxx
@@ -34,7 +34,7 @@
// include ---------------------------------------------------------------
#include <svtools/insdlg.hxx>
-#include "sores.hxx"
+#include <svtools/sores.hxx>
#include <svtools/svtdata.hxx>
#include <tools/rc.hxx>
@@ -79,7 +79,7 @@ PRV_SV_IMPL_OWNER_LIST( SvObjectServerList, SvObjectServer )
*************************************************************************/
const SvObjectServer * SvObjectServerList::Get( const String & rHumanName ) const
{
- for( ULONG i = 0; i < Count(); i++ )
+ for( sal_uLong i = 0; i < Count(); i++ )
{
if( rHumanName == GetObject( i ).GetHumanName() )
return &GetObject( i );
@@ -94,7 +94,7 @@ const SvObjectServer * SvObjectServerList::Get( const String & rHumanName ) cons
*************************************************************************/
const SvObjectServer * SvObjectServerList::Get( const SvGlobalName & rName ) const
{
- for( ULONG i = 0; i < Count(); i++ )
+ for( sal_uLong i = 0; i < Count(); i++ )
{
if( rName == GetObject( i ).GetClassName() )
return &GetObject( i );
@@ -238,7 +238,7 @@ String SvPasteObjectHelper::GetSotFormatUIName( SotFormatStringId nId )
struct SotResourcePair
{
SotFormatStringId mnSotId;
- USHORT mnResId;
+ sal_uInt16 mnResId;
};
static const SotResourcePair aSotResourcePairs[] =
@@ -312,7 +312,7 @@ String SvPasteObjectHelper::GetSotFormatUIName( SotFormatStringId nId )
};
String aUIName;
- USHORT nResId = 0;
+ sal_uInt16 nResId = 0;
for( sal_uInt32 i = 0, nCount = SAL_N_ELEMENTS( aSotResourcePairs ); ( i < nCount ) && !nResId; i++ )
{
diff --git a/svtools/source/dialogs/makefile.mk b/svtools/source/dialogs/makefile.mk
deleted file mode 100755
index ede452cb29c8..000000000000
--- a/svtools/source/dialogs/makefile.mk
+++ /dev/null
@@ -1,81 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=dialogs
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SRS1NAME=$(TARGET)
-SRC1FILES= filedlg2.src \
- so3res.src \
- formats.src \
- prnsetup.src \
- printdlg.src \
- colrdlg.src \
- addresstemplate.src \
- wizardmachine.src
-
-
-EXCEPTIONSFILES= $(SLO)$/addresstemplate.obj \
- $(SLO)$/colctrl.obj \
- $(SLO)$/colrdlg.obj \
- $(SLO)$/filedlg.obj \
- $(SLO)$/filedlg2.obj \
- $(SLO)$/insdlg.obj \
- $(SLO)$/printdlg.obj \
- $(SLO)$/prnsetup.obj \
- $(SLO)$/property.obj \
- $(SLO)$/roadmapwizard.obj \
- $(SLO)$/wizardmachine.obj \
- $(SLO)$/wizdlg.obj
-
-SLOFILES= \
- $(SLO)$/addresstemplate.obj \
- $(SLO)$/colctrl.obj \
- $(SLO)$/colrdlg.obj \
- $(SLO)$/filedlg.obj \
- $(SLO)$/filedlg2.obj \
- $(SLO)$/insdlg.obj \
- $(SLO)$/mcvmath.obj \
- $(SLO)$/printdlg.obj \
- $(SLO)$/prnsetup.obj \
- $(SLO)$/property.obj \
- $(SLO)$/roadmapwizard.obj \
- $(SLO)$/wizardmachine.obj \
- $(SLO)$/wizdlg.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svtools/source/dialogs/mcvmath.cxx b/svtools/source/dialogs/mcvmath.cxx
index 66a61ee7d232..5d5ad14c82c2 100644
--- a/svtools/source/dialogs/mcvmath.cxx
+++ b/svtools/source/dialogs/mcvmath.cxx
@@ -94,11 +94,11 @@ FixCpx ImpMultBig2( const FixCpx& ra, const FixCpx& rb )
|*
**************************************************************************/
-USHORT ImpSqrt( ULONG nRadi )
+sal_uInt16 ImpSqrt( sal_uLong nRadi )
{
- register ULONG inf = 1;
- register ULONG sup = nRadi;
- register ULONG sqr;
+ register sal_uLong inf = 1;
+ register sal_uLong sup = nRadi;
+ register sal_uLong sqr;
if ( !nRadi )
return 0;
@@ -113,7 +113,7 @@ USHORT ImpSqrt( ULONG nRadi )
sqr = (nRadi/sqr + sqr) >> 1; // 2 Newton-Iterationen reichen fuer
sqr = (nRadi/sqr + sqr) >> 1; // +- 1 Digit
- return sal::static_int_cast< USHORT >(sqr);
+ return sal::static_int_cast< sal_uInt16 >(sqr);
}
/**************************************************************************
@@ -126,7 +126,7 @@ USHORT ImpSqrt( ULONG nRadi )
// e**(i*nPhi), Einheit nPhi: 2**16 == 360 Grad
-FixCpx ImpExPI( USHORT nPhi )
+FixCpx ImpExPI( sal_uInt16 nPhi )
{
short i;
FixCpx aIter(1L); // e**(0*i)
@@ -156,10 +156,10 @@ FixCpx ImpExPI( USHORT nPhi )
// use for x*x+y*y==1 only
-static USHORT ImpATanx2( const Fix& rX, const Fix& rY )
+static sal_uInt16 ImpATanx2( const Fix& rX, const Fix& rY )
{
- USHORT phi0 = 0; // result angel higher part
- USHORT phi = 0; // dito lower part
+ sal_uInt16 phi0 = 0; // result angel higher part
+ sal_uInt16 phi = 0; // dito lower part
long x = rX.x;
long y = rY.x;
long z;
@@ -168,7 +168,7 @@ static USHORT ImpATanx2( const Fix& rX, const Fix& rY )
FixCpx aTry;
FixCpx aInc;
FixCpx aIter(1L);
- BOOL Small = FALSE;
+ sal_Bool Small = sal_False;
if ( (x==0) && (y==0) )
return 0;
@@ -216,7 +216,7 @@ static USHORT ImpATanx2( const Fix& rX, const Fix& rY )
phi += (1<<i);
if ( i > 11 )
- Small=TRUE;
+ Small=sal_True;
}
}
}
@@ -232,9 +232,9 @@ static USHORT ImpATanx2( const Fix& rX, const Fix& rY )
|*
**************************************************************************/
-USHORT ImpATan2( const short x, const short y )
+sal_uInt16 ImpATan2( const short x, const short y )
{
- Fix rRad = ImpSqrt(ULONG(long(x)*x+long(y)*y));
+ Fix rRad = ImpSqrt(sal_uLong(long(x)*x+long(y)*y));
if ( !rRad.x )
return 0;
@@ -254,9 +254,9 @@ USHORT ImpATan2( const short x, const short y )
|*
**************************************************************************/
-void ImpCartToPolar( const short x, const short y, Fix& rRad, USHORT& rPhi )
+void ImpCartToPolar( const short x, const short y, Fix& rRad, sal_uInt16& rPhi )
{
- rRad = Fix( ImpSqrt( ULONG( long(x)*x+long(y)*y ) ) );
+ rRad = Fix( ImpSqrt( sal_uLong( long(x)*x+long(y)*y ) ) );
if ( !rRad.x )
rPhi=0;
@@ -279,7 +279,7 @@ void ImpCartToPolar( const short x, const short y, Fix& rRad, USHORT& rPhi )
|*
**************************************************************************/
-void ImpPolarToCart( const Fix& rR, const USHORT Phi, short& rX, short& rY )
+void ImpPolarToCart( const Fix& rR, const sal_uInt16 Phi, short& rX, short& rY )
{
FixCpx fc = ImpExPI( Phi ); // calculate sin() & cos()
fc.GetReal().MultBig( rR );
diff --git a/svtools/source/dialogs/mcvmath.hxx b/svtools/source/dialogs/mcvmath.hxx
index bad63f33093f..5e0d47e655ef 100644
--- a/svtools/source/dialogs/mcvmath.hxx
+++ b/svtools/source/dialogs/mcvmath.hxx
@@ -84,7 +84,7 @@ public:
Fix() { x=0; }
Fix( int i ) { x=(long(i)<<FIX_POST); }
Fix( short l ) { x=(long(l)<<FIX_POST); }
- Fix( USHORT l ) { x=(long(l)<<FIX_POST); }
+ Fix( sal_uInt16 l ) { x=(long(l)<<FIX_POST); }
Fix( long l ) { x=(l<<FIX_POST); }
Fix( long Z, long N ) { x=(Z<<FIX_POST)/N; }
@@ -102,8 +102,8 @@ public:
void DivBig( const Fix& a )
{ x=((x<<FIX_P3)/a.x)<<FIX_P2; }
- friend BOOL operator> ( const Fix& a, const Fix& b ) { return a.x > b.x; }
- friend BOOL operator< ( const Fix& a, const Fix& b ) { return a.x < b.x; }
+ friend sal_Bool operator> ( const Fix& a, const Fix& b ) { return a.x > b.x; }
+ friend sal_Bool operator< ( const Fix& a, const Fix& b ) { return a.x < b.x; }
operator long() const { return (x+FIX_ADD) >> FIX_POST; }
operator double() const { return double(x)/(1<<FIX_POST); }
@@ -219,12 +219,12 @@ inline FixCpx operator/ ( const FixCpx& a, const FixCpx& b )
Fix ImpMultBig2( const Fix& a, const Fix& b );
FixCpx ImpMultBig2( const FixCpx& ra, const FixCpx& rb );
-void ImpCartToPolar( const short x, const short y, Fix& rRad, USHORT& rPhi );
-void ImpPolarToCart( const Fix& rR, const USHORT Phi, short& rX, short& rY );
+void ImpCartToPolar( const short x, const short y, Fix& rRad, sal_uInt16& rPhi );
+void ImpPolarToCart( const Fix& rR, const sal_uInt16 Phi, short& rX, short& rY );
-USHORT ImpSqrt( ULONG nRadi );
-USHORT ImpATan2( const short x, const short y );
-FixCpx ImpExPI( USHORT nPhi );
+sal_uInt16 ImpSqrt( sal_uLong nRadi );
+sal_uInt16 ImpATan2( const short x, const short y );
+FixCpx ImpExPI( sal_uInt16 nPhi );
#endif // _MCVMATH_HXX
diff --git a/svtools/source/dialogs/printdlg.cxx b/svtools/source/dialogs/printdlg.cxx
deleted file mode 100644
index ebb75e0dc6cc..000000000000
--- a/svtools/source/dialogs/printdlg.cxx
+++ /dev/null
@@ -1,787 +0,0 @@
-/* -*- 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 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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-#include <tools/debug.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/print.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/jobset.hxx>
-#include <sal/macros.h>
-#include <tools/urlobj.hxx>
-
-#include "printdlg.hrc"
-#include "controldims.hrc"
-#include <svtools/prnsetup.hxx>
-#include <svtools/printdlg.hxx>
-#include <svtools/svtdata.hxx>
-#include <filedlg.hxx>
-#include "svl/pickerhelper.hxx"
-#include <svtools/helpid.hrc>
-#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
-#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
-#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <comphelper/processfactory.hxx>
-
-using rtl::OUString;
-using namespace com::sun::star;
-
-struct SvtPrinterImpl
-{
- Printer* m_pTempPrinter;
- sal_Bool m_bHelpDisabled;
- PrintSheetRange m_eSheetRange;
-
- SvtPrinterImpl() :
- m_pTempPrinter( NULL ), m_bHelpDisabled( sal_False ), m_eSheetRange( PRINTSHEETS_ALL ) {}
- ~SvtPrinterImpl() { delete m_pTempPrinter; }
-};
-
-#define TEMPPRINTER() mpPrinterImpl->m_pTempPrinter
-
-// =======================================================================
-
-PrintDialog::PrintDialog( Window* pWindow, bool bWithSheetsAndCells ) :
- ModalDialog ( pWindow, SvtResId( DLG_SVT_PRNDLG_PRINTDLG ) ),
- maFlPrinter ( this, SvtResId( FL_PRINTER ) ),
- maFtName ( this, SvtResId( FT_NAME ) ),
- maLbName ( this, SvtResId( LB_NAMES ) ),
- maBtnProperties ( this, SvtResId( BTN_PROPERTIES ) ),
- maFtStatus ( this, SvtResId( FT_STATUS ) ),
- maFiStatus ( this, SvtResId( FI_STATUS ) ),
- maFtType ( this, SvtResId( FT_TYPE ) ),
- maFiType ( this, SvtResId( FI_TYPE ) ),
- maFtLocation ( this, SvtResId( FT_LOCATION ) ),
- maFiLocation ( this, SvtResId( FI_LOCATION ) ),
- maFtComment ( this, SvtResId( FT_COMMENT ) ),
- maFiComment ( this, SvtResId( FI_COMMENT ) ),
- maCbxFilePrint ( this, SvtResId( CBX_FILEPRINT ) ),
- maFiPrintFile ( this, SvtResId( FI_PRINTFILE ) ),
- maFiFaxNo ( this, SvtResId( FI_FAXNO ) ),
- maEdtFaxNo ( this, SvtResId( EDT_FAXNO ) ),
- maFlPrint ( this, SvtResId( FL_PRINT ) ),
- maRbtAllSheets ( this, SvtResId( RBT_ALL_SHEETS ) ),
- maRbtSelectedSheets ( this, SvtResId( RBT_SELECTED_SHEETS ) ),
- maRbtSelectedCells ( this, SvtResId( RBT_SELECTED_CELLS ) ),
- maFlPrintRange ( this, SvtResId( FL_PRINTRANGE ) ),
- maRbtAll ( this, SvtResId( RBT_ALL ) ),
- maRbtPages ( this, SvtResId( RBT_PAGES ) ),
- maRbtSelection ( this, SvtResId( RBT_SELECTION ) ),
- maEdtPages ( this, SvtResId( EDT_PAGES ) ),
- maFlSepCopiesRange ( this, SvtResId( FL_SEPCOPIESRANGE ) ),
- maFlCopies ( this, SvtResId( FL_COPIES ) ),
- maFtCopies ( this, SvtResId( FT_COPIES ) ),
- maNumCopies ( this, SvtResId( NUM_COPIES ) ),
- maImgCollate ( this, SvtResId( IMG_COLLATE ) ),
- maImgNotCollate ( this, SvtResId( IMG_NOT_COLLATE ) ),
- maCbxCollate ( this, SvtResId( CBX_COLLATE ) ),
- maFlSepButtonLine ( this, SvtResId( FL_SEPBUTTONLINE ) ),
- maBtnOptions ( this, SvtResId( BTN_OPTIONS ) ),
- maBtnOK ( this, SvtResId( BTN_OK ) ),
- maBtnCancel ( this, SvtResId( BTN_CANCEL ) ),
- maBtnHelp ( this, SvtResId( BTN_HELP ) ),
- mbWithSheetsAndCells( bWithSheetsAndCells ),
- maAllFilterStr ( SvtResId( STR_ALLFILTER ) )
-
-{
- FreeResource();
-
- mpPrinter = NULL;
- mpPrinterImpl = new SvtPrinterImpl;
- mnCopyCount = 1;
- mnFirstPage = 0;
- mnLastPage = 0;
- mnMinPage = 1;
- mnMaxPage = 65535;
- meCheckRange = PRINTDIALOG_ALL;
- mbAll = TRUE;
- mbSelection = FALSE;
- mbFromTo = FALSE;
- mbRange = FALSE;
- mbCollate = TRUE;
- mbCollateCheck = TRUE;
- mbOptions = FALSE;
-
- maStatusTimer.SetTimeout( IMPL_PRINTDLG_STATUS_UPDATE );
- maStatusTimer.SetTimeoutHdl( LINK( this, PrintDialog, ImplStatusHdl ) );
- maBtnProperties.SetClickHdl( LINK( this, PrintDialog, ImplPropertiesHdl ) );
- maLbName.SetSelectHdl( LINK( this, PrintDialog, ImplChangePrinterHdl ) );
-
- maFiPrintFile.SetStyle( maFiPrintFile.GetStyle() | WB_PATHELLIPSIS );
-
- Link aLink( LINK( this, PrintDialog, ImplModifyControlHdl ) );
- maCbxFilePrint.SetClickHdl( aLink );
- maRbtAll.SetClickHdl( aLink );
- maRbtPages.SetClickHdl( aLink );
- maRbtSelection.SetClickHdl( aLink );
- maEdtPages.SetModifyHdl( aLink );
- maNumCopies.SetModifyHdl( aLink );
- maCbxCollate.SetClickHdl( aLink );
- maBtnOptions.SetClickHdl( aLink );
- maEdtFaxNo.SetModifyHdl( aLink );
- maBtnOK.SetClickHdl( aLink );
-
- maRbtAll.Check();
- ImplSetImages();
-}
-
-// -----------------------------------------------------------------------
-
-PrintDialog::~PrintDialog()
-{
- ImplFreePrnDlgListBox( &maLbName, FALSE );
- delete mpPrinterImpl;
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::ImplSetImages()
-{
- maImgCollate.SetModeImage( Image( SvtResId( RID_IMG_PRNDLG_COLLATE ) ) );
- maImgNotCollate.SetModeImage(Image( SvtResId( RID_IMG_PRNDLG_NOCOLLATE ) ) );
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::ImplSetInfo()
-{
- const QueueInfo* pInfo = Printer::GetQueueInfo( maLbName.GetSelectEntry(), true );
- if ( pInfo )
- {
- maFiType.SetText( pInfo->GetDriver() );
- maFiLocation.SetText( pInfo->GetLocation() );
- maFiComment.SetText( pInfo->GetComment() );
- maFiStatus.SetText( ImplPrnDlgGetStatusText( *pInfo ) );
- }
- else
- {
- XubString aTempStr;
- maFiType.SetText( aTempStr );
- maFiLocation.SetText( aTempStr );
- maFiComment.SetText( aTempStr );
- maFiStatus.SetText( aTempStr );
- }
-
-#ifdef UNX
- if( pInfo && pInfo->GetLocation().EqualsAscii( "fax_queue" ) )
- {
- maFiPrintFile.Show( FALSE );
- maCbxFilePrint.Show( FALSE );
- maFiFaxNo.Show( TRUE );
- maEdtFaxNo.Show( TRUE );
- Printer* pPrinter = TEMPPRINTER() ? TEMPPRINTER() : mpPrinter;
- maEdtFaxNo.SetText( pPrinter->GetJobValue( String::CreateFromAscii( "FAX#" ) ) );
-
- Size aFTSize = maFiFaxNo.GetSizePixel();
- long nTextWidth = maFiFaxNo.GetCtrlTextWidth( maFiFaxNo.GetText() ) + 10;
- if ( aFTSize.Width() < nTextWidth )
- {
- long nDelta = nTextWidth - aFTSize.Width();
- aFTSize.Width() = aFTSize.Width() + nDelta;
- maFiFaxNo.SetSizePixel( aFTSize );
- Size aEdtSize = maEdtFaxNo.GetSizePixel();
- aEdtSize.Width() = aEdtSize.Width() - nDelta;
- Point aEdtPos = maEdtFaxNo.GetPosPixel();
- aEdtPos.X() = aEdtPos.X() + nDelta;
- maEdtFaxNo.SetPosSizePixel( aEdtPos, aEdtSize );
- }
- }
- else
-#endif
- {
- maFiPrintFile.Show( TRUE );
- maCbxFilePrint.Show( TRUE );
- maFiFaxNo.Show( FALSE );
- maEdtFaxNo.Show( FALSE );
- }
-
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::ImplCheckOK()
-{
- // Ueberprueft, ob der OK-Button enabled ist
- BOOL bEnable = TRUE;
-
- if ( bEnable && maRbtPages.IsChecked() )
- bEnable = maEdtPages.GetText().Len() > 0;
-
- if ( bEnable )
- {
- if ( TEMPPRINTER() )
- bEnable = TEMPPRINTER()->IsValid();
- else
- bEnable = mpPrinter->IsValid();
- }
-
- maBtnOK.Enable( bEnable );
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::ImplInitControls()
-{
- // Alles
- if ( mbAll )
- {
- maRbtAll.Enable();
- if( meCheckRange == PRINTDIALOG_ALL )
- maRbtAll.Check( TRUE );
- }
- else
- maRbtAll.Enable( FALSE );
-
- // Selektion
- if ( mbSelection )
- {
- maRbtSelection.Enable();
- if ( meCheckRange == PRINTDIALOG_SELECTION )
- maRbtSelection.Check( TRUE );
- }
- else
- maRbtSelection.Enable( FALSE );
-
- // Seiten
- if ( mbRange )
- {
- maRbtPages.Enable();
- maEdtPages.Show();
- maEdtPages.SetText( maRangeText );
-
- if( ( meCheckRange == PRINTDIALOG_FROMTO ) ||
- ( meCheckRange == PRINTDIALOG_RANGE ) )
- {
- maRbtPages.Check( TRUE );
- maEdtPages.Enable();
- }
- else
- maEdtPages.Enable( FALSE );
- }
- else
- {
- maRbtPages.Enable( FALSE );
- maEdtPages.Hide();
- }
-
- // Anzahl Kopien
- maNumCopies.SetValue( mnCopyCount );
-
- // Sortierung
- maCbxCollate.Enable( mbCollate );
- maCbxCollate.Check( mbCollateCheck );
-
- // Zusaetze-Button
- if ( mbOptions )
- maBtnOptions.Show();
-
- if ( !mbWithSheetsAndCells )
- {
- Size aMarginSize =
- LogicToPixel( Size( RSC_SP_CTRL_GROUP_X, RSC_SP_CTRL_GROUP_Y ), MAP_APPFONT );
- long nTempPos = maImgCollate.GetPosPixel().Y() +
- maImgCollate.GetSizePixel().Height() + aMarginSize.Height();
- long nDelta1 = maFlPrintRange.GetPosPixel().Y() - maFlPrint.GetPosPixel().Y();
- long nDelta2 = maFlSepButtonLine.GetPosPixel().Y() - nTempPos;
-
- maFlPrint.Hide();
- maRbtAllSheets.Hide();
- maRbtSelectedSheets.Hide();
- maRbtSelectedCells.Hide();
- maRbtSelection.Show();
-
- Size aNewSize = GetSizePixel();
- aNewSize.Height() -= nDelta2;
- SetSizePixel( aNewSize );
- aNewSize = maFlSepCopiesRange.GetSizePixel();
- aNewSize.Height() -= nDelta2;
- maFlSepCopiesRange.SetSizePixel( aNewSize );
-
- long nDelta = nDelta1;
- Window* pControls[] = { &maFlPrintRange, &maRbtAll,
- &maRbtPages, &maEdtPages, &maRbtSelection, NULL,
- &maFlSepButtonLine, &maBtnOptions, &maBtnOK,
- &maBtnCancel, &maBtnHelp };
- Window** pCtrl = pControls;
- const sal_Int32 nCount = SAL_N_ELEMENTS( pControls );
- for ( sal_Int32 i = 0; i < nCount; ++i, ++pCtrl )
- {
- if ( NULL == *pCtrl )
- {
- nDelta = nDelta2;
- continue;
- }
- Point aNewPos = (*pCtrl)->GetPosPixel();
- aNewPos.Y() -= nDelta;
- (*pCtrl)->SetPosPixel( aNewPos );
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::ImplFillDialogData()
-{
- if ( maRbtAll.IsChecked() )
- meCheckRange = PRINTDIALOG_ALL;
- else if( maRbtSelection.IsChecked() )
- meCheckRange = PRINTDIALOG_SELECTION;
- else
- {
- meCheckRange = PRINTDIALOG_RANGE;
- maRangeText = maEdtPages.GetText();
- }
-
- mnCopyCount = (USHORT) maNumCopies.GetValue();
- mbCollateCheck = maCbxCollate.IsChecked();
-
- // In Datei drucken
- if ( maCbxFilePrint.IsChecked() )
- mpPrinter->SetPrintFile( maFiPrintFile.GetText() );
- mpPrinter->EnablePrintFile( maCbxFilePrint.IsChecked() );
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( PrintDialog, ImplStatusHdl, Timer*, EMPTYARG )
-{
- QueueInfo aInfo;
- ImplPrnDlgUpdateQueueInfo( &maLbName, aInfo );
- maFiStatus.SetText( ImplPrnDlgGetStatusText( aInfo ) );
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( PrintDialog, ImplPropertiesHdl, void*, EMPTYARG )
-{
- if ( !TEMPPRINTER() )
- TEMPPRINTER() = new Printer( mpPrinter->GetJobSetup() );
- TEMPPRINTER()->Setup( this );
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( PrintDialog, ImplChangePrinterHdl, void*, EMPTYARG )
-{
- TEMPPRINTER() = ImplPrnDlgListBoxSelect( &maLbName, &maBtnProperties,
- mpPrinter, TEMPPRINTER() );
- ImplSetInfo();
- ImplCheckOK(); // Check if "OK" button can be enabled now!
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-bool PrintDialog::ImplGetFilename()
-{
- uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- static ::rtl::OUString aOldFile;
- if( xFactory.is() )
- {
- uno::Sequence< uno::Any > aTempl( 1 );
- aTempl.getArray()[0] <<= ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION;
- uno::Reference< ui::dialogs::XFilePicker > xFilePicker(
- xFactory->createInstanceWithArguments(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) ),
- aTempl ), uno::UNO_QUERY );
- DBG_ASSERT( xFilePicker.is(), "could not get FilePicker service" );
-
- uno::Reference< ui::dialogs::XFilterManager > xFilterMgr( xFilePicker, uno::UNO_QUERY );
- if( xFilePicker.is() && xFilterMgr.is() )
- {
- try
- {
-#ifdef UNX
- // add PostScript and PDF
- Printer* pPrinter = TEMPPRINTER() ? TEMPPRINTER() : mpPrinter;
- bool bPS = true, bPDF = true;
- if( pPrinter )
- {
- if( pPrinter->GetCapabilities( PRINTER_CAPABILITIES_PDF ) )
- bPS = false;
- else
- bPDF = false;
- }
- if( bPS )
- xFilterMgr->appendFilter( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PostScript" ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.ps" ) ) );
- if( bPDF )
- xFilterMgr->appendFilter( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Portable Document Format" ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.pdf" ) ) );
-#elif defined WNT
- xFilterMgr->appendFilter( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.PRN" ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.prn" ) ) );
-#endif
- // add arbitrary files
- xFilterMgr->appendFilter( maAllFilterStr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.*" ) ) );
- }
- catch( lang::IllegalArgumentException rExc )
- {
- DBG_ERRORFILE( "caught IllegalArgumentException when registering filter\n" );
- }
-
- if( aOldFile.getLength() )
- {
- INetURLObject aUrl( aOldFile, INET_PROT_FILE );
- xFilePicker->setDefaultName( aUrl.GetLastName() );
- aUrl.CutLastName();
- xFilePicker->setDisplayDirectory( aUrl.GetMainURL( INetURLObject::DECODE_TO_IURI ) );
- }
-
- if( xFilePicker->execute() == ui::dialogs::ExecutableDialogResults::OK )
- {
- uno::Sequence< ::rtl::OUString > aPathSeq( xFilePicker->getFiles() );
- INetURLObject aObj( aPathSeq[0] );
- maFiPrintFile.SetText( aOldFile = aObj.PathToFileName() );
- return true;
- }
- return false;
- }
- }
-
- // something went awry, lets try the old fashioned dialogue
- Window* pDlgParent = IsReallyVisible() ? this : GetParent();
- FileDialog aDlg( pDlgParent, WB_STDDIALOG | WB_SAVEAS );
-#ifdef WNT
- aDlg.AddFilter( String( RTL_CONSTASCII_USTRINGPARAM( "*.prn" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "*.prn" ) ) );
- aDlg.SetDefaultExt( String( RTL_CONSTASCII_USTRINGPARAM( "prn" ) ) );
-#elif defined UNX
- aDlg.AddFilter( String( RTL_CONSTASCII_USTRINGPARAM( "PostScript" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "*.ps" ) ) );
- aDlg.SetDefaultExt( String( RTL_CONSTASCII_USTRINGPARAM( "ps" ) ) );
-#endif
-
- if( aOldFile.getLength() )
- aDlg.SetPath( aOldFile );
-
- if( aDlg.Execute() )
- {
- String aTargetFile = aDlg.GetPath();
- maFiPrintFile.SetText( aOldFile = aTargetFile );
- return true;
- }
-
- return false;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( PrintDialog, ImplModifyControlHdl, void*, p )
-{
- // Radiobuttons (Umfang)
- if ( !p || (p == &maRbtAll) || (p == &maRbtPages) || (p == &maRbtSelection) )
- {
- BOOL bCheck = maRbtPages.IsChecked();
- maEdtPages.Enable( bCheck );
- if ( p == &maRbtPages )
- maEdtPages.GrabFocus();
- ImplCheckOK();
- }
-
- // Edit-Felder (Seiten)
- if ( p == &maEdtPages )
- ImplCheckOK();
-
- if( p == &maEdtFaxNo )
- {
- Printer* pPrinter = TEMPPRINTER() ? TEMPPRINTER() : mpPrinter;
- pPrinter->SetJobValue( String::CreateFromAscii( "FAX#" ), maEdtFaxNo.GetText() );
- }
-
- // Anzahl Kopien
- BOOL bNumCopies = FALSE;
-
- if ( !p || p == &maNumCopies )
- {
- if ( p )
- bNumCopies = TRUE;
- //BOOL bCopies = maNumCopies.GetValue() > 1;
- maCbxCollate.Enable( mbCollate );
-
- /*if ( !bCopies )
- maCbxCollate.Check( FALSE );
- else*/
- if ( mbCollateCheck )
- maCbxCollate.Check( TRUE );
- }
-
- // Sortieren
- if ( !p || p == &maCbxCollate || bNumCopies )
- {
- BOOL bCheck = maCbxCollate.IsChecked();
-
- if ( !bNumCopies )
- mbCollateCheck = maCbxCollate.IsChecked();
-
- if( bCheck )
- {
- maImgCollate.Show();
- maImgNotCollate.Hide();
- }
- else
- {
- maImgCollate.Hide();
- maImgNotCollate.Show();
- }
- }
-
- // Zus"atze
- if ( p == &maBtnOptions )
- ClickOptionsHdl();
-
- if( p == &maBtnOK )
- {
- EndDialog( maCbxFilePrint.IsChecked() ? ImplGetFilename() : TRUE );
- }
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-long PrintDialog::ClickOptionsHdl()
-{
- if ( maOptionsHdlLink.IsSet() )
- return maOptionsHdlLink.Call( this );
- else
- return TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-long PrintDialog::OK()
-{
- if ( maOKHdlLink.IsSet() )
- return maOKHdlLink.Call( this );
- else
- return TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::EnableSheetRange( bool bEnable, PrintSheetRange eRange )
-{
- if ( mbWithSheetsAndCells )
- {
- switch ( eRange )
- {
- case PRINTSHEETS_ALL :
- maRbtAllSheets.Enable( bEnable != false );
- break;
- case PRINTSHEETS_SELECTED_SHEETS :
- maRbtSelectedSheets.Enable( bEnable != false );
- break;
- case PRINTSHEETS_SELECTED_CELLS :
- maRbtSelectedCells.Enable( bEnable != false );
- break;
- default:
- DBG_ERRORFILE( "PrintDialog::EnableSheetRange(): invalid range" );
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-bool PrintDialog::IsSheetRangeEnabled( PrintSheetRange eRange ) const
-{
- if ( !mbWithSheetsAndCells )
- return false;
-
- bool bRet = false;
- switch ( eRange )
- {
- case PRINTSHEETS_ALL :
- bRet = maRbtAllSheets.IsEnabled() != FALSE;
- break;
- case PRINTSHEETS_SELECTED_SHEETS :
- bRet = maRbtSelectedSheets.IsEnabled() != FALSE;
- break;
- case PRINTSHEETS_SELECTED_CELLS :
- bRet = maRbtSelectedCells.IsEnabled() != FALSE;
- break;
- default:
- DBG_ERRORFILE( "PrintDialog::IsSheetRangeEnabled(): invalid range" );
- }
- return bRet;
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::CheckSheetRange( PrintSheetRange eRange )
-{
- if ( mbWithSheetsAndCells )
- {
- switch ( eRange )
- {
- case PRINTSHEETS_ALL :
- maRbtAllSheets.Check();
- break;
- case PRINTSHEETS_SELECTED_SHEETS :
- maRbtSelectedSheets.Check();
- break;
- case PRINTSHEETS_SELECTED_CELLS :
- maRbtSelectedCells.Check();
- break;
- default:
- DBG_ERRORFILE( "PrintDialog::CheckSheetRange(): invalid range" );
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-PrintSheetRange PrintDialog::GetCheckedSheetRange() const
-{
- PrintSheetRange eRange = PRINTSHEETS_ALL;
- if ( mbWithSheetsAndCells )
- {
- if ( maRbtSelectedSheets.IsChecked() )
- eRange = PRINTSHEETS_SELECTED_SHEETS;
- else if ( maRbtSelectedCells.IsChecked() )
- eRange = PRINTSHEETS_SELECTED_CELLS;
- }
- return eRange;
-}
-
-// -----------------------------------------------------------------------
-
-bool PrintDialog::IsSheetRangeChecked( PrintSheetRange eRange ) const
-{
- if ( !mbWithSheetsAndCells )
- return false;
-
- bool bRet = false;
- switch ( eRange )
- {
- case PRINTSHEETS_ALL :
- bRet = maRbtAllSheets.IsChecked() != FALSE;
- break;
- case PRINTSHEETS_SELECTED_SHEETS :
- bRet = maRbtSelectedSheets.IsChecked() != FALSE;
- break;
- case PRINTSHEETS_SELECTED_CELLS :
- bRet = maRbtSelectedCells.IsChecked() != FALSE;
- break;
- default:
- DBG_ERRORFILE( "PrintDialog::IsSheetRangeChecked(): invalid range" );
- }
- return bRet;
-}
-
-// -----------------------------------------------------------------------
-
-long PrintDialog::Notify( NotifyEvent& rNEvt )
-{
- if ( (rNEvt.GetType() == EVENT_GETFOCUS) && IsReallyVisible() )
- ImplStatusHdl( &maStatusTimer );
- else if ( rNEvt.GetType() == EVENT_KEYINPUT )
- {
- if ( rNEvt.GetKeyEvent()->GetKeyCode().GetCode() == KEY_F1 && mpPrinterImpl->m_bHelpDisabled )
- return 1; // do nothing
- }
-
- return ModalDialog::Notify( rNEvt );
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::DataChanged( const DataChangedEvent& rDCEvt )
-{
- if ( rDCEvt.GetType() == DATACHANGED_PRINTER )
- {
- TEMPPRINTER() = ImplPrnDlgUpdatePrinter( mpPrinter, TEMPPRINTER() );
- Printer* pPrn;
- if ( TEMPPRINTER() )
- pPrn = TEMPPRINTER();
- else
- pPrn = mpPrinter;
- ImplFillPrnDlgListBox( pPrn, &maLbName, &maBtnProperties );
- ImplSetInfo();
- ImplCheckOK();
- }
- else if ( rDCEvt.GetType() == DATACHANGED_SETTINGS )
- ImplSetImages();
-
- ModalDialog::DataChanged( rDCEvt );
-}
-
-// -----------------------------------------------------------------------
-
-short PrintDialog::Execute()
-{
- if ( !mpPrinter || mpPrinter->IsPrinting() || mpPrinter->IsJobActive() )
- {
- DBG_ERRORFILE( "PrinterSetupDialog::Execute() - No Printer or printer is printing" );
- return FALSE;
- }
-
- // check if the printer brings up its own dialog
- // in that case leave the work to that dialog
- if( mpPrinter->GetCapabilities( PRINTER_CAPABILITIES_EXTERNALDIALOG ) )
- return TRUE;
-
- Printer::updatePrinters();
-
- // Controls initialisieren
- ImplFillPrnDlgListBox( mpPrinter, &maLbName, &maBtnProperties );
- ImplSetInfo();
- maStatusTimer.Start();
- ImplInitControls();
- maNumCopies.GrabFocus();
- maNumCopies.SetSelection( Selection( 0, maNumCopies.GetText().Len() ) );
- ImplModifyControlHdl( NULL );
-
- // Dialog starten
- short nRet = ModalDialog::Execute();
-
- // Wenn Dialog mit OK beendet wurde, dann die Daten updaten
- if( nRet == TRUE )
- {
- if ( TEMPPRINTER() )
- mpPrinter->SetPrinterProps( TEMPPRINTER() );
- ImplFillDialogData();
- }
-
- maStatusTimer.Stop();
-
- return nRet;
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::DisableHelp()
-{
- mpPrinterImpl->m_bHelpDisabled = sal_True;
- maBtnHelp.Disable();
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/dialogs/printdlg.hrc b/svtools/source/dialogs/printdlg.hrc
deleted file mode 100644
index 83b7b0b28c82..000000000000
--- a/svtools/source/dialogs/printdlg.hrc
+++ /dev/null
@@ -1,74 +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.
- *
- ************************************************************************/
-
-#include <svtools/svtools.hrc>
-
-#define FL_PRINTER 1
-#define LB_NAMES 2
-#define BTN_PROPERTIES 3
-#define FT_NAME 4
-#define FT_STATUS 5
-#define FI_STATUS 6
-#define FT_TYPE 7
-#define FI_TYPE 8
-#define FT_LOCATION 9
-#define FI_LOCATION 10
-#define FT_COMMENT 11
-#define FI_COMMENT 12
-#define CBX_FILEPRINT 13
-#define FI_PRINTFILE 14
-#define FI_FAXNO 15
-#define EDT_FAXNO 16
-
-#define FL_PRINT 20
-#define RBT_ALL_SHEETS 21
-#define RBT_SELECTED_SHEETS 22
-#define RBT_SELECTED_CELLS 23
-
-#define FL_PRINTRANGE 30
-#define RBT_ALL 31
-#define RBT_PAGES 32
-#define EDT_PAGES 33
-#define RBT_SELECTION 34
-
-#define FL_SEPCOPIESRANGE 35
-
-#define FL_COPIES 40
-#define FT_COPIES 41
-#define NUM_COPIES 42
-#define CBX_COLLATE 43
-#define IMG_COLLATE 44
-#define IMG_NOT_COLLATE 45
-
-#define FL_SEPBUTTONLINE 50
-#define BTN_OK 51
-#define BTN_CANCEL 52
-#define BTN_HELP 53
-#define BTN_OPTIONS 54
-
-#define STR_ALLFILTER 10
-
diff --git a/svtools/source/dialogs/printdlg.src b/svtools/source/dialogs/printdlg.src
deleted file mode 100644
index 6ce73d01aa7f..000000000000
--- a/svtools/source/dialogs/printdlg.src
+++ /dev/null
@@ -1,289 +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.
- *
- ************************************************************************/
-
-#include "printdlg.hrc"
-
-#define IMAGE_MAGENTA_MASK Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; }
-
-ModalDialog DLG_SVT_PRNDLG_PRINTDLG
-{
- SVLook = TRUE ;
- OutputSize = TRUE ;
- Moveable = TRUE ;
- Size = MAP_APPFONT ( 265 , 210 ) ;
- Text [ en-US ] = "Print" ;
- FixedLine FL_PRINTER
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 253 , 8 ) ;
- Text [ en-US ] = "Printer" ;
- };
- FixedText FT_NAME
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- Text [ en-US ] = "~Name" ;
- };
- ListBox LB_NAMES
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 60 , 13 ) ;
- Size = MAP_APPFONT ( 130 , 80 ) ;
- DropDown = TRUE ;
- Sort = TRUE ;
- };
- PushButton BTN_PROPERTIES
- {
- Pos = MAP_APPFONT ( 193 , 12 ) ;
- Size = MAP_APPFONT ( 60 , 14 ) ;
- Text [ en-US ] = "Propert~ies..." ;
- };
- FixedText FT_STATUS
- {
- Pos = MAP_APPFONT ( 12 , 29 ) ;
- Size = MAP_APPFONT ( 45 , 8 ) ;
- Text [ en-US ] = "Status" ;
- };
- FixedText FI_STATUS
- {
- Pos = MAP_APPFONT ( 60 , 29 ) ;
- Size = MAP_APPFONT ( 193 , 8 ) ;
- };
- FixedText FT_TYPE
- {
- Pos = MAP_APPFONT ( 12 , 40 ) ;
- Size = MAP_APPFONT ( 45 , 8 ) ;
- Text [ en-US ] = "Type" ;
- };
- FixedText FI_TYPE
- {
- Pos = MAP_APPFONT ( 60 , 40 ) ;
- Size = MAP_APPFONT ( 193 , 8 ) ;
- };
- FixedText FT_LOCATION
- {
- Pos = MAP_APPFONT ( 12 , 51 ) ;
- Size = MAP_APPFONT ( 45 , 8 ) ;
- Text [ en-US ] = "Location" ;
- };
- FixedText FI_LOCATION
- {
- Pos = MAP_APPFONT ( 60 , 51 ) ;
- Size = MAP_APPFONT ( 193 , 8 ) ;
- };
- FixedText FT_COMMENT
- {
- Pos = MAP_APPFONT ( 12 , 62 ) ;
- Size = MAP_APPFONT ( 45 , 8 ) ;
- Text [ en-US ] = "Comment" ;
- };
- FixedText FI_COMMENT
- {
- Pos = MAP_APPFONT ( 60 , 62 ) ;
- Size = MAP_APPFONT ( 193 , 8 ) ;
- };
- FixedText FI_FAXNO
- {
- Pos = MAP_APPFONT ( 12 , 75 ) ;
- Size = MAP_APPFONT ( 45 , 8 ) ;
- Text [ en-US ] = "Fax number";
- };
- Edit EDT_FAXNO
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 60 , 73 );
- Size = MAP_APPFONT ( 188 , 12 );
- };
- CheckBox CBX_FILEPRINT
- {
- Pos = MAP_APPFONT ( 12 , 73 ) ;
- Size = MAP_APPFONT ( 75 , 10 ) ;
- Text [ en-US ] = "Print to file" ;
- };
- FixedText FI_PRINTFILE
- {
- Pos = MAP_APPFONT ( 90 , 74 ) ;
- Size = MAP_APPFONT ( 163 , 8 ) ;
- };
- /*!!!
- PushButton BTN_BROWSE
- {
- Pos = MAP_APPFONT ( 234 , 75 ) ;
- Size = MAP_APPFONT ( 14 , 14 ) ;
- Text = "~..." ;
- Hide = TRUE ;
- };
- */
- FixedLine FL_PRINT
- {
- Pos = MAP_APPFONT ( 6 , 91 ) ;
- Size = MAP_APPFONT ( 117 , 8 ) ;
- Text [ en-US ] = "Print" ;
- };
- RadioButton RBT_ALL_SHEETS
- {
- Pos = MAP_APPFONT ( 12 , 102 ) ;
- Size = MAP_APPFONT ( 105 , 10 ) ;
- Text [ en-US ] = "All sheets" ;
- };
- RadioButton RBT_SELECTED_SHEETS
- {
- Pos = MAP_APPFONT ( 12 , 115 ) ;
- Size = MAP_APPFONT ( 105 , 10 ) ;
- Text [ en-US ] = "Selected sheets" ;
- };
- RadioButton RBT_SELECTED_CELLS
- {
- Pos = MAP_APPFONT ( 12 , 128 ) ;
- Size = MAP_APPFONT ( 105 , 10 ) ;
- Text [ en-US ] = "Selected cells" ;
- };
- FixedLine FL_PRINTRANGE
- {
- Pos = MAP_APPFONT ( 6 , 141 ) ;
- Size = MAP_APPFONT ( 117 , 8 ) ;
- Text [ en-US ] = "Print range" ;
- };
- RadioButton RBT_ALL
- {
- Pos = MAP_APPFONT ( 12 , 152 ) ;
- Size = MAP_APPFONT ( 105 , 10 ) ;
- Text [ en-US ] = "All pages" ;
- };
- RadioButton RBT_PAGES
- {
- Pos = MAP_APPFONT ( 12 , 165 ) ;
- Size = MAP_APPFONT ( 50 , 10 ) ;
- Text [ en-US ] = "Pages" ;
- };
- Edit EDT_PAGES
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 65 , 164 ) ;
- Size = MAP_APPFONT ( 52 , 12 ) ;
- };
- RadioButton RBT_SELECTION
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 12 , 179 ) ;
- Size = MAP_APPFONT ( 105 , 10 ) ;
- Text [ en-US ] = "Selection" ;
- };
- FixedLine FL_SEPCOPIESRANGE
- {
- Pos = MAP_APPFONT( 126, 102 );
- Size = MAP_APPFONT( 1, 74 );
- Vert = TRUE;
- };
- FixedLine FL_COPIES
- {
- Pos = MAP_APPFONT ( 129 , 91 ) ;
- Size = MAP_APPFONT ( 130 , 8 ) ;
- Text [ en-US ] = "Copies" ;
- };
- FixedText FT_COPIES
- {
- Pos = MAP_APPFONT ( 135 , 104 ) ;
- Size = MAP_APPFONT ( 63 , 8 ) ;
- Text [ en-US ] = "Number of copies" ;
- };
- NumericField NUM_COPIES
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 201 , 102 ) ;
- Size = MAP_APPFONT ( 33 , 12 ) ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 9999 ;
- StrictFormat = TRUE ;
- First = 1 ;
- Last = 9999 ;
- };
- CheckBox CBX_COLLATE
- {
- Pos = MAP_APPFONT ( 201 , 123 ) ;
- Size = MAP_APPFONT ( 60 , 10 ) ;
- Text [ en-US ] = "Co~llate" ;
- };
- FixedImage IMG_COLLATE
- {
- Pos = MAP_APPFONT ( 132 , 117 ) ;
- Size = MAP_APPFONT ( 67 , 22 ) ;
- Hide = TRUE ;
- };
- FixedImage IMG_NOT_COLLATE
- {
- Pos = MAP_APPFONT ( 132 , 117 ) ;
- Size = MAP_APPFONT ( 67 , 22 ) ;
- Hide = TRUE ;
- };
- FixedLine FL_SEPBUTTONLINE
- {
- Pos = MAP_APPFONT( 0, 179 );
- Size = MAP_APPFONT( 265, 8 );
- };
- PushButton BTN_OPTIONS
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 6 , 190 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Options..." ;
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 100 , 190 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 153 , 190 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 209 , 190 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- String STR_ALLFILTER
- {
- Text [ en-US ] = "<All>";
- };
-};
-
-Image RID_IMG_PRNDLG_COLLATE
-{
- ImageBitmap = Bitmap { File = "collate.png" ; };
- MaskColor = IMAGE_MAGENTA_MASK ;
-};
-
-Image RID_IMG_PRNDLG_NOCOLLATE
-{
- ImageBitmap = Bitmap { File = "ncollate.png" ; };
- MaskColor = IMAGE_MAGENTA_MASK ;
-};
diff --git a/svtools/source/dialogs/prnsetup.cxx b/svtools/source/dialogs/prnsetup.cxx
index 3abad8dd8505..728d0e6ea5c7 100644
--- a/svtools/source/dialogs/prnsetup.cxx
+++ b/svtools/source/dialogs/prnsetup.cxx
@@ -57,7 +57,7 @@ void ImplFillPrnDlgListBox( const Printer* pPrinter,
// -----------------------------------------------------------------------
-void ImplFreePrnDlgListBox( ListBox* pBox, BOOL bClear )
+void ImplFreePrnDlgListBox( ListBox* pBox, sal_Bool bClear )
{
if ( bClear )
pBox->Clear();
@@ -145,7 +145,7 @@ static void ImplPrnDlgAddString( XubString& rStr, const XubString& rAddStr )
// -----------------------------------------------------------------------
-static void ImplPrnDlgAddResString( XubString& rStr, USHORT nResId )
+static void ImplPrnDlgAddResString( XubString& rStr, sal_uInt16 nResId )
{
SvtResId aResId( nResId );
XubString aAddStr( aResId );
@@ -157,7 +157,7 @@ static void ImplPrnDlgAddResString( XubString& rStr, USHORT nResId )
XubString ImplPrnDlgGetStatusText( const QueueInfo& rInfo )
{
XubString aStr;
- ULONG nStatus = rInfo.GetStatus();
+ sal_uLong nStatus = rInfo.GetStatus();
// Default-Printer
if ( rInfo.GetPrinterName().Len() &&
@@ -217,7 +217,7 @@ XubString ImplPrnDlgGetStatusText( const QueueInfo& rInfo )
ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_POWER_SAVE );
// Anzahl Jobs
- ULONG nJobs = rInfo.GetJobs();
+ sal_uLong nJobs = rInfo.GetJobs();
if ( nJobs && (nJobs != QUEUE_JOBS_DONTKNOW) )
{
XubString aJobStr( SvtResId( STR_SVT_PRNDLG_JOBCOUNT ) );
@@ -269,7 +269,7 @@ PrinterSetupDialog::PrinterSetupDialog( Window* pWindow ) :
PrinterSetupDialog::~PrinterSetupDialog()
{
- ImplFreePrnDlgListBox( &maLbName, FALSE );
+ ImplFreePrnDlgListBox( &maLbName, sal_False );
delete mpTempPrinter;
}
@@ -374,7 +374,7 @@ short PrinterSetupDialog::Execute()
if ( !mpPrinter || mpPrinter->IsPrinting() || mpPrinter->IsJobActive() )
{
DBG_ERRORFILE( "PrinterSetupDialog::Execute() - No Printer or printer is printing" );
- return FALSE;
+ return sal_False;
}
Printer::updatePrinters();
@@ -387,7 +387,7 @@ short PrinterSetupDialog::Execute()
short nRet = ModalDialog::Execute();
// Wenn Dialog mit OK beendet wurde, dann die Daten updaten
- if ( nRet == TRUE )
+ if ( nRet == sal_True )
{
if ( mpTempPrinter )
mpPrinter->SetPrinterProps( mpTempPrinter );
diff --git a/svtools/source/dialogs/prnsetup.src b/svtools/source/dialogs/prnsetup.src
index 8bb866c4e40e..b0ef9638d974 100644
--- a/svtools/source/dialogs/prnsetup.src
+++ b/svtools/source/dialogs/prnsetup.src
@@ -138,6 +138,7 @@ String STR_SVT_PRNDLG_JOBCOUNT
ModalDialog DLG_SVT_PRNDLG_PRNSETUPDLG
{
+ HelpID = "svtools:ModalDialog:DLG_SVT_PRNDLG_PRNSETUPDLG";
OutputSize = TRUE ;
SVLook = TRUE ;
Moveable = TRUE ;
@@ -157,6 +158,7 @@ ModalDialog DLG_SVT_PRNDLG_PRNSETUPDLG
};
ListBox LB_NAMES
{
+ HelpID = "svtools:ListBox:DLG_SVT_PRNDLG_PRNSETUPDLG:LB_NAMES";
Border = TRUE ;
Pos = MAP_APPFONT ( 60 , 12 ) ;
Size = MAP_APPFONT ( 125 , 80 ) ;
@@ -165,6 +167,7 @@ ModalDialog DLG_SVT_PRNDLG_PRNSETUPDLG
};
PushButton BTN_PROPERTIES
{
+ HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRNSETUPDLG:BTN_PROPERTIES";
Pos = MAP_APPFONT ( 188 , 12 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "Propert~ies..." ;
@@ -220,6 +223,7 @@ ModalDialog DLG_SVT_PRNDLG_PRNSETUPDLG
};
PushButton BTN_OPTIONS
{
+ HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRNSETUPDLG:BTN_OPTIONS";
Pos = MAP_APPFONT ( 5 , 84 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Options..." ;
diff --git a/svtools/source/dialogs/propctrl.cxx b/svtools/source/dialogs/propctrl.cxx
deleted file mode 100644
index d24e7226d2bf..000000000000
--- a/svtools/source/dialogs/propctrl.cxx
+++ /dev/null
@@ -1,499 +0,0 @@
-/* -*- 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 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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-
-
-#include <usr/inspect.hxx>
-#include <usr/serinfo.hxx>
-#include <usr/introsp.hxx>
-
-#include <propctrl.hxx>
-#include <property.hxx>
-
-
-// Controller-Implementation
-class PropertyEditorControler_Impl : public SvPropertyDataControl
-{
- XIntrospectionAccessRef mxUnoAccess;
- PropertySequence mPropSeq;
- XPropertyEditorRef mxEditor;
- SvPropertyBox* mpPropBox;
- UsrAny maUnoObj;
-
-public:
- // Provisorisch direkt Window mitgeben
- PropertyEditorControler_Impl( SvPropertyBox* pPropBox_ );
- //SimplePropertyEditor_Impl( void );
-
- // Objekt zum Editieren setzen, dies loest das Eintragen
- // der Properties in die PropertyBox aus
- void setObject( XPropertyEditorRef xEditor_, const UsrAny& aToEditObj,
- /* HACK fuer History-Interface*/String aPath, BOOL bBack=FALSE, BOOL bForward=FALSE );
-
- /* SPAETER
- SMART_UNO_DECLARATION(ImplIntrospection,UsrObject);
-
- // Methoden von XInterface
- XInterface * queryInterface( Uik aUik );
- XIdlClassRef getIdlClass();
- */
-
- // Methoden von SvPropertyDataControl
- virtual void Modified( const String& aName,
- const String& aVal,
- void* pData);
-
- virtual void Clicked( const String& aName,
- const String& aVal,
- void* pData);
-
- virtual void Commit( const String& aName,
- const String& aVal,
- void* pData);
-
- virtual void Select( const String& aName,
- void* pData);
-
- virtual void LinkClicked(const String& aName,
- void* pData);
-
- // TODO: Das muss raus, sehr unglueckliche Schnittstelle
- // PropertyBox erzwingt Zustand des Controllers
- virtual String GetTheCorrectProperty() const;
-};
-
-// Methoden von XPropertyEditor
-PropertyEditorControler_Impl::PropertyEditorControler_Impl( SvPropertyBox* pPropBox_ )
-{
- mpPropBox = pPropBox_;
-}
-
-void PropertyEditorControler_Impl::setObject( XPropertyEditorRef xEditor_, const UsrAny& aToEditObj,
- /* HACK fuer History-Interface*/ String aPath, BOOL bBack, BOOL bForward )
-{
- static XIntrospectionRef xIntrospection;
-
- // Ohne Fenster laeuft gar nix
- if( !mpPropBox )
- return;
-
- // Fenster aufraeumen
- mpPropBox->ClearAll();
-
- // Editor und Objekt übernehmen
- mxEditor = xEditor_;
- maUnoObj = aToEditObj;
-
- if( !xIntrospection.is() )
- {
- // Introspection-Service holen
- XServiceManagerRef xServiceManager = getGlobalServiceManager();
- XServiceProviderRef xProv = xServiceManager->getServiceProvider
- ( "com.sun.star.beans.Introspection", UikSequence(), UikSequence() );
- xIntrospection = (XIntrospection *)xProv->newInstance()
- ->queryInterface( XIntrospection::getSmartUik() );
- }
- if( !xIntrospection.is() )
- return;
-
- // und unspecten
- mxUnoAccess = xIntrospection->inspect( maUnoObj );
- if( !mxUnoAccess.Is() )
- return;
-
- // Uns als Controler anmelden
- mpPropBox->SetController( this );
-
- // Properties anlegen
- mPropSeq = mxUnoAccess->getProperties();
- UINT32 nPropCount = mPropSeq.getLen();
- const Property* pProps = mPropSeq.getConstArray();
-
- // 1. Seite anlegen
- USHORT nPropPageId = mpPropBox->AppendPage("Properties");
-
- // Beim Eintragen solls nicht flimmern
- mpPropBox->DisableUpdate();
-
- // Dummy-Properties fuer Path und Navigation
- SvPropertyData aProperty;
- if( aPath.Len() )
- {
- // Interface und Structs werden Hyperlinks
- aProperty.bIsHyperLink = FALSE;
- aProperty.bIsLocked = TRUE;
- aProperty.bHasVisibleXButton = FALSE;
- aProperty.eKind = KOC_EDIT;
- aProperty.pControl = NULL;
- aProperty.pDataPtr = NULL;
- aProperty.aName = "Path";
- aProperty.aValue = aPath;
- mpPropBox->InsertEntry( aProperty );
- }
- if( bBack || bForward )
- {
- // Interface und Structs werden Hyperlinks
- aProperty.bIsHyperLink = TRUE;
- aProperty.bIsLocked = TRUE;
- // HACK, solange Hyperlink nicht funktioniert
- aProperty.bHasVisibleXButton = aProperty.bIsHyperLink;
- aProperty.eKind = KOC_EDIT;
- UINT32 iHandle;
- aProperty.pControl = NULL;
- if( bBack )
- {
- iHandle = 1000001;
- aProperty.pDataPtr = (void*)iHandle;
- aProperty.aName = "<-";
- aProperty.aValue = "Back";
- mpPropBox->InsertEntry( aProperty );
- }
- if( bForward )
- {
- iHandle = 1000000;
- aProperty.pDataPtr = (void*)iHandle;
- aProperty.aName = "->";
- aProperty.aValue = "Forward";
- mpPropBox->InsertEntry( aProperty );
- }
- }
-
- // Properties eintragen
- // TODO: Wo kommen die Strings her
- UINT32 i;
- for( i = 0 ; i < nPropCount ; i++ )
- {
- const Property& rProp = pProps[ i ];
-
- // TypeClass des Property ermitteln
- XIdlClassRef xPropClass = rProp.Type;
- if( !xPropClass.is() )
- {
- OSL_FAIL( "PropertyEditorControler_Impl::Commit(), Property without type" )
- return;
- }
- TypeClass eType = xPropClass->getTypeClass();
-
- // Interface und Structs werden Hyperlinks
- aProperty.bIsHyperLink = ( eType == TYPECLASS_INTERFACE || eType == TYPECLASS_STRUCT );
- aProperty.bIsLocked = ((rProp.Attributes & PROPERTY_READONLY) != 0 );
-
- // HACK, solange Hyperlink nicht funktioniert
- aProperty.bHasVisibleXButton = aProperty.bIsHyperLink;
-
- // Wert holen und in String wandeln
- UsrAny aVal = mxUnoAccess->getPropertyValueByIndex( maUnoObj, i );
- String aStrVal = AnyToString( aVal );
-
- // Properties reinbraten
- aProperty.eKind = KOC_EDIT;
- aProperty.aName = rProp.Name;
- aProperty.aValue = aStrVal;
- aProperty.pDataPtr = (void*)i;
- aProperty.pControl = NULL;
- //aProperty.theValues.Insert(new String("1"),aProperty.theValues.Count());
- //aProperty.theValues.Insert(new String("2"),aProperty.theValues.Count());
- //aProperty.theValues.Insert(new String("3"),aProperty.theValues.Count());
- //aProperty.theValues.Insert(new String("4"),aProperty.theValues.Count());
- mpPropBox->InsertEntry( aProperty );
- }
-
- // 2. Seite fuer Listener
- // TODO: Wo kommen die Eintraege her
- USHORT nListenerPageId = mpPropBox->AppendPage("Listener");
-
- XIdlClassSequence aSupportedListenerSeq = mxUnoAccess->getSupportedListeners();
- const XIdlClassRef* pListenerArray = aSupportedListenerSeq.getConstArray();
- UINT32 nIfaceCount = aSupportedListenerSeq.getLen();
-
- // Property-Data vorfuellen
- aProperty.eKind = KOC_EDIT;
- //aProperty.eKind = KOC_UNDEFINED;
- aProperty.aValue = "Listener-Value";
- aProperty.bHasVisibleXButton = TRUE;
- // TEST
- //aProperty.bIsHyperLink = TRUE;
- aProperty.bIsHyperLink = FALSE;
- aProperty.bIsLocked = TRUE;
- //aProperty.bIsLocked = FALSE;
- aProperty.pDataPtr = NULL;
- aProperty.pControl = NULL;
-
- for( UINT32 j = 0 ; j < nIfaceCount ; j++ )
- {
- const XIdlClassRef& rxIfaceClass = pListenerArray[j];
- aProperty.aName = rxIfaceClass->getName();
- mpPropBox->InsertEntry( aProperty );
- }
- mpPropBox->EnableUpdate();
- mpPropBox->SetPage( nPropPageId );
-}
-
-void PropertyEditorControler_Impl::Modified
-( const String& aName, const String& aVal, void* pData)
-{
-}
-
-void PropertyEditorControler_Impl::Clicked
-( const String& aName, const String& aVal, void* pData)
-{
- // HACK, solange LinkClicked nicht funktioniert
- UINT32 iPos = (UINT32)pData;
- UINT32 nPropCount = mPropSeq.getLen();
- if( iPos >= nPropCount )
- {
- // Spezial-IDs fuer forward/back?
- BOOL bForward = (iPos == 1000000);
- BOOL bBack = (iPos == 1000001);
- if( bForward || bBack )
- {
- // Unterstuetzt der PropertyEditor das?
- XPropertyEditorNavigationRef xPropEdNav = (XPropertyEditorNavigation*)
- mxEditor->queryInterface( XPropertyEditorNavigation::getSmartUik() );
- if( xPropEdNav.is() )
- {
- if( bForward )
- xPropEdNav->forward();
- else
- xPropEdNav->back();
- }
- }
- return;
- }
-
- const Property* pProps = mPropSeq.getConstArray();
- const Property& rProp = pProps[ iPos ];
- XIdlClassRef xPropClass = rProp.Type;
- if( !xPropClass.is() )
- {
- OSL_FAIL( "PropertyEditorControler_Impl::Commit(), Property without type" )
- return;
- }
- TypeClass eType = xPropClass->getTypeClass();
- if( eType == TYPECLASS_INTERFACE || eType == TYPECLASS_STRUCT )
- LinkClicked( aName, pData );
-}
-
-void PropertyEditorControler_Impl::Commit
-( const String& aName, const String& aVal, void* pData)
-{
- UINT32 iPos = (UINT32)pData;
- UINT32 nPropCount = mPropSeq.getLen();
- if( iPos >= nPropCount )
- return;
-
- // String in Property-Typ wandeln
- const Property* pProps = mPropSeq.getConstArray();
- const Property& rProp = pProps[ iPos ];
- XIdlClassRef xPropClass = rProp.Type;
- if( !xPropClass.is() )
- {
- OSL_FAIL( "PropertyEditorControler_Impl::Commit(), Property without type" )
- return;
- }
- TypeClass eType = xPropClass->getTypeClass();
- UsrAny aValue = StringToAny( aVal, eType );
-
- // Wert setzen
- mxUnoAccess->setPropertyValueByIndex( maUnoObj, iPos, aValue );
-
- // Wert neu holen und ggf. neu setzen
- UsrAny aNewVal = mxUnoAccess->getPropertyValueByIndex( maUnoObj, iPos );
- String aNewStrVal = AnyToString( aNewVal );
- if( aNewStrVal != aVal )
- mpPropBox->SetPropertyValue( aName, aNewStrVal );
-}
-
-void PropertyEditorControler_Impl::Select
-( const String& aName, void* pData)
-{
-}
-
-void PropertyEditorControler_Impl::LinkClicked(const String& aName, void* pData)
-{
- UINT32 iPos = (UINT32)pData;
- UINT32 nPropCount = mPropSeq.getLen();
- if( iPos >= nPropCount )
- return;
-
- // Wert holen und an Master-Controller zurueckgeben
- UsrAny aNewObj = mxUnoAccess->getPropertyValueByIndex( maUnoObj, iPos );
- mxEditor->setObject( aNewObj, aName );
-}
-
-
-// TODO: Das muss raus, sehr unglueckliche Schnittstelle
-// PropertyBox erzwingt Zustand des Controllers
-String PropertyEditorControler_Impl::GetTheCorrectProperty() const
-{
- return String();
-}
-
-
-SMART_UNO_IMPLEMENTATION(SimplePropertyEditor_Impl,UsrObject);
-
-// Methoden von XInterface
-XInterface * SimplePropertyEditor_Impl::queryInterface( Uik aUik )
-{
- if( aUik == XPropertyEditor::getSmartUik() )
- return (XPropertyEditor *)this;
- if( aUik == XPropertyEditorNavigation::getSmartUik() )
- return (XPropertyEditorNavigation *)this;
- return UsrObject::queryInterface( aUik );
-}
-
-XIdlClassRef SimplePropertyEditor_Impl::getIdlClass()
-{
- // TODO: Unterstuetzen
- return NULL;
-}
-
-
-// Methoden von SimplePropertyEditor_Impl
-SimplePropertyEditor_Impl::SimplePropertyEditor_Impl( Window *pParent )
- : maHistorySeq( 10 ), maHistoryNames( 10 ), bSimpleHistory( FALSE )
-{
- //XVCLComponent xC = pParent->getVCLComponent
- //xC->addVCLComponentListener( MyListener )
-
- pActiveControler = NULL;
- mpPropBox = new SvPropertyBox( pParent );
- mpPropBox->Show();
-
- long cxOut = pParent->GetOutputSizePixel().Width();
- long cyOut = pParent->GetOutputSizePixel().Height();
- Size aSize( cxOut, cyOut );
- mpPropBox->SetPosSizePixel( Point( 0, 0 ), aSize );
-
- mnHistoryCount = 0;
- mnActualHistoryLevel = -1;
-}
-
-SimplePropertyEditor_Impl::~SimplePropertyEditor_Impl()
-{
- delete mpPropBox;
- if( pActiveControler )
- delete pActiveControler;
-}
-
-// Private Methode zum Anlegen/Aktivieren der Controller
-void SimplePropertyEditor_Impl::showObject( const UsrAny& aToShowObj )
-{
- if( pActiveControler )
- delete pActiveControler;
-
- // Neuen Controller auf der Wiese anlegen (TODO: Controller cachen?)
- pActiveControler = new PropertyEditorControler_Impl( mpPropBox );
-
- XPropertyEditorRef xThis = (XPropertyEditor *)this;
- pActiveControler->setObject( xThis, aToShowObj,
- /*aPath*/bSimpleHistory ? getPath() : String(),
- /*bBack*/bSimpleHistory && mnActualHistoryLevel > 0,
- /*bForward*/bSimpleHistory && (INT32)mnHistoryCount > mnActualHistoryLevel );
-}
-
-String SimplePropertyEditor_Impl::getPath( void )
-{
- String aRetStr;
- const String* pStr = maHistoryNames.getConstArray();
- for( INT32 i = 0 ; i <= mnActualHistoryLevel ; i++ )
- {
- String aName = pStr[i];
-
- // Root speziell behandeln
- if( i == 0 )
- {
- aRetStr += aName;
- }
- else
- {
- // Ist es ein Index?
- long l = (long)aName;
- String aNumStr( l );
- if( aNumStr == aName )
- {
- aRetStr += '[';
- aRetStr += aName;
- aRetStr += ']';
- }
- else
- {
- aRetStr += '.';
- aRetStr += aName;
- }
- }
- }
- return aRetStr;
-}
-
-// Methoden von XPropertyEditor
-void SimplePropertyEditor_Impl::setObject( const UsrAny& aToEditObj, const XubString& aObjName )
-{
- // History pflegen
- mnActualHistoryLevel++;
- mnHistoryCount = (UINT32)mnActualHistoryLevel;
- UINT32 iHistorySize = maHistorySeq.getLen();
- if( mnHistoryCount > iHistorySize )
- {
- maHistorySeq.realloc( iHistorySize + 10 );
- maHistoryNames.realloc( iHistorySize + 10 );
- }
-
- // Neues Object eintragen
- maHistorySeq.getArray()[ mnHistoryCount ] = aToEditObj;
- maHistoryNames.getArray()[ mnHistoryCount ] = aObjName;
-
- // Object anzeigen
- showObject( aToEditObj );
-}
-
-// Methoden von PropertyEditorNavigation
-void SimplePropertyEditor_Impl::forward(void)
-{
- if( (INT32)mnHistoryCount > mnActualHistoryLevel )
- {
- // Naechstes Object darstellen
- mnActualHistoryLevel++;
- showObject( maHistorySeq.getConstArray()[mnActualHistoryLevel] );
- }
-}
-
-void SimplePropertyEditor_Impl::back(void)
-{
- if( mnActualHistoryLevel > 0 )
- {
- // Voriges Object darstellen
- mnActualHistoryLevel--;
- showObject( maHistorySeq.getConstArray()[mnActualHistoryLevel] );
- }
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/dialogs/propctrl.hxx b/svtools/source/dialogs/propctrl.hxx
deleted file mode 100644
index bc93914af014..000000000000
--- a/svtools/source/dialogs/propctrl.hxx
+++ /dev/null
@@ -1,109 +0,0 @@
-/* -*- 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 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.
- *
- ************************************************************************/
-
-/*
-#include <tools/stream.hxx>
-#include <vcl/sound.hxx>
-#include "sbx.hxx"
-#include "sbxbase.hxx"
-#include "sbxres.hxx"
-#include <svl/brdcst.hxx>
- */
-
-
-#include <proped.hxx>
-#include <usr/uno.hxx>
-#include <usr/sequ.hxx>
-#include <usr/toolsidl.hxx>
-
-/*
-class XPropertyEditor
- : public XInterface
-{
-public:
-
- virtual void setObject(const UsrAny& aToInspectObj) = 0;
-
- static Uik getSmartUik() { return(385); }
-};
-*/
-
-class PropertyEditorControler_Impl;
-class SvPropertyBox;
-class Window;
-
-class SimplePropertyEditor_Impl :
- public XPropertyEditor,
- public XPropertyEditorNavigation,
- public UsrObject
-{
- PropertyEditorControler_Impl* pActiveControler;
- SvPropertyBox* mpPropBox;
- UsrAny maStartUnoObj;
- UsrAny maActiveUnoObj;
-
- // History der Objekte speichern
- AnySequence maHistorySeq;
- WSStringSequence maHistoryNames;
- UINT32 mnHistoryCount;
- INT32 mnActualHistoryLevel;
-
- // Einfache History via Dummy-Properties
- BOOL bSimpleHistory;
-
- // Methode zum Anlegen/Aktivieren der Controller
- void showObject( const UsrAny& aToShowObj );
- String getPath( void );
-
-public:
- // Provisorischer Ctor mit Parent-Window
- SimplePropertyEditor_Impl( Window *pParent );
- ~SimplePropertyEditor_Impl();
-
- // HACK fuer History-Test
- void enableSimpleHistory( BOOL bHistory_ ) { bSimpleHistory = bHistory_; }
-
- SMART_UNO_DECLARATION(ImplIntrospection,UsrObject);
-
- // Methoden von XInterface
- XInterface * queryInterface( Uik aUik );
- XIdlClassRef getIdlClass();
-
- // Methoden von XPropertyEditor
- virtual void setObject(const UsrAny& aToInspectObj, const XubString& aObjName);
-
- // Methoden von PropertyEditorNavigation
- virtual void forward(void);
- virtual void back(void);
-
-};
-
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/dialogs/property.cxx b/svtools/source/dialogs/property.cxx
index 61ce869cacec..7bc07c88a6e6 100644
--- a/svtools/source/dialogs/property.cxx
+++ b/svtools/source/dialogs/property.cxx
@@ -98,7 +98,7 @@ void SvXPropertyEdit::SetCtrSize(const Size& rSize)
aEdit.SetSizePixel(aSize);
}
-void SvXPropertyEdit::SetLocked(BOOL bLocked)
+void SvXPropertyEdit::SetLocked(sal_Bool bLocked)
{
if(bLocked)
Disable();
@@ -116,9 +116,9 @@ String SvXPropertyEdit::GetProperty() const
return aEdit.GetText();
}
-BOOL SvXPropertyEdit::HasList()
+sal_Bool SvXPropertyEdit::HasList()
{
- return FALSE;
+ return sal_False;
};
@@ -126,7 +126,7 @@ void SvXPropertyEdit::ClearList()
{
return;
}
-void SvXPropertyEdit::InsertEntry( const String&,USHORT )
+void SvXPropertyEdit::InsertEntry( const String&,sal_uInt16 )
{
return;
}
@@ -226,7 +226,7 @@ void SvXPropertyListBox::SetCtrSize(const Size& rSize)
aListBox.SetSizePixel(aSize);
}
-void SvXPropertyListBox::SetLocked(BOOL bLocked)
+void SvXPropertyListBox::SetLocked(sal_Bool bLocked)
{
if(bLocked)
Disable();
@@ -244,9 +244,9 @@ String SvXPropertyListBox::GetProperty()const
return aListBox.GetSelectEntry();
}
-BOOL SvXPropertyListBox::HasList()
+sal_Bool SvXPropertyListBox::HasList()
{
- return TRUE;
+ return sal_True;
}
@@ -255,7 +255,7 @@ void SvXPropertyListBox::ClearList()
aListBox.Clear();
}
-void SvXPropertyListBox::InsertEntry( const String& rString,USHORT nPos)
+void SvXPropertyListBox::InsertEntry( const String& rString,sal_uInt16 nPos)
{
aListBox.InsertEntry(rString,nPos);
}
@@ -335,7 +335,7 @@ SvXPropertyComboBox::SvXPropertyComboBox( Window* pParent, const ResId& rResId)
aComboBox.Show();
}
-void SvXPropertyComboBox::SetLocked(BOOL bLocked)
+void SvXPropertyComboBox::SetLocked(sal_Bool bLocked)
{
if(bLocked)
Disable();
@@ -374,9 +374,9 @@ String SvXPropertyComboBox::GetProperty() const
return aComboBox.GetText();
}
-BOOL SvXPropertyComboBox::HasList()
+sal_Bool SvXPropertyComboBox::HasList()
{
- return TRUE;
+ return sal_True;
}
void SvXPropertyComboBox::ClearList()
@@ -384,7 +384,7 @@ void SvXPropertyComboBox::ClearList()
aComboBox.Clear();
}
-void SvXPropertyComboBox::InsertEntry( const String& rString,USHORT nPos)
+void SvXPropertyComboBox::InsertEntry( const String& rString,sal_uInt16 nPos)
{
aComboBox.InsertEntry(rString,nPos);
}
@@ -436,11 +436,11 @@ SvPropertyLine::SvPropertyLine( Window* pParent,WinBits nWinStyle)
aName(this,WB_BORDER),
pSvXPropertyControl(NULL),
aXButton(this,WB_BORDER),
- bIsLocked(FALSE),
- bIsHyperlink(FALSE)
+ bIsLocked(sal_False),
+ bIsHyperlink(sal_False)
{
- bNeedsRepaint = TRUE;
- bHasXButton = FALSE;
+ bNeedsRepaint = sal_True;
+ bHasXButton = sal_False;
aXButton.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "..." ) ) );
aName.Show();
aXButton.Show();
@@ -455,11 +455,11 @@ SvPropertyLine::SvPropertyLine( Window* pParent,const ResId& rResId )
aName (this,WB_BORDER),
pSvXPropertyControl(NULL),
aXButton (this,WB_BORDER),
- bIsLocked(FALSE),
- bIsHyperlink(FALSE)
+ bIsLocked(sal_False),
+ bIsHyperlink(sal_False)
{
- bNeedsRepaint = TRUE;
- bHasXButton = FALSE;
+ bNeedsRepaint = sal_True;
+ bHasXButton = sal_False;
eKindOfCtr = KOC_UNDEFINED;
aXButton.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "..." ) ) );
aName.Show();
@@ -494,11 +494,11 @@ void SvPropertyLine::Resize()
aName.SetPosPixel(aPos);
aName.SetSizePixel(aSize);
- USHORT nXButtonWidth=0;
+ sal_uInt16 nXButtonWidth=0;
if(bHasXButton)
{
- nXButtonWidth=(USHORT)aSize.Height();
+ nXButtonWidth=(sal_uInt16)aSize.Height();
}
a2Size.Width()=a2Size.Width()-nXButtonWidth;
@@ -520,12 +520,12 @@ void SvPropertyLine::Resize()
}
}
-void SvPropertyLine::SetNeedsRepaint(BOOL bFlag)
+void SvPropertyLine::SetNeedsRepaint(sal_Bool bFlag)
{
bNeedsRepaint=bFlag;
}
-BOOL SvPropertyLine::NeedsRepaint()
+sal_Bool SvPropertyLine::NeedsRepaint()
{
return bNeedsRepaint;
}
@@ -553,22 +553,22 @@ eKindOfControl SvPropertyLine::GetKindOfControl()
void SvPropertyLine::ShowXButton()
{
- bHasXButton=TRUE;
+ bHasXButton=sal_True;
aXButton.Show();
Resize();
}
void SvPropertyLine::HideXButton()
{
- bHasXButton=FALSE;
+ bHasXButton=sal_False;
aXButton.Hide();
Resize();
}
-BOOL SvPropertyLine::IsVisibleXButton()
+sal_Bool SvPropertyLine::IsVisibleXButton()
{
return bHasXButton;
}
-void SvPropertyLine::ShowAsHyperLink(BOOL nFlag)
+void SvPropertyLine::ShowAsHyperLink(sal_Bool nFlag)
{
bIsHyperlink=nFlag;
if(nFlag)
@@ -585,24 +585,24 @@ void SvPropertyLine::ShowAsHyperLink(BOOL nFlag)
}
}
-BOOL SvPropertyLine::IsShownAsHyperlink()
+sal_Bool SvPropertyLine::IsShownAsHyperlink()
{
return bIsHyperlink;
}
-void SvPropertyLine::Locked(BOOL nFlag)
+void SvPropertyLine::Locked(sal_Bool nFlag)
{
bIsLocked=nFlag;
if(pSvXPropertyControl!=NULL)
pSvXPropertyControl->SetLocked(nFlag);
}
-BOOL SvPropertyLine::IsLineLocked()
+sal_Bool SvPropertyLine::IsLineLocked()
{
return bIsLocked;
}
-void SvPropertyLine::SetNameWidth(USHORT nWidth)
+void SvPropertyLine::SetNameWidth(sal_uInt16 nWidth)
{
nNameWidth=nWidth;
Resize();
@@ -677,7 +677,7 @@ SvListBoxForProperties::SvListBoxForProperties( Window* pParent, WinBits nWinSty
nTheNameSize=0;
ListBox aListBox(this,WB_DROPDOWN);
aListBox.SetPosSizePixel(Point(0,0),Size(100,100));
- nRowHeight=(USHORT)aListBox.GetSizePixel().Height();
+ nRowHeight=(sal_uInt16)aListBox.GetSizePixel().Height();
Wallpaper aWall = aPlayGround.GetBackground();
aWall.SetColor( Color( COL_TRANSPARENT ) );
aPlayGround.SetBackground( aWall );
@@ -699,7 +699,7 @@ SvListBoxForProperties::SvListBoxForProperties( Window* pParent, const ResId& rR
nYOffset=0;
ListBox aListBox(this,WB_DROPDOWN);
aListBox.SetPosSizePixel(Point(0,0),Size(100,100));
- nRowHeight=(USHORT)aListBox.GetSizePixel().Height();
+ nRowHeight=(sal_uInt16)aListBox.GetSizePixel().Height();
Wallpaper aWall = aPlayGround.GetBackground();
aWall.SetColor( Color( COL_TRANSPARENT ) );
aPlayGround.SetBackground( aWall );
@@ -717,7 +717,7 @@ SvListBoxForProperties::~SvListBoxForProperties()
void SvListBoxForProperties::Clear()
{
- for(USHORT i=0;i<PLineArray.Count();i++)
+ for(sal_uInt16 i=0;i<PLineArray.Count();i++)
{
SvPropertyLine* pPropLine=PLineArray[i];
@@ -763,19 +763,19 @@ void SvListBoxForProperties::SetController( SvPropertyDataControl *pPDC)
pPropDataControl=pPDC;
}
-USHORT SvListBoxForProperties::CalcVisibleLines()
+sal_uInt16 SvListBoxForProperties::CalcVisibleLines()
{
Size aSize=aPlayGround.GetOutputSizePixel();
- USHORT nResult=0;
+ sal_uInt16 nResult=0;
if(nRowHeight!=0)
- nResult=(USHORT) aSize.Height()/nRowHeight;
+ nResult=(sal_uInt16) aSize.Height()/nRowHeight;
return nResult;
}
void SvListBoxForProperties::UpdateVScroll()
{
- USHORT nLines=CalcVisibleLines();
+ sal_uInt16 nLines=CalcVisibleLines();
aVScroll.SetPageSize(nLines-1);
aVScroll.SetVisibleSize(nLines-1);
aVScroll.SetRange(Range(0,PLineArray.Count()-1));
@@ -785,7 +785,7 @@ void SvListBoxForProperties::UpdateVScroll()
}
else
{
- BOOL bFlag=aVScroll.IsVisible();
+ sal_Bool bFlag=aVScroll.IsVisible();
aVScroll.Show();
if(!bFlag)Resize();
}
@@ -797,7 +797,7 @@ void SvListBoxForProperties::UpdatePosNSize()
{
Point aPos(0,nYOffset);
- for(USHORT i=0; i<PLineArray.Count();i++)
+ for(sal_uInt16 i=0; i<PLineArray.Count();i++)
{
if((PLineArray[i])->NeedsRepaint())
{
@@ -809,7 +809,7 @@ void SvListBoxForProperties::UpdatePosNSize()
(PLineArray[i])->Invalidate();
(PLineArray[i])->Update();
(PLineArray[i])->Show();
- (PLineArray[i])->SetNeedsRepaint(FALSE);
+ (PLineArray[i])->SetNeedsRepaint(sal_False);
}
else
{
@@ -836,21 +836,21 @@ void SvListBoxForProperties::UpdatePlayGround()
long nLines=aVScroll.GetPageSize();
long nDelta=aVScroll.GetDelta();
- USHORT nStart,nEnd;
+ sal_uInt16 nStart,nEnd;
Size aSize=aPlayGround.GetOutputSizePixel();
Point aPEnd;
aPEnd.X()=aSize.Width();
if(nDelta>0)
{
- nStart=(USHORT)(nThumbPos+nLines+1-nDelta);
- nEnd=(USHORT)(nThumbPos+nLines);
+ nStart=(sal_uInt16)(nThumbPos+nLines+1-nDelta);
+ nEnd=(sal_uInt16)(nThumbPos+nLines);
aPos.Y()=(nLines+1-nDelta)*nRowHeight;
}
else
{
- nStart=(USHORT)nThumbPos;
- nEnd=(USHORT)(nThumbPos-nDelta);
+ nStart=(sal_uInt16)nThumbPos;
+ nEnd=(sal_uInt16)(nThumbPos-nDelta);
aPEnd.Y()=(nThumbPos-nDelta)*nRowHeight;;
}
@@ -860,7 +860,7 @@ void SvListBoxForProperties::UpdatePlayGround()
aPlayGround.Scroll(0,nDelta,SCROLL_CHILDREN);
- for(USHORT i=nStart; i<=nEnd;i++)
+ for(sal_uInt16 i=nStart; i<=nEnd;i++)
{
(PLineArray[i])->SetPosSizePixel(aPos,aSize);
(PLineArray[i])->SetNameWidth(nTheNameSize+2*FRAME_OFFSET);
@@ -879,18 +879,18 @@ void SvListBoxForProperties::UpdateAll()
void SvListBoxForProperties::DisableUpdate()
{
- bUpdate=FALSE;
+ bUpdate=sal_False;
}
void SvListBoxForProperties::EnableUpdate()
{
- bUpdate=TRUE;
+ bUpdate=sal_True;
UpdateAll();
}
void SvListBoxForProperties::SetPropertyValue( const String & rEntryName, const String & rValue )
{
- USHORT i, iEnd = PLineArray.Count();
+ sal_uInt16 i, iEnd = PLineArray.Count();
for( i = 0 ; i < iEnd ; i++ )
{
SvPropertyLine* pPropLine = PLineArray[ i ];
@@ -902,14 +902,14 @@ void SvListBoxForProperties::SetPropertyValue( const String & rEntryName, const
}
}
-USHORT SvListBoxForProperties::AppendEntry( const SvPropertyData& aPropData)
+sal_uInt16 SvListBoxForProperties::AppendEntry( const SvPropertyData& aPropData)
{
return InsertEntry(aPropData);
}
-USHORT SvListBoxForProperties::InsertEntry( const SvPropertyData& aPropData, USHORT nPos)
+sal_uInt16 SvListBoxForProperties::InsertEntry( const SvPropertyData& aPropData, sal_uInt16 nPos)
{
- USHORT nInsPos=nPos;
+ sal_uInt16 nInsPos=nPos;
SvPropertyLine* pPropLine=new SvPropertyLine(&aPlayGround,WB_TABSTOP | WB_DIALOGCONTROL);
if(nPos==LISTBOX_APPEND)
@@ -928,7 +928,7 @@ USHORT SvListBoxForProperties::InsertEntry( const SvPropertyData& aPropData, USH
return nInsPos;
}
-void SvListBoxForProperties::ChangeEntry( const SvPropertyData& aPropData, USHORT nPos)
+void SvListBoxForProperties::ChangeEntry( const SvPropertyData& aPropData, sal_uInt16 nPos)
{
if(nPos<PLineArray.Count())
{
@@ -983,7 +983,7 @@ void SvListBoxForProperties::ChangeEntry( const SvPropertyData& aPropData, USHOR
if(pSvXPCtr->HasList())
{
- for(USHORT i=0;i<aPropData.theValues.Count();i++)
+ for(sal_uInt16 i=0;i<aPropData.theValues.Count();i++)
{
pSvXPCtr->InsertEntry(*(aPropData.theValues[i]));
}
@@ -992,7 +992,7 @@ void SvListBoxForProperties::ChangeEntry( const SvPropertyData& aPropData, USHOR
pPropLine->SetName(aPropData.aName);
- USHORT nTextWidth=(USHORT)aPlayGround.GetTextWidth(aPropData.aName);
+ sal_uInt16 nTextWidth=(sal_uInt16)aPlayGround.GetTextWidth(aPropData.aName);
if ( nTheNameSize < nTextWidth )
nTheNameSize = nTextWidth;
@@ -1012,21 +1012,21 @@ void SvListBoxForProperties::ChangeEntry( const SvPropertyData& aPropData, USHOR
}
}
-USHORT SvListBoxForProperties::GetFirstVisibleEntry()
+sal_uInt16 SvListBoxForProperties::GetFirstVisibleEntry()
{
return 0;
}
-void SvListBoxForProperties::SetFirstVisibleEntry(USHORT)
+void SvListBoxForProperties::SetFirstVisibleEntry(sal_uInt16)
{
return;
}
-void SvListBoxForProperties::SetSelectedEntry(USHORT)
+void SvListBoxForProperties::SetSelectedEntry(sal_uInt16)
{
return;
}
-USHORT SvListBoxForProperties::GetSelectedEntry()
+sal_uInt16 SvListBoxForProperties::GetSelectedEntry()
{
return 0;
}
@@ -1037,7 +1037,7 @@ IMPL_LINK( SvListBoxForProperties, ScrollHdl, ScrollBar*, pSB )
{
long nDelta=aVScroll.GetDelta();
nYOffset=-aVScroll.GetThumbPos()*nRowHeight;
- //aPlayGround.SetUpdateMode(FALSE);
+ //aPlayGround.SetUpdateMode(sal_False);
long nThumbPos=aVScroll.GetThumbPos();
long nLines=aVScroll.GetPageSize();
@@ -1048,14 +1048,14 @@ IMPL_LINK( SvListBoxForProperties, ScrollHdl, ScrollBar*, pSB )
{
if(i>=nThumbPos && i<=nThumbPos+nLines)
{
- (PLineArray[sal::static_int_cast< USHORT >(i)])->
- SetNeedsRepaint(TRUE);
+ (PLineArray[sal::static_int_cast< sal_uInt16 >(i)])->
+ SetNeedsRepaint(sal_True);
}
else
{
- (PLineArray[sal::static_int_cast< USHORT >(i)])->Hide();
- (PLineArray[sal::static_int_cast< USHORT >(i)])->
- SetNeedsRepaint(FALSE);
+ (PLineArray[sal::static_int_cast< sal_uInt16 >(i)])->Hide();
+ (PLineArray[sal::static_int_cast< sal_uInt16 >(i)])->
+ SetNeedsRepaint(sal_False);
}
}
}
@@ -1176,9 +1176,9 @@ SvPropertyBox::~SvPropertyBox()
void SvPropertyBox::ClearAll()
{
- USHORT nCount=aTabControl.GetPageCount();
+ sal_uInt16 nCount=aTabControl.GetPageCount();
- for(USHORT i=nCount;i>=1;i--)
+ for(sal_uInt16 i=nCount;i>=1;i--)
{
SvTabPageForProperties* pPage=(SvTabPageForProperties*)
aTabControl.GetTabPage(i);
@@ -1197,10 +1197,10 @@ void SvPropertyBox::Resize()
aTabControl.SetPosSizePixel(aPos,aSize);
- USHORT nCount=aTabControl.GetPageCount();
+ sal_uInt16 nCount=aTabControl.GetPageCount();
aSize=aTabControl.GetTabPageSizePixel();
- for(USHORT i=1;i<=nCount;i++)
+ for(sal_uInt16 i=1;i<=nCount;i++)
{
SvTabPageForProperties* pPage=(SvTabPageForProperties*)
aTabControl.GetTabPage(i);
@@ -1210,9 +1210,9 @@ void SvPropertyBox::Resize()
}
-USHORT SvPropertyBox::AppendPage( const String & rText )
+sal_uInt16 SvPropertyBox::AppendPage( const String & rText )
{
- USHORT nId=aTabControl.GetPageCount()+1;
+ sal_uInt16 nId=aTabControl.GetPageCount()+1;
aTabControl.InsertPage( nId,rText);
SvTabPageForProperties* pPage=new SvTabPageForProperties(&aTabControl);
pPage->SetSizePixel(aTabControl.GetTabPageSizePixel());
@@ -1222,17 +1222,17 @@ USHORT SvPropertyBox::AppendPage( const String & rText )
return nId;
}
-void SvPropertyBox::SetPage( USHORT nId)
+void SvPropertyBox::SetPage( sal_uInt16 nId)
{
aTabControl.SetCurPageId(nId);
}
-USHORT SvPropertyBox::GetCurPage()
+sal_uInt16 SvPropertyBox::GetCurPage()
{
return aTabControl.GetCurPageId();
}
-USHORT SvPropertyBox::CalcVisibleLines()
+sal_uInt16 SvPropertyBox::CalcVisibleLines()
{
SvTabPageForProperties* pPage=(SvTabPageForProperties*)
aTabControl.GetTabPage(aTabControl.GetCurPageId());
@@ -1255,9 +1255,9 @@ void SvPropertyBox::DisableUpdate()
void SvPropertyBox::SetController(SvPropertyDataControl *pDataCtr)
{
pThePropDataCtr=pDataCtr;
- USHORT nCount=aTabControl.GetPageCount();
+ sal_uInt16 nCount=aTabControl.GetPageCount();
- for(USHORT i=1;i<=nCount;i++)
+ for(sal_uInt16 i=1;i<=nCount;i++)
{
SvTabPageForProperties* pPage=(SvTabPageForProperties*)
aTabControl.GetTabPage(i);
@@ -1267,21 +1267,21 @@ void SvPropertyBox::SetController(SvPropertyDataControl *pDataCtr)
}
-USHORT SvPropertyBox::InsertEntry( const SvPropertyData& rData, USHORT nPos)
+sal_uInt16 SvPropertyBox::InsertEntry( const SvPropertyData& rData, sal_uInt16 nPos)
{
SvTabPageForProperties* pPage=(SvTabPageForProperties*)
aTabControl.GetTabPage(aTabControl.GetCurPageId());
return pPage->GetTheListBox()->InsertEntry(rData,nPos);
}
-void SvPropertyBox::ChangeEntry( const SvPropertyData& rData, USHORT nPos)
+void SvPropertyBox::ChangeEntry( const SvPropertyData& rData, sal_uInt16 nPos)
{
SvTabPageForProperties* pPage=(SvTabPageForProperties*)
aTabControl.GetTabPage(aTabControl.GetCurPageId());
pPage->GetTheListBox()->ChangeEntry(rData,nPos);
}
-USHORT SvPropertyBox::AppendEntry( const SvPropertyData& rData)
+sal_uInt16 SvPropertyBox::AppendEntry( const SvPropertyData& rData)
{
SvTabPageForProperties* pPage=(SvTabPageForProperties*)
aTabControl.GetTabPage(aTabControl.GetCurPageId());
@@ -1295,26 +1295,26 @@ void SvPropertyBox::SetPropertyValue( const String & rEntryName, const String &
pPage->GetTheListBox()->SetPropertyValue( rEntryName, rValue );
}
-void SvPropertyBox::SetFirstVisibleEntry(USHORT nPos)
+void SvPropertyBox::SetFirstVisibleEntry(sal_uInt16 nPos)
{
SvTabPageForProperties* pPage=(SvTabPageForProperties*)
aTabControl.GetTabPage(aTabControl.GetCurPageId());
pPage->GetTheListBox()->SetFirstVisibleEntry(nPos);
}
-USHORT SvPropertyBox::GetFirstVisibleEntry()
+sal_uInt16 SvPropertyBox::GetFirstVisibleEntry()
{
SvTabPageForProperties* pPage=(SvTabPageForProperties*)
aTabControl.GetTabPage(aTabControl.GetCurPageId());
return pPage->GetTheListBox()->GetFirstVisibleEntry();
}
-void SvPropertyBox::SetSelectedEntry(USHORT nPos)
+void SvPropertyBox::SetSelectedEntry(sal_uInt16 nPos)
{
SvTabPageForProperties* pPage=(SvTabPageForProperties*)
aTabControl.GetTabPage(aTabControl.GetCurPageId());
pPage->GetTheListBox()->SetSelectedEntry(nPos);
}
-USHORT SvPropertyBox::GetSelectedEntry()
+sal_uInt16 SvPropertyBox::GetSelectedEntry()
{
SvTabPageForProperties* pPage=(SvTabPageForProperties*)
aTabControl.GetTabPage(aTabControl.GetCurPageId());
@@ -1401,7 +1401,7 @@ void SvBasicPropertyDataControl::SetTheCorrectProperty(const String& aString)
aCorrectProperty=aString;
}
-void SvBasicPropertyDataControl::SetIsCorrect(BOOL nFlag)
+void SvBasicPropertyDataControl::SetIsCorrect(sal_Bool nFlag)
{
bCorrectness=nFlag;
}
diff --git a/svtools/source/dialogs/roadmapwizard.cxx b/svtools/source/dialogs/roadmapwizard.cxx
index 056e16d07e7b..db6e4434c980 100644
--- a/svtools/source/dialogs/roadmapwizard.cxx
+++ b/svtools/source/dialogs/roadmapwizard.cxx
@@ -32,7 +32,7 @@
#include <svtools/roadmapwizard.hxx>
#include <svtools/svtools.hrc>
#include <svtools/svtdata.hxx>
-#include "roadmap.hxx"
+#include <svtools/roadmap.hxx>
#include <tools/debug.hxx>
#include <stdarg.h>
@@ -240,15 +240,15 @@ namespace svt
}
//--------------------------------------------------------------------
- void RoadmapWizard::SetRoadmapSmartHelpId( const SmartId& _rId, SmartIdUpdateMode _aMode )
+ void RoadmapWizard::SetRoadmapHelpId( const rtl::OString& _rId )
{
- m_pImpl->pRoadmap->SetSmartHelpId( _rId, _aMode );
+ m_pImpl->pRoadmap->SetHelpId( _rId );
}
//--------------------------------------------------------------------
- SmartId RoadmapWizard::GetRoadmapSmartHelpId() const
+ const rtl::OString& RoadmapWizard::GetRoadmapHelpId() const
{
- return m_pImpl->pRoadmap->GetSmartHelpId();
+ return m_pImpl->pRoadmap->GetHelpId();
}
//--------------------------------------------------------------------
diff --git a/svtools/source/dialogs/so3res.src b/svtools/source/dialogs/so3res.src
index 5fb5ad49a076..3b2aab346584 100644
--- a/svtools/source/dialogs/so3res.src
+++ b/svtools/source/dialogs/so3res.src
@@ -25,10 +25,11 @@
*
************************************************************************/
-#include "sores.hxx"
+#include "svtools/sores.hxx"
#define __RSC
-#include "soerr.hxx"
+#include <svtools/soerr.hxx>
#define S_MAX 0x7fff
+
Resource RID_SO_ERROR_HANDLER
{
String ERRCODE_SO_GENERALERROR&S_MAX
diff --git a/svtools/source/dialogs/wizardmachine.cxx b/svtools/source/dialogs/wizardmachine.cxx
index d652a1a8a294..f4e024b65cc1 100644
--- a/svtools/source/dialogs/wizardmachine.cxx
+++ b/svtools/source/dialogs/wizardmachine.cxx
@@ -196,7 +196,7 @@ namespace svt
if (_nButtonFlags & WZB_PREVIOUS)
{
m_pPrevPage = new PushButton(this, WB_TABSTOP);
- m_pPrevPage->SetSmartHelpId( SmartId(HID_WIZARD_PREVIOUS) );
+ m_pPrevPage->SetHelpId( HID_WIZARD_PREVIOUS );
m_pPrevPage->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
m_pPrevPage->SetText(String(SvtResId(STR_WIZDLG_PREVIOUS)));
m_pPrevPage->Show();
@@ -213,7 +213,7 @@ namespace svt
if (_nButtonFlags & WZB_NEXT)
{
m_pNextPage = new PushButton(this, WB_TABSTOP);
- m_pNextPage->SetSmartHelpId( SmartId(HID_WIZARD_NEXT) );
+ m_pNextPage->SetHelpId( HID_WIZARD_NEXT );
m_pNextPage->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
m_pNextPage->SetText(String(SvtResId(STR_WIZDLG_NEXT)));
m_pNextPage->Show();
diff --git a/svtools/source/dialogs/wizdlg.cxx b/svtools/source/dialogs/wizdlg.cxx
index de1e30d8f647..e7bb12989e4a 100644
--- a/svtools/source/dialogs/wizdlg.cxx
+++ b/svtools/source/dialogs/wizdlg.cxx
@@ -198,7 +198,7 @@ void WizardDialog::ImplPosCtrls()
long nViewWidth = 0;
long nViewHeight = 0;
long nDlgHeight = nOffY;
- USHORT nViewPosFlags = WINDOW_POSSIZE_POS;
+ sal_uInt16 nViewPosFlags = WINDOW_POSSIZE_POS;
if ( meViewAlign == WINDOWALIGN_TOP )
{
nViewOffX = WIZARDDIALOG_VIEW_DLGOFFSET_X;
@@ -333,9 +333,9 @@ void WizardDialog::ImplShowTabPage( TabPage* pTabPage )
// -----------------------------------------------------------------------
-TabPage* WizardDialog::ImplGetPage( USHORT nLevel ) const
+TabPage* WizardDialog::ImplGetPage( sal_uInt16 nLevel ) const
{
- USHORT nTempLevel = 0;
+ sal_uInt16 nTempLevel = 0;
ImplWizPageData* pPageData = mpFirstPage;
while ( pPageData )
{
@@ -442,7 +442,7 @@ long WizardDialog::Notify( NotifyEvent& rNEvt )
{
const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
KeyCode aKeyCode = pKEvt->GetKeyCode();
- USHORT nKeyCode = aKeyCode.GetCode();
+ sal_uInt16 nKeyCode = aKeyCode.GetCode();
if ( aKeyCode.IsMod1() )
{
@@ -453,11 +453,11 @@ long WizardDialog::Notify( NotifyEvent& rNEvt )
if ( mpPrevBtn->IsVisible() &&
mpPrevBtn->IsEnabled() && mpPrevBtn->IsInputEnabled() )
{
- mpPrevBtn->SetPressed( TRUE );
- mpPrevBtn->SetPressed( FALSE );
+ mpPrevBtn->SetPressed( sal_True );
+ mpPrevBtn->SetPressed( sal_False );
mpPrevBtn->Click();
}
- return TRUE;
+ return sal_True;
}
}
else
@@ -467,11 +467,11 @@ long WizardDialog::Notify( NotifyEvent& rNEvt )
if ( mpNextBtn->IsVisible() &&
mpNextBtn->IsEnabled() && mpNextBtn->IsInputEnabled() )
{
- mpNextBtn->SetPressed( TRUE );
- mpNextBtn->SetPressed( FALSE );
+ mpNextBtn->SetPressed( sal_True );
+ mpNextBtn->SetPressed( sal_False );
mpNextBtn->Click();
}
- return TRUE;
+ return sal_True;
}
}
}
@@ -494,43 +494,43 @@ long WizardDialog::DeactivatePage()
if ( maDeactivateHdl.IsSet() )
return maDeactivateHdl.Call( this );
else
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL WizardDialog::ShowNextPage()
+sal_Bool WizardDialog::ShowNextPage()
{
return ShowPage( mnCurLevel+1 );
}
// -----------------------------------------------------------------------
-BOOL WizardDialog::ShowPrevPage()
+sal_Bool WizardDialog::ShowPrevPage()
{
if ( !mnCurLevel )
- return FALSE;
+ return sal_False;
return ShowPage( mnCurLevel-1 );
}
// -----------------------------------------------------------------------
-BOOL WizardDialog::ShowPage( USHORT nLevel )
+sal_Bool WizardDialog::ShowPage( sal_uInt16 nLevel )
{
if ( DeactivatePage() )
{
mnCurLevel = nLevel;
ActivatePage();
ImplShowTabPage( ImplGetPage( mnCurLevel ) );
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL WizardDialog::Finnish( long nResult )
+sal_Bool WizardDialog::Finnish( long nResult )
{
if ( DeactivatePage() )
{
@@ -541,10 +541,10 @@ BOOL WizardDialog::Finnish( long nResult )
EndDialog( nResult );
else if ( GetStyle() & WB_CLOSEABLE )
Close();
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -595,9 +595,9 @@ void WizardDialog::RemovePage( TabPage* pPage )
// -----------------------------------------------------------------------
-void WizardDialog::SetPage( USHORT nLevel, TabPage* pPage )
+void WizardDialog::SetPage( sal_uInt16 nLevel, TabPage* pPage )
{
- USHORT nTempLevel = 0;
+ sal_uInt16 nTempLevel = 0;
ImplWizPageData* pPageData = mpFirstPage;
while ( pPageData )
{
@@ -618,9 +618,9 @@ void WizardDialog::SetPage( USHORT nLevel, TabPage* pPage )
// -----------------------------------------------------------------------
-TabPage* WizardDialog::GetPage( USHORT nLevel ) const
+TabPage* WizardDialog::GetPage( sal_uInt16 nLevel ) const
{
- USHORT nTempLevel = 0;
+ sal_uInt16 nTempLevel = 0;
ImplWizPageData* pPageData = mpFirstPage;
while ( pPageData )
{
@@ -681,7 +681,7 @@ void WizardDialog::RemoveButton( Button* pButton )
// -----------------------------------------------------------------------
-void WizardDialog::ShowButtonFixedLine( BOOL bVisible )
+void WizardDialog::ShowButtonFixedLine( sal_Bool bVisible )
{
if ( !mpFixedLine )
{
@@ -696,7 +696,7 @@ void WizardDialog::ShowButtonFixedLine( BOOL bVisible )
// -----------------------------------------------------------------------
-BOOL WizardDialog::IsButtonFixedLineVisible()
+sal_Bool WizardDialog::IsButtonFixedLineVisible()
{
return (mpFixedLine && mpFixedLine->IsVisible());
}
diff --git a/svtools/source/edit/editsyntaxhighlighter.cxx b/svtools/source/edit/editsyntaxhighlighter.cxx
index 14a737a99e60..bc81a96ea142 100644
--- a/svtools/source/edit/editsyntaxhighlighter.cxx
+++ b/svtools/source/edit/editsyntaxhighlighter.cxx
@@ -32,7 +32,7 @@
#include <svtools/svmedit.hxx>
#include <svtools/xtextedt.hxx>
#include <svtools/editsyntaxhighlighter.hxx>
-#include "../../inc/txtattr.hxx"
+#include <svtools/txtattr.hxx>
MultiLineEditSyntaxHighlight::MultiLineEditSyntaxHighlight( Window* pParent, WinBits nWinStyle,
@@ -69,12 +69,12 @@ void MultiLineEditSyntaxHighlight::SetText(const String& rNewText)
UpdateData();
}
-void MultiLineEditSyntaxHighlight::DoBracketHilight(USHORT aKey)
+void MultiLineEditSyntaxHighlight::DoBracketHilight(sal_uInt16 aKey)
{
TextSelection aCurrentPos = GetTextView()->GetSelection();
xub_StrLen aStartPos = aCurrentPos.GetStart().GetIndex();
- ULONG nStartPara = aCurrentPos.GetStart().GetPara();
- USHORT aCount = 0;
+ sal_uLong nStartPara = aCurrentPos.GetStart().GetPara();
+ sal_uInt16 aCount = 0;
int aChar = -1;
switch (aKey)
@@ -110,16 +110,16 @@ void MultiLineEditSyntaxHighlight::DoBracketHilight(USHORT aKey)
continue;
String aLine( GetTextEngine()->GetText( aPara ) );
- for (USHORT i = ((unsigned long)aPara==nStartPara) ? aStartPos-1 : (USHORT)(aLine.Len()-1); i>0; --i)
+ for (sal_uInt16 i = ((unsigned long)aPara==nStartPara) ? aStartPos-1 : (sal_uInt16)(aLine.Len()-1); i>0; --i)
{
if (aLine.GetChar(i)==aChar)
{
if (!aCount)
{
- GetTextEngine()->SetAttrib( TextAttribFontWeight( WEIGHT_ULTRABOLD ), aPara, i, i+1, TRUE );
- GetTextEngine()->SetAttrib( TextAttribFontColor( Color(0,0,0) ), aPara, i, i+1, TRUE );
- GetTextEngine()->SetAttrib( TextAttribFontWeight( WEIGHT_ULTRABOLD ), nStartPara, aStartPos, aStartPos, TRUE );
- GetTextEngine()->SetAttrib( TextAttribFontColor( Color(0,0,0) ), nStartPara, aStartPos, aStartPos, TRUE );
+ GetTextEngine()->SetAttrib( TextAttribFontWeight( WEIGHT_ULTRABOLD ), aPara, i, i+1, sal_True );
+ GetTextEngine()->SetAttrib( TextAttribFontColor( Color(0,0,0) ), aPara, i, i+1, sal_True );
+ GetTextEngine()->SetAttrib( TextAttribFontWeight( WEIGHT_ULTRABOLD ), nStartPara, aStartPos, aStartPos, sal_True );
+ GetTextEngine()->SetAttrib( TextAttribFontColor( Color(0,0,0) ), nStartPara, aStartPos, aStartPos, sal_True );
return;
}
else
@@ -185,19 +185,19 @@ void MultiLineEditSyntaxHighlight::UpdateData()
{
// syntax highlighting
// this must be possible improved by using notifychange correctly
- BOOL bTempModified = GetTextEngine()->IsModified();
+ sal_Bool bTempModified = GetTextEngine()->IsModified();
for (unsigned int nLine=0; nLine < GetTextEngine()->GetParagraphCount(); nLine++)
{
String aLine( GetTextEngine()->GetText( nLine ) );
aHighlighter.notifyChange( nLine, 0, &aLine, 1 );
- GetTextEngine()->RemoveAttribs( nLine, TRUE );
+ GetTextEngine()->RemoveAttribs( nLine, sal_True );
HighlightPortions aPortions;
aHighlighter.getHighlightPortions( nLine, aLine, aPortions );
- for ( USHORT i = 0; i < aPortions.Count(); i++ )
+ for ( size_t i = 0; i < aPortions.size(); i++ )
{
HighlightPortion& r = aPortions[i];
- GetTextEngine()->SetAttrib( TextAttribFontColor( GetColorValue(r.tokenType) ), nLine, r.nBegin, r.nEnd, TRUE );
+ GetTextEngine()->SetAttrib( TextAttribFontColor( GetColorValue(r.tokenType) ), nLine, r.nBegin, r.nEnd, sal_True );
}
}
GetTextView()->ShowCursor( false, true );
diff --git a/svtools/source/edit/makefile.mk b/svtools/source/edit/makefile.mk
deleted file mode 100644
index 9aacde1bfc73..000000000000
--- a/svtools/source/edit/makefile.mk
+++ /dev/null
@@ -1,71 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=edit
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/svmedit.obj \
- $(SLO)$/svmedit2.obj \
- $(SLO)$/sychconv.obj \
- $(SLO)$/syntaxhighlight.obj \
- $(SLO)$/textdata.obj \
- $(SLO)$/textdoc.obj \
- $(SLO)$/texteng.obj \
- $(SLO)$/textundo.obj \
- $(SLO)$/textview.obj \
- $(SLO)$/textwindowpeer.obj \
- $(SLO)$/txtattr.obj \
- $(SLO)$/xtextedt.obj \
- $(SLO)$/editsyntaxhighlighter.obj
-
-EXCEPTIONSFILES= \
- $(SLO)$/editsyntaxhighlighter.obj \
- $(SLO)$/svmedit.obj \
- $(SLO)$/svmedit2.obj \
- $(SLO)$/sychconv.obj \
- $(SLO)$/syntaxhighlight.obj \
- $(SLO)$/textdata.obj \
- $(SLO)$/textdoc.obj \
- $(SLO)$/texteng.obj \
- $(SLO)$/textundo.obj \
- $(SLO)$/textview.obj \
- $(SLO)$/textwindowpeer.obj \
- $(SLO)$/xtextedt.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svtools/source/edit/svmedit.cxx b/svtools/source/edit/svmedit.cxx
index 6fcc61dd467b..2e45ae38172b 100644
--- a/svtools/source/edit/svmedit.cxx
+++ b/svtools/source/edit/svmedit.cxx
@@ -66,11 +66,11 @@ private:
ExtTextEngine* mpExtTextEngine;
ExtTextView* mpExtTextView;
- BOOL mbInMBDown;
- BOOL mbFocusSelectionHide;
- BOOL mbIgnoreTab;
- BOOL mbActivePopup;
- BOOL mbSelectOnTab;
+ sal_Bool mbInMBDown;
+ sal_Bool mbFocusSelectionHide;
+ sal_Bool mbIgnoreTab;
+ sal_Bool mbActivePopup;
+ sal_Bool mbSelectOnTab;
public:
TextWindow( Window* pParent );
@@ -92,17 +92,17 @@ public:
virtual void GetFocus();
virtual void LoseFocus();
- BOOL IsAutoFocusHide() const { return mbFocusSelectionHide; }
- void SetAutoFocusHide( BOOL bAutoHide ) { mbFocusSelectionHide = bAutoHide; }
+ sal_Bool IsAutoFocusHide() const { return mbFocusSelectionHide; }
+ void SetAutoFocusHide( sal_Bool bAutoHide ) { mbFocusSelectionHide = bAutoHide; }
- BOOL IsIgnoreTab() const { return mbIgnoreTab; }
- void SetIgnoreTab( BOOL bIgnore ) { mbIgnoreTab = bIgnore; }
+ sal_Bool IsIgnoreTab() const { return mbIgnoreTab; }
+ void SetIgnoreTab( sal_Bool bIgnore ) { mbIgnoreTab = bIgnore; }
void DisableSelectionOnFocus() {mbSelectOnTab = sal_False;}
virtual
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >
- GetComponentInterface(BOOL bCreate = TRUE);
+ GetComponentInterface(sal_Bool bCreate = sal_True);
};
@@ -132,17 +132,17 @@ public:
ImpSvMEdit( MultiLineEdit* pSvMultiLineEdit, WinBits nWinStyle );
~ImpSvMEdit();
- void SetModified( BOOL bMod );
- BOOL IsModified() const;
+ void SetModified( sal_Bool bMod );
+ sal_Bool IsModified() const;
- void SetReadOnly( BOOL bRdOnly );
- BOOL IsReadOnly() const;
+ void SetReadOnly( sal_Bool bRdOnly );
+ sal_Bool IsReadOnly() const;
void SetMaxTextLen( xub_StrLen nLen );
xub_StrLen GetMaxTextLen() const;
- void SetInsertMode( BOOL bInsert );
- BOOL IsInsertMode() const;
+ void SetInsertMode( sal_Bool bInsert );
+ sal_Bool IsInsertMode() const;
void InsertText( const String& rStr );
String GetSelected() const;
@@ -164,13 +164,13 @@ public:
void Resize();
void GetFocus();
- BOOL HandleCommand( const CommandEvent& rCEvt );
+ sal_Bool HandleCommand( const CommandEvent& rCEvt );
- void Enable( BOOL bEnable );
+ void Enable( sal_Bool bEnable );
Size CalcMinimumSize() const;
- Size CalcSize( USHORT nColumns, USHORT nLines ) const;
- void GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const;
+ Size CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const;
+ void GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const;
void SetAlign( WinBits nWinStyle );
@@ -198,27 +198,27 @@ ImpSvMEdit::ImpSvMEdit( MultiLineEdit* pEdt, WinBits nWinStyle )
void ImpSvMEdit::ImpUpdateSrollBarVis( WinBits nWinStyle )
{
- const BOOL bHaveVScroll = (NULL != mpVScrollBar);
- const BOOL bHaveHScroll = (NULL != mpHScrollBar);
- const BOOL bHaveScrollBox = (NULL != mpScrollBox);
+ const sal_Bool bHaveVScroll = (NULL != mpVScrollBar);
+ const sal_Bool bHaveHScroll = (NULL != mpHScrollBar);
+ const sal_Bool bHaveScrollBox = (NULL != mpScrollBox);
- BOOL bNeedVScroll = ( nWinStyle & WB_VSCROLL ) == WB_VSCROLL;
- const BOOL bNeedHScroll = ( nWinStyle & WB_HSCROLL ) == WB_HSCROLL;
+ sal_Bool bNeedVScroll = ( nWinStyle & WB_VSCROLL ) == WB_VSCROLL;
+ const sal_Bool bNeedHScroll = ( nWinStyle & WB_HSCROLL ) == WB_HSCROLL;
- const BOOL bAutoVScroll = ( nWinStyle & WB_AUTOVSCROLL ) == WB_AUTOVSCROLL;
+ const sal_Bool bAutoVScroll = ( nWinStyle & WB_AUTOVSCROLL ) == WB_AUTOVSCROLL;
if ( !bNeedVScroll && bAutoVScroll )
{
TextEngine& rEngine( *mpTextWindow->GetTextEngine() );
- ULONG nOverallTextHeight(0);
- for ( ULONG i=0; i<rEngine.GetParagraphCount(); ++i )
+ sal_uLong nOverallTextHeight(0);
+ for ( sal_uLong i=0; i<rEngine.GetParagraphCount(); ++i )
nOverallTextHeight += rEngine.GetTextHeight( i );
- if ( nOverallTextHeight > (ULONG)mpTextWindow->GetOutputSizePixel().Height() )
+ if ( nOverallTextHeight > (sal_uLong)mpTextWindow->GetOutputSizePixel().Height() )
bNeedVScroll = true;
}
- const BOOL bNeedScrollBox = bNeedVScroll && bNeedHScroll;
+ const sal_Bool bNeedScrollBox = bNeedVScroll && bNeedHScroll;
- BOOL bScrollbarsChanged = false;
+ sal_Bool bScrollbarsChanged = false;
if ( bHaveVScroll != bNeedVScroll )
{
delete mpVScrollBar;
@@ -269,22 +269,22 @@ void ImpSvMEdit::InitFromStyle( WinBits nWinStyle )
SetAlign( nWinStyle );
if ( nWinStyle & WB_NOHIDESELECTION )
- mpTextWindow->SetAutoFocusHide( FALSE );
+ mpTextWindow->SetAutoFocusHide( sal_False );
else
- mpTextWindow->SetAutoFocusHide( TRUE );
+ mpTextWindow->SetAutoFocusHide( sal_True );
if ( nWinStyle & WB_READONLY )
- mpTextWindow->GetTextView()->SetReadOnly( TRUE );
+ mpTextWindow->GetTextView()->SetReadOnly( sal_True );
else
- mpTextWindow->GetTextView()->SetReadOnly( FALSE );
+ mpTextWindow->GetTextView()->SetReadOnly( sal_False );
if ( nWinStyle & WB_IGNORETAB )
{
- mpTextWindow->SetIgnoreTab( TRUE );
+ mpTextWindow->SetIgnoreTab( sal_True );
}
else
{
- mpTextWindow->SetIgnoreTab( FALSE );
+ mpTextWindow->SetIgnoreTab( sal_False );
// #103667# MultiLineEdit has the flag, but focusable window also needs this flag
WinBits nStyle = mpTextWindow->GetStyle();
nStyle |= WINDOW_DLGCTRL_MOD1TAB;
@@ -305,14 +305,14 @@ void ImpSvMEdit::ImpSetScrollBarRanges()
{
if ( mpVScrollBar )
{
- ULONG nTextHeight = mpTextWindow->GetTextEngine()->GetTextHeight();
+ sal_uLong nTextHeight = mpTextWindow->GetTextEngine()->GetTextHeight();
mpVScrollBar->SetRange( Range( 0, (long)nTextHeight-1 ) );
}
if ( mpHScrollBar )
{
-// ULONG nTextWidth = mpTextWindow->GetTextEngine()->CalcTextWidth();
+// sal_uLong nTextWidth = mpTextWindow->GetTextEngine()->CalcTextWidth();
// Es gibt kein Notify bei Breiten-Aenderung...
-// ULONG nW = Max( (ULONG)mpTextWindow->GetOutputSizePixel().Width()*5, (ULONG)nTextWidth );
+// sal_uLong nW = Max( (sal_uLong)mpTextWindow->GetOutputSizePixel().Width()*5, (sal_uLong)nTextWidth );
// mpHScrollBar->SetRange( Range( 0, (long)nW ) );
mpHScrollBar->SetRange( Range( 0, (long)mnTextWidth-1 ) );
}
@@ -365,7 +365,7 @@ IMPL_LINK( ImpSvMEdit, ScrollHdl, ScrollBar*, pCurScrollBar )
nDiffX = mpTextWindow->GetTextView()->GetStartDocPos().X() - pCurScrollBar->GetThumbPos();
mpTextWindow->GetTextView()->Scroll( nDiffX, nDiffY );
- // mpTextWindow->GetTextView()->ShowCursor( FALSE, TRUE );
+ // mpTextWindow->GetTextView()->ShowCursor( sal_False, sal_True );
return 0;
}
@@ -379,7 +379,7 @@ IMPL_LINK( ImpSvMEdit, ScrollHdl, ScrollBar*, pCurScrollBar )
void ImpSvMEdit::SetAlign( WinBits nWinStyle )
{
- BOOL bRTL = Application::GetSettings().GetLayoutRTL();
+ sal_Bool bRTL = Application::GetSettings().GetLayoutRTL();
mpTextWindow->GetTextEngine()->SetRightToLeft( bRTL );
if ( nWinStyle & WB_CENTER )
@@ -396,28 +396,28 @@ void ImpSvMEdit::SetTextWindowOffset( const Point& rOffset )
Resize();
}
-void ImpSvMEdit::SetModified( BOOL bMod )
+void ImpSvMEdit::SetModified( sal_Bool bMod )
{
mpTextWindow->GetTextEngine()->SetModified( bMod );
}
-BOOL ImpSvMEdit::IsModified() const
+sal_Bool ImpSvMEdit::IsModified() const
{
return mpTextWindow->GetTextEngine()->IsModified();
}
-void ImpSvMEdit::SetInsertMode( BOOL bInsert )
+void ImpSvMEdit::SetInsertMode( sal_Bool bInsert )
{
mpTextWindow->GetTextView()->SetInsertMode( bInsert );
}
-void ImpSvMEdit::SetReadOnly( BOOL bRdOnly )
+void ImpSvMEdit::SetReadOnly( sal_Bool bRdOnly )
{
mpTextWindow->GetTextView()->SetReadOnly( bRdOnly );
// Farbe anpassen ???????????????????????????
}
-BOOL ImpSvMEdit::IsReadOnly() const
+sal_Bool ImpSvMEdit::IsReadOnly() const
{
return mpTextWindow->GetTextView()->IsReadOnly();
}
@@ -534,10 +534,10 @@ void ImpSvMEdit::Paste()
void ImpSvMEdit::SetText( const String& rStr )
{
- BOOL bWasModified = mpTextWindow->GetTextEngine()->IsModified();
+ sal_Bool bWasModified = mpTextWindow->GetTextEngine()->IsModified();
mpTextWindow->GetTextEngine()->SetText( rStr );
if ( !bWasModified )
- mpTextWindow->GetTextEngine()->SetModified( FALSE );
+ mpTextWindow->GetTextEngine()->SetModified( sal_False );
mpTextWindow->GetTextView()->SetSelection( TextSelection() );
@@ -594,7 +594,7 @@ void ImpSvMEdit::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
if ( mpHScrollBar )
{
- ULONG nWidth = mpTextWindow->GetTextEngine()->CalcTextWidth();
+ sal_uLong nWidth = mpTextWindow->GetTextEngine()->CalcTextWidth();
if ( nWidth != mnTextWidth )
{
mnTextWidth = sal::static_int_cast< xub_StrLen >(nWidth);
@@ -626,9 +626,9 @@ void ImpSvMEdit::SetSelection( const Selection& rSelection )
long nEnd = Max( aNewSelection.Min(), aNewSelection.Max() );
TextSelection aTextSel;
- ULONG nPara = 0;
- USHORT nChar = 0;
- USHORT x = 0;
+ sal_uLong nPara = 0;
+ sal_uInt16 nChar = 0;
+ sal_uInt16 x = 0;
while ( x <= nEnd )
{
if ( x == aNewSelection.Min() )
@@ -657,7 +657,7 @@ const Selection& ImpSvMEdit::GetSelection() const
ExtTextEngine* pExtTextEngine = mpTextWindow->GetTextEngine();
// Absaetze davor:
- ULONG n;
+ sal_uLong n;
for ( n = 0; n < aTextSel.GetStart().GetPara(); n++ )
{
maSelection.Min() += pExtTextEngine->GetTextLen( n );
@@ -692,7 +692,7 @@ Size ImpSvMEdit::CalcMinimumSize() const
return aSz;
}
-Size ImpSvMEdit::CalcSize( USHORT nColumns, USHORT nLines ) const
+Size ImpSvMEdit::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const
{
static const sal_Unicode sampleText[] = { 'X', '\0' };
@@ -719,16 +719,16 @@ Size ImpSvMEdit::CalcSize( USHORT nColumns, USHORT nLines ) const
return aSz;
}
-void ImpSvMEdit::GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const
+void ImpSvMEdit::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const
{
static const sal_Unicode sampleText[] = { 'x', '\0' };
Size aOutSz = mpTextWindow->GetOutputSizePixel();
Size aCharSz( mpTextWindow->GetTextWidth( sampleText ), mpTextWindow->GetTextHeight() );
- rnCols = (USHORT) (aOutSz.Width()/aCharSz.Width());
- rnLines = (USHORT) (aOutSz.Height()/aCharSz.Height());
+ rnCols = (sal_uInt16) (aOutSz.Width()/aCharSz.Width());
+ rnLines = (sal_uInt16) (aOutSz.Height()/aCharSz.Height());
}
-void ImpSvMEdit::Enable( BOOL bEnable )
+void ImpSvMEdit::Enable( sal_Bool bEnable )
{
mpTextWindow->Enable( bEnable );
if ( mpHScrollBar )
@@ -737,15 +737,15 @@ void ImpSvMEdit::Enable( BOOL bEnable )
mpVScrollBar->Enable( bEnable );
}
-BOOL ImpSvMEdit::HandleCommand( const CommandEvent& rCEvt )
+sal_Bool ImpSvMEdit::HandleCommand( const CommandEvent& rCEvt )
{
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
if ( ( rCEvt.GetCommand() == COMMAND_WHEEL ) ||
( rCEvt.GetCommand() == COMMAND_STARTAUTOSCROLL ) ||
( rCEvt.GetCommand() == COMMAND_AUTOSCROLL ) )
{
mpTextWindow->HandleScrollCommand( rCEvt, mpHScrollBar, mpVScrollBar );
- bDone = TRUE;
+ bDone = sal_True;
}
return bDone;
}
@@ -753,12 +753,12 @@ BOOL ImpSvMEdit::HandleCommand( const CommandEvent& rCEvt )
TextWindow::TextWindow( Window* pParent ) : Window( pParent )
{
- mbInMBDown = FALSE;
- mbSelectOnTab = TRUE;
- mbFocusSelectionHide = FALSE;
- mbIgnoreTab = FALSE;
- mbActivePopup = FALSE;
- mbSelectOnTab = TRUE;
+ mbInMBDown = sal_False;
+ mbSelectOnTab = sal_True;
+ mbFocusSelectionHide = sal_False;
+ mbIgnoreTab = sal_False;
+ mbActivePopup = sal_False;
+ mbSelectOnTab = sal_True;
SetPointer( Pointer( POINTER_TEXT ) );
@@ -769,7 +769,7 @@ TextWindow::TextWindow( Window* pParent ) : Window( pParent )
mpExtTextEngine->SetLocale( GetSettings().GetLocale() );
mpExtTextView = new ExtTextView( mpExtTextEngine, this );
mpExtTextEngine->InsertView( mpExtTextView );
- mpExtTextEngine->EnableUndo( TRUE );
+ mpExtTextEngine->EnableUndo( sal_True );
mpExtTextView->ShowCursor();
Color aBackgroundColor = GetSettings().GetStyleSettings().GetWorkspaceColor();
@@ -791,11 +791,11 @@ void TextWindow::MouseMove( const MouseEvent& rMEvt )
void TextWindow::MouseButtonDown( const MouseEvent& rMEvt )
{
- mbInMBDown = TRUE; // Dann im GetFocus nicht alles selektieren wird
+ mbInMBDown = sal_True; // Dann im GetFocus nicht alles selektieren wird
mpExtTextView->MouseButtonDown( rMEvt );
Window::MouseButtonDown( rMEvt );
GrabFocus();
- mbInMBDown = FALSE;
+ mbInMBDown = sal_False;
}
void TextWindow::MouseButtonUp( const MouseEvent& rMEvt )
@@ -806,29 +806,29 @@ void TextWindow::MouseButtonUp( const MouseEvent& rMEvt )
void TextWindow::KeyInput( const KeyEvent& rKEvent )
{
- BOOL bDone = FALSE;
- USHORT nCode = rKEvent.GetKeyCode().GetCode();
+ sal_Bool bDone = sal_False;
+ sal_uInt16 nCode = rKEvent.GetKeyCode().GetCode();
if ( nCode == com::sun::star::awt::Key::SELECT_ALL ||
( (nCode == KEY_A) && rKEvent.GetKeyCode().IsMod1() && !rKEvent.GetKeyCode().IsMod2() )
)
{
mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFF, 0xFFFF ) ) );
- bDone = TRUE;
+ bDone = sal_True;
}
else if ( (nCode == KEY_S) && rKEvent.GetKeyCode().IsShift() && rKEvent.GetKeyCode().IsMod1() )
{
if ( Edit::GetGetSpecialCharsFunction() )
{
// Damit die Selektion erhalten bleibt
- mbActivePopup = TRUE;
+ mbActivePopup = sal_True;
XubString aChars = Edit::GetGetSpecialCharsFunction()( this, GetFont() );
if ( aChars.Len() )
{
mpExtTextView->InsertText( aChars );
- mpExtTextView->GetTextEngine()->SetModified( TRUE );
+ mpExtTextView->GetTextEngine()->SetModified( sal_True );
}
- mbActivePopup = FALSE;
- bDone = TRUE;
+ mbActivePopup = sal_False;
+ bDone = sal_True;
}
}
else if ( nCode == KEY_TAB )
@@ -864,33 +864,33 @@ void TextWindow::Command( const CommandEvent& rCEvt )
pPopup->SetMenuFlags( MENU_FLAG_HIDEDISABLEDENTRIES );
if ( !mpExtTextView->HasSelection() )
{
- pPopup->EnableItem( SV_MENU_EDIT_CUT, FALSE );
- pPopup->EnableItem( SV_MENU_EDIT_COPY, FALSE );
- pPopup->EnableItem( SV_MENU_EDIT_DELETE, FALSE );
+ pPopup->EnableItem( SV_MENU_EDIT_CUT, sal_False );
+ pPopup->EnableItem( SV_MENU_EDIT_COPY, sal_False );
+ pPopup->EnableItem( SV_MENU_EDIT_DELETE, sal_False );
}
if ( mpExtTextView->IsReadOnly() )
{
- pPopup->EnableItem( SV_MENU_EDIT_CUT, FALSE );
- pPopup->EnableItem( SV_MENU_EDIT_PASTE, FALSE );
- pPopup->EnableItem( SV_MENU_EDIT_DELETE, FALSE );
- pPopup->EnableItem( SV_MENU_EDIT_INSERTSYMBOL, FALSE );
+ pPopup->EnableItem( SV_MENU_EDIT_CUT, sal_False );
+ pPopup->EnableItem( SV_MENU_EDIT_PASTE, sal_False );
+ pPopup->EnableItem( SV_MENU_EDIT_DELETE, sal_False );
+ pPopup->EnableItem( SV_MENU_EDIT_INSERTSYMBOL, sal_False );
}
if ( !mpExtTextView->GetTextEngine()->HasUndoManager() || !mpExtTextView->GetTextEngine()->GetUndoManager().GetUndoActionCount() )
{
- pPopup->EnableItem( SV_MENU_EDIT_UNDO, FALSE );
+ pPopup->EnableItem( SV_MENU_EDIT_UNDO, sal_False );
}
// if ( ( maSelection.Min() == 0 ) && ( maSelection.Max() == maText.Len() ) )
// {
-// pPopup->EnableItem( SV_MENU_EDIT_SELECTALL, FALSE );
+// pPopup->EnableItem( SV_MENU_EDIT_SELECTALL, sal_False );
// }
if ( !Edit::GetGetSpecialCharsFunction() )
{
- USHORT nPos = pPopup->GetItemPos( SV_MENU_EDIT_INSERTSYMBOL );
+ sal_uInt16 nPos = pPopup->GetItemPos( SV_MENU_EDIT_INSERTSYMBOL );
pPopup->RemoveItem( nPos );
pPopup->RemoveItem( nPos-1 );
}
- mbActivePopup = TRUE;
+ mbActivePopup = sal_True;
Point aPos = rCEvt.GetMousePosPixel();
if ( !rCEvt.IsMouseEvent() )
{
@@ -899,26 +899,26 @@ void TextWindow::Command( const CommandEvent& rCEvt )
aPos = Point( aSize.Width()/2, aSize.Height()/2 );
}
// pPopup->RemoveDisabledEntries();
- USHORT n = pPopup->Execute( this, aPos );
+ sal_uInt16 n = pPopup->Execute( this, aPos );
Edit::DeletePopupMenu( pPopup );
switch ( n )
{
case SV_MENU_EDIT_UNDO: mpExtTextView->Undo();
- mpExtTextEngine->SetModified( TRUE );
+ mpExtTextEngine->SetModified( sal_True );
mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
break;
case SV_MENU_EDIT_CUT: mpExtTextView->Cut();
- mpExtTextEngine->SetModified( TRUE );
+ mpExtTextEngine->SetModified( sal_True );
mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
break;
case SV_MENU_EDIT_COPY: mpExtTextView->Copy();
break;
case SV_MENU_EDIT_PASTE: mpExtTextView->Paste();
- mpExtTextEngine->SetModified( TRUE );
+ mpExtTextEngine->SetModified( sal_True );
mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
break;
case SV_MENU_EDIT_DELETE: mpExtTextView->DeleteSelected();
- mpExtTextEngine->SetModified( TRUE );
+ mpExtTextEngine->SetModified( sal_True );
mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
break;
case SV_MENU_EDIT_SELECTALL: mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFFFFFF, 0xFFFF ) ) );
@@ -929,13 +929,13 @@ void TextWindow::Command( const CommandEvent& rCEvt )
if ( aChars.Len() )
{
mpExtTextView->InsertText( aChars );
- mpExtTextEngine->SetModified( TRUE );
+ mpExtTextEngine->SetModified( sal_True );
mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
}
}
break;
}
- mbActivePopup = FALSE;
+ mbActivePopup = sal_False;
}
else
{
@@ -949,19 +949,19 @@ void TextWindow::GetFocus()
Window::GetFocus();
if ( !mbActivePopup )
{
- BOOL bGotoCursor = !mpExtTextView->IsReadOnly();
+ sal_Bool bGotoCursor = !mpExtTextView->IsReadOnly();
if ( mbFocusSelectionHide && IsReallyVisible() && !mpExtTextView->IsReadOnly()
&& ( mbSelectOnTab &&
(!mbInMBDown || ( GetSettings().GetStyleSettings().GetSelectionOptions() & SELECTION_OPTION_FOCUS ) )) )
{
// Alles selektieren, aber nicht scrollen
- BOOL bAutoScroll = mpExtTextView->IsAutoScroll();
- mpExtTextView->SetAutoScroll( FALSE );
+ sal_Bool bAutoScroll = mpExtTextView->IsAutoScroll();
+ mpExtTextView->SetAutoScroll( sal_False );
mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFF, 0xFFFF ) ) );
mpExtTextView->SetAutoScroll( bAutoScroll );
- bGotoCursor = FALSE;
+ bGotoCursor = sal_False;
}
- mpExtTextView->SetPaintSelection( TRUE );
+ mpExtTextView->SetPaintSelection( sal_True );
mpExtTextView->ShowCursor( bGotoCursor );
}
}
@@ -971,12 +971,12 @@ void TextWindow::LoseFocus()
Window::LoseFocus();
if ( mbFocusSelectionHide && !mbActivePopup )
- mpExtTextView->SetPaintSelection( FALSE );
+ mpExtTextView->SetPaintSelection( sal_False );
}
// virtual
::css::uno::Reference< ::css::awt::XWindowPeer >
-TextWindow::GetComponentInterface(BOOL bCreate)
+TextWindow::GetComponentInterface(sal_Bool bCreate)
{
::css::uno::Reference< ::css::awt::XWindowPeer > xPeer(
Window::GetComponentInterface(false));
@@ -993,10 +993,10 @@ MultiLineEdit::MultiLineEdit( Window* pParent, WinBits nWinStyle )
{
SetType( WINDOW_MULTILINEEDIT );
pImpSvMEdit = new ImpSvMEdit( this, nWinStyle );
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
pUpdateDataTimer = 0;
- SetCompoundControl( TRUE );
+ SetCompoundControl( sal_True );
SetStyle( ImplInitStyle( nWinStyle ) );
}
@@ -1006,10 +1006,10 @@ MultiLineEdit::MultiLineEdit( Window* pParent, const ResId& rResId )
SetType( WINDOW_MULTILINEEDIT );
WinBits nWinStyle = rResId.GetWinBits();
pImpSvMEdit = new ImpSvMEdit( this, nWinStyle );
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
pUpdateDataTimer = 0;
- USHORT nMaxLen = Edit::GetMaxTextLen();
+ sal_uInt16 nMaxLen = Edit::GetMaxTextLen();
if ( nMaxLen )
SetMaxTextLen( nMaxLen );
@@ -1018,7 +1018,7 @@ MultiLineEdit::MultiLineEdit( Window* pParent, const ResId& rResId )
if ( IsVisible() )
pImpSvMEdit->Resize();
- SetCompoundControl( TRUE );
+ SetCompoundControl( sal_True );
SetStyle( ImplInitStyle( nWinStyle ) );
// Base Edit ctor could call Show already, but that would cause problems
@@ -1053,7 +1053,7 @@ WinBits MultiLineEdit::ImplInitStyle( WinBits nStyle )
}
-void MultiLineEdit::ImplInitSettings( BOOL /*bFont*/, BOOL /*bForeground*/, BOOL bBackground )
+void MultiLineEdit::ImplInitSettings( sal_Bool /*bFont*/, sal_Bool /*bForeground*/, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -1085,7 +1085,7 @@ void MultiLineEdit::ImplInitSettings( BOOL /*bFont*/, BOOL /*bForeground*/, BOOL
{
if( IsPaintTransparent() )
{
- pImpSvMEdit->GetTextWindow()->SetPaintTransparent( TRUE );
+ pImpSvMEdit->GetTextWindow()->SetPaintTransparent( sal_True );
pImpSvMEdit->GetTextWindow()->SetBackground();
pImpSvMEdit->GetTextWindow()->SetControlBackground();
SetBackground();
@@ -1127,20 +1127,20 @@ void MultiLineEdit::UpdateData()
void MultiLineEdit::SetModifyFlag()
{
- pImpSvMEdit->SetModified( TRUE );
+ pImpSvMEdit->SetModified( sal_True );
}
void MultiLineEdit::ClearModifyFlag()
{
- pImpSvMEdit->SetModified( FALSE );
+ pImpSvMEdit->SetModified( sal_False );
}
-BOOL MultiLineEdit::IsModified() const
+sal_Bool MultiLineEdit::IsModified() const
{
return pImpSvMEdit->IsModified();
}
-void MultiLineEdit::EnableUpdateData( ULONG nTimeout )
+void MultiLineEdit::EnableUpdateData( sal_uLong nTimeout )
{
if ( !nTimeout )
DisableUpdateData();
@@ -1155,7 +1155,7 @@ void MultiLineEdit::EnableUpdateData( ULONG nTimeout )
}
}
-void MultiLineEdit::SetReadOnly( BOOL bReadOnly )
+void MultiLineEdit::SetReadOnly( sal_Bool bReadOnly )
{
pImpSvMEdit->SetReadOnly( bReadOnly );
Edit::SetReadOnly( bReadOnly );
@@ -1169,7 +1169,7 @@ void MultiLineEdit::SetReadOnly( BOOL bReadOnly )
SetStyle( nStyle );
}
-BOOL MultiLineEdit::IsReadOnly() const
+sal_Bool MultiLineEdit::IsReadOnly() const
{
return pImpSvMEdit->IsReadOnly();
}
@@ -1300,7 +1300,7 @@ Size MultiLineEdit::CalcAdjustedSize( const Size& rPrefSize ) const
return aSz;
}
-Size MultiLineEdit::CalcSize( USHORT nColumns, USHORT nLines ) const
+Size MultiLineEdit::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const
{
Size aSz = pImpSvMEdit->CalcSize( nColumns, nLines );
@@ -1311,7 +1311,7 @@ Size MultiLineEdit::CalcSize( USHORT nColumns, USHORT nLines ) const
return aSz;
}
-void MultiLineEdit::GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const
+void MultiLineEdit::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const
{
pImpSvMEdit->GetMaxVisColumnsAndLines( rnCols, rnLines );
}
@@ -1321,7 +1321,7 @@ void MultiLineEdit::StateChanged( StateChangedType nType )
if( nType == STATE_CHANGE_ENABLE )
{
pImpSvMEdit->Enable( IsEnabled() );
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
}
else if( nType == STATE_CHANGE_READONLY )
{
@@ -1330,23 +1330,23 @@ void MultiLineEdit::StateChanged( StateChangedType nType )
else if ( nType == STATE_CHANGE_ZOOM )
{
pImpSvMEdit->GetTextWindow()->SetZoom( GetZoom() );
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Resize();
}
else if ( nType == STATE_CHANGE_CONTROLFONT )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Resize();
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
else if ( nType == STATE_CHANGE_STYLE )
@@ -1358,7 +1358,7 @@ void MultiLineEdit::StateChanged( StateChangedType nType )
{
if( IsPaintTransparent() )
{
- pImpSvMEdit->GetTextWindow()->SetPaintTransparent( TRUE );
+ pImpSvMEdit->GetTextWindow()->SetPaintTransparent( sal_True );
pImpSvMEdit->GetTextWindow()->SetBackground();
pImpSvMEdit->GetTextWindow()->SetControlBackground();
SetBackground();
@@ -1374,7 +1374,7 @@ void MultiLineEdit::DataChanged( const DataChangedEvent& rDCEvt )
if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE) )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Resize();
Invalidate();
}
@@ -1382,14 +1382,14 @@ void MultiLineEdit::DataChanged( const DataChangedEvent& rDCEvt )
Control::DataChanged( rDCEvt );
}
-void MultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+void MultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
Font aFont = pImpSvMEdit->GetTextWindow()->GetDrawPixelFont( pDev );
- aFont.SetTransparent( TRUE );
+ aFont.SetTransparent( sal_True );
OutDevType eOutDevType = pDev->GetOutDevType();
pDev->Push();
@@ -1400,8 +1400,8 @@ void MultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSi
// Border/Background
pDev->SetLineColor();
pDev->SetFillColor();
- BOOL bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
- BOOL bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground();
+ sal_Bool bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
+ sal_Bool bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground();
if ( bBorder || bBackground )
{
Rectangle aRect( aPos, aSize );
@@ -1435,7 +1435,7 @@ void MultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSi
XubString aText = GetText();
Size aTextSz( pDev->GetTextWidth( aText ), pDev->GetTextHeight() );
- ULONG nLines = (ULONG) (aSize.Height() / aTextSz.Height());
+ sal_uLong nLines = (sal_uLong) (aSize.Height() / aTextSz.Height());
if ( !nLines )
nLines = 1;
aTextSz.Height() = nLines*aTextSz.Height();
@@ -1589,24 +1589,24 @@ ScrollBar* MultiLineEdit::GetVScrollBar() const
return pImpSvMEdit->GetVScrollBar();
}
-void MultiLineEdit::EnableFocusSelectionHide( BOOL bHide )
+void MultiLineEdit::EnableFocusSelectionHide( sal_Bool bHide )
{
pImpSvMEdit->GetTextWindow()->SetAutoFocusHide( bHide );
}
-BOOL MultiLineEdit::IsFocusSelectionHideEnabled() const
+sal_Bool MultiLineEdit::IsFocusSelectionHideEnabled() const
{
return pImpSvMEdit->GetTextWindow()->IsAutoFocusHide();
}
-void MultiLineEdit::SetLeftMargin( USHORT n )
+void MultiLineEdit::SetLeftMargin( sal_uInt16 n )
{
if ( GetTextEngine() )
GetTextEngine()->SetLeftMargin( n );
}
-USHORT MultiLineEdit::GetLeftMargin() const
+sal_uInt16 MultiLineEdit::GetLeftMargin() const
{
if ( GetTextEngine() )
return GetTextEngine()->GetLeftMargin();
@@ -1614,7 +1614,7 @@ USHORT MultiLineEdit::GetLeftMargin() const
return 0;
}
-void MultiLineEdit::SetRightToLeft( BOOL bRightToLeft )
+void MultiLineEdit::SetRightToLeft( sal_Bool bRightToLeft )
{
if ( GetTextEngine() )
{
@@ -1623,9 +1623,9 @@ void MultiLineEdit::SetRightToLeft( BOOL bRightToLeft )
}
}
-BOOL MultiLineEdit::IsRightToLeft() const
+sal_Bool MultiLineEdit::IsRightToLeft() const
{
- BOOL bRightToLeft = FALSE;
+ sal_Bool bRightToLeft = sal_False;
if ( GetTextEngine() )
bRightToLeft = GetTextEngine()->IsRightToLeft();
@@ -1635,7 +1635,7 @@ BOOL MultiLineEdit::IsRightToLeft() const
// virtual
::css::uno::Reference< ::css::awt::XWindowPeer >
-MultiLineEdit::GetComponentInterface(BOOL bCreate)
+MultiLineEdit::GetComponentInterface(sal_Bool bCreate)
{
::css::uno::Reference< ::css::awt::XWindowPeer > xPeer(
Edit::GetComponentInterface(false));
diff --git a/svtools/source/edit/svmedit2.cxx b/svtools/source/edit/svmedit2.cxx
index 1241eef2089e..bb496e47a7ef 100644
--- a/svtools/source/edit/svmedit2.cxx
+++ b/svtools/source/edit/svmedit2.cxx
@@ -50,32 +50,32 @@ ExtMultiLineEdit::~ExtMultiLineEdit()
{
}
-void ExtMultiLineEdit::InsertText( const String& rNew, BOOL )
+void ExtMultiLineEdit::InsertText( const String& rNew, sal_Bool )
{
- GetTextView()->InsertText( rNew, FALSE );
+ GetTextView()->InsertText( rNew, sal_False );
}
-void ExtMultiLineEdit::SetAutoScroll( BOOL bAutoScroll )
+void ExtMultiLineEdit::SetAutoScroll( sal_Bool bAutoScroll )
{
GetTextView()->SetAutoScroll( bAutoScroll );
}
-void ExtMultiLineEdit::EnableCursor( BOOL bEnable )
+void ExtMultiLineEdit::EnableCursor( sal_Bool bEnable )
{
GetTextView()->EnableCursor( bEnable );
}
-void ExtMultiLineEdit::SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart, USHORT nEnd )
+void ExtMultiLineEdit::SetAttrib( const TextAttrib& rAttr, sal_uLong nPara, sal_uInt16 nStart, sal_uInt16 nEnd )
{
GetTextEngine()->SetAttrib( rAttr, nPara, nStart, nEnd );
}
-void ExtMultiLineEdit::SetLeftMargin( USHORT nLeftMargin )
+void ExtMultiLineEdit::SetLeftMargin( sal_uInt16 nLeftMargin )
{
GetTextEngine()->SetLeftMargin( nLeftMargin );
}
-ULONG ExtMultiLineEdit::GetParagraphCount() const
+sal_uLong ExtMultiLineEdit::GetParagraphCount() const
{
return GetTextEngine()->GetParagraphCount();
}
diff --git a/svtools/source/edit/sychconv.cxx b/svtools/source/edit/sychconv.cxx
index e8d0d75cd6e0..c20ebd962acd 100644
--- a/svtools/source/edit/sychconv.cxx
+++ b/svtools/source/edit/sychconv.cxx
@@ -28,17 +28,17 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "sychconv.hxx"
+#include <svtools/sychconv.hxx>
#include <vcl/outdev.hxx>
-BOOL SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* pDev )
+sal_Bool SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* pDev )
{
// hibyte 0 = exact matching
// 1 = little differences,
// 2 = the converted character does not look like the original but got the same meaning
// 3 = the destination does not match looking and meaning of the original
- static USHORT const aWingdingsToStarBatsTable[ 256 - 32 ] =
+ static sal_uInt16 const aWingdingsToStarBatsTable[ 256 - 32 ] =
{
0x0020, 0x0238, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0174, 0x02BA, 0x017B, 0x017C, 0x037C, 0x037C, 0x037C, 0x037C,
0x0000, 0x0000, 0x0372, 0x0272, 0x0372, 0x0000, 0x0000, 0x0374, 0x0279, 0x0000, 0x027A, 0x0000, 0x0178, 0x0278, 0x0000, 0x0137,
@@ -56,7 +56,7 @@ BOOL SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* p
0x01AF, 0x01B2, 0x01B0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0150, 0x0032, 0x0033, 0x0034, 0x01C8
};
- static USHORT const aMonotypeSortsToStarBatsTable[ 256 - 32 ]=
+ static sal_uInt16 const aMonotypeSortsToStarBatsTable[ 256 - 32 ]=
{
0x0020, 0x00cb, 0x00cb, 0x00cb, 0x00cb, 0x0074, 0x00ba, 0x0021, 0x00cc, 0x007b, 0x0036, 0x007d, 0x007e, 0x0037, 0x0038, 0x0038,
0x0039, 0x0038, 0x0038, 0x0039, 0x003a, 0x004f, 0x0050, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0086, 0x0086, 0x0086,
@@ -74,9 +74,9 @@ BOOL SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* p
0x0000, 0x00af, 0x0035, 0x00dc, 0x00da, 0x00dc, 0x00db, 0x00da, 0x00dc, 0x00db, 0x00dc, 0x00dc, 0x00dc, 0x00dc, 0x00af, 0x0000
};
- const USHORT* pTransTable = NULL;
+ const sal_uInt16* pTransTable = NULL;
- BOOL bIsAvailable = ( pDev ) ? pDev->IsFontAvailable( rFont.GetName() ) : FALSE;
+ sal_Bool bIsAvailable = ( pDev ) ? pDev->IsFontAvailable( rFont.GetName() ) : sal_False;
if ( !bIsAvailable )
{
if ( rFont.GetName().CompareToAscii( RTL_CONSTASCII_STRINGPARAM( "Wingdings" ) ) == COMPARE_EQUAL )
@@ -87,20 +87,20 @@ BOOL SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* p
if ( pTransTable )
{
sal_Unicode c;
- for ( UINT16 i = rString.Len(); i--; )
+ for ( sal_uInt16 i = rString.Len(); i--; )
{
c = rString.GetChar( i );
c -= 32;
- c = ( ((UINT16)c) >= 224 ) ? 0 : (sal_Unicode) pTransTable[ c ];
+ c = ( ((sal_uInt16)c) >= 224 ) ? 0 : (sal_Unicode) pTransTable[ c ];
if ( !c ) // if character is out of range or not matching
c = 0xA5; // we will default a StarBats-Bullet
rString.SetChar( i, c );
}
rFont.SetCharSet( RTL_TEXTENCODING_SYMBOL );
rFont.SetName( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "StarBats" ) ) );
- return TRUE;
+ return sal_True;
}
- else return FALSE;
+ else return sal_False;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/edit/syntaxhighlight.cxx b/svtools/source/edit/syntaxhighlight.cxx
index f326eb0ec8a5..f859e9930cf9 100644
--- a/svtools/source/edit/syntaxhighlight.cxx
+++ b/svtools/source/edit/syntaxhighlight.cxx
@@ -35,9 +35,6 @@
#include <tools/debug.hxx>
-SV_IMPL_VARARR(HighlightPortions, HighlightPortion)
-
-
// ##########################################################################
// ATTENTION: all these words needs to be in small caps
// ##########################################################################
@@ -260,22 +257,22 @@ class BasicSimpleCharClass
static LetterTable aLetterTable;
public:
- static BOOL isAlpha( sal_Unicode c, bool bCompatible )
+ static sal_Bool isAlpha( sal_Unicode c, bool bCompatible )
{
- BOOL bRet = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
+ sal_Bool bRet = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
|| (bCompatible && aLetterTable.isLetter( c ));
return bRet;
}
- static BOOL isDigit( sal_Unicode c )
+ static sal_Bool isDigit( sal_Unicode c )
{
- BOOL bRet = (c >= '0' && c <= '9');
+ sal_Bool bRet = (c >= '0' && c <= '9');
return bRet;
}
- static BOOL isAlphaNumeric( sal_Unicode c, bool bCompatible )
+ static sal_Bool isAlphaNumeric( sal_Unicode c, bool bCompatible )
{
- BOOL bRet = isDigit( c ) || isAlpha( c, bCompatible );
+ sal_Bool bRet = isDigit( c ) || isAlpha( c, bCompatible );
return bRet;
}
};
@@ -287,68 +284,68 @@ LetterTable::LetterTable( void )
for( int i = 0 ; i < 256 ; ++i )
IsLetterTab[i] = false;
- IsLetterTab[0xC0] = true; // À , CAPITAL LETTER A WITH GRAVE ACCENT
- IsLetterTab[0xC1] = true; // Á , CAPITAL LETTER A WITH ACUTE ACCENT
- IsLetterTab[0xC2] = true; // Â , CAPITAL LETTER A WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xC3] = true; // Ã , CAPITAL LETTER A WITH TILDE
- IsLetterTab[0xC4] = true; // Ä , CAPITAL LETTER A WITH DIAERESIS
- IsLetterTab[0xC5] = true; // Å , CAPITAL LETTER A WITH RING ABOVE
- IsLetterTab[0xC6] = true; // Æ , CAPITAL LIGATURE AE
- IsLetterTab[0xC7] = true; // Ç , CAPITAL LETTER C WITH CEDILLA
- IsLetterTab[0xC8] = true; // È , CAPITAL LETTER E WITH GRAVE ACCENT
- IsLetterTab[0xC9] = true; // É , CAPITAL LETTER E WITH ACUTE ACCENT
- IsLetterTab[0xCA] = true; // Ê , CAPITAL LETTER E WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xCB] = true; // Ë , CAPITAL LETTER E WITH DIAERESIS
- IsLetterTab[0xCC] = true; // Ì , CAPITAL LETTER I WITH GRAVE ACCENT
- IsLetterTab[0xCD] = true; // Í , CAPITAL LETTER I WITH ACUTE ACCENT
- IsLetterTab[0xCE] = true; // Î , CAPITAL LETTER I WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xCF] = true; // Ï , CAPITAL LETTER I WITH DIAERESIS
- IsLetterTab[0xD0] = true; // Ð , CAPITAL LETTER ETH
- IsLetterTab[0xD1] = true; // Ñ , CAPITAL LETTER N WITH TILDE
- IsLetterTab[0xD2] = true; // Ò , CAPITAL LETTER O WITH GRAVE ACCENT
- IsLetterTab[0xD3] = true; // Ó , CAPITAL LETTER O WITH ACUTE ACCENT
- IsLetterTab[0xD4] = true; // Ô , CAPITAL LETTER O WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xD5] = true; // Õ , CAPITAL LETTER O WITH TILDE
- IsLetterTab[0xD6] = true; // Ö , CAPITAL LETTER O WITH DIAERESIS
- IsLetterTab[0xD8] = true; // Ø , CAPITAL LETTER O WITH STROKE
- IsLetterTab[0xD9] = true; // Ù , CAPITAL LETTER U WITH GRAVE ACCENT
- IsLetterTab[0xDA] = true; // Ú , CAPITAL LETTER U WITH ACUTE ACCENT
- IsLetterTab[0xDB] = true; // Û , CAPITAL LETTER U WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xDC] = true; // Ü , CAPITAL LETTER U WITH DIAERESIS
- IsLetterTab[0xDD] = true; // Ý , CAPITAL LETTER Y WITH ACUTE ACCENT
- IsLetterTab[0xDE] = true; // Þ , CAPITAL LETTER THORN
- IsLetterTab[0xDF] = true; // ß , SMALL LETTER SHARP S
- IsLetterTab[0xE0] = true; // à , SMALL LETTER A WITH GRAVE ACCENT
- IsLetterTab[0xE1] = true; // á , SMALL LETTER A WITH ACUTE ACCENT
- IsLetterTab[0xE2] = true; // â , SMALL LETTER A WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xE3] = true; // ã , SMALL LETTER A WITH TILDE
- IsLetterTab[0xE4] = true; // ä , SMALL LETTER A WITH DIAERESIS
- IsLetterTab[0xE5] = true; // å , SMALL LETTER A WITH RING ABOVE
- IsLetterTab[0xE6] = true; // æ , SMALL LIGATURE AE
- IsLetterTab[0xE7] = true; // ç , SMALL LETTER C WITH CEDILLA
- IsLetterTab[0xE8] = true; // è , SMALL LETTER E WITH GRAVE ACCENT
- IsLetterTab[0xE9] = true; // é , SMALL LETTER E WITH ACUTE ACCENT
- IsLetterTab[0xEA] = true; // ê , SMALL LETTER E WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xEB] = true; // ë , SMALL LETTER E WITH DIAERESIS
- IsLetterTab[0xEC] = true; // ì , SMALL LETTER I WITH GRAVE ACCENT
- IsLetterTab[0xED] = true; // í , SMALL LETTER I WITH ACUTE ACCENT
- IsLetterTab[0xEE] = true; // î , SMALL LETTER I WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xEF] = true; // ï , SMALL LETTER I WITH DIAERESIS
- IsLetterTab[0xF0] = true; // ð , SMALL LETTER ETH
- IsLetterTab[0xF1] = true; // ñ , SMALL LETTER N WITH TILDE
- IsLetterTab[0xF2] = true; // ò , SMALL LETTER O WITH GRAVE ACCENT
- IsLetterTab[0xF3] = true; // ó , SMALL LETTER O WITH ACUTE ACCENT
- IsLetterTab[0xF4] = true; // ô , SMALL LETTER O WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xF5] = true; // õ , SMALL LETTER O WITH TILDE
- IsLetterTab[0xF6] = true; // ö , SMALL LETTER O WITH DIAERESIS
- IsLetterTab[0xF8] = true; // ø , SMALL LETTER O WITH OBLIQUE BAR
- IsLetterTab[0xF9] = true; // ù , SMALL LETTER U WITH GRAVE ACCENT
- IsLetterTab[0xFA] = true; // ú , SMALL LETTER U WITH ACUTE ACCENT
- IsLetterTab[0xFB] = true; // û , SMALL LETTER U WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xFC] = true; // ü , SMALL LETTER U WITH DIAERESIS
- IsLetterTab[0xFD] = true; // ý , SMALL LETTER Y WITH ACUTE ACCENT
- IsLetterTab[0xFE] = true; // þ , SMALL LETTER THORN
- IsLetterTab[0xFF] = true; // ÿ , SMALL LETTER Y WITH DIAERESIS
+ IsLetterTab[0xC0] = true; // ?, CAPITAL LETTER A WITH GRAVE ACCENT
+ IsLetterTab[0xC1] = true; // ?, CAPITAL LETTER A WITH ACUTE ACCENT
+ IsLetterTab[0xC2] = true; // ?, CAPITAL LETTER A WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xC3] = true; // ?, CAPITAL LETTER A WITH TILDE
+ IsLetterTab[0xC4] = true; // ?, CAPITAL LETTER A WITH DIAERESIS
+ IsLetterTab[0xC5] = true; // ?, CAPITAL LETTER A WITH RING ABOVE
+ IsLetterTab[0xC6] = true; // ?, CAPITAL LIGATURE AE
+ IsLetterTab[0xC7] = true; // ?, CAPITAL LETTER C WITH CEDILLA
+ IsLetterTab[0xC8] = true; // ?, CAPITAL LETTER E WITH GRAVE ACCENT
+ IsLetterTab[0xC9] = true; // ?, CAPITAL LETTER E WITH ACUTE ACCENT
+ IsLetterTab[0xCA] = true; // ?, CAPITAL LETTER E WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xCB] = true; // ?, CAPITAL LETTER E WITH DIAERESIS
+ IsLetterTab[0xCC] = true; // ?, CAPITAL LETTER I WITH GRAVE ACCENT
+ IsLetterTab[0xCD] = true; // ?, CAPITAL LETTER I WITH ACUTE ACCENT
+ IsLetterTab[0xCE] = true; // ?, CAPITAL LETTER I WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xCF] = true; // ?, CAPITAL LETTER I WITH DIAERESIS
+ IsLetterTab[0xD0] = true; // ?, CAPITAL LETTER ETH
+ IsLetterTab[0xD1] = true; // ?, CAPITAL LETTER N WITH TILDE
+ IsLetterTab[0xD2] = true; // ?, CAPITAL LETTER O WITH GRAVE ACCENT
+ IsLetterTab[0xD3] = true; // ?, CAPITAL LETTER O WITH ACUTE ACCENT
+ IsLetterTab[0xD4] = true; // ?, CAPITAL LETTER O WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xD5] = true; // ?, CAPITAL LETTER O WITH TILDE
+ IsLetterTab[0xD6] = true; // ?, CAPITAL LETTER O WITH DIAERESIS
+ IsLetterTab[0xD8] = true; // ?, CAPITAL LETTER O WITH STROKE
+ IsLetterTab[0xD9] = true; // ?, CAPITAL LETTER U WITH GRAVE ACCENT
+ IsLetterTab[0xDA] = true; // ?, CAPITAL LETTER U WITH ACUTE ACCENT
+ IsLetterTab[0xDB] = true; // ?, CAPITAL LETTER U WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xDC] = true; // ?, CAPITAL LETTER U WITH DIAERESIS
+ IsLetterTab[0xDD] = true; // ?, CAPITAL LETTER Y WITH ACUTE ACCENT
+ IsLetterTab[0xDE] = true; // ?, CAPITAL LETTER THORN
+ IsLetterTab[0xDF] = true; // ?, SMALL LETTER SHARP S
+ IsLetterTab[0xE0] = true; // ?, SMALL LETTER A WITH GRAVE ACCENT
+ IsLetterTab[0xE1] = true; // ?, SMALL LETTER A WITH ACUTE ACCENT
+ IsLetterTab[0xE2] = true; // ?, SMALL LETTER A WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xE3] = true; // ?, SMALL LETTER A WITH TILDE
+ IsLetterTab[0xE4] = true; // ?, SMALL LETTER A WITH DIAERESIS
+ IsLetterTab[0xE5] = true; // ?, SMALL LETTER A WITH RING ABOVE
+ IsLetterTab[0xE6] = true; // ?, SMALL LIGATURE AE
+ IsLetterTab[0xE7] = true; // ?, SMALL LETTER C WITH CEDILLA
+ IsLetterTab[0xE8] = true; // ?, SMALL LETTER E WITH GRAVE ACCENT
+ IsLetterTab[0xE9] = true; // ?, SMALL LETTER E WITH ACUTE ACCENT
+ IsLetterTab[0xEA] = true; // ?, SMALL LETTER E WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xEB] = true; // ?, SMALL LETTER E WITH DIAERESIS
+ IsLetterTab[0xEC] = true; // ?, SMALL LETTER I WITH GRAVE ACCENT
+ IsLetterTab[0xED] = true; // ?, SMALL LETTER I WITH ACUTE ACCENT
+ IsLetterTab[0xEE] = true; // ?, SMALL LETTER I WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xEF] = true; // ?, SMALL LETTER I WITH DIAERESIS
+ IsLetterTab[0xF0] = true; // ?, SMALL LETTER ETH
+ IsLetterTab[0xF1] = true; // ?, SMALL LETTER N WITH TILDE
+ IsLetterTab[0xF2] = true; // ?, SMALL LETTER O WITH GRAVE ACCENT
+ IsLetterTab[0xF3] = true; // ?, SMALL LETTER O WITH ACUTE ACCENT
+ IsLetterTab[0xF4] = true; // ?, SMALL LETTER O WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xF5] = true; // ?, SMALL LETTER O WITH TILDE
+ IsLetterTab[0xF6] = true; // ?, SMALL LETTER O WITH DIAERESIS
+ IsLetterTab[0xF8] = true; // ?, SMALL LETTER O WITH OBLIQUE BAR
+ IsLetterTab[0xF9] = true; // ?, SMALL LETTER U WITH GRAVE ACCENT
+ IsLetterTab[0xFA] = true; // ?, SMALL LETTER U WITH ACUTE ACCENT
+ IsLetterTab[0xFB] = true; // ?, SMALL LETTER U WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xFC] = true; // ?, SMALL LETTER U WITH DIAERESIS
+ IsLetterTab[0xFD] = true; // ?, SMALL LETTER Y WITH ACUTE ACCENT
+ IsLetterTab[0xFE] = true; // ?, SMALL LETTER THORN
+ IsLetterTab[0xFF] = true; // � , SMALL LETTER Y WITH DIAERESIS
}
bool LetterTable::isLetterUnicode( sal_Unicode c )
@@ -362,7 +359,7 @@ bool LetterTable::isLetterUnicode( sal_Unicode c )
}
// Hilfsfunktion: Zeichen-Flag Testen
-BOOL SimpleTokenizer_Impl::testCharFlags( sal_Unicode c, USHORT nTestFlags )
+sal_Bool SimpleTokenizer_Impl::testCharFlags( sal_Unicode c, sal_uInt16 nTestFlags )
{
bool bRet = false;
if( c != 0 && c <= 255 )
@@ -377,14 +374,14 @@ BOOL SimpleTokenizer_Impl::testCharFlags( sal_Unicode c, USHORT nTestFlags )
return bRet;
}
-void SimpleTokenizer_Impl::setKeyWords( const char** ppKeyWords, UINT16 nCount )
+void SimpleTokenizer_Impl::setKeyWords( const char** ppKeyWords, sal_uInt16 nCount )
{
ppListKeyWords = ppKeyWords;
nKeyWordCount = nCount;
}
// Neues Token holen
-BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
+sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
/*out*/const sal_Unicode*& rpStartPos, /*out*/const sal_Unicode*& rpEndPos )
{
reType = TT_UNKNOWN;
@@ -395,25 +392,25 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
// Zeichen untersuchen
sal_Unicode c = peekChar();
if( c == CHAR_EOF )
- return FALSE;
+ return sal_False;
// Zeichen lesen
getChar();
//*** Alle Moeglichkeiten durchgehen ***
// Space?
- if ( (testCharFlags( c, CHAR_SPACE ) == TRUE) )
+ if ( (testCharFlags( c, CHAR_SPACE ) == sal_True) )
{
- while( testCharFlags( peekChar(), CHAR_SPACE ) == TRUE )
+ while( testCharFlags( peekChar(), CHAR_SPACE ) == sal_True )
getChar();
reType = TT_WHITESPACE;
}
// Identifier?
- else if ( (testCharFlags( c, CHAR_START_IDENTIFIER ) == TRUE) )
+ else if ( (testCharFlags( c, CHAR_START_IDENTIFIER ) == sal_True) )
{
- BOOL bIdentifierChar;
+ sal_Bool bIdentifierChar;
do
{
// Naechstes Zeichen holen
@@ -456,7 +453,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
{
// Alle Zeichen bis Zeilen-Ende oder EOF entfernen
sal_Unicode cPeek = peekChar();
- while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == FALSE )
+ while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == sal_False )
{
c = getChar();
cPeek = peekChar();
@@ -471,14 +468,14 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
// Operator?
// only for BASIC '\'' should be a comment, otherwise it is a normal string and handled there
- else if ( ( testCharFlags( c, CHAR_OPERATOR ) == TRUE ) || ( (c == '\'') && (aLanguage==HIGHLIGHT_BASIC)) )
+ else if ( ( testCharFlags( c, CHAR_OPERATOR ) == sal_True ) || ( (c == '\'') && (aLanguage==HIGHLIGHT_BASIC)) )
{
// paramters for SQL view
if ( (c==':') || (c=='?'))
{
if (c!='?')
{
- BOOL bIdentifierChar;
+ sal_Bool bIdentifierChar;
do
{
// Naechstes Zeichen holen
@@ -497,7 +494,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
if (cPeekNext=='-')
{
// Alle Zeichen bis Zeilen-Ende oder EOF entfernen
- while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == FALSE )
+ while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == sal_False )
{
getChar();
cPeekNext = peekChar();
@@ -511,7 +508,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
if (cPeekNext=='/')
{
// Alle Zeichen bis Zeilen-Ende oder EOF entfernen
- while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == FALSE )
+ while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == sal_False )
{
getChar();
cPeekNext = peekChar();
@@ -528,7 +525,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
// Alle Zeichen bis Zeilen-Ende oder EOF entfernen
sal_Unicode cPeek = c;
- while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == FALSE )
+ while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == sal_False )
{
getChar();
cPeek = peekChar();
@@ -555,7 +552,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
}
// Zahl?
- else if( testCharFlags( c, CHAR_START_NUMBER ) == TRUE )
+ else if( testCharFlags( c, CHAR_START_NUMBER ) == sal_True )
{
reType = TT_NUMBER;
@@ -597,7 +594,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
if( reType == TT_NUMBER && nRadix == 10 )
{
// Flag, ob das letzte Zeichen ein Exponent war
- BOOL bAfterExpChar = FALSE;
+ sal_Bool bAfterExpChar = sal_False;
// Alle Ziffern einlesen
while( testCharFlags( peekChar(), CHAR_IN_NUMBER ) ||
@@ -614,7 +611,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
}
// String?
- else if( testCharFlags( c, CHAR_START_STRING ) == TRUE )
+ else if( testCharFlags( c, CHAR_START_STRING ) == sal_True )
{
// Merken, welches Zeichen den String eroeffnet hat
sal_Unicode cEndString = c;
@@ -632,7 +629,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
break;
}
c = getChar();
- if( testCharFlags( c, CHAR_EOL ) == TRUE )
+ if( testCharFlags( c, CHAR_EOL ) == sal_True )
{
// ERROR: unterminated string literal
reType = TT_ERROR;
@@ -652,11 +649,11 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
}
// Zeilenende?
- else if( testCharFlags( c, CHAR_EOL ) == TRUE )
+ else if( testCharFlags( c, CHAR_EOL ) == sal_True )
{
// Falls ein weiteres anderes EOL-Char folgt, weg damit
sal_Unicode cNext = peekChar();
- if( cNext != c && testCharFlags( cNext, CHAR_EOL ) == TRUE )
+ if( cNext != c && testCharFlags( cNext, CHAR_EOL ) == sal_True )
getChar();
// Positions-Daten auf Zeilen-Beginn setzen
@@ -671,13 +668,13 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
// End-Position eintragen
rpEndPos = mpActualPos;
- return TRUE;
+ return sal_True;
}
String SimpleTokenizer_Impl::getTokStr
( /*out*/const sal_Unicode* pStartPos, /*out*/const sal_Unicode* pEndPos )
{
- return String( pStartPos, (USHORT)( pEndPos - pStartPos ) );
+ return String( pStartPos, (sal_uInt16)( pEndPos - pStartPos ) );
}
#ifdef DBG_UTIL
@@ -702,7 +699,7 @@ String SimpleTokenizer_Impl::getFullTokenStr( /*out*/TokenTypes eType,
}
if( eType != TT_EOL )
{
- aOut += String( pStartPos, (USHORT)( pEndPos - pStartPos ) );
+ aOut += String( pStartPos, (sal_uInt16)( pEndPos - pStartPos ) );
}
aOut += String( RTL_CONSTASCII_USTRINGPARAM("\n") );
return aOut;
@@ -714,10 +711,10 @@ SimpleTokenizer_Impl::SimpleTokenizer_Impl( HighlighterLanguage aLang ): aLangua
memset( aCharTypeTab, 0, sizeof( aCharTypeTab ) );
// Zeichen-Tabelle fuellen
- USHORT i;
+ sal_uInt16 i;
// Zulaessige Zeichen fuer Identifier
- USHORT nHelpMask = (USHORT)( CHAR_START_IDENTIFIER | CHAR_IN_IDENTIFIER );
+ sal_uInt16 nHelpMask = (sal_uInt16)( CHAR_START_IDENTIFIER | CHAR_IN_IDENTIFIER );
for( i = 'a' ; i <= 'z' ; i++ )
aCharTypeTab[i] |= nHelpMask;
for( i = 'A' ; i <= 'Z' ; i++ )
@@ -728,7 +725,7 @@ SimpleTokenizer_Impl::SimpleTokenizer_Impl( HighlighterLanguage aLang ): aLangua
aCharTypeTab[(int)'$'] |= nHelpMask;
// Ziffern (Identifier und Number ist moeglich)
- nHelpMask = (USHORT)( CHAR_IN_IDENTIFIER | CHAR_START_NUMBER |
+ nHelpMask = (sal_uInt16)( CHAR_IN_IDENTIFIER | CHAR_START_NUMBER |
CHAR_IN_NUMBER | CHAR_IN_HEX_NUMBER );
for( i = '0' ; i <= '9' ; i++ )
aCharTypeTab[i] |= nHelpMask;
@@ -736,7 +733,7 @@ SimpleTokenizer_Impl::SimpleTokenizer_Impl( HighlighterLanguage aLang ): aLangua
// e und E sowie . von Hand ergaenzen
aCharTypeTab[(int)'e'] |= CHAR_IN_NUMBER;
aCharTypeTab[(int)'E'] |= CHAR_IN_NUMBER;
- aCharTypeTab[(int)'.'] |= (USHORT)( CHAR_IN_NUMBER | CHAR_START_NUMBER );
+ aCharTypeTab[(int)'.'] |= (sal_uInt16)( CHAR_IN_NUMBER | CHAR_START_NUMBER );
aCharTypeTab[(int)'&'] |= CHAR_START_NUMBER;
// Hex-Ziffern
@@ -804,7 +801,7 @@ SimpleTokenizer_Impl* getSimpleTokenizer( void )
}
// Heraussuchen der jeweils naechsten Funktion aus einem JavaScript-Modul
-UINT16 SimpleTokenizer_Impl::parseLine( UINT32 nParseLine, const String* aSource )
+sal_uInt16 SimpleTokenizer_Impl::parseLine( sal_uInt32 nParseLine, const String* aSource )
{
// Position auf den Anfang des Source-Strings setzen
mpStringBegin = mpActualPos = aSource->GetBuffer();
@@ -819,14 +816,14 @@ UINT16 SimpleTokenizer_Impl::parseLine( UINT32 nParseLine, const String* aSource
const sal_Unicode* pEndPos;
// Schleife ueber alle Tokens
- UINT16 nTokenCount = 0;
+ sal_uInt16 nTokenCount = 0;
while( getNextToken( eType, pStartPos, pEndPos ) )
nTokenCount++;
return nTokenCount;
}
-void SimpleTokenizer_Impl::getHighlightPortions( UINT32 nParseLine, const String& rLine,
+void SimpleTokenizer_Impl::getHighlightPortions( sal_uInt32 nParseLine, const String& rLine,
/*out*/HighlightPortions& portions )
{
// Position auf den Anfang des Source-Strings setzen
@@ -846,11 +843,11 @@ void SimpleTokenizer_Impl::getHighlightPortions( UINT32 nParseLine, const String
{
HighlightPortion portion;
- portion.nBegin = (UINT16)(pStartPos - mpStringBegin);
- portion.nEnd = (UINT16)(pEndPos - mpStringBegin);
+ portion.nBegin = (sal_uInt16)(pStartPos - mpStringBegin);
+ portion.nEnd = (sal_uInt16)(pEndPos - mpStringBegin);
portion.tokenType = eType;
- portions.Insert(portion, portions.Count());
+ portions.push_back(portion);
}
}
@@ -892,18 +889,18 @@ void SyntaxHighlighter::initialize( HighlighterLanguage eLanguage_ )
}
}
-const Range SyntaxHighlighter::notifyChange( UINT32 nLine, INT32 nLineCountDifference,
- const String* pChangedLines, UINT32 nArrayLength)
+const Range SyntaxHighlighter::notifyChange( sal_uInt32 nLine, sal_Int32 nLineCountDifference,
+ const String* pChangedLines, sal_uInt32 nArrayLength)
{
(void)nLineCountDifference;
- for( UINT32 i=0 ; i < nArrayLength ; i++ )
+ for( sal_uInt32 i=0 ; i < nArrayLength ; i++ )
m_pSimpleTokenizer->parseLine(nLine+i, &pChangedLines[i]);
return Range( nLine, nLine + nArrayLength-1 );
}
-void SyntaxHighlighter::getHighlightPortions( UINT32 nLine, const String& rLine,
+void SyntaxHighlighter::getHighlightPortions( sal_uInt32 nLine, const String& rLine,
/*out*/HighlightPortions& portions )
{
m_pSimpleTokenizer->getHighlightPortions( nLine, rLine, portions );
diff --git a/svtools/source/edit/textdat2.hxx b/svtools/source/edit/textdat2.hxx
index df2e3ffaf6a5..579810ce37ab 100644
--- a/svtools/source/edit/textdat2.hxx
+++ b/svtools/source/edit/textdat2.hxx
@@ -56,35 +56,35 @@ class TextView;
class TETextPortion
{
private:
- USHORT nLen;
+ sal_uInt16 nLen;
long nWidth;
- BYTE nKind;
- BYTE nRightToLeft;
+ sal_uInt8 nKind;
+ sal_uInt8 nRightToLeft;
TETextPortion() { nLen = 0; nKind = PORTIONKIND_TEXT; nWidth = -1; nRightToLeft = 0;}
public:
- TETextPortion( USHORT nL ) {
+ TETextPortion( sal_uInt16 nL ) {
nLen = nL;
nKind = PORTIONKIND_TEXT;
nWidth= -1;
nRightToLeft = 0;
}
- USHORT GetLen() const { return nLen; }
- USHORT& GetLen() { return nLen; }
+ sal_uInt16 GetLen() const { return nLen; }
+ sal_uInt16& GetLen() { return nLen; }
long GetWidth()const { return nWidth; }
long& GetWidth() { return nWidth; }
- BYTE GetKind() const { return nKind; }
- BYTE& GetKind() { return nKind; }
+ sal_uInt8 GetKind() const { return nKind; }
+ sal_uInt8& GetKind() { return nKind; }
- BYTE GetRightToLeft() const { return nRightToLeft; }
- BYTE& GetRightToLeft() { return nRightToLeft; }
- BOOL IsRightToLeft() const { return (nRightToLeft&1); }
+ sal_uInt8 GetRightToLeft() const { return nRightToLeft; }
+ sal_uInt8& GetRightToLeft() { return nRightToLeft; }
+ sal_Bool IsRightToLeft() const { return (nRightToLeft&1); }
- BOOL HasValidSize() const { return nWidth != (-1); }
+ sal_Bool HasValidSize() const { return nWidth != (-1); }
};
@@ -99,17 +99,17 @@ public:
~TETextPortionList();
void Reset();
- USHORT FindPortion( USHORT nCharPos, USHORT& rPortionStart, BOOL bPreferStartingPortion = FALSE );
- USHORT GetPortionStartIndex( USHORT nPortion );
- void DeleteFromPortion( USHORT nDelFrom );
+ sal_uInt16 FindPortion( sal_uInt16 nCharPos, sal_uInt16& rPortionStart, sal_Bool bPreferStartingPortion = sal_False );
+ sal_uInt16 GetPortionStartIndex( sal_uInt16 nPortion );
+ void DeleteFromPortion( sal_uInt16 nDelFrom );
};
struct TEWritingDirectionInfo
{
- BYTE nType;
- USHORT nStartPos;
- USHORT nEndPos;
- TEWritingDirectionInfo( BYTE _Type, USHORT _Start, USHORT _End )
+ sal_uInt8 nType;
+ sal_uInt16 nStartPos;
+ sal_uInt16 nEndPos;
+ TEWritingDirectionInfo( sal_uInt8 _Type, sal_uInt16 _Start, sal_uInt16 _End )
{
nType = _Type;
nStartPos = _Start;
@@ -122,65 +122,65 @@ SV_DECL_VARARR( TEWritingDirectionInfos, TEWritingDirectionInfo, 0, 4 )
class TextLine
{
private:
- USHORT mnStart;
- USHORT mnEnd;
- USHORT mnStartPortion;
- USHORT mnEndPortion;
+ sal_uInt16 mnStart;
+ sal_uInt16 mnEnd;
+ sal_uInt16 mnStartPortion;
+ sal_uInt16 mnEndPortion;
short mnStartX;
- BOOL mbInvalid; // fuer geschickte Formatierung/Ausgabe
+ sal_Bool mbInvalid; // fuer geschickte Formatierung/Ausgabe
public:
TextLine() {
mnStart = mnEnd = 0;
mnStartPortion = mnEndPortion = 0;
mnStartX = 0;
- mbInvalid = TRUE;
+ mbInvalid = sal_True;
}
- BOOL IsIn( USHORT nIndex ) const
+ sal_Bool IsIn( sal_uInt16 nIndex ) const
{ return ( (nIndex >= mnStart ) && ( nIndex < mnEnd ) ); }
- BOOL IsIn( USHORT nIndex, BOOL bInclEnd ) const
+ sal_Bool IsIn( sal_uInt16 nIndex, sal_Bool bInclEnd ) const
{ return ( ( nIndex >= mnStart ) && ( bInclEnd ? ( nIndex <= mnEnd ) : ( nIndex < mnEnd ) ) ); }
- void SetStart( USHORT n ) { mnStart = n; }
- USHORT GetStart() const { return mnStart; }
- USHORT& GetStart() { return mnStart; }
+ void SetStart( sal_uInt16 n ) { mnStart = n; }
+ sal_uInt16 GetStart() const { return mnStart; }
+ sal_uInt16& GetStart() { return mnStart; }
- void SetEnd( USHORT n ) { mnEnd = n; }
- USHORT GetEnd() const { return mnEnd; }
- USHORT& GetEnd() { return mnEnd; }
+ void SetEnd( sal_uInt16 n ) { mnEnd = n; }
+ sal_uInt16 GetEnd() const { return mnEnd; }
+ sal_uInt16& GetEnd() { return mnEnd; }
- void SetStartPortion( USHORT n ) { mnStartPortion = n; }
- USHORT GetStartPortion() const { return mnStartPortion; }
- USHORT& GetStartPortion() { return mnStartPortion; }
+ void SetStartPortion( sal_uInt16 n ) { mnStartPortion = n; }
+ sal_uInt16 GetStartPortion() const { return mnStartPortion; }
+ sal_uInt16& GetStartPortion() { return mnStartPortion; }
- void SetEndPortion( USHORT n ) { mnEndPortion = n; }
- USHORT GetEndPortion() const { return mnEndPortion; }
- USHORT& GetEndPortion() { return mnEndPortion; }
+ void SetEndPortion( sal_uInt16 n ) { mnEndPortion = n; }
+ sal_uInt16 GetEndPortion() const { return mnEndPortion; }
+ sal_uInt16& GetEndPortion() { return mnEndPortion; }
- USHORT GetLen() const { return mnEnd - mnStart; }
+ sal_uInt16 GetLen() const { return mnEnd - mnStart; }
- BOOL IsInvalid() const { return mbInvalid; }
- BOOL IsValid() const { return !mbInvalid; }
- void SetInvalid() { mbInvalid = TRUE; }
- void SetValid() { mbInvalid = FALSE; }
+ sal_Bool IsInvalid() const { return mbInvalid; }
+ sal_Bool IsValid() const { return !mbInvalid; }
+ void SetInvalid() { mbInvalid = sal_True; }
+ void SetValid() { mbInvalid = sal_False; }
- BOOL IsEmpty() const { return (mnEnd > mnStart) ? FALSE : TRUE; }
+ sal_Bool IsEmpty() const { return (mnEnd > mnStart) ? sal_False : sal_True; }
short GetStartX() const { return mnStartX; }
void SetStartX( short n ) { mnStartX = n; }
- inline BOOL operator == ( const TextLine& rLine ) const;
- inline BOOL operator != ( const TextLine& rLine ) const;
+ inline sal_Bool operator == ( const TextLine& rLine ) const;
+ inline sal_Bool operator != ( const TextLine& rLine ) const;
};
typedef TextLine* TextLinePtr;
SV_DECL_PTRARR_DEL( TextLines, TextLinePtr, 1, 4 )
-inline BOOL TextLine::operator == ( const TextLine& rLine ) const
+inline sal_Bool TextLine::operator == ( const TextLine& rLine ) const
{
return ( ( mnStart == rLine.mnStart ) &&
( mnEnd == rLine.mnEnd ) &&
@@ -188,7 +188,7 @@ inline BOOL TextLine::operator == ( const TextLine& rLine ) const
( mnEndPortion == rLine.mnEndPortion ) );
}
-inline BOOL TextLine::operator != ( const TextLine& rLine ) const
+inline sal_Bool TextLine::operator != ( const TextLine& rLine ) const
{
return !( *this == rLine );
}
@@ -205,11 +205,11 @@ private:
TEWritingDirectionInfos maWritingDirectionInfos;
- USHORT mnInvalidPosStart;
+ sal_uInt16 mnInvalidPosStart;
short mnInvalidDiff;
- BOOL mbInvalid;
- BOOL mbSimple; // nur lineares Tippen
+ sal_Bool mbInvalid;
+ sal_Bool mbSimple; // nur lineares Tippen
TEParaPortion( const TEParaPortion& ) {;}
@@ -219,15 +219,15 @@ public:
~TEParaPortion();
- BOOL IsInvalid() const { return mbInvalid; }
- BOOL IsSimpleInvalid() const { return mbSimple; }
- void SetNotSimpleInvalid() { mbSimple = FALSE; }
- void SetValid() { mbInvalid = FALSE; mbSimple = TRUE;}
+ sal_Bool IsInvalid() const { return mbInvalid; }
+ sal_Bool IsSimpleInvalid() const { return mbSimple; }
+ void SetNotSimpleInvalid() { mbSimple = sal_False; }
+ void SetValid() { mbInvalid = sal_False; mbSimple = sal_True;}
- void MarkInvalid( USHORT nStart, short nDiff);
- void MarkSelectionInvalid( USHORT nStart, USHORT nEnd );
+ void MarkInvalid( sal_uInt16 nStart, short nDiff);
+ void MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 nEnd );
- USHORT GetInvalidPosStart() const { return mnInvalidPosStart; }
+ sal_uInt16 GetInvalidPosStart() const { return mnInvalidPosStart; }
short GetInvalidDiff() const { return mnInvalidDiff; }
TextNode* GetNode() const { return mpNode; }
@@ -236,8 +236,8 @@ public:
TEWritingDirectionInfos& GetWritingDirectionInfos() { return maWritingDirectionInfos; }
- USHORT GetLineNumber( USHORT nIndex, BOOL bInclEnd );
- void CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLine );
+ sal_uInt16 GetLineNumber( sal_uInt16 nIndex, sal_Bool bInclEnd );
+ void CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormattedLine );
};
@@ -262,9 +262,9 @@ public:
virtual void CreateAnchor();
- virtual BOOL SetCursorAtPoint( const Point& rPointPixel, BOOL bDontSelectAtCursor = FALSE );
+ virtual sal_Bool SetCursorAtPoint( const Point& rPointPixel, sal_Bool bDontSelectAtCursor = sal_False );
- virtual BOOL IsSelectionAtPoint( const Point& rPointPixel );
+ virtual sal_Bool IsSelectionAtPoint( const Point& rPointPixel );
virtual void DeselectAll();
virtual void DeselectAtPoint( const Point& );
@@ -276,13 +276,13 @@ class IdleFormatter : public Timer
{
private:
TextView* mpView;
- USHORT mnRestarts;
+ sal_uInt16 mnRestarts;
public:
IdleFormatter();
~IdleFormatter();
- void DoIdleFormat( TextView* pV, USHORT nMaxRestarts );
+ void DoIdleFormat( TextView* pV, sal_uInt16 nMaxRestarts );
void ForceTimeout();
TextView* GetView() { return mpView; }
};
@@ -292,14 +292,14 @@ struct TextDDInfo
Cursor maCursor;
TextPaM maDropPos;
- BOOL mbStarterOfDD;
- BOOL mbVisCursor;
+ sal_Bool mbStarterOfDD;
+ sal_Bool mbVisCursor;
TextDDInfo()
{
maCursor.SetStyle( CURSOR_SHADOW );
- mbStarterOfDD = FALSE;
- mbVisCursor = FALSE;
+ mbStarterOfDD = sal_False;
+ mbVisCursor = sal_False;
}
};
diff --git a/svtools/source/edit/textdata.cxx b/svtools/source/edit/textdata.cxx
index 18301a181fae..d1586de4352a 100644
--- a/svtools/source/edit/textdata.cxx
+++ b/svtools/source/edit/textdata.cxx
@@ -38,7 +38,7 @@ SV_IMPL_PTRARR( TextLines, TextLinePtr );
SV_IMPL_VARARR( TEWritingDirectionInfos, TEWritingDirectionInfo );
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class TextSelection
// -------------------------------------------------------------------------
@@ -67,7 +67,7 @@ void TextSelection::Justify()
}
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class TETextPortionList
// -------------------------------------------------------------------------
TETextPortionList::TETextPortionList()
@@ -81,24 +81,24 @@ TETextPortionList::~TETextPortionList()
void TETextPortionList::Reset()
{
- for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ )
+ for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ )
delete GetObject( nPortion );
Remove( 0, Count() );
}
-void TETextPortionList::DeleteFromPortion( USHORT nDelFrom )
+void TETextPortionList::DeleteFromPortion( sal_uInt16 nDelFrom )
{
DBG_ASSERT( ( nDelFrom < Count() ) || ( (nDelFrom == 0) && (Count() == 0) ), "DeleteFromPortion: Out of range" );
- for ( USHORT nP = nDelFrom; nP < Count(); nP++ )
+ for ( sal_uInt16 nP = nDelFrom; nP < Count(); nP++ )
delete GetObject( nP );
Remove( nDelFrom, Count()-nDelFrom );
}
-USHORT TETextPortionList::FindPortion( USHORT nCharPos, USHORT& nPortionStart, BOOL bPreferStartingPortion )
+sal_uInt16 TETextPortionList::FindPortion( sal_uInt16 nCharPos, sal_uInt16& nPortionStart, sal_Bool bPreferStartingPortion )
{
// Bei nCharPos an Portion-Grenze wird die linke Portion gefunden
- USHORT nTmpPos = 0;
- for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ )
+ sal_uInt16 nTmpPos = 0;
+ for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ )
{
TETextPortion* pPortion = GetObject( nPortion );
nTmpPos = nTmpPos + pPortion->GetLen();
@@ -117,10 +117,10 @@ USHORT TETextPortionList::FindPortion( USHORT nCharPos, USHORT& nPortionStart, B
}
/*
-USHORT TETextPortionList::GetPortionStartIndex( USHORT nPortion )
+sal_uInt16 TETextPortionList::GetPortionStartIndex( sal_uInt16 nPortion )
{
- USHORT nPos = 0;
- for ( USHORT nP = 0; nP < nPortion; nP++ )
+ sal_uInt16 nPos = 0;
+ for ( sal_uInt16 nP = 0; nP < nPortion; nP++ )
{
TETextPortion* pPortion = GetObject( nP );
nPos += pPortion->GetLen();
@@ -130,24 +130,24 @@ USHORT TETextPortionList::GetPortionStartIndex( USHORT nPortion )
*/
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class TEParaPortion
// -------------------------------------------------------------------------
TEParaPortion::TEParaPortion( TextNode* pN )
{
mpNode = pN;
mnInvalidPosStart = mnInvalidDiff = 0;
- mbInvalid = TRUE;
- mbSimple = FALSE;
+ mbInvalid = sal_True;
+ mbSimple = sal_False;
}
TEParaPortion::~TEParaPortion()
{
}
-void TEParaPortion::MarkInvalid( USHORT nStart, short nDiff )
+void TEParaPortion::MarkInvalid( sal_uInt16 nStart, short nDiff )
{
- if ( mbInvalid == FALSE )
+ if ( mbInvalid == sal_False )
{
mnInvalidPosStart = ( nDiff >= 0 ) ? nStart : ( nStart + nDiff );
mnInvalidDiff = nDiff;
@@ -169,20 +169,20 @@ void TEParaPortion::MarkInvalid( USHORT nStart, short nDiff )
else
{
DBG_ASSERT( ( nDiff >= 0 ) || ( (nStart+nDiff) >= 0 ), "MarkInvalid: Diff out of Range" );
- mnInvalidPosStart = Min( mnInvalidPosStart, (USHORT) ( (nDiff < 0) ? nStart+nDiff : nDiff ) );
+ mnInvalidPosStart = Min( mnInvalidPosStart, (sal_uInt16) ( (nDiff < 0) ? nStart+nDiff : nDiff ) );
mnInvalidDiff = 0;
- mbSimple = FALSE;
+ mbSimple = sal_False;
}
}
maWritingDirectionInfos.Remove( 0, maWritingDirectionInfos.Count() );
- mbInvalid = TRUE;
+ mbInvalid = sal_True;
}
-void TEParaPortion::MarkSelectionInvalid( USHORT nStart, USHORT /*nEnd*/ )
+void TEParaPortion::MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 /*nEnd*/ )
{
- if ( mbInvalid == FALSE )
+ if ( mbInvalid == sal_False )
{
mnInvalidPosStart = nStart;
// nInvalidPosEnd = nEnd;
@@ -196,13 +196,13 @@ void TEParaPortion::MarkSelectionInvalid( USHORT nStart, USHORT /*nEnd*/ )
maWritingDirectionInfos.Remove( 0, maWritingDirectionInfos.Count() );
mnInvalidDiff = 0;
- mbInvalid = TRUE;
- mbSimple = FALSE;
+ mbInvalid = sal_True;
+ mbSimple = sal_False;
}
-USHORT TEParaPortion::GetLineNumber( USHORT nChar, BOOL bInclEnd )
+sal_uInt16 TEParaPortion::GetLineNumber( sal_uInt16 nChar, sal_Bool bInclEnd )
{
- for ( USHORT nLine = 0; nLine < maLines.Count(); nLine++ )
+ for ( sal_uInt16 nLine = 0; nLine < maLines.Count(); nLine++ )
{
TextLine* pLine = maLines.GetObject( nLine );
if ( ( bInclEnd && ( pLine->GetEnd() >= nChar ) ) ||
@@ -219,9 +219,9 @@ USHORT TEParaPortion::GetLineNumber( USHORT nChar, BOOL bInclEnd )
}
-void TEParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLine )
+void TEParaPortion::CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormattedLine )
{
- USHORT nLines = maLines.Count();
+ sal_uInt16 nLines = maLines.Count();
DBG_ASSERT( nLines, "CorrectPortionNumbersFromLine: Leere Portion?" );
if ( nLastFormattedLine < ( nLines - 1 ) )
{
@@ -239,7 +239,7 @@ void TEParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedL
short nTDiff = sal::static_int_cast< short >(-( nTextDiff-1 ));
if ( nPDiff || nTDiff )
{
- for ( USHORT nL = nLastFormattedLine+1; nL < nLines; nL++ )
+ for ( sal_uInt16 nL = nLastFormattedLine+1; nL < nLines; nL++ )
{
TextLine* pLine = maLines[ nL ];
@@ -255,7 +255,7 @@ void TEParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedL
}
}
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class TEParaPortions
// -------------------------------------------------------------------------
TEParaPortions::TEParaPortions()
@@ -275,7 +275,7 @@ void TEParaPortions::Reset()
clear();
}
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class IdleFormatter
// -------------------------------------------------------------------------
IdleFormatter::IdleFormatter()
@@ -289,7 +289,7 @@ IdleFormatter::~IdleFormatter()
mpView = 0;
}
-void IdleFormatter::DoIdleFormat( TextView* pV, USHORT nMaxRestarts )
+void IdleFormatter::DoIdleFormat( TextView* pV, sal_uInt16 nMaxRestarts )
{
mpView = pV;
@@ -319,12 +319,12 @@ void IdleFormatter::ForceTimeout()
TYPEINIT1( TextHint, SfxSimpleHint );
-TextHint::TextHint( ULONG Id ) : SfxSimpleHint( Id )
+TextHint::TextHint( sal_uLong Id ) : SfxSimpleHint( Id )
{
mnValue = 0;
}
-TextHint::TextHint( ULONG Id, ULONG nValue ) : SfxSimpleHint( Id )
+TextHint::TextHint( sal_uLong Id, sal_uLong nValue ) : SfxSimpleHint( Id )
{
mnValue = nValue;
}
@@ -334,9 +334,9 @@ TEIMEInfos::TEIMEInfos( const TextPaM& rPos, const String& rOldTextAfterStartPos
{
aPos = rPos;
nLen = 0;
- bCursor = TRUE;
+ bCursor = sal_True;
pAttribs = NULL;
- bWasCursorOverwrite = FALSE;
+ bWasCursorOverwrite = sal_False;
}
TEIMEInfos::~TEIMEInfos()
@@ -344,12 +344,12 @@ TEIMEInfos::~TEIMEInfos()
delete[] pAttribs;
}
-void TEIMEInfos::CopyAttribs( const USHORT* pA, USHORT nL )
+void TEIMEInfos::CopyAttribs( const sal_uInt16* pA, sal_uInt16 nL )
{
nLen = nL;
delete pAttribs;
- pAttribs = new USHORT[ nL ];
- memcpy( pAttribs, pA, nL*sizeof(USHORT) );
+ pAttribs = new sal_uInt16[ nL ];
+ memcpy( pAttribs, pA, nL*sizeof(sal_uInt16) );
}
void TEIMEInfos::DestroyAttribs()
diff --git a/svtools/source/edit/textdoc.cxx b/svtools/source/edit/textdoc.cxx
index 59072e2e1d9f..b4eeb76d8a06 100644
--- a/svtools/source/edit/textdoc.cxx
+++ b/svtools/source/edit/textdoc.cxx
@@ -28,7 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-
#include <textdoc.hxx>
#include <stdlib.h>
@@ -67,7 +66,7 @@ CompareStart( const void* pFirst, const void* pSecond )
// -------------------------------------------------------------------------
// (+) class TextCharAttrib
// -------------------------------------------------------------------------
-TextCharAttrib::TextCharAttrib( const TextAttrib& rAttr, USHORT nStart, USHORT nEnd )
+TextCharAttrib::TextCharAttrib( const TextAttrib& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd )
{
mpAttr = rAttr.Clone();
mnStart = nStart,
@@ -92,7 +91,7 @@ TextCharAttrib::~TextCharAttrib()
TextCharAttribList::TextCharAttribList()
{
- mbHasEmptyAttribs = FALSE;
+ mbHasEmptyAttribs = sal_False;
}
TextCharAttribList::~TextCharAttribList()
@@ -100,7 +99,7 @@ TextCharAttribList::~TextCharAttribList()
// PTRARR_DEL
}
-void TextCharAttribList::Clear( BOOL bDestroyAttribs )
+void TextCharAttribList::Clear( sal_Bool bDestroyAttribs )
{
if ( bDestroyAttribs )
TextCharAttribs::DeleteAndDestroy( 0, Count() );
@@ -112,18 +111,18 @@ void TextCharAttribList::Clear( BOOL bDestroyAttribs )
void TextCharAttribList::InsertAttrib( TextCharAttrib* pAttrib )
{
if ( pAttrib->IsEmpty() )
- mbHasEmptyAttribs = TRUE;
+ mbHasEmptyAttribs = sal_True;
- const USHORT nCount = Count();
- const USHORT nStart = pAttrib->GetStart(); // vielleicht besser fuer Comp.Opt.
- BOOL bInserted = FALSE;
- for ( USHORT x = 0; x < nCount; x++ )
+ const sal_uInt16 nCount = Count();
+ const sal_uInt16 nStart = pAttrib->GetStart(); // vielleicht besser fuer Comp.Opt.
+ sal_Bool bInserted = sal_False;
+ for ( sal_uInt16 x = 0; x < nCount; x++ )
{
TextCharAttrib* pCurAttrib = GetObject( x );
if ( pCurAttrib->GetStart() > nStart )
{
Insert( pAttrib, x );
- bInserted = TRUE;
+ bInserted = sal_True;
break;
}
}
@@ -137,12 +136,12 @@ void TextCharAttribList::ResortAttribs()
qsort( (void*)GetData(), Count(), sizeof( TextCharAttrib* ), CompareStart );
}
-TextCharAttrib* TextCharAttribList::FindAttrib( USHORT nWhich, USHORT nPos )
+TextCharAttrib* TextCharAttribList::FindAttrib( sal_uInt16 nWhich, sal_uInt16 nPos )
{
// Rueckwaerts, falls eins dort endet, das naechste startet.
// => Das startende gilt...
- for ( USHORT nAttr = Count(); nAttr; )
+ for ( sal_uInt16 nAttr = Count(); nAttr; )
{
TextCharAttrib* pAttr = GetObject( --nAttr );
@@ -155,11 +154,11 @@ TextCharAttrib* TextCharAttribList::FindAttrib( USHORT nWhich, USHORT nPos )
return NULL;
}
-TextCharAttrib* TextCharAttribList::FindNextAttrib( USHORT nWhich, USHORT nFromPos, USHORT nMaxPos ) const
+TextCharAttrib* TextCharAttribList::FindNextAttrib( sal_uInt16 nWhich, sal_uInt16 nFromPos, sal_uInt16 nMaxPos ) const
{
DBG_ASSERT( nWhich, "FindNextAttrib: Which?" );
- const USHORT nAttribs = Count();
- for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ const sal_uInt16 nAttribs = Count();
+ for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ )
{
TextCharAttrib* pAttr = GetObject( nAttr );
if ( ( pAttr->GetStart() >= nFromPos ) &&
@@ -170,41 +169,41 @@ TextCharAttrib* TextCharAttribList::FindNextAttrib( USHORT nWhich, USHORT nFromP
return NULL;
}
-BOOL TextCharAttribList::HasAttrib( USHORT nWhich ) const
+sal_Bool TextCharAttribList::HasAttrib( sal_uInt16 nWhich ) const
{
- for ( USHORT nAttr = Count(); nAttr; )
+ for ( sal_uInt16 nAttr = Count(); nAttr; )
{
const TextCharAttrib* pAttr = GetObject( --nAttr );
if ( pAttr->Which() == nWhich )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL TextCharAttribList::HasBoundingAttrib( USHORT nBound )
+sal_Bool TextCharAttribList::HasBoundingAttrib( sal_uInt16 nBound )
{
// Rueckwaerts, falls eins dort endet, das naechste startet.
// => Das startende gilt...
- for ( USHORT nAttr = Count(); nAttr; )
+ for ( sal_uInt16 nAttr = Count(); nAttr; )
{
TextCharAttrib* pAttr = GetObject( --nAttr );
if ( pAttr->GetEnd() < nBound )
- return FALSE;
+ return sal_False;
if ( ( pAttr->GetStart() == nBound ) || ( pAttr->GetEnd() == nBound ) )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-TextCharAttrib* TextCharAttribList::FindEmptyAttrib( USHORT nWhich, USHORT nPos )
+TextCharAttrib* TextCharAttribList::FindEmptyAttrib( sal_uInt16 nWhich, sal_uInt16 nPos )
{
if ( !mbHasEmptyAttribs )
return 0;
- const USHORT nAttribs = Count();
- for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ const sal_uInt16 nAttribs = Count();
+ for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ )
{
TextCharAttrib* pAttr = GetObject( nAttr );
if ( pAttr->GetStart() > nPos )
@@ -218,7 +217,7 @@ TextCharAttrib* TextCharAttribList::FindEmptyAttrib( USHORT nWhich, USHORT nPos
void TextCharAttribList::DeleteEmptyAttribs()
{
- for ( USHORT nAttr = 0; nAttr < Count(); nAttr++ )
+ for ( sal_uInt16 nAttr = 0; nAttr < Count(); nAttr++ )
{
TextCharAttrib* pAttr = GetObject( nAttr );
if ( pAttr->IsEmpty() )
@@ -228,19 +227,19 @@ void TextCharAttribList::DeleteEmptyAttribs()
nAttr--;
}
}
- mbHasEmptyAttribs = FALSE;
+ mbHasEmptyAttribs = sal_False;
}
#ifdef DBG_UTIL
-BOOL TextCharAttribList::DbgCheckAttribs()
+sal_Bool TextCharAttribList::DbgCheckAttribs()
{
- BOOL bOK = TRUE;
- for ( USHORT nAttr = 0; nAttr < Count(); nAttr++ )
+ sal_Bool bOK = sal_True;
+ for ( sal_uInt16 nAttr = 0; nAttr < Count(); nAttr++ )
{
TextCharAttrib* pAttr = GetObject( nAttr );
if ( pAttr->GetStart() > pAttr->GetEnd() )
{
- bOK = FALSE;
+ bOK = sal_False;
OSL_FAIL( "Attr verdreht" );
}
}
@@ -257,14 +256,14 @@ TextNode::TextNode( const String& rText ) :
{
}
-void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew )
+void TextNode::ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNew )
{
if ( !nNew )
return;
- BOOL bResort = FALSE;
- USHORT nAttribs = maCharAttribs.Count();
- for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ sal_Bool bResort = sal_False;
+ sal_uInt16 nAttribs = maCharAttribs.Count();
+ for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ )
{
TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr );
if ( pAttrib->GetEnd() >= nIndex )
@@ -295,7 +294,7 @@ void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew )
pAttrib->Expand( nNew );
}
else
- bResort = TRUE;
+ bResort = sal_True;
}
// 2: Attribut startet davor, geht hinter Index...
else if ( ( pAttrib->GetStart() < nIndex ) && ( pAttrib->GetEnd() > nIndex ) )
@@ -308,7 +307,7 @@ void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew )
if ( nIndex == 0 )
{
pAttrib->Expand( nNew );
-// bResort = TRUE; // es gibt ja keine Features mehr...
+// bResort = sal_True; // es gibt ja keine Features mehr...
}
else
pAttrib->MoveForward( nNew );
@@ -328,18 +327,18 @@ void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew )
#endif
}
-void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted )
+void TextNode::CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDeleted )
{
if ( !nDeleted )
return;
- BOOL bResort = FALSE;
- USHORT nEndChanges = nIndex+nDeleted;
+ sal_Bool bResort = sal_False;
+ sal_uInt16 nEndChanges = nIndex+nDeleted;
- for ( USHORT nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ )
+ for ( sal_uInt16 nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ )
{
TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr );
- BOOL bDelAttr = FALSE;
+ sal_Bool bDelAttr = sal_False;
if ( pAttrib->GetEnd() >= nIndex )
{
// Alles Attribute hinter der Einfuegeposition verschieben...
@@ -355,7 +354,7 @@ void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted )
if ( ( pAttrib->GetStart() == nIndex ) && ( pAttrib->GetEnd() == nEndChanges ) )
pAttrib->GetEnd() = nIndex; // leer
else
- bDelAttr = TRUE;
+ bDelAttr = sal_True;
}
// 2. Attribut beginnt davor, endet drinnen oder dahinter...
else if ( ( pAttrib->GetStart() <= nIndex ) && ( pAttrib->GetEnd() > nIndex ) )
@@ -378,13 +377,13 @@ void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted )
DBG_ASSERT( ( pAttrib->GetEnd() <= maText.Len()) || bDelAttr, "Collaps: Attrib groesser als Absatz!" );
if ( bDelAttr /* || pAttrib->IsEmpty() */ )
{
- bResort = TRUE;
+ bResort = sal_True;
maCharAttribs.RemoveAttrib( nAttr );
delete pAttrib;
nAttr--;
}
else if ( pAttrib->IsEmpty() )
- maCharAttribs.HasEmptyAttribs() = TRUE;
+ maCharAttribs.HasEmptyAttribs() = sal_True;
}
if ( bResort )
@@ -395,25 +394,25 @@ void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted )
#endif
}
-void TextNode::InsertText( USHORT nPos, const String& rText )
+void TextNode::InsertText( sal_uInt16 nPos, const String& rText )
{
maText.Insert( rText, nPos );
ExpandAttribs( nPos, rText.Len() );
}
-void TextNode::InsertText( USHORT nPos, sal_Unicode c )
+void TextNode::InsertText( sal_uInt16 nPos, sal_Unicode c )
{
maText.Insert( c, nPos );
ExpandAttribs( nPos, 1 );
}
-void TextNode::RemoveText( USHORT nPos, USHORT nChars )
+void TextNode::RemoveText( sal_uInt16 nPos, sal_uInt16 nChars )
{
maText.Erase( nPos, nChars );
CollapsAttribs( nPos, nChars );
}
-TextNode* TextNode::Split( USHORT nPos, BOOL bKeepEndingAttribs )
+TextNode* TextNode::Split( sal_uInt16 nPos, sal_Bool bKeepEndingAttribs )
{
String aNewText;
if ( nPos < maText.Len() )
@@ -423,7 +422,7 @@ TextNode* TextNode::Split( USHORT nPos, BOOL bKeepEndingAttribs )
}
TextNode* pNew = new TextNode( aNewText );
- for ( USHORT nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ )
+ for ( sal_uInt16 nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ )
{
TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr );
if ( pAttrib->GetEnd() < nPos )
@@ -471,7 +470,7 @@ TextNode* TextNode::Split( USHORT nPos, BOOL bKeepEndingAttribs )
void TextNode::Append( const TextNode& rNode )
{
- USHORT nOldLen = maText.Len();
+ sal_uInt16 nOldLen = maText.Len();
maText += rNode.GetText();
@@ -479,16 +478,16 @@ void TextNode::Append( const TextNode& rNode )
DBG_ASSERT( maCharAttribs.DbgCheckAttribs(), "Attribute VOR AppendAttribs kaputt" );
#endif
- const USHORT nAttribs = rNode.GetCharAttribs().Count();
- for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ const sal_uInt16 nAttribs = rNode.GetCharAttribs().Count();
+ for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ )
{
TextCharAttrib* pAttrib = rNode.GetCharAttribs().GetAttrib( nAttr );
- BOOL bMelted = FALSE;
+ sal_Bool bMelted = sal_False;
if ( pAttrib->GetStart() == 0 )
{
// Evtl koennen Attribute zusammengefasst werden:
- USHORT nTmpAttribs = maCharAttribs.Count();
- for ( USHORT nTmpAttr = 0; nTmpAttr < nTmpAttribs; nTmpAttr++ )
+ sal_uInt16 nTmpAttribs = maCharAttribs.Count();
+ for ( sal_uInt16 nTmpAttr = 0; nTmpAttr < nTmpAttribs; nTmpAttr++ )
{
TextCharAttrib* pTmpAttrib = maCharAttribs.GetAttrib( nTmpAttr );
@@ -499,7 +498,7 @@ void TextNode::Append( const TextNode& rNode )
{
pTmpAttrib->GetEnd() =
pTmpAttrib->GetEnd() + pAttrib->GetLen();
- bMelted = TRUE;
+ bMelted = sal_True;
break; // es kann nur eins von der Sorte an der Stelle geben
}
}
@@ -541,15 +540,15 @@ void TextDoc::Clear()
void TextDoc::DestroyTextNodes()
{
- for ( ULONG nNode = 0; nNode < maTextNodes.Count(); nNode++ )
+ for ( sal_uLong nNode = 0; nNode < maTextNodes.Count(); nNode++ )
delete maTextNodes.GetObject( nNode );
maTextNodes.clear();
}
String TextDoc::GetText( const sal_Unicode* pSep ) const
{
- ULONG nLen = GetTextLen( pSep );
- ULONG nNodes = maTextNodes.Count();
+ sal_uLong nLen = GetTextLen( pSep );
+ sal_uLong nNodes = maTextNodes.Count();
if ( nLen > STRING_MAXLEN )
{
@@ -558,8 +557,8 @@ String TextDoc::GetText( const sal_Unicode* pSep ) const
}
String aASCIIText;
- ULONG nLastNode = nNodes-1;
- for ( ULONG nNode = 0; nNode < nNodes; nNode++ )
+ sal_uLong nLastNode = nNodes-1;
+ for ( sal_uLong nNode = 0; nNode < nNodes; nNode++ )
{
TextNode* pNode = maTextNodes.GetObject( nNode );
String aTmp( pNode->GetText() );
@@ -571,7 +570,7 @@ String TextDoc::GetText( const sal_Unicode* pSep ) const
return aASCIIText;
}
-XubString TextDoc::GetText( ULONG nPara ) const
+XubString TextDoc::GetText( sal_uLong nPara ) const
{
XubString aText;
TextNode* pNode = ( nPara < maTextNodes.Count() ) ? maTextNodes.GetObject( nPara ) : 0;
@@ -582,26 +581,26 @@ XubString TextDoc::GetText( ULONG nPara ) const
}
-ULONG TextDoc::GetTextLen( const xub_Unicode* pSep, const TextSelection* pSel ) const
+sal_uLong TextDoc::GetTextLen( const xub_Unicode* pSep, const TextSelection* pSel ) const
{
- ULONG nLen = 0;
- ULONG nNodes = maTextNodes.Count();
+ sal_uLong nLen = 0;
+ sal_uLong nNodes = maTextNodes.Count();
if ( nNodes )
{
- ULONG nStartNode = 0;
- ULONG nEndNode = nNodes-1;
+ sal_uLong nStartNode = 0;
+ sal_uLong nEndNode = nNodes-1;
if ( pSel )
{
nStartNode = pSel->GetStart().GetPara();
nEndNode = pSel->GetEnd().GetPara();
}
- for ( ULONG nNode = nStartNode; nNode <= nEndNode; nNode++ )
+ for ( sal_uLong nNode = nStartNode; nNode <= nEndNode; nNode++ )
{
TextNode* pNode = maTextNodes.GetObject( nNode );
- USHORT nS = 0;
- ULONG nE = pNode->GetText().Len();
+ sal_uInt16 nS = 0;
+ sal_uLong nE = pNode->GetText().Len();
if ( pSel && ( nNode == pSel->GetStart().GetPara() ) )
nS = pSel->GetStart().GetIndex();
if ( pSel && ( nNode == pSel->GetEnd().GetPara() ) )
@@ -641,7 +640,7 @@ TextPaM TextDoc::InsertText( const TextPaM& rPaM, const XubString& rStr )
return aPaM;
}
-TextPaM TextDoc::InsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs )
+TextPaM TextDoc::InsertParaBreak( const TextPaM& rPaM, sal_Bool bKeepEndingAttribs )
{
TextNode* pNode = maTextNodes.GetObject( rPaM.GetPara() );
TextNode* pNew = pNode->Split( rPaM.GetIndex(), bKeepEndingAttribs );
@@ -654,20 +653,20 @@ TextPaM TextDoc::InsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs )
TextPaM TextDoc::ConnectParagraphs( TextNode* pLeft, TextNode* pRight )
{
- USHORT nPrevLen = pLeft->GetText().Len();
+ sal_uInt16 nPrevLen = pLeft->GetText().Len();
pLeft->Append( *pRight );
// der rechte verschwindet.
- ULONG nRight = maTextNodes.GetPos( pRight );
+ sal_uLong nRight = maTextNodes.GetPos( pRight );
maTextNodes.Remove( nRight );
delete pRight;
- ULONG nLeft = maTextNodes.GetPos( pLeft );
+ sal_uLong nLeft = maTextNodes.GetPos( pLeft );
TextPaM aPaM( nLeft, nPrevLen );
return aPaM;
}
-TextPaM TextDoc::RemoveChars( const TextPaM& rPaM, USHORT nChars )
+TextPaM TextDoc::RemoveChars( const TextPaM& rPaM, sal_uInt16 nChars )
{
TextNode* pNode = maTextNodes.GetObject( rPaM.GetPara() );
pNode->RemoveText( rPaM.GetIndex(), nChars );
@@ -675,20 +674,20 @@ TextPaM TextDoc::RemoveChars( const TextPaM& rPaM, USHORT nChars )
return rPaM;
}
-BOOL TextDoc::IsValidPaM( const TextPaM& rPaM )
+sal_Bool TextDoc::IsValidPaM( const TextPaM& rPaM )
{
if ( rPaM.GetPara() >= maTextNodes.Count() )
{
OSL_FAIL( "PaM: Para out of range" );
- return FALSE;
+ return sal_False;
}
TextNode * pNode = maTextNodes.GetObject( rPaM.GetPara() );
if ( rPaM.GetIndex() > pNode->GetText().Len() )
{
OSL_FAIL( "PaM: Index out of range" );
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/edit/textdoc.hxx b/svtools/source/edit/textdoc.hxx
index ea7619f3da25..c52190ca4d63 100644
--- a/svtools/source/edit/textdoc.hxx
+++ b/svtools/source/edit/textdoc.hxx
@@ -31,7 +31,7 @@
#include <svl/svarray.hxx>
#include <svtools/textdata.hxx>
-#include <txtattr.hxx>
+#include <svtools/txtattr.hxx>
#include <tools/debug.hxx>
#include <tools/string.hxx>
@@ -42,7 +42,7 @@ SV_DECL_PTRARR_DEL( TextCharAttribs, TextCharAttribPtr, 0, 4 )
class TextCharAttribList : private TextCharAttribs
{
private:
- BOOL mbHasEmptyAttribs;
+ sal_Bool mbHasEmptyAttribs;
TextCharAttribList( const TextCharAttribList& ) : TextCharAttribs() {}
@@ -50,28 +50,28 @@ public:
TextCharAttribList();
~TextCharAttribList();
- void Clear( BOOL bDestroyAttribs );
- USHORT Count() const { return TextCharAttribs::Count(); }
+ void Clear( sal_Bool bDestroyAttribs );
+ sal_uInt16 Count() const { return TextCharAttribs::Count(); }
- TextCharAttrib* GetAttrib( USHORT n ) const { return TextCharAttribs::GetObject( n ); }
- void RemoveAttrib( USHORT n ) { TextCharAttribs::Remove( n, 1 ); }
+ TextCharAttrib* GetAttrib( sal_uInt16 n ) const { return TextCharAttribs::GetObject( n ); }
+ void RemoveAttrib( sal_uInt16 n ) { TextCharAttribs::Remove( n, 1 ); }
void InsertAttrib( TextCharAttrib* pAttrib );
void DeleteEmptyAttribs();
void ResortAttribs();
- BOOL HasEmptyAttribs() const { return mbHasEmptyAttribs; }
- BOOL& HasEmptyAttribs() { return mbHasEmptyAttribs; }
+ sal_Bool HasEmptyAttribs() const { return mbHasEmptyAttribs; }
+ sal_Bool& HasEmptyAttribs() { return mbHasEmptyAttribs; }
- TextCharAttrib* FindAttrib( USHORT nWhich, USHORT nPos );
- TextCharAttrib* FindNextAttrib( USHORT nWhich, USHORT nFromPos, USHORT nMaxPos = 0xFFFF ) const;
- TextCharAttrib* FindEmptyAttrib( USHORT nWhich, USHORT nPos );
- BOOL HasAttrib( USHORT nWhich ) const;
- BOOL HasBoundingAttrib( USHORT nBound );
+ TextCharAttrib* FindAttrib( sal_uInt16 nWhich, sal_uInt16 nPos );
+ TextCharAttrib* FindNextAttrib( sal_uInt16 nWhich, sal_uInt16 nFromPos, sal_uInt16 nMaxPos = 0xFFFF ) const;
+ TextCharAttrib* FindEmptyAttrib( sal_uInt16 nWhich, sal_uInt16 nPos );
+ sal_Bool HasAttrib( sal_uInt16 nWhich ) const;
+ sal_Bool HasBoundingAttrib( sal_uInt16 nBound );
#ifdef DBG_UTIL
- BOOL DbgCheckAttribs();
+ sal_Bool DbgCheckAttribs();
#endif
};
@@ -84,8 +84,8 @@ private:
TextNode( const TextNode& ) {;}
protected:
- void ExpandAttribs( USHORT nIndex, USHORT nNewChars );
- void CollapsAttribs( USHORT nIndex, USHORT nDelChars );
+ void ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNewChars );
+ void CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDelChars );
public:
TextNode( const String& rText );
@@ -96,11 +96,11 @@ public:
const TextCharAttribList& GetCharAttribs() const { return maCharAttribs; }
TextCharAttribList& GetCharAttribs() { return maCharAttribs; }
- void InsertText( USHORT nPos, const String& rText );
- void InsertText( USHORT nPos, sal_Unicode c );
- void RemoveText( USHORT nPos, USHORT nChars );
+ void InsertText( sal_uInt16 nPos, const String& rText );
+ void InsertText( sal_uInt16 nPos, sal_Unicode c );
+ void RemoveText( sal_uInt16 nPos, sal_uInt16 nChars );
- TextNode* Split( USHORT nPos, BOOL bKeepEndigAttribs );
+ TextNode* Split( sal_uInt16 nPos, sal_Bool bKeepEndigAttribs );
void Append( const TextNode& rNode );
};
@@ -108,7 +108,7 @@ class TextDoc
{
private:
ToolsList<TextNode*> maTextNodes;
- USHORT mnLeftMargin;
+ sal_uInt16 mnLeftMargin;
protected:
void DestroyTextNodes();
@@ -122,27 +122,27 @@ public:
ToolsList<TextNode*>& GetNodes() { return maTextNodes; }
const ToolsList<TextNode*>& GetNodes() const { return maTextNodes; }
- TextPaM RemoveChars( const TextPaM& rPaM, USHORT nChars );
+ TextPaM RemoveChars( const TextPaM& rPaM, sal_uInt16 nChars );
TextPaM InsertText( const TextPaM& rPaM, sal_Unicode c );
TextPaM InsertText( const TextPaM& rPaM, const String& rStr );
- TextPaM InsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs );
+ TextPaM InsertParaBreak( const TextPaM& rPaM, sal_Bool bKeepEndingAttribs );
TextPaM ConnectParagraphs( TextNode* pLeft, TextNode* pRight );
- ULONG GetTextLen( const sal_Unicode* pSep, const TextSelection* pSel = NULL ) const;
+ sal_uLong GetTextLen( const sal_Unicode* pSep, const TextSelection* pSel = NULL ) const;
String GetText( const sal_Unicode* pSep ) const;
- String GetText( ULONG nPara ) const;
+ String GetText( sal_uLong nPara ) const;
- void SetLeftMargin( USHORT n ) { mnLeftMargin = n; }
- USHORT GetLeftMargin() const { return mnLeftMargin; }
+ void SetLeftMargin( sal_uInt16 n ) { mnLeftMargin = n; }
+ sal_uInt16 GetLeftMargin() const { return mnLeftMargin; }
-// BOOL RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd ), USHORT nWhich = 0 );
-// BOOL RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCharAttrib*& rpStarting, TextCharAttrib*& rpEnding, USHORT nWhich = 0 );
+// sal_Bool RemoveAttribs( TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd ), sal_uInt16 nWhich = 0 );
+// sal_Bool RemoveAttribs( TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, TextCharAttrib*& rpStarting, TextCharAttrib*& rpEnding, sal_uInt16 nWhich = 0 );
// void InsertAttrib( const EditCharAttrib* pAttr );
// void InsertAttribInSelection( const EditCharAttrib* pAttr );
-// void FindAttribs( TextNode* pNode, USHORT nStartPos, USHORT nEndPos, SfxItemSet& rCurSet );
+// void FindAttribs( TextNode* pNode, sal_uInt16 nStartPos, sal_uInt16 nEndPos, SfxItemSet& rCurSet );
- BOOL IsValidPaM( const TextPaM& rPaM );
+ sal_Bool IsValidPaM( const TextPaM& rPaM );
};
#endif // _TEXTDOC_HXX
diff --git a/svtools/source/edit/texteng.cxx b/svtools/source/edit/texteng.cxx
index 45d23bcdbee9..15412276e587 100644
--- a/svtools/source/edit/texteng.cxx
+++ b/svtools/source/edit/texteng.cxx
@@ -74,8 +74,8 @@ typedef TextView* TextViewPtr;
SV_DECL_PTRARR( TextViews, TextViewPtr, 0, 1 )
// SV_IMPL_PTRARR( TextViews, TextViewPtr );
-SV_DECL_VARARR_SORT( TESortedPositions, ULONG, 16, 8 )
-SV_IMPL_VARARR_SORT( TESortedPositions, ULONG )
+SV_DECL_VARARR_SORT( TESortedPositions, sal_uLong, 16, 8 )
+SV_IMPL_VARARR_SORT( TESortedPositions, sal_uLong )
#define RESDIFF 10
#define SCRLRANGE 20 // 1/20 der Breite/Hoehe scrollen, wenn im QueryDrop
@@ -92,15 +92,15 @@ TextEngine::TextEngine()
mpViews = new TextViews;
mpActiveView = NULL;
- mbIsFormatting = FALSE;
- mbFormatted = FALSE;
- mbUpdate = TRUE;
- mbModified = FALSE;
- mbUndoEnabled = FALSE;
- mbIsInUndo = FALSE;
- mbDowning = FALSE;
- mbRightToLeft = FALSE;
- mbHasMultiLineParas = FALSE;
+ mbIsFormatting = sal_False;
+ mbFormatted = sal_False;
+ mbUpdate = sal_True;
+ mbModified = sal_False;
+ mbUndoEnabled = sal_False;
+ mbIsInUndo = sal_False;
+ mbDowning = sal_False;
+ mbRightToLeft = sal_False;
+ mbHasMultiLineParas = sal_False;
meAlign = TXTALIGN_LEFT;
@@ -124,7 +124,7 @@ TextEngine::TextEngine()
maTextColor = COL_BLACK;
Font aFont;
- aFont.SetTransparent( FALSE );
+ aFont.SetTransparent( sal_False );
Color aFillColor( aFont.GetFillColor() );
aFillColor.SetTransparency( 0 );
aFont.SetFillColor( aFillColor );
@@ -133,7 +133,7 @@ TextEngine::TextEngine()
TextEngine::~TextEngine()
{
- mbDowning = TRUE;
+ mbDowning = sal_True;
delete mpIdleFormatter;
delete mpDoc;
@@ -156,7 +156,7 @@ void TextEngine::InsertView( TextView* pTextView )
void TextEngine::RemoveView( TextView* pTextView )
{
- USHORT nPos = mpViews->GetPos( pTextView );
+ sal_uInt16 nPos = mpViews->GetPos( pTextView );
if( nPos != USHRT_MAX )
{
pTextView->HideCursor();
@@ -166,12 +166,12 @@ void TextEngine::RemoveView( TextView* pTextView )
}
}
-USHORT TextEngine::GetViewCount() const
+sal_uInt16 TextEngine::GetViewCount() const
{
return mpViews->Count();
}
-TextView* TextEngine::GetView( USHORT nView ) const
+TextView* TextEngine::GetView( sal_uInt16 nView ) const
{
return mpViews->GetObject( nView );
}
@@ -210,7 +210,7 @@ void TextEngine::SetFont( const Font& rFont )
// Wegen Selektion keinen Transparenten Font zulassen...
// (Sonst spaeter in ImplPaint den Hintergrund anders loeschen...)
- maFont.SetTransparent( FALSE );
+ maFont.SetTransparent( sal_False );
// Tell VCL not to use the font color, use text color from OutputDevice
maFont.SetColor( COL_TRANSPARENT );
Color aFillColor( maFont.GetFillColor() );
@@ -225,10 +225,10 @@ void TextEngine::SetFont( const Font& rFont )
if ( !aTextSize.Width() )
aTextSize.Width() = mpRefDev->GetTextWidth( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "XXXX" ) ) );
- mnDefTab = (USHORT)aTextSize.Width();
+ mnDefTab = (sal_uInt16)aTextSize.Width();
if ( !mnDefTab )
mnDefTab = 1;
- mnCharHeight = (USHORT)aTextSize.Height();
+ mnCharHeight = (sal_uInt16)aTextSize.Height();
/*
// #93746# Doesn't work with CJK HalfWidth/FullWidth
FontMetric aRealFont( mpRefDev->GetFontMetric() );
@@ -236,7 +236,7 @@ void TextEngine::SetFont( const Font& rFont )
{
String aX100;
aX100.Fill( 100, 'X' );
- mnFixCharWidth100 = (USHORT)mpRefDev->GetTextWidth( aX100 );
+ mnFixCharWidth100 = (sal_uInt16)mpRefDev->GetTextWidth( aX100 );
}
else
*/
@@ -245,7 +245,7 @@ void TextEngine::SetFont( const Font& rFont )
FormatFullDoc();
UpdateViews();
- for ( USHORT nView = mpViews->Count(); nView; )
+ for ( sal_uInt16 nView = mpViews->Count(); nView; )
{
TextView* pView = mpViews->GetObject( --nView );
pView->GetWindow()->SetInputContext( InputContext( GetFont(), !pView->IsReadOnly() ? INPUTCONTEXT_TEXT|INPUTCONTEXT_EXTTEXTINPUT : 0 ) );
@@ -253,22 +253,22 @@ void TextEngine::SetFont( const Font& rFont )
}
}
-void TextEngine::SetDefTab( USHORT nDefTab )
+void TextEngine::SetDefTab( sal_uInt16 nDefTab )
{
mnDefTab = nDefTab;
// evtl neu setzen?
}
-void TextEngine::SetMaxTextLen( ULONG nLen )
+void TextEngine::SetMaxTextLen( sal_uLong nLen )
{
mnMaxTextLen = nLen;
}
-void TextEngine::SetMaxTextWidth( ULONG nMaxWidth )
+void TextEngine::SetMaxTextWidth( sal_uLong nMaxWidth )
{
if ( nMaxWidth != mnMaxTextWidth )
{
- mnMaxTextWidth = Min( nMaxWidth, (ULONG)0x7FFFFFFF );
+ mnMaxTextWidth = Min( nMaxWidth, (sal_uLong)0x7FFFFFFF );
FormatFullDoc();
UpdateViews();
}
@@ -304,14 +304,14 @@ String TextEngine::GetText( LineEnd aSeparator ) const
String TextEngine::GetTextLines( LineEnd aSeparator ) const
{
String aText;
- ULONG nParas = mpTEParaPortions->Count();
+ sal_uLong nParas = mpTEParaPortions->Count();
const sal_Unicode* pSep = static_getLineEndText( aSeparator );
- for ( ULONG nP = 0; nP < nParas; nP++ )
+ for ( sal_uLong nP = 0; nP < nParas; nP++ )
{
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nP );
- USHORT nLines = pTEParaPortion->GetLines().Count();
- for ( USHORT nL = 0; nL < nLines; nL++ )
+ sal_uInt16 nLines = pTEParaPortion->GetLines().Count();
+ for ( sal_uInt16 nL = 0; nL < nLines; nL++ )
{
TextLine* pLine = pTEParaPortion->GetLines()[nL];
aText += pTEParaPortion->GetNode()->GetText().Copy( pLine->GetStart(), pLine->GetEnd() - pLine->GetStart() );
@@ -322,17 +322,17 @@ String TextEngine::GetTextLines( LineEnd aSeparator ) const
return aText;
}
-String TextEngine::GetText( ULONG nPara ) const
+String TextEngine::GetText( sal_uLong nPara ) const
{
return mpDoc->GetText( nPara );
}
-ULONG TextEngine::GetTextLen( LineEnd aSeparator ) const
+sal_uLong TextEngine::GetTextLen( LineEnd aSeparator ) const
{
return mpDoc->GetTextLen( static_getLineEndText( aSeparator ) );
}
-ULONG TextEngine::GetTextLen( const TextSelection& rSel, LineEnd aSeparator ) const
+sal_uLong TextEngine::GetTextLen( const TextSelection& rSel, LineEnd aSeparator ) const
{
TextSelection aSel( rSel );
aSel.Justify();
@@ -340,12 +340,12 @@ ULONG TextEngine::GetTextLen( const TextSelection& rSel, LineEnd aSeparator ) co
return mpDoc->GetTextLen( static_getLineEndText( aSeparator ), &aSel );
}
-USHORT TextEngine::GetTextLen( ULONG nPara ) const
+sal_uInt16 TextEngine::GetTextLen( sal_uLong nPara ) const
{
return mpDoc->GetNodes().GetObject( nPara )->GetText().Len();
}
-void TextEngine::SetUpdateMode( BOOL bUpdate )
+void TextEngine::SetUpdateMode( sal_Bool bUpdate )
{
if ( bUpdate != mbUpdate )
{
@@ -359,9 +359,9 @@ void TextEngine::SetUpdateMode( BOOL bUpdate )
}
}
-BOOL TextEngine::DoesKeyMoveCursor( const KeyEvent& rKeyEvent )
+sal_Bool TextEngine::DoesKeyMoveCursor( const KeyEvent& rKeyEvent )
{
- BOOL bDoesMove = FALSE;
+ sal_Bool bDoesMove = sal_False;
switch ( rKeyEvent.GetKeyCode().GetCode() )
{
@@ -375,16 +375,16 @@ BOOL TextEngine::DoesKeyMoveCursor( const KeyEvent& rKeyEvent )
case KEY_PAGEDOWN:
{
if ( !rKeyEvent.GetKeyCode().IsMod2() )
- bDoesMove = TRUE;
+ bDoesMove = sal_True;
}
break;
}
return bDoesMove;
}
-BOOL TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent )
+sal_Bool TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent )
{
- BOOL bDoesChange = FALSE;
+ sal_Bool bDoesChange = sal_False;
KeyFuncType eFunc = rKeyEvent.GetKeyCode().GetFunction();
if ( eFunc != KEYFUNC_DONTKNOW )
@@ -394,7 +394,7 @@ BOOL TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent )
case KEYFUNC_UNDO:
case KEYFUNC_REDO:
case KEYFUNC_CUT:
- case KEYFUNC_PASTE: bDoesChange = TRUE;
+ case KEYFUNC_PASTE: bDoesChange = sal_True;
break;
default: // wird dann evtl. unten bearbeitet.
eFunc = KEYFUNC_DONTKNOW;
@@ -408,14 +408,14 @@ BOOL TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent )
case KEY_BACKSPACE:
{
if ( !rKeyEvent.GetKeyCode().IsMod2() )
- bDoesChange = TRUE;
+ bDoesChange = sal_True;
}
break;
case KEY_RETURN:
case KEY_TAB:
{
if ( !rKeyEvent.GetKeyCode().IsMod1() && !rKeyEvent.GetKeyCode().IsMod2() )
- bDoesChange = TRUE;
+ bDoesChange = sal_True;
}
break;
default:
@@ -427,15 +427,15 @@ BOOL TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent )
return bDoesChange;
}
-BOOL TextEngine::IsSimpleCharInput( const KeyEvent& rKeyEvent )
+sal_Bool TextEngine::IsSimpleCharInput( const KeyEvent& rKeyEvent )
{
if( rKeyEvent.GetCharCode() >= 32 && rKeyEvent.GetCharCode() != 127 &&
KEY_MOD1 != (rKeyEvent.GetKeyCode().GetModifier() & ~KEY_SHIFT) && // (ssa) #i45714#:
KEY_MOD2 != (rKeyEvent.GetKeyCode().GetModifier() & ~KEY_SHIFT) ) // check for Ctrl and Alt separately
{
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
void TextEngine::ImpInitDoc()
@@ -452,9 +452,9 @@ void TextEngine::ImpInitDoc()
mpDoc->GetNodes().Insert( pNode, 0 );
TEParaPortion* pIniPortion = new TEParaPortion( pNode );
- mpTEParaPortions->Insert( pIniPortion, (ULONG)0 );
+ mpTEParaPortions->Insert( pIniPortion, (sal_uLong)0 );
- mbFormatted = FALSE;
+ mbFormatted = sal_False;
ImpParagraphRemoved( TEXT_PARA_ALL );
ImpParagraphInserted( 0 );
@@ -470,15 +470,15 @@ String TextEngine::GetText( const TextSelection& rSel, LineEnd aSeparator ) cons
TextSelection aSel( rSel );
aSel.Justify();
- ULONG nStartPara = aSel.GetStart().GetPara();
- ULONG nEndPara = aSel.GetEnd().GetPara();
+ sal_uLong nStartPara = aSel.GetStart().GetPara();
+ sal_uLong nEndPara = aSel.GetEnd().GetPara();
const sal_Unicode* pSep = static_getLineEndText( aSeparator );
- for ( ULONG nNode = aSel.GetStart().GetPara(); nNode <= nEndPara; nNode++ )
+ for ( sal_uLong nNode = aSel.GetStart().GetPara(); nNode <= nEndPara; nNode++ )
{
TextNode* pNode = mpDoc->GetNodes().GetObject( nNode );
- USHORT nStartPos = 0;
- USHORT nEndPos = pNode->GetText().Len();
+ sal_uInt16 nStartPos = 0;
+ sal_uInt16 nEndPos = pNode->GetText().Len();
if ( nNode == nStartPara )
nStartPos = aSel.GetStart().GetIndex();
if ( nNode == nEndPara ) // kann auch == nStart sein!
@@ -497,7 +497,7 @@ void TextEngine::ImpRemoveText()
TextPaM aStartPaM( 0, 0 );
TextSelection aEmptySel( aStartPaM, aStartPaM );
- for ( USHORT nView = 0; nView < mpViews->Count(); nView++ )
+ for ( sal_uInt16 nView = 0; nView < mpViews->Count(); nView++ )
{
TextView* pView = mpViews->GetObject( nView );
pView->ImpSetSelection( aEmptySel );
@@ -509,9 +509,9 @@ void TextEngine::SetText( const XubString& rText )
{
ImpRemoveText();
- BOOL bUndoCurrentlyEnabled = IsUndoEnabled();
+ sal_Bool bUndoCurrentlyEnabled = IsUndoEnabled();
// Der von Hand reingesteckte Text kann nicht vom Anwender rueckgaengig gemacht werden.
- EnableUndo( FALSE );
+ EnableUndo( sal_False );
TextPaM aStartPaM( 0, 0 );
TextSelection aEmptySel( aStartPaM, aStartPaM );
@@ -520,7 +520,7 @@ void TextEngine::SetText( const XubString& rText )
if ( rText.Len() )
aPaM = ImpInsertText( aEmptySel, rText );
- for ( USHORT nView = 0; nView < mpViews->Count(); nView++ )
+ for ( sal_uInt16 nView = 0; nView < mpViews->Count(); nView++ )
{
TextView* pView = mpViews->GetObject( nView );
pView->ImpSetSelection( aEmptySel );
@@ -541,7 +541,7 @@ void TextEngine::SetText( const XubString& rText )
}
-void TextEngine::CursorMoved( ULONG nNode )
+void TextEngine::CursorMoved( sal_uLong nNode )
{
// Leere Attribute loeschen, aber nur, wenn Absatz nicht leer!
TextNode* pNode = mpDoc->GetNodes().GetObject( nNode );
@@ -549,7 +549,7 @@ void TextEngine::CursorMoved( ULONG nNode )
pNode->GetCharAttribs().DeleteEmptyAttribs();
}
-void TextEngine::ImpRemoveChars( const TextPaM& rPaM, USHORT nChars, SfxUndoAction* )
+void TextEngine::ImpRemoveChars( const TextPaM& rPaM, sal_uInt16 nChars, SfxUndoAction* )
{
DBG_ASSERT( nChars, "ImpRemoveChars - 0 Chars?!" );
if ( IsUndoEnabled() && !IsInUndo() )
@@ -559,9 +559,9 @@ void TextEngine::ImpRemoveChars( const TextPaM& rPaM, USHORT nChars, SfxUndoActi
XubString aStr( pNode->GetText().Copy( rPaM.GetIndex(), nChars ) );
// Pruefen, ob Attribute geloescht oder geaendert werden:
- USHORT nStart = rPaM.GetIndex();
- USHORT nEnd = nStart + nChars;
- for ( USHORT nAttr = pNode->GetCharAttribs().Count(); nAttr; )
+ sal_uInt16 nStart = rPaM.GetIndex();
+ sal_uInt16 nEnd = nStart + nChars;
+ for ( sal_uInt16 nAttr = pNode->GetCharAttribs().Count(); nAttr; )
{
TextCharAttrib* pAttr = pNode->GetCharAttribs().GetAttrib( --nAttr );
if ( ( pAttr->GetEnd() >= nStart ) && ( pAttr->GetStart() < nEnd ) )
@@ -583,7 +583,7 @@ void TextEngine::ImpRemoveChars( const TextPaM& rPaM, USHORT nChars, SfxUndoActi
ImpCharsRemoved( rPaM.GetPara(), rPaM.GetIndex(), nChars );
}
-TextPaM TextEngine::ImpConnectParagraphs( ULONG nLeft, ULONG nRight )
+TextPaM TextEngine::ImpConnectParagraphs( sal_uLong nLeft, sal_uLong nRight )
{
DBG_ASSERT( nLeft != nRight, "Den gleichen Absatz zusammenfuegen ?" );
@@ -627,11 +627,11 @@ TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel )
DBG_ASSERT( mpDoc->IsValidPaM( aStartPaM ), "Index im Wald in ImpDeleteText" );
DBG_ASSERT( mpDoc->IsValidPaM( aEndPaM ), "Index im Wald in ImpDeleteText" );
- ULONG nStartNode = aStartPaM.GetPara();
- ULONG nEndNode = aEndPaM.GetPara();
+ sal_uLong nStartNode = aStartPaM.GetPara();
+ sal_uLong nEndNode = aEndPaM.GetPara();
// Alle Nodes dazwischen entfernen....
- for ( ULONG z = nStartNode+1; z < nEndNode; z++ )
+ for ( sal_uLong z = nStartNode+1; z < nEndNode; z++ )
{
// Immer nStartNode+1, wegen Remove()!
ImpRemoveParagraph( nStartNode+1 );
@@ -641,7 +641,7 @@ TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel )
{
// Den Rest des StartNodes...
TextNode* pLeft = mpDoc->GetNodes().GetObject( nStartNode );
- USHORT nChars = pLeft->GetText().Len() - aStartPaM.GetIndex();
+ sal_uInt16 nChars = pLeft->GetText().Len() - aStartPaM.GetIndex();
if ( nChars )
{
ImpRemoveChars( aStartPaM, nChars );
@@ -668,7 +668,7 @@ TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel )
}
else
{
- USHORT nChars;
+ sal_uInt16 nChars;
nChars = aEndPaM.GetIndex() - aStartPaM.GetIndex();
ImpRemoveChars( aStartPaM, nChars );
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nStartNode );
@@ -681,7 +681,7 @@ TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel )
return aStartPaM;
}
-void TextEngine::ImpRemoveParagraph( ULONG nPara )
+void TextEngine::ImpRemoveParagraph( sal_uLong nPara )
{
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara );
@@ -715,14 +715,14 @@ uno::Reference < i18n::XExtendedInputSequenceChecker > TextEngine::GetInputSeque
return xISC;
}
-BOOL TextEngine::IsInputSequenceCheckingRequired( sal_Unicode c, const TextSelection& rCurSel ) const
+sal_Bool TextEngine::IsInputSequenceCheckingRequired( sal_Unicode c, const TextSelection& rCurSel ) const
{
uno::Reference< i18n::XBreakIterator > xBI = ((TextEngine *) this)->GetBreakIterator();
SvtCTLOptions aCTLOptions;
// get the index that really is first
- USHORT nFirstPos = rCurSel.GetStart().GetIndex();
- USHORT nMaxPos = rCurSel.GetEnd().GetIndex();
+ sal_uInt16 nFirstPos = rCurSel.GetStart().GetIndex();
+ sal_uInt16 nMaxPos = rCurSel.GetEnd().GetIndex();
if (nMaxPos < nFirstPos)
nFirstPos = nMaxPos;
@@ -735,12 +735,12 @@ BOOL TextEngine::IsInputSequenceCheckingRequired( sal_Unicode c, const TextSelec
return bIsSequenceChecking;
}
-TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, sal_Unicode c, BOOL bOverwrite )
+TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, sal_Unicode c, sal_Bool bOverwrite )
{
return ImpInsertText( c, rCurSel, bOverwrite, sal_False );
}
-TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel, BOOL bOverwrite, BOOL bIsUserInput )
+TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel, sal_Bool bOverwrite, sal_Bool bIsUserInput )
{
DBG_ASSERT( c != '\n', "Zeilenumbruch bei InsertText ?" );
DBG_ASSERT( c != '\r', "Zeilenumbruch bei InsertText ?" );
@@ -750,13 +750,13 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel,
if ( pNode->GetText().Len() < STRING_MAXLEN )
{
- BOOL bDoOverwrite = ( bOverwrite &&
- ( aPaM.GetIndex() < pNode->GetText().Len() ) ) ? TRUE : FALSE;
+ sal_Bool bDoOverwrite = ( bOverwrite &&
+ ( aPaM.GetIndex() < pNode->GetText().Len() ) ) ? sal_True : sal_False;
- BOOL bUndoAction = ( rCurSel.HasRange() || bDoOverwrite );
+ sal_Bool bUndoAction = ( rCurSel.HasRange() || bDoOverwrite );
if ( bUndoAction )
- UndoActionStart( TEXTUNDO_INSERT );
+ UndoActionStart();
if ( rCurSel.HasRange() )
{
@@ -803,7 +803,7 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel,
String aChgText( aNewText.copy( nChgPos ), nChgLen );
// select text from first pos to be changed to current pos
- TextSelection aSel( TextPaM( aPaM.GetPara(), (USHORT) nChgPos ), aPaM );
+ TextSelection aSel( TextPaM( aPaM.GetPara(), (sal_uInt16) nChgPos ), aPaM );
if (aChgText.Len())
// ImpInsertText implicitly handles undo...
@@ -826,7 +826,7 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel,
if ( IsUndoEnabled() && !IsInUndo() )
{
TextUndoInsertChars* pNewUndo = new TextUndoInsertChars( this, aPaM, c );
- BOOL bTryMerge = ( !bDoOverwrite && ( c != ' ' ) ) ? TRUE : FALSE;
+ sal_Bool bTryMerge = ( !bDoOverwrite && ( c != ' ' ) ) ? sal_True : sal_False;
InsertUndo( pNewUndo, bTryMerge );
}
@@ -840,7 +840,7 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel,
TextModified();
if ( bUndoAction )
- UndoActionEnd( TEXTUNDO_INSERT );
+ UndoActionEnd();
}
return aPaM;
@@ -849,7 +849,7 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel,
TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, const XubString& rStr )
{
- UndoActionStart( TEXTUNDO_INSERT );
+ UndoActionStart();
TextPaM aPaM;
@@ -861,21 +861,21 @@ TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, const XubString
XubString aText( rStr );
aText.ConvertLineEnd( LINEEND_LF );
- USHORT nStart = 0;
+ sal_uInt16 nStart = 0;
while ( nStart < aText.Len() )
{
- USHORT nEnd = aText.Search( LINE_SEP, nStart );
+ sal_uInt16 nEnd = aText.Search( LINE_SEP, nStart );
if ( nEnd == STRING_NOTFOUND )
nEnd = aText.Len(); // nicht dereferenzieren!
// Start == End => Leerzeile
if ( nEnd > nStart )
{
- ULONG nL = aPaM.GetIndex();
+ sal_uLong nL = aPaM.GetIndex();
nL += ( nEnd-nStart );
if ( nL > STRING_MAXLEN )
{
- USHORT nDiff = (USHORT) (nL-STRING_MAXLEN);
+ sal_uInt16 nDiff = (sal_uInt16) (nL-STRING_MAXLEN);
nEnd = nEnd - nDiff;
}
@@ -901,13 +901,13 @@ TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, const XubString
break;
}
- UndoActionEnd( TEXTUNDO_INSERT );
+ UndoActionEnd();
TextModified();
return aPaM;
}
-TextPaM TextEngine::ImpInsertParaBreak( const TextSelection& rCurSel, BOOL bKeepEndingAttribs )
+TextPaM TextEngine::ImpInsertParaBreak( const TextSelection& rCurSel, sal_Bool bKeepEndingAttribs )
{
TextPaM aPaM;
if ( rCurSel.HasRange() )
@@ -918,13 +918,13 @@ TextPaM TextEngine::ImpInsertParaBreak( const TextSelection& rCurSel, BOOL bKeep
return ImpInsertParaBreak( aPaM, bKeepEndingAttribs );
}
-TextPaM TextEngine::ImpInsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs )
+TextPaM TextEngine::ImpInsertParaBreak( const TextPaM& rPaM, sal_Bool bKeepEndingAttribs )
{
if ( IsUndoEnabled() && !IsInUndo() )
InsertUndo( new TextUndoSplitPara( this, rPaM.GetPara(), rPaM.GetIndex() ) );
TextNode* pNode = mpDoc->GetNodes().GetObject( rPaM.GetPara() );
- BOOL bFirstParaContentChanged = rPaM.GetIndex() < pNode->GetText().Len();
+ sal_Bool bFirstParaContentChanged = rPaM.GetIndex() < pNode->GetText().Len();
TextPaM aPaM( mpDoc->InsertParaBreak( rPaM, bKeepEndingAttribs ) );
@@ -946,9 +946,9 @@ TextPaM TextEngine::ImpInsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAtt
return aPaM;
}
-Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, BOOL bSpecial )
+Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, sal_Bool bSpecial )
{
- DBG_ASSERT( GetUpdateMode(), "Darf bei Update=FALSE nicht erreicht werden: PaMtoEditCursor" );
+ DBG_ASSERT( GetUpdateMode(), "Darf bei Update=sal_False nicht erreicht werden: PaMtoEditCursor" );
Rectangle aEditCursor;
long nY = 0;
@@ -959,7 +959,7 @@ Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, BOOL bSpecial )
}
else
{
- for ( ULONG nPortion = 0; nPortion < rPaM.GetPara(); nPortion++ )
+ for ( sal_uLong nPortion = 0; nPortion < rPaM.GetPara(); nPortion++ )
{
TEParaPortion* pPortion = mpTEParaPortions->GetObject(nPortion);
nY += pPortion->GetLines().Count() * mnCharHeight;
@@ -972,7 +972,7 @@ Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, BOOL bSpecial )
return aEditCursor;
}
-Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, BOOL bSpecial, BOOL bPreferPortionStart )
+Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, sal_Bool bSpecial, sal_Bool bPreferPortionStart )
{
if ( !IsFormatted() && !IsFormatting() )
FormatAndUpdate();
@@ -993,9 +993,9 @@ Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, BOOL bSpecial, BOOL bP
*/
long nY = 0;
- USHORT nCurIndex = 0;
+ sal_uInt16 nCurIndex = 0;
TextLine* pLine = 0;
- for ( USHORT nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ )
+ for ( sal_uInt16 nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ )
{
TextLine* pTmpLine = pPortion->GetLines().GetObject( nLine );
if ( ( pTmpLine->GetStart() == rPaM.GetIndex() ) || ( pTmpLine->IsIn( rPaM.GetIndex(), bSpecial ) ) )
@@ -1029,21 +1029,21 @@ Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, BOOL bSpecial, BOOL bP
return aEditCursor;
}
-long TextEngine::ImpGetXPos( ULONG nPara, TextLine* pLine, USHORT nIndex, BOOL bPreferPortionStart )
+long TextEngine::ImpGetXPos( sal_uLong nPara, TextLine* pLine, sal_uInt16 nIndex, sal_Bool bPreferPortionStart )
{
DBG_ASSERT( ( nIndex >= pLine->GetStart() ) && ( nIndex <= pLine->GetEnd() ) , "ImpGetXPos muss richtig gerufen werden!" );
- BOOL bDoPreferPortionStart = bPreferPortionStart;
+ sal_Bool bDoPreferPortionStart = bPreferPortionStart;
// Assure that the portion belongs to this line:
if ( nIndex == pLine->GetStart() )
- bDoPreferPortionStart = TRUE;
+ bDoPreferPortionStart = sal_True;
else if ( nIndex == pLine->GetEnd() )
- bDoPreferPortionStart = FALSE;
+ bDoPreferPortionStart = sal_False;
TEParaPortion* pParaPortion = mpTEParaPortions->GetObject( nPara );
- USHORT nTextPortionStart = 0;
- USHORT nTextPortion = pParaPortion->GetTextPortions().FindPortion( nIndex, nTextPortionStart, bDoPreferPortionStart );
+ sal_uInt16 nTextPortionStart = 0;
+ sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( nIndex, nTextPortionStart, bDoPreferPortionStart );
DBG_ASSERT( ( nTextPortion >= pLine->GetStartPortion() ) && ( nTextPortion <= pLine->GetEndPortion() ), "GetXPos: Portion not in current line! " );
@@ -1074,7 +1074,7 @@ long TextEngine::ImpGetXPos( ULONG nPara, TextLine* pLine, USHORT nIndex, BOOL b
// nX += pNextPortion->GetWidth();
// End of the tab portion, use start of next for cursor pos
DBG_ASSERT( !bPreferPortionStart, "ImpGetXPos - How can we this tab portion here???" );
- nX = ImpGetXPos( nPara, pLine, nIndex, TRUE );
+ nX = ImpGetXPos( nPara, pLine, nIndex, sal_True );
}
}
@@ -1110,7 +1110,7 @@ long TextEngine::ImpGetXPos( ULONG nPara, TextLine* pLine, USHORT nIndex, BOOL b
return nX;
}
-const TextAttrib* TextEngine::FindAttrib( const TextPaM& rPaM, USHORT nWhich ) const
+const TextAttrib* TextEngine::FindAttrib( const TextPaM& rPaM, sal_uInt16 nWhich ) const
{
const TextAttrib* pAttr = NULL;
const TextCharAttrib* pCharAttr = FindCharAttrib( rPaM, nWhich );
@@ -1119,7 +1119,7 @@ const TextAttrib* TextEngine::FindAttrib( const TextPaM& rPaM, USHORT nWhich ) c
return pAttr;
}
-const TextCharAttrib* TextEngine::FindCharAttrib( const TextPaM& rPaM, USHORT nWhich ) const
+const TextCharAttrib* TextEngine::FindCharAttrib( const TextPaM& rPaM, sal_uInt16 nWhich ) const
{
const TextCharAttrib* pAttr = NULL;
TextNode* pNode = mpDoc->GetNodes().GetObject( rPaM.GetPara() );
@@ -1128,10 +1128,10 @@ const TextCharAttrib* TextEngine::FindCharAttrib( const TextPaM& rPaM, USHORT nW
return pAttr;
}
-BOOL TextEngine::HasAttrib( USHORT nWhich ) const
+sal_Bool TextEngine::HasAttrib( sal_uInt16 nWhich ) const
{
- BOOL bAttr = FALSE;
- for ( ULONG n = mpDoc->GetNodes().Count(); --n && !bAttr; )
+ sal_Bool bAttr = sal_False;
+ for ( sal_uLong n = mpDoc->GetNodes().Count(); --n && !bAttr; )
{
TextNode* pNode = mpDoc->GetNodes().GetObject( n );
bAttr = pNode->GetCharAttribs().HasAttrib( nWhich );
@@ -1139,12 +1139,12 @@ BOOL TextEngine::HasAttrib( USHORT nWhich ) const
return bAttr;
}
-TextPaM TextEngine::GetPaM( const Point& rDocPos, BOOL bSmart )
+TextPaM TextEngine::GetPaM( const Point& rDocPos, sal_Bool bSmart )
{
- DBG_ASSERT( GetUpdateMode(), "Darf bei Update=FALSE nicht erreicht werden: GetPaM" );
+ DBG_ASSERT( GetUpdateMode(), "Darf bei Update=sal_False nicht erreicht werden: GetPaM" );
long nY = 0;
- for ( ULONG nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ )
+ for ( sal_uLong nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ )
{
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion );
long nTmpHeight = pPortion->GetLines().Count() * mnCharHeight;
@@ -1162,21 +1162,21 @@ TextPaM TextEngine::GetPaM( const Point& rDocPos, BOOL bSmart )
}
// Nicht gefunden - Dann den letzten sichtbare...
- ULONG nLastNode = mpDoc->GetNodes().Count() - 1;
+ sal_uLong nLastNode = mpDoc->GetNodes().Count() - 1;
TextNode* pLast = mpDoc->GetNodes().GetObject( nLastNode );
return TextPaM( nLastNode, pLast->GetText().Len() );
}
-USHORT TextEngine::ImpFindIndex( ULONG nPortion, const Point& rPosInPara, BOOL bSmart )
+sal_uInt16 TextEngine::ImpFindIndex( sal_uLong nPortion, const Point& rPosInPara, sal_Bool bSmart )
{
DBG_ASSERT( IsFormatted(), "GetPaM: Nicht formatiert" );
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion );
- USHORT nCurIndex = 0;
+ sal_uInt16 nCurIndex = 0;
long nY = 0;
TextLine* pLine = 0;
- USHORT nLine;
+ sal_uInt16 nLine;
for ( nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ )
{
TextLine* pTmpLine = pPortion->GetLines().GetObject( nLine );
@@ -1196,24 +1196,24 @@ USHORT TextEngine::ImpFindIndex( ULONG nPortion, const Point& rPosInPara, BOOL b
{
uno::Reference < i18n::XBreakIterator > xBI = GetBreakIterator();
sal_Int32 nCount = 1;
- nCurIndex = (USHORT)xBI->previousCharacters( pPortion->GetNode()->GetText(), nCurIndex, GetLocale(), i18n::CharacterIteratorMode::SKIPCELL, nCount, nCount );
+ nCurIndex = (sal_uInt16)xBI->previousCharacters( pPortion->GetNode()->GetText(), nCurIndex, GetLocale(), i18n::CharacterIteratorMode::SKIPCELL, nCount, nCount );
}
return nCurIndex;
}
-USHORT TextEngine::GetCharPos( ULONG nPortion, USHORT nLine, long nXPos, BOOL )
+sal_uInt16 TextEngine::GetCharPos( sal_uLong nPortion, sal_uInt16 nLine, long nXPos, sal_Bool )
{
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion );
TextLine* pLine = pPortion->GetLines().GetObject( nLine );
- USHORT nCurIndex = pLine->GetStart();
+ sal_uInt16 nCurIndex = pLine->GetStart();
long nTmpX = pLine->GetStartX();
if ( nXPos <= nTmpX )
return nCurIndex;
- for ( USHORT i = pLine->GetStartPortion(); i <= pLine->GetEndPortion(); i++ )
+ for ( sal_uInt16 i = pLine->GetStartPortion(); i <= pLine->GetEndPortion(); i++ )
{
TETextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( i );
nTmpX += pTextPortion->GetWidth();
@@ -1241,9 +1241,9 @@ USHORT TextEngine::GetCharPos( ULONG nPortion, USHORT nLine, long nXPos, BOOL )
}
-ULONG TextEngine::GetTextHeight() const
+sal_uLong TextEngine::GetTextHeight() const
{
- DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=FALSE nicht verwendet werden: GetTextHeight" );
+ DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=sal_False nicht verwendet werden: GetTextHeight" );
if ( !IsFormatted() && !IsFormatting() )
((TextEngine*)this)->FormatAndUpdate();
@@ -1251,9 +1251,9 @@ ULONG TextEngine::GetTextHeight() const
return mnCurTextHeight;
}
-ULONG TextEngine::GetTextHeight( ULONG nParagraph ) const
+sal_uLong TextEngine::GetTextHeight( sal_uLong nParagraph ) const
{
- DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=FALSE nicht verwendet werden: GetTextHeight" );
+ DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=sal_False nicht verwendet werden: GetTextHeight" );
if ( !IsFormatted() && !IsFormatting() )
((TextEngine*)this)->FormatAndUpdate();
@@ -1261,15 +1261,15 @@ ULONG TextEngine::GetTextHeight( ULONG nParagraph ) const
return CalcParaHeight( nParagraph );
}
-ULONG TextEngine::CalcTextWidth( ULONG nPara )
+sal_uLong TextEngine::CalcTextWidth( sal_uLong nPara )
{
- ULONG nParaWidth = 0;
+ sal_uLong nParaWidth = 0;
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara );
- for ( USHORT nLine = pPortion->GetLines().Count(); nLine; )
+ for ( sal_uInt16 nLine = pPortion->GetLines().Count(); nLine; )
{
- ULONG nLineWidth = 0;
+ sal_uLong nLineWidth = 0;
TextLine* pLine = pPortion->GetLines().GetObject( --nLine );
- for ( USHORT nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ )
+ for ( sal_uInt16 nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ )
{
TETextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( nTP );
nLineWidth += pTextPortion->GetWidth();
@@ -1280,7 +1280,7 @@ ULONG TextEngine::CalcTextWidth( ULONG nPara )
return nParaWidth;
}
-ULONG TextEngine::CalcTextWidth()
+sal_uLong TextEngine::CalcTextWidth()
{
if ( !IsFormatted() && !IsFormatting() )
FormatAndUpdate();
@@ -1288,9 +1288,9 @@ ULONG TextEngine::CalcTextWidth()
if ( mnCurTextWidth == 0xFFFFFFFF )
{
mnCurTextWidth = 0;
- for ( ULONG nPara = mpTEParaPortions->Count(); nPara; )
+ for ( sal_uLong nPara = mpTEParaPortions->Count(); nPara; )
{
- ULONG nParaWidth = CalcTextWidth( --nPara );
+ sal_uLong nParaWidth = CalcTextWidth( --nPara );
if ( nParaWidth > mnCurTextWidth )
mnCurTextWidth = nParaWidth;
}
@@ -1298,25 +1298,25 @@ ULONG TextEngine::CalcTextWidth()
return mnCurTextWidth+1;// Ein breiter, da in CreateLines bei >= umgebrochen wird.
}
-ULONG TextEngine::CalcTextHeight()
+sal_uLong TextEngine::CalcTextHeight()
{
- DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=FALSE nicht verwendet werden: CalcTextHeight" );
+ DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=sal_False nicht verwendet werden: CalcTextHeight" );
- ULONG nY = 0;
- for ( ULONG nPortion = mpTEParaPortions->Count(); nPortion; )
+ sal_uLong nY = 0;
+ for ( sal_uLong nPortion = mpTEParaPortions->Count(); nPortion; )
nY += CalcParaHeight( --nPortion );
return nY;
}
-ULONG TextEngine::CalcTextWidth( ULONG nPara, USHORT nPortionStart, USHORT nLen, const Font* pFont )
+sal_uLong TextEngine::CalcTextWidth( sal_uLong nPara, sal_uInt16 nPortionStart, sal_uInt16 nLen, const Font* pFont )
{
// Innerhalb des Textes darf es keinen Portionwechsel (Attribut/Tab) geben!
DBG_ASSERT( mpDoc->GetNodes().GetObject( nPara )->GetText().Search( '\t', nPortionStart ) >= (nPortionStart+nLen), "CalcTextWidth: Tab!" );
- ULONG nWidth;
+ sal_uLong nWidth;
if ( mnFixCharWidth100 )
{
- nWidth = (ULONG)nLen*mnFixCharWidth100/100;
+ nWidth = (sal_uLong)nLen*mnFixCharWidth100/100;
}
else
{
@@ -1332,14 +1332,14 @@ ULONG TextEngine::CalcTextWidth( ULONG nPara, USHORT nPortionStart, USHORT nLen,
mpRefDev->SetFont( aFont );
}
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
- nWidth = (ULONG)mpRefDev->GetTextWidth( pNode->GetText(), nPortionStart, nLen );
+ nWidth = (sal_uLong)mpRefDev->GetTextWidth( pNode->GetText(), nPortionStart, nLen );
}
return nWidth;
}
-USHORT TextEngine::GetLineCount( ULONG nParagraph ) const
+sal_uInt16 TextEngine::GetLineCount( sal_uLong nParagraph ) const
{
DBG_ASSERT( nParagraph < mpTEParaPortions->Count(), "GetLineCount: Out of range" );
@@ -1350,7 +1350,7 @@ USHORT TextEngine::GetLineCount( ULONG nParagraph ) const
return 0xFFFF;
}
-USHORT TextEngine::GetLineLen( ULONG nParagraph, USHORT nLine ) const
+sal_uInt16 TextEngine::GetLineLen( sal_uLong nParagraph, sal_uInt16 nLine ) const
{
DBG_ASSERT( nParagraph < mpTEParaPortions->Count(), "GetLineCount: Out of range" );
@@ -1364,9 +1364,9 @@ USHORT TextEngine::GetLineLen( ULONG nParagraph, USHORT nLine ) const
return 0xFFFF;
}
-ULONG TextEngine::CalcParaHeight( ULONG nParagraph ) const
+sal_uLong TextEngine::CalcParaHeight( sal_uLong nParagraph ) const
{
- ULONG nHeight = 0;
+ sal_uLong nHeight = 0;
TEParaPortion* pPPortion = mpTEParaPortions->GetObject( nParagraph );
DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetParaHeight" );
@@ -1380,12 +1380,12 @@ void TextEngine::UpdateSelections()
{
}
-Range TextEngine::GetInvalidYOffsets( ULONG nPortion )
+Range TextEngine::GetInvalidYOffsets( sal_uLong nPortion )
{
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPortion );
- USHORT nLines = pTEParaPortion->GetLines().Count();
- USHORT nLastInvalid, nFirstInvalid = 0;
- USHORT nLine;
+ sal_uInt16 nLines = pTEParaPortion->GetLines().Count();
+ sal_uInt16 nLastInvalid, nFirstInvalid = 0;
+ sal_uInt16 nLine;
for ( nLine = 0; nLine < nLines; nLine++ )
{
TextLine* pL = pTEParaPortion->GetLines().GetObject( nLine );
@@ -1409,12 +1409,12 @@ Range TextEngine::GetInvalidYOffsets( ULONG nPortion )
return Range( nFirstInvalid*mnCharHeight, ((nLastInvalid+1)*mnCharHeight)-1 );
}
-ULONG TextEngine::GetParagraphCount() const
+sal_uLong TextEngine::GetParagraphCount() const
{
return mpDoc->GetNodes().Count();
}
-void TextEngine::EnableUndo( BOOL bEnable )
+void TextEngine::EnableUndo( sal_Bool bEnable )
{
// Beim Umschalten des Modus Liste loeschen:
if ( bEnable != IsUndoEnabled() )
@@ -1423,14 +1423,14 @@ void TextEngine::EnableUndo( BOOL bEnable )
mbUndoEnabled = bEnable;
}
-SfxUndoManager& TextEngine::GetUndoManager()
+::svl::IUndoManager& TextEngine::GetUndoManager()
{
if ( !mpUndoManager )
mpUndoManager = new TextUndoManager( this );
return *mpUndoManager;
}
-void TextEngine::UndoActionStart( USHORT nId )
+void TextEngine::UndoActionStart( sal_uInt16 nId )
{
if ( IsUndoEnabled() && !IsInUndo() )
{
@@ -1440,13 +1440,13 @@ void TextEngine::UndoActionStart( USHORT nId )
}
}
-void TextEngine::UndoActionEnd( USHORT )
+void TextEngine::UndoActionEnd()
{
if ( IsUndoEnabled() && !IsInUndo() )
GetUndoManager().LeaveListAction();
}
-void TextEngine::InsertUndo( TextUndo* pUndo, BOOL bTryMerge )
+void TextEngine::InsertUndo( TextUndo* pUndo, sal_Bool bTryMerge )
{
DBG_ASSERT( !IsInUndo(), "InsertUndo im Undomodus!" );
GetUndoManager().AddUndoAction( pUndo, bTryMerge );
@@ -1458,7 +1458,7 @@ void TextEngine::ResetUndo()
mpUndoManager->Clear();
}
-void TextEngine::InsertContent( TextNode* pNode, ULONG nPara )
+void TextEngine::InsertContent( TextNode* pNode, sal_uLong nPara )
{
DBG_ASSERT( pNode, "NULL-Pointer in InsertContent! " );
DBG_ASSERT( IsInUndo(), "InsertContent nur fuer Undo()!" );
@@ -1468,7 +1468,7 @@ void TextEngine::InsertContent( TextNode* pNode, ULONG nPara )
ImpParagraphInserted( nPara );
}
-TextPaM TextEngine::SplitContent( ULONG nNode, USHORT nSepPos )
+TextPaM TextEngine::SplitContent( sal_uLong nNode, sal_uInt16 nSepPos )
{
#ifdef DBG_UTIL
TextNode* pNode = mpDoc->GetNodes().GetObject( nNode );
@@ -1480,21 +1480,21 @@ TextPaM TextEngine::SplitContent( ULONG nNode, USHORT nSepPos )
return ImpInsertParaBreak( aPaM );
}
-TextPaM TextEngine::ConnectContents( ULONG nLeftNode )
+TextPaM TextEngine::ConnectContents( sal_uLong nLeftNode )
{
DBG_ASSERT( IsInUndo(), "ConnectContent nur fuer Undo()!" );
return ImpConnectParagraphs( nLeftNode, nLeftNode+1 );
}
-void TextEngine::SeekCursor( ULONG nPara, USHORT nPos, Font& rFont, OutputDevice* pOutDev )
+void TextEngine::SeekCursor( sal_uLong nPara, sal_uInt16 nPos, Font& rFont, OutputDevice* pOutDev )
{
rFont = maFont;
if ( pOutDev )
pOutDev->SetTextColor( maTextColor );
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
- USHORT nAttribs = pNode->GetCharAttribs().Count();
- for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ sal_uInt16 nAttribs = pNode->GetCharAttribs().Count();
+ for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ )
{
TextCharAttrib* pAttrib = pNode->GetCharAttribs().GetAttrib( nAttr );
if ( pAttrib->GetStart() > nPos )
@@ -1542,7 +1542,7 @@ void TextEngine::SeekCursor( ULONG nPara, USHORT nPos, Font& rFont, OutputDevice
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
rFont.SetColor( rStyleSettings.GetHighlightTextColor() );
rFont.SetFillColor( rStyleSettings.GetHighlightColor() );
- rFont.SetTransparent( FALSE );
+ rFont.SetTransparent( sal_False );
}
else if ( nAttr & EXTTEXTINPUT_ATTR_GRAYWAVELINE )
{
@@ -1553,9 +1553,9 @@ void TextEngine::SeekCursor( ULONG nPara, USHORT nPos, Font& rFont, OutputDevice
}
}
-void TextEngine::SetUpdateMode( BOOL bUp, TextView* pCurView, BOOL bForceUpdate )
+void TextEngine::SetUpdateMode( sal_Bool bUp, TextView* pCurView, sal_Bool bForceUpdate )
{
- BOOL bChanged = ( GetUpdateMode() != bUp );
+ sal_Bool bChanged = ( GetUpdateMode() != bUp );
mbUpdate = bUp;
if ( mbUpdate && ( bChanged || bForceUpdate ) )
@@ -1577,15 +1577,15 @@ void TextEngine::FormatAndUpdate( TextView* pCurView )
}
-void TextEngine::IdleFormatAndUpdate( TextView* pCurView, USHORT nMaxTimerRestarts )
+void TextEngine::IdleFormatAndUpdate( TextView* pCurView, sal_uInt16 nMaxTimerRestarts )
{
mpIdleFormatter->DoIdleFormat( pCurView, nMaxTimerRestarts );
}
void TextEngine::TextModified()
{
- mbFormatted = FALSE;
- mbModified = TRUE;
+ mbFormatted = sal_False;
+ mbModified = sal_True;
}
void TextEngine::UpdateViews( TextView* pCurView )
@@ -1595,7 +1595,7 @@ void TextEngine::UpdateViews( TextView* pCurView )
DBG_ASSERT( IsFormatted(), "UpdateViews: Doc nicht formatiert!" );
- for ( USHORT nView = 0; nView < mpViews->Count(); nView++ )
+ for ( sal_uInt16 nView = 0; nView < mpViews->Count(); nView++ )
{
TextView* pView = mpViews->GetObject( nView );
pView->HideCursor();
@@ -1640,12 +1640,12 @@ void TextEngine::CheckIdleFormatter()
void TextEngine::FormatFullDoc()
{
- for ( ULONG nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ )
+ for ( sal_uLong nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ )
{
- TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPortion ); USHORT nLen = pTEParaPortion->GetNode()->GetText().Len();
+ TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPortion ); sal_uInt16 nLen = pTEParaPortion->GetNode()->GetText().Len();
pTEParaPortion->MarkSelectionInvalid( 0, nLen );
}
- mbFormatted = FALSE;
+ mbFormatted = sal_False;
FormatDoc();
}
@@ -1654,26 +1654,26 @@ void TextEngine::FormatDoc()
if ( IsFormatted() || !GetUpdateMode() || IsFormatting() )
return;
- mbIsFormatting = TRUE;
- mbHasMultiLineParas = FALSE;
+ mbIsFormatting = sal_True;
+ mbHasMultiLineParas = sal_False;
long nY = 0;
- BOOL bGrow = FALSE;
+ sal_Bool bGrow = sal_False;
maInvalidRec = Rectangle(); // leermachen
- for ( ULONG nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ )
+ for ( sal_uLong nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ )
{
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
if ( pTEParaPortion->IsInvalid() )
{
- ULONG nOldParaWidth = 0xFFFFFFFF;
+ sal_uLong nOldParaWidth = 0xFFFFFFFF;
if ( mnCurTextWidth != 0xFFFFFFFF )
nOldParaWidth = CalcTextWidth( nPara );
ImpFormattingParagraph( nPara );
if ( CreateLines( nPara ) )
- bGrow = TRUE;
+ bGrow = sal_True;
// InvalidRec nur einmal setzen...
if ( maInvalidRec.IsEmpty() )
@@ -1693,7 +1693,7 @@ void TextEngine::FormatDoc()
if ( mnCurTextWidth != 0xFFFFFFFF )
{
- ULONG nNewParaWidth = CalcTextWidth( nPara );
+ sal_uLong nNewParaWidth = CalcTextWidth( nPara );
if ( nNewParaWidth >= mnCurTextWidth )
mnCurTextWidth = nNewParaWidth;
else if ( ( nOldParaWidth != 0xFFFFFFFF ) && ( nOldParaWidth >= mnCurTextWidth ) )
@@ -1706,12 +1706,12 @@ void TextEngine::FormatDoc()
}
nY += CalcParaHeight( nPara );
if ( !mbHasMultiLineParas && pTEParaPortion->GetLines().Count() > 1 )
- mbHasMultiLineParas = TRUE;
+ mbHasMultiLineParas = sal_True;
}
if ( !maInvalidRec.IsEmpty() )
{
- ULONG nNewHeight = CalcTextHeight();
+ sal_uLong nNewHeight = CalcTextHeight();
long nDiff = nNewHeight - mnCurTextHeight;
if ( nNewHeight < mnCurTextHeight )
{
@@ -1728,18 +1728,18 @@ void TextEngine::FormatDoc()
mnCurTextHeight = nNewHeight;
if ( nDiff )
{
- mbFormatted = TRUE;
+ mbFormatted = sal_True;
ImpTextHeightChanged();
}
}
- mbIsFormatting = FALSE;
- mbFormatted = TRUE;
+ mbIsFormatting = sal_False;
+ mbFormatted = sal_True;
ImpTextFormatted();
}
-void TextEngine::CreateAndInsertEmptyLine( ULONG nPara )
+void TextEngine::CreateAndInsertEmptyLine( sal_uLong nPara )
{
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
@@ -1756,31 +1756,31 @@ void TextEngine::CreateAndInsertEmptyLine( ULONG nPara )
else
pTmpLine->SetStartX( mpDoc->GetLeftMargin() );
- BOOL bLineBreak = pNode->GetText().Len() ? TRUE : FALSE;
+ sal_Bool bLineBreak = pNode->GetText().Len() ? sal_True : sal_False;
TETextPortion* pDummyPortion = new TETextPortion( 0 );
pDummyPortion->GetWidth() = 0;
pTEParaPortion->GetTextPortions().Insert( pDummyPortion, pTEParaPortion->GetTextPortions().Count() );
- if ( bLineBreak == TRUE )
+ if ( bLineBreak == sal_True )
{
// -2: Die neue ist bereits eingefuegt.
#ifdef DBG_UTIL
TextLine* pLastLine = pTEParaPortion->GetLines().GetObject( pTEParaPortion->GetLines().Count()-2 );
DBG_ASSERT( pLastLine, "Weicher Umbruch, keine Zeile ?!" );
#endif
- USHORT nPos = (USHORT) pTEParaPortion->GetTextPortions().Count() - 1 ;
+ sal_uInt16 nPos = (sal_uInt16) pTEParaPortion->GetTextPortions().Count() - 1 ;
pTmpLine->SetStartPortion( nPos );
pTmpLine->SetEndPortion( nPos );
}
}
-void TextEngine::ImpBreakLine( ULONG nPara, TextLine* pLine, TETextPortion*, USHORT nPortionStart, long nRemainingWidth )
+void TextEngine::ImpBreakLine( sal_uLong nPara, TextLine* pLine, TETextPortion*, sal_uInt16 nPortionStart, long nRemainingWidth )
{
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
// Font sollte noch eingestellt sein.
- USHORT nMaxBreakPos = mpRefDev->GetTextBreak( pNode->GetText(), nRemainingWidth, nPortionStart );
+ sal_uInt16 nMaxBreakPos = mpRefDev->GetTextBreak( pNode->GetText(), nRemainingWidth, nPortionStart );
DBG_ASSERT( nMaxBreakPos < pNode->GetText().Len(), "Break?!" );
@@ -1799,7 +1799,7 @@ void TextEngine::ImpBreakLine( ULONG nPara, TextLine* pLine, TETextPortion*, USH
static const com::sun::star::lang::Locale aDefLocale;
i18n::LineBreakResults aLBR = xBI->getLineBreak( pNode->GetText(), nMaxBreakPos, aDefLocale, pLine->GetStart(), aHyphOptions, aUserOptions );
- USHORT nBreakPos = (USHORT)aLBR.breakIndex;
+ sal_uInt16 nBreakPos = (sal_uInt16)aLBR.breakIndex;
if ( nBreakPos <= pLine->GetStart() )
{
nBreakPos = nMaxBreakPos;
@@ -1810,7 +1810,7 @@ void TextEngine::ImpBreakLine( ULONG nPara, TextLine* pLine, TETextPortion*, USH
// die angeknackste Portion ist die End-Portion
pLine->SetEnd( nBreakPos );
- USHORT nEndPortion = SplitTextPortion( nPara, nBreakPos );
+ sal_uInt16 nEndPortion = SplitTextPortion( nPara, nBreakPos );
sal_Bool bBlankSeparator = ( ( nBreakPos >= pLine->GetStart() ) &&
( pNode->GetText().GetChar( nBreakPos ) == ' ' ) ) ? sal_True : sal_False;
@@ -1825,7 +1825,7 @@ void TextEngine::ImpBreakLine( ULONG nPara, TextLine* pLine, TETextPortion*, USH
pLine->SetEndPortion( nEndPortion );
}
-USHORT TextEngine::SplitTextPortion( ULONG nPara, USHORT nPos )
+sal_uInt16 TextEngine::SplitTextPortion( sal_uLong nPara, sal_uInt16 nPos )
{
// Die Portion bei nPos wird geplittet, wenn bei nPos nicht
@@ -1833,11 +1833,11 @@ USHORT TextEngine::SplitTextPortion( ULONG nPara, USHORT nPos )
if ( nPos == 0 )
return 0;
- USHORT nSplitPortion;
- USHORT nTmpPos = 0;
+ sal_uInt16 nSplitPortion;
+ sal_uInt16 nTmpPos = 0;
TETextPortion* pTextPortion = 0;
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
- USHORT nPortions = pTEParaPortion->GetTextPortions().Count();
+ sal_uInt16 nPortions = pTEParaPortion->GetTextPortions().Count();
for ( nSplitPortion = 0; nSplitPortion < nPortions; nSplitPortion++ )
{
TETextPortion* pTP = pTEParaPortion->GetTextPortions().GetObject(nSplitPortion);
@@ -1853,7 +1853,7 @@ USHORT TextEngine::SplitTextPortion( ULONG nPara, USHORT nPos )
DBG_ASSERT( pTextPortion, "Position ausserhalb des Bereichs!" );
- USHORT nOverlapp = nTmpPos - nPos;
+ sal_uInt16 nOverlapp = nTmpPos - nPos;
pTextPortion->GetLen() = pTextPortion->GetLen() - nOverlapp;
TETextPortion* pNewPortion = new TETextPortion( nOverlapp );
pTEParaPortion->GetTextPortions().Insert( pNewPortion, nSplitPortion+1 );
@@ -1862,18 +1862,18 @@ USHORT TextEngine::SplitTextPortion( ULONG nPara, USHORT nPos )
return nSplitPortion;
}
-void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos )
+void TextEngine::CreateTextPortions( sal_uLong nPara, sal_uInt16 nStartPos )
{
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
TextNode* pNode = pTEParaPortion->GetNode();
DBG_ASSERT( pNode->GetText().Len(), "CreateTextPortions sollte nicht fuer leere Absaetze verwendet werden!" );
TESortedPositions aPositions;
- ULONG nZero = 0;
+ sal_uLong nZero = 0;
aPositions.Insert( nZero );
- USHORT nAttribs = pNode->GetCharAttribs().Count();
- for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ sal_uInt16 nAttribs = pNode->GetCharAttribs().Count();
+ for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ )
{
TextCharAttrib* pAttrib = pNode->GetCharAttribs().GetAttrib( nAttr );
@@ -1885,7 +1885,7 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos )
aPositions.Insert( pNode->GetText().Len() );
const TEWritingDirectionInfos& rWritingDirections = pTEParaPortion->GetWritingDirectionInfos();
- for ( USHORT nD = 0; nD < rWritingDirections.Count(); nD++ )
+ for ( sal_uInt16 nD = 0; nD < rWritingDirections.Count(); nD++ )
aPositions.Insert( rWritingDirections[nD].nStartPos );
if ( mpIMEInfos && mpIMEInfos->pAttribs && ( mpIMEInfos->aPos.GetPara() == nPara ) )
@@ -1901,7 +1901,7 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos )
}
}
- USHORT nTabPos = pNode->GetText().Search( '\t', 0 );
+ sal_uInt16 nTabPos = pNode->GetText().Search( '\t', 0 );
while ( nTabPos != STRING_NOTFOUND )
{
aPositions.Insert( nTabPos );
@@ -1912,9 +1912,9 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos )
// Ab ... loeschen:
// Leider muss die Anzahl der TextPortions mit aPositions.Count()
// nicht uebereinstimmen, da evtl. Zeilenumbrueche...
- USHORT nPortionStart = 0;
- USHORT nInvPortion = 0;
- USHORT nP;
+ sal_uInt16 nPortionStart = 0;
+ sal_uInt16 nInvPortion = 0;
+ sal_uInt16 nP;
for ( nP = 0; nP < pTEParaPortion->GetTextPortions().Count(); nP++ )
{
TETextPortion* pTmpPortion = pTEParaPortion->GetTextPortions().GetObject(nP);
@@ -1940,15 +1940,15 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos )
// Eine Portion kann auch durch einen Zeilenumbruch entstanden sein:
aPositions.Insert( nPortionStart );
- USHORT nInvPos;
+ sal_uInt16 nInvPos;
#ifdef DBG_UTIL
- BOOL bFound =
+ sal_Bool bFound =
#endif
aPositions.Seek_Entry( nPortionStart, &nInvPos );
DBG_ASSERT( bFound && ( nInvPos < (aPositions.Count()-1) ), "InvPos ?!" );
- for ( USHORT i = nInvPos+1; i < aPositions.Count(); i++ )
+ for ( sal_uInt16 i = nInvPos+1; i < aPositions.Count(); i++ )
{
- TETextPortion* pNew = new TETextPortion( (USHORT)aPositions[i] - (USHORT)aPositions[i-1] );
+ TETextPortion* pNew = new TETextPortion( (sal_uInt16)aPositions[i] - (sal_uInt16)aPositions[i-1] );
pTEParaPortion->GetTextPortions().Insert( pNew, pTEParaPortion->GetTextPortions().Count());
}
@@ -1958,7 +1958,7 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos )
#endif
}
-void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewChars )
+void TextEngine::RecalcTextPortion( sal_uLong nPara, sal_uInt16 nStartPos, short nNewChars )
{
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
DBG_ASSERT( pTEParaPortion->GetTextPortions().Count(), "Keine Portions!" );
@@ -1976,7 +1976,7 @@ void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewCha
( nStartPos && ( pNode->GetText().GetChar( nStartPos - 1 ) == '\t' ) ) ||
( ( !nStartPos && ( nNewChars < pNode->GetText().Len() ) && pNode->GetText().GetChar( nNewChars ) == '\t' ) ) )
{
- USHORT nNewPortionPos = 0;
+ sal_uInt16 nNewPortionPos = 0;
if ( nStartPos )
nNewPortionPos = SplitTextPortion( nPara, nStartPos ) + 1;
// else if ( ( pTEParaPortion->GetTextPortions().Count() == 1 ) &&
@@ -1989,7 +1989,7 @@ void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewCha
!pTEParaPortion->GetTextPortions()[nNewPortionPos]->GetLen() )
{
// Dann die leere Portion verwenden.
- USHORT & r =
+ sal_uInt16 & r =
pTEParaPortion->GetTextPortions()[nNewPortionPos]->GetLen();
r = r + nNewChars;
}
@@ -2001,8 +2001,8 @@ void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewCha
}
else
{
- USHORT nPortionStart;
- const USHORT nTP = pTEParaPortion->GetTextPortions().
+ sal_uInt16 nPortionStart;
+ const sal_uInt16 nTP = pTEParaPortion->GetTextPortions().
FindPortion( nStartPos, nPortionStart );
TETextPortion* const pTP = pTEParaPortion->GetTextPortions()[ nTP ];
DBG_ASSERT( pTP, "RecalcTextPortion: Portion nicht gefunden" );
@@ -2018,10 +2018,10 @@ void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewCha
// Es darf keine reinragende oder im Bereich startende Portion geben,
// also muss nStartPos <= nPos <= nStartPos - nNewChars(neg.) sein
- USHORT nPortion = 0;
- USHORT nPos = 0;
- USHORT nEnd = nStartPos-nNewChars;
- USHORT nPortions = pTEParaPortion->GetTextPortions().Count();
+ sal_uInt16 nPortion = 0;
+ sal_uInt16 nPos = 0;
+ sal_uInt16 nEnd = nStartPos-nNewChars;
+ sal_uInt16 nPortions = pTEParaPortion->GetTextPortions().Count();
TETextPortion* pTP = 0;
for ( nPortion = 0; nPortion < nPortions; nPortion++ )
{
@@ -2072,7 +2072,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
TextPaM const* pSelEnd = 0;
if ( pSelection && pSelection->HasRange() )
{
- BOOL bInvers = pSelection->GetEnd() < pSelection->GetStart();
+ sal_Bool bInvers = pSelection->GetEnd() < pSelection->GetStart();
pSelStart = !bInvers ? &pSelection->GetStart() : &pSelection->GetEnd();
pSelEnd = bInvers ? &pSelection->GetStart() : &pSelection->GetEnd();
}
@@ -2083,23 +2083,23 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
// --------------------------------------------------
// Ueber alle Absaetze...
// --------------------------------------------------
- for ( ULONG nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ )
+ for ( sal_uLong nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ )
{
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara );
// falls beim Tippen Idle-Formatierung, asynchrones Paint.
if ( pPortion->IsInvalid() )
return;
- ULONG nParaHeight = CalcParaHeight( nPara );
+ sal_uLong nParaHeight = CalcParaHeight( nPara );
if ( ( !pPaintArea || ( ( nY + (long)nParaHeight ) > pPaintArea->Top() ) )
&& ( !pPaintRange || ( ( nPara >= pPaintRange->GetStart().GetPara() ) && ( nPara <= pPaintRange->GetEnd().GetPara() ) ) ) )
{
// --------------------------------------------------
// Ueber die Zeilen des Absatzes...
// --------------------------------------------------
- USHORT nLines = pPortion->GetLines().Count();
- USHORT nIndex = 0;
- for ( USHORT nLine = 0; nLine < nLines; nLine++ )
+ sal_uInt16 nLines = pPortion->GetLines().Count();
+ sal_uInt16 nIndex = 0;
+ for ( sal_uInt16 nLine = 0; nLine < nLines; nLine++ )
{
TextLine* pLine = pPortion->GetLines().GetObject(nLine);
Point aTmpPos( rStartPos.X() + pLine->GetStartX(), nY );
@@ -2113,7 +2113,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
// Ueber die Portions der Zeile...
// --------------------------------------------------
nIndex = pLine->GetStart();
- for ( USHORT y = pLine->GetStartPortion(); y <= pLine->GetEndPortion(); y++ )
+ for ( sal_uInt16 y = pLine->GetStartPortion(); y <= pLine->GetEndPortion(); y++ )
{
DBG_ASSERT( pPortion->GetTextPortions().Count(), "Zeile ohne Textportion im Paint!" );
TETextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( y );
@@ -2138,13 +2138,13 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
Font aFont;
SeekCursor( nPara, nIndex+1, aFont, pOutDev );
if( bTransparent )
- aFont.SetTransparent( TRUE );
+ aFont.SetTransparent( sal_True );
else if ( pSelection )
- aFont.SetTransparent( FALSE );
+ aFont.SetTransparent( sal_False );
pOutDev->SetFont( aFont );
- USHORT nTmpIndex = nIndex;
- USHORT nEnd = nTmpIndex + pTextPortion->GetLen();
+ sal_uInt16 nTmpIndex = nIndex;
+ sal_uInt16 nEnd = nTmpIndex + pTextPortion->GetLen();
Point aPos = aTmpPos;
if ( pPaintRange )
{
@@ -2161,7 +2161,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
}
}
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
if ( pSelStart )
{
// liegt ein Teil in der Selektion???
@@ -2169,7 +2169,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
TextPaM aTextEnd( nPara, nEnd );
if ( ( aTextStart < *pSelEnd ) && ( aTextEnd > *pSelStart ) )
{
- USHORT nL;
+ sal_uInt16 nL;
// 1) Bereich vor Selektion
if ( aTextStart < *pSelStart )
@@ -2204,7 +2204,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
aPos.X() = rStartPos.X() + ImpGetOutputOffset( nPara, pLine, nTmpIndex, nTmpIndex+nL );
pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nEnd-nTmpIndex );
}
- bDone = TRUE;
+ bDone = sal_True;
}
}
if ( !bDone )
@@ -2222,7 +2222,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
if ( pSelStart || pPaintRange )
{
Rectangle aTabArea( aTmpPos, Point( aTmpPos.X()+nTxtWidth, aTmpPos.Y()+mnCharHeight-1 ) );
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
if ( pSelStart )
{
// liegt der Tab in der Selektion???
@@ -2234,7 +2234,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
pOutDev->SetFillColor( rStyleSettings.GetHighlightColor() );
pOutDev->DrawRect( aTabArea );
pOutDev->SetFillColor( aOldColor );
- bDone = TRUE;
+ bDone = sal_True;
}
}
if ( !bDone )
@@ -2275,15 +2275,15 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
}
}
-BOOL TextEngine::CreateLines( ULONG nPara )
+sal_Bool TextEngine::CreateLines( sal_uLong nPara )
{
- // BOOL: Aenderung der Hoehe des Absatzes Ja/Nein - TRUE/FALSE
+ // sal_Bool: Aenderung der Hoehe des Absatzes Ja/Nein - sal_True/sal_False
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
DBG_ASSERT( pTEParaPortion->IsInvalid(), "CreateLines: Portion nicht invalid!" );
- USHORT nOldLineCount = pTEParaPortion->GetLines().Count();
+ sal_uInt16 nOldLineCount = pTEParaPortion->GetLines().Count();
// ---------------------------------------------------------------
// Schnelle Sonderbehandlung fuer leere Absaetze...
@@ -2311,9 +2311,9 @@ BOOL TextEngine::CreateLines( ULONG nPara )
}
const short nInvalidDiff = pTEParaPortion->GetInvalidDiff();
- const USHORT nInvalidStart = pTEParaPortion->GetInvalidPosStart();
- const USHORT nInvalidEnd = nInvalidStart + Abs( nInvalidDiff );
- BOOL bQuickFormat = FALSE;
+ const sal_uInt16 nInvalidStart = pTEParaPortion->GetInvalidPosStart();
+ const sal_uInt16 nInvalidEnd = nInvalidStart + Abs( nInvalidDiff );
+ sal_Bool bQuickFormat = sal_False;
if ( !pTEParaPortion->GetWritingDirectionInfos().Count() )
ImpInitWritingDirections( nPara );
@@ -2322,24 +2322,24 @@ BOOL TextEngine::CreateLines( ULONG nPara )
{
if ( pTEParaPortion->IsSimpleInvalid() && ( nInvalidDiff > 0 ) )
{
- bQuickFormat = TRUE;
+ bQuickFormat = sal_True;
}
else if ( ( pTEParaPortion->IsSimpleInvalid() ) && ( nInvalidDiff < 0 ) )
{
// pruefen, ob loeschen ueber Portiongrenzen erfolgte...
- USHORT nStart = nInvalidStart; // DOPPELT !!!!!!!!!!!!!!!
- USHORT nEnd = nStart - nInvalidDiff; // neg.
- bQuickFormat = TRUE;
- USHORT nPos = 0;
- USHORT nPortions = pTEParaPortion->GetTextPortions().Count();
- for ( USHORT nTP = 0; nTP < nPortions; nTP++ )
+ sal_uInt16 nStart = nInvalidStart; // DOPPELT !!!!!!!!!!!!!!!
+ sal_uInt16 nEnd = nStart - nInvalidDiff; // neg.
+ bQuickFormat = sal_True;
+ sal_uInt16 nPos = 0;
+ sal_uInt16 nPortions = pTEParaPortion->GetTextPortions().Count();
+ for ( sal_uInt16 nTP = 0; nTP < nPortions; nTP++ )
{
// Es darf kein Start/Ende im geloeschten Bereich liegen.
TETextPortion* const pTP = pTEParaPortion->GetTextPortions().GetObject( nTP );
nPos = nPos + pTP->GetLen();
if ( ( nPos > nStart ) && ( nPos < nEnd ) )
{
- bQuickFormat = FALSE;
+ bQuickFormat = sal_False;
break;
}
}
@@ -2356,8 +2356,8 @@ BOOL TextEngine::CreateLines( ULONG nPara )
// Zeilen flaggen => nicht removen !
// ---------------------------------------------------------------
- USHORT nLine = pTEParaPortion->GetLines().Count()-1;
- for ( USHORT nL = 0; nL <= nLine; nL++ )
+ sal_uInt16 nLine = pTEParaPortion->GetLines().Count()-1;
+ for ( sal_uInt16 nL = 0; nL <= nLine; nL++ )
{
TextLine* pLine = pTEParaPortion->GetLines().GetObject( nL );
if ( pLine->GetEnd() > nInvalidStart )
@@ -2377,24 +2377,24 @@ BOOL TextEngine::CreateLines( ULONG nPara )
// ---------------------------------------------------------------
// Ab hier alle Zeilen durchformatieren...
// ---------------------------------------------------------------
- USHORT nDelFromLine = 0xFFFF;
- BOOL bLineBreak = FALSE;
+ sal_uInt16 nDelFromLine = 0xFFFF;
+ sal_Bool bLineBreak = sal_False;
- USHORT nIndex = pLine->GetStart();
+ sal_uInt16 nIndex = pLine->GetStart();
TextLine aSaveLine( *pLine );
Font aFont;
- BOOL bCalcPortion = TRUE;
+ sal_Bool bCalcPortion = sal_True;
while ( nIndex < pNode->GetText().Len() )
{
- BOOL bEOL = FALSE;
- USHORT nPortionStart = 0;
- USHORT nPortionEnd = 0;
+ sal_Bool bEOL = sal_False;
+ sal_uInt16 nPortionStart = 0;
+ sal_uInt16 nPortionEnd = 0;
- USHORT nTmpPos = nIndex;
- USHORT nTmpPortion = pLine->GetStartPortion();
+ sal_uInt16 nTmpPos = nIndex;
+ sal_uInt16 nTmpPortion = pLine->GetStartPortion();
long nTmpWidth = mpDoc->GetLeftMargin();
// long nXWidth = mnMaxTextWidth ? ( mnMaxTextWidth - mpDoc->GetLeftMargin() ) : 0x7FFFFFFF;
// Margin nicht abziehen, ist schon in TmpWidth enthalten.
@@ -2404,8 +2404,8 @@ BOOL TextEngine::CreateLines( ULONG nPara )
// Portion suchen, die nicht mehr in Zeile passt....
TETextPortion* pPortion = 0;
- BOOL bBrokenLine = FALSE;
- bLineBreak = FALSE;
+ sal_Bool bBrokenLine = sal_False;
+ bLineBreak = sal_False;
while ( ( nTmpWidth <= nXWidth ) && !bEOL && ( nTmpPortion < pTEParaPortion->GetTextPortions().Count() ) )
{
@@ -2424,8 +2424,8 @@ BOOL TextEngine::CreateLines( ULONG nPara )
// Aber was jetzt ? Tab passend machen!
pPortion->GetWidth() = nXWidth-1;
nTmpWidth = pPortion->GetWidth();
- bEOL = TRUE;
- bBrokenLine = TRUE;
+ bEOL = sal_True;
+ bBrokenLine = sal_True;
}
pPortion->GetKind() = PORTIONKIND_TAB;
}
@@ -2446,28 +2446,28 @@ BOOL TextEngine::CreateLines( ULONG nPara )
}
// das war evtl. eine Portion zu weit:
- BOOL bFixedEnd = FALSE;
+ sal_Bool bFixedEnd = sal_False;
if ( nTmpWidth > nXWidth )
{
nPortionEnd = nTmpPos;
nTmpPos = nTmpPos - pPortion->GetLen();
nPortionStart = nTmpPos;
nTmpPortion--;
- bEOL = FALSE;
+ bEOL = sal_False;
nTmpWidth -= pPortion->GetWidth();
if ( pPortion->GetKind() == PORTIONKIND_TAB )
{
- bEOL = TRUE;
- bFixedEnd = TRUE;
+ bEOL = sal_True;
+ bFixedEnd = sal_True;
}
}
else
{
- bEOL = TRUE;
+ bEOL = sal_True;
pLine->SetEnd( nPortionEnd );
DBG_ASSERT( pTEParaPortion->GetTextPortions().Count(), "Keine TextPortions?" );
- pLine->SetEndPortion( (USHORT)pTEParaPortion->GetTextPortions().Count() - 1 );
+ pLine->SetEndPortion( (sal_uInt16)pTEParaPortion->GetTextPortions().Count() - 1 );
}
if ( bFixedEnd )
@@ -2491,7 +2491,7 @@ BOOL TextEngine::CreateLines( ULONG nPara )
{
// Ausrichten...
long nTextWidth = 0;
- for ( USHORT nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ )
+ for ( sal_uInt16 nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ )
{
TETextPortion* pTextPortion = pTEParaPortion->GetTextPortions().GetObject( nTP );
nTextWidth += pTextPortion->GetWidth();
@@ -2500,9 +2500,9 @@ BOOL TextEngine::CreateLines( ULONG nPara )
if ( nSpace > 0 )
{
if ( ImpGetAlign() == TXTALIGN_CENTER )
- pLine->SetStartX( (USHORT)(nSpace / 2) );
+ pLine->SetStartX( (sal_uInt16)(nSpace / 2) );
else // TXTALIGN_RIGHT
- pLine->SetStartX( (USHORT)nSpace );
+ pLine->SetStartX( (sal_uInt16)nSpace );
}
}
else
@@ -2531,8 +2531,8 @@ BOOL TextEngine::CreateLines( ULONG nPara )
}
else
{
- USHORT nStart = pLine->GetStart();
- USHORT nEnd = pLine->GetEnd();
+ sal_uInt16 nStart = pLine->GetStart();
+ sal_uInt16 nEnd = pLine->GetEnd();
if ( nStart > nInvalidEnd )
{
@@ -2542,7 +2542,7 @@ BOOL TextEngine::CreateLines( ULONG nPara )
pLine->SetValid();
if ( bCalcPortion && bQuickFormat )
{
- bCalcPortion = FALSE;
+ bCalcPortion = sal_False;
pTEParaPortion->CorrectValuesBehindLastFormattedLine( nLine );
break;
}
@@ -2556,7 +2556,7 @@ BOOL TextEngine::CreateLines( ULONG nPara )
// textbreiten neu bestimmen:
if ( nEnd == ( aSaveLine.GetEnd() + nInvalidDiff ) )
{
- bCalcPortion = FALSE;
+ bCalcPortion = sal_False;
pTEParaPortion->CorrectValuesBehindLastFormattedLine( nLine );
break;
}
@@ -2567,7 +2567,7 @@ BOOL TextEngine::CreateLines( ULONG nPara )
nIndex = pLine->GetEnd(); // naechste Zeile Start = letzte Zeile Ende
// weil nEnd hinter das letzte Zeichen zeigt!
- USHORT nEndPortion = pLine->GetEndPortion();
+ sal_uInt16 nEndPortion = pLine->GetEndPortion();
// Naechste Zeile oder ggf. neue Zeile....
pLine = 0;
@@ -2598,7 +2598,7 @@ BOOL TextEngine::CreateLines( ULONG nPara )
DBG_ASSERT( pTEParaPortion->GetLines().Count(), "Keine Zeile nach CreateLines!" );
- if ( bLineBreak == TRUE )
+ if ( bLineBreak == sal_True )
CreateAndInsertEmptyLine( nPara );
pTEParaPortion->SetValid();
@@ -2615,8 +2615,8 @@ String TextEngine::GetWord( const TextPaM& rCursorPos, TextPaM* pStartOfWord )
TextNode* pNode = mpDoc->GetNodes().GetObject( rCursorPos.GetPara() );
uno::Reference < i18n::XBreakIterator > xBI = GetBreakIterator();
i18n::Boundary aBoundary = xBI->getWordBoundary( pNode->GetText(), rCursorPos.GetIndex(), GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True );
- aSel.GetStart().GetIndex() = (USHORT)aBoundary.startPos;
- aSel.GetEnd().GetIndex() = (USHORT)aBoundary.endPos;
+ aSel.GetStart().GetIndex() = (sal_uInt16)aBoundary.startPos;
+ aSel.GetEnd().GetIndex() = (sal_uInt16)aBoundary.endPos;
aWord = pNode->GetText().Copy( aSel.GetStart().GetIndex(), aSel.GetEnd().GetIndex() - aSel.GetStart().GetIndex() );
if ( pStartOfWord )
*pStartOfWord = aSel.GetStart();
@@ -2624,18 +2624,18 @@ String TextEngine::GetWord( const TextPaM& rCursorPos, TextPaM* pStartOfWord )
return aWord;
}
-BOOL TextEngine::Read( SvStream& rInput, const TextSelection* pSel )
+sal_Bool TextEngine::Read( SvStream& rInput, const TextSelection* pSel )
{
- BOOL bUpdate = GetUpdateMode();
- SetUpdateMode( FALSE );
+ sal_Bool bUpdate = GetUpdateMode();
+ SetUpdateMode( sal_False );
- UndoActionStart( TEXTUNDO_READ );
+ UndoActionStart();
TextSelection aSel;
if ( pSel )
aSel = *pSel;
else
{
- ULONG nParas = mpDoc->GetNodes().Count();
+ sal_uLong nParas = mpDoc->GetNodes().Count();
TextNode* pNode = mpDoc->GetNodes().GetObject( nParas - 1 );
aSel = TextPaM( nParas-1 , pNode->GetText().Len() );
}
@@ -2644,7 +2644,7 @@ BOOL TextEngine::Read( SvStream& rInput, const TextSelection* pSel )
aSel = ImpDeleteText( aSel );
ByteString aLine;
- BOOL bDone = rInput.ReadLine( aLine );
+ sal_Bool bDone = rInput.ReadLine( aLine );
String aTmpStr( aLine, rInput.GetStreamCharSet() ), aStr;
while ( bDone )
{
@@ -2655,7 +2655,7 @@ BOOL TextEngine::Read( SvStream& rInput, const TextSelection* pSel )
aSel = ImpInsertParaBreak( aSel.GetEnd() );
}
- UndoActionEnd( TEXTUNDO_READ );
+ UndoActionEnd();
TextSelection aNewSel( aSel.GetEnd(), aSel.GetEnd() );
@@ -2666,17 +2666,17 @@ BOOL TextEngine::Read( SvStream& rInput, const TextSelection* pSel )
SetUpdateMode( bUpdate );
FormatAndUpdate( GetActiveView() );
- return rInput.GetError() ? FALSE : TRUE;
+ return rInput.GetError() ? sal_False : sal_True;
}
-BOOL TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, BOOL bHTML )
+sal_Bool TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, sal_Bool bHTML )
{
TextSelection aSel;
if ( pSel )
aSel = *pSel;
else
{
- ULONG nParas = mpDoc->GetNodes().Count();
+ sal_uLong nParas = mpDoc->GetNodes().Count();
TextNode* pNode = mpDoc->GetNodes().GetObject( nParas - 1 );
aSel.GetStart() = TextPaM( 0, 0 );
aSel.GetEnd() = TextPaM( nParas-1, pNode->GetText().Len() );
@@ -2688,12 +2688,12 @@ BOOL TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, BOOL bHTML
rOutput.WriteLine( "<BODY>" );
}
- for ( ULONG nPara = aSel.GetStart().GetPara(); nPara <= aSel.GetEnd().GetPara(); nPara++ )
+ for ( sal_uLong nPara = aSel.GetStart().GetPara(); nPara <= aSel.GetEnd().GetPara(); nPara++ )
{
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
- USHORT nStartPos = 0;
- USHORT nEndPos = pNode->GetText().Len();
+ sal_uInt16 nStartPos = 0;
+ sal_uInt16 nEndPos = pNode->GetText().Len();
if ( nPara == aSel.GetStart().GetPara() )
nStartPos = aSel.GetStart().GetIndex();
if ( nPara == aSel.GetEnd().GetPara() )
@@ -2715,8 +2715,8 @@ BOOL TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, BOOL bHTML
}
else
{
- USHORT nTmpStart = nStartPos;
- USHORT nTmpEnd = nEndPos;
+ sal_uInt16 nTmpStart = nStartPos;
+ sal_uInt16 nTmpEnd = nEndPos;
do
{
TextCharAttrib* pAttr = pNode->GetCharAttribs().FindNextAttrib( TEXTATTR_HYPERLINK, nTmpStart, nEndPos );
@@ -2753,22 +2753,22 @@ BOOL TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, BOOL bHTML
rOutput.WriteLine( "</HTML>" );
}
- return rOutput.GetError() ? FALSE : TRUE;
+ return rOutput.GetError() ? sal_False : sal_True;
}
-void TextEngine::RemoveAttribs( ULONG nPara, BOOL bIdleFormatAndUpdate )
+void TextEngine::RemoveAttribs( sal_uLong nPara, sal_Bool bIdleFormatAndUpdate )
{
if ( nPara < mpDoc->GetNodes().Count() )
{
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
if ( pNode->GetCharAttribs().Count() )
{
- pNode->GetCharAttribs().Clear( TRUE );
+ pNode->GetCharAttribs().Clear( sal_True );
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
pTEParaPortion->MarkSelectionInvalid( 0, pNode->GetText().Len() );
- mbFormatted = FALSE;
+ mbFormatted = sal_False;
if ( bIdleFormatAndUpdate )
IdleFormatAndUpdate( NULL, 0xFFFF );
@@ -2777,7 +2777,7 @@ void TextEngine::RemoveAttribs( ULONG nPara, BOOL bIdleFormatAndUpdate )
}
}
}
-void TextEngine::RemoveAttribs( ULONG nPara, USHORT nWhich, BOOL bIdleFormatAndUpdate )
+void TextEngine::RemoveAttribs( sal_uLong nPara, sal_uInt16 nWhich, sal_Bool bIdleFormatAndUpdate )
{
if ( nPara < mpDoc->GetNodes().Count() )
{
@@ -2785,15 +2785,15 @@ void TextEngine::RemoveAttribs( ULONG nPara, USHORT nWhich, BOOL bIdleFormatAndU
if ( pNode->GetCharAttribs().Count() )
{
TextCharAttribList& rAttribs = pNode->GetCharAttribs();
- USHORT nAttrCount = rAttribs.Count();
- for(USHORT nAttr = nAttrCount; nAttr; --nAttr)
+ sal_uInt16 nAttrCount = rAttribs.Count();
+ for(sal_uInt16 nAttr = nAttrCount; nAttr; --nAttr)
{
if(rAttribs.GetAttrib( nAttr - 1 )->Which() == nWhich)
rAttribs.RemoveAttrib( nAttr -1 );
}
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
pTEParaPortion->MarkSelectionInvalid( 0, pNode->GetText().Len() );
- mbFormatted = FALSE;
+ mbFormatted = sal_False;
if(bIdleFormatAndUpdate)
IdleFormatAndUpdate( NULL, 0xFFFF );
else
@@ -2801,7 +2801,7 @@ void TextEngine::RemoveAttribs( ULONG nPara, USHORT nWhich, BOOL bIdleFormatAndU
}
}
}
-void TextEngine::RemoveAttrib( ULONG nPara, const TextCharAttrib& rAttrib )
+void TextEngine::RemoveAttrib( sal_uLong nPara, const TextCharAttrib& rAttrib )
{
if ( nPara < mpDoc->GetNodes().Count() )
{
@@ -2809,8 +2809,8 @@ void TextEngine::RemoveAttrib( ULONG nPara, const TextCharAttrib& rAttrib )
if ( pNode->GetCharAttribs().Count() )
{
TextCharAttribList& rAttribs = pNode->GetCharAttribs();
- USHORT nAttrCount = rAttribs.Count();
- for(USHORT nAttr = nAttrCount; nAttr; --nAttr)
+ sal_uInt16 nAttrCount = rAttribs.Count();
+ for(sal_uInt16 nAttr = nAttrCount; nAttr; --nAttr)
{
if(rAttribs.GetAttrib( nAttr - 1 ) == &rAttrib)
{
@@ -2820,13 +2820,13 @@ void TextEngine::RemoveAttrib( ULONG nPara, const TextCharAttrib& rAttrib )
}
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
pTEParaPortion->MarkSelectionInvalid( 0, pNode->GetText().Len() );
- mbFormatted = FALSE;
+ mbFormatted = sal_False;
FormatAndUpdate( NULL );
}
}
}
-void TextEngine::SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart, USHORT nEnd, BOOL bIdleFormatAndUpdate )
+void TextEngine::SetAttrib( const TextAttrib& rAttr, sal_uLong nPara, sal_uInt16 nStart, sal_uInt16 nEnd, sal_Bool bIdleFormatAndUpdate )
{
// Es wird hier erstmal nicht geprueft, ob sich Attribute ueberlappen!
// Diese Methode ist erstmal nur fuer einen Editor, der fuer eine Zeile
@@ -2840,7 +2840,7 @@ void TextEngine::SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart,
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
- USHORT nMax = pNode->GetText().Len();
+ sal_uInt16 nMax = pNode->GetText().Len();
if ( nStart > nMax )
nStart = nMax;
if ( nEnd > nMax )
@@ -2849,7 +2849,7 @@ void TextEngine::SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart,
pNode->GetCharAttribs().InsertAttrib( new TextCharAttrib( rAttr, nStart, nEnd ) );
pTEParaPortion->MarkSelectionInvalid( nStart, nEnd );
- mbFormatted = FALSE;
+ mbFormatted = sal_False;
if ( bIdleFormatAndUpdate )
IdleFormatAndUpdate( NULL, 0xFFFF );
else
@@ -2876,14 +2876,14 @@ void TextEngine::ValidateSelection( TextSelection& rSel ) const
void TextEngine::ValidatePaM( TextPaM& rPaM ) const
{
- ULONG nMaxPara = mpDoc->GetNodes().Count() - 1;
+ sal_uLong nMaxPara = mpDoc->GetNodes().Count() - 1;
if ( rPaM.GetPara() > nMaxPara )
{
rPaM.GetPara() = nMaxPara;
rPaM.GetIndex() = 0xFFFF;
}
- USHORT nMaxIndex = GetTextLen( rPaM.GetPara() );
+ sal_uInt16 nMaxIndex = GetTextLen( rPaM.GetPara() );
if ( rPaM.GetIndex() > nMaxIndex )
rPaM.GetIndex() = nMaxIndex;
}
@@ -2891,18 +2891,18 @@ void TextEngine::ValidatePaM( TextPaM& rPaM ) const
// Status & Selektionsanpassung
-void TextEngine::ImpParagraphInserted( ULONG nPara )
+void TextEngine::ImpParagraphInserted( sal_uLong nPara )
{
// Die aktive View braucht nicht angepasst werden, aber bei allen
// passiven muss die Selektion angepasst werden:
if ( mpViews->Count() > 1 )
{
- for ( USHORT nView = mpViews->Count(); nView; )
+ for ( sal_uInt16 nView = mpViews->Count(); nView; )
{
TextView* pView = mpViews->GetObject( --nView );
if ( pView != GetActiveView() )
{
-// BOOL bInvers = pView->maSelection.GetEnd() < pView->maSelection.GetStart();
+// sal_Bool bInvers = pView->maSelection.GetEnd() < pView->maSelection.GetStart();
// TextPaM& rMin = !bInvers ? pView->maSelection.GetStart(): pView->maSelection.GetEnd();
// TextPaM& rMax = bInvers ? pView->maSelection.GetStart() : pView->maSelection.GetEnd();
//
@@ -2922,16 +2922,16 @@ void TextEngine::ImpParagraphInserted( ULONG nPara )
Broadcast( TextHint( TEXT_HINT_PARAINSERTED, nPara ) );
}
-void TextEngine::ImpParagraphRemoved( ULONG nPara )
+void TextEngine::ImpParagraphRemoved( sal_uLong nPara )
{
if ( mpViews->Count() > 1 )
{
- for ( USHORT nView = mpViews->Count(); nView; )
+ for ( sal_uInt16 nView = mpViews->Count(); nView; )
{
TextView* pView = mpViews->GetObject( --nView );
if ( pView != GetActiveView() )
{
- ULONG nParas = mpDoc->GetNodes().Count();
+ sal_uLong nParas = mpDoc->GetNodes().Count();
for ( int n = 0; n <= 1; n++ )
{
TextPaM& rPaM = n ? pView->GetSelection().GetStart(): pView->GetSelection().GetEnd();
@@ -2950,16 +2950,16 @@ void TextEngine::ImpParagraphRemoved( ULONG nPara )
Broadcast( TextHint( TEXT_HINT_PARAREMOVED, nPara ) );
}
-void TextEngine::ImpCharsRemoved( ULONG nPara, USHORT nPos, USHORT nChars )
+void TextEngine::ImpCharsRemoved( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16 nChars )
{
if ( mpViews->Count() > 1 )
{
- for ( USHORT nView = mpViews->Count(); nView; )
+ for ( sal_uInt16 nView = mpViews->Count(); nView; )
{
TextView* pView = mpViews->GetObject( --nView );
if ( pView != GetActiveView() )
{
- USHORT nEnd = nPos+nChars;
+ sal_uInt16 nEnd = nPos+nChars;
for ( int n = 0; n <= 1; n++ )
{
TextPaM& rPaM = n ? pView->GetSelection().GetStart(): pView->GetSelection().GetEnd();
@@ -2977,11 +2977,11 @@ void TextEngine::ImpCharsRemoved( ULONG nPara, USHORT nPos, USHORT nChars )
Broadcast( TextHint( TEXT_HINT_PARACONTENTCHANGED, nPara ) );
}
-void TextEngine::ImpCharsInserted( ULONG nPara, USHORT nPos, USHORT nChars )
+void TextEngine::ImpCharsInserted( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16 nChars )
{
if ( mpViews->Count() > 1 )
{
- for ( USHORT nView = mpViews->Count(); nView; )
+ for ( sal_uInt16 nView = mpViews->Count(); nView; )
{
TextView* pView = mpViews->GetObject( --nView );
if ( pView != GetActiveView() )
@@ -3001,7 +3001,7 @@ void TextEngine::ImpCharsInserted( ULONG nPara, USHORT nPos, USHORT nChars )
Broadcast( TextHint( TEXT_HINT_PARACONTENTCHANGED, nPara ) );
}
-void TextEngine::ImpFormattingParagraph( ULONG nPara )
+void TextEngine::ImpFormattingParagraph( sal_uLong nPara )
{
Broadcast( TextHint( TEXT_HINT_FORMATPARA, nPara ) );
}
@@ -3021,12 +3021,12 @@ void TextEngine::Draw( OutputDevice* pDev, const Point& rPos )
ImpPaint( pDev, rPos, NULL );
}
-void TextEngine::SetLeftMargin( USHORT n )
+void TextEngine::SetLeftMargin( sal_uInt16 n )
{
mpDoc->SetLeftMargin( n );
}
-USHORT TextEngine::GetLeftMargin() const
+sal_uInt16 TextEngine::GetLeftMargin() const
{
return mpDoc->GetLeftMargin();
}
@@ -3063,7 +3063,7 @@ LocaleDataWrapper* TextEngine::ImpGetLocaleDataWrapper()
return mpLocaleDataWrapper;
}
-void TextEngine::SetRightToLeft( BOOL bR2L )
+void TextEngine::SetRightToLeft( sal_Bool bR2L )
{
if ( mbRightToLeft != bR2L )
{
@@ -3074,7 +3074,7 @@ void TextEngine::SetRightToLeft( BOOL bR2L )
}
}
-void TextEngine::ImpInitWritingDirections( ULONG nPara )
+void TextEngine::ImpInitWritingDirections( sal_uLong nPara )
{
TEParaPortion* pParaPortion = mpTEParaPortions->GetObject( nPara );
TEWritingDirectionInfos& rInfos = pParaPortion->GetWritingDirectionInfos();
@@ -3101,10 +3101,10 @@ void TextEngine::ImpInitWritingDirections( ULONG nPara )
int32_t nEnd;
UBiDiLevel nCurrDir;
- for ( USHORT nIdx = 0; nIdx < nCount; ++nIdx )
+ for ( sal_uInt16 nIdx = 0; nIdx < nCount; ++nIdx )
{
ubidi_getLogicalRun( pBidi, nStart, &nEnd, &nCurrDir );
- rInfos.Insert( TEWritingDirectionInfo( nCurrDir, (USHORT)nStart, (USHORT)nEnd ), rInfos.Count() );
+ rInfos.Insert( TEWritingDirectionInfo( nCurrDir, (sal_uInt16)nStart, (sal_uInt16)nEnd ), rInfos.Count() );
nStart = nEnd;
}
@@ -3113,13 +3113,13 @@ void TextEngine::ImpInitWritingDirections( ULONG nPara )
// No infos mean no CTL and default dir is L2R...
if ( !rInfos.Count() )
- rInfos.Insert( TEWritingDirectionInfo( 0, 0, (USHORT)pParaPortion->GetNode()->GetText().Len() ), rInfos.Count() );
+ rInfos.Insert( TEWritingDirectionInfo( 0, 0, (sal_uInt16)pParaPortion->GetNode()->GetText().Len() ), rInfos.Count() );
}
-BYTE TextEngine::ImpGetRightToLeft( ULONG nPara, USHORT nPos, USHORT* pStart, USHORT* pEnd )
+sal_uInt8 TextEngine::ImpGetRightToLeft( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16* pStart, sal_uInt16* pEnd )
{
- BYTE nRightToLeft = 0;
+ sal_uInt8 nRightToLeft = 0;
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
if ( pNode && pNode->GetText().Len() )
@@ -3129,7 +3129,7 @@ BYTE TextEngine::ImpGetRightToLeft( ULONG nPara, USHORT nPos, USHORT* pStart, US
ImpInitWritingDirections( nPara );
TEWritingDirectionInfos& rDirInfos = pParaPortion->GetWritingDirectionInfos();
- for ( USHORT n = 0; n < rDirInfos.Count(); n++ )
+ for ( sal_uInt16 n = 0; n < rDirInfos.Count(); n++ )
{
if ( ( rDirInfos[n].nStartPos <= nPos ) && ( rDirInfos[n].nEndPos >= nPos ) )
{
@@ -3145,13 +3145,13 @@ BYTE TextEngine::ImpGetRightToLeft( ULONG nPara, USHORT nPos, USHORT* pStart, US
return nRightToLeft;
}
-long TextEngine::ImpGetPortionXOffset( ULONG nPara, TextLine* pLine, USHORT nTextPortion )
+long TextEngine::ImpGetPortionXOffset( sal_uLong nPara, TextLine* pLine, sal_uInt16 nTextPortion )
{
long nX = pLine->GetStartX();
TEParaPortion* pParaPortion = mpTEParaPortions->GetObject( nPara );
- for ( USHORT i = pLine->GetStartPortion(); i < nTextPortion; i++ )
+ for ( sal_uInt16 i = pLine->GetStartPortion(); i < nTextPortion; i++ )
{
TETextPortion* pPortion = pParaPortion->GetTextPortions().GetObject( i );
nX += pPortion->GetWidth();
@@ -3225,9 +3225,9 @@ long TextEngine::ImpGetPortionXOffset( ULONG nPara, TextLine* pLine, USHORT nTex
return nX;
}
-void TextEngine::ImpInitLayoutMode( OutputDevice* pOutDev, BOOL bDrawingR2LPortion )
+void TextEngine::ImpInitLayoutMode( OutputDevice* pOutDev, sal_Bool bDrawingR2LPortion )
{
- ULONG nLayoutMode = pOutDev->GetLayoutMode();
+ sal_uLong nLayoutMode = pOutDev->GetLayoutMode();
nLayoutMode &= ~(TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_COMPLEX_DISABLED | TEXT_LAYOUT_BIDI_STRONG );
if ( bDrawingR2LPortion )
@@ -3249,12 +3249,12 @@ TxtAlign TextEngine::ImpGetAlign() const
return eAlign;
}
-long TextEngine::ImpGetOutputOffset( ULONG nPara, TextLine* pLine, USHORT nIndex, USHORT nIndex2 )
+long TextEngine::ImpGetOutputOffset( sal_uLong nPara, TextLine* pLine, sal_uInt16 nIndex, sal_uInt16 nIndex2 )
{
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara );
- USHORT nPortionStart;
- USHORT nPortion = pPortion->GetTextPortions().FindPortion( nIndex, nPortionStart, TRUE );
+ sal_uInt16 nPortionStart;
+ sal_uInt16 nPortion = pPortion->GetTextPortions().FindPortion( nIndex, nPortionStart, sal_True );
TETextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( nPortion );
@@ -3275,7 +3275,7 @@ long TextEngine::ImpGetOutputOffset( ULONG nPara, TextLine* pLine, USHORT nIndex
nX = ImpGetXPos( nPara, pLine, nIndex, nIndex == nPortionStart );
if ( nIndex2 != nIndex )
{
- long nX2 = ImpGetXPos( nPara, pLine, nIndex2, FALSE );
+ long nX2 = ImpGetXPos( nPara, pLine, nIndex2, sal_False );
if ( ( !IsRightToLeft() && ( nX2 < nX ) ) ||
( IsRightToLeft() && ( nX2 > nX ) ) )
{
diff --git a/svtools/source/edit/textund2.hxx b/svtools/source/edit/textund2.hxx
index b49619894670..63937c31e0e8 100644
--- a/svtools/source/edit/textund2.hxx
+++ b/svtools/source/edit/textund2.hxx
@@ -34,13 +34,13 @@
class TextUndoDelPara : public TextUndo
{
private:
- BOOL mbDelObject;
- ULONG mnPara;
+ sal_Bool mbDelObject;
+ sal_uLong mnPara;
TextNode* mpNode; // Zeigt auf das gueltige, nicht zerstoerte Objekt!
public:
TYPEINFO();
- TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, ULONG nPara );
+ TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, sal_uLong nPara );
~TextUndoDelPara();
virtual void Undo();
@@ -51,12 +51,12 @@ public:
class TextUndoConnectParas : public TextUndo
{
private:
- ULONG mnPara;
- USHORT mnSepPos;
+ sal_uLong mnPara;
+ sal_uInt16 mnSepPos;
public:
TYPEINFO();
- TextUndoConnectParas( TextEngine* pTextEngine, ULONG nPara, USHORT nSepPos );
+ TextUndoConnectParas( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nSepPos );
~TextUndoConnectParas();
virtual void Undo();
@@ -67,12 +67,12 @@ public:
class TextUndoSplitPara : public TextUndo
{
private:
- ULONG mnPara;
- USHORT mnSepPos;
+ sal_uLong mnPara;
+ sal_uInt16 mnSepPos;
public:
TYPEINFO();
- TextUndoSplitPara( TextEngine* pTextEngine, ULONG nPara, USHORT nSepPos );
+ TextUndoSplitPara( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nSepPos );
~TextUndoSplitPara();
virtual void Undo();
@@ -96,7 +96,7 @@ public:
virtual void Undo();
virtual void Redo();
- virtual BOOL Merge( SfxUndoAction *pNextAction );
+ virtual sal_Bool Merge( SfxUndoAction *pNextAction );
};
@@ -124,9 +124,9 @@ private:
TextSelection maSelection;
// SfxItemSet aNewAttribs;
// TextInfoArray aPrevAttribs;
-// BYTE nSpecial;
-// BOOL bSetIsRemove;
-// USHORT nRemoveWhich;
+// sal_uInt8 nSpecial;
+// sal_Bool bSetIsRemove;
+// sal_uInt16 nRemoveWhich;
//
// void ImpSetSelection( TextView* pView );
@@ -138,9 +138,9 @@ public:
// TextInfoArray& GetTextInfos() { return aPrevAttribs; }
// SfxItemSet& GetNewAttribs() { return aNewAttribs; }
-// void SetSpecial( BYTE n ) { nSpecial = n; }
-// void SetRemoveAttribs( BOOL b ) { bSetIsRemove = b; }
-// void SetRemoveWhich( USHORT n ) { nRemoveWhich = n; }
+// void SetSpecial( sal_uInt8 n ) { nSpecial = n; }
+// void SetRemoveAttribs( sal_Bool b ) { bSetIsRemove = b; }
+// void SetRemoveWhich( sal_uInt16 n ) { nRemoveWhich = n; }
virtual void Undo();
virtual void Redo();
diff --git a/svtools/source/edit/textundo.cxx b/svtools/source/edit/textundo.cxx
index fcecb59452f5..660c272397f5 100644
--- a/svtools/source/edit/textundo.cxx
+++ b/svtools/source/edit/textundo.cxx
@@ -55,33 +55,33 @@ TextUndoManager::~TextUndoManager()
{
}
-BOOL TextUndoManager::Undo( USHORT nCount )
+sal_Bool TextUndoManager::Undo()
{
if ( GetUndoActionCount() == 0 )
- return FALSE;
+ return sal_False;
UndoRedoStart();
- mpTextEngine->SetIsInUndo( TRUE );
- BOOL bDone = SfxUndoManager::Undo( nCount );
- mpTextEngine->SetIsInUndo( FALSE );
+ mpTextEngine->SetIsInUndo( sal_True );
+ sal_Bool bDone = SfxUndoManager::Undo();
+ mpTextEngine->SetIsInUndo( sal_False );
UndoRedoEnd();
return bDone;
}
-BOOL TextUndoManager::Redo( USHORT nCount )
+sal_Bool TextUndoManager::Redo()
{
if ( GetRedoActionCount() == 0 )
- return FALSE;
+ return sal_False;
UndoRedoStart();
- mpTextEngine->SetIsInUndo( TRUE );
- BOOL bDone = SfxUndoManager::Redo( nCount );
- mpTextEngine->SetIsInUndo( FALSE );
+ mpTextEngine->SetIsInUndo( sal_True );
+ sal_Bool bDone = SfxUndoManager::Redo();
+ mpTextEngine->SetIsInUndo( sal_False );
UndoRedoEnd();
@@ -111,9 +111,8 @@ void TextUndoManager::UndoRedoEnd()
}
-TextUndo::TextUndo( USHORT nI, TextEngine* p )
+TextUndo::TextUndo( TextEngine* p )
{
- mnId = nI;
mpTextEngine = p;
}
@@ -121,12 +120,6 @@ TextUndo::~TextUndo()
{
}
-USHORT TextUndo::GetId() const
-{
- //nId sollte mal entfallen => GetId ueberall ueberladen...
- return mnId;
-}
-
XubString TextUndo::GetComment() const
{
// return mpTextEngine->GetUndoComment( this );
@@ -140,12 +133,12 @@ void TextUndo::SetSelection( const TextSelection& rSel )
}
-TextUndoDelPara::TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, ULONG nPara )
- : TextUndo( TEXTUNDO_DELCONTENT, pTextEngine )
+TextUndoDelPara::TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, sal_uLong nPara )
+ : TextUndo( pTextEngine )
{
mpNode = pNode;
mnPara = nPara;
- mbDelObject = TRUE;
+ mbDelObject = sal_True;
}
TextUndoDelPara::~TextUndoDelPara()
@@ -157,7 +150,7 @@ TextUndoDelPara::~TextUndoDelPara()
void TextUndoDelPara::Undo()
{
GetTextEngine()->InsertContent( mpNode, mnPara );
- mbDelObject = FALSE; // gehoert wieder der Engine
+ mbDelObject = sal_False; // gehoert wieder der Engine
if ( GetView() )
{
@@ -179,10 +172,10 @@ void TextUndoDelPara::Redo()
GetDoc()->GetNodes().Remove( mnPara );
GetTextEngine()->ImpParagraphRemoved( mnPara );
- mbDelObject = TRUE; // gehoert wieder dem Undo
+ mbDelObject = sal_True; // gehoert wieder dem Undo
- ULONG nParas = GetDoc()->GetNodes().Count();
- ULONG n = mnPara < nParas ? mnPara : (nParas-1);
+ sal_uLong nParas = GetDoc()->GetNodes().Count();
+ sal_uLong n = mnPara < nParas ? mnPara : (nParas-1);
TextNode* pN = GetDoc()->GetNodes().GetObject( n );
TextPaM aPaM( n, pN->GetText().Len() );
SetSelection( aPaM );
@@ -191,8 +184,8 @@ void TextUndoDelPara::Redo()
// -----------------------------------------------------------------------
// TextUndoConnectParas
// ------------------------------------------------------------------------
-TextUndoConnectParas::TextUndoConnectParas( TextEngine* pTextEngine, ULONG nPara, USHORT nPos )
- : TextUndo( TEXTUNDO_CONNECTPARAS, pTextEngine )
+TextUndoConnectParas::TextUndoConnectParas( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nPos )
+ : TextUndo( pTextEngine )
{
mnPara = nPara;
mnSepPos = nPos;
@@ -215,8 +208,8 @@ void TextUndoConnectParas::Redo()
}
-TextUndoSplitPara::TextUndoSplitPara( TextEngine* pTextEngine, ULONG nPara, USHORT nPos )
- : TextUndo( TEXTUNDO_SPLITPARA, pTextEngine )
+TextUndoSplitPara::TextUndoSplitPara( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nPos )
+ : TextUndo( pTextEngine )
{
mnPara = nPara;
mnSepPos = nPos;
@@ -240,7 +233,7 @@ void TextUndoSplitPara::Redo()
TextUndoInsertChars::TextUndoInsertChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const XubString& rStr )
- : TextUndo( TEXTUNDO_INSERTCHARS, pTextEngine ),
+ : TextUndo( pTextEngine ),
maTextPaM( rTextPaM ), maText( rStr )
{
}
@@ -262,27 +255,27 @@ void TextUndoInsertChars::Redo()
SetSelection( TextSelection( aSel.GetStart(), aNewPaM ) );
}
-BOOL TextUndoInsertChars::Merge( SfxUndoAction* pNextAction )
+sal_Bool TextUndoInsertChars::Merge( SfxUndoAction* pNextAction )
{
if ( !pNextAction->ISA( TextUndoInsertChars ) )
- return FALSE;
+ return sal_False;
TextUndoInsertChars* pNext = (TextUndoInsertChars*)pNextAction;
if ( maTextPaM.GetPara() != pNext->maTextPaM.GetPara() )
- return FALSE;
+ return sal_False;
if ( ( maTextPaM.GetIndex() + maText.Len() ) == pNext->maTextPaM.GetIndex() )
{
maText += pNext->maText;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
TextUndoRemoveChars::TextUndoRemoveChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const XubString& rStr )
- : TextUndo( TEXTUNDO_REMOVECHARS, pTextEngine ),
+ : TextUndo( pTextEngine ),
maTextPaM( rTextPaM ), maText( rStr )
{
}
@@ -305,11 +298,11 @@ void TextUndoRemoveChars::Redo()
TextUndoSetAttribs::TextUndoSetAttribs( TextEngine* pTextEngine, const TextSelection& rSel )
- : TextUndo( TEXTUNDO_ATTRIBS, pTextEngine ), maSelection( rSel )
+ : TextUndo( pTextEngine ), maSelection( rSel )
{
maSelection.Justify();
// aNewAttribs.Set( rNewItems );
-// mbSetIsRemove = FALSE;
+// mbSetIsRemove = sal_False;
// mnRemoveWhich = 0;
// mnSpecial = 0;
}
@@ -321,12 +314,12 @@ TextUndoSetAttribs::~TextUndoSetAttribs()
void TextUndoSetAttribs::Undo()
{
- for ( ULONG nPara = maSelection.GetStart().GetPara(); nPara <= maSelection.GetEnd().GetPara(); nPara++ )
+ for ( sal_uLong nPara = maSelection.GetStart().GetPara(); nPara <= maSelection.GetEnd().GetPara(); nPara++ )
{
-// ContentAttribsInfo* pInf = aPrevAttribs[ (USHORT)(nPara-aESel.nStartPara) ];
+// ContentAttribsInfo* pInf = aPrevAttribs[ (sal_uInt16)(nPara-aESel.nStartPara) ];
// GetTextEngine()->RemoveCharAttribs( nPara );
// TextNode* pNode = GetTextEngine()->GetTextDoc().GetObject( nPara );
-// for ( USHORT nAttr = 0; nAttr < pInf->GetPrevCharAttribs().Count(); nAttr++ )
+// for ( sal_uInt16 nAttr = 0; nAttr < pInf->GetPrevCharAttribs().Count(); nAttr++ )
// {
// GetTextEngine()->GetTextDoc().InsertAttrib( pNode, pX->GetStart(), pX->GetEnd(), *pX->GetItem() );
// }
diff --git a/svtools/source/edit/textundo.hxx b/svtools/source/edit/textundo.hxx
index 414f2f1f5db2..b8189eaa9711 100644
--- a/svtools/source/edit/textundo.hxx
+++ b/svtools/source/edit/textundo.hxx
@@ -48,16 +48,15 @@ public:
~TextUndoManager();
using SfxUndoManager::Undo;
- virtual BOOL Undo( USHORT nCount=1 );
+ virtual sal_Bool Undo();
using SfxUndoManager::Redo;
- virtual BOOL Redo( USHORT nCount=1 );
+ virtual sal_Bool Redo();
};
class TextUndo : public SfxUndoAction
{
private:
- USHORT mnId;
TextEngine* mpTextEngine;
protected:
@@ -70,7 +69,7 @@ protected:
public:
TYPEINFO();
- TextUndo( USHORT nId, TextEngine* pTextEngine );
+ TextUndo( TextEngine* pTextEngine );
virtual ~TextUndo();
TextEngine* GetTextEngine() const { return mpTextEngine; }
@@ -79,7 +78,6 @@ public:
virtual void Redo() = 0;
virtual XubString GetComment() const;
- virtual USHORT GetId() const;
};
#endif // _TEXTUNDO_HXX
diff --git a/svtools/source/edit/textview.cxx b/svtools/source/edit/textview.cxx
index 292cf03ce86a..f2b370a9a923 100644
--- a/svtools/source/edit/textview.cxx
+++ b/svtools/source/edit/textview.cxx
@@ -117,7 +117,7 @@ uno::Any TETextDataObject::getTransferData( const datatransfer::DataFlavor& rFla
{
uno::Any aAny;
- ULONG nT = SotExchange::GetFormat( rFlavor );
+ sal_uLong nT = SotExchange::GetFormat( rFlavor );
if ( nT == SOT_FORMAT_STRING )
{
aAny <<= (::rtl::OUString)GetText();
@@ -125,7 +125,7 @@ uno::Any TETextDataObject::getTransferData( const datatransfer::DataFlavor& rFla
else if ( nT == SOT_FORMATSTR_ID_HTML )
{
GetHTMLStream().Seek( STREAM_SEEK_TO_END );
- ULONG nLen = GetHTMLStream().Tell();
+ sal_uLong nLen = GetHTMLStream().Tell();
GetHTMLStream().Seek(0);
uno::Sequence< sal_Int8 > aSeq( nLen );
@@ -142,7 +142,7 @@ uno::Any TETextDataObject::getTransferData( const datatransfer::DataFlavor& rFla
uno::Sequence< datatransfer::DataFlavor > TETextDataObject::getTransferDataFlavors( ) throw(uno::RuntimeException)
{
GetHTMLStream().Seek( STREAM_SEEK_TO_END );
- BOOL bHTML = GetHTMLStream().Tell() > 0;
+ sal_Bool bHTML = GetHTMLStream().Tell() > 0;
uno::Sequence< datatransfer::DataFlavor > aDataFlavors( bHTML ? 2 : 1 );
SotExchange::GetFormatDataFlavor( SOT_FORMAT_STRING, aDataFlavors.getArray()[0] );
if ( bHTML )
@@ -152,7 +152,7 @@ uno::Sequence< datatransfer::DataFlavor > TETextDataObject::getTransferDataFlavo
sal_Bool TETextDataObject::isDataFlavorSupported( const datatransfer::DataFlavor& rFlavor ) throw(uno::RuntimeException)
{
- ULONG nT = SotExchange::GetFormat( rFlavor );
+ sal_uLong nT = SotExchange::GetFormat( rFlavor );
return ( nT == SOT_FORMAT_STRING );
}
@@ -176,17 +176,17 @@ struct ImpTextView
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener > mxDnDListener;
- USHORT mnTravelXPos;
-
- BOOL mbAutoScroll : 1;
- BOOL mbInsertMode : 1;
- BOOL mbReadOnly : 1;
- BOOL mbPaintSelection : 1;
- BOOL mbAutoIndent : 1;
- BOOL mbHighlightSelection : 1;
- BOOL mbCursorEnabled : 1;
- BOOL mbClickedInSelection : 1;
- BOOL mbSupportProtectAttribute : 1;
+ sal_uInt16 mnTravelXPos;
+
+ sal_Bool mbAutoScroll : 1;
+ sal_Bool mbInsertMode : 1;
+ sal_Bool mbReadOnly : 1;
+ sal_Bool mbPaintSelection : 1;
+ sal_Bool mbAutoIndent : 1;
+ sal_Bool mbHighlightSelection : 1;
+ sal_Bool mbCursorEnabled : 1;
+ sal_Bool mbClickedInSelection : 1;
+ sal_Bool mbSupportProtectAttribute : 1;
bool mbCursorAtEndOfLine;
};
@@ -196,30 +196,30 @@ struct ImpTextView
TextView::TextView( TextEngine* pEng, Window* pWindow ) :
mpImpl(new ImpTextView)
{
- pWindow->EnableRTL( FALSE );
+ pWindow->EnableRTL( sal_False );
mpImpl->mpWindow = pWindow;
mpImpl->mpTextEngine = pEng;
mpImpl->mpVirtDev = NULL;
- mpImpl->mbPaintSelection = TRUE;
- mpImpl->mbAutoScroll = TRUE;
- mpImpl->mbInsertMode = TRUE;
- mpImpl->mbReadOnly = FALSE;
- mpImpl->mbHighlightSelection = FALSE;
- mpImpl->mbAutoIndent = FALSE;
- mpImpl->mbCursorEnabled = TRUE;
- mpImpl->mbClickedInSelection = FALSE;
- mpImpl->mbSupportProtectAttribute = FALSE;
+ mpImpl->mbPaintSelection = sal_True;
+ mpImpl->mbAutoScroll = sal_True;
+ mpImpl->mbInsertMode = sal_True;
+ mpImpl->mbReadOnly = sal_False;
+ mpImpl->mbHighlightSelection = sal_False;
+ mpImpl->mbAutoIndent = sal_False;
+ mpImpl->mbCursorEnabled = sal_True;
+ mpImpl->mbClickedInSelection = sal_False;
+ mpImpl->mbSupportProtectAttribute = sal_False;
mpImpl->mbCursorAtEndOfLine = false;
-// mbInSelection = FALSE;
+// mbInSelection = sal_False;
mpImpl->mnTravelXPos = TRAVEL_X_DONTKNOW;
mpImpl->mpSelFuncSet = new TextSelFunctionSet( this );
mpImpl->mpSelEngine = new SelectionEngine( mpImpl->mpWindow, mpImpl->mpSelFuncSet );
mpImpl->mpSelEngine->SetSelectionMode( RANGE_SELECTION );
- mpImpl->mpSelEngine->EnableDrag( TRUE );
+ mpImpl->mpSelEngine->EnableDrag( sal_True );
mpImpl->mpCursor = new Cursor;
mpImpl->mpCursor->Show();
@@ -227,7 +227,7 @@ TextView::TextView( TextEngine* pEng, Window* pWindow ) :
pWindow->SetInputContext( InputContext( pEng->GetFont(), INPUTCONTEXT_TEXT|INPUTCONTEXT_EXTTEXTINPUT ) );
if ( pWindow->GetSettings().GetStyleSettings().GetSelectionOptions() & SELECTION_OPTION_INVERT )
- mpImpl->mbHighlightSelection = TRUE;
+ mpImpl->mbHighlightSelection = sal_True;
pWindow->SetLineColor();
@@ -265,7 +265,7 @@ void TextView::Invalidate()
mpImpl->mpWindow->Invalidate();
}
-void TextView::SetSelection( const TextSelection& rTextSel, BOOL bGotoCursor )
+void TextView::SetSelection( const TextSelection& rTextSel, sal_Bool bGotoCursor )
{
// Falls jemand gerade ein leeres Attribut hinterlassen hat,
// und dann der Outliner die Selektion manipulitert:
@@ -301,9 +301,9 @@ void TextView::DeleteSelected()
{
// HideSelection();
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_DELETE );
+ mpImpl->mpTextEngine->UndoActionStart();
TextPaM aPaM = mpImpl->mpTextEngine->ImpDeleteText( mpImpl->maSelection );
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_DELETE );
+ mpImpl->mpTextEngine->UndoActionEnd();
ImpSetSelection( aPaM );
mpImpl->mpTextEngine->FormatAndUpdate( this );
@@ -335,10 +335,10 @@ void TextView::ImpPaint( OutputDevice* pOut, const Point& rStartPos, Rectangle c
void TextView::Paint( const Rectangle& rRect )
{
- ImpPaint( rRect, FALSE );
+ ImpPaint( rRect, sal_False );
}
-void TextView::ImpPaint( const Rectangle& rRect, BOOL bUseVirtDev )
+void TextView::ImpPaint( const Rectangle& rRect, sal_Bool bUseVirtDev )
{
if ( !mpImpl->mpTextEngine->GetUpdateMode() || mpImpl->mpTextEngine->IsInUndo() )
return;
@@ -357,7 +357,7 @@ void TextView::ImpPaint( const Rectangle& rRect, BOOL bUseVirtDev )
if ( pVDev->GetBackground().GetColor() != rBackgroundColor )
pVDev->SetBackground( rBackgroundColor );
- BOOL bVDevValid = TRUE;
+ sal_Bool bVDevValid = sal_True;
Size aOutSz( pVDev->GetOutputSizePixel() );
if ( ( aOutSz.Width() < rRect.GetWidth() ) ||
( aOutSz.Height() < rRect.GetHeight() ) )
@@ -380,7 +380,7 @@ void TextView::ImpPaint( const Rectangle& rRect, BOOL bUseVirtDev )
}
if ( !bVDevValid )
{
- ImpPaint( rRect, FALSE /* ohne VDev */ );
+ ImpPaint( rRect, sal_False /* ohne VDev */ );
return;
}
@@ -418,27 +418,27 @@ void TextView::ImpHighlight( const TextSelection& rSel )
Rectangle aVisArea( mpImpl->maStartDocPos, mpImpl->mpWindow->GetOutputSizePixel() );
long nY = 0;
- ULONG nStartPara = aSel.GetStart().GetPara();
- ULONG nEndPara = aSel.GetEnd().GetPara();
- for ( ULONG nPara = 0; nPara <= nEndPara; nPara++ )
+ sal_uLong nStartPara = aSel.GetStart().GetPara();
+ sal_uLong nEndPara = aSel.GetEnd().GetPara();
+ for ( sal_uLong nPara = 0; nPara <= nEndPara; nPara++ )
{
long nParaHeight = (long)mpImpl->mpTextEngine->CalcParaHeight( nPara );
if ( ( nPara >= nStartPara ) && ( ( nY + nParaHeight ) > aVisArea.Top() ) )
{
TEParaPortion* pTEParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( nPara );
- USHORT nStartLine = 0;
- USHORT nEndLine = pTEParaPortion->GetLines().Count() -1;
+ sal_uInt16 nStartLine = 0;
+ sal_uInt16 nEndLine = pTEParaPortion->GetLines().Count() -1;
if ( nPara == nStartPara )
- nStartLine = pTEParaPortion->GetLineNumber( aSel.GetStart().GetIndex(), FALSE );
+ nStartLine = pTEParaPortion->GetLineNumber( aSel.GetStart().GetIndex(), sal_False );
if ( nPara == nEndPara )
- nEndLine = pTEParaPortion->GetLineNumber( aSel.GetEnd().GetIndex(), TRUE );
+ nEndLine = pTEParaPortion->GetLineNumber( aSel.GetEnd().GetIndex(), sal_True );
// ueber die Zeilen iterieren....
- for ( USHORT nLine = nStartLine; nLine <= nEndLine; nLine++ )
+ for ( sal_uInt16 nLine = nStartLine; nLine <= nEndLine; nLine++ )
{
TextLine* pLine = pTEParaPortion->GetLines().GetObject( nLine );
- USHORT nStartIndex = pLine->GetStart();
- USHORT nEndIndex = pLine->GetEnd();
+ sal_uInt16 nStartIndex = pLine->GetStart();
+ sal_uInt16 nEndIndex = pLine->GetEnd();
if ( ( nPara == nStartPara ) && ( nLine == nStartLine ) )
nStartIndex = aSel.GetStart().GetIndex();
if ( ( nPara == nEndPara ) && ( nLine == nEndLine ) )
@@ -448,12 +448,12 @@ void TextView::ImpHighlight( const TextSelection& rSel )
if ( nEndIndex < nStartIndex )
nEndIndex = nStartIndex;
- Rectangle aTmpRec( mpImpl->mpTextEngine->GetEditCursor( TextPaM( nPara, nStartIndex ), FALSE ) );
+ Rectangle aTmpRec( mpImpl->mpTextEngine->GetEditCursor( TextPaM( nPara, nStartIndex ), sal_False ) );
aTmpRec.Top() += nY;
aTmpRec.Bottom() += nY;
Point aTopLeft( aTmpRec.TopLeft() );
- aTmpRec = mpImpl->mpTextEngine->GetEditCursor( TextPaM( nPara, nEndIndex ), TRUE );
+ aTmpRec = mpImpl->mpTextEngine->GetEditCursor( TextPaM( nPara, nEndIndex ), sal_True );
aTmpRec.Top() += nY;
aTmpRec.Bottom() += nY;
Point aBottomRight( aTmpRec.BottomRight() );
@@ -489,20 +489,20 @@ void TextView::ImpSetSelection( const TextSelection& rSelection )
void TextView::ShowSelection()
{
- ImpShowHideSelection( TRUE );
+ ImpShowHideSelection( sal_True );
}
void TextView::HideSelection()
{
- ImpShowHideSelection( FALSE );
+ ImpShowHideSelection( sal_False );
}
void TextView::ShowSelection( const TextSelection& rRange )
{
- ImpShowHideSelection( TRUE, &rRange );
+ ImpShowHideSelection( sal_True, &rRange );
}
-void TextView::ImpShowHideSelection( BOOL bShow, const TextSelection* pRange )
+void TextView::ImpShowHideSelection( sal_Bool bShow, const TextSelection* pRange )
{
const TextSelection* pRangeOrSelection = pRange ? pRange : &mpImpl->maSelection;
@@ -522,7 +522,7 @@ void TextView::ImpShowHideSelection( BOOL bShow, const TextSelection* pRange )
Point aStartPos( ImpGetOutputStartPos( mpImpl->maStartDocPos ) );
TextSelection aRange( *pRangeOrSelection );
aRange.Justify();
- BOOL bVisCursor = mpImpl->mpCursor->IsVisible();
+ sal_Bool bVisCursor = mpImpl->mpCursor->IsVisible();
mpImpl->mpCursor->Hide();
ImpPaint( mpImpl->mpWindow, aStartPos, &aOutArea, &aRange, bShow ? &mpImpl->maSelection : NULL );
if ( bVisCursor )
@@ -548,24 +548,24 @@ void TextView::EraseVirtualDevice()
mpImpl->mpVirtDev = 0;
}
-BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
+sal_Bool TextView::KeyInput( const KeyEvent& rKeyEvent )
{
- BOOL bDone = TRUE;
- BOOL bModified = FALSE;
- BOOL bMoved = FALSE;
- BOOL bEndKey = FALSE; // spezielle CursorPosition
- BOOL bAllowIdle = TRUE;
+ sal_Bool bDone = sal_True;
+ sal_Bool bModified = sal_False;
+ sal_Bool bMoved = sal_False;
+ sal_Bool bEndKey = sal_False; // spezielle CursorPosition
+ sal_Bool bAllowIdle = sal_True;
// Um zu pruefen ob durch irgendeine Aktion mModified, das lokale
// bModified wird z.B. bei Cut/Paste nicht gesetzt, weil dort an anderen
// Stellen das updaten erfolgt.
- BOOL bWasModified = mpImpl->mpTextEngine->IsModified();
- mpImpl->mpTextEngine->SetModified( FALSE );
+ sal_Bool bWasModified = mpImpl->mpTextEngine->IsModified();
+ mpImpl->mpTextEngine->SetModified( sal_False );
TextSelection aCurSel( mpImpl->maSelection );
TextSelection aOldSel( aCurSel );
- USHORT nCode = rKeyEvent.GetKeyCode().GetCode();
+ sal_uInt16 nCode = rKeyEvent.GetKeyCode().GetCode();
KeyFuncType eFunc = rKeyEvent.GetKeyCode().GetFunction();
if ( eFunc != KEYFUNC_DONTKNOW )
{
@@ -642,12 +642,12 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
uno::Reference<datatransfer::clipboard::XClipboard> aSelection(GetWindow()->GetPrimarySelection());
Copy( aSelection );
}
- bMoved = TRUE;
+ bMoved = sal_True;
if ( nCode == KEY_END )
- bEndKey = TRUE;
+ bEndKey = sal_True;
}
else
- bDone = FALSE;
+ bDone = sal_False;
}
break;
case KEY_BACKSPACE:
@@ -659,8 +659,8 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
{
if ( !mpImpl->mbReadOnly && !rKeyEvent.GetKeyCode().IsMod2() )
{
- BYTE nDel = ( nCode == KEY_DELETE ) ? DEL_RIGHT : DEL_LEFT;
- BYTE nMode = rKeyEvent.GetKeyCode().IsMod1() ? DELMODE_RESTOFWORD : DELMODE_SIMPLE;
+ sal_uInt8 nDel = ( nCode == KEY_DELETE ) ? DEL_RIGHT : DEL_LEFT;
+ sal_uInt8 nMode = rKeyEvent.GetKeyCode().IsMod1() ? DELMODE_RESTOFWORD : DELMODE_SIMPLE;
if ( ( nMode == DELMODE_RESTOFWORD ) && rKeyEvent.GetKeyCode().IsShift() )
nMode = DELMODE_RESTOFCONTENT;
@@ -685,7 +685,7 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
default: break;
}
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_DELETE );
+ mpImpl->mpTextEngine->UndoActionStart();
if(mpImpl->mbSupportProtectAttribute)
{
//expand selection to include all protected content - if there is any
@@ -707,12 +707,12 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
}
}
aCurSel = ImpDelete( nDel, nMode );
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_DELETE );
- bModified = TRUE;
- bAllowIdle = FALSE;
+ mpImpl->mpTextEngine->UndoActionEnd();
+ bModified = sal_True;
+ bAllowIdle = sal_False;
}
else
- bDone = FALSE;
+ bDone = sal_False;
}
break;
case KEY_TAB:
@@ -722,10 +722,10 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
ImplCheckTextLen( 'x' ) )
{
aCurSel = mpImpl->mpTextEngine->ImpInsertText( aCurSel, '\t', !IsInsertMode() );
- bModified = TRUE;
+ bModified = sal_True;
}
else
- bDone = FALSE;
+ bDone = sal_False;
}
break;
case KEY_RETURN:
@@ -735,12 +735,12 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
if ( !mpImpl->mbReadOnly && !rKeyEvent.GetKeyCode().IsMod1() &&
!rKeyEvent.GetKeyCode().IsMod2() && ImplCheckTextLen( 'x' ) )
{
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_INSERT );
+ mpImpl->mpTextEngine->UndoActionStart();
aCurSel = mpImpl->mpTextEngine->ImpInsertParaBreak( aCurSel );
if ( mpImpl->mbAutoIndent )
{
TextNode* pPrev = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( aCurSel.GetEnd().GetPara() - 1 );
- USHORT n = 0;
+ sal_uInt16 n = 0;
while ( ( n < pPrev->GetText().Len() ) && (
( pPrev->GetText().GetChar( n ) == ' ' ) ||
( pPrev->GetText().GetChar( n ) == '\t' ) ) )
@@ -750,11 +750,11 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
if ( n )
aCurSel = mpImpl->mpTextEngine->ImpInsertText( aCurSel, pPrev->GetText().Copy( 0, n ) );
}
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_INSERT );
- bModified = TRUE;
+ mpImpl->mpTextEngine->UndoActionEnd();
+ bModified = sal_True;
}
else
- bDone = FALSE;
+ bDone = sal_False;
}
break;
case KEY_INSERT:
@@ -771,11 +771,11 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
if ( !mpImpl->mbReadOnly && ImplCheckTextLen( nCharCode ) ) // sonst trotzdem das Zeichen schlucken...
{
aCurSel = mpImpl->mpTextEngine->ImpInsertText( nCharCode, aCurSel, !IsInsertMode(), sal_True );
- bModified = TRUE;
+ bModified = sal_True;
}
}
else
- bDone = FALSE;
+ bDone = sal_False;
}
}
}
@@ -799,20 +799,20 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
else if ( bMoved )
{
// Selection wird jetzt gezielt in ImpMoveCursor gemalt.
- ImpShowCursor( mpImpl->mbAutoScroll, TRUE, bEndKey );
+ ImpShowCursor( mpImpl->mbAutoScroll, sal_True, bEndKey );
}
if ( mpImpl->mpTextEngine->IsModified() )
mpImpl->mpTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
else if ( bWasModified )
- mpImpl->mpTextEngine->SetModified( TRUE );
+ mpImpl->mpTextEngine->SetModified( sal_True );
return bDone;
}
void TextView::MouseButtonUp( const MouseEvent& rMouseEvent )
{
- mpImpl->mbClickedInSelection = FALSE;
+ mpImpl->mbClickedInSelection = sal_False;
mpImpl->mnTravelXPos = TRAVEL_X_DONTKNOW;
mpImpl->mpSelEngine->SelMouseButtonUp( rMouseEvent );
if ( rMouseEvent.IsMiddle() && !IsReadOnly() &&
@@ -866,18 +866,18 @@ void TextView::MouseButtonDown( const MouseEvent& rMouseEvent )
uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator();
i18n::Boundary aBoundary = xBI->getWordBoundary( pNode->GetText(), mpImpl->maSelection.GetEnd().GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True );
TextSelection aNewSel( mpImpl->maSelection );
- aNewSel.GetStart().GetIndex() = (USHORT)aBoundary.startPos;
- aNewSel.GetEnd().GetIndex() = (USHORT)aBoundary.endPos;
+ aNewSel.GetStart().GetIndex() = (sal_uInt16)aBoundary.startPos;
+ aNewSel.GetEnd().GetIndex() = (sal_uInt16)aBoundary.endPos;
if(mpImpl->mbSupportProtectAttribute)
{
//expand selection to include all protected content - if there is any
const TextCharAttrib* pStartAttr = mpImpl->mpTextEngine->FindCharAttrib(
TextPaM(aNewSel.GetStart().GetPara(),
- (USHORT)aBoundary.startPos),
+ (sal_uInt16)aBoundary.startPos),
TEXTATTR_PROTECTED );
const TextCharAttrib* pEndAttr = mpImpl->mpTextEngine->FindCharAttrib(
TextPaM(aNewSel.GetEnd().GetPara(),
- (USHORT)aBoundary.endPos),
+ (sal_uInt16)aBoundary.endPos),
TEXTATTR_PROTECTED );
if(pStartAttr && pStartAttr->GetStart() < aNewSel.GetStart().GetIndex())
{
@@ -890,7 +890,7 @@ void TextView::MouseButtonDown( const MouseEvent& rMouseEvent )
}
ImpSetSelection( aNewSel );
ShowSelection();
- ShowCursor( TRUE, TRUE );
+ ShowCursor( sal_True, sal_True );
}
}
else if ( rMouseEvent.GetClicks() == 3 )
@@ -904,7 +904,7 @@ void TextView::MouseButtonDown( const MouseEvent& rMouseEvent )
aNewSel.GetEnd().GetIndex() = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( mpImpl->maSelection.GetEnd().GetPara() )->GetText().Len();
ImpSetSelection( aNewSel );
ShowSelection();
- ShowCursor( TRUE, TRUE );
+ ShowCursor( sal_True, sal_True );
}
}
}
@@ -938,7 +938,7 @@ void TextView::Command( const CommandEvent& rCEvt )
TEParaPortion* pPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( mpImpl->mpTextEngine->mpIMEInfos->aPos.GetPara() );
pPortion->MarkSelectionInvalid( mpImpl->mpTextEngine->mpIMEInfos->aPos.GetIndex(), 0 );
- BOOL bInsertMode = !mpImpl->mpTextEngine->mpIMEInfos->bWasCursorOverwrite;
+ sal_Bool bInsertMode = !mpImpl->mpTextEngine->mpIMEInfos->bWasCursorOverwrite;
delete mpImpl->mpTextEngine->mpIMEInfos;
mpImpl->mpTextEngine->mpIMEInfos = NULL;
@@ -967,14 +967,14 @@ void TextView::Command( const CommandEvent& rCEvt )
if ( mpImpl->mpTextEngine->mpIMEInfos->bWasCursorOverwrite )
{
- USHORT nOldIMETextLen = mpImpl->mpTextEngine->mpIMEInfos->nLen;
- USHORT nNewIMETextLen = pData->GetText().Len();
+ sal_uInt16 nOldIMETextLen = mpImpl->mpTextEngine->mpIMEInfos->nLen;
+ sal_uInt16 nNewIMETextLen = pData->GetText().Len();
if ( ( nOldIMETextLen > nNewIMETextLen ) &&
( nNewIMETextLen < mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Len() ) )
{
// restore old characters
- USHORT nRestore = nOldIMETextLen - nNewIMETextLen;
+ sal_uInt16 nRestore = nOldIMETextLen - nNewIMETextLen;
TextPaM aPaM( mpImpl->mpTextEngine->mpIMEInfos->aPos );
aPaM.GetIndex() = aPaM.GetIndex() + nNewIMETextLen;
mpImpl->mpTextEngine->ImpInsertText( aPaM, mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Copy( nNewIMETextLen, nRestore ) );
@@ -983,7 +983,7 @@ void TextView::Command( const CommandEvent& rCEvt )
( nOldIMETextLen < mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Len() ) )
{
// overwrite
- USHORT nOverwrite = nNewIMETextLen - nOldIMETextLen;
+ sal_uInt16 nOverwrite = nNewIMETextLen - nOldIMETextLen;
if ( ( nOldIMETextLen + nOverwrite ) > mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Len() )
nOverwrite = mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Len() - nOldIMETextLen;
DBG_ASSERT( nOverwrite && (nOverwrite < 0xFF00), "IME Overwrite?!" );
@@ -1028,13 +1028,13 @@ void TextView::Command( const CommandEvent& rCEvt )
TextPaM aPaM( GetSelection().GetEnd() );
Rectangle aR1 = mpImpl->mpTextEngine->PaMtoEditCursor( aPaM );
- USHORT nInputEnd = mpImpl->mpTextEngine->mpIMEInfos->aPos.GetIndex() + mpImpl->mpTextEngine->mpIMEInfos->nLen;
+ sal_uInt16 nInputEnd = mpImpl->mpTextEngine->mpIMEInfos->aPos.GetIndex() + mpImpl->mpTextEngine->mpIMEInfos->nLen;
if ( !mpImpl->mpTextEngine->IsFormatted() )
mpImpl->mpTextEngine->FormatDoc();
TEParaPortion* pParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() );
- USHORT nLine = pParaPortion->GetLineNumber( aPaM.GetIndex(), sal_True );
+ sal_uInt16 nLine = pParaPortion->GetLineNumber( aPaM.GetIndex(), sal_True );
TextLine* pLine = pParaPortion->GetLines().GetObject( nLine );
if ( pLine && ( nInputEnd > pLine->GetEnd() ) )
nInputEnd = pLine->GetEnd();
@@ -1055,12 +1055,12 @@ void TextView::Command( const CommandEvent& rCEvt )
}
}
-void TextView::ShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor )
+void TextView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor )
{
// Die Einstellung hat mehr Gewicht:
if ( !mpImpl->mbAutoScroll )
- bGotoCursor = FALSE;
- ImpShowCursor( bGotoCursor, bForceVisCursor, FALSE );
+ bGotoCursor = sal_False;
+ ImpShowCursor( bGotoCursor, bForceVisCursor, sal_False );
}
void TextView::HideCursor()
@@ -1092,7 +1092,7 @@ void TextView::Scroll( long ndX, long ndY )
if ( nDiffX || nDiffY )
{
- BOOL bVisCursor = mpImpl->mpCursor->IsVisible();
+ sal_Bool bVisCursor = mpImpl->mpCursor->IsVisible();
mpImpl->mpCursor->Hide();
mpImpl->mpWindow->Update();
mpImpl->maStartDocPos = aNewStartPos;
@@ -1112,21 +1112,21 @@ void TextView::Scroll( long ndX, long ndY )
void TextView::Undo()
{
mpImpl->mpTextEngine->SetActiveView( this );
- mpImpl->mpTextEngine->GetUndoManager().Undo( 1 );
+ mpImpl->mpTextEngine->GetUndoManager().Undo();
}
void TextView::Redo()
{
mpImpl->mpTextEngine->SetActiveView( this );
- mpImpl->mpTextEngine->GetUndoManager().Redo( 0 );
+ mpImpl->mpTextEngine->GetUndoManager().Redo();
}
void TextView::Cut()
{
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_CUT );
+ mpImpl->mpTextEngine->UndoActionStart();
Copy();
DeleteSelected();
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_CUT );
+ mpImpl->mpTextEngine->UndoActionEnd();
}
void TextView::Copy( uno::Reference< datatransfer::clipboard::XClipboard >& rxClipboard )
@@ -1136,7 +1136,7 @@ void TextView::Copy( uno::Reference< datatransfer::clipboard::XClipboard >& rxCl
TETextDataObject* pDataObj = new TETextDataObject( GetSelected() );
if ( mpImpl->mpTextEngine->HasAttrib( TEXTATTR_HYPERLINK ) ) // Dann auch als HTML
- mpImpl->mpTextEngine->Write( pDataObj->GetHTMLStream(), &mpImpl->maSelection, TRUE );
+ mpImpl->mpTextEngine->Write( pDataObj->GetHTMLStream(), &mpImpl->maSelection, sal_True );
const sal_uInt32 nRef = Application::ReleaseSolarMutex();
@@ -1194,7 +1194,7 @@ void TextView::Paste( uno::Reference< datatransfer::clipboard::XClipboard >& rxC
bool bWasTruncated = false;
if( mpImpl->mpTextEngine->GetMaxTextLen() != 0 )
bWasTruncated = ImplTruncateNewText( aText );
- InsertNewText( aText, FALSE );
+ InsertNewText( aText, sal_False );
mpImpl->mpTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
if( bWasTruncated )
@@ -1224,22 +1224,22 @@ String TextView::GetSelected( LineEnd aSeparator )
return mpImpl->mpTextEngine->GetText( mpImpl->maSelection, aSeparator );
}
-void TextView::SetInsertMode( BOOL bInsert )
+void TextView::SetInsertMode( sal_Bool bInsert )
{
if ( mpImpl->mbInsertMode != bInsert )
{
mpImpl->mbInsertMode = bInsert;
- ShowCursor( mpImpl->mbAutoScroll, FALSE );
+ ShowCursor( mpImpl->mbAutoScroll, sal_False );
}
}
-void TextView::SetReadOnly( BOOL bReadOnly )
+void TextView::SetReadOnly( sal_Bool bReadOnly )
{
if ( mpImpl->mbReadOnly != bReadOnly )
{
mpImpl->mbReadOnly = bReadOnly;
if ( !mpImpl->mbReadOnly )
- ShowCursor( mpImpl->mbAutoScroll, FALSE );
+ ShowCursor( mpImpl->mbAutoScroll, sal_False );
else
HideCursor();
@@ -1261,8 +1261,8 @@ TextSelection TextView::ImpMoveCursor( const KeyEvent& rKeyEvent )
KeyEvent aTranslatedKeyEvent = rKeyEvent.LogicalTextDirectionality( eTextDirection );
- BOOL bCtrl = aTranslatedKeyEvent.GetKeyCode().IsMod1() ? TRUE : FALSE;
- USHORT nCode = aTranslatedKeyEvent.GetKeyCode().GetCode();
+ sal_Bool bCtrl = aTranslatedKeyEvent.GetKeyCode().IsMod1() ? sal_True : sal_False;
+ sal_uInt16 nCode = aTranslatedKeyEvent.GetKeyCode().GetCode();
bool bSelect = aTranslatedKeyEvent.GetKeyCode().IsShift();
switch ( nCode )
@@ -1279,9 +1279,9 @@ TextSelection TextView::ImpMoveCursor( const KeyEvent& rKeyEvent )
break;
case KEY_PAGEDOWN: aPaM = bCtrl ? CursorEndOfDoc() : PageDown( aPaM );
break;
- case KEY_LEFT: aPaM = bCtrl ? CursorWordLeft( aPaM ) : CursorLeft( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? (USHORT)i18n::CharacterIteratorMode::SKIPCHARACTER : (USHORT)i18n::CharacterIteratorMode::SKIPCELL );
+ case KEY_LEFT: aPaM = bCtrl ? CursorWordLeft( aPaM ) : CursorLeft( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? (sal_uInt16)i18n::CharacterIteratorMode::SKIPCHARACTER : (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL );
break;
- case KEY_RIGHT: aPaM = bCtrl ? CursorWordRight( aPaM ) : CursorRight( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? (USHORT)i18n::CharacterIteratorMode::SKIPCHARACTER : (USHORT)i18n::CharacterIteratorMode::SKIPCELL );
+ case KEY_RIGHT: aPaM = bCtrl ? CursorWordRight( aPaM ) : CursorRight( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? (sal_uInt16)i18n::CharacterIteratorMode::SKIPCHARACTER : (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL );
break;
case com::sun::star::awt::Key::SELECT_WORD_FORWARD:
bSelect = true; // fallthrough intentional
@@ -1352,15 +1352,15 @@ TextSelection TextView::ImpMoveCursor( const KeyEvent& rKeyEvent )
return mpImpl->maSelection;
}
-void TextView::InsertText( const XubString& rStr, BOOL bSelect )
+void TextView::InsertText( const XubString& rStr, sal_Bool bSelect )
{
InsertNewText( rStr, bSelect );
}
-void TextView::InsertNewText( const rtl::OUString& rStr, BOOL bSelect )
+void TextView::InsertNewText( const rtl::OUString& rStr, sal_Bool bSelect )
{
// HideSelection();
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_INSERT );
+ mpImpl->mpTextEngine->UndoActionStart();
/* #i87633#
break inserted text into chunks that fit into the underlying String
@@ -1395,21 +1395,21 @@ void TextView::InsertNewText( const rtl::OUString& rStr, BOOL bSelect )
nLen -= nChunkLen;
nPos += nChunkLen;
}
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_INSERT );
+ mpImpl->mpTextEngine->UndoActionEnd();
mpImpl->mpTextEngine->FormatAndUpdate( this );
}
/*
-void TextView::InsertText( const XubString& rStr, BOOL bSelect )
+void TextView::InsertText( const XubString& rStr, sal_Bool bSelect )
{
// HideSelection();
TextSelection aNewSel( mpImpl->maSelection );
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_INSERT );
+ mpImpl->mpTextEngine->UndoActionStart();
TextPaM aPaM = mpImpl->mpTextEngine->ImpInsertText( mpImpl->maSelection, rStr );
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_INSERT );
+ mpImpl->mpTextEngine->UndoActionEnd();
if ( bSelect )
{
@@ -1428,22 +1428,22 @@ void TextView::InsertText( const XubString& rStr, BOOL bSelect )
*/
// OLD
-TextPaM TextView::CursorLeft( const TextPaM& rPaM, BOOL bWordMode )
+TextPaM TextView::CursorLeft( const TextPaM& rPaM, sal_Bool bWordMode )
{
- return bWordMode ? CursorWordLeft( rPaM ) : CursorLeft( rPaM, (USHORT)i18n::CharacterIteratorMode::SKIPCELL );
+ return bWordMode ? CursorWordLeft( rPaM ) : CursorLeft( rPaM, (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL );
- // Remove (USHORT) typecasts in this file when removing this method!
+ // Remove (sal_uInt16) typecasts in this file when removing this method!
}
// OLD
-TextPaM TextView::CursorRight( const TextPaM& rPaM, BOOL bWordMode )
+TextPaM TextView::CursorRight( const TextPaM& rPaM, sal_Bool bWordMode )
{
- return bWordMode ? CursorWordRight( rPaM ) : CursorRight( rPaM, (USHORT)i18n::CharacterIteratorMode::SKIPCELL );
+ return bWordMode ? CursorWordRight( rPaM ) : CursorRight( rPaM, (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL );
- // Remove (USHORT) typecasts in this file when removing this method!
+ // Remove (sal_uInt16) typecasts in this file when removing this method!
}
-TextPaM TextView::CursorLeft( const TextPaM& rPaM, USHORT nCharacterIteratorMode )
+TextPaM TextView::CursorLeft( const TextPaM& rPaM, sal_uInt16 nCharacterIteratorMode )
{
TextPaM aPaM( rPaM );
@@ -1452,7 +1452,7 @@ TextPaM TextView::CursorLeft( const TextPaM& rPaM, USHORT nCharacterIteratorMode
TextNode* pNode = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( aPaM.GetPara() );
uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator();
sal_Int32 nCount = 1;
- aPaM.GetIndex() = (USHORT)xBI->previousCharacters( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), nCharacterIteratorMode, nCount, nCount );
+ aPaM.GetIndex() = (sal_uInt16)xBI->previousCharacters( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), nCharacterIteratorMode, nCount, nCount );
}
else if ( aPaM.GetPara() )
{
@@ -1463,7 +1463,7 @@ TextPaM TextView::CursorLeft( const TextPaM& rPaM, USHORT nCharacterIteratorMode
return aPaM;
}
-TextPaM TextView::CursorRight( const TextPaM& rPaM, USHORT nCharacterIteratorMode )
+TextPaM TextView::CursorRight( const TextPaM& rPaM, sal_uInt16 nCharacterIteratorMode )
{
TextPaM aPaM( rPaM );
@@ -1472,7 +1472,7 @@ TextPaM TextView::CursorRight( const TextPaM& rPaM, USHORT nCharacterIteratorMod
{
uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator();
sal_Int32 nCount = 1;
- aPaM.GetIndex() = (USHORT)xBI->nextCharacters( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), nCharacterIteratorMode, nCount, nCount );
+ aPaM.GetIndex() = (sal_uInt16)xBI->nextCharacters( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), nCharacterIteratorMode, nCount, nCount );
}
else if ( aPaM.GetPara() < ( mpImpl->mpTextEngine->mpDoc->GetNodes().Count()-1) )
{
@@ -1495,7 +1495,7 @@ TextPaM TextView::CursorWordLeft( const TextPaM& rPaM )
i18n::Boundary aBoundary = xBI->getWordBoundary( pNode->GetText(), rPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True );
if ( aBoundary.startPos >= rPaM.GetIndex() )
aBoundary = xBI->previousWord( pNode->GetText(), rPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES );
- aPaM.GetIndex() = ( aBoundary.startPos != -1 ) ? (USHORT)aBoundary.startPos : 0;
+ aPaM.GetIndex() = ( aBoundary.startPos != -1 ) ? (sal_uInt16)aBoundary.startPos : 0;
}
else if ( aPaM.GetPara() )
{
@@ -1516,7 +1516,7 @@ TextPaM TextView::CursorWordRight( const TextPaM& rPaM )
{
uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator();
i18n::Boundary aBoundary = xBI->nextWord( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES );
- aPaM.GetIndex() = (USHORT)aBoundary.startPos;
+ aPaM.GetIndex() = (sal_uInt16)aBoundary.startPos;
}
else if ( aPaM.GetPara() < ( mpImpl->mpTextEngine->mpDoc->GetNodes().Count()-1) )
{
@@ -1527,7 +1527,7 @@ TextPaM TextView::CursorWordRight( const TextPaM& rPaM )
return aPaM;
}
-TextPaM TextView::ImpDelete( BYTE nMode, BYTE nDelMode )
+TextPaM TextView::ImpDelete( sal_uInt8 nMode, sal_uInt8 nDelMode )
{
if ( mpImpl->maSelection.HasRange() ) // dann nur Sel. loeschen
return mpImpl->mpTextEngine->ImpDeleteText( mpImpl->maSelection );
@@ -1538,7 +1538,7 @@ TextPaM TextView::ImpDelete( BYTE nMode, BYTE nDelMode )
{
if ( nDelMode == DELMODE_SIMPLE )
{
- aEndPaM = CursorLeft( aEndPaM, (USHORT)i18n::CharacterIteratorMode::SKIPCHARACTER );
+ aEndPaM = CursorLeft( aEndPaM, (sal_uInt16)i18n::CharacterIteratorMode::SKIPCHARACTER );
}
else if ( nDelMode == DELMODE_RESTOFWORD )
{
@@ -1548,7 +1548,7 @@ TextPaM TextView::ImpDelete( BYTE nMode, BYTE nDelMode )
if ( aBoundary.startPos == mpImpl->maSelection.GetEnd().GetIndex() )
aBoundary = xBI->previousWord( pNode->GetText(), mpImpl->maSelection.GetEnd().GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES );
// #i63506# startPos is -1 when the paragraph starts with a tab
- aEndPaM.GetIndex() = (aBoundary.startPos >= 0) ? (USHORT)aBoundary.startPos : 0;
+ aEndPaM.GetIndex() = (aBoundary.startPos >= 0) ? (sal_uInt16)aBoundary.startPos : 0;
}
else // DELMODE_RESTOFCONTENT
{
@@ -1566,14 +1566,14 @@ TextPaM TextView::ImpDelete( BYTE nMode, BYTE nDelMode )
{
if ( nDelMode == DELMODE_SIMPLE )
{
- aEndPaM = CursorRight( aEndPaM, (USHORT)i18n::CharacterIteratorMode::SKIPCELL );
+ aEndPaM = CursorRight( aEndPaM, (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL );
}
else if ( nDelMode == DELMODE_RESTOFWORD )
{
TextNode* pNode = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( aEndPaM.GetPara() );
uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator();
i18n::Boundary aBoundary = xBI->nextWord( pNode->GetText(), mpImpl->maSelection.GetEnd().GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES );
- aEndPaM.GetIndex() = (USHORT)aBoundary.startPos;
+ aEndPaM.GetIndex() = (sal_uInt16)aBoundary.startPos;
}
else // DELMODE_RESTOFCONTENT
{
@@ -1602,17 +1602,17 @@ TextPaM TextView::CursorUp( const TextPaM& rPaM )
long nX;
if ( mpImpl->mnTravelXPos == TRAVEL_X_DONTKNOW )
{
- nX = mpImpl->mpTextEngine->GetEditCursor( rPaM, FALSE ).Left();
- mpImpl->mnTravelXPos = (USHORT)nX+1;
+ nX = mpImpl->mpTextEngine->GetEditCursor( rPaM, sal_False ).Left();
+ mpImpl->mnTravelXPos = (sal_uInt16)nX+1;
}
else
nX = mpImpl->mnTravelXPos;
TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() );
- USHORT nLine = pPPortion->GetLineNumber( rPaM.GetIndex(), FALSE );
+ sal_uInt16 nLine = pPPortion->GetLineNumber( rPaM.GetIndex(), sal_False );
if ( nLine ) // gleicher Absatz
{
- USHORT nCharPos = mpImpl->mpTextEngine->GetCharPos( rPaM.GetPara(), nLine-1, nX );
+ sal_uInt16 nCharPos = mpImpl->mpTextEngine->GetCharPos( rPaM.GetPara(), nLine-1, nX );
aPaM.GetIndex() = nCharPos;
// Wenn davor eine autom.Umgebrochene Zeile, und ich muss genau an das
// Ende dieser Zeile, landet der Cursor in der aktuellen Zeile am Anfang
@@ -1625,8 +1625,8 @@ TextPaM TextView::CursorUp( const TextPaM& rPaM )
{
aPaM.GetPara()--;
pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() );
- USHORT nL = pPPortion->GetLines().Count() - 1;
- USHORT nCharPos = mpImpl->mpTextEngine->GetCharPos( aPaM.GetPara(), nL, nX+1 );
+ sal_uInt16 nL = pPPortion->GetLines().Count() - 1;
+ sal_uInt16 nCharPos = mpImpl->mpTextEngine->GetCharPos( aPaM.GetPara(), nL, nX+1 );
aPaM.GetIndex() = nCharPos;
}
@@ -1640,17 +1640,17 @@ TextPaM TextView::CursorDown( const TextPaM& rPaM )
long nX;
if ( mpImpl->mnTravelXPos == TRAVEL_X_DONTKNOW )
{
- nX = mpImpl->mpTextEngine->GetEditCursor( rPaM, FALSE ).Left();
- mpImpl->mnTravelXPos = (USHORT)nX+1;
+ nX = mpImpl->mpTextEngine->GetEditCursor( rPaM, sal_False ).Left();
+ mpImpl->mnTravelXPos = (sal_uInt16)nX+1;
}
else
nX = mpImpl->mnTravelXPos;
TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() );
- USHORT nLine = pPPortion->GetLineNumber( rPaM.GetIndex(), FALSE );
+ sal_uInt16 nLine = pPPortion->GetLineNumber( rPaM.GetIndex(), sal_False );
if ( nLine < ( pPPortion->GetLines().Count() - 1 ) )
{
- USHORT nCharPos = mpImpl->mpTextEngine->GetCharPos( rPaM.GetPara(), nLine+1, nX );
+ sal_uInt16 nCharPos = mpImpl->mpTextEngine->GetCharPos( rPaM.GetPara(), nLine+1, nX );
aPaM.GetIndex() = nCharPos;
// Sonderbehandlung siehe CursorUp...
@@ -1662,7 +1662,7 @@ TextPaM TextView::CursorDown( const TextPaM& rPaM )
{
aPaM.GetPara()++;
pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() );
- USHORT nCharPos = mpImpl->mpTextEngine->GetCharPos( aPaM.GetPara(), 0, nX+1 );
+ sal_uInt16 nCharPos = mpImpl->mpTextEngine->GetCharPos( aPaM.GetPara(), 0, nX+1 );
aPaM.GetIndex() = nCharPos;
TextLine* pLine = pPPortion->GetLines().GetObject( 0 );
if ( ( aPaM.GetIndex() == pLine->GetEnd() ) && ( aPaM.GetIndex() > pLine->GetStart() ) && ( pPPortion->GetLines().Count() > 1 ) )
@@ -1677,7 +1677,7 @@ TextPaM TextView::CursorStartOfLine( const TextPaM& rPaM )
TextPaM aPaM( rPaM );
TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() );
- USHORT nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), FALSE );
+ sal_uInt16 nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), sal_False );
TextLine* pLine = pPPortion->GetLines().GetObject( nLine );
aPaM.GetIndex() = pLine->GetStart();
@@ -1689,13 +1689,13 @@ TextPaM TextView::CursorEndOfLine( const TextPaM& rPaM )
TextPaM aPaM( rPaM );
TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() );
- USHORT nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), FALSE );
+ sal_uInt16 nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), sal_False );
TextLine* pLine = pPPortion->GetLines().GetObject( nLine );
aPaM.GetIndex() = pLine->GetEnd();
if ( pLine->GetEnd() > pLine->GetStart() ) // Leerzeile
{
- xub_Unicode cLastChar = pPPortion->GetNode()->GetText().GetChar((USHORT)(aPaM.GetIndex()-1) );
+ xub_Unicode cLastChar = pPPortion->GetNode()->GetText().GetChar((sal_uInt16)(aPaM.GetIndex()-1) );
if ( ( cLastChar == ' ' ) && ( aPaM.GetIndex() != pPPortion->GetNode()->GetText().Len() ) )
{
// Bei einem Blank in einer autom. umgebrochenen Zeile macht es Sinn,
@@ -1730,7 +1730,7 @@ TextPaM TextView::CursorStartOfDoc()
TextPaM TextView::CursorEndOfDoc()
{
- ULONG nNode = mpImpl->mpTextEngine->mpDoc->GetNodes().Count() - 1;
+ sal_uLong nNode = mpImpl->mpTextEngine->mpDoc->GetNodes().Count() - 1;
TextNode* pNode = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( nNode );
TextPaM aPaM( nNode, pNode->GetText().Len() );
return aPaM;
@@ -1763,11 +1763,11 @@ TextPaM TextView::PageDown( const TextPaM& rPaM )
return aPaM;
}
-void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpecial )
+void TextView::ImpShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, sal_Bool bSpecial )
{
if ( mpImpl->mpTextEngine->IsFormatting() )
return;
- if ( mpImpl->mpTextEngine->GetUpdateMode() == FALSE )
+ if ( mpImpl->mpTextEngine->GetUpdateMode() == sal_False )
return;
if ( mpImpl->mpTextEngine->IsInUndo() )
return;
@@ -1786,7 +1786,7 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec
{
TEParaPortion* pParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() );
mpImpl->mbCursorAtEndOfLine =
- pParaPortion->GetLineNumber( aPaM.GetIndex(), TRUE ) != pParaPortion->GetLineNumber( aPaM.GetIndex(), FALSE );
+ pParaPortion->GetLineNumber( aPaM.GetIndex(), sal_True ) != pParaPortion->GetLineNumber( aPaM.GetIndex(), sal_False );
}
if ( !IsInsertMode() && !mpImpl->maSelection.HasRange() )
@@ -1795,12 +1795,12 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec
if ( pNode->GetText().Len() && ( aPaM.GetIndex() < pNode->GetText().Len() ) )
{
// If we are behind a portion, and the next portion has other direction, we must change position...
- aEditCursor.Left() = aEditCursor.Right() = mpImpl->mpTextEngine->GetEditCursor( aPaM, FALSE, TRUE ).Left();
+ aEditCursor.Left() = aEditCursor.Right() = mpImpl->mpTextEngine->GetEditCursor( aPaM, sal_False, sal_True ).Left();
TEParaPortion* pParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() );
- USHORT nTextPortionStart = 0;
- USHORT nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, TRUE );
+ sal_uInt16 nTextPortionStart = 0;
+ sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, sal_True );
TETextPortion* pTextPortion = pParaPortion->GetTextPortions().GetObject( nTextPortion );
if ( pTextPortion->GetKind() == PORTIONKIND_TAB )
{
@@ -1812,8 +1812,8 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec
}
else
{
- TextPaM aNext = CursorRight( TextPaM( aPaM.GetPara(), aPaM.GetIndex() ), (USHORT)i18n::CharacterIteratorMode::SKIPCELL );
- aEditCursor.Right() = mpImpl->mpTextEngine->GetEditCursor( aNext, TRUE ).Left();
+ TextPaM aNext = CursorRight( TextPaM( aPaM.GetPara(), aPaM.GetIndex() ), (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL );
+ aEditCursor.Right() = mpImpl->mpTextEngine->GetEditCursor( aNext, sal_True ).Left();
}
}
}
@@ -1862,7 +1862,7 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec
}
// X kann durch das 'bischen mehr' falsch sein:
-// ULONG nMaxTextWidth = mpImpl->mpTextEngine->GetMaxTextWidth();
+// sal_uLong nMaxTextWidth = mpImpl->mpTextEngine->GetMaxTextWidth();
// if ( !nMaxTextWidth || ( nMaxTextWidth > 0x7FFFFFFF ) )
// nMaxTextWidth = 0x7FFFFFFF;
// long nMaxX = (long)nMaxTextWidth - aOutSz.Width();
@@ -1900,7 +1900,7 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec
mpImpl->mpCursor->Show();
}
-BOOL TextView::SetCursorAtPoint( const Point& rPosPixel )
+sal_Bool TextView::SetCursorAtPoint( const Point& rPosPixel )
{
mpImpl->mpTextEngine->CheckIdleFormatter();
@@ -1926,50 +1926,50 @@ BOOL TextView::SetCursorAtPoint( const Point& rPosPixel )
ShowSelection( aTmpNewSel );
}
- BOOL bForceCursor = mpImpl->mpDDInfo ? FALSE : TRUE; // && !mbInSelection
- ImpShowCursor( mpImpl->mbAutoScroll, bForceCursor, FALSE );
- return TRUE;
+ sal_Bool bForceCursor = mpImpl->mpDDInfo ? sal_False : sal_True; // && !mbInSelection
+ ImpShowCursor( mpImpl->mbAutoScroll, bForceCursor, sal_False );
+ return sal_True;
}
-BOOL TextView::IsSelectionAtPoint( const Point& rPosPixel )
+sal_Bool TextView::IsSelectionAtPoint( const Point& rPosPixel )
{
// if ( !Rectangle( Point(), mpImpl->mpWindow->GetOutputSizePixel() ).IsInside( rPosPixel ) && !mbInSelection )
-// return FALSE;
+// return sal_False;
Point aDocPos = GetDocPos( rPosPixel );
- TextPaM aPaM = mpImpl->mpTextEngine->GetPaM( aDocPos, FALSE );
+ TextPaM aPaM = mpImpl->mpTextEngine->GetPaM( aDocPos, sal_False );
// Bei Hyperlinks D&D auch ohne Selektion starten.
// BeginDrag wird aber nur gerufen, wenn IsSelectionAtPoint()
// Problem: IsSelectionAtPoint wird bei Command() nicht gerufen,
- // wenn vorher im MBDown schon FALSE returnt wurde.
+ // wenn vorher im MBDown schon sal_False returnt wurde.
return ( IsInSelection( aPaM ) ||
( /* mpImpl->mpSelEngine->IsInCommand() && */ mpImpl->mpTextEngine->FindAttrib( aPaM, TEXTATTR_HYPERLINK ) ) );
}
-BOOL TextView::IsInSelection( const TextPaM& rPaM )
+sal_Bool TextView::IsInSelection( const TextPaM& rPaM )
{
TextSelection aSel = mpImpl->maSelection;
aSel.Justify();
- ULONG nStartNode = aSel.GetStart().GetPara();
- ULONG nEndNode = aSel.GetEnd().GetPara();
- ULONG nCurNode = rPaM.GetPara();
+ sal_uLong nStartNode = aSel.GetStart().GetPara();
+ sal_uLong nEndNode = aSel.GetEnd().GetPara();
+ sal_uLong nCurNode = rPaM.GetPara();
if ( ( nCurNode > nStartNode ) && ( nCurNode < nEndNode ) )
- return TRUE;
+ return sal_True;
if ( nStartNode == nEndNode )
{
if ( nCurNode == nStartNode )
if ( ( rPaM.GetIndex() >= aSel.GetStart().GetIndex() ) && ( rPaM.GetIndex() < aSel.GetEnd().GetIndex() ) )
- return TRUE;
+ return sal_True;
}
else if ( ( nCurNode == nStartNode ) && ( rPaM.GetIndex() >= aSel.GetStart().GetIndex() ) )
- return TRUE;
+ return sal_True;
else if ( ( nCurNode == nEndNode ) && ( rPaM.GetIndex() < aSel.GetEnd().GetIndex() ) )
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
}
void TextView::ImpHideDDCursor()
@@ -1977,7 +1977,7 @@ void TextView::ImpHideDDCursor()
if ( mpImpl->mpDDInfo && mpImpl->mpDDInfo->mbVisCursor )
{
mpImpl->mpDDInfo->maCursor.Hide();
- mpImpl->mpDDInfo->mbVisCursor = FALSE;
+ mpImpl->mpDDInfo->mbVisCursor = sal_False;
}
}
@@ -1985,7 +1985,7 @@ void TextView::ImpShowDDCursor()
{
if ( !mpImpl->mpDDInfo->mbVisCursor )
{
- Rectangle aCursor = mpImpl->mpTextEngine->PaMtoEditCursor( mpImpl->mpDDInfo->maDropPos, TRUE );
+ Rectangle aCursor = mpImpl->mpTextEngine->PaMtoEditCursor( mpImpl->mpDDInfo->maDropPos, sal_True );
aCursor.Right()++;
aCursor.SetPos( GetWindowPos( aCursor.TopLeft() ) );
@@ -1993,11 +1993,11 @@ void TextView::ImpShowDDCursor()
mpImpl->mpDDInfo->maCursor.SetPos( aCursor.TopLeft() );
mpImpl->mpDDInfo->maCursor.SetSize( aCursor.GetSize() );
mpImpl->mpDDInfo->maCursor.Show();
- mpImpl->mpDDInfo->mbVisCursor = TRUE;
+ mpImpl->mpDDInfo->mbVisCursor = sal_True;
}
}
-void TextView::SetPaintSelection( BOOL bPaint )
+void TextView::SetPaintSelection( sal_Bool bPaint )
{
if ( bPaint != mpImpl->mbPaintSelection )
{
@@ -2006,7 +2006,7 @@ void TextView::SetPaintSelection( BOOL bPaint )
}
}
-void TextView::SetHighlightSelection( BOOL bSelectByHighlight )
+void TextView::SetHighlightSelection( sal_Bool bSelectByHighlight )
{
if ( bSelectByHighlight != mpImpl->mbHighlightSelection )
{
@@ -2015,14 +2015,14 @@ void TextView::SetHighlightSelection( BOOL bSelectByHighlight )
}
}
-BOOL TextView::Read( SvStream& rInput )
+sal_Bool TextView::Read( SvStream& rInput )
{
- BOOL bDone = mpImpl->mpTextEngine->Read( rInput, &mpImpl->maSelection );
+ sal_Bool bDone = mpImpl->mpTextEngine->Read( rInput, &mpImpl->maSelection );
ShowCursor();
return bDone;
}
-BOOL TextView::Write( SvStream& rOutput )
+sal_Bool TextView::Write( SvStream& rOutput )
{
return mpImpl->mpTextEngine->Read( rOutput, &mpImpl->maSelection );
}
@@ -2037,17 +2037,17 @@ bool TextView::ImplTruncateNewText( rtl::OUString& rNewText ) const
bTruncated = true;
}
- ULONG nMaxLen = mpImpl->mpTextEngine->GetMaxTextLen();
+ sal_uLong nMaxLen = mpImpl->mpTextEngine->GetMaxTextLen();
// 0 means unlimited, there is just the String API limit handled above
if( nMaxLen != 0 )
{
- ULONG nCurLen = mpImpl->mpTextEngine->GetTextLen();
+ sal_uLong nCurLen = mpImpl->mpTextEngine->GetTextLen();
sal_uInt32 nNewLen = rNewText.getLength();
if ( nCurLen + nNewLen > nMaxLen )
{
// see how much text will be replaced
- ULONG nSelLen = mpImpl->mpTextEngine->GetTextLen( mpImpl->maSelection );
+ sal_uLong nSelLen = mpImpl->mpTextEngine->GetTextLen( mpImpl->maSelection );
if ( nCurLen + nNewLen - nSelLen > nMaxLen )
{
sal_uInt32 nTruncatedLen = static_cast<sal_uInt32>(nMaxLen - (nCurLen - nSelLen));
@@ -2059,12 +2059,12 @@ bool TextView::ImplTruncateNewText( rtl::OUString& rNewText ) const
return bTruncated;
}
-BOOL TextView::ImplCheckTextLen( const String& rNewText )
+sal_Bool TextView::ImplCheckTextLen( const String& rNewText )
{
- BOOL bOK = TRUE;
+ sal_Bool bOK = sal_True;
if ( mpImpl->mpTextEngine->GetMaxTextLen() )
{
- ULONG n = mpImpl->mpTextEngine->GetTextLen();
+ sal_uLong n = mpImpl->mpTextEngine->GetTextLen();
n += rNewText.Len();
if ( n > mpImpl->mpTextEngine->GetMaxTextLen() )
{
@@ -2075,7 +2075,7 @@ BOOL TextView::ImplCheckTextLen( const String& rNewText )
// Beep hat hier eigentlich nichts verloren, sondern lieber ein Hdl,
// aber so funktioniert es wenigstens in ME, BasicIDE, SourceView
Sound::Beep();
- bOK = FALSE;
+ bOK = sal_False;
}
}
}
@@ -2092,12 +2092,12 @@ void TextView::dragGestureRecognized( const ::com::sun::star::datatransfer::dnd:
delete mpImpl->mpDDInfo;
mpImpl->mpDDInfo = new TextDDInfo;
- mpImpl->mpDDInfo->mbStarterOfDD = TRUE;
+ mpImpl->mpDDInfo->mbStarterOfDD = sal_True;
TETextDataObject* pDataObj = new TETextDataObject( GetSelected() );
if ( mpImpl->mpTextEngine->HasAttrib( TEXTATTR_HYPERLINK ) ) // Dann auch als HTML
- mpImpl->mpTextEngine->Write( pDataObj->GetHTMLStream(), &mpImpl->maSelection, TRUE );
+ mpImpl->mpTextEngine->Write( pDataObj->GetHTMLStream(), &mpImpl->maSelection, sal_True );
/*
@@ -2141,7 +2141,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv
{
SolarMutexGuard aVclGuard;
- BOOL bChanges = FALSE;
+ sal_Bool bChanges = sal_False;
if ( !mpImpl->mbReadOnly && mpImpl->mpDDInfo )
{
ImpHideDDCursor();
@@ -2149,17 +2149,17 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv
// Daten fuer das loeschen nach einem DROP_MOVE:
TextSelection aPrevSel( mpImpl->maSelection );
aPrevSel.Justify();
- ULONG nPrevParaCount = mpImpl->mpTextEngine->GetParagraphCount();
- USHORT nPrevStartParaLen = mpImpl->mpTextEngine->GetTextLen( aPrevSel.GetStart().GetPara() );
+ sal_uLong nPrevParaCount = mpImpl->mpTextEngine->GetParagraphCount();
+ sal_uInt16 nPrevStartParaLen = mpImpl->mpTextEngine->GetTextLen( aPrevSel.GetStart().GetPara() );
- BOOL bStarterOfDD = FALSE;
- for ( USHORT nView = mpImpl->mpTextEngine->GetViewCount(); nView && !bStarterOfDD; )
- bStarterOfDD = mpImpl->mpTextEngine->GetView( --nView )->mpImpl->mpDDInfo ? mpImpl->mpTextEngine->GetView( nView )->mpImpl->mpDDInfo->mbStarterOfDD : FALSE;
+ sal_Bool bStarterOfDD = sal_False;
+ for ( sal_uInt16 nView = mpImpl->mpTextEngine->GetViewCount(); nView && !bStarterOfDD; )
+ bStarterOfDD = mpImpl->mpTextEngine->GetView( --nView )->mpImpl->mpDDInfo ? mpImpl->mpTextEngine->GetView( nView )->mpImpl->mpDDInfo->mbStarterOfDD : sal_False;
HideSelection();
ImpSetSelection( mpImpl->mpDDInfo->maDropPos );
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_DRAGANDDROP );
+ mpImpl->mpTextEngine->UndoActionStart();
String aText;
uno::Reference< datatransfer::XTransferable > xDataObj = rDTDE.Transferable;
@@ -2188,7 +2188,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv
mpImpl->mpTextEngine->SetAttrib( TextAttribProtect(),
aTempStart.GetPara(),
aTempStart.GetIndex(),
- mpImpl->maSelection.GetEnd().GetIndex(), FALSE );
+ mpImpl->maSelection.GetEnd().GetIndex(), sal_False );
}
if ( aPrevSel.HasRange() &&
@@ -2200,7 +2200,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv
( ( mpImpl->mpDDInfo->maDropPos.GetPara() == aPrevSel.GetStart().GetPara() )
&& ( mpImpl->mpDDInfo->maDropPos.GetIndex() < aPrevSel.GetStart().GetIndex() ) ) )
{
- ULONG nNewParasBeforeSelection =
+ sal_uLong nNewParasBeforeSelection =
mpImpl->mpTextEngine->GetParagraphCount() - nPrevParaCount;
aPrevSel.GetStart().GetPara() += nNewParasBeforeSelection;
@@ -2208,7 +2208,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv
if ( mpImpl->mpDDInfo->maDropPos.GetPara() == aPrevSel.GetStart().GetPara() )
{
- USHORT nNewChars =
+ sal_uInt16 nNewChars =
mpImpl->mpTextEngine->GetTextLen( aPrevSel.GetStart().GetPara() ) - nPrevStartParaLen;
aPrevSel.GetStart().GetIndex() =
@@ -2237,7 +2237,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv
mpImpl->mpTextEngine->ImpDeleteText( aPrevSel );
}
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_DRAGANDDROP );
+ mpImpl->mpTextEngine->UndoActionEnd();
delete mpImpl->mpDDInfo;
mpImpl->mpDDInfo = 0;
@@ -2370,7 +2370,7 @@ sal_Int32 TextView::GetLineNumberOfCursorInSelection() const
{
TextPaM aPaM = GetSelection().GetEnd();
TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() );
- nLineNo = pPPortion->GetLineNumber( aPaM.GetIndex(), FALSE );
+ nLineNo = pPPortion->GetLineNumber( aPaM.GetIndex(), sal_False );
if( mpImpl->mbCursorAtEndOfLine )
--nLineNo;
}
@@ -2401,12 +2401,12 @@ void TextSelFunctionSet::CreateAnchor()
mpView->ImpSetSelection( mpView->mpImpl->maSelection.GetEnd() );
}
-BOOL TextSelFunctionSet::SetCursorAtPoint( const Point& rPointPixel, BOOL )
+sal_Bool TextSelFunctionSet::SetCursorAtPoint( const Point& rPointPixel, sal_Bool )
{
return mpView->SetCursorAtPoint( rPointPixel );
}
-BOOL TextSelFunctionSet::IsSelectionAtPoint( const Point& rPointPixel )
+sal_Bool TextSelFunctionSet::IsSelectionAtPoint( const Point& rPointPixel )
{
return mpView->IsSelectionAtPoint( rPointPixel );
}
@@ -2429,31 +2429,31 @@ TextEngine* TextView::GetTextEngine() const
{ return mpImpl->mpTextEngine; }
Window* TextView::GetWindow() const
{ return mpImpl->mpWindow; }
-void TextView::EnableCursor( BOOL bEnable )
+void TextView::EnableCursor( sal_Bool bEnable )
{ mpImpl->mbCursorEnabled = bEnable; }
-BOOL TextView::IsCursorEnabled() const
+sal_Bool TextView::IsCursorEnabled() const
{ return mpImpl->mbCursorEnabled; }
void TextView::SetStartDocPos( const Point& rPos )
{ mpImpl->maStartDocPos = rPos; }
const Point& TextView::GetStartDocPos() const
{ return mpImpl->maStartDocPos; }
-void TextView::SetAutoIndentMode( BOOL bAutoIndent )
+void TextView::SetAutoIndentMode( sal_Bool bAutoIndent )
{ mpImpl->mbAutoIndent = bAutoIndent; }
-BOOL TextView::IsAutoIndentMode() const
+sal_Bool TextView::IsAutoIndentMode() const
{ return mpImpl->mbAutoIndent; }
-BOOL TextView::IsReadOnly() const
+sal_Bool TextView::IsReadOnly() const
{ return mpImpl->mbReadOnly; }
-void TextView::SetAutoScroll( BOOL bAutoScroll )
+void TextView::SetAutoScroll( sal_Bool bAutoScroll )
{ mpImpl->mbAutoScroll = bAutoScroll; }
-BOOL TextView::IsAutoScroll() const
+sal_Bool TextView::IsAutoScroll() const
{ return mpImpl->mbAutoScroll; }
-BOOL TextView::IsPaintSelection() const
+sal_Bool TextView::IsPaintSelection() const
{ return mpImpl->mbPaintSelection; }
-BOOL TextView::IsHighlightSelection() const
+sal_Bool TextView::IsHighlightSelection() const
{ return mpImpl->mbHighlightSelection; }
-BOOL TextView::HasSelection() const
+sal_Bool TextView::HasSelection() const
{ return mpImpl->maSelection.HasRange(); }
-BOOL TextView::IsInsertMode() const
+sal_Bool TextView::IsInsertMode() const
{ return mpImpl->mbInsertMode; }
void TextView::SupportProtectAttribute(sal_Bool bSupport)
{ mpImpl->mbSupportProtectAttribute = bSupport;}
diff --git a/svtools/source/edit/txtattr.cxx b/svtools/source/edit/txtattr.cxx
index 57b4ade43379..022a40ae848f 100644
--- a/svtools/source/edit/txtattr.cxx
+++ b/svtools/source/edit/txtattr.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include <txtattr.hxx>
+#include <svtools/txtattr.hxx>
#include <vcl/font.hxx>
diff --git a/svtools/source/edit/xtextedt.cxx b/svtools/source/edit/xtextedt.cxx
index e7c77e7e65ce..eaef852b9d6d 100644
--- a/svtools/source/edit/xtextedt.cxx
+++ b/svtools/source/edit/xtextedt.cxx
@@ -53,12 +53,12 @@ ExtTextEngine::~ExtTextEngine()
TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const
{
TextSelection aSel( rCursor );
- USHORT nPos = rCursor.GetIndex();
- ULONG nPara = rCursor.GetPara();
- ULONG nParas = GetParagraphCount();
+ sal_uInt16 nPos = rCursor.GetIndex();
+ sal_uLong nPara = rCursor.GetPara();
+ sal_uLong nParas = GetParagraphCount();
if ( ( nPara < nParas ) && ( nPos < GetTextLen( nPara ) ) )
{
- USHORT nMatchChar = maGroupChars.Search( GetText( rCursor.GetPara() ).GetChar( nPos ) );
+ sal_uInt16 nMatchChar = maGroupChars.Search( GetText( rCursor.GetPara() ).GetChar( nPos ) );
if ( nMatchChar != STRING_NOTFOUND )
{
if ( ( nMatchChar % 2 ) == 0 )
@@ -67,8 +67,8 @@ TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const
sal_Unicode nSC = maGroupChars.GetChar( nMatchChar );
sal_Unicode nEC = maGroupChars.GetChar( nMatchChar+1 );
- USHORT nCur = nPos+1;
- USHORT nLevel = 1;
+ sal_uInt16 nCur = nPos+1;
+ sal_uInt16 nLevel = 1;
while ( nLevel && ( nPara < nParas ) )
{
XubString aStr = GetText( nPara );
@@ -103,8 +103,8 @@ TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const
xub_Unicode nEC = maGroupChars.GetChar( nMatchChar );
xub_Unicode nSC = maGroupChars.GetChar( nMatchChar-1 );
- USHORT nCur = rCursor.GetIndex()-1;
- USHORT nLevel = 1;
+ sal_uInt16 nCur = rCursor.GetIndex()-1;
+ sal_uInt16 nLevel = 1;
while ( nLevel )
{
if ( GetTextLen( nPara ) )
@@ -149,12 +149,12 @@ TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const
return aSel;
}
-BOOL ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSearchOptions, BOOL bForward )
+sal_Bool ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSearchOptions, sal_Bool bForward )
{
TextSelection aSel( rSel );
aSel.Justify();
- BOOL bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) );
+ sal_Bool bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) );
TextPaM aStartPaM( aSel.GetEnd() );
if ( aSel.HasRange() && ( ( bSearchInSelection && bForward ) || ( !bSearchInSelection && !bForward ) ) )
@@ -163,7 +163,7 @@ BOOL ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSea
}
bool bFound = false;
- ULONG nStartNode, nEndNode;
+ sal_uLong nStartNode, nEndNode;
if ( bSearchInSelection )
nEndNode = bForward ? aSel.GetEnd().GetPara() : aSel.GetStart().GetPara();
@@ -177,13 +177,13 @@ BOOL ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSea
utl::TextSearch aSearcher( rSearchOptions );
// ueber die Absaetze iterieren...
- for ( ULONG nNode = nStartNode;
+ for ( sal_uLong nNode = nStartNode;
bForward ? ( nNode <= nEndNode) : ( nNode >= nEndNode );
bForward ? nNode++ : nNode-- )
{
String aText = GetText( nNode );
- USHORT nStartPos = 0;
- USHORT nEndPos = aText.Len();
+ sal_uInt16 nStartPos = 0;
+ sal_uInt16 nEndPos = aText.Len();
if ( nNode == nStartNode )
{
if ( bForward )
@@ -213,7 +213,7 @@ BOOL ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSea
// Ueber den Absatz selektieren?
// Select over the paragraph?
// FIXME This should be max long...
- if( nEndPos == sal::static_int_cast<USHORT>(-1) ) // USHORT for 0 and -1 !
+ if( nEndPos == sal::static_int_cast<sal_uInt16>(-1) ) // sal_uInt16 for 0 and -1 !
{
if ( (rSel.GetEnd().GetPara()+1) < GetParagraphCount() )
{
@@ -250,34 +250,34 @@ ExtTextView::~ExtTextView()
{
}
-BOOL ExtTextView::MatchGroup()
+sal_Bool ExtTextView::MatchGroup()
{
TextSelection aTmpSel( GetSelection() );
aTmpSel.Justify();
if ( ( aTmpSel.GetStart().GetPara() != aTmpSel.GetEnd().GetPara() ) ||
( ( aTmpSel.GetEnd().GetIndex() - aTmpSel.GetStart().GetIndex() ) > 1 ) )
{
- return FALSE;
+ return sal_False;
}
TextSelection aMatchSel = ((ExtTextEngine*)GetTextEngine())->MatchGroup( aTmpSel.GetStart() );
if ( aMatchSel.HasRange() )
SetSelection( aMatchSel );
- return aMatchSel.HasRange() ? TRUE : FALSE;
+ return aMatchSel.HasRange() ? sal_True : sal_False;
}
-BOOL ExtTextView::Search( const util::SearchOptions& rSearchOptions, BOOL bForward )
+sal_Bool ExtTextView::Search( const util::SearchOptions& rSearchOptions, sal_Bool bForward )
{
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
TextSelection aSel( GetSelection() );
if ( ((ExtTextEngine*)GetTextEngine())->Search( aSel, rSearchOptions, bForward ) )
{
- bFound = TRUE;
+ bFound = sal_True;
// Erstmal den Anfang des Wortes als Selektion einstellen,
// damit das ganze Wort in den sichtbaren Bereich kommt.
SetSelection( aSel.GetStart() );
- ShowCursor( TRUE, FALSE );
+ ShowCursor( sal_True, sal_False );
}
else
{
@@ -290,9 +290,9 @@ BOOL ExtTextView::Search( const util::SearchOptions& rSearchOptions, BOOL bForwa
return bFound;
}
-USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAll, BOOL bForward )
+sal_uInt16 ExtTextView::Replace( const util::SearchOptions& rSearchOptions, sal_Bool bAll, sal_Bool bForward )
{
- USHORT nFound = 0;
+ sal_uInt16 nFound = 0;
if ( !bAll )
{
@@ -317,7 +317,7 @@ USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAl
// HideSelection();
TextSelection aSel;
- BOOL bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) );
+ sal_Bool bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) );
if ( bSearchInSelection )
{
aSel = GetSelection();
@@ -326,9 +326,9 @@ USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAl
TextSelection aSearchSel( aSel );
- BOOL bFound = pTextEngine->Search( aSel, rSearchOptions, TRUE );
+ sal_Bool bFound = pTextEngine->Search( aSel, rSearchOptions, sal_True );
if ( bFound )
- pTextEngine->UndoActionStart( XTEXTUNDO_REPLACEALL );
+ pTextEngine->UndoActionStart();
while ( bFound )
{
nFound++;
@@ -336,42 +336,42 @@ USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAl
TextPaM aNewStart = pTextEngine->ImpInsertText( aSel, rSearchOptions.replaceString );
aSel = aSearchSel;
aSel.GetStart() = aNewStart;
- bFound = pTextEngine->Search( aSel, rSearchOptions, TRUE );
+ bFound = pTextEngine->Search( aSel, rSearchOptions, sal_True );
}
if ( nFound )
{
SetSelection( aSel.GetStart() );
pTextEngine->FormatAndUpdate( this );
- pTextEngine->UndoActionEnd( XTEXTUNDO_REPLACEALL );
+ pTextEngine->UndoActionEnd();
}
}
return nFound;
}
-BOOL ExtTextView::ImpIndentBlock( BOOL bRight )
+sal_Bool ExtTextView::ImpIndentBlock( sal_Bool bRight )
{
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
TextSelection aSel = GetSelection();
aSel.Justify();
HideSelection();
- GetTextEngine()->UndoActionStart( bRight ? XTEXTUNDO_INDENTBLOCK : XTEXTUNDO_UNINDENTBLOCK );
+ GetTextEngine()->UndoActionStart();
- ULONG nStartPara = aSel.GetStart().GetPara();
- ULONG nEndPara = aSel.GetEnd().GetPara();
+ sal_uLong nStartPara = aSel.GetStart().GetPara();
+ sal_uLong nEndPara = aSel.GetEnd().GetPara();
if ( aSel.HasRange() && !aSel.GetEnd().GetIndex() )
{
nEndPara--; // den dann nicht einruecken...
}
- for ( ULONG nPara = nStartPara; nPara <= nEndPara; nPara++ )
+ for ( sal_uLong nPara = nStartPara; nPara <= nEndPara; nPara++ )
{
if ( bRight )
{
// Tabs hinzufuegen
GetTextEngine()->ImpInsertText( TextPaM( nPara, 0 ), '\t' );
- bDone = TRUE;
+ bDone = sal_True;
}
else
{
@@ -382,14 +382,14 @@ BOOL ExtTextView::ImpIndentBlock( BOOL bRight )
( aText.GetChar( 0 ) == ' ' ) ) )
{
GetTextEngine()->ImpDeleteText( TextSelection( TextPaM( nPara, 0 ), TextPaM( nPara, 1 ) ) );
- bDone = TRUE;
+ bDone = sal_True;
}
}
}
- GetTextEngine()->UndoActionEnd( bRight ? XTEXTUNDO_INDENTBLOCK : XTEXTUNDO_UNINDENTBLOCK );
+ GetTextEngine()->UndoActionEnd();
- BOOL bRange = aSel.HasRange();
+ sal_Bool bRange = aSel.HasRange();
if ( bRight )
{
aSel.GetStart().GetIndex()++;
@@ -410,14 +410,14 @@ BOOL ExtTextView::ImpIndentBlock( BOOL bRight )
return bDone;
}
-BOOL ExtTextView::IndentBlock()
+sal_Bool ExtTextView::IndentBlock()
{
- return ImpIndentBlock( TRUE );
+ return ImpIndentBlock( sal_True );
}
-BOOL ExtTextView::UnindentBlock()
+sal_Bool ExtTextView::UnindentBlock()
{
- return ImpIndentBlock( FALSE );
+ return ImpIndentBlock( sal_False );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter.vcl/filter/FilterConfigCache.cxx b/svtools/source/filter.vcl/filter/FilterConfigCache.cxx
index 3c26d8cad9d4..c142aa1ce95d 100644
--- a/svtools/source/filter.vcl/filter/FilterConfigCache.cxx
+++ b/svtools/source/filter.vcl/filter/FilterConfigCache.cxx
@@ -47,7 +47,7 @@ using namespace ::com::sun::star::container ; // XNameAccess
using namespace ::com::sun::star::uno ; // Reference
using namespace ::com::sun::star::beans ; // PropertyValue
using namespace ::utl ; // getProcessServiceFactory();
-using namespace ::rtl ;
+using ::rtl::OUString;
const char* FilterConfigCache::FilterConfigCacheEntry::InternalPixelFilterNameList[] =
{
diff --git a/svtools/source/filter.vcl/filter/FilterConfigItem.cxx b/svtools/source/filter.vcl/filter/FilterConfigItem.cxx
index 8ad858a1d877..fddeec1f0482 100644
--- a/svtools/source/filter.vcl/filter/FilterConfigItem.cxx
+++ b/svtools/source/filter.vcl/filter/FilterConfigItem.cxx
@@ -39,7 +39,7 @@
#include <com/sun/star/beans/XPropertySetInfo.hpp>
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-using namespace ::rtl;
+using ::rtl::OUString;
using namespace ::utl ; // getProcessServiceFactory
using namespace ::com::sun::star::lang ; // XMultiServiceFactory
using namespace ::com::sun::star::beans ; // PropertyValue
@@ -429,7 +429,7 @@ void FilterConfigItem::WriteBool( const OUString& rKey, sal_Bool bNewValue )
Any aAny;
if ( ImplGetPropertyValue( aAny, xPropSet, rKey, sal_True ) )
{
- sal_Bool bOldValue;
+ sal_Bool bOldValue(sal_True);
if ( aAny >>= bOldValue )
{
if ( bOldValue != bNewValue )
@@ -463,7 +463,7 @@ void FilterConfigItem::WriteInt32( const OUString& rKey, sal_Int32 nNewValue )
if ( ImplGetPropertyValue( aAny, xPropSet, rKey, sal_True ) )
{
- sal_Int32 nOldValue;
+ sal_Int32 nOldValue = 0;
if ( aAny >>= nOldValue )
{
if ( nOldValue != nNewValue )
diff --git a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx
index efe020b1cbda..6f78dd19fb6e 100644
--- a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx
+++ b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx
@@ -37,9 +37,7 @@
#include <osl/module.hxx>
#include <svl/solar.hrc>
#include <svtools/fltcall.hxx>
-#include "dlgexpor.hxx"
-#include "dlgejpg.hxx"
-#include "dlgepng.hxx"
+#include "exportdialog.hxx"
#include <uno/mapping.hxx>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/document/XViewDataSupplier.hpp>
@@ -50,12 +48,6 @@
#include <unotools/syslocale.hxx>
#include "vcl/svapp.hxx"
-#if defined WIN || (defined OS2 && !defined ICC)
-#define EXPDLG_FUNCTION_NAME "_DoExportDialog"
-#else
-#define EXPDLG_FUNCTION_NAME "DoExportDialog"
-#endif
-
using namespace ::rtl;
using namespace ::com::sun::star;
@@ -94,9 +86,10 @@ uno::Sequence< OUString > SAL_CALL SvFilterOptionsDialog_getSupportedServiceName
// -----------------------------------------------------------------------------
-SvFilterOptionsDialog::SvFilterOptionsDialog( const uno::Reference< lang::XMultiServiceFactory > & xMgr ) :
- rxMgr ( xMgr ),
- eFieldUnit ( FUNIT_CM )
+SvFilterOptionsDialog::SvFilterOptionsDialog( const uno::Reference< lang::XMultiServiceFactory > xMgr ) :
+ mxMgr ( xMgr ),
+ meFieldUnit ( FUNIT_CM ),
+ mbExportSelection ( sal_False )
{
}
@@ -149,18 +142,18 @@ uno::Sequence< beans::PropertyValue > SvFilterOptionsDialog::getPropertyValues()
throw ( uno::RuntimeException )
{
sal_Int32 i, nCount;
- for ( i = 0, nCount = aMediaDescriptor.getLength(); i < nCount; i++ )
+ for ( i = 0, nCount = maMediaDescriptor.getLength(); i < nCount; i++ )
{
- if ( aMediaDescriptor[ i ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FilterData")) )
+ if ( maMediaDescriptor[ i ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FilterData")) )
break;
}
if ( i == nCount )
- aMediaDescriptor.realloc( ++nCount );
+ maMediaDescriptor.realloc( ++nCount );
// the "FilterData" Property is an Any that will contain our PropertySequence of Values
- aMediaDescriptor[ i ].Name = String( RTL_CONSTASCII_USTRINGPARAM( "FilterData" ) );
- aMediaDescriptor[ i ].Value <<= aFilterDataSequence;
- return aMediaDescriptor;
+ maMediaDescriptor[ i ].Name = String( RTL_CONSTASCII_USTRINGPARAM( "FilterData" ) );
+ maMediaDescriptor[ i ].Value <<= maFilterDataSequence;
+ return maMediaDescriptor;
}
void SvFilterOptionsDialog::setPropertyValues( const uno::Sequence< beans::PropertyValue > & aProps )
@@ -168,15 +161,18 @@ void SvFilterOptionsDialog::setPropertyValues( const uno::Sequence< beans::Prope
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException )
{
- aMediaDescriptor = aProps;
+ maMediaDescriptor = aProps;
sal_Int32 i, nCount;
- for ( i = 0, nCount = aMediaDescriptor.getLength(); i < nCount; i++ )
+ for ( i = 0, nCount = maMediaDescriptor.getLength(); i < nCount; i++ )
{
- if ( aMediaDescriptor[ i ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FilterData")) )
+ if ( maMediaDescriptor[ i ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FilterData")) )
{
- aMediaDescriptor[ i ].Value >>= aFilterDataSequence;
- break;
+ maMediaDescriptor[ i ].Value >>= maFilterDataSequence;
+ }
+ else if ( maMediaDescriptor[ i ].Name.equalsAscii( "SelectionOnly" ) )
+ {
+ maMediaDescriptor[ i ].Value >>= mbExportSelection;
}
}
}
@@ -185,7 +181,7 @@ void SvFilterOptionsDialog::setPropertyValues( const uno::Sequence< beans::Prope
void SvFilterOptionsDialog::setTitle( const OUString& aTitle )
throw ( uno::RuntimeException )
{
- aDialogTitle = aTitle;
+ maDialogTitle = aTitle;
}
sal_Int16 SvFilterOptionsDialog::execute()
@@ -195,13 +191,13 @@ sal_Int16 SvFilterOptionsDialog::execute()
String aFilterNameStr( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) );
String aInternalFilterName;
- sal_Int32 j, nCount = aMediaDescriptor.getLength();
+ sal_Int32 j, nCount = maMediaDescriptor.getLength();
for ( j = 0; j < nCount; j++ )
{
- if ( aMediaDescriptor[ j ].Name.equals( aFilterNameStr ) )
+ if ( maMediaDescriptor[ j ].Name.equals( aFilterNameStr ) )
{
OUString aStr;
- aMediaDescriptor[ j ].Value >>= aStr;
+ maMediaDescriptor[ j ].Value >>= aStr;
aInternalFilterName = aStr;
aInternalFilterName.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "draw_" ) ), String(), 0 );
aInternalFilterName.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "impress_" ) ), String(), 0 );
@@ -220,79 +216,24 @@ sal_Int16 SvFilterOptionsDialog::execute()
}
if ( nFormat < nFilterCount )
{
- FltCallDialogParameter aFltCallDlgPara( Application::GetDefDialogParent(), NULL, eFieldUnit );
- aFltCallDlgPara.aFilterData = aFilterDataSequence;
-
- String aFilterName( aGraphicFilter.pConfig->GetExportFilterName( nFormat ) );
- if ( aGraphicFilter.pConfig->IsExportInternalFilter( nFormat ) )
- {
- // Export-Dialog fuer Bitmap's, SVM's und WMF's
- if( ( aFilterName.EqualsIgnoreCaseAscii( EXP_BMP ) ) ||
- ( aFilterName.EqualsIgnoreCaseAscii( EXP_SVMETAFILE ) ) ||
- ( aFilterName.EqualsIgnoreCaseAscii( EXP_WMF ) ) ||
- ( aFilterName.EqualsIgnoreCaseAscii( EXP_EMF ) ) ||
- ( aFilterName.EqualsIgnoreCaseAscii( EXP_JPEG ) )||
- ( aFilterName.EqualsIgnoreCaseAscii( EXP_PNG ) ) )
- {
- ByteString aResMgrName( "svt", 3 );
- ResMgr* pResMgr;
-
- pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
- aFltCallDlgPara.pResMgr = pResMgr;
- // JPEG-Dialog
- if( aFilterName.EqualsIgnoreCaseAscii( EXP_JPEG ) )
- {
- if ( DlgExportEJPG( aFltCallDlgPara ).Execute() == RET_OK )
- nRet = ui::dialogs::ExecutableDialogResults::OK;
- }
- else if ( aFilterName.EqualsIgnoreCaseAscii( EXP_PNG ) )
- {
- if ( DlgExportEPNG( aFltCallDlgPara ).Execute() == RET_OK )
- nRet = ui::dialogs::ExecutableDialogResults::OK;
- }
- else if( aFilterName.EqualsIgnoreCaseAscii( EXP_BMP ) )
- {
- // Fuer Vektorformate nehmen wir den Vektor-Dialog
- aFltCallDlgPara.aFilterExt = aGraphicFilter.pConfig->GetExportFormatShortName( nFormat );
- if ( DlgExportPix( aFltCallDlgPara ).Execute() == RET_OK )
- nRet = ui::dialogs::ExecutableDialogResults::OK;
- }
- else
- {
- aFltCallDlgPara.aFilterExt = aGraphicFilter.pConfig->GetExportFormatShortName( nFormat );
- if ( DlgExportVec( aFltCallDlgPara ).Execute() == RET_OK )
- nRet = ui::dialogs::ExecutableDialogResults::OK;
- }
- delete pResMgr;
- }
- }
- else // ladbare Filter
- {
- xub_StrLen i, nTokenCount = aGraphicFilter.aFilterPath.GetTokenCount( ';' );
- for ( i = 0; i < nTokenCount; i++ )
- {
-
- OUString aPathURL;
-
- ::osl::FileBase::getFileURLFromSystemPath( aGraphicFilter.aFilterPath.GetToken( i ), aPathURL );
- aPathURL += String( '/' );
-
- OUString aSystemPath;
- ::osl::FileBase::getSystemPathFromFileURL( aPathURL, aSystemPath );
- aSystemPath += OUString( aFilterName );
-
- osl::Module aLibrary( aSystemPath );
- PFilterDlgCall pFunc = (PFilterDlgCall) aLibrary.getFunctionSymbol( UniString::CreateFromAscii( EXPDLG_FUNCTION_NAME ) );
- // Dialog in DLL ausfuehren
- if( pFunc )
- {
- if ( (*pFunc)( aFltCallDlgPara ) )
- nRet = ui::dialogs::ExecutableDialogResults::OK;
- }
- }
- }
+ FltCallDialogParameter aFltCallDlgPara( Application::GetDefDialogParent(), NULL, meFieldUnit );
+ aFltCallDlgPara.aFilterData = maFilterDataSequence;
+
+ ByteString aResMgrName( "svt", 3 );
+ ResMgr* pResMgr;
+
+ pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
+ aFltCallDlgPara.pResMgr = pResMgr;
+
+ aFltCallDlgPara.aFilterExt = aGraphicFilter.pConfig->GetExportFormatShortName( nFormat );
+ sal_Bool bIsPixelFormat( aGraphicFilter.pConfig->IsExportPixelFormat( nFormat ) );
+ if ( ExportDialog( aFltCallDlgPara, mxMgr, mxSourceDocument, mbExportSelection, bIsPixelFormat ).Execute() == RET_OK )
+ nRet = ui::dialogs::ExecutableDialogResults::OK;
+
+ delete pResMgr;
+
// taking the out parameter from the dialog
- aFilterDataSequence = aFltCallDlgPara.aFilterData;
+ maFilterDataSequence = aFltCallDlgPara.aFilterData;
}
}
return nRet;
@@ -302,6 +243,8 @@ sal_Int16 SvFilterOptionsDialog::execute()
void SvFilterOptionsDialog::setSourceDocument( const uno::Reference< lang::XComponent >& xDoc )
throw ( lang::IllegalArgumentException, uno::RuntimeException )
{
+ mxSourceDocument = xDoc;
+
// try to set the corresponding metric unit
String aConfigPath;
uno::Reference< lang::XServiceInfo > xServiceInfo
@@ -321,7 +264,7 @@ void SvFilterOptionsDialog::setSourceDocument( const uno::Reference< lang::XComp
aPropertyName = String( RTL_CONSTASCII_USTRINGPARAM( "Metric" ) );
else
aPropertyName = String( RTL_CONSTASCII_USTRINGPARAM( "NonMetric" ) );
- eFieldUnit = (FieldUnit)aConfigItem.ReadInt32( aPropertyName, FUNIT_CM );
+ meFieldUnit = (FieldUnit)aConfigItem.ReadInt32( aPropertyName, FUNIT_CM );
}
}
}
diff --git a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx
index 3e9fce6cf4ca..6cc10d98d6a7 100644
--- a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx
+++ b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx
@@ -29,7 +29,7 @@
#ifndef _SV_FILTER_OPTIONS_DIALOG_HXX_
#define _SV_FILTER_OPTIONS_DIALOG_HXX_
-#include <vcl/fldunit.hxx>
+#include <tools/fldunit.hxx>
#include <cppuhelper/implbase5.hxx>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -47,18 +47,22 @@ class SvFilterOptionsDialog : public cppu::WeakImplHelper5
com::sun::star::lang::XServiceInfo
>
{
- const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > &
- rxMgr;
+ const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
+ mxMgr;
com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
- aMediaDescriptor;
+ maMediaDescriptor;
com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
- aFilterDataSequence;
- rtl::OUString aDialogTitle;
- FieldUnit eFieldUnit;
+ maFilterDataSequence;
+ com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
+ mxSourceDocument;
+
+ rtl::OUString maDialogTitle;
+ FieldUnit meFieldUnit;
+ sal_Bool mbExportSelection;
public:
- SvFilterOptionsDialog( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB );
+ SvFilterOptionsDialog( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > _rxORB );
~SvFilterOptionsDialog();
// XInterface
diff --git a/svtools/source/filter.vcl/filter/dlgejpg.cxx b/svtools/source/filter.vcl/filter/dlgejpg.cxx
deleted file mode 100644
index 4cedaf70e509..000000000000
--- a/svtools/source/filter.vcl/filter/dlgejpg.cxx
+++ /dev/null
@@ -1,98 +0,0 @@
-/* -*- 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 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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-#include "dlgejpg.hxx"
-#include "dlgejpg.hrc"
-#include "strings.hrc"
-#include <svtools/FilterConfigItem.hxx>
-
-#define KEY_QUALITY "Quality"
-#define KEY_GRAYSCALES "ColorMode"
-
-/*************************************************************************
-|*
-|* Ctor
-|*
-\************************************************************************/
-
-DlgExportEJPG::DlgExportEJPG( FltCallDialogParameter& rPara ) :
- ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_JPG, *rPara.pResMgr ) ),
- rFltCallPara ( rPara ),
- aFiDescr ( this, ResId( FI_DESCR, *rPara.pResMgr ) ),
- aNumFldQuality ( this, ResId( NUM_FLD_QUALITY, *rPara.pResMgr ) ),
- aGrpQuality ( this, ResId( GRP_QUALITY, *rPara.pResMgr ) ),
- aRbGray ( this, ResId( RB_GRAY, *rPara.pResMgr ) ),
- aRbRGB ( this, ResId( RB_RGB, *rPara.pResMgr ) ),
- aGrpColors ( this, ResId( GRP_COLORS, *rPara.pResMgr ) ),
- aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ),
- aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ),
- aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) )
-{
- FreeResource();
- String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/JPG" ) );
- pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
-
- // reading filter options
- sal_Int32 nQuality = pConfigItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( KEY_QUALITY ) ), 75 );
- sal_Int32 nColorMode = pConfigItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( KEY_GRAYSCALES ) ), 0 );
- aNumFldQuality.SetValue( nQuality );
-
- if ( nColorMode )
- aRbGray.Check( sal_True );
- else
- aRbRGB.Check( sal_True );
-
- aBtnOK.SetClickHdl( LINK( this, DlgExportEJPG, OK ) );
-}
-
-
-/*************************************************************************
-|*
-|* Speichert eingestellte Werte in ini-Datei
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportEJPG, OK, void *, EMPTYARG )
-{
- // Config-Parameter schreiben
- pConfigItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( KEY_QUALITY ) ), (sal_Int32)aNumFldQuality.GetValue() );
- pConfigItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( KEY_GRAYSCALES ) ), aRbGray.IsChecked() ? 1 : 0 );
- rFltCallPara.aFilterData = pConfigItem->GetFilterData();
- EndDialog( RET_OK );
- return 0;
-}
-
-DlgExportEJPG::~DlgExportEJPG()
-{
- delete pConfigItem;
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter.vcl/filter/dlgejpg.hxx b/svtools/source/filter.vcl/filter/dlgejpg.hxx
deleted file mode 100644
index efc5daa7105c..000000000000
--- a/svtools/source/filter.vcl/filter/dlgejpg.hxx
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- 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 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef _DLGEJPG_HXX_
-#define _DLGEJPG_HXX_
-
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/msgbox.hxx>
-#include <svtools/stdctrl.hxx>
-#include <svtools/fltcall.hxx>
-
-/*************************************************************************
-|*
-|* Dialog zum Einstellen von Filteroptionen
-|*
-\************************************************************************/
-class FilterConfigItem;
-class DlgExportEJPG : public ModalDialog
-{
-private:
-
- FltCallDialogParameter& rFltCallPara;
-
- FixedInfo aFiDescr;
- NumericField aNumFldQuality;
- FixedLine aGrpQuality;
- RadioButton aRbGray;
- RadioButton aRbRGB;
- FixedLine aGrpColors;
- OKButton aBtnOK;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
- FilterConfigItem* pConfigItem;
-
- DECL_LINK( OK, void * );
-
-public:
- DlgExportEJPG( FltCallDialogParameter& rDlgPara );
- ~DlgExportEJPG();
-};
-
-#endif // _DLGEJPG_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter.vcl/filter/dlgejpg.src b/svtools/source/filter.vcl/filter/dlgejpg.src
deleted file mode 100644
index 0817f7cbf3c7..000000000000
--- a/svtools/source/filter.vcl/filter/dlgejpg.src
+++ /dev/null
@@ -1,101 +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.
- *
- ************************************************************************/
-
-#include "dlgejpg.hrc"
-ModalDialog DLG_EXPORT_JPG
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 159 , 92 ) ;
- Text [ en-US ] = "JPEG Options" ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 103 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 103 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 103 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- FixedLine GRP_QUALITY
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 90 , 8 ) ;
- Text [ en-US ] = "Quality" ;
- };
- FixedText FI_DESCR
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 81 , 16 ) ;
- Text [ en-US ] = "1: min. quality\n100: max. quality" ;
- };
- NumericField NUM_FLD_QUALITY
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 33 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Spin = TRUE ;
- Minimum = 1;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Last = 100 ;
- Repeat = TRUE ;
- };
- FixedLine GRP_COLORS
- {
- Pos = MAP_APPFONT ( 6 , 51 ) ;
- Size = MAP_APPFONT ( 90 , 8 ) ;
- Text [ en-US ] = "Color resolution" ;
- };
- RadioButton RB_GRAY
- {
- Pos = MAP_APPFONT ( 12 , 62 ) ;
- Size = MAP_APPFONT ( 81 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Grayscale" ;
- };
- RadioButton RB_RGB
- {
- Pos = MAP_APPFONT ( 12 , 76 ) ;
- Size = MAP_APPFONT ( 81 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "True Colors" ;
- };
-};
diff --git a/svtools/source/filter.vcl/filter/dlgepng.cxx b/svtools/source/filter.vcl/filter/dlgepng.cxx
deleted file mode 100644
index 1b400cba87c6..000000000000
--- a/svtools/source/filter.vcl/filter/dlgepng.cxx
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- 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 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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-#include <tools/ref.hxx>
-#include <vcl/msgbox.hxx>
-#include "dlgepng.hxx"
-#include "dlgepng.hrc"
-
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-
-/*************************************************************************
-|*
-|* Ctor
-|*
-\************************************************************************/
-
-DlgExportEPNG::DlgExportEPNG( FltCallDialogParameter& rPara ) :
- ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_EPNG, *rPara.pResMgr ) ),
- FilterConfigItem ( OUString( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/PNG" ) ), &rPara.aFilterData ),
- rFltCallPara ( rPara ),
- aGrpCompression ( this, ResId( GRP_COMPRESSION, *rPara.pResMgr ) ),
- aFiCompression ( this, ResId( FI_COMPRESSION, *rPara.pResMgr ) ),
- aNumCompression ( this, ResId( NUM_COMPRESSION, *rPara.pResMgr ) ),
- aCbxInterlaced ( this, ResId( CBX_INTERLACED, *rPara.pResMgr ) ),
- aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ),
- aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ),
- aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ),
- pMgr ( rPara.pResMgr )
-{
- FreeResource();
-
- // Config-Parameter lesen
- sal_Int32 nCompression = ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) ), 6 );
- if ( ( nCompression < 0 ) || ( nCompression > 9 ) )
- nCompression = 6;
- aNumCompression.SetValue( nCompression );
-
- sal_Int32 nInterlaced = ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), 0 );
- sal_Bool bInterlaced = nInterlaced != 0;
- aCbxInterlaced.Check( bInterlaced );
-
- aBtnOK.SetClickHdl( LINK( this, DlgExportEPNG, OK ) );
-}
-
-/*************************************************************************
-|*
-|* Speichert eingestellte Werte in ini-Datei
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportEPNG, OK, void *, EMPTYARG )
-{
- // Config-Parameter schreiben
- WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) ), static_cast<sal_Int32>(aNumCompression.GetValue()) );
- sal_Int32 nInterlace = 0;
- if ( aCbxInterlaced.IsChecked() )
- nInterlace++;
- WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), nInterlace );
- rFltCallPara.aFilterData = GetFilterData();
- EndDialog( RET_OK );
-
- return 0;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter.vcl/filter/dlgepng.hrc b/svtools/source/filter.vcl/filter/dlgepng.hrc
deleted file mode 100644
index b3ffaab3ab1e..000000000000
--- a/svtools/source/filter.vcl/filter/dlgepng.hrc
+++ /dev/null
@@ -1,35 +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.
- *
- ************************************************************************/
-#include <svtools/svtools.hrc>
-
-#define BTN_OK 1
-#define BTN_CANCEL 1
-#define BTN_HELP 1
-#define GRP_COMPRESSION 1
-#define FI_COMPRESSION 1
-#define NUM_COMPRESSION 1
-#define CBX_INTERLACED 1
diff --git a/svtools/source/filter.vcl/filter/dlgepng.hxx b/svtools/source/filter.vcl/filter/dlgepng.hxx
deleted file mode 100644
index b43feafc0d49..000000000000
--- a/svtools/source/filter.vcl/filter/dlgepng.hxx
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- 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 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef _DLGEPNG_HXX_
-#define _DLGEPNG_HXX_
-#include <svtools/fltcall.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-#include <svtools/stdctrl.hxx>
-#include <svtools/FilterConfigItem.hxx>
-
-
-/*************************************************************************
-|*
-|* Dialog zum Einstellen von Filteroptionen
-|*
-\************************************************************************/
-
-class ResMgr;
-
-class DlgExportEPNG : public ModalDialog, FilterConfigItem
-{
-
- private:
-
- FltCallDialogParameter& rFltCallPara;
-
- FixedLine aGrpCompression;
- FixedInfo aFiCompression;
- NumericField aNumCompression;
- CheckBox aCbxInterlaced;
- OKButton aBtnOK;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
- ResMgr* pMgr;
-
- DECL_LINK( OK, void * );
-
- public:
-
- DlgExportEPNG( FltCallDialogParameter& rPara );
-};
-
-#endif // _DLGEPNG_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter.vcl/filter/dlgepng.src b/svtools/source/filter.vcl/filter/dlgepng.src
deleted file mode 100644
index 14c53ad8374b..000000000000
--- a/svtools/source/filter.vcl/filter/dlgepng.src
+++ /dev/null
@@ -1,89 +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.
- *
- ************************************************************************/
-
-#include "dlgepng.hrc"
-ModalDialog DLG_EXPORT_EPNG
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 169 , 64 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- Text [ en-US ] = "PNG Options" ;
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 113 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 113 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 113 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- FixedLine GRP_COMPRESSION
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 100 , 8 ) ;
- Text[ en-US ] = "Mode";
- };
- FixedText FI_COMPRESSION
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 80 , 8 ) ;
- Text[ en-US ] = "~Compression 0..9";
- };
- NumericField NUM_COMPRESSION
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 25 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- Spin = TRUE ;
- Minimum = 0 ;
- Maximum = 9 ;
- First = 0 ;
- Last = 9 ;
- StrictFormat = TRUE ;
- Repeat = TRUE ;
- };
- CheckBox CBX_INTERLACED
- {
- Pos = MAP_APPFONT ( 12 , 43 ) ;
- Size = MAP_APPFONT ( 80 , 12 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Interlaced" ;
- };
-};
diff --git a/svtools/source/filter.vcl/filter/dlgexpor.cxx b/svtools/source/filter.vcl/filter/dlgexpor.cxx
deleted file mode 100644
index 951dd2c1a551..000000000000
--- a/svtools/source/filter.vcl/filter/dlgexpor.cxx
+++ /dev/null
@@ -1,444 +0,0 @@
-/* -*- 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 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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-
-#ifndef GCC
-# pragma hdrstop
-#endif
-
-#include <tools/ref.hxx>
-#include <svtools/FilterConfigItem.hxx>
-#include <com/sun/star/awt/Size.hpp>
-#include <vcl/msgbox.hxx>
-#include "dlgexpor.hxx"
-#include "dlgexpor.hrc"
-#include "strings.hrc"
-
-/*************************************************************************
-|*
-|* Ctor
-|*
-\************************************************************************/
-
-DlgExportPix::DlgExportPix( FltCallDialogParameter& rPara ) :
- ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_PIX, *rPara.pResMgr ) ),
- rFltCallPara ( rPara ),
- aBtnOK ( this, ResId( BTN_OK_PIX, *rPara.pResMgr ) ),
- aBtnCancel ( this, ResId( BTN_CANCEL_PIX, *rPara.pResMgr ) ),
- aBtnHelp ( this, ResId( BTN_HELP_PIX, *rPara.pResMgr ) ),
- aLbColors ( this, ResId( LB_COLORS, *rPara.pResMgr ) ),
- aCbxRLE ( this, ResId( CBX_RLE, *rPara.pResMgr ) ),
- aGrpColors ( this, ResId( GRP_COLORS, *rPara.pResMgr ) ),
- aRbOriginal ( this, ResId( RB_ORIGINAL_PIX, *rPara.pResMgr ) ),
- aRbRes ( this, ResId( RB_RES_PIX, *rPara.pResMgr ) ),
- aRbSize ( this, ResId( RB_SIZE_PIX, *rPara.pResMgr ) ),
- aFtSizeX ( this, ResId( FT_SIZEX_PIX, *rPara.pResMgr ) ),
- aMtfSizeX ( this, ResId( MTF_SIZEX_PIX, *rPara.pResMgr ) ),
- aFtSizeY ( this, ResId( FT_SIZEY_PIX, *rPara.pResMgr ) ),
- aMtfSizeY ( this, ResId( MTF_SIZEY_PIX, *rPara.pResMgr ) ),
- aGrpMode ( this, ResId( GRP_MODE_PIX, *rPara.pResMgr ) ),
- aCbbRes ( this, ResId( CBB_RES_PIX, *rPara.pResMgr ) ),
- pMgr ( rPara.pResMgr ),
- aExt ( rPara.aFilterExt )
-{
- aExt.ToUpperAscii();
- String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/" ) );
- aFilterConfigPath.Append( aExt );
- pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
-
- String aTitle( aExt );
- FreeResource();
-
- aBtnOK.SetClickHdl( LINK( this, DlgExportPix, OK ) );
- aRbOriginal.SetClickHdl( LINK( this, DlgExportPix, ClickRbOriginal ) );
- aRbRes.SetClickHdl( LINK( this, DlgExportPix, ClickRbRes ) );
- aRbSize.SetClickHdl( LINK( this, DlgExportPix, ClickRbSize ) );
- aLbColors.SetSelectHdl( LINK( this, DlgExportPix, SelectLbColors ) );
-
- aTitle.ToUpperAscii();
- aTitle += String( ResId( EXPORT_DIALOG_TITLE, *pMgr ) );
- SetText( aTitle );
-
- // Config-Parameter lesen
- sal_Int32 nColors = pConfigItem->ReadInt32( String( ResId( KEY_COLORS, *pMgr ) ), 0 );
- sal_Int32 nMode = pConfigItem->ReadInt32( String( ResId( KEY_MODE, *pMgr ) ), 0 );
- sal_Int32 nRes = pConfigItem->ReadInt32( String( ResId( KEY_RES, *pMgr ) ), 75 );
- sal_Bool bRleCoding = pConfigItem->ReadBool( String( ResId( KEY_RLE_CODING, *pMgr ) ), sal_True );
-
- aLbColors.SelectEntryPos( Min( (sal_uInt16) 7, (sal_uInt16)nColors ) );
-
- String aStrRes( String::CreateFromInt32( nRes ) );
- aStrRes.Append( String( RTL_CONSTASCII_USTRINGPARAM( " DPI" ) ) );
- aCbbRes.SetText( aStrRes );
-
- ::com::sun::star::awt::Size aDefault( 10000, 10000 );
- ::com::sun::star::awt::Size aSize;
- aSize = pConfigItem->ReadSize( String( ResId( KEY_SIZE, *pMgr ) ), aDefault );
-
- aCbxRLE.Check( bRleCoding );
-
- aMtfSizeX.SetDefaultUnit( FUNIT_MM );
- aMtfSizeY.SetDefaultUnit( FUNIT_MM );
-
- aMtfSizeX.SetValue( aSize.Width );
- aMtfSizeY.SetValue( aSize.Height );
-
- switch ( rPara.eFieldUnit )
- {
-// case FUNIT_NONE :
-// case FUNIT_KM :
-// case FUNIT_PERCENT :
-// case FUNIT_CUSTOM :
-// case FUNIT_MILE :
-// case FUNIT_FOOT :
-// case FUNIT_M :
- case FUNIT_MM :
- case FUNIT_CM :
- case FUNIT_TWIP :
- case FUNIT_POINT :
- case FUNIT_PICA :
- case FUNIT_INCH :
- case FUNIT_100TH_MM :
- {
- aMtfSizeX.SetUnit( rPara.eFieldUnit );
- aMtfSizeY.SetUnit( rPara.eFieldUnit );
- }
- break;
-
- default:
- break; // -Wall multiple values not handled.
- }
-
- switch ( nMode )
- {
- case 2 :
- {
- aRbSize.Check( TRUE );
- ClickRbSize( NULL );
- }
- break;
- case 1 :
- {
- aRbRes.Check( TRUE );
- ClickRbRes( NULL );
- }
- break;
- default :
- {
- aRbOriginal.Check( TRUE );
- ClickRbOriginal( NULL );
- }
- break;
- }
- SelectLbColors( &aLbColors );
-}
-
-DlgExportPix::~DlgExportPix()
-{
- delete pConfigItem;
-}
-
-
-/*************************************************************************
-|*
-|* Speichert eingestellte Werte in ini-Datei
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportPix, OK, void *, EMPTYARG )
-{
- // Config-Parameter schreiben
-
- sal_Int32 nRes = Max( Min( aCbbRes.GetText().ToInt32(), sal_Int32( 600 ) ), sal_Int32( 75 ) );
- ::com::sun::star::awt::Size aSize(
- static_cast<long>(MetricField::ConvertDoubleValue( static_cast<double>(aMtfSizeX.GetValue()), 2, aMtfSizeX.GetUnit(), MAP_100TH_MM )),
- static_cast<long>(MetricField::ConvertDoubleValue( static_cast<double>(aMtfSizeY.GetValue()), 2, aMtfSizeY.GetUnit(), MAP_100TH_MM )) );
-
- sal_Int32 nMode;
- if ( aRbRes.IsChecked() )
- nMode = 1;
- else if ( aRbSize.IsChecked() )
- nMode = 2;
- else
- nMode = 0;
-
- pConfigItem->WriteInt32( String( ResId( KEY_MODE, *pMgr ) ), nMode );
- pConfigItem->WriteInt32( String( ResId( KEY_RES, *pMgr ) ), nRes );
- pConfigItem->WriteSize( String( ResId( KEY_SIZE, *pMgr ) ), aSize );
- pConfigItem->WriteInt32( String( ResId( KEY_COLORS, *pMgr ) ), (sal_Int32)aLbColors.GetSelectEntryPos() );
- pConfigItem->WriteBool( String( ResId( KEY_RLE_CODING, *pMgr ) ), aCbxRLE.IsChecked() );
- rFltCallPara.aFilterData = pConfigItem->GetFilterData();
- EndDialog( RET_OK );
-
- return 0;
-}
-
-/*************************************************************************
-|*
-|* Enabled/Disabled Controls
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportPix, ClickRbOriginal, void*, EMPTYARG )
-{
- aCbbRes.Disable();
-
- aFtSizeX.Disable();
- aMtfSizeX.Disable();
- aFtSizeY.Disable();
- aMtfSizeY.Disable();
-
- return 0;
-}
-
-
-/*************************************************************************
-|*
-|* Enabled/Disabled Controls
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportPix, ClickRbRes, void*, EMPTYARG )
-{
- aCbbRes.Enable();
-
- aFtSizeX.Disable();
- aMtfSizeX.Disable();
- aFtSizeY.Disable();
- aMtfSizeY.Disable();
-
- return 0;
-}
-
-
-/*************************************************************************
-|*
-|* Enabled/Disabled Controls
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportPix, ClickRbSize, void*, EMPTYARG )
-{
- aFtSizeX.Enable();
- aMtfSizeX.Enable();
- aFtSizeY.Enable();
- aMtfSizeY.Enable();
-
- aCbbRes.Disable();
-
- return 0;
-}
-
-
-/*************************************************************************
-|*
-|* Enabled/Disabled Controls
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportPix, SelectLbColors, void*, EMPTYARG )
-{
- const USHORT nLbPos = aLbColors.GetSelectEntryPos();
-
- if ( ( nLbPos >= 3 ) && ( nLbPos <= 6 ) )
- aCbxRLE.Enable();
- else
- aCbxRLE.Disable();
-
- return 0L;
-}
-
-
-/******************************************************************************/
-
-
-/*************************************************************************
-|*
-|* Ctor
-|*
-\************************************************************************/
-
-DlgExportVec::DlgExportVec( FltCallDialogParameter& rPara ) :
- ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_VEC, *rPara.pResMgr ) ),
- rFltCallPara ( rPara ),
- aBtnOK ( this, ResId( BTN_OK_VEC, *rPara.pResMgr ) ),
- aBtnCancel ( this, ResId( BTN_CANCEL_VEC, *rPara.pResMgr ) ),
- aBtnHelp ( this, ResId( BTN_HELP_VEC, *rPara.pResMgr ) ),
- aRbOriginal ( this, ResId( RB_ORIGINAL_VEC, *rPara.pResMgr ) ),
- aRbSize ( this, ResId( RB_SIZE_VEC, *rPara.pResMgr ) ),
- aGrpMode ( this, ResId( GRP_MODE_VEC, *rPara.pResMgr ) ),
- aFtSizeX ( this, ResId( FT_SIZEX_VEC, *rPara.pResMgr ) ),
- aMtfSizeX ( this, ResId( MTF_SIZEX_VEC, *rPara.pResMgr ) ),
- aFtSizeY ( this, ResId( FT_SIZEY_VEC, *rPara.pResMgr ) ),
- aMtfSizeY ( this, ResId( MTF_SIZEY_VEC, *rPara.pResMgr ) ),
- aGrpSize ( this, ResId( GRP_SIZE_VEC, *rPara.pResMgr ) ),
- pMgr ( rPara.pResMgr ),
- aExt ( rPara.aFilterExt )
-{
- aExt.ToUpperAscii();
- String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/" ) );
- aFilterConfigPath.Append( aExt );
- pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
-
- String aTitle( aExt );
- FreeResource();
-
- aBtnOK.SetClickHdl( LINK( this, DlgExportVec, OK ) );
- aRbOriginal.SetClickHdl( LINK( this, DlgExportVec, ClickRbOriginal ) );
- aRbSize.SetClickHdl( LINK( this, DlgExportVec, ClickRbSize ) );
-
- aTitle.ToUpperAscii();
- aTitle += String( ResId( EXPORT_DIALOG_TITLE, *pMgr ) );
- SetText( aTitle );
-
- // reading config-parameter
- sal_Int32 nMode = pConfigItem->ReadInt32( String( ResId( KEY_MODE, *pMgr ) ), 0 );
-
- ::com::sun::star::awt::Size aDefault( 10000, 10000 );
- ::com::sun::star::awt::Size aSize;
- aSize = pConfigItem->ReadSize( String( ResId( KEY_SIZE, *pMgr ) ), aDefault );
-
- aMtfSizeX.SetDefaultUnit( FUNIT_MM );
- aMtfSizeY.SetDefaultUnit( FUNIT_MM );
- aMtfSizeX.SetValue( aSize.Width );
- aMtfSizeY.SetValue( aSize.Height );
-
- switch ( rPara.eFieldUnit )
- {
-// case FUNIT_NONE :
-// case FUNIT_KM :
-// case FUNIT_PERCENT :
-// case FUNIT_CUSTOM :
-// case FUNIT_MILE :
-// case FUNIT_FOOT :
- case FUNIT_MM :
- case FUNIT_CM :
- case FUNIT_M :
- case FUNIT_TWIP :
- case FUNIT_POINT :
- case FUNIT_PICA :
- case FUNIT_INCH :
- case FUNIT_100TH_MM :
- {
- aMtfSizeX.SetUnit( rPara.eFieldUnit );
- aMtfSizeY.SetUnit( rPara.eFieldUnit );
- }
- break;
- default:
- break; // -Wall Multiple values not handled.
- }
-
- switch ( nMode )
- {
- case 1 :
- {
- aRbSize.Check( TRUE );
- ClickRbSize( NULL );
- }
- break;
-
- default :
- {
- aRbOriginal.Check( TRUE );
- ClickRbOriginal( NULL );
- }
- break;
- }
-}
-
-DlgExportVec::~DlgExportVec()
-{
- delete pConfigItem;
-}
-/*************************************************************************
-|*
-|* Speichert eingestellte Werte in ini-Datei
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportVec, OK, void *, EMPTYARG )
-{
- // Config-Parameter schreiben
- ::com::sun::star::awt::Size aSize(
- static_cast<long>(MetricField::ConvertDoubleValue( static_cast<double>(aMtfSizeX.GetValue()), 2, aMtfSizeX.GetUnit(), MAP_100TH_MM )),
- static_cast<long>(MetricField::ConvertDoubleValue( static_cast<double>(aMtfSizeY.GetValue()), 2, aMtfSizeY.GetUnit(), MAP_100TH_MM )) );
-
- sal_Int32 nMode;
- if ( aRbSize.IsChecked() )
- nMode = 1;
- else
- nMode = 0;
-
- pConfigItem->WriteInt32( String( ResId( KEY_MODE, *pMgr ) ), nMode );
- pConfigItem->WriteSize( String( ResId( KEY_SIZE, *pMgr ) ), aSize );
- rFltCallPara.aFilterData = pConfigItem->GetFilterData();
- EndDialog( RET_OK );
-
- return 0;
-}
-
-/*************************************************************************
-|*
-|* Enabled/Disabled Controls
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportVec, ClickRbOriginal, void*, EMPTYARG )
-{
- aGrpSize.Disable();
- aFtSizeX.Disable();
- aMtfSizeX.Disable();
- aFtSizeY.Disable();
- aMtfSizeY.Disable();
-
- return 0;
-}
-
-
-/*************************************************************************
-|*
-|* Enabled/Disabled Controls
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportVec, ClickRbSize, void*, EMPTYARG )
-{
- aGrpSize.Enable();
- aFtSizeX.Enable();
- aMtfSizeX.Enable();
- aFtSizeY.Enable();
- aMtfSizeY.Enable();
-
- return 0;
-}
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter.vcl/filter/dlgexpor.hrc b/svtools/source/filter.vcl/filter/dlgexpor.hrc
deleted file mode 100644
index 69870c9b00b0..000000000000
--- a/svtools/source/filter.vcl/filter/dlgexpor.hrc
+++ /dev/null
@@ -1,58 +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.
- *
- ************************************************************************/
-#include <svtools/svtools.hrc>
-
-#define BTN_OK_PIX 1
-#define BTN_CANCEL_PIX 1
-#define BTN_HELP_PIX 1
-#define CBX_RES_PIX 1
-#define CBX_SIZE_PIX 2
-#define CBX_RLE 3
-#define CBB_RES_PIX 1
-#define LB_COLORS 1
-#define MTF_SIZEX_PIX 1
-#define MTF_SIZEY_PIX 2
-#define FT_SIZEX_PIX 1
-#define FT_SIZEY_PIX 2
-#define GRP_MODE_PIX 1
-#define GRP_COLORS 4
-#define RB_ORIGINAL_PIX 1
-#define RB_RES_PIX 2
-#define RB_SIZE_PIX 3
-
-#define BTN_OK_VEC 1
-#define BTN_CANCEL_VEC 1
-#define BTN_HELP_VEC 1
-#define CBX_SIZE_VEC 2
-#define MTF_SIZEX_VEC 1
-#define MTF_SIZEY_VEC 2
-#define FT_SIZEX_VEC 1
-#define FT_SIZEY_VEC 2
-#define GRP_SIZE_VEC 1
-#define GRP_MODE_VEC 2
-#define RB_ORIGINAL_VEC 1
-#define RB_SIZE_VEC 2
diff --git a/svtools/source/filter.vcl/filter/dlgexpor.hxx b/svtools/source/filter.vcl/filter/dlgexpor.hxx
deleted file mode 100644
index 4c8b926335cd..000000000000
--- a/svtools/source/filter.vcl/filter/dlgexpor.hxx
+++ /dev/null
@@ -1,129 +0,0 @@
-/* -*- 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 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef _DLGEXPOR_HXX_
-#define _DLGEXPOR_HXX_
-
-#include <svtools/fltcall.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-#include <vcl/lstbox.hxx>
-
-/*************************************************************************
-|*
-|* Dialog zum Einstellen von Filteroptionen bei Pixelformaten
-|*
-\************************************************************************/
-
-class FilterConfigItem;
-class DlgExportPix : public ModalDialog
-{
-private:
-
- FltCallDialogParameter& rFltCallPara;
-
- OKButton aBtnOK;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
-
- ListBox aLbColors;
- CheckBox aCbxRLE;
- FixedLine aGrpColors;
-
- RadioButton aRbOriginal;
- RadioButton aRbRes;
- RadioButton aRbSize;
- FixedText aFtSizeX;
- MetricField aMtfSizeX;
- FixedText aFtSizeY;
- MetricField aMtfSizeY;
- FixedLine aGrpMode;
- ComboBox aCbbRes;
-
- FilterConfigItem* pConfigItem;
- ResMgr* pMgr;
-
- String aExt;
-
- DECL_LINK( OK, void* p );
- DECL_LINK( ClickRbOriginal,void* p );
- DECL_LINK( ClickRbRes,void* p );
- DECL_LINK( ClickRbSize,void* p );
- DECL_LINK( SelectLbColors, void* p );
-
-public:
- DlgExportPix( FltCallDialogParameter& rPara );
- ~DlgExportPix();
-};
-
-
-/*************************************************************************
-|*
-|* Dialog zum Einstellen von Filteroptionen bei Vektorformaten
-|*
-\************************************************************************/
-class DlgExportVec : public ModalDialog
-{
-private:
-
- FltCallDialogParameter& rFltCallPara;
-
- OKButton aBtnOK;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
-
- RadioButton aRbOriginal;
- RadioButton aRbSize;
- FixedLine aGrpMode;
-
- FixedText aFtSizeX;
- MetricField aMtfSizeX;
- FixedText aFtSizeY;
- MetricField aMtfSizeY;
- FixedLine aGrpSize;
-
- FilterConfigItem* pConfigItem;
- ResMgr* pMgr;
-
- String aExt;
-
- DECL_LINK( OK, void* p );
- DECL_LINK( ClickRbOriginal,void* p );
- DECL_LINK( ClickRbSize,void* p );
-
-public:
- DlgExportVec( FltCallDialogParameter& rPara );
- ~DlgExportVec();
-};
-
-#endif // _DLGEXPOR_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter.vcl/filter/dlgexpor.src b/svtools/source/filter.vcl/filter/dlgexpor.src
deleted file mode 100644
index f1e63268fb22..000000000000
--- a/svtools/source/filter.vcl/filter/dlgexpor.src
+++ /dev/null
@@ -1,276 +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.
- *
- ************************************************************************/
-
-
-#include "dlgexpor.hrc"
-
-ModalDialog DLG_EXPORT_PIX
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 178 , 135 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- FixedLine GRP_COLORS
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 110 , 8 ) ;
- Text [ en-US ] = "Color resolution" ;
- };
- ListBox LB_COLORS
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 98 , 90 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- AutoHScroll = TRUE ;
- StringList [ en-US ] =
- {
- < "Original" ; Default ; > ;
- < "1 Bit - Threshold Value" ; Default ; > ;
- < "1 Bit - Dithering" ; Default ; > ;
- < "4 Bit - Grayscale" ; Default ; > ;
- < "4 Bit - Color Palette" ; Default ; > ;
- < "8 Bit - Grayscales" ; Default ; > ;
- < "8 Bit - Color Palette" ; Default ; > ;
- < "24 Bit - True Colors" ; Default ; > ;
- };
- };
- CheckBox CBX_RLE
- {
- Pos = MAP_APPFONT ( 12 , 31 ) ;
- Size = MAP_APPFONT ( 98 , 12 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "RLE coding" ;
- };
- FixedLine GRP_MODE_PIX
- {
- Pos = MAP_APPFONT ( 6 , 48 ) ;
- Size = MAP_APPFONT ( 110 , 8 ) ;
- Text [ en-US ] = "Mode" ;
- };
- RadioButton RB_ORIGINAL_PIX
- {
- Pos = MAP_APPFONT ( 12 , 59 ) ;
- Size = MAP_APPFONT ( 98 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Original" ;
- };
- RadioButton RB_RES_PIX
- {
- Pos = MAP_APPFONT ( 12 , 73 ) ;
- Size = MAP_APPFONT ( 55 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Resolution" ;
- };
- ComboBox CBB_RES_PIX
- {
- Pos = MAP_APPFONT ( 70 , 73 ) ;
- Size = MAP_APPFONT ( 40 , 50 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- StringList =
- {
- "75 DPI" ;
- "150 DPI" ;
- "300 DPI" ;
- "600 DPI" ;
- };
- };
- RadioButton RB_SIZE_PIX
- {
- Pos = MAP_APPFONT ( 12 , 87 ) ;
- Size = MAP_APPFONT ( 98 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Size" ;
- };
- MetricField MTF_SIZEX_PIX
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 60 , 101 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 100 ;
- Maximum = 99999 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- First = 100 ;
- Last = 99999 ;
- SpinSize = 100 ;
- };
- FixedText FT_SIZEX_PIX
- {
- Pos = MAP_APPFONT ( 18 , 102 ) ;
- Size = MAP_APPFONT ( 41 , 10 ) ;
- Text [ en-US ] = "Width" ;
- };
- MetricField MTF_SIZEY_PIX
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 60 , 117 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 100 ;
- Maximum = 99999 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- First = 100 ;
- Last = 99999 ;
- SpinSize = 100 ;
- };
- FixedText FT_SIZEY_PIX
- {
- Pos = MAP_APPFONT ( 18 , 118 ) ;
- Size = MAP_APPFONT ( 41 , 10 ) ;
- Text [ en-US ] = "Height" ;
- };
- OKButton BTN_OK_PIX
- {
- Pos = MAP_APPFONT ( 122 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL_PIX
- {
- Pos = MAP_APPFONT ( 122 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP_PIX
- {
- Pos = MAP_APPFONT ( 122 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
-};
-ModalDialog DLG_EXPORT_VEC
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 178 , 89 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
-
- FixedLine GRP_MODE_VEC
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 110 , 8 ) ;
- Text [ en-US ] = "Mode" ;
- };
- RadioButton RB_ORIGINAL_VEC
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 98 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Original" ;
- };
- RadioButton RB_SIZE_VEC
- {
- Pos = MAP_APPFONT ( 12 , 28 ) ;
- Size = MAP_APPFONT ( 98 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Size" ;
- };
- FixedLine GRP_SIZE_VEC
- {
- Pos = MAP_APPFONT ( 6 , 44 ) ;
- Size = MAP_APPFONT ( 110 , 8 ) ;
- Text [ en-US ] = "Size" ;
- };
- FixedText FT_SIZEX_VEC
- {
- Pos = MAP_APPFONT ( 12 , 56 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- Text [ en-US ] = "Width" ;
- };
- MetricField MTF_SIZEX_VEC
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 60 , 55 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 100 ;
- Maximum = 99999 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- First = 100 ;
- Last = 99999 ;
- SpinSize = 100 ;
- };
- FixedText FT_SIZEY_VEC
- {
- Pos = MAP_APPFONT ( 12 , 72 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- Text [ en-US ] = "Height" ;
- };
- MetricField MTF_SIZEY_VEC
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 60 , 71 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 100 ;
- Maximum = 99999 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- First = 100 ;
- Last = 99999 ;
- SpinSize = 100 ;
- };
- OKButton BTN_OK_VEC
- {
- Pos = MAP_APPFONT ( 122 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL_VEC
- {
- Pos = MAP_APPFONT ( 122 , 24 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP_VEC
- {
- Pos = MAP_APPFONT ( 122 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
-};
diff --git a/svtools/source/filter.vcl/filter/exportdialog.cxx b/svtools/source/filter.vcl/filter/exportdialog.cxx
new file mode 100644
index 000000000000..701619d31f6c
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/exportdialog.cxx
@@ -0,0 +1,1513 @@
+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svtools.hxx"
+
+#ifndef GCC
+# pragma hdrstop
+#endif
+
+#include <tools/ref.hxx>
+#include <tools/stream.hxx>
+#include <svtools/filter.hxx>
+#include <svtools/FilterConfigItem.hxx>
+#include <com/sun/star/io/XStream.hpp>
+#include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/frame/XController.hpp>
+#include <com/sun/star/drawing/XDrawView.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/graphic/XPrimitiveFactory2D.hpp>
+#include <com/sun/star/geometry/AffineMatrix2D.hpp>
+#include <com/sun/star/document/XExporter.hpp>
+#include <com/sun/star/document/XFilter.hpp>
+#include <unotools/streamwrap.hxx>
+#include <vcl/msgbox.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/outdev.hxx>
+#include <vcl/graph.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include "exportdialog.hxx"
+#include "exportdialog.hrc"
+
+#define FORMAT_UNKNOWN 0
+#define FORMAT_JPG 1
+#define FORMAT_PNG 2
+#define FORMAT_BMP 3
+#define FORMAT_GIF 4
+#define FORMAT_PBM 5
+#define FORMAT_PGM 6
+#define FORMAT_PPM 7
+#define FORMAT_PCT 8
+#define FORMAT_RAS 9
+#define FORMAT_TIF 10
+#define FORMAT_XPM 11
+#define FORMAT_WMF 12
+#define FORMAT_EMF 13
+#define FORMAT_EPS 14
+#define FORMAT_MET 15
+#define FORMAT_SVG 16
+#define FORMAT_SVM 17
+
+#define UNIT_DEFAULT -1
+#define UNIT_INCH 0
+#define UNIT_CM 1
+#define UNIT_MM 2
+#define UNIT_POINT 3
+#define UNIT_PIXEL 4
+#define UNIT_MAX_ID UNIT_PIXEL
+
+using namespace ::com::sun::star;
+
+static sal_Int16 GetFilterFormat( String& rExt )
+{
+ sal_Int16 nFormat = FORMAT_UNKNOWN;
+ ByteString aExt( rExt, RTL_TEXTENCODING_UTF8 );
+ if ( aExt.Equals( "JPG" ) )
+ nFormat = FORMAT_JPG;
+ else if ( aExt.Equals( "PNG" ) )
+ nFormat = FORMAT_PNG;
+ else if ( aExt.Equals( "BMP" ) )
+ nFormat = FORMAT_BMP;
+ else if ( aExt.Equals( "GIF" ) )
+ nFormat = FORMAT_GIF;
+ else if ( aExt.Equals( "PBM" ) )
+ nFormat = FORMAT_PBM;
+ else if ( aExt.Equals( "PGM" ) )
+ nFormat = FORMAT_PGM;
+ else if ( aExt.Equals( "PPM" ) )
+ nFormat = FORMAT_PPM;
+ else if ( aExt.Equals( "PCT" ) )
+ nFormat = FORMAT_PCT;
+ else if ( aExt.Equals( "RAS" ) )
+ nFormat = FORMAT_RAS;
+ else if ( aExt.Equals( "TIF" ) )
+ nFormat = FORMAT_TIF;
+ else if ( aExt.Equals( "XPM" ) )
+ nFormat = FORMAT_XPM;
+ else if ( aExt.Equals( "WMF" ) )
+ nFormat = FORMAT_WMF;
+ else if ( aExt.Equals( "EMF" ) )
+ nFormat = FORMAT_EMF;
+ else if ( aExt.Equals( "EPS" ) )
+ nFormat = FORMAT_EPS;
+ else if ( aExt.Equals( "MET" ) )
+ nFormat = FORMAT_MET;
+ else if ( aExt.Equals( "SVG" ) )
+ nFormat = FORMAT_SVG;
+ else if ( aExt.Equals( "SVM" ) )
+ nFormat = FORMAT_SVM;
+ return nFormat;
+}
+
+static MapUnit GetMapUnit( sal_Int32 nUnit )
+{
+ MapUnit aMapUnit( MAP_PIXEL );
+ switch( nUnit )
+ {
+ case UNIT_INCH : aMapUnit = MAP_INCH; break;
+ case UNIT_CM : aMapUnit = MAP_CM; break;
+ case UNIT_MM : aMapUnit = MAP_MM; break;
+ case UNIT_POINT : aMapUnit = MAP_POINT; break;
+ case UNIT_PIXEL : aMapUnit = MAP_PIXEL; break;
+ }
+ return aMapUnit;
+}
+
+sal_Int32 ExportDialog::GetDefaultUnit()
+{
+ sal_Int32 nDefaultUnit = UNIT_CM;
+ switch( mrFltCallPara.eFieldUnit )
+ {
+// case FUNIT_NONE :
+// case FUNIT_PERCENT :
+// case FUNIT_CUSTOM :
+ default: nDefaultUnit = UNIT_CM; break;
+
+ case FUNIT_MILE : // PASSTHROUGH INTENDED
+ case FUNIT_FOOT :
+ case FUNIT_TWIP :
+ case FUNIT_PICA : nDefaultUnit = UNIT_INCH; break;
+
+ case FUNIT_KM : // PASSTHROUGH INTENDED
+ case FUNIT_M :
+ case FUNIT_100TH_MM : nDefaultUnit = UNIT_CM; break;
+
+ case FUNIT_INCH : nDefaultUnit = UNIT_INCH; break;
+ case FUNIT_CM : nDefaultUnit = UNIT_CM; break;
+ case FUNIT_MM : nDefaultUnit = UNIT_MM; break;
+ case FUNIT_POINT : nDefaultUnit = UNIT_POINT; break;
+ }
+ return nDefaultUnit;
+}
+
+static basegfx::B2DRange GetShapeRangeForXShape( const uno::Reference< drawing::XShape >& rxShape,
+ const uno::Reference< graphic::XPrimitiveFactory2D >& rxPrimitiveFactory2D, const uno::Sequence< beans::PropertyValue >& rViewInformation )
+{
+ basegfx::B2DRange aShapeRange;
+
+ const uno::Sequence< beans::PropertyValue > aParams;
+ const uno::Sequence< uno::Reference< graphic::XPrimitive2D > > aPrimitiveSequence( rxPrimitiveFactory2D->createPrimitivesFromXShape( rxShape, aParams ) );
+
+ const sal_Int32 nCount = aPrimitiveSequence.getLength();
+ for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
+ {
+ const geometry::RealRectangle2D aRect( aPrimitiveSequence[ nIndex ]->getRange( rViewInformation ) );
+ aShapeRange.expand( basegfx::B2DTuple( aRect.X1, aRect.Y1 ) );
+ aShapeRange.expand( basegfx::B2DTuple( aRect.X2, aRect.Y2 ) );
+ }
+ return aShapeRange;
+}
+
+uno::Sequence< beans::PropertyValue > ExportDialog::GetFilterData( sal_Bool bUpdateConfig )
+{
+ if ( bUpdateConfig )
+ {
+ sal_Int32 nUnit = maLbSizeX.GetSelectEntryPos();
+ if ( nUnit < 0 )
+ nUnit = UNIT_CM;
+
+ if ( ( mnInitialResolutionUnit == UNIT_DEFAULT ) && ( nUnit == GetDefaultUnit() ) )
+ nUnit = UNIT_DEFAULT;
+
+ // updating ui configuration
+ if ( mbIsPixelFormat )
+ {
+ if ( nUnit > UNIT_MAX_ID )
+ nUnit = UNIT_PIXEL;
+
+ sal_Int32 nResolution = maNfResolution.GetValue();
+ if ( nResolution < 1 )
+ nResolution = 96;
+
+ mpOptionsItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportUnit" ) ), nUnit );
+ mpOptionsItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportResolution" ) ), nResolution );
+ mpOptionsItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportResolutionUnit" ) ), maLbResolution.GetSelectEntryPos() );
+ }
+ else
+ {
+ if ( nUnit >= UNIT_PIXEL )
+ nUnit = UNIT_CM;
+
+ mpOptionsItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "VectorExportUnit" ) ), nUnit );
+ }
+ }
+
+ FilterConfigItem* pFilterOptions;
+ if ( bUpdateConfig )
+ pFilterOptions = mpFilterOptionsItem;
+ else
+ {
+ uno::Sequence< beans::PropertyValue > aFilterData( mpFilterOptionsItem->GetFilterData() );
+ pFilterOptions = new FilterConfigItem( &aFilterData );
+ }
+
+ const String sLogicalWidth( String( RTL_CONSTASCII_USTRINGPARAM( "LogicalWidth" ) ) );
+ const String sLogicalHeight( String( RTL_CONSTASCII_USTRINGPARAM( "LogicalHeight" ) ) );
+ if ( mbIsPixelFormat )
+ {
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelWidth" ) ), static_cast< sal_Int32 >( maSize.Width ) );
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelHeight" ) ), static_cast< sal_Int32 >( maSize.Height ) );
+ if ( maResolution.Width && maResolution.Height )
+ {
+ const double f100thmmPerPixelX = 100000.0 / maResolution.Width;
+ const double f100thmmPerPixelY = 100000.0 / maResolution.Height;
+ sal_Int32 nLogicalWidth = static_cast< sal_Int32 >( f100thmmPerPixelX * maSize.Width );
+ sal_Int32 nLogicalHeight= static_cast< sal_Int32 >( f100thmmPerPixelY * maSize.Height );
+ if ( nLogicalWidth && nLogicalHeight )
+ {
+ pFilterOptions->WriteInt32( sLogicalWidth, nLogicalWidth );
+ pFilterOptions->WriteInt32( sLogicalHeight, nLogicalHeight );
+ }
+ }
+ }
+ else
+ {
+ pFilterOptions->WriteInt32( sLogicalWidth, static_cast< sal_Int32 >( maSize.Width ) );
+ pFilterOptions->WriteInt32( sLogicalHeight, static_cast< sal_Int32 >( maSize.Height ) );
+ }
+ switch ( mnFormat )
+ {
+ case FORMAT_JPG :
+ {
+ sal_Int32 nColor = maLbColorDepth.GetSelectEntryPos();
+ if ( nColor == 1 )
+ nColor = 0;
+ else
+ nColor = 1;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ColorMode" ) ), nColor );
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), static_cast< sal_Int32 >( maSbCompression.GetThumbPos() ) );
+ }
+ break;
+
+ case FORMAT_PNG :
+ {
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) ), static_cast< sal_Int32 >( maSbCompression.GetThumbPos() ) );
+ sal_Int32 nInterlace = 0;
+ if ( maCbInterlaced.IsChecked() )
+ nInterlace++;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), nInterlace );
+ }
+ break;
+
+ case FORMAT_BMP :
+ {
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Color" ) ), maLbColorDepth.GetSelectEntryPos() + 1 );
+ pFilterOptions->WriteBool( String( RTL_CONSTASCII_USTRINGPARAM( "RLE_Coding" ) ), maCbRLEEncoding.IsChecked() );
+ }
+ break;
+
+ case FORMAT_GIF :
+ {
+ sal_Int32 nValue = 0;
+ if ( maCbInterlaced.IsChecked() )
+ nValue++;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), nValue );
+
+ nValue = 0;
+ if ( maCbSaveTransparency.IsChecked() )
+ nValue++;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Translucent" ) ), nValue );
+ }
+ break;
+
+ case FORMAT_PBM :
+ case FORMAT_PGM :
+ case FORMAT_PPM :
+ {
+ sal_Int32 nFormat = 0;
+ if ( maRbText.IsChecked() )
+ nFormat++;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "FileFormat" ) ), nFormat );
+ }
+ break;
+
+ case FORMAT_EPS :
+ {
+ sal_Int32 nCheck = 0;
+ if ( maCbEPSPreviewTIFF.IsChecked() )
+ nCheck++;
+ if ( maCbEPSPreviewEPSI.IsChecked() )
+ nCheck += 2;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Preview" ) ), nCheck );
+
+ nCheck = 1;
+ if ( maRbEPSLevel2.IsChecked() )
+ nCheck++;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ), nCheck );
+
+ nCheck = 1;
+ if ( maRbEPSColorFormat2.IsChecked() )
+ nCheck++;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ColorFormat" ) ), nCheck );
+
+ nCheck = 1;
+ if ( maRbEPSCompressionNone.IsChecked() )
+ nCheck++;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "CompressionMode" ) ), nCheck );
+ }
+ break;
+ }
+
+ uno::Sequence< beans::PropertyValue > aRet( pFilterOptions->GetFilterData() );
+ if ( bUpdateConfig == sal_False )
+ delete pFilterOptions;
+ return aRet;
+}
+
+//
+awt::Size ExportDialog::GetOriginalSize()
+{
+ basegfx::B2DRange aShapesRange;
+
+ if ( mxPage.is () )
+ {
+ uno::Reference< beans::XPropertySet > xPagePropSet( mxPage, uno::UNO_QUERY );
+ if ( xPagePropSet.is() )
+ {
+ sal_Int32 nWidth = 0;
+ sal_Int32 nHeight= 0;
+ com::sun::star::uno::Any aAny;
+ aAny = xPagePropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Width" ) ) );
+ aAny >>= nWidth;
+ aAny = xPagePropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) );
+ aAny >>= nHeight;
+ aShapesRange = basegfx::B2DRange( 0, 0, nWidth, nHeight );
+ }
+ }
+ else
+ {
+ uno::Reference< graphic::XPrimitiveFactory2D > xPrimitiveFactory(
+ mxMgr->createInstance( String( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.graphic.PrimitiveFactory2D" ) ) ), uno::UNO_QUERY );
+ if ( xPrimitiveFactory.is() )
+ {
+ basegfx::B2DHomMatrix aViewTransformation( Application::GetDefaultDevice()->GetViewTransformation() );
+ com::sun::star::geometry::AffineMatrix2D aTransformation;
+ aTransformation.m00 = aViewTransformation.get(0,0);
+ aTransformation.m01 = aViewTransformation.get(0,1);
+ aTransformation.m02 = aViewTransformation.get(0,2);
+ aTransformation.m10 = aViewTransformation.get(1,0);
+ aTransformation.m11 = aViewTransformation.get(1,1);
+ aTransformation.m12 = aViewTransformation.get(1,2);
+
+ const rtl::OUString sViewTransformation( RTL_CONSTASCII_USTRINGPARAM( "ViewTransformation" ) );
+ uno::Sequence< beans::PropertyValue > aViewInformation( 1 );
+ aViewInformation[ 0 ].Value <<= aTransformation;
+ aViewInformation[ 0 ].Name = sViewTransformation;
+
+ if ( mxShape.is() )
+ aShapesRange = GetShapeRangeForXShape( mxShape, xPrimitiveFactory, aViewInformation );
+ else if ( mxShapes.is() )
+ {
+ const sal_Int32 nCount = mxShapes->getCount();
+ for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
+ {
+ uno::Reference< drawing::XShape > xShape;
+ mxShapes->getByIndex( nIndex ) >>= xShape;
+ aShapesRange.expand( GetShapeRangeForXShape( xShape, xPrimitiveFactory, aViewInformation ) );
+ }
+ }
+ }
+ }
+ return awt::Size( static_cast<sal_Int32>(aShapesRange.getWidth()), static_cast<sal_Int32>(aShapesRange.getHeight()) );
+}
+
+void ExportDialog::GetGraphicSource()
+{
+ if ( mxSourceDocument.is() )
+ {
+ uno::Reference< frame::XModel > xModel( mxSourceDocument, uno::UNO_QUERY );
+ if ( xModel.is() )
+ {
+ uno::Reference< frame::XController > xController( xModel->getCurrentController() );
+ if ( xController.is() )
+ {
+ if ( mbExportSelection ) // check if there is a selection
+ {
+ uno::Reference< view::XSelectionSupplier > xSelectionSupplier( xController, uno::UNO_QUERY );
+ if ( xSelectionSupplier.is() )
+ {
+ uno::Any aAny( xSelectionSupplier->getSelection() );
+ if ( ! ( aAny >>= mxShapes ) )
+ aAny >>= mxShape;
+ }
+ }
+ if ( !mxShape.is() && !mxShapes.is() )
+ {
+ uno::Reference< drawing::XDrawView > xDrawView( xController, uno::UNO_QUERY );
+ if ( xDrawView.is() )
+ {
+ uno::Reference< drawing::XDrawPage > xCurrentPage( xDrawView->getCurrentPage() );
+ if ( xCurrentPage.is() )
+ {
+ mxPage = xCurrentPage; // exporting whole page
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+sal_Bool ExportDialog::GetGraphicStream()
+{
+ sal_Bool bRet = sal_False;
+
+ if ( !IsTempExportAvailable() )
+ {
+ delete mpTempStream, mpTempStream = new SvMemoryStream();
+ maBitmap = Bitmap();
+ return bRet;
+ }
+
+ sal_Bool bRecreateOutputStream = mpTempStream->Tell() == 0;
+
+ static uno::Sequence< beans::PropertyValue > aOldFilterData;
+ uno::Sequence< beans::PropertyValue > aNewFilterData( GetFilterData( sal_False ) );
+ if ( aOldFilterData != aNewFilterData )
+ {
+ aOldFilterData = aNewFilterData;
+ bRecreateOutputStream = sal_True;
+ }
+ try
+ {
+ if ( bRecreateOutputStream )
+ {
+ delete mpTempStream, mpTempStream = new SvMemoryStream();
+ maBitmap = Bitmap();
+
+ uno::Reference < io::XStream > xStream( new utl::OStreamWrapper( *mpTempStream ) );
+ uno::Reference < io::XOutputStream > xOutputStream( xStream->getOutputStream() );
+
+ uno::Reference< document::XExporter > xGraphicExporter(
+ mxMgr->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GraphicExportFilter") ) ), uno::UNO_QUERY_THROW );
+ uno::Reference< document::XFilter > xFilter( xGraphicExporter, uno::UNO_QUERY_THROW );
+
+ sal_Int32 nProperties = 2;
+ uno::Sequence< beans::PropertyValue > aFilterData( nProperties );
+
+
+ rtl::OUString sFormat( maExt );
+ uno::Sequence< beans::PropertyValue > aDescriptor( 3 );
+ aDescriptor[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OutputStream") );
+ aDescriptor[0].Value <<= xOutputStream;
+ aDescriptor[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FilterName") );
+ aDescriptor[1].Value <<= sFormat;
+ aDescriptor[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FilterData") );
+ aDescriptor[2].Value <<= aNewFilterData;
+
+ uno::Reference< lang::XComponent > xSourceDoc;
+ if ( mxPage.is() )
+ xSourceDoc = uno::Reference< lang::XComponent >( mxPage, uno::UNO_QUERY_THROW );
+ else if ( mxShapes.is() )
+ xSourceDoc = uno::Reference< lang::XComponent >( mxShapes, uno::UNO_QUERY_THROW );
+ else if ( mxShape.is() )
+ xSourceDoc = uno::Reference< lang::XComponent >( mxShape, uno::UNO_QUERY_THROW );;
+ if ( xSourceDoc.is() )
+ {
+ xGraphicExporter->setSourceDocument( xSourceDoc );
+ xFilter->filter( aDescriptor );
+ bRet = sal_True;
+
+ if ( mnFormat == FORMAT_JPG )
+ {
+ mpTempStream->Seek( STREAM_SEEK_TO_BEGIN );
+ maBitmap = GetGraphicBitmap( *mpTempStream );
+ mpTempStream->Seek( STREAM_SEEK_TO_END );
+ }
+ }
+ }
+ else
+ bRet = sal_True;
+ }
+ catch( uno::Exception& )
+ {
+
+ // ups
+
+ }
+ return bRet;
+}
+
+Bitmap ExportDialog::GetGraphicBitmap( SvStream& rInputStream )
+{
+ Bitmap aRet;
+ Graphic aGraphic;
+ GraphicFilter aFilter( sal_False );
+ if ( aFilter.ImportGraphic( aGraphic, String(), rInputStream, GRFILTER_FORMAT_NOTFOUND, NULL, 0, NULL ) == GRFILTER_OK )
+ {
+ aRet = aGraphic.GetBitmap();
+ }
+ return aRet;
+}
+
+sal_uInt32 ExportDialog::GetRawFileSize() const
+{
+ sal_uInt64 nRawFileSize = 0;
+ if ( mbIsPixelFormat )
+ {
+ sal_Int32 nBitsPerPixel = 24;
+ String aEntry( maLbColorDepth.GetSelectEntry() );
+ if ( ms1BitTreshold == aEntry )
+ nBitsPerPixel = 1;
+ else if ( ms1BitDithered == aEntry )
+ nBitsPerPixel = 1;
+ else if ( ms4BitGrayscale == aEntry )
+ nBitsPerPixel = 4;
+ else if ( ms4BitColorPalette == aEntry )
+ nBitsPerPixel = 8;
+ else if ( ms8BitGrayscale == aEntry )
+ nBitsPerPixel = 8;
+ else if ( ms8BitColorPalette == aEntry )
+ nBitsPerPixel = 8;
+ else if ( ms24BitColor == aEntry )
+ nBitsPerPixel = 24;
+
+ if ( mbIsPixelFormat )
+ {
+ nRawFileSize = ( maSize.Width * nBitsPerPixel + 7 ) &~ 7; // rounding up to 8 bits
+ nRawFileSize /= 8; // in bytes
+ nRawFileSize *= maSize.Height;
+ }
+ if ( nRawFileSize > SAL_MAX_UINT32 )
+ nRawFileSize = 0;
+ }
+ return static_cast< sal_uInt32 >( nRawFileSize );
+}
+
+// checks if the source dimension/resolution is not too big
+// to determine the exact graphic output size and preview for jpg
+sal_Bool ExportDialog::IsTempExportAvailable() const
+{
+ return GetRawFileSize() < static_cast< sal_uInt32 >( mnMaxFilesizeForRealtimePreview );
+}
+
+ExportDialog::ExportDialog( FltCallDialogParameter& rPara,
+ const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > rxMgr,
+ const com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rxSourceDocument,
+ sal_Bool bExportSelection, sal_Bool bIsPixelFormat ) :
+ ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT, *rPara.pResMgr ) ),
+ mrFltCallPara ( rPara ),
+ mpMgr ( rPara.pResMgr ),
+ mxMgr ( rxMgr ),
+ mxSourceDocument ( rxSourceDocument ),
+ maFlExportSize ( this, ResId( FL_EXPORT_SIZE, *rPara.pResMgr ) ),
+ maFtSizeX ( this, ResId( FT_SIZEX, *rPara.pResMgr ) ),
+ maMfSizeX ( this, ResId( MF_SIZEX, *rPara.pResMgr ) ),
+ maLbSizeX ( this, ResId( LB_SIZEX, *rPara.pResMgr ) ),
+ maFtSizeY ( this, ResId( FT_SIZEY, *rPara.pResMgr ) ),
+ maMfSizeY ( this, ResId( MF_SIZEY, *rPara.pResMgr ) ),
+ maLbSizeY ( this, ResId( LB_SIZEY, *rPara.pResMgr ) ),
+ maFtResolution ( this, ResId( FT_RESOLUTION, *rPara.pResMgr ) ),
+ maNfResolution ( this, ResId( NF_RESOLUTION, *rPara.pResMgr ) ),
+ maLbResolution ( this, ResId( LB_RESOLUTION, *rPara.pResMgr ) ),
+ maFlColorDepth ( this, ResId( FL_COLOR_DEPTH, *rPara.pResMgr ) ),
+ maLbColorDepth ( this, ResId( LB_COLOR_DEPTH, *rPara.pResMgr ) ),
+ maFlJPGQuality ( this, ResId( FL_JPG_QUALITY, *rPara.pResMgr ) ),
+ maFlMode ( this, ResId( FL_MODE, *rPara.pResMgr ) ),
+ maFlPBMOptions ( this, ResId( FL_PBM_OPTIONS, *rPara.pResMgr ) ),
+ maSbCompression ( this, ResId( SB_COMPRESSION, *rPara.pResMgr ) ),
+ maNfCompression ( this, ResId( NF_COMPRESSION, *rPara.pResMgr ) ),
+ maFtJPGMin ( this, ResId( FT_JPG_MIN, *rPara.pResMgr ) ),
+ maFtJPGMax ( this, ResId( FT_JPG_MAX, *rPara.pResMgr ) ),
+ maFtPNGMin ( this, ResId( FT_PNG_MIN, *rPara.pResMgr ) ),
+ maFtPNGMax ( this, ResId( FT_PNG_MAX, *rPara.pResMgr ) ),
+ maCbJPGPreview ( this, ResId( CB_JPG_PREVIEW, *rPara.pResMgr ) ),
+ maCbInterlaced ( this, ResId( CB_INTERLACED, *rPara.pResMgr ) ),
+ maCbRLEEncoding ( this, ResId( CB_RLE_ENCODING, *rPara.pResMgr ) ),
+ maFlGIFDrawingObjects ( this, ResId( FL_GIF_DRAWING_OBJECTS, *rPara.pResMgr ) ),
+ maCbSaveTransparency ( this, ResId( CB_SAVE_TRANSPARENCY, *rPara.pResMgr ) ),
+ maRbBinary ( this, ResId( RB_BINARY, *rPara.pResMgr ) ),
+ maRbText ( this, ResId( RB_TEXT, *rPara.pResMgr ) ),
+ maFlEPSPreview ( this, ResId( FL_EPS_PREVIEW, *rPara.pResMgr ) ),
+ maCbEPSPreviewTIFF ( this, ResId( CB_EPS_PREVIEW_TIFF, *rPara.pResMgr ) ),
+ maCbEPSPreviewEPSI ( this, ResId( CB_EPS_PREVIEW_EPSI, *rPara.pResMgr ) ),
+ maFlEPSVersion ( this, ResId( FL_EPS_VERSION, *rPara.pResMgr ) ),
+ maRbEPSLevel1 ( this, ResId( RB_EPS_LEVEL1, *rPara.pResMgr ) ),
+ maRbEPSLevel2 ( this, ResId( RB_EPS_LEVEL2, *rPara.pResMgr ) ),
+ maFlEPSColorFormat ( this, ResId( FL_EPS_COLOR_FORMAT, *rPara.pResMgr ) ),
+ maRbEPSColorFormat1 ( this, ResId( RB_EPS_COLOR_FORMAT1, *rPara.pResMgr ) ),
+ maRbEPSColorFormat2 ( this, ResId( RB_EPS_COLOR_FORMAT2, *rPara.pResMgr ) ),
+ maFlCompression ( this, ResId( FL_COMPRESSION, *rPara.pResMgr ) ),
+ maRbEPSCompressionLZW ( this, ResId( RB_EPS_COMPRESSION_LZW, *rPara.pResMgr ) ),
+ maRbEPSCompressionNone ( this, ResId( RB_EPS_COMPRESSION_NONE, *rPara.pResMgr ) ),
+ maFlEstimatedSize ( this, ResId( FL_ESTIMATED_SIZE, *rPara.pResMgr ) ),
+ maFtEstimatedSize ( this, ResId( FT_ESTIMATED_SIZE, *rPara.pResMgr ) ),
+ msEstimatedSizePix1 ( ResId( STR_ESTIMATED_SIZE_PIX_1, *rPara.pResMgr ) ),
+ msEstimatedSizePix2 ( ResId( STR_ESTIMATED_SIZE_PIX_2, *rPara.pResMgr ) ),
+ msEstimatedSizeVec ( ResId( STR_ESTIMATED_SIZE_VEC, *rPara.pResMgr ) ),
+ maFlButtons ( this, ResId( FL_BUTTONS, *rPara.pResMgr ) ),
+ maFbJPGPreview ( this, ResId( FB_JPG_PREVIEW, *rPara.pResMgr ) ),
+ maSbZoom ( this, ResId( SB_ZOOM, *rPara.pResMgr ) ),
+ maNfZoom ( this, ResId( NF_ZOOM, *rPara.pResMgr ) ),
+ maSbJPGPreviewHorz ( this, ResId( SB_JPG_PREVIEW_HORZ, *rPara.pResMgr ) ),
+ maSbJPGPreviewVert ( this, ResId( SB_JPG_PREVIEW_VERT, *rPara.pResMgr ) ),
+ maBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ),
+ maBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ),
+ maBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ),
+ ms1BitTreshold ( ResId( STR_1BIT_THRESHOLD, *rPara.pResMgr ) ),
+ ms1BitDithered ( ResId( STR_1BIT_DITHERED, *rPara.pResMgr ) ),
+ ms4BitGrayscale ( ResId( STR_4BIT_GRAYSCALE, *rPara.pResMgr ) ),
+ ms4BitColorPalette ( ResId( STR_4BIT_COLOR_PALETTE, *rPara.pResMgr ) ),
+ ms8BitGrayscale ( ResId( STR_8BIT_GRAYSCALE, *rPara.pResMgr ) ),
+ ms8BitColorPalette ( ResId( STR_8BIT_COLOR_PALETTE, *rPara.pResMgr ) ),
+ ms24BitColor ( ResId( STR_24BIT_TRUE_COLOR, *rPara.pResMgr ) ),
+ maExt ( rPara.aFilterExt ),
+ mnFormat ( FORMAT_UNKNOWN ),
+ mnMaxFilesizeForRealtimePreview( 0 ),
+ mpTempStream ( new SvMemoryStream() ),
+ maOriginalSize ( awt::Size( 0, 0 ) ),
+ mbPreview ( sal_False ),
+ mbIsPixelFormat ( bIsPixelFormat ),
+ mbExportSelection ( bExportSelection ),
+ mbPreserveAspectRatio ( sal_True )
+{
+ GetGraphicSource();
+
+ maExt.ToUpperAscii();
+
+ String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/" ) );
+ mpOptionsItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
+ aFilterConfigPath.Append( maExt );
+ mpFilterOptionsItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
+
+ mnInitialResolutionUnit = mbIsPixelFormat
+ ? mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportUnit" ) ), UNIT_DEFAULT )
+ : mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "VectorExportUnit" ) ), UNIT_DEFAULT );
+
+ mnMaxFilesizeForRealtimePreview = mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "MaxFilesizeForRealtimePreview" ) ), 0 );
+ maFtEstimatedSize.SetText( String( RTL_CONSTASCII_USTRINGPARAM( " \n " ) ) );
+
+ String aTitle( maExt );
+ aTitle += String( ResId( DLG_EXPORT_TITLE, *mpMgr ) );
+ SetText( aTitle );
+
+ mnFormat = GetFilterFormat( maExt );
+
+ Size aResolution( Application::GetDefaultDevice()->LogicToPixel( Size( 100, 100 ), MAP_CM ) );
+ maResolution.Width = aResolution.Width();
+ maResolution.Height= aResolution.Height();
+ maOriginalSize = GetOriginalSize();
+ if ( bIsPixelFormat )
+ {
+ double fPixelsPer100thmm = static_cast< double >( maResolution.Width ) / 100000.0;
+ maSize = awt::Size( static_cast< sal_Int32 >( ( fPixelsPer100thmm * maOriginalSize.Width ) + 0.5 ),
+ static_cast< sal_Int32 >( ( fPixelsPer100thmm * maOriginalSize.Height ) + 0.5 ) );
+ }
+ else
+ {
+ maSize = maOriginalSize;
+ }
+
+ // Size
+ maLbSizeX.SetSelectHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maSbCompression.SetScrollHdl( LINK( this, ExportDialog, SbCompressionUpdateHdl ) );
+ maNfCompression.SetModifyHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maMfSizeX.SetModifyHdl( LINK( this, ExportDialog, UpdateHdlMtfSizeX ) );
+ maMfSizeY.SetModifyHdl( LINK( this, ExportDialog, UpdateHdlMtfSizeY ) );
+
+ maNfResolution.SetModifyHdl( LINK( this, ExportDialog, UpdateHdlNfResolution ) );
+ maLbResolution.SetSelectHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maLbColorDepth.SetSelectHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maCbInterlaced.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maCbSaveTransparency.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maCbEPSPreviewTIFF.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+ maCbEPSPreviewEPSI.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maRbEPSCompressionLZW.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+ maRbEPSCompressionNone.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maRbBinary.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+ maRbText.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+
+ // JPG Preview
+// maCbJPGPreview.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+maCbJPGPreview.Enable( sal_False );
+
+ maSbJPGPreviewVert.SetScrollHdl( LINK( this, ExportDialog, UpdateHdl ) );
+ maSbJPGPreviewHorz.SetScrollHdl( LINK( this, ExportDialog, UpdateHdl ) );
+ maSbZoom.SetScrollHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ // BMP
+ maCbRLEEncoding.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ // EPS
+ maRbEPSLevel1.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+ maRbEPSLevel2.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maBtnOK.SetClickHdl( LINK( this, ExportDialog, OK ) );
+
+ setupLayout();
+ updateControls();
+
+ FreeResource();
+}
+
+void ExportDialog::createSizeControls( vcl::RowOrColumn& rLayout )
+{
+ size_t nIndex;
+ Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
+ long nIndent = aBorder.Width();
+
+ // Size controls
+ rLayout.addWindow( &maFlExportSize );
+
+ Size aLbMax( maLbSizeX.GetSizePixel() );
+ aLbMax.Width() = Max( aLbMax.Width(), maLbResolution.GetSizePixel().Width() );
+
+ boost::shared_ptr< vcl::LabelColumn > xSizeColumns( new vcl::LabelColumn( &rLayout ) );
+ rLayout.addChild( xSizeColumns );
+
+ // row 1
+ boost::shared_ptr< vcl::RowOrColumn > xColumn( new vcl::RowOrColumn( xSizeColumns.get(), false ) );
+ xSizeColumns->addRow( &maFtSizeX, xColumn, nIndent );
+ Size aMinSize( maMfSizeX.GetSizePixel() );
+ nIndex = xColumn->addWindow( &maMfSizeX );
+ xColumn->setMinimumSize( nIndex, aMinSize );
+ nIndex = xColumn->addWindow( &maLbSizeX );
+ xColumn->setMinimumSize( nIndex, aLbMax );
+
+ // row 2
+ xColumn = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xSizeColumns.get(), false ) );
+ xSizeColumns->addRow( &maFtSizeY, xColumn, nIndent );
+ nIndex = xColumn->addWindow( &maMfSizeY );
+ xColumn->setMinimumSize( nIndex, aMinSize );
+ nIndex = xColumn->addWindow( &maLbSizeY );
+ xColumn->setMinimumSize( nIndex, aLbMax );
+
+ // row 3
+ if ( mbIsPixelFormat ) // TODO: (metafileresolutionsupport)
+ {
+ xColumn = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xSizeColumns.get(), false ) );
+ xSizeColumns->addRow( &maFtResolution, xColumn, nIndent );
+ nIndex = xColumn->addWindow( &maNfResolution );
+ xColumn->setMinimumSize( nIndex, aMinSize );
+ nIndex = xColumn->addWindow( &maLbResolution );
+ xColumn->setMinimumSize( nIndex, aLbMax );
+ }
+
+ sal_Int32 nUnit = mnInitialResolutionUnit;
+ if ( nUnit == UNIT_DEFAULT )
+ nUnit = GetDefaultUnit();
+
+ if ( !mbIsPixelFormat )
+ {
+ maLbSizeX.RemoveEntry( UNIT_PIXEL ); // removing pixel
+ if ( nUnit >= UNIT_PIXEL )
+ nUnit = UNIT_CM;
+ }
+ else if ( nUnit > UNIT_MAX_ID )
+ nUnit = UNIT_PIXEL;
+ if ( nUnit < 0 )
+ nUnit = UNIT_CM;
+ maLbSizeX.SelectEntryPos( static_cast< sal_uInt16 >( nUnit ) );
+
+ if ( mbIsPixelFormat ) // TODO: (metafileresolutionsupport) should be supported for vector formats also... this makes
+ { // sense eg for bitmap fillings in metafiles, to preserve high dpi output
+ // (atm without special vector support the bitmaps are rendered with 96dpi)
+ sal_Int32 nResolution = mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportResolution" ) ), 96 );
+ if ( nResolution < 1 )
+ nResolution = 96;
+ maNfResolution.SetValue( nResolution );
+
+ sal_Int32 nResolutionUnit = mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportResolutionUnit" ) ), 1 );
+ if ( ( nResolutionUnit < 0 ) || ( nResolutionUnit > 2 ) )
+ nResolutionUnit = 1;
+ maLbResolution.SelectEntryPos( static_cast< sal_uInt16 >( nResolutionUnit ) );
+ }
+
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+}
+
+void ExportDialog::createColorDepthControls( vcl::RowOrColumn& rLayout )
+{
+ // Color Depth
+ Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
+ long nIndent = aBorder.Width();
+
+ boost::shared_ptr< vcl::RowOrColumn > xRow( new vcl::RowOrColumn( &rLayout, false ) );
+ rLayout.addChild( xRow );
+ xRow->addWindow( &maFlColorDepth );
+
+ xRow = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( &rLayout, false ) );
+ rLayout.addChild( xRow );
+ boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) );
+ xRow->addChild( xIndenter );
+ boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maLbColorDepth );
+
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+}
+
+void ExportDialog::createScrollBar( vcl::RowOrColumn& rLayout )
+{
+ boost::shared_ptr< vcl::RowOrColumn > xRow( new vcl::RowOrColumn( &rLayout, false ) );
+ rLayout.addChild( xRow );
+
+ Size aMinSize( maSbCompression.GetSizePixel() );
+ size_t nIndex = xRow->addWindow( &maSbCompression );
+ xRow->setMinimumSize( nIndex, aMinSize );
+ aMinSize = maNfCompression.GetSizePixel();
+ nIndex = xRow->addWindow( &maNfCompression );
+ xRow->setMinimumSize( nIndex, aMinSize );
+}
+
+void ExportDialog::createFilterOptions( vcl::RowOrColumn& rLayout )
+{
+ Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
+ long nIndent = aBorder.Width();
+
+ switch( mnFormat )
+ {
+ case FORMAT_JPG :
+ {
+ sal_Int32 nColor = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ColorMode" ) ), 0 );
+ if ( nColor == 1 )
+ nColor = 0;
+ else
+ nColor = 1;
+ maLbColorDepth.InsertEntry( ms8BitGrayscale );
+ maLbColorDepth.InsertEntry( ms24BitColor );
+ maLbColorDepth.SelectEntryPos( nColor );
+ createColorDepthControls( maLayout );
+
+ rLayout.addWindow( &maFlJPGQuality );
+
+ // Quality
+ boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) );
+ rLayout.addChild( xIndenter );
+ boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ createScrollBar( *xRows.get() );
+ xRows->addWindow( &maFtJPGMin );
+ xRows->addWindow( &maFtJPGMax );
+ if ( maCbJPGPreview.IsEnabled() )
+ xRows->addWindow( &maCbJPGPreview );
+
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ sal_Int32 nQuality = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), 75 );
+ if ( ( nQuality < 1 ) || ( nQuality > 100 ) )
+ nQuality = 75;
+
+ maSbCompression.SetRangeMin( 1 );
+ maSbCompression.SetRangeMax( 100 );
+ maNfCompression.SetMin( 1 );
+ maNfCompression.SetMax( 100 );
+ maNfCompression.SetValue( nQuality );
+ maNfCompression.SetStrictFormat( sal_True );
+ if ( maCbJPGPreview.IsEnabled() )
+ maCbJPGPreview.Check( sal_False );
+ }
+ break;
+ case FORMAT_PNG :
+ {
+ rLayout.addWindow( &maFlCompression );
+
+ // Compression 1..9
+ boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) );
+ rLayout.addChild( xIndenter );
+ boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ createScrollBar( *xRows.get() );
+ xRows->addWindow( &maFtPNGMin );
+ xRows->addWindow( &maFtPNGMax );
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ // Interlaced
+ rLayout.addWindow( &maFlMode );
+ xIndenter.reset( new vcl::Indenter( &rLayout, nIndent ) );
+ rLayout.addChild( xIndenter );
+ xRows.reset( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maCbInterlaced );
+
+ xSpacer.reset( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ sal_Int32 nCompression = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) ), 6 );
+ if ( ( nCompression < 1 ) || ( nCompression > 9 ) )
+ nCompression = 6;
+ maSbCompression.SetRangeMin( 1 );
+ maSbCompression.SetRangeMax( 9 );
+ maNfCompression.SetMin( 1 );
+ maNfCompression.SetMax( 9 );
+ maNfCompression.SetValue( 9 );
+ maNfCompression.SetStrictFormat( sal_True );
+
+ maCbInterlaced.Check( mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), 0 ) != 0 );
+ }
+ break;
+ case FORMAT_BMP :
+ {
+ sal_Int32 nColor = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Color" ) ), 0 );
+ if ( nColor == 0 )
+ nColor = 6;
+ else
+ nColor--;
+ maLbColorDepth.InsertEntry( ms1BitTreshold );
+ maLbColorDepth.InsertEntry( ms1BitDithered );
+ maLbColorDepth.InsertEntry( ms4BitGrayscale );
+ maLbColorDepth.InsertEntry( ms4BitColorPalette );
+ maLbColorDepth.InsertEntry( ms8BitGrayscale );
+ maLbColorDepth.InsertEntry( ms8BitColorPalette );
+ maLbColorDepth.InsertEntry( ms24BitColor );
+ maLbColorDepth.SelectEntryPos( nColor );
+ createColorDepthControls( maLayout );
+
+ rLayout.addWindow( &maFlCompression );
+ // RLE coding
+ boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) );
+ rLayout.addChild( xIndenter );
+ boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maCbRLEEncoding );
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ maCbRLEEncoding.Check( mpFilterOptionsItem->ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "RLE_Coding" ) ), sal_True ) );
+ }
+ break;
+ case FORMAT_GIF :
+ {
+ rLayout.addWindow( &maFlMode );
+ boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) );
+ rLayout.addChild( xIndenter );
+ boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maCbInterlaced );
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ rLayout.addWindow( &maFlGIFDrawingObjects );
+ xIndenter = boost::shared_ptr< vcl::Indenter >( new vcl::Indenter( &rLayout, nIndent ) );
+ rLayout.addChild( xIndenter );
+ xRows = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maCbSaveTransparency );
+ xSpacer.reset( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ maCbInterlaced.Check( mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), 1 ) != 0 );
+ maCbSaveTransparency.Check( mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Translucent" ) ), 1 ) != 0 );
+ }
+ break;
+ case FORMAT_PBM :
+ case FORMAT_PGM :
+ case FORMAT_PPM :
+ {
+ rLayout.addWindow( &maFlJPGQuality );
+
+ // RB Binary / Text
+ boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) );
+ rLayout.addChild( xIndenter );
+ boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maRbBinary );
+ xRows->addWindow( &maRbText );
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ sal_Int32 nFormat = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "FileFormat" ) ), 1 );
+ maRbBinary.Check( nFormat == 0 );
+ maRbText.Check( nFormat != 0 );
+ }
+ break;
+ case FORMAT_EPS :
+ {
+ boost::shared_ptr< vcl::RowOrColumn > xColumns( new vcl::RowOrColumn( &rLayout, false ) );
+ rLayout.addChild( xColumns );
+ boost::shared_ptr< vcl::RowOrColumn > xLeft( new vcl::RowOrColumn( &rLayout, true ) );
+ xColumns->addChild( xLeft );
+
+ xLeft->addWindow( &maFlEPSPreview );
+ boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( xLeft.get(), nIndent ) );
+ xLeft->addChild( xIndenter );
+ boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( xLeft.get(), true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maCbEPSPreviewTIFF );
+ xRows->addWindow( &maCbEPSPreviewEPSI );
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( xLeft.get(), 2 ) );
+ xLeft->addChild( xSpacer );
+
+ xLeft->addWindow( &maFlEPSVersion );
+ xIndenter = boost::shared_ptr< vcl::Indenter >( new vcl::Indenter( xLeft.get(), nIndent ) );
+ xLeft->addChild( xIndenter );
+ xRows = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xLeft.get(), true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maRbEPSLevel1 );
+ xRows->addWindow( &maRbEPSLevel2 );
+ xSpacer.reset( new vcl::Spacer( xLeft.get(), 2 ) );
+ xLeft->addChild( xSpacer );
+
+ boost::shared_ptr< vcl::RowOrColumn > xRight( new vcl::RowOrColumn( &rLayout, true ) );
+ xColumns->addChild( xRight );
+
+ xRight->addWindow( &maFlEPSColorFormat );
+ xIndenter = boost::shared_ptr< vcl::Indenter >( new vcl::Indenter( xRight.get(), nIndent ) );
+ xRight->addChild( xIndenter );
+ xRows = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xRight.get(), true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maRbEPSColorFormat1 );
+ xRows->addWindow( &maRbEPSColorFormat2 );
+ xSpacer.reset( new vcl::Spacer( xRight.get(), 2 ) );
+ xRight->addChild( xSpacer );
+
+ xRight->addWindow( &maFlCompression );
+ xIndenter = boost::shared_ptr< vcl::Indenter >( new vcl::Indenter( xRight.get(), nIndent ) );
+ xRight->addChild( xIndenter );
+ xRows = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xRight.get(), true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maRbEPSCompressionLZW );
+ xRows->addWindow( &maRbEPSCompressionNone );
+
+ xSpacer.reset( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ sal_Int32 nPreview = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Preview" ) ), 0 );
+ sal_Int32 nVersion = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ), 2 );
+ sal_Int32 nColor = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ColorFormat" ) ), 0 );
+ sal_Int32 nCompr = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "CompressionMode" ) ), 2 );
+
+ mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "TextMode" ) ), 0 );
+
+ maCbEPSPreviewTIFF.Check( ( nPreview & 1 ) != 0 );
+ maCbEPSPreviewEPSI.Check( ( nPreview & 2 ) != 0 );
+
+ maRbEPSLevel1.Check( nVersion == 1 );
+ maRbEPSLevel2.Check( nVersion == 2 );
+
+ maRbEPSColorFormat1.Check( nColor == 1 );
+ maRbEPSColorFormat2.Check( nColor != 1 );
+
+ maRbEPSCompressionLZW.Check( nCompr == 1 );
+ maRbEPSCompressionNone.Check( nCompr != 1 );
+ }
+ break;
+ }
+}
+
+void ExportDialog::createButtons( vcl::RowOrColumn& rLayout )
+{
+ rLayout.addWindow( &maFlButtons );
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
+
+ boost::shared_ptr< vcl::RowOrColumn > xButtons( new vcl::RowOrColumn( &rLayout, false ) );
+ size_t nIndex = rLayout.addChild( xButtons );
+ rLayout.setBorders( nIndex, aBorder.Width(), 0, aBorder.Width(), aBorder.Width() );
+
+ Size aMinSize( maBtnCancel.GetSizePixel() );
+ // insert help button
+ xButtons->setMinimumSize( xButtons->addWindow( &maBtnHelp ), aMinSize );
+
+ // insert a spacer, cancel and OK buttons are right aligned
+
+ xSpacer.reset( new vcl::Spacer( xButtons.get(), 2 ) );
+ xButtons->addChild( xSpacer );
+ xButtons->setMinimumSize( xButtons->addWindow( &maBtnOK ), aMinSize );
+ xButtons->setMinimumSize( xButtons->addWindow( &maBtnCancel ), aMinSize );
+}
+
+void ExportDialog::setupLayout()
+{
+ Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
+ maLayout.setParentWindow( this );
+ maLayout.setOuterBorder( aBorder.Width() );
+
+ createSizeControls( maLayout );
+ createFilterOptions( maLayout );
+
+ if ( mnMaxFilesizeForRealtimePreview || mbIsPixelFormat )
+ {
+ maLayout.addWindow( &maFlEstimatedSize );
+ maLayout.addWindow( &maFtEstimatedSize );
+ }
+ createButtons( maLayout );
+
+ maLayout.show();
+ maDialogSize = maLayout.getOptimalSize( WINDOWSIZE_PREFERRED );
+ maLayout.setManagedArea( Rectangle( Point(), maDialogSize ) );
+ SetOutputSizePixel( Size( mbPreview ? maDialogSize.Width() * 2 : maDialogSize.Width(), maDialogSize.Height() ) );
+
+ maRectFlButtons = Rectangle( maFlButtons.GetPosPixel(), maFlButtons.GetSizePixel() );
+ maRectBtnHelp = Rectangle( maBtnHelp.GetPosPixel(), maBtnHelp.GetSizePixel() );
+ maRectBtnOK = Rectangle( maBtnOK.GetPosPixel(), maBtnOK.GetSizePixel() );
+ maRectBtnCancel = Rectangle( maBtnCancel.GetPosPixel(), maBtnOK.GetSizePixel() );
+
+ maLbSizeY.Hide();
+}
+
+static rtl::OUString ImpValueOfInKB( const sal_Int64& rVal )
+{
+ double fVal( static_cast<double>( rVal ) );
+ fVal /= ( 1 << 10 );
+ fVal += 0.05;
+ rtl::OUStringBuffer aVal( rtl::OUString::valueOf( fVal ) );
+ sal_Int32 nX( rtl::OUString( aVal.getStr() ).indexOf( '.', 0 ) );
+ if ( nX > 0 )
+ aVal.setLength( nX + 2 );
+ return aVal.makeStringAndClear();
+}
+
+sal_Int32 static GetZoomValueFromThumbPos( sal_Int32 nThumbPos )
+{
+ sal_Int32 nProz = 0;
+ if ( nThumbPos <= 50 )
+ nProz = nThumbPos * 2; // so a range of 50 represents 100%
+ else
+ nProz = ( ( nThumbPos - 50 ) * 60 ) + 100; // we want to scale up to 3000%
+ return nProz;
+}
+
+void ExportDialog::updatePreview()
+{
+ // JPG
+// maCbJPGPreview.Enable( IsTempExportAvailable() );
+
+// if ( maCbJPGPreview.IsEnabled() && maCbJPGPreview.IsChecked() )
+ if ( mbPreview )
+ {
+ long nScrollBarSize = Application::GetSettings().GetStyleSettings().GetScrollBarSize();
+
+ Point aPreviewPos( maDialogSize.Width(), 0 );
+ Size aPreviewSize( maDialogSize.Width(), maFlButtons.GetPosPixel().Y() );
+
+ Point aFixedBitmapPos( aPreviewPos );
+ Size aFixedBitmapSize( aPreviewSize );
+
+ maSbZoom.Show( sal_False );
+ maSbZoom.SetPosPixel( Point( aPreviewPos.X(), aPreviewPos.Y() ) );
+ maSbZoom.SetSizePixel( Size( aPreviewSize.Width() / 4, nScrollBarSize ) );
+ maNfZoom.Show( sal_False );
+ maNfZoom.SetPosPixel( Point( aPreviewPos.X() + aPreviewSize.Width() / 4, aPreviewPos.Y() ) );
+ maNfZoom.SetSizePixel( Size( aPreviewSize.Width() / 6, nScrollBarSize ) );
+ maNfZoom.SetValue( GetZoomValueFromThumbPos( maSbZoom.GetThumbPos() ) );
+ maFbJPGPreview.Show( sal_True );
+
+ sal_Int32 nZoom = GetZoomValueFromThumbPos( maSbZoom.GetThumbPos() );
+ double fSizePixelX = static_cast< double >( maSize.Width * nZoom ) / 100.0;
+ double fSizePixelY = static_cast< double >( maSize.Height * nZoom ) / 100.0;
+
+ double fXRatio = fSizePixelX / maSize.Width; // the size of each pixel
+ double fYRatio = fSizePixelY / maSize.Height;
+
+ sal_Bool bHorzSb = fSizePixelX > aFixedBitmapSize.Width();
+ sal_Bool bVertSb = fSizePixelY > aFixedBitmapSize.Height();
+ if ( bHorzSb )
+ {
+ aFixedBitmapSize.Height() -= nScrollBarSize;
+
+ maSbJPGPreviewHorz.Show( sal_True );
+ maSbJPGPreviewHorz.SetPosPixel( Point( aFixedBitmapPos.X(), aFixedBitmapPos.Y() + aFixedBitmapSize.Height() ) );
+ maSbJPGPreviewHorz.SetSizePixel( Size( aFixedBitmapSize.Width(), nScrollBarSize ) );
+ }
+ else
+ {
+ maSbJPGPreviewHorz.Show( sal_False );
+ }
+
+
+ if ( bVertSb )
+ {
+ aFixedBitmapSize.Width() -= nScrollBarSize;
+
+ maSbJPGPreviewVert.Show( sal_True );
+ maSbJPGPreviewVert.SetPosPixel( Point( aFixedBitmapPos.X() + aFixedBitmapSize.Width(), aFixedBitmapPos.Y() ) );
+ maSbJPGPreviewVert.SetSizePixel( Size( nScrollBarSize, aFixedBitmapSize.Height() ) );
+ }
+ else
+ {
+ maSbJPGPreviewVert.Show( sal_False );
+ }
+
+ Point aPos( 0, 0 );
+ Size aSize;
+ if ( fXRatio > 1.0 )
+ {
+ aSize.Width() = maSize.Width > aFixedBitmapSize.Width() ? maSize.Width : aFixedBitmapSize.Width();
+ aSize.Width() /= static_cast<long int>(fXRatio);
+ }
+ else
+ {
+ aSize.Width() = maSize.Width < aFixedBitmapSize.Width() ? maSize.Width : aFixedBitmapSize.Width();
+ aSize.Width() /= static_cast<long int>(fXRatio);
+ }
+
+ if ( fYRatio > 1.0 )
+ {
+ aSize.Height() = maSize.Height > aFixedBitmapSize.Height() ? maSize.Height : aFixedBitmapSize.Height();
+ aSize.Height() /= static_cast<long int>(fYRatio);
+ }
+ else
+ {
+ aSize.Height() = maSize.Height < aFixedBitmapSize.Height() ? maSize.Height : aFixedBitmapSize.Height();
+ aSize.Height() /= static_cast<long int>(fYRatio);
+ }
+
+ if ( aSize.Width() < maSize.Width )
+ {
+ sal_Int32 nXDiff = static_cast< sal_Int32 >( ( ( ( maSize.Width - aSize.Width() ) * maSbJPGPreviewHorz.GetThumbPos() ) / 100.0 ) );
+ aPos.X() += nXDiff;
+ }
+ if ( aSize.Height() < maSize.Height )
+ {
+ sal_Int32 nYDiff = static_cast< sal_Int32 >( ( ( ( maSize.Height - aSize.Height() ) * maSbJPGPreviewVert.GetThumbPos() ) / 100.0 ) );
+ aPos.Y() += nYDiff;
+ }
+
+ Bitmap aCroppedBitmap( maBitmap );
+ aCroppedBitmap.Crop( Rectangle( aPos, aSize ) );
+ aSize = aCroppedBitmap.GetSizePixel();
+ aSize = Size( static_cast<long int>(aSize.Width() * fXRatio), static_cast<long int>(aSize.Height() * fYRatio) );
+ aCroppedBitmap.Scale( aSize );
+
+ if ( aSize.Width() > aFixedBitmapSize.Width() )
+ aSize.Width() = aFixedBitmapSize.Width();
+ if ( aSize.Height() > aFixedBitmapSize.Height() )
+ aSize.Height() = aFixedBitmapSize.Height();
+ Point aPoint( aFixedBitmapPos );
+ if ( aSize.Width() < aFixedBitmapSize.Width() )
+ aPoint.X() += ( aFixedBitmapSize.Width() - aSize.Width() ) / 2;
+ if ( aSize.Height() < aFixedBitmapSize.Height() )
+ aPoint.Y() += ( aFixedBitmapSize.Height() - aSize.Height() ) / 2;
+
+ maFbJPGPreview.SetPosPixel( aPoint );
+ maFbJPGPreview.SetSizePixel( aSize );
+ maFbJPGPreview.SetBitmap( aCroppedBitmap );
+
+ SetOutputSizePixel( Size( maDialogSize.Width() * 2, maDialogSize.Height() ) );
+
+ maFlButtons.SetSizePixel( Size( maRectFlButtons.GetWidth() * 2, maRectFlButtons.GetHeight() ) );
+ maBtnHelp.SetPosPixel( Point( maRectBtnHelp.Left() + maDialogSize.Width(), maRectBtnHelp.Top() ) );
+ maBtnOK.SetPosPixel( Point( maRectBtnOK.Left() + maDialogSize.Width(), maRectBtnOK.Top() ) );
+ maBtnCancel.SetPosPixel( Point( maRectBtnCancel.Left() + maDialogSize.Width(), maRectBtnCancel.Top() ) );
+ }
+ else
+ {
+ maSbZoom.Show( sal_False );
+ maNfZoom.Show( sal_False );
+ maFbJPGPreview.Show( sal_False );
+ maSbJPGPreviewHorz.Show( sal_False );
+ maSbJPGPreviewVert.Show( sal_False );
+
+ SetOutputSizePixel( maDialogSize );
+
+ maFlButtons.SetSizePixel( Size( maRectFlButtons.GetWidth(), maRectFlButtons.GetHeight() ) );
+ maBtnHelp.SetPosPixel( Point( maRectBtnHelp.Left(), maRectBtnHelp.Top() ) );
+ maBtnOK.SetPosPixel( Point( maRectBtnOK.Left(), maRectBtnOK.Top() ) );
+ maBtnCancel.SetPosPixel( Point( maRectBtnCancel.Left(), maRectBtnCancel.Top() ) );
+ }
+}
+
+void ExportDialog::updateControls()
+{
+ GetGraphicStream();
+
+ // Size Controls
+ if ( !mbIsPixelFormat )
+ {
+ awt::Size aSize100thmm( maSize );
+ Size aSize( LogicToLogic( Size( aSize100thmm.Width * 100, aSize100thmm.Height * 100 ), MAP_100TH_MM,
+ MapMode( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) ) ) );
+ maMfSizeX.SetValue( aSize.Width() );
+ maMfSizeY.SetValue( aSize.Height() );
+ }
+ else
+ {
+ MapUnit aMapUnit( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) );
+ if ( aMapUnit == MAP_PIXEL )
+ { // calculating pixel count via resolution and original graphic size
+ maMfSizeX.SetDecimalDigits( 0 );
+ maMfSizeY.SetDecimalDigits( 0 );
+ maMfSizeX.SetValue( maSize.Width );
+ maMfSizeY.SetValue( maSize.Height );
+ }
+ else
+ {
+ maMfSizeX.SetDecimalDigits( 2 );
+ maMfSizeY.SetDecimalDigits( 2 );
+ double fRatio;
+ switch( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) )
+ {
+ case MAP_INCH : fRatio = static_cast< double >( maResolution.Width ) * 0.0254; break;
+ case MAP_MM : fRatio = static_cast< double >( maResolution.Width ) * 0.001; break;
+ case MAP_POINT :fRatio = ( static_cast< double >( maResolution.Width ) * 0.0254 ) / 72.0; break;
+ default:
+ case MAP_CM : fRatio = static_cast< double >( maResolution.Width ) * 0.01; break;
+ }
+ maMfSizeX.SetValue( static_cast< sal_Int32 >( ( static_cast< double >( maSize.Width * 100 ) / fRatio ) + 0.5 ) );
+ maMfSizeY.SetValue( static_cast< sal_Int32 >( ( static_cast< double >( maSize.Height * 100 ) / fRatio ) + 0.5 ) );
+ }
+ }
+ sal_Int32 nResolution = 0;
+ switch( maLbResolution.GetSelectEntryPos() )
+ {
+ case 0 : nResolution = maResolution.Width / 100; break; // pixels / cm
+ case 2 : nResolution = maResolution.Width; break; // pixels / meter
+ default:
+ case 1 : nResolution = static_cast< sal_Int32 >(maResolution.Width * 0.0254); break; // pixels / inch
+ }
+ maNfResolution.SetValue( nResolution );
+
+ if ( maSbCompression.IsVisible() )
+ maSbCompression.SetThumbPos( maNfCompression.GetValue() );
+
+ // updating estimated size
+ sal_Int64 nRealFileSize( mpTempStream->Tell() );
+ if ( mbIsPixelFormat )
+ {
+ String aEst( nRealFileSize ? msEstimatedSizePix2 : msEstimatedSizePix1 );
+ sal_Int64 nRawFileSize( GetRawFileSize() );
+ xub_StrLen nInd = aEst.Search( '%' );
+ aEst.Replace( nInd, 2, ImpValueOfInKB( nRawFileSize ) );
+
+ if ( nRealFileSize )
+ {
+ nInd = aEst.Search( '%', nInd );
+ aEst.Replace( nInd, 2, ImpValueOfInKB( nRealFileSize ) );
+ }
+ maFtEstimatedSize.SetText( aEst );
+ }
+ else
+ {
+ if ( mnMaxFilesizeForRealtimePreview )
+ {
+ String aEst( msEstimatedSizeVec );
+ xub_StrLen nInd = aEst.Search( '%', 0 );
+ aEst.Replace( nInd, 2, ImpValueOfInKB( nRealFileSize ) );
+ maFtEstimatedSize.SetText( aEst );
+ }
+ }
+ updatePreview();
+
+ // EPS
+ if ( maRbEPSLevel1.IsVisible() )
+ {
+ sal_Bool bEnabled = maRbEPSLevel1.IsChecked() == sal_False;
+ maRbEPSColorFormat1.Enable( bEnabled );
+ maRbEPSColorFormat2.Enable( bEnabled );
+ maRbEPSCompressionLZW.Enable( bEnabled );
+ maRbEPSCompressionNone.Enable( bEnabled );
+ }
+}
+
+ExportDialog::~ExportDialog()
+{
+ delete mpFilterOptionsItem;
+ delete mpOptionsItem;
+}
+
+
+/*************************************************************************
+|*
+|* Speichert eingestellte Werte in ini-Datei
+|*
+\************************************************************************/
+IMPL_LINK( ExportDialog, UpdateHdl, void *, EMPTYARG )
+{
+ updateControls();
+ return 0;
+}
+
+IMPL_LINK( ExportDialog, UpdateHdlMtfSizeX, void *, EMPTYARG )
+{
+ double fRatio = static_cast< double >( maOriginalSize.Height ) / maOriginalSize.Width;
+
+ if ( mbIsPixelFormat )
+ {
+ switch( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) )
+ {
+ case MAP_INCH : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.0254 * maMfSizeX.GetValue() / 100.0 + 0.5 ); break;
+ case MAP_CM : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.01 * maMfSizeX.GetValue() / 100.0 + 0.5 ); break;
+ case MAP_MM : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.001 * maMfSizeX.GetValue() / 100.0 + 0.5 ); break;
+ case MAP_POINT : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.0254 * maMfSizeX.GetValue() / 100.0 * 72 + 0.5 ); break;
+ default:
+ case MAP_PIXEL : maSize.Width = maMfSizeX.GetValue(); break;
+ }
+ maSize.Height = static_cast< sal_Int32 >( fRatio * maSize.Width + 0.5 );
+ }
+ else
+ {
+ Fraction aFract( 1, 100 );
+ sal_Int32 nWidth = maMfSizeX.GetValue();
+ sal_Int32 nHeight= static_cast< sal_Int32 >( nWidth * fRatio );
+ const Size aSource( static_cast< sal_Int32 >( nWidth ), static_cast< sal_Int32 >( nHeight ) );
+ MapMode aSourceMapMode( GetMapUnit( maLbSizeX.GetSelectEntryPos() ),Point(), aFract, aFract );
+ Size aDest( LogicToLogic( aSource, aSourceMapMode, MAP_100TH_MM ) );
+
+ maSize.Width = aDest.Width();
+ if ( mbPreserveAspectRatio )
+ maSize.Height = aDest.Height();
+ }
+ updateControls();
+ return 0;
+}
+
+IMPL_LINK( ExportDialog, UpdateHdlMtfSizeY, void *, EMPTYARG )
+{
+ double fRatio = static_cast< double >( maOriginalSize.Width ) / maOriginalSize.Height;
+
+ if ( mbIsPixelFormat )
+ {
+ switch( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) )
+ {
+ case MAP_INCH : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.0254 * maMfSizeY.GetValue() / 100.0 + 0.5 ); break;
+ case MAP_CM : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.01 * maMfSizeY.GetValue() / 100.0 + 0.5 ); break;
+ case MAP_MM : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.001 * maMfSizeY.GetValue() / 100.0 + 0.5 ); break;
+ case MAP_POINT : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.0254 * maMfSizeY.GetValue() / 100.0 * 72 + 0.5 ); break;
+ default:
+ case MAP_PIXEL : maSize.Height = maMfSizeY.GetValue(); break;
+ }
+ maSize.Width = static_cast< sal_Int32 >( fRatio * maSize.Height + 0.5 );
+ }
+ else
+ {
+ Fraction aFract( 1, 100 );
+ sal_Int32 nHeight= maMfSizeY.GetValue();
+ sal_Int32 nWidth = static_cast< sal_Int32 >( nHeight * fRatio );
+ const Size aSource( static_cast< sal_Int32 >( nWidth ), static_cast< sal_Int32 >( nHeight ) );
+ MapMode aSourceMapMode( GetMapUnit( maLbSizeX.GetSelectEntryPos() ),Point(), aFract, aFract );
+ Size aDest( LogicToLogic( aSource, aSourceMapMode, MAP_100TH_MM ) );
+
+ maSize.Height = aDest.Height();
+ if ( mbPreserveAspectRatio )
+ maSize.Width = aDest.Width();
+ }
+ updateControls();
+ return 0;
+}
+
+IMPL_LINK( ExportDialog, UpdateHdlNfResolution, void *, EMPTYARG )
+{
+ sal_Int32 nResolution = maNfResolution.GetValue();
+ if ( maLbResolution.GetSelectEntryPos() == 0 ) // pixels / cm
+ nResolution *= 100;
+ else if ( maLbResolution.GetSelectEntryPos() == 1 ) // pixels / inch
+ nResolution = static_cast< sal_Int32 >( ( ( static_cast< double >( nResolution ) + 0.5 ) / 0.0254 ) );
+ maResolution.Width = nResolution;
+ maResolution.Height= nResolution;
+
+ updateControls();
+ return 0;
+}
+
+IMPL_LINK( ExportDialog, SbCompressionUpdateHdl, void *, EMPTYARG )
+{
+ maNfCompression.SetValue( maSbCompression.GetThumbPos() );
+ updateControls();
+ return 0;
+}
+
+IMPL_LINK( ExportDialog, OK, void *, EMPTYARG )
+{
+ // writing config parameter
+
+
+ mrFltCallPara.aFilterData = GetFilterData( sal_True );
+ EndDialog( RET_OK );
+
+ return 0;
+}
+
diff --git a/svtools/source/filter.vcl/filter/exportdialog.hrc b/svtools/source/filter.vcl/filter/exportdialog.hrc
new file mode 100755
index 000000000000..e230bcd2c5c3
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/exportdialog.hrc
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+#include <svtools/svtools.hrc>
+
+#define BTN_OK 1
+#define BTN_CANCEL 1
+#define BTN_HELP 1
+
+#define FL_EXPORT_SIZE 1
+#define FL_COLOR_DEPTH 2
+#define FL_JPG_QUALITY 3
+#define FL_COMPRESSION 4
+#define FL_MODE 5
+#define FL_GIF_DRAWING_OBJECTS 6
+#define FL_PBM_OPTIONS 7
+#define FL_EPS_PREVIEW 8
+#define FL_EPS_VERSION 9
+#define FL_EPS_COLOR_FORMAT 10
+#define FL_ESTIMATED_SIZE 11
+#define FL_BUTTONS 12
+
+#define FT_SIZEX 1
+#define FT_SIZEY 2
+#define FT_RESOLUTION 3
+#define FT_JPG_MIN 4
+#define FT_JPG_MAX 5
+#define FT_PNG_MIN 6
+#define FT_PNG_MAX 7
+#define FT_ESTIMATED_SIZE 8
+
+#define NF_RESOLUTION 1
+#define NF_COMPRESSION 2
+#define NF_ZOOM 3
+
+#define MF_SIZEX 1
+#define MF_SIZEY 2
+
+#define LB_SIZEX 1
+#define LB_SIZEY 2
+#define LB_RESOLUTION 3
+#define LB_COLOR_DEPTH 4
+
+#define RB_BINARY 1
+#define RB_TEXT 2
+#define RB_EPS_LEVEL1 3
+#define RB_EPS_LEVEL2 4
+#define RB_EPS_COLOR_FORMAT1 5
+#define RB_EPS_COLOR_FORMAT2 6
+#define RB_EPS_COMPRESSION_LZW 7
+#define RB_EPS_COMPRESSION_NONE 8
+
+#define CB_JPG_PREVIEW 1
+#define CB_INTERLACED 2
+#define CB_RLE_ENCODING 3
+#define CB_SAVE_TRANSPARENCY 4
+#define CB_EPS_PREVIEW_TIFF 5
+#define CB_EPS_PREVIEW_EPSI 6
+
+#define FB_JPG_PREVIEW 1
+
+#define SB_COMPRESSION 1
+#define SB_JPG_PREVIEW_HORZ 2
+#define SB_JPG_PREVIEW_VERT 3
+#define SB_ZOOM 4
+
+#define STR_1BIT_THRESHOLD 1
+#define STR_1BIT_DITHERED 2
+#define STR_4BIT_GRAYSCALE 3
+#define STR_4BIT_COLOR_PALETTE 4
+#define STR_8BIT_GRAYSCALE 5
+#define STR_8BIT_COLOR_PALETTE 6
+#define STR_24BIT_TRUE_COLOR 7
+#define STR_ESTIMATED_SIZE_PIX_1 8
+#define STR_ESTIMATED_SIZE_PIX_2 9
+#define STR_ESTIMATED_SIZE_VEC 10
diff --git a/svtools/source/filter.vcl/filter/exportdialog.hxx b/svtools/source/filter.vcl/filter/exportdialog.hxx
new file mode 100755
index 000000000000..20a9ac3ea832
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/exportdialog.hxx
@@ -0,0 +1,216 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+#ifndef _EXPORTDIALOG_HXX_
+#define _EXPORTDIALOG_HXX_
+
+#include <svtools/fltcall.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/button.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/field.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/msgbox.hxx>
+#include <vcl/arrange.hxx>
+#include <vcl/scrbar.hxx>
+#include <com/sun/star/document/XExporter.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+
+/*************************************************************************
+|*
+|* Dialog zum Einstellen von Filteroptionen bei Pixelformaten
+|*
+\************************************************************************/
+
+class FilterConfigItem;
+class ExportDialog : public ModalDialog
+{
+private:
+
+ FltCallDialogParameter&
+ mrFltCallPara;
+
+ ResMgr* mpMgr;
+
+ const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
+ mxMgr;
+ const com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >&
+ mxSourceDocument;
+
+ FixedLine maFlExportSize;
+ FixedText maFtSizeX;
+ MetricField maMfSizeX;
+ ListBox maLbSizeX;
+ FixedText maFtSizeY;
+ MetricField maMfSizeY;
+ ListBox maLbSizeY;
+ FixedText maFtResolution;
+ NumericField maNfResolution;
+ ListBox maLbResolution;
+ FixedLine maFlColorDepth;
+ ListBox maLbColorDepth;
+ FixedLine maFlJPGQuality;
+ FixedLine maFlMode;
+ FixedLine maFlPBMOptions;
+ ScrollBar maSbCompression;
+ NumericField maNfCompression;
+ FixedText maFtJPGMin;
+ FixedText maFtJPGMax;
+ FixedText maFtPNGMin;
+ FixedText maFtPNGMax;
+ CheckBox maCbJPGPreview;
+ CheckBox maCbInterlaced;
+ CheckBox maCbRLEEncoding;
+ FixedLine maFlGIFDrawingObjects;
+ CheckBox maCbSaveTransparency;
+ RadioButton maRbBinary;
+ RadioButton maRbText;
+ FixedLine maFlEPSPreview;
+ CheckBox maCbEPSPreviewTIFF;
+ CheckBox maCbEPSPreviewEPSI;
+ FixedLine maFlEPSVersion;
+ RadioButton maRbEPSLevel1;
+ RadioButton maRbEPSLevel2;
+ FixedLine maFlEPSColorFormat;
+ RadioButton maRbEPSColorFormat1;
+ RadioButton maRbEPSColorFormat2;
+ FixedLine maFlCompression;
+ RadioButton maRbEPSCompressionLZW;
+ RadioButton maRbEPSCompressionNone;
+ FixedLine maFlEstimatedSize;
+ FixedText maFtEstimatedSize;
+ String msEstimatedSizePix1;
+ String msEstimatedSizePix2;
+ String msEstimatedSizeVec;
+ FixedLine maFlButtons;
+ FixedBitmap maFbJPGPreview;
+ ScrollBar maSbZoom;
+ NumericField maNfZoom;
+ ScrollBar maSbJPGPreviewHorz;
+ ScrollBar maSbJPGPreviewVert;
+ OKButton maBtnOK;
+ CancelButton maBtnCancel;
+ HelpButton maBtnHelp;
+
+ String ms1BitTreshold;
+ String ms1BitDithered;
+ String ms4BitGrayscale;
+ String ms4BitColorPalette;
+ String ms8BitGrayscale;
+ String ms8BitColorPalette;
+ String ms24BitColor;
+
+ vcl::RowOrColumn maLayout;
+ Size maDialogSize;
+
+ FilterConfigItem* mpOptionsItem;
+ FilterConfigItem* mpFilterOptionsItem;
+
+ String maExt;
+ String maEstimatedSizeText;
+ sal_Int16 mnFormat;
+ sal_Int32 mnMaxFilesizeForRealtimePreview;
+
+ Rectangle maRectFlButtons;
+ Rectangle maRectBtnHelp;
+ Rectangle maRectBtnOK;
+ Rectangle maRectBtnCancel;
+
+ SvStream* mpTempStream;
+ Bitmap maBitmap;
+
+ com::sun::star::awt::Size
+ maOriginalSize; // the original graphic size in 1/100mm
+ com::sun::star::awt::Size
+ maSize; // for vector graphics it always contains the logical size in 1/100mm
+
+ sal_Bool mbPreview;
+ sal_Bool mbIsPixelFormat;
+ sal_Bool mbExportSelection;
+ sal_Bool mbPreserveAspectRatio;
+
+ sal_Int32 mnInitialResolutionUnit;
+
+ // for pixel graphics it always contains the pixel count
+ com::sun::star::awt::Size
+ maResolution; // it always contains the number of pixels per meter
+
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShape >
+ mxShape;
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >
+ mxShapes;
+ com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >
+ mxPage;
+
+
+ DECL_LINK( UpdateHdl,void* p );
+ DECL_LINK( UpdateHdlMtfSizeX,void* p );
+ DECL_LINK( UpdateHdlMtfSizeY,void* p );
+ DECL_LINK( UpdateHdlNfResolution,void* p );
+ DECL_LINK( SbCompressionUpdateHdl,void* p );
+ DECL_LINK( NfCompressionUpdateHdlX,void* p );
+
+ DECL_LINK( OK, void* p );
+
+ void createSizeControls( vcl::RowOrColumn& );
+ void createColorDepthControls( vcl::RowOrColumn& );
+ void createFilterOptions( vcl::RowOrColumn& );
+ void createButtons( vcl::RowOrColumn& );
+ void createScrollBar( vcl::RowOrColumn& );
+ void setupLayout();
+ void updatePreview();
+ void updateControls();
+
+ void GetGraphicSource();
+ sal_Bool GetGraphicStream();
+ Bitmap GetGraphicBitmap( SvStream& rStream );
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
+ GetFilterData( sal_Bool bUpdateConfig );
+
+ sal_uInt32 GetRawFileSize() const;
+ sal_Bool IsTempExportAvailable() const;
+
+ com::sun::star::awt::Size
+ GetOriginalSize();
+
+ sal_Int32 GetDefaultUnit();
+
+public:
+ ExportDialog( FltCallDialogParameter& rPara,
+ const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > rxMgr,
+ const com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rxSourceDocument,
+ sal_Bool bExportSelection, sal_Bool bIsExportVectorFormat );
+ ~ExportDialog();
+};
+
+
+
+#endif // _EXPORTDIALOG_HXX_
+
diff --git a/svtools/source/filter.vcl/filter/exportdialog.src b/svtools/source/filter.vcl/filter/exportdialog.src
new file mode 100644
index 000000000000..c9e87989a314
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/exportdialog.src
@@ -0,0 +1,529 @@
+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#include "exportdialog.hrc"
+
+String DLG_EXPORT_TITLE
+{
+ Text [ en-US ] = " Options" ;
+};
+
+ModalDialog DLG_EXPORT
+{
+ HelpID = "svtools:ModalDialog:DLG_EXPORT";
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 178 , 135 ) ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+
+ FixedLine FL_EXPORT_SIZE
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "Size" ;
+ };
+ FixedText FT_SIZEX
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "Width:" ;
+ };
+ MetricField MF_SIZEX
+ {
+ HelpID = "svtools:MetricField:DLG_EXPORT:MF_SIZEX";
+ Hide = TRUE;
+ Border = TRUE;
+ Size = MAP_APPFONT ( 30, 12 ) ;
+ TabStop = TRUE;
+ Repeat = TRUE;
+ Spin = FALSE;
+ StrictFormat = TRUE;
+ DecimalDigits = 2;
+ Unit = FUNIT_NONE;
+ Maximum = 99999;
+ Last = 255;
+ };
+ ListBox LB_SIZEX
+ {
+ HelpID = "svtools:ListBox:DLG_EXPORT:LB_SIZEX";
+ Hide = TRUE;
+ Border = TRUE ;
+ Size = MAP_APPFONT ( 60, 80 ) ;
+ DropDown = TRUE ;
+ Sort = FALSE ;
+ StringList [ en-US ] =
+ {
+ < "inches" ; > ;
+ < "cm" ; Default ; > ;
+ < "mm" ; > ;
+ < "points" ; > ;
+ < "pixels" ; > ;
+ };
+ };
+ FixedText FT_SIZEY
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "Height:" ;
+ };
+ MetricField MF_SIZEY
+ {
+ HelpID = "svtools:MetricField:DLG_EXPORT:MF_SIZEY";
+ Hide = TRUE;
+ Border = TRUE;
+ Size = MAP_APPFONT ( 30, 12 );
+ TabStop = TRUE;
+ Repeat = TRUE;
+ Spin = FALSE;
+ StrictFormat = TRUE;
+ DecimalDigits = 2;
+ Unit = FUNIT_NONE;
+ Maximum = 99999;
+ Last = 255 ;
+ };
+ ListBox LB_SIZEY
+ {
+ HelpID = "svtools:ListBox:DLG_EXPORT:LB_SIZEY";
+ Hide = TRUE;
+ Border = TRUE ;
+ Size = MAP_APPFONT ( 60, 80 ) ;
+ DropDown = TRUE ;
+ Sort = FALSE ;
+ StringList [ en-US ] =
+ {
+ < "inches" ; > ;
+ < "cm" ; Default ; > ;
+ < "mm" ; > ;
+ < "points" ; > ;
+ < "pixels" ; > ;
+ };
+ };
+ FixedText FT_RESOLUTION
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "Resolution:" ;
+ };
+ NumericField NF_RESOLUTION
+ {
+ HelpID = "svtools:NumericField:DLG_EXPORT:NF_RESOLUTION";
+ Hide = TRUE;
+ Border = TRUE ;
+ Size = MAP_APPFONT ( 30, 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = FALSE ;
+ Maximum = 99999;
+ Last = 255 ;
+ };
+ ListBox LB_RESOLUTION
+ {
+ HelpID = "svtools:ListBox:DLG_EXPORT:LB_RESOLUTION";
+ Hide = TRUE;
+ Border = TRUE ;
+ Size = MAP_APPFONT ( 60, 80 ) ;
+ DropDown = TRUE ;
+ Sort = FALSE ;
+ StringList [ en-US ] =
+ {
+ < "pixels/cm" ; > ;
+ < "pixels/inch" ; Default ; > ;
+ < "pixels/meter" ; > ;
+ };
+ };
+ FixedLine FL_COLOR_DEPTH
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "Color Depth" ;
+ };
+ ListBox LB_COLOR_DEPTH
+ {
+ HelpID = "svtools:ListBox:DLG_EXPORT:LB_COLOR_DEPTH";
+ Hide = TRUE;
+ Border = TRUE ;
+ Size = MAP_APPFONT ( 60, 80 ) ;
+ DropDown = TRUE ;
+ Sort = FALSE ;
+ };
+ String STR_1BIT_THRESHOLD
+ {
+ Text [ en-US ] = "1 bit threshold";
+ };
+ String STR_1BIT_DITHERED
+ {
+ Text [ en-US ] = "1 bit dithered";
+ };
+ String STR_4BIT_GRAYSCALE
+ {
+ Text [ en-US ] = "4 bit grayscale";
+ };
+ String STR_4BIT_COLOR_PALETTE
+ {
+ Text [ en-US ] = "4 bit color";
+ };
+ String STR_8BIT_GRAYSCALE
+ {
+ Text [ en-US ] = "8 bit grayscale";
+ };
+ String STR_8BIT_COLOR_PALETTE
+ {
+ Text [ en-US ] = "8 bit color";
+ };
+ String STR_24BIT_TRUE_COLOR
+ {
+ Text [ en-US ] = "24 bit true color";
+ };
+ FixedLine FL_JPG_QUALITY
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "Quality" ;
+ };
+ FixedLine FL_COMPRESSION
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "Compression" ;
+ };
+ FixedLine FL_MODE
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "Mode" ;
+ };
+ FixedLine FL_PBM_OPTIONS
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "File Format" ;
+ };
+ ScrollBar SB_COMPRESSION
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 48, 10 ) ;
+ VScroll = FALSE ;
+ HScroll = TRUE;
+ Drag = TRUE ;
+ };
+ NumericField NF_COMPRESSION
+ {
+ HelpID = "svtools:NumericField:DLG_EXPORT:NF_COMPRESSION";
+ Hide = TRUE;
+ Border = TRUE ;
+ Size = MAP_APPFONT ( 30, 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = FALSE ;
+ Maximum = 99999;
+ Last = 255 ;
+ };
+ FixedText FT_JPG_MIN
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "1 is minimum Quality and smallest file size." ;
+ };
+ FixedText FT_JPG_MAX
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "100 is maximum Quality and biggest file size." ;
+ };
+ FixedText FT_PNG_MIN
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "0 is biggest file size and fastest loading." ;
+ };
+ FixedText FT_PNG_MAX
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "9 is smallest file size and slowest loading." ;
+ };
+ CheckBox CB_JPG_PREVIEW
+ {
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_JPG_PREVIEW";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Text [ en-US ] = "Preview" ;
+ };
+ CheckBox CB_INTERLACED
+ {
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_INTERLACED";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Text [ en-US ] = "Interlaced" ;
+ };
+ CheckBox CB_RLE_ENCODING
+ {
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_RLE_ENCODING";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Text [ en-US ] = "RLE encoding" ;
+ };
+ FixedLine FL_GIF_DRAWING_OBJECTS
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "Drawing Objects" ;
+ };
+ CheckBox CB_SAVE_TRANSPARENCY
+ {
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_SAVE_TRANSPARENCY";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Text [ en-US ] = "Save transparency" ;
+ };
+ RadioButton RB_BINARY
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_BINARY";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "Binary" ;
+ };
+ RadioButton RB_TEXT
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_TEXT";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "Text" ;
+ };
+ FixedLine FL_EPS_PREVIEW
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "Preview" ;
+ };
+ CheckBox CB_EPS_PREVIEW_TIFF
+ {
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_EPS_PREVIEW_TIFF";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Text [ en-US ] = "Image Preview (TIFF)" ;
+ };
+ CheckBox CB_EPS_PREVIEW_EPSI
+ {
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_EPS_PREVIEW_EPSI";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Text [ en-US ] = "Interchange (EPSI)" ;
+ };
+ FixedLine FL_EPS_VERSION
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "Version" ;
+ };
+ RadioButton RB_EPS_LEVEL1
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_LEVEL1";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "Level 1" ;
+ };
+ RadioButton RB_EPS_LEVEL2
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_LEVEL2";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "Level 2" ;
+ };
+ FixedLine FL_EPS_COLOR_FORMAT
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "Color format" ;
+ };
+ RadioButton RB_EPS_COLOR_FORMAT1
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_COLOR_FORMAT1";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "Color" ;
+ };
+ RadioButton RB_EPS_COLOR_FORMAT2
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_COLOR_FORMAT2";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "Grayscale" ;
+ };
+ RadioButton RB_EPS_COMPRESSION_LZW
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_COMPRESSION_LZW";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "LZW encoding" ;
+ };
+ RadioButton RB_EPS_COMPRESSION_NONE
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_COMPRESSION_NONE";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "None" ;
+ };
+ FixedLine FL_ESTIMATED_SIZE
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ };
+ FixedText FT_ESTIMATED_SIZE
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ };
+ String STR_ESTIMATED_SIZE_PIX_1
+ {
+ Text [ en-US ] = "The picture needs about %1 KB of memory.";
+ };
+ String STR_ESTIMATED_SIZE_PIX_2
+ {
+ Text [ en-US ] = "The picture needs about %1 KB of memory,\n the file size is %2 KB.";
+ };
+ String STR_ESTIMATED_SIZE_VEC
+ {
+ Text [ en-US ] = "The file size is %1 KB.";
+ };
+ FixedLine FL_BUTTONS
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ };
+ FixedBitmap FB_JPG_PREVIEW
+ {
+ Hide = TRUE;
+ OutputSize = TRUE ;
+ Scale = TRUE;
+ Border = TRUE;
+ };
+ ScrollBar SB_ZOOM
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 48, 10 );
+ VScroll = FALSE;
+ HScroll = TRUE;
+ Drag = TRUE;
+ MinPos = 5;
+ MaxPos = 100;
+ ThumbPos = 50;
+ };
+ NumericField NF_ZOOM
+ {
+ HelpID = "svtools:NumericField:DLG_EXPORT:NF_ZOOM";
+ Hide = TRUE;
+ Border = TRUE ;
+ Size = MAP_APPFONT ( 30, 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = FALSE ;
+ Maximum = 3000;
+ Last = 255 ;
+ };
+ ScrollBar SB_JPG_PREVIEW_HORZ
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 48, 10 );
+ VScroll = FALSE;
+ HScroll = TRUE;
+ Drag = TRUE;
+ MinPos = 0;
+ MaxPos = 100;
+ ThumbPos = 50;
+ };
+ ScrollBar SB_JPG_PREVIEW_VERT
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 48, 10 );
+ VScroll = TRUE;
+ HScroll = FALSE;
+ Drag = TRUE;
+ MinPos = 0;
+ MaxPos = 100;
+ ThumbPos = 50;
+ };
+ OKButton BTN_OK
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ DefButton = TRUE ;
+ };
+ CancelButton BTN_CANCEL
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ HelpButton BTN_HELP
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/svtools/source/filter.vcl/filter/filter.cxx b/svtools/source/filter.vcl/filter/filter.cxx
index fe6adfa266ba..5ea07d2017f2 100644
--- a/svtools/source/filter.vcl/filter/filter.cxx
+++ b/svtools/source/filter.vcl/filter/filter.cxx
@@ -53,7 +53,7 @@
#include "xbmread.hxx"
#include "xpmread.hxx"
#include <svl/solar.hrc>
-#include "strings.hrc"
+#include <svtools/svtools.hrc>
#include "sgffilt.hxx"
#include "osl/module.hxx"
#include <com/sun/star/uno/Reference.h>
@@ -78,7 +78,7 @@
#define PMGCHUNG_msOG 0x6d734f47 // Microsoft Office Animated GIF
-#if defined WIN || (defined OS2 && !defined ICC)
+#if (defined OS2 && !defined ICC)
#define IMPORT_FUNCTION_NAME "_GraphicImport"
#define EXPORT_FUNCTION_NAME "_GraphicExport"
@@ -94,10 +94,6 @@
#endif
-// Compilerfehler, wenn Optimierung bei WNT & MSC
-#ifdef _MSC_VER
-#pragma optimize( "", off )
-#endif
// -----------
// - statics -
@@ -136,9 +132,9 @@ public:
~ImpFilterOutputStream() {}
};
-BOOL ImplDirEntryHelper::Exists( const INetURLObject& rObj )
+sal_Bool ImplDirEntryHelper::Exists( const INetURLObject& rObj )
{
- BOOL bExists = FALSE;
+ sal_Bool bExists = sal_False;
try
{
@@ -191,11 +187,11 @@ void ImplDirEntryHelper::Kill( const String& rMainUrl )
//--------------------------------------------------------------------------
-BYTE* ImplSearchEntry( BYTE* pSource, BYTE* pDest, ULONG nComp, ULONG nSize )
+sal_uInt8* ImplSearchEntry( sal_uInt8* pSource, sal_uInt8* pDest, sal_uLong nComp, sal_uLong nSize )
{
while ( nComp-- >= nSize )
{
- ULONG i;
+ sal_uLong i;
for ( i = 0; i < nSize; i++ )
{
if ( ( pSource[i]&~0x20 ) != ( pDest[i]&~0x20 ) )
@@ -228,9 +224,9 @@ inline String ImpGetExtension( const String &rPath )
|* Eingabe-prarameter:
|* rPath - Dateipfad
|* rFormatExtension - Inhalt egal
-|* bTest - setze FALSE
+|* bTest - setze sal_False
|* Ausgabe-parameter:
-|* Funkionswert - TRUE wenn Erfolg
+|* Funkionswert - sal_True wenn Erfolg
|* rFormatExtension - Bei Erfolg: uebliche Dateiendung
|* des Formats (Grossbuchstaben)
|* 2.) Datei anlesen, Dateiformat ueberpruefen
@@ -238,32 +234,32 @@ inline String ImpGetExtension( const String &rPath )
|* rPath - Dateipfad
|* rFormatExtension - uebliche Dateiendung des Formats
|* (Grossbuchstaben)
-|* bTest - setze TRUE
+|* bTest - setze sal_True
|* Ausgabe-parameter:
-|* Funkionswert - FALSE, wenn die Datei bestimmt nicht
+|* Funkionswert - sal_False, wenn die Datei bestimmt nicht
|* vom uebgebenen Format ist.
-|* TRUE, wenn die Datei WAHRSCHEINLICH von
+|* sal_True, wenn die Datei WAHRSCHEINLICH von
|* dem Format ist, ODER WENN DAS FORMAT
|* DIESER FUNKTION NICHT BEKANNT IST!
|*
*************************************************************************/
-static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, BOOL bTest )
+static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, sal_Bool bTest )
{
- USHORT i;
- BYTE sFirstBytes[ 256 ];
- ULONG nFirstLong,nSecondLong;
- ULONG nStreamPos = rStream.Tell();
+ sal_uInt16 i;
+ sal_uInt8 sFirstBytes[ 256 ];
+ sal_uLong nFirstLong,nSecondLong;
+ sal_uLong nStreamPos = rStream.Tell();
rStream.Seek( STREAM_SEEK_TO_END );
- ULONG nStreamLen = rStream.Tell() - nStreamPos;
+ sal_uLong nStreamLen = rStream.Tell() - nStreamPos;
rStream.Seek( nStreamPos );
if ( !nStreamLen )
{
SvLockBytes* pLockBytes = rStream.GetLockBytes();
if ( pLockBytes )
- pLockBytes->SetSynchronMode( TRUE );
+ pLockBytes->SetSynchronMode( sal_True );
rStream.Seek( STREAM_SEEK_TO_END );
nStreamLen = rStream.Tell() - nStreamPos;
@@ -276,25 +272,25 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
{
rStream.Read( sFirstBytes, nStreamLen );
- for( i = (USHORT) nStreamLen; i < 256; i++ )
+ for( i = (sal_uInt16) nStreamLen; i < 256; i++ )
sFirstBytes[ i ]=0;
}
if( rStream.GetError() )
- return FALSE;
+ return sal_False;
// Die ersten 8 Bytes in nFirstLong, nSecondLong unterbringen,
// Big-Endian:
for( i = 0, nFirstLong = 0L, nSecondLong = 0L; i < 4; i++ )
{
- nFirstLong=(nFirstLong<<8)|(ULONG)sFirstBytes[i];
- nSecondLong=(nSecondLong<<8)|(ULONG)sFirstBytes[i+4];
+ nFirstLong=(nFirstLong<<8)|(sal_uLong)sFirstBytes[i];
+ nSecondLong=(nSecondLong<<8)|(sal_uLong)sFirstBytes[i+4];
}
- // Folgende Variable ist nur bei bTest==TRUE interessant. Sie
- // bleibt FALSE, wenn das Format (rFormatExtension) hier noch nicht
+ // Folgende Variable ist nur bei bTest==sal_True interessant. Sie
+ // bleibt sal_False, wenn das Format (rFormatExtension) hier noch nicht
// einprogrammiert wurde.
- BOOL bSomethingTested = FALSE;
+ sal_Bool bSomethingTested = sal_False;
// Nun werden die verschieden Formate ueberprueft. Dabei ist die
// Reihenfolge nicht egal. Z.b. koennte eine MET-Datei auch durch
@@ -303,7 +299,7 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
// Theoretisch waere aber vielleicht auch eine BMP-Datei denkbar,
// die durch den MET-Test geht.
// Diese Probleme gibt es natuerlich nicht nur bei MET und BMP.
- // Deshalb wird im Falle der Uberpruefung eines Formats (bTest==TRUE)
+ // Deshalb wird im Falle der Uberpruefung eines Formats (bTest==sal_True)
// nur genau dieses eine Format getestet. Alles andere koennte fatale
// Folgen haben, z.B. wenn der Benutzer sagt, es sei BMP-Datei (und es
// ist BMP-Datei), und hier wuerde die Datei durch den MET-Test gehen...
@@ -311,26 +307,26 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
//--------------------------- MET ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "MET", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
if( sFirstBytes[2] == 0xd3 )
{
rStream.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
rStream.Seek( nStreamPos );
- USHORT nFieldSize;
- BYTE nMagic;
- BOOL bOK=TRUE;
+ sal_uInt16 nFieldSize;
+ sal_uInt8 nMagic;
+ sal_Bool bOK=sal_True;
rStream >> nFieldSize >> nMagic;
for (i=0; i<3; i++) {
- if (nFieldSize<6) { bOK=FALSE; break; }
- if (nStreamLen < rStream.Tell() + nFieldSize ) { bOK=FALSE; break; }
+ if (nFieldSize<6) { bOK=sal_False; break; }
+ if (nStreamLen < rStream.Tell() + nFieldSize ) { bOK=sal_False; break; }
rStream.SeekRel(nFieldSize-3);
rStream >> nFieldSize >> nMagic;
- if (nMagic!=0xd3) { bOK=FALSE; break; }
+ if (nMagic!=0xd3) { bOK=sal_False; break; }
}
rStream.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
if (bOK && !rStream.GetError()) {
rFormatExtension= UniString::CreateFromAscii( "MET", 3 );
- return TRUE;
+ return sal_True;
}
}
}
@@ -338,9 +334,9 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
//--------------------------- BMP ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "BMP", 3 ) == COMPARE_EQUAL ) )
{
- BYTE nOffs;
+ sal_uInt8 nOffs;
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
// OS/2-Bitmaparray ('BA') koennen wir evtl. auch lesen,
// dementspr. muessen wir den Offset anpassen,
@@ -364,7 +360,7 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
sFirstBytes[14+nOffs] == 0x0c )
{
rFormatExtension = UniString::CreateFromAscii( "BMP", 3 );
- return TRUE;
+ return sal_True;
}
}
}
@@ -375,33 +371,33 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
( rFormatExtension.CompareToAscii( "WMF", 3 ) == COMPARE_EQUAL ) ||
( rFormatExtension.CompareToAscii( "EMF", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested = TRUE;
+ bSomethingTested = sal_True;
if ( nFirstLong==0xd7cdc69a || nFirstLong==0x01000900 )
{
rFormatExtension = UniString::CreateFromAscii( "WMF", 3 );
- return TRUE;
+ return sal_True;
}
else if( nFirstLong == 0x01000000 && sFirstBytes[ 40 ] == 0x20 && sFirstBytes[ 41 ] == 0x45 &&
sFirstBytes[ 42 ] == 0x4d && sFirstBytes[ 43 ] == 0x46 )
{
rFormatExtension = UniString::CreateFromAscii( "EMF", 3 );
- return TRUE;
+ return sal_True;
}
}
//--------------------------- PCX ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "PCX", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
if (sFirstBytes[0]==0x0a)
{
- BYTE nVersion=sFirstBytes[1];
- BYTE nEncoding=sFirstBytes[2];
+ sal_uInt8 nVersion=sFirstBytes[1];
+ sal_uInt8 nEncoding=sFirstBytes[2];
if( ( nVersion==0 || nVersion==2 || nVersion==3 || nVersion==5 ) && nEncoding<=1 )
{
rFormatExtension = UniString::CreateFromAscii( "PCX", 3 );
- return TRUE;
+ return sal_True;
}
}
}
@@ -409,69 +405,69 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
//--------------------------- TIF ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "TIF", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
if ( nFirstLong==0x49492a00 || nFirstLong==0x4d4d002a )
{
rFormatExtension=UniString::CreateFromAscii( "TIF", 3 );
- return TRUE;
+ return sal_True;
}
}
//--------------------------- GIF ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "GIF", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
if ( nFirstLong==0x47494638 && (sFirstBytes[4]==0x37 || sFirstBytes[4]==0x39) && sFirstBytes[5]==0x61 )
{
rFormatExtension = UniString::CreateFromAscii( "GIF", 3 );
- return TRUE;
+ return sal_True;
}
}
//--------------------------- PNG ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "PNG", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
if (nFirstLong==0x89504e47 && nSecondLong==0x0d0a1a0a)
{
rFormatExtension = UniString::CreateFromAscii( "PNG", 3 );
- return TRUE;
+ return sal_True;
}
}
//--------------------------- JPG ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "JPG", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
if ( ( nFirstLong==0xffd8ffe0 && sFirstBytes[6]==0x4a && sFirstBytes[7]==0x46 && sFirstBytes[8]==0x49 && sFirstBytes[9]==0x46 ) ||
( nFirstLong==0xffd8fffe ) || ( 0xffd8ff00 == ( nFirstLong & 0xffffff00 ) ) )
{
rFormatExtension = UniString::CreateFromAscii( "JPG", 3 );
- return TRUE;
+ return sal_True;
}
}
//--------------------------- SVM ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "SVM", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
if( nFirstLong==0x53564744 && sFirstBytes[4]==0x49 )
{
rFormatExtension = UniString::CreateFromAscii( "SVM", 3 );
- return TRUE;
+ return sal_True;
}
else if( sFirstBytes[0]==0x56 && sFirstBytes[1]==0x43 && sFirstBytes[2]==0x4C &&
sFirstBytes[3]==0x4D && sFirstBytes[4]==0x54 && sFirstBytes[5]==0x46 )
{
rFormatExtension = UniString::CreateFromAscii( "SVM", 3 );
- return TRUE;
+ return sal_True;
}
}
//--------------------------- PCD ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "PCD", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested = TRUE;
+ bSomethingTested = sal_True;
if( nStreamLen >= 2055 )
{
char sBuf[8];
@@ -481,7 +477,7 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
if( strncmp( sBuf, "PCD_IPI", 7 ) == 0 )
{
rFormatExtension = UniString::CreateFromAscii( "PCD", 3 );
- return TRUE;
+ return sal_True;
}
}
}
@@ -489,30 +485,30 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
//--------------------------- PSD ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "PSD", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested = TRUE;
+ bSomethingTested = sal_True;
if ( ( nFirstLong == 0x38425053 ) && ( (nSecondLong >> 16 ) == 1 ) )
{
rFormatExtension = UniString::CreateFromAscii( "PSD", 3 );
- return TRUE;
+ return sal_True;
}
}
//--------------------------- EPS ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "EPS", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested = TRUE;
- if ( ( nFirstLong == 0xC5D0D3C6 ) || ( ImplSearchEntry( sFirstBytes, (BYTE*)"%!PS-Adobe", 10, 10 ) &&
- ImplSearchEntry( &sFirstBytes[15], (BYTE*)"EPS", 3, 3 ) ) )
+ bSomethingTested = sal_True;
+ if ( ( nFirstLong == 0xC5D0D3C6 ) || ( ImplSearchEntry( sFirstBytes, (sal_uInt8*)"%!PS-Adobe", 10, 10 ) &&
+ ImplSearchEntry( &sFirstBytes[15], (sal_uInt8*)"EPS", 3, 3 ) ) )
{
rFormatExtension = UniString::CreateFromAscii( "EPS", 3 );
- return TRUE;
+ return sal_True;
}
}
//--------------------------- DXF ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "DXF", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
i=0;
while (i<256 && sFirstBytes[i]<=32)
@@ -533,31 +529,63 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
if (strncmp((char*)(sFirstBytes+i),"SECTION",7)==0)
{
rFormatExtension = UniString::CreateFromAscii( "DXF", 3 );
- return TRUE;
+ return sal_True;
}
}
if( strncmp( (char*) sFirstBytes, "AutoCAD Binary DXF", 18 ) == 0 )
{
rFormatExtension = UniString::CreateFromAscii( "DXF", 3 );
- return TRUE;
+ return sal_True;
}
}
//--------------------------- PCT ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "PCT", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested = TRUE;
- BYTE sBuf[4];
+ bSomethingTested = sal_True;
+ sal_uInt8 sBuf[3];
+ // store number format
+ sal_uInt16 oldNumberFormat = rStream.GetNumberFormatInt();
sal_uInt32 nOffset; // in ms documents the pict format is used without the first 512 bytes
- for ( nOffset = 10; ( nOffset <= 522 ) && ( ( nStreamPos + nOffset + 3 ) <= nStreamLen ); nOffset += 512 )
+ for ( nOffset = 0; ( nOffset <= 512 ) && ( ( nStreamPos + nOffset + 14 ) <= nStreamLen ); nOffset += 512 )
{
- rStream.Seek( nStreamPos + nOffset );
+ short y1,x1,y2,x2;
+ bool bdBoxOk = true;
+
+ rStream.Seek( nStreamPos + nOffset);
+ // size of the pict in version 1 pict ( 2bytes) : ignored
+ rStream.SeekRel(2);
+ // bounding box (bytes 2 -> 9)
+ rStream.SetNumberFormatInt(NUMBERFORMAT_INT_BIGENDIAN);
+ rStream >> y1 >> x1 >> y2 >> x2;
+ rStream.SetNumberFormatInt(oldNumberFormat); // reset format
+
+ if (x1 > x2 || y1 > y2 || // bad bdbox
+ (x1 == x2 && y1 == y2) || // 1 pixel picture
+ x2-x1 > 2048 || y2-y1 > 2048 ) // picture anormaly big
+ bdBoxOk = false;
+
+ // read version op
rStream.Read( sBuf,3 );
- if ( sBuf[ 0 ] == 0x00 && sBuf[ 1 ] == 0x11 && ( sBuf[ 2 ] == 0x01 || sBuf[ 2 ] == 0x02 ) )
+ // see http://developer.apple.com/legacy/mac/library/documentation/mac/pdf/Imaging_With_QuickDraw/Appendix_A.pdf
+ // normal version 2 - page A23 and A24
+ if ( sBuf[ 0 ] == 0x00 && sBuf[ 1 ] == 0x11 && sBuf[ 2 ] == 0x02)
+ {
+ rFormatExtension = UniString::CreateFromAscii( "PCT", 3 );
+ return sal_True;
+ }
+ // normal version 1 - page A25
+ else if (sBuf[ 0 ] == 0x11 && sBuf[ 1 ] == 0x01 && bdBoxOk) {
+ rFormatExtension = UniString::CreateFromAscii( "PCT", 3 );
+ return sal_True;
+ }
+ // previous code kept in order to do not break any compatibility
+ // probably eroneous
+ else if ( sBuf[ 0 ] == 0x00 && sBuf[ 1 ] == 0x11 && sBuf[ 2 ] == 0x01 && bdBoxOk)
{
- rFormatExtension = UniString::CreateFromAscii( "PCT", 3 );
- return TRUE;
+ rFormatExtension = UniString::CreateFromAscii( "PCT", 3 );
+ return sal_True;
}
}
}
@@ -568,7 +596,7 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
( rFormatExtension.CompareToAscii( "PGM", 3 ) == COMPARE_EQUAL ) ||
( rFormatExtension.CompareToAscii( "PPM", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
if ( sFirstBytes[ 0 ] == 'P' )
{
switch( sFirstBytes[ 1 ] )
@@ -576,17 +604,17 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
case '1' :
case '4' :
rFormatExtension = UniString::CreateFromAscii( "PBM", 3 );
- return TRUE;
+ return sal_True;
case '2' :
case '5' :
rFormatExtension = UniString::CreateFromAscii( "PGM", 3 );
- return TRUE;
+ return sal_True;
case '3' :
case '6' :
rFormatExtension = UniString::CreateFromAscii( "PPM", 3 );
- return TRUE;
+ return sal_True;
}
}
}
@@ -594,81 +622,81 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
//--------------------------- RAS( SUN RasterFile )------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "RAS", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
if( nFirstLong == 0x59a66a95 )
{
rFormatExtension = UniString::CreateFromAscii( "RAS", 3 );
- return TRUE;
+ return sal_True;
}
}
//--------------------------- XPM ------------------------------------
if( !bTest )
{
- bSomethingTested = TRUE;
- if( ImplSearchEntry( sFirstBytes, (BYTE*)"/* XPM */", 256, 9 ) )
+ bSomethingTested = sal_True;
+ if( ImplSearchEntry( sFirstBytes, (sal_uInt8*)"/* XPM */", 256, 9 ) )
{
rFormatExtension = UniString::CreateFromAscii( "XPM", 3 );
- return TRUE;
+ return sal_True;
}
}
else if( rFormatExtension.CompareToAscii( "XPM", 3 ) == COMPARE_EQUAL )
{
- bSomethingTested = TRUE;
- return TRUE;
+ bSomethingTested = sal_True;
+ return sal_True;
}
//--------------------------- XBM ------------------------------------
if( !bTest )
{
- ULONG nSize = ( nStreamLen > 2048 ) ? 2048 : nStreamLen;
- BYTE* pBuf = new BYTE [ nSize ];
+ sal_uLong nSize = ( nStreamLen > 2048 ) ? 2048 : nStreamLen;
+ sal_uInt8* pBuf = new sal_uInt8 [ nSize ];
rStream.Seek( nStreamPos );
rStream.Read( pBuf, nSize );
- BYTE* pPtr = ImplSearchEntry( pBuf, (BYTE*)"#define", nSize, 7 );
+ sal_uInt8* pPtr = ImplSearchEntry( pBuf, (sal_uInt8*)"#define", nSize, 7 );
if( pPtr )
{
- if( ImplSearchEntry( pPtr, (BYTE*)"_width", pBuf + nSize - pPtr, 6 ) )
+ if( ImplSearchEntry( pPtr, (sal_uInt8*)"_width", pBuf + nSize - pPtr, 6 ) )
{
rFormatExtension = UniString::CreateFromAscii( "XBM", 3 );
delete[] pBuf;
- return TRUE;
+ return sal_True;
}
}
delete[] pBuf;
}
else if( rFormatExtension.CompareToAscii( "XBM", 3 ) == COMPARE_EQUAL )
{
- bSomethingTested = TRUE;
- return TRUE;
+ bSomethingTested = sal_True;
+ return sal_True;
}
//--------------------------- TGA ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "TGA", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested = TRUE;
+ bSomethingTested = sal_True;
if( rFormatExtension.CompareToAscii( "TGA", 3 ) == COMPARE_EQUAL )
- return TRUE;
+ return sal_True;
}
//--------------------------- SGV ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "SGV", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested = TRUE;
+ bSomethingTested = sal_True;
if( rFormatExtension.CompareToAscii( "SGV", 3 ) == COMPARE_EQUAL )
- return TRUE;
+ return sal_True;
}
//--------------------------- SGF ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "SGF", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
if( sFirstBytes[ 0 ] == 'J' && sFirstBytes[ 1 ] == 'J' )
{
rFormatExtension = UniString::CreateFromAscii( "SGF", 3 );
- return TRUE;
+ return sal_True;
}
}
@@ -686,7 +714,7 @@ sal_uInt16 GraphicFilter::ImpTestOrFindFormat( const String& rPath, SvStream& rS
if( rFormat == GRFILTER_FORMAT_DONTKNOW )
{
String aFormatExt;
- if( ImpPeekGraphicFormat( rStream, aFormatExt, FALSE ) )
+ if( ImpPeekGraphicFormat( rStream, aFormatExt, sal_False ) )
{
for( sal_uInt16 i = 0; i < n; i++ )
{
@@ -715,7 +743,7 @@ sal_uInt16 GraphicFilter::ImpTestOrFindFormat( const String& rPath, SvStream& rS
else
{
String aTmpStr( pConfig->GetImportFormatExtension( rFormat ) );
- if( !ImpPeekGraphicFormat( rStream, aTmpStr, TRUE ) )
+ if( !ImpPeekGraphicFormat( rStream, aTmpStr, sal_True ) )
return GRFILTER_FORMATERROR;
if ( pConfig->GetImportFormatExtension( rFormat ).EqualsIgnoreCaseAscii( "pcd" ) )
{
@@ -748,7 +776,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r
if ( rGraphic.GetType() != GRAPHIC_NONE )
{
- sal_Int32 nMode = rConfigItem.ReadInt32( String( ResId( KEY_MODE, *pResMgr ) ), -1 );
+ sal_Int32 nMode = rConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ExportMode" ) ), -1 );
if ( nMode == -1 ) // the property is not there, this is possible, if the graphic filter
{ // is called via UnoGraphicExporter and not from a graphic export Dialog
@@ -778,7 +806,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r
Bitmap aBitmap( rGraphic.GetBitmap() );
MapMode aMap( MAP_100TH_INCH );
- sal_Int32 nDPI = rConfigItem.ReadInt32( String( ResId( KEY_RES, *pResMgr ) ), 75 );
+ sal_Int32 nDPI = rConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Resolution" ) ), 75 );
Fraction aFrac( 1, Min( Max( nDPI, sal_Int32( 75 ) ), sal_Int32( 600 ) ) );
aMap.SetScaleX( aFrac );
@@ -802,7 +830,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r
else
aGraphic = rGraphic;
- sal_Int32 nColors = rConfigItem.ReadInt32( String( ResId( KEY_COLORS, *pResMgr ) ), 0 ); // #92767#
+ sal_Int32 nColors = rConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Color" ) ), 0 ); // #92767#
if ( nColors ) // graphic conversion necessary ?
{
BitmapEx aBmpEx( aGraphic.GetBitmapEx() );
@@ -1047,7 +1075,7 @@ void GraphicFilter::ImplInit()
// ------------------------------------------------------------------------
-ULONG GraphicFilter::ImplSetError( ULONG nError, const SvStream* pStm )
+sal_uLong GraphicFilter::ImplSetError( sal_uLong nError, const SvStream* pStm )
{
pErrorEx->nFilterError = nError;
pErrorEx->nStreamError = pStm ? pStm->GetError() : ERRCODE_NONE;
@@ -1055,28 +1083,28 @@ ULONG GraphicFilter::ImplSetError( ULONG nError, const SvStream* pStm )
}
// ------------------------------------------------------------------------
-USHORT GraphicFilter::GetImportFormatCount()
+sal_uInt16 GraphicFilter::GetImportFormatCount()
{
return pConfig->GetImportFormatCount();
}
// ------------------------------------------------------------------------
-USHORT GraphicFilter::GetImportFormatNumber( const String& rFormatName )
+sal_uInt16 GraphicFilter::GetImportFormatNumber( const String& rFormatName )
{
return pConfig->GetImportFormatNumber( rFormatName );
}
// ------------------------------------------------------------------------
-USHORT GraphicFilter::GetImportFormatNumberForMediaType( const String& rMediaType )
+sal_uInt16 GraphicFilter::GetImportFormatNumberForMediaType( const String& rMediaType )
{
return pConfig->GetImportFormatNumberForMediaType( rMediaType );
}
// ------------------------------------------------------------------------
-USHORT GraphicFilter::GetImportFormatNumberForShortName( const String& rShortName )
+sal_uInt16 GraphicFilter::GetImportFormatNumberForShortName( const String& rShortName )
{
return pConfig->GetImportFormatNumberForShortName( rShortName );
}
@@ -1090,35 +1118,35 @@ sal_uInt16 GraphicFilter::GetImportFormatNumberForTypeName( const String& rType
// ------------------------------------------------------------------------
-String GraphicFilter::GetImportFormatName( USHORT nFormat )
+String GraphicFilter::GetImportFormatName( sal_uInt16 nFormat )
{
return pConfig->GetImportFormatName( nFormat );
}
// ------------------------------------------------------------------------
-String GraphicFilter::GetImportFormatTypeName( USHORT nFormat )
+String GraphicFilter::GetImportFormatTypeName( sal_uInt16 nFormat )
{
return pConfig->GetImportFilterTypeName( nFormat );
}
// ------------------------------------------------------------------------
-String GraphicFilter::GetImportFormatMediaType( USHORT nFormat )
+String GraphicFilter::GetImportFormatMediaType( sal_uInt16 nFormat )
{
return pConfig->GetImportFormatMediaType( nFormat );
}
// ------------------------------------------------------------------------
-String GraphicFilter::GetImportFormatShortName( USHORT nFormat )
+String GraphicFilter::GetImportFormatShortName( sal_uInt16 nFormat )
{
return pConfig->GetImportFormatShortName( nFormat );
}
// ------------------------------------------------------------------------
-String GraphicFilter::GetImportOSFileType( USHORT )
+String GraphicFilter::GetImportOSFileType( sal_uInt16 )
{
String aOSFileType;
return aOSFileType;
@@ -1126,42 +1154,42 @@ String GraphicFilter::GetImportOSFileType( USHORT )
// ------------------------------------------------------------------------
-String GraphicFilter::GetImportWildcard( USHORT nFormat, sal_Int32 nEntry )
+String GraphicFilter::GetImportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry )
{
return pConfig->GetImportWildcard( nFormat, nEntry );
}
// ------------------------------------------------------------------------
-BOOL GraphicFilter::IsImportPixelFormat( USHORT nFormat )
+sal_Bool GraphicFilter::IsImportPixelFormat( sal_uInt16 nFormat )
{
return pConfig->IsImportPixelFormat( nFormat );
}
// ------------------------------------------------------------------------
-USHORT GraphicFilter::GetExportFormatCount()
+sal_uInt16 GraphicFilter::GetExportFormatCount()
{
return pConfig->GetExportFormatCount();
}
// ------------------------------------------------------------------------
-USHORT GraphicFilter::GetExportFormatNumber( const String& rFormatName )
+sal_uInt16 GraphicFilter::GetExportFormatNumber( const String& rFormatName )
{
return pConfig->GetExportFormatNumber( rFormatName );
}
// ------------------------------------------------------------------------
-USHORT GraphicFilter::GetExportFormatNumberForMediaType( const String& rMediaType )
+sal_uInt16 GraphicFilter::GetExportFormatNumberForMediaType( const String& rMediaType )
{
return pConfig->GetExportFormatNumberForMediaType( rMediaType );
}
// ------------------------------------------------------------------------
-USHORT GraphicFilter::GetExportFormatNumberForShortName( const String& rShortName )
+sal_uInt16 GraphicFilter::GetExportFormatNumberForShortName( const String& rShortName )
{
return pConfig->GetExportFormatNumberForShortName( rShortName );
}
@@ -1175,35 +1203,35 @@ sal_uInt16 GraphicFilter::GetExportFormatNumberForTypeName( const String& rType
// ------------------------------------------------------------------------
-String GraphicFilter::GetExportFormatName( USHORT nFormat )
+String GraphicFilter::GetExportFormatName( sal_uInt16 nFormat )
{
return pConfig->GetExportFormatName( nFormat );
}
// ------------------------------------------------------------------------
-String GraphicFilter::GetExportFormatTypeName( USHORT nFormat )
+String GraphicFilter::GetExportFormatTypeName( sal_uInt16 nFormat )
{
return pConfig->GetExportFilterTypeName( nFormat );
}
// ------------------------------------------------------------------------
-String GraphicFilter::GetExportFormatMediaType( USHORT nFormat )
+String GraphicFilter::GetExportFormatMediaType( sal_uInt16 nFormat )
{
return pConfig->GetExportFormatMediaType( nFormat );
}
// ------------------------------------------------------------------------
-String GraphicFilter::GetExportFormatShortName( USHORT nFormat )
+String GraphicFilter::GetExportFormatShortName( sal_uInt16 nFormat )
{
return pConfig->GetExportFormatShortName( nFormat );
}
// ------------------------------------------------------------------------
-String GraphicFilter::GetExportOSFileType( USHORT )
+String GraphicFilter::GetExportOSFileType( sal_uInt16 )
{
String aOSFileType;
return aOSFileType;
@@ -1211,22 +1239,22 @@ String GraphicFilter::GetExportOSFileType( USHORT )
// ------------------------------------------------------------------------
-String GraphicFilter::GetExportWildcard( USHORT nFormat, sal_Int32 nEntry )
+String GraphicFilter::GetExportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry )
{
return pConfig->GetExportWildcard( nFormat, nEntry );
}
// ------------------------------------------------------------------------
-BOOL GraphicFilter::IsExportPixelFormat( USHORT nFormat )
+sal_Bool GraphicFilter::IsExportPixelFormat( sal_uInt16 nFormat )
{
return pConfig->IsExportPixelFormat( nFormat );
}
// ------------------------------------------------------------------------
-USHORT GraphicFilter::CanImportGraphic( const INetURLObject& rPath,
- USHORT nFormat, USHORT* pDeterminedFormat )
+sal_uInt16 GraphicFilter::CanImportGraphic( const INetURLObject& rPath,
+ sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat )
{
sal_uInt16 nRetValue = GRFILTER_FORMATERROR;
DBG_ASSERT( rPath.GetProtocol() != INET_PROT_NOT_VALID, "GraphicFilter::CanImportGraphic() : ProtType == INET_PROT_NOT_VALID" );
@@ -1243,10 +1271,10 @@ USHORT GraphicFilter::CanImportGraphic( const INetURLObject& rPath,
// ------------------------------------------------------------------------
-USHORT GraphicFilter::CanImportGraphic( const String& rMainUrl, SvStream& rIStream,
- USHORT nFormat, USHORT* pDeterminedFormat )
+sal_uInt16 GraphicFilter::CanImportGraphic( const String& rMainUrl, SvStream& rIStream,
+ sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat )
{
- ULONG nStreamPos = rIStream.Tell();
+ sal_uLong nStreamPos = rIStream.Tell();
sal_uInt16 nRes = ImpTestOrFindFormat( rMainUrl, rIStream, nFormat );
rIStream.Seek(nStreamPos);
@@ -1254,13 +1282,13 @@ USHORT GraphicFilter::CanImportGraphic( const String& rMainUrl, SvStream& rIStre
if( nRes==GRFILTER_OK && pDeterminedFormat!=NULL )
*pDeterminedFormat = nFormat;
- return (USHORT) ImplSetError( nRes, &rIStream );
+ return (sal_uInt16) ImplSetError( nRes, &rIStream );
}
// ------------------------------------------------------------------------
//SJ: TODO, we need to create a GraphicImporter component
-USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const INetURLObject& rPath,
- USHORT nFormat, USHORT * pDeterminedFormat, sal_uInt32 nImportFlags )
+sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const INetURLObject& rPath,
+ sal_uInt16 nFormat, sal_uInt16 * pDeterminedFormat, sal_uInt32 nImportFlags )
{
sal_uInt16 nRetValue = GRFILTER_FORMATERROR;
DBG_ASSERT( rPath.GetProtocol() != INET_PROT_NOT_VALID, "GraphicFilter::ImportGraphic() : ProtType == INET_PROT_NOT_VALID" );
@@ -1275,25 +1303,25 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const INetURLObject& rPa
return nRetValue;
}
-USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream,
- USHORT nFormat, USHORT* pDeterminedFormat, sal_uInt32 nImportFlags )
+sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream,
+ sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat, sal_uInt32 nImportFlags )
{
return ImportGraphic( rGraphic, rPath, rIStream, nFormat, pDeterminedFormat, nImportFlags, NULL );
}
//-------------------------------------------------------------------------
-USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream,
- USHORT nFormat, USHORT* pDeterminedFormat, sal_uInt32 nImportFlags,
+sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream,
+ sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat, sal_uInt32 nImportFlags,
com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData )
{
String aFilterName;
- ULONG nStmBegin;
- USHORT nStatus;
+ sal_uLong nStmBegin;
+ sal_uInt16 nStatus;
GraphicReader* pContext = rGraphic.GetContext();
GfxLinkType eLinkType = GFX_LINK_TYPE_NONE;
- BOOL bDummyContext = ( pContext == (GraphicReader*) 1 );
- const BOOL bLinkSet = rGraphic.IsLink();
+ sal_Bool bDummyContext = ( pContext == (GraphicReader*) 1 );
+ const sal_Bool bLinkSet = rGraphic.IsLink();
FilterConfigItem* pFilterConfigItem = NULL;
Size aPreviewSizeHint( 0, 0 );
@@ -1344,7 +1372,7 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS
else
nStmBegin = rIStream.Tell();
- bAbort = FALSE;
+ bAbort = sal_False;
nStatus = ImpTestOrFindFormat( rPath, rIStream, nFormat );
// Falls Pending, geben wir GRFILTER_OK zurueck,
// um mehr Bytes anzufordern
@@ -1353,13 +1381,13 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS
rGraphic.SetContext( (GraphicReader*) 1 );
rIStream.ResetError();
rIStream.Seek( nStmBegin );
- return (USHORT) ImplSetError( GRFILTER_OK );
+ return (sal_uInt16) ImplSetError( GRFILTER_OK );
}
rIStream.Seek( nStmBegin );
if( ( nStatus != GRFILTER_OK ) || rIStream.GetError() )
- return (USHORT) ImplSetError( ( nStatus != GRFILTER_OK ) ? nStatus : GRFILTER_OPENERROR, &rIStream );
+ return (sal_uInt16) ImplSetError( ( nStatus != GRFILTER_OK ) ? nStatus : GRFILTER_OPENERROR, &rIStream );
if( pDeterminedFormat )
*pDeterminedFormat = nFormat;
@@ -1493,7 +1521,7 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS
else if( aFilterName.EqualsIgnoreCaseAscii( IMP_SVSGF )
|| aFilterName.EqualsIgnoreCaseAscii( IMP_SVSGV ) )
{
- USHORT nVersion;
+ sal_uInt16 nVersion;
unsigned char nTyp = CheckSgfTyp( rIStream, nVersion );
switch( nTyp )
@@ -1605,15 +1633,15 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS
if( nStatus == GRFILTER_OK && bCreateNativeLink && ( eLinkType != GFX_LINK_TYPE_NONE ) && !rGraphic.GetContext() && !bLinkSet )
{
- const ULONG nStmEnd = rIStream.Tell();
- const ULONG nBufSize = nStmEnd - nStmBegin;
+ const sal_uLong nStmEnd = rIStream.Tell();
+ const sal_uLong nBufSize = nStmEnd - nStmBegin;
if( nBufSize )
{
- BYTE* pBuf=0;
+ sal_uInt8* pBuf=0;
try
{
- pBuf = new BYTE[ nBufSize ];
+ pBuf = new sal_uInt8[ nBufSize ];
}
catch (std::bad_alloc)
{
@@ -1624,7 +1652,7 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS
{
rIStream.Seek( nStmBegin );
rIStream.Read( pBuf, nBufSize );
- rGraphic.SetLink( GfxLink( pBuf, nBufSize, eLinkType, TRUE ) );
+ rGraphic.SetLink( GfxLink( pBuf, nBufSize, eLinkType, sal_True ) );
}
}
}
@@ -1647,12 +1675,12 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS
// ------------------------------------------------------------------------
-USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const INetURLObject& rPath,
+sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const INetURLObject& rPath,
sal_uInt16 nFormat, const uno::Sequence< beans::PropertyValue >* pFilterData )
{
sal_uInt16 nRetValue = GRFILTER_FORMATERROR;
DBG_ASSERT( rPath.GetProtocol() != INET_PROT_NOT_VALID, "GraphicFilter::ExportGraphic() : ProtType == INET_PROT_NOT_VALID" );
- BOOL bAlreadyExists = ImplDirEntryHelper::Exists( rPath );
+ sal_Bool bAlreadyExists = ImplDirEntryHelper::Exists( rPath );
String aMainUrl( rPath.GetMainURL( INetURLObject::NO_DECODE ) );
SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aMainUrl, STREAM_WRITE | STREAM_TRUNC );
@@ -1669,10 +1697,10 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const INetURLObjec
// ------------------------------------------------------------------------
-USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPath,
+sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPath,
SvStream& rOStm, sal_uInt16 nFormat, const uno::Sequence< beans::PropertyValue >* pFilterData )
{
- USHORT nFormatCount = GetExportFormatCount();
+ sal_uInt16 nFormatCount = GetExportFormatCount();
ResetLastError();
nExpGraphHint = 0;
@@ -1683,7 +1711,7 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat
String aExt( aURL.GetFileExtension().toAsciiUpperCase() );
- for( USHORT i = 0; i < nFormatCount; i++ )
+ for( sal_uInt16 i = 0; i < nFormatCount; i++ )
{
if ( pConfig->GetExportFormatExtension( i ).EqualsIgnoreCaseAscii( aExt ) )
{
@@ -1693,13 +1721,13 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat
}
}
if( nFormat >= nFormatCount )
- return (USHORT) ImplSetError( GRFILTER_FORMATERROR );
+ return (sal_uInt16) ImplSetError( GRFILTER_FORMATERROR );
FilterConfigItem aConfigItem( (uno::Sequence< beans::PropertyValue >*)pFilterData );
String aFilterName( pConfig->GetExportFilterName( nFormat ) );
- bAbort = FALSE;
- USHORT nStatus = GRFILTER_OK;
+ bAbort = sal_False;
+ sal_uInt16 nStatus = GRFILTER_OK;
GraphicType eType;
Graphic aGraphic( rGraphic );
@@ -1711,12 +1739,12 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat
if( eType != GRAPHIC_BITMAP )
{
Size aSizePixel;
- ULONG nColorCount,nBitsPerPixel,nNeededMem,nMaxMem;
+ sal_uLong nColorCount,nBitsPerPixel,nNeededMem,nMaxMem;
VirtualDevice aVirDev;
// Maximalen Speicherbedarf fuer das Bildes holen:
// if( GetOptionsConfig() )
-// nMaxMem = (UINT32)GetOptionsConfig()->ReadKey( "VEC-TO-PIX-MAX-KB", "1024" ).ToInt32();
+// nMaxMem = (sal_uInt32)GetOptionsConfig()->ReadKey( "VEC-TO-PIX-MAX-KB", "1024" ).ToInt32();
// else
nMaxMem = 1024;
@@ -1733,14 +1761,14 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat
else if (nColorCount<=256) nBitsPerPixel=8;
else if (nColorCount<=65536) nBitsPerPixel=16;
else nBitsPerPixel=24;
- nNeededMem=((ULONG)aSizePixel.Width()*(ULONG)aSizePixel.Height()*nBitsPerPixel+7)/8;
+ nNeededMem=((sal_uLong)aSizePixel.Width()*(sal_uLong)aSizePixel.Height()*nBitsPerPixel+7)/8;
// ggf. Groesse des Bildes einschraenken:
if (nMaxMem<nNeededMem)
{
double fFak=sqrt(((double)nMaxMem)/((double)nNeededMem));
- aSizePixel.Width()=(ULONG)(((double)aSizePixel.Width())*fFak);
- aSizePixel.Height()=(ULONG)(((double)aSizePixel.Height())*fFak);
+ aSizePixel.Width()=(sal_uLong)(((double)aSizePixel.Width())*fFak);
+ aSizePixel.Height()=(sal_uLong)(((double)aSizePixel.Height())*fFak);
}
aVirDev.SetMapMode(MapMode(MAP_PIXEL));
@@ -1761,13 +1789,13 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat
{
Bitmap aBmp( aGraphic.GetBitmap() );
sal_Int32 nColorRes = aConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Colors" ) ), 0 );
- if ( nColorRes && ( nColorRes <= (USHORT)BMP_CONVERSION_24BIT) )
+ if ( nColorRes && ( nColorRes <= (sal_uInt16)BMP_CONVERSION_24BIT) )
{
if( !aBmp.Convert( (BmpConversion) nColorRes ) )
aBmp = aGraphic.GetBitmap();
}
ResMgr* pResMgr = CREATERESMGR( svt );
- sal_Bool bRleCoding = aConfigItem.ReadBool( String( ResId( KEY_RLE_CODING, *pResMgr ) ), sal_True );
+ sal_Bool bRleCoding = aConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "RLE_Coding" ) ), sal_True );
// Wollen wir RLE-Kodiert speichern?
aBmp.Write( rOStm, bRleCoding );
delete pResMgr;
@@ -1987,16 +2015,16 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat
// ------------------------------------------------------------------------
-BOOL GraphicFilter::Setup( USHORT )
+sal_Bool GraphicFilter::Setup( sal_uInt16 )
{
- return FALSE;
+ return sal_False;
}
/* ------------------------------------------------------------------------
No Import filter has a dialog, so
the following two methods are obsolete */
-BOOL GraphicFilter::HasImportDialog( USHORT )
+sal_Bool GraphicFilter::HasImportDialog( sal_uInt16 )
{
return sal_True;
// return pConfig->IsImportDialog( nFormat );
@@ -2004,26 +2032,26 @@ BOOL GraphicFilter::HasImportDialog( USHORT )
// ------------------------------------------------------------------------
-BOOL GraphicFilter::DoImportDialog( Window*, USHORT )
+sal_Bool GraphicFilter::DoImportDialog( Window*, sal_uInt16 )
{
return sal_True;
}
// ------------------------------------------------------------------------
-BOOL GraphicFilter::HasExportDialog( USHORT nFormat )
+sal_Bool GraphicFilter::HasExportDialog( sal_uInt16 nFormat )
{
return pConfig->IsExportDialog( nFormat );
}
// ------------------------------------------------------------------------
-BOOL GraphicFilter::DoExportDialog( Window* pWindow, USHORT nFormat )
+sal_Bool GraphicFilter::DoExportDialog( Window* pWindow, sal_uInt16 nFormat )
{
return DoExportDialog( pWindow, nFormat, FUNIT_MM );
}
-BOOL GraphicFilter::DoExportDialog( Window*, USHORT nFormat, FieldUnit )
+sal_Bool GraphicFilter::DoExportDialog( Window*, sal_uInt16 nFormat, FieldUnit )
{
sal_Bool bRet = sal_False;
com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
@@ -2081,7 +2109,7 @@ IMPL_LINK( GraphicFilter, FilterCallback, ConvertData*, pData )
if( pData )
{
- USHORT nFormat = GRFILTER_FORMAT_DONTKNOW;
+ sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW;
ByteString aShortName;
switch( pData->mnFormat )
{
@@ -2129,12 +2157,12 @@ GraphicFilter* GraphicFilter::GetGraphicFilter()
int GraphicFilter::LoadGraphic( const String &rPath, const String &rFilterName,
Graphic& rGraphic, GraphicFilter* pFilter,
- USHORT* pDeterminedFormat )
+ sal_uInt16* pDeterminedFormat )
{
if ( !pFilter )
pFilter = GetGraphicFilter();
- const USHORT nFilter = rFilterName.Len() && pFilter->GetImportFormatCount()
+ const sal_uInt16 nFilter = rFilterName.Len() && pFilter->GetImportFormatCount()
? pFilter->GetImportFormatNumber( rFilterName )
: GRFILTER_FORMAT_DONTKNOW;
diff --git a/svtools/source/filter.vcl/filter/filter2.cxx b/svtools/source/filter.vcl/filter/filter2.cxx
index 0220961b657a..586591b4d86c 100644
--- a/svtools/source/filter.vcl/filter/filter2.cxx
+++ b/svtools/source/filter.vcl/filter/filter2.cxx
@@ -41,30 +41,7 @@
#define DATA_SIZE 640
-BYTE* ImplSearchEntry( BYTE* , BYTE* , ULONG , ULONG );
-
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-GraphicDescriptor::GraphicDescriptor( const String* pPath ) :
- pFileStm ( NULL )
-{
- ImpConstruct();
-
- if ( pPath )
- {
- INetURLObject aURL( *pPath, INET_PROT_FILE );
- aPathExt = aURL.GetFileExtension().toAsciiLowerCase();
- }
- bLinked = TRUE;
- bLinkChanged = FALSE;
- bWideSearch = FALSE;
-}
-
+sal_uInt8* ImplSearchEntry( sal_uInt8* , sal_uInt8* , sal_uLong , sal_uLong );
/*************************************************************************
|*
@@ -74,19 +51,10 @@ GraphicDescriptor::GraphicDescriptor( const String* pPath ) :
GraphicDescriptor::GraphicDescriptor( const INetURLObject& rPath ) :
pFileStm( ::utl::UcbStreamHelper::CreateStream( rPath.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ) ),
- aPathExt( rPath.GetFileExtension().toAsciiLowerCase() )
+ aPathExt( rPath.GetFileExtension().toAsciiLowerCase() ),
+ bOwnStream( sal_True )
{
- if ( pFileStm )
- {
- nStmPos = 0;
- pFileStm->Seek( nStmPos );
- bDataReady = TRUE;
- }
-
ImpConstruct();
-
- if ( pFileStm && !pFileStm->GetError() )
- bDataReady = TRUE;
}
/*************************************************************************
@@ -96,7 +64,8 @@ GraphicDescriptor::GraphicDescriptor( const INetURLObject& rPath ) :
\************************************************************************/
GraphicDescriptor::GraphicDescriptor( SvStream& rInStream, const String* pPath) :
- pFileStm ( NULL )
+ pFileStm ( &rInStream ),
+ bOwnStream ( sal_False )
{
ImpConstruct();
@@ -105,15 +74,8 @@ GraphicDescriptor::GraphicDescriptor( SvStream& rInStream, const String* pPath)
INetURLObject aURL( *pPath );
aPathExt = aURL.GetFileExtension().toAsciiLowerCase();
}
- nStmPos = rInStream.Tell();
- pBaseStm = &rInStream;
- bBaseStm = TRUE;
-
- if ( !pBaseStm->GetError() )
- bDataReady = TRUE;
}
-
/*************************************************************************
|*
|*
@@ -122,150 +84,54 @@ GraphicDescriptor::GraphicDescriptor( SvStream& rInStream, const String* pPath)
GraphicDescriptor::~GraphicDescriptor()
{
- delete pFileStm;
+ if ( bOwnStream )
+ delete pFileStm;
}
-
/*************************************************************************
|*
|*
|*
\************************************************************************/
-BOOL GraphicDescriptor::Detect( BOOL bExtendedInfo )
+sal_Bool GraphicDescriptor::Detect( sal_Bool bExtendedInfo )
{
- BOOL bRet = FALSE;
-
- // Link-Status ueberpruefen
- if ( bLinked && bLinkChanged )
- {
- DBG_ASSERT( aReqLink.IsSet(), "Wo ist der RequestHandler???" );
- pMemStm = (SvStream*) aReqLink.Call( this );
- if ( pMemStm )
- {
- nStmPos = pMemStm->Tell();
- bDataReady = TRUE;
- }
- }
-
- if ( bDataReady )
+ sal_Bool bRet = sal_False;
+ if ( pFileStm && !pFileStm->GetError() )
{
- SvStream& rStm = GetSearchStream();
- UINT16 nOldFormat = rStm.GetNumberFormatInt();
-
- if ( ImpDetectGIF( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectJPG( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectBMP( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectPNG( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectTIF( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectPCX( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectDXF( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectMET( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectSGF( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectSGV( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectSVM( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectWMF( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectEMF( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectPCT( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectXBM( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectXPM( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectPBM( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectPGM( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectPPM( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectRAS( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectTGA( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectPSD( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectEPS( rStm, bExtendedInfo ) ) bRet = TRUE;
-
- // diese Formate lassen sich nur bei WideSearch im gesamten
- // Stream ermitteln
- else if ( bWideSearch )
- {
- if ( ImpDetectPCD( rStm, bExtendedInfo ) )
- bRet = TRUE;
- }
+ SvStream& rStm = *pFileStm;
+ sal_uInt16 nOldFormat = rStm.GetNumberFormatInt();
+
+ if ( ImpDetectGIF( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectJPG( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectBMP( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectPNG( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectTIF( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectPCX( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectDXF( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectMET( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectSGF( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectSGV( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectSVM( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectWMF( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectEMF( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectPCT( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectXBM( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectXPM( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectPBM( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectPGM( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectPPM( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectRAS( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectTGA( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectPSD( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectEPS( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectPCD( rStm, bExtendedInfo ) ) bRet = sal_True;
rStm.SetNumberFormatInt( nOldFormat );
- rStm.Seek( nStmPos );
}
-
return bRet;
}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-BOOL GraphicDescriptor::IsDataReady() const
-{
- return bDataReady;
-}
-
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-BOOL GraphicDescriptor::IsWideSearch() const
-{
- return bWideSearch;
-}
-
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-SvStream& GraphicDescriptor::GetSearchStream() const
-{
- DBG_ASSERT( bDataReady, "Was laeuft hier falsch???" );
-
- if ( bLinked )
- return *pMemStm;
- else if ( bBaseStm )
- return *pBaseStm;
- else
- return *pFileStm;
-}
-
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-void GraphicDescriptor::SetRequestHdl( const Link& rRequestLink )
-{
- aReqLink = rRequestLink;
- bLinkChanged = TRUE;
-}
-
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-ULONG GraphicDescriptor::GetRequestedByteCount() const
-{
- return DATA_SIZE;
-}
-
-
-/******************************************************************************/
-/* IMP-Methoden */
-/* */
-
-
/*************************************************************************
|*
|*
@@ -274,17 +140,10 @@ ULONG GraphicDescriptor::GetRequestedByteCount() const
void GraphicDescriptor::ImpConstruct()
{
- if ( !pFileStm )
- pFileStm = new SvStream();
nFormat = GFF_NOT;
nBitsPerPixel = 0;
nPlanes = 0;
- bCompressed = FALSE;
- bDataReady = FALSE;
- bLinked = FALSE;
- bWideSearch = TRUE;
- bBaseStm = FALSE;
- pMemStm = NULL;
+ bCompressed = sal_False;
}
@@ -294,14 +153,13 @@ void GraphicDescriptor::ImpConstruct()
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo )
+sal_Bool GraphicDescriptor::ImpDetectBMP( SvStream& rStm, sal_Bool bExtendedInfo )
{
- UINT16 nTemp16;
- BOOL bRet = FALSE;
+ sal_uInt16 nTemp16;
+ sal_Bool bRet = sal_False;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- rStm.Seek( nStmPos );
-
rStm >> nTemp16;
// OS/2-BitmapArray
@@ -315,12 +173,12 @@ BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo )
if ( nTemp16 == 0x4d42 )
{
nFormat = GFF_BMP;
- bRet = TRUE;
+ bRet = sal_True;
if ( bExtendedInfo )
{
- UINT32 nTemp32;
- UINT32 nCompression;
+ sal_uInt32 nTemp32;
+ sal_uInt32 nCompression;
// bis zur ersten Information
rStm.SeekRel( 0x10 );
@@ -361,11 +219,11 @@ BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo )
if ( ( nBitsPerPixel > 24 ) || ( nCompression > 3 ) )
{
nFormat = GFF_NOT;
- bRet = FALSE;
+ bRet = sal_False;
}
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -376,28 +234,28 @@ BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo )
+sal_Bool GraphicDescriptor::ImpDetectGIF( SvStream& rStm, sal_Bool bExtendedInfo )
{
- UINT32 n32;
- UINT16 n16;
- BOOL bRet = FALSE;
- BYTE cByte;
+ sal_uInt32 n32;
+ sal_uInt16 n16;
+ sal_Bool bRet = sal_False;
+ sal_uInt8 cByte;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- rStm.Seek( nStmPos );
-
rStm >> n32;
+
if ( n32 == 0x38464947 )
{
rStm >> n16;
if ( ( n16 == 0x6137 ) || ( n16 == 0x6139 ) )
{
nFormat = GFF_GIF;
- bRet = TRUE;
+ bRet = sal_True;
if ( bExtendedInfo )
{
- UINT16 nTemp16;
+ sal_uInt16 nTemp16;
// PixelBreite auslesen
rStm >> nTemp16;
@@ -413,7 +271,7 @@ BOOL GraphicDescriptor::ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo )
}
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -424,125 +282,188 @@ BOOL GraphicDescriptor::ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo )
+// returns the next jpeg marker, a return value of 0 represents an error
+sal_uInt8 ImpDetectJPG_GetNextMarker( SvStream& rStm )
{
- UINT32 nTemp32;
- BOOL bRet = FALSE;
- BYTE cByte = 0;
- BOOL bM_COM;
+ sal_uInt8 nByte;
+ do
+ {
+ do
+ {
+ rStm >> nByte;
+ if ( rStm.IsEof() || rStm.GetError() ) // as 0 is not allowed as marker,
+ return 0; // we can use it as errorcode
+ }
+ while ( nByte != 0xff );
+ do
+ {
+ rStm >> nByte;
+ if ( rStm.IsEof() || rStm.GetError() )
+ return 0;
+ }
+ while( nByte == 0xff );
+ }
+ while( nByte == 0 ); // 0xff00 represents 0xff and not a marker,
+ // the marker detection has to be restartet.
+ return nByte;
+}
- rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
- rStm.Seek( nStmPos );
+sal_Bool GraphicDescriptor::ImpDetectJPG( SvStream& rStm, sal_Bool bExtendedInfo )
+{
+ sal_uInt32 nTemp32;
+ sal_Bool bRet = sal_False;
+ sal_Int32 nStmPos = rStm.Tell();
+
+ rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
rStm >> nTemp32;
- // compare upper 28 bits
+ // compare upper 24 bits
if( 0xffd8ff00 == ( nTemp32 & 0xffffff00 ) )
{
nFormat = GFF_JPG;
- return TRUE;
- }
-
- bM_COM = ( nTemp32 == 0xffd8fffe );
- if ( ( nTemp32 == 0xffd8ffe0 ) || bM_COM )
- {
- if( !bM_COM )
- {
- rStm.SeekRel( 2 );
- rStm >> nTemp32;
- }
+ bRet = sal_True;
- if( bM_COM || ( nTemp32 == 0x4a464946 ) )
+ if ( bExtendedInfo )
{
- nFormat = GFF_JPG;
- bRet = TRUE;
-
- if( bExtendedInfo )
- {
- MapMode aMap;
- UINT16 nTemp16;
- ULONG nCount = 9;
- ULONG nMax;
- ULONG nResX;
- ULONG nResY;
- BYTE cUnit;
-
- // Groesse des verbleibenden Puffers ermitteln
- if ( bLinked )
- nMax = static_cast< SvMemoryStream& >(rStm).GetEndOfData()
- - 16;
- else
- nMax = DATA_SIZE - 16;
+ rStm.SeekRel( -2 );
- // max. 8K
- nMax = Min( nMax, (ULONG) 8192 );
+ sal_uInt32 nError( rStm.GetError() );
- // Res-Unit ermitteln
- rStm.SeekRel( 3 );
- rStm >> cUnit;
+ sal_Bool bScanFailure = sal_False;
+ sal_Bool bScanFinished = sal_False;
- // ResX ermitteln
- rStm >> nTemp16;
- nResX = nTemp16;
-
- // ResY ermitteln
- rStm >> nTemp16;
- nResY = nTemp16;
-
- // SOF0/1-Marker finden, aber dabei
- // nicht mehr als DATA_SIZE Pixel lesen, falls
- // kein WideSearch
- do
+ while( !bScanFailure && !bScanFinished && !rStm.IsEof() && !rStm.GetError() )
+ {
+ sal_uInt8 nMarker = ImpDetectJPG_GetNextMarker( rStm );
+ switch( nMarker )
{
- while ( ( cByte != 0xff ) &&
- ( bWideSearch || ( nCount++ < nMax ) ) )
+ // fixed size marker, not having a two byte length parameter
+ case 0xd0 : // RST0
+ case 0xd1 :
+ case 0xd2 :
+ case 0xd3 :
+ case 0xd4 :
+ case 0xd5 :
+ case 0xd6 :
+ case 0xd7 : // RST7
+ case 0x01 : // TEM
+ break;
+
+ case 0xd8 : // SOI (has already been checked, there should not be a second one)
+ case 0x00 : // marker is invalid, we should stop now
+ bScanFailure = sal_True;
+ break;
+
+ case 0xd9 : // EOI
+ bScanFinished = sal_True;
+ break;
+
+ // per default we assume marker segments conaining a length parameter
+ default :
{
- rStm >> cByte;
- }
-
- while ( ( cByte == 0xff ) &&
- ( bWideSearch || ( nCount++ < nMax ) ) )
- {
- rStm >> cByte;
- }
- }
- while ( ( cByte != 0xc0 ) &&
- ( cByte != 0xc1 ) &&
- ( bWideSearch || ( nCount < nMax ) ) );
-
- // wir haben den SOF0/1-Marker
- if ( ( cByte == 0xc0 ) || ( cByte == 0xc1 ) )
- {
- // Hoehe einlesen
- rStm.SeekRel( 3 );
- rStm >> nTemp16;
- aPixSize.Height() = nTemp16;
-
- // Breite einlesen
- rStm >> nTemp16;
- aPixSize.Width() = nTemp16;
+ sal_uInt16 nLength;
+ rStm >> nLength;
- // Bit/Pixel einlesen
- rStm >> cByte;
- nBitsPerPixel = ( cByte == 3 ? 24 : cByte == 1 ? 8 : 0 );
+ if ( nLength < 2 )
+ bScanFailure = sal_True;
+ else
+ {
+ sal_uInt32 nNextMarkerPos = rStm.Tell() + nLength - 2;
+ switch( nMarker )
+ {
+ case 0xe0 : // APP0 Marker
+ {
+ if ( nLength == 16 )
+ {
+ sal_Int32 nIdentifier;
+ rStm >> nIdentifier;
+ if ( nIdentifier == 0x4a464946 ) // JFIF Identifier
+ {
+ sal_uInt8 nStringTerminator;
+ sal_uInt8 nMajorRevision;
+ sal_uInt8 nMinorRevision;
+ sal_uInt8 nUnits;
+ sal_uInt16 nHorizontalResolution;
+ sal_uInt16 nVerticalResolution;
+ sal_uInt8 nHorzThumbnailPixelCount;
+ sal_uInt8 nVertThumbnailPixelCount;
+
+ rStm >> nStringTerminator
+ >> nMajorRevision
+ >> nMinorRevision
+ >> nUnits
+ >> nHorizontalResolution
+ >> nVerticalResolution
+ >> nHorzThumbnailPixelCount
+ >> nVertThumbnailPixelCount;
+
+ // setting the logical size
+ if ( nUnits && nHorizontalResolution && nVerticalResolution )
+ {
+ MapMode aMap;
+ aMap.SetMapUnit( nUnits == 1 ? MAP_INCH : MAP_CM );
+ aMap.SetScaleX( Fraction( 1, nHorizontalResolution ) );
+ aMap.SetScaleY( Fraction( 1, nVerticalResolution ) );
+ aLogSize = OutputDevice::LogicToLogic( aPixSize, aMap, MapMode( MAP_100TH_MM ) );
+ }
+ }
+ }
+ }
+ break;
- // logische Groesse setzen
- if ( cUnit && nResX && nResY )
- {
- aMap.SetMapUnit( cUnit == 1 ? MAP_INCH : MAP_CM );
- aMap.SetScaleX( Fraction( 1, nResX ) );
- aMap.SetScaleY( Fraction( 1, nResY ) );
- aLogSize = OutputDevice::LogicToLogic( aPixSize, aMap,
- MapMode( MAP_100TH_MM ) );
+ // Start of Frame Markers
+ case 0xc0 : // SOF0
+ case 0xc1 : // SOF1
+ case 0xc2 : // SOF2
+ case 0xc3 : // SOF3
+ case 0xc5 : // SOF5
+ case 0xc6 : // SOF6
+ case 0xc7 : // SOF7
+ case 0xc9 : // SOF9
+ case 0xca : // SOF10
+ case 0xcb : // SOF11
+ case 0xcd : // SOF13
+ case 0xce : // SOF14
+ case 0xcf : // SOF15
+ {
+ sal_uInt8 nSamplePrecision;
+ sal_uInt16 nNumberOfLines;
+ sal_uInt16 nSamplesPerLine;
+ sal_uInt8 nNumberOfImageComponents;
+ sal_uInt8 nComponentsIdentifier;
+ sal_uInt8 nHorizontalSamplingFactor;
+ sal_uInt8 nVerticalSamplingFactor;
+ sal_uInt8 nQuantizationTableDestinationSelector;
+ rStm >> nSamplePrecision
+ >> nNumberOfLines
+ >> nSamplesPerLine
+ >> nNumberOfImageComponents
+ >> nComponentsIdentifier
+ >> nHorizontalSamplingFactor
+ >> nQuantizationTableDestinationSelector;
+ nVerticalSamplingFactor = nHorizontalSamplingFactor & 0xf;
+ nHorizontalSamplingFactor >>= 4;
+
+ aPixSize.Height() = nNumberOfLines;
+ aPixSize.Width() = nSamplesPerLine;
+ nBitsPerPixel = ( nNumberOfImageComponents == 3 ? 24 : nNumberOfImageComponents == 1 ? 8 : 0 );
+ nPlanes = 1;
+
+ bScanFinished = sal_True;
+ }
+ break;
+ }
+ rStm.Seek( nNextMarkerPos );
+ }
}
-
- // Planes immer 1
- nPlanes = 1;
+ break;
}
}
+ rStm.SetError( nError );
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -553,41 +474,30 @@ BOOL GraphicDescriptor::ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectPCD( SvStream& rStm, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectPCD( SvStream& rStm, sal_Bool )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- rStm.Seek( nStmPos );
- if ( bWideSearch )
- {
- UINT32 nTemp32;
- UINT16 nTemp16;
- BYTE cByte;
+ sal_uInt32 nTemp32;
+ sal_uInt16 nTemp16;
+ sal_uInt8 cByte;
- rStm.SeekRel( 2048 );
- rStm >> nTemp32;
- rStm >> nTemp16;
- rStm >> cByte;
+ rStm.SeekRel( 2048 );
+ rStm >> nTemp32;
+ rStm >> nTemp16;
+ rStm >> cByte;
- if ( ( nTemp32 == 0x5f444350 ) &&
- ( nTemp16 == 0x5049 ) &&
- ( cByte == 0x49 ) )
- {
- nFormat = GFF_PCD;
- bRet = TRUE;
- }
- }
- else
+ if ( ( nTemp32 == 0x5f444350 ) &&
+ ( nTemp16 == 0x5049 ) &&
+ ( cByte == 0x49 ) )
{
- bRet = aPathExt.CompareToAscii( "pcd", 3 ) == COMPARE_EQUAL;
- if ( bRet )
- {
- nFormat = GFF_PCD;
- }
+ nFormat = GFF_PCD;
+ bRet = sal_True;
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -598,35 +508,35 @@ BOOL GraphicDescriptor::ImpDetectPCD( SvStream& rStm, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo )
+sal_Bool GraphicDescriptor::ImpDetectPCX( SvStream& rStm, sal_Bool bExtendedInfo )
{
// ! Because 0x0a can be interpreted as LF too ...
// we cant be shure that this special sign represent a PCX file only.
// Every Ascii file is possible here :-(
// We must detect the whole header.
- bExtendedInfo = TRUE;
+ bExtendedInfo = sal_True;
- BOOL bRet = FALSE;
- BYTE cByte;
+ sal_Bool bRet = sal_False;
+ sal_uInt8 cByte;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- rStm.Seek( nStmPos );
-
rStm >> cByte;
+
if ( cByte == 0x0a )
{
nFormat = GFF_PCX;
- bRet = TRUE;
+ bRet = sal_True;
if ( bExtendedInfo )
{
- UINT16 nTemp16;
- USHORT nXmin;
- USHORT nXmax;
- USHORT nYmin;
- USHORT nYmax;
- USHORT nDPIx;
- USHORT nDPIy;
+ sal_uInt16 nTemp16;
+ sal_uInt16 nXmin;
+ sal_uInt16 nXmax;
+ sal_uInt16 nYmin;
+ sal_uInt16 nYmax;
+ sal_uInt16 nDPIx;
+ sal_uInt16 nDPIy;
rStm.SeekRel( 1 );
@@ -676,6 +586,7 @@ BOOL GraphicDescriptor::ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo )
}
}
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -686,26 +597,26 @@ BOOL GraphicDescriptor::ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo )
+sal_Bool GraphicDescriptor::ImpDetectPNG( SvStream& rStm, sal_Bool bExtendedInfo )
{
- UINT32 nTemp32;
- BOOL bRet = FALSE;
+ sal_uInt32 nTemp32;
+ sal_Bool bRet = sal_False;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
- rStm.Seek( nStmPos );
-
rStm >> nTemp32;
+
if ( nTemp32 == 0x89504e47 )
{
rStm >> nTemp32;
if ( nTemp32 == 0x0d0a1a0a )
{
nFormat = GFF_PNG;
- bRet = TRUE;
+ bRet = sal_True;
if ( bExtendedInfo )
{
- BYTE cByte;
+ sal_uInt8 cByte;
// IHDR-Chunk
rStm.SeekRel( 8 );
@@ -725,57 +636,54 @@ BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo )
// Planes immer 1;
// Kompression immer
nPlanes = 1;
- bCompressed = TRUE;
+ bCompressed = sal_True;
- if ( bWideSearch )
- {
- UINT32 nLen32;
+ sal_uInt32 nLen32;
- rStm.SeekRel( 8 );
+ rStm.SeekRel( 8 );
- // so lange ueberlesen, bis wir den pHYs-Chunk haben oder
- // den Anfang der Bilddaten
+ // so lange ueberlesen, bis wir den pHYs-Chunk haben oder
+ // den Anfang der Bilddaten
+ rStm >> nLen32;
+ rStm >> nTemp32;
+ while( ( nTemp32 != 0x70485973 ) && ( nTemp32 != 0x49444154 ) )
+ {
+ rStm.SeekRel( 4 + nLen32 );
rStm >> nLen32;
rStm >> nTemp32;
- while( ( nTemp32 != 0x70485973 ) && ( nTemp32 != 0x49444154 ) )
- {
- rStm.SeekRel( 4 + nLen32 );
- rStm >> nLen32;
- rStm >> nTemp32;
- }
+ }
- if ( nTemp32 == 0x70485973 )
- {
- ULONG nXRes;
- ULONG nYRes;
+ if ( nTemp32 == 0x70485973 )
+ {
+ sal_uLong nXRes;
+ sal_uLong nYRes;
- // horizontale Aufloesung
- rStm >> nTemp32;
- nXRes = nTemp32;
+ // horizontale Aufloesung
+ rStm >> nTemp32;
+ nXRes = nTemp32;
- // vertikale Aufloesung
- rStm >> nTemp32;
- nYRes = nTemp32;
+ // vertikale Aufloesung
+ rStm >> nTemp32;
+ nYRes = nTemp32;
- // Unit einlesen
- rStm >> cByte;
+ // Unit einlesen
+ rStm >> cByte;
- if ( cByte )
- {
- if ( nXRes )
- aLogSize.Width() = ( aPixSize.Width() * 100000 ) /
- nTemp32;
+ if ( cByte )
+ {
+ if ( nXRes )
+ aLogSize.Width() = ( aPixSize.Width() * 100000 ) /
+ nTemp32;
- if ( nYRes )
- aLogSize.Height() = ( aPixSize.Height() * 100000 ) /
- nTemp32;
- }
+ if ( nYRes )
+ aLogSize.Height() = ( aPixSize.Height() * 100000 ) /
+ nTemp32;
}
}
}
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -786,14 +694,14 @@ BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo )
+sal_Bool GraphicDescriptor::ImpDetectTIF( SvStream& rStm, sal_Bool bExtendedInfo )
{
- BOOL bDetectOk = FALSE;
- BOOL bRet = FALSE;
- BYTE cByte1;
- BYTE cByte2;
+ sal_Bool bDetectOk = sal_False;
+ sal_Bool bRet = sal_False;
+ sal_uInt8 cByte1;
+ sal_uInt8 cByte2;
- rStm.Seek( nStmPos );
+ sal_Int32 nStmPos = rStm.Tell();
rStm >> cByte1;
rStm >> cByte2;
if ( cByte1 == cByte2 )
@@ -801,43 +709,43 @@ BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo )
if ( cByte1 == 0x49 )
{
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- bDetectOk = TRUE;
+ bDetectOk = sal_True;
}
else if ( cByte1 == 0x4d )
{
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
- bDetectOk = TRUE;
+ bDetectOk = sal_True;
}
if ( bDetectOk )
{
- UINT16 nTemp16;
+ sal_uInt16 nTemp16;
rStm >> nTemp16;
if ( nTemp16 == 0x2a )
{
nFormat = GFF_TIF;
- bRet = TRUE;
+ bRet = sal_True;
if ( bExtendedInfo )
{
- ULONG nCount;
- ULONG nMax = DATA_SIZE - 48;
- UINT32 nTemp32;
- BOOL bOk = FALSE;
+ sal_uLong nCount;
+ sal_uLong nMax = DATA_SIZE - 48;
+ sal_uInt32 nTemp32;
+ sal_Bool bOk = sal_False;
// Offset des ersten IFD einlesen
rStm >> nTemp32;
rStm.SeekRel( ( nCount = ( nTemp32 + 2 ) ) - 0x08 );
- if ( bWideSearch || ( nCount < nMax ) )
+ if ( nCount < nMax )
{
// Tag's lesen, bis wir auf Tag256 ( Width ) treffen
// nicht mehr Bytes als DATA_SIZE lesen
rStm >> nTemp16;
while ( nTemp16 != 256 )
{
- bOk = bWideSearch || ( nCount < nMax );
+ bOk = nCount < nMax;
if ( !bOk )
{
break;
@@ -913,7 +821,7 @@ BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo )
}
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -924,9 +832,9 @@ BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectXBM( SvStream&, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectXBM( SvStream&, sal_Bool )
{
- BOOL bRet = aPathExt.CompareToAscii( "xbm", 3 ) == COMPARE_EQUAL;
+ sal_Bool bRet = aPathExt.CompareToAscii( "xbm", 3 ) == COMPARE_EQUAL;
if (bRet)
nFormat = GFF_XBM;
@@ -940,9 +848,9 @@ BOOL GraphicDescriptor::ImpDetectXBM( SvStream&, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectXPM( SvStream&, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectXPM( SvStream&, sal_Bool )
{
- BOOL bRet = aPathExt.CompareToAscii( "xpm", 3 ) == COMPARE_EQUAL;
+ sal_Bool bRet = aPathExt.CompareToAscii( "xpm", 3 ) == COMPARE_EQUAL;
if (bRet)
nFormat = GFF_XPM;
@@ -955,22 +863,23 @@ BOOL GraphicDescriptor::ImpDetectXPM( SvStream&, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectPBM( SvStream& rStm, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectPBM( SvStream& rStm, sal_Bool )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
// erst auf Datei Extension pruefen, da diese aussagekraeftiger ist
// als die 2 ID Bytes
if ( aPathExt.CompareToAscii( "pbm", 3 ) == COMPARE_EQUAL )
- bRet = TRUE;
+ bRet = sal_True;
else
{
- BYTE nFirst, nSecond;
- rStm.Seek( nStmPos );
+ sal_Int32 nStmPos = rStm.Tell();
+ sal_uInt8 nFirst, nSecond;
rStm >> nFirst >> nSecond;
if ( nFirst == 'P' && ( ( nSecond == '1' ) || ( nSecond == '4' ) ) )
- bRet = TRUE;
+ bRet = sal_True;
+ rStm.Seek( nStmPos );
}
if ( bRet )
@@ -985,19 +894,20 @@ BOOL GraphicDescriptor::ImpDetectPBM( SvStream& rStm, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectPGM( SvStream& rStm, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectPGM( SvStream& rStm, sal_Bool )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( aPathExt.CompareToAscii( "pgm", 3 ) == COMPARE_EQUAL )
- bRet = TRUE;
+ bRet = sal_True;
else
{
- BYTE nFirst, nSecond;
- rStm.Seek( nStmPos );
+ sal_uInt8 nFirst, nSecond;
+ sal_Int32 nStmPos = rStm.Tell();
rStm >> nFirst >> nSecond;
if ( nFirst == 'P' && ( ( nSecond == '2' ) || ( nSecond == '5' ) ) )
- bRet = TRUE;
+ bRet = sal_True;
+ rStm.Seek( nStmPos );
}
if ( bRet )
@@ -1012,19 +922,20 @@ BOOL GraphicDescriptor::ImpDetectPGM( SvStream& rStm, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectPPM( SvStream& rStm, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectPPM( SvStream& rStm, sal_Bool )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( aPathExt.CompareToAscii( "ppm", 3 ) == COMPARE_EQUAL )
- bRet = TRUE;
+ bRet = sal_True;
else
{
- BYTE nFirst, nSecond;
- rStm.Seek( nStmPos );
+ sal_uInt8 nFirst, nSecond;
+ sal_Int32 nStmPos = rStm.Tell();
rStm >> nFirst >> nSecond;
if ( nFirst == 'P' && ( ( nSecond == '3' ) || ( nSecond == '6' ) ) )
- bRet = TRUE;
+ bRet = sal_True;
+ rStm.Seek( nStmPos );
}
if ( bRet )
@@ -1039,19 +950,20 @@ BOOL GraphicDescriptor::ImpDetectPPM( SvStream& rStm, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectRAS( SvStream& rStm, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectRAS( SvStream& rStm, sal_Bool )
{
- UINT32 nMagicNumber;
- rStm.Seek( nStmPos );
+ sal_uInt32 nMagicNumber;
+ sal_Bool bRet = sal_False;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
rStm >> nMagicNumber;
if ( nMagicNumber == 0x59a66a95 )
{
nFormat = GFF_RAS;
- return TRUE;
+ bRet = sal_True;
}
- else
- return FALSE;
+ rStm.Seek( nStmPos );
+ return bRet;
}
/*************************************************************************
@@ -1060,9 +972,9 @@ BOOL GraphicDescriptor::ImpDetectRAS( SvStream& rStm, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectTGA( SvStream&, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectTGA( SvStream&, sal_Bool )
{
- BOOL bRet = aPathExt.CompareToAscii( "tga", 3 ) == COMPARE_EQUAL;
+ sal_Bool bRet = aPathExt.CompareToAscii( "tga", 3 ) == COMPARE_EQUAL;
if (bRet)
nFormat = GFF_TGA;
@@ -1075,28 +987,28 @@ BOOL GraphicDescriptor::ImpDetectTGA( SvStream&, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo )
+sal_Bool GraphicDescriptor::ImpDetectPSD( SvStream& rStm, sal_Bool bExtendedInfo )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
- UINT32 nMagicNumber;
- rStm.Seek( nStmPos );
+ sal_uInt32 nMagicNumber;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
rStm >> nMagicNumber;
if ( nMagicNumber == 0x38425053 )
{
- UINT16 nVersion;
+ sal_uInt16 nVersion;
rStm >> nVersion;
if ( nVersion == 1 )
{
- bRet = TRUE;
+ bRet = sal_True;
if ( bExtendedInfo )
{
- UINT16 nChannels;
- UINT32 nRows;
- UINT32 nColumns;
- UINT16 nDepth;
- UINT16 nMode;
+ sal_uInt16 nChannels;
+ sal_uInt32 nRows;
+ sal_uInt32 nColumns;
+ sal_uInt16 nDepth;
+ sal_uInt16 nMode;
rStm.SeekRel( 6 ); // Pad
rStm >> nChannels >> nRows >> nColumns >> nDepth >> nMode;
if ( ( nDepth == 1 ) || ( nDepth == 8 ) || ( nDepth == 16 ) )
@@ -1113,17 +1025,18 @@ BOOL GraphicDescriptor::ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo )
aPixSize.Height() = nRows;
break;
default:
- bRet = FALSE;
+ bRet = sal_False;
}
}
else
- bRet = FALSE;
+ bRet = sal_False;
}
}
}
if ( bRet )
nFormat = GFF_PSD;
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -1133,15 +1046,16 @@ BOOL GraphicDescriptor::ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectEPS( SvStream& rStm, sal_Bool )
{
// es wird die EPS mit Vorschaubild Variante und die Extensionuebereinstimmung
// geprueft
sal_uInt32 nFirstLong;
sal_uInt8 nFirstBytes[20];
+ sal_Bool bRet = sal_False;
- rStm.Seek( nStmPos );
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
rStm >> nFirstLong;
rStm.SeekRel( -4 );
@@ -1152,10 +1066,10 @@ BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL )
&& ImplSearchEntry( &nFirstBytes[15], (sal_uInt8*)"EPS", 3, 3 ) ) )
{
nFormat = GFF_EPS;
- return TRUE;
+ bRet = sal_True;
}
- else
- return FALSE;
+ rStm.Seek( nStmPos );
+ return bRet;
}
/*************************************************************************
@@ -1164,9 +1078,9 @@ BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectDXF( SvStream&, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectDXF( SvStream&, sal_Bool )
{
- BOOL bRet = aPathExt.CompareToAscii( "dxf", 3 ) == COMPARE_EQUAL;
+ sal_Bool bRet = aPathExt.CompareToAscii( "dxf", 3 ) == COMPARE_EQUAL;
if (bRet)
nFormat = GFF_DXF;
@@ -1179,9 +1093,9 @@ BOOL GraphicDescriptor::ImpDetectDXF( SvStream&, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectMET( SvStream&, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectMET( SvStream&, sal_Bool )
{
- BOOL bRet = aPathExt.CompareToAscii( "met", 3 ) == COMPARE_EQUAL;
+ sal_Bool bRet = aPathExt.CompareToAscii( "met", 3 ) == COMPARE_EQUAL;
if (bRet)
nFormat = GFF_MET;
@@ -1195,16 +1109,18 @@ BOOL GraphicDescriptor::ImpDetectMET( SvStream&, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectPCT( SvStream& rStm, sal_Bool )
{
- BOOL bRet = aPathExt.CompareToAscii( "pct", 3 ) == COMPARE_EQUAL;
+ sal_Bool bRet = aPathExt.CompareToAscii( "pct", 3 ) == COMPARE_EQUAL;
if (bRet)
nFormat = GFF_PCT;
else
{
- BYTE sBuf[3]={0};
+ sal_Int32 nStmPos = rStm.Tell();
- rStm.Seek( nStmPos + 522 );
+ sal_uInt8 sBuf[4];
+
+ rStm.SeekRel( 522 );
rStm.Read( sBuf, 3 );
if( !rStm.GetError() )
@@ -1212,10 +1128,11 @@ BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL )
if ( ( sBuf[0] == 0x00 ) && ( sBuf[1] == 0x11 ) &&
( ( sBuf[2] == 0x01 ) || ( sBuf[2] == 0x02 ) ) )
{
- bRet = TRUE;
+ bRet = sal_True;
nFormat = GFF_PCT;
}
}
+ rStm.Seek( nStmPos );
}
return bRet;
@@ -1228,21 +1145,23 @@ BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectSGF( SvStream& rStm, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectSGF( SvStream& rStm, sal_Bool )
{
- BOOL bRet = FALSE;
-
+ sal_Bool bRet = sal_False;
if( aPathExt.CompareToAscii( "sgf", 3 ) == COMPARE_EQUAL )
- bRet = TRUE;
+ bRet = sal_True;
else
{
- BYTE nFirst, nSecond;
+ sal_Int32 nStmPos = rStm.Tell();
+
+ sal_uInt8 nFirst, nSecond;
- rStm.Seek( nStmPos );
rStm >> nFirst >> nSecond;
if( nFirst == 'J' && nSecond == 'J' )
- bRet = TRUE;
+ bRet = sal_True;
+
+ rStm.Seek( nStmPos );
}
if( bRet )
@@ -1258,9 +1177,9 @@ BOOL GraphicDescriptor::ImpDetectSGF( SvStream& rStm, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectSGV( SvStream&, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectSGV( SvStream&, sal_Bool )
{
- BOOL bRet = aPathExt.CompareToAscii( "sgv", 3 ) == COMPARE_EQUAL;
+ sal_Bool bRet = aPathExt.CompareToAscii( "sgv", 3 ) == COMPARE_EQUAL;
if (bRet)
nFormat = GFF_SGV;
@@ -1274,15 +1193,14 @@ BOOL GraphicDescriptor::ImpDetectSGV( SvStream&, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo )
+sal_Bool GraphicDescriptor::ImpDetectSVM( SvStream& rStm, sal_Bool bExtendedInfo )
{
- UINT32 n32;
- BOOL bRet = FALSE;
- BYTE cByte;
+ sal_uInt32 n32;
+ sal_Bool bRet = sal_False;
+ sal_uInt8 cByte;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- rStm.Seek( nStmPos );
-
rStm >> n32;
if ( n32 == 0x44475653 )
{
@@ -1290,12 +1208,12 @@ BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo )
if ( cByte == 0x49 )
{
nFormat = GFF_SVM;
- bRet = TRUE;
+ bRet = sal_True;
if ( bExtendedInfo )
{
- UINT32 nTemp32;
- UINT16 nTemp16;
+ sal_uInt32 nTemp32;
+ sal_uInt16 nTemp16;
rStm.SeekRel( 0x04 );
@@ -1322,14 +1240,14 @@ BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo )
if( n32 == 0x4D4C4356 )
{
- UINT16 nTmp16;
+ sal_uInt16 nTmp16;
rStm >> nTmp16;
if( nTmp16 == 0x4654 )
{
nFormat = GFF_SVM;
- bRet = TRUE;
+ bRet = sal_True;
if( bExtendedInfo )
{
@@ -1343,7 +1261,7 @@ BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo )
}
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -1354,9 +1272,9 @@ BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectWMF( SvStream&, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectWMF( SvStream&, sal_Bool )
{
- BOOL bRet = aPathExt.CompareToAscii( "wmf",3 ) == COMPARE_EQUAL;
+ sal_Bool bRet = aPathExt.CompareToAscii( "wmf",3 ) == COMPARE_EQUAL;
if (bRet)
nFormat = GFF_WMF;
@@ -1369,9 +1287,9 @@ BOOL GraphicDescriptor::ImpDetectWMF( SvStream&, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectEMF( SvStream&, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectEMF( SvStream&, sal_Bool )
{
- BOOL bRet = aPathExt.CompareToAscii( "emf", 3 ) == COMPARE_EQUAL;
+ sal_Bool bRet = aPathExt.CompareToAscii( "emf", 3 ) == COMPARE_EQUAL;
if (bRet)
nFormat = GFF_EMF;
diff --git a/svtools/source/filter.vcl/filter/makefile.mk b/svtools/source/filter.vcl/filter/makefile.mk
deleted file mode 100644
index c1cd42b666c1..000000000000
--- a/svtools/source/filter.vcl/filter/makefile.mk
+++ /dev/null
@@ -1,97 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-
-PRJNAME=svtools
-TARGET=filter
-LIBTARGET=NO
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-SOLARINC+=-I../../inc
-
-# --- Files --------------------------------------------------------
-
-SRS1NAME=$(TARGET)
-SRC1FILES= strings.src \
- dlgexpor.src \
- dlgepng.src \
- dlgejpg.src
-
-SLOFILES= \
- $(SLO)$/FilterConfigCache.obj \
- $(SLO)$/FilterConfigItem.obj \
- $(SLO)$/SvFilterOptionsDialog.obj \
- $(SLO)$/dlgejpg.obj \
- $(SLO)$/dlgepng.obj \
- $(SLO)$/dlgexpor.obj \
- $(SLO)$/filter.obj \
- $(SLO)$/filter2.obj \
- $(SLO)$/sgfbram.obj \
- $(SLO)$/sgvmain.obj \
- $(SLO)$/sgvspln.obj \
- $(SLO)$/sgvtext.obj
-
-EXCEPTIONSNOOPTFILES= \
- $(SLO)$/FilterConfigCache.obj \
- $(SLO)$/FilterConfigItem.obj \
- $(SLO)$/SvFilterOptionsDialog.obj \
- $(SLO)$/dlgejpg.obj \
- $(SLO)$/dlgepng.obj \
- $(SLO)$/dlgexpor.obj \
- $(SLO)$/filter.obj \
- $(SLO)$/filter2.obj \
- $(SLO)$/sgfbram.obj \
- $(SLO)$/sgvmain.obj \
- $(SLO)$/sgvtext.obj
-
-LIB1TARGET= $(SLB)$/$(TARGET).uno.lib
-LIB1OBJFILES= \
- $(SLO)$/dlgexpor.obj \
- $(SLO)$/dlgejpg.obj \
- $(SLO)$/dlgepng.obj \
- $(SLO)$/SvFilterOptionsDialog.obj
-
-LIB2TARGET= $(SLB)$/$(TARGET).lib
-LIB2OBJFILES= \
- $(SLO)$/filter.obj \
- $(SLO)$/filter2.obj \
- $(SLO)$/sgfbram.obj \
- $(SLO)$/sgvmain.obj \
- $(SLO)$/sgvtext.obj \
- $(SLO)$/sgvspln.obj \
- $(SLO)$/FilterConfigItem.obj \
- $(SLO)$/FilterConfigCache.obj
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svtools/source/filter.vcl/filter/sgfbram.cxx b/svtools/source/filter.vcl/filter/sgfbram.cxx
index 2fee4470a203..8559cbee30eb 100644
--- a/svtools/source/filter.vcl/filter/sgfbram.cxx
+++ b/svtools/source/filter.vcl/filter/sgfbram.cxx
@@ -38,10 +38,6 @@
#include "sgffilt.hxx"
#include "sgfbram.hxx"
-#if defined( WIN ) && defined( MSC )
-#pragma code_seg( "SVTOOLS_FILTER4", "SVTOOLS_CODE" )
-#endif
-
/*************************************************************************
|*
|* operator>>( SvStream&, SgfHeader& )
@@ -72,11 +68,11 @@ SvStream& operator>>(SvStream& rIStream, SgfHeader& rHead)
|* SgfHeader::ChkMagic()
|*
*************************************************************************/
-BOOL SgfHeader::ChkMagic()
+sal_Bool SgfHeader::ChkMagic()
{ return Magic=='J'*256+'J'; }
-UINT32 SgfHeader::GetOffset()
-{ return UINT32(OfsLo)+0x00010000*UINT32(OfsHi); }
+sal_uInt32 SgfHeader::GetOffset()
+{ return sal_uInt32(OfsLo)+0x00010000*sal_uInt32(OfsHi); }
/*************************************************************************
@@ -98,8 +94,8 @@ SvStream& operator>>(SvStream& rIStream, SgfEntry& rEntr)
return rIStream;
}
-UINT32 SgfEntry::GetOffset()
-{ return UINT32(OfsLo)+0x00010000*UINT32(OfsHi); }
+sal_uInt32 SgfEntry::GetOffset()
+{ return sal_uInt32(OfsLo)+0x00010000*sal_uInt32(OfsHi); }
/*************************************************************************
@@ -150,21 +146,21 @@ SvStream& operator<<(SvStream& rOStream, BmpFileHeader& rHead)
return rOStream;
}
-void BmpFileHeader::SetSize(UINT32 Size)
+void BmpFileHeader::SetSize(sal_uInt32 Size)
{
- SizeLo=UINT16(Size & 0x0000FFFF);
- SizeHi=UINT16((Size & 0xFFFF0000)>>16);
+ SizeLo=sal_uInt16(Size & 0x0000FFFF);
+ SizeHi=sal_uInt16((Size & 0xFFFF0000)>>16);
}
-void BmpFileHeader::SetOfs(UINT32 Ofs)
+void BmpFileHeader::SetOfs(sal_uInt32 Ofs)
{
- OfsLo=UINT16(Ofs & 0x0000FFFF);
- OfsHi=UINT16((Ofs & 0xFFFF0000)>>16);
+ OfsLo=sal_uInt16(Ofs & 0x0000FFFF);
+ OfsHi=sal_uInt16((Ofs & 0xFFFF0000)>>16);
}
-UINT32 BmpFileHeader::GetOfs()
+sal_uInt32 BmpFileHeader::GetOfs()
{
- return UINT32(OfsLo)+0x00010000*UINT32(OfsHi);
+ return sal_uInt32(OfsLo)+0x00010000*sal_uInt32(OfsHi);
}
/*************************************************************************
@@ -224,14 +220,14 @@ SvStream& operator<<(SvStream& rOStream, const RGBQuad& rQuad)
class PcxExpand
{
private:
- USHORT Count;
- BYTE Data;
+ sal_uInt16 Count;
+ sal_uInt8 Data;
public:
PcxExpand() { Count=0; }
- BYTE GetByte(SvStream& rInp);
+ sal_uInt8 GetByte(SvStream& rInp);
};
-BYTE PcxExpand::GetByte(SvStream& rInp)
+sal_uInt8 PcxExpand::GetByte(SvStream& rInp)
{
if (Count>0) {
Count--;
@@ -255,21 +251,21 @@ BYTE PcxExpand::GetByte(SvStream& rInp)
|* SgfFilterBmp()
|*
*************************************************************************/
-BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&)
+sal_Bool SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&)
{
BmpFileHeader aBmpHead;
BmpInfoHeader aBmpInfo;
- USHORT nWdtInp=(rHead.Xsize+7)/8; // Breite der Input-Bitmap in Bytes
- USHORT nWdtOut; // Breite der Output-Bitmap in Bytes
- USHORT nColors; // Anzahl der Farben (1,16,256)
- USHORT nColBits; // Anzahl der Bits/Pixel (2, 4, 8)
- USHORT i,j,k; // Spaltenzaehler, Zeilenzaehler, Planezaehler
- USHORT a,b; // Hilfsvariable
- BYTE pl1 = 0; // Masken fuer die Planes
- BYTE* pBuf=NULL; // Buffer fuer eine Pixelzeile
+ sal_uInt16 nWdtInp=(rHead.Xsize+7)/8; // Breite der Input-Bitmap in Bytes
+ sal_uInt16 nWdtOut; // Breite der Output-Bitmap in Bytes
+ sal_uInt16 nColors; // Anzahl der Farben (1,16,256)
+ sal_uInt16 nColBits; // Anzahl der Bits/Pixel (2, 4, 8)
+ sal_uInt16 i,j,k; // Spaltenzaehler, Zeilenzaehler, Planezaehler
+ sal_uInt16 a,b; // Hilfsvariable
+ sal_uInt8 pl1 = 0; // Masken fuer die Planes
+ sal_uInt8* pBuf=NULL; // Buffer fuer eine Pixelzeile
PcxExpand aPcx;
- ULONG nOfs;
- BYTE cRGB[4];
+ sal_uLong nOfs;
+ sal_uInt8 cRGB[4];
if (rHead.Planes<=1) nColBits=1; else nColBits=4; if (rHead.Typ==4) nColBits=8;
nColors=1<<nColBits;
@@ -290,8 +286,8 @@ BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&)
aBmpInfo.yDpmm=0;
aBmpInfo.ColUsed=0;
aBmpInfo.ColMust=0;
- pBuf=new BYTE[nWdtOut];
- if (!pBuf) return FALSE; // Fehler: kein Speichel da
+ pBuf=new sal_uInt8[nWdtOut];
+ if (!pBuf) return sal_False; // Fehler: kein Speichel da
rOut<<aBmpHead<<aBmpInfo;
memset(pBuf,0,nWdtOut); // Buffer mit Nullen fuellen
@@ -308,11 +304,11 @@ BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&)
pBuf[i]=aPcx.GetByte(rInp);
}
for(i=nWdtInp;i<nWdtOut;i++) pBuf[i]=0; // noch bis zu 3 Bytes
- rOut.Seek(nOfs+((ULONG)rHead.Ysize-j-1L)*(ULONG)nWdtOut); // rueckwaerts schreiben!
+ rOut.Seek(nOfs+((sal_uLong)rHead.Ysize-j-1L)*(sal_uLong)nWdtOut); // rueckwaerts schreiben!
rOut.Write((char*)pBuf,nWdtOut);
}
} else if (nColors==16) {
- BYTE pl2= 0; // Masken fuer die Planes
+ sal_uInt8 pl2= 0; // Masken fuer die Planes
rOut<<RGBQuad(0x00,0x00,0x00); // Schwarz
rOut<<RGBQuad(0x24,0x24,0x24); // Grau 80%
@@ -356,7 +352,7 @@ BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&)
}
}
for(i=nWdtInp*4;i<nWdtOut;i++) pBuf[i]=0; // noch bis zu 3 Bytes
- rOut.Seek(nOfs+((ULONG)rHead.Ysize-j-1L)*(ULONG)nWdtOut); // rueckwaerts schreiben!
+ rOut.Seek(nOfs+((sal_uLong)rHead.Ysize-j-1L)*(sal_uLong)nWdtOut); // rueckwaerts schreiben!
rOut.Write((char*)pBuf,nWdtOut);
}
} else if (nColors==256) {
@@ -376,12 +372,12 @@ BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&)
for(i=0;i<rHead.Xsize;i++)
pBuf[i]=aPcx.GetByte(rInp);
for(i=rHead.Xsize;i<nWdtOut;i++) pBuf[i]=0; // noch bis zu 3 Bytes
- rOut.Seek(nOfs+((ULONG)rHead.Ysize-j-1L)*(ULONG)nWdtOut); // rueckwaerts schreiben!
+ rOut.Seek(nOfs+((sal_uLong)rHead.Ysize-j-1L)*(sal_uLong)nWdtOut); // rueckwaerts schreiben!
rOut.Write((char*)pBuf,nWdtOut);
}
}
delete[] pBuf;
- return TRUE;
+ return sal_True;
}
@@ -390,14 +386,14 @@ BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&)
|* SgfBMapFilter()
|*
*************************************************************************/
-BOOL SgfBMapFilter(SvStream& rInp, SvStream& rOut)
+sal_Bool SgfBMapFilter(SvStream& rInp, SvStream& rOut)
{
- ULONG nFileStart; // Offset des SgfHeaders. Im allgemeinen 0.
+ sal_uLong nFileStart; // Offset des SgfHeaders. Im allgemeinen 0.
SgfHeader aHead;
SgfEntry aEntr;
- ULONG nNext;
- BOOL bRdFlag=FALSE; // Grafikentry gelesen ?
- BOOL bRet=FALSE; // Returncode
+ sal_uLong nNext;
+ sal_Bool bRdFlag=sal_False; // Grafikentry gelesen ?
+ sal_Bool bRet=sal_False; // Returncode
nFileStart=rInp.Tell();
rInp>>aHead;
@@ -409,7 +405,7 @@ BOOL SgfBMapFilter(SvStream& rInp, SvStream& rOut)
rInp>>aEntr;
nNext=aEntr.GetOffset();
if (aEntr.Typ==aHead.Typ) {
- bRdFlag=TRUE;
+ bRdFlag=sal_True;
switch(aEntr.Typ) {
case SgfBitImag0:
case SgfBitImag1:
@@ -419,7 +415,7 @@ BOOL SgfBMapFilter(SvStream& rInp, SvStream& rOut)
}
} // while(nNext)
}
- if (rInp.GetError()) bRet=FALSE;
+ if (rInp.GetError()) bRet=sal_False;
return(bRet);
}
@@ -435,15 +431,15 @@ long SgfVectXmul=0;
long SgfVectYmul=0;
long SgfVectXdiv=0;
long SgfVectYdiv=0;
-BOOL SgfVectScal=FALSE;
+sal_Bool SgfVectScal=sal_False;
////////////////////////////////////////////////////////////
// Hpgl2SvFarbe ////////////////////////////////////////////
////////////////////////////////////////////////////////////
-Color Hpgl2SvFarbe( BYTE nFarb )
+Color Hpgl2SvFarbe( sal_uInt8 nFarb )
{
- ULONG nColor = COL_BLACK;
+ sal_uLong nColor = COL_BLACK;
switch (nFarb & 0x07) {
case 0: nColor=COL_WHITE; break;
@@ -464,20 +460,20 @@ Color Hpgl2SvFarbe( BYTE nFarb )
|* SgfFilterVect()
|*
*************************************************************************/
-BOOL SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMtf)
+sal_Bool SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMtf)
{
VirtualDevice aOutDev;
SgfVector aVect;
- BYTE nFarb;
- BYTE nFrb0=7;
- BYTE nLTyp;
- BYTE nOTyp;
- BOOL bEoDt=FALSE;
- BOOL bPDwn=FALSE;
+ sal_uInt8 nFarb;
+ sal_uInt8 nFrb0=7;
+ sal_uInt8 nLTyp;
+ sal_uInt8 nOTyp;
+ sal_Bool bEoDt=sal_False;
+ sal_Bool bPDwn=sal_False;
Point aP0(0,0);
Point aP1(0,0);
String Msg;
- USHORT RecNr=0;
+ sal_uInt16 RecNr=0;
rMtf.Record(&aOutDev);
aOutDev.SetLineColor(Color(COL_BLACK));
@@ -485,9 +481,9 @@ BOOL SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMt
while (!bEoDt && !rInp.GetError()) {
rInp>>aVect; RecNr++;
- nFarb=(BYTE) (aVect.Flag & 0x000F);
- nLTyp=(BYTE)((aVect.Flag & 0x00F0) >>4);
- nOTyp=(BYTE)((aVect.Flag & 0x0F00) >>8);
+ nFarb=(sal_uInt8) (aVect.Flag & 0x000F);
+ nLTyp=(sal_uInt8)((aVect.Flag & 0x00F0) >>4);
+ nOTyp=(sal_uInt8)((aVect.Flag & 0x0F00) >>8);
bEoDt=(aVect.Flag & 0x4000) !=0;
bPDwn=(aVect.Flag & 0x8000) !=0;
@@ -528,7 +524,7 @@ BOOL SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMt
Fraction( 1, 4 ), Fraction( 1, 4 ) );
rMtf.SetPrefMapMode( aMap );
rMtf.SetPrefSize( Size( (short)rHead.Xsize, (short)rHead.Ysize ) );
- return TRUE;
+ return sal_True;
}
@@ -537,14 +533,14 @@ BOOL SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMt
|* SgfVectFilter()
|*
*************************************************************************/
-BOOL SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf)
+sal_Bool SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf)
{
- ULONG nFileStart; // Offset des SgfHeaders. Im allgemeinen 0.
+ sal_uLong nFileStart; // Offset des SgfHeaders. Im allgemeinen 0.
SgfHeader aHead;
SgfEntry aEntr;
- ULONG nNext;
- BOOL bRdFlag=FALSE; // Grafikentry gelesen ?
- BOOL bRet=FALSE; // Returncode
+ sal_uLong nNext;
+ sal_Bool bRdFlag=sal_False; // Grafikentry gelesen ?
+ sal_Bool bRet=sal_False; // Returncode
nFileStart=rInp.Tell();
rInp>>aHead;
@@ -559,7 +555,7 @@ BOOL SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf)
}
} // while(nNext)
if (bRdFlag) {
- if (!rInp.GetError()) bRet=TRUE; // Scheinbar Ok
+ if (!rInp.GetError()) bRet=sal_True; // Scheinbar Ok
}
}
return(bRet);
@@ -571,9 +567,9 @@ BOOL SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf)
|* SgfFilterPScr()
|*
*************************************************************************/
-BOOL SgfFilterPScr(SvStream&, SgfHeader&, SgfEntry&)
+sal_Bool SgfFilterPScr(SvStream&, SgfHeader&, SgfEntry&)
{
- return FALSE; // PostSrcipt wird noch nicht unterstuetzt !
+ return sal_False; // PostSrcipt wird noch nicht unterstuetzt !
}
@@ -584,7 +580,7 @@ BOOL SgfFilterPScr(SvStream&, SgfHeader&, SgfEntry&)
|* Beschreibung Feststellen, um was fuer ein SGF/SGV es sich handelt.
|*
*************************************************************************/
-BYTE CheckSgfTyp(SvStream& rInp, USHORT& nVersion)
+sal_uInt8 CheckSgfTyp(SvStream& rInp, sal_uInt16& nVersion)
{
#if OSL_DEBUG_LEVEL > 1 // Recordgroessen checken. Neuer Compiler hat vielleichte anderes Allignment!
if (sizeof(SgfHeader)!=SgfHeaderSize ||
@@ -595,7 +591,7 @@ BYTE CheckSgfTyp(SvStream& rInp, USHORT& nVersion)
sizeof(RGBQuad )!=RGBQuadSize ) return SGF_DONTKNOW;
#endif
- ULONG nPos;
+ sal_uLong nPos;
SgfHeader aHead;
nVersion=0;
nPos=rInp.Tell();
diff --git a/svtools/source/filter.vcl/filter/sgvmain.cxx b/svtools/source/filter.vcl/filter/sgvmain.cxx
index 7d0e45a4c3fb..404e2b5b01a1 100644
--- a/svtools/source/filter.vcl/filter/sgvmain.cxx
+++ b/svtools/source/filter.vcl/filter/sgvmain.cxx
@@ -55,7 +55,7 @@
p.Paper.RandO =SWAPSHORT(p.Paper.RandO ); \
p.Paper.RandU =SWAPSHORT(p.Paper.RandU ); \
SWAPPOINT(p.U); \
- UINT16 iTemp; \
+ sal_uInt16 iTemp; \
for (iTemp=0;iTemp<20;iTemp++) { \
rPage.HlpLnH[iTemp]=SWAPSHORT(rPage.HlpLnH[iTemp]); \
rPage.HlpLnV[iTemp]=SWAPSHORT(rPage.HlpLnV[iTemp]); }}
@@ -107,58 +107,49 @@
//
////////////////////////////////////////////////////////////////////////////////////////////////////
-#if defined( WIN ) && defined( MSC )
-#pragma code_seg( "svtools", "AUTO_CODE" )
-#endif
-
////////////////////////////////////////////////////////////////////////////////////////////////////
// Fuer Fontuebersetzung ///////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
SgfFontLst* pSgfFonts = 0;
-#if defined( WIN ) && defined( MSC )
-#pragma code_seg( "SVTOOLS_FILTER3", "SVTOOLS_CODE" )
-static void AntiMscBug() {}
-#endif
-
////////////////////////////////////////////////////////////////////////////////////////////////////
// Fuer Kreisunterarten, Text und gedrehte Rechtecke ///////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
-void RotatePoint(PointType& P, INT16 cx, INT16 cy, double sn, double cs)
+void RotatePoint(PointType& P, sal_Int16 cx, sal_Int16 cy, double sn, double cs)
{
- INT16 dx,dy;
+ sal_Int16 dx,dy;
double x1,y1;
dx=P.x-cx;
dy=P.y-cy;
x1=dx*cs-dy*sn;
y1=dy*cs+dx*sn;
- P.x=cx+INT16(x1);
- P.y=cy+INT16(y1);
+ P.x=cx+sal_Int16(x1);
+ P.y=cy+sal_Int16(y1);
}
-void RotatePoint(Point& P, INT16 cx, INT16 cy, double sn, double cs)
+void RotatePoint(Point& P, sal_Int16 cx, sal_Int16 cy, double sn, double cs)
{
- INT16 dx,dy;
+ sal_Int16 dx,dy;
double x1,y1;
- dx=(INT16)(P.X()-cx);
- dy=(INT16)(P.Y()-cy);
+ dx=(sal_Int16)(P.X()-cx);
+ dy=(sal_Int16)(P.Y()-cy);
x1=dx*cs-dy*sn;
y1=dy*cs+dx*sn;
- P=Point(cx+INT16(x1),cy+INT16(y1));
+ P=Point(cx+sal_Int16(x1),cy+sal_Int16(y1));
}
-INT16 iMulDiv(INT16 a, INT16 Mul, INT16 Div)
+sal_Int16 iMulDiv(sal_Int16 a, sal_Int16 Mul, sal_Int16 Div)
{
- INT32 Temp;
- Temp=INT32(a)*INT32(Mul)/INT32(Div);
- return INT16(Temp);
+ sal_Int32 Temp;
+ Temp=sal_Int32(a)*sal_Int32(Mul)/sal_Int32(Div);
+ return sal_Int16(Temp);
}
-UINT16 MulDiv(UINT16 a, UINT16 Mul, UINT16 Div)
+sal_uInt16 MulDiv(sal_uInt16 a, sal_uInt16 Mul, sal_uInt16 Div)
{
- UINT32 Temp;
- Temp=UINT32(a)*UINT32(Mul)/UINT32(Div);
- return UINT16(Temp);
+ sal_uInt32 Temp;
+ Temp=sal_uInt32(a)*sal_uInt32(Mul)/sal_uInt32(Div);
+ return sal_uInt16(Temp);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -173,10 +164,10 @@ SvStream& operator>>(SvStream& rIStream, DtHdType& rDtHd)
void DtHdOverSeek(SvStream& rInp)
{
- ULONG FPos=rInp.Tell();
- FPos+=(ULONG)DtHdSize;
+ sal_uLong FPos=rInp.Tell();
+ FPos+=(sal_uLong)DtHdSize;
rInp.Seek(FPos);
-// rInp.seekg(rInp.tellg()+(ULONG)DtHdSize);
+// rInp.seekg(rInp.tellg()+(sal_uLong)DtHdSize);
}
@@ -191,21 +182,21 @@ SvStream& operator>>(SvStream& rIStream, PageType& rPage)
void ObjkOverSeek(SvStream& rInp, ObjkType& rObjk)
{
- ULONG Siz;
- Siz=(ULONG)rObjk.MemSize+rObjk.Last; // ObjSize+ObjAnhSize
+ sal_uLong Siz;
+ Siz=(sal_uLong)rObjk.MemSize+rObjk.Last; // ObjSize+ObjAnhSize
rInp.Seek(rInp.Tell()+Siz);
}
SvStream& operator>>(SvStream& rInp, ObjkType& rObjk)
{ // Die Fileposition im Stream bleibt unveraendert!
- ULONG nPos;
+ sal_uLong nPos;
nPos=rInp.Tell();
rInp.Read((char*)&rObjk.Last,ObjkSize);
#if defined OSL_BIGENDIAN
SWAPOBJK(rObjk);
#endif
#ifdef InArbeit
- ULONG nPos1=rInp.Tell();
+ sal_uLong nPos1=rInp.Tell();
if(nPos == nPos1) InfoBox( NULL, "tellg funkt nich" ).Execute();
#endif
rInp.Seek(nPos);
@@ -333,10 +324,10 @@ SvStream& operator>>(SvStream& rInp, GrupType& rGrup)
|* Sgv2SvFarbe()
|*
*************************************************************************/
-Color Sgv2SvFarbe(BYTE nFrb1, BYTE nFrb2, BYTE nInts)
+Color Sgv2SvFarbe(sal_uInt8 nFrb1, sal_uInt8 nFrb2, sal_uInt8 nInts)
{
- UINT16 r1=0,g1=0,b1=0,r2=0,g2=0,b2=0;
- BYTE nInt2=100-nInts;
+ sal_uInt16 r1=0,g1=0,b1=0,r2=0,g2=0,b2=0;
+ sal_uInt8 nInt2=100-nInts;
switch(nFrb1 & 0x07) {
case 0: r1=0xFF; g1=0xFF; b1=0xFF; break;
case 1: r1=0xFF; g1=0xFF; break;
@@ -357,9 +348,9 @@ Color Sgv2SvFarbe(BYTE nFrb1, BYTE nFrb2, BYTE nInts)
case 6: b2=0xFF; break;
case 7: break;
}
- r1=(UINT16)((UINT32)r1*nInts/100+(UINT32)r2*nInt2/100);
- g1=(UINT16)((UINT32)g1*nInts/100+(UINT32)g2*nInt2/100);
- b1=(UINT16)((UINT32)b1*nInts/100+(UINT32)b2*nInt2/100);
+ r1=(sal_uInt16)((sal_uInt32)r1*nInts/100+(sal_uInt32)r2*nInt2/100);
+ g1=(sal_uInt16)((sal_uInt32)g1*nInts/100+(sal_uInt32)g2*nInt2/100);
+ b1=(sal_uInt16)((sal_uInt32)b1*nInts/100+(sal_uInt32)b2*nInt2/100);
Color aColor( (sal_uInt8)r1, (sal_uInt8)g1, (sal_uInt8)b1 );
return aColor;
}
@@ -448,7 +439,7 @@ void StrkType::Draw(OutputDevice& rOut)
|* RectType::DrawObjekt()
|*
*************************************************************************/
-void SgfAreaColorIntens(UINT16 Muster, BYTE Col1, BYTE Col2, BYTE Int, OutputDevice& rOut)
+void SgfAreaColorIntens(sal_uInt16 Muster, sal_uInt8 Col1, sal_uInt8 Col2, sal_uInt8 Int, OutputDevice& rOut)
{
ObjAreaType F;
F.FMuster=Muster;
@@ -458,15 +449,15 @@ void SgfAreaColorIntens(UINT16 Muster, BYTE Col1, BYTE Col2, BYTE Int, OutputDev
SetArea(F,rOut);
}
-void DrawSlideRect(INT16 x1, INT16 y1, INT16 x2, INT16 y2, ObjAreaType& F, OutputDevice& rOut)
+void DrawSlideRect(sal_Int16 x1, sal_Int16 y1, sal_Int16 x2, sal_Int16 y2, ObjAreaType& F, OutputDevice& rOut)
{
- INT16 i,i0,b,b0;
- INT16 Int1,Int2;
- INT16 Col1,Col2;
+ sal_Int16 i,i0,b,b0;
+ sal_Int16 Int1,Int2;
+ sal_Int16 Col1,Col2;
// ClipMerk: HgdClipRec;
- INT16 cx,cy;
- INT16 MaxR;
- INT32 dx,dy;
+ sal_Int16 cx,cy;
+ sal_Int16 MaxR;
+ sal_Int32 dx,dy;
rOut.SetLineColor();
if (x1>x2) { i=x1; x1=x2; x2=i; }
@@ -474,7 +465,7 @@ void DrawSlideRect(INT16 x1, INT16 y1, INT16 x2, INT16 y2, ObjAreaType& F, Outpu
Col1=F.FBFarbe & 0x87; Col2=F.FFarbe & 0x87;
Int1=100-F.FIntens; Int2=F.FIntens;
if (Int1==Int2) {
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut);
rOut.DrawRect(Rectangle(x1,y1,x2,y2));
} else {
b0=Int1;
@@ -483,30 +474,30 @@ void DrawSlideRect(INT16 x1, INT16 y1, INT16 x2, INT16 y2, ObjAreaType& F, Outpu
i0=y1;
i=y1;
while (i<=y2) {
- b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-y1) /(INT32)(y2-y1+1));
+ b=Int1+sal_Int16((sal_Int32)(Int2-Int1)*(sal_Int32)(i-y1) /(sal_Int32)(y2-y1+1));
if (b!=b0) {
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut);
rOut.DrawRect(Rectangle(x1,i0,x2,i-1));
i0=i; b0=b;
}
i++;
}
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut);
rOut.DrawRect(Rectangle(x1,i0,x2,y2));
} break;
case 0x28: { // horizontal
i0=x1;
i=x1;
while (i<=x2) {
- b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-x1) /(INT32)(x2-x1+1));
+ b=Int1+sal_Int16((sal_Int32)(Int2-Int1)*(sal_Int32)(i-x1) /(sal_Int32)(x2-x1+1));
if (b!=b0) {
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut);
rOut.DrawRect(Rectangle(i0,y1,i-1,y2));
i0=i; b0=b;
}
i++;
}
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut);
rOut.DrawRect(Rectangle(i0,y1,x2,y2));
} break;
@@ -520,14 +511,14 @@ void DrawSlideRect(INT16 x1, INT16 y1, INT16 x2, INT16 y2, ObjAreaType& F, Outpu
dx=x2-x1+1;
dy=y2-y1+1;
a=sqrt((double)(dx*dx+dy*dy));
- MaxR=INT16(a) /2 +1;
+ MaxR=sal_Int16(a) /2 +1;
b0=Int2;
i0=MaxR; if (MaxR<1) MaxR=1;
i=MaxR;
while (i>=0) {
- b=Int1+INT16((INT32(Int2-Int1)*INT32(i)) /INT32(MaxR));
+ b=Int1+sal_Int16((sal_Int32(Int2-Int1)*sal_Int32(i)) /sal_Int32(MaxR));
if (b!=b0) {
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut);
//if (i0>200 || (Col1 & $80)!=0 || (Col2 & $80)!=0) {
// then begin { Fallunterscheidung fuer etwas bessere Performance }
// s2:=i0-i+2;
@@ -540,7 +531,7 @@ void DrawSlideRect(INT16 x1, INT16 y1, INT16 x2, INT16 y2, ObjAreaType& F, Outpu
}
i--;
}
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int1,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int1,rOut);
rOut.DrawEllipse(Rectangle(cx-i0,cy-i0,cx+i0,cy+i0));
rOut.SetClipRegion(ClipMerk);
} break; // Kreis
@@ -567,7 +558,7 @@ void RectType::Draw(OutputDevice& rOut)
}
} else {
Point aPts[4];
- USHORT i;
+ sal_uInt16 i;
double sn,cs;
sn=sin(double(DrehWink)*3.14159265359/18000);
cs=cos(double(DrehWink)*3.14159265359/18000);
@@ -594,7 +585,7 @@ void PolyType::Draw(OutputDevice& rOut)
if ((Flags & PolyClosBit) !=0) SetArea(F,rOut);
SetLine(L,rOut);
Polygon aPoly(nPoints);
- USHORT i;
+ sal_uInt16 i;
for(i=0;i<nPoints;i++) aPoly.SetPoint(Point(EckP[i].x,EckP[i].y),i);
if ((Flags & PolyClosBit) !=0) {
rOut.DrawPolygon(aPoly);
@@ -614,13 +605,13 @@ void SplnType::Draw(OutputDevice& rOut)
SetLine(L,rOut);
Polygon aPoly(0);
Polygon aSpln(nPoints);
- USHORT i;
+ sal_uInt16 i;
for(i=0;i<nPoints;i++) aSpln.SetPoint(Point(EckP[i].x,EckP[i].y),i);
if ((Flags & PolyClosBit) !=0) {
- Spline2Poly(aSpln,TRUE,aPoly);
+ Spline2Poly(aSpln,sal_True,aPoly);
if (aPoly.GetSize()>0) rOut.DrawPolygon(aPoly);
} else {
- Spline2Poly(aSpln,FALSE,aPoly);
+ Spline2Poly(aSpln,sal_False,aPoly);
if (aPoly.GetSize()>0) rOut.DrawPolyLine(aPoly);
}
}
@@ -630,22 +621,22 @@ void SplnType::Draw(OutputDevice& rOut)
|* CircType::Draw()
|*
*************************************************************************/
-void DrawSlideCirc(INT16 cx, INT16 cy, INT16 rx, INT16 ry, ObjAreaType& F, OutputDevice& rOut)
+void DrawSlideCirc(sal_Int16 cx, sal_Int16 cy, sal_Int16 rx, sal_Int16 ry, ObjAreaType& F, OutputDevice& rOut)
{
- INT16 x1=cx-rx;
- INT16 y1=cy-ry;
- INT16 x2=cx+rx;
- INT16 y2=cy+ry;
+ sal_Int16 x1=cx-rx;
+ sal_Int16 y1=cy-ry;
+ sal_Int16 x2=cx+rx;
+ sal_Int16 y2=cy+ry;
- INT16 i,i0,b,b0;
- INT16 Int1,Int2;
- INT16 Col1,Col2;
+ sal_Int16 i,i0,b,b0;
+ sal_Int16 Int1,Int2;
+ sal_Int16 Col1,Col2;
rOut.SetLineColor();
Col1=F.FBFarbe & 0x87; Col2=F.FFarbe & 0x87;
Int1=100-F.FIntens; Int2=F.FIntens;
if (Int1==Int2) {
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut);
rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
} else {
b0=Int1;
@@ -655,16 +646,16 @@ void DrawSlideCirc(INT16 cx, INT16 cy, INT16 rx, INT16 ry, ObjAreaType& F, Outpu
i0=y1;
i=y1;
while (i<=y2) {
- b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-y1) /(INT32)(y2-y1+1));
+ b=Int1+sal_Int16((sal_Int32)(Int2-Int1)*(sal_Int32)(i-y1) /(sal_Int32)(y2-y1+1));
if (b!=b0) {
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut);
rOut.SetClipRegion(Rectangle(x1,i0,x2,i-1));
rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
i0=i; b0=b;
}
i++;
}
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut);
rOut.SetClipRegion(Rectangle(x1,i0,x2,y2));
rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
rOut.SetClipRegion(ClipMerk);
@@ -674,23 +665,23 @@ void DrawSlideCirc(INT16 cx, INT16 cy, INT16 rx, INT16 ry, ObjAreaType& F, Outpu
i0=x1;
i=x1;
while (i<=x2) {
- b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-x1) /(INT32)(x2-x1+1));
+ b=Int1+sal_Int16((sal_Int32)(Int2-Int1)*(sal_Int32)(i-x1) /(sal_Int32)(x2-x1+1));
if (b!=b0) {
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut);
rOut.SetClipRegion(Rectangle(i0,y1,i-1,y2));
rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
i0=i; b0=b;
}
i++;
}
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut);
rOut.SetClipRegion(Rectangle(i0,y1,x2,y2));
rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
rOut.SetClipRegion(ClipMerk);
} break;
case 0x18: case 0x38: { // Kreis
- INT16 MaxR;
+ sal_Int16 MaxR;
if (rx<1) rx=1;
if (ry<1) ry=1;
@@ -699,17 +690,17 @@ void DrawSlideCirc(INT16 cx, INT16 cy, INT16 rx, INT16 ry, ObjAreaType& F, Outpu
i0=MaxR; if (MaxR<1) MaxR=1;
i=MaxR;
while (i>=0) {
- b=Int1+INT16((INT32(Int2-Int1)*INT32(i)) /INT32(MaxR));
+ b=Int1+sal_Int16((sal_Int32(Int2-Int1)*sal_Int32(i)) /sal_Int32(MaxR));
if (b!=b0) {
- INT32 temp=INT32(i0)*INT32(ry)/INT32(rx);
- INT16 j0=INT16(temp);
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
+ sal_Int32 temp=sal_Int32(i0)*sal_Int32(ry)/sal_Int32(rx);
+ sal_Int16 j0=sal_Int16(temp);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut);
rOut.DrawEllipse(Rectangle(cx-i0,cy-j0,cx+i0,cy+j0));
i0=i; b0=b;
}
i--;
}
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int1,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int1,rOut);
rOut.DrawEllipse(Rectangle(cx-i0,cy-i0,cx+i0,cy+i0));
} break; // Kreis
}
@@ -778,7 +769,7 @@ void BmapType::Draw(OutputDevice& rOut)
{
//ifstream aInp;
unsigned char nSgfTyp;
- USHORT nVersion;
+ sal_uInt16 nVersion;
String aStr(
reinterpret_cast< char const * >(&Filename[ 1 ]),
(xub_StrLen)Filename[ 0 ], RTL_TEXTENCODING_UTF8 );
@@ -803,7 +794,7 @@ void BmapType::Draw(OutputDevice& rOut)
SgfVectYmul=Pos2.y-Pos1.y;
SgfVectXdiv=0;
SgfVectYdiv=0;
- SgfVectScal=TRUE;
+ SgfVectScal=sal_True;
SgfVectFilter(*pInp,aMtf);
SgfVectXofs=0;
SgfVectYofs=0;
@@ -811,7 +802,7 @@ void BmapType::Draw(OutputDevice& rOut)
SgfVectYmul=0;
SgfVectXdiv=0;
SgfVectYdiv=0;
- SgfVectScal=FALSE;
+ SgfVectScal=sal_False;
aMtf.Play(&rOut);
} break;
}
@@ -825,9 +816,9 @@ void BmapType::Draw(OutputDevice& rOut)
|* GrupType::...
|*
*************************************************************************/
-UINT32 GrupType::GetSubPtr()
+sal_uInt32 GrupType::GetSubPtr()
{
- return UINT32(SbLo)+0x00010000*UINT32(SbHi);
+ return sal_uInt32(SbLo)+0x00010000*sal_uInt32(SbHi);
}
/*************************************************************************
@@ -838,8 +829,8 @@ UINT32 GrupType::GetSubPtr()
void DrawObjkList( SvStream& rInp, OutputDevice& rOut )
{
ObjkType aObjk;
- USHORT nGrpCnt=0;
- BOOL bEnde=FALSE;
+ sal_uInt16 nGrpCnt=0;
+ sal_Bool bEnde=sal_False;
do {
rInp>>aObjk;
if (!rInp.GetError()) {
@@ -906,11 +897,11 @@ void DrawObjkList( SvStream& rInp, OutputDevice& rOut )
} // if rInp
if (!rInp.GetError()) {
if (aObjk.Next==0L) {
- if (nGrpCnt==0) bEnde=TRUE;
+ if (nGrpCnt==0) bEnde=sal_True;
else nGrpCnt--;
}
} else {
- bEnde=TRUE; // Lesefehler
+ bEnde=sal_True; // Lesefehler
}
} while (!bEnde);
}
@@ -942,15 +933,15 @@ void SkipObjkList(SvStream& rInp)
|* SgfFilterSDrw()
|*
*************************************************************************/
-BOOL SgfFilterSDrw( SvStream& rInp, SgfHeader&, SgfEntry&, GDIMetaFile& rMtf )
+sal_Bool SgfFilterSDrw( SvStream& rInp, SgfHeader&, SgfEntry&, GDIMetaFile& rMtf )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
PageType aPage;
VirtualDevice aOutDev;
OutputDevice* pOutDev;
- ULONG nStdPos;
- ULONG nZchPos;
- USHORT Num;
+ sal_uLong nStdPos;
+ sal_uLong nZchPos;
+ sal_uInt16 Num;
pOutDev=&aOutDev;
DtHdOverSeek(rInp); // DataHeader weglesen
@@ -986,8 +977,8 @@ BOOL SgfFilterSDrw( SvStream& rInp, SgfHeader&, SgfEntry&, GDIMetaFile& rMtf )
rMtf.WindStart();
MapMode aMap(MAP_10TH_MM,Point(),Fraction(1,4),Fraction(1,4));
rMtf.SetPrefMapMode(aMap);
- rMtf.SetPrefSize(Size((INT16)aPage.Paper.Size.x,(INT16)aPage.Paper.Size.y));
- bRet=TRUE;
+ rMtf.SetPrefSize(Size((sal_Int16)aPage.Paper.Size.x,(sal_Int16)aPage.Paper.Size.y));
+ bRet=sal_True;
return bRet;
}
@@ -998,18 +989,18 @@ BOOL SgfFilterSDrw( SvStream& rInp, SgfHeader&, SgfEntry&, GDIMetaFile& rMtf )
|* SgfSDrwFilter()
|*
*************************************************************************/
-BOOL SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath )
+sal_Bool SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath )
{
#if OSL_DEBUG_LEVEL > 1 // Recordgroessen checken. Neuer Compiler hat vielleichte anderes Alignment!
- if (sizeof(ObjTextType)!=ObjTextTypeSize) return FALSE;
+ if (sizeof(ObjTextType)!=ObjTextTypeSize) return sal_False;
#endif
- ULONG nFileStart; // Offset des SgfHeaders. Im allgemeinen 0.
+ sal_uLong nFileStart; // Offset des SgfHeaders. Im allgemeinen 0.
SgfHeader aHead;
SgfEntry aEntr;
- ULONG nNext;
- BOOL bRdFlag=FALSE; // Grafikentry gelesen ?
- BOOL bRet=FALSE; // Returncode
+ sal_uLong nNext;
+ sal_Bool bRdFlag=sal_False; // Grafikentry gelesen ?
+ sal_Bool bRet=sal_False; // Returncode
aIniPath.Append( String::CreateFromAscii( "sgf.ini", 7 ) );
// aIniPath.ToAbs();
@@ -1030,7 +1021,7 @@ BOOL SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath )
}
} // while(nNext)
if (bRdFlag) {
- if (!rInp.GetError()) bRet=TRUE; // Scheinbar Ok
+ if (!rInp.GetError()) bRet=sal_True; // Scheinbar Ok
}
}
delete pSgfFonts;
@@ -1038,7 +1029,7 @@ BOOL SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath )
}
/*
-Bitmap Dither(BYTE Intens)
+Bitmap Dither(sal_uInt8 Intens)
{
Bitmap aBmp;
BmpInfoHeader Info;
@@ -1081,8 +1072,4 @@ for n:=0 to 63 do
end;
*/
-#if defined( WIN ) && defined( MSC )
-#pragma code_seg( "svtools", "AUTO_CODE" )
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter.vcl/filter/sgvspln.cxx b/svtools/source/filter.vcl/filter/sgvspln.cxx
index fb70950b2b2d..0ed81a50d534 100644
--- a/svtools/source/filter.vcl/filter/sgvspln.cxx
+++ b/svtools/source/filter.vcl/filter/sgvspln.cxx
@@ -34,11 +34,6 @@
#include <tools/poly.hxx>
-#if defined( WIN ) && defined( MSC )
-#pragma code_seg( "SVTOOLS_FILTER2", "SVTOOLS_CODE" )
-#pragma optimize( "", off )
-#endif
-
#if defined( PM2 ) && defined( __BORLANDC__ )
#pragma option -Od
#endif
@@ -146,10 +141,6 @@ short basis() /* BASIS maschinenunabhaengig bestimmen */
#define NEGMAX -POSMIN /* groesste negative Zahl */
#define NEGMIN -POSMAX /* kleinste negative Zahl */
-#define TRUE 1
-#define FALSE 0
-
-
/* Definition von Funktionsmakros:
*/
@@ -176,7 +167,7 @@ short basis() /* BASIS maschinenunabhaengig bestimmen */
/*---------------------- MODUL TRIDIAGONAL ------------------------*/
-USHORT TriDiagGS(BOOL rep, USHORT n, double* lower,
+sal_uInt16 TriDiagGS(sal_Bool rep, sal_uInt16 n, double* lower,
double* diag, double* upper, double* b)
/************************/
/* GAUSS-Verfahren fuer */
@@ -213,7 +204,7 @@ USHORT TriDiagGS(BOOL rep, USHORT n, double* lower,
/* */
/* Eingabeparameter: */
/* ================ */
-/* n Dimension der Matrix ( > 1 ) USHORT n */
+/* n Dimension der Matrix ( > 1 ) sal_uInt16 n */
/* */
/* lower untere Nebendiagonale double lower[n] */
/* diag Hauptdiagonale double diag[n] */
@@ -223,7 +214,7 @@ USHORT TriDiagGS(BOOL rep, USHORT n, double* lower,
/* Dreieckzerlegung der Ausgangsmatrix. */
/* */
/* b rechte Seite des Systems double b[n] */
-/* rep = 0 erstmaliger Aufruf BOOL rep */
+/* rep = 0 erstmaliger Aufruf sal_Bool rep */
/* !=0 wiederholter Aufruf */
/* fuer gleiche Matrix, */
/* aber verschiedenes b. */
@@ -257,7 +248,7 @@ USHORT TriDiagGS(BOOL rep, USHORT n, double* lower,
/*.cp 5 */
{
- USHORT i;
+ sal_uInt16 i;
short j;
// double fabs(double);
@@ -308,7 +299,7 @@ USHORT TriDiagGS(BOOL rep, USHORT n, double* lower,
/*---------------- MODUL ZYKLISCH TRIDIAGONAL ----------------------*/
-USHORT ZyklTriDiagGS(BOOL rep, USHORT n, double* lower, double* diag,
+sal_uInt16 ZyklTriDiagGS(sal_Bool rep, sal_uInt16 n, double* lower, double* diag,
double* upper, double* lowrow, double* ricol, double* b)
/******************************/
/* Systeme mit zyklisch tri- */
@@ -349,12 +340,12 @@ USHORT ZyklTriDiagGS(BOOL rep, USHORT n, double* lower, double* diag,
/* */
/* Eingabeparameter: */
/* ================ */
-/* n Dimension der Matrix ( > 2 ) USHORT n */
+/* n Dimension der Matrix ( > 2 ) sal_uInt16 n */
/* lower untere Nebendiagonale double lower[n] */
/* diag Hauptdiagonale double diag[n] */
/* upper obere Nebendiagonale double upper[n] */
/* b rechte Seite des Systems double b[n] */
-/* rep = 0 erstmaliger Aufruf BOOL rep */
+/* rep = 0 erstmaliger Aufruf sal_Bool rep */
/* !=0 wiederholter Aufruf */
/* fuer gleiche Matrix, */
/* aber verschiedenes b. */
@@ -391,7 +382,7 @@ USHORT ZyklTriDiagGS(BOOL rep, USHORT n, double* lower, double* diag,
/*.cp 5 */
{
double temp; // fabs(double);
- USHORT i;
+ sal_uInt16 i;
short j;
if ( n < 3 ) return(1);
@@ -462,15 +453,15 @@ USHORT ZyklTriDiagGS(BOOL rep, USHORT n, double* lower, double* diag,
|*
*************************************************************************/
-USHORT NaturalSpline(USHORT n, double* x, double* y,
+sal_uInt16 NaturalSpline(sal_uInt16 n, double* x, double* y,
double Marg0, double MargN,
- BYTE MargCond,
+ sal_uInt8 MargCond,
double* b, double* c, double* d)
{
- USHORT i;
+ sal_uInt16 i;
double* a;
double* h;
- USHORT error;
+ sal_uInt16 error;
if (n<2) return 1;
if ( (MargCond & ~3) ) return 2;
@@ -520,7 +511,7 @@ USHORT NaturalSpline(USHORT n, double* x, double* y,
if (n==2) {
c[1]=a[0]/d[0];
} else {
- error=TriDiagGS(FALSE,n-1,b,d,c,a);
+ error=TriDiagGS(sal_False,n-1,b,d,c,a);
if (error!=0) { delete[] a; delete[] h; return error+2; }
for (i=0;i<n-1;i++) c[i+1]=a[i];
}
@@ -569,11 +560,11 @@ USHORT NaturalSpline(USHORT n, double* x, double* y,
*************************************************************************/
-USHORT PeriodicSpline(USHORT n, double* x, double* y,
+sal_uInt16 PeriodicSpline(sal_uInt16 n, double* x, double* y,
double* b, double* c, double* d)
{ // Arrays muessen von [0..n] dimensioniert sein!
- USHORT Error;
- USHORT i,im1,nm1; //integer
+ sal_uInt16 Error;
+ sal_uInt16 i,im1,nm1; //integer
double hr,hl;
double* a;
double* lowrow;
@@ -610,7 +601,7 @@ USHORT PeriodicSpline(USHORT n, double* x, double* y,
lowrow[0]=hr;
ricol[0]=hr;
a[nm1]=3.0*((y[1]-y[0])/hr-(y[n]-y[nm1])/hl);
- Error=ZyklTriDiagGS(FALSE,n,b,d,c,lowrow,ricol,a);
+ Error=ZyklTriDiagGS(sal_False,n,b,d,c,lowrow,ricol,a);
if ( Error != 0 )
{
delete[] a;
@@ -645,22 +636,22 @@ USHORT PeriodicSpline(USHORT n, double* x, double* y,
|*
*************************************************************************/
-USHORT ParaSpline(USHORT n, double* x, double* y, BYTE MargCond,
+sal_uInt16 ParaSpline(sal_uInt16 n, double* x, double* y, sal_uInt8 MargCond,
double Marg01, double Marg02,
double MargN1, double MargN2,
- BOOL CondT, double* T,
+ sal_Bool CondT, double* T,
double* bx, double* cx, double* dx,
double* by, double* cy, double* dy)
{
- USHORT Error;
- USHORT i;
+ sal_uInt16 Error;
+ sal_uInt16 i;
double deltX,deltY,delt,
alphX = 0,alphY = 0,
betX = 0,betY = 0;
if (n<2) return 1;
if ((MargCond & ~3) && (MargCond != 4)) return 2; // ungueltige Randbedingung
- if (CondT==FALSE) {
+ if (CondT==sal_False) {
T[0]=0.0;
for (i=0;i<n;i++) {
deltX=x[i+1]-x[i]; deltY=y[i+1]-y[i];
@@ -722,21 +713,21 @@ USHORT ParaSpline(USHORT n, double* x, double* y, BYTE MargCond,
|* Polygons werden als Stuetzstellen angenommen.
|* n liefert die Anzahl der Teilpolynome.
|* Ist die Berechnung fehlerfrei verlaufen, so
-|* liefert die Funktion TRUE. Nur in diesem Fall
+|* liefert die Funktion sal_True. Nur in diesem Fall
|* ist Speicher fuer die Koeffizientenarrays
|* allokiert, der dann spaeter vom Aufrufer mittels
|* delete freizugeben ist.
|*
*************************************************************************/
-BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n,
+sal_Bool CalcSpline(Polygon& rPoly, sal_Bool Periodic, sal_uInt16& n,
double*& ax, double*& ay, double*& bx, double*& by,
double*& cx, double*& cy, double*& dx, double*& dy, double*& T)
{
- BYTE Marg;
+ sal_uInt8 Marg;
double Marg01;
double MargN1,MargN2;
- USHORT i;
+ sal_uInt16 i;
Point P0(-32768,-32768);
Point Pt;
@@ -777,12 +768,12 @@ BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n,
MargN2=0.0;
if (n>0) n--; // n Korregieren (Anzahl der Teilpolynome)
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( ( Marg == 3 && n >= 3 ) || ( Marg == 2 && n >= 2 ) )
{
- bRet = ParaSpline(n,ax,ay,Marg,Marg01,Marg01,MargN1,MargN2,FALSE,T,bx,cx,dx,by,cy,dy) == 0;
+ bRet = ParaSpline(n,ax,ay,Marg,Marg01,Marg01,MargN1,MargN2,sal_False,T,bx,cx,dx,by,cy,dy) == 0;
}
- if ( bRet == FALSE )
+ if ( bRet == sal_False )
{
delete[] ax;
delete[] ay;
@@ -806,7 +797,7 @@ BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n,
|* Beschreibung Konvertiert einen parametrichen kubischen
|* Polynomspline Spline (natuerlich oder periodisch)
|* in ein angenaehertes Polygon.
-|* Die Funktion liefert FALSE, wenn ein Fehler bei
+|* Die Funktion liefert sal_False, wenn ein Fehler bei
|* der Koeffizientenberechnung aufgetreten ist oder
|* das Polygon zu gross wird (>PolyMax=16380). Im 1.
|* Fall hat das Polygon 0, im 2. Fall PolyMax Punkte.
@@ -814,7 +805,7 @@ BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n,
|* auf +/-32000 begrenzt.
|*
*************************************************************************/
-BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly)
+sal_Bool Spline2Poly(Polygon& rSpln, sal_Bool Periodic, Polygon& rPoly)
{
short MinKoord=-32000; // zur Vermeidung
short MaxKoord=32000; // von Ueberlaeufen
@@ -832,11 +823,11 @@ BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly)
double Step; // Schrittweite fuer t
double dt1,dt2,dt3; // Delta t, y, ^3
double t;
- BOOL bEnde; // Teilpolynom zu Ende?
- USHORT n; // Anzahl der zu zeichnenden Teilpolynome
- USHORT i; // aktuelles Teilpolynom
- BOOL bOk; // noch alles ok?
- USHORT PolyMax=16380;// Maximale Anzahl von Polygonpunkten
+ sal_Bool bEnde; // Teilpolynom zu Ende?
+ sal_uInt16 n; // Anzahl der zu zeichnenden Teilpolynome
+ sal_uInt16 i; // aktuelles Teilpolynom
+ sal_Bool bOk; // noch alles ok?
+ sal_uInt16 PolyMax=16380;// Maximale Anzahl von Polygonpunkten
long x,y;
bOk=CalcSpline(rSpln,Periodic,n,ax,ay,bx,by,cx,cy,dx,dy,tv);
@@ -848,7 +839,7 @@ BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly)
i=0;
while (i<n) { // n Teilpolynome malen
t=tv[i]+Step;
- bEnde=FALSE;
+ bEnde=sal_False;
while (!bEnde) { // ein Teilpolynom interpolieren
bEnde=t>=tv[i+1];
if (bEnde) t=tv[i+1];
@@ -861,7 +852,7 @@ BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly)
rPoly.SetSize(rPoly.GetSize()+1);
rPoly.SetPoint(Point(short(x),short(y)),rPoly.GetSize()-1);
} else {
- bOk=FALSE; // Fehler: Polygon wird zu gross
+ bOk=sal_False; // Fehler: Polygon wird zu gross
}
t=t+Step;
} // Ende von Teilpolynom
@@ -879,7 +870,7 @@ BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly)
return bOk;
} // Ende von if (bOk)
rPoly.SetSize(0);
- return FALSE;
+ return sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter.vcl/filter/sgvtext.cxx b/svtools/source/filter.vcl/filter/sgvtext.cxx
index 538b75245403..5eb0b5e5c1f4 100644
--- a/svtools/source/filter.vcl/filter/sgvtext.cxx
+++ b/svtools/source/filter.vcl/filter/sgvtext.cxx
@@ -38,10 +38,6 @@
extern SgfFontLst* pSgfFonts;
-#if defined( WIN ) && defined( MSC )
-#pragma code_seg( "SVTOOLS_FILTER1", "SVTOOLS_CODE" )
-#endif
-
#ifndef abs
#define abs(x) ((x)<0 ? -(x) : (x))
#endif
@@ -217,9 +213,9 @@ extern SgfFontLst* pSgfFonts;
/////////////////////////////////////////////////////////////////////////////////
-BOOL CheckTextOutl(ObjAreaType& F, ObjLineType& L);
+sal_Bool CheckTextOutl(ObjAreaType& F, ObjLineType& L);
-BOOL CheckTextOutl(ObjAreaType& F, ObjLineType& L)
+sal_Bool CheckTextOutl(ObjAreaType& F, ObjLineType& L)
{
return (F.FIntens!=L.LIntens) ||
((F.FFarbe!=L.LFarbe) && (F.FIntens>0)) ||
@@ -265,11 +261,11 @@ short Sgf2hPoint(short a)
// Unterkante berechnen. Alles in SGF-Units.
// ======================================================================
-USHORT GetTopToBaseLine(USHORT MaxGrad)
+sal_uInt16 GetTopToBaseLine(sal_uInt16 MaxGrad)
{
long ret;
ret=long(MaxGrad)*long(CharTopToBase) /long(100);
- return USHORT(ret);
+ return sal_uInt16(ret);
}
// ======================================================================
@@ -310,9 +306,9 @@ UCHAR ConvertTextChar(UCHAR c)
-USHORT GetSchnittBit(UCHAR c)
+sal_uInt16 GetSchnittBit(UCHAR c)
{
- USHORT r=0;
+ sal_uInt16 r=0;
switch (c) {
case EscBold : r=TextBoldBit; break;
case EscRSlnt: r=TextRSlnBit; break;
@@ -353,10 +349,10 @@ long ChgValue(long Def, long Min, long Max, UCHAR FlgVal, long NumVal)
-void ChgSchnittBit(USHORT Bit, USHORT Radio1, USHORT Radio2, USHORT Radio3,
- UCHAR FlgVal, USHORT Schnitt0, USHORT& Schnitt)
+void ChgSchnittBit(sal_uInt16 Bit, sal_uInt16 Radio1, sal_uInt16 Radio2, sal_uInt16 Radio3,
+ UCHAR FlgVal, sal_uInt16 Schnitt0, sal_uInt16& Schnitt)
{
- USHORT All,Rad;
+ sal_uInt16 All,Rad;
Rad=Radio1 | Radio2 | Radio3;
All=Bit | Rad;
@@ -371,9 +367,9 @@ void ChgSchnittBit(USHORT Bit, USHORT Radio1, USHORT Radio2, USHORT Radio3,
-UCHAR GetNextChar(UCHAR* TBuf, USHORT Index)
+UCHAR GetNextChar(UCHAR* TBuf, sal_uInt16 Index)
{
- USHORT Cnt;
+ sal_uInt16 Cnt;
while (TBuf[Index]==Escape) {
Index++;
Cnt=0;
@@ -386,24 +382,24 @@ UCHAR GetNextChar(UCHAR* TBuf, USHORT Index)
-UCHAR ProcessOne(UCHAR* TBuf, USHORT& Index,
+UCHAR ProcessOne(UCHAR* TBuf, sal_uInt16& Index,
ObjTextType& Atr0, ObjTextType& AktAtr,
- BOOL ScanEsc)
+ sal_Bool ScanEsc)
{
UCHAR c;
UCHAR Ident;
- BOOL Ende;
- BOOL q;
+ sal_Bool Ende;
+ sal_Bool q;
UCHAR FlgVal;
long NumVal;
long Sgn;
short i;
- BOOL EoVal;
+ sal_Bool EoVal;
do {
c=TBuf[Index]; Index++;
Ende=(c!=Escape);
- if (Ende==FALSE) {
+ if (Ende==sal_False) {
c=TBuf[Index]; Index++;
Ident=c; // Identifer merken
FlgVal=EscNoFlg;
@@ -417,36 +413,36 @@ UCHAR ProcessOne(UCHAR* TBuf, USHORT& Index,
do {
NumVal=10*NumVal+c-'0';
EoVal=(TBuf[Index]<'0' || TBuf[Index]>'9');
- if (EoVal==FALSE) { c=TBuf[Index]; Index++; }
+ if (EoVal==sal_False) { c=TBuf[Index]; Index++; }
i--;
- } while (i>0 && EoVal==FALSE);
+ } while (i>0 && EoVal==sal_False);
NumVal=Sgn*NumVal;
}
q=!CheckTextOutl(AktAtr.F,AktAtr.L);
switch (Ident) {
- case EscFont : AktAtr.SetFont(ULONG (ChgValue(Atr0.GetFont(),0,0 ,FlgVal,NumVal)));break;
- case EscGrad : AktAtr.Grad =USHORT(ChgValue(Atr0.Grad, 2,2000 ,FlgVal,NumVal)); break;
- case EscBreit: AktAtr.Breite =USHORT(ChgValue(Atr0.Breite, 1,1000 ,FlgVal,NumVal)); break;
- case EscKaptS: AktAtr.Kapit =(BYTE)(ChgValue(Atr0.Kapit, 1,255 ,FlgVal,NumVal)); break;
- case EscLFeed: AktAtr.LnFeed =USHORT(ChgValue(Atr0.LnFeed, 1,65535 ,FlgVal,NumVal)); break;
- case EscSlant: AktAtr.Slant =USHORT(ChgValue(Atr0.Slant, 1,MaxCharSlant ,FlgVal,NumVal)); break;
+ case EscFont : AktAtr.SetFont(sal_uLong (ChgValue(Atr0.GetFont(),0,0 ,FlgVal,NumVal)));break;
+ case EscGrad : AktAtr.Grad =sal_uInt16(ChgValue(Atr0.Grad, 2,2000 ,FlgVal,NumVal)); break;
+ case EscBreit: AktAtr.Breite =sal_uInt16(ChgValue(Atr0.Breite, 1,1000 ,FlgVal,NumVal)); break;
+ case EscKaptS: AktAtr.Kapit =(sal_uInt8)(ChgValue(Atr0.Kapit, 1,255 ,FlgVal,NumVal)); break;
+ case EscLFeed: AktAtr.LnFeed =sal_uInt16(ChgValue(Atr0.LnFeed, 1,65535 ,FlgVal,NumVal)); break;
+ case EscSlant: AktAtr.Slant =sal_uInt16(ChgValue(Atr0.Slant, 1,MaxCharSlant ,FlgVal,NumVal)); break;
case EscVPos : AktAtr.ChrVPos=char (ChgValue(Atr0.ChrVPos,-128,127 ,FlgVal,NumVal)); break;
- case EscZAbst: AktAtr.ZAbst =(BYTE)(ChgValue(Atr0.ZAbst, 1,255 ,FlgVal,NumVal)); break;
- case EscHJust: AktAtr.Justify=(BYTE)(ChgValue(Atr0.Justify & 0x0F,0,5 ,FlgVal,NumVal)); break;
- case EscFarbe: { AktAtr.L.LFarbe =(BYTE)(ChgValue(Atr0.L.LFarbe,0,7 ,FlgVal,NumVal)); if (q) AktAtr.F.FFarbe =AktAtr.L.LFarbe; } break;
- case EscBFarb: { AktAtr.L.LBFarbe=(BYTE)(ChgValue(Atr0.L.LBFarbe,0,255,FlgVal,NumVal)); if (q) AktAtr.F.FBFarbe=AktAtr.L.LBFarbe; } break;
- case EscInts : { AktAtr.L.LIntens=(BYTE)(ChgValue(Atr0.L.LIntens,0,100,FlgVal,NumVal)); if (q) AktAtr.F.FIntens=AktAtr.L.LIntens; } break;
-
- case EscMustr: { AktAtr.F.FMuster=USHORT(ChgValue(Atr0.F.FMuster,0,65535,FlgVal,NumVal)); } break;
- case EscMFarb: { AktAtr.F.FFarbe =(BYTE)(ChgValue(Atr0.F.FFarbe,0,7 ,FlgVal,NumVal)); } break;
- case EscMBFrb: { AktAtr.F.FBFarbe=(BYTE)(ChgValue(Atr0.F.FBFarbe,0,255,FlgVal,NumVal)); } break;
- case EscMInts: { AktAtr.F.FIntens=(BYTE)(ChgValue(Atr0.F.FIntens,0,100,FlgVal,NumVal)); } break;
-
- case EscSMstr: { AktAtr.ShdF.FMuster=USHORT(ChgValue(Atr0.ShdF.FMuster,0,65535,FlgVal,NumVal)); } break;
- case EscSFarb: { AktAtr.ShdL.LFarbe =(BYTE)(ChgValue(Atr0.ShdL.LFarbe,0,7 ,FlgVal,NumVal)); AktAtr.ShdF.FFarbe =AktAtr.ShdL.LFarbe; } break;
- case EscSBFrb: { AktAtr.ShdL.LBFarbe=(BYTE)(ChgValue(Atr0.ShdL.LBFarbe,0,255,FlgVal,NumVal)); AktAtr.ShdF.FBFarbe=AktAtr.ShdL.LBFarbe; } break;
- case EscSInts: { AktAtr.ShdL.LIntens=(BYTE)(ChgValue(Atr0.ShdL.LIntens,0,100,FlgVal,NumVal)); AktAtr.ShdF.FIntens=AktAtr.ShdL.LIntens; } break;
+ case EscZAbst: AktAtr.ZAbst =(sal_uInt8)(ChgValue(Atr0.ZAbst, 1,255 ,FlgVal,NumVal)); break;
+ case EscHJust: AktAtr.Justify=(sal_uInt8)(ChgValue(Atr0.Justify & 0x0F,0,5 ,FlgVal,NumVal)); break;
+ case EscFarbe: { AktAtr.L.LFarbe =(sal_uInt8)(ChgValue(Atr0.L.LFarbe,0,7 ,FlgVal,NumVal)); if (q) AktAtr.F.FFarbe =AktAtr.L.LFarbe; } break;
+ case EscBFarb: { AktAtr.L.LBFarbe=(sal_uInt8)(ChgValue(Atr0.L.LBFarbe,0,255,FlgVal,NumVal)); if (q) AktAtr.F.FBFarbe=AktAtr.L.LBFarbe; } break;
+ case EscInts : { AktAtr.L.LIntens=(sal_uInt8)(ChgValue(Atr0.L.LIntens,0,100,FlgVal,NumVal)); if (q) AktAtr.F.FIntens=AktAtr.L.LIntens; } break;
+
+ case EscMustr: { AktAtr.F.FMuster=sal_uInt16(ChgValue(Atr0.F.FMuster,0,65535,FlgVal,NumVal)); } break;
+ case EscMFarb: { AktAtr.F.FFarbe =(sal_uInt8)(ChgValue(Atr0.F.FFarbe,0,7 ,FlgVal,NumVal)); } break;
+ case EscMBFrb: { AktAtr.F.FBFarbe=(sal_uInt8)(ChgValue(Atr0.F.FBFarbe,0,255,FlgVal,NumVal)); } break;
+ case EscMInts: { AktAtr.F.FIntens=(sal_uInt8)(ChgValue(Atr0.F.FIntens,0,100,FlgVal,NumVal)); } break;
+
+ case EscSMstr: { AktAtr.ShdF.FMuster=sal_uInt16(ChgValue(Atr0.ShdF.FMuster,0,65535,FlgVal,NumVal)); } break;
+ case EscSFarb: { AktAtr.ShdL.LFarbe =(sal_uInt8)(ChgValue(Atr0.ShdL.LFarbe,0,7 ,FlgVal,NumVal)); AktAtr.ShdF.FFarbe =AktAtr.ShdL.LFarbe; } break;
+ case EscSBFrb: { AktAtr.ShdL.LBFarbe=(sal_uInt8)(ChgValue(Atr0.ShdL.LBFarbe,0,255,FlgVal,NumVal)); AktAtr.ShdF.FBFarbe=AktAtr.ShdL.LBFarbe; } break;
+ case EscSInts: { AktAtr.ShdL.LIntens=(sal_uInt8)(ChgValue(Atr0.ShdL.LIntens,0,100,FlgVal,NumVal)); AktAtr.ShdF.FIntens=AktAtr.ShdL.LIntens; } break;
case EscSDist: { AktAtr.ShdVers.x=(short)ChgValue(Atr0.ShdVers.x,0,30000,FlgVal,NumVal); AktAtr.ShdVers.y=AktAtr.ShdVers.x; } break;
case EscSXDst: { AktAtr.ShdVers.x=(short)ChgValue(Atr0.ShdVers.x,0,30000,FlgVal,NumVal); } break;
case EscSYDst: { AktAtr.ShdVers.y=(short)ChgValue(Atr0.ShdVers.y,0,30000,FlgVal,NumVal); } break;
@@ -467,21 +463,21 @@ UCHAR ProcessOne(UCHAR* TBuf, USHORT& Index,
case EscEbShd: ChgSchnittBit(TextShEbBit,TextSh2DBit,TextSh3DBit,TextSh4DBit,FlgVal,Atr0.Schnitt,AktAtr.Schnitt); break;
} //endcase
if (TBuf[Index]==Escape) Index++; // zweites Esc weglesen }
- } // if Ende==FALSE
- } while (Ende==FALSE && ScanEsc==FALSE);
- if (Ende==FALSE) c=Escape;
+ } // if Ende==sal_False
+ } while (Ende==sal_False && ScanEsc==sal_False);
+ if (Ende==sal_False) c=Escape;
return c;
} // end of ProcessOne
-UCHAR GetTextChar(UCHAR* TBuf, USHORT& Index,
+UCHAR GetTextChar(UCHAR* TBuf, sal_uInt16& Index,
ObjTextType& Atr0, ObjTextType& AktAtr,
- USHORT Rest, BOOL ScanEsc)
+ sal_uInt16 Rest, sal_Bool ScanEsc)
{
UCHAR c,c0,nc;
c=ProcessOne(TBuf,Index,Atr0,AktAtr,ScanEsc);
- if (ScanEsc==FALSE) {
+ if (ScanEsc==sal_False) {
if (c==SoftTrennAdd || c==SoftTrennK || c==SoftTrenn) {
nc=GetNextChar(TBuf,Index);
c0=c;
@@ -511,9 +507,9 @@ UCHAR GetTextChar(UCHAR* TBuf, USHORT& Index,
-UCHAR GetTextCharConv(UCHAR* TBuf, USHORT& Index,
+UCHAR GetTextCharConv(UCHAR* TBuf, sal_uInt16& Index,
ObjTextType& Atr0, ObjTextType& AktAtr,
- USHORT Rest, BOOL ScanEsc)
+ sal_uInt16 Rest, sal_Bool ScanEsc)
{
UCHAR c;
@@ -534,23 +530,23 @@ UCHAR GetTextCharConv(UCHAR* TBuf, USHORT& Index,
//
// Benoetigter Zeilenabstand in SGF-Units. ChrVPos wird beruecksichtigt.
// ======================================================================
-USHORT GetLineFeed(UCHAR* TBuf, USHORT Index, ObjTextType Atr0, ObjTextType AktAtr,
- USHORT nChar, USHORT& LF, USHORT& MaxGrad)
+sal_uInt16 GetLineFeed(UCHAR* TBuf, sal_uInt16 Index, ObjTextType Atr0, ObjTextType AktAtr,
+ sal_uInt16 nChar, sal_uInt16& LF, sal_uInt16& MaxGrad)
{
UCHAR c=0;
- BOOL AbsEnd=FALSE;
- ULONG LF100=0;
- ULONG MaxLF100=0;
- BOOL LFauto=0;
- BOOL First=TRUE;
- USHORT Grad;
- USHORT i=0;
- USHORT r=1;
+ sal_Bool AbsEnd=sal_False;
+ sal_uLong LF100=0;
+ sal_uLong MaxLF100=0;
+ sal_Bool LFauto=0;
+ sal_Bool First=sal_True;
+ sal_uInt16 Grad;
+ sal_uInt16 i=0;
+ sal_uInt16 r=1;
MaxGrad=0;
while (!AbsEnd && nChar>0) {
nChar--;
- c=GetTextChar(TBuf,Index,Atr0,AktAtr,nChar,FALSE);
+ c=GetTextChar(TBuf,Index,Atr0,AktAtr,nChar,sal_False);
i++;
AbsEnd=(c==TextEnd || c==AbsatzEnd);
if (First || (!AbsEnd && c!=' ' && c!=HardTrenn)) {
@@ -562,15 +558,15 @@ USHORT GetLineFeed(UCHAR* TBuf, USHORT Index, ObjTextType Atr0, ObjTextType AktA
Grad=AktAtr.Grad;
if (AktAtr.ChrVPos>0) Grad=Grad-AktAtr.ChrVPos;
if (Grad>MaxGrad) MaxGrad=Grad;
- First=FALSE;
+ First=sal_False;
}
if (!AbsEnd && c!=' ') r=i;
}
MaxGrad=hPoint2Sgf(MaxGrad);
if (MaxLF100<=4000) { // sonst Overflowgefahr
- LF=USHORT(hPoint2Sgf(short(MaxLF100)) /100);
+ LF=sal_uInt16(hPoint2Sgf(short(MaxLF100)) /100);
} else {
- LF=USHORT(hPoint2Sgf(short(MaxLF100) /100));
+ LF=sal_uInt16(hPoint2Sgf(short(MaxLF100) /100));
}
return r;
@@ -592,17 +588,17 @@ USHORT GetLineFeed(UCHAR* TBuf, USHORT Index, ObjTextType Atr0, ObjTextType AktA
#define SuperSubFact 60 /* SuperScript/SubScript: 60% vom Schriftgrad */
#define DefaultSpace 40 /* Default: Space ist 40% vom SchriftGrad */
-USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dreh,
- USHORT FitXMul, USHORT FitXDiv, USHORT FitYMul, USHORT FitYDiv)
+sal_uInt16 SetTextContext(OutputDevice& rOut, ObjTextType& Atr, sal_Bool Kapt, sal_uInt16 Dreh,
+ sal_uInt16 FitXMul, sal_uInt16 FitXDiv, sal_uInt16 FitYMul, sal_uInt16 FitYDiv)
{
SgfFontOne* pSgfFont; // Font aus dem IniFile
Font aFont;
Color aColor;
- ULONG Grad;
- ULONG Brei;
+ sal_uLong Grad;
+ sal_uLong Brei;
String FNam;
- USHORT StdBrei=50; // Durchschnittliche Zeichenbreite in % von Schriftgrad
- BOOL bFit=(FitXMul!=1 || FitXDiv!=1 || FitYMul!=1 || FitYDiv!=1);
+ sal_uInt16 StdBrei=50; // Durchschnittliche Zeichenbreite in % von Schriftgrad
+ sal_Bool bFit=(FitXMul!=1 || FitXDiv!=1 || FitYMul!=1 || FitYDiv!=1);
pSgfFont = pSgfFonts->GetFontDesc(Atr.GetFont());
@@ -621,7 +617,7 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr
switch (Atr.GetFont()) {
case 92500: case 92501: case 92504: case 92505:
{
-#if defined(WIN) || defined(WNT) || defined(PM2)
+#if defined(WNT) || defined(PM2)
FNam=String::CreateFromAscii( "Times New Roman" ); // CG Times ist unter Windows und OS/2 Times New Roman
#else
FNam=String::CreateFromAscii( "Times" ); // ansonsten ist das einfach Times
@@ -630,7 +626,7 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr
aFont.SetFamily(FAMILY_ROMAN);
} break;
case 94021: case 94022: case 94023: case 94024: {
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
FNam=String::CreateFromAscii( "Arial", 5 ); // Univers ist unter Windows Arial
#else
FNam=String::CreateFromAscii( "Helvetica" ); // und ansonsten Helvetica
@@ -639,7 +635,7 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr
StdBrei=47;
} break;
case 93950: case 93951: case 93952: case 93953: {
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
FNam=String::CreateFromAscii( "Courier New" ); // Der Vector-Courierfont unter Windows heisst Courier New
#else
FNam=String::CreateFromAscii( "Courier" ); // ansonsten ist und bleibt Courier immer Courier
@@ -653,25 +649,25 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr
//aFont.SetCharSet(CHARSET_SYSTEM);
}
- Grad=ULONG(Atr.Grad);
- if ((Atr.Schnitt & TextKaptBit) !=0 && Kapt) Grad=Grad*ULONG(Atr.Kapit)/100;
+ Grad=sal_uLong(Atr.Grad);
+ if ((Atr.Schnitt & TextKaptBit) !=0 && Kapt) Grad=Grad*sal_uLong(Atr.Kapit)/100;
if ((Atr.Schnitt & TextSupSBit) !=0 || (Atr.Schnitt & TextSubSBit) !=0) Grad=Grad*SuperSubFact/100;
Brei=Grad;
if (Atr.Breite!=100 || bFit) {
if (bFit) {
- Grad=Grad*ULONG(FitYMul)/ULONG(FitYDiv);
- Brei=Brei*ULONG(FitXMul)/ULONG(FitXDiv);
+ Grad=Grad*sal_uLong(FitYMul)/sal_uLong(FitYDiv);
+ Brei=Brei*sal_uLong(FitXMul)/sal_uLong(FitXDiv);
}
- Brei=Brei*ULONG(Atr.Breite)/100;
- Brei=Brei*ULONG(StdBrei)/100;
- aFont.SetSize(Size(hPoint2Sgf(USHORT(Brei)),hPoint2Sgf(USHORT(Grad))));
+ Brei=Brei*sal_uLong(Atr.Breite)/100;
+ Brei=Brei*sal_uLong(StdBrei)/100;
+ aFont.SetSize(Size(hPoint2Sgf(sal_uInt16(Brei)),hPoint2Sgf(sal_uInt16(Grad))));
} else {
- aFont.SetSize(Size(0,hPoint2Sgf(USHORT(Grad))));
+ aFont.SetSize(Size(0,hPoint2Sgf(sal_uInt16(Grad))));
}
aColor=Sgv2SvFarbe(Atr.L.LFarbe,Atr.L.LBFarbe,Atr.L.LIntens); aFont.SetColor(aColor);
aColor=Sgv2SvFarbe(Atr.F.FFarbe,Atr.F.FBFarbe,Atr.F.FIntens); aFont.SetFillColor(aColor);
- aFont.SetTransparent(TRUE);
+ aFont.SetTransparent(sal_True);
aFont.SetAlign(ALIGN_BASELINE);
Dreh/=10; Dreh=3600-Dreh; if (Dreh==3600) Dreh=0;
@@ -683,11 +679,11 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr
if ((Atr.Schnitt & TextDbUnBit) !=0) aFont.SetUnderline(UNDERLINE_DOUBLE);
if ((Atr.Schnitt & TextStrkBit) !=0) aFont.SetStrikeout(STRIKEOUT_SINGLE);
if ((Atr.Schnitt & TextDbStBit) !=0) aFont.SetStrikeout(STRIKEOUT_DOUBLE);
- if ((Atr.Schnitt & TextSh2DBit) !=0) aFont.SetShadow(TRUE);
- if ((Atr.Schnitt & TextSh3DBit) !=0) aFont.SetShadow(TRUE);
- if ((Atr.Schnitt & TextSh4DBit) !=0) aFont.SetShadow(TRUE);
- if ((Atr.Schnitt & TextShEbBit) !=0) aFont.SetShadow(TRUE);
- if (CheckTextOutl(Atr.F,Atr.L)) aFont.SetOutline(TRUE);
+ if ((Atr.Schnitt & TextSh2DBit) !=0) aFont.SetShadow(sal_True);
+ if ((Atr.Schnitt & TextSh3DBit) !=0) aFont.SetShadow(sal_True);
+ if ((Atr.Schnitt & TextSh4DBit) !=0) aFont.SetShadow(sal_True);
+ if ((Atr.Schnitt & TextShEbBit) !=0) aFont.SetShadow(sal_True);
+ if (CheckTextOutl(Atr.F,Atr.L)) aFont.SetOutline(sal_True);
if (aFont!=rOut.GetFont()) rOut.SetFont(aFont);
@@ -706,26 +702,26 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr
// Absatz.Pas
struct ProcChrSta {
- USHORT Index;
- USHORT ChrXP;
+ sal_uInt16 Index;
+ sal_uInt16 ChrXP;
UCHAR OutCh;
- BOOL Kapt;
+ sal_Bool Kapt;
ObjTextType Attrib;
};
-void InitProcessCharState(ProcChrSta& State, ObjTextType& AktAtr, USHORT IndexA)
+void InitProcessCharState(ProcChrSta& State, ObjTextType& AktAtr, sal_uInt16 IndexA)
{
State.Attrib=AktAtr;
State.OutCh=0;
State.Index=IndexA;
State.ChrXP=0;
- State.Kapt=FALSE;
+ State.Kapt=sal_False;
}
-BOOL UpcasePossible(UCHAR c)
+sal_Bool UpcasePossible(UCHAR c)
{
- if ((c>='a' && c<='z') || c == 0xe4 || c == 0xf6 || c == 0xfc ) return TRUE;
- else return FALSE;
+ if ((c>='a' && c<='z') || c == 0xe4 || c == 0xf6 || c == 0xfc ) return sal_True;
+ else return sal_False;
}
UCHAR Upcase(UCHAR c)
@@ -737,15 +733,15 @@ UCHAR Upcase(UCHAR c)
return c;
}
-USHORT GetCharWidth(OutputDevice& rOut, UCHAR c)
+sal_uInt16 GetCharWidth(OutputDevice& rOut, UCHAR c)
{
UCHAR c1;
- USHORT ChrWidth;
+ sal_uInt16 ChrWidth;
c1 = ByteString::Convert((char)c,RTL_TEXTENCODING_IBM_437, gsl_getSystemTextEncoding() );
if (c==' ')
{
- ChrWidth=(USHORT)rOut.GetTextWidth( String('A') );
+ ChrWidth=(sal_uInt16)rOut.GetTextWidth( String('A') );
if (rOut.GetFont().GetPitch()!=PITCH_FIXED) {
ChrWidth=MulDiv(ChrWidth,DefaultSpace,100);
}
@@ -755,30 +751,30 @@ USHORT GetCharWidth(OutputDevice& rOut, UCHAR c)
OSL_ENSURE( MaxChar == 255, "MaxChar not 255" );
if (c>=MinChar /*&& c<=MaxChar*/)
{
- ChrWidth=(USHORT)rOut.GetTextWidth(String((char)c1));
+ ChrWidth=(sal_uInt16)rOut.GetTextWidth(String((char)c1));
}
else
{
- ChrWidth=(USHORT)rOut.GetTextWidth(String('A'));
+ ChrWidth=(sal_uInt16)rOut.GetTextWidth(String('A'));
}
}
return ChrWidth;
}
UCHAR ProcessChar(OutputDevice& rOut, UCHAR* TBuf, ProcChrSta& R, ObjTextType& Atr0,
- USHORT& nChars, USHORT Rest,
+ sal_uInt16& nChars, sal_uInt16 Rest,
short* Line, UCHAR* cLine)
{
- USHORT KernDist=0; // Wert fuer Kerning
- USHORT ChrWidth;
+ sal_uInt16 KernDist=0; // Wert fuer Kerning
+ sal_uInt16 ChrWidth;
UCHAR c;
UCHAR c1;
- BOOL AbsEnd;
+ sal_Bool AbsEnd;
- c=GetTextChar(TBuf,R.Index,Atr0,R.Attrib,Rest,FALSE); // versucht evtl. zu trennen, wenn Rest entsprechenden Wert besitzt
+ c=GetTextChar(TBuf,R.Index,Atr0,R.Attrib,Rest,sal_False); // versucht evtl. zu trennen, wenn Rest entsprechenden Wert besitzt
AbsEnd=(c==AbsatzEnd || c==TextEnd);
- if (AbsEnd==FALSE) {
+ if (AbsEnd==sal_False) {
R.OutCh=ConvertTextChar(c); // von HardTrenn nach '-', ...
R.Kapt=(R.Attrib.Schnitt & TextKaptBit) !=0 && UpcasePossible(R.OutCh);
if (R.Kapt) R.OutCh=Upcase(R.OutCh);
@@ -788,9 +784,9 @@ UCHAR ProcessChar(OutputDevice& rOut, UCHAR* TBuf, ProcChrSta& R, ObjTextType& A
ChrWidth=GetCharWidth(rOut,c1);
if (R.Attrib.ZAbst!=100) { // Spezial-Zeichenabstand ?
- ULONG Temp;
- Temp=ULONG(ChrWidth)*ULONG(R.Attrib.ZAbst)/100;
- ChrWidth=USHORT(Temp);
+ sal_uLong Temp;
+ Temp=sal_uLong(ChrWidth)*sal_uLong(R.Attrib.ZAbst)/100;
+ ChrWidth=sal_uInt16(Temp);
}
nChars++;
if (R.ChrXP>32000) R.ChrXP=32000;
@@ -801,44 +797,44 @@ UCHAR ProcessChar(OutputDevice& rOut, UCHAR* TBuf, ProcChrSta& R, ObjTextType& A
return c;
}
-void FormatLine(UCHAR* TBuf, USHORT& Index, ObjTextType& Atr0, ObjTextType& AktAtr,
- USHORT UmbWdt, USHORT AdjWdt,
- short* Line, USHORT& nChars,
+void FormatLine(UCHAR* TBuf, sal_uInt16& Index, ObjTextType& Atr0, ObjTextType& AktAtr,
+ sal_uInt16 UmbWdt, sal_uInt16 AdjWdt,
+ short* Line, sal_uInt16& nChars,
double, double,
- UCHAR* cLine, BOOL TextFit)
+ UCHAR* cLine, sal_Bool TextFit)
{
VirtualDevice vOut;
UCHAR c,c0;
UCHAR ct;
- BOOL First; // erster Char ?
- BYTE Just = 0; // Absatzformatierung
- BOOL Border; // Rand der Box erreicht ?
- BOOL Border0;
- BOOL AbsEnd; // Ende des Absatzes erreicht ?
+ sal_Bool First; // erster Char ?
+ sal_uInt8 Just = 0; // Absatzformatierung
+ sal_Bool Border; // Rand der Box erreicht ?
+ sal_Bool Border0;
+ sal_Bool AbsEnd; // Ende des Absatzes erreicht ?
ProcChrSta* R=new ProcChrSta;
ProcChrSta* R0=new ProcChrSta;
ProcChrSta* WErec=new ProcChrSta;
- USHORT WEnChar;
+ sal_uInt16 WEnChar;
ProcChrSta* WErec0=new ProcChrSta;
- USHORT WEnChar0;
+ sal_uInt16 WEnChar0;
ProcChrSta* TRrec=new ProcChrSta;
- USHORT TRnChar;
+ sal_uInt16 TRnChar;
- USHORT WordEndCnt; // Justieren und Trennen
- BOOL WordEnd;
- BOOL Trenn;
+ sal_uInt16 WordEndCnt; // Justieren und Trennen
+ sal_Bool WordEnd;
+ sal_Bool Trenn;
short BoxRest; // zum Quetschen und formatieren
- USHORT i,j,k,h;
- USHORT re,li;
+ sal_uInt16 i,j,k,h;
+ sal_uInt16 re,li;
vOut.SetMapMode(MapMode(MAP_10TH_MM,Point(),Fraction(1,4),Fraction(1,4)));
nChars=0;
- SetTextContext(vOut,AktAtr,FALSE,0,1,1,1,1);
+ SetTextContext(vOut,AktAtr,sal_False,0,1,1,1,1);
InitProcessCharState(*R,AktAtr,Index);
- (*R0)=(*R); (*WErec)=(*R); WEnChar=0; c0=0; Border0=FALSE;
- Border=FALSE; First=TRUE;
+ (*R0)=(*R); (*WErec)=(*R); WEnChar=0; c0=0; Border0=sal_False;
+ Border=sal_False; First=sal_True;
WordEndCnt=0;
do { // mal schauen, wieviele Worte so in die Zeile passen
@@ -866,16 +862,16 @@ void FormatLine(UCHAR* TBuf, USHORT& Index, ObjTextType& Atr0, ObjTextType& AktA
}
(*R0)=(*R); c0=c;
Border0=Border;
- First=FALSE;
+ First=sal_False;
AbsEnd=AbsEnd || (nChars>=MaxLineChars);
} while (!(AbsEnd || (Border && ((WordEndCnt>0) || WordEnd || Trenn))));
if (Border) { // Trennen und Quetschen
(*WErec0)=(*WErec); WEnChar0=WEnChar;
- AbsEnd=FALSE; c0=0;
+ AbsEnd=sal_False; c0=0;
(*R)=(*WErec); nChars=WEnChar;
(*TRrec)=(*R); TRnChar=nChars;
- Border0=FALSE; Border=FALSE;
+ Border0=sal_False; Border=sal_False;
do { // erst mal gucken wieviele Silben noch reinpassen
ct=ProcessChar(vOut,TBuf,*TRrec,Atr0,TRnChar,DoTrenn,Line,cLine);
c=ProcessChar(vOut,TBuf,*R,Atr0,nChars,NoTrenn,Line,cLine);
@@ -922,7 +918,7 @@ void FormatLine(UCHAR* TBuf, USHORT& Index, ObjTextType& Atr0, ObjTextType& AktA
if (!AbsEnd) {
do { // Leerzeichen weglesen
(*WErec)=(*R);
- c=GetTextChar(TBuf,R->Index,Atr0,R->Attrib,NoTrenn,FALSE);
+ c=GetTextChar(TBuf,R->Index,Atr0,R->Attrib,NoTrenn,sal_False);
nChars++;
Line[nChars]=R->ChrXP;
cLine[nChars]=c;
@@ -938,7 +934,7 @@ void FormatLine(UCHAR* TBuf, USHORT& Index, ObjTextType& Atr0, ObjTextType& AktA
nChars++; Line[nChars]=R->ChrXP; // Damit AbsatzEnde auch weggelesen wird
Line[nChars+1]=R->ChrXP; // denn die Breite von CR oder #0 ist nun mal sehr klein
if (TBuf[R->Index-1]!=AbsatzEnd && TBuf[R->Index-1]!=TextEnd) {
- c=GetTextChar(TBuf,R->Index,Atr0,R->Attrib,NoTrenn,FALSE); // Kleine Korrektur. Notig, wenn nur 1 Wort in
+ c=GetTextChar(TBuf,R->Index,Atr0,R->Attrib,NoTrenn,sal_False); // Kleine Korrektur. Notig, wenn nur 1 Wort in
}
}
@@ -1022,8 +1018,8 @@ void FormatLine(UCHAR* TBuf, USHORT& Index, ObjTextType& Atr0, ObjTextType& AktA
/////////////////////////////////////////////////////////////////////////////////
// DrawText.Pas
-void DrawChar(OutputDevice& rOut, UCHAR c, ObjTextType T, PointType Pos, USHORT DrehWink,
- USHORT FitXMul, USHORT FitXDiv, USHORT FitYMul, USHORT FitYDiv)
+void DrawChar(OutputDevice& rOut, UCHAR c, ObjTextType T, PointType Pos, sal_uInt16 DrehWink,
+ sal_uInt16 FitXMul, sal_uInt16 FitXDiv, sal_uInt16 FitYMul, sal_uInt16 FitYDiv)
{
SetTextContext(rOut,T,UpcasePossible(c),DrehWink,FitXMul,FitXDiv,FitYMul,FitYDiv);
if ((T.Schnitt & TextKaptBit)!=0 && UpcasePossible(c)) c=Upcase(c);
@@ -1041,32 +1037,32 @@ void TextType::Draw(OutputDevice& rOut)
if ((Flags & TextOutlBit)!=0) return; // Sourcetext fuer Outliner !!
ObjTextType T1,T2;
- USHORT Index1;
- USHORT Index2;
+ sal_uInt16 Index1;
+ sal_uInt16 Index2;
UCHAR c = TextEnd;
- USHORT l; // Anzahl der Zeichen in der Zeile
- USHORT i;
+ sal_uInt16 l; // Anzahl der Zeichen in der Zeile
+ sal_uInt16 i;
short yPos0;
short xPos;
short yPos;
- USHORT LF;
- USHORT MaxGrad;
+ sal_uInt16 LF;
+ sal_uInt16 MaxGrad;
short xSize;
short xSAdj;
short ySize;
double sn,cs;
- USHORT TopToBase;
- BOOL Ende = 0;
- USHORT lc;
- BOOL LineFit; // FitSize.x=0? oder Flags -> jede Zeile stretchen
- BOOL TextFit;
+ sal_uInt16 TopToBase;
+ sal_Bool Ende = 0;
+ sal_uInt16 lc;
+ sal_Bool LineFit; // FitSize.x=0? oder Flags -> jede Zeile stretchen
+ sal_Bool TextFit;
short* xLine;
UCHAR* cLine; // Buffer fuer FormatLine
- USHORT FitXMul;
- USHORT FitXDiv;
- USHORT FitYMul;
- USHORT FitYDiv;
- BOOL Fehler;
+ sal_uInt16 FitXMul;
+ sal_uInt16 FitXDiv;
+ sal_uInt16 FitYMul;
+ sal_uInt16 FitYDiv;
+ sal_Bool Fehler;
UCHAR* Buf=Buffer; // Zeiger auf die Buchstaben
pSgfFonts->ReadList();
@@ -1074,9 +1070,9 @@ void TextType::Draw(OutputDevice& rOut)
cLine=new UCHAR[CharLineSize];
TextFit=(Flags & TextFitBits)!=0;
- LineFit=FALSE;
+ LineFit=sal_False;
LineFit=((Flags & TextFitZBit)!=0);
- if (TextFit && FitSize.x==0) LineFit=TRUE;
+ if (TextFit && FitSize.x==0) LineFit=sal_True;
if (DrehWink==0) {
sn=0.0;
@@ -1091,9 +1087,9 @@ void TextType::Draw(OutputDevice& rOut)
ySize=Pos2.y-Pos1.y;
xSize=32000 /2; // Umbruch
xSAdj=Pos2.x-Pos1.x; // zum Ausrichten bei Zentriert/Blocksatz
- //if (xSize<=0) { xSize=32000 /2; LineFit=TRUE; }
- FitXMul=sal::static_int_cast< USHORT >(abs(Pos2.x-Pos1.x)); FitXDiv=FitSize.x; if (FitXDiv==0) FitXDiv=1;
- FitYMul=sal::static_int_cast< USHORT >(abs(Pos2.y-Pos1.y)); FitYDiv=FitSize.y; if (FitYDiv==0) FitYDiv=1;
+ //if (xSize<=0) { xSize=32000 /2; LineFit=sal_True; }
+ FitXMul=sal::static_int_cast< sal_uInt16 >(abs(Pos2.x-Pos1.x)); FitXDiv=FitSize.x; if (FitXDiv==0) FitXDiv=1;
+ FitYMul=sal::static_int_cast< sal_uInt16 >(abs(Pos2.y-Pos1.y)); FitYDiv=FitSize.y; if (FitYDiv==0) FitYDiv=1;
} else {
xSize=Pos2.x-Pos1.x;
xSAdj=xSize;
@@ -1132,7 +1128,7 @@ void TextType::Draw(OutputDevice& rOut)
T2=T1; Index2=Index1;
i=1;
while (i<=l) {
- c=GetTextCharConv(Buf,Index2,T,T2,l-i,FALSE);
+ c=GetTextCharConv(Buf,Index2,T,T2,l-i,sal_False);
long xp1,yp1; // wegen Overflowgefahr
PointType Pos;
xp1=long(Pos1.x)+xPos+long(xLine[i]);
@@ -1164,27 +1160,27 @@ void TextType::Draw(OutputDevice& rOut)
// (DEC Alpha hat naemlich 64Bit-Pointer!)
//UCHAR* TextType::GetBufPtr()
//{
-// ULONG Temp;
-// Temp=ULONG(BufLo)+0x00010000*ULONG(BufHi);
+// sal_uLong Temp;
+// Temp=sal_uLong(BufLo)+0x00010000*sal_uLong(BufHi);
// return (UCHAR*)Temp;
//}
//
//void TextType::SetBufPtr(UCHAR* Ptr)
//{
-// ULONG Temp=(ULONG)Ptr;
-// BufLo=USHORT(Temp & 0x0000FFFF);
-// BufHi=USHORT((Temp & 0xFFFF0000)>>16);
+// sal_uLong Temp=(sal_uLong)Ptr;
+// BufLo=sal_uInt16(Temp & 0x0000FFFF);
+// BufHi=sal_uInt16((Temp & 0xFFFF0000)>>16);
//}
-UINT32 ObjTextType::GetFont()
+sal_uInt32 ObjTextType::GetFont()
{
- return ULONG(FontLo)+0x00010000*ULONG(FontHi);
+ return sal_uLong(FontLo)+0x00010000*sal_uLong(FontHi);
}
-void ObjTextType::SetFont(UINT32 FontID)
+void ObjTextType::SetFont(sal_uInt32 FontID)
{
- FontLo=USHORT(FontID & 0x0000FFFF);
- FontHi=USHORT((FontID & 0xFFFF0000)>>16);
+ FontLo=sal_uInt16(FontID & 0x0000FFFF);
+ FontHi=sal_uInt16((FontID & 0xFFFF0000)>>16);
}
@@ -1195,11 +1191,11 @@ SgfFontOne::SgfFontOne()
{
Next=NULL;
IFID=0;
- Bold=FALSE;
- Ital=FALSE;
- Sans=FALSE;
- Serf=FALSE;
- Fixd=FALSE;
+ Bold=sal_False;
+ Ital=sal_False;
+ Sans=sal_False;
+ Serf=sal_False;
+ Fixd=sal_False;
SVFamil=FAMILY_DONTKNOW;
SVChSet=RTL_TEXTENCODING_DONTKNOW;
SVWidth=40;
@@ -1207,7 +1203,7 @@ SgfFontOne::SgfFontOne()
void SgfFontOne::ReadOne( ByteString& ID, ByteString& Dsc )
{
- USHORT i,j,n;
+ sal_uInt16 i,j,n;
ByteString s;
if ( Dsc.Len() < 4 || ( Dsc.GetChar( 0 ) != '(' ) )
@@ -1229,7 +1225,7 @@ void SgfFontOne::ReadOne( ByteString& ID, ByteString& Dsc )
SVFName=String(Dsc,i+1,j); // SV-Fontname rausholen
Dsc.Erase(i,j);
- IFID = (UINT32)ID.ToInt32();
+ IFID = (sal_uInt32)ID.ToInt32();
n=Dsc.GetTokenCount(' ');
for (i=0;i<n;i++)
{
@@ -1237,11 +1233,11 @@ void SgfFontOne::ReadOne( ByteString& ID, ByteString& Dsc )
if ( s.Len() )
{
s.ToUpperAscii();
- if ( s.CompareTo( "BOLD", 4 ) == COMPARE_EQUAL ) Bold=TRUE;
- else if ( s.CompareTo( "ITAL", 4 ) == COMPARE_EQUAL ) Ital=TRUE;
- else if ( s.CompareTo( "SERF", 4 ) == COMPARE_EQUAL ) Serf=TRUE;
- else if ( s.CompareTo( "SANS", 4 ) == COMPARE_EQUAL ) Sans=TRUE;
- else if ( s.CompareTo( "FIXD", 4 ) == COMPARE_EQUAL ) Fixd=TRUE;
+ if ( s.CompareTo( "BOLD", 4 ) == COMPARE_EQUAL ) Bold=sal_True;
+ else if ( s.CompareTo( "ITAL", 4 ) == COMPARE_EQUAL ) Ital=sal_True;
+ else if ( s.CompareTo( "SERF", 4 ) == COMPARE_EQUAL ) Serf=sal_True;
+ else if ( s.CompareTo( "SANS", 4 ) == COMPARE_EQUAL ) Sans=sal_True;
+ else if ( s.CompareTo( "FIXD", 4 ) == COMPARE_EQUAL ) Fixd=sal_True;
else if ( s.CompareTo( "ROMAN", 5 ) == COMPARE_EQUAL ) SVFamil=FAMILY_ROMAN;
else if ( s.CompareTo( "SWISS", 5 ) == COMPARE_EQUAL ) SVFamil=FAMILY_SWISS;
else if ( s.CompareTo( "MODERN", 6 ) == COMPARE_EQUAL ) SVFamil=FAMILY_MODERN;
@@ -1252,7 +1248,7 @@ void SgfFontOne::ReadOne( ByteString& ID, ByteString& Dsc )
else if ( s.CompareTo( "MAC", 3 ) == COMPARE_EQUAL ) SVChSet=RTL_TEXTENCODING_APPLE_ROMAN;
else if ( s.CompareTo( "SYMBOL", 6 ) == COMPARE_EQUAL ) SVChSet=RTL_TEXTENCODING_SYMBOL;
else if ( s.CompareTo( "SYSTEM", 6 ) == COMPARE_EQUAL ) SVChSet = gsl_getSystemTextEncoding();
- else if ( s.IsNumericAscii() ) SVWidth=sal::static_int_cast< USHORT >(s.ToInt32());
+ else if ( s.IsNumericAscii() ) SVWidth=sal::static_int_cast< sal_uInt16 >(s.ToInt32());
}
}
}
@@ -1265,7 +1261,7 @@ SgfFontLst::SgfFontLst()
Last=NULL;
LastID=0;
LastLn=NULL;
- Tried=FALSE;
+ Tried=sal_False;
}
SgfFontLst::~SgfFontLst()
@@ -1285,7 +1281,7 @@ void SgfFontLst::RausList()
}
pList=NULL;
Last=NULL;
- Tried=FALSE;
+ Tried=sal_False;
LastID=0;
LastLn=NULL;
}
@@ -1296,14 +1292,14 @@ void SgfFontLst::AssignFN(const String& rFName)
void SgfFontLst::ReadList()
{
if (!Tried) {
- Tried=TRUE;
+ Tried=sal_True;
LastID=0;
LastLn=NULL;
SgfFontOne* P,P1;
Config aCfg(FNam);
aCfg.SetGroup("SGV Fonts fuer StarView");
- USHORT Anz=aCfg.GetKeyCount();
- USHORT i;
+ sal_uInt16 Anz=aCfg.GetKeyCount();
+ sal_uInt16 i;
ByteString FID,Dsc;
for (i=0;i<Anz;i++)
@@ -1321,7 +1317,7 @@ void SgfFontLst::ReadList()
}
}
-SgfFontOne* SgfFontLst::GetFontDesc(UINT32 ID)
+SgfFontOne* SgfFontLst::GetFontDesc(sal_uInt32 ID)
{
if (ID!=LastID) {
SgfFontOne* P;
diff --git a/svtools/source/filter.vcl/filter/strings.hrc b/svtools/source/filter.vcl/filter/strings.hrc
deleted file mode 100644
index 0eea67fb2338..000000000000
--- a/svtools/source/filter.vcl/filter/strings.hrc
+++ /dev/null
@@ -1,27 +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.
- *
- ************************************************************************/
-#include <svtools/svtools.hrc>
diff --git a/svtools/source/filter.vcl/filter/strings.src b/svtools/source/filter.vcl/filter/strings.src
deleted file mode 100644
index 3087a70f1316..000000000000
--- a/svtools/source/filter.vcl/filter/strings.src
+++ /dev/null
@@ -1,58 +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.
- *
- ************************************************************************/
-
-#include "strings.hrc"
-
-String EXPORT_DIALOG_TITLE
-{
- Text [ en-US ] = " Options" ;
-};
-
-String KEY_MODE
-{
- Text = "ExportMode" ;
-};
-
-String KEY_RES
-{
- Text = "Resolution" ;
-};
-
-String KEY_SIZE
-{
- Text = "Size" ;
-};
-
-String KEY_COLORS
-{
- Text = "Color" ;
-};
-
-String KEY_RLE_CODING
-{
- Text = "RLE_Coding" ;
-};
diff --git a/svtools/source/filter.vcl/igif/decode.cxx b/svtools/source/filter.vcl/igif/decode.cxx
index d40cfab7cc50..03a69414cd4b 100644
--- a/svtools/source/filter.vcl/igif/decode.cxx
+++ b/svtools/source/filter.vcl/igif/decode.cxx
@@ -37,19 +37,19 @@ struct GIFLZWTableEntry
{
GIFLZWTableEntry* pPrev;
GIFLZWTableEntry* pFirst;
- BYTE nData;
+ sal_uInt8 nData;
};
// ------------------------------------------------------------------------
-GIFLZWDecompressor::GIFLZWDecompressor( BYTE cDataSize ) :
+GIFLZWDecompressor::GIFLZWDecompressor( sal_uInt8 cDataSize ) :
nInputBitsBuf ( 0 ),
nOutBufDataLen ( 0 ),
nInputBitsBufSize ( 0 ),
- bEOIFound ( FALSE ),
+ bEOIFound ( sal_False ),
nDataSize ( cDataSize )
{
- pOutBuf = new BYTE[ 4096 ];
+ pOutBuf = new sal_uInt8[ 4096 ];
nClearCode = 1 << nDataSize;
nEOICode = nClearCode + 1;
@@ -60,11 +60,11 @@ GIFLZWDecompressor::GIFLZWDecompressor( BYTE cDataSize ) :
pTable = new GIFLZWTableEntry[ 4098 ];
- for( USHORT i = 0; i < nTableSize; i++ )
+ for( sal_uInt16 i = 0; i < nTableSize; i++ )
{
pTable[i].pPrev = NULL;
pTable[i].pFirst = pTable + i;
- pTable[i].nData = (BYTE) i;
+ pTable[i].nData = (sal_uInt8) i;
}
}
@@ -78,11 +78,11 @@ GIFLZWDecompressor::~GIFLZWDecompressor()
// ------------------------------------------------------------------------
-HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, BYTE cBufSize,
- ULONG& rCount, BOOL& rEOI )
+HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, sal_uInt8 cBufSize,
+ sal_uLong& rCount, sal_Bool& rEOI )
{
- ULONG nTargetSize = 4096;
- ULONG nCount = 0;
+ sal_uLong nTargetSize = 4096;
+ sal_uLong nCount = 0;
HPBYTE pTarget = (HPBYTE) rtl_allocateMemory( nTargetSize );
HPBYTE pTmpTarget = pTarget;
@@ -96,8 +96,8 @@ HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, BYTE cBufSize,
if( nCount > nTargetSize )
{
- ULONG nNewSize = nTargetSize << 1;
- ULONG nOffset = pTmpTarget - pTarget;
+ sal_uLong nNewSize = nTargetSize << 1;
+ sal_uLong nOffset = pTmpTarget - pTarget;
HPBYTE pTmp = (HPBYTE) rtl_allocateMemory( nNewSize );
memcpy( pTmp, pTarget, nTargetSize );
@@ -124,7 +124,7 @@ HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, BYTE cBufSize,
// ------------------------------------------------------------------------
-void GIFLZWDecompressor::AddToTable( USHORT nPrevCode, USHORT nCodeFirstData )
+void GIFLZWDecompressor::AddToTable( sal_uInt16 nPrevCode, sal_uInt16 nCodeFirstData )
{
GIFLZWTableEntry* pE;
@@ -136,37 +136,37 @@ void GIFLZWDecompressor::AddToTable( USHORT nPrevCode, USHORT nCodeFirstData )
pE->nData = pTable[ nCodeFirstData ].pFirst->nData;
nTableSize++;
- if ( ( nTableSize == (USHORT) (1 << nCodeSize) ) && ( nTableSize < 4096 ) )
+ if ( ( nTableSize == (sal_uInt16) (1 << nCodeSize) ) && ( nTableSize < 4096 ) )
nCodeSize++;
}
}
// ------------------------------------------------------------------------
-BOOL GIFLZWDecompressor::ProcessOneCode()
+sal_Bool GIFLZWDecompressor::ProcessOneCode()
{
GIFLZWTableEntry* pE;
- USHORT nCode;
- BOOL bRet = FALSE;
- BOOL bEndOfBlock = FALSE;
+ sal_uInt16 nCode;
+ sal_Bool bRet = sal_False;
+ sal_Bool bEndOfBlock = sal_False;
while( nInputBitsBufSize < nCodeSize )
{
if( nBlockBufPos >= nBlockBufSize )
{
- bEndOfBlock = TRUE;
+ bEndOfBlock = sal_True;
break;
}
- nInputBitsBuf |= ( (ULONG) pBlockBuf[ nBlockBufPos++ ] ) << nInputBitsBufSize;
+ nInputBitsBuf |= ( (sal_uLong) pBlockBuf[ nBlockBufPos++ ] ) << nInputBitsBufSize;
nInputBitsBufSize += 8;
}
if ( !bEndOfBlock )
{
// Einen Code aus dem Eingabe-Buffer holen:
- nCode = sal::static_int_cast< USHORT >(
- ( (USHORT) nInputBitsBuf ) & ( ~( 0xffff << nCodeSize ) ));
+ nCode = sal::static_int_cast< sal_uInt16 >(
+ ( (sal_uInt16) nInputBitsBuf ) & ( ~( 0xffff << nCodeSize ) ));
nInputBitsBuf >>= nCodeSize;
nInputBitsBufSize = nInputBitsBufSize - nCodeSize;
@@ -192,9 +192,9 @@ BOOL GIFLZWDecompressor::ProcessOneCode()
nOutBufDataLen = 0;
}
else
- bEOIFound = TRUE;
+ bEOIFound = sal_True;
- return TRUE;
+ return sal_True;
}
nOldCode = nCode;
@@ -209,7 +209,7 @@ BOOL GIFLZWDecompressor::ProcessOneCode()
}
while( pE );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
diff --git a/svtools/source/filter.vcl/igif/decode.hxx b/svtools/source/filter.vcl/igif/decode.hxx
index 5bce26b724f1..3dd6328839d9 100644
--- a/svtools/source/filter.vcl/igif/decode.hxx
+++ b/svtools/source/filter.vcl/igif/decode.hxx
@@ -39,29 +39,29 @@ class GIFLZWDecompressor
HPBYTE pOutBuf;
HPBYTE pOutBufData;
HPBYTE pBlockBuf;
- ULONG nInputBitsBuf;
- USHORT nTableSize;
- USHORT nClearCode;
- USHORT nEOICode;
- USHORT nCodeSize;
- USHORT nOldCode;
- USHORT nOutBufDataLen;
- USHORT nInputBitsBufSize;
- BOOL bEOIFound;
- BYTE nDataSize;
- BYTE nBlockBufSize;
- BYTE nBlockBufPos;
+ sal_uLong nInputBitsBuf;
+ sal_uInt16 nTableSize;
+ sal_uInt16 nClearCode;
+ sal_uInt16 nEOICode;
+ sal_uInt16 nCodeSize;
+ sal_uInt16 nOldCode;
+ sal_uInt16 nOutBufDataLen;
+ sal_uInt16 nInputBitsBufSize;
+ sal_Bool bEOIFound;
+ sal_uInt8 nDataSize;
+ sal_uInt8 nBlockBufSize;
+ sal_uInt8 nBlockBufPos;
- void AddToTable(USHORT nPrevCode, USHORT nCodeFirstData);
- BOOL ProcessOneCode();
+ void AddToTable(sal_uInt16 nPrevCode, sal_uInt16 nCodeFirstData);
+ sal_Bool ProcessOneCode();
public:
- GIFLZWDecompressor( BYTE cDataSize );
+ GIFLZWDecompressor( sal_uInt8 cDataSize );
~GIFLZWDecompressor();
- HPBYTE DecompressBlock( HPBYTE pSrc, BYTE cBufSize, ULONG& rCount, BOOL& rEOI );
+ HPBYTE DecompressBlock( HPBYTE pSrc, sal_uInt8 cBufSize, sal_uLong& rCount, sal_Bool& rEOI );
};
#endif
diff --git a/svtools/source/filter.vcl/igif/gifread.cxx b/svtools/source/filter.vcl/igif/gifread.cxx
index 62d1413e145f..8de8c6c01148 100644
--- a/svtools/source/filter.vcl/igif/gifread.cxx
+++ b/svtools/source/filter.vcl/igif/gifread.cxx
@@ -55,11 +55,11 @@ GIFReader::GIFReader( SvStream& rStm ) :
nLogHeight100 ( 0UL ),
nLoops ( 1 ),
eActAction ( GLOBAL_HEADER_READING ),
- bGCTransparent ( FALSE ),
- bImGraphicReady ( FALSE )
+ bGCTransparent ( sal_False ),
+ bImGraphicReady ( sal_False )
{
maUpperName = UniString::CreateFromAscii( "SVIGIF", 6 );
- pSrcBuf = new BYTE[ 256 ];
+ pSrcBuf = new sal_uInt8[ 256 ];
ClearImageExtensions();
}
@@ -83,14 +83,14 @@ GIFReader::~GIFReader()
void GIFReader::ClearImageExtensions()
{
nGCDisposalMethod = 0;
- bGCTransparent = FALSE;
+ bGCTransparent = sal_False;
nTimer = 0;
}
// ------------------------------------------------------------------------
-BOOL GIFReader::CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal,
- BOOL bWatchForBackgroundColor )
+sal_Bool GIFReader::CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal,
+ sal_Bool bWatchForBackgroundColor )
{
const Size aSize( nWidth, nHeight );
@@ -107,11 +107,11 @@ BOOL GIFReader::CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal,
if( pAcc1 )
{
- cTransIndex1 = (BYTE) pAcc1->GetBestPaletteIndex( aWhite );
+ cTransIndex1 = (sal_uInt8) pAcc1->GetBestPaletteIndex( aWhite );
cNonTransIndex1 = cTransIndex1 ? 0 : 1;
}
else
- bStatus = FALSE;
+ bStatus = sal_False;
}
if( bStatus )
@@ -132,12 +132,12 @@ BOOL GIFReader::CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal,
// ------------------------------------------------------------------------
-BOOL GIFReader::ReadGlobalHeader()
+sal_Bool GIFReader::ReadGlobalHeader()
{
char pBuf[ 7 ];
- BYTE nRF;
- BYTE nAspect;
- BOOL bRet = FALSE;
+ sal_uInt8 nRF;
+ sal_uInt8 nAspect;
+ sal_Bool bRet = sal_False;
rIStm.Read( pBuf, 6 );
if( NO_PENDING( rIStm ) )
@@ -150,14 +150,14 @@ BOOL GIFReader::ReadGlobalHeader()
{
SvMemoryStream aMemStm;
- aMemStm.SetBuffer( pBuf, 7, FALSE, 7 );
+ aMemStm.SetBuffer( pBuf, 7, sal_False, 7 );
aMemStm >> nGlobalWidth;
aMemStm >> nGlobalHeight;
aMemStm >> nRF;
aMemStm >> nBackgroundColor;
aMemStm >> nAspect;
- bGlobalPalette = (BOOL) ( nRF & 0x80 );
+ bGlobalPalette = (sal_Bool) ( nRF & 0x80 );
if( bGlobalPalette )
ReadPaletteEntries( &aGPalette, 1 << ( ( nRF & 7 ) + 1 ) );
@@ -165,11 +165,11 @@ BOOL GIFReader::ReadGlobalHeader()
nBackgroundColor = 0;
if( NO_PENDING( rIStm ) )
- bRet = TRUE;
+ bRet = sal_True;
}
}
else
- bStatus = FALSE;
+ bStatus = sal_False;
}
return bRet;
@@ -177,19 +177,19 @@ BOOL GIFReader::ReadGlobalHeader()
// ------------------------------------------------------------------------
-void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, ULONG nCount )
+void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, sal_uLong nCount )
{
- const ULONG nLen = 3UL * nCount;
- BYTE* pBuf = new BYTE[ nLen ];
+ const sal_uLong nLen = 3UL * nCount;
+ sal_uInt8* pBuf = new sal_uInt8[ nLen ];
rIStm.Read( pBuf, nLen );
if( NO_PENDING( rIStm ) )
{
- BYTE* pTmp = pBuf;
+ sal_uInt8* pTmp = pBuf;
- for( ULONG i = 0UL; i < nCount; )
+ for( sal_uLong i = 0UL; i < nCount; )
{
- BitmapColor& rColor = (*pPal)[ (USHORT) i++ ];
+ BitmapColor& rColor = (*pPal)[ (sal_uInt16) i++ ];
rColor.SetRed( *pTmp++ );
rColor.SetGreen( *pTmp++ );
@@ -211,13 +211,13 @@ void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, ULONG nCount )
// ------------------------------------------------------------------------
-BOOL GIFReader::ReadExtension()
+sal_Bool GIFReader::ReadExtension()
{
- BYTE cFunction;
- BYTE cSize;
- BYTE cByte;
- BOOL bRet = FALSE;
- BOOL bOverreadDataBlocks = FALSE;
+ sal_uInt8 cFunction;
+ sal_uInt8 cSize;
+ sal_uInt8 cByte;
+ sal_Bool bRet = sal_False;
+ sal_Bool bOverreadDataBlocks = sal_False;
// Extension-Label
rIStm >> cFunction;
@@ -231,7 +231,7 @@ BOOL GIFReader::ReadExtension()
// 'Graphic Control Extension'
case( 0xf9 ) :
{
- BYTE cFlags;
+ sal_uInt8 cFlags;
rIStm >> cFlags;
rIStm >> nTimer;
@@ -241,9 +241,9 @@ BOOL GIFReader::ReadExtension()
if ( NO_PENDING( rIStm ) )
{
nGCDisposalMethod = ( cFlags >> 2) & 7;
- bGCTransparent = ( cFlags & 1 ) ? TRUE : FALSE;
+ bGCTransparent = ( cFlags & 1 ) ? sal_True : sal_False;
bStatus = ( cSize == 4 ) && ( cByte == 0 );
- bRet = TRUE;
+ bRet = sal_True;
}
}
break;
@@ -254,7 +254,7 @@ BOOL GIFReader::ReadExtension()
if ( NO_PENDING( rIStm ) )
{
// default diese Extension ueberlesen
- bOverreadDataBlocks = TRUE;
+ bOverreadDataBlocks = sal_True;
// Appl.-Extension hat Laenge 11
if ( cSize == 0x0b )
@@ -277,12 +277,12 @@ BOOL GIFReader::ReadExtension()
rIStm >> cByte;
nLoops = cByte;
rIStm >> cByte;
- nLoops |= ( (USHORT) cByte << 8 );
+ nLoops |= ( (sal_uInt16) cByte << 8 );
rIStm >> cByte;
bStatus = ( cByte == 0 );
bRet = NO_PENDING( rIStm );
- bOverreadDataBlocks = FALSE;
+ bOverreadDataBlocks = sal_False;
// Netscape interpretiert den LoopCount
// als reine Anzahl der _Wiederholungen_;
@@ -305,7 +305,7 @@ BOOL GIFReader::ReadExtension()
rIStm >> cByte;
bStatus = ( cByte == 0 );
bRet = NO_PENDING( rIStm );
- bOverreadDataBlocks = FALSE;
+ bOverreadDataBlocks = sal_False;
}
else
rIStm.SeekRel( -1 );
@@ -318,25 +318,25 @@ BOOL GIFReader::ReadExtension()
// alles andere ueberlesen
default:
- bOverreadDataBlocks = TRUE;
+ bOverreadDataBlocks = sal_True;
break;
}
// Sub-Blocks ueberlesen
if ( bOverreadDataBlocks )
{
- bRet = TRUE;
+ bRet = sal_True;
while( cSize && bStatus && !rIStm.IsEof() )
{
- USHORT nCount = (USHORT) cSize + 1;
+ sal_uInt16 nCount = (sal_uInt16) cSize + 1;
char* pBuffer = new char[ nCount ];
- bRet = FALSE;
+ bRet = sal_False;
rIStm.Read( pBuffer, nCount );
if( NO_PENDING( rIStm ) )
{
- cSize = (BYTE) pBuffer[ cSize ];
- bRet = TRUE;
+ cSize = (sal_uInt8) pBuffer[ cSize ];
+ bRet = sal_True;
}
else
cSize = 0;
@@ -351,19 +351,19 @@ BOOL GIFReader::ReadExtension()
// ------------------------------------------------------------------------
-BOOL GIFReader::ReadLocalHeader()
+sal_Bool GIFReader::ReadLocalHeader()
{
- BYTE pBuf[ 9 ];
- BOOL bRet = FALSE;
+ sal_uInt8 pBuf[ 9 ];
+ sal_Bool bRet = sal_False;
rIStm.Read( pBuf, 9 );
if( NO_PENDING( rIStm ) )
{
SvMemoryStream aMemStm;
BitmapPalette* pPal;
- BYTE nFlags;
+ sal_uInt8 nFlags;
- aMemStm.SetBuffer( (char*) pBuf, 9, FALSE, 9 );
+ aMemStm.SetBuffer( (char*) pBuf, 9, sal_False, 9 );
aMemStm >> nImagePosX;
aMemStm >> nImagePosY;
aMemStm >> nImageWidth;
@@ -391,7 +391,7 @@ BOOL GIFReader::ReadLocalHeader()
if( NO_PENDING( rIStm ) )
{
CreateBitmaps( nImageWidth, nImageHeight, pPal, bGlobalPalette && ( pPal == &aGPalette ) );
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -400,11 +400,11 @@ BOOL GIFReader::ReadLocalHeader()
// ------------------------------------------------------------------------
-ULONG GIFReader::ReadNextBlock()
+sal_uLong GIFReader::ReadNextBlock()
{
- ULONG nRet = 0UL;
- ULONG nRead;
- BYTE cBlockSize;
+ sal_uLong nRet = 0UL;
+ sal_uLong nRead;
+ sal_uInt8 cBlockSize;
rIStm >> cBlockSize;
@@ -424,7 +424,7 @@ ULONG GIFReader::ReadNextBlock()
nRet = 3UL;
else
{
- BOOL bEOI;
+ sal_Bool bEOI;
HPBYTE pTarget = pDecomp->DecompressBlock( pSrcBuf, cBlockSize, nRead, bEOI );
nRet = ( bEOI ? 3 : 1 );
@@ -443,9 +443,9 @@ ULONG GIFReader::ReadNextBlock()
// ------------------------------------------------------------------------
-void GIFReader::FillImages( HPBYTE pBytes, ULONG nCount )
+void GIFReader::FillImages( HPBYTE pBytes, sal_uLong nCount )
{
- for( ULONG i = 0UL; i < nCount; i++ )
+ for( sal_uLong i = 0UL; i < nCount; i++ )
{
if( nImageX >= nImageWidth )
{
@@ -464,9 +464,9 @@ void GIFReader::FillImages( HPBYTE pBytes, ULONG nCount )
if( ( nMinY > nLastImageY ) && ( nLastImageY < ( nImageHeight - 1 ) ) )
{
HPBYTE pScanline8 = pAcc8->GetScanline( nYAcc );
- ULONG nSize8 = pAcc8->GetScanlineSize();
+ sal_uLong nSize8 = pAcc8->GetScanlineSize();
HPBYTE pScanline1 = 0;
- ULONG nSize1 = 0;
+ sal_uLong nSize1 = 0;
if( bGCTransparent )
{
@@ -508,7 +508,7 @@ void GIFReader::FillImages( HPBYTE pBytes, ULONG nCount )
}
}
- nLastImageY = (USHORT) nT1;
+ nLastImageY = (sal_uInt16) nT1;
nYAcc = nT1;
}
else
@@ -523,7 +523,7 @@ void GIFReader::FillImages( HPBYTE pBytes, ULONG nCount )
if( nImageY < nImageHeight )
{
- const BYTE cTmp = pBytes[ i ];
+ const sal_uInt8 cTmp = pBytes[ i ];
if( bGCTransparent )
{
@@ -540,7 +540,7 @@ void GIFReader::FillImages( HPBYTE pBytes, ULONG nCount )
}
else
{
- bOverreadBlock = TRUE;
+ bOverreadBlock = sal_True;
break;
}
}
@@ -567,7 +567,7 @@ void GIFReader::CreateNewBitmaps()
aAnimBmp.aPosPix = Point( nImagePosX, nImagePosY );
aAnimBmp.aSizePix = Size( nImageWidth, nImageHeight );
aAnimBmp.nWait = ( nTimer != 65535 ) ? nTimer : ANIMATION_TIMEOUT_ON_CLICK;
- aAnimBmp.bUserInput = FALSE;
+ aAnimBmp.bUserInput = sal_False;
if( nGCDisposalMethod == 2 )
aAnimBmp.eDisposal = DISPOSE_BACK;
@@ -618,10 +618,10 @@ const Graphic& GIFReader::GetIntermediateGraphic()
// ------------------------------------------------------------------------
-BOOL GIFReader::ProcessGIF()
+sal_Bool GIFReader::ProcessGIF()
{
- BOOL bRead = FALSE;
- BOOL bEnd = FALSE;
+ sal_Bool bRead = sal_False;
+ sal_Bool bEnd = sal_False;
if ( !bStatus )
eActAction = ABORT_READING;
@@ -634,7 +634,7 @@ BOOL GIFReader::ProcessGIF()
// naechsten Marker lesen
case( MARKER_READING ):
{
- BYTE cByte;
+ sal_uInt8 cByte;
rIStm >> cByte;
@@ -642,7 +642,7 @@ BOOL GIFReader::ProcessGIF()
eActAction = END_READING;
else if( NO_PENDING( rIStm ) )
{
- bRead = TRUE;
+ bRead = sal_True;
if( cByte == '!' )
eActAction = EXTENSION_READING;
@@ -659,7 +659,7 @@ BOOL GIFReader::ProcessGIF()
// ScreenDescriptor lesen
case( GLOBAL_HEADER_READING ):
{
- if( ( bRead = ReadGlobalHeader() ) == TRUE )
+ if( ( bRead = ReadGlobalHeader() ) == sal_True )
{
ClearImageExtensions();
eActAction = MARKER_READING;
@@ -671,7 +671,7 @@ BOOL GIFReader::ProcessGIF()
// Extension lesen
case( EXTENSION_READING ):
{
- if( ( bRead = ReadExtension() ) == TRUE )
+ if( ( bRead = ReadExtension() ) == sal_True )
eActAction = MARKER_READING;
}
break;
@@ -680,7 +680,7 @@ BOOL GIFReader::ProcessGIF()
// Image-Descriptor lesen
case( LOCAL_HEADER_READING ):
{
- if( ( bRead = ReadLocalHeader() ) == TRUE )
+ if( ( bRead = ReadLocalHeader() ) == sal_True )
{
nYAcc = nImageX = nImageY = 0;
eActAction = FIRST_BLOCK_READING;
@@ -692,20 +692,20 @@ BOOL GIFReader::ProcessGIF()
// ersten Datenblock lesen
case( FIRST_BLOCK_READING ):
{
- BYTE cDataSize;
+ sal_uInt8 cDataSize;
rIStm >> cDataSize;
if( rIStm.IsEof() )
eActAction = ABORT_READING;
else if( cDataSize > 12 )
- bStatus = FALSE;
+ bStatus = sal_False;
else if( NO_PENDING( rIStm ) )
{
- bRead = TRUE;
+ bRead = sal_True;
pDecomp = new GIFLZWDecompressor( cDataSize );
eActAction = NEXT_BLOCK_READING;
- bOverreadBlock = FALSE;
+ bOverreadBlock = sal_False;
}
else
eActAction = FIRST_BLOCK_READING;
@@ -715,20 +715,20 @@ BOOL GIFReader::ProcessGIF()
// naechsten Datenblock lesen
case( NEXT_BLOCK_READING ):
{
- USHORT nLastX = nImageX;
- USHORT nLastY = nImageY;
- ULONG nRet = ReadNextBlock();
+ sal_uInt16 nLastX = nImageX;
+ sal_uInt16 nLastY = nImageY;
+ sal_uLong nRet = ReadNextBlock();
// Return: 0:Pending / 1:OK; / 2:OK und letzter Block: / 3:EOI / 4:HardAbort
if( nRet )
{
- bRead = TRUE;
+ bRead = sal_True;
if ( nRet == 1UL )
{
- bImGraphicReady = TRUE;
+ bImGraphicReady = sal_True;
eActAction = NEXT_BLOCK_READING;
- bOverreadBlock = FALSE;
+ bOverreadBlock = sal_False;
}
else
{
@@ -742,7 +742,7 @@ BOOL GIFReader::ProcessGIF()
else if( nRet == 3UL )
{
eActAction = NEXT_BLOCK_READING;
- bOverreadBlock = TRUE;
+ bOverreadBlock = sal_True;
}
else
{
@@ -764,7 +764,7 @@ BOOL GIFReader::ProcessGIF()
// ein Fehler trat auf
case( ABORT_READING ):
{
- bEnd = TRUE;
+ bEnd = sal_True;
eActAction = END_READING;
}
break;
@@ -788,7 +788,7 @@ ReadState GIFReader::ReadGIF( Graphic& rGraphic )
{
ReadState eReadState;
- bStatus = TRUE;
+ bStatus = sal_True;
while( ProcessGIF() && ( eActAction != END_READING ) ) {}
@@ -825,12 +825,12 @@ ReadState GIFReader::ReadGIF( Graphic& rGraphic )
// - ImportGIF -
// -------------
-BOOL ImportGIF( SvStream & rStm, Graphic& rGraphic )
+sal_Bool ImportGIF( SvStream & rStm, Graphic& rGraphic )
{
GIFReader* pGIFReader = (GIFReader*) rGraphic.GetContext();
- USHORT nOldFormat = rStm.GetNumberFormatInt();
+ sal_uInt16 nOldFormat = rStm.GetNumberFormatInt();
ReadState eReadState;
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -842,7 +842,7 @@ BOOL ImportGIF( SvStream & rStm, Graphic& rGraphic )
if( eReadState == GIFREAD_ERROR )
{
- bRet = FALSE;
+ bRet = sal_False;
delete pGIFReader;
}
else if( eReadState == GIFREAD_OK )
diff --git a/svtools/source/filter.vcl/igif/makefile.mk b/svtools/source/filter.vcl/igif/makefile.mk
deleted file mode 100644
index 0821591e0178..000000000000
--- a/svtools/source/filter.vcl/igif/makefile.mk
+++ /dev/null
@@ -1,45 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-
-PRJNAME=svtools
-TARGET=igif
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-SOLARINC+=-I../../inc
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= $(SLO)$/gifread.obj \
- $(SLO)$/decode.obj
-
-.INCLUDE : target.mk
-
diff --git a/svtools/source/filter.vcl/ixbm/makefile.mk b/svtools/source/filter.vcl/ixbm/makefile.mk
deleted file mode 100644
index 55708d2f2630..000000000000
--- a/svtools/source/filter.vcl/ixbm/makefile.mk
+++ /dev/null
@@ -1,44 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-
-PRJNAME=svtools
-TARGET=ixbm
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-SOLARINC+=-I../../inc
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= $(SLO)$/xbmread.obj
-
-.INCLUDE : target.mk
-
diff --git a/svtools/source/filter.vcl/ixbm/xbmread.cxx b/svtools/source/filter.vcl/ixbm/xbmread.cxx
index 6adb1e4a621b..0870eecb7187 100644
--- a/svtools/source/filter.vcl/ixbm/xbmread.cxx
+++ b/svtools/source/filter.vcl/ixbm/xbmread.cxx
@@ -45,7 +45,7 @@ XBMReader::XBMReader( SvStream& rStm ) :
nLastPos ( rStm.Tell() ),
nWidth ( 0 ),
nHeight ( 0 ),
- bStatus ( TRUE )
+ bStatus ( sal_True )
{
pHexTable = new short[ 256 ];
maUpperName = String::CreateFromAscii( "SVIXBM", 6 );
@@ -110,7 +110,7 @@ ByteString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1,
long nPos2;
long nPos3;
- bStatus = FALSE;
+ bStatus = sal_False;
do
{
@@ -121,23 +121,23 @@ ByteString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1,
{
if( ( nPos1 = aRet.Search( pTok1 ) ) != STRING_NOTFOUND )
{
- bStatus = TRUE;
+ bStatus = sal_True;
if( pTok2 )
{
- bStatus = FALSE;
+ bStatus = sal_False;
if( ( ( nPos2 = aRet.Search( pTok2 ) ) != STRING_NOTFOUND ) &&
( nPos2 > nPos1 ) )
{
- bStatus = TRUE;
+ bStatus = sal_True;
if( pTok3 )
{
- bStatus = FALSE;
+ bStatus = sal_False;
if( ( ( nPos3 = aRet.Search( pTok3 ) ) != STRING_NOTFOUND ) && ( nPos3 > nPos2 ) )
- bStatus = TRUE;
+ bStatus = sal_True;
}
}
}
@@ -200,16 +200,16 @@ long XBMReader::ParseDefine( const sal_Char* pDefine )
// ------------------------------------------------------------------------
-BOOL XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat )
+sal_Bool XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat )
{
ByteString aLine;
long nRow = 0;
long nCol = 0;
long nBits = ( eFormat == XBM10 ) ? 16 : 8;
long nBit;
- USHORT nValue;
- USHORT nDigits;
- BOOL bFirstLine = TRUE;
+ sal_uInt16 nValue;
+ sal_uInt16 nDigits;
+ sal_Bool bFirstLine = sal_True;
while( nRow < nHeight )
{
@@ -221,20 +221,20 @@ BOOL XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFor
if( (nPos = ( aLine = aLastLine ).Search( '{' ) ) != STRING_NOTFOUND )
aLine.Erase( 0, nPos + 1 );
- bFirstLine = FALSE;
+ bFirstLine = sal_False;
}
else if( !pInStm->ReadLine( aLine ) )
break;
if( aLine.Len() )
{
- const USHORT nCount = aLine.GetTokenCount( ',' );
+ const sal_uInt16 nCount = aLine.GetTokenCount( ',' );
- for( USHORT i = 0; ( i < nCount ) && ( nRow < nHeight ); i++ )
+ for( sal_uInt16 i = 0; ( i < nCount ) && ( nRow < nHeight ); i++ )
{
const ByteString aToken( aLine.GetToken( i, ',' ) );
const xub_StrLen nLen = aToken.Len();
- BOOL bProcessed = FALSE;
+ sal_Bool bProcessed = sal_False;
nBit = nDigits = nValue = 0;
@@ -247,11 +247,11 @@ BOOL XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFor
{
nValue = ( nValue << 4 ) + nTable;
nDigits++;
- bProcessed = TRUE;
+ bProcessed = sal_True;
}
else if( ( nTable < 0 ) && nDigits )
{
- bProcessed = TRUE;
+ bProcessed = sal_True;
break;
}
}
@@ -268,7 +268,7 @@ BOOL XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFor
}
}
- return TRUE;
+ return sal_True;
}
// ------------------------------------------------------------------------
@@ -276,7 +276,7 @@ BOOL XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFor
ReadState XBMReader::ReadXBM( Graphic& rGraphic )
{
ReadState eReadState;
- BYTE cDummy;
+ sal_uInt8 cDummy;
// sehen, ob wir _alles_ lesen koennen
rIStm.Seek( STREAM_SEEK_TO_END );
@@ -289,7 +289,7 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic )
ByteString aLine;
rIStm.Seek( nLastPos );
- bStatus = FALSE;
+ bStatus = sal_False;
aLine = FindTokenLine( &rIStm, "#define", "_width" );
if ( bStatus )
@@ -309,7 +309,7 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic )
}
}
else
- bStatus = FALSE;
+ bStatus = sal_False;
if ( bStatus )
{
@@ -327,7 +327,7 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic )
else if ( aLine.Search( "char" ) != STRING_NOTFOUND )
eFormat = XBM11;
else
- bStatus = FALSE;
+ bStatus = sal_False;
if ( bStatus && nWidth && nHeight )
{
@@ -341,7 +341,7 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic )
bStatus = ParseData( &rIStm, aLine, eFormat );
}
else
- bStatus = FALSE;
+ bStatus = sal_False;
}
}
}
@@ -373,11 +373,11 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic )
// - ImportXBM -
// -------------
-BOOL ImportXBM( SvStream& rStm, Graphic& rGraphic )
+sal_Bool ImportXBM( SvStream& rStm, Graphic& rGraphic )
{
XBMReader* pXBMReader = (XBMReader*) rGraphic.GetContext();
ReadState eReadState;
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if( !pXBMReader )
pXBMReader = new XBMReader( rStm );
@@ -387,7 +387,7 @@ BOOL ImportXBM( SvStream& rStm, Graphic& rGraphic )
if( eReadState == XBMREAD_ERROR )
{
- bRet = FALSE;
+ bRet = sal_False;
delete pXBMReader;
}
else if( eReadState == XBMREAD_OK )
diff --git a/svtools/source/filter.vcl/ixpm/makefile.mk b/svtools/source/filter.vcl/ixpm/makefile.mk
deleted file mode 100644
index 98f93290d325..000000000000
--- a/svtools/source/filter.vcl/ixpm/makefile.mk
+++ /dev/null
@@ -1,43 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-
-PRJNAME=svtools
-TARGET=ixpm
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-SOLARINC+=-I../../inc
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= $(SLO)$/xpmread.obj
-
-.INCLUDE : target.mk
diff --git a/svtools/source/filter.vcl/ixpm/rgbtable.hxx b/svtools/source/filter.vcl/ixpm/rgbtable.hxx
index f3506a1d0465..738c3f33460c 100644
--- a/svtools/source/filter.vcl/ixpm/rgbtable.hxx
+++ b/svtools/source/filter.vcl/ixpm/rgbtable.hxx
@@ -29,9 +29,9 @@
struct XPMRGBTab
{
const char* name;
- BYTE red;
- BYTE green;
- BYTE blue;
+ sal_uInt8 red;
+ sal_uInt8 green;
+ sal_uInt8 blue;
};
static XPMRGBTab pRGBTable[] = {
diff --git a/svtools/source/filter.vcl/ixpm/xpmread.cxx b/svtools/source/filter.vcl/ixpm/xpmread.cxx
index e0bbad0f0ceb..c218cff1630f 100644
--- a/svtools/source/filter.vcl/ixpm/xpmread.cxx
+++ b/svtools/source/filter.vcl/ixpm/xpmread.cxx
@@ -48,8 +48,8 @@ XPMReader::XPMReader( SvStream& rStm ) :
mnHeight ( 0 ),
mnColors ( 0 ),
mnCpp ( 0 ),
- mbTransparent ( FALSE ),
- mbStatus ( TRUE ),
+ mbTransparent ( sal_False ),
+ mbStatus ( sal_True ),
mnStatus ( 0 ),
mnIdentifier ( XPMIDENTIFIER ),
mcThisByte ( 0 ),
@@ -77,7 +77,7 @@ XPMReader::~XPMReader()
ReadState XPMReader::ReadXPM( Graphic& rGraphic )
{
ReadState eReadState;
- BYTE cDummy;
+ sal_uInt8 cDummy;
// sehen, ob wir _alles_ lesen koennen
mrIStm.Seek( STREAM_SEEK_TO_END );
@@ -88,14 +88,14 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic )
if ( mrIStm.GetError() != ERRCODE_IO_PENDING )
{
mrIStm.Seek( mnLastPos );
- mbStatus = TRUE;
+ mbStatus = sal_True;
if ( mbStatus )
{
- mpStringBuf = new BYTE [ XPMSTRINGBUF ];
- mpTempBuf = new BYTE [ XPMTEMPBUFSIZE ];
+ mpStringBuf = new sal_uInt8 [ XPMSTRINGBUF ];
+ mpTempBuf = new sal_uInt8 [ XPMTEMPBUFSIZE ];
- if ( ( mbStatus = ImplGetString() ) == TRUE )
+ if ( ( mbStatus = ImplGetString() ) == sal_True )
{
mnIdentifier = XPMVALUES; // Bitmap informationen einholen
mnWidth = ImplGetULONG( 0 );
@@ -115,14 +115,14 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic )
// Farbe: ( mnCpp )Byte(s)-> ASCII Eintrag der der Farbe zugeordnet ist
// 1 Byte -> 0xff wenn Farbe transparent ist
// 3 Bytes -> RGB Wert der Farbe
- mpColMap = new BYTE[ mnColors * ( 4 + mnCpp ) ];
+ mpColMap = new sal_uInt8[ mnColors * ( 4 + mnCpp ) ];
if ( mpColMap )
{
- for ( ULONG i = 0; i < mnColors; i++ )
+ for ( sal_uLong i = 0; i < mnColors; i++ )
{
- if ( ImplGetColor( i ) == FALSE )
+ if ( ImplGetColor( i ) == sal_False )
{
- mbStatus = FALSE;
+ mbStatus = sal_False;
break;
}
}
@@ -146,35 +146,35 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic )
maBmp = Bitmap( Size( mnWidth, mnHeight ), nBits );
mpAcc = maBmp.AcquireWriteAccess();
- // mbTransparent ist TRUE wenn mindestens eine Farbe Transparent ist
+ // mbTransparent ist sal_True wenn mindestens eine Farbe Transparent ist
if ( mbTransparent )
{
maMaskBmp = Bitmap( Size( mnWidth, mnHeight ), 1 );
if ( ( mpMaskAcc = maMaskBmp.AcquireWriteAccess() ) == NULL )
- mbStatus = FALSE;
+ mbStatus = sal_False;
}
if( mpAcc && mbStatus )
{
- ULONG i;
+ sal_uLong i;
if ( mnColors <=256 ) // palette is only needed by using less than 257
{ // colors
- BYTE* pPtr = &mpColMap[mnCpp];
+ sal_uInt8* pPtr = &mpColMap[mnCpp];
for ( i = 0; i < mnColors; i++ )
{
- mpAcc->SetPaletteColor( (BYTE)i, Color( pPtr[1], pPtr[2], pPtr[3] ) );
+ mpAcc->SetPaletteColor( (sal_uInt8)i, Color( pPtr[1], pPtr[2], pPtr[3] ) );
pPtr += ( mnCpp + 4 );
}
// using 2 charakters per pixel and less than 257 Colors we speed up
if ( mnCpp == 2 ) // by using a 64kb indexing table
{
- mpFastColorTable = new BYTE[ 256 * 256 ];
+ mpFastColorTable = new sal_uInt8[ 256 * 256 ];
for ( pPtr = mpColMap, i = 0; i < mnColors; i++, pPtr += mnCpp + 4 )
{
- ULONG j = pPtr[ 0 ] << 8;
+ sal_uLong j = pPtr[ 0 ] << 8;
j += pPtr[ 1 ];
- mpFastColorTable[ j ] = (BYTE)i;
+ mpFastColorTable[ j ] = (sal_uInt8)i;
}
}
}
@@ -182,9 +182,9 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic )
mnIdentifier = XPMPIXELS;
for ( i = 0; i < mnHeight; i++ )
{
- if ( ImplGetScanLine( i ) == FALSE )
+ if ( ImplGetScanLine( i ) == sal_False )
{
- mbStatus = FALSE;
+ mbStatus = sal_False;
break;
}
}
@@ -235,17 +235,17 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic )
// ------------------------------------------------------------------------
// ImplGetColor ermittelt saemtliche Farbwerte,
-// die Rueckgabe ist TRUE wenn saemtliche Farben zugeordnet werden konnten
+// die Rueckgabe ist sal_True wenn saemtliche Farben zugeordnet werden konnten
-BOOL XPMReader::ImplGetColor( ULONG nNumb )
+sal_Bool XPMReader::ImplGetColor( sal_uLong nNumb )
{
- BYTE* pString = mpStringBuf;
- BYTE* pPtr = ( mpColMap + nNumb * ( 4 + mnCpp ) );
- BOOL bStatus = ImplGetString();
+ sal_uInt8* pString = mpStringBuf;
+ sal_uInt8* pPtr = ( mpColMap + nNumb * ( 4 + mnCpp ) );
+ sal_Bool bStatus = ImplGetString();
if ( bStatus )
{
- for ( ULONG i = 0; i < mnCpp; i++ )
+ for ( sal_uLong i = 0; i < mnCpp; i++ )
*pPtr++ = *pString++;
bStatus = ImplGetColSub ( pPtr );
}
@@ -256,11 +256,11 @@ BOOL XPMReader::ImplGetColor( ULONG nNumb )
// ImpGetScanLine liest den String mpBufSize aus und schreibt die Pixel in die
// Bitmap. Der Parameter nY gibt die horizontale Position an.
-BOOL XPMReader::ImplGetScanLine( ULONG nY )
+sal_Bool XPMReader::ImplGetScanLine( sal_uLong nY )
{
- BOOL bStatus = ImplGetString();
- BYTE* pString = mpStringBuf;
- BYTE* pColor;
+ sal_Bool bStatus = ImplGetString();
+ sal_uInt8* pString = mpStringBuf;
+ sal_uInt8* pColor;
BitmapColor aWhite;
BitmapColor aBlack;
@@ -272,18 +272,18 @@ BOOL XPMReader::ImplGetScanLine( ULONG nY )
aBlack = mpMaskAcc->GetBestMatchingColor( Color( COL_BLACK ) );
}
if ( mnStringSize != ( mnWidth * mnCpp ))
- bStatus = FALSE;
+ bStatus = sal_False;
else
{
- ULONG i, j;
+ sal_uLong i, j;
if ( mpFastColorTable )
{
for ( i = 0; i < mnWidth; i++ )
{
j = (*pString++) << 8;
j += *pString++;
- BYTE k = (BYTE)mpFastColorTable[ j ];
- mpAcc->SetPixel( nY, i, BitmapColor( (BYTE)k ) );
+ sal_uInt8 k = (sal_uInt8)mpFastColorTable[ j ];
+ mpAcc->SetPixel( nY, i, BitmapColor( (sal_uInt8)k ) );
if ( mpMaskAcc )
mpMaskAcc->SetPixel( nY, i,
@@ -295,12 +295,12 @@ BOOL XPMReader::ImplGetScanLine( ULONG nY )
pColor = mpColMap;
for ( j = 0; j < mnColors; j++ )
{
- if ( ImplCompare( pString, pColor, mnCpp, XPMCASESENSITIVE ) == TRUE )
+ if ( ImplCompare( pString, pColor, mnCpp, XPMCASESENSITIVE ) == sal_True )
{
if ( mnColors > 256 )
mpAcc->SetPixel( nY, i, Color ( pColor[3], pColor[4], pColor[5] ) );
else
- mpAcc->SetPixel( nY, i, BitmapColor( (BYTE) j ) );
+ mpAcc->SetPixel( nY, i, BitmapColor( (sal_uInt8) j ) );
if ( mpMaskAcc )
mpMaskAcc->SetPixel( nY, i, (
@@ -323,11 +323,11 @@ BOOL XPMReader::ImplGetScanLine( ULONG nY )
// wurde eine Farbe gefunden wird an pDest[1]..pDest[2] der RGB wert geschrieben
// pDest[0] enthaelt 0xff wenn die Farbe transparent ist sonst 0
-BOOL XPMReader::ImplGetColSub( BYTE* pDest )
+sal_Bool XPMReader::ImplGetColSub( sal_uInt8* pDest )
{
unsigned char cTransparent[] = "None";
- BOOL bColStatus = FALSE;
+ sal_Bool bColStatus = sal_False;
if ( ImplGetColKey( 'c' ) || ImplGetColKey( 'm' ) || ImplGetColKey( 'g' ) )
{
@@ -335,7 +335,7 @@ BOOL XPMReader::ImplGetColSub( BYTE* pDest )
if ( *mpPara == '#' )
{
*pDest++ = 0;
- bColStatus = TRUE;
+ bColStatus = sal_True;
switch ( mnParaSize )
{
case 25 :
@@ -348,7 +348,7 @@ BOOL XPMReader::ImplGetColSub( BYTE* pDest )
ImplGetRGBHex ( pDest, 0 );
break;
default:
- bColStatus = FALSE;
+ bColStatus = sal_False;
break;
}
}
@@ -356,14 +356,14 @@ BOOL XPMReader::ImplGetColSub( BYTE* pDest )
else if ( ImplCompare( &cTransparent[0], mpPara, 4 ))
{
*pDest++ = 0xff;
- bColStatus = TRUE;
- mbTransparent = TRUE;
+ bColStatus = sal_True;
+ mbTransparent = sal_True;
}
// last we will try to get the colorname
else if ( mnParaSize > 2 ) // name must enlarge the minimum size
{
- ULONG i = 0;
- while ( TRUE )
+ sal_uLong i = 0;
+ while ( sal_True )
{
if ( pRGBTable[ i ].name == NULL )
break;
@@ -372,7 +372,7 @@ BOOL XPMReader::ImplGetColSub( BYTE* pDest )
if ( ImplCompare ( (unsigned char*)pRGBTable[ i ].name,
mpPara, mnParaSize, XPMCASENONSENSITIVE ) )
{
- bColStatus = TRUE;
+ bColStatus = sal_True;
*pDest++ = 0;
*pDest++ = pRGBTable[ i ].red;
*pDest++ = pRGBTable[ i ].green;
@@ -388,11 +388,11 @@ BOOL XPMReader::ImplGetColSub( BYTE* pDest )
// ------------------------------------------------------------------------
// ImplGetColKey durchsuch den String mpStringBuf nach einem Parameter 'nKey'
-// und gibt einen BOOL zurueck. ( wenn TRUE werden mpPara und mnParaSize gesetzt )
+// und gibt einen sal_Bool zurueck. ( wenn sal_True werden mpPara und mnParaSize gesetzt )
-BOOL XPMReader::ImplGetColKey( BYTE nKey )
+sal_Bool XPMReader::ImplGetColKey( sal_uInt8 nKey )
{
- BYTE nTemp, nPrev = ' ';
+ sal_uInt8 nTemp, nPrev = ' ';
mpPara = mpStringBuf + mnCpp + 1;
mnParaSize = 0;
@@ -427,7 +427,7 @@ BOOL XPMReader::ImplGetColKey( BYTE nKey )
}
}
}
- return ( mnParaSize ) ? TRUE : FALSE;
+ return ( mnParaSize ) ? sal_True : sal_False;
}
// ------------------------------------------------------------------------
@@ -439,12 +439,12 @@ BOOL XPMReader::ImplGetColKey( BYTE nKey )
// 6 : '#12345678abcdefab12345678' " " " "
-void XPMReader::ImplGetRGBHex( BYTE* pDest,ULONG nAdd )
+void XPMReader::ImplGetRGBHex( sal_uInt8* pDest,sal_uLong nAdd )
{
- BYTE* pPtr = mpPara+1;
- BYTE nHex, nTemp;
+ sal_uInt8* pPtr = mpPara+1;
+ sal_uInt8 nHex, nTemp;
- for ( ULONG i = 0; i < 3; i++ )
+ for ( sal_uLong i = 0; i < 3; i++ )
{
nHex = (*pPtr++) - '0';
if ( nHex > 9 )
@@ -456,24 +456,24 @@ void XPMReader::ImplGetRGBHex( BYTE* pDest,ULONG nAdd )
nHex = ( nHex << 4 ) + nTemp;
pPtr += nAdd;
- *pDest++ = (BYTE)nHex;
+ *pDest++ = (sal_uInt8)nHex;
}
}
// ------------------------------------------------------------------------
// ImplGetUlong gibt den wert einer bis zu 6stelligen ASCII-Dezimalzahl zurueck.
-ULONG XPMReader::ImplGetULONG( ULONG nPara )
+sal_uLong XPMReader::ImplGetULONG( sal_uLong nPara )
{
if ( ImplGetPara ( nPara ) )
{
- ULONG nRetValue = 0;
- BYTE* pPtr = mpPara;
+ sal_uLong nRetValue = 0;
+ sal_uInt8* pPtr = mpPara;
if ( ( mnParaSize > 6 ) || ( mnParaSize == 0 ) ) return 0;
- for ( ULONG i = 0; i < mnParaSize; i++ )
+ for ( sal_uLong i = 0; i < mnParaSize; i++ )
{
- BYTE j = (*pPtr++) - 48;
+ sal_uInt8 j = (*pPtr++) - 48;
if ( j > 9 ) return 0; // ascii is invalid
nRetValue*=10;
nRetValue+=j;
@@ -485,28 +485,28 @@ ULONG XPMReader::ImplGetULONG( ULONG nPara )
// ------------------------------------------------------------------------
-BOOL XPMReader::ImplCompare( BYTE* pSource, BYTE* pDest, ULONG nSize, ULONG nMode )
+sal_Bool XPMReader::ImplCompare( sal_uInt8* pSource, sal_uInt8* pDest, sal_uLong nSize, sal_uLong nMode )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if ( nMode == XPMCASENONSENSITIVE )
{
- for ( ULONG i = 0; i < nSize; i++ )
+ for ( sal_uLong i = 0; i < nSize; i++ )
{
if ( ( pSource[i]&~0x20 ) != ( pDest[i]&~0x20 ) )
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
}
else
{
- for ( ULONG i = 0; i < nSize; i++ )
+ for ( sal_uLong i = 0; i < nSize; i++ )
{
if ( pSource[i] != pDest[i] )
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
@@ -517,15 +517,15 @@ BOOL XPMReader::ImplCompare( BYTE* pSource, BYTE* pDest, ULONG nSize, ULONG nMod
// ------------------------------------------------------------------------
// ImplGetPara versucht den nNumb ( 0...x ) Parameter aus mpStringBuf zu ermitteln.
// Ein Parameter ist durch Spaces oder Tabs von den anderen getrennt.
-// Konnte der Parameter gefunden werden ist der Rueckgabewert TRUE und mpPara + mnParaSize
+// Konnte der Parameter gefunden werden ist der Rueckgabewert sal_True und mpPara + mnParaSize
// werden gesetzt.
-BOOL XPMReader::ImplGetPara ( ULONG nNumb )
+sal_Bool XPMReader::ImplGetPara ( sal_uLong nNumb )
{
- BYTE nByte;
- ULONG pSize = 0;
- BYTE* pPtr = mpStringBuf;
- ULONG nCount = 0;
+ sal_uInt8 nByte;
+ sal_uLong pSize = 0;
+ sal_uInt8* pPtr = mpStringBuf;
+ sal_uLong nCount = 0;
if ( ( *pPtr != ' ' ) && ( *pPtr != 0x09 ) )
{
@@ -567,7 +567,7 @@ BOOL XPMReader::ImplGetPara ( ULONG nNumb )
pSize++;
pPtr++;
}
- return ( ( nCount == nNumb ) && ( mpPara ) ) ? TRUE : FALSE;
+ return ( ( nCount == nNumb ) && ( mpPara ) ) ? sal_True : sal_False;
}
// ------------------------------------------------------------------------
@@ -575,10 +575,10 @@ BOOL XPMReader::ImplGetPara ( ULONG nNumb )
// mnStringSize enthaelt die Groesse des gelesenen Strings.
// Bemerkungen wie '//' und '/*.....*/' werden uebersprungen.
-BOOL XPMReader::ImplGetString( void )
+sal_Bool XPMReader::ImplGetString( void )
{
- BYTE sID[] = "/* XPM */";
- BYTE* pString = mpStringBuf;
+ sal_uInt8 sID[] = "/* XPM */";
+ sal_uInt8* pString = mpStringBuf;
mnStringSize = 0;
mpStringBuf[0] = 0;
@@ -597,13 +597,13 @@ BOOL XPMReader::ImplGetString( void )
{
if ( mnTempAvail <= 50 )
{
- mbStatus = FALSE; // file is too short to be a correct XPM format
+ mbStatus = sal_False; // file is too short to be a correct XPM format
break;
}
for ( int i = 0; i < 9; i++ ) // searching for "/* XPM */"
if ( *mpTempPtr++ != sID[i] )
{
- mbStatus = FALSE;
+ mbStatus = sal_False;
break;
}
mnTempAvail-=9;
@@ -635,7 +635,7 @@ BOOL XPMReader::ImplGetString( void )
}
if ( mnStringSize >= ( XPMSTRINGBUF - 1 ) )
{
- mbStatus = FALSE;
+ mbStatus = sal_False;
break;
}
*pString++ = mcThisByte;
@@ -673,11 +673,11 @@ BOOL XPMReader::ImplGetString( void )
// - ImportXPM -
// -------------
-BOOL ImportXPM( SvStream& rStm, Graphic& rGraphic )
+sal_Bool ImportXPM( SvStream& rStm, Graphic& rGraphic )
{
XPMReader* pXPMReader = (XPMReader*) rGraphic.GetContext();
ReadState eReadState;
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if( !pXPMReader )
pXPMReader = new XPMReader( rStm );
@@ -687,7 +687,7 @@ BOOL ImportXPM( SvStream& rStm, Graphic& rGraphic )
if( eReadState == XPMREAD_ERROR )
{
- bRet = FALSE;
+ bRet = sal_False;
delete pXPMReader;
}
else if( eReadState == XPMREAD_OK )
diff --git a/svtools/source/filter.vcl/jpeg/jpeg.cxx b/svtools/source/filter.vcl/jpeg/jpeg.cxx
index 146beff287bc..609e4684513e 100644
--- a/svtools/source/filter.vcl/jpeg/jpeg.cxx
+++ b/svtools/source/filter.vcl/jpeg/jpeg.cxx
@@ -33,12 +33,10 @@
extern "C"
{
- #define INT32 JPEG_INT32
#include "stdio.h"
#include "jpeg.h"
#include "jpeglib.h"
#include "jerror.h"
- #undef INT32
}
#define _JPEGPRIVATE
@@ -126,7 +124,7 @@ extern "C" int empty_output_buffer (j_compress_ptr cinfo)
dest->pub.next_output_byte = dest->buffer;
dest->pub.free_in_buffer = BUF_SIZE;
- return TRUE;
+ return sal_True;
}
extern "C" void term_destination (j_compress_ptr cinfo)
@@ -190,7 +188,7 @@ extern "C" void init_source (j_decompress_ptr cinfo)
* but we don't clear the input buffer.
* This is correct behavior for reading a series of images from one source.
*/
- src->start_of_file = TRUE;
+ src->start_of_file = sal_True;
}
long StreamRead( SvStream* pSvStm, void* pBuffer, long nBufferSize )
@@ -239,9 +237,9 @@ extern "C" int fill_input_buffer (j_decompress_ptr cinfo)
src->pub.next_input_byte = src->buffer;
src->pub.bytes_in_buffer = nbytes;
- src->start_of_file = FALSE;
+ src->start_of_file = sal_False;
- return TRUE;
+ return sal_True;
}
extern "C" void skip_input_data (j_decompress_ptr cinfo, long num_bytes)
@@ -256,7 +254,7 @@ extern "C" void skip_input_data (j_decompress_ptr cinfo, long num_bytes)
while (num_bytes > (long) src->pub.bytes_in_buffer) {
num_bytes -= (long) src->pub.bytes_in_buffer;
(void) fill_input_buffer(cinfo);
- /* note we assume that fill_input_buffer will never return FALSE,
+ /* note we assume that fill_input_buffer will never return sal_False,
* so suspension need not be handled.
*/
}
@@ -351,9 +349,9 @@ void* JPEGReader::CreateBitmap( void* pParam )
{
BitmapPalette aGrayPal( 256 );
- for( USHORT n = 0; n < 256; n++ )
+ for( sal_uInt16 n = 0; n < 256; n++ )
{
- const BYTE cGray = (BYTE) n;
+ const sal_uInt8 cGray = (sal_uInt8) n;
aGrayPal[ n ] = BitmapColor( cGray, cGray, cGray );
}
@@ -387,7 +385,7 @@ void* JPEGReader::CreateBitmap( void* pParam )
{
long nAlignedWidth;
- const ULONG nFormat = pAcc->GetScanlineFormat();
+ const sal_uLong nFormat = pAcc->GetScanlineFormat();
if(
( bGray && ( BMP_FORMAT_8BIT_PAL == nFormat ) ) ||
@@ -401,7 +399,7 @@ void* JPEGReader::CreateBitmap( void* pParam )
else
{
nAlignedWidth = AlignedWidth4Bytes( aSize.Width() * ( bGray ? 8 : 24 ) );
- ((JPEGCreateBitmapParam*)pParam)->bTopDown = TRUE;
+ ((JPEGCreateBitmapParam*)pParam)->bTopDown = sal_True;
pBmpBuf = pBuffer = rtl_allocateMemory( nAlignedWidth * aSize.Height() );
}
((JPEGCreateBitmapParam*)pParam)->nAlignedWidth = nAlignedWidth;
@@ -426,9 +424,9 @@ void JPEGReader::FillBitmap()
{
BitmapColor* pCols = new BitmapColor[ 256 ];
- for( USHORT n = 0; n < 256; n++ )
+ for( sal_uInt16 n = 0; n < 256; n++ )
{
- const BYTE cGray = (BYTE) n;
+ const sal_uInt8 cGray = (sal_uInt8) n;
pCols[ n ] = pAcc->GetBestMatchingColor( BitmapColor( cGray, cGray, cGray ) );
}
@@ -436,7 +434,7 @@ void JPEGReader::FillBitmap()
for( long nY = 0L; nY < nHeight; nY++ )
{
- pTmp = (BYTE*) pBuffer + nY * nAlignedWidth;
+ pTmp = (sal_uInt8*) pBuffer + nY * nAlignedWidth;
for( long nX = 0L; nX < nWidth; nX++ )
pAcc->SetPixel( nY, nX, pCols[ *pTmp++ ] );
@@ -450,7 +448,7 @@ void JPEGReader::FillBitmap()
for( long nY = 0L; nY < nHeight; nY++ )
{
- pTmp = (BYTE*) pBuffer + nY * nAlignedWidth;
+ pTmp = (sal_uInt8*) pBuffer + nY * nAlignedWidth;
for( long nX = 0L; nX < nWidth; nX++ )
{
@@ -516,8 +514,8 @@ ReadState JPEGReader::Read( Graphic& rGraphic )
long nEndPos;
long nLines;
ReadState eReadState;
- BOOL bRet = FALSE;
- BYTE cDummy;
+ sal_Bool bRet = sal_False;
+ sal_uInt8 cDummy;
#if 1 // TODO: is it possible to get rid of this seek to the end?
// check if the stream's end is already available
@@ -563,10 +561,10 @@ ReadState JPEGReader::Read( Graphic& rGraphic )
else
rGraphic = aBmp;
- bRet = TRUE;
+ bRet = sal_True;
}
else if( rIStm.GetError() == ERRCODE_IO_PENDING )
- bRet = TRUE;
+ bRet = sal_True;
// Status setzen ( Pending hat immer Vorrang )
if( rIStm.GetError() == ERRCODE_IO_PENDING )
@@ -630,13 +628,13 @@ void* JPEGWriter::GetScanline( long nY )
{
BitmapColor aColor;
long nWidth = pAcc->Width();
- BYTE* pTmp = pBuffer;
+ sal_uInt8* pTmp = pBuffer;
if( pAcc->HasPalette() )
{
for( long nX = 0L; nX < nWidth; nX++ )
{
- aColor = pAcc->GetPaletteColor( (BYTE) pAcc->GetPixel( nY, nX ) );
+ aColor = pAcc->GetPaletteColor( (sal_uInt8) pAcc->GetPixel( nY, nX ) );
*pTmp++ = aColor.GetRed();
if ( bGreys )
continue;
@@ -666,9 +664,9 @@ void* JPEGWriter::GetScanline( long nY )
// ------------------------------------------------------------------------
-BOOL JPEGWriter::Write( const Graphic& rGraphic )
+sal_Bool JPEGWriter::Write( const Graphic& rGraphic )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( xStatusIndicator.is() )
{
@@ -697,7 +695,7 @@ BOOL JPEGWriter::Write( const Graphic& rGraphic )
BitmapColor aColor;
for( long nX = 0L; bIsGrey && ( nX < nWidth ); nX++ )
{
- aColor = pAcc->HasPalette() ? pAcc->GetPaletteColor( (BYTE) pAcc->GetPixel( nY, nX ) )
+ aColor = pAcc->HasPalette() ? pAcc->GetPaletteColor( (sal_uInt8) pAcc->GetPixel( nY, nX ) )
: pAcc->GetPixel( nY, nX );
bIsGrey = ( aColor.GetRed() == aColor.GetGreen() ) && ( aColor.GetRed() == aColor.GetBlue() );
}
@@ -714,11 +712,11 @@ BOOL JPEGWriter::Write( const Graphic& rGraphic )
bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB );
if( !bNative )
- pBuffer = new BYTE[ AlignedWidth4Bytes( bGreys ? pAcc->Width() * 8L : pAcc->Width() * 24L ) ];
+ pBuffer = new sal_uInt8[ AlignedWidth4Bytes( bGreys ? pAcc->Width() * 8L : pAcc->Width() * 24L ) ];
JPEGCallbackStruct aCallbackData;
aCallbackData.xStatusIndicator = xStatusIndicator;
- bRet = (BOOL) WriteJPEG( this, &rOStm, pAcc->Width(), pAcc->Height(), bGreys, nQuality, &aCallbackData );
+ bRet = (sal_Bool) WriteJPEG( this, &rOStm, pAcc->Width(), pAcc->Height(), bGreys, nQuality, &aCallbackData );
delete[] pBuffer;
pBuffer = NULL;
@@ -736,11 +734,11 @@ BOOL JPEGWriter::Write( const Graphic& rGraphic )
// - ImportJPEG -
// --------------
-BOOL ImportJPEG( SvStream& rStm, Graphic& rGraphic, void* pCallerData, sal_Int32 nImportFlags )
+sal_Bool ImportJPEG( SvStream& rStm, Graphic& rGraphic, void* pCallerData, sal_Int32 nImportFlags )
{
JPEGReader* pJPEGReader = (JPEGReader*) rGraphic.GetContext();
ReadState eReadState;
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if( !pJPEGReader )
pJPEGReader = new JPEGReader( rStm, pCallerData, ( nImportFlags & GRFILTER_I_FLAGS_SET_LOGSIZE_FOR_JPEG ) != 0 );
@@ -755,7 +753,7 @@ BOOL ImportJPEG( SvStream& rStm, Graphic& rGraphic, void* pCallerData, sal_Int32
if( eReadState == JPEGREAD_ERROR )
{
- bRet = FALSE;
+ bRet = sal_False;
delete pJPEGReader;
}
else if( eReadState == JPEGREAD_OK )
@@ -770,7 +768,7 @@ BOOL ImportJPEG( SvStream& rStm, Graphic& rGraphic, void* pCallerData, sal_Int32
// - ExportJPEG -
// --------------
-BOOL ExportJPEG( SvStream& rOStm, const Graphic& rGraphic,
+sal_Bool ExportJPEG( SvStream& rOStm, const Graphic& rGraphic,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData,
bool* pExportWasGrey
)
diff --git a/svtools/source/filter.vcl/jpeg/jpeg.h b/svtools/source/filter.vcl/jpeg/jpeg.h
index c5284e968a8d..a77c335d4b66 100644
--- a/svtools/source/filter.vcl/jpeg/jpeg.h
+++ b/svtools/source/filter.vcl/jpeg/jpeg.h
@@ -51,12 +51,7 @@ struct JPEGCreateBitmapParam
};
typedef struct my_error_mgr* my_error_ptr;
-typedef unsigned char BYTE;
-#ifdef WIN
-typedef unsigned char _huge* HPBYTE;
-#else
typedef unsigned char* HPBYTE;
-#endif
void* JPEGMalloc( size_t size );
void JPEGFree( void *ptr );
diff --git a/svtools/source/filter.vcl/jpeg/jpegc.c b/svtools/source/filter.vcl/jpeg/jpegc.c
index f94d7039920f..06c7d4f69964 100644
--- a/svtools/source/filter.vcl/jpeg/jpegc.c
+++ b/svtools/source/filter.vcl/jpeg/jpegc.c
@@ -101,13 +101,13 @@ void ReadJPEG( void* pJPEGReader, void* pIStm, long* pLines )
jpeg_create_decompress( &cinfo );
bDecompCreated = 1;
jpeg_svstream_src( &cinfo, pIStm );
- jpeg_read_header( &cinfo, TRUE );
+ jpeg_read_header( &cinfo, sal_True );
cinfo.scale_num = 1;
cinfo.scale_denom = 1;
cinfo.output_gamma = 1.0;
- cinfo.raw_data_out = FALSE;
- cinfo.quantize_colors = FALSE;
+ cinfo.raw_data_out = sal_False;
+ cinfo.quantize_colors = sal_False;
if ( cinfo.jpeg_color_space == JCS_YCbCr )
cinfo.out_color_space = JCS_RGB;
else if ( cinfo.jpeg_color_space == JCS_YCCK )
@@ -139,8 +139,8 @@ void ReadJPEG( void* pJPEGReader, void* pIStm, long* pLines )
if( cinfo.scale_denom > 1 )
{
cinfo.dct_method = JDCT_FASTEST;
- cinfo.do_fancy_upsampling = FALSE;
- cinfo.do_block_smoothing = FALSE;
+ cinfo.do_fancy_upsampling = sal_False;
+ cinfo.do_block_smoothing = sal_False;
}
}
@@ -254,12 +254,12 @@ long WriteJPEG( void* pJPEGWriter, void* pOStm,
}
jpeg_set_defaults( &cinfo );
- jpeg_set_quality( &cinfo, (int) nQualityPercent, FALSE );
+ jpeg_set_quality( &cinfo, (int) nQualityPercent, sal_False );
if ( ( nWidth > 128 ) || ( nHeight > 128 ) )
jpeg_simple_progression( &cinfo );
- jpeg_start_compress( &cinfo, TRUE );
+ jpeg_start_compress( &cinfo, sal_True );
for( nY = 0; nY < nHeight; nY++ )
{
diff --git a/svtools/source/filter.vcl/jpeg/makefile.mk b/svtools/source/filter.vcl/jpeg/makefile.mk
deleted file mode 100644
index 303398c5e0c9..000000000000
--- a/svtools/source/filter.vcl/jpeg/makefile.mk
+++ /dev/null
@@ -1,48 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-
-PRJNAME=svtools
-TARGET=jpeg
-
-# --- Settings -----------------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-SOLARINC+=-I../../inc
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= $(EXCEPTIONSFILES) \
- $(SLO)$/jpegc.obj
-
-EXCEPTIONSFILES= \
- $(SLO)$/jpeg.obj
-
-.INCLUDE : target.mk
diff --git a/svtools/source/filter.vcl/wmf/emfwr.cxx b/svtools/source/filter.vcl/wmf/emfwr.cxx
index ba97834b4fbc..d556e889d2ad 100644
--- a/svtools/source/filter.vcl/wmf/emfwr.cxx
+++ b/svtools/source/filter.vcl/wmf/emfwr.cxx
@@ -169,17 +169,17 @@
// - EMFWriter -
// -------------
-BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, FilterConfigItem* pFilterConfigItem )
+sal_Bool EMFWriter::WriteEMF( const GDIMetaFile& rMtf, FilterConfigItem* pFilterConfigItem )
{
- const ULONG nHeaderPos = m_rStm.Tell();
+ const sal_uLong nHeaderPos = m_rStm.Tell();
- mpHandlesUsed = new BOOL[ MAXHANDLES ];
- memset( mpHandlesUsed, 0, MAXHANDLES * sizeof( BOOL ) );
+ mpHandlesUsed = new sal_Bool[ MAXHANDLES ];
+ memset( mpHandlesUsed, 0, MAXHANDLES * sizeof( sal_Bool ) );
mnHorTextAlign = mnHandleCount = mnLastPercent = mnRecordPos = mnRecordCount = 0;
mnLineHandle = mnFillHandle = mnTextHandle = HANDLE_INVALID;
- mbRecordOpen = FALSE;
+ mbRecordOpen = sal_False;
- maVDev.EnableOutput( FALSE );
+ maVDev.EnableOutput( sal_False );
maVDev.SetMapMode( rMtf.GetPrefMapMode() );
mpFilterConfigItem = pFilterConfigItem;
@@ -197,29 +197,29 @@ BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, FilterConfigItem* pFilterConf
// set 100th mm map mode in EMF
ImplBeginRecord( WIN_EMR_SETMAPMODE );
- m_rStm << (INT32) MM_ANISOTROPIC;
+ m_rStm << (sal_Int32) MM_ANISOTROPIC;
ImplEndRecord();
ImplBeginRecord( WIN_EMR_SETVIEWPORTEXTEX );
- m_rStm << (INT32) maVDev.ImplGetDPIX() << (INT32) maVDev.ImplGetDPIY();
+ m_rStm << (sal_Int32) maVDev.ImplGetDPIX() << (sal_Int32) maVDev.ImplGetDPIY();
ImplEndRecord();
ImplBeginRecord( WIN_EMR_SETWINDOWEXTEX );
- m_rStm << (INT32) 2540 << (INT32) 2540;
+ m_rStm << (sal_Int32) 2540 << (sal_Int32) 2540;
ImplEndRecord();
ImplBeginRecord( WIN_EMR_SETVIEWPORTORGEX );
- m_rStm << (INT32) 0 << (INT32) 0;
+ m_rStm << (sal_Int32) 0 << (sal_Int32) 0;
ImplEndRecord();
ImplBeginRecord( WIN_EMR_SETWINDOWORGEX );
- m_rStm << (INT32) 0 << (INT32) 0;
+ m_rStm << (sal_Int32) 0 << (sal_Int32) 0;
ImplEndRecord();
ImplWriteRasterOp( ROP_OVERPAINT );
ImplBeginRecord( WIN_EMR_SETBKMODE );
- m_rStm << (UINT32) 1; // TRANSPARENT
+ m_rStm << (sal_uInt32) 1; // TRANSPARENT
ImplEndRecord();
// write emf data
@@ -233,17 +233,17 @@ BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, FilterConfigItem* pFilterConf
// write header
- const ULONG nEndPos = m_rStm.Tell(); m_rStm.Seek( nHeaderPos );
-
- m_rStm << (UINT32) 0x00000001 << (UINT32) 108 //use [MS-EMF 2.2.11] HeaderExtension2 Object
- << (INT32) 0 << (INT32) 0 << (INT32) ( aMtfSizePix.Width() - 1 ) << (INT32) ( aMtfSizePix.Height() - 1 )
- << (INT32) 0 << (INT32) 0 << (INT32) ( aMtfSizeLog.Width() - 1 ) << (INT32) ( aMtfSizeLog.Height() - 1 )
- << (UINT32) 0x464d4520 << (UINT32) 0x10000 << (UINT32) ( nEndPos - nHeaderPos )
- << (UINT32) mnRecordCount << (UINT16) ( mnHandleCount + 1 ) << (UINT16) 0 << (UINT32) 0 << (UINT32) 0 << (UINT32) 0
- << (INT32) aMtfSizePix.Width() << (INT32) aMtfSizePix.Height()
- << (INT32) ( aMtfSizeLog.Width() / 100 ) << (INT32) ( aMtfSizeLog.Height() / 100 )
- << (UINT32) 0 << (UINT32) 0 << (UINT32) 0
- << (INT32) ( aMtfSizeLog.Width() * 10 ) << (INT32) ( aMtfSizeLog.Height() * 10 ); //use [MS-EMF 2.2.11] HeaderExtension2 Object
+ const sal_uLong nEndPos = m_rStm.Tell(); m_rStm.Seek( nHeaderPos );
+
+ m_rStm << (sal_uInt32) 0x00000001 << (sal_uInt32) 108 //use [MS-EMF 2.2.11] HeaderExtension2 Object
+ << (sal_Int32) 0 << (sal_Int32) 0 << (sal_Int32) ( aMtfSizePix.Width() - 1 ) << (sal_Int32) ( aMtfSizePix.Height() - 1 )
+ << (sal_Int32) 0 << (sal_Int32) 0 << (sal_Int32) ( aMtfSizeLog.Width() - 1 ) << (sal_Int32) ( aMtfSizeLog.Height() - 1 )
+ << (sal_uInt32) 0x464d4520 << (sal_uInt32) 0x10000 << (sal_uInt32) ( nEndPos - nHeaderPos )
+ << (sal_uInt32) mnRecordCount << (sal_uInt16) ( mnHandleCount + 1 ) << (sal_uInt16) 0 << (sal_uInt32) 0 << (sal_uInt32) 0 << (sal_uInt32) 0
+ << (sal_Int32) aMtfSizePix.Width() << (sal_Int32) aMtfSizePix.Height()
+ << (sal_Int32) ( aMtfSizeLog.Width() / 100 ) << (sal_Int32) ( aMtfSizeLog.Height() / 100 )
+ << (sal_uInt32) 0 << (sal_uInt32) 0 << (sal_uInt32) 0
+ << (sal_Int32) ( aMtfSizeLog.Width() * 10 ) << (sal_Int32) ( aMtfSizeLog.Height() * 10 ); //use [MS-EMF 2.2.11] HeaderExtension2 Object
m_rStm.Seek( nEndPos );
delete[] mpHandlesUsed;
@@ -253,15 +253,15 @@ BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, FilterConfigItem* pFilterConf
// -----------------------------------------------------------------------------
-ULONG EMFWriter::ImplAcquireHandle()
+sal_uLong EMFWriter::ImplAcquireHandle()
{
- ULONG nHandle = HANDLE_INVALID;
+ sal_uLong nHandle = HANDLE_INVALID;
- for( ULONG i = 0; i < MAXHANDLES && ( HANDLE_INVALID == nHandle ); i++ )
+ for( sal_uLong i = 0; i < MAXHANDLES && ( HANDLE_INVALID == nHandle ); i++ )
{
if( !mpHandlesUsed[ i ] )
{
- mpHandlesUsed[ i ] = TRUE;
+ mpHandlesUsed[ i ] = sal_True;
if( ( nHandle = i ) == mnHandleCount )
mnHandleCount++;
@@ -274,10 +274,10 @@ ULONG EMFWriter::ImplAcquireHandle()
// -----------------------------------------------------------------------------
-void EMFWriter::ImplReleaseHandle( ULONG nHandle )
+void EMFWriter::ImplReleaseHandle( sal_uLong nHandle )
{
DBG_ASSERT( nHandle && ( nHandle < MAXHANDLES ), "Handle out of range" );
- mpHandlesUsed[ nHandle - 1 ] = FALSE;
+ mpHandlesUsed[ nHandle - 1 ] = sal_False;
}
// -----------------------------------------------------------------------------
@@ -288,7 +288,7 @@ void EMFWriter::ImplBeginRecord( sal_uInt32 nType )
if( !mbRecordOpen )
{
- mbRecordOpen = TRUE;
+ mbRecordOpen = sal_True;
mnRecordPos = m_rStm.Tell();
m_rStm << nType;
@@ -315,17 +315,17 @@ void EMFWriter::ImplEndRecord()
while( nFillBytes-- )
m_rStm << (sal_uInt8)0;
mnRecordCount++;
- mbRecordOpen = FALSE;
+ mbRecordOpen = sal_False;
}
}
// -----------------------------------------------------------------------------
-BOOL EMFWriter::ImplPrepareHandleSelect( sal_uInt32& rHandle, ULONG nSelectType )
+sal_Bool EMFWriter::ImplPrepareHandleSelect( sal_uInt32& rHandle, sal_uLong nSelectType )
{
if( rHandle != HANDLE_INVALID )
{
- UINT32 nStockObject = 0x80000000;
+ sal_uInt32 nStockObject = 0x80000000;
if( LINE_SELECT == nSelectType )
nStockObject |= 0x00000007;
@@ -410,7 +410,7 @@ void EMFWriter::ImplCheckTextAttr()
m_rStm << mnTextHandle;
ImplWriteExtent( -rFont.GetSize().Height() );
ImplWriteExtent( rFont.GetSize().Width() );
- m_rStm << (INT32) rFont.GetOrientation() << (INT32) rFont.GetOrientation();
+ m_rStm << (sal_Int32) rFont.GetOrientation() << (sal_Int32) rFont.GetOrientation();
switch( rFont.GetWeight() )
{
@@ -428,11 +428,11 @@ void EMFWriter::ImplCheckTextAttr()
}
m_rStm << nWeight;
- m_rStm << (BYTE) ( ( ITALIC_NONE == rFont.GetItalic() ) ? 0 : 1 );
- m_rStm << (BYTE) ( ( UNDERLINE_NONE == rFont.GetUnderline() ) ? 0 : 1 );
- m_rStm << (BYTE) ( ( STRIKEOUT_NONE == rFont.GetStrikeout() ) ? 0 : 1 );
- m_rStm << (BYTE) ( ( RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet() ) ? 2 : 0 );
- m_rStm << (BYTE) 0 << (BYTE) 0 << (BYTE) 0;
+ m_rStm << (sal_uInt8) ( ( ITALIC_NONE == rFont.GetItalic() ) ? 0 : 1 );
+ m_rStm << (sal_uInt8) ( ( UNDERLINE_NONE == rFont.GetUnderline() ) ? 0 : 1 );
+ m_rStm << (sal_uInt8) ( ( STRIKEOUT_NONE == rFont.GetStrikeout() ) ? 0 : 1 );
+ m_rStm << (sal_uInt8) ( ( RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet() ) ? 2 : 0 );
+ m_rStm << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0;
switch( rFont.GetPitch() )
{
@@ -465,24 +465,24 @@ void EMFWriter::ImplCheckTextAttr()
m_rStm << (sal_Unicode) 0;
// dummy elfVersion, elfStyleSize, elfMatch, elfReserved
- m_rStm << (UINT32) 0 << (UINT32) 0 << (UINT32) 0 << (UINT32) 0 ;
+ m_rStm << (sal_uInt32) 0 << (sal_uInt32) 0 << (sal_uInt32) 0 << (sal_uInt32) 0 ;
// dummy elfVendorId
- m_rStm << (UINT32) 0;
+ m_rStm << (sal_uInt32) 0;
// dummy elfCulture
- m_rStm << (UINT32) 0;
+ m_rStm << (sal_uInt32) 0;
// dummy elfPanose
- m_rStm << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0;
+ m_rStm << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0;
// fill record to get a record size divideable by 4
- m_rStm << (UINT16) 0;
+ m_rStm << (sal_uInt16) 0;
ImplEndRecord();
// TextAlign
- UINT32 nTextAlign;
+ sal_uInt32 nTextAlign;
switch( rFont.GetAlign() )
{
@@ -511,10 +511,10 @@ void EMFWriter::ImplCheckTextAttr()
void EMFWriter::ImplWriteColor( const Color& rColor )
{
- UINT32 nCol = rColor.GetRed();
+ sal_uInt32 nCol = rColor.GetRed();
- nCol |= ( (UINT32) rColor.GetGreen() ) << 8;
- nCol |= ( (UINT32) rColor.GetBlue() ) << 16;
+ nCol |= ( (sal_uInt32) rColor.GetGreen() ) << 8;
+ nCol |= ( (sal_uInt32) rColor.GetBlue() ) << 16;
m_rStm << nCol;
}
@@ -523,7 +523,7 @@ void EMFWriter::ImplWriteColor( const Color& rColor )
void EMFWriter::ImplWriteRasterOp( RasterOp eRop )
{
- UINT32 nROP2;
+ sal_uInt32 nROP2;
switch( eRop )
{
@@ -542,7 +542,7 @@ void EMFWriter::ImplWriteRasterOp( RasterOp eRop )
void EMFWriter::ImplWriteExtent( long nExtent )
{
nExtent = maVDev.LogicToLogic( Size( nExtent, 0 ), maVDev.GetMapMode(), maDestMapMode ).Width();
- m_rStm << (INT32) nExtent;
+ m_rStm << (sal_Int32) nExtent;
}
// -----------------------------------------------------------------------------
@@ -550,7 +550,7 @@ void EMFWriter::ImplWriteExtent( long nExtent )
void EMFWriter::ImplWritePoint( const Point& rPoint )
{
const Point aPoint( maVDev.LogicToLogic( rPoint, maVDev.GetMapMode(), maDestMapMode ));
- m_rStm << (INT32) aPoint.X() << (INT32) aPoint.Y();
+ m_rStm << (sal_Int32) aPoint.X() << (sal_Int32) aPoint.Y();
}
// -----------------------------------------------------------------------------
@@ -558,7 +558,7 @@ void EMFWriter::ImplWritePoint( const Point& rPoint )
void EMFWriter::ImplWriteSize( const Size& rSize)
{
const Size aSize( maVDev.LogicToLogic( rSize, maVDev.GetMapMode(), maDestMapMode ));
- m_rStm << (INT32) aSize.Width() << (INT32) aSize.Height();
+ m_rStm << (sal_Int32) aSize.Width() << (sal_Int32) aSize.Height();
}
// -----------------------------------------------------------------------------
@@ -571,7 +571,7 @@ void EMFWriter::ImplWriteRect( const Rectangle& rRect )
// -----------------------------------------------------------------------------
-void EMFWriter::ImplWritePolygonRecord( const Polygon& rPoly, BOOL bClose )
+void EMFWriter::ImplWritePolygonRecord( const Polygon& rPoly, sal_Bool bClose )
{
if( rPoly.GetSize() )
{
@@ -586,9 +586,9 @@ void EMFWriter::ImplWritePolygonRecord( const Polygon& rPoly, BOOL bClose )
ImplBeginRecord( bClose ? WIN_EMR_POLYGON : WIN_EMR_POLYLINE );
ImplWriteRect( rPoly.GetBoundRect() );
- m_rStm << (UINT32) rPoly.GetSize();
+ m_rStm << (sal_uInt32) rPoly.GetSize();
- for( USHORT i = 0; i < rPoly.GetSize(); i++ )
+ for( sal_uInt16 i = 0; i < rPoly.GetSize(); i++ )
ImplWritePoint( rPoly[ i ] );
ImplEndRecord();
@@ -605,7 +605,7 @@ void EMFWriter::ImplWritePolyPolygonRecord( const PolyPolygon& rPolyPoly )
if( nPolyCount )
{
if( 1 == nPolyCount )
- ImplWritePolygonRecord( rPolyPoly[ 0 ], TRUE );
+ ImplWritePolygonRecord( rPolyPoly[ 0 ], sal_True );
else
{
sal_Bool bHasFlags = sal_False;
@@ -737,7 +737,7 @@ void EMFWriter::ImplWritePath( const PolyPolygon& rPolyPoly, sal_Bool bClosed )
// -----------------------------------------------------------------------------
void EMFWriter::ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt,
- const Size& rSz, UINT32 nROP )
+ const Size& rSz, sal_uInt32 nROP )
{
if( !!rBmp )
{
@@ -747,19 +747,19 @@ void EMFWriter::ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt,
ImplBeginRecord( WIN_EMR_STRETCHDIBITS );
ImplWriteRect( Rectangle( rPt, rSz ) );
ImplWritePoint( rPt );
- m_rStm << (INT32) 0 << (INT32) 0 << (INT32) aBmpSizePixel.Width() << (INT32) aBmpSizePixel.Height();
+ m_rStm << (sal_Int32) 0 << (sal_Int32) 0 << (sal_Int32) aBmpSizePixel.Width() << (sal_Int32) aBmpSizePixel.Height();
// write offset positions and sizes later
- const ULONG nOffPos = m_rStm.Tell();
+ const sal_uLong nOffPos = m_rStm.Tell();
m_rStm.SeekRel( 16 );
- m_rStm << (UINT32) 0 << ( ( ROP_XOR == maVDev.GetRasterOp() && WIN_SRCCOPY == nROP ) ? WIN_SRCINVERT : nROP );
+ m_rStm << (sal_uInt32) 0 << ( ( ROP_XOR == maVDev.GetRasterOp() && WIN_SRCCOPY == nROP ) ? WIN_SRCINVERT : nROP );
ImplWriteSize( rSz );
- rBmp.Write( aMemStm, TRUE, FALSE );
+ rBmp.Write( aMemStm, sal_True, sal_False );
- UINT32 nDIBSize = aMemStm.Tell(), nHeaderSize, nCompression, nColsUsed, nPalCount, nImageSize;
- UINT16 nBitCount;
+ sal_uInt32 nDIBSize = aMemStm.Tell(), nHeaderSize, nCompression, nColsUsed, nPalCount, nImageSize;
+ sal_uInt16 nBitCount;
// get DIB parameters
aMemStm.Seek( 0 );
@@ -769,15 +769,15 @@ void EMFWriter::ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt,
aMemStm.SeekRel( 8 );
aMemStm >> nColsUsed;
- nPalCount = ( nBitCount <= 8 ) ? ( nColsUsed ? nColsUsed : ( 1 << (UINT32) nBitCount ) ) :
+ nPalCount = ( nBitCount <= 8 ) ? ( nColsUsed ? nColsUsed : ( 1 << (sal_uInt32) nBitCount ) ) :
( ( 3 == nCompression ) ? 12 : 0 );
m_rStm.Write( aMemStm.GetData(), nDIBSize );
- const ULONG nEndPos = m_rStm.Tell();
+ const sal_uLong nEndPos = m_rStm.Tell();
m_rStm.Seek( nOffPos );
- m_rStm << (UINT32) 80 << (UINT32)( nHeaderSize + ( nPalCount << 2 ) );
- m_rStm << (UINT32)( 80 + ( nHeaderSize + ( nPalCount << 2 ) ) ) << nImageSize;
+ m_rStm << (sal_uInt32) 80 << (sal_uInt32)( nHeaderSize + ( nPalCount << 2 ) );
+ m_rStm << (sal_uInt32)( 80 + ( nHeaderSize + ( nPalCount << 2 ) ) ) << nImageSize;
m_rStm.Seek( nEndPos );
ImplEndRecord();
@@ -827,12 +827,12 @@ void EMFWriter::ImplWriteTextRecord( const Point& rPos, const String rText, cons
ImplBeginRecord( WIN_EMR_EXTTEXTOUTW );
ImplWriteRect( Rectangle( rPos, Size( nNormWidth, maVDev.GetTextHeight() ) ) );
- m_rStm << (UINT32)1;
- m_rStm << (INT32) 0 << (INT32) 0;
+ m_rStm << (sal_uInt32)1;
+ m_rStm << (sal_Int32) 0 << (sal_Int32) 0;
ImplWritePoint( rPos );
- m_rStm << (UINT32) nLen << (UINT32) 76 << (UINT32) 2;
- m_rStm << (INT32) 0 << (INT32) 0 << (INT32) 0 << (INT32) 0;
- m_rStm << (UINT32) ( 76 + ( nLen << 1 ) + ( (nLen & 1 ) ? 2 : 0 ) );
+ m_rStm << (sal_uInt32) nLen << (sal_uInt32) 76 << (sal_uInt32) 2;
+ m_rStm << (sal_Int32) 0 << (sal_Int32) 0 << (sal_Int32) 0 << (sal_Int32) 0;
+ m_rStm << (sal_uInt32) ( 76 + ( nLen << 1 ) + ( (nLen & 1 ) ? 2 : 0 ) );
// write text
for( i = 0; i < nLen; i++ )
@@ -840,7 +840,7 @@ void EMFWriter::ImplWriteTextRecord( const Point& rPos, const String rText, cons
// padding word
if( nLen & 1 )
- m_rStm << (UINT16) 0;
+ m_rStm << (sal_uInt16) 0;
// write DX array
ImplWriteExtent( pDX[ 0 ] );
@@ -874,7 +874,7 @@ void EMFWriter::Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const bas
for(sal_uInt32 a(0); a < aLinePolyPolygon.count(); a++)
{
const basegfx::B2DPolygon aCandidate(aLinePolyPolygon.getB2DPolygon(a));
- ImplWritePolygonRecord( Polygon(aCandidate), FALSE );
+ ImplWritePolygonRecord( Polygon(aCandidate), sal_False );
}
}
@@ -902,10 +902,10 @@ void EMFWriter::Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const bas
void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
{
- for( ULONG j = 0, nActionCount = rMtf.GetActionCount(); j < nActionCount; j++ )
+ for( sal_uLong j = 0, nActionCount = rMtf.GetActionCount(); j < nActionCount; j++ )
{
const MetaAction* pAction = rMtf.GetAction( j );
- const USHORT nType = pAction->GetType();
+ const sal_uInt16 nType = pAction->GetType();
switch( nType )
{
@@ -1073,7 +1073,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
{
if(pA->GetLineInfo().IsDefault())
{
- ImplWritePolygonRecord( rPoly, FALSE );
+ ImplWritePolygonRecord( rPoly, sal_False );
}
else
{
@@ -1156,7 +1156,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
const MetaEPSAction* pA = (const MetaEPSAction*) pAction;
const GDIMetaFile aSubstitute( pA->GetSubstitute() );
- for( ULONG i = 0, nCount = aSubstitute.GetActionCount(); i < nCount; i++ )
+ for( sal_uLong i = 0, nCount = aSubstitute.GetActionCount(); i < nCount; i++ )
{
const MetaAction* pSubstAct = aSubstitute.GetAction( i );
if( pSubstAct->GetType() == META_BMPSCALE_ACTION )
@@ -1175,7 +1175,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
maVDev.Pop();
ImplBeginRecord( WIN_EMR_RESTOREDC );
- m_rStm << (INT32) -1;
+ m_rStm << (sal_Int32) -1;
ImplEndRecord();
break;
}
@@ -1306,14 +1306,14 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
case( META_LINECOLOR_ACTION ):
{
( (MetaAction*) pAction )->Execute( &maVDev );
- mbLineChanged = TRUE;
+ mbLineChanged = sal_True;
}
break;
case( META_FILLCOLOR_ACTION ):
{
( (MetaAction*) pAction )->Execute( &maVDev );
- mbFillChanged = TRUE;
+ mbFillChanged = sal_True;
}
break;
@@ -1324,7 +1324,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
case( META_FONT_ACTION ):
{
( (MetaAction*) pAction )->Execute( &maVDev );
- mbTextChanged = TRUE;
+ mbTextChanged = sal_True;
}
break;
@@ -1365,11 +1365,11 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
( (MetaAction*) pAction )->Execute( &maVDev );
ImplBeginRecord( WIN_EMR_RESTOREDC );
- m_rStm << (INT32) -1;
+ m_rStm << (sal_Int32) -1;
ImplEndRecord();
ImplWriteRasterOp( maVDev.GetRasterOp() );
- mbLineChanged = mbFillChanged = mbTextChanged = TRUE;
+ mbLineChanged = mbFillChanged = mbTextChanged = sal_True;
}
break;
diff --git a/svtools/source/filter.vcl/wmf/emfwr.hxx b/svtools/source/filter.vcl/wmf/emfwr.hxx
index fbee680b1cd0..ee3b723ace3e 100644
--- a/svtools/source/filter.vcl/wmf/emfwr.hxx
+++ b/svtools/source/filter.vcl/wmf/emfwr.hxx
@@ -51,27 +51,27 @@ private:
MapMode maDestMapMode;
FilterConfigItem* mpFilterConfigItem;
SvStream& m_rStm;
- BOOL* mpHandlesUsed;
- ULONG mnHandleCount;
- ULONG mnLastPercent;
- ULONG mnRecordCount;
- ULONG mnRecordPos;
- BOOL mbRecordOpen;
- BOOL mbLineChanged;
+ sal_Bool* mpHandlesUsed;
+ sal_uLong mnHandleCount;
+ sal_uLong mnLastPercent;
+ sal_uLong mnRecordCount;
+ sal_uLong mnRecordPos;
+ sal_Bool mbRecordOpen;
+ sal_Bool mbLineChanged;
sal_uInt32 mnLineHandle;
- BOOL mbFillChanged;
+ sal_Bool mbFillChanged;
sal_uInt32 mnFillHandle;
- BOOL mbTextChanged;
+ sal_Bool mbTextChanged;
sal_uInt32 mnTextHandle;
sal_uInt32 mnHorTextAlign;
void ImplBeginRecord( sal_uInt32 nType );
void ImplEndRecord();
- ULONG ImplAcquireHandle();
- void ImplReleaseHandle( ULONG nHandle );
+ sal_uLong ImplAcquireHandle();
+ void ImplReleaseHandle( sal_uLong nHandle );
- BOOL ImplPrepareHandleSelect( sal_uInt32& rHandle, ULONG nSelectType );
+ sal_Bool ImplPrepareHandleSelect( sal_uInt32& rHandle, sal_uLong nSelectType );
void ImplCheckLineAttr();
void ImplCheckFillAttr();
void ImplCheckTextAttr();
@@ -83,9 +83,9 @@ private:
void ImplWriteSize( const Size& rSize);
void ImplWriteRect( const Rectangle& rRect );
void ImplWritePath( const PolyPolygon& rPolyPoly, sal_Bool bClose );
- void ImplWritePolygonRecord( const Polygon& rPoly, BOOL bClose );
+ void ImplWritePolygonRecord( const Polygon& rPoly, sal_Bool bClose );
void ImplWritePolyPolygonRecord( const PolyPolygon& rPolyPoly );
- void ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, const Size& rSz, UINT32 nROP );
+ void ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, const Size& rSz, sal_uInt32 nROP );
void ImplWriteTextRecord( const Point& rPos, const String rText, const sal_Int32* pDXArray, sal_uInt32 nWidth );
void Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon);
@@ -95,7 +95,7 @@ public:
EMFWriter(SvStream &rStream) : m_rStm(rStream) {}
- BOOL WriteEMF( const GDIMetaFile& rMtf, FilterConfigItem* pConfigItem = NULL );
+ sal_Bool WriteEMF( const GDIMetaFile& rMtf, FilterConfigItem* pConfigItem = NULL );
};
#endif // _EMFWR_HXX
diff --git a/svtools/source/filter.vcl/wmf/enhwmf.cxx b/svtools/source/filter.vcl/wmf/enhwmf.cxx
index 259f518fbf95..91cabcf430a3 100644
--- a/svtools/source/filter.vcl/wmf/enhwmf.cxx
+++ b/svtools/source/filter.vcl/wmf/enhwmf.cxx
@@ -272,8 +272,8 @@ void EnhWMFReader::ReadEMFPlusComment(sal_uInt32 length, sal_Bool& bHaveDC)
length -= 4;
while (length > 0) {
- UINT16 type, flags;
- UINT32 size, dataSize;
+ sal_uInt16 type, flags;
+ sal_uInt32 size, dataSize;
sal_uInt32 next;
*pWMF >> type >> flags >> size >> dataSize;
@@ -332,7 +332,7 @@ void EnhWMFReader::ReadGDIComment()
}
}
-BOOL EnhWMFReader::ReadEnhWMF()
+sal_Bool EnhWMFReader::ReadEnhWMF()
{
sal_uInt32 nStretchBltMode = 0;
sal_uInt32 nRecType, nRecSize, nNextPos,
@@ -357,7 +357,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
if ( ( nRecSize < 8 ) || ( nRecSize & 3 ) ) // Parameter sind immer durch 4 teilbar
{
- bStatus = FALSE;
+ bStatus = sal_False;
break;
}
@@ -365,7 +365,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
if ( nNextPos > nEndPos )
{
- bStatus = FALSE;
+ bStatus = sal_False;
break;
}
@@ -384,7 +384,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
EMFP_DEBUG(printf ("\tGDI comment\n\t\tlength: %d\n", length));
if( length >= 4 ) {
- UINT32 id;
+ sal_uInt32 id;
*pWMF >> id;
@@ -430,8 +430,8 @@ BOOL EnhWMFReader::ReadEnhWMF()
{
pWMF->SeekRel( 16 );
*pWMF >> nPoints;
- Polygon aPoly( (UINT16)nPoints );
- for( UINT16 k = 0; k < (UINT16)nPoints; k++ )
+ Polygon aPoly( (sal_uInt16)nPoints );
+ for( sal_uInt16 k = 0; k < (sal_uInt16)nPoints; k++ )
{
*pWMF >> nX32 >> nY32;
aPoly[ k ] = Point( nX32, nY32 );
@@ -446,14 +446,14 @@ BOOL EnhWMFReader::ReadEnhWMF()
{
pWMF->SeekRel( 0x10 );
*pWMF >> nPoints;
- UINT16 i = 0;
+ sal_uInt16 i = 0;
if ( bFlag )
{
i++;
nPoints++;
}
- Polygon aPolygon( (UINT16)nPoints );
- for ( ; i < (UINT16)nPoints; i++ )
+ Polygon aPolygon( (sal_uInt16)nPoints );
+ for ( ; i < (sal_uInt16)nPoints; i++ )
{
*pWMF >> nX32 >> nY32;
aPolygon[ i ] = Point( nX32, nY32 );
@@ -464,25 +464,25 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_POLYPOLYLINE :
{
- UINT16* pnPoints;
+ sal_uInt16* pnPoints;
- INT32 i, nPoly;
+ sal_Int32 i, nPoly;
pWMF->SeekRel( 0x10 );
// Anzahl der Polygone:
*pWMF >> nPoly >> i;
// taking the amount of points of each polygon, retrieving the total number of points
- if ( static_cast< sal_uInt32 >(nPoly) < SAL_MAX_UINT32 / sizeof(UINT16) )
+ if ( static_cast< sal_uInt32 >(nPoly) < SAL_MAX_UINT32 / sizeof(sal_uInt16) )
{
- if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof(UINT16) ) <= ( nEndPos - pWMF->Tell() ) )
+ if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof(sal_uInt16) ) <= ( nEndPos - pWMF->Tell() ) )
{
- pnPoints = new UINT16[ nPoly ];
+ pnPoints = new sal_uInt16[ nPoly ];
for ( i = 0; i < nPoly; i++ )
{
*pWMF >> nPoints;
- pnPoints[ i ] = (UINT16)nPoints;
+ pnPoints[ i ] = (sal_uInt16)nPoints;
}
// Polygonpunkte holen:
@@ -490,7 +490,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
for ( i = 0; ( i < nPoly ) && !pWMF->IsEof(); i++ )
{
Polygon aPoly( pnPoints[ i ] );
- for( UINT16 k = 0; k < pnPoints[ i ]; k++ )
+ for( sal_uInt16 k = 0; k < pnPoints[ i ]; k++ )
{
*pWMF >> nX32 >> nY32;
aPoly[ k ] = Point( nX32, nY32 );
@@ -505,25 +505,25 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_POLYPOLYGON :
{
- UINT16* pnPoints;
+ sal_uInt16* pnPoints;
Point* pPtAry;
- UINT32 i, nPoly, nGesPoints;
+ sal_uInt32 i, nPoly, nGesPoints;
pWMF->SeekRel( 0x10 );
// Anzahl der Polygone:
*pWMF >> nPoly >> nGesPoints;
- if ( ( nGesPoints < SAL_MAX_UINT32 / sizeof(Point) ) && ( nPoly < SAL_MAX_UINT32 / sizeof(UINT16) ) )
+ if ( ( nGesPoints < SAL_MAX_UINT32 / sizeof(Point) ) && ( nPoly < SAL_MAX_UINT32 / sizeof(sal_uInt16) ) )
{
- if ( ( nPoly * sizeof(UINT16) ) <= ( nEndPos - pWMF->Tell() ) )
+ if ( ( nPoly * sizeof(sal_uInt16) ) <= ( nEndPos - pWMF->Tell() ) )
{
- pnPoints = new UINT16[ nPoly ];
+ pnPoints = new sal_uInt16[ nPoly ];
for ( i = 0; i < nPoly; i++ )
{
*pWMF >> nPoints;
- pnPoints[ i ] = (UINT16)nPoints;
+ pnPoints[ i ] = (sal_uInt16)nPoints;
}
if ( ( nGesPoints * (sizeof(sal_uInt32)+sizeof(sal_uInt32)) ) <= ( nEndPos - pWMF->Tell() ) )
@@ -537,7 +537,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
pPtAry[ i ] = Point( nX32, nY32 );
}
// PolyPolygon Actions erzeugen
- PolyPolygon aPolyPoly( (UINT16)nPoly, pnPoints, pPtAry );
+ PolyPolygon aPolyPoly( (sal_uInt16)nPoly, pnPoints, pPtAry );
pOut->DrawPolyPolygon( aPolyPoly, bRecordPath );
delete[] pPtAry;
}
@@ -693,7 +693,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_MODIFYWORLDTRANSFORM :
{
- UINT32 nMode;
+ sal_uInt32 nMode;
XForm aTempXForm;
*pWMF >> aTempXForm >> nMode;
pOut->ModifyWorldTransform( aTempXForm, nMode );
@@ -714,7 +714,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
{
LineInfo aLineInfo;
- UINT32 nStyle;
+ sal_uInt32 nStyle;
Size aSize;
*pWMF >> nStyle >> aSize.Width() >> aSize.Height();
@@ -722,9 +722,9 @@ BOOL EnhWMFReader::ReadEnhWMF()
if ( aSize.Width() )
aLineInfo.SetWidth( aSize.Width() );
- BOOL bTransparent = FALSE;
- UINT16 nDashCount = 0;
- UINT16 nDotCount = 0;
+ sal_Bool bTransparent = sal_False;
+ sal_uInt16 nDashCount = 0;
+ sal_uInt16 nDotCount = 0;
switch( nStyle )
{
case PS_DASHDOTDOT :
@@ -738,7 +738,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
nDashCount++;
break;
case PS_NULL :
- bTransparent = TRUE;
+ bTransparent = sal_True;
aLineInfo.SetStyle( LINE_NONE );
break;
default :
@@ -813,12 +813,12 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_CREATEBRUSHINDIRECT :
{
- UINT32 nStyle;
+ sal_uInt32 nStyle;
*pWMF >> nIndex;
if ( ( nIndex & ENHMETA_STOCK_OBJECT ) == 0 )
{
*pWMF >> nStyle;
- pOut->CreateObject( nIndex, GDI_BRUSH, new WinMtfFillStyle( ReadColor(), ( nStyle == BS_HOLLOW ) ? TRUE : FALSE ) );
+ pOut->CreateObject( nIndex, GDI_BRUSH, new WinMtfFillStyle( ReadColor(), ( nStyle == BS_HOLLOW ) ? sal_True : sal_False ) );
}
}
break;
@@ -855,7 +855,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_ARC :
{
- UINT32 nStartX, nStartY, nEndX, nEndY;
+ sal_uInt32 nStartX, nStartY, nEndX, nEndY;
*pWMF >> nX32 >> nY32 >> nx32 >> ny32 >> nStartX >> nStartY >> nEndX >> nEndY;
pOut->DrawArc( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ) );
}
@@ -863,7 +863,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_CHORD :
{
- UINT32 nStartX, nStartY, nEndX, nEndY;
+ sal_uInt32 nStartX, nStartY, nEndX, nEndY;
*pWMF >> nX32 >> nY32 >> nx32 >> ny32 >> nStartX >> nStartY >> nEndX >> nEndY;
pOut->DrawChord( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ) );
}
@@ -871,7 +871,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_PIE :
{
- UINT32 nStartX, nStartY, nEndX, nEndY;
+ sal_uInt32 nStartX, nStartY, nEndX, nEndY;
*pWMF >> nX32 >> nY32 >> nx32 >> ny32 >> nStartX >> nStartY >> nEndX >> nEndY;
const Rectangle aRect( ReadRectangle( nX32, nY32, nx32, ny32 ));
@@ -893,9 +893,9 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_ARCTO :
{
- UINT32 nStartX, nStartY, nEndX, nEndY;
+ sal_uInt32 nStartX, nStartY, nEndX, nEndY;
*pWMF >> nX32 >> nY32 >> nx32 >> ny32 >> nStartX >> nStartY >> nEndX >> nEndY;
- pOut->DrawArc( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ), TRUE );
+ pOut->DrawArc( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ), sal_True );
}
break;
@@ -952,11 +952,11 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_BITBLT : // PASSTHROUGH INTENDED
case EMR_STRETCHBLT :
{
- INT32 xDest, yDest, cxDest, cyDest, xSrc, ySrc, cxSrc, cySrc;
- UINT32 dwRop, iUsageSrc, offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc;
+ sal_Int32 xDest, yDest, cxDest, cyDest, xSrc, ySrc, cxSrc, cySrc;
+ sal_uInt32 dwRop, iUsageSrc, offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc;
XForm xformSrc;
- UINT32 nStart = pWMF->Tell() - 8;
+ sal_uInt32 nStart = pWMF->Tell() - 8;
pWMF->SeekRel( 0x10 );
*pWMF >> xDest >> yDest >> cxDest >> cyDest >> dwRop >> xSrc >> ySrc
@@ -975,27 +975,27 @@ BOOL EnhWMFReader::ReadEnhWMF()
cyDest = abs( (int)cyDest ); // and also 122889
if ( (cbBitsSrc > (SAL_MAX_UINT32 - 14)) || ((SAL_MAX_UINT32 - 14) - cbBitsSrc < cbBmiSrc) )
- bStatus = FALSE;
+ bStatus = sal_False;
else
{
- UINT32 nSize = cbBmiSrc + cbBitsSrc + 14;
+ sal_uInt32 nSize = cbBmiSrc + cbBitsSrc + 14;
if ( nSize <= ( nEndPos - nStartPos ) )
{
char* pBuf = new char[ nSize ];
SvMemoryStream aTmp( pBuf, nSize, STREAM_READ | STREAM_WRITE );
- aTmp.ObjectOwnsMemory( TRUE );
- aTmp << (BYTE)'B'
- << (BYTE)'M'
- << (UINT32)cbBitsSrc
- << (UINT16)0
- << (UINT16)0
- << (UINT32)cbBmiSrc + 14;
+ aTmp.ObjectOwnsMemory( sal_True );
+ aTmp << (sal_uInt8)'B'
+ << (sal_uInt8)'M'
+ << (sal_uInt32)cbBitsSrc
+ << (sal_uInt16)0
+ << (sal_uInt16)0
+ << (sal_uInt32)cbBmiSrc + 14;
pWMF->Seek( nStart + offBmiSrc );
pWMF->Read( pBuf + 14, cbBmiSrc );
pWMF->Seek( nStart + offBitsSrc );
pWMF->Read( pBuf + 14 + cbBmiSrc, cbBitsSrc );
aTmp.Seek( 0 );
- aBitmap.Read( aTmp, TRUE );
+ aBitmap.Read( aTmp, sal_True );
// test if it is sensible to crop
if ( ( cxSrc > 0 ) && ( cySrc > 0 ) &&
@@ -1017,9 +1017,9 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_STRETCHDIBITS :
{
- INT32 xDest, yDest, xSrc, ySrc, cxSrc, cySrc, cxDest, cyDest;
- UINT32 offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc, iUsageSrc, dwRop;
- UINT32 nStart = pWMF->Tell() - 8;
+ sal_Int32 xDest, yDest, xSrc, ySrc, cxSrc, cySrc, cxDest, cyDest;
+ sal_uInt32 offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc, iUsageSrc, dwRop;
+ sal_uInt32 nStart = pWMF->Tell() - 8;
pWMF->SeekRel( 0x10 );
*pWMF >> xDest >> yDest >> xSrc >> ySrc >> cxSrc >> cySrc >> offBmiSrc >> cbBmiSrc >> offBitsSrc
@@ -1032,27 +1032,27 @@ BOOL EnhWMFReader::ReadEnhWMF()
cyDest = abs( (int)cyDest ); // and also 122889
if ( (cbBitsSrc > (SAL_MAX_UINT32 - 14)) || ((SAL_MAX_UINT32 - 14) - cbBitsSrc < cbBmiSrc) )
- bStatus = FALSE;
+ bStatus = sal_False;
else
{
- UINT32 nSize = cbBmiSrc + cbBitsSrc + 14;
+ sal_uInt32 nSize = cbBmiSrc + cbBitsSrc + 14;
if ( nSize <= ( nEndPos - nStartPos ) )
{
char* pBuf = new char[ nSize ];
SvMemoryStream aTmp( pBuf, nSize, STREAM_READ | STREAM_WRITE );
- aTmp.ObjectOwnsMemory( TRUE );
- aTmp << (BYTE)'B'
- << (BYTE)'M'
- << (UINT32)cbBitsSrc
- << (UINT16)0
- << (UINT16)0
- << (UINT32)cbBmiSrc + 14;
+ aTmp.ObjectOwnsMemory( sal_True );
+ aTmp << (sal_uInt8)'B'
+ << (sal_uInt8)'M'
+ << (sal_uInt32)cbBitsSrc
+ << (sal_uInt16)0
+ << (sal_uInt16)0
+ << (sal_uInt32)cbBmiSrc + 14;
pWMF->Seek( nStart + offBmiSrc );
pWMF->Read( pBuf + 14, cbBmiSrc );
pWMF->Seek( nStart + offBitsSrc );
pWMF->Read( pBuf + 14 + cbBmiSrc, cbBitsSrc );
aTmp.Seek( 0 );
- aBitmap.Read( aTmp, TRUE );
+ aBitmap.Read( aTmp, sal_True );
// test if it is sensible to crop
if ( ( cxSrc > 0 ) && ( cySrc > 0 ) &&
@@ -1084,7 +1084,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
for ( int i = 0; i < LF_FACESIZE; i++ )
{
- UINT16 nChar;
+ sal_uInt16 nChar;
*pWMF >> nChar;
lfFaceName[ i ] = nChar;
}
@@ -1188,14 +1188,14 @@ BOOL EnhWMFReader::ReadEnhWMF()
{
pWMF->SeekRel( 16 );
*pWMF >> nPoints;
- UINT16 i = 0;
+ sal_uInt16 i = 0;
if ( bFlag )
{
i++;
nPoints++;
}
- Polygon aPoly( (UINT16)nPoints );
- for( ; i < (UINT16)nPoints; i++ )
+ Polygon aPoly( (sal_uInt16)nPoints );
+ for( ; i < (sal_uInt16)nPoints; i++ )
{
*pWMF >> nX16 >> nY16;
aPoly[ i ] = Point( nX16, nY16 );
@@ -1208,8 +1208,8 @@ BOOL EnhWMFReader::ReadEnhWMF()
{
pWMF->SeekRel( 16 );
*pWMF >> nPoints;
- Polygon aPoly( (UINT16)nPoints );
- for( UINT16 k = 0; k < (UINT16)nPoints; k++ )
+ Polygon aPoly( (sal_uInt16)nPoints );
+ for( sal_uInt16 k = 0; k < (sal_uInt16)nPoints; k++ )
{
*pWMF >> nX16 >> nY16;
aPoly[ k ] = Point( nX16, nY16 );
@@ -1224,15 +1224,15 @@ BOOL EnhWMFReader::ReadEnhWMF()
{
pWMF->SeekRel( 16 );
*pWMF >> nPoints;
- UINT16 i = 0;
+ sal_uInt16 i = 0;
if ( bFlag )
{
i++;
nPoints++;
}
- Polygon aPoly( (UINT16)nPoints );
- for( ; i < (UINT16)nPoints; i++ )
+ Polygon aPoly( (sal_uInt16)nPoints );
+ for( ; i < (sal_uInt16)nPoints; i++ )
{
*pWMF >> nX16 >> nY16;
aPoly[ i ] = Point( nX16, nY16 );
@@ -1243,29 +1243,29 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_POLYPOLYLINE16 :
{
- UINT16* pnPoints;
+ sal_uInt16* pnPoints;
- INT32 i, nPoly, nGesPoints;
+ sal_Int32 i, nPoly, nGesPoints;
pWMF->SeekRel( 0x10 );
// Anzahl der Polygone:
*pWMF >> nPoly >> nGesPoints;
// taking the amount of points of each polygon, retrieving the total number of points
- if ( static_cast< sal_uInt32 >(nPoly) < SAL_MAX_UINT32 / sizeof(UINT16) )
+ if ( static_cast< sal_uInt32 >(nPoly) < SAL_MAX_UINT32 / sizeof(sal_uInt16) )
{
- if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof(UINT16) ) <= ( nEndPos - pWMF->Tell() ) )
+ if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof(sal_uInt16) ) <= ( nEndPos - pWMF->Tell() ) )
{
- pnPoints = new UINT16[ nPoly ];
+ pnPoints = new sal_uInt16[ nPoly ];
for ( i = 0; i < nPoly; i++ )
{
*pWMF >> nPoints;
- pnPoints[ i ] = (UINT16)nPoints;
+ pnPoints[ i ] = (sal_uInt16)nPoints;
}
// Polygonpunkte holen:
for ( i = 0; ( i < nPoly ) && !pWMF->IsEof(); i++ )
{
Polygon aPolygon( pnPoints[ i ] );
- for ( UINT16 k = 0; k < pnPoints[ i ]; k++ )
+ for ( sal_uInt16 k = 0; k < pnPoints[ i ]; k++ )
{
*pWMF >> nX16 >> nY16;
aPolygon[ k ] = Point( nX16, nY16 );
@@ -1280,22 +1280,22 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_POLYPOLYGON16 :
{
- UINT16* pnPoints;
+ sal_uInt16* pnPoints;
Point* pPtAry;
- UINT32 i, nPoly, nGesPoints;
+ sal_uInt32 i, nPoly, nGesPoints;
pWMF->SeekRel( 0x10 );
// Anzahl der Polygone:
*pWMF >> nPoly >> nGesPoints;
- if ( ( nGesPoints < SAL_MAX_UINT32 / sizeof(Point) ) && ( nPoly < SAL_MAX_UINT32 / sizeof(UINT16) ) )
+ if ( ( nGesPoints < SAL_MAX_UINT32 / sizeof(Point) ) && ( nPoly < SAL_MAX_UINT32 / sizeof(sal_uInt16) ) )
{
- if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof( UINT16 ) ) <= ( nEndPos - pWMF->Tell() ) )
+ if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof( sal_uInt16 ) ) <= ( nEndPos - pWMF->Tell() ) )
{
- pnPoints = new UINT16[ nPoly ];
+ pnPoints = new sal_uInt16[ nPoly ];
for ( i = 0; i < nPoly; i++ )
{
*pWMF >> nPoints;
- pnPoints[ i ] = (UINT16)nPoints;
+ pnPoints[ i ] = (sal_uInt16)nPoints;
}
if ( ( nGesPoints * (sizeof(sal_uInt16)+sizeof(sal_uInt16)) ) <= ( nEndPos - pWMF->Tell() ) )
{
@@ -1308,7 +1308,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
}
// PolyPolygon Actions erzeugen
- PolyPolygon aPolyPoly( (UINT16)nPoly, pnPoints, pPtAry );
+ PolyPolygon aPolyPoly( (sal_uInt16)nPoly, pnPoints, pPtAry );
pOut->DrawPolyPolygon( aPolyPoly, bRecordPath );
delete[] pPtAry;
}
@@ -1337,14 +1337,14 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_CREATEDIBPATTERNBRUSHPT :
{
- UINT32 nStart = pWMF->Tell() - 8;
+ sal_uInt32 nStart = pWMF->Tell() - 8;
Bitmap aBitmap;
*pWMF >> nIndex;
if ( ( nIndex & ENHMETA_STOCK_OBJECT ) == 0 )
{
- UINT32 usage, offBmi, cbBmi, offBits, cbBits;
+ sal_uInt32 usage, offBmi, cbBmi, offBits, cbBits;
*pWMF >> usage;
*pWMF >> offBmi;
@@ -1353,28 +1353,28 @@ BOOL EnhWMFReader::ReadEnhWMF()
*pWMF >> cbBits;
if ( (cbBits > (SAL_MAX_UINT32 - 14)) || ((SAL_MAX_UINT32 - 14) - cbBits < cbBmi) )
- bStatus = FALSE;
+ bStatus = sal_False;
else if ( offBmi )
{
- UINT32 nSize = cbBmi + cbBits + 14;
+ sal_uInt32 nSize = cbBmi + cbBits + 14;
if ( nSize <= ( nEndPos - nStartPos ) )
{
char* pBuf = new char[ nSize ];
SvMemoryStream aTmp( pBuf, nSize, STREAM_READ | STREAM_WRITE );
- aTmp.ObjectOwnsMemory( TRUE );
- aTmp << (BYTE)'B'
- << (BYTE)'M'
- << (UINT32)cbBits
- << (UINT16)0
- << (UINT16)0
- << (UINT32)cbBmi + 14;
+ aTmp.ObjectOwnsMemory( sal_True );
+ aTmp << (sal_uInt8)'B'
+ << (sal_uInt8)'M'
+ << (sal_uInt32)cbBits
+ << (sal_uInt16)0
+ << (sal_uInt16)0
+ << (sal_uInt32)cbBmi + 14;
pWMF->Seek( nStart + offBmi );
pWMF->Read( pBuf + 14, cbBmi );
pWMF->Seek( nStart + offBits );
pWMF->Read( pBuf + 14 + cbBmi, cbBits );
aTmp.Seek( 0 );
- aBitmap.Read( aTmp, TRUE );
+ aBitmap.Read( aTmp, sal_True );
}
}
}
@@ -1455,16 +1455,16 @@ BOOL EnhWMFReader::ReadEnhWMF()
//-----------------------------------------------------------------------------------
-BOOL EnhWMFReader::ReadHeader()
+sal_Bool EnhWMFReader::ReadHeader()
{
- UINT32 nUINT32, nHeaderSize, nPalEntries;
- INT32 nLeft, nTop, nRight, nBottom;
+ sal_uInt32 nsal_uInt32, nHeaderSize, nPalEntries;
+ sal_Int32 nLeft, nTop, nRight, nBottom;
// METAFILEHEADER SPARE ICH MIR HIER
// Einlesen des METAHEADER
- *pWMF >> nUINT32 >> nHeaderSize;
- if ( nUINT32 != 1 ) // Typ
- return FALSE;
+ *pWMF >> nsal_uInt32 >> nHeaderSize;
+ if ( nsal_uInt32 != 1 ) // Typ
+ return sal_False;
// bound size
Rectangle rclBounds; // rectangle in logical units 1/100th mm
@@ -1482,12 +1482,12 @@ BOOL EnhWMFReader::ReadHeader()
rclFrame.Right() = nRight;
rclFrame.Bottom() = nBottom;
- *pWMF >> nUINT32; // signature
+ *pWMF >> nsal_uInt32; // signature
- if ( nUINT32 != 0x464d4520 )
- return FALSE;
+ if ( nsal_uInt32 != 0x464d4520 )
+ return sal_False;
- *pWMF >> nUINT32; // nVersion
+ *pWMF >> nsal_uInt32; // nVersion
*pWMF >> nEndPos; // size of metafile
nEndPos += nStartPos;
@@ -1500,7 +1500,7 @@ BOOL EnhWMFReader::ReadHeader()
*pWMF >> nRecordCount;
if ( !nRecordCount )
- return FALSE;
+ return sal_False;
pWMF->SeekRel( 0xc );
@@ -1513,12 +1513,12 @@ BOOL EnhWMFReader::ReadHeader()
pOut->SetRefMill( Size( nMillX, nMillY ) );
pWMF->Seek( nStartPos + nHeaderSize );
- return TRUE;
+ return sal_True;
}
//-----------------------------------------------------------------------------------
-Rectangle EnhWMFReader::ReadRectangle( INT32 x1, INT32 y1, INT32 x2, INT32 y2 )
+Rectangle EnhWMFReader::ReadRectangle( sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, sal_Int32 y2 )
{
Point aTL ( Point( x1, y1 ) );
Point aBR( Point( --x2, --y2 ) );
diff --git a/svtools/source/filter.vcl/wmf/makefile.mk b/svtools/source/filter.vcl/wmf/makefile.mk
deleted file mode 100644
index 5c9412bc8387..000000000000
--- a/svtools/source/filter.vcl/wmf/makefile.mk
+++ /dev/null
@@ -1,50 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-
-PRJNAME=svtools
-TARGET=wmf
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= $(SLO)$/wmf.obj \
- $(SLO)$/winmtf.obj \
- $(SLO)$/winwmf.obj \
- $(SLO)$/enhwmf.obj \
- $(SLO)$/emfwr.obj \
- $(SLO)$/wmfwr.obj
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svtools/source/filter.vcl/wmf/winmtf.cxx b/svtools/source/filter.vcl/wmf/winmtf.cxx
index 4e52fb4d548c..b0625567d5d6 100644
--- a/svtools/source/filter.vcl/wmf/winmtf.cxx
+++ b/svtools/source/filter.vcl/wmf/winmtf.cxx
@@ -316,7 +316,7 @@ WinMtf::WinMtf( WinMtfOutput* pWinMtfOutput, SvStream& rStreamWMF, FilterConfigI
SvLockBytes *pLB = pWMF->GetLockBytes();
if ( pLB )
- pLB->SetSynchronMode( TRUE );
+ pLB->SetSynchronMode( sal_True );
nStartPos = pWMF->Tell();
@@ -344,7 +344,7 @@ WinMtf::~WinMtf()
// ------------------------------------------------------------------------
-void WinMtf::Callback( USHORT nPercent )
+void WinMtf::Callback( sal_uInt16 nPercent )
{
if ( xStatusIndicator.is() )
xStatusIndicator->setValue( nPercent );
@@ -354,9 +354,9 @@ void WinMtf::Callback( USHORT nPercent )
Color WinMtf::ReadColor()
{
- UINT32 nColor;
+ sal_uInt32 nColor;
*pWMF >> nColor;
- return Color( (BYTE)nColor, (BYTE)( nColor >> 8 ), (BYTE)( nColor >> 16 ) );
+ return Color( (sal_uInt8)nColor, (sal_uInt8)( nColor >> 8 ), (sal_uInt8)( nColor >> 16 ) );
};
//-----------------------------------------------------------------------------------
@@ -522,8 +522,8 @@ void WinMtfOutput::ImplMap( Font& rFont )
Polygon& WinMtfOutput::ImplMap( Polygon& rPolygon )
{
- UINT16 nPoints = rPolygon.GetSize();
- for ( UINT16 i = 0; i < nPoints; i++ )
+ sal_uInt16 nPoints = rPolygon.GetSize();
+ for ( sal_uInt16 i = 0; i < nPoints; i++ )
{
rPolygon[ i ] = ImplMap( rPolygon[ i ] );
}
@@ -534,14 +534,14 @@ Polygon& WinMtfOutput::ImplMap( Polygon& rPolygon )
PolyPolygon& WinMtfOutput::ImplMap( PolyPolygon& rPolyPolygon )
{
- UINT16 nPolys = rPolyPolygon.Count();
- for ( UINT16 i = 0; i < nPolys; ImplMap( rPolyPolygon[ i++ ] ) ) ;
+ sal_uInt16 nPolys = rPolyPolygon.Count();
+ for ( sal_uInt16 i = 0; i < nPolys; ImplMap( rPolyPolygon[ i++ ] ) ) ;
return rPolyPolygon;
}
//-----------------------------------------------------------------------------------
-void WinMtfOutput::SelectObject( INT32 nIndex )
+void WinMtfOutput::SelectObject( sal_Int32 nIndex )
{
GDIObj* pGDIObj = NULL;
@@ -551,7 +551,7 @@ void WinMtfOutput::SelectObject( INT32 nIndex )
{
nIndex &= 0xffff; // zur Sicherheit: mehr als 65535 nicht zulassen
- if ( (UINT32)nIndex < vGDIObj.size() )
+ if ( (sal_uInt32)nIndex < vGDIObj.size() )
pGDIObj = vGDIObj[ nIndex ];
}
@@ -560,7 +560,7 @@ void WinMtfOutput::SelectObject( INT32 nIndex )
if ( nIndex & ENHMETA_STOCK_OBJECT )
{
- UINT16 nStockId = (BYTE)nIndex;
+ sal_uInt16 nStockId = (sal_uInt8)nIndex;
switch( nStockId )
{
case WHITE_BRUSH :
@@ -586,7 +586,7 @@ void WinMtfOutput::SelectObject( INT32 nIndex )
break;
case NULL_BRUSH :
{
- pGDIObj->Set( GDI_BRUSH, new WinMtfFillStyle( Color( COL_TRANSPARENT ), TRUE ) );
+ pGDIObj->Set( GDI_BRUSH, new WinMtfFillStyle( Color( COL_TRANSPARENT ), sal_True ) );
}
break;
case WHITE_PEN :
@@ -601,7 +601,7 @@ void WinMtfOutput::SelectObject( INT32 nIndex )
break;
case NULL_PEN :
{
- pGDIObj->Set( GDI_PEN, new WinMtfLineStyle( Color( COL_TRANSPARENT ), TRUE ) );
+ pGDIObj->Set( GDI_PEN, new WinMtfLineStyle( Color( COL_TRANSPARENT ), sal_True ) );
}
break;
default:
@@ -662,7 +662,7 @@ sal_uInt32 WinMtfOutput::GetTextLayoutMode() const
//-----------------------------------------------------------------------------------
-void WinMtfOutput::SetBkMode( UINT32 nMode )
+void WinMtfOutput::SetBkMode( sal_uInt32 nMode )
{
mnBkMode = nMode;
}
@@ -683,14 +683,14 @@ void WinMtfOutput::SetTextColor( const Color& rColor )
//-----------------------------------------------------------------------------------
-void WinMtfOutput::SetTextAlign( UINT32 nAlign )
+void WinMtfOutput::SetTextAlign( sal_uInt32 nAlign )
{
mnTextAlign = nAlign;
}
//-----------------------------------------------------------------------------------
-void WinMtfOutput::ImplResizeObjectArry( UINT32 nNewEntrys )
+void WinMtfOutput::ImplResizeObjectArry( sal_uInt32 nNewEntrys )
{
sal_uInt32 i = vGDIObj.size();
vGDIObj.resize( nNewEntrys );
@@ -756,7 +756,7 @@ void WinMtfOutput::CreateObject( GDIObjectType eType, void* pStyle )
}
}
}
- UINT32 nIndex;
+ sal_uInt32 nIndex;
for ( nIndex = 0; nIndex < vGDIObj.size(); nIndex++ )
{
if ( vGDIObj[ nIndex ] == NULL )
@@ -770,7 +770,7 @@ void WinMtfOutput::CreateObject( GDIObjectType eType, void* pStyle )
//-----------------------------------------------------------------------------------
-void WinMtfOutput::CreateObject( INT32 nIndex, GDIObjectType eType, void* pStyle )
+void WinMtfOutput::CreateObject( sal_Int32 nIndex, GDIObjectType eType, void* pStyle )
{
if ( ( nIndex & ENHMETA_STOCK_OBJECT ) == 0 )
{
@@ -793,7 +793,7 @@ void WinMtfOutput::CreateObject( INT32 nIndex, GDIObjectType eType, void* pStyle
}
}
}
- if ( (UINT32)nIndex >= vGDIObj.size() )
+ if ( (sal_uInt32)nIndex >= vGDIObj.size() )
ImplResizeObjectArry( nIndex + 16 );
if ( vGDIObj[ nIndex ] != NULL )
@@ -935,7 +935,7 @@ WinMtfOutput::~WinMtfOutput()
else
mpGDIMetaFile->SetPrefSize( mrclFrame.GetSize() );
- for ( UINT32 i = 0; i < vGDIObj.size(); i++ )
+ for ( sal_uInt32 i = 0; i < vGDIObj.size(); i++ )
delete vGDIObj[ i ];
};
@@ -971,7 +971,7 @@ void WinMtfOutput::UpdateClipRegion()
void WinMtfOutput::ImplSetNonPersistentLineColorTransparenz()
{
Color aColor( COL_TRANSPARENT);
- WinMtfLineStyle aTransparentLine( aColor, TRUE );
+ WinMtfLineStyle aTransparentLine( aColor, sal_True );
if ( ! ( maLatestLineStyle == aTransparentLine ) )
{
maLatestLineStyle = aTransparentLine;
@@ -1006,7 +1006,7 @@ void WinMtfOutput::UpdateFillStyle()
//-----------------------------------------------------------------------------------
-sal_uInt32 WinMtfOutput::SetRasterOp( UINT32 nRasterOp )
+sal_uInt32 WinMtfOutput::SetRasterOp( sal_uInt32 nRasterOp )
{
sal_uInt32 nRetROP = mnRop;
if ( nRasterOp != mnRop )
@@ -1039,8 +1039,8 @@ sal_uInt32 WinMtfOutput::SetRasterOp( UINT32 nRasterOp )
{
aNopFillStyle = maFillStyle;
aNopLineStyle = maLineStyle;
- maFillStyle = WinMtfFillStyle( Color( COL_TRANSPARENT ), TRUE );
- maLineStyle = WinMtfLineStyle( Color( COL_TRANSPARENT ), TRUE );
+ maFillStyle = WinMtfFillStyle( Color( COL_TRANSPARENT ), sal_True );
+ maLineStyle = WinMtfLineStyle( Color( COL_TRANSPARENT ), sal_True );
mbNopMode = sal_True;
}
}
@@ -1070,7 +1070,7 @@ void WinMtfOutput::StrokeAndFillPath( sal_Bool bStroke, sal_Bool bFill )
if ( !bStroke )
{
mpGDIMetaFile->AddAction( new MetaPushAction( PUSH_LINECOLOR ) );
- mpGDIMetaFile->AddAction( new MetaLineColorAction( Color(), FALSE ) );
+ mpGDIMetaFile->AddAction( new MetaLineColorAction( Color(), sal_False ) );
}
if ( aPathObj.Count() == 1 )
mpGDIMetaFile->AddAction( new MetaPolygonAction( aPathObj.GetObject( 0 ) ) );
@@ -1135,7 +1135,7 @@ void WinMtfOutput::DrawLine( const Point& rSource, const Point& rDest )
//-----------------------------------------------------------------------------------
-void WinMtfOutput::DrawRect( const Rectangle& rRect, BOOL bEdge )
+void WinMtfOutput::DrawRect( const Rectangle& rRect, sal_Bool bEdge )
{
UpdateClipRegion();
UpdateFillStyle();
@@ -1209,7 +1209,7 @@ void WinMtfOutput::DrawEllipse( const Rectangle& rRect )
//-----------------------------------------------------------------------------------
-void WinMtfOutput::DrawArc( const Rectangle& rRect, const Point& rStart, const Point& rEnd, BOOL bTo )
+void WinMtfOutput::DrawArc( const Rectangle& rRect, const Point& rStart, const Point& rEnd, sal_Bool bTo )
{
UpdateClipRegion();
UpdateLineStyle();
@@ -1311,7 +1311,7 @@ void WinMtfOutput::DrawPolygon( Polygon& rPolygon, sal_Bool bRecordPath )
{
if ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LINE_DASH ) )
{
- USHORT nCount = rPolygon.GetSize();
+ sal_uInt16 nCount = rPolygon.GetSize();
if ( nCount )
{
if ( rPolygon[ nCount - 1 ] != rPolygon[ 0 ] )
@@ -1352,7 +1352,7 @@ void WinMtfOutput::DrawPolygon( Polygon& rPolygon, sal_Bool bRecordPath )
aMemStm << aFill;
mpGDIMetaFile->AddAction( new MetaCommentAction( "XPATHFILL_SEQ_BEGIN", 0,
- static_cast<const BYTE*>(aMemStm.GetData()),
+ static_cast<const sal_uInt8*>(aMemStm.GetData()),
aMemStm.Seek( STREAM_SEEK_TO_END ) ) );
mpGDIMetaFile->AddAction( new MetaCommentAction( "XPATHFILL_SEQ_END" ) );
}
@@ -1554,7 +1554,7 @@ void WinMtfOutput::DrawText( Point& rPosition, String& rText, sal_Int32* pDXArry
pVDev->SetFont( maFont );
if( pDXArry )
{
- UINT32 nLen = rText.Len();
+ sal_uInt32 nLen = rText.Len();
nTextWidth = pVDev->GetTextWidth( rText.GetChar( (sal_uInt16)( nLen - 1 ) ) );
if( nLen > 1 )
nTextWidth += pDXArry[ nLen - 2 ];
@@ -1634,7 +1634,7 @@ void WinMtfOutput::ImplDrawBitmap( const Point& rPos, const Size& rSize, const B
const Point aEmptyPoint;
// #i50672# Extract whole VDev content (to match size of rBitmap)
- aVDev.EnableMapMode( FALSE );
+ aVDev.EnableMapMode( sal_False );
Bitmap aMask( aVDev.GetBitmap( aEmptyPoint, aSizePixel ).CreateMask( Color( COL_WHITE ) ) );
if ( aBmpEx.IsTransparent() )
@@ -1703,7 +1703,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList )
{ // patterns aren't well supported yet
sal_uInt32 nOldRop = SetRasterOp( ROP_OVERPAINT ); // in this case nRasterOperation is either 0 or 0xff
UpdateFillStyle();
- DrawRect( aRect, FALSE );
+ DrawRect( aRect, sal_False );
SetRasterOp( nOldRop );
}
else
@@ -1768,7 +1768,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList )
if ( nOperation == 0x1 )
{
SetRasterOp( R2_NOT );
- DrawRect( aRect, FALSE );
+ DrawRect( aRect, sal_False );
}
}
break;
@@ -1786,7 +1786,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList )
if ( nOperation == 0x7 )
{
SetRasterOp( R2_NOT );
- DrawRect( aRect, FALSE );
+ DrawRect( aRect, sal_False );
}
}
break;
@@ -1795,7 +1795,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList )
case 0xb :
{
SetRasterOp( R2_NOT );
- DrawRect( aRect, FALSE );
+ DrawRect( aRect, sal_False );
SetRasterOp( R2_COPYPEN );
Bitmap aMask( aBitmap );
aBitmap.Invert();
@@ -1806,7 +1806,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList )
if ( nOperation == 0xb )
{
SetRasterOp( R2_NOT );
- DrawRect( aRect, FALSE );
+ DrawRect( aRect, sal_False );
}
}
break;
@@ -1823,7 +1823,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList )
if ( nOperation == 0xd )
{
SetRasterOp( R2_NOT );
- DrawRect( aRect, FALSE );
+ DrawRect( aRect, sal_False );
}
}
break;
@@ -1835,7 +1835,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList )
if ( nOperation == 0x9 )
{
SetRasterOp( R2_NOT );
- DrawRect( aRect, FALSE );
+ DrawRect( aRect, sal_False );
}
}
break;
@@ -1845,7 +1845,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList )
{ // in this case nRasterOperation is either 0 or 0xff
maFillStyle = WinMtfFillStyle( Color( nRasterOperation, nRasterOperation, nRasterOperation ) );
UpdateFillStyle();
- DrawRect( aRect, FALSE );
+ DrawRect( aRect, sal_False );
}
break;
@@ -1861,7 +1861,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList )
case 0x5 : // only destination is used
{
SetRasterOp( R2_NOT );
- DrawRect( aRect, FALSE );
+ DrawRect( aRect, sal_False );
}
case 0xa : // no operation
break;
@@ -1890,7 +1890,7 @@ void WinMtfOutput::SetDevOrg( const Point& rPoint )
//-----------------------------------------------------------------------------------
-void WinMtfOutput::SetDevOrgOffset( INT32 nXAdd, INT32 nYAdd )
+void WinMtfOutput::SetDevOrgOffset( sal_Int32 nXAdd, sal_Int32 nYAdd )
{
mnDevOrgX += nXAdd;
mnDevOrgY += nYAdd;
@@ -1932,7 +1932,7 @@ void WinMtfOutput::SetWinOrg( const Point& rPoint )
//-----------------------------------------------------------------------------------
-void WinMtfOutput::SetWinOrgOffset( INT32 nXAdd, INT32 nYAdd )
+void WinMtfOutput::SetWinOrgOffset( sal_Int32 nXAdd, sal_Int32 nYAdd )
{
mnWinOrgX += nXAdd;
mnWinOrgY += nYAdd;
@@ -2026,7 +2026,7 @@ void WinMtfOutput::SetWorldTransform( const XForm& rXForm )
//-----------------------------------------------------------------------------------
-void WinMtfOutput::ModifyWorldTransform( const XForm& rXForm, UINT32 nMode )
+void WinMtfOutput::ModifyWorldTransform( const XForm& rXForm, sal_uInt32 nMode )
{
switch( nMode )
{
@@ -2216,14 +2216,14 @@ void WinMtfOutput::PassEMFPlusHeaderInfo()
// rotate and scale operations
mem << one << zero << zero << one << zero << zero;
- mpGDIMetaFile->AddAction( new MetaCommentAction( "EMF_PLUS_HEADER_INFO", 0, (const BYTE*) mem.GetData(), mem.GetEndOfData() ) );
- mpGDIMetaFile->UseCanvas( TRUE );
+ mpGDIMetaFile->AddAction( new MetaCommentAction( "EMF_PLUS_HEADER_INFO", 0, (const sal_uInt8*) mem.GetData(), mem.GetEndOfData() ) );
+ mpGDIMetaFile->UseCanvas( sal_True );
}
-void WinMtfOutput::PassEMFPlus( void* pBuffer, UINT32 nLength )
+void WinMtfOutput::PassEMFPlus( void* pBuffer, sal_uInt32 nLength )
{
EMFP_DEBUG(printf ("\t\t\tadd EMF_PLUS comment length %d\n", nLength));
- mpGDIMetaFile->AddAction( new MetaCommentAction( "EMF_PLUS", 0, static_cast<const BYTE*>(pBuffer), nLength ) );
+ mpGDIMetaFile->AddAction( new MetaCommentAction( "EMF_PLUS", 0, static_cast<const sal_uInt8*>(pBuffer), nLength ) );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter.vcl/wmf/winmtf.hxx b/svtools/source/filter.vcl/wmf/winmtf.hxx
index a068ad3eb3da..bd2293fe108b 100644
--- a/svtools/source/filter.vcl/wmf/winmtf.hxx
+++ b/svtools/source/filter.vcl/wmf/winmtf.hxx
@@ -142,19 +142,19 @@
struct LOGFONTW
{
- INT32 lfHeight;
- INT32 lfWidth;
- INT32 lfEscapement;
- INT32 lfOrientation;
- INT32 lfWeight;
- BYTE lfItalic;
- BYTE lfUnderline;
- BYTE lfStrikeOut;
- BYTE lfCharSet;
- BYTE lfOutPrecision;
- BYTE lfClipPrecision;
- BYTE lfQuality;
- BYTE lfPitchAndFamily;
+ sal_Int32 lfHeight;
+ sal_Int32 lfWidth;
+ sal_Int32 lfEscapement;
+ sal_Int32 lfOrientation;
+ sal_Int32 lfWeight;
+ sal_uInt8 lfItalic;
+ sal_uInt8 lfUnderline;
+ sal_uInt8 lfStrikeOut;
+ sal_uInt8 lfCharSet;
+ sal_uInt8 lfOutPrecision;
+ sal_uInt8 lfClipPrecision;
+ sal_uInt8 lfQuality;
+ sal_uInt8 lfPitchAndFamily;
String alfFaceName;
};
@@ -361,18 +361,18 @@ typedef enum {
struct WinMtfFillStyle
{
Color aFillColor;
- BOOL bTransparent;
+ sal_Bool bTransparent;
WinMtfFillStyleType aType;
Bitmap aBmp;
WinMtfFillStyle()
: aFillColor(Color(COL_BLACK))
- , bTransparent(FALSE)
+ , bTransparent(sal_False)
, aType(FillStyleSolid)
{
}
- WinMtfFillStyle( const Color& rColor, BOOL bTrans = FALSE )
+ WinMtfFillStyle( const Color& rColor, sal_Bool bTrans = sal_False )
: aFillColor(rColor)
, bTransparent(bTrans)
, aType(FillStyleSolid)
@@ -385,9 +385,9 @@ struct WinMtfFillStyle
{
}
- BOOL operator==( const WinMtfFillStyle& rStyle )
+ sal_Bool operator==( const WinMtfFillStyle& rStyle )
{ return ( ( aFillColor == rStyle.aFillColor ) && ( bTransparent == rStyle.bTransparent ) && ( aType == rStyle.aType ) ); }
- BOOL operator==( WinMtfFillStyle* pStyle )
+ sal_Bool operator==( WinMtfFillStyle* pStyle )
{ return ( ( aFillColor == pStyle->aFillColor ) && ( bTransparent == pStyle->bTransparent ) && ( aType == pStyle->aType ) ); }
WinMtfFillStyle& operator=( const WinMtfFillStyle& rStyle ) { aFillColor = rStyle.aFillColor; bTransparent = rStyle.bTransparent; aBmp = rStyle.aBmp; aType = rStyle.aType; return *this; }
WinMtfFillStyle& operator=( WinMtfFillStyle* pStyle ) { aFillColor = pStyle->aFillColor; bTransparent = pStyle->bTransparent; aBmp = pStyle->aBmp; aType = pStyle->aType; return *this; }
@@ -399,23 +399,23 @@ struct WinMtfLineStyle
{
Color aLineColor;
LineInfo aLineInfo;
- BOOL bTransparent;
+ sal_Bool bTransparent;
WinMtfLineStyle() :
aLineColor ( COL_BLACK ),
- bTransparent( FALSE ) {}
+ bTransparent( sal_False ) {}
- WinMtfLineStyle( const Color& rColor, BOOL bTrans = FALSE ) :
+ WinMtfLineStyle( const Color& rColor, sal_Bool bTrans = sal_False ) :
aLineColor ( rColor ),
bTransparent( bTrans ) {}
- WinMtfLineStyle( const Color& rColor, const LineInfo rStyle, BOOL bTrans = FALSE ) :
+ WinMtfLineStyle( const Color& rColor, const LineInfo rStyle, sal_Bool bTrans = sal_False ) :
aLineColor ( rColor ),
aLineInfo ( rStyle ),
bTransparent( bTrans ) {}
- BOOL operator==( const WinMtfLineStyle& rStyle ) { return ( ( aLineColor == rStyle.aLineColor ) && ( bTransparent == rStyle.bTransparent ) && ( aLineInfo == rStyle.aLineInfo ) ); }
- BOOL operator==( WinMtfLineStyle* pStyle ) { return ( ( aLineColor == pStyle->aLineColor ) && ( bTransparent == pStyle->bTransparent ) && ( aLineInfo == pStyle->aLineInfo ) ); }
+ sal_Bool operator==( const WinMtfLineStyle& rStyle ) { return ( ( aLineColor == rStyle.aLineColor ) && ( bTransparent == rStyle.bTransparent ) && ( aLineInfo == rStyle.aLineInfo ) ); }
+ sal_Bool operator==( WinMtfLineStyle* pStyle ) { return ( ( aLineColor == pStyle->aLineColor ) && ( bTransparent == pStyle->bTransparent ) && ( aLineInfo == pStyle->aLineInfo ) ); }
WinMtfLineStyle& operator=( const WinMtfLineStyle& rStyle )
{
aLineColor = rStyle.aLineColor;
@@ -486,10 +486,10 @@ struct BSaveStruct
{
Bitmap aBmp;
Rectangle aOutRect;
- UINT32 nWinRop;
+ sal_uInt32 nWinRop;
WinMtfFillStyle aStyle;
- BSaveStruct( const Bitmap& rBmp, const Rectangle& rOutRect, UINT32 nRop, WinMtfFillStyle& rStyle ) :
+ BSaveStruct( const Bitmap& rBmp, const Rectangle& rOutRect, sal_uInt32 nRop, WinMtfFillStyle& rStyle ) :
aBmp( rBmp ), aOutRect( rOutRect ), nWinRop( nRop ), aStyle ( rStyle ){}
};
@@ -603,7 +603,7 @@ class WinMtfOutput
void ImplMap( Font& rFont );
Polygon& ImplMap( Polygon& rPolygon );
PolyPolygon& ImplMap( PolyPolygon& rPolyPolygon );
- void ImplResizeObjectArry( UINT32 nNewEntry );
+ void ImplResizeObjectArry( sal_uInt32 nNewEntry );
void ImplSetNonPersistentLineColorTransparenz();
void ImplDrawClippedPolyPolygon( const PolyPolygon& rPolyPoly );
void ImplDrawBitmap( const Point& rPos, const Size& rSize, const BitmapEx rBitmap );
@@ -611,12 +611,12 @@ class WinMtfOutput
public:
void SetDevOrg( const Point& rPoint );
- void SetDevOrgOffset( INT32 nXAdd, INT32 nYAdd );
+ void SetDevOrgOffset( sal_Int32 nXAdd, sal_Int32 nYAdd );
void SetDevExt( const Size& rSize );
void ScaleDevExt( double fX, double fY );
void SetWinOrg( const Point& rPoint );
- void SetWinOrgOffset( INT32 nX, INT32 nY );
+ void SetWinOrgOffset( sal_Int32 nX, sal_Int32 nY );
void SetWinExt( const Size& rSize );
void ScaleWinExt( double fX, double fY );
@@ -628,24 +628,24 @@ class WinMtfOutput
sal_uInt32 GetMapMode() const { return mnMapMode; };
void SetMapMode( sal_uInt32 mnMapMode );
void SetWorldTransform( const XForm& rXForm );
- void ModifyWorldTransform( const XForm& rXForm, UINT32 nMode );
+ void ModifyWorldTransform( const XForm& rXForm, sal_uInt32 nMode );
void Push();
void Pop();
- UINT32 SetRasterOp( UINT32 nRasterOp );
+ sal_uInt32 SetRasterOp( sal_uInt32 nRasterOp );
void StrokeAndFillPath( sal_Bool bStroke, sal_Bool bFill );
void SetGfxMode( sal_Int32 nGfxMode ){ mnGfxMode = nGfxMode; };
sal_Int32 GetGfxMode() const { return mnGfxMode; };
- void SetBkMode( UINT32 nMode );
+ void SetBkMode( sal_uInt32 nMode );
void SetBkColor( const Color& rColor );
void SetTextColor( const Color& rColor );
- void SetTextAlign( UINT32 nAlign );
+ void SetTextAlign( sal_uInt32 nAlign );
void CreateObject( GDIObjectType, void* pStyle = NULL );
- void CreateObject( INT32 nIndex, GDIObjectType, void* pStyle = NULL );
- void DeleteObject( INT32 nIndex );
- void SelectObject( INT32 nIndex );
+ void CreateObject( sal_Int32 nIndex, GDIObjectType, void* pStyle = NULL );
+ void DeleteObject( sal_Int32 nIndex );
+ void SelectObject( sal_Int32 nIndex );
CharSet GetCharSet(){ return maFont.GetCharSet(); };
WinMtfFillStyle& GetFillStyle () { return maFillStyle; }
void SetFont( const Font& rFont );
@@ -661,10 +661,10 @@ class WinMtfOutput
void LineTo( const Point& rPoint, sal_Bool bRecordPath = sal_False );
void DrawPixel( const Point& rSource, const Color& rColor );
void DrawLine( const Point& rSource, const Point& rDest );
- void DrawRect( const Rectangle& rRect, BOOL bEdge = TRUE );
+ void DrawRect( const Rectangle& rRect, sal_Bool bEdge = sal_True );
void DrawRoundRect( const Rectangle& rRect, const Size& rSize );
void DrawEllipse( const Rectangle& rRect );
- void DrawArc( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle, BOOL bDrawTo = FALSE );
+ void DrawArc( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle, sal_Bool bDrawTo = sal_False );
void DrawPie( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle );
void DrawChord( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle );
void DrawPolygon( Polygon& rPolygon, sal_Bool bRecordPath = sal_False );
@@ -682,7 +682,7 @@ class WinMtfOutput
void UpdateClipRegion();
void AddFromGDIMetaFile( GDIMetaFile& rGDIMetaFile );
- void PassEMFPlus( void* pBuffer, UINT32 nLength );
+ void PassEMFPlus( void* pBuffer, sal_uInt32 nLength );
void PassEMFPlusHeaderInfo();
WinMtfOutput( GDIMetaFile& rGDIMetaFile );
@@ -698,7 +698,7 @@ class WinMtf
WinMtfOutput* pOut; //
SvStream* pWMF; // Die einzulesende WMF/EMF-Datei
- UINT32 nStartPos, nEndPos;
+ sal_uInt32 nStartPos, nEndPos;
List aBmpSaveList;
FilterConfigItem* pFilterConfigItem;
@@ -708,7 +708,7 @@ class WinMtf
// Sorgt dafuer, das aSampledBrush der aktuelle Brush des GDIMetaFiles ist.
Color ReadColor();
- void Callback( USHORT nPercent );
+ void Callback( sal_uInt16 nPercent );
WinMtf( WinMtfOutput* pOut, SvStream& rStreamWMF, FilterConfigItem* pConfigItem = NULL );
~WinMtf();
@@ -723,19 +723,19 @@ class EnhWMFReader : public WinMtf
{
sal_Bool bRecordPath;
sal_Int32 nRecordCount;
- BOOL bEMFPlus;
+ sal_Bool bEMFPlus;
- BOOL ReadHeader();
- Rectangle ReadRectangle( INT32, INT32, INT32, INT32 ); // Liesst und konvertiert ein Rechteck
- void ImplExtTextOut( BOOL bWideCharakter );
+ sal_Bool ReadHeader();
+ Rectangle ReadRectangle( sal_Int32, sal_Int32, sal_Int32, sal_Int32 ); // Liesst und konvertiert ein Rechteck
+ void ImplExtTextOut( sal_Bool bWideCharakter );
public:
EnhWMFReader( SvStream& rStreamWMF, GDIMetaFile& rGDIMetaFile, FilterConfigItem* pConfigItem = NULL )
- : WinMtf( new WinMtfOutput( rGDIMetaFile ), rStreamWMF, pConfigItem ), bRecordPath( sal_False ), bEMFPlus (FALSE) {};
+ : WinMtf( new WinMtfOutput( rGDIMetaFile ), rStreamWMF, pConfigItem ), bRecordPath( sal_False ), bEMFPlus( sal_False ) {};
~EnhWMFReader();
- BOOL ReadEnhWMF();
+ sal_Bool ReadEnhWMF();
void ReadEMFPlusComment(sal_uInt32 length, sal_Bool& bHaveDC);
void ReadGDIComment();
};
@@ -747,7 +747,7 @@ class WMFReader : public WinMtf
private:
VirtualDevice aVDev; // just for the purpose of "IsFontAvailable"
- UINT16 nUnitsPerInch;
+ sal_uInt16 nUnitsPerInch;
sal_uInt32 nRecSize;
// embedded EMF data
@@ -767,10 +767,10 @@ private:
sal_uInt32 nUnicodeEscapeAction;
// Liesst den Kopf der WMF-Datei
- BOOL ReadHeader();
+ sal_Bool ReadHeader();
// Liesst die Parameter des Rocords mit der Funktionsnummer nFunction.
- void ReadRecordParams( USHORT nFunction );
+ void ReadRecordParams( sal_uInt16 nFunction );
Point ReadPoint(); // Liesst und konvertiert einen Punkt (erst X dann Y)
Point ReadYX(); // Liesst und konvertiert einen Punkt (erst Y dann X)
diff --git a/svtools/source/filter.vcl/wmf/winwmf.cxx b/svtools/source/filter.vcl/wmf/winwmf.cxx
index e2e9c4de3bd9..c7d33a824adf 100644
--- a/svtools/source/filter.vcl/wmf/winwmf.cxx
+++ b/svtools/source/filter.vcl/wmf/winwmf.cxx
@@ -157,7 +157,7 @@ Size WMFReader::ReadYXExt()
// ------------------------------------------------------------------------
-void WMFReader::ReadRecordParams( USHORT nFunc )
+void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
{
switch( nFunc )
{
@@ -169,7 +169,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
case W_META_SETBKMODE:
{
- USHORT nDat;
+ sal_uInt16 nDat;
*pWMF >> nDat;
pOut->SetBkMode( nDat );
}
@@ -186,7 +186,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
case W_META_SETROP2:
{
- UINT16 nROP2;
+ sal_uInt16 nROP2;
*pWMF >> nROP2;
pOut->SetRasterOp( nROP2 );
}
@@ -323,7 +323,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
case W_META_POLYGON:
{
- USHORT i,nPoints;
+ sal_uInt16 i,nPoints;
*pWMF >> nPoints;
Polygon aPoly( nPoints );
for( i = 0; i < nPoints; i++ )
@@ -334,13 +334,13 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
case W_META_POLYPOLYGON:
{
- USHORT i, nPoly, nPoints;
- USHORT* pnPoints;
+ sal_uInt16 i, nPoly, nPoints;
+ sal_uInt16* pnPoints;
Point* pPtAry;
// Anzahl der Polygone:
*pWMF >> nPoly;
// Anzahl der Punkte eines jeden Polygons holen, Gesammtzahl der Punkte ermitteln:
- pnPoints = new USHORT[ nPoly ];
+ pnPoints = new sal_uInt16[ nPoly ];
nPoints = 0;
for( i = 0; i < nPoly; i++ )
{
@@ -361,7 +361,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
case W_META_POLYLINE:
{
- USHORT i,nPoints;
+ sal_uInt16 i,nPoints;
*pWMF >> nPoints;
Polygon aPoly( nPoints );
for( i = 0; i < nPoints; i++ )
@@ -397,7 +397,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
case W_META_TEXTOUT:
{
- USHORT nLength;
+ sal_uInt16 nLength;
*pWMF >> nLength;
if ( nLength )
{
@@ -454,7 +454,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
sal_uInt32 nMaxStreamPos = nRecordPos + ( nRecordSize << 1 );
sal_Int32 nDxArySize = nMaxStreamPos - pWMF->Tell();
sal_Int32 nDxAryEntries = nDxArySize >> 1;
- sal_Bool bUseDXAry = FALSE;
+ sal_Bool bUseDXAry = sal_False;
if ( ( ( nDxAryEntries % nOriginalTextLen ) == 0 ) && ( nNewTextLen <= nOriginalTextLen ) )
{
@@ -482,7 +482,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
pDXAry[ i ] = nDx;
}
if ( i == nNewTextLen )
- bUseDXAry = TRUE;
+ bUseDXAry = sal_True;
}
if ( pDXAry && bUseDXAry )
pOut->DrawText( aPosition, aText, pDXAry );
@@ -497,7 +497,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
case W_META_SELECTOBJECT:
{
- INT16 nObjIndex;
+ sal_Int16 nObjIndex;
*pWMF >> nObjIndex;
pOut->SelectObject( nObjIndex );
}
@@ -505,7 +505,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
case W_META_SETTEXTALIGN:
{
- UINT16 nAlign;
+ sal_uInt16 nAlign;
*pWMF >> nAlign;
pOut->SetTextAlign( nAlign );
}
@@ -603,14 +603,14 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
{
if ( nWinROP == PATCOPY )
*pWMF >> nUsage; // i don't know anything of this parameter, so its called nUsage
- // pOut->DrawRect( Rectangle( ReadYX(), aDestSize ), FALSE );
+ // pOut->DrawRect( Rectangle( ReadYX(), aDestSize ), sal_False );
Size aDestSize( ReadYXExt() );
if ( aDestSize.Width() && aDestSize.Height() ) // #92623# do not try to read buggy bitmaps
{
Rectangle aDestRect( ReadYX(), aDestSize );
if ( nWinROP != PATCOPY )
- aBmp.Read( *pWMF, FALSE );
+ aBmp.Read( *pWMF, sal_False );
// test if it is sensible to crop
if ( nSye && nSxe &&
@@ -630,18 +630,18 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
{
Bitmap aBmp;
BitmapReadAccess* pBmp;
- UINT32 nRed = 0, nGreen = 0, nBlue = 0, nCount = 1;
- UINT16 nFunction;
+ sal_uInt32 nRed = 0, nGreen = 0, nBlue = 0, nCount = 1;
+ sal_uInt16 nFunction;
*pWMF >> nFunction >> nFunction;
- aBmp.Read( *pWMF, FALSE );
+ aBmp.Read( *pWMF, sal_False );
pBmp = aBmp.AcquireReadAccess();
if ( pBmp )
{
- for ( INT32 y = 0; y < pBmp->Height(); y++ )
+ for ( sal_Int32 y = 0; y < pBmp->Height(); y++ )
{
- for ( INT32 x = 0; x < pBmp->Width(); x++ )
+ for ( sal_Int32 x = 0; x < pBmp->Width(); x++ )
{
const BitmapColor aColor( pBmp->GetColor( y, x ) );
@@ -655,14 +655,14 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
nCount++;
aBmp.ReleaseAccess( pBmp );
}
- Color aColor( (BYTE)( nRed / nCount ), (BYTE)( nGreen / nCount ), (BYTE)( nBlue / nCount ) );
- pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( aColor, FALSE ) );
+ Color aColor( (sal_uInt8)( nRed / nCount ), (sal_uInt8)( nGreen / nCount ), (sal_uInt8)( nBlue / nCount ) );
+ pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( aColor, sal_False ) );
}
break;
case W_META_DELETEOBJECT:
{
- INT16 nIndex;
+ sal_Int16 nIndex;
*pWMF >> nIndex;
pOut->DeleteObject( nIndex );
}
@@ -676,29 +676,29 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
case W_META_CREATEBRUSH:
{
- pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( Color( COL_WHITE ), FALSE ) );
+ pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( Color( COL_WHITE ), sal_False ) );
}
break;
case W_META_CREATEPATTERNBRUSH:
{
- pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( Color( COL_WHITE ), FALSE ) );
+ pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( Color( COL_WHITE ), sal_False ) );
}
break;
case W_META_CREATEPENINDIRECT:
{
LineInfo aLineInfo;
- USHORT nStyle, nWidth, nHeight;
+ sal_uInt16 nStyle, nWidth, nHeight;
*pWMF >> nStyle >> nWidth >> nHeight;
if ( nWidth )
aLineInfo.SetWidth( nWidth );
- BOOL bTransparent = FALSE;
- UINT16 nDashCount = 0;
- UINT16 nDotCount = 0;
+ sal_Bool bTransparent = sal_False;
+ sal_uInt16 nDashCount = 0;
+ sal_uInt16 nDotCount = 0;
switch( nStyle )
{
case PS_DASHDOTDOT :
@@ -712,7 +712,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
nDashCount++;
break;
case PS_NULL :
- bTransparent = TRUE;
+ bTransparent = sal_True;
aLineInfo.SetStyle( LINE_NONE );
break;
default :
@@ -732,9 +732,9 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
case W_META_CREATEBRUSHINDIRECT:
{
- USHORT nStyle;
+ sal_uInt16 nStyle;
*pWMF >> nStyle;
- pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( ReadColor(), ( nStyle == BS_HOLLOW ) ? TRUE : FALSE ) );
+ pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( ReadColor(), ( nStyle == BS_HOLLOW ) ? sal_True : sal_False ) );
}
break;
@@ -742,7 +742,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
{
Size aFontSize;
char lfFaceName[ LF_FACESIZE ];
- INT16 lfEscapement, lfOrientation, lfWeight; // ( ehemals USHORT )
+ sal_Int16 lfEscapement, lfOrientation, lfWeight; // ( ehemals sal_uInt16 )
LOGFONTW aLogFont;
aFontSize = ReadYXExt();
@@ -797,11 +797,11 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
case W_META_PATBLT:
{
- UINT32 nROP, nOldROP;
+ sal_uInt32 nROP, nOldROP;
*pWMF >> nROP;
Size aSize = ReadYXExt();
nOldROP = pOut->SetRasterOp( nROP );
- pOut->DrawRect( Rectangle( ReadYX(), aSize ), FALSE );
+ pOut->DrawRect( Rectangle( ReadYX(), aSize ), sal_False );
pOut->SetRasterOp( nOldROP );
}
break;
@@ -997,7 +997,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
// ------------------------------------------------------------------------
-BOOL WMFReader::ReadHeader()
+sal_Bool WMFReader::ReadHeader()
{
Rectangle aPlaceableBound;
sal_uInt32 nl, nStrmPos = pWMF->Tell();
@@ -1008,7 +1008,7 @@ BOOL WMFReader::ReadHeader()
Size aWMFSize;
if ( nl == 0x9ac6cdd7L )
{
- INT16 nVal;
+ sal_Int16 nVal;
// hmf (Unused) ueberlesen wir
pWMF->SeekRel(2);
@@ -1056,7 +1056,7 @@ BOOL WMFReader::ReadHeader()
if( nl != 0x00090001 )
{
pWMF->SetError( SVSTREAM_FILEFORMAT_ERROR );
- return FALSE;
+ return sal_False;
}
pWMF->SeekRel( 2 ); // Version (von Windows)
@@ -1065,13 +1065,13 @@ BOOL WMFReader::ReadHeader()
pWMF->SeekRel( 4 ); // MaxRecord (Groesse des groessten Records in Words)
pWMF->SeekRel( 2 ); // NoParameters (Unused
- return TRUE;
+ return sal_True;
}
void WMFReader::ReadWMF()
{
- USHORT nFunction;
- ULONG nPos, nPercent, nLastPercent;
+ sal_uInt16 nFunction;
+ sal_uLong nPos, nPercent, nLastPercent;
nSkipActions = 0;
nCurrentAction = 0;
@@ -1091,7 +1091,7 @@ void WMFReader::ReadWMF()
nEndPos=pWMF->Seek( STREAM_SEEK_TO_END );
pWMF->Seek( nStartPos );
- Callback( (USHORT) ( nLastPercent = 0 ) );
+ Callback( (sal_uInt16) ( nLastPercent = 0 ) );
if ( ReadHeader() )
{
@@ -1100,14 +1100,14 @@ void WMFReader::ReadWMF()
if( nEndPos - nStartPos )
{
- while( TRUE )
+ while( sal_True )
{
nCurrentAction++;
nPercent = ( nPos - nStartPos ) * 100 / ( nEndPos - nStartPos );
if( nLastPercent + 4 <= nPercent )
{
- Callback( (USHORT) nPercent );
+ Callback( (sal_uInt16) nPercent );
nLastPercent = nPercent;
}
*pWMF >> nRecSize >> nFunction;
@@ -1289,7 +1289,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt
case W_META_POLYGON:
{
- USHORT i,nPoints;
+ sal_uInt16 i,nPoints;
*pStm >> nPoints;
for( i = 0; i < nPoints; i++ )
GetWinExtMax( ReadPoint(), rPlaceableBound, nMapMode );
@@ -1298,7 +1298,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt
case W_META_POLYPOLYGON:
{
- USHORT i, nPoly, nPoints = 0;
+ sal_uInt16 i, nPoly, nPoints = 0;
*pStm >> nPoly;
for( i = 0; i < nPoly; i++ )
{
@@ -1313,7 +1313,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt
case W_META_POLYLINE:
{
- USHORT i,nPoints;
+ sal_uInt16 i,nPoints;
*pStm >> nPoints;
for( i = 0; i < nPoints; i++ )
GetWinExtMax( ReadPoint(), rPlaceableBound, nMapMode );
@@ -1329,7 +1329,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt
case W_META_TEXTOUT:
{
- USHORT nLength;
+ sal_uInt16 nLength;
*pStm >> nLength;
// todo: we also have to take care of the text width
if ( nLength )
@@ -1383,7 +1383,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt
{
if ( nWinROP == PATCOPY )
*pStm >> nUsage; // i don't know anything of this parameter, so its called nUsage
- // pOut->DrawRect( Rectangle( ReadYX(), aDestSize ), FALSE );
+ // pOut->DrawRect( Rectangle( ReadYX(), aDestSize ), sal_False );
Size aDestSize( ReadYXExt() );
if ( aDestSize.Width() && aDestSize.Height() ) // #92623# do not try to read buggy bitmaps
@@ -1397,7 +1397,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt
case W_META_PATBLT:
{
- UINT32 nROP;
+ sal_uInt32 nROP;
*pStm >> nROP;
Size aSize = ReadYXExt();
GetWinExtMax( Rectangle( ReadYX(), aSize ), rPlaceableBound, nMapMode );
diff --git a/svtools/source/filter.vcl/wmf/wmf.cxx b/svtools/source/filter.vcl/wmf/wmf.cxx
index b56d9d07cc28..d78ce2d160bb 100644
--- a/svtools/source/filter.vcl/wmf/wmf.cxx
+++ b/svtools/source/filter.vcl/wmf/wmf.cxx
@@ -36,18 +36,18 @@
// -----------------------------------------------------------------------------
-BOOL ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile, FilterConfigItem* pConfigItem )
+sal_Bool ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile, FilterConfigItem* pConfigItem )
{
- UINT32 nMetaType;
- UINT32 nOrgPos = rStreamWMF.Tell();
- UINT16 nOrigNumberFormat = rStreamWMF.GetNumberFormatInt();
+ sal_uInt32 nMetaType;
+ sal_uInt32 nOrgPos = rStreamWMF.Tell();
+ sal_uInt16 nOrigNumberFormat = rStreamWMF.GetNumberFormatInt();
rStreamWMF.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
rStreamWMF.Seek( 0x28 );
rStreamWMF >> nMetaType;
rStreamWMF.Seek( nOrgPos );
if ( nMetaType == 0x464d4520 )
{
- if ( EnhWMFReader( rStreamWMF, rGDIMetaFile, pConfigItem ).ReadEnhWMF() == FALSE )
+ if ( EnhWMFReader( rStreamWMF, rGDIMetaFile, pConfigItem ).ReadEnhWMF() == sal_False )
rStreamWMF.SetError( SVSTREAM_FILEFORMAT_ERROR );
}
else
@@ -60,18 +60,18 @@ BOOL ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile,
// -----------------------------------------------------------------------------
-BOOL ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF, FilterConfigItem* pFilterConfigItem )
+sal_Bool ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF, FilterConfigItem* pFilterConfigItem )
{
- UINT32 nMetaType;
- UINT32 nOrgPos = rStream.Tell();
- UINT16 nOrigNumberFormat = rStream.GetNumberFormatInt();
+ sal_uInt32 nMetaType;
+ sal_uInt32 nOrgPos = rStream.Tell();
+ sal_uInt16 nOrigNumberFormat = rStream.GetNumberFormatInt();
rStream.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
rStream.Seek( 0x28 );
rStream >> nMetaType;
rStream.Seek( nOrgPos );
if ( nMetaType == 0x464d4520 )
{
- if ( EnhWMFReader( rStream, rMTF, NULL ).ReadEnhWMF() == FALSE )
+ if ( EnhWMFReader( rStream, rMTF, NULL ).ReadEnhWMF() == sal_False )
rStream.SetError( SVSTREAM_FILEFORMAT_ERROR );
}
else
@@ -84,8 +84,8 @@ BOOL ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF, FilterConfigItem*
// -----------------------------------------------------------------------------
-BOOL ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStream & rTargetStream,
- FilterConfigItem* pConfigItem, BOOL bPlaceable)
+sal_Bool ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStream & rTargetStream,
+ FilterConfigItem* pConfigItem, sal_Bool bPlaceable)
{
WMFWriter aWMFWriter;
return aWMFWriter.WriteWMF( rMTF, rTargetStream, pConfigItem, bPlaceable );
@@ -93,7 +93,7 @@ BOOL ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStream & rTargetStream
// -----------------------------------------------------------------------------
-BOOL ConvertGDIMetaFileToEMF( const GDIMetaFile & rMTF, SvStream & rTargetStream,
+sal_Bool ConvertGDIMetaFileToEMF( const GDIMetaFile & rMTF, SvStream & rTargetStream,
FilterConfigItem* pConfigItem )
{
EMFWriter aEMFWriter(rTargetStream);
@@ -102,16 +102,16 @@ BOOL ConvertGDIMetaFileToEMF( const GDIMetaFile & rMTF, SvStream & rTargetStream
// -----------------------------------------------------------------------------
-BOOL WriteWindowMetafile( SvStream& rStream, const GDIMetaFile& rMTF )
+sal_Bool WriteWindowMetafile( SvStream& rStream, const GDIMetaFile& rMTF )
{
return WMFWriter().WriteWMF( rMTF, rStream, NULL );
}
// -----------------------------------------------------------------------------
-BOOL WriteWindowMetafileBits( SvStream& rStream, const GDIMetaFile& rMTF )
+sal_Bool WriteWindowMetafileBits( SvStream& rStream, const GDIMetaFile& rMTF )
{
- return WMFWriter().WriteWMF( rMTF, rStream, NULL, FALSE );
+ return WMFWriter().WriteWMF( rMTF, rStream, NULL, sal_False );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter.vcl/wmf/wmfwr.cxx b/svtools/source/filter.vcl/wmf/wmfwr.cxx
index 5214918b9870..2e507f835e68 100644
--- a/svtools/source/filter.vcl/wmf/wmfwr.cxx
+++ b/svtools/source/filter.vcl/wmf/wmfwr.cxx
@@ -252,7 +252,7 @@ void WMFWriter::MayCallback()
{
if ( xStatusIndicator.is() )
{
- ULONG nPercent;
+ sal_uLong nPercent;
// Wir gehen mal einfach so davon aus, dass 16386 Actions einer Bitmap entsprechen
// (in der Regel wird ein Metafile entweder nur Actions oder einige Bitmaps und fast
@@ -273,7 +273,7 @@ void WMFWriter::MayCallback()
void WMFWriter::CountActionsAndBitmaps( const GDIMetaFile & rMTF )
{
- ULONG nAction, nActionCount;
+ sal_uLong nAction, nActionCount;
nActionCount = rMTF.GetActionCount();
@@ -341,7 +341,7 @@ void WMFWriter::WriteRectangle(const Rectangle & rRect)
void WMFWriter::WriteColor(const Color & rColor)
{
- *pWMF << (BYTE) rColor.GetRed() << (BYTE) rColor.GetGreen() << (BYTE) rColor.GetBlue() << (BYTE) 0;
+ *pWMF << (sal_uInt8) rColor.GetRed() << (sal_uInt8) rColor.GetGreen() << (sal_uInt8) rColor.GetBlue() << (sal_uInt8) 0;
}
@@ -355,12 +355,12 @@ void WMFWriter::WriteRecordHeader(sal_uInt32 nSizeWords, sal_uInt16 nType)
void WMFWriter::UpdateRecordHeader()
{
- ULONG nPos;
+ sal_uLong nPos;
sal_uInt32 nSize;
nPos=pWMF->Tell(); nSize=nPos-nActRecordPos;
if ((nSize & 1)!=0) {
- *pWMF << (BYTE)0;
+ *pWMF << (sal_uInt8)0;
nPos++; nSize++;
}
nSize/=2;
@@ -393,19 +393,19 @@ void WMFWriter::WMFRecord_CreateBrushIndirect(const Color& rColor)
WriteRecordHeader(0x00000007,W_META_CREATEBRUSHINDIRECT);
if( rColor==Color(COL_TRANSPARENT) )
- *pWMF << (UINT16) W_BS_HOLLOW;
+ *pWMF << (sal_uInt16) W_BS_HOLLOW;
else
- *pWMF << (UINT16) W_BS_SOLID;
+ *pWMF << (sal_uInt16) W_BS_SOLID;
WriteColor( rColor );
- *pWMF << (UINT16) 0;
+ *pWMF << (sal_uInt16) 0;
}
void WMFWriter::WMFRecord_CreateFontIndirect(const Font & rFont)
{
- USHORT nWeight,i;
- BYTE nPitchFamily;
+ sal_uInt16 nWeight,i;
+ sal_uInt8 nPitchFamily;
WriteRecordHeader(0x00000000,W_META_CREATEFONTINDIRECT);
WriteHeightWidth(Size(rFont.GetSize().Width(),-rFont.GetSize().Height()));
@@ -426,9 +426,9 @@ void WMFWriter::WMFRecord_CreateFontIndirect(const Font & rFont)
}
*pWMF << nWeight;
- if (rFont.GetItalic()==ITALIC_NONE) *pWMF << (BYTE)0; else *pWMF << (BYTE)1;
- if (rFont.GetUnderline()==UNDERLINE_NONE) *pWMF << (BYTE)0; else *pWMF << (BYTE)1;
- if (rFont.GetStrikeout()==STRIKEOUT_NONE) *pWMF << (BYTE)0; else *pWMF << (BYTE)1;
+ if (rFont.GetItalic()==ITALIC_NONE) *pWMF << (sal_uInt8)0; else *pWMF << (sal_uInt8)1;
+ if (rFont.GetUnderline()==UNDERLINE_NONE) *pWMF << (sal_uInt8)0; else *pWMF << (sal_uInt8)1;
+ if (rFont.GetStrikeout()==STRIKEOUT_NONE) *pWMF << (sal_uInt8)0; else *pWMF << (sal_uInt8)1;
CharSet eFontNameEncoding = rFont.GetCharSet();
sal_uInt8 nCharSet = rtl_getBestWindowsCharsetFromTextEncoding( eFontNameEncoding );
@@ -438,7 +438,7 @@ void WMFWriter::WMFRecord_CreateFontIndirect(const Font & rFont)
nCharSet = W_ANSI_CHARSET;
*pWMF << nCharSet;
- *pWMF << (BYTE)0 << (BYTE)0 << (BYTE)0;
+ *pWMF << (sal_uInt8)0 << (sal_uInt8)0 << (sal_uInt8)0;
switch (rFont.GetPitch()) {
case PITCH_FIXED: nPitchFamily=W_FIXED_PITCH; break;
@@ -467,7 +467,7 @@ void WMFWriter::WMFRecord_CreateFontIndirect(const Font & rFont)
void WMFWriter::WMFRecord_CreatePenIndirect(const Color& rColor, const LineInfo& rLineInfo )
{
WriteRecordHeader(0x00000008,W_META_CREATEPENINDIRECT);
- USHORT nStyle = rColor == Color( COL_TRANSPARENT ) ? W_PS_NULL : W_PS_SOLID;
+ sal_uInt16 nStyle = rColor == Color( COL_TRANSPARENT ) ? W_PS_NULL : W_PS_SOLID;
switch( rLineInfo.GetStyle() )
{
case LINE_DASH :
@@ -500,7 +500,7 @@ void WMFWriter::WMFRecord_CreatePenIndirect(const Color& rColor, const LineInfo&
WriteColor( rColor );
}
-void WMFWriter::WMFRecord_DeleteObject(USHORT nObjectHandle)
+void WMFWriter::WMFRecord_DeleteObject(sal_uInt16 nObjectHandle)
{
WriteRecordHeader(0x00000004,W_META_DELETEOBJECT);
*pWMF << nObjectHandle;
@@ -721,7 +721,7 @@ void WMFWriter::WMFRecord_Pie(const Rectangle & rRect, const Point & rStartPt, c
void WMFWriter::WMFRecord_Polygon(const Polygon & rPoly)
{
- USHORT nSize,i;
+ sal_uInt16 nSize,i;
Polygon aSimplePoly;
if ( rPoly.HasFlags() )
@@ -729,7 +729,7 @@ void WMFWriter::WMFRecord_Polygon(const Polygon & rPoly)
else
aSimplePoly = rPoly;
nSize = aSimplePoly.GetSize();
- WriteRecordHeader(((ULONG)nSize)*2+4,W_META_POLYGON);
+ WriteRecordHeader(((sal_uLong)nSize)*2+4,W_META_POLYGON);
*pWMF << nSize;
for (i=0; i<nSize; i++) WritePointXY(aSimplePoly.GetPoint(i));
}
@@ -737,14 +737,14 @@ void WMFWriter::WMFRecord_Polygon(const Polygon & rPoly)
void WMFWriter::WMFRecord_PolyLine(const Polygon & rPoly)
{
- USHORT nSize,i;
+ sal_uInt16 nSize,i;
Polygon aSimplePoly;
if ( rPoly.HasFlags() )
rPoly.AdaptiveSubdivide( aSimplePoly );
else
aSimplePoly = rPoly;
nSize=aSimplePoly.GetSize();
- WriteRecordHeader(((ULONG)nSize)*2+4,W_META_POLYLINE);
+ WriteRecordHeader(((sal_uLong)nSize)*2+4,W_META_POLYLINE);
*pWMF << nSize;
for (i=0; i<nSize; i++) WritePointXY(aSimplePoly.GetPoint(i));
}
@@ -753,7 +753,7 @@ void WMFWriter::WMFRecord_PolyLine(const Polygon & rPoly)
void WMFWriter::WMFRecord_PolyPolygon(const PolyPolygon & rPolyPoly)
{
const Polygon * pPoly;
- USHORT nCount,nSize,i,j;
+ sal_uInt16 nCount,nSize,i,j;
nCount=rPolyPoly.Count();
PolyPolygon aSimplePolyPoly( rPolyPoly );
@@ -768,7 +768,7 @@ void WMFWriter::WMFRecord_PolyPolygon(const PolyPolygon & rPolyPoly)
}
WriteRecordHeader(0,W_META_POLYPOLYGON);
*pWMF << nCount;
- for (i=0; i<nCount; i++) *pWMF << ((USHORT)(aSimplePolyPoly.GetObject(i).GetSize()));
+ for (i=0; i<nCount; i++) *pWMF << ((sal_uInt16)(aSimplePolyPoly.GetObject(i).GetSize()));
for (i=0; i<nCount; i++) {
pPoly=&(aSimplePolyPoly.GetObject(i));
nSize=pPoly->GetSize();
@@ -806,24 +806,24 @@ void WMFWriter::WMFRecord_SaveDC()
}
-void WMFWriter::WMFRecord_SelectObject(USHORT nObjectHandle)
+void WMFWriter::WMFRecord_SelectObject(sal_uInt16 nObjectHandle)
{
WriteRecordHeader(0x00000004,W_META_SELECTOBJECT);
*pWMF << nObjectHandle;
}
-void WMFWriter::WMFRecord_SetBkMode(BOOL bTransparent)
+void WMFWriter::WMFRecord_SetBkMode(sal_Bool bTransparent)
{
WriteRecordHeader(0x00000004,W_META_SETBKMODE);
- if (bTransparent==TRUE) *pWMF << (USHORT)W_TRANSPARENT;
- else *pWMF << (USHORT)W_OPAQUE;
+ if (bTransparent==sal_True) *pWMF << (sal_uInt16)W_TRANSPARENT;
+ else *pWMF << (sal_uInt16)W_OPAQUE;
}
void WMFWriter::WMFRecord_SetStretchBltMode()
{
WriteRecordHeader( 0x00000004, W_META_SETSTRETCHBLTMODE );
- *pWMF << (USHORT) 3; // STRETCH_DELETESCANS
+ *pWMF << (sal_uInt16) 3; // STRETCH_DELETESCANS
}
void WMFWriter::WMFRecord_SetPixel(const Point & rPoint, const Color & rColor)
@@ -836,7 +836,7 @@ void WMFWriter::WMFRecord_SetPixel(const Point & rPoint, const Color & rColor)
void WMFWriter::WMFRecord_SetROP2(RasterOp eROP)
{
- USHORT nROP2;
+ sal_uInt16 nROP2;
switch (eROP) {
case ROP_INVERT: nROP2=W_R2_NOT; break;
@@ -848,9 +848,9 @@ void WMFWriter::WMFRecord_SetROP2(RasterOp eROP)
}
-void WMFWriter::WMFRecord_SetTextAlign(FontAlign eFontAlign, UINT32 eHorTextAlign)
+void WMFWriter::WMFRecord_SetTextAlign(FontAlign eFontAlign, sal_uInt32 eHorTextAlign)
{
- USHORT nAlign;
+ sal_uInt16 nAlign;
switch (eFontAlign) {
case ALIGN_TOP: nAlign=W_TA_TOP; break;
@@ -889,7 +889,7 @@ void WMFWriter::WMFRecord_SetWindowOrg(const Point & rPoint)
void WMFWriter::WMFRecord_StretchDIB( const Point & rPoint, const Size & rSize,
const Bitmap & rBitmap, sal_uInt32 nROP )
{
- ULONG nPosAnf,nPosEnd;
+ sal_uLong nPosAnf,nPosEnd;
nActBitmapPercent=50;
MayCallback();
@@ -949,14 +949,14 @@ void WMFWriter::WMFRecord_TextOut(const Point & rPoint, const String & rStr)
void WMFWriter::TrueTextOut(const Point & rPoint, const ByteString& rString)
{
- USHORT nLen,i;
+ sal_uInt16 nLen,i;
WriteRecordHeader(0,W_META_TEXTOUT);
nLen=rString.Len();
*pWMF << nLen;
for ( i = 0; i < nLen; i++ )
- *pWMF << (BYTE)rString.GetChar( i );
- if ((nLen&1)!=0) *pWMF << (BYTE)0;
+ *pWMF << (sal_uInt8)rString.GetChar( i );
+ if ((nLen&1)!=0) *pWMF << (sal_uInt8)0;
WritePointYX(rPoint);
UpdateRecordHeader();
}
@@ -974,30 +974,30 @@ void WMFWriter::WMFRecord_IntersectClipRect( const Rectangle& rRect )
}
-USHORT WMFWriter::AllocHandle()
+sal_uInt16 WMFWriter::AllocHandle()
{
- USHORT i;
+ sal_uInt16 i;
for (i=0; i<MAXOBJECTHANDLES; i++) {
- if (bHandleAllocated[i]==FALSE) {
- bHandleAllocated[i]=TRUE;
+ if (bHandleAllocated[i]==sal_False) {
+ bHandleAllocated[i]=sal_True;
return i;
}
}
- bStatus=FALSE;
+ bStatus=sal_False;
return 0xffff;
}
-void WMFWriter::FreeHandle(USHORT nObjectHandle)
+void WMFWriter::FreeHandle(sal_uInt16 nObjectHandle)
{
- if (nObjectHandle<MAXOBJECTHANDLES) bHandleAllocated[nObjectHandle]=FALSE;
+ if (nObjectHandle<MAXOBJECTHANDLES) bHandleAllocated[nObjectHandle]=sal_False;
}
void WMFWriter::CreateSelectDeletePen( const Color& rColor, const LineInfo& rLineInfo )
{
- USHORT nOldHandle;
+ sal_uInt16 nOldHandle;
nOldHandle=nDstPenHandle;
nDstPenHandle=AllocHandle();
@@ -1012,7 +1012,7 @@ void WMFWriter::CreateSelectDeletePen( const Color& rColor, const LineInfo& rLin
void WMFWriter::CreateSelectDeleteFont(const Font & rFont)
{
- USHORT nOldHandle;
+ sal_uInt16 nOldHandle;
nOldHandle=nDstFontHandle;
nDstFontHandle=AllocHandle();
@@ -1027,7 +1027,7 @@ void WMFWriter::CreateSelectDeleteFont(const Font & rFont)
void WMFWriter::CreateSelectDeleteBrush(const Color& rColor)
{
- USHORT nOldHandle;
+ sal_uInt16 nOldHandle;
nOldHandle=nDstBrushHandle;
nDstBrushHandle=AllocHandle();
@@ -1059,7 +1059,7 @@ void WMFWriter::SetLineAndFillAttr()
CreateSelectDeleteBrush( aDstFillColor );
}
if ( bDstIsClipping != bSrcIsClipping ||
- (bSrcIsClipping==TRUE && aDstClipRegion!=aSrcClipRegion)) {
+ (bSrcIsClipping==sal_True && aDstClipRegion!=aSrcClipRegion)) {
bDstIsClipping=bSrcIsClipping;
aDstClipRegion=aSrcClipRegion;
}
@@ -1144,7 +1144,7 @@ void WMFWriter::HandleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx:
void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
{
- ULONG nA, nACount;
+ sal_uLong nA, nACount;
MetaAction* pMA;
if( bStatus )
@@ -1663,8 +1663,8 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
const MetaEPSAction* pA = (const MetaEPSAction*)pMA;
const GDIMetaFile aGDIMetaFile( pA->GetSubstitute() );
- INT32 nCount = aGDIMetaFile.GetActionCount();
- for ( INT32 i = 0; i < nCount; i++ )
+ sal_Int32 nCount = aGDIMetaFile.GetActionCount();
+ for ( sal_Int32 i = 0; i < nCount; i++ )
{
const MetaAction* pMetaAct = aGDIMetaFile.GetAction( i );
if ( pMetaAct->GetType() == META_BMPSCALE_ACTION )
@@ -1767,9 +1767,9 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
MayCallback();
if (pWMF->GetError())
- bStatus=FALSE;
+ bStatus=sal_False;
- if(bStatus==FALSE)
+ if(bStatus==sal_False)
break;
}
}
@@ -1777,13 +1777,13 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
// ------------------------------------------------------------------------
-void WMFWriter::WriteHeader( const GDIMetaFile &, BOOL bPlaceable )
+void WMFWriter::WriteHeader( const GDIMetaFile &, sal_Bool bPlaceable )
{
if( bPlaceable )
{
- USHORT nCheckSum, nValue;
+ sal_uInt16 nCheckSum, nValue;
Size aSize( pVirDev->LogicToLogic(Size(1,1),MapMode(MAP_INCH), aTargetMapMode) );
- USHORT nUnitsPerInch = (USHORT) ( ( aSize.Width() + aSize.Height() ) >> 1 );
+ sal_uInt16 nUnitsPerInch = (sal_uInt16) ( ( aSize.Width() + aSize.Height() ) >> 1 );
nCheckSum=0;
nValue=0xcdd7; nCheckSum^=nValue; *pWMF << nValue;
@@ -1791,8 +1791,8 @@ void WMFWriter::WriteHeader( const GDIMetaFile &, BOOL bPlaceable )
nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue;
nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue;
nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue;
- nValue=(USHORT) aTargetSize.Width(); nCheckSum^=nValue; *pWMF << nValue;
- nValue=(USHORT) aTargetSize.Height(); nCheckSum^=nValue; *pWMF << nValue;
+ nValue=(sal_uInt16) aTargetSize.Width(); nCheckSum^=nValue; *pWMF << nValue;
+ nValue=(sal_uInt16) aTargetSize.Height(); nCheckSum^=nValue; *pWMF << nValue;
nValue=nUnitsPerInch; nCheckSum^=nValue; *pWMF << nValue;
nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue;
nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue;
@@ -1813,13 +1813,13 @@ void WMFWriter::WriteHeader( const GDIMetaFile &, BOOL bPlaceable )
void WMFWriter::UpdateHeader()
{
- ULONG nPos;
+ sal_uLong nPos;
sal_uInt32 nFileSize;
nPos=pWMF->Tell(); // Endposition = Gesammtgroesse der Datei
nFileSize=nPos-nMetafileHeaderPos; // Groesse des 1. Headers abziehen
if ((nFileSize&1)!=0) { // ggf. auf ganze Worte aufrunden
- *pWMF << (BYTE)0;
+ *pWMF << (sal_uInt8)0;
nPos++;
nFileSize++;
}
@@ -1833,13 +1833,13 @@ void WMFWriter::UpdateHeader()
// ------------------------------------------------------------------------
-BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream,
- FilterConfigItem* pFConfigItem, BOOL bPlaceable )
+sal_Bool WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream,
+ FilterConfigItem* pFConfigItem, sal_Bool bPlaceable )
{
WMFWriterAttrStackMember * pAt;
- bEmbedEMF = TRUE;
- bStatus=TRUE;
+ bEmbedEMF = sal_True;
+ bStatus=sal_True;
pConvert = 0;
pVirDev = new VirtualDevice;
@@ -1886,8 +1886,8 @@ BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream,
pAttrStack=NULL;
- for (USHORT i=0; i<MAXOBJECTHANDLES; i++)
- bHandleAllocated[i]=FALSE;
+ for (sal_uInt16 i=0; i<MAXOBJECTHANDLES; i++)
+ bHandleAllocated[i]=sal_False;
nDstPenHandle=0xffff;
nDstFontHandle=0xffff;
@@ -1906,7 +1906,7 @@ BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream,
WriteEmbeddedEMF( rMTF );
WMFRecord_SetWindowOrg(Point(0,0));
WMFRecord_SetWindowExt(rMTF.GetPrefSize());
- WMFRecord_SetBkMode( TRUE );
+ WMFRecord_SetBkMode( sal_True );
eDstROP2 = eSrcRasterOp = ROP_OVERPAINT;
WMFRecord_SetROP2(eDstROP2);
@@ -1919,7 +1919,7 @@ BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream,
CreateSelectDeleteBrush( aDstFillColor );
aDstClipRegion = aSrcClipRegion = Region();
- bDstIsClipping = bSrcIsClipping = FALSE;
+ bDstIsClipping = bSrcIsClipping = sal_False;
Font aFont;
aFont.SetCharSet( GetExtendedTextEncoding( RTL_TEXTENCODING_MS_1252 ) );
@@ -1959,11 +1959,11 @@ BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream,
// ------------------------------------------------------------------------
-USHORT WMFWriter::CalcSaveTargetMapMode(MapMode& rMapMode,
+sal_uInt16 WMFWriter::CalcSaveTargetMapMode(MapMode& rMapMode,
const Size& rPrefSize)
{
Fraction aDivFrac(2, 1);
- USHORT nDivisor = 1;
+ sal_uInt16 nDivisor = 1;
Size aSize = pVirDev->LogicToLogic( rPrefSize, aSrcMapMode, rMapMode );
diff --git a/svtools/source/filter.vcl/wmf/wmfwr.hxx b/svtools/source/filter.vcl/wmf/wmfwr.hxx
index 22fe8efb2256..42aa647d78c2 100644
--- a/svtools/source/filter.vcl/wmf/wmfwr.hxx
+++ b/svtools/source/filter.vcl/wmf/wmfwr.hxx
@@ -70,9 +70,9 @@ class WMFWriter
{
private:
- BOOL bStatus;
+ sal_Bool bStatus;
- ULONG nLastPercent; // Mit welcher Zahl pCallback zuletzt aufgerufen wurde.
+ sal_uLong nLastPercent; // Mit welcher Zahl pCallback zuletzt aufgerufen wurde.
FilterConfigItem* pFilterConfigItem;
com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > xStatusIndicator;
@@ -82,11 +82,11 @@ private:
StarSymbolToMSMultiFont *pConvert;
MapMode aTargetMapMode;
Size aTargetSize;
- USHORT nTargetDivisor;
+ sal_uInt16 nTargetDivisor;
- ULONG nMetafileHeaderPos;
+ sal_uLong nMetafileHeaderPos;
sal_uInt32 nMaxRecordSize; // in Worten
- ULONG nActRecordPos;
+ sal_uLong nActRecordPos;
// Aktuelle Attribute im Quell-Metafile:
Color aSrcLineColor;
@@ -97,11 +97,11 @@ private:
FontAlign eSrcTextAlign;
Font aSrcFont;
MapMode aSrcMapMode;
- BOOL bSrcIsClipping;
+ sal_Bool bSrcIsClipping;
Region aSrcClipRegion;
WMFWriterAttrStackMember * pAttrStack;
- UINT32 eSrcHorTextAlign;
+ sal_uInt32 eSrcHorTextAlign;
// Aktuelle Attribute im Ziel-Metafile:
Color aDstLineColor;
@@ -112,28 +112,28 @@ private:
FontAlign eDstTextAlign;
Font aDstFont;
- UINT32 eDstHorTextAlign;
+ sal_uInt32 eDstHorTextAlign;
- BOOL bDstIsClipping; // ???: derzeit unberuecksichtigt
+ sal_Bool bDstIsClipping; // ???: derzeit unberuecksichtigt
Region aDstClipRegion; // ???: derzeit unberuecksichtigt
- BOOL bHandleAllocated[MAXOBJECTHANDLES]; // Welche Handles vergeben sind
- USHORT nDstPenHandle,nDstFontHandle,nDstBrushHandle; // Welche Handles die jeweiligen
+ sal_Bool bHandleAllocated[MAXOBJECTHANDLES]; // Welche Handles vergeben sind
+ sal_uInt16 nDstPenHandle,nDstFontHandle,nDstBrushHandle; // Welche Handles die jeweiligen
// Selected-Objects besitzen
// 0xffff = keines:
// Damit nicht bei jeder Operation alle Attribute verglichen werden muessen:
- ULONG nNumberOfActions; // Anzahl der Actions im GDIMetafile
- ULONG nNumberOfBitmaps; // Anzahl der Bitmaps
- ULONG nWrittenActions; // Anzahl der bereits verarbeiteten Actions beim Schreiben der Orders
- ULONG nWrittenBitmaps; // Anzahl der bereits geschriebenen Bitmaps
- ULONG nActBitmapPercent; // Wieviel Prozent die naechste Bitmap schon geschrieben ist.
+ sal_uLong nNumberOfActions; // Anzahl der Actions im GDIMetafile
+ sal_uLong nNumberOfBitmaps; // Anzahl der Bitmaps
+ sal_uLong nWrittenActions; // Anzahl der bereits verarbeiteten Actions beim Schreiben der Orders
+ sal_uLong nWrittenBitmaps; // Anzahl der bereits geschriebenen Bitmaps
+ sal_uLong nActBitmapPercent; // Wieviel Prozent die naechste Bitmap schon geschrieben ist.
- BOOL bEmbedEMF; // optionally embedd EMF data into WMF
+ sal_Bool bEmbedEMF; // optionally embedd EMF data into WMF
void MayCallback();
// Berechnet anhand der obigen 5 Parameter eine Prozentzahl
- // und macht dann ggf. einen Callback. Setzt bStatus auf FALSE wenn User abbrechen
+ // und macht dann ggf. einen Callback. Setzt bStatus auf sal_False wenn User abbrechen
// moechte.
void CountActionsAndBitmaps(const GDIMetaFile & rMTF);
@@ -155,14 +155,14 @@ private:
void UpdateRecordHeader();
// berichtig die Groesse des Records nach dem Schreiben der Parameter, wenn
// nSizeWords bei Aufruf von WriteRecordHeader(..) unbekannt war.
- // fuegt ggf. noch ein BYTE 0 ein damit Anzahl Bytes immer gerade.
+ // fuegt ggf. noch ein sal_uInt8 0 ein damit Anzahl Bytes immer gerade.
void WMFRecord_Arc(const Rectangle & rRect, const Point & rStartPt, const Point & rEndPt);
void WMFRecord_Chord(const Rectangle & rRect, const Point & rStartPt, const Point & rEndPt);
void WMFRecord_CreateBrushIndirect(const Color& rColor);
void WMFRecord_CreateFontIndirect(const Font & rFont);
void WMFRecord_CreatePenIndirect(const Color& rColor, const LineInfo& rLineInfo );
- void WMFRecord_DeleteObject(USHORT nObjectHandle);
+ void WMFRecord_DeleteObject(sal_uInt16 nObjectHandle);
void WMFRecord_Ellipse(const Rectangle & rRect);
void WMFRecord_Escape( sal_uInt32 nEsc, sal_uInt32 nLen, const sal_Int8* pData );
sal_Bool WMFRecord_Escape_Unicode( const Point& rPoint, const String& rStr, const sal_Int32 * pDXAry );
@@ -181,12 +181,12 @@ private:
void WMFRecord_RestoreDC();
void WMFRecord_RoundRect(const Rectangle & rRect, long nHorzRound, long nVertRound);
void WMFRecord_SaveDC();
- void WMFRecord_SelectObject(USHORT nObjectHandle);
- void WMFRecord_SetBkMode(BOOL bTransparent);
+ void WMFRecord_SelectObject(sal_uInt16 nObjectHandle);
+ void WMFRecord_SetBkMode(sal_Bool bTransparent);
void WMFRecord_SetStretchBltMode();
void WMFRecord_SetPixel(const Point & rPoint, const Color & rColor);
void WMFRecord_SetROP2(RasterOp eROP);
- void WMFRecord_SetTextAlign(FontAlign eFontAlign, UINT32 eHorTextAlign);
+ void WMFRecord_SetTextAlign(FontAlign eFontAlign, sal_uInt32 eHorTextAlign);
void WMFRecord_SetTextColor(const Color & rColor);
void WMFRecord_SetWindowExt(const Size & rSize);
void WMFRecord_SetWindowOrg(const Point & rPoint);
@@ -195,8 +195,8 @@ private:
void WMFRecord_EndOfFile();
void WMFRecord_IntersectClipRect( const Rectangle& rRect);
- USHORT AllocHandle();
- void FreeHandle(USHORT nObjectHandle);
+ sal_uInt16 AllocHandle();
+ void FreeHandle(sal_uInt16 nObjectHandle);
void CreateSelectDeletePen( const Color& rColor, const LineInfo& rLineInfo );
void CreateSelectDeleteFont(const Font & rFont);
void CreateSelectDeleteBrush(const Color& rColor);
@@ -207,7 +207,7 @@ private:
void HandleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon);
void WriteRecords(const GDIMetaFile & rMTF);
- void WriteHeader(const GDIMetaFile & rMTF, BOOL bPlaceable);
+ void WriteHeader(const GDIMetaFile & rMTF, sal_Bool bPlaceable);
void UpdateHeader();
void WriteEmbeddedEMF( const GDIMetaFile& rMTF );
@@ -217,13 +217,13 @@ private:
sal_uInt32 nRecCounts,
sal_uInt16 nCheckSum );
- USHORT CalcSaveTargetMapMode(MapMode& rMapMode, const Size& rPrefSize);
+ sal_uInt16 CalcSaveTargetMapMode(MapMode& rMapMode, const Size& rPrefSize);
public:
WMFWriter() {}
- BOOL WriteWMF(const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pFilterConfigItem, BOOL bPlaceable=TRUE);
+ sal_Bool WriteWMF(const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pFilterConfigItem, sal_Bool bPlaceable=sal_True);
};
#endif
diff --git a/svtools/source/graphic/descriptor.cxx b/svtools/source/graphic/descriptor.cxx
index c3929f5007d0..5a2ed9d9df1b 100644
--- a/svtools/source/graphic/descriptor.cxx
+++ b/svtools/source/graphic/descriptor.cxx
@@ -458,7 +458,7 @@ void GraphicDescriptor::_getPropertyValues( const comphelper::PropertyMapEntry**
case( UNOGRAPHIC_BITSPERPIXEL ):
{
- USHORT nBitsPerPixel = 0;
+ sal_uInt16 nBitsPerPixel = 0;
if( mpGraphic )
{
diff --git a/svtools/source/graphic/descriptor.hxx b/svtools/source/graphic/descriptor.hxx
index 38d0241dcd0d..2eeff29b9927 100644
--- a/svtools/source/graphic/descriptor.hxx
+++ b/svtools/source/graphic/descriptor.hxx
@@ -124,7 +124,7 @@ private:
::rtl::OUString maMimeType;
Size maSizePixel;
Size maSize100thMM;
- USHORT mnBitsPerPixel;
+ sal_uInt16 mnBitsPerPixel;
bool mbTransparent;
bool mbAlpha;
bool mbAnimated;
diff --git a/svtools/source/graphic/grfattr.cxx b/svtools/source/graphic/grfattr.cxx
index 3515ed276529..a85cd90df079 100644
--- a/svtools/source/graphic/grfattr.cxx
+++ b/svtools/source/graphic/grfattr.cxx
@@ -49,7 +49,7 @@ GraphicAttr::GraphicAttr() :
mnRPercent ( 0 ),
mnGPercent ( 0 ),
mnBPercent ( 0 ),
- mbInvert ( FALSE ),
+ mbInvert ( sal_False ),
mcTransparency ( 0 ),
meDrawMode ( GRAPHICDRAWMODE_STANDARD )
{
@@ -63,7 +63,7 @@ GraphicAttr::~GraphicAttr()
// ------------------------------------------------------------------------
-BOOL GraphicAttr::operator==( const GraphicAttr& rAttr ) const
+sal_Bool GraphicAttr::operator==( const GraphicAttr& rAttr ) const
{
return( ( mfGamma == rAttr.mfGamma ) &&
( mnMirrFlags == rAttr.mnMirrFlags ) &&
@@ -88,7 +88,7 @@ SvStream& operator>>( SvStream& rIStm, GraphicAttr& rAttr )
{
VersionCompat aCompat( rIStm, STREAM_READ );
sal_uInt32 nTmp32;
- UINT16 nTmp16;
+ sal_uInt16 nTmp16;
rIStm >> nTmp32 >> nTmp32 >> rAttr.mfGamma >> rAttr.mnMirrFlags >> rAttr.mnRotate10;
rIStm >> rAttr.mnContPercent >> rAttr.mnLumPercent >> rAttr.mnRPercent >> rAttr.mnGPercent >> rAttr.mnBPercent;
@@ -112,7 +112,7 @@ SvStream& operator<<( SvStream& rOStm, const GraphicAttr& rAttr )
rOStm << nTmp32 << nTmp32 << rAttr.mfGamma << rAttr.mnMirrFlags << rAttr.mnRotate10;
rOStm << rAttr.mnContPercent << rAttr.mnLumPercent << rAttr.mnRPercent << rAttr.mnGPercent << rAttr.mnBPercent;
- rOStm << rAttr.mbInvert << rAttr.mcTransparency << (UINT16) rAttr.meDrawMode;
+ rOStm << rAttr.mbInvert << rAttr.mcTransparency << (sal_uInt16) rAttr.meDrawMode;
rOStm << rAttr.mnLeftCrop << rAttr.mnTopCrop << rAttr.mnRightCrop << rAttr.mnBottomCrop;
return rOStm;
diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx
index 129ea5b5721e..658cf983bcb5 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -71,14 +71,14 @@ public:
GraphicID( const GraphicObject& rObj );
~GraphicID() {}
- BOOL operator==( const GraphicID& rID ) const
+ sal_Bool operator==( const GraphicID& rID ) const
{
return( rID.mnID1 == mnID1 && rID.mnID2 == mnID2 &&
rID.mnID3 == mnID3 && rID.mnID4 == mnID4 );
}
ByteString GetIDString() const;
- BOOL IsEmpty() const { return( 0 == mnID4 ); }
+ sal_Bool IsEmpty() const { return( 0 == mnID4 ); }
};
// -----------------------------------------------------------------------------
@@ -87,7 +87,7 @@ GraphicID::GraphicID( const GraphicObject& rObj )
{
const Graphic& rGraphic = rObj.GetGraphic();
- mnID1 = ( (ULONG) rGraphic.GetType() ) << 28;
+ mnID1 = ( (sal_uLong) rGraphic.GetType() ) << 28;
switch( rGraphic.GetType() )
{
@@ -106,7 +106,7 @@ GraphicID::GraphicID( const GraphicObject& rObj )
{
const BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
- mnID1 |= ( ( ( (ULONG) aBmpEx.GetTransparentType() << 8 ) | ( aBmpEx.IsAlpha() ? 1 : 0 ) ) & 0x0fffffff );
+ mnID1 |= ( ( ( (sal_uLong) aBmpEx.GetTransparentType() << 8 ) | ( aBmpEx.IsAlpha() ? 1 : 0 ) ) & 0x0fffffff );
mnID2 = aBmpEx.GetSizePixel().Width();
mnID3 = aBmpEx.GetSizePixel().Height();
mnID4 = rGraphic.GetChecksum();
@@ -168,9 +168,9 @@ private:
BitmapEx* mpBmpEx;
GDIMetaFile* mpMtf;
Animation* mpAnimation;
- BOOL mbSwappedAll;
+ sal_Bool mbSwappedAll;
- BOOL ImplInit( const GraphicObject& rObj );
+ sal_Bool ImplInit( const GraphicObject& rObj );
void ImplFillSubstitute( Graphic& rSubstitute );
public:
@@ -181,13 +181,13 @@ public:
const GraphicID& GetID() const { return maID; }
void AddGraphicObjectReference( const GraphicObject& rObj, Graphic& rSubstitute );
- BOOL ReleaseGraphicObjectReference( const GraphicObject& rObj );
- ULONG GetGraphicObjectReferenceCount() { return maGraphicObjectList.Count(); }
- BOOL HasGraphicObjectReference( const GraphicObject& rObj );
+ sal_Bool ReleaseGraphicObjectReference( const GraphicObject& rObj );
+ sal_uLong GetGraphicObjectReferenceCount() { return maGraphicObjectList.Count(); }
+ sal_Bool HasGraphicObjectReference( const GraphicObject& rObj );
void TryToSwapIn();
void GraphicObjectWasSwappedOut( const GraphicObject& rObj );
- BOOL FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute );
+ sal_Bool FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute );
void GraphicObjectWasSwappedIn( const GraphicObject& rObj );
};
@@ -216,9 +216,9 @@ GraphicCacheEntry::~GraphicCacheEntry()
// -----------------------------------------------------------------------------
-BOOL GraphicCacheEntry::ImplInit( const GraphicObject& rObj )
+sal_Bool GraphicCacheEntry::ImplInit( const GraphicObject& rObj )
{
- BOOL bRet;
+ sal_Bool bRet;
if( !rObj.IsSwappedOut() )
{
@@ -260,10 +260,10 @@ BOOL GraphicCacheEntry::ImplInit( const GraphicObject& rObj )
else
maGfxLink = GfxLink();
- bRet = TRUE;
+ bRet = sal_True;
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
@@ -277,9 +277,9 @@ void GraphicCacheEntry::ImplFillSubstitute( Graphic& rSubstitute )
const MapMode aPrefMapMode( rSubstitute.GetPrefMapMode() );
const Link aAnimationNotifyHdl( rSubstitute.GetAnimationNotifyHdl() );
const String aDocFileName( rSubstitute.GetDocFileName() );
- const ULONG nDocFilePos = rSubstitute.GetDocFilePos();
+ const sal_uLong nDocFilePos = rSubstitute.GetDocFilePos();
const GraphicType eOldType = rSubstitute.GetType();
- const BOOL bDefaultType = ( rSubstitute.GetType() == GRAPHIC_DEFAULT );
+ const sal_Bool bDefaultType = ( rSubstitute.GetType() == GRAPHIC_DEFAULT );
if( rSubstitute.IsLink() && ( GFX_LINK_TYPE_NONE == maGfxLink.GetType() ) )
maGfxLink = rSubstitute.GetLink();
@@ -321,16 +321,16 @@ void GraphicCacheEntry::AddGraphicObjectReference( const GraphicObject& rObj, Gr
// -----------------------------------------------------------------------------
-BOOL GraphicCacheEntry::ReleaseGraphicObjectReference( const GraphicObject& rObj )
+sal_Bool GraphicCacheEntry::ReleaseGraphicObjectReference( const GraphicObject& rObj )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
for( void* pObj = maGraphicObjectList.First(); !bRet && pObj; pObj = maGraphicObjectList.Next() )
{
if( &rObj == (GraphicObject*) pObj )
{
maGraphicObjectList.Remove( pObj );
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -339,13 +339,13 @@ BOOL GraphicCacheEntry::ReleaseGraphicObjectReference( const GraphicObject& rObj
// -----------------------------------------------------------------------------
-BOOL GraphicCacheEntry::HasGraphicObjectReference( const GraphicObject& rObj )
+sal_Bool GraphicCacheEntry::HasGraphicObjectReference( const GraphicObject& rObj )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
for( void* pObj = maGraphicObjectList.First(); !bRet && pObj; pObj = maGraphicObjectList.Next() )
if( &rObj == (GraphicObject*) pObj )
- bRet = TRUE;
+ bRet = sal_True;
return bRet;
}
@@ -362,11 +362,11 @@ void GraphicCacheEntry::TryToSwapIn()
void GraphicCacheEntry::GraphicObjectWasSwappedOut( const GraphicObject& /*rObj*/ )
{
- mbSwappedAll = TRUE;
+ mbSwappedAll = sal_True;
for( void* pObj = maGraphicObjectList.First(); mbSwappedAll && pObj; pObj = maGraphicObjectList.Next() )
if( !( (GraphicObject*) pObj )->IsSwappedOut() )
- mbSwappedAll = FALSE;
+ mbSwappedAll = sal_False;
if( mbSwappedAll )
{
@@ -378,17 +378,17 @@ void GraphicCacheEntry::GraphicObjectWasSwappedOut( const GraphicObject& /*rObj*
// -----------------------------------------------------------------------------
-BOOL GraphicCacheEntry::FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute )
+sal_Bool GraphicCacheEntry::FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute )
{
- BOOL bRet;
+ sal_Bool bRet;
if( !mbSwappedAll && rObj.IsSwappedOut() )
{
ImplFillSubstitute( rSubstitute );
- bRet = TRUE;
+ bRet = sal_True;
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
@@ -415,13 +415,13 @@ private:
BitmapEx* mpBmpEx;
GraphicAttr maAttr;
Size maOutSizePix;
- ULONG mnCacheSize;
- ULONG mnOutDevDrawMode;
- USHORT mnOutDevBitCount;
+ sal_uLong mnCacheSize;
+ sal_uLong mnOutDevDrawMode;
+ sal_uInt16 mnOutDevBitCount;
public:
- static ULONG GetNeededSize( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ static sal_uLong GetNeededSize( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr );
public:
@@ -457,15 +457,15 @@ public:
const GraphicAttr& GetAttr() const { return maAttr; }
const Size& GetOutputSizePixel() const { return maOutSizePix; }
- ULONG GetCacheSize() const { return mnCacheSize; }
+ sal_uLong GetCacheSize() const { return mnCacheSize; }
const GraphicCacheEntry* GetReferencedCacheEntry() const { return mpRefCacheEntry; }
- ULONG GetOutDevDrawMode() const { return mnOutDevDrawMode; }
- USHORT GetOutDevBitCount() const { return mnOutDevBitCount; }
+ sal_uLong GetOutDevDrawMode() const { return mnOutDevDrawMode; }
+ sal_uInt16 GetOutDevBitCount() const { return mnOutDevBitCount; }
void SetReleaseTime( const ::salhelper::TTimeValue& rReleaseTime ) { maReleaseTime = rReleaseTime; }
const ::salhelper::TTimeValue& GetReleaseTime() const { return maReleaseTime; }
- BOOL Matches( OutputDevice* pOut, const Point& /*rPtPixel*/, const Size& rSzPixel,
+ sal_Bool Matches( OutputDevice* pOut, const Point& /*rPtPixel*/, const Size& rSzPixel,
const GraphicCacheEntry* pCacheEntry, const GraphicAttr& rAttr ) const
{
// #i46805# Additional match
@@ -486,12 +486,12 @@ public:
// -----------------------------------------------------------------------------
-ULONG GraphicDisplayCacheEntry::GetNeededSize( OutputDevice* pOut, const Point& /*rPt*/, const Size& rSz,
+sal_uLong GraphicDisplayCacheEntry::GetNeededSize( OutputDevice* pOut, const Point& /*rPt*/, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr )
{
const Graphic& rGraphic = rObj.GetGraphic();
const GraphicType eType = rGraphic.GetType();
- ULONG nNeededSize;
+ sal_uLong nNeededSize;
if( GRAPHIC_BITMAP == eType )
{
@@ -560,7 +560,7 @@ void GraphicDisplayCacheEntry::Draw( OutputDevice* pOut, const Point& rPt, const
// - GraphicCache -
// -----------------------
-GraphicCache::GraphicCache( GraphicManager& rMgr, ULONG nDisplayCacheSize, ULONG nMaxObjDisplayCacheSize ) :
+GraphicCache::GraphicCache( GraphicManager& rMgr, sal_uLong nDisplayCacheSize, sal_uLong nMaxObjDisplayCacheSize ) :
mrMgr ( rMgr ),
mnReleaseTimeoutSeconds ( 0UL ),
mnMaxDisplaySize ( nDisplayCacheSize ),
@@ -585,7 +585,7 @@ GraphicCache::~GraphicCache()
void GraphicCache::AddGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute,
const ByteString* pID, const GraphicObject* pCopyObj )
{
- BOOL bInserted = FALSE;
+ sal_Bool bInserted = sal_False;
if( !rObj.IsSwappedOut() &&
( pID || ( pCopyObj && ( pCopyObj->GetType() != GRAPHIC_NONE ) ) || ( rObj.GetType() != GRAPHIC_NONE ) ) )
@@ -599,7 +599,7 @@ void GraphicCache::AddGraphicObject( const GraphicObject& rObj, Graphic& rSubsti
if( pEntry->HasGraphicObjectReference( *pCopyObj ) )
{
pEntry->AddGraphicObjectReference( rObj, rSubstitute );
- bInserted = TRUE;
+ bInserted = sal_True;
}
else
{
@@ -640,14 +640,14 @@ void GraphicCache::AddGraphicObject( const GraphicObject& rObj, Graphic& rSubsti
if( rID.GetIDString() == *pID )
{
pEntry->AddGraphicObjectReference( rObj, rSubstitute );
- bInserted = TRUE;
+ bInserted = sal_True;
}
}
if( !bInserted )
{
maGraphicCache.Insert( new GraphicCacheEntry( rObj ), LIST_APPEND );
- bInserted = TRUE;
+ bInserted = sal_True;
}
}
}
@@ -656,7 +656,7 @@ void GraphicCache::AddGraphicObject( const GraphicObject& rObj, Graphic& rSubsti
if( rEntryID == *apID )
{
pEntry->AddGraphicObjectReference( rObj, rSubstitute );
- bInserted = TRUE;
+ bInserted = sal_True;
}
}
@@ -676,7 +676,7 @@ void GraphicCache::ReleaseGraphicObject( const GraphicObject& rObj )
{
// Release cached object
GraphicCacheEntry* pEntry = (GraphicCacheEntry*) maGraphicCache.First();
- BOOL bRemoved = FALSE;
+ sal_Bool bRemoved = sal_False;
while( !bRemoved && pEntry )
{
@@ -729,12 +729,12 @@ void GraphicCache::GraphicObjectWasSwappedOut( const GraphicObject& rObj )
// -----------------------------------------------------------------------------
-BOOL GraphicCache::FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute )
+sal_Bool GraphicCache::FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute )
{
GraphicCacheEntry* pEntry = ImplGetCacheEntry( rObj );
if( !pEntry )
- return FALSE;
+ return sal_False;
return pEntry->FillSwappedGraphicObject( rObj, rSubstitute );
}
@@ -759,7 +759,7 @@ void GraphicCache::GraphicObjectWasSwappedIn( const GraphicObject& rObj )
// -----------------------------------------------------------------------------
-void GraphicCache::SetMaxDisplayCacheSize( ULONG nNewCacheSize )
+void GraphicCache::SetMaxDisplayCacheSize( sal_uLong nNewCacheSize )
{
mnMaxDisplaySize = nNewCacheSize;
@@ -769,9 +769,9 @@ void GraphicCache::SetMaxDisplayCacheSize( ULONG nNewCacheSize )
// -----------------------------------------------------------------------------
-void GraphicCache::SetMaxObjDisplayCacheSize( ULONG nNewMaxObjSize, BOOL bDestroyGreaterCached )
+void GraphicCache::SetMaxObjDisplayCacheSize( sal_uLong nNewMaxObjSize, sal_Bool bDestroyGreaterCached )
{
- const BOOL bDestroy = ( bDestroyGreaterCached && ( nNewMaxObjSize < mnMaxObjDisplaySize ) );
+ const sal_Bool bDestroy = ( bDestroyGreaterCached && ( nNewMaxObjSize < mnMaxObjDisplaySize ) );
mnMaxObjDisplaySize = Min( nNewMaxObjSize, mnMaxDisplaySize );
@@ -796,7 +796,7 @@ void GraphicCache::SetMaxObjDisplayCacheSize( ULONG nNewMaxObjSize, BOOL bDestro
// -----------------------------------------------------------------------------
-void GraphicCache::SetCacheTimeout( ULONG nTimeoutSeconds )
+void GraphicCache::SetCacheTimeout( sal_uLong nTimeoutSeconds )
{
if( mnReleaseTimeoutSeconds != nTimeoutSeconds )
{
@@ -830,7 +830,7 @@ void GraphicCache::ClearDisplayCache()
// -----------------------------------------------------------------------------
-BOOL GraphicCache::IsDisplayCacheable( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+sal_Bool GraphicCache::IsDisplayCacheable( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr ) const
{
return( GraphicDisplayCacheEntry::GetNeededSize( pOut, rPt, rSz, rObj, rAttr ) <=
@@ -839,20 +839,20 @@ BOOL GraphicCache::IsDisplayCacheable( OutputDevice* pOut, const Point& rPt, con
// -----------------------------------------------------------------------------
-BOOL GraphicCache::IsInDisplayCache( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+sal_Bool GraphicCache::IsInDisplayCache( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr ) const
{
const Point aPtPixel( pOut->LogicToPixel( rPt ) );
const Size aSzPixel( pOut->LogicToPixel( rSz ) );
const GraphicCacheEntry* pCacheEntry = ( (GraphicCache*) this )->ImplGetCacheEntry( rObj );
//GraphicDisplayCacheEntry* pDisplayEntry = (GraphicDisplayCacheEntry*) ( (GraphicCache*) this )->maDisplayCache.First(); // -Wall removed ....
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
if( pCacheEntry )
{
for( long i = 0, nCount = maDisplayCache.Count(); !bFound && ( i < nCount ); i++ )
if( ( (GraphicDisplayCacheEntry*) maDisplayCache.GetObject( i ) )->Matches( pOut, aPtPixel, aSzPixel, pCacheEntry, rAttr ) )
- bFound = TRUE;
+ bFound = sal_True;
}
return bFound;
@@ -880,12 +880,12 @@ ByteString GraphicCache::GetUniqueID( const GraphicObject& rObj ) const
// -----------------------------------------------------------------------------
-BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+sal_Bool GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr,
const BitmapEx& rBmpEx )
{
- const ULONG nNeededSize = GraphicDisplayCacheEntry::GetNeededSize( pOut, rPt, rSz, rObj, rAttr );
- BOOL bRet = FALSE;
+ const sal_uLong nNeededSize = GraphicDisplayCacheEntry::GetNeededSize( pOut, rPt, rSz, rObj, rAttr );
+ sal_Bool bRet = sal_False;
if( nNeededSize <= GetMaxObjDisplayCacheSize() )
{
@@ -906,7 +906,7 @@ BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt,
maDisplayCache.Insert( pNewEntry, LIST_APPEND );
mnUsedDisplaySize += pNewEntry->GetCacheSize();
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -914,12 +914,12 @@ BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt,
// -----------------------------------------------------------------------------
-BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+sal_Bool GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr,
const GDIMetaFile& rMtf )
{
- const ULONG nNeededSize = GraphicDisplayCacheEntry::GetNeededSize( pOut, rPt, rSz, rObj, rAttr );
- BOOL bRet = FALSE;
+ const sal_uLong nNeededSize = GraphicDisplayCacheEntry::GetNeededSize( pOut, rPt, rSz, rObj, rAttr );
+ sal_Bool bRet = sal_False;
if( nNeededSize <= GetMaxObjDisplayCacheSize() )
{
@@ -940,7 +940,7 @@ BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt,
maDisplayCache.Insert( pNewEntry, LIST_APPEND );
mnUsedDisplaySize += pNewEntry->GetCacheSize();
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -948,14 +948,14 @@ BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt,
// -----------------------------------------------------------------------------
-BOOL GraphicCache::DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+sal_Bool GraphicCache::DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr )
{
const Point aPtPixel( pOut->LogicToPixel( rPt ) );
const Size aSzPixel( pOut->LogicToPixel( rSz ) );
const GraphicCacheEntry* pCacheEntry = ImplGetCacheEntry( rObj );
GraphicDisplayCacheEntry* pDisplayCacheEntry = (GraphicDisplayCacheEntry*) maDisplayCache.First();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
while( !bRet && pDisplayCacheEntry )
{
@@ -973,7 +973,7 @@ BOOL GraphicCache::DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, co
}
pDisplayCacheEntry->SetReleaseTime( aReleaseTime );
- bRet = TRUE;
+ bRet = sal_True;
}
else
pDisplayCacheEntry = (GraphicDisplayCacheEntry*) maDisplayCache.Next();
@@ -987,9 +987,9 @@ BOOL GraphicCache::DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, co
// -----------------------------------------------------------------------------
-BOOL GraphicCache::ImplFreeDisplayCacheSpace( ULONG nSizeToFree )
+sal_Bool GraphicCache::ImplFreeDisplayCacheSpace( sal_uLong nSizeToFree )
{
- ULONG nFreedSize = 0UL;
+ sal_uLong nFreedSize = 0UL;
if( nSizeToFree )
{
diff --git a/svtools/source/graphic/grfcache.hxx b/svtools/source/graphic/grfcache.hxx
index a2b7593d159b..cfa946f6bca9 100644
--- a/svtools/source/graphic/grfcache.hxx
+++ b/svtools/source/graphic/grfcache.hxx
@@ -47,12 +47,12 @@ private:
Timer maReleaseTimer;
List maGraphicCache;
List maDisplayCache;
- ULONG mnReleaseTimeoutSeconds;
- ULONG mnMaxDisplaySize;
- ULONG mnMaxObjDisplaySize;
- ULONG mnUsedDisplaySize;
+ sal_uLong mnReleaseTimeoutSeconds;
+ sal_uLong mnMaxDisplaySize;
+ sal_uLong mnMaxObjDisplaySize;
+ sal_uLong mnUsedDisplaySize;
- BOOL ImplFreeDisplayCacheSpace( ULONG nSizeToFree );
+ sal_Bool ImplFreeDisplayCacheSpace( sal_uLong nSizeToFree );
GraphicCacheEntry* ImplGetCacheEntry( const GraphicObject& rObj );
@@ -61,8 +61,8 @@ private:
public:
GraphicCache( GraphicManager& rMgr,
- ULONG nDisplayCacheSize = 10000000UL,
- ULONG nMaxObjDisplayCacheSize = 2400000UL );
+ sal_uLong nDisplayCacheSize = 10000000UL,
+ sal_uLong nMaxObjDisplayCacheSize = 2400000UL );
~GraphicCache();
public:
@@ -72,37 +72,37 @@ public:
void ReleaseGraphicObject( const GraphicObject& rObj );
void GraphicObjectWasSwappedOut( const GraphicObject& rObj );
- BOOL FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute );
+ sal_Bool FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute );
void GraphicObjectWasSwappedIn( const GraphicObject& rObj );
ByteString GetUniqueID( const GraphicObject& rObj ) const;
public:
- void SetMaxDisplayCacheSize( ULONG nNewCacheSize );
- ULONG GetMaxDisplayCacheSize() const { return mnMaxDisplaySize; };
+ void SetMaxDisplayCacheSize( sal_uLong nNewCacheSize );
+ sal_uLong GetMaxDisplayCacheSize() const { return mnMaxDisplaySize; };
- void SetMaxObjDisplayCacheSize( ULONG nNewMaxObjSize, BOOL bDestroyGreaterCached = FALSE );
- ULONG GetMaxObjDisplayCacheSize() const { return mnMaxObjDisplaySize; }
+ void SetMaxObjDisplayCacheSize( sal_uLong nNewMaxObjSize, sal_Bool bDestroyGreaterCached = sal_False );
+ sal_uLong GetMaxObjDisplayCacheSize() const { return mnMaxObjDisplaySize; }
- ULONG GetUsedDisplayCacheSize() const { return mnUsedDisplaySize; }
- ULONG GetFreeDisplayCacheSize() const { return( mnMaxDisplaySize - mnUsedDisplaySize ); }
+ sal_uLong GetUsedDisplayCacheSize() const { return mnUsedDisplaySize; }
+ sal_uLong GetFreeDisplayCacheSize() const { return( mnMaxDisplaySize - mnUsedDisplaySize ); }
- void SetCacheTimeout( ULONG nTimeoutSeconds );
- ULONG GetCacheTimeout() const { return mnReleaseTimeoutSeconds; }
+ void SetCacheTimeout( sal_uLong nTimeoutSeconds );
+ sal_uLong GetCacheTimeout() const { return mnReleaseTimeoutSeconds; }
void ClearDisplayCache();
- BOOL IsDisplayCacheable( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ sal_Bool IsDisplayCacheable( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr ) const;
- BOOL IsInDisplayCache( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ sal_Bool IsInDisplayCache( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr ) const;
- BOOL CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ sal_Bool CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr,
const BitmapEx& rBmpEx );
- BOOL CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ sal_Bool CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr,
const GDIMetaFile& rMtf );
- BOOL DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ sal_Bool DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr );
};
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index 303da056933e..9e7d635b9731 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -143,9 +143,9 @@ void GraphicObject::ImplConstruct()
mpSwapOutTimer = NULL;
mpSimpleCache = NULL;
mnAnimationLoopCount = 0;
- mbAutoSwapped = FALSE;
- mbIsInSwapIn = FALSE;
- mbIsInSwapOut = FALSE;
+ mbAutoSwapped = sal_False;
+ mbIsInSwapIn = sal_False;
+ mbIsInSwapOut = sal_False;
}
void GraphicObject::ImplAssignGraphicData()
@@ -165,7 +165,7 @@ void GraphicObject::ImplAssignGraphicData()
mbEPS = ( rMtf.GetActionCount() >= 1 ) && ( META_EPS_ACTION == rMtf.GetAction( 0 )->GetType() );
}
else
- mbEPS = FALSE;
+ mbEPS = sal_False;
}
void GraphicObject::ImplSetGraphicManager( const GraphicManager* pMgr, const ByteString* pID, const GraphicObject* pCopyObj )
@@ -210,13 +210,13 @@ void GraphicObject::ImplAutoSwapIn()
if( IsSwappedOut() )
{
if( mpMgr && mpMgr->ImplFillSwappedGraphicObject( *this, maGraphic ) )
- mbAutoSwapped = FALSE;
+ mbAutoSwapped = sal_False;
else
{
- mbIsInSwapIn = TRUE;
+ mbIsInSwapIn = sal_True;
if( maGraphic.SwapIn() )
- mbAutoSwapped = FALSE;
+ mbAutoSwapped = sal_False;
else
{
SvStream* pStream = GetSwapStream();
@@ -259,7 +259,7 @@ void GraphicObject::ImplAutoSwapIn()
}
}
- mbIsInSwapIn = FALSE;
+ mbIsInSwapIn = sal_False;
if( !mbAutoSwapped && mpMgr )
mpMgr->ImplGraphicObjectWasSwappedIn( *this );
@@ -267,15 +267,15 @@ void GraphicObject::ImplAutoSwapIn()
}
}
-BOOL GraphicObject::ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz, const GraphicAttr* pAttr,
- PolyPolygon& rClipPolyPoly, BOOL& bRectClipRegion ) const
+sal_Bool GraphicObject::ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz, const GraphicAttr* pAttr,
+ PolyPolygon& rClipPolyPoly, sal_Bool& bRectClipRegion ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( GetType() != GRAPHIC_NONE )
{
Polygon aClipPoly( Rectangle( rPt, rSz ) );
- const USHORT nRot10 = pAttr->GetRotation() % 3600;
+ const sal_uInt16 nRot10 = pAttr->GetRotation() % 3600;
const Point aOldOrigin( rPt );
const MapMode aMap100( MAP_100TH_MM );
Size aSize100;
@@ -286,10 +286,10 @@ BOOL GraphicObject::ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz
if( nRot10 )
{
aClipPoly.Rotate( rPt, nRot10 );
- bRectClipRegion = FALSE;
+ bRectClipRegion = sal_False;
}
else
- bRectClipRegion = TRUE;
+ bRectClipRegion = sal_True;
rClipPolyPoly = aClipPoly;
@@ -332,7 +332,7 @@ BOOL GraphicObject::ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz
rPt = aOriginPoly[ 0 ];
}
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -355,7 +355,7 @@ GraphicObject& GraphicObject::operator=( const GraphicObject& rGraphicObj )
mpLink = rGraphicObj.mpLink ? new String( *rGraphicObj.mpLink ) : NULL;
mpUserData = rGraphicObj.mpUserData ? new String( *rGraphicObj.mpUserData ) : NULL;
ImplAssignGraphicData();
- mbAutoSwapped = FALSE;
+ mbAutoSwapped = sal_False;
mpMgr = rGraphicObj.mpMgr;
mpMgr->ImplRegisterObj( *this, maGraphic, NULL, &rGraphicObj );
@@ -364,7 +364,7 @@ GraphicObject& GraphicObject::operator=( const GraphicObject& rGraphicObj )
return *this;
}
-BOOL GraphicObject::operator==( const GraphicObject& rGraphicObj ) const
+sal_Bool GraphicObject::operator==( const GraphicObject& rGraphicObj ) const
{
return( ( rGraphicObj.maGraphic == maGraphic ) &&
( rGraphicObj.maAttr == maAttr ) &&
@@ -399,7 +399,7 @@ ByteString GraphicObject::GetUniqueID() const
return aRet;
}
-ULONG GraphicObject::GetChecksum() const
+sal_uLong GraphicObject::GetChecksum() const
{
return( ( maGraphic.IsSupportedGraphic() && !maGraphic.IsSwapOut() ) ? maGraphic.GetChecksum() : 0 );
}
@@ -410,7 +410,7 @@ SvStream* GraphicObject::GetSwapStream() const
}
// !!! to be removed
-ULONG GraphicObject::GetReleaseFromCache() const
+sal_uLong GraphicObject::GetReleaseFromCache() const
{
return 0;
}
@@ -470,7 +470,7 @@ void GraphicObject::SetSwapStreamHdl()
}
}
-void GraphicObject::SetSwapStreamHdl( const Link& rHdl, const ULONG nSwapOutTimeout )
+void GraphicObject::SetSwapStreamHdl( const Link& rHdl, const sal_uLong nSwapOutTimeout )
{
delete mpSwapStreamHdl, mpSwapStreamHdl = new Link( rHdl );
@@ -519,10 +519,10 @@ void GraphicObject::SetGraphicManager( const GraphicManager& rMgr )
ImplSetGraphicManager( &rMgr );
}
-BOOL GraphicObject::IsCached( OutputDevice* pOut, const Point& rPt, const Size& rSz,
- const GraphicAttr* pAttr, ULONG nFlags ) const
+sal_Bool GraphicObject::IsCached( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ const GraphicAttr* pAttr, sal_uLong nFlags ) const
{
- BOOL bRet;
+ sal_Bool bRet;
if( nFlags & GRFMGR_DRAW_CACHED )
{
@@ -531,13 +531,13 @@ BOOL GraphicObject::IsCached( OutputDevice* pOut, const Point& rPt, const Size&
if ( pAttr->IsCropped() )
{
PolyPolygon aClipPolyPoly;
- BOOL bRectClip;
+ sal_Bool bRectClip;
ImplGetCropParams( pOut, aPt, aSz, pAttr, aClipPolyPoly, bRectClip );
}
bRet = mpMgr->IsInCache( pOut, aPt, aSz, *this, ( pAttr ? *pAttr : GetAttr() ) );
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
@@ -558,16 +558,16 @@ List* GraphicObject::GetAnimationInfoList() const
return maGraphic.GetAnimationInfoList();
}
-BOOL GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
- const GraphicAttr* pAttr, ULONG nFlags )
+sal_Bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ const GraphicAttr* pAttr, sal_uLong nFlags )
{
GraphicAttr aAttr( pAttr ? *pAttr : GetAttr() );
Point aPt( rPt );
Size aSz( rSz );
const sal_uInt32 nOldDrawMode = pOut->GetDrawMode();
- BOOL bCropped = aAttr.IsCropped();
- BOOL bCached = FALSE;
- BOOL bRet;
+ sal_Bool bCropped = aAttr.IsCropped();
+ sal_Bool bCached = sal_False;
+ sal_Bool bRet;
// #i29534# Provide output rects for PDF writer
Rectangle aCropRect;
@@ -594,8 +594,8 @@ BOOL GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
if( bCropped )
{
PolyPolygon aClipPolyPoly;
- BOOL bRectClip;
- const BOOL bCrop = ImplGetCropParams( pOut, aPt, aSz, &aAttr, aClipPolyPoly, bRectClip );
+ sal_Bool bRectClip;
+ const sal_Bool bCrop = ImplGetCropParams( pOut, aPt, aSz, &aAttr, aClipPolyPoly, bRectClip );
pOut->Push( PUSH_CLIPREGION );
@@ -636,10 +636,10 @@ BOOL GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
}
// #i105243#
-BOOL GraphicObject::DrawWithPDFHandling( OutputDevice& rOutDev,
+sal_Bool GraphicObject::DrawWithPDFHandling( OutputDevice& rOutDev,
const Point& rPt, const Size& rSz,
const GraphicAttr* pGrfAttr,
- const ULONG nFlags )
+ const sal_uLong nFlags )
{
const GraphicAttr aGrfAttr( pGrfAttr ? *pGrfAttr : GetAttr() );
@@ -666,8 +666,8 @@ BOOL GraphicObject::DrawWithPDFHandling( OutputDevice& rOutDev,
if( aGrfAttr.IsCropped() )
{
PolyPolygon aClipPolyPoly;
- BOOL bRectClip;
- const BOOL bCrop = ImplGetCropParams( &rOutDev,
+ sal_Bool bRectClip;
+ const sal_Bool bCrop = ImplGetCropParams( &rOutDev,
aPt, aSz,
&aGrfAttr,
aClipPolyPoly,
@@ -682,7 +682,7 @@ BOOL GraphicObject::DrawWithPDFHandling( OutputDevice& rOutDev,
}
}
- BOOL bRet = Draw( &rOutDev, rPt, rSz, &aGrfAttr, nFlags );
+ sal_Bool bRet = Draw( &rOutDev, rPt, rSz, &aGrfAttr, nFlags );
// Notify PDF writer about linked graphic (if any)
if( bWritingPdfLinkedGraphic )
@@ -696,11 +696,11 @@ BOOL GraphicObject::DrawWithPDFHandling( OutputDevice& rOutDev,
return bRet;
}
-BOOL GraphicObject::DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSize,
- const Size& rOffset, const GraphicAttr* pAttr, ULONG nFlags, int nTileCacheSize1D )
+sal_Bool GraphicObject::DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSize,
+ const Size& rOffset, const GraphicAttr* pAttr, sal_uLong nFlags, int nTileCacheSize1D )
{
if( pOut == NULL || rSize.Width() == 0 || rSize.Height() == 0 )
- return FALSE;
+ return sal_False;
const MapMode aOutMapMode( pOut->GetMapMode() );
const MapMode aMapMode( aOutMapMode.GetMapUnit(), Point(), aOutMapMode.GetScaleX(), aOutMapMode.GetScaleY() );
@@ -718,11 +718,11 @@ BOOL GraphicObject::DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const
return ImplDrawTiled( pOut, rArea, aOutTileSize, rOffset, pAttr, nFlags, nTileCacheSize1D );
}
-BOOL GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const Size& rSz,
- long nExtraData, const GraphicAttr* pAttr, ULONG /*nFlags*/,
+sal_Bool GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ long nExtraData, const GraphicAttr* pAttr, sal_uLong /*nFlags*/,
OutputDevice* pFirstFrameOutDev )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
GetGraphic();
@@ -734,13 +734,13 @@ BOOL GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const
{
Point aPt( rPt );
Size aSz( rSz );
- BOOL bCropped = aAttr.IsCropped();
+ sal_Bool bCropped = aAttr.IsCropped();
if( bCropped )
{
PolyPolygon aClipPolyPoly;
- BOOL bRectClip;
- const BOOL bCrop = ImplGetCropParams( pOut, aPt, aSz, &aAttr, aClipPolyPoly, bRectClip );
+ sal_Bool bRectClip;
+ const sal_Bool bCrop = ImplGetCropParams( pOut, aPt, aSz, &aAttr, aClipPolyPoly, bRectClip );
pOut->Push( PUSH_CLIPREGION );
@@ -767,7 +767,7 @@ BOOL GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const
if( bCropped )
pOut->Pop();
- bRet = TRUE;
+ bRet = sal_True;
}
else
bRet = Draw( pOut, rPt, rSz, &aAttr, GRFMGR_DRAW_STANDARD );
@@ -798,7 +798,7 @@ void GraphicObject::SetGraphic( const Graphic& rGraphic, const GraphicObject* pC
mpSwapOutTimer->Stop();
maGraphic = rGraphic;
- mbAutoSwapped = FALSE;
+ mbAutoSwapped = sal_False;
ImplAssignGraphicData();
delete mpLink, mpLink = NULL;
delete mpSimpleCache, mpSimpleCache = NULL;
@@ -920,7 +920,7 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo
// #105641# Also crop animations
if( aTransGraphic.IsAnimated() )
{
- USHORT nFrame;
+ sal_uInt16 nFrame;
Animation aAnim( aTransGraphic.GetAnimation() );
for( nFrame=0; nFrame<aAnim.Count(); ++nFrame )
@@ -937,7 +937,7 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo
// cropping affects this frame, apply it then
// do _not_ apply enlargement, this is done below
ImplTransformBitmap( aAnimBmp.aBmpEx, rAttr, Size(), Size(),
- aCropRectRel, rDestSize, FALSE );
+ aCropRectRel, rDestSize, sal_False );
aAnim.Replace( aAnimBmp, nFrame );
}
@@ -984,7 +984,7 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo
BitmapEx aBmpEx( aTransGraphic.GetBitmapEx() );
ImplTransformBitmap( aBmpEx, rAttr, aCropLeftTop, aCropRightBottom,
- aCropRect, rDestSize, TRUE );
+ aCropRect, rDestSize, sal_True );
aTransGraphic = aBmpEx;
}
@@ -1060,9 +1060,9 @@ void GraphicObject::ResetAnimationLoopCount()
}
}
-BOOL GraphicObject::SwapOut()
+sal_Bool GraphicObject::SwapOut()
{
- BOOL bRet = ( !mbAutoSwapped ? maGraphic.SwapOut() : FALSE );
+ sal_Bool bRet = ( !mbAutoSwapped ? maGraphic.SwapOut() : sal_False );
if( bRet && mpMgr )
mpMgr->ImplGraphicObjectWasSwappedOut( *this );
@@ -1070,9 +1070,9 @@ BOOL GraphicObject::SwapOut()
return bRet;
}
-BOOL GraphicObject::SwapOut( SvStream* pOStm )
+sal_Bool GraphicObject::SwapOut( SvStream* pOStm )
{
- BOOL bRet = ( !mbAutoSwapped ? maGraphic.SwapOut( pOStm ) : FALSE );
+ sal_Bool bRet = ( !mbAutoSwapped ? maGraphic.SwapOut( pOStm ) : sal_False );
if( bRet && mpMgr )
mpMgr->ImplGraphicObjectWasSwappedOut( *this );
@@ -1080,17 +1080,17 @@ BOOL GraphicObject::SwapOut( SvStream* pOStm )
return bRet;
}
-BOOL GraphicObject::SwapIn()
+sal_Bool GraphicObject::SwapIn()
{
- BOOL bRet;
+ sal_Bool bRet;
if( mbAutoSwapped )
{
ImplAutoSwapIn();
- bRet = TRUE;
+ bRet = sal_True;
}
else if( mpMgr && mpMgr->ImplFillSwappedGraphicObject( *this, maGraphic ) )
- bRet = TRUE;
+ bRet = sal_True;
else
{
bRet = maGraphic.SwapIn();
@@ -1105,17 +1105,17 @@ BOOL GraphicObject::SwapIn()
return bRet;
}
-BOOL GraphicObject::SwapIn( SvStream* pIStm )
+sal_Bool GraphicObject::SwapIn( SvStream* pIStm )
{
- BOOL bRet;
+ sal_Bool bRet;
if( mbAutoSwapped )
{
ImplAutoSwapIn();
- bRet = TRUE;
+ bRet = sal_True;
}
else if( mpMgr && mpMgr->ImplFillSwappedGraphicObject( *this, maGraphic ) )
- bRet = TRUE;
+ bRet = sal_True;
else
{
bRet = maGraphic.SwapIn( pIStm );
@@ -1134,7 +1134,7 @@ void GraphicObject::SetSwapState()
{
if( !IsSwappedOut() )
{
- mbAutoSwapped = TRUE;
+ mbAutoSwapped = sal_True;
if( mpMgr )
mpMgr->ImplGraphicObjectWasSwappedOut( *this );
@@ -1145,7 +1145,7 @@ IMPL_LINK( GraphicObject, ImplAutoSwapOutHdl, void*, EMPTYARG )
{
if( !IsSwappedOut() )
{
- mbIsInSwapOut = TRUE;
+ mbIsInSwapOut = sal_True;
SvStream* pStream = GetSwapStream();
@@ -1165,7 +1165,7 @@ IMPL_LINK( GraphicObject, ImplAutoSwapOutHdl, void*, EMPTYARG )
}
}
- mbIsInSwapOut = FALSE;
+ mbIsInSwapOut = sal_False;
}
if( mpSwapOutTimer )
@@ -1180,7 +1180,7 @@ SvStream& operator>>( SvStream& rIStm, GraphicObject& rGraphicObj )
Graphic aGraphic;
GraphicAttr aAttr;
ByteString aLink;
- BOOL bLink;
+ sal_Bool bLink;
rIStm >> aGraphic >> aAttr >> bLink;
@@ -1203,7 +1203,7 @@ SvStream& operator>>( SvStream& rIStm, GraphicObject& rGraphicObj )
SvStream& operator<<( SvStream& rOStm, const GraphicObject& rGraphicObj )
{
VersionCompat aCompat( rOStm, STREAM_WRITE, 1 );
- const BOOL bLink = rGraphicObj.HasLink();
+ const sal_Bool bLink = rGraphicObj.HasLink();
rOStm << rGraphicObj.GetGraphic() << rGraphicObj.GetAttr() << bLink;
diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx
index 51aada3e5cc5..dc21aba0c216 100644
--- a/svtools/source/graphic/grfmgr2.cxx
+++ b/svtools/source/graphic/grfmgr2.cxx
@@ -47,7 +47,7 @@
// -----------
#define MAX_PRINTER_EXT 1024
-#define MAP( cVal0, cVal1, nFrac ) ((BYTE)((((long)(cVal0)<<20L)+nFrac*((long)(cVal1)-(cVal0)))>>20L))
+#define MAP( cVal0, cVal1, nFrac ) ((sal_uInt8)((((long)(cVal0)<<20L)+nFrac*((long)(cVal1)-(cVal0)))>>20L))
#define WATERMARK_LUM_OFFSET 50
#define WATERMARK_CON_OFFSET -70
@@ -113,7 +113,7 @@ BitmapEx muckWithBitmap( const BitmapEx& rBmpEx,
// - GraphicManager -
// ------------------
-GraphicManager::GraphicManager( ULONG nCacheSize, ULONG nMaxObjCacheSize ) :
+GraphicManager::GraphicManager( sal_uLong nCacheSize, sal_uLong nMaxObjCacheSize ) :
mpCache( new GraphicCache( *this, nCacheSize, nMaxObjCacheSize ) )
{
}
@@ -130,56 +130,56 @@ GraphicManager::~GraphicManager()
// -----------------------------------------------------------------------------
-void GraphicManager::SetMaxCacheSize( ULONG nNewCacheSize )
+void GraphicManager::SetMaxCacheSize( sal_uLong nNewCacheSize )
{
mpCache->SetMaxDisplayCacheSize( nNewCacheSize );
}
// -----------------------------------------------------------------------------
-ULONG GraphicManager::GetMaxCacheSize() const
+sal_uLong GraphicManager::GetMaxCacheSize() const
{
return mpCache->GetMaxDisplayCacheSize();
}
// -----------------------------------------------------------------------------
-void GraphicManager::SetMaxObjCacheSize( ULONG nNewMaxObjSize, BOOL bDestroyGreaterCached )
+void GraphicManager::SetMaxObjCacheSize( sal_uLong nNewMaxObjSize, sal_Bool bDestroyGreaterCached )
{
mpCache->SetMaxObjDisplayCacheSize( nNewMaxObjSize, bDestroyGreaterCached );
}
// -----------------------------------------------------------------------------
-ULONG GraphicManager::GetMaxObjCacheSize() const
+sal_uLong GraphicManager::GetMaxObjCacheSize() const
{
return mpCache->GetMaxObjDisplayCacheSize();
}
// -----------------------------------------------------------------------------
-ULONG GraphicManager::GetUsedCacheSize() const
+sal_uLong GraphicManager::GetUsedCacheSize() const
{
return mpCache->GetUsedDisplayCacheSize();
}
// -----------------------------------------------------------------------------
-ULONG GraphicManager::GetFreeCacheSize() const
+sal_uLong GraphicManager::GetFreeCacheSize() const
{
return mpCache->GetFreeDisplayCacheSize();
}
// -----------------------------------------------------------------------------
-void GraphicManager::SetCacheTimeout( ULONG nTimeoutSeconds )
+void GraphicManager::SetCacheTimeout( sal_uLong nTimeoutSeconds )
{
mpCache->SetCacheTimeout( nTimeoutSeconds );
}
// -----------------------------------------------------------------------------
-ULONG GraphicManager::GetCacheTimeout() const
+sal_uLong GraphicManager::GetCacheTimeout() const
{
return mpCache->GetCacheTimeout();
}
@@ -200,7 +200,7 @@ void GraphicManager::ReleaseFromCache( const GraphicObject& /*rObj*/ )
// -----------------------------------------------------------------------------
-BOOL GraphicManager::IsInCache( OutputDevice* pOut, const Point& rPt,
+sal_Bool GraphicManager::IsInCache( OutputDevice* pOut, const Point& rPt,
const Size& rSz, const GraphicObject& rObj,
const GraphicAttr& rAttr ) const
{
@@ -209,15 +209,15 @@ BOOL GraphicManager::IsInCache( OutputDevice* pOut, const Point& rPt,
// -----------------------------------------------------------------------------
-BOOL GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+sal_Bool GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
GraphicObject& rObj, const GraphicAttr& rAttr,
- const ULONG nFlags, BOOL& rCached )
+ const sal_uLong nFlags, sal_Bool& rCached )
{
Point aPt( rPt );
Size aSz( rSz );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
- rCached = FALSE;
+ rCached = sal_False;
if( ( rObj.GetType() == GRAPHIC_BITMAP ) || ( rObj.GetType() == GRAPHIC_GDIMETAFILE ) )
{
@@ -235,7 +235,7 @@ BOOL GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size&
if( aGraphic.IsSupportedGraphic() )
{
- const USHORT nRot10 = rAttr.GetRotation() % 3600;
+ const sal_uInt16 nRot10 = rAttr.GetRotation() % 3600;
if( nRot10 )
{
@@ -250,7 +250,7 @@ BOOL GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size&
aGraphic.Draw( pOut, aPt, aSz );
}
- bRet = TRUE;
+ bRet = sal_True;
}
if( !bRet )
@@ -259,7 +259,7 @@ BOOL GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size&
if( !mpCache->DrawDisplayCacheObj( pOut, aPt, aSz, rObj, rAttr ) )
bRet = ImplDraw( pOut, aPt, aSz, rObj, rAttr, nFlags, rCached );
else
- bRet = rCached = TRUE;
+ bRet = rCached = sal_True;
}
}
@@ -299,7 +299,7 @@ ByteString GraphicManager::ImplGetUniqueID( const GraphicObject& rObj ) const
// -----------------------------------------------------------------------------
-BOOL GraphicManager::ImplFillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute )
+sal_Bool GraphicManager::ImplFillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute )
{
return( mpCache->FillSwappedGraphicObject( rObj, rSubstitute ) );
}
@@ -313,13 +313,13 @@ void GraphicManager::ImplGraphicObjectWasSwappedIn( const GraphicObject& rObj )
// -----------------------------------------------------------------------------
-BOOL GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt,
+sal_Bool GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt,
const Size& rSz, GraphicObject& rObj,
const GraphicAttr& rAttr,
- const ULONG nFlags, BOOL& rCached )
+ const sal_uLong nFlags, sal_Bool& rCached )
{
const Graphic& rGraphic = rObj.GetGraphic();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( rGraphic.IsSupportedGraphic() && !rGraphic.IsSwapOut() )
{
@@ -337,7 +337,7 @@ BOOL GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt,
if( ImplCreateOutput( pOut, rPt, rSz, aSrcBmpEx, rAttr, nFlags, &aDstBmpEx ) )
{
rCached = mpCache->CreateDisplayCacheObj( pOut, rPt, rSz, rObj, rAttr, aDstBmpEx );
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -365,13 +365,13 @@ BOOL GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt,
if( ImplCreateOutput( pOut, rPt, rSz, aContainedBmpEx, rAttr, nFlags, &aDstBmpEx ) )
{
rCached = mpCache->CreateDisplayCacheObj( pOut, rPt, rSz, rObj, rAttr, aDstBmpEx );
- bRet = TRUE;
+ bRet = sal_True;
}
}
else
{
rCached = mpCache->CreateDisplayCacheObj( pOut, rPt, rSz, rObj, rAttr, aDstMtf );
- bRet = TRUE;
+ bRet = sal_True;
}
}
}
@@ -383,7 +383,7 @@ BOOL GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt,
if( aGraphic.IsSupportedGraphic() )
{
aGraphic.Draw( pOut, rPt, rSz );
- bRet = TRUE;
+ bRet = sal_True;
}
}
}
@@ -394,16 +394,16 @@ BOOL GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt,
// -----------------------------------------------------------------------------
-BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut,
+sal_Bool GraphicManager::ImplCreateOutput( OutputDevice* pOut,
const Point& rPt, const Size& rSz,
const BitmapEx& rBmpEx, const GraphicAttr& rAttr,
- const ULONG nFlags, BitmapEx* pBmpEx )
+ const sal_uLong nFlags, BitmapEx* pBmpEx )
{
- USHORT nRot10 = rAttr.GetRotation() % 3600;
+ sal_uInt16 nRot10 = rAttr.GetRotation() % 3600;
Point aOutPtPix;
Size aOutSzPix;
Size aUnrotatedSzPix( pOut->LogicToPixel( rSz ) );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( nRot10 )
{
@@ -438,8 +438,8 @@ BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut,
long* pMapFY = new long[ nNewH ];
long nStartX = -1, nStartY = -1, nEndX = -1, nEndY = -1;
long nX, nY, nTmp, nTmpX, nTmpY;
- BOOL bHMirr = ( rAttr.GetMirrorFlags() & BMP_MIRROR_HORZ ) != 0;
- BOOL bVMirr = ( rAttr.GetMirrorFlags() & BMP_MIRROR_VERT ) != 0;
+ sal_Bool bHMirr = ( rAttr.GetMirrorFlags() & BMP_MIRROR_HORZ ) != 0;
+ sal_Bool bVMirr = ( rAttr.GetMirrorFlags() & BMP_MIRROR_VERT ) != 0;
if( nFlags & GRFMGR_DRAW_BILINEAR )
{
@@ -541,7 +541,7 @@ BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut,
// do transformation
if( nStartX >= 0L )
{
- const BOOL bSimple = ( 1 == nW || 1 == nH );
+ const sal_Bool bSimple = ( 1 == nW || 1 == nH );
if( nRot10 )
{
@@ -570,7 +570,7 @@ BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut,
aOutPt = pOut->PixelToLogic( aOutPtPix );
aOutSz = pOut->PixelToLogic( aOutSzPix );
aOutBmpEx = aBmpEx;
- bRet = TRUE;
+ bRet = sal_True;
}
else
{
@@ -624,10 +624,10 @@ BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut,
// -----------------------------------------------------------------------------
-BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut,
+sal_Bool GraphicManager::ImplCreateOutput( OutputDevice* pOut,
const Point& rPt, const Size& rSz,
const GDIMetaFile& rMtf, const GraphicAttr& rAttr,
- const ULONG /*nFlags*/, GDIMetaFile& rOutMtf, BitmapEx& rOutBmpEx )
+ const sal_uLong /*nFlags*/, GDIMetaFile& rOutMtf, BitmapEx& rOutBmpEx )
{
const Size aNewSize( rMtf.GetPrefSize() );
@@ -919,12 +919,12 @@ BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut,
rOutBmpEx = BitmapEx();
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------------
-BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx,
+sal_Bool GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx,
long* pMapIX, long* pMapFX, long* pMapIY, long* pMapFY,
long nStartX, long nEndX, long nStartY, long nEndY,
BitmapEx& rOutBmpEx )
@@ -938,8 +938,8 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx,
const long nDstH = nEndY - nStartY + 1L;
long nX, nY, nTmpX, nTmpY, nTmpFX, nTmpFY;
long nXDst, nYDst;
- BYTE cR0, cG0, cB0, cR1, cG1, cB1;
- BOOL bRet = FALSE;
+ sal_uInt8 cR0, cG0, cB0, cR1, cG1, cB1;
+ sal_Bool bRet = sal_False;
DBG_ASSERT( aBmp.GetSizePixel() == rBmpEx.GetSizePixel(),
"GraphicManager::ImplCreateScaled(): bmp size inconsistent" );
@@ -1117,7 +1117,7 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx,
}
aOutBmp.ReleaseAccess( pWAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
aBmp.ReleaseAccess( pAcc );
@@ -1125,7 +1125,7 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx,
if( bRet && rBmpEx.IsTransparent() )
{
- bRet = FALSE;
+ bRet = sal_False;
if( rBmpEx.IsAlpha() )
{
@@ -1198,7 +1198,7 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx,
}
aOutAlpha.ReleaseAccess( pWAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
aAlpha.ReleaseAccess( pAcc );
@@ -1277,7 +1277,7 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx,
{
for( nX = 0L; nX < nDstW; nX++ )
{
- if( pAcc->GetPaletteColor( (BYTE) pAcc->GetPixel( pMapLY[ nY ], pMapLX[ nX ] ) ) == aB )
+ if( pAcc->GetPaletteColor( (sal_uInt8) pAcc->GetPixel( pMapLY[ nY ], pMapLX[ nX ] ) ) == aB )
pWAcc->SetPixel( nY, nX, aWB );
else
pWAcc->SetPixel( nY, nX, aWW );
@@ -1302,7 +1302,7 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx,
delete[] pMapLX;
delete[] pMapLY;
aOutMsk.ReleaseAccess( pWAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
aMsk.ReleaseAccess( pAcc );
@@ -1323,8 +1323,8 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx,
// -----------------------------------------------------------------------------
-BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx,
- USHORT nRot10, const Size& /*rOutSzPix*/, const Size& rUnrotatedSzPix,
+sal_Bool GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx,
+ sal_uInt16 nRot10, const Size& /*rOutSzPix*/, const Size& rUnrotatedSzPix,
long* pMapIX, long* pMapFX, long* pMapIY, long* pMapFY,
long nStartX, long nEndX, long nStartY, long nEndY,
BitmapEx& rOutBmpEx )
@@ -1347,8 +1347,8 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx,
long* pCosY = new long[ nDstH ];
long* pSinY = new long[ nDstH ];
long nX, nY, nTmpX, nTmpY, nTmpFX, nTmpFY, nUnRotX, nUnRotY, nSinY, nCosY;
- BYTE cR0, cG0, cB0, cR1, cG1, cB1;
- BOOL bRet = FALSE;
+ sal_uInt8 cR0, cG0, cB0, cR1, cG1, cB1;
+ sal_Bool bRet = sal_False;
// create horizontal mapping table
for( nX = 0L, nTmpX = aNewBound.Left() + nStartX; nX < nDstW; nX++ )
@@ -1455,7 +1455,7 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx,
}
aOutBmp.ReleaseAccess( pWAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
aBmp.ReleaseAccess( pAcc );
@@ -1464,7 +1464,7 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx,
// mask processing
if( bRet && ( rBmpEx.IsTransparent() || ( nRot10 != 900 && nRot10 != 1800 && nRot10 != 2700 ) ) )
{
- bRet = FALSE;
+ bRet = sal_False;
if( rBmpEx.IsAlpha() )
{
@@ -1555,7 +1555,7 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx,
}
aOutAlpha.ReleaseAccess( pWAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
aAlpha.ReleaseAccess( pAcc );
@@ -1628,7 +1628,7 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx,
if( pMAcc )
aMsk.ReleaseAccess( pMAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
aOutMsk.ReleaseAccess( pWAcc );
@@ -1654,7 +1654,7 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx,
// -----------------------------------------------------------------------------
-void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULONG nAdjustmentFlags )
+void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, sal_uLong nAdjustmentFlags )
{
GraphicAttr aAttr( rAttr );
@@ -1702,7 +1702,7 @@ void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULO
if( ( nAdjustmentFlags & ADJUSTMENT_TRANSPARENCY ) && aAttr.IsTransparent() )
{
AlphaMask aAlpha;
- BYTE cTrans = aAttr.GetTransparency();
+ sal_uInt8 cTrans = aAttr.GetTransparency();
if( !rBmpEx.IsTransparent() )
aAlpha = AlphaMask( rBmpEx.GetSizePixel(), &cTrans );
@@ -1718,7 +1718,7 @@ void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULO
if( pA )
{
- ULONG nTrans = cTrans, nNewTrans;
+ sal_uLong nTrans = cTrans, nNewTrans;
const long nWidth = pA->Width(), nHeight = pA->Height();
if( pA->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL )
@@ -1730,7 +1730,7 @@ void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULO
for( long nX = 0; nX < nWidth; nX++ )
{
nNewTrans = nTrans + *pAScan;
- *pAScan++ = (BYTE) ( ( nNewTrans & 0xffffff00 ) ? 255 : nNewTrans );
+ *pAScan++ = (sal_uInt8) ( ( nNewTrans & 0xffffff00 ) ? 255 : nNewTrans );
}
}
}
@@ -1743,7 +1743,7 @@ void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULO
for( long nX = 0; nX < nWidth; nX++ )
{
nNewTrans = nTrans + pA->GetPixel( nY, nX ).GetIndex();
- aAlphaValue.SetIndex( (BYTE) ( ( nNewTrans & 0xffffff00 ) ? 255 : nNewTrans ) );
+ aAlphaValue.SetIndex( (sal_uInt8) ( ( nNewTrans & 0xffffff00 ) ? 255 : nNewTrans ) );
pA->SetPixel( nY, nX, aAlphaValue );
}
}
@@ -1759,7 +1759,7 @@ void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULO
// -----------------------------------------------------------------------------
-void GraphicManager::ImplAdjust( GDIMetaFile& rMtf, const GraphicAttr& rAttr, ULONG nAdjustmentFlags )
+void GraphicManager::ImplAdjust( GDIMetaFile& rMtf, const GraphicAttr& rAttr, sal_uLong nAdjustmentFlags )
{
GraphicAttr aAttr( rAttr );
@@ -1812,7 +1812,7 @@ void GraphicManager::ImplAdjust( GDIMetaFile& rMtf, const GraphicAttr& rAttr, UL
// -----------------------------------------------------------------------------
-void GraphicManager::ImplAdjust( Animation& rAnimation, const GraphicAttr& rAttr, ULONG nAdjustmentFlags )
+void GraphicManager::ImplAdjust( Animation& rAnimation, const GraphicAttr& rAttr, sal_uLong nAdjustmentFlags )
{
GraphicAttr aAttr( rAttr );
@@ -1868,7 +1868,7 @@ void GraphicManager::ImplAdjust( Animation& rAnimation, const GraphicAttr& rAttr
void GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GDIMetaFile& rMtf, const GraphicAttr& rAttr )
{
- USHORT nRot10 = rAttr.GetRotation() % 3600;
+ sal_uInt16 nRot10 = rAttr.GetRotation() % 3600;
Point aOutPt( rPt );
Size aOutSz( rSz );
@@ -1926,7 +1926,7 @@ struct ImplTileInfo
bool GraphicObject::ImplRenderTempTile( VirtualDevice& rVDev, int nExponent,
int nNumTilesX, int nNumTilesY,
const Size& rTileSizePixel,
- const GraphicAttr* pAttr, ULONG nFlags )
+ const GraphicAttr* pAttr, sal_uLong nFlags )
{
if( nExponent <= 1 )
return false;
@@ -1946,8 +1946,8 @@ bool GraphicObject::ImplRenderTempTile( VirtualDevice& rVDev, int nExponent,
// #105229# Switch off mapping (converting to logic and back to
// pixel might cause roundoff errors)
- BOOL bOldMap( rVDev.IsMapModeEnabled() );
- rVDev.EnableMapMode( FALSE );
+ sal_Bool bOldMap( rVDev.IsMapModeEnabled() );
+ rVDev.EnableMapMode( sal_False );
bool bRet( ImplRenderTileRecursive( rVDev, nExponent, nMSBFactor, nNumTilesX, nNumTilesY,
nNumTilesX, nNumTilesY, rTileSizePixel, pAttr, nFlags, aTileInfo ) );
@@ -1970,7 +1970,7 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent
int nNumOrigTilesX, int nNumOrigTilesY,
int nRemainderTilesX, int nRemainderTilesY,
const Size& rTileSizePixel, const GraphicAttr* pAttr,
- ULONG nFlags, ImplTileInfo& rTileInfo )
+ sal_uLong nFlags, ImplTileInfo& rTileInfo )
{
// gets loaded with our tile bitmap
GraphicObject aTmpGraphic;
@@ -2145,7 +2145,7 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent
// -----------------------------------------------------------------------------
bool GraphicObject::ImplDrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSizePixel,
- const Size& rOffset, const GraphicAttr* pAttr, ULONG nFlags, int nTileCacheSize1D )
+ const Size& rOffset, const GraphicAttr* pAttr, sal_uLong nFlags, int nTileCacheSize1D )
{
// how many tiles to generate per recursion step
enum{ SubdivisionExponent=2 };
@@ -2256,7 +2256,7 @@ bool GraphicObject::ImplDrawTiled( OutputDevice* pOut, const Rectangle& rArea, c
bool GraphicObject::ImplDrawTiled( OutputDevice& rOut, const Point& rPosPixel,
int nNumTilesX, int nNumTilesY,
- const Size& rTileSizePixel, const GraphicAttr* pAttr, ULONG nFlags )
+ const Size& rTileSizePixel, const GraphicAttr* pAttr, sal_uLong nFlags )
{
Point aCurrPos( rPosPixel );
Size aTileSizeLogic( rOut.PixelToLogic( rTileSizePixel ) );
@@ -2264,14 +2264,14 @@ bool GraphicObject::ImplDrawTiled( OutputDevice& rOut, const Point& rPosPixel,
// #107607# Use logical coordinates for metafile playing, too
bool bDrawInPixel( rOut.GetConnectMetaFile() == NULL && GRAPHIC_BITMAP == GetType() );
- BOOL bRet( FALSE );
+ sal_Bool bRet( sal_False );
// #105229# Switch off mapping (converting to logic and back to
// pixel might cause roundoff errors)
- BOOL bOldMap( rOut.IsMapModeEnabled() );
+ sal_Bool bOldMap( rOut.IsMapModeEnabled() );
if( bDrawInPixel )
- rOut.EnableMapMode( FALSE );
+ rOut.EnableMapMode( sal_False );
for( nY=0; nY < nNumTilesY; ++nY )
{
@@ -2310,7 +2310,7 @@ void GraphicObject::ImplTransformBitmap( BitmapEx& rBmpEx,
const Size& rCropRightBottom,
const Rectangle& rCropRect,
const Size& rDstSize,
- BOOL bEnlarge ) const
+ sal_Bool bEnlarge ) const
{
// #107947# Extracted from svdograf.cxx
diff --git a/svtools/source/graphic/makefile.mk b/svtools/source/graphic/makefile.mk
deleted file mode 100644
index cf3a916e7aa1..000000000000
--- a/svtools/source/graphic/makefile.mk
+++ /dev/null
@@ -1,69 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=graphic
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-.IF "$(GUI)"=="WIN"
-LINKFLAGS=$(LINKFLAGS) /PACKC:32768
-.ENDIF
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/descriptor.obj \
- $(SLO)$/graphic.obj \
- $(SLO)$/graphicunofactory.obj \
- $(SLO)$/grfattr.obj \
- $(SLO)$/grfcache.obj \
- $(SLO)$/grfmgr.obj \
- $(SLO)$/grfmgr2.obj \
- $(SLO)$/provider.obj \
- $(SLO)$/renderer.obj \
- $(SLO)$/transformer.obj
-
-EXCEPTIONSFILES= \
- $(SLO)$/descriptor.obj \
- $(SLO)$/graphic.obj \
- $(SLO)$/graphicunofactory.obj \
- $(SLO)$/grfcache.obj \
- $(SLO)$/grfmgr.obj \
- $(SLO)$/grfmgr2.obj \
- $(SLO)$/provider.obj \
- $(SLO)$/renderer.obj \
- $(SLO)$/transformer.obj
-
-# --- Target -------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx
index a4dcb7f51de8..af579f82c446 100644
--- a/svtools/source/graphic/provider.cxx
+++ b/svtools/source/graphic/provider.cxx
@@ -338,7 +338,7 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadResource( const :
if( 0 < nImageId )
{
- const Image aImage( aImageList.GetImage( sal::static_int_cast< USHORT >(nImageId) ) );
+ const Image aImage( aImageList.GetImage( sal::static_int_cast< sal_uInt16 >(nImageId) ) );
aBmpEx = aImage.GetBitmapEx();
}
else
diff --git a/svtools/source/hatchwindow/hatchwindow.cxx b/svtools/source/hatchwindow/hatchwindow.cxx
index 1651eb2b16c3..c32e3a6c0b60 100644
--- a/svtools/source/hatchwindow/hatchwindow.cxx
+++ b/svtools/source/hatchwindow/hatchwindow.cxx
@@ -34,6 +34,8 @@
#include "ipwin.hxx"
#include <toolkit/helper/convert.hxx>
+#include <osl/mutex.hxx>
+#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
@@ -51,6 +53,8 @@ void VCLXHatchWindow::initializeWindow( const uno::Reference< awt::XWindowPeer >
const awt::Rectangle& aBounds,
const awt::Size& aSize )
{
+ SolarMutexGuard aGuard;
+
Window* pParent = NULL;
VCLXWindow* pParentComponent = VCLXWindow::GetImplementation( xParent );
@@ -118,7 +122,7 @@ uno::Any SAL_CALL VCLXHatchWindow::queryInterface( const uno::Type & rType )
throw( uno::RuntimeException )
{
// Attention:
- // Don't use mutex or guard in this method!!! Is a method of XInterface.
+ // Don't use mutex or guard in this method!!! Is a method of XInterface.
uno::Any aReturn( ::cppu::queryInterface( rType,
static_cast< embed::XHatchWindow* >( this ) ) );
diff --git a/svtools/source/hatchwindow/hatchwindowfactory.component b/svtools/source/hatchwindow/hatchwindowfactory.component
new file mode 100644
index 000000000000..153fc8796281
--- /dev/null
+++ b/svtools/source/hatchwindow/hatchwindowfactory.component
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.embed.DocumentCloser">
+ <service name="com.sun.star.embed.DocumentCloser"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.embed.HatchWindowFactory">
+ <service name="com.sun.star.comp.embed.HatchWindowFactory"/>
+ <service name="com.sun.star.embed.HatchWindowFactory"/>
+ </implementation>
+</component>
diff --git a/svtools/source/hatchwindow/hatchwindowfactory.cxx b/svtools/source/hatchwindow/hatchwindowfactory.cxx
index d0e9786fe99c..a0ff0d4daf17 100644
--- a/svtools/source/hatchwindow/hatchwindowfactory.cxx
+++ b/svtools/source/hatchwindow/hatchwindowfactory.cxx
@@ -32,6 +32,7 @@
#include "hatchwindowfactory.hxx"
#include "hatchwindow.hxx"
#include "cppuhelper/factory.hxx"
+#include <vcl/svapp.hxx>
#include "documentcloser.hxx"
@@ -70,6 +71,7 @@ uno::Reference< embed::XHatchWindow > SAL_CALL OHatchWindowFactory::createHatchW
if ( !xParent.is() )
throw lang::IllegalArgumentException(); // TODO
+ SolarMutexGuard aGuard;
VCLXHatchWindow* pResult = new VCLXHatchWindow();
pResult->initializeWindow( xParent, aBounds, aHandlerSize );
return uno::Reference< embed::XHatchWindow >( static_cast< embed::XHatchWindow* >( pResult ) );
@@ -113,45 +115,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
- void * /* pServiceManager */, void * pRegistryKey)
-{
- if (pRegistryKey)
- {
- uno::Reference< registry::XRegistryKey> xRegistryKey (
- reinterpret_cast< registry::XRegistryKey* >(pRegistryKey));
- uno::Reference< registry::XRegistryKey> xNewKey;
-
- // OHatchWindowFactory registration
-
- xNewKey = xRegistryKey->createKey (
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
- OHatchWindowFactory::impl_staticGetImplementationName() +
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) );
-
- uno::Sequence< ::rtl::OUString > aServices =
- OHatchWindowFactory::impl_staticGetSupportedServiceNames();
- for (sal_Int32 i = 0, n = aServices.getLength(); i < n; i++ )
- xNewKey->createKey( aServices.getConstArray()[i] );
-
-
- // ODocumentCloser registration
-
- xNewKey = xRegistryKey->createKey (
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
- ODocumentCloser::impl_staticGetImplementationName() +
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) );
-
- aServices = ODocumentCloser::impl_staticGetSupportedServiceNames();
- for (sal_Int32 i = 0, n = aServices.getLength(); i < n; i++ )
- xNewKey->createKey( aServices.getConstArray()[i] );
-
-
- return sal_True;
- }
- return sal_False;
-}
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */)
{
diff --git a/svtools/source/hatchwindow/ipwin.cxx b/svtools/source/hatchwindow/ipwin.cxx
index 4cf4f9dcf741..c4a68a49ec2a 100644
--- a/svtools/source/hatchwindow/ipwin.cxx
+++ b/svtools/source/hatchwindow/ipwin.cxx
@@ -44,7 +44,7 @@
SvResizeHelper::SvResizeHelper()
: aBorder( 5, 5 )
, nGrab( -1 )
- , bResizeable( TRUE )
+ , bResizeable( sal_True )
{
}
@@ -128,7 +128,7 @@ void SvResizeHelper::Draw( OutputDevice * pDev )
Rectangle aMoveRects[ 4 ];
FillMoveRectsPixel( aMoveRects );
- USHORT i;
+ sal_uInt16 i;
for( i = 0; i < 4; i++ )
pDev->DrawRect( aMoveRects[ i ] );
if( bResizeable )
@@ -152,7 +152,7 @@ void SvResizeHelper::InvalidateBorder( Window * pWin )
{
Rectangle aMoveRects[ 4 ];
FillMoveRectsPixel( aMoveRects );
- for( USHORT i = 0; i < 4; i++ )
+ for( sal_uInt16 i = 0; i < 4; i++ )
pWin->Invalidate( aMoveRects[ i ] );
}
@@ -161,7 +161,7 @@ void SvResizeHelper::InvalidateBorder( Window * pWin )
|*
|* Beschreibung
*************************************************************************/
-BOOL SvResizeHelper::SelectBegin( Window * pWin, const Point & rPos )
+sal_Bool SvResizeHelper::SelectBegin( Window * pWin, const Point & rPos )
{
if( -1 == nGrab )
{
@@ -170,10 +170,10 @@ BOOL SvResizeHelper::SelectBegin( Window * pWin, const Point & rPos )
{
aSelPos = rPos; // Start-Position merken
pWin->CaptureMouse();
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -189,14 +189,14 @@ short SvResizeHelper::SelectMove( Window * pWin, const Point & rPos )
{
Rectangle aRects[ 8 ];
FillHandleRectsPixel( aRects );
- for( USHORT i = 0; i < 8; i++ )
+ for( sal_uInt16 i = 0; i < 8; i++ )
if( aRects[ i ].IsInside( rPos ) )
return i;
}
// Move-Rect ueberlappen Handles
Rectangle aMoveRects[ 4 ];
FillMoveRectsPixel( aMoveRects );
- for( USHORT i = 0; i < 4; i++ )
+ for( sal_uInt16 i = 0; i < 4; i++ )
if( aMoveRects[ i ].IsInside( rPos ) )
return 8;
}
@@ -421,7 +421,7 @@ void SvResizeHelper::ValidateRect( Rectangle & rValidate ) const
|*
|* Beschreibung
*************************************************************************/
-BOOL SvResizeHelper::SelectRelease( Window * pWin, const Point & rPos,
+sal_Bool SvResizeHelper::SelectRelease( Window * pWin, const Point & rPos,
Rectangle & rOutPosSize )
{
if( -1 != nGrab )
@@ -431,9 +431,9 @@ BOOL SvResizeHelper::SelectRelease( Window * pWin, const Point & rPos,
nGrab = -1;
pWin->ReleaseMouse();
pWin->HideTracking();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -632,7 +632,7 @@ long SvResizeWindow::Notify( NotifyEvent& rEvt )
{
if ( rEvt.GetType() == EVENT_LOSEFOCUS && m_bActive )
{
- BOOL bHasFocus = HasChildPathFocus(TRUE);
+ sal_Bool bHasFocus = HasChildPathFocus(sal_True);
if ( !bHasFocus )
{
m_bActive = sal_False;
diff --git a/svtools/source/hatchwindow/ipwin.hxx b/svtools/source/hatchwindow/ipwin.hxx
index cbe91e7ed4d9..c5331a9e580c 100644
--- a/svtools/source/hatchwindow/ipwin.hxx
+++ b/svtools/source/hatchwindow/ipwin.hxx
@@ -41,11 +41,11 @@ class SvResizeHelper
Rectangle aOuter;
short nGrab; // -1 kein Grab, 0 - 7, 8 = Move, siehe FillHandle...
Point aSelPos;
- BOOL bResizeable;
+ sal_Bool bResizeable;
public:
SvResizeHelper();
- void SetResizeable( BOOL b ) { bResizeable = b; }
+ void SetResizeable( sal_Bool b ) { bResizeable = b; }
short GetGrab() const { return nGrab; }
void SetBorderPixel( const Size & rBorderP )
{ aBorder = rBorderP; }
@@ -68,12 +68,12 @@ public:
void FillMoveRectsPixel( Rectangle aRects[ 4 ] ) const;
void Draw( OutputDevice * );
void InvalidateBorder( Window * );
- BOOL SelectBegin( Window *, const Point & rPos );
+ sal_Bool SelectBegin( Window *, const Point & rPos );
short SelectMove( Window * pWin, const Point & rPos );
Point GetTrackPosPixel( const Rectangle & rRect ) const;
Rectangle GetTrackRectPixel( const Point & rTrackPos ) const;
void ValidateRect( Rectangle & rValidate ) const;
- BOOL SelectRelease( Window *, const Point & rPos, Rectangle & rOutPosSize );
+ sal_Bool SelectRelease( Window *, const Point & rPos, Rectangle & rOutPosSize );
void Release( Window * pWin );
};
diff --git a/svtools/source/hatchwindow/makefile.mk b/svtools/source/hatchwindow/makefile.mk
deleted file mode 100644
index 316e4ab1bfe2..000000000000
--- a/svtools/source/hatchwindow/makefile.mk
+++ /dev/null
@@ -1,65 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJNAME=svtools
-TARGET=hatchwindowfactory.uno
-LIBTARGET=NO
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-DLLPRE=
-
-# --- Files -------------------------------------
-
-SLOFILES= \
- $(SLO)$/hatchwindow.obj\
- $(SLO)$/hatchwindowfactory.obj\
- $(SLO)$/documentcloser.obj\
- $(SLO)$/ipwin.obj
-
-SHL1TARGET= $(TARGET)
-SHL1IMPLIB= i$(TARGET)
-SHL1OBJS= $(SLOFILES)
-SHL1STDLIBS=\
- $(TKLIB) \
- $(VCLLIB) \
- $(TOOLSLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-DEF1NAME= $(SHL1TARGET)
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svtools/source/inc/filectrl.hrc b/svtools/source/inc/filectrl.hrc
index 1707e306e1b0..150bbba4ac68 100644
--- a/svtools/source/inc/filectrl.hrc
+++ b/svtools/source/inc/filectrl.hrc
@@ -30,5 +30,12 @@
#define STR_FILECTRL_BUTTONTEXT 333 // ID-Range?!
+//IAccessibility2 Implementation 2009-----
+#define STR_TABBAR_PUSHBUTTON_MOVET0HOME ( STR_FILECTRL_BUTTONTEXT+ 1)
+#define STR_TABBAR_PUSHBUTTON_MOVELEFT ( STR_FILECTRL_BUTTONTEXT+ 2)
+#define STR_TABBAR_PUSHBUTTON_MOVERIGHT ( STR_FILECTRL_BUTTONTEXT+ 3)
+#define STR_TABBAR_PUSHBUTTON_MOVETOEND ( STR_FILECTRL_BUTTONTEXT+ 4)
+//-----IAccessibility2 Implementation 2009
+
#endif
diff --git a/svtools/source/inc/gifread.hxx b/svtools/source/inc/gifread.hxx
index ee42c86b23de..1b92271dfc9f 100644
--- a/svtools/source/inc/gifread.hxx
+++ b/svtools/source/inc/gifread.hxx
@@ -85,41 +85,41 @@ class GIFReader : public GraphicReader
long nLastPos;
sal_uInt32 nLogWidth100;
sal_uInt32 nLogHeight100;
- USHORT nTimer;
- USHORT nGlobalWidth; // maximale Bildbreite aus Header
- USHORT nGlobalHeight; // maximale Bildhoehe aus Header
- USHORT nImageWidth; // maximale Bildbreite aus Header
- USHORT nImageHeight; // maximale Bildhoehe aus Header
- USHORT nImagePosX;
- USHORT nImagePosY;
- USHORT nImageX; // maximale Bildbreite aus Header
- USHORT nImageY; // maximale Bildhoehe aus Header
- USHORT nLastImageY;
- USHORT nLastInterCount;
- USHORT nLoops;
+ sal_uInt16 nTimer;
+ sal_uInt16 nGlobalWidth; // maximale Bildbreite aus Header
+ sal_uInt16 nGlobalHeight; // maximale Bildhoehe aus Header
+ sal_uInt16 nImageWidth; // maximale Bildbreite aus Header
+ sal_uInt16 nImageHeight; // maximale Bildhoehe aus Header
+ sal_uInt16 nImagePosX;
+ sal_uInt16 nImagePosY;
+ sal_uInt16 nImageX; // maximale Bildbreite aus Header
+ sal_uInt16 nImageY; // maximale Bildhoehe aus Header
+ sal_uInt16 nLastImageY;
+ sal_uInt16 nLastInterCount;
+ sal_uInt16 nLoops;
GIFAction eActAction;
- BOOL bStatus;
- BOOL bGCTransparent; // Ob das Bild Transparent ist, wenn ja:
- BOOL bInterlaced;
- BOOL bOverreadBlock;
- BOOL bImGraphicReady;
- BOOL bGlobalPalette;
- BYTE nBackgroundColor; // Hintergrundfarbe
- BYTE nGCTransparentIndex; // Pixel von diesem Index sind durchsichtig
- BYTE nGCDisposalMethod; // 'Disposal Method' (siehe GIF-Doku)
- BYTE cTransIndex1;
- BYTE cNonTransIndex1;
-
- void ReadPaletteEntries( BitmapPalette* pPal, ULONG nCount );
+ sal_Bool bStatus;
+ sal_Bool bGCTransparent; // Ob das Bild Transparent ist, wenn ja:
+ sal_Bool bInterlaced;
+ sal_Bool bOverreadBlock;
+ sal_Bool bImGraphicReady;
+ sal_Bool bGlobalPalette;
+ sal_uInt8 nBackgroundColor; // Hintergrundfarbe
+ sal_uInt8 nGCTransparentIndex; // Pixel von diesem Index sind durchsichtig
+ sal_uInt8 nGCDisposalMethod; // 'Disposal Method' (siehe GIF-Doku)
+ sal_uInt8 cTransIndex1;
+ sal_uInt8 cNonTransIndex1;
+
+ void ReadPaletteEntries( BitmapPalette* pPal, sal_uLong nCount );
void ClearImageExtensions();
- BOOL CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal, BOOL bWatchForBackgroundColor );
- BOOL ReadGlobalHeader();
- BOOL ReadExtension();
- BOOL ReadLocalHeader();
- ULONG ReadNextBlock();
- void FillImages( HPBYTE pBytes, ULONG nCount );
+ sal_Bool CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal, sal_Bool bWatchForBackgroundColor );
+ sal_Bool ReadGlobalHeader();
+ sal_Bool ReadExtension();
+ sal_Bool ReadLocalHeader();
+ sal_uLong ReadNextBlock();
+ void FillImages( HPBYTE pBytes, sal_uLong nCount );
void CreateNewBitmaps();
- BOOL ProcessGIF();
+ sal_Bool ProcessGIF();
public:
@@ -136,7 +136,7 @@ public:
// - ImportGIF -
// -------------
- BOOL ImportGIF( SvStream& rStream, Graphic& rGraphic );
+ sal_Bool ImportGIF( SvStream& rStream, Graphic& rGraphic );
#endif // _GIFREAD_HXX
diff --git a/svtools/source/inc/jpeg.hxx b/svtools/source/inc/jpeg.hxx
index 4163354d1416..00c267f71650 100644
--- a/svtools/source/inc/jpeg.hxx
+++ b/svtools/source/inc/jpeg.hxx
@@ -92,8 +92,8 @@ class JPEGWriter
SvStream& rOStm;
Bitmap aBmp;
BitmapReadAccess* pAcc;
- BYTE* pBuffer;
- BOOL bNative;
+ sal_uInt8* pBuffer;
+ sal_Bool bNative;
sal_Bool bGreys;
sal_Int32 nQuality;
@@ -110,7 +110,7 @@ public:
bool* pExportWasGrey = NULL );
~JPEGWriter() {};
- BOOL Write( const Graphic& rGraphic );
+ sal_Bool Write( const Graphic& rGraphic );
};
#endif // _JPEGPRIVATE
@@ -119,9 +119,9 @@ public:
// - Import/ExportJPEG -
// ---------------------
-BOOL ImportJPEG( SvStream& rStream, Graphic& rGraphic, void* pCallerData, sal_Int32 nImportFlags );
+sal_Bool ImportJPEG( SvStream& rStream, Graphic& rGraphic, void* pCallerData, sal_Int32 nImportFlags );
-BOOL ExportJPEG( SvStream& rStream,
+sal_Bool ExportJPEG( SvStream& rStream,
const Graphic& rGraphic,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData,
bool* pExportWasGrey = NULL
diff --git a/svtools/source/inc/msgrd.hxx b/svtools/source/inc/msgrd.hxx
index 6b1bc8cb5775..dd39a1446af2 100644
--- a/svtools/source/inc/msgrd.hxx
+++ b/svtools/source/inc/msgrd.hxx
@@ -30,9 +30,9 @@
#define _MSGRD_HXX
-BOOL ConvertMSGToGDIMetaFile( SvStream & rMSG, GDIMetaFile & rGDIMetaFile,
- BOOL(*pCallback)(void *, USHORT), void * pCallerData,
- ULONG nMinPercent, ULONG nMaxPercent);
+sal_Bool ConvertMSGToGDIMetaFile( SvStream & rMSG, GDIMetaFile & rGDIMetaFile,
+ sal_Bool(*pCallback)(void *, sal_uInt16), void * pCallerData,
+ sal_uLong nMinPercent, sal_uLong nMaxPercent);
#endif // _MSGRD_HXX
diff --git a/svtools/source/inc/msgwr.hxx b/svtools/source/inc/msgwr.hxx
index 77eeda2b26b9..c382397899e2 100644
--- a/svtools/source/inc/msgwr.hxx
+++ b/svtools/source/inc/msgwr.hxx
@@ -30,9 +30,9 @@
#define _MSGWR_HXX
-BOOL ConvertGraphicToMSG(const Graphic & rGraphic, SvStream & rTargetStream,
- BOOL(*pCallback)(void *, USHORT), void * pCallerData,
- ULONG nMinPercent, ULONG nMaxPercent);
+sal_Bool ConvertGraphicToMSG(const Graphic & rGraphic, SvStream & rTargetStream,
+ sal_Bool(*pCallback)(void *, sal_uInt16), void * pCallerData,
+ sal_uLong nMinPercent, sal_uLong nMaxPercent);
#endif // _MSGWR_HXX
diff --git a/svtools/source/inc/property.hxx b/svtools/source/inc/property.hxx
index e77cbb4ed5e6..a6ef27fda9af 100644
--- a/svtools/source/inc/property.hxx
+++ b/svtools/source/inc/property.hxx
@@ -72,13 +72,13 @@ public:
virtual SvXPropertyCtrListener* GetSvXPropertyCtrListener()=0;
virtual void SetProperty(const String &rString)=0;
virtual String GetProperty()const=0;
- virtual BOOL HasList()=0;
+ virtual sal_Bool HasList()=0;
virtual void ClearList()=0;
virtual void InsertEntry( const String& rString,
- USHORT nPos = LISTBOX_APPEND )=0;
+ sal_uInt16 nPos = LISTBOX_APPEND )=0;
virtual void SetCtrSize(const Size& rSize)=0;
- virtual void SetLocked(BOOL bLocked=TRUE)=0;
+ virtual void SetLocked(sal_Bool bLocked=sal_True)=0;
virtual void SetMyName(const String &rString)=0;
virtual String GetMyName()const=0;
@@ -122,13 +122,13 @@ public:
virtual void SetProperty(const String &rString);
virtual String GetProperty()const;
- virtual BOOL HasList();
+ virtual sal_Bool HasList();
virtual void ClearList();
virtual void InsertEntry( const String& rString,
- USHORT nPos = LISTBOX_APPEND );
+ sal_uInt16 nPos = LISTBOX_APPEND );
virtual void SetCtrSize(const Size& rSize);
- virtual void SetLocked(BOOL bLocked=TRUE);
+ virtual void SetLocked(sal_Bool bLocked=sal_True);
virtual void SetMyName(const String &rString);
virtual String GetMyName()const;
@@ -165,13 +165,13 @@ public:
virtual void SetProperty(const String &rString);
virtual String GetProperty()const;
- virtual BOOL HasList();
+ virtual sal_Bool HasList();
virtual void ClearList();
virtual void InsertEntry( const String& rString,
- USHORT nPos = LISTBOX_APPEND );
+ sal_uInt16 nPos = LISTBOX_APPEND );
virtual void SetCtrSize(const Size& rSize);
- virtual void SetLocked(BOOL bLocked=TRUE);
+ virtual void SetLocked(sal_Bool bLocked=sal_True);
virtual void SetMyName(const String &rString);
virtual String GetMyName()const;
@@ -207,13 +207,13 @@ public:
virtual void SetProperty(const String &rString);
virtual String GetProperty()const;
- virtual BOOL HasList();
+ virtual sal_Bool HasList();
virtual void ClearList();
virtual void InsertEntry( const String& rString,
- USHORT nPos = LISTBOX_APPEND );
+ sal_uInt16 nPos = LISTBOX_APPEND );
virtual void SetCtrSize(const Size& rSize);
- virtual void SetLocked(BOOL bLocked=TRUE);
+ virtual void SetLocked(sal_Bool bLocked=sal_True);
virtual void SetMyName(const String &rString);
virtual String GetMyName()const;
@@ -228,14 +228,14 @@ class SvPropertyLine : public Control
{
private:
FixedText aName;
- USHORT nNameWidth;
- BOOL bNeedsRepaint;
+ sal_uInt16 nNameWidth;
+ sal_Bool bNeedsRepaint;
SvXPropertyControl* pSvXPropertyControl;
PushButton aXButton;
- BOOL bIsLocked;
- BOOL bHasXButton;
- BOOL bIsHyperlink;
+ sal_Bool bIsLocked;
+ sal_Bool bHasXButton;
+ sal_Bool bIsHyperlink;
eKindOfControl eKindOfCtr;
protected:
@@ -247,8 +247,8 @@ public:
SvPropertyLine( Window* pParent,
const ResId& rResId );
- BOOL NeedsRepaint();
- void SetNeedsRepaint(BOOL bFlag);
+ sal_Bool NeedsRepaint();
+ void SetNeedsRepaint(sal_Bool bFlag);
void SetSvXPropertyControl(SvXPropertyControl*);
SvXPropertyControl* GetSvXPropertyControl();
@@ -257,16 +257,16 @@ public:
void SetName(const String& rString );
String GetName() const;
- void SetNameWidth(USHORT);
+ void SetNameWidth(sal_uInt16);
void ShowXButton();
void HideXButton();
- BOOL IsVisibleXButton();
- void ShowAsHyperLink(BOOL nFlag=TRUE);
- BOOL IsShownAsHyperlink();
+ sal_Bool IsVisibleXButton();
+ void ShowAsHyperLink(sal_Bool nFlag=sal_True);
+ sal_Bool IsShownAsHyperlink();
- void Locked(BOOL nFlag=TRUE);
- BOOL IsLineLocked();
+ void Locked(sal_Bool nFlag=sal_True);
+ sal_Bool IsLineLocked();
void SetClickHdl(const Link&);
@@ -281,9 +281,9 @@ public:
String aValue;
SvStrings theValues; // ???
- BOOL bHasVisibleXButton;
- BOOL bIsHyperLink;
- BOOL bIsLocked;
+ sal_Bool bHasVisibleXButton;
+ sal_Bool bIsHyperLink;
+ sal_Bool bIsLocked;
void* pDataPtr;
SvXPropertyControl* pControl;
};
@@ -365,9 +365,9 @@ private:
ScrollBar aVScroll;
SvPropLineArray PLineArray;
SvPropertyDataControl* pPropDataControl;
- USHORT nRowHeight;
- BOOL bUpdate;
- USHORT nTheNameSize;
+ sal_uInt16 nRowHeight;
+ sal_Bool bUpdate;
+ sal_uInt16 nTheNameSize;
long nYOffset;
DECL_LINK( ScrollHdl,ScrollBar*);
@@ -392,7 +392,7 @@ public:
~SvListBoxForProperties();
- virtual USHORT CalcVisibleLines();
+ virtual sal_uInt16 CalcVisibleLines();
virtual void EnableUpdate();
virtual void DisableUpdate();
@@ -400,19 +400,19 @@ public:
virtual void Clear();
- virtual USHORT InsertEntry( const SvPropertyData&, USHORT nPos = LISTBOX_APPEND );
+ virtual sal_uInt16 InsertEntry( const SvPropertyData&, sal_uInt16 nPos = LISTBOX_APPEND );
- virtual void ChangeEntry( const SvPropertyData&, USHORT nPos);
+ virtual void ChangeEntry( const SvPropertyData&, sal_uInt16 nPos);
- virtual USHORT AppendEntry( const SvPropertyData&);
+ virtual sal_uInt16 AppendEntry( const SvPropertyData&);
virtual void SetPropertyValue( const String & rEntryName, const String & rValue );
- virtual void SetFirstVisibleEntry(USHORT nPos);
- virtual USHORT GetFirstVisibleEntry();
+ virtual void SetFirstVisibleEntry(sal_uInt16 nPos);
+ virtual sal_uInt16 GetFirstVisibleEntry();
- virtual void SetSelectedEntry(USHORT nPos);
- virtual USHORT GetSelectedEntry();
+ virtual void SetSelectedEntry(sal_uInt16 nPos);
+ virtual sal_uInt16 GetSelectedEntry();
};
class SvTabPageForProperties: public TabPage
@@ -437,7 +437,7 @@ class SvBasicPropertyDataControl: public SvPropertyDataControl
{
private:
- BOOL bCorrectness;
+ sal_Bool bCorrectness;
String aEntryName;
String aEntryProperty;
String aCorrectProperty;
@@ -468,7 +468,7 @@ public:
virtual void LinkClicked(const String& aName,
void* pData);
- virtual void SetIsCorrect(BOOL nFlag);
+ virtual void SetIsCorrect(sal_Bool nFlag);
//virtual String GetTheCorrectProperty()const;
virtual void SetTheCorrectProperty(const String& aName);
@@ -508,30 +508,30 @@ public:
~SvPropertyBox();
- virtual USHORT CalcVisibleLines();
+ virtual sal_uInt16 CalcVisibleLines();
virtual void EnableUpdate(); // auch IDL?
virtual void DisableUpdate(); // auch IDL?
// AB: Hier beginnt das 'offizielle' Interface, das in IDL uebernommen werden soll
virtual void SetController(SvPropertyDataControl *);
- virtual USHORT AppendPage( const String & r );
- virtual void SetPage( USHORT );
- virtual USHORT GetCurPage();
+ virtual sal_uInt16 AppendPage( const String & r );
+ virtual void SetPage( sal_uInt16 );
+ virtual sal_uInt16 GetCurPage();
virtual void ClearAll();
virtual void ClearTable();
virtual void SetPropertyValue( const String & rEntryName, const String & rValue );
- virtual USHORT InsertEntry( const SvPropertyData&, USHORT nPos = LISTBOX_APPEND );
- virtual void ChangeEntry( const SvPropertyData&, USHORT nPos);
- virtual USHORT AppendEntry( const SvPropertyData&);
+ virtual sal_uInt16 InsertEntry( const SvPropertyData&, sal_uInt16 nPos = LISTBOX_APPEND );
+ virtual void ChangeEntry( const SvPropertyData&, sal_uInt16 nPos);
+ virtual sal_uInt16 AppendEntry( const SvPropertyData&);
- virtual void SetFirstVisibleEntry(USHORT nPos);
- virtual USHORT GetFirstVisibleEntry();
+ virtual void SetFirstVisibleEntry(sal_uInt16 nPos);
+ virtual sal_uInt16 GetFirstVisibleEntry();
- virtual void SetSelectedEntry(USHORT nPos);
- virtual USHORT GetSelectedEntry();
+ virtual void SetSelectedEntry(sal_uInt16 nPos);
+ virtual sal_uInt16 GetSelectedEntry();
};
@@ -543,8 +543,8 @@ private:
SvBasicPropertyDataControl aBaProDatCtr;
OKButton anOk;
CancelButton aCancel;
- USHORT nCount;
- USHORT nClickCount;
+ sal_uInt16 nCount;
+ sal_uInt16 nClickCount;
SvPropertyData aProperty;
SvPropertyBox aPropListBox;
diff --git a/svtools/source/inc/sgfbram.hxx b/svtools/source/inc/sgfbram.hxx
index d3003e5ba565..ef3ee7a7bfe4 100644
--- a/svtools/source/inc/sgfbram.hxx
+++ b/svtools/source/inc/sgfbram.hxx
@@ -41,11 +41,11 @@
#define SgfDontKnow 255 /* Unbekannt oder kein SGF/SGV */
// Konstanten fr SgfHeader.SwGrCol
-#define SgfBlckWhit 1 /* Schwarz/Weiá Bild Ä¿ SimpVector, */
-#define SgfGrayscal 2 /* Bild mit Graustufen ³ StarDraw und */
+#define SgfBlckWhit 1 /* Schwarz/Wei?Bild Ä¿ SimpVector, */
+#define SgfGrayscal 2 /* Bild mit Graustufen ?StarDraw und */
#define Sgf16Colors 3 /* Farbbild (16 Farben) ÄÙ Bit Image */
#define SgfVectFarb 4 /* Farben fr Linien verwenden Ä¿ */
-#define SgfVectGray 5 /* Graustufen fr Linien verwenden ³ Nur fr */
+#define SgfVectGray 5 /* Graustufen fr Linien verwenden ?Nur fr */
#define SgfVectWdth 6 /* Strichst„rken fr Linien verwenden ÄÙ SimpVector */
@@ -53,35 +53,35 @@
class SgfHeader
{
public:
- UINT16 Magic;
- UINT16 Version;
- UINT16 Typ;
- UINT16 Xsize;
- UINT16 Ysize;
- INT16 Xoffs;
- INT16 Yoffs;
- UINT16 Planes; // Layer
- UINT16 SwGrCol;
+ sal_uInt16 Magic;
+ sal_uInt16 Version;
+ sal_uInt16 Typ;
+ sal_uInt16 Xsize;
+ sal_uInt16 Ysize;
+ sal_Int16 Xoffs;
+ sal_Int16 Yoffs;
+ sal_uInt16 Planes; // Layer
+ sal_uInt16 SwGrCol;
char Autor[10];
char Programm[10];
- UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (38 mod 4 =2) !
+ sal_uInt16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (38 mod 4 =2) !
- UINT32 GetOffset();
+ sal_uInt32 GetOffset();
friend SvStream& operator>>(SvStream& rIStream, SgfHeader& rHead);
- BOOL ChkMagic();
+ sal_Bool ChkMagic();
};
#define SgfEntrySize 22
class SgfEntry
{
public:
- UINT16 Typ;
- UINT16 iFrei;
- UINT16 lFreiLo,lFreiHi;
+ sal_uInt16 Typ;
+ sal_uInt16 iFrei;
+ sal_uInt16 lFreiLo,lFreiHi;
char cFrei[10];
- UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (18 mod 4 =2) !
+ sal_uInt16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (18 mod 4 =2) !
- UINT32 GetOffset();
+ sal_uInt32 GetOffset();
friend SvStream& operator>>(SvStream& rIStream, SgfEntry& rEntr);
};
@@ -89,10 +89,10 @@ public:
class SgfVector
{
public:
- UINT16 Flag;
- INT16 x;
- INT16 y;
- UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (6 mod 4 =2) !
+ sal_uInt16 Flag;
+ sal_Int16 x;
+ sal_Int16 y;
+ sal_uInt16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (6 mod 4 =2) !
friend SvStream& operator>>(SvStream& rIStream, SgfVector& rEntr);
};
@@ -103,7 +103,7 @@ extern long SgfVectXmul;
extern long SgfVectYmul;
extern long SgfVectXdiv;
extern long SgfVectYdiv;
-extern BOOL SgfVectScal;
+extern sal_Bool SgfVectScal;
////////////////////////////////////////////////////////////////////////////////////////////////////
// Windows BMP /////////////////////////////////////////////////////////////////////////////////////
@@ -113,15 +113,15 @@ extern BOOL SgfVectScal;
class BmpFileHeader
{
public:
- UINT16 Typ; // = "BM"
- UINT16 SizeLo,SizeHi; // Filesize in Bytes
- UINT16 Reserve1; // Reserviert
- UINT16 Reserve2; // Reserviert
- UINT16 OfsLo,OfsHi; // Offset?
-
- void SetSize(UINT32 Size);
- void SetOfs(UINT32 Size);
- UINT32 GetOfs();
+ sal_uInt16 Typ; // = "BM"
+ sal_uInt16 SizeLo,SizeHi; // Filesize in Bytes
+ sal_uInt16 Reserve1; // Reserviert
+ sal_uInt16 Reserve2; // Reserviert
+ sal_uInt16 OfsLo,OfsHi; // Offset?
+
+ void SetSize(sal_uInt32 Size);
+ void SetOfs(sal_uInt32 Size);
+ sal_uInt32 GetOfs();
friend SvStream& operator<<(SvStream& rOStream, BmpFileHeader& rHead);
};
@@ -129,17 +129,17 @@ public:
class BmpInfoHeader
{
public:
- UINT32 Size; // GrӇe des BmpInfoHeaders
- INT32 Width; // Breite in Pixel
- INT32 Hight; // H”he in Pixel
- UINT16 Planes; // Anzahl der Planes (immer 1)
- UINT16 PixBits; // Anzahl der Bit je Pixel (1,4,8,oder 24)
- UINT32 Compress; // Datenkompression
- UINT32 ImgSize; // GrӇe der Images in Bytes. Ohne Kompression ist auch 0 erlaubt.
- INT32 xDpmm; // Dot per Meter (0 ist erlaubt)
- INT32 yDpmm; // Dot per Meter (0 ist erlaubt)
- UINT32 ColUsed; // Anzahl der verwendeten Farben (0=alle)
- UINT32 ColMust; // Anzahl der wichtigen Farben (0=alle)
+ sal_uInt32 Size; // GrӇe des BmpInfoHeaders
+ sal_Int32 Width; // Breite in Pixel
+ sal_Int32 Hight; // H”he in Pixel
+ sal_uInt16 Planes; // Anzahl der Planes (immer 1)
+ sal_uInt16 PixBits; // Anzahl der Bit je Pixel (1,4,8,oder 24)
+ sal_uInt32 Compress; // Datenkompression
+ sal_uInt32 ImgSize; // GrӇe der Images in Bytes. Ohne Kompression ist auch 0 erlaubt.
+ sal_Int32 xDpmm; // Dot per Meter (0 ist erlaubt)
+ sal_Int32 yDpmm; // Dot per Meter (0 ist erlaubt)
+ sal_uInt32 ColUsed; // Anzahl der verwendeten Farben (0=alle)
+ sal_uInt32 ColMust; // Anzahl der wichtigen Farben (0=alle)
friend SvStream& operator<<(SvStream& rOStream, BmpInfoHeader& rHead);
};
@@ -147,12 +147,12 @@ public:
#define RGBQuadSize 4
class RGBQuad {
private:
- BYTE Red;
- BYTE Grn;
- BYTE Blu;
- BYTE Fil;
+ sal_uInt8 Red;
+ sal_uInt8 Grn;
+ sal_uInt8 Blu;
+ sal_uInt8 Fil;
public:
- RGBQuad(BYTE R, BYTE G, BYTE B) { Red=R; Grn=G; Blu=B; Fil=0; }
+ RGBQuad(sal_uInt8 R, sal_uInt8 G, sal_uInt8 B) { Red=R; Grn=G; Blu=B; Fil=0; }
};
#endif //_SGFBRAM_HXX
diff --git a/svtools/source/inc/sgffilt.hxx b/svtools/source/inc/sgffilt.hxx
index e21810c6109e..427ba7edc8b0 100644
--- a/svtools/source/inc/sgffilt.hxx
+++ b/svtools/source/inc/sgffilt.hxx
@@ -30,10 +30,10 @@
#define _SGFFILT_HXX
#include <tools/urlobj.hxx>
-BYTE CheckSgfTyp(SvStream& rInp, USHORT& nVersion);
-BOOL SgfBMapFilter(SvStream& rInp, SvStream& rOut);
-BOOL SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf);
-BOOL SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath );
+sal_uInt8 CheckSgfTyp(SvStream& rInp, sal_uInt16& nVersion);
+sal_Bool SgfBMapFilter(SvStream& rInp, SvStream& rOut);
+sal_Bool SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf);
+sal_Bool SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath );
// Konstanten fr CheckSgfTyp()
#define SGF_BITIMAGE 1 /* Bitmap */
diff --git a/svtools/source/inc/sgvmain.hxx b/svtools/source/inc/sgvmain.hxx
index 25a4785c9b15..b4c79e748ab6 100644
--- a/svtools/source/inc/sgvmain.hxx
+++ b/svtools/source/inc/sgvmain.hxx
@@ -37,8 +37,8 @@
#define UCHAR unsigned char
struct PointType {
- INT16 x;
- INT16 y;
+ sal_Int16 x;
+ sal_Int16 y;
};
#define SgfDpmm 40
@@ -46,7 +46,7 @@ struct PointType {
#define DtHdSize 256
class DtHdType {
public:
- BYTE Reserved[256];
+ sal_uInt8 Reserved[256];
friend SvStream& operator>>(SvStream& rIStream, DtHdType& rDtHd);
friend void DtHdOverSeek(SvStream& rInp);
};
@@ -54,30 +54,30 @@ public:
struct Seitenformat {
PointType Size; // 0.00mm...819.175mm (Papiergr��e)
- INT16 RandL; // links Rand auf
- INT16 RandR; // rechts dem Papier
- INT16 RandO; // oben Rand auf
- INT16 RandU; // unten dem Papier
- BYTE PColor; // Future Use
- BYTE PIntens; // erst recht Future use
-// BOOL BorderClip; // Objekte am Rand abschneiden (Schummel wg. Allignment unter NT)
+ sal_Int16 RandL; // links Rand auf
+ sal_Int16 RandR; // rechts dem Papier
+ sal_Int16 RandO; // oben Rand auf
+ sal_Int16 RandU; // unten dem Papier
+ sal_uInt8 PColor; // Future Use
+ sal_uInt8 PIntens; // erst recht Future use
+// sal_Bool BorderClip; // Objekte am Rand abschneiden (Schummel wg. Allignment unter NT)
};
#define PageSize 146
class PageType {
public:
- UINT32 Next; // N�chste Seite
- UINT32 nList; // Objektdaten, erster Record
- UINT32 ListEnd; // Objektdaten, letzter Record
+ sal_uInt32 Next; // N�chste Seite
+ sal_uInt32 nList; // Objektdaten, erster Record
+ sal_uInt32 ListEnd; // Objektdaten, letzter Record
Seitenformat Paper; // Papierdaten
- BOOL BorderClip; // Objekte am Rand abschneiden (Schummel wg. Allignment unter NT)
- BYTE StdPg; // welche Standardseite einblenden ?
+ sal_Bool BorderClip; // Objekte am Rand abschneiden (Schummel wg. Allignment unter NT)
+ sal_uInt8 StdPg; // welche Standardseite einblenden ?
PointType U; // Nullpunkt
- INT16 HlpLnH[20]; // Hilfslinien
- INT16 HlpLnV[20];
- BYTE LnAnzH;
- BYTE LnAnzV;
+ sal_Int16 HlpLnH[20]; // Hilfslinien
+ sal_Int16 HlpLnV[20];
+ sal_uInt8 LnAnzH;
+ sal_uInt8 LnAnzV;
UCHAR PgName[32]; // Seitenname
friend SvStream& operator>>(SvStream& rIStream, PageType& rPage);
};
@@ -87,21 +87,21 @@ enum ObjArtType {ObjStrk,ObjRect,ObjPoly,ObjCirc,ObjSpln,
ObjText,ObjGrup,ObjBmap,ObjVirt,ObjTxtX,ObjMaxi};
struct ObjLineType {
- BYTE LFarbe; // [Index]
- BYTE LBFarbe; // [Index]
- BYTE LIntens; // [%]
- BYTE LMuster; // [Index] inkl. Transparenz
- INT16 LMSize; // [Koeffizient/100]
- INT16 LDicke; // Strichst�rke
+ sal_uInt8 LFarbe; // [Index]
+ sal_uInt8 LBFarbe; // [Index]
+ sal_uInt8 LIntens; // [%]
+ sal_uInt8 LMuster; // [Index] inkl. Transparenz
+ sal_Int16 LMSize; // [Koeffizient/100]
+ sal_Int16 LDicke; // Strichst�rke
};
struct ObjAreaType {
- BYTE FFarbe; // [Index]
- BYTE FBFarbe; // [Index]
- BYTE FIntens; // [%]
- BYTE FDummy1; //
- INT16 FDummy2; //
- UINT16 FMuster; // [Index] inkl. Invers, Transparenz
+ sal_uInt8 FFarbe; // [Index]
+ sal_uInt8 FBFarbe; // [Index]
+ sal_uInt8 FIntens; // [%]
+ sal_uInt8 FDummy1; //
+ sal_Int16 FDummy2; //
+ sal_uInt16 FMuster; // [Index] inkl. Invers, Transparenz
};
#define ObjTextTypeSize 64
@@ -109,24 +109,24 @@ class ObjTextType {
public:
ObjLineType L; // Text-Outline (future)
ObjAreaType F; // Text innen
- UINT16 FontLo,FontHi;// z.B. 92500 (CG Times), zweigeteilt wegen DWordAllign in TextType.
- UINT16 Grad; // 0.5..32767.5 Pt - bei 1000 Pt sollte aber schlu� sein
- UINT16 Breite; // 1..65535% bitte nicht mehr als 500%
- BYTE Justify; // 2 Bit Vert (Hi), 3 Bit Hor (Lo)
- BYTE Kapit; // 1..255%
- UINT16 Schnitt; // 8 Flags
- UINT16 LnFeed; // 1..32767% vom max. Schriftgrad der Zeile
- UINT16 Slant; // Kursivwinkel 0.00..89.99� default 15.00� doppelt Breit angesehen)
- BYTE ZAbst; // Zeichenabstand 0..255% (0=auf der Stelle; 100=normal; 200=Zeichen wird als
- INT8 ChrVPos; // Zeichen V-Position default 0= on Baseline, 10= 5Pt drunter (-64..63�)
+ sal_uInt16 FontLo,FontHi;// z.B. 92500 (CG Times), zweigeteilt wegen DWordAllign in TextType.
+ sal_uInt16 Grad; // 0.5..32767.5 Pt - bei 1000 Pt sollte aber schlu� sein
+ sal_uInt16 Breite; // 1..65535% bitte nicht mehr als 500%
+ sal_uInt8 Justify; // 2 Bit Vert (Hi), 3 Bit Hor (Lo)
+ sal_uInt8 Kapit; // 1..255%
+ sal_uInt16 Schnitt; // 8 Flags
+ sal_uInt16 LnFeed; // 1..32767% vom max. Schriftgrad der Zeile
+ sal_uInt16 Slant; // Kursivwinkel 0.00..89.99� default 15.00� doppelt Breit angesehen)
+ sal_uInt8 ZAbst; // Zeichenabstand 0..255% (0=auf der Stelle; 100=normal; 200=Zeichen wird als
+ sal_sChar ChrVPos; // Zeichen V-Position default 0= on Baseline, 10= 5Pt drunter (-64..63�)
ObjLineType ShdL; // Schatten-Outline (neu 2.0)
ObjAreaType ShdF; // Schatten-innen (neu 2.0)
PointType ShdVers; // Schattenversatz Max.300.00%
- BOOL ShdAbs; // True-> Schattenversatz ist absolut statt relativ zum Schriftgrad
- BOOL NoSpc; // True-> kein Zwischenraum (f�r BackArea)
+ sal_Bool ShdAbs; // True-> Schattenversatz ist absolut statt relativ zum Schriftgrad
+ sal_Bool NoSpc; // True-> kein Zwischenraum (f�r BackArea)
ObjAreaType BackF; // Hintergrundfl�che
- UINT32 GetFont();
- void SetFont(UINT32 FontID);
+ sal_uInt32 GetFont();
+ void SetFont(sal_uInt32 FontID);
};
class Obj0Type { // SuperClass f�r Apple-VMT
@@ -138,16 +138,16 @@ public:
#define ObjkSize 20 /* eigentlich 21. Wg. Allignment ist Flags jedoch verschoben worden*/
class ObjkType: public Obj0Type { // Grundkomponenten aller Stardraw-Objekte
public:
- UINT32 Last;
- UINT32 Next;
- UINT16 MemSize; // in Bytes
+ sal_uInt32 Last;
+ sal_uInt32 Next;
+ sal_uInt16 MemSize; // in Bytes
PointType ObjMin; // XY-Minimum des Objekts
PointType ObjMax; // XY-Maximum des Objekts
- BYTE Art;
- BYTE Layer;
-// BYTE Flags; // (Schummel f�r Allignment unter NT)
+ sal_uInt8 Art;
+ sal_uInt8 Layer;
+// sal_uInt8 Flags; // (Schummel f�r Allignment unter NT)
friend SvStream& operator>>(SvStream& rIStream, ObjkType& rObjk);
- friend BOOL ObjOverSeek(SvStream& rInp, ObjkType& rObjk);
+ friend sal_Bool ObjOverSeek(SvStream& rInp, ObjkType& rObjk);
virtual void Draw(OutputDevice& rOut);
};
@@ -155,8 +155,8 @@ public:
#define StrkSize 38
class StrkType: public ObjkType {
public:
- BYTE Flags; // (Schummel f�r Allignment unter NT)
- BYTE LEnden; // Linienenden
+ sal_uInt8 Flags; // (Schummel f�r Allignment unter NT)
+ sal_uInt8 LEnden; // Linienenden
ObjLineType L;
PointType Pos1; // Anfangspunkt
PointType Pos2; // Endpunkt
@@ -168,15 +168,15 @@ public:
#define RectSize 52
class RectType: public ObjkType {
public:
- BYTE Flags; // (Schummel f�r Allignment unter NT)
- BYTE Reserve;
+ sal_uInt8 Flags; // (Schummel f�r Allignment unter NT)
+ sal_uInt8 Reserve;
ObjLineType L;
ObjAreaType F;
PointType Pos1; // LO-Ecke = Bezugspunkt
PointType Pos2; // R-Ecke
- INT16 Radius; // Eckenradius
- UINT16 DrehWink; // 315...<45
- UINT16 Slant; // >270...<90
+ sal_Int16 Radius; // Eckenradius
+ sal_uInt16 DrehWink; // 315...<45
+ sal_uInt16 Slant; // >270...<90
friend SvStream& operator>>(SvStream& rIStream, RectType& rRect);
virtual void Draw(OutputDevice& rOut);
};
@@ -185,13 +185,13 @@ public:
#define PolySize 44
class PolyType: public ObjkType { // identisch mit Spline !
public:
- BYTE Flags; // (Schummel f�r Allignment unter NT)
- BYTE LEnden; // nur f�r Polyline
+ sal_uInt8 Flags; // (Schummel f�r Allignment unter NT)
+ sal_uInt8 LEnden; // nur f�r Polyline
ObjLineType L;
ObjAreaType F; // nicht f�r Polyline
- BYTE nPoints;
- BYTE Reserve;
- UINT32 SD_EckP; // Zeiger auf die Eckpunkte (StarDraw)
+ sal_uInt8 nPoints;
+ sal_uInt8 Reserve;
+ sal_uInt32 SD_EckP; // Zeiger auf die Eckpunkte (StarDraw)
PointType* EckP; // Zeiger auf die Eckpunkte (StarView (wird nicht von Disk gelesen!))
friend SvStream& operator>>(SvStream& rIStream, PolyType& rPoly);
virtual void Draw(OutputDevice& rOut);
@@ -202,13 +202,13 @@ public:
#define SplnSize 44
class SplnType: public ObjkType { // identisch mit Poly !
public:
- BYTE Flags; // (Schummel f�r Allignment unter NT)
- BYTE LEnden; // nur f�r nSpline
+ sal_uInt8 Flags; // (Schummel f�r Allignment unter NT)
+ sal_uInt8 LEnden; // nur f�r nSpline
ObjLineType L;
ObjAreaType F; // nicht f�r nSpline
- BYTE nPoints;
- BYTE Reserve;
- UINT32 SD_EckP; // Zeiger auf die Eckpunkte (StarDraw)
+ sal_uInt8 nPoints;
+ sal_uInt8 Reserve;
+ sal_uInt32 SD_EckP; // Zeiger auf die Eckpunkte (StarDraw)
PointType* EckP; // Zeiger auf die Eckpunkte (StarView (wird nicht von Disk gelesen!))
friend SvStream& operator>>(SvStream& rIStream, SplnType& rSpln);
virtual void Draw(OutputDevice& rOut);
@@ -219,15 +219,15 @@ public:
#define CircSize 52
class CircType: public ObjkType {
public:
- BYTE Flags; // (Schummel f�r Allignment unter NT)
- BYTE LEnden; // nur Bogen (Kr & El)
+ sal_uInt8 Flags; // (Schummel f�r Allignment unter NT)
+ sal_uInt8 LEnden; // nur Bogen (Kr & El)
ObjLineType L;
ObjAreaType F; // nicht f�r Bogen (Kr & El)
PointType Center; // Mittelpunkt
PointType Radius; // Radius
- UINT16 DrehWink; // nur Ellipse
- UINT16 StartWink; // � nicht f�r Vollkreis
- UINT16 RelWink; // � und Vollellipse
+ sal_uInt16 DrehWink; // nur Ellipse
+ sal_uInt16 StartWink; // � nicht f�r Vollkreis
+ sal_uInt16 RelWink; // � und Vollellipse
friend SvStream& operator>>(SvStream& rIStream, CircType& rCirc);
virtual void Draw(OutputDevice& rOut);
};
@@ -240,19 +240,19 @@ public:
#define TextSize 116
class TextType: public ObjkType {
public:
- BYTE Flags; // (Schummel f�r Allignment unter NT)
- BYTE Reserve; // f�r Word Allign
+ sal_uInt8 Flags; // (Schummel f�r Allignment unter NT)
+ sal_uInt8 Reserve; // f�r Word Allign
ObjTextType T; // 64 Bytes << DWord-Allign bei FontID erforderlich
PointType Pos1; // Bezugspunkt (ObenLinks)
PointType Pos2; // (untenRechts)
- INT16 TopOfs; // Von Oberkante bis Textbegin (future f�r vJustify)
- UINT16 DrehWink; // 0...<360
- UINT16 BoxSlant; // >270...<90 (nur Box)
- UINT16 BufSize; // Gr��e von Buf f�r Load, Save, Copy und so
- UINT16 BufLo,BufHi;// (UCHAR*) Zeiger auf den Textbuffer << ShortArr, weil sonst DWord-Allign erforderlich
- UINT16 ExtLo,ExtHi;// (Ptr) Text �ber mehrere Rahmen << ShortArr, weil sonst DWord-Allign erforderlich
+ sal_Int16 TopOfs; // Von Oberkante bis Textbegin (future f�r vJustify)
+ sal_uInt16 DrehWink; // 0...<360
+ sal_uInt16 BoxSlant; // >270...<90 (nur Box)
+ sal_uInt16 BufSize; // Gr��e von Buf f�r Load, Save, Copy und so
+ sal_uInt16 BufLo,BufHi;// (UCHAR*) Zeiger auf den Textbuffer << ShortArr, weil sonst DWord-Allign erforderlich
+ sal_uInt16 ExtLo,ExtHi;// (Ptr) Text �ber mehrere Rahmen << ShortArr, weil sonst DWord-Allign erforderlich
PointType FitSize; // Ursprungsgr��e f�r Fit2Size
- INT16 FitBreit; // Breite zum formatieren bei Fit2Size
+ sal_Int16 FitBreit; // Breite zum formatieren bei Fit2Size
UCHAR* Buffer; // Diese Variable wird nicht durch Lesen von Disk gef�llt, sondern explizit!
friend SvStream& operator>>(SvStream& rIStream, TextType& rText);
virtual void Draw(OutputDevice& rOut);
@@ -269,21 +269,21 @@ enum GrafStat {NoGraf,Pic,Pcx,Hpgl,Img,Msp,Tiff,Dxf,Lot,Usr,Sgf};
#define BmapSize 132
class BmapType: public ObjkType {
public:
- BYTE Flags; // (Schummel f�r Allignment unter NT)
- BYTE Reserve;
+ sal_uInt8 Flags; // (Schummel f�r Allignment unter NT)
+ sal_uInt8 Reserve;
ObjAreaType F; // Farbe und Muster der 1-Plane Bitmap
PointType Pos1;
PointType Pos2;
- UINT16 DrehWink; // 315...<45 (Future)
- UINT16 Slant; // >270...<90 (Future)
+ sal_uInt16 DrehWink; // 315...<45 (Future)
+ sal_uInt16 Slant; // >270...<90 (Future)
UCHAR Filename[80]; // Pfad
PointType PixSize; // Gr��e in Pixel (0 bei Vektor)
GrafStat Format; // siehe GpmDef.Pas
- BYTE nPlanes; // Anzahl der Bitplanes (0 bei Vektor)
- BOOL RawOut; // als Raw ausgeben ?
- BOOL InvOut; // invertiert ausgeben ?
- BOOL LightOut; // aufhellen? (SD20)
- BYTE GrfFlg; // (SD20) 0=nSGF 1=Pcx 2=Hpgl 4=Raw $FF=Undef(f�r Fix in DrawBmp)
+ sal_uInt8 nPlanes; // Anzahl der Bitplanes (0 bei Vektor)
+ sal_Bool RawOut; // als Raw ausgeben ?
+ sal_Bool InvOut; // invertiert ausgeben ?
+ sal_Bool LightOut; // aufhellen? (SD20)
+ sal_uInt8 GrfFlg; // (SD20) 0=nSGF 1=Pcx 2=Hpgl 4=Raw $FF=Undef(f�r Fix in DrawBmp)
INetURLObject aFltPath; // F�r GraphicFilter
friend SvStream& operator>>(SvStream& rIStream, BmapType& rBmap);
@@ -295,13 +295,13 @@ public:
#define GrupSize 48
class GrupType: public ObjkType {
public:
- BYTE Flags; // (Schummel f�r Allignment unter NT)
+ sal_uInt8 Flags; // (Schummel f�r Allignment unter NT)
UCHAR Name[13]; // Name der Gruppe
- UINT16 SbLo,SbHi; // (Ptr) Gruppenliste << ShortArr, weil sonst DWord Allign erforderlich
- UINT16 UpLo,UpHi; // (Ptr) Vaterliste << ShortArr, weil sonst DWord Allign erforderlich
- UINT16 ChartSize; // Speicherbedarf der Diagrammstruktur Struktur
- UINT32 ChartPtr; // Diagrammstruktur
- UINT32 GetSubPtr(); // hier nur zum Checken, ob Sublist evtl. leer ist.
+ sal_uInt16 SbLo,SbHi; // (Ptr) Gruppenliste << ShortArr, weil sonst DWord Allign erforderlich
+ sal_uInt16 UpLo,UpHi; // (Ptr) Vaterliste << ShortArr, weil sonst DWord Allign erforderlich
+ sal_uInt16 ChartSize; // Speicherbedarf der Diagrammstruktur Struktur
+ sal_uInt32 ChartPtr; // Diagrammstruktur
+ sal_uInt32 GetSubPtr(); // hier nur zum Checken, ob Sublist evtl. leer ist.
friend SvStream& operator>>(SvStream& rIStream, GrupType& rGrup);
// virtual void Draw(OutputDevice& rOut);
};
@@ -309,26 +309,26 @@ public:
void SetLine(ObjLineType& rLine, OutputDevice& rOut);
void SetArea(ObjAreaType& rArea, OutputDevice& rOut);
-Color Sgv2SvFarbe(BYTE nFrb1, BYTE nFrb2, BYTE nInts);
-void RotatePoint(PointType& P, INT16 cx, INT16 cy, double sn, double cs);
-void RotatePoint(Point& P, INT16 cx, INT16 cy, double sn, double cs);
-INT16 iMulDiv(INT16 a, INT16 Mul, INT16 Div);
-UINT16 MulDiv(UINT16 a, UINT16 Mul, UINT16 Div);
+Color Sgv2SvFarbe(sal_uInt8 nFrb1, sal_uInt8 nFrb2, sal_uInt8 nInts);
+void RotatePoint(PointType& P, sal_Int16 cx, sal_Int16 cy, double sn, double cs);
+void RotatePoint(Point& P, sal_Int16 cx, sal_Int16 cy, double sn, double cs);
+sal_Int16 iMulDiv(sal_Int16 a, sal_Int16 Mul, sal_Int16 Div);
+sal_uInt16 MulDiv(sal_uInt16 a, sal_uInt16 Mul, sal_uInt16 Div);
class SgfFontOne {
public:
SgfFontOne* Next; // Zeiger f�r Listenverkettung
- UINT32 IFID;
- BOOL Bold;
- BOOL Ital;
- BOOL Sans;
- BOOL Serf;
- BOOL Fixd;
+ sal_uInt32 IFID;
+ sal_Bool Bold;
+ sal_Bool Ital;
+ sal_Bool Sans;
+ sal_Bool Serf;
+ sal_Bool Fixd;
FontFamily SVFamil;
CharSet SVChSet;
String SVFName; // z.B. "Times New Roman" = 15 Chars
- USHORT SVWidth; // Durchschnittliche Zeichenbreite in %
+ sal_uInt16 SVWidth; // Durchschnittliche Zeichenbreite in %
SgfFontOne();
void ReadOne( ByteString& ID, ByteString& Dsc);
};
@@ -338,15 +338,15 @@ public:
String FNam; // vollst�ndiger Filename des Inifiles
SgfFontOne* pList; // Listenanfang
SgfFontOne* Last; // Listenende
- UINT32 LastID; // f�r schnelleren Zugriff bei Wiederholungen
+ sal_uInt32 LastID; // f�r schnelleren Zugriff bei Wiederholungen
SgfFontOne* LastLn; // f�r schnelleren Zugriff bei Wiederholungen
- BOOL Tried;
+ sal_Bool Tried;
SgfFontLst();
~SgfFontLst();
void AssignFN(const String& rFName);
void ReadList();
void RausList();
- SgfFontOne* GetFontDesc(UINT32 ID);
+ SgfFontOne* GetFontDesc(sal_uInt32 ID);
};
#endif //_SGVMAIN_HXX
diff --git a/svtools/source/inc/sgvspln.hxx b/svtools/source/inc/sgvspln.hxx
index daa92e62db1c..18c86f743715 100644
--- a/svtools/source/inc/sgvspln.hxx
+++ b/svtools/source/inc/sgvspln.hxx
@@ -39,14 +39,14 @@
|* Polygons werden als Sttzstellen angenommen.
|* n liefert die Anzahl der Teilpolynome.
|* Ist die Berechnung fehlerfrei verlaufen, so
-|* liefert die Funktion TRUE. Nur in diesem Fall
+|* liefert die Funktion sal_True. Nur in diesem Fall
|* ist Speicher fr die Koeffizientenarrays
|* allokiert, der dann sp„ter vom Aufrufer mittels
|* delete freizugeben ist.
|*
*************************************************************************/
-BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n,
+sal_Bool CalcSpline(Polygon& rPoly, sal_Bool Periodic, sal_uInt16& n,
double*& ax, double*& ay, double*& bx, double*& by,
double*& cx, double*& cy, double*& dx, double*& dy, double*& T);
@@ -57,15 +57,15 @@ BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n,
|* Beschreibung Konvertiert einen parametrichen kubischen
|* Polynomspline Spline (natrlich oder periodisch)
|* in ein angen„hertes Polygon.
-|* Die Funktion liefert FALSE, wenn ein Fehler bei
+|* Die Funktion liefert sal_False, wenn ein Fehler bei
|* der Koeffizientenberechnung aufgetreten ist oder
-|* das Polygon zu groá wird (>PolyMax=16380). Im 1.
+|* das Polygon zu gro?wird (>PolyMax=16380). Im 1.
|* Fall hat das Polygon 0, im 2. Fall PolyMax Punkte.
|* Um Koordinatenberl„ufe zu vermeiden werden diese
|* auf +/-32000 begrenzt.
|*
*************************************************************************/
-BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly);
+sal_Bool Spline2Poly(Polygon& rSpln, sal_Bool Periodic, Polygon& rPoly);
#endif //_SGVSPLN_HXX
diff --git a/svtools/source/inc/svimpbox.hxx b/svtools/source/inc/svimpbox.hxx
index fdc7fb867542..122416f8764d 100644
--- a/svtools/source/inc/svimpbox.hxx
+++ b/svtools/source/inc/svimpbox.hxx
@@ -61,9 +61,9 @@ public:
void BeginDrag();
void CreateAnchor();
void DestroyAnchor();
- BOOL SetCursorAtPoint( const Point& rPoint,
- BOOL bDontSelectAtCursor=FALSE );
- BOOL IsSelectionAtPoint( const Point& rPoint );
+ sal_Bool SetCursorAtPoint( const Point& rPoint,
+ sal_Bool bDontSelectAtCursor=sal_False );
+ sal_Bool IsSelectionAtPoint( const Point& rPoint );
void DeselectAtPoint( const Point& rPoint );
void DeselectAll();
};
@@ -140,22 +140,22 @@ private:
long nNodeBmpWidth;
long nNextVerVisSize;
long nMostRight;
- ULONG nVisibleCount; // Anzahl Zeilen im Control
- ULONG nCurUserEvent; //-1 == kein Userevent amn Laufen
+ sal_uLong nVisibleCount; // Anzahl Zeilen im Control
+ sal_uLong nCurUserEvent; //-1 == kein Userevent amn Laufen
short nHorSBarHeight, nVerSBarWidth;
- USHORT nFlags;
- USHORT nCurTabPos;
+ sal_uInt16 nFlags;
+ sal_uInt16 nCurTabPos;
- WinBits nWinBits;
+ WinBits m_nStyle;
ExtendedWinBits nExtendedWinBits;
- BOOL bSimpleTravel : 1; // ist TRUE bei SINGLE_SELECTION
- BOOL bUpdateMode : 1;
- BOOL bInVScrollHdl : 1;
- BOOL bAsyncBeginDrag : 1;
- BOOL bSubLstOpRet : 1; // open/close sublist with return/enter, defaulted with FALSE
- BOOL bSubLstOpLR : 1; // open/close sublist with cursor left/right, defaulted with FALSE
- BOOL bContextMenuHandling : 1;
- BOOL bIsCellFocusEnabled : 1;
+ sal_Bool bSimpleTravel : 1; // ist sal_True bei SINGLE_SELECTION
+ sal_Bool bUpdateMode : 1;
+ sal_Bool bInVScrollHdl : 1;
+ sal_Bool bAsyncBeginDrag : 1;
+ sal_Bool bSubLstOpRet : 1; // open/close sublist with return/enter, defaulted with sal_False
+ sal_Bool bSubLstOpLR : 1; // open/close sublist with cursor left/right, defaulted with sal_False
+ sal_Bool bContextMenuHandling : 1;
+ sal_Bool bIsCellFocusEnabled : 1;
sal_Bool bAreChildrenTransient;
@@ -179,16 +179,16 @@ private:
void ShowVerSBar();
// setzt Thumb auf FirstEntryToDraw
void SyncVerThumb();
- BOOL IsLineVisible( long nY ) const;
+ sal_Bool IsLineVisible( long nY ) const;
long GetEntryLine( SvLBoxEntry* pEntry ) const;
void FillView();
void CursorDown();
void CursorUp();
void KeyLeftRight( long nDiff );
- void PageDown( USHORT nDelta );
- void PageUp( USHORT nDelta );
+ void PageDown( sal_uInt16 nDelta );
+ void PageUp( sal_uInt16 nDelta );
- void SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect = FALSE );
+ void SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect = sal_False );
void DrawNet();
@@ -202,39 +202,39 @@ private:
// Selection-Engine
SvLBoxEntry* MakePointVisible( const Point& rPoint,
- BOOL bNotifyScroll=TRUE );
+ sal_Bool bNotifyScroll=sal_True );
void SetAnchorSelection( SvLBoxEntry* pOld,
SvLBoxEntry* pNewCursor );
void BeginDrag();
- BOOL ButtonDownCheckCtrl( const MouseEvent& rMEvt,
+ sal_Bool ButtonDownCheckCtrl( const MouseEvent& rMEvt,
SvLBoxEntry* pEntry, long nY );
- BOOL MouseMoveCheckCtrl( const MouseEvent& rMEvt,
+ sal_Bool MouseMoveCheckCtrl( const MouseEvent& rMEvt,
SvLBoxEntry* pEntry );
- BOOL ButtonUpCheckCtrl( const MouseEvent& rMEvt );
- BOOL ButtonDownCheckExpand( const MouseEvent&,
+ sal_Bool ButtonUpCheckCtrl( const MouseEvent& rMEvt );
+ sal_Bool ButtonDownCheckExpand( const MouseEvent&,
SvLBoxEntry*,long nY );
- void PositionScrollBars( Size& rOSize, USHORT nMask );
- USHORT AdjustScrollBars( Size& rSize );
+ void PositionScrollBars( Size& rOSize, sal_uInt16 nMask );
+ sal_uInt16 AdjustScrollBars( Size& rSize );
void BeginScroll();
void EndScroll();
- BOOL InScroll() const { return (BOOL)(nFlags & F_IN_SCROLLING)!=0;}
+ sal_Bool InScroll() const { return (sal_Bool)(nFlags & F_IN_SCROLLING)!=0;}
Rectangle GetVisibleArea() const;
- BOOL EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPos,long nLine);
+ sal_Bool EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPos,long nLine);
void InitScrollBarBox();
SvLBoxTab* NextTab( SvLBoxTab* );
- BOOL SetMostRight( SvLBoxEntry* pEntry );
+ sal_Bool SetMostRight( SvLBoxEntry* pEntry );
void FindMostRight( SvLBoxEntry* EntryToIgnore );
void FindMostRight( SvLBoxEntry* pParent, SvLBoxEntry* EntryToIgnore );
void FindMostRight_Impl( SvLBoxEntry* pParent,SvLBoxEntry* EntryToIgnore );
void NotifyTabsChanged();
- inline BOOL IsExpandable() const // if element at cursor can be expanded in general
+ inline sal_Bool IsExpandable() const // if element at cursor can be expanded in general
{ return pCursor->HasChilds() || pCursor->HasChildsOnDemand(); }
- inline BOOL IsNowExpandable() const // if element at cursor can be expanded at this moment
+ inline sal_Bool IsNowExpandable() const // if element at cursor can be expanded at this moment
{ return IsExpandable() && !pView->IsExpanded( pCursor ); }
static void implInitDefaultNodeImages();
@@ -257,7 +257,7 @@ public:
~SvImpLBox();
void Clear();
- void SetWindowBits( WinBits nWinStyle );
+ void SetStyle( WinBits i_nWinStyle );
void SetExtendedWindowBits( ExtendedWinBits _nBits );
ExtendedWinBits GetExtendedWindowBits() const { return nExtendedWinBits; }
void SetModel( SvLBoxTreeList* pModel ) { pTree = pModel;}
@@ -273,40 +273,40 @@ public:
void EntryExpanded( SvLBoxEntry* pEntry );
void EntryCollapsed( SvLBoxEntry* pEntry );
void CollapsingEntry( SvLBoxEntry* pEntry );
- void EntrySelected( SvLBoxEntry*, BOOL bSelect );
+ void EntrySelected( SvLBoxEntry*, sal_Bool bSelect );
void Paint( const Rectangle& rRect );
void RepaintSelectionItems();
void MouseButtonDown( const MouseEvent& );
void MouseButtonUp( const MouseEvent& );
void MouseMove( const MouseEvent&);
- BOOL KeyInput( const KeyEvent& );
+ sal_Bool KeyInput( const KeyEvent& );
void Resize();
void GetFocus();
void LoseFocus();
void UpdateAll(
- BOOL bInvalidateCompleteView= TRUE,
- BOOL bUpdateVerSBar = TRUE );
+ sal_Bool bInvalidateCompleteView= sal_True,
+ sal_Bool bUpdateVerSBar = sal_True );
void SetEntryHeight( short nHeight );
void PaintEntry( SvLBoxEntry* pEntry );
void InvalidateEntry( SvLBoxEntry* );
void RecalcFocusRect();
- inline void SelectEntry( SvLBoxEntry* pEntry, BOOL bSelect );
+ inline void SelectEntry( SvLBoxEntry* pEntry, sal_Bool bSelect );
void SetDragDropMode( DragDropMode eDDMode );
void SetSelectionMode( SelectionMode eSelMode );
- void SetAddMode( BOOL ) { aSelEng.AddAlways(FALSE); }
- BOOL IsAddMode() const { return aSelEng.IsAlwaysAdding(); }
+ void SetAddMode( sal_Bool ) { aSelEng.AddAlways(sal_False); }
+ sal_Bool IsAddMode() const { return aSelEng.IsAlwaysAdding(); }
SvLBoxEntry* GetCurrentEntry() const { return pCursor; }
- BOOL IsEntryInView( SvLBoxEntry* ) const;
+ sal_Bool IsEntryInView( SvLBoxEntry* ) const;
SvLBoxEntry* GetEntry( const Point& rPos ) const;
// gibt letzten Eintrag zurueck, falls Pos unter letztem Eintrag
SvLBoxEntry* GetClickedEntry( const Point& ) const;
SvLBoxEntry* GetCurEntry() const { return pCursor; }
void SetCurEntry( SvLBoxEntry* );
Point GetEntryPosition( SvLBoxEntry* ) const;
- void MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop=FALSE );
+ void MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop=sal_False );
void PaintDDCursor( SvLBoxEntry* );
@@ -329,38 +329,38 @@ public:
static const Image& GetDefaultCollapsedNodeImage( );
const Size& GetOutputSize() const { return aOutputSize;}
- void KeyUp( BOOL bPageUp, BOOL bNotifyScroll = TRUE );
- void KeyDown( BOOL bPageDown, BOOL bNotifyScroll = TRUE );
- bool Command( const CommandEvent& rCEvt );
+ void KeyUp( sal_Bool bPageUp, sal_Bool bNotifyScroll = sal_True );
+ void KeyDown( sal_Bool bPageDown, sal_Bool bNotifyScroll = sal_True );
+ void Command( const CommandEvent& rCEvt );
void Invalidate();
void DestroyAnchor() { pAnchor=0; aSelEng.Reset(); }
- void SelAllDestrAnch( BOOL bSelect,
- BOOL bDestroyAnchor = TRUE,
- BOOL bSingleSelToo = FALSE );
- void ShowCursor( BOOL bShow );
+ void SelAllDestrAnch( sal_Bool bSelect,
+ sal_Bool bDestroyAnchor = sal_True,
+ sal_Bool bSingleSelToo = sal_False );
+ void ShowCursor( sal_Bool bShow );
- BOOL RequestHelp( const HelpEvent& rHEvt );
+ sal_Bool RequestHelp( const HelpEvent& rHEvt );
void EndSelection();
- BOOL IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) const;
+ sal_Bool IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) const;
void RepaintScrollBars();
- void EnableAsyncDrag( BOOL b) { bAsyncBeginDrag = b; }
- void SetUpdateMode( BOOL );
- void SetUpdateModeFast( BOOL );
- BOOL GetUpdateMode() const { return bUpdateMode; }
+ void EnableAsyncDrag( sal_Bool b) { bAsyncBeginDrag = b; }
+ void SetUpdateMode( sal_Bool );
+ void SetUpdateModeFast( sal_Bool );
+ sal_Bool GetUpdateMode() const { return bUpdateMode; }
Rectangle GetClipRegionRect() const;
- BOOL HasHorScrollBar() const { return aHorSBar.IsVisible(); }
+ sal_Bool HasHorScrollBar() const { return aHorSBar.IsVisible(); }
void ShowFocusRect( const SvLBoxEntry* pEntry );
void SetTabBar( TabBar* pTabBar );
void CancelPendingEdit();
- void CallEventListeners( ULONG nEvent, void* pData = NULL );
+ void CallEventListeners( sal_uLong nEvent, void* pData = NULL );
/** Enables, that one cell of a tablistbox entry can be focused */
- inline BOOL IsCellFocusEnabled() const { return bIsCellFocusEnabled; }
- inline void EnableCellFocus() { bIsCellFocusEnabled = TRUE; }
- bool SetCurrentTabPos( USHORT _nNewPos );
- inline USHORT GetCurrentTabPos() const { return nCurTabPos; }
+ inline sal_Bool IsCellFocusEnabled() const { return bIsCellFocusEnabled; }
+ inline void EnableCellFocus() { bIsCellFocusEnabled = sal_True; }
+ bool SetCurrentTabPos( sal_uInt16 _nNewPos );
+ inline sal_uInt16 GetCurrentTabPos() const { return nCurTabPos; }
bool IsSelectable( const SvLBoxEntry* pEntry );
};
@@ -432,11 +432,11 @@ inline void SvImpLBox::PaintEntry( SvLBoxEntry* pEntry )
pView->PaintEntry( pEntry, nY );
}
-inline BOOL SvImpLBox::IsLineVisible( long nY ) const
+inline sal_Bool SvImpLBox::IsLineVisible( long nY ) const
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if ( nY < 0 || nY >= aOutputSize.Height() )
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
diff --git a/svtools/source/inc/svimpicn.hxx b/svtools/source/inc/svimpicn.hxx
index 8d297e3476db..585827ff0c05 100644
--- a/svtools/source/inc/svimpicn.hxx
+++ b/svtools/source/inc/svimpicn.hxx
@@ -93,7 +93,6 @@ class SvImpIconView
nGridDY;
long nHorSBarHeight,
nVerSBarWidth;
- WinBits nWinBits;
int nViewMode;
long nHorDist;
long nVerDist;
@@ -101,8 +100,8 @@ class SvImpIconView
long nMaxBmpHeight;
long nMaxTextWidth;
long nMaxBoundHeight; // Hoehe des hoechsten BoundRects
- ULONG nFlags;
- ULONG nCurUserEvent;
+ sal_uLong nFlags;
+ sal_uLong nCurUserEvent;
SvLBoxEntry* pCurParent;
SvLBoxEntry* pCursor;
SvLBoxEntry* pNextCursor; // wird in MovingEntry gesetzt und ist
@@ -113,12 +112,12 @@ class SvImpIconView
VirtualDevice* pDDTempDev;
SvIconViewTextMode eTextMode;
- BOOL bMustRecalcBoundingRects;
+ sal_Bool bMustRecalcBoundingRects;
void CheckAllSizes();
void CheckSizes( SvLBoxEntry* pEntry,
const SvIcnVwDataEntry* pViewData = 0 );
- void ShowCursor( BOOL bShow );
+ void ShowCursor( sal_Bool bShow );
void SetNextEntryPos(const Point& rPos);
Point FindNextEntryPos( const Size& rBoundSize );
@@ -135,7 +134,7 @@ class SvImpIconView
void AdjustScrollBars();
void PositionScrollBars( long nRealWidth, long nRealHeight );
void CalcDocPos( Point& aMousePos );
- BOOL GetResizeRect( Rectangle& );
+ sal_Bool GetResizeRect( Rectangle& );
void PaintResizeRect( const Rectangle& );
SvLBoxEntry* GetNewCursor();
void ToggleSelection( SvLBoxEntry* );
@@ -158,8 +157,8 @@ class SvImpIconView
SvIconViewTextMode GetEntryTextModeSmart( const SvLBoxEntry* pEntry,
const SvIcnVwDataEntry* pViewData ) const;
- BOOL CheckVerScrollBar();
- BOOL CheckHorScrollBar();
+ sal_Bool CheckVerScrollBar();
+ sal_Bool CheckHorScrollBar();
void CancelUserEvent();
public:
@@ -167,8 +166,8 @@ public:
SvImpIconView( SvIconView* pView, SvLBoxTreeList*, WinBits nWinStyle );
~SvImpIconView();
- void Clear( BOOL bInCtor = FALSE );
- void SetWindowBits( WinBits nWinStyle );
+ void Clear( sal_Bool bInCtor = sal_False );
+ void SetStyle( const WinBits i_nWinStyle );
void SetModel( SvLBoxTreeList* pTree, SvLBoxEntry* pParent )
{ pModel = pTree; SetCurParent(pParent); }
void EntryInserted( SvLBoxEntry*);
@@ -182,14 +181,14 @@ public:
void EntryExpanded( SvLBoxEntry* pEntry );
void EntryCollapsed( SvLBoxEntry* pEntry );
void CollapsingEntry( SvLBoxEntry* pEntry );
- void EntrySelected( SvLBoxEntry*, BOOL bSelect );
+ void EntrySelected( SvLBoxEntry*, sal_Bool bSelect );
void Paint( const Rectangle& rRect );
void RepaintSelectionItems();
void MouseButtonDown( const MouseEvent& );
void MouseButtonUp( const MouseEvent& );
void MouseMove( const MouseEvent&);
- BOOL KeyInput( const KeyEvent& );
+ sal_Bool KeyInput( const KeyEvent& );
void Resize();
void GetFocus();
void LoseFocus();
@@ -199,8 +198,8 @@ public:
void PaintEntry( SvLBoxEntry*, const Point&,
SvIcnVwDataEntry* pViewData = 0, OutputDevice* pOut = 0);
void SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos,
- BOOL bAdjustRow = FALSE,
- BOOL bCheckScrollBars = FALSE );
+ sal_Bool bAdjustRow = sal_False,
+ sal_Bool bCheckScrollBars = sal_False );
void InvalidateEntry( SvLBoxEntry* );
void ViewDataInitialized( SvLBoxEntry* pEntry );
SvLBoxItem* GetItem( SvLBoxEntry*, const Point& rAbsPos );
@@ -215,7 +214,7 @@ public:
SvLBoxEntry* GetCurEntry() const { return pCursor; }
void SetCursor( SvLBoxEntry* );
- BOOL IsEntryInView( SvLBoxEntry* );
+ sal_Bool IsEntryInView( SvLBoxEntry* );
SvLBoxEntry* GetEntry( const Point& rDocPos );
SvLBoxEntry* GetNextEntry( const Point& rDocPos, SvLBoxEntry* pCurEntry );
SvLBoxEntry* GetPrevEntry( const Point& rDocPos, SvLBoxEntry* pCurEntry );
@@ -235,7 +234,7 @@ public:
SvIcnVwDataEntry* pViewData=0 );
Rectangle CalcTextRect( SvLBoxEntry*, SvLBoxString* pItem = 0,
const Point* pPos = 0,
- BOOL bForInplaceEdit = FALSE,
+ sal_Bool bForInplaceEdit = sal_False,
SvIcnVwDataEntry* pViewData = 0 );
long CalcBoundingWidth( SvLBoxEntry*, const SvIcnVwDataEntry* pViewData = 0) const;
@@ -252,22 +251,22 @@ public:
SvIcnVwDataEntry* pViewData=0);
void InvalidateBoundingRect( SvLBoxEntry* );
void InvalidateBoundingRect( Rectangle& rRect ) { rRect.Right() = LONG_MAX; }
- BOOL IsBoundingRectValid( const Rectangle& rRect ) const { return (BOOL)( rRect.Right() != LONG_MAX ); }
+ sal_Bool IsBoundingRectValid( const Rectangle& rRect ) const { return (sal_Bool)( rRect.Right() != LONG_MAX ); }
- void PaintEmphasis( const Rectangle&, BOOL bSelected,
- BOOL bCursored, OutputDevice* pOut = 0 );
+ void PaintEmphasis( const Rectangle&, sal_Bool bSelected,
+ sal_Bool bCursored, OutputDevice* pOut = 0 );
void PaintItem( const Rectangle& rRect, SvLBoxItem* pItem,
- SvLBoxEntry* pEntry, USHORT nPaintFlags, OutputDevice* pOut = 0 );
- // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == TRUE
+ SvLBoxEntry* pEntry, sal_uInt16 nPaintFlags, OutputDevice* pOut = 0 );
+ // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == sal_True
void CheckBoundingRects() { if (bMustRecalcBoundingRects) RecalcAllBoundingRects(); }
// berechnet alle invalidierten BoundingRects neu
void UpdateBoundingRects();
- void ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow );
+ void ShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool bShow );
SvLBoxEntry* GetDropTarget( const Point& rPosPixel );
- BOOL NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
- SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos );
- BOOL NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
- SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos );
+ sal_Bool NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos );
+ sal_Bool NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos );
void WriteDragServerInfo( const Point&, SvLBoxDDInfo* );
void ReadDragServerInfo( const Point&, SvLBoxDDInfo* );
@@ -275,9 +274,9 @@ public:
void SetCurParent( SvLBoxEntry* pNewParent );
SvLBoxEntry* GetCurParent() const { return pCurParent; }
- USHORT GetSelectionCount() const;
+ sal_uInt16 GetSelectionCount() const;
void SetGrid( long nDX, long nDY );
- void Scroll( long nDeltaX, long nDeltaY, BOOL bScrollBar = FALSE );
+ void Scroll( long nDeltaX, long nDeltaY, sal_Bool bScrollBar = sal_False );
const Size& GetItemSize( SvIconView* pView, SvLBoxEntry*, SvLBoxItem*,
const SvIcnVwDataEntry* pViewData = 0 ) const;
void PrepareCommandEvent( const Point& rPt );
@@ -288,18 +287,18 @@ public:
SvLBoxEntry* mpViewData;
- BOOL IsOver( SvPtrarr* pSelectedRectList, const Rectangle& rEntryBoundRect ) const;
- void SelectRect( const Rectangle&, BOOL bAdd = TRUE,
+ sal_Bool IsOver( SvPtrarr* pSelectedRectList, const Rectangle& rEntryBoundRect ) const;
+ void SelectRect( const Rectangle&, sal_Bool bAdd = sal_True,
SvPtrarr* pOtherRects = 0,
short nOffs = SELRECT_BORDER_OFFS );
void DrawSelectionRect( const Rectangle& );
void HideSelectionRect();
void CalcScrollOffsets( const Point& rRefPosPixel,
- long& rX, long& rY, BOOL bDragDrop = FALSE,
- USHORT nBorderWidth = 10 );
+ long& rX, long& rY, sal_Bool bDragDrop = sal_False,
+ sal_uInt16 nBorderWidth = 10 );
void EndTracking();
- BOOL IsTextHit( SvLBoxEntry* pEntry, const Point& rDocPos );
- void MakeVisible( const Rectangle& rDocPos,BOOL bInScrollBarEvent=FALSE);
+ sal_Bool IsTextHit( SvLBoxEntry* pEntry, const Point& rDocPos );
+ void MakeVisible( const Rectangle& rDocPos,sal_Bool bInScrollBarEvent=sal_False);
void AdjustAtGrid( SvLBoxEntry* pStart = 0 );
void SetTextMode( SvIconViewTextMode, SvLBoxEntry* pEntry = 0 );
SvIconViewTextMode GetTextMode( const SvLBoxEntry* pEntry = 0,
diff --git a/svtools/source/inc/xbmread.hxx b/svtools/source/inc/xbmread.hxx
index 030a09a6185e..0e9b178e9428 100644
--- a/svtools/source/inc/xbmread.hxx
+++ b/svtools/source/inc/xbmread.hxx
@@ -66,13 +66,13 @@ class XBMReader : public GraphicReader
long nLastPos;
long nWidth;
long nHeight;
- BOOL bStatus;
+ sal_Bool bStatus;
void InitTable();
ByteString FindTokenLine( SvStream* pInStm, const char* pTok1,
const char* pTok2 = NULL, const char* pTok3 = NULL );
long ParseDefine( const sal_Char* pDefine );
- BOOL ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat );
+ sal_Bool ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat );
public:
@@ -89,7 +89,7 @@ public:
// - ImportXBM -
// -------------
-BOOL ImportXBM( SvStream& rStream, Graphic& rGraphic );
+sal_Bool ImportXBM( SvStream& rStream, Graphic& rGraphic );
#endif // _XBMREAD_HXX
diff --git a/svtools/source/inc/xpmread.hxx b/svtools/source/inc/xpmread.hxx
index 0ef3d625525a..825a0efe34ea 100644
--- a/svtools/source/inc/xpmread.hxx
+++ b/svtools/source/inc/xpmread.hxx
@@ -82,35 +82,35 @@ private:
BitmapWriteAccess* mpMaskAcc;
long mnLastPos;
- ULONG mnWidth;
- ULONG mnHeight;
- ULONG mnColors;
- ULONG mnCpp; // characters per pix
- BOOL mbTransparent;
- BOOL mbStatus;
- ULONG mnStatus;
- ULONG mnIdentifier;
- BYTE mcThisByte;
- BYTE mcLastByte;
- ULONG mnTempAvail;
- BYTE* mpTempBuf;
- BYTE* mpTempPtr;
- BYTE* mpFastColorTable;
- BYTE* mpColMap;
- ULONG mnStringSize;
- BYTE* mpStringBuf;
- ULONG mnParaSize;
- BYTE* mpPara;
-
- BOOL ImplGetString( void );
- BOOL ImplGetColor( ULONG );
- BOOL ImplGetScanLine( ULONG );
- BOOL ImplGetColSub( BYTE* );
- BOOL ImplGetColKey( BYTE );
- void ImplGetRGBHex( BYTE*, ULONG );
- BOOL ImplGetPara( ULONG numb );
- BOOL ImplCompare( BYTE*, BYTE*, ULONG, ULONG nmode = XPMCASENONSENSITIVE );
- ULONG ImplGetULONG( ULONG nPara );
+ sal_uLong mnWidth;
+ sal_uLong mnHeight;
+ sal_uLong mnColors;
+ sal_uLong mnCpp; // characters per pix
+ sal_Bool mbTransparent;
+ sal_Bool mbStatus;
+ sal_uLong mnStatus;
+ sal_uLong mnIdentifier;
+ sal_uInt8 mcThisByte;
+ sal_uInt8 mcLastByte;
+ sal_uLong mnTempAvail;
+ sal_uInt8* mpTempBuf;
+ sal_uInt8* mpTempPtr;
+ sal_uInt8* mpFastColorTable;
+ sal_uInt8* mpColMap;
+ sal_uLong mnStringSize;
+ sal_uInt8* mpStringBuf;
+ sal_uLong mnParaSize;
+ sal_uInt8* mpPara;
+
+ sal_Bool ImplGetString( void );
+ sal_Bool ImplGetColor( sal_uLong );
+ sal_Bool ImplGetScanLine( sal_uLong );
+ sal_Bool ImplGetColSub( sal_uInt8* );
+ sal_Bool ImplGetColKey( sal_uInt8 );
+ void ImplGetRGBHex( sal_uInt8*, sal_uLong );
+ sal_Bool ImplGetPara( sal_uLong numb );
+ sal_Bool ImplCompare( sal_uInt8*, sal_uInt8*, sal_uLong, sal_uLong nmode = XPMCASENONSENSITIVE );
+ sal_uLong ImplGetULONG( sal_uLong nPara );
public:
XPMReader( SvStream& rStm );
@@ -125,7 +125,7 @@ public:
// - ImportXPM -
// -------------
-BOOL ImportXPM( SvStream& rStream, Graphic& rGraphic );
+sal_Bool ImportXPM( SvStream& rStream, Graphic& rGraphic );
#endif // _XPMREAD_HXX
diff --git a/svtools/source/java/javainteractionhandler.cxx b/svtools/source/java/javainteractionhandler.cxx
index 6c76d463216e..e4bf442ed42d 100644
--- a/svtools/source/java/javainteractionhandler.cxx
+++ b/svtools/source/java/javainteractionhandler.cxx
@@ -126,7 +126,7 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
com::sun::star::java::RestartRequiredException e5;
// Try to recover the Exception type in the any and
// react accordingly.
- USHORT nResult = RET_CANCEL;
+ sal_uInt16 nResult = RET_CANCEL;
::rtl::OUString aParameter;
if ( anyExc >>= e1 )
@@ -136,28 +136,10 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
// No suitable JRE found
SolarMutexGuard aSolarGuard;
m_bJavaNotFound_Handled = true;
- //We first try to get the patch resource svp680xxx.res
- //If the resource is not found then svt680xxx.res is used
- ResId idWBX = SvtResId(WARNINGBOX_JAVANOTFOUND);
- SvpResId pidPatchWBX(WARNINGBOX_JAVANOTFOUND);
- pidPatchWBX.SetRT(RSC_WARNINGBOX);
- ResMgr *pMgrWB = pidPatchWBX.GetResMgr();
- if (pMgrWB && pMgrWB->IsAvailable(pidPatchWBX))
- idWBX = pidPatchWBX;
- WarningBox aWarningBox( NULL, idWBX);
-
- String aTitle;
- SvpResId pidString(STR_WARNING_JAVANOTFOUND);
- pidString.SetRT(RSC_STRING);
- ResMgr *pmgr = pidString.GetResMgr();
- if ( pmgr && pmgr->IsAvailable(pidString))
- aTitle = String(pidString);
- else
- aTitle = String( SvtResId( STR_WARNING_JAVANOTFOUND ));
-
+ WarningBox aWarningBox( NULL, SvtResId( WARNINGBOX_JAVANOTFOUND ) );
+ String aTitle( SvtResId( STR_WARNING_JAVANOTFOUND ) );
aWarningBox.SetText( aTitle );
nResult = aWarningBox.Execute();
-
}
else
{
@@ -171,25 +153,8 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
// javavendors.xml was updated and Java has not been configured yet
SolarMutexGuard aSolarGuard;
m_bInvalidSettings_Handled = true;
- //We first try to get the patch resource svp680xxx.res
- //If the resource is not found then svt680xxx.res is used
- ResId idWBX = SvtResId(WARNINGBOX_INVALIDJAVASETTINGS);
- SvpResId pidPatchWBX(WARNINGBOX_INVALIDJAVASETTINGS);
- pidPatchWBX.SetRT(RSC_WARNINGBOX);
- ResMgr *pMgrWB = pidPatchWBX.GetResMgr();
- if (pMgrWB && pMgrWB->IsAvailable(pidPatchWBX))
- idWBX = pidPatchWBX;
- WarningBox aWarningBox( NULL, idWBX);
-
- String aTitle;
- SvpResId pidString(STR_WARNING_INVALIDJAVASETTINGS);
- pidString.SetRT(RSC_STRING);
- ResMgr *pmgr = pidString.GetResMgr();
- if ( pmgr && pmgr->IsAvailable(pidString))
- aTitle = String(pidString);
- else
- aTitle = String( SvtResId(STR_WARNING_INVALIDJAVASETTINGS));
-
+ WarningBox aWarningBox( NULL, SvtResId( WARNINGBOX_INVALIDJAVASETTINGS ) );
+ String aTitle( SvtResId(STR_WARNING_INVALIDJAVASETTINGS));
aWarningBox.SetText( aTitle );
nResult = aWarningBox.Execute();
}
@@ -205,28 +170,8 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
SolarMutexGuard aSolarGuard;
m_bJavaDisabled_Handled = true;
// Java disabled. Give user a chance to enable Java inside Office.
- //We first try to get the patch resource svp680xxx.res
- //If the resource is not found then svt680xxx.res is used
- ResId idQBX = SvtResId( QBX_JAVADISABLED );
- SvpResId pidPatchQBX(QBX_JAVADISABLED);
- pidPatchQBX.SetRT(RSC_QUERYBOX);
- ResMgr *pMgrQB = pidPatchQBX.GetResMgr();
-
- if (pMgrQB && pMgrQB->IsAvailable(pidPatchQBX))
- idQBX = pidPatchQBX;
-
- QueryBox aQueryBox(NULL, idQBX);
-
- String aTitle;
-
- SvpResId pidString(STR_QUESTION_JAVADISABLED);
- pidString.SetRT(RSC_STRING);
- ResMgr *pmgr = pidString.GetResMgr();
- if ( pmgr && pmgr->IsAvailable(pidString))
- aTitle = String(pidString);
- else
- aTitle = String( SvtResId( STR_QUESTION_JAVADISABLED ));
-
+ QueryBox aQueryBox( NULL, SvtResId( QBX_JAVADISABLED ) );
+ String aTitle( SvtResId( STR_QUESTION_JAVADISABLED ) );
aQueryBox.SetText( aTitle );
nResult = aQueryBox.Execute();
if ( nResult == RET_YES )
@@ -249,25 +194,8 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
// Java not correctly installed, or damaged
SolarMutexGuard aSolarGuard;
m_bVMCreationFailure_Handled = true;
- //We first try to get the patch resource svp680xxx.res
- //If the resource is not found then svt680xxx.res is used
- ResId idEBX = SvtResId(ERRORBOX_JVMCREATIONFAILED);
- SvpResId pidPatchEBX(ERRORBOX_JVMCREATIONFAILED);
- pidPatchEBX.SetRT(RSC_ERRORBOX);
- ResMgr *pMgrEB = pidPatchEBX.GetResMgr();
- if (pMgrEB && pMgrEB->IsAvailable(pidPatchEBX))
- idEBX = pidPatchEBX;
- ErrorBox aErrorBox( NULL, idEBX);
-
- String aTitle;
- SvpResId pidString(STR_ERROR_JVMCREATIONFAILED);
- pidString.SetRT(RSC_STRING);
- ResMgr *pmgr = pidString.GetResMgr();
- if ( pmgr && pmgr->IsAvailable(pidString))
- aTitle = String(pidString);
- else
- aTitle = String( SvtResId(STR_ERROR_JVMCREATIONFAILED));
-
+ ErrorBox aErrorBox( NULL, SvtResId( ERRORBOX_JVMCREATIONFAILED ) );
+ String aTitle( SvtResId( STR_ERROR_JVMCREATIONFAILED ) );
aErrorBox.SetText( aTitle );
nResult = aErrorBox.Execute();
}
@@ -284,25 +212,8 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
//before it can be used.
SolarMutexGuard aSolarGuard;
m_bRestartRequired_Handled = true;
- //We first try to get the patch resource svp680xxx.res
- //If the resource is not found then svt680xxx.res is used
- ResId idEBX = SvtResId(ERRORBOX_RESTARTREQUIRED);
- SvpResId pidPatchEBX(ERRORBOX_RESTARTREQUIRED);
- pidPatchEBX.SetRT(RSC_ERRORBOX);
- ResMgr *pMgrEB = pidPatchEBX.GetResMgr();
- if (pMgrEB && pMgrEB->IsAvailable(pidPatchEBX))
- idEBX = pidPatchEBX;
- ErrorBox aErrorBox(NULL, idEBX);
-
- String aTitle;
- SvpResId pidString(STR_ERROR_RESTARTREQUIRED);
- pidString.SetRT(RSC_STRING);
- ResMgr *pmgr = pidString.GetResMgr();
- if ( pmgr && pmgr->IsAvailable(pidString))
- aTitle = String(pidString);
- else
- aTitle = String( SvtResId(STR_ERROR_RESTARTREQUIRED));
-
+ ErrorBox aErrorBox(NULL, SvtResId( ERRORBOX_RESTARTREQUIRED ) );
+ String aTitle( SvtResId( STR_ERROR_RESTARTREQUIRED ) );
aErrorBox.SetText( aTitle );
nResult = aErrorBox.Execute();
}
diff --git a/svtools/source/java/makefile.mk b/svtools/source/java/makefile.mk
deleted file mode 100644
index 6db57388dca0..000000000000
--- a/svtools/source/java/makefile.mk
+++ /dev/null
@@ -1,54 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=java
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SRS1NAME= javaerror
-SRC1FILES= javaerror.src
-
-SRS2NAME= patchjavaerror
-SRC2FILES= patchjavaerror.src
-
-
-SLOFILES= \
- $(SLO)$/javainteractionhandler.obj \
- $(SLO)$/javacontext.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svtools/source/java/patchjavaerror.src b/svtools/source/java/patchjavaerror.src
deleted file mode 100644
index fb750968b798..000000000000
--- a/svtools/source/java/patchjavaerror.src
+++ /dev/null
@@ -1,91 +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.
- *
- ************************************************************************/
-
-#include <svtools/svtools.hrc>
-
-WarningBox WARNINGBOX_JAVANOTFOUND
-{
- Buttons = WB_OK ;
- DefButton = WB_DEF_OK ;
- Message[ en-US ] ="%PRODUCTNAME requires a Java runtime environment (JRE) to perform this task. Please install a JRE and restart %PRODUCTNAME.";
-};
-
-WarningBox WARNINGBOX_INVALIDJAVASETTINGS
-{
- Buttons = WB_OK ;
- DefButton = WB_DEF_OK ;
- Message[ en-US ] ="The %PRODUCTNAME configuration has been changed. Under Tools - Options - %PRODUCTNAME - Java, select the Java runtime environment you want to have used by %PRODUCTNAME.";
-};
-
-QueryBox QBX_JAVADISABLED
-{
- Buttons = WB_YES_NO_CANCEL ;
- DefButton = WB_DEF_YES ;
- Message[ en-US ] = "%PRODUCTNAME requires a Java runtime environment (JRE) to perform this task. However, use of a JRE has been disabled. Do you want to enable the use of a JRE now?";
-};
-
-ErrorBox ERRORBOX_JVMCREATIONFAILED
-{
- Buttons = WB_OK;
- DefButton = WB_DEF_OK ;
- Message[ en-US ] = "%PRODUCTNAME requires a Java runtime environment (JRE) to perform this task. The selected JRE is defective. Please select another version or install a new JRE and select it under Tools - Options - %PRODUCTNAME - Java.";
-};
-
-ErrorBox ERRORBOX_RESTARTREQUIRED
-{
- Buttons = WB_OK;
- DefButton = WB_DEF_OK ;
- Message[ en-US ] = "For the selected Java runtime environment to work properly, %PRODUCTNAME must be restarted. Please restart %PRODUCTNAME now.";
-};
-
-
-
-String STR_WARNING_JAVANOTFOUND
-{
- Text[ en-US ] = "JRE Required" ;
-};
-
-String STR_WARNING_INVALIDJAVASETTINGS
-{
- Text[ en-US ] = "Select JRE";
-};
-
-String STR_ERROR_RESTARTREQUIRED
-{
- Text[ en-US ] = "Restart Required";
-};
-
-String STR_QUESTION_JAVADISABLED
-{
- Text[ en-US ] = "Enable JRE" ;
-};
-
-
-String STR_ERROR_JVMCREATIONFAILED
-{
- Text[ en-US ] = "JRE is Defective" ;
-};
diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx
index 200163c0d3db..c18071664a03 100644
--- a/svtools/source/misc/acceleratorexecute.cxx
+++ b/svtools/source/misc/acceleratorexecute.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "acceleratorexecute.hxx"
+#include <svtools/acceleratorexecute.hxx>
//===============================================
// includes
@@ -254,7 +254,7 @@ KeyCode AcceleratorExecute::st_AWTKey2VCLKey(const css::awt::KeyEvent& aAWTKey)
sal_Bool bMod1 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD1 ) == css::awt::KeyModifier::MOD1 );
sal_Bool bMod2 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD2 ) == css::awt::KeyModifier::MOD2 );
sal_Bool bMod3 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD3 ) == css::awt::KeyModifier::MOD3 );
- USHORT nKey = (USHORT)aAWTKey.KeyCode;
+ sal_uInt16 nKey = (sal_uInt16)aAWTKey.KeyCode;
return KeyCode(nKey, bShift, bMod1, bMod2, bMod3);
}
diff --git a/svtools/source/misc/cliplistener.cxx b/svtools/source/misc/cliplistener.cxx
index 741e62cb64a8..f059e5eb9c0b 100644
--- a/svtools/source/misc/cliplistener.cxx
+++ b/svtools/source/misc/cliplistener.cxx
@@ -35,7 +35,7 @@
#include <vcl/window.hxx>
#include <osl/mutex.hxx>
-#include "cliplistener.hxx"
+#include <svtools/cliplistener.hxx>
#include <svtools/transfer.hxx>
using namespace ::com::sun::star;
@@ -69,7 +69,7 @@ void SAL_CALL TransferableClipboardListener::changedContents(
}
}
-void TransferableClipboardListener::AddRemoveListener( Window* pWin, BOOL bAdd )
+void TransferableClipboardListener::AddRemoveListener( Window* pWin, sal_Bool bAdd )
{
try
{
diff --git a/svtools/source/misc/dialogclosedlistener.cxx b/svtools/source/misc/dialogclosedlistener.cxx
index a1edf0e5b859..f07d24b536a9 100644
--- a/svtools/source/misc/dialogclosedlistener.cxx
+++ b/svtools/source/misc/dialogclosedlistener.cxx
@@ -27,7 +27,7 @@
************************************************************************/
#include "precompiled_svtools.hxx"
-#include "dialogclosedlistener.hxx"
+#include <svtools/dialogclosedlistener.hxx>
//.........................................................................
namespace svt
diff --git a/svtools/source/misc/dialogcontrolling.cxx b/svtools/source/misc/dialogcontrolling.cxx
index c46ebfa7f85d..d5e9ac545962 100644
--- a/svtools/source/misc/dialogcontrolling.cxx
+++ b/svtools/source/misc/dialogcontrolling.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "dialogcontrolling.hxx"
+#include <svtools/dialogcontrolling.hxx>
#include <vcl/window.hxx>
#include <algorithm>
diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx
index f146a84a969e..405b98588598 100644
--- a/svtools/source/misc/ehdl.cxx
+++ b/svtools/source/misc/ehdl.cxx
@@ -31,7 +31,7 @@
#include <osl/mutex.hxx>
#include <tools/debug.hxx>
#include <tools/rcid.h>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
#if defined(OS2)
@@ -41,13 +41,13 @@
#include <svtools/ehdl.hxx>
#include <svtools/svtdata.hxx>
#include <svtools/svtools.hrc>
-#include "sfxecode.hxx"
+#include <svtools/sfxecode.hxx>
//=========================================================================
-static USHORT aWndFunc(
+static sal_uInt16 aWndFunc(
Window *pWin, // Parent des Dialoges
- USHORT nFlags,
+ sal_uInt16 nFlags,
const String &rErr, // Fehlertext
const String &rAction) // Actiontext
@@ -130,7 +130,7 @@ static USHORT aWndFunc(
}
}
- USHORT nRet = RET_CANCEL;
+ sal_uInt16 nRet = RET_CANCEL;
switch ( pBox->Execute() )
{
case RET_OK:
@@ -158,7 +158,7 @@ static USHORT aWndFunc(
//-------------------------------------------------------------------------
-SfxErrorHandler::SfxErrorHandler(USHORT nIdP, ULONG lStartP, ULONG lEndP, ResMgr *pMgrP) :
+SfxErrorHandler::SfxErrorHandler(sal_uInt16 nIdP, sal_uLong lStartP, sal_uLong lEndP, ResMgr *pMgrP) :
lStart(lStartP), lEnd(lEndP), nId(nIdP), pMgr(pMgrP), pFreeMgr( NULL )
@@ -181,8 +181,8 @@ SfxErrorHandler::~SfxErrorHandler()
//-------------------------------------------------------------------------
-BOOL SfxErrorHandler::CreateString(
- const ErrorInfo *pErr, String &rStr, USHORT& nFlags) const
+sal_Bool SfxErrorHandler::CreateString(
+ const ErrorInfo *pErr, String &rStr, sal_uInt16& nFlags) const
/* [Beschreibung]
@@ -191,9 +191,9 @@ BOOL SfxErrorHandler::CreateString(
*/
{
- ULONG nErrCode = pErr->GetErrorCode() & ERRCODE_ERROR_MASK;
+ sal_uLong nErrCode = pErr->GetErrorCode() & ERRCODE_ERROR_MASK;
if( nErrCode>=lEnd || nErrCode<=lStart )
- return FALSE;
+ return sal_False;
MessageInfo *pMsgInfo=PTR_CAST(MessageInfo,pErr);
if(pMsgInfo)
{
@@ -207,7 +207,7 @@ BOOL SfxErrorHandler::CreateString(
break;
i = i + pMsgInfo->GetMessageArg().Len();
}
- return TRUE;
+ return sal_True;
}
}
else if(GetErrorString(nErrCode, rStr, nFlags))
@@ -227,10 +227,10 @@ BOOL SfxErrorHandler::CreateString(
TwoStringErrorInfo * pTwoStringInfo = PTR_CAST(TwoStringErrorInfo,
pErr);
if (pTwoStringInfo)
- for (USHORT i = 0; i < rStr.Len();)
+ for (sal_uInt16 i = 0; i < rStr.Len();)
{
- USHORT nArg1Pos = rStr.Search(String::CreateFromAscii( "$(ARG1)" ), i);
- USHORT nArg2Pos = rStr.Search(String::CreateFromAscii( "$(ARG2)" ), i);
+ sal_uInt16 nArg1Pos = rStr.Search(String::CreateFromAscii( "$(ARG1)" ), i);
+ sal_uInt16 nArg2Pos = rStr.Search(String::CreateFromAscii( "$(ARG2)" ), i);
if (nArg1Pos < nArg2Pos)
{
rStr.Replace(nArg1Pos, 7, pTwoStringInfo->GetArg1());
@@ -244,9 +244,9 @@ BOOL SfxErrorHandler::CreateString(
else break;
}
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
//-------------------------------------------------------------------------
@@ -261,9 +261,9 @@ class ResString: public String
*/
{
- USHORT nFlags;
+ sal_uInt16 nFlags;
public:
- USHORT GetFlags() const {return nFlags;}
+ sal_uInt16 GetFlags() const {return nFlags;}
const String & GetString() const {return *this;}
ResString( ResId &rId);
};
@@ -271,14 +271,14 @@ class ResString: public String
//-------------------------------------------------------------------------
ResString::ResString(ResId & rId):
- String(rId.SetAutoRelease(FALSE)),
+ String(rId.SetAutoRelease(sal_False)),
nFlags(0)
{
ResMgr * pResMgr = rId.GetResMgr();
// String ctor temporarily sets global ResManager
if (pResMgr->GetRemainSize())
- nFlags = USHORT(pResMgr->ReadShort());
- rId.SetAutoRelease(TRUE);
+ nFlags = sal_uInt16(pResMgr->ReadShort());
+ rId.SetAutoRelease(sal_True);
pResMgr->PopContext();
}
@@ -295,18 +295,18 @@ struct ErrorResource_Impl : private Resource
ResId aResId;
- ErrorResource_Impl(ResId& rErrIdP, USHORT nId)
+ ErrorResource_Impl(ResId& rErrIdP, sal_uInt16 nId)
: Resource(rErrIdP),aResId(nId,*rErrIdP.GetResMgr()){}
~ErrorResource_Impl() { FreeResource(); }
operator ResString(){ return ResString( aResId ); }
- operator BOOL(){return IsAvailableRes(aResId.SetRT(RSC_STRING));}
+ operator sal_Bool(){return IsAvailableRes(aResId.SetRT(RSC_STRING));}
};
-BOOL SfxErrorHandler::GetClassString(ULONG lClassId, String &rStr) const
+sal_Bool SfxErrorHandler::GetClassString(sal_uLong lClassId, String &rStr) const
/* [Beschreibung]
@@ -316,17 +316,17 @@ BOOL SfxErrorHandler::GetClassString(ULONG lClassId, String &rStr) const
*/
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
com::sun::star::lang::Locale aLocale( Application::GetSettings().GetUILocale() );
ResMgr* pResMgr = ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(ofa), aLocale );
if( pResMgr )
{
ResId aId(RID_ERRHDL, *pResMgr );
- ErrorResource_Impl aEr(aId, (USHORT)lClassId);
+ ErrorResource_Impl aEr(aId, (sal_uInt16)lClassId);
if(aEr)
{
rStr=((ResString)aEr).GetString();
- bRet = TRUE;
+ bRet = sal_True;
}
}
delete pResMgr;
@@ -335,8 +335,8 @@ BOOL SfxErrorHandler::GetClassString(ULONG lClassId, String &rStr) const
//-------------------------------------------------------------------------
-BOOL SfxErrorHandler::GetMessageString(
- ULONG lErrId, String &rStr, USHORT &nFlags) const
+sal_Bool SfxErrorHandler::GetMessageString(
+ sal_uLong lErrId, String &rStr, sal_uInt16 &nFlags) const
/* [Beschreibung]
@@ -345,18 +345,18 @@ BOOL SfxErrorHandler::GetMessageString(
*/
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
ResId *pResId= new ResId(nId, *pMgr);
- ErrorResource_Impl aEr(*pResId, (USHORT)lErrId);
+ ErrorResource_Impl aEr(*pResId, (sal_uInt16)lErrId);
if(aEr)
{
ResString aErrorString(aEr);
- USHORT nResFlags = aErrorString.GetFlags();
+ sal_uInt16 nResFlags = aErrorString.GetFlags();
if( nResFlags )
nFlags=aErrorString.GetFlags();
rStr = aErrorString.GetString();
- bRet = TRUE;
+ bRet = sal_True;
}
delete pResId;
@@ -365,8 +365,8 @@ BOOL SfxErrorHandler::GetMessageString(
//-------------------------------------------------------------------------
-BOOL SfxErrorHandler::GetErrorString(
- ULONG lErrId, String &rStr, USHORT &nFlags) const
+sal_Bool SfxErrorHandler::GetErrorString(
+ sal_uLong lErrId, String &rStr, sal_uInt16 &nFlags) const
/* [Beschreibung]
Erzeugt den Fehlerstring fuer den eigentlichen Fehler ohne
@@ -377,25 +377,25 @@ BOOL SfxErrorHandler::GetErrorString(
{
SolarMutexGuard aGuard;
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
rStr=String(SvtResId(RID_ERRHDL_CLASS));
ResId aResId(nId, *pMgr);
{
- ErrorResource_Impl aEr(aResId, (USHORT)lErrId);
+ ErrorResource_Impl aEr(aResId, (sal_uInt16)lErrId);
if(aEr)
{
ResString aErrorString(aEr);
- USHORT nResFlags = aErrorString.GetFlags();
+ sal_uInt16 nResFlags = aErrorString.GetFlags();
if ( nResFlags )
nFlags = nResFlags;
rStr.SearchAndReplace(
String::CreateFromAscii("$(ERROR)"), aErrorString.GetString());
- bRet = TRUE;
+ bRet = sal_True;
}
else
- bRet = FALSE;
+ bRet = sal_False;
}
if( bRet )
@@ -414,7 +414,7 @@ BOOL SfxErrorHandler::GetErrorString(
//-------------------------------------------------------------------------
SfxErrorContext::SfxErrorContext(
- USHORT nCtxIdP, Window *pWindow, USHORT nResIdP, ResMgr *pMgrP)
+ sal_uInt16 nCtxIdP, Window *pWindow, sal_uInt16 nResIdP, ResMgr *pMgrP)
: ErrorContext(pWindow), nCtxId(nCtxIdP), nResId(nResIdP), pMgr(pMgrP)
{
if( nResId==USHRT_MAX )
@@ -424,8 +424,8 @@ SfxErrorContext::SfxErrorContext(
//-------------------------------------------------------------------------
SfxErrorContext::SfxErrorContext(
- USHORT nCtxIdP, const String &aArg1P, Window *pWindow,
- USHORT nResIdP, ResMgr *pMgrP)
+ sal_uInt16 nCtxIdP, const String &aArg1P, Window *pWindow,
+ sal_uInt16 nResIdP, ResMgr *pMgrP)
: ErrorContext(pWindow), nCtxId(nCtxIdP), nResId(nResIdP), pMgr(pMgrP),
aArg1(aArg1P)
{
@@ -435,7 +435,7 @@ SfxErrorContext::SfxErrorContext(
//-------------------------------------------------------------------------
-BOOL SfxErrorContext::GetString(ULONG nErrId, String &rStr)
+sal_Bool SfxErrorContext::GetString(sal_uLong nErrId, String &rStr)
/* [Beschreibung]
@@ -471,7 +471,7 @@ BOOL SfxErrorContext::GetString(ULONG nErrId, String &rStr)
if ( bRet )
{
- USHORT nId = ( nErrId & ERRCODE_WARNING_MASK ) ? ERRCTX_WARNING : ERRCTX_ERROR;
+ sal_uInt16 nId = ( nErrId & ERRCODE_WARNING_MASK ) ? ERRCTX_WARNING : ERRCTX_ERROR;
ResId aSfxResId( RID_ERRCTX, *pMgr );
ErrorResource_Impl aEr( aSfxResId, nId );
rStr.SearchAndReplace( String::CreateFromAscii( "$(ERR)" ), ( (ResString)aEr ).GetString() );
diff --git a/svtools/source/misc/ehdl.src b/svtools/source/misc/ehdl.src
index 436e06b7f3c5..2c2fab3e19b5 100644
--- a/svtools/source/misc/ehdl.src
+++ b/svtools/source/misc/ehdl.src
@@ -27,7 +27,8 @@
#define __RSC
#include <svtools/svtools.hrc>
-#include "sfxecode.hxx"
+#include <svtools/sfxecode.hxx>
+
// pragma ----------------------------------------------------------------
String STR_ERR_HDLMESS
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index 1ae633cad254..59479c39d4b7 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -236,7 +236,7 @@ struct EmbeddedObjectRef_Impl
comphelper::EmbeddedObjectContainer* pContainer;
Graphic* pGraphic;
sal_Int64 nViewAspect;
- BOOL bIsLocked;
+ sal_Bool bIsLocked;
sal_Bool bNeedUpdate;
// #i104867#
@@ -250,7 +250,7 @@ void EmbeddedObjectRef::Construct_Impl()
mpImp->pContainer = 0;
mpImp->pGraphic = 0;
mpImp->nViewAspect = embed::Aspects::MSOLE_CONTENT;
- mpImp->bIsLocked = FALSE;
+ mpImp->bIsLocked = sal_False;
mpImp->bNeedUpdate = sal_False;
mpImp->mnGraphicVersion = 0;
mpImp->aDefaultSizeForChart_In_100TH_MM = awt::Size(8000,7000);
@@ -306,6 +306,7 @@ void EmbeddedObjectRef::Assign( const NS_UNO::Reference < NS_EMBED::XEmbeddedObj
mpImp->xListener = EmbedEventListener_Impl::Create( this );
//#i103460#
+ if ( IsChart() )
{
::com::sun::star::uno::Reference < ::com::sun::star::chart2::XDefaultSizeTransmitter > xSizeTransmitter( xObj, uno::UNO_QUERY );
DBG_ASSERT( xSizeTransmitter.is(), "Object does not support XDefaultSizeTransmitter -> will cause #i103460#!" );
@@ -360,7 +361,7 @@ void EmbeddedObjectRef::Clear()
}
mpImp->pContainer = 0;
- mpImp->bIsLocked = FALSE;
+ mpImp->bIsLocked = sal_False;
mpImp->bNeedUpdate = sal_False;
}
@@ -402,17 +403,17 @@ void EmbeddedObjectRef::SetViewAspect( sal_Int64 nAspect )
mpImp->nViewAspect = nAspect;
}
-void EmbeddedObjectRef::Lock( BOOL bLock )
+void EmbeddedObjectRef::Lock( sal_Bool bLock )
{
mpImp->bIsLocked = bLock;
}
-BOOL EmbeddedObjectRef::IsLocked() const
+sal_Bool EmbeddedObjectRef::IsLocked() const
{
return mpImp->bIsLocked;
}
-void EmbeddedObjectRef::GetReplacement( BOOL bUpdate )
+void EmbeddedObjectRef::GetReplacement( sal_Bool bUpdate )
{
if ( bUpdate )
{
@@ -449,7 +450,7 @@ Graphic* EmbeddedObjectRef::GetGraphic( ::rtl::OUString* pMediaType ) const
// bNeedUpdate will be set to false while retrieving new replacement
const_cast < EmbeddedObjectRef* >(this)->GetReplacement( sal_True );
else if ( !mpImp->pGraphic )
- const_cast < EmbeddedObjectRef* >(this)->GetReplacement( FALSE );
+ const_cast < EmbeddedObjectRef* >(this)->GetReplacement( sal_False );
if ( mpImp->pGraphic && pMediaType )
*pMediaType = mpImp->aMediaType;
@@ -561,7 +562,7 @@ void EmbeddedObjectRef::SetGraphic( const Graphic& rGraphic, const ::rtl::OUStri
mpImp->bNeedUpdate = sal_False;
}
-SvStream* EmbeddedObjectRef::GetGraphicStream( BOOL bUpdate ) const
+SvStream* EmbeddedObjectRef::GetGraphicStream( sal_Bool bUpdate ) const
{
RTL_LOGFILE_CONTEXT( aLog, "svtools (mv76033) svt::EmbeddedObjectRef::GetGraphicStream" );
DBG_ASSERT( bUpdate || mpImp->pContainer, "Can't retrieve current graphic!" );
@@ -615,7 +616,7 @@ void EmbeddedObjectRef::DrawPaintReplacement( const Rectangle &rRect, const Stri
MapMode aMM( MAP_APPFONT );
Size aAppFontSz = pOut->LogicToLogic( Size( 0, 8 ), &aMM, NULL );
Font aFnt( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "Helvetica" ) ), aAppFontSz );
- aFnt.SetTransparent( TRUE );
+ aFnt.SetTransparent( sal_True );
aFnt.SetColor( Color( COL_LIGHTRED ) );
aFnt.SetWeight( WEIGHT_BOLD );
aFnt.SetFamily( FAMILY_SWISS );
@@ -627,14 +628,14 @@ void EmbeddedObjectRef::DrawPaintReplacement( const Rectangle &rRect, const Stri
Point aPt;
// Nun den Text so skalieren, dass er in das Rect passt.
// Wir fangen mit der Defaultsize an und gehen 1-AppFont runter
- for( USHORT i = 8; i > 2; i-- )
+ for( sal_uInt16 i = 8; i > 2; i-- )
{
aPt.X() = (rRect.GetWidth() - pOut->GetTextWidth( rText )) / 2;
aPt.Y() = (rRect.GetHeight() - pOut->GetTextHeight()) / 2;
- BOOL bTiny = FALSE;
- if( aPt.X() < 0 ) bTiny = TRUE, aPt.X() = 0;
- if( aPt.Y() < 0 ) bTiny = TRUE, aPt.Y() = 0;
+ sal_Bool bTiny = sal_False;
+ if( aPt.X() < 0 ) bTiny = sal_True, aPt.X() = 0;
+ if( aPt.Y() < 0 ) bTiny = sal_True, aPt.Y() = 0;
if( bTiny )
{
// heruntergehen bei kleinen Bildern
@@ -696,8 +697,8 @@ void EmbeddedObjectRef::DrawShading( const Rectangle &rRect, OutputDevice *pOut
aPixSize.Width() -= 1;
aPixSize.Height() -= 1;
Point aPixViewPos = pOut->LogicToPixel( rRect.TopLeft() );
- INT32 nMax = aPixSize.Width() + aPixSize.Height();
- for( INT32 i = 5; i < nMax; i += 5 )
+ sal_Int32 nMax = aPixSize.Width() + aPixSize.Height();
+ for( sal_Int32 i = 5; i < nMax; i += 5 )
{
Point a1( aPixViewPos ), a2( aPixViewPos );
if( i > aPixSize.Width() )
@@ -716,15 +717,15 @@ void EmbeddedObjectRef::DrawShading( const Rectangle &rRect, OutputDevice *pOut
}
-BOOL EmbeddedObjectRef::TryRunningState()
+sal_Bool EmbeddedObjectRef::TryRunningState()
{
return TryRunningState( mxObj );
}
-BOOL EmbeddedObjectRef::TryRunningState( const uno::Reference < embed::XEmbeddedObject >& xEmbObj )
+sal_Bool EmbeddedObjectRef::TryRunningState( const uno::Reference < embed::XEmbeddedObject >& xEmbObj )
{
if ( !xEmbObj.is() )
- return FALSE;
+ return sal_False;
try
{
@@ -733,10 +734,10 @@ BOOL EmbeddedObjectRef::TryRunningState( const uno::Reference < embed::XEmbedded
}
catch ( uno::Exception& )
{
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
void EmbeddedObjectRef::SetGraphicToContainer( const Graphic& rGraphic,
@@ -797,7 +798,7 @@ void EmbeddedObjectRef::UpdateReplacementOnDemand()
}
}
-BOOL EmbeddedObjectRef::IsChart() const
+sal_Bool EmbeddedObjectRef::IsChart() const
{
//todo maybe for 3.0:
//if the changes work good for chart
diff --git a/svtools/source/misc/embedtransfer.cxx b/svtools/source/misc/embedtransfer.cxx
index 67d325cb41e5..34cf5c595e38 100644
--- a/svtools/source/misc/embedtransfer.cxx
+++ b/svtools/source/misc/embedtransfer.cxx
@@ -37,7 +37,7 @@
#include <com/sun/star/embed/Aspects.hpp>
#include <svtools/embedtransfer.hxx>
-#include <vcl/mapunit.hxx>
+#include <tools/mapunit.hxx>
#include <vcl/outdev.hxx>
#include <comphelper/storagehelper.hxx>
#include <unotools/ucbstreamhelper.hxx>
@@ -111,21 +111,21 @@ sal_Bool SvEmbedTransferHelper::GetData( const ::com::sun::star::datatransfer::D
// TODO/LATER: Propbably the graphic should be copied here as well
// currently it is handled by the applications
utl::TempFile aTmp;
- aTmp.EnableKillingFile( TRUE );
+ aTmp.EnableKillingFile( sal_True );
uno::Reference < embed::XEmbedPersist > xPers( m_xObj, uno::UNO_QUERY );
if ( xPers.is() )
{
uno::Reference < embed::XStorage > xStg = comphelper::OStorageHelper::GetTemporaryStorage();
::rtl::OUString aName( RTL_CONSTASCII_USTRINGPARAM( "Dummy" ));
SvStream* pStream = NULL;
- BOOL bDeleteStream = FALSE;
+ sal_Bool bDeleteStream = sal_False;
uno::Sequence < beans::PropertyValue > aEmpty;
xPers->storeToEntry( xStg, aName, aEmpty, aEmpty );
if ( xStg->isStreamElement( aName ) )
{
uno::Reference < io::XStream > xStm = xStg->cloneStreamElement( aName );
pStream = utl::UcbStreamHelper::CreateStream( xStm );
- bDeleteStream = TRUE;
+ bDeleteStream = sal_True;
}
else
{
@@ -252,7 +252,7 @@ void SvEmbedTransferHelper::FillTransferableObjectDescriptor( TransferableObject
rDesc.maSize = OutputDevice::LogicToLogic( aSize, aMapMode, MapMode( MAP_100TH_MM ) );
rDesc.maDragStartPos = Point();
rDesc.maDisplayName = String();
- rDesc.mbCanLink = FALSE;
+ rDesc.mbCanLink = sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/misc/errtxt.src b/svtools/source/misc/errtxt.src
deleted file mode 100644
index 08514ea23953..000000000000
--- a/svtools/source/misc/errtxt.src
+++ /dev/null
@@ -1,515 +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 __RSC
-#include <svtools/svtools.hrc>
-#include "sfxecode.hxx"
- // pragma ----------------------------------------------------------------
-Resource RID_ERRCTX
-{
- String ERRCTX_ERROR
- {
- Text [ en-US ] = "Error" ;
- };
- String ERRCTX_WARNING
- {
- Text [ en-US ] = "Warning" ;
- };
- String ERRCTX_SFX_LOADTEMPLATE
- {
- Text [ en-US ] = "$(ERR) loading the template $(ARG1)" ;
- };
- String ERRCTX_SFX_SAVEDOC
- {
- Text [ en-US ] = "$(ERR) saving the document $(ARG1)";
- };
- String ERRCTX_SFX_SAVEASDOC
- {
- Text [ en-US ] = "$(ERR) saving the document $(ARG1)";
- };
- String ERRCTX_SFX_DOCINFO
- {
- Text [ en-US ] = "$(ERR) displaying doc. information for document $(ARG1)" ;
- };
- String ERRCTX_SFX_DOCTEMPLATE
- {
- Text [ en-US ] = "$(ERR) writing document $(ARG1) as template" ;
- };
- String ERRCTX_SFX_MOVEORCOPYCONTENTS
- {
- Text [ en-US ] = "$(ERR) copying or moving document contents" ;
- };
- String ERRCTX_SFX_DOCMANAGER
- {
- Text [ en-US ] = "$(ERR) starting the Document Manager" ;
- };
- String ERRCTX_SFX_OPENDOC
- {
- Text [ en-US ] = "$(ERR) loading document $(ARG1)" ;
- };
- String ERRCTX_SFX_NEWDOCDIRECT
- {
- Text [ en-US ] = "$(ERR) creating a new document" ;
- };
- String ERRCTX_SFX_NEWDOC
- {
- Text [ en-US ] = "$(ERR) creating a new document" ;
- };
- String ERRCTX_SFX_CREATEOBJSH
- {
- Text [ en-US ] = "$(ERR) expanding entry" ;
- };
- String ERRCTX_SFX_LOADBASIC
- {
- Text [ en-US ] = "$(ERR) loading BASIC of document $(ARG1)" ;
- };
- String ERRCTX_SFX_SEARCHADDRESS
- {
- Text [ en-US ] = "$(ERR) searching for an address";
- };
-};
-
-Resource RID_ERRHDL
-{
- String ERRCODE_CLASS_ABORT
- {
- Text [ en-US ] = "Abort" ;
- };
- String ERRCODE_CLASS_NOTEXISTS
- {
- Text [ en-US ] = "Nonexistent object" ;
- };
- String ERRCODE_CLASS_ALREADYEXISTS
- {
- Text [ en-US ] = "Object already exists" ;
- };
- String ERRCODE_CLASS_ACCESS
- {
- Text [ en-US ] = "Object not accessible" ;
- };
- String ERRCODE_CLASS_PATH
- {
- Text [ en-US ] = "Inadmissible path" ;
- };
- String ERRCODE_CLASS_LOCKING
- {
- Text [ en-US ] = "Locking problem" ;
- };
- String ERRCODE_CLASS_PARAMETER
- {
- Text [ en-US ] = "Wrong parameter" ;
- };
- String ERRCODE_CLASS_SPACE
- {
- Text [ en-US ] = "Resource exhausted" ;
- };
- String ERRCODE_CLASS_NOTSUPPORTED
- {
- Text [ en-US ] = "Action not supported" ;
- };
- String ERRCODE_CLASS_READ
- {
- Text [ en-US ] = "Read-Error" ;
- };
- String ERRCODE_CLASS_WRITE
- {
- Text [ en-US ] = "Write Error" ;
- };
- String ERRCODE_CLASS_UNKNOWN
- {
- Text [ en-US ] = "unknown" ;
- };
- String ERRCODE_CLASS_VERSION
- {
- Text [ en-US ] = "Version Incompatibility" ;
- };
- String ERRCODE_CLASS_GENERAL
- {
- Text [ en-US ] = "General Error" ;
- };
- String ERRCODE_CLASS_FORMAT
- {
- Text [ en-US ] = "Incorrect format" ;
- };
- String ERRCODE_CLASS_CREATE
- {
- Text [ en-US ] = "Error creating object" ;
- };
- String ERRCODE_CLASS_SBX
- {
- Text [ en-US ] = "Inadmissible value or data type" ;
- };
- String ERRCODE_CLASS_RUNTIME
- {
- Text [ en-US ] = "BASIC runtime error" ;
- };
- String ERRCODE_CLASS_COMPILER
- {
- Text [ en-US ] = "BASIC syntax error" ;
- };
- String 1
- {
- Text [ en-US ] = "General Error" ;
- };
- String ERRCODE_IO_GENERAL
- {
- Text [ en-US ] = "General input/output error." ;
- };
- String ERRCODE_IO_MISPLACEDCHAR
- {
- Text [ en-US ] = "Invalid file name." ;
- };
- String ERRCODE_IO_NOTEXISTS
- {
- Text [ en-US ] = "Nonexistent file." ;
- };
- String ERRCODE_IO_ALREADYEXISTS
- {
- Text [ en-US ] = "File already exists." ;
- };
- String ERRCODE_IO_NOTADIRECTORY
- {
- Text [ en-US ] = "The object is not a directory." ;
- };
- String ERRCODE_IO_NOTAFILE
- {
- Text [ en-US ] = "The object is not a file." ;
- };
- String ERRCODE_IO_INVALIDDEVICE
- {
- Text [ en-US ] = "The specified device is invalid." ;
- };
- String ERRCODE_IO_ACCESSDENIED
- {
- Text [ en-US ] = "The object cannot be accessed\ndue to insufficient user rights." ;
- };
- String ERRCODE_IO_LOCKVIOLATION
- {
- Text [ en-US ] = "Sharing violation while accessing the object." ;
- };
- String ERRCODE_IO_OUTOFSPACE
- {
- Text [ en-US ] = "No more space on device." ;
- };
- String ERRCODE_IO_ISWILDCARD
- {
- Text [ en-US ] = "This operation cannot be run on\nfiles containing wildcards." ;
- };
- String ERRCODE_IO_NOTSUPPORTED
- {
- Text [ en-US ] = "This operation is not supported on this operating system." ;
- };
- String ERRCODE_IO_TOOMANYOPENFILES
- {
- Text [ en-US ] = "There are too many files open." ;
- };
- String ERRCODE_IO_CANTREAD
- {
- Text [ en-US ] = "Data could not be read from the file." ;
- };
- String ERRCODE_IO_CANTWRITE
- {
- Text [ en-US ] = "The file could not be written." ;
- };
- String ERRCODE_IO_OUTOFMEMORY
- {
- Text [ en-US ] = "The operation could not be run due to insufficient memory." ;
- };
- String ERRCODE_IO_CANTSEEK
- {
- Text [ en-US ] = "The seek operation could not be run." ;
- };
- String ERRCODE_IO_CANTTELL
- {
- Text [ en-US ] = "The tell operation could not be run." ;
- };
- String ERRCODE_IO_WRONGVERSION
- {
- Text [ en-US ] = "Incorrect file version." ;
- };
- String ERRCODE_IO_WRONGFORMAT
- {
- Text [ en-US ] = "Incorrect file format." ;
- };
- String ERRCODE_IO_INVALIDCHAR
- {
- Text [ en-US ] = "The file name contains invalid characters." ;
- };
- String ERRCODE_IO_UNKNOWN
- {
- Text [ en-US ] = "An unknown I/O error has occurred." ;
- };
- String ERRCODE_IO_INVALIDACCESS
- {
- Text [ en-US ] = "An invalid attempt was made to access the file." ;
- };
- String ERRCODE_IO_CANTCREATE
- {
- Text [ en-US ] = "The file could not be created." ;
- };
- String ERRCODE_IO_INVALIDPARAMETER
- {
- Text [ en-US ] = "The operation was started under an invalid parameter." ;
- };
- String ERRCODE_IO_ABORT
- {
- Text [ en-US ] = "The operation on the file was aborted." ;
- };
- String ERRCODE_IO_NOTEXISTSPATH
- {
- Text [ en-US ] = "Path to the file does not exist." ;
- };
- String ERRCODE_IO_RECURSIVE
- {
- Text [ en-US ] = "An object cannot be copied into itself." ;
- };
- String ERRCODE_SFX_NOSTDTEMPLATE
- {
- Text [ en-US ] = "The default template could not be opened." ;
- };
- String ERRCODE_SFX_TEMPLATENOTFOUND
- {
- Text [ en-US ] = "The specified template could not be found." ;
- };
- String ERRCODE_SFX_NOTATEMPLATE
- {
- Text [ en-US ] = "The file cannot be used as template." ;
- };
- String ERRCODE_SFX_CANTREADDOCINFO
- {
- Text [ en-US ] = "Document information could not be read from the file because\nthe document information format is unknown or because document information does not\nexist." ;
- };
- String ERRCODE_SFX_ALREADYOPEN
- {
- Text [ en-US ] = "This document has already been opened for editing." ;
- };
- String ERRCODE_SFX_WRONGPASSWORD
- {
- Text [ en-US ] = "The wrong password has been entered." ;
- };
- String ERRCODE_SFX_DOLOADFAILED
- {
- Text [ en-US ] = "Error reading file." ;
- };
- String ERRCODE_SFX_DOCUMENTREADONLY
- {
- Text [ en-US ] = "The document was opened as read-only." ;
- };
- String ERRCODE_SFX_OLEGENERAL
- {
- Text [ en-US ] = "General OLE Error." ;
- };
- String ERRCODE_INET_NAME_RESOLVE
- {
- Text [ en-US ] = "The host name $(ARG1) could not be resolved." ;
- };
- String ERRCODE_INET_CONNECT
- {
- Text [ en-US ] = "Could not establish network connection to $(ARG1)." ;
- };
- String ERRCODE_INET_READ
- {
- Text [ en-US ] = "Error reading data from the network.\nServer error message: $(ARG1)." ;
- };
- String ERRCODE_INET_WRITE
- {
- Text [ en-US ] = "Error transferring data to the network.\nServer error message: $(ARG1)." ;
- };
- String ERRCODE_INET_GENERAL
- {
- Text [ en-US ] = "General network error has occurred." ;
- };
- String ERRCODE_INET_OFFLINE
- {
- Text [ en-US ] = "The requested network data is not available in the cache and cannot be transmitted as the Online mode has not be activated." ;
- };
- String ERRCODE_SFXMSG_STYLEREPLACE
- {
- ExtraData = ERRCODE_MSG_ERROR | ERRCODE_BUTTON_OK_CANCEL ;
- Text [ en-US ] = "Should the $(ARG1) Style be replaced?" ;
- };
- String ERRCODE_SFX_NOFILTER
- {
- Text [ en-US ] = "A filter has not been found." ;
- };
- String ERRCODE_SFX_CANTFINDORIGINAL
- {
- Text [ en-US ] = "The original could not be determined." ;
- };
- String ERRCODE_SFX_CANTCREATECONTENT
- {
- Text [ en-US ] = "The contents could not be created." ;
- };
- String ERRCODE_SFX_CANTCREATELINK
- {
- Text [ en-US ] = "The link could not be created." ;
- };
- String ERRCODE_SFX_WRONGBMKFORMAT
- {
- Text [ en-US ] = "The link format is invalid." ;
- };
- String ERRCODE_SFX_WRONGICONFILE
- {
- Text [ en-US ] = "The configuration of the icon display is invalid." ;
- };
- String ERRCODE_SFX_CANTWRITEICONFILE
- {
- Text [ en-US ] = "The configuration of the icon display can not be saved." ;
- };
- String ERRCODE_SFX_CANTDELICONFILE
- {
- Text [ en-US ] = "The configuration of the icon display could not be deleted." ;
- };
- String ERRCODE_SFX_CANTRENAMECONTENT
- {
- Text [ en-US ] = "Contents cannot be renamed." ;
- };
- String ERRCODE_SFX_INVALIDBMKPATH
- {
- Text [ en-US ] = "The bookmark folder is invalid." ;
- };
- String ERRCODE_SFX_CANTWRITEURLCFGFILE
- {
- Text [ en-US ] = "The configuration of the URLs to be saved locally could not be saved." ;
- };
- String ERRCODE_SFX_WRONGURLCFGFORMAT
- {
- Text [ en-US ] = "The configuration format of the URLs to be saved locally is invalid." ;
- };
- String ERRCODE_SFX_NODOCUMENT
- {
- Text [ en-US ] = "This action cannot be applied to a document that does not exist." ;
- };
- String ERRCODE_SFX_INVALIDLINK
- {
- Text [ en-US ] = "The link refers to an invalid target." ;
- };
- String ERRCODE_SFX_INVALIDTRASHPATH
- {
- Text [ en-US ] = "The Recycle Bin path is invalid." ;
- };
- String ERRCODE_SFX_NOTRESTORABLE
- {
- Text [ en-US ] = "The entry could not be restored." ;
- };
- String ERRCODE_IO_NAMETOOLONG
- {
- Text [ en-US ] = "The file name is too long for the target file system." ;
- };
- String ERRCODE_SFX_CONSULTUSER
- {
- Text [ en-US ] = "The details for running the function are incomplete." ;
- };
- String ERRCODE_SFX_INVALIDSYNTAX
- {
- Text [ en-US ] = "The input syntax is invalid." ;
- };
- String ERRCODE_SFX_CANTCREATEFOLDER
- {
- Text [ en-US ] = "The input syntax is invalid." ;
- };
- String ERRCODE_SFX_CANTRENAMEFOLDER
- {
- Text [ en-US ] = "The input syntax is invalid." ;
- };
- String ERRCODE_SFX_WRONG_CDF_FORMAT
- {
- Text [ en-US ] = "The channel document has an invalid format." ;
- };
- String ERRCODE_SFX_EMPTY_SERVER
- {
- Text [ en-US ] = "The server must not be empty." ;
- };
- String ERRCODE_SFX_NO_ABOBOX
- {
- Text [ en-US ] = "A subscription folder is required to install a Channel." ;
- };
- String ERRCODE_IO_NOTSTORABLEINBINARYFORMAT
- {
- Text [ en-US ] = "This document contains attributes that cannot be saved in the selected format.\nPlease save the document in a %PRODUCTNAME %PRODUCTVERSION file format.";
- };
- String ERRCODE_SFX_TARGETFILECORRUPTED
- {
- Text [ en-US ] = "The file $(FILENAME) cannot be saved. Please check your system settings. You can find an automatically generated backup copy of this file in folder $(PATH) named $(BACKUPNAME).";
- };
- String ERRCODE_SFX_NOMOREDOCUMENTSALLOWED
- {
- Text [ en-US ] = "The maximum number of documents that can be opened at the same time has been reached. You need to close one or more documents before you can open a new document.";
- };
- String ERRCODE_SFX_CANTCREATEBACKUP
- {
- Text [ en-US ] = "Could not create backup copy." ;
- };
- String ERRCODE_SFX_MACROS_SUPPORT_DISABLED
- {
- Text [ en-US ] = "An attempt was made to execute a macro.\nFor security reasons, macro support is disabled.";
- };
- String ERRCODE_SFX_DOCUMENT_MACRO_DISABLED
- {
- Text [ en-US ] = "This document contains macros.\n\nMacros may contain viruses. Execution of macros is disabled due to the current macro security setting in Tools - Options - %PRODUCTNAME - Security.\n\nTherefore, some functionality may not be available." ;
- };
- String ERRCODE_SFX_BROKENSIGNATURE
- {
- Text [ en-US ] = "The digitally signed document content and/or macros do not match the current document signature.\n\nThis could be the result of document manipulation or of structural document damage due to data transmission.\n\nWe recommend that you do not trust the content of the current document.\nExecution of macros is disabled for this document.\n " ;
- };
- String ERRCODE_SFX_INCOMPLETE_ENCRYPTION
- {
- Text [ en-US ] = "The encrypted document contains unexpected non-encrypted streams.\n\nThis could be the result of document manipulation.\n\nWe recommend that you do not trust the content of the current document.\nExecution of macros is disabled for this document.\n " ;
- };
-
- String ERRCODE_IO_INVALIDLENGTH
- {
- Text [ en-US ] = "Invalid data length." ;
- };
- String ERRCODE_IO_CURRENTDIR
- {
- Text [ en-US ] = "Function not possible: path contains current directory." ;
- };
- String ERRCODE_IO_NOTSAMEDEVICE
- {
- Text [ en-US ] = "Function not possible: device (drive) not identical." ;
- };
- String ERRCODE_IO_DEVICENOTREADY
- {
- Text [ en-US ] = "Device (drive) not ready." ;
- };
- String ERRCODE_IO_BADCRC
- {
- Text [ en-US ] = "Wrong check amount." ;
- };
- String ERRCODE_IO_WRITEPROTECTED
- {
- Text [ en-US ] = "Function not possible: write protected." ;
- };
- String ERRCODE_SFX_SHARED_NOPASSWORDCHANGE
- {
- Text [ en-US ] = "The password of a shared spreadsheet cannot be set or changed.\nDeactivate sharing mode first.";
- };
-};
-
-// eof ------------------------------------------------------------------------
-
diff --git a/svtools/source/misc/filterutils.cxx b/svtools/source/misc/filterutils.cxx
index 578c94099fae..06640c55f10e 100644
--- a/svtools/source/misc/filterutils.cxx
+++ b/svtools/source/misc/filterutils.cxx
@@ -1,7 +1,7 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "filterutils.hxx"
+#include <svtools/filterutils.hxx>
#include <rtl/ustrbuf.hxx>
namespace svt
diff --git a/svtools/source/misc/helpagentwindow.cxx b/svtools/source/misc/helpagentwindow.cxx
index 46118ffbabfc..50a2341d1290 100644
--- a/svtools/source/misc/helpagentwindow.cxx
+++ b/svtools/source/misc/helpagentwindow.cxx
@@ -28,12 +28,11 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "helpagentwindow.hxx"
+#include <svtools/helpagentwindow.hxx>
#include <osl/diagnose.h>
#include <vcl/button.hxx>
#include <vcl/bitmap.hxx>
#include <svtools/svtdata.hxx>
-
#include <svtools/svtools.hrc>
#include <svtools/helpid.hrc>
@@ -101,7 +100,7 @@ namespace svt
m_aPreferredSize.Height() += aSize.Height() - aOutputSize.Height();
SetPointer(Pointer(POINTER_REFHAND));
- AlwaysEnableInput( TRUE, TRUE );
+ AlwaysEnableInput( sal_True, sal_True );
// unique id for the testtool
SetUniqueId( HID_HELPAGENT_WINDOW );
diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx
index d17efb5f0287..92fd64bde9cc 100644
--- a/svtools/source/misc/imagemgr.cxx
+++ b/svtools/source/misc/imagemgr.cxx
@@ -31,7 +31,7 @@
// includes --------------------------------------------------------------
-#include "imagemgr.hxx"
+#include <svtools/imagemgr.hxx>
#include <tools/urlobj.hxx>
#include <tools/debug.hxx>
#include <vcl/svapp.hxx>
@@ -50,167 +50,166 @@
#include <tools/rcid.h>
#include <rtl/logfile.hxx>
#include <unotools/configmgr.hxx>
-
#include <svtools/svtools.hrc>
-#include "imagemgr.hrc"
+#include <svtools/imagemgr.hrc>
#include <svtools/svtdata.hxx>
#include <osl/mutex.hxx>
// globals *******************************************************************
-#define NO_INDEX ((USHORT)0xFFFF)
+#define NO_INDEX ((sal_uInt16)0xFFFF)
#define CONTENT_HELPER ::utl::UCBContentHelper
#define ASCII_STRING(s) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(s) )
struct SvtExtensionResIdMapping_Impl
{
const char* _pExt;
- BOOL _bExt;
- USHORT _nStrId;
- USHORT _nImgId;
+ sal_Bool _bExt;
+ sal_uInt16 _nStrId;
+ sal_uInt16 _nImgId;
};
static SvtExtensionResIdMapping_Impl const ExtensionMap_Impl[] =
{
- { "awk", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "bas", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "bat", TRUE, STR_DESCRIPTION_BATCHFILE, 0 },
- { "bmk", FALSE, STR_DESCRIPTION_BOOKMARKFILE, 0 },
- { "bmp", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP },
- { "c", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "cfg", FALSE, STR_DESCRIPTION_CFGFILE, 0 },
- { "cmd", TRUE, STR_DESCRIPTION_BATCHFILE, 0 },
- { "cob", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "com", TRUE, STR_DESCRIPTION_APPLICATION, 0 },
- { "cxx", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "dbf", TRUE, STR_DESCRIPTION_DATABASE_TABLE, IMG_TABLE },
- { "def", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "dll", TRUE, STR_DESCRIPTION_SYSFILE, 0 },
- { "doc", FALSE, STR_DESCRIPTION_WORD_DOC, IMG_WRITER },
- { "dot", FALSE, STR_DESCRIPTION_WORD_DOC, IMG_WRITERTEMPLATE },
- { "docx", FALSE, STR_DESCRIPTION_WORD_DOC, IMG_WRITER },
- { "dxf", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_DXF },
- { "exe", TRUE, STR_DESCRIPTION_APPLICATION, 0 },
- { "gif", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_GIF },
- { "h", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "hlp", FALSE, STR_DESCRIPTION_HELP_DOC, 0 },
- { "hrc", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "htm", FALSE, STR_DESCRIPTION_HTMLFILE, IMG_HTML },
- { "html", FALSE, STR_DESCRIPTION_HTMLFILE, IMG_HTML },
- { "asp", FALSE, STR_DESCRIPTION_HTMLFILE, IMG_HTML },
- { "hxx", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "ini", FALSE, STR_DESCRIPTION_CFGFILE, 0 },
- { "java", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "jpeg", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG },
- { "jpg", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG },
- { "lha", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 },
+ { "awk", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "bas", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "bat", sal_True, STR_DESCRIPTION_BATCHFILE, 0 },
+ { "bmk", sal_False, STR_DESCRIPTION_BOOKMARKFILE, 0 },
+ { "bmp", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP },
+ { "c", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "cfg", sal_False, STR_DESCRIPTION_CFGFILE, 0 },
+ { "cmd", sal_True, STR_DESCRIPTION_BATCHFILE, 0 },
+ { "cob", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "com", sal_True, STR_DESCRIPTION_APPLICATION, 0 },
+ { "cxx", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "dbf", sal_True, STR_DESCRIPTION_DATABASE_TABLE, IMG_TABLE },
+ { "def", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "dll", sal_True, STR_DESCRIPTION_SYSFILE, 0 },
+ { "doc", sal_False, STR_DESCRIPTION_WORD_DOC, IMG_WRITER },
+ { "dot", sal_False, STR_DESCRIPTION_WORD_DOC, IMG_WRITERTEMPLATE },
+ { "docx", sal_False, STR_DESCRIPTION_WORD_DOC, IMG_WRITER },
+ { "dxf", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_DXF },
+ { "exe", sal_True, STR_DESCRIPTION_APPLICATION, 0 },
+ { "gif", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_GIF },
+ { "h", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "hlp", sal_False, STR_DESCRIPTION_HELP_DOC, 0 },
+ { "hrc", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "htm", sal_False, STR_DESCRIPTION_HTMLFILE, IMG_HTML },
+ { "html", sal_False, STR_DESCRIPTION_HTMLFILE, IMG_HTML },
+ { "asp", sal_False, STR_DESCRIPTION_HTMLFILE, IMG_HTML },
+ { "hxx", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "ini", sal_False, STR_DESCRIPTION_CFGFILE, 0 },
+ { "java", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "jpeg", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG },
+ { "jpg", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG },
+ { "lha", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 },
#ifdef WNT
- { "lnk", FALSE, 0, 0 },
+ { "lnk", sal_False, 0, 0 },
#endif
- { "log", TRUE, STR_DESCRIPTION_LOGFILE, 0 },
- { "lst", TRUE, STR_DESCRIPTION_LOGFILE, 0 },
- { "met", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_MET },
- { "mml", FALSE, STR_DESCRIPTION_MATHML_DOC, IMG_MATH },
- { "mod", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "odb", FALSE, STR_DESCRIPTION_OO_DATABASE_DOC, IMG_OO_DATABASE_DOC },
- { "odg", FALSE, STR_DESCRIPTION_OO_DRAW_DOC, IMG_OO_DRAW_DOC },
- { "odf", FALSE, STR_DESCRIPTION_OO_MATH_DOC, IMG_OO_MATH_DOC },
- { "odm", FALSE, STR_DESCRIPTION_OO_GLOBAL_DOC, IMG_OO_GLOBAL_DOC },
- { "odp", FALSE, STR_DESCRIPTION_OO_IMPRESS_DOC, IMG_OO_IMPRESS_DOC },
- { "ods", FALSE, STR_DESCRIPTION_OO_CALC_DOC, IMG_OO_CALC_DOC },
- { "odt", FALSE, STR_DESCRIPTION_OO_WRITER_DOC, IMG_OO_WRITER_DOC },
- { "otg", FALSE, STR_DESCRIPTION_OO_DRAW_TEMPLATE, IMG_OO_DRAW_TEMPLATE },
- { "otp", FALSE, STR_DESCRIPTION_OO_IMPRESS_TEMPLATE, IMG_OO_IMPRESS_TEMPLATE },
- { "ots", FALSE, STR_DESCRIPTION_OO_CALC_TEMPLATE, IMG_OO_CALC_TEMPLATE },
- { "ott", FALSE, STR_DESCRIPTION_OO_WRITER_TEMPLATE, IMG_OO_WRITER_TEMPLATE },
- { "pas", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "pcd", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCD },
- { "pct", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCT },
- { "pcx", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCX },
- { "pl", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "png", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PNG },
- { "rar", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 },
- { "rtf", FALSE, STR_DESCRIPTION_WORD_DOC, IMG_WRITER },
- { "sbl", FALSE, 0, 0 },
- { "sch", FALSE, 0, 0 },
- { "sda", FALSE, STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW },
- { "sdb", FALSE, STR_DESCRIPTION_SDATABASE_DOC, IMG_DATABASE },
- { "sdc", FALSE, STR_DESCRIPTION_SCALC_DOC, IMG_CALC },
- { "sdd", FALSE, STR_DESCRIPTION_SIMPRESS_DOC, IMG_IMPRESS },
- { "sdp", FALSE, STR_DESCRIPTION_SIMPRESS_DOC, 0 },
- { "sds", FALSE, STR_DESCRIPTION_SCHART_DOC, 0 },
- { "sdw", FALSE, STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER },
- { "sga", FALSE, 0, 0 },
- { "sgf", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SGF },
- { "sgl", FALSE, STR_DESCRIPTION_GLOBALDOC, IMG_GLOBAL_DOC },
- { "sgv", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SGV },
- { "shtml", FALSE, STR_DESCRIPTION_HTMLFILE, IMG_HTML },
- { "sim", FALSE, STR_DESCRIPTION_SIMAGE_DOC, IMG_SIM },
- { "smf", FALSE, STR_DESCRIPTION_SMATH_DOC, IMG_MATH },
- { "src", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "svh", FALSE, STR_DESCRIPTION_HELP_DOC, 0 },
- { "svm", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SVM },
- { "stc", FALSE, STR_DESCRIPTION_CALC_TEMPLATE, IMG_CALCTEMPLATE },
- { "std", FALSE, STR_DESCRIPTION_DRAW_TEMPLATE, IMG_DRAWTEMPLATE },
- { "sti", FALSE, STR_DESCRIPTION_IMPRESS_TEMPLATE, IMG_IMPRESSTEMPLATE },
- { "stw", FALSE, STR_DESCRIPTION_WRITER_TEMPLATE, IMG_WRITERTEMPLATE },
- { "sxc", FALSE, STR_DESCRIPTION_SXCALC_DOC, IMG_CALC },
- { "sxd", FALSE, STR_DESCRIPTION_SXDRAW_DOC, IMG_DRAW },
- { "sxg", FALSE, STR_DESCRIPTION_SXGLOBAL_DOC, IMG_GLOBAL_DOC },
- { "sxi", FALSE, STR_DESCRIPTION_SXIMPRESS_DOC, IMG_IMPRESS },
- { "sxm", FALSE, STR_DESCRIPTION_SXMATH_DOC, IMG_MATH },
- { "sxs", FALSE, STR_DESCRIPTION_SXCHART_DOC, 0 },
- { "sxw", FALSE, STR_DESCRIPTION_SXWRITER_DOC, IMG_WRITER },
- { "sys", TRUE, STR_DESCRIPTION_SYSFILE, 0 },
- { "tif", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF },
- { "tiff", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF },
- { "txt", FALSE, STR_DESCRIPTION_TEXTFILE, IMG_TEXTFILE },
- { "url", FALSE, STR_DESCRIPTION_LINK, 0 },
- { "vor", FALSE, STR_DESCRIPTION_SOFFICE_TEMPLATE_DOC, IMG_WRITERTEMPLATE },
- { "vxd", TRUE, STR_DESCRIPTION_SYSFILE, 0 },
- { "wmf", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_WMF },
- { "xls", FALSE, STR_DESCRIPTION_EXCEL_DOC, IMG_CALC },
- { "xlt", FALSE, STR_DESCRIPTION_EXCEL_TEMPLATE_DOC, IMG_CALCTEMPLATE },
- { "xlsx", FALSE, STR_DESCRIPTION_EXCEL_DOC, IMG_CALC },
- { "uu", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 },
- { "uue", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 },
- { "z", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 },
- { "zip", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 },
- { "zoo", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 },
- { "gz", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 },
- { "ppt", FALSE, STR_DESCRIPTION_POWERPOINT, IMG_IMPRESS },
- { "pot", FALSE, STR_DESCRIPTION_POWERPOINT_TEMPLATE, IMG_IMPRESSTEMPLATE },
- { "pps", FALSE, STR_DESCRIPTION_POWERPOINT_SHOW, IMG_IMPRESS },
- { "pptx", FALSE, STR_DESCRIPTION_POWERPOINT, IMG_IMPRESS },
- { "oxt", FALSE, STR_DESCRIPTION_EXTENSION, IMG_EXTENSION },
- { 0, FALSE, 0, 0 }
+ { "log", sal_True, STR_DESCRIPTION_LOGFILE, 0 },
+ { "lst", sal_True, STR_DESCRIPTION_LOGFILE, 0 },
+ { "met", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_MET },
+ { "mml", sal_False, STR_DESCRIPTION_MATHML_DOC, IMG_MATH },
+ { "mod", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "odb", sal_False, STR_DESCRIPTION_OO_DATABASE_DOC, IMG_OO_DATABASE_DOC },
+ { "odg", sal_False, STR_DESCRIPTION_OO_DRAW_DOC, IMG_OO_DRAW_DOC },
+ { "odf", sal_False, STR_DESCRIPTION_OO_MATH_DOC, IMG_OO_MATH_DOC },
+ { "odm", sal_False, STR_DESCRIPTION_OO_GLOBAL_DOC, IMG_OO_GLOBAL_DOC },
+ { "odp", sal_False, STR_DESCRIPTION_OO_IMPRESS_DOC, IMG_OO_IMPRESS_DOC },
+ { "ods", sal_False, STR_DESCRIPTION_OO_CALC_DOC, IMG_OO_CALC_DOC },
+ { "odt", sal_False, STR_DESCRIPTION_OO_WRITER_DOC, IMG_OO_WRITER_DOC },
+ { "otg", sal_False, STR_DESCRIPTION_OO_DRAW_TEMPLATE, IMG_OO_DRAW_TEMPLATE },
+ { "otp", sal_False, STR_DESCRIPTION_OO_IMPRESS_TEMPLATE, IMG_OO_IMPRESS_TEMPLATE },
+ { "ots", sal_False, STR_DESCRIPTION_OO_CALC_TEMPLATE, IMG_OO_CALC_TEMPLATE },
+ { "ott", sal_False, STR_DESCRIPTION_OO_WRITER_TEMPLATE, IMG_OO_WRITER_TEMPLATE },
+ { "pas", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "pcd", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCD },
+ { "pct", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCT },
+ { "pcx", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCX },
+ { "pl", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "png", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PNG },
+ { "rar", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 },
+ { "rtf", sal_False, STR_DESCRIPTION_WORD_DOC, IMG_WRITER },
+ { "sbl", sal_False, 0, 0 },
+ { "sch", sal_False, 0, 0 },
+ { "sda", sal_False, STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW },
+ { "sdb", sal_False, STR_DESCRIPTION_SDATABASE_DOC, IMG_DATABASE },
+ { "sdc", sal_False, STR_DESCRIPTION_SCALC_DOC, IMG_CALC },
+ { "sdd", sal_False, STR_DESCRIPTION_SIMPRESS_DOC, IMG_IMPRESS },
+ { "sdp", sal_False, STR_DESCRIPTION_SIMPRESS_DOC, 0 },
+ { "sds", sal_False, STR_DESCRIPTION_SCHART_DOC, 0 },
+ { "sdw", sal_False, STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER },
+ { "sga", sal_False, 0, 0 },
+ { "sgf", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SGF },
+ { "sgl", sal_False, STR_DESCRIPTION_GLOBALDOC, IMG_GLOBAL_DOC },
+ { "sgv", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SGV },
+ { "shtml", sal_False, STR_DESCRIPTION_HTMLFILE, IMG_HTML },
+ { "sim", sal_False, STR_DESCRIPTION_SIMAGE_DOC, IMG_SIM },
+ { "smf", sal_False, STR_DESCRIPTION_SMATH_DOC, IMG_MATH },
+ { "src", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "svh", sal_False, STR_DESCRIPTION_HELP_DOC, 0 },
+ { "svm", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SVM },
+ { "stc", sal_False, STR_DESCRIPTION_CALC_TEMPLATE, IMG_CALCTEMPLATE },
+ { "std", sal_False, STR_DESCRIPTION_DRAW_TEMPLATE, IMG_DRAWTEMPLATE },
+ { "sti", sal_False, STR_DESCRIPTION_IMPRESS_TEMPLATE, IMG_IMPRESSTEMPLATE },
+ { "stw", sal_False, STR_DESCRIPTION_WRITER_TEMPLATE, IMG_WRITERTEMPLATE },
+ { "sxc", sal_False, STR_DESCRIPTION_SXCALC_DOC, IMG_CALC },
+ { "sxd", sal_False, STR_DESCRIPTION_SXDRAW_DOC, IMG_DRAW },
+ { "sxg", sal_False, STR_DESCRIPTION_SXGLOBAL_DOC, IMG_GLOBAL_DOC },
+ { "sxi", sal_False, STR_DESCRIPTION_SXIMPRESS_DOC, IMG_IMPRESS },
+ { "sxm", sal_False, STR_DESCRIPTION_SXMATH_DOC, IMG_MATH },
+ { "sxs", sal_False, STR_DESCRIPTION_SXCHART_DOC, 0 },
+ { "sxw", sal_False, STR_DESCRIPTION_SXWRITER_DOC, IMG_WRITER },
+ { "sys", sal_True, STR_DESCRIPTION_SYSFILE, 0 },
+ { "tif", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF },
+ { "tiff", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF },
+ { "txt", sal_False, STR_DESCRIPTION_TEXTFILE, IMG_TEXTFILE },
+ { "url", sal_False, STR_DESCRIPTION_LINK, 0 },
+ { "vor", sal_False, STR_DESCRIPTION_SOFFICE_TEMPLATE_DOC, IMG_WRITERTEMPLATE },
+ { "vxd", sal_True, STR_DESCRIPTION_SYSFILE, 0 },
+ { "wmf", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_WMF },
+ { "xls", sal_False, STR_DESCRIPTION_EXCEL_DOC, IMG_CALC },
+ { "xlt", sal_False, STR_DESCRIPTION_EXCEL_TEMPLATE_DOC, IMG_CALCTEMPLATE },
+ { "xlsx", sal_False, STR_DESCRIPTION_EXCEL_DOC, IMG_CALC },
+ { "uu", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 },
+ { "uue", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 },
+ { "z", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 },
+ { "zip", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 },
+ { "zoo", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 },
+ { "gz", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 },
+ { "ppt", sal_False, STR_DESCRIPTION_POWERPOINT, IMG_IMPRESS },
+ { "pot", sal_False, STR_DESCRIPTION_POWERPOINT_TEMPLATE, IMG_IMPRESSTEMPLATE },
+ { "pps", sal_False, STR_DESCRIPTION_POWERPOINT_SHOW, IMG_IMPRESS },
+ { "pptx", sal_False, STR_DESCRIPTION_POWERPOINT, IMG_IMPRESS },
+ { "oxt", sal_False, STR_DESCRIPTION_EXTENSION, IMG_EXTENSION },
+ { 0, sal_False, 0, 0 }
};
#ifdef OS2
SvtExtensionResIdMapping_Impl Mappings[] =
{
- {"StarWriter 4.0", FALSE,STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER},
- {"StarWriter 3.0", FALSE,STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER},
- {"StarCalc 4.0", FALSE,STR_DESCRIPTION_SCALC_DOC, IMG_CALC},
- {"StarCalc 3.0", FALSE,STR_DESCRIPTION_SCALC_DOC, IMG_CALC},
- {"StarImpress 4.0", FALSE,STR_DESCRIPTION_SIMPRESS_DOC,IMG_IMPRESS},
- {"StarDraw 4.0", FALSE,STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW},
- {"StarDraw 3.0", FALSE,STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW},
- {"StarChart 3.0", FALSE,STR_DESCRIPTION_SCHART_DOC, IMG_CHART},
- {"StarChart 4.0", FALSE,STR_DESCRIPTION_SCHART_DOC, IMG_CHART},
- {"Bitmap", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP},
- {"AutoCAD", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM},
- {"Gif-File", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_GIF},
- {"JPEG-File", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG},
- {"Metafile ", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM},
- {"Photo-CD ", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCD},
- {"Mac Pict", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCT},
- {"PCX-File ", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCX},
- {"PNG-File", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM},
- {"SV-Metafile", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM},
- {"TIFF-File", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF},
- {"MS-Metafile", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_WMF},
- {"XBM-File", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP},
+ {"StarWriter 4.0", sal_False,STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER},
+ {"StarWriter 3.0", sal_False,STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER},
+ {"StarCalc 4.0", sal_False,STR_DESCRIPTION_SCALC_DOC, IMG_CALC},
+ {"StarCalc 3.0", sal_False,STR_DESCRIPTION_SCALC_DOC, IMG_CALC},
+ {"StarImpress 4.0", sal_False,STR_DESCRIPTION_SIMPRESS_DOC,IMG_IMPRESS},
+ {"StarDraw 4.0", sal_False,STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW},
+ {"StarDraw 3.0", sal_False,STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW},
+ {"StarChart 3.0", sal_False,STR_DESCRIPTION_SCHART_DOC, IMG_CHART},
+ {"StarChart 4.0", sal_False,STR_DESCRIPTION_SCHART_DOC, IMG_CHART},
+ {"Bitmap", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP},
+ {"AutoCAD", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM},
+ {"Gif-File", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_GIF},
+ {"JPEG-File", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG},
+ {"Metafile ", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM},
+ {"Photo-CD ", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCD},
+ {"Mac Pict", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCT},
+ {"PCX-File ", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCX},
+ {"PNG-File", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM},
+ {"SV-Metafile", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM},
+ {"TIFF-File", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF},
+ {"MS-Metafile", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_WMF},
+ {"XBM-File", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP},
{NULL, 0}
};
#endif
@@ -246,7 +245,7 @@ static String GetImageExtensionByFactory_Impl( const String& rURL )
if ( aPath.Len() )
{
- USHORT nIndex = 0;
+ sal_uInt16 nIndex = 0;
while ( Fac2ExtMap_Impl[ nIndex ]._pFactory )
{
if ( aPath.EqualsAscii( Fac2ExtMap_Impl[ nIndex ]._pFactory ) )
@@ -304,12 +303,12 @@ static String GetImageExtensionByFactory_Impl( const String& rURL )
return aExtension;
}
-static USHORT GetIndexOfExtension_Impl( const String& rExtension )
+static sal_uInt16 GetIndexOfExtension_Impl( const String& rExtension )
{
- USHORT nRet = NO_INDEX;
+ sal_uInt16 nRet = NO_INDEX;
if ( rExtension.Len() )
{
- USHORT nIndex = 0;
+ sal_uInt16 nIndex = 0;
String aExt = rExtension;
aExt.ToLowerAscii();
while ( ExtensionMap_Impl[ nIndex ]._pExt )
@@ -326,12 +325,12 @@ static USHORT GetIndexOfExtension_Impl( const String& rExtension )
return nRet;
}
-static USHORT GetImageId_Impl( const String& rExtension )
+static sal_uInt16 GetImageId_Impl( const String& rExtension )
{
- USHORT nImage = IMG_FILE;
+ sal_uInt16 nImage = IMG_FILE;
if ( rExtension.Len() != NO_INDEX )
{
- USHORT nIndex = GetIndexOfExtension_Impl( rExtension );
+ sal_uInt16 nIndex = GetIndexOfExtension_Impl( rExtension );
if ( nIndex != NO_INDEX )
{
nImage = ExtensionMap_Impl[ nIndex ]._nImgId;
@@ -367,9 +366,9 @@ static sal_Bool GetVolumeProperties_Impl( ::ucbhelper::Content& rContent, svtool
return bRet;
}
-static USHORT GetFolderImageId_Impl( const String& rURL )
+static sal_uInt16 GetFolderImageId_Impl( const String& rURL )
{
- USHORT nRet = IMG_FOLDER;
+ sal_uInt16 nRet = IMG_FOLDER;
::svtools::VolumeInfo aVolumeInfo;
try
{
@@ -397,12 +396,12 @@ static USHORT GetFolderImageId_Impl( const String& rURL )
return nRet;
}
-static USHORT GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFolder )
+static sal_uInt16 GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFolder )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aTimeLog, "svtools", "hb93813", "SvFileInformationManager::GetImageId_Impl()" );
String aExt, sURL = rObject.GetMainURL( INetURLObject::NO_DECODE );
- USHORT nImage = IMG_FILE;
+ sal_uInt16 nImage = IMG_FILE;
if ( rObject.GetProtocol() == INET_PROT_PRIVATE )
{
@@ -417,7 +416,7 @@ static USHORT GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFol
return nImage;
}
else if ( aType == String( RTL_CONSTASCII_USTRINGPARAM("image") ) )
- nImage = (USHORT)aURLPath.GetToken( 1, INET_PATH_TOKEN ).ToInt32();
+ nImage = (sal_uInt16)aURLPath.GetToken( 1, INET_PATH_TOKEN ).ToInt32();
}
else
{
@@ -425,7 +424,7 @@ static USHORT GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFol
if ( aExt.EqualsAscii( "vor" ) )
{
SotStorageRef aStorage = new SotStorage( sURL, STREAM_STD_READ );
- USHORT nId = IMG_WRITERTEMPLATE;
+ sal_uInt16 nId = IMG_WRITERTEMPLATE;
if ( !aStorage->GetError() )
{
SvGlobalName aGlobalName = aStorage->GetClassName();
@@ -454,13 +453,13 @@ static USHORT GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFol
return nImage;
}
-static USHORT GetDescriptionId_Impl( const String& rExtension, sal_Bool& rbShowExt )
+static sal_uInt16 GetDescriptionId_Impl( const String& rExtension, sal_Bool& rbShowExt )
{
- USHORT nId = 0;
+ sal_uInt16 nId = 0;
if ( rExtension.Len() != NO_INDEX )
{
- USHORT nIndex = GetIndexOfExtension_Impl( rExtension );
+ sal_uInt16 nIndex = GetIndexOfExtension_Impl( rExtension );
if ( nIndex != NO_INDEX )
{
nId = ExtensionMap_Impl[ nIndex ]._nStrId;
@@ -473,7 +472,7 @@ static USHORT GetDescriptionId_Impl( const String& rExtension, sal_Bool& rbShowE
static String GetDescriptionByFactory_Impl( const String& rFactory )
{
- USHORT nResId = 0;
+ sal_uInt16 nResId = 0;
if ( rFactory.EqualsIgnoreCaseAscii( "swriter", 0, 7 ) )
nResId = STR_DESCRIPTION_FACTORY_WRITER;
else if ( rFactory.EqualsIgnoreCaseAscii( "scalc", 0, 5 ) )
@@ -500,9 +499,9 @@ static String GetDescriptionByFactory_Impl( const String& rFactory )
return aRet;
}
-static USHORT GetFolderDescriptionId_Impl( const String& rURL )
+static sal_uInt16 GetFolderDescriptionId_Impl( const String& rURL )
{
- USHORT nRet = STR_DESCRIPTION_FOLDER;
+ sal_uInt16 nRet = STR_DESCRIPTION_FOLDER;
svtools::VolumeInfo aVolumeInfo;
try
{
@@ -530,76 +529,7 @@ static USHORT GetFolderDescriptionId_Impl( const String& rURL )
return nRet;
}
-static ResMgr* GetIsoResMgr_Impl()
-{
- static ResMgr* pIsoResMgr = NULL;
-
- if ( !pIsoResMgr )
- {
- ByteString aResMgrName( "iso" );
- pIsoResMgr = ResMgr::CreateResMgr(
- aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
- if ( !pIsoResMgr )
- {
- // no "iso" resource -> search for "ooo" resource
- aResMgrName = ByteString( "ooo" );
- pIsoResMgr = ResMgr::CreateResMgr(
- aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
- }
- }
-
- return pIsoResMgr;
-}
-
-static ImageList* CreateImageList_Impl( USHORT nResId )
-{
- ImageList* pList = NULL;
- ResMgr* pResMgr = GetIsoResMgr_Impl();
- DBG_ASSERT( pResMgr, "SvFileInformationManager::CreateImageList_Impl(): no resmgr" );
- ResId aResId( nResId, *pResMgr );
- aResId.SetRT( RSC_IMAGELIST );
- if ( pResMgr->IsAvailable( aResId ) )
- pList = new ImageList( aResId );
- else
- pList = new ImageList();
- return pList;
-}
-
-static Image GetOfficeImageFromList_Impl( USHORT nImageId, BOOL bBig )
-{
- ImageList* pList = NULL;
-
- static ImageList* _pSmallOfficeImgList = NULL;
- static ImageList* _pBigOfficeImgList = NULL;
- static ULONG nStyle = Application::GetSettings().GetStyleSettings().GetSymbolsStyle();
-
- // If the style has been changed, throw away our cache of the older images
- if ( nStyle != Application::GetSettings().GetStyleSettings().GetSymbolsStyle() )
- {
- delete _pSmallOfficeImgList, _pSmallOfficeImgList = NULL;
- delete _pBigOfficeImgList, _pBigOfficeImgList = NULL;
- nStyle = Application::GetSettings().GetStyleSettings().GetSymbolsStyle();
- }
-
- if ( bBig )
- {
- if ( !_pBigOfficeImgList )
- _pBigOfficeImgList = CreateImageList_Impl( RID_SVTOOLS_IMAGELIST_BIG );
- pList = _pBigOfficeImgList;
- }
- else
- {
- if ( !_pSmallOfficeImgList )
- _pSmallOfficeImgList = CreateImageList_Impl( RID_SVTOOLS_IMAGELIST_SMALL );
- pList = _pSmallOfficeImgList;
- }
-
- Image aImage = pList->GetImage( nImageId );
-
- return aImage;
-}
-
-static Image GetImageFromList_Impl( USHORT nImageId, BOOL bBig )
+static Image GetImageFromList_Impl( sal_uInt16 nImageId, sal_Bool bBig )
{
if ( !bBig && IMG_FOLDER == nImageId )
// return our new small folder image (256 colors)
@@ -609,7 +539,7 @@ static Image GetImageFromList_Impl( USHORT nImageId, BOOL bBig )
static ImageList* _pSmallImageList = NULL;
static ImageList* _pBigImageList = NULL;
- static ULONG nStyle = Application::GetSettings().GetStyleSettings().GetSymbolsStyle();
+ static sal_uLong nStyle = Application::GetSettings().GetStyleSettings().GetSymbolsStyle();
// If the style has been changed, throw away our cache of the older images
if ( nStyle != Application::GetSettings().GetStyleSettings().GetSymbolsStyle() )
@@ -635,7 +565,8 @@ static Image GetImageFromList_Impl( USHORT nImageId, BOOL bBig )
if ( pList->HasImageAtPos( nImageId ) )
return pList->GetImage( nImageId );
else
- return GetOfficeImageFromList_Impl( nImageId, bBig );
+ return Image();
+// return GetOfficeImageFromList_Impl( nImageId, bBig );
}
String SvFileInformationManager::GetDescription_Impl( const INetURLObject& rObject, sal_Bool bDetectFolder )
@@ -644,7 +575,7 @@ String SvFileInformationManager::GetDescription_Impl( const INetURLObject& rObje
String sDescription;
String sExtension( rObject.getExtension() ), sURL( rObject.GetMainURL( INetURLObject::NO_DECODE ) );
- USHORT nResId = 0;
+ sal_uInt16 nResId = 0;
sal_Bool bShowExt = sal_False, bDetected = sal_False, bOnlyFile = sal_False;
sal_Bool bFolder = bDetectFolder ? CONTENT_HELPER::IsFolder( sURL ) : sal_False;
if ( !bFolder )
@@ -709,21 +640,21 @@ String SvFileInformationManager::GetDescription_Impl( const INetURLObject& rObje
Image SvFileInformationManager::GetImage( const INetURLObject& rObject, sal_Bool bBig )
{
- USHORT nImage = GetImageId_Impl( rObject, sal_True );
+ sal_uInt16 nImage = GetImageId_Impl( rObject, sal_True );
DBG_ASSERT( nImage, "invalid ImageId" );
return GetImageFromList_Impl( nImage, bBig );
}
Image SvFileInformationManager::GetFileImage( const INetURLObject& rObject, sal_Bool bBig )
{
- USHORT nImage = GetImageId_Impl( rObject, sal_False );
+ sal_Int16 nImage = GetImageId_Impl( rObject, sal_False );
DBG_ASSERT( nImage, "invalid ImageId" );
return GetImageFromList_Impl( nImage, bBig );
}
Image SvFileInformationManager::GetImageNoDefault( const INetURLObject& rObject, sal_Bool bBig )
{
- USHORT nImage = GetImageId_Impl( rObject, sal_True );
+ sal_uInt16 nImage = GetImageId_Impl( rObject, sal_True );
DBG_ASSERT( nImage, "invalid ImageId" );
if ( nImage == IMG_FILE )
@@ -734,7 +665,7 @@ Image SvFileInformationManager::GetImageNoDefault( const INetURLObject& rObject,
Image SvFileInformationManager::GetFolderImage( const svtools::VolumeInfo& rInfo, sal_Bool bBig )
{
- USHORT nImage = IMG_FOLDER;
+ sal_uInt16 nImage = IMG_FOLDER;
DBG_ASSERT( nImage, "invalid ImageId" );
if ( rInfo.m_bIsRemote )
@@ -761,7 +692,7 @@ String SvFileInformationManager::GetFileDescription( const INetURLObject& rObjec
String SvFileInformationManager::GetFolderDescription( const svtools::VolumeInfo& rInfo )
{
- USHORT nResId = STR_DESCRIPTION_FOLDER;
+ sal_uInt16 nResId = STR_DESCRIPTION_FOLDER;
if ( rInfo.m_bIsRemote )
nResId = STR_DESCRIPTION_REMOTE_VOLUME;
else if ( rInfo.m_bIsFloppy )
diff --git a/svtools/source/misc/imagemgr.src b/svtools/source/misc/imagemgr.src
index c49f048364e4..62104ea09d54 100644
--- a/svtools/source/misc/imagemgr.src
+++ b/svtools/source/misc/imagemgr.src
@@ -27,11 +27,26 @@
// includes ******************************************************************
#include <svtools/svtools.hrc>
-#include "imagemgr.hrc"
+#include <svtools/imagemgr.hrc>
// images ********************************************************************
#define X_IMAGE_LIST \
+ IMG_IMPRESS ; \
+ IMG_CALC ; \
+ IMG_CALCTEMPLATE ; \
+ IMG_CHART ; \
+ IMG_IMPRESSTEMPLATE ; \
+ IMG_HTML ; \
+ IMG_MATH ; \
+ IMG_WRITER ; \
+ IMG_WRITERTEMPLATE ; \
+ IMG_MACROLIB ; \
+ IMG_GLOBAL_DOC ; \
+ IMG_DRAW ; \
+ IMG_DRAWTEMPLATE ; \
+ IMG_NEWFROMTEMPLATE ; \
+ IMG_DATABASE; \
IMG_BITMAP ; \
IMG_CALC ; \
IMG_CALCTEMPLATE ; \
@@ -95,7 +110,7 @@ ImageList RID_SVTOOLS_IMAGELIST_BIG
};
IdCount =
{
- 51 ;
+ 66 ;
};
};
@@ -109,7 +124,7 @@ ImageList RID_SVTOOLS_IMAGELIST_SMALL
};
IdCount =
{
- 51;
+ 66;
};
};
diff --git a/svtools/source/misc/imageresourceaccess.cxx b/svtools/source/misc/imageresourceaccess.cxx
index 47a68a5684ea..e69f1967b462 100644
--- a/svtools/source/misc/imageresourceaccess.cxx
+++ b/svtools/source/misc/imageresourceaccess.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "imageresourceaccess.hxx"
+#include <svtools/imageresourceaccess.hxx>
/** === begin UNO includes === **/
#include <com/sun/star/io/NotConnectedException.hpp>
diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx
index 105eb763fb7b..88bb9a9a510a 100644
--- a/svtools/source/misc/imap.cxx
+++ b/svtools/source/misc/imap.cxx
@@ -53,15 +53,11 @@ DBG_NAME( ImageMap )
/******************************************************************************/
-UINT16 IMapObject::nActualTextEncoding = (UINT16) RTL_TEXTENCODING_DONTKNOW;
+sal_uInt16 IMapObject::nActualTextEncoding = (sal_uInt16) RTL_TEXTENCODING_DONTKNOW;
/******************************************************************************/
-#ifdef WIN
-#pragma optimize ( "", off )
-#endif
-
IMapObject::IMapObject()
: bActive( false )
, nReadVersion( 0 )
@@ -69,7 +65,7 @@ IMapObject::IMapObject()
}
IMapObject::IMapObject( const String& rURL, const String& rAltText, const String& rDesc,
- const String& rTarget, const String& rName, BOOL bURLActive )
+ const String& rTarget, const String& rName, sal_Bool bURLActive )
: aURL( rURL )
, aAltText( rAltText )
, aDesc( rDesc )
@@ -87,7 +83,7 @@ IMapObject::IMapObject( const String& rURL, const String& rAltText, const String
|*
\******************************************************************************/
-UINT16 IMapObject::GetVersion() const
+sal_uInt16 IMapObject::GetVersion() const
{
return IMAP_OBJ_VERSION;
}
@@ -106,7 +102,7 @@ void IMapObject::Write( SvStream& rOStm, const String& rBaseURL ) const
rOStm << GetType();
rOStm << GetVersion();
- rOStm << ( (UINT16) eEncoding );
+ rOStm << ( (sal_uInt16) eEncoding );
const ByteString aRelURL = ByteString( String(URIHelper::simpleNormalizedMakeRelative( rBaseURL, aURL )), eEncoding );
rOStm.WriteByteString( aRelURL );
@@ -197,7 +193,7 @@ Point IMapObject::GetLogPoint( const Point& rPixelPoint )
|*
\******************************************************************************/
-BOOL IMapObject::IsEqual( const IMapObject& rEqObj )
+sal_Bool IMapObject::IsEqual( const IMapObject& rEqObj )
{
return ( ( aURL == rEqObj.aURL ) &&
( aAltText == rEqObj.aAltText ) &&
@@ -218,8 +214,8 @@ IMapRectangleObject::IMapRectangleObject( const Rectangle& rRect,
const String& rDesc,
const String& rTarget,
const String& rName,
- BOOL bURLActive,
- BOOL bPixelCoords ) :
+ sal_Bool bURLActive,
+ sal_Bool bPixelCoords ) :
IMapObject ( rURL, rAltText, rDesc, rTarget, rName, bURLActive )
{
ImpConstruct( rRect, bPixelCoords );
@@ -232,7 +228,7 @@ IMapRectangleObject::IMapRectangleObject( const Rectangle& rRect,
|*
\******************************************************************************/
-void IMapRectangleObject::ImpConstruct( const Rectangle& rRect, BOOL bPixel )
+void IMapRectangleObject::ImpConstruct( const Rectangle& rRect, sal_Bool bPixel )
{
if ( bPixel )
aRect = Application::GetDefaultDevice()->PixelToLogic( rRect, MapMode( MAP_100TH_MM ) );
@@ -271,7 +267,7 @@ void IMapRectangleObject::ReadIMapObject( SvStream& rIStm )
|*
\******************************************************************************/
-UINT16 IMapRectangleObject::GetType() const
+sal_uInt16 IMapRectangleObject::GetType() const
{
return IMAP_OBJ_RECTANGLE;
}
@@ -283,7 +279,7 @@ UINT16 IMapRectangleObject::GetType() const
|*
\******************************************************************************/
-BOOL IMapRectangleObject::IsHit( const Point& rPoint ) const
+sal_Bool IMapRectangleObject::IsHit( const Point& rPoint ) const
{
return aRect.IsInside( rPoint );
}
@@ -295,7 +291,7 @@ BOOL IMapRectangleObject::IsHit( const Point& rPoint ) const
|*
\******************************************************************************/
-Rectangle IMapRectangleObject::GetRectangle( BOOL bPixelCoords ) const
+Rectangle IMapRectangleObject::GetRectangle( sal_Bool bPixelCoords ) const
{
Rectangle aNewRect;
@@ -335,7 +331,7 @@ void IMapRectangleObject::Scale( const Fraction& rFracX, const Fraction& rFracY
|*
\******************************************************************************/
-BOOL IMapRectangleObject::IsEqual( const IMapRectangleObject& rEqObj )
+sal_Bool IMapRectangleObject::IsEqual( const IMapRectangleObject& rEqObj )
{
return ( IMapObject::IsEqual( rEqObj ) && ( aRect == rEqObj.aRect ) );
}
@@ -345,14 +341,14 @@ BOOL IMapRectangleObject::IsEqual( const IMapRectangleObject& rEqObj )
/******************************************************************************/
/******************************************************************************/
-IMapCircleObject::IMapCircleObject( const Point& rCenter, ULONG nCircleRadius,
+IMapCircleObject::IMapCircleObject( const Point& rCenter, sal_uLong nCircleRadius,
const String& rURL,
const String& rAltText,
const String& rDesc,
const String& rTarget,
const String& rName,
- BOOL bURLActive,
- BOOL bPixelCoords ) :
+ sal_Bool bURLActive,
+ sal_Bool bPixelCoords ) :
IMapObject ( rURL, rAltText, rDesc, rTarget, rName, bURLActive )
{
ImpConstruct( rCenter, nCircleRadius, bPixelCoords );
@@ -365,7 +361,7 @@ IMapCircleObject::IMapCircleObject( const Point& rCenter, ULONG nCircleRadius,
|*
\******************************************************************************/
-void IMapCircleObject::ImpConstruct( const Point& rCenter, ULONG nRad, BOOL bPixel )
+void IMapCircleObject::ImpConstruct( const Point& rCenter, sal_uLong nRad, sal_Bool bPixel )
{
if ( bPixel )
{
@@ -390,7 +386,7 @@ void IMapCircleObject::ImpConstruct( const Point& rCenter, ULONG nRad, BOOL bPix
void IMapCircleObject::WriteIMapObject( SvStream& rOStm ) const
{
- UINT32 nTmp = nRadius;
+ sal_uInt32 nTmp = nRadius;
rOStm << aCenter;
rOStm << nTmp;
@@ -405,7 +401,7 @@ void IMapCircleObject::WriteIMapObject( SvStream& rOStm ) const
void IMapCircleObject::ReadIMapObject( SvStream& rIStm )
{
- UINT32 nTmp;
+ sal_uInt32 nTmp;
rIStm >> aCenter;
rIStm >> nTmp;
@@ -420,7 +416,7 @@ void IMapCircleObject::ReadIMapObject( SvStream& rIStm )
|*
\******************************************************************************/
-UINT16 IMapCircleObject::GetType() const
+sal_uInt16 IMapCircleObject::GetType() const
{
return IMAP_OBJ_CIRCLE;
}
@@ -432,15 +428,15 @@ UINT16 IMapCircleObject::GetType() const
|*
\******************************************************************************/
-BOOL IMapCircleObject::IsHit( const Point& rPoint ) const
+sal_Bool IMapCircleObject::IsHit( const Point& rPoint ) const
{
const Point aPoint( aCenter - rPoint );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
- if ( (ULONG) sqrt( (double) aPoint.X() * aPoint.X() +
+ if ( (sal_uLong) sqrt( (double) aPoint.X() * aPoint.X() +
aPoint.Y() * aPoint.Y() ) <= nRadius )
{
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -453,7 +449,7 @@ BOOL IMapCircleObject::IsHit( const Point& rPoint ) const
|*
\******************************************************************************/
-Point IMapCircleObject::GetCenter( BOOL bPixelCoords ) const
+Point IMapCircleObject::GetCenter( sal_Bool bPixelCoords ) const
{
Point aNewPoint;
@@ -472,9 +468,9 @@ Point IMapCircleObject::GetCenter( BOOL bPixelCoords ) const
|*
\******************************************************************************/
-ULONG IMapCircleObject::GetRadius( BOOL bPixelCoords ) const
+sal_uLong IMapCircleObject::GetRadius( sal_Bool bPixelCoords ) const
{
- ULONG nNewRadius;
+ sal_uLong nNewRadius;
if ( bPixelCoords )
nNewRadius = Application::GetDefaultDevice()->LogicToPixel( Size( nRadius, 0 ), MapMode( MAP_100TH_MM ) ).Width();
@@ -528,7 +524,7 @@ void IMapCircleObject::Scale( const Fraction& rFracX, const Fraction& rFracY )
|*
\******************************************************************************/
-BOOL IMapCircleObject::IsEqual( const IMapCircleObject& rEqObj )
+sal_Bool IMapCircleObject::IsEqual( const IMapCircleObject& rEqObj )
{
return ( IMapObject::IsEqual( rEqObj ) &&
( aCenter == rEqObj.aCenter ) &&
@@ -545,10 +541,10 @@ IMapPolygonObject::IMapPolygonObject( const Polygon& rPoly,
const String& rDesc,
const String& rTarget,
const String& rName,
- BOOL bURLActive,
- BOOL bPixelCoords ) :
+ sal_Bool bURLActive,
+ sal_Bool bPixelCoords ) :
IMapObject ( rURL, rAltText, rDesc, rTarget, rName, bURLActive ),
- bEllipse ( FALSE )
+ bEllipse ( sal_False )
{
ImpConstruct( rPoly, bPixelCoords );
}
@@ -560,7 +556,7 @@ IMapPolygonObject::IMapPolygonObject( const Polygon& rPoly,
|*
\******************************************************************************/
-void IMapPolygonObject::ImpConstruct( const Polygon& rPoly, BOOL bPixel )
+void IMapPolygonObject::ImpConstruct( const Polygon& rPoly, sal_Bool bPixel )
{
if ( bPixel )
aPoly = Application::GetDefaultDevice()->PixelToLogic( rPoly, MapMode( MAP_100TH_MM ) );
@@ -608,7 +604,7 @@ void IMapPolygonObject::ReadIMapObject( SvStream& rIStm )
|*
\******************************************************************************/
-UINT16 IMapPolygonObject::GetType() const
+sal_uInt16 IMapPolygonObject::GetType() const
{
return IMAP_OBJ_POLYGON;
}
@@ -620,7 +616,7 @@ UINT16 IMapPolygonObject::GetType() const
|*
\******************************************************************************/
-BOOL IMapPolygonObject::IsHit( const Point& rPoint ) const
+sal_Bool IMapPolygonObject::IsHit( const Point& rPoint ) const
{
return aPoly.IsInside( rPoint );
}
@@ -632,7 +628,7 @@ BOOL IMapPolygonObject::IsHit( const Point& rPoint ) const
|*
\******************************************************************************/
-Polygon IMapPolygonObject::GetPolygon( BOOL bPixelCoords ) const
+Polygon IMapPolygonObject::GetPolygon( sal_Bool bPixelCoords ) const
{
Polygon aNewPoly;
@@ -655,7 +651,7 @@ void IMapPolygonObject::SetExtraEllipse( const Rectangle& rEllipse )
{
if ( aPoly.GetSize() )
{
- bEllipse = TRUE;
+ bEllipse = sal_True;
aEllipse = rEllipse;
}
}
@@ -669,9 +665,9 @@ void IMapPolygonObject::SetExtraEllipse( const Rectangle& rEllipse )
void IMapPolygonObject::Scale( const Fraction& rFracX, const Fraction& rFracY )
{
- USHORT nCount = aPoly.GetSize();
+ sal_uInt16 nCount = aPoly.GetSize();
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
Point aScaledPt( aPoly[ i ] );
@@ -705,30 +701,30 @@ void IMapPolygonObject::Scale( const Fraction& rFracX, const Fraction& rFracY )
|*
\******************************************************************************/
-BOOL IMapPolygonObject::IsEqual( const IMapPolygonObject& rEqObj )
+sal_Bool IMapPolygonObject::IsEqual( const IMapPolygonObject& rEqObj )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( IMapObject::IsEqual( rEqObj ) )
{
const Polygon& rEqPoly = rEqObj.aPoly;
- const USHORT nCount = aPoly.GetSize();
- const USHORT nEqCount = rEqPoly.GetSize();
- BOOL bDifferent = FALSE;
+ const sal_uInt16 nCount = aPoly.GetSize();
+ const sal_uInt16 nEqCount = rEqPoly.GetSize();
+ sal_Bool bDifferent = sal_False;
if ( nCount == nEqCount )
{
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
if ( aPoly[ i ] != rEqPoly[ i ] )
{
- bDifferent = TRUE;
+ bDifferent = sal_True;
break;
}
}
if ( !bDifferent )
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -763,9 +759,9 @@ ImageMap::ImageMap( const ImageMap& rImageMap )
{
DBG_CTOR( ImageMap, NULL );
- USHORT nCount = rImageMap.GetIMapObjectCount();
+ sal_uInt16 nCount = rImageMap.GetIMapObjectCount();
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
IMapObject* pCopyObj = rImageMap.GetIMapObject( i );
@@ -836,11 +832,11 @@ void ImageMap::ClearImageMap()
ImageMap& ImageMap::operator=( const ImageMap& rImageMap )
{
- USHORT nCount = rImageMap.GetIMapObjectCount();
+ sal_uInt16 nCount = rImageMap.GetIMapObjectCount();
ClearImageMap();
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
IMapObject* pCopyObj = rImageMap.GetIMapObject( i );
@@ -875,17 +871,17 @@ ImageMap& ImageMap::operator=( const ImageMap& rImageMap )
|*
\******************************************************************************/
-BOOL ImageMap::operator==( const ImageMap& rImageMap )
+sal_Bool ImageMap::operator==( const ImageMap& rImageMap )
{
- const USHORT nCount = (USHORT) maList.Count();
- const USHORT nEqCount = rImageMap.GetIMapObjectCount();
- BOOL bRet = FALSE;
+ const sal_uInt16 nCount = (sal_uInt16) maList.Count();
+ const sal_uInt16 nEqCount = rImageMap.GetIMapObjectCount();
+ sal_Bool bRet = sal_False;
if ( nCount == nEqCount )
{
- BOOL bDifferent = ( aName != rImageMap.aName );
+ sal_Bool bDifferent = ( aName != rImageMap.aName );
- for ( USHORT i = 0; ( i < nCount ) && !bDifferent; i++ )
+ for ( sal_uInt16 i = 0; ( i < nCount ) && !bDifferent; i++ )
{
IMapObject* pObj = (IMapObject*) maList.GetObject( i );
IMapObject* pEqObj = rImageMap.GetIMapObject( i );
@@ -897,21 +893,21 @@ BOOL ImageMap::operator==( const ImageMap& rImageMap )
case( IMAP_OBJ_RECTANGLE ):
{
if ( !( (IMapRectangleObject*) pObj )->IsEqual( *(IMapRectangleObject*) pEqObj ) )
- bDifferent = TRUE;
+ bDifferent = sal_True;
}
break;
case( IMAP_OBJ_CIRCLE ):
{
if ( !( (IMapCircleObject*) pObj )->IsEqual( *(IMapCircleObject*) pEqObj ) )
- bDifferent = TRUE;
+ bDifferent = sal_True;
}
break;
case( IMAP_OBJ_POLYGON ):
{
if ( !( (IMapPolygonObject*) pObj )->IsEqual( *(IMapPolygonObject*) pEqObj ) )
- bDifferent = TRUE;
+ bDifferent = sal_True;
}
break;
@@ -920,11 +916,11 @@ BOOL ImageMap::operator==( const ImageMap& rImageMap )
}
}
else
- bDifferent = TRUE;
+ bDifferent = sal_True;
}
if ( !bDifferent )
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -937,7 +933,7 @@ BOOL ImageMap::operator==( const ImageMap& rImageMap )
|*
\******************************************************************************/
-BOOL ImageMap::operator!=( const ImageMap& rImageMap )
+sal_Bool ImageMap::operator!=( const ImageMap& rImageMap )
{
return !( *this == rImageMap );
}
@@ -949,7 +945,7 @@ BOOL ImageMap::operator!=( const ImageMap& rImageMap )
|*
\******************************************************************************/
-UINT16 ImageMap::GetVersion() const
+sal_uInt16 ImageMap::GetVersion() const
{
return IMAGE_MAP_VERSION;
}
@@ -992,7 +988,7 @@ void ImageMap::InsertIMapObject( const IMapObject& rIMapObject )
IMapObject* ImageMap::GetHitIMapObject( const Size& rTotalSize,
const Size& rDisplaySize,
const Point& rRelHitPoint,
- ULONG nFlags )
+ sal_uLong nFlags )
{
Point aRelPoint( rTotalSize.Width() * rRelHitPoint.X() / rDisplaySize.Width(),
rTotalSize.Height() * rRelHitPoint.Y() / rDisplaySize.Height() );
@@ -1031,9 +1027,9 @@ IMapObject* ImageMap::GetHitIMapObject( const Size& rTotalSize,
Rectangle ImageMap::GetBoundRect() const
{
Rectangle aBoundRect;
- ULONG nCount = maList.Count();
+ sal_uLong nCount = maList.Count();
- for ( ULONG i = 0; i < nCount; i++ )
+ for ( sal_uLong i = 0; i < nCount; i++ )
aBoundRect.Union( ( (IMapObject*) maList.GetObject( i ) )->GetBoundRect() );
return aBoundRect;
@@ -1048,9 +1044,9 @@ Rectangle ImageMap::GetBoundRect() const
void ImageMap::Scale( const Fraction& rFracX, const Fraction& rFracY )
{
- USHORT nCount = (USHORT) maList.Count();
+ sal_uInt16 nCount = (sal_uInt16) maList.Count();
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
IMapObject* pObj = GetIMapObject( i );
@@ -1084,9 +1080,9 @@ void ImageMap::Scale( const Fraction& rFracX, const Fraction& rFracY )
void ImageMap::ImpWriteImageMap( SvStream& rOStm, const String& rBaseURL ) const
{
IMapObject* pObj;
- USHORT nCount = (USHORT) maList.Count();
+ sal_uInt16 nCount = (sal_uInt16) maList.Count();
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
pObj = (IMapObject*) maList.GetObject( i );
pObj->Write( rOStm, rBaseURL );
@@ -1100,12 +1096,12 @@ void ImageMap::ImpWriteImageMap( SvStream& rOStm, const String& rBaseURL ) const
|*
\******************************************************************************/
-void ImageMap::ImpReadImageMap( SvStream& rIStm, USHORT nCount, const String& rBaseURL )
+void ImageMap::ImpReadImageMap( SvStream& rIStm, sal_uInt16 nCount, const String& rBaseURL )
{
// neue Objekte einlesen
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
- UINT16 nType;
+ sal_uInt16 nType;
rIStm >> nType;
rIStm.SeekRel( -2 );
@@ -1154,8 +1150,8 @@ void ImageMap::Write( SvStream& rOStm, const String& rBaseURL ) const
IMapCompat* pCompat;
String aImageName( GetName() );
String aDummy;
- USHORT nOldFormat = rOStm.GetNumberFormatInt();
- UINT16 nCount = (UINT16) GetIMapObjectCount();
+ sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt();
+ sal_uInt16 nCount = (sal_uInt16) GetIMapObjectCount();
const rtl_TextEncoding eEncoding = gsl_getSystemTextEncoding();
rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -1190,8 +1186,8 @@ void ImageMap::Read( SvStream& rIStm, const String& rBaseURL )
{
ByteString aString;
char cMagic[6];
- USHORT nOldFormat = rIStm.GetNumberFormatInt();
- UINT16 nCount;
+ sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
+ sal_uInt16 nCount;
rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
rIStm.Read( cMagic, sizeof( cMagic ) );
@@ -1226,9 +1222,4 @@ void ImageMap::Read( SvStream& rIStm, const String& rBaseURL )
}
-#ifdef WIN
-#pragma optimize ( "", on )
-#endif
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx
index d1cb4ddafd72..20e8ae6431b8 100644
--- a/svtools/source/misc/imap2.cxx
+++ b/svtools/source/misc/imap2.cxx
@@ -29,9 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#ifdef WIN
-#include <sysdep.hxx>
-#endif
#include <string.h>
#include <vcl/svapp.hxx>
#include <tools/urlobj.hxx>
@@ -46,9 +43,6 @@
#include <svtools/imapcirc.hxx>
#include <svtools/imappoly.hxx>
-#ifdef WIN
-#include <sysdep.hxx>
-#endif
#include <string.h>
#include <math.h>
@@ -216,9 +210,9 @@ void IMapCircleObject::WriteNCSA( SvStream& rOStm, const String& rBaseURL ) cons
void IMapPolygonObject::WriteCERN( SvStream& rOStm, const String& rBaseURL ) const
{
ByteString aStr( "polygon " );
- const USHORT nCount = aPoly.GetSize();
+ const sal_uInt16 nCount = aPoly.GetSize();
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
AppendCERNCoords( aPoly[ i ], aStr );
AppendCERNURL( aStr, rBaseURL );
@@ -236,11 +230,11 @@ void IMapPolygonObject::WriteCERN( SvStream& rOStm, const String& rBaseURL ) co
void IMapPolygonObject::WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const
{
ByteString aStr( "poly " );
- const USHORT nCount = Min( aPoly.GetSize(), (USHORT) 100 );
+ const sal_uInt16 nCount = Min( aPoly.GetSize(), (sal_uInt16) 100 );
AppendNCSAURL( aStr, rBaseURL );
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
AppendNCSACoords( aPoly[ i ], aStr );
rOStm.WriteLine( aStr );
@@ -257,7 +251,7 @@ void IMapPolygonObject::WriteNCSA( SvStream& rOStm, const String& rBaseURL ) co
|*
\******************************************************************************/
-void ImageMap::Write( SvStream& rOStm, ULONG nFormat, const String& rBaseURL ) const
+void ImageMap::Write( SvStream& rOStm, sal_uLong nFormat, const String& rBaseURL ) const
{
switch( nFormat )
{
@@ -280,9 +274,9 @@ void ImageMap::Write( SvStream& rOStm, ULONG nFormat, const String& rBaseURL ) c
void ImageMap::ImpWriteCERN( SvStream& rOStm, const String& rBaseURL ) const
{
IMapObject* pObj;
- USHORT nCount = (USHORT) maList.Count();
+ sal_uInt16 nCount = (sal_uInt16) maList.Count();
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
pObj = GetIMapObject( i );
@@ -316,9 +310,9 @@ void ImageMap::ImpWriteCERN( SvStream& rOStm, const String& rBaseURL ) const
void ImageMap::ImpWriteNCSA( SvStream& rOStm, const String& rBaseURL ) const
{
IMapObject* pObj;
- USHORT nCount = (USHORT) maList.Count();
+ sal_uInt16 nCount = (sal_uInt16) maList.Count();
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
pObj = GetIMapObject( i );
@@ -349,9 +343,9 @@ void ImageMap::ImpWriteNCSA( SvStream& rOStm, const String& rBaseURL ) const
|*
\******************************************************************************/
-ULONG ImageMap::Read( SvStream& rIStm, ULONG nFormat, const String& rBaseURL )
+sal_uLong ImageMap::Read( SvStream& rIStm, sal_uLong nFormat, const String& rBaseURL )
{
- ULONG nRet = IMAP_ERR_FORMAT;
+ sal_uLong nRet = IMAP_ERR_FORMAT;
if ( nFormat == IMAP_FORMAT_DETECT )
nFormat = ImpDetectFormat( rIStm );
@@ -379,7 +373,7 @@ ULONG ImageMap::Read( SvStream& rIStm, ULONG nFormat, const String& rBaseURL )
|*
\******************************************************************************/
-ULONG ImageMap::ImpReadCERN( SvStream& rIStm, const String& rBaseURL )
+sal_uLong ImageMap::ImpReadCERN( SvStream& rIStm, const String& rBaseURL )
{
ByteString aStr;
@@ -442,11 +436,11 @@ void ImageMap::ImpReadCERNLine( const ByteString& rLine, const String& rBaseURL
}
else if ( ( aToken == "polygon" ) || ( aToken == "poly" ) )
{
- const USHORT nCount = aStr.GetTokenCount( '(' ) - 1;
+ const sal_uInt16 nCount = aStr.GetTokenCount( '(' ) - 1;
Polygon aPoly( nCount );
String aURL;
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
aPoly[ i ] = ImpReadCERNCoords( &pStr );
aURL = ImpReadCERNURL( &pStr, rBaseURL );
@@ -557,7 +551,7 @@ String ImageMap::ImpReadCERNURL( const char** ppStr, const String& rBaseURL )
|*
\******************************************************************************/
-ULONG ImageMap::ImpReadNCSA( SvStream& rIStm, const String& rBaseURL )
+sal_uLong ImageMap::ImpReadNCSA( SvStream& rIStm, const String& rBaseURL )
{
ByteString aStr;
@@ -622,11 +616,11 @@ void ImageMap::ImpReadNCSALine( const ByteString& rLine, const String& rBaseURL
}
else if ( aToken == "poly" )
{
- const USHORT nCount = aStr.GetTokenCount( ',' ) - 1;
+ const sal_uInt16 nCount = aStr.GetTokenCount( ',' ) - 1;
const String aURL( ImpReadNCSAURL( &pStr, rBaseURL ) );
Polygon aPoly( nCount );
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
aPoly[ i ] = ImpReadNCSACoords( &pStr );
IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, String(), String(), String(), String() );
@@ -712,10 +706,10 @@ Point ImageMap::ImpReadNCSACoords( const char** ppStr )
|*
\******************************************************************************/
-ULONG ImageMap::ImpDetectFormat( SvStream& rIStm )
+sal_uLong ImageMap::ImpDetectFormat( SvStream& rIStm )
{
- ULONG nPos = rIStm.Tell();
- ULONG nRet = IMAP_FORMAT_BIN;
+ sal_uLong nPos = rIStm.Tell();
+ sal_uLong nRet = IMAP_FORMAT_BIN;
char cMagic[6];
rIStm.Read( cMagic, sizeof( cMagic ) );
diff --git a/svtools/source/misc/imap3.cxx b/svtools/source/misc/imap3.cxx
index 1072121a3c5d..21cce8e7672f 100644
--- a/svtools/source/misc/imap3.cxx
+++ b/svtools/source/misc/imap3.cxx
@@ -41,7 +41,7 @@
|*
\******************************************************************************/
-IMapCompat::IMapCompat( SvStream& rStm, const USHORT nStreamMode ) :
+IMapCompat::IMapCompat( SvStream& rStm, const sal_uInt16 nStreamMode ) :
pRWStm ( &rStm ),
nStmMode ( nStreamMode )
{
@@ -57,7 +57,7 @@ IMapCompat::IMapCompat( SvStream& rStm, const USHORT nStreamMode ) :
}
else
{
- UINT32 nTotalSizeTmp;
+ sal_uInt32 nTotalSizeTmp;
*pRWStm >> nTotalSizeTmp;
nTotalSize = nTotalSizeTmp;
nCompatPos = pRWStm->Tell();
@@ -78,15 +78,15 @@ IMapCompat::~IMapCompat()
{
if ( nStmMode == STREAM_WRITE )
{
- const ULONG nEndPos = pRWStm->Tell();
+ const sal_uLong nEndPos = pRWStm->Tell();
pRWStm->Seek( nCompatPos );
- *pRWStm << (UINT32) ( nEndPos - nTotalSize );
+ *pRWStm << (sal_uInt32) ( nEndPos - nTotalSize );
pRWStm->Seek( nEndPos );
}
else
{
- const ULONG nReadSize = pRWStm->Tell() - nCompatPos;
+ const sal_uLong nReadSize = pRWStm->Tell() - nCompatPos;
if ( nTotalSize > nReadSize )
pRWStm->SeekRel( nTotalSize - nReadSize );
diff --git a/svtools/source/misc/itemdel.cxx b/svtools/source/misc/itemdel.cxx
index 184b631cec65..0850947b9064 100644
--- a/svtools/source/misc/itemdel.cxx
+++ b/svtools/source/misc/itemdel.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "itemdel.hxx"
+#include <svtools/itemdel.hxx>
#include <vcl/svapp.hxx>
#include <tools/errcode.hxx>
#include <limits.h>
@@ -125,7 +125,7 @@ void DeleteOnIdleItems()
= ImpSvtData::GetSvtData().pItemDesruptList;
if ( rpList )
{
- USHORT n;
+ sal_uInt16 n;
while ( 0 != ( n = rpList->Count() ) )
// Remove ist implizit im Dtor
delete rpList->GetObject( n-1 );
diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index 1a139a2ff966..7d5bb5d49f35 100644..100755
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -49,7 +49,7 @@ using namespace ::com::sun::star;
SVT_DLLPUBLIC const String ApplyLreOrRleEmbedding( const String &rText )
{
- const USHORT nLen = rText.Len();
+ const sal_uInt16 nLen = rText.Len();
if (nLen == 0)
return String();
@@ -75,7 +75,7 @@ SVT_DLLPUBLIC const String ApplyLreOrRleEmbedding( const String &rText )
// Thus we can avoid to check every character of the text.
bool bFound = false;
bool bIsRtlText = false;
- for (USHORT i = 0; i < nLen && !bFound; ++i)
+ for (sal_uInt16 i = 0; i < nLen && !bFound; ++i)
{
sal_Int16 nDirection = rCharClass.getCharacterDirection( rText, i );
switch (nDirection)
diff --git a/svtools/source/misc/langtab.src b/svtools/source/misc/langtab.src
index e521fbdba570..67d650b61c8e 100644
--- a/svtools/source/misc/langtab.src
+++ b/svtools/source/misc/langtab.src
@@ -301,7 +301,7 @@ StringArray STR_ARR_SVT_LANGUAGE_TABLE
< "Shuswap" ; LANGUAGE_USER_SHUSWAP ; > ;
< "Oromo" ; LANGUAGE_OROMO ; > ;
< "Greek, Ancient" ; LANGUAGE_USER_ANCIENT_GREEK ; > ;
- < "Yiddish" ; LANGUAGE_YIDDISH ; > ;
+ < "Yiddish (Israel)" ; LANGUAGE_YIDDISH ; > ;
< "Quechua (Ecuador)" ; LANGUAGE_QUECHUA_ECUADOR ; > ;
< "Uyghur" ; LANGUAGE_UIGHUR_CHINA ; > ;
< "Asturian" ; LANGUAGE_USER_ASTURIAN ; > ;
@@ -324,6 +324,12 @@ StringArray STR_ARR_SVT_LANGUAGE_TABLE
< "Rusyn (Ukraine)" ; LANGUAGE_USER_RUSYN_UKRAINE ; > ;
< "Rusyn (Slovakia)" ; LANGUAGE_USER_RUSYN_SLOVAKIA ; > ;
< "Kabyle Latin" ; LANGUAGE_TAMAZIGHT_LATIN ; > ;
+ < "Yiddish (USA)" ; LANGUAGE_USER_YIDDISH_US ; > ;
+ < "Hawaiian" ; LANGUAGE_HAWAIIAN_UNITED_STATES ; > ;
+ < "Limbu" ; LANGUAGE_USER_LIMBU ; > ;
+ < "Lojban" ; LANGUAGE_USER_LOJBAN ; > ;
+ < "Kabyle" ; LANGUAGE_USER_KABYLE ; > ;
+ < "Haitian" ; LANGUAGE_USER_HAITIAN ; > ;
};
};
diff --git a/svtools/source/misc/makefile.mk b/svtools/source/misc/makefile.mk
deleted file mode 100755
index fe7680492cd0..000000000000
--- a/svtools/source/misc/makefile.mk
+++ /dev/null
@@ -1,88 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJNAME=svtools
-TARGET=misc
-
-ENABLE_EXCEPTIONS := TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-#use local "bmp" as it may not yet be delivered
-
-SRS1NAME=misc
-SRC1FILES=\
- ehdl.src \
- helpagent.src \
- imagemgr.src \
- langtab.src
-
-SRS2NAME=ehdl
-SRC2FILES=\
- errtxt.src
-
-SLOFILES=\
- $(SLO)$/acceleratorexecute.obj \
- $(SLO)$/chartprettypainter.obj \
- $(SLO)$/cliplistener.obj \
- $(SLO)$/dialogclosedlistener.obj\
- $(SLO)$/dialogcontrolling.obj \
- $(SLO)$/ehdl.obj \
- $(SLO)$/embedhlp.obj \
- $(SLO)$/embedtransfer.obj \
- $(SLO)$/filechangedchecker.obj \
- $(SLO)$/helpagentwindow.obj \
- $(SLO)$/imagemgr.obj \
- $(SLO)$/imageresourceaccess.obj \
- $(SLO)$/imap.obj \
- $(SLO)$/imap2.obj \
- $(SLO)$/imap3.obj \
- $(SLO)$/itemdel.obj \
- $(SLO)$/langtab.obj \
- $(SLO)$/langhelp.obj \
- $(SLO)$/stringtransfer.obj \
- $(SLO)$/svtaccessiblefactory.obj \
- $(SLO)$/svtdata.obj \
- $(SLO)$/templatefoldercache.obj \
- $(SLO)$/transfer.obj \
- $(SLO)$/transfer2.obj \
- $(SLO)$/unitconv.obj \
- $(SLO)$/bindablecontrolhelper.obj \
- $(SLO)$/filterutils.obj \
- $(SLO)$/wallitem.obj \
- $(SLO)$/xwindowitem.obj
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svtools/source/misc/svtdata.cxx b/svtools/source/misc/svtdata.cxx
index 9429ac014df9..23c98175f7a2 100644
--- a/svtools/source/misc/svtdata.cxx
+++ b/svtools/source/misc/svtdata.cxx
@@ -61,25 +61,6 @@ ResMgr * ImpSvtData::GetResMgr()
return GetResMgr(Application::GetSettings().GetUILocale());
}
-ResMgr * ImpSvtData::GetPatchResMgr(const ::com::sun::star::lang::Locale& aLocale)
-{
- if (!pPatchResMgr)
- {
- pPatchResMgr = ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(svp), aLocale);
- }
- return pPatchResMgr;
-}
-
-ResMgr * ImpSvtData::GetPatchResMgr()
-{
- return GetPatchResMgr(Application::GetSettings().GetUILocale());
-}
-
-SvpResId::SvpResId( USHORT nId ) :
- ResId( nId, *ImpSvtData::GetSvtData().GetPatchResMgr() )
-{
-}
-
//============================================================================
// static
ImpSvtData & ImpSvtData::GetSvtData()
@@ -90,4 +71,9 @@ ImpSvtData & ImpSvtData::GetSvtData()
return *static_cast<ImpSvtData *>(*pAppData);
}
+SvtResId::SvtResId(sal_uInt16 nId, const ::com::sun::star::lang::Locale aLocale):
+ ResId(nId, *ImpSvtData::GetSvtData().GetResMgr(aLocale)) {}
+
+SvtResId::SvtResId(sal_uInt16 nId): ResId(nId, *ImpSvtData::GetSvtData().GetResMgr()) {}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx
index 1543d2b5e076..20d82fe6e02b 100644
--- a/svtools/source/misc/templatefoldercache.cxx
+++ b/svtools/source/misc/templatefoldercache.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "templatefoldercache.hxx"
+#include <svtools/templatefoldercache.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <unotools/localfilehelper.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -117,8 +117,8 @@ namespace svt
//=====================================================================
struct TemplateContent;
typedef ::std::vector< ::rtl::Reference< TemplateContent > > TemplateFolderContent;
- typedef TemplateFolderContent::const_iterator ConstFolderIterator;
- typedef TemplateFolderContent::iterator FolderIterator;
+ typedef TemplateFolderContent::const_iterator ConstFolderIterator;
+ typedef TemplateFolderContent::iterator FolderIterator;
/** a struct describing one content in one of the template dirs (or at least it's relevant aspects)
*/
@@ -706,15 +706,18 @@ namespace svt
m_aCurrentState.swap( aTemplateFolderContent );
// the template directories from the config
- String aDirs = SvtPathOptions().GetTemplatePath();
+ const SvtPathOptions aPathOptions;
+ String aDirs = aPathOptions.GetTemplatePath();
sal_uInt16 nDirs = aDirs.GetTokenCount( ';' );
m_aCurrentState.reserve( nDirs );
// loop through all the root-level template folders
for ( sal_uInt16 i=0; i<nDirs; ++i)
{
+ String sTemplatePath( aDirs.GetToken( i, ';' ) );
+ sTemplatePath = aPathOptions.ExpandMacros( sTemplatePath );
// create a new entry
- m_aCurrentState.push_back( new TemplateContent( INetURLObject( aDirs.GetToken( i, ';' ) ) ) );
+ m_aCurrentState.push_back( new TemplateContent( INetURLObject( sTemplatePath ) ) );
TemplateFolderContent::iterator aCurrentRoot = m_aCurrentState.end();
--aCurrentRoot;
diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx
index 1ce02a305513..2adee87e49a3 100644
--- a/svtools/source/misc/transfer.cxx
+++ b/svtools/source/misc/transfer.cxx
@@ -432,7 +432,7 @@ Any SAL_CALL TransferableHelper::getTransferData( const DataFlavor& rFlavor ) th
SvMemoryStream aDstStm( 65535, 65535 );
// taking wmf without file header
- if ( ConvertGDIMetaFileToWMF( aMtf, aDstStm, NULL, FALSE ) )
+ if ( ConvertGDIMetaFileToWMF( aMtf, aDstStm, NULL, sal_False ) )
{
maAny <<= ( aSeq = Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( aDstStm.GetData() ),
aDstStm.Seek( STREAM_SEEK_TO_END ) ) );
@@ -936,7 +936,7 @@ sal_Bool TransferableHelper::SetINetBookmark( const INetBookmark& rBmk,
rFDesc1.dwFlags = FD_LINKUI;
ByteString aStr( rBmk.GetDescription(), eSysCSet );
- for( USHORT nChar = 0; nChar < aStr.Len(); ++nChar )
+ for( sal_uInt16 nChar = 0; nChar < aStr.Len(); ++nChar )
if( strchr( "\\/:*?\"<>|", aStr.GetChar( nChar ) ) )
aStr.Erase( nChar--, 1 );
@@ -1843,7 +1843,7 @@ sal_Bool TransferableDataHelper::GetGDIMetaFile( const DataFlavor& rFlavor, GDIM
if( GraphicConverter::Import( *xStm, aGraphic ) == ERRCODE_NONE )
{
rMtf = aGraphic.GetGDIMetaFile();
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -1857,7 +1857,7 @@ sal_Bool TransferableDataHelper::GetGDIMetaFile( const DataFlavor& rFlavor, GDIM
if( GraphicConverter::Import( *xStm, aGraphic ) == ERRCODE_NONE )
{
rMtf = aGraphic.GetGDIMetaFile();
- bRet = TRUE;
+ bRet = sal_True;
}
}
diff --git a/svtools/source/misc/transfer2.cxx b/svtools/source/misc/transfer2.cxx
index 3ef70f236b0d..5e4fa8e56077 100644
--- a/svtools/source/misc/transfer2.cxx
+++ b/svtools/source/misc/transfer2.cxx
@@ -41,9 +41,8 @@
#include <vcl/window.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/datatransfer/dnd/XDropTargetDragContext.hpp>
-
#include "svl/urlbmk.hxx"
-#include "inetimg.hxx"
+#include <svtools/inetimg.hxx>
#include <svtools/imap.hxx>
#include <svtools/transfer.hxx>
@@ -436,7 +435,7 @@ sal_Bool TransferDataContainer::GetData( const
TDataCntnrEntryList::iterator aIter( pImpl->aFmtList.begin() ),
aEnd( pImpl->aFmtList.end() );
sal_Bool bFnd = sal_False;
- ULONG nFmtId = SotExchange::GetFormat( rFlavor );
+ sal_uLong nFmtId = SotExchange::GetFormat( rFlavor );
// test first the list
for( ; aIter != aEnd; ++aIter )
@@ -502,8 +501,8 @@ void TransferDataContainer::CopyINetBookmark( const INetBookmark& rBkmk )
// -----------------------------------------------------------------------------
-void TransferDataContainer::CopyAnyData( ULONG nFormatId,
- const sal_Char* pData, ULONG nLen )
+void TransferDataContainer::CopyAnyData( sal_uLong nFormatId,
+ const sal_Char* pData, sal_uLong nLen )
{
if( nLen )
{
@@ -520,7 +519,7 @@ void TransferDataContainer::CopyAnyData( ULONG nFormatId,
// -----------------------------------------------------------------------------
-void TransferDataContainer::CopyByteString( ULONG nFormatId,
+void TransferDataContainer::CopyByteString( sal_uLong nFormatId,
const ByteString& rStr )
{
CopyAnyData( nFormatId, rStr.GetBuffer(), rStr.Len() );
@@ -570,7 +569,7 @@ void TransferDataContainer::CopyGraphic( const Graphic& rGrf )
// -----------------------------------------------------------------------------
-void TransferDataContainer::CopyString( USHORT nFmt, const String& rStr )
+void TransferDataContainer::CopyString( sal_uInt16 nFmt, const String& rStr )
{
if( rStr.Len() )
{
@@ -592,7 +591,7 @@ void TransferDataContainer::CopyString( const String& rStr )
// -----------------------------------------------------------------------------
-void TransferDataContainer::CopyAny( USHORT nFmt,
+void TransferDataContainer::CopyAny( sal_uInt16 nFmt,
const ::com::sun::star::uno::Any& rAny )
{
TDataCntnrEntry_Impl aEntry;
diff --git a/svtools/source/filter.vcl/filter/dlgejpg.hrc b/svtools/source/misc/undo.src
index fae40f4c3f6f..33c179a65032 100644
--- a/svtools/source/filter.vcl/filter/dlgejpg.hrc
+++ b/svtools/source/misc/undo.src
@@ -24,14 +24,20 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+
+ // include ------------------------------------------------------------------
+
#include <svtools/svtools.hrc>
-#define BTN_OK 1
-#define BTN_CANCEL 1
-#define BTN_HELP 1
-#define FI_DESCR 1
-#define NUM_FLD_QUALITY 1
-#define GRP_QUALITY 1
-#define GRP_COLORS 2
-#define RB_GRAY 1
-#define RB_RGB 2
+String STR_UNDO
+{
+ Text [ en-US ] = "Undo: " ;
+};
+String STR_REDO
+{
+ Text [ en-US ] = "Re~do: " ;
+};
+String STR_REPEAT
+{
+ Text [ en-US ] = "~Repeat: " ;
+}; \ No newline at end of file
diff --git a/svtools/source/misc/unitconv.cxx b/svtools/source/misc/unitconv.cxx
index 2f59261f327f..17adaeaecd81 100644
--- a/svtools/source/misc/unitconv.cxx
+++ b/svtools/source/misc/unitconv.cxx
@@ -35,7 +35,7 @@
// -----------------------------------------------------------------------
-void SetFieldUnit( MetricField& rField, FieldUnit eUnit, BOOL bAll )
+void SetFieldUnit( MetricField& rField, FieldUnit eUnit, sal_Bool bAll )
{
sal_Int64 nFirst = rField.Denormalize( rField.GetFirst( FUNIT_TWIP ) );
sal_Int64 nLast = rField.Denormalize( rField.GetLast( FUNIT_TWIP ) );
@@ -95,7 +95,7 @@ void SetFieldUnit( MetricField& rField, FieldUnit eUnit, BOOL bAll )
// -----------------------------------------------------------------------
-void SetFieldUnit( MetricBox& rBox, FieldUnit eUnit, BOOL bAll )
+void SetFieldUnit( MetricBox& rBox, FieldUnit eUnit, sal_Bool bAll )
{
sal_Int64 nMin = rBox.Denormalize( rBox.GetMin( FUNIT_TWIP ) );
sal_Int64 nMax = rBox.Denormalize( rBox.GetMax( FUNIT_TWIP ) );
@@ -351,7 +351,7 @@ long ConvertValueToUnit( long nVal, SfxMapUnit eUnit )
// -----------------------------------------------------------------------
-long CalcToPoint( long nIn, SfxMapUnit eUnit, USHORT nFaktor )
+long CalcToPoint( long nIn, SfxMapUnit eUnit, sal_uInt16 nFaktor )
{
DBG_ASSERT( eUnit == SFX_MAPUNIT_TWIP ||
eUnit == SFX_MAPUNIT_100TH_MM ||
@@ -723,8 +723,8 @@ long TransformMetric( long nVal, FieldUnit aOld, FieldUnit aNew )
return nVal;
}
- USHORT nOld = 0;
- USHORT nNew = 0;
+ sal_uInt16 nOld = 0;
+ sal_uInt16 nNew = 0;
switch ( aOld )
{
diff --git a/svtools/source/misc/wallitem.cxx b/svtools/source/misc/wallitem.cxx
index 147cd0a6b154..b9d0300a140c 100644
--- a/svtools/source/misc/wallitem.cxx
+++ b/svtools/source/misc/wallitem.cxx
@@ -49,7 +49,7 @@
#include <vcl/gradient.hxx>
#include <vcl/cvtgrf.hxx>
-#include "wallitem.hxx"
+#include <svtools/wallitem.hxx>
#include <svl/cntwall.hxx>
// -----------------------------------------------------------------------
diff --git a/svtools/source/misc/xwindowitem.cxx b/svtools/source/misc/xwindowitem.cxx
index d801d06317b8..eea3f65577aa 100644
--- a/svtools/source/misc/xwindowitem.cxx
+++ b/svtools/source/misc/xwindowitem.cxx
@@ -47,7 +47,7 @@ XWindowItem::XWindowItem() :
}
-XWindowItem::XWindowItem( USHORT nWhichId, Window * pWin ) :
+XWindowItem::XWindowItem( sal_uInt16 nWhichId, Window * pWin ) :
SfxPoolItem( nWhichId )
{
if (pWin)
@@ -59,7 +59,7 @@ XWindowItem::XWindowItem( USHORT nWhichId, Window * pWin ) :
}
-XWindowItem::XWindowItem( USHORT nWhichId, uno::Reference< awt::XWindow > & rxWin ) :
+XWindowItem::XWindowItem( sal_uInt16 nWhichId, uno::Reference< awt::XWindow > & rxWin ) :
SfxPoolItem( nWhichId ),
m_xWin( rxWin )
{
diff --git a/svtools/source/plugapp/commtest.cxx b/svtools/source/plugapp/commtest.cxx
deleted file mode 100644
index 6dc88e4d9645..000000000000
--- a/svtools/source/plugapp/commtest.cxx
+++ /dev/null
@@ -1,262 +0,0 @@
-/* -*- 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 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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-#include <vcl/svapp.hxx>
-#include <vcl/wrkwin.hxx>
-#include <vcl/toolbox.hxx>
-
-
-#include <tools/simplecm.hxx>
-#include "communi.hxx"
-#include "brooker.hxx"
-
-#include "commtest.hrc"
-
-
-
-#define TCP_PORT 17612
-
-#define CUniString( constAsciiStr ) UniString( RTL_CONSTASCII_USTRINGPARAM ( constAsciiStr ) )
-
-
-class PacketSender : public Timer
-{
- SvStream* mpData;
- CommunicationLinkRef mxCL;
-
-public:
- PacketSender( ULONG nDelay, SvStream* pData, CommunicationLink* pCL );
- virtual void Timeout();
-};
-
-PacketSender::PacketSender( ULONG nDelay, SvStream* pData, CommunicationLink* pCL )
-: mpData( pData )
-, mxCL( pCL )
-{
- SetTimeout( nDelay );
- Start();
-}
-
-void PacketSender::Timeout()
-{
- mxCL->TransferDataStream( mpData );
- delete mpData;
- delete this;
-}
-
-
-
-class DelayedDeleter : public Timer
-{
- CommunicationManager *mpManager;
-
-public:
- DelayedDeleter( ULONG nDelay, CommunicationManager *pManager );
- virtual void Timeout();
-};
-
-DelayedDeleter::DelayedDeleter( ULONG nDelay, CommunicationManager *pManager )
-: mpManager( pManager )
-{
- SetTimeout( nDelay );
- Start();
-}
-
-void DelayedDeleter::Timeout()
-{
- delete mpManager;
- delete this;
-}
-
-
-
-
-class CommunicationTester : public Application
-{
- DECL_LINK( TBClick, ToolBox* );
- DECL_LINK( DataReceived, CommunicationLink* );
- DECL_LINK( ConnectionOpened, CommunicationLink* );
- DECL_LINK( ConnectionClosed, CommunicationLink* );
-
-
- CommunicationManager *pClientTcp, *pServerTcp;
- InformationBroadcaster *pBCSTSend;
- InformationBroadcaster *pBCSTListen;
- InformationBrooker *pBCSTBrooker;
-public:
- CommunicationTester();
-
- virtual void Main();
-};
-
-CommunicationTester IchSelber;
-
-CommunicationTester::CommunicationTester()
-: pClientTcp( NULL )
-, pServerTcp( NULL )
-, pBCSTSend( NULL )
-, pBCSTListen( NULL )
-, pBCSTBrooker( NULL )
-{}
-
-void CommunicationTester::Main()
-{
- ResMgr *pRes = ResMgr::CreateResMgr( "commtest" );
- Resource::SetResManager( pRes );
- WorkWindow aWW( NULL, WB_APP | WB_STDWORK );
- aWW.Show();
- ToolBox aTB( &aWW, ResId( TBMenu ) );
- aTB.Show();
- aTB.RecalcItems();
- aTB.SetFloatingMode( TRUE );
- aTB.SetFloatingMode( FALSE );
- aTB.SetClickHdl( LINK( this, CommunicationTester, TBClick ) );
-
- Execute();
-}
-
-#define SWITCH( pManager, ManagerClass ) \
-{ \
- if ( pManager ) \
- { \
- pManager->StopCommunication(); \
- new DelayedDeleter( 1000, pManager ); \
- pTB->SetItemState( pTB->GetCurItemId(), STATE_NOCHECK ); \
- pManager = NULL; \
- } \
- else \
- { \
- pManager = new ManagerClass; \
- pManager->SetConnectionOpenedHdl( LINK( this, CommunicationTester, ConnectionOpened ) );\
- pManager->SetConnectionClosedHdl( LINK( this, CommunicationTester, ConnectionClosed ) );\
- pManager->SetDataReceivedHdl( LINK( this, CommunicationTester, DataReceived ) );\
- pTB->SetItemState( pTB->GetCurItemId(), STATE_CHECK ); \
- } \
-}
-
-
-IMPL_LINK( CommunicationTester, TBClick, ToolBox*, pTB )
-{
- switch ( pTB->GetCurItemId() )
- {
- case SERVER_TCP:
- {
- SWITCH( pServerTcp, CommunicationManagerServerViaSocket( TCP_PORT, (USHORT) 32000 ) );
- if ( pServerTcp )
- pServerTcp->StartCommunication(); // Am Port horchen
- }
- break;
- case CLIENT_TCP:
- {
- SWITCH( pClientTcp, CommunicationManagerClientViaSocket( "localhost", TCP_PORT ) );
- if ( pClientTcp )
- pClientTcp->StartCommunication(); // Eine Verbindung aufbauen
- }
- break;
- case BCST_BROOKER:
- {
- if ( pBCSTBrooker )
- {
- delete pBCSTBrooker;
- pBCSTBrooker = NULL;
- }
- else
- {
- pBCSTBrooker = new InformationBrooker();
- }
- }
- break;
- case BCST_LISTEN:
- {
- if ( pBCSTListen )
- {
- delete pBCSTListen;
- pBCSTListen = NULL;
- }
- else
- {
- pBCSTListen = new InformationBroadcaster();
- }
- }
- case BCST_SEND:
- {
- if ( pBCSTSend )
- {
- pBCSTSend->Broadcast( BCST_CAT_PL2X, "Message: BCST_CAT_PL2X" );
- pBCSTSend->Broadcast( BCST_CAT_MINORCOPY, "Message: BCST_CAT_MINORCOPY" );
- pBCSTSend->Broadcast( BCST_CAT_DELIVER, "Message: BCST_CAT_DELIVER" );
- pBCSTSend->Broadcast( BCST_CAT_ALL, "Message: BCST_CAT_ALL" );
- }
- else
- {
- pBCSTSend = new InformationBroadcaster();
- }
- }
- break;
- }
- return 0;
-}
-
-IMPL_LINK( CommunicationTester, ConnectionOpened, CommunicationLink*, pCL )
-{
- SvStream *pData = pCL->GetBestCommunicationStream();
- while ( pData->Tell() < 70 ) *pData << 123;
-
- pCL->TransferDataStream( pData );
- return 0;
-}
-
-IMPL_LINK( CommunicationTester, ConnectionClosed, CommunicationLink*, pCL )
-{
- return 0;
-}
-
-IMPL_LINK( CommunicationTester, DataReceived, CommunicationLink*, pCL )
-{
- // Find Manager
- CommunicationManager* pManager;
- if ( pClientTcp && pClientTcp->IsLinkValid( pCL ) )
- {
- pManager = pClientTcp;
- }
- if ( pServerTcp && pServerTcp->IsLinkValid( pCL ) )
- {
- DBG_ASSERT( !pManager, "CommunicationLink bei mehreren Managern eingetragen");
- pManager = pServerTcp;
- }
- DBG_ASSERT( pCL->GetCommunicationManager() == pManager, "Manager des Link != Manager bei dem der Link Valid ist");
-
- // Send Data Back (Echo)
- new PacketSender( 1000, pCL->GetServiceData(), pCL );
-
- return 0;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/plugapp/commtest.hrc b/svtools/source/plugapp/commtest.hrc
deleted file mode 100644
index f0f646b49bfc..000000000000
--- a/svtools/source/plugapp/commtest.hrc
+++ /dev/null
@@ -1,34 +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 TBMenu 256
-
-
-#define SERVER_TCP 1
-#define CLIENT_TCP 2
-#define BCST_BROOKER 3
-#define BCST_LISTEN 4
-#define BCST_SEND 5
diff --git a/svtools/source/plugapp/commtest.src b/svtools/source/plugapp/commtest.src
deleted file mode 100644
index d1efb29a1730..000000000000
--- a/svtools/source/plugapp/commtest.src
+++ /dev/null
@@ -1,59 +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.
- *
- ************************************************************************/
-#include "commtest.hrc"
-
-ToolBox TBMenu {
- Border = TRUE;
- SVLook = TRUE;
- Dockable = TRUE;
- Pos = MAP_APPFONT( 0, 0 );
- Size = MAP_APPFONT( 100, 20 );
- LineCount = 2;
- ItemList = {
- ToolBoxItem {
- Identifier = SERVER_TCP;
- Text = "Server TCP";
- };
- ToolBoxItem {
- Identifier = CLIENT_TCP;
- Text = "Client TCP";
- };
- ToolBoxItem {
- Identifier = BCST_BROOKER;
- Text = "BroadcastBrooker";
- };
- ToolBoxItem {
- Identifier = BCST_SEND;
- Text = "BroadcastClientSend";
- };
- ToolBoxItem {
- Identifier = BCST_LISTEN;
- Text = "BroadcastClientListen";
- };
- };
- Scroll = TRUE;
-};
diff --git a/svtools/source/plugapp/makefile.mk b/svtools/source/plugapp/makefile.mk
deleted file mode 100644
index 094da3a0cd83..000000000000
--- a/svtools/source/plugapp/makefile.mk
+++ /dev/null
@@ -1,64 +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.
-#
-#*************************************************************************
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=plugapp
-LIBTARGET=NO
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(EXCEPTIONSFILES)
-
-EXCEPTIONSFILES = \
- $(SLO)$/ttprops.obj
-
-
-SRS2NAME=$(TARGET)
-SRC2FILES= testtool.src
-
-
-LIB1TARGET= $(SLB)$/plugapp.lib
-LIB1OBJFILES= $(SLOFILES)
-
-######## Testapplikation #########
-
-SRC1FILES= commtest.src
-SRS1NAME= commtest
-
-######## Ende Testapplikation #########
-
-# --- Tagets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svtools/source/plugapp/testtool.src b/svtools/source/plugapp/testtool.src
index 55112329dcf5..27f89221e0ba 100644
--- a/svtools/source/plugapp/testtool.src
+++ b/svtools/source/plugapp/testtool.src
@@ -97,6 +97,7 @@ Bitmap TT_SHOW2 {
};
WorkWindow TT_INLINE_TRANSLATION {
+ HelpID = "svtools:WorkWindow:TT_INLINE_TRANSLATION";
SVLook = TRUE;
Size = MAP_APPFONT( 2*Control_Border + 4*ButtonWidth + 3*Button_Button, 120 );
Moveable = TRUE;
@@ -109,6 +110,7 @@ WorkWindow TT_INLINE_TRANSLATION {
Text[ en-US ] = "Translation";
};
Edit TT_E_NEW {
+ HelpID = "svtools:Edit:TT_INLINE_TRANSLATION:TT_E_NEW";
Disable = TRUE;
Border = TRUE;
Pos = MAP_APPFONT( 7, 16 );
@@ -127,6 +129,7 @@ WorkWindow TT_INLINE_TRANSLATION {
Text[ en-US ] = "Comment";
};
Edit TT_E_COMMENT {
+ HelpID = "svtools:Edit:TT_INLINE_TRANSLATION:TT_E_COMMENT";
Disable = TRUE;
Border = TRUE;
Pos = MAP_APPFONT( 7, 64 );
@@ -135,12 +138,14 @@ WorkWindow TT_INLINE_TRANSLATION {
Text[ en-US ] = "~Comment";
};
PushButton TT_PB_SELECT {
+ HelpID = "svtools:PushButton:TT_INLINE_TRANSLATION:TT_PB_SELECT";
Pos = MAP_APPFONT( Control_Border, 89 );
Size = MAP_APPFONT( ButtonWidth, 12 );
TabStop = TRUE;
Text[ en-US ] = "~Select";
};
PushButton TT_PB_RESTORE {
+ HelpID = "svtools:PushButton:TT_INLINE_TRANSLATION:TT_PB_RESTORE";
Disable = TRUE;
Pos = MAP_APPFONT( Control_Border + ButtonWidth + Button_Button, 89 );
Size = MAP_APPFONT( ButtonWidth, 12 );
@@ -148,6 +153,7 @@ WorkWindow TT_INLINE_TRANSLATION {
Text[ en-US ] = "~Restore";
};
PushButton TT_PB_ACCEPT {
+ HelpID = "svtools:PushButton:TT_INLINE_TRANSLATION:TT_PB_ACCEPT";
Disable = TRUE;
Pos = MAP_APPFONT( Control_Border + 2*(ButtonWidth + Button_Button), 89 );
Size = MAP_APPFONT( ButtonWidth, 12 );
@@ -155,6 +161,7 @@ WorkWindow TT_INLINE_TRANSLATION {
Text[ en-US ] = "~Accept";
};
PushButton TT_PB_NEXT {
+ HelpID = "svtools:PushButton:TT_INLINE_TRANSLATION:TT_PB_NEXT";
Pos = MAP_APPFONT( Control_Border + 3*(ButtonWidth + Button_Button), 89 );
Size = MAP_APPFONT( ButtonWidth, 12 );
TabStop = TRUE;
diff --git a/svtools/source/plugapp/ttprops.cxx b/svtools/source/plugapp/ttprops.cxx
index fb556cfcebc1..3c6be8fac141 100644
--- a/svtools/source/plugapp/ttprops.cxx
+++ b/svtools/source/plugapp/ttprops.cxx
@@ -35,7 +35,7 @@
TYPEINIT1( TTProperties, ApplicationProperty )
-BOOL TTProperties::RequestProperty( USHORT nRequest )
+sal_Bool TTProperties::RequestProperty( sal_uInt16 nRequest )
{
if ( (( nRequest & TT_PR_ONCE ) == 0) || (nDonePRs & (nRequest & 0x0ff)) == 0 )
{
@@ -44,17 +44,17 @@ BOOL TTProperties::RequestProperty( USHORT nRequest )
GetpApp()->Property( *this );
return nActualPR == 0;
}
- return TRUE;
+ return sal_True;
}
-BOOL TTProperties::GetSlots()
+sal_Bool TTProperties::GetSlots()
{
RequestProperty( TT_PR_SLOTS );
return HasSlots();
}
-USHORT TTProperties::ExecuteFunction( USHORT nSID, SfxPoolItem** ppArgs, USHORT nMode )
+sal_uInt16 TTProperties::ExecuteFunction( sal_uInt16 nSID, SfxPoolItem** ppArgs, sal_uInt16 nMode )
{
mnSID = nSID;
mppArgs = ppArgs;
@@ -64,16 +64,16 @@ USHORT TTProperties::ExecuteFunction( USHORT nSID, SfxPoolItem** ppArgs, USHORT
return nActualPR;
}
-BOOL TTProperties::Img( Bitmap *pBmp )
+sal_Bool TTProperties::Img( Bitmap *pBmp )
{
- BOOL bRet;
+ sal_Bool bRet;
mpBmp = pBmp;
bRet = RequestProperty( TT_PR_IMG );
mpBmp = NULL;
return bRet;
}
-SvtResId TTProperties::GetSvtResId( USHORT nId )
+SvtResId TTProperties::GetSvtResId( sal_uInt16 nId )
{
return SvtResId( nId );
}
diff --git a/svtools/source/productregistration/makefile.mk b/svtools/source/productregistration/makefile.mk
deleted file mode 100644
index a26e8feca753..000000000000
--- a/svtools/source/productregistration/makefile.mk
+++ /dev/null
@@ -1,78 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJNAME=svtools
-TARGET=productregistration.uno
-LIBTARGET=NO
-ENABLE_EXCEPTIONS=TRUE
-GEN_HID=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-DLLPRE=
-
-# --- Files -------------------------------------
-
-SLOFILES= \
- $(SLO)$/productregistration.obj \
- $(SLO)$/registrationdlg.obj
-
-SHL1TARGET= $(TARGET)
-SHL1IMPLIB= i$(TARGET)
-
-SHL1OBJS= \
- $(SLOFILES)
-
-SHL1STDLIBS=\
- $(TKLIB) \
- $(VCLLIB) \
- $(SVLLIB) \
- $(UNOTOOLSLIB) \
- $(TOOLSLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-DEF1NAME= $(SHL1TARGET)
-
-SRS1NAME= productregistration
-SRC1FILES= \
- registrationdlg.src
-
-RESLIB1NAME=productregistration
-RESLIB1IMAGES=$(PRJ)$/res
-RESLIB1SRSFILES=\
- $(SRS)$/productregistration.srs
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svtools/source/productregistration/productregistration.cxx b/svtools/source/productregistration/productregistration.cxx
index 683d06e54985..720cf15a41f3 100644
--- a/svtools/source/productregistration/productregistration.cxx
+++ b/svtools/source/productregistration/productregistration.cxx
@@ -459,25 +459,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
- void * /* pServiceManager */, void * pRegistryKey)
-{
- if (pRegistryKey)
- {
- Reference< XRegistryKey > xRegistryKey (
- reinterpret_cast< XRegistryKey* >( pRegistryKey ));
- Reference< XRegistryKey > xNewKey;
-
- xNewKey = xRegistryKey->createKey(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "/" PRODREG_IMPLNAME "/UNO/SERVICES" )));
- xNewKey->createKey(
- OUString(RTL_CONSTASCII_USTRINGPARAM( PRODREG_SERVNAME )));
-
- return sal_True;
- }
- return sal_False;
-}
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */)
{
diff --git a/svtools/source/productregistration/productregistration.uno.component b/svtools/source/productregistration/productregistration.uno.component
new file mode 100644
index 000000000000..da2cfd37c483
--- /dev/null
+++ b/svtools/source/productregistration/productregistration.uno.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.setup.ProductRegistration">
+ <service name="com.sun.star.setup.ProductRegistration"/>
+ </implementation>
+</component>
diff --git a/svtools/source/productregistration/registrationdlg.cxx b/svtools/source/productregistration/registrationdlg.cxx
index 07dcb095535a..f2bc90416313 100644
--- a/svtools/source/productregistration/registrationdlg.cxx
+++ b/svtools/source/productregistration/registrationdlg.cxx
@@ -109,7 +109,7 @@ namespace svt
FreeResource();
- m_aNow.Check( TRUE );
+ m_aNow.Check( sal_True );
}
//--------------------------------------------------------------------
diff --git a/svtools/source/productregistration/registrationdlg.src b/svtools/source/productregistration/registrationdlg.src
index 4021e395b069..01127b44227c 100644
--- a/svtools/source/productregistration/registrationdlg.src
+++ b/svtools/source/productregistration/registrationdlg.src
@@ -66,6 +66,7 @@ ModalDialog DLG_REGISTRATION_REQUEST
RadioButton RB_NOW
{
+ HelpID = "svtools:RadioButton:DLG_REGISTRATION_REQUEST:RB_NOW";
Pos = MAP_APPFONT ( 33 , 41 ) ;
Size = MAP_APPFONT ( 153 , 10 ) ;
Text [ en-US ] = "Register now" ;
@@ -73,18 +74,21 @@ ModalDialog DLG_REGISTRATION_REQUEST
RadioButton RB_LATER
{
+ HelpID = "svtools:RadioButton:DLG_REGISTRATION_REQUEST:RB_LATER";
Pos = MAP_APPFONT ( 33 , 54 ) ;
Size = MAP_APPFONT ( 153 , 10 ) ;
Text [ en-US ] = "Remind me to register later" ;
};
RadioButton RB_NEVER
{
+ HelpID = "svtools:RadioButton:DLG_REGISTRATION_REQUEST:RB_NEVER";
Pos = MAP_APPFONT ( 33 , 67 ) ;
Size = MAP_APPFONT ( 153 , 10 ) ;
Text [ en-US ] = "Never register" ;
};
RadioButton RB_DONE
{
+ HelpID = "svtools:RadioButton:DLG_REGISTRATION_REQUEST:RB_DONE";
Pos = MAP_APPFONT ( 33 , 80 ) ;
Size = MAP_APPFONT ( 153 , 20 ) ;
WordBreak = TRUE;
diff --git a/svtools/source/svhtml/htmlkywd.cxx b/svtools/source/svhtml/htmlkywd.cxx
index e1631efc84b9..412140f9a3f5 100644
--- a/svtools/source/svhtml/htmlkywd.cxx
+++ b/svtools/source/svhtml/htmlkywd.cxx
@@ -35,8 +35,8 @@
#include <limits.h>
#include <svtools/svparser.hxx>
-#include "htmlkywd.hxx"
-#include "htmltokn.h"
+#include <svtools/htmlkywd.hxx>
+#include <svtools/htmltokn.h>
// die Tabelle muss noch sortiert werden
struct HTML_TokenEntry
@@ -50,7 +50,7 @@ struct HTML_TokenEntry
};
// Flag: RTF-Token Tabelle wurde schon sortiert
-static int bSortKeyWords = FALSE;
+static int bSortKeyWords = sal_False;
static HTML_TokenEntry aHTMLTokenTab[] = {
{{OOO_STRING_SVTOOLS_HTML_area}, HTML_AREA}, // Netscape 2.0
@@ -245,7 +245,7 @@ int GetHTMLToken( const String& rName )
sizeof( aHTMLTokenTab ) / sizeof( HTML_TokenEntry ),
sizeof( HTML_TokenEntry ),
HTMLKeyCompare );
- bSortKeyWords = TRUE;
+ bSortKeyWords = sal_True;
}
int nRet = 0;
@@ -280,7 +280,7 @@ struct HTML_CharEntry
};
// Flag: RTF-Token Tabelle wurde schon sortiert
-static int bSortCharKeyWords = FALSE;
+static int bSortCharKeyWords = sal_False;
static HTML_CharEntry aHTMLCharNameTab[] = {
{{OOO_STRING_SVTOOLS_HTML_C_lt}, 60},
@@ -600,7 +600,7 @@ sal_Unicode GetHTMLCharName( const String& rName )
sizeof( aHTMLCharNameTab ) / sizeof( HTML_CharEntry ),
sizeof( HTML_CharEntry ),
HTMLCharNameCompare );
- bSortCharKeyWords = TRUE;
+ bSortCharKeyWords = sal_True;
}
sal_Unicode cRet = 0;
@@ -621,7 +621,7 @@ sal_Unicode GetHTMLCharName( const String& rName )
/* */
// Flag: Optionen-Tabelle wurde schon sortiert
-static int bSortOptionKeyWords = FALSE;
+static int bSortOptionKeyWords = sal_False;
static HTML_TokenEntry aHTMLOptionTab[] = {
@@ -833,7 +833,7 @@ int GetHTMLOption( const String& rName )
sizeof( aHTMLOptionTab ) / sizeof( HTML_TokenEntry ),
sizeof( HTML_TokenEntry ),
HTMLKeyCompare );
- bSortOptionKeyWords = TRUE;
+ bSortOptionKeyWords = sal_True;
}
int nRet = HTML_O_UNKNOWN;
@@ -861,10 +861,10 @@ struct HTML_ColorEntry
const sal_Char* sName;
const String *pUName;
};
- ULONG nColor;
+ sal_uLong nColor;
};
-static int bSortColorKeyWords = FALSE;
+static int bSortColorKeyWords = sal_False;
#define HTML_NO_COLOR 0xffffffffUL
@@ -1053,7 +1053,7 @@ static int
}
-ULONG GetHTMLColor( const String& rName )
+sal_uLong GetHTMLColor( const String& rName )
{
if( !bSortColorKeyWords )
{
@@ -1061,10 +1061,10 @@ ULONG GetHTMLColor( const String& rName )
sizeof( aHTMLColorNameTab ) / sizeof( HTML_ColorEntry ),
sizeof( HTML_ColorEntry ),
HTMLColorNameCompare );
- bSortColorKeyWords = TRUE;
+ bSortColorKeyWords = sal_True;
}
- ULONG nRet = ULONG_MAX;
+ sal_uLong nRet = ULONG_MAX;
void* pFound;
HTML_ColorEntry aSrch;
aSrch.pUName = &rName;
diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx
index 29a142e88151..31e60e1ab1a1 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -37,7 +37,7 @@
#include <svl/zforlist.hxx>
#include <svtools/htmlout.hxx>
-#include "htmlkywd.hxx"
+#include <svtools/htmlkywd.hxx>
#include <svtools/imap.hxx>
#include <svtools/imaprect.hxx>
#include <svtools/imapcirc.hxx>
@@ -529,7 +529,7 @@ void HTMLOutFuncs::ConvertStringToHTML( const String& rSrc,
}
SvStream& HTMLOutFuncs::Out_AsciiTag( SvStream& rStream, const sal_Char *pStr,
- BOOL bOn, rtl_TextEncoding )
+ sal_Bool bOn, rtl_TextEncoding )
{
sal_Char sStt[3] = "</";
if( bOn )
@@ -570,7 +570,7 @@ SvStream& HTMLOutFuncs::FlushToAscii( SvStream& rStream,
return rStream;
}
-SvStream& HTMLOutFuncs::Out_Hex( SvStream& rStream, ULONG nHex, BYTE nLen,
+SvStream& HTMLOutFuncs::Out_Hex( SvStream& rStream, sal_uLong nHex, sal_uInt8 nLen,
rtl_TextEncoding )
{ // in einen Stream aus
sal_Char aNToABuf[] = "0000000000000000";
@@ -581,7 +581,7 @@ SvStream& HTMLOutFuncs::Out_Hex( SvStream& rStream, ULONG nHex, BYTE nLen,
// Pointer an das Bufferende setzen
sal_Char *pStr = aNToABuf + (sizeof(aNToABuf)-1);
- for( BYTE n = 0; n < nLen; ++n )
+ for( sal_uInt8 n = 0; n < nLen; ++n )
{
*(--pStr) = (sal_Char)(nHex & 0xf ) + 48;
if( *pStr > '9' )
@@ -616,7 +616,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
const ImageMap& rIMap,
const String& rName,
const HTMLOutEvent *pEventTable,
- BOOL bOutStarBasic,
+ sal_Bool bOutStarBasic,
const sal_Char *pDelim,
const sal_Char *pIndentArea,
const sal_Char *pIndentMap,
@@ -641,7 +641,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
Out_String( rStream, rOutName, eDestEnc, pNonConvertableChars );
rStream << "\">";
- for( USHORT i=0U; i<rIMap.GetIMapObjectCount(); i++ )
+ for( sal_uInt16 i=0U; i<rIMap.GetIMapObjectCount(); i++ )
{
const IMapObject* pObj = rIMap.GetIMapObject( i );
DBG_ASSERT( pObj, "Wo ist das ImageMap-Object?" );
@@ -684,7 +684,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
(const IMapPolygonObject *)pObj;
pShape= OOO_STRING_SVTOOLS_HTML_SH_poly;
Polygon aPoly( pPolyObj->GetPolygon() );
- USHORT nCount = aPoly.GetSize();
+ sal_uInt16 nCount = aPoly.GetSize();
if( nCount>0 )
{
const Point& rPoint = aPoly[0];
@@ -692,7 +692,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
ByteString::CreateFromInt32(rPoint.X())) += ',')
+= ByteString::CreateFromInt32(rPoint.Y());
}
- for( USHORT j=1; j<nCount; j++ )
+ for( sal_uInt16 j=1; j<nCount; j++ )
{
const Point& rPoint = aPoly[j];
(((aCoords += ',')
@@ -772,7 +772,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
rStream << pDelim;
if( pIndentMap )
rStream << pIndentMap;
- Out_AsciiTag( rStream, OOO_STRING_SVTOOLS_HTML_map, FALSE );
+ Out_AsciiTag( rStream, OOO_STRING_SVTOOLS_HTML_map, sal_False );
return rStream;
}
@@ -886,7 +886,7 @@ SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm,
}
}
- HTMLOutFuncs::Out_AsciiTag( rStrm, OOO_STRING_SVTOOLS_HTML_script, FALSE );
+ HTMLOutFuncs::Out_AsciiTag( rStrm, OOO_STRING_SVTOOLS_HTML_script, sal_False );
return rStrm;
}
@@ -895,11 +895,11 @@ SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm,
SvStream& HTMLOutFuncs::Out_Events( SvStream& rStrm,
const SvxMacroTableDtor& rMacroTable,
const HTMLOutEvent *pEventTable,
- BOOL bOutStarBasic,
+ sal_Bool bOutStarBasic,
rtl_TextEncoding eDestEnc,
String *pNonConvertableChars )
{
- USHORT i=0;
+ sal_uInt16 i=0;
while( pEventTable[i].pBasicName || pEventTable[i].pJavaName )
{
const SvxMacro *pMacro =
@@ -928,8 +928,8 @@ SvStream& HTMLOutFuncs::Out_Events( SvStream& rStrm,
}
ByteString& HTMLOutFuncs::CreateTableDataOptionsValNum( ByteString& aStrTD,
- BOOL bValue,
- double fVal, ULONG nFormat, SvNumberFormatter& rFormatter,
+ sal_Bool bValue,
+ double fVal, sal_uLong nFormat, SvNumberFormatter& rFormatter,
rtl_TextEncoding eDestEnc, String* pNonConvertableChars )
{
if ( bValue )
@@ -966,16 +966,16 @@ ByteString& HTMLOutFuncs::CreateTableDataOptionsValNum( ByteString& aStrTD,
return aStrTD;
}
-BOOL HTMLOutFuncs::PrivateURLToInternalImg( String& rURL )
+sal_Bool HTMLOutFuncs::PrivateURLToInternalImg( String& rURL )
{
if( rURL.Len() > 14UL &&
rURL.CompareToAscii( OOO_STRING_SVTOOLS_HTML_private_image, 14UL ) == COMPARE_EQUAL )
{
rURL.Erase( 0UL, 14UL );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
diff --git a/svtools/source/svhtml/htmlsupp.cxx b/svtools/source/svhtml/htmlsupp.cxx
index cfb0fca37e11..76f49e7d0558 100644
--- a/svtools/source/svhtml/htmlsupp.cxx
+++ b/svtools/source/svhtml/htmlsupp.cxx
@@ -38,8 +38,8 @@
#endif
#include <svtools/parhtml.hxx>
-#include "htmltokn.h"
-#include "htmlkywd.hxx"
+#include <svtools/htmltokn.h>
+#include <svtools/htmlkywd.hxx>
/* */
@@ -57,7 +57,7 @@ static HTMLOptionEnum const aScriptLangOptEnums[] =
{ 0, 0 }
};
-BOOL HTMLParser::ParseScriptOptions( String& rLangString, const String& rBaseURL,
+sal_Bool HTMLParser::ParseScriptOptions( String& rLangString, const String& rBaseURL,
HTMLScriptLanguage& rLang,
String& rSrc,
String& rLibrary,
@@ -71,7 +71,7 @@ BOOL HTMLParser::ParseScriptOptions( String& rLangString, const String& rBaseURL
rLibrary.Erase();
rModule.Erase();
- for( USHORT i = pScriptOptions->Count(); i; )
+ for( sal_uInt16 i = pScriptOptions->Count(); i; )
{
const HTMLOption *pOption = (*pScriptOptions)[ --i ];
switch( pOption->GetToken() )
@@ -79,7 +79,7 @@ BOOL HTMLParser::ParseScriptOptions( String& rLangString, const String& rBaseURL
case HTML_O_LANGUAGE:
{
rLangString = pOption->GetString();
- USHORT nLang;
+ sal_uInt16 nLang;
if( pOption->GetEnum( nLang, aScriptLangOptEnums ) )
rLang = (HTMLScriptLanguage)nLang;
else
@@ -100,10 +100,10 @@ BOOL HTMLParser::ParseScriptOptions( String& rLangString, const String& rBaseURL
}
}
- return TRUE;
+ return sal_True;
}
-void HTMLParser::RemoveSGMLComment( String &rString, BOOL bFull )
+void HTMLParser::RemoveSGMLComment( String &rString, sal_Bool bFull )
{
sal_Unicode c = 0;
while( rString.Len() &&
diff --git a/svtools/source/svhtml/makefile.mk b/svtools/source/svhtml/makefile.mk
deleted file mode 100644
index 7a8552f2b672..000000000000
--- a/svtools/source/svhtml/makefile.mk
+++ /dev/null
@@ -1,51 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=svhtml
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES=\
- $(SLO)$/htmlkywd.obj \
- $(SLO)$/htmlsupp.obj \
- $(SLO)$/htmlout.obj \
- $(SLO)$/parhtml.obj
-
-# ==========================================================================
-
-.INCLUDE : target.mk
-
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index dc3f593c6729..dbaae52db17e 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -49,8 +49,8 @@
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <svtools/parhtml.hxx>
-#include "htmltokn.h"
-#include "htmlkywd.hxx"
+#include <svtools/htmltokn.h>
+#include <svtools/htmlkywd.hxx>
using namespace ::com::sun::star;
@@ -115,9 +115,9 @@ SV_IMPL_PTRARR(HTMLOptions,HTMLOptionPtr)
/* */
-USHORT HTMLOption::GetEnum( const HTMLOptionEnum *pOptEnums, USHORT nDflt ) const
+sal_uInt16 HTMLOption::GetEnum( const HTMLOptionEnum *pOptEnums, sal_uInt16 nDflt ) const
{
- USHORT nValue = nDflt;
+ sal_uInt16 nValue = nDflt;
while( pOptEnums->pName )
if( aValue.EqualsIgnoreCaseAscii( pOptEnums->pName ) )
@@ -131,7 +131,7 @@ USHORT HTMLOption::GetEnum( const HTMLOptionEnum *pOptEnums, USHORT nDflt ) cons
return nValue;
}
-BOOL HTMLOption::GetEnum( USHORT &rEnum, const HTMLOptionEnum *pOptEnums ) const
+sal_Bool HTMLOption::GetEnum( sal_uInt16 &rEnum, const HTMLOptionEnum *pOptEnums ) const
{
while( pOptEnums->pName )
{
@@ -148,7 +148,7 @@ BOOL HTMLOption::GetEnum( USHORT &rEnum, const HTMLOptionEnum *pOptEnums ) const
return (pName != 0);
}
-HTMLOption::HTMLOption( USHORT nTok, const String& rToken,
+HTMLOption::HTMLOption( sal_uInt16 nTok, const String& rToken,
const String& rValue )
: aValue(rValue)
, aToken(rToken)
@@ -172,7 +172,7 @@ sal_uInt32 HTMLOption::GetNumber() const
return nTmp >= 0 ? (sal_uInt32)nTmp : 0;
}
-INT32 HTMLOption::GetSNumber() const
+sal_Int32 HTMLOption::GetSNumber() const
{
DBG_ASSERT( (nToken>=HTML_OPTION_NUMBER_START && nToken<HTML_OPTION_NUMBER_END) ||
(nToken>=HTML_OPTION_CONTEXT_START && nToken<HTML_OPTION_CONTEXT_END),
@@ -191,8 +191,8 @@ void HTMLOption::GetNumbers( SvULongs &rLongs, sal_Bool bSpaceDelim ) const
{
// das ist ein sehr stark vereinfachter Scanner. Er sucht einfach
// alle Tiffern aus dem String
- BOOL bInNum = FALSE;
- ULONG nNum = 0;
+ sal_Bool bInNum = sal_False;
+ sal_uLong nNum = 0;
for( xub_StrLen i=0; i<aValue.Len(); i++ )
{
register sal_Unicode c = aValue.GetChar( i );
@@ -200,12 +200,12 @@ void HTMLOption::GetNumbers( SvULongs &rLongs, sal_Bool bSpaceDelim ) const
{
nNum *= 10;
nNum += (c - '0');
- bInNum = TRUE;
+ bInNum = sal_True;
}
else if( bInNum )
{
rLongs.Insert( nNum, rLongs.Count() );
- bInNum = FALSE;
+ bInNum = sal_False;
nNum = 0;
}
}
@@ -228,7 +228,7 @@ void HTMLOption::GetNumbers( SvULongs &rLongs, sal_Bool bSpaceDelim ) const
nPos++;
if( nPos==aValue.Len() )
- rLongs.Insert( ULONG(0), rLongs.Count() );
+ rLongs.Insert( sal_uLong(0), rLongs.Count() );
else
{
xub_StrLen nEnd = aValue.Search( (sal_Unicode)',', nPos );
@@ -259,7 +259,7 @@ void HTMLOption::GetColor( Color& rColor ) const
String aTmp( aValue );
aTmp.ToUpperAscii();
- ULONG nColor = ULONG_MAX;
+ sal_uLong nColor = ULONG_MAX;
if( '#'!=aTmp.GetChar( 0 ) )
nColor = GetHTMLColor( aTmp );
@@ -289,9 +289,9 @@ void HTMLOption::GetColor( Color& rColor ) const
}
}
- rColor.SetRed( (BYTE)((nColor & 0x00ff0000) >> 16) );
- rColor.SetGreen( (BYTE)((nColor & 0x0000ff00) >> 8));
- rColor.SetBlue( (BYTE)(nColor & 0x000000ff) );
+ rColor.SetRed( (sal_uInt8)((nColor & 0x00ff0000) >> 16) );
+ rColor.SetGreen( (sal_uInt8)((nColor & 0x0000ff00) >> 8));
+ rColor.SetBlue( (sal_uInt8)(nColor & 0x000000ff) );
}
HTMLInputType HTMLOption::GetInputType() const
@@ -321,8 +321,8 @@ HTMLParser::HTMLParser( SvStream& rIn, int bReadNewDoc )
bReadListing = bReadXMP = bReadPRE = bReadTextArea =
bReadScript = bReadStyle =
bEndTokenFound = bIsInBody = bReadNextChar =
- bReadComment = FALSE;
- bIsInHeader = TRUE;
+ bReadComment = sal_False;
+ bIsInHeader = sal_True;
pOptions = new HTMLOptions;
//#i76649, default to UTF-8 for HTML unless we know differently
@@ -343,7 +343,7 @@ SvParserState HTMLParser::CallParser()
SaveState( 0 );
nPre_LinePos = 0;
- bPre_IgnoreNewPara = FALSE;
+ bPre_IgnoreNewPara = sal_False;
AddRef();
Continue( 0 );
@@ -382,24 +382,24 @@ int HTMLParser::FilterToken( int nToken )
break; // nicht verschicken
case HTML_HEAD_OFF:
- bIsInBody = TRUE;
+ bIsInBody = sal_True;
case HTML_HEAD_ON:
bIsInHeader = HTML_HEAD_ON == nToken;
break;
case HTML_BODY_ON:
case HTML_FRAMESET_ON:
- bIsInHeader = FALSE;
+ bIsInHeader = sal_False;
bIsInBody = HTML_BODY_ON == nToken;
break;
case HTML_BODY_OFF:
- bIsInBody = bReadPRE = bReadListing = bReadXMP = FALSE;
+ bIsInBody = bReadPRE = bReadListing = bReadXMP = sal_False;
break;
case HTML_HTML_OFF:
nToken = 0;
- bReadPRE = bReadListing = bReadXMP = FALSE;
+ bReadPRE = bReadListing = bReadXMP = sal_False;
break; // HTML_ON wurde auch nicht verschickt !
case HTML_PREFORMTXT_ON:
@@ -450,23 +450,23 @@ int HTMLParser::FilterToken( int nToken )
int HTMLParser::ScanText( const sal_Unicode cBreak )
{
::rtl::OUStringBuffer sTmpBuffer( MAX_LEN );
- int bWeiter = TRUE;
- int bEqSignFound = FALSE;
+ int bWeiter = sal_True;
+ int bEqSignFound = sal_False;
sal_Unicode cQuote = 0U;
while( bWeiter && IsParserWorking() )
{
- int bNextCh = TRUE;
+ int bNextCh = sal_True;
switch( nNextCh )
{
case '&':
- bEqSignFound = FALSE;
+ bEqSignFound = sal_False;
if( bReadXMP )
sTmpBuffer.append( (sal_Unicode)'&' );
else
{
- ULONG nStreamPos = rInput.Tell();
- ULONG nLinePos = GetLinePos();
+ sal_uLong nStreamPos = rInput.Tell();
+ sal_uLong nLinePos = GetLinePos();
sal_Unicode cChar = 0U;
if( '#' == (nNextCh = GetNextChar()) )
@@ -544,7 +544,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
if( 0U == cChar && ';' != nNextCh )
{
DBG_ASSERT( rInput.Tell() - nStreamPos ==
- (ULONG)(nPos+1L)*GetCharSize(),
+ (sal_uLong)(nPos+1L)*GetCharSize(),
"UTF-8 geht hier schief" );
for( xub_StrLen i=nPos-1L; i>1L; i-- )
{
@@ -574,10 +574,10 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
// rInput.SeekRel( -(long)(++nPos*GetCharSize()) );
// nlLinePos -= nPos;
DBG_ASSERT( rInput.Tell()-nStreamPos ==
- (ULONG)(nPos+1)*GetCharSize(),
+ (sal_uLong)(nPos+1)*GetCharSize(),
"Falsche Stream-Position" );
DBG_ASSERT( nlLinePos-nLinePos ==
- (ULONG)(nPos+1),
+ (sal_uLong)(nPos+1),
"Falsche Zeilen-Position" );
rInput.Seek( nStreamPos );
nlLinePos = nLinePos;
@@ -619,10 +619,10 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
// rInput.SeekRel( -(long)(++nPos*GetCharSize()) );
// nlLinePos -= nPos;
DBG_ASSERT( rInput.Tell()-nStreamPos ==
- (ULONG)(nPos+1)*GetCharSize(),
+ (sal_uLong)(nPos+1)*GetCharSize(),
"Falsche Stream-Position" );
DBG_ASSERT( nlLinePos-nLinePos ==
- (ULONG)(nPos+1),
+ (sal_uLong)(nPos+1),
"Falsche Zeilen-Position" );
rInput.Seek( nStreamPos );
nlLinePos = nLinePos;
@@ -654,7 +654,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
else if( IsParserWorking() )
{
sTmpBuffer.append( (sal_Unicode)'&' );
- bNextCh = FALSE;
+ bNextCh = sal_False;
break;
}
@@ -691,15 +691,15 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
rInput.Seek( nStreamPos-(sal_uInt32)GetCharSize() );
nlLinePos = nLinePos-1;
ClearTxtConvContext();
- bReadNextChar = TRUE;
+ bReadNextChar = sal_True;
}
- bNextCh = FALSE;
+ bNextCh = sal_False;
}
}
break;
case '=':
if( '>'==cBreak && !cQuote )
- bEqSignFound = TRUE;
+ bEqSignFound = sal_True;
sTmpBuffer.append( nNextCh );
break;
@@ -724,7 +724,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
cQuote = 0U;
}
sTmpBuffer.append( nNextCh );
- bEqSignFound = FALSE;
+ bEqSignFound = sal_False;
break;
case sal_Unicode(EOF):
@@ -734,7 +734,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
// abc&auml;<EOF> nicht angezeigt, also lassen wir das in Zukunft.
// if( '>' != cBreak )
// eState = SVPAR_ACCEPTED;
- bWeiter = FALSE;
+ bWeiter = sal_False;
}
else
{
@@ -743,11 +743,11 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
break;
case '<':
- bEqSignFound = FALSE;
+ bEqSignFound = sal_False;
if( '>'==cBreak )
sTmpBuffer.append( nNextCh );
else
- bWeiter = FALSE; // Abbrechen, String zusammen
+ bWeiter = sal_False; // Abbrechen, String zusammen
break;
case '\f':
@@ -759,7 +759,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
else
{
// sonst wird es ein eigenes Token
- bWeiter = FALSE;
+ bWeiter = sal_False;
}
break;
@@ -773,7 +773,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
}
else if( bReadListing || bReadXMP || bReadPRE || bReadTextArea )
{
- bWeiter = FALSE;
+ bWeiter = sal_False;
break;
}
// Bug 18984: CR-LF -> Blank
@@ -783,7 +783,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
if( '\t'==nNextCh && bReadPRE && '>'!=cBreak )
{
// In <PRE>: Tabs nach oben durchreichen
- bWeiter = FALSE;
+ bWeiter = sal_False;
break;
}
// kein break
@@ -820,15 +820,15 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
} while ( ' ' == nNextCh || '\t' == nNextCh ||
'\r' == nNextCh || '\n' == nNextCh ||
'\x0b' == nNextCh );
- bNextCh = FALSE;
+ bNextCh = sal_False;
}
break;
default:
- bEqSignFound = FALSE;
+ bEqSignFound = sal_False;
if( (nNextCh==cBreak && !cQuote) ||
- (ULONG(aToken.Len()) + MAX_LEN) > ULONG(STRING_MAXLEN & ~1 ))
- bWeiter = FALSE;
+ (sal_uLong(aToken.Len()) + MAX_LEN) > sal_uLong(STRING_MAXLEN & ~1 ))
+ bWeiter = sal_False;
else
{
do {
@@ -837,8 +837,8 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
if( MAX_LEN == sTmpBuffer.getLength() )
{
aToken += String(sTmpBuffer.makeStringAndClear());
- if( (ULONG(aToken.Len()) + MAX_LEN) >
- ULONG(STRING_MAXLEN & ~1 ) )
+ if( (sal_uLong(aToken.Len()) + MAX_LEN) >
+ sal_uLong(STRING_MAXLEN & ~1 ) )
{
nNextCh = GetNextChar();
return HTML_TEXTTOKEN;
@@ -853,7 +853,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
return HTML_TEXTTOKEN;
}
} while( HTML_ISALPHA( nNextCh ) || HTML_ISDIGIT( nNextCh ) );
- bNextCh = FALSE;
+ bNextCh = sal_False;
}
}
@@ -878,21 +878,21 @@ int HTMLParser::_GetNextRawToken()
{
// beim letzten Aufruf haben wir das End-Token bereits gefunden,
// deshalb muessen wir es nicht noch einmal suchen
- bReadScript = FALSE;
- bReadStyle = FALSE;
+ bReadScript = sal_False;
+ bReadStyle = sal_False;
aEndToken.Erase();
- bEndTokenFound = FALSE;
+ bEndTokenFound = sal_False;
return 0;
}
// per default geben wir HTML_RAWDATA zurueck
- int bWeiter = TRUE;
+ int bWeiter = sal_True;
int nToken = HTML_RAWDATA;
SaveState( 0 );
while( bWeiter && IsParserWorking() )
{
- int bNextCh = TRUE;
+ int bNextCh = sal_True;
switch( nNextCh )
{
case '<':
@@ -903,15 +903,15 @@ int HTMLParser::_GetNextRawToken()
aToken += String(sTmpBuffer.makeStringAndClear());
// und die Position im Stream merken
- ULONG nStreamPos = rInput.Tell();
- ULONG nLineNr = GetLineNr();
- ULONG nLinePos = GetLinePos();
+ sal_uLong nStreamPos = rInput.Tell();
+ sal_uLong nLineNr = GetLineNr();
+ sal_uLong nLinePos = GetLinePos();
// Start eines End-Token?
- int bOffState = FALSE;
+ int bOffState = sal_False;
if( '/' == (nNextCh = GetNextChar()) )
{
- bOffState = TRUE;
+ bOffState = sal_True;
nNextCh = GetNextChar();
}
else if( '!' == nNextCh )
@@ -932,7 +932,7 @@ int HTMLParser::_GetNextRawToken()
sal::static_int_cast< xub_StrLen >(
sTmpBuffer.getLength()) );
aTok.ToUpperAscii();
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
if( bReadScript || aEndToken.Len() )
{
if( !bReadComment )
@@ -940,7 +940,7 @@ int HTMLParser::_GetNextRawToken()
if( aTok.CompareToAscii( OOO_STRING_SVTOOLS_HTML_comment, 3 )
== COMPARE_EQUAL )
{
- bReadComment = TRUE;
+ bReadComment = sal_True;
}
else
{
@@ -957,7 +957,7 @@ int HTMLParser::_GetNextRawToken()
aTok.Copy( aTok.Len()-2 ).EqualsAscii( "--" ) )
{
// hier ist ein Kommentar der Art <!-----> zuende
- bReadComment = FALSE;
+ bReadComment = sal_False;
}
}
else
@@ -980,15 +980,15 @@ int HTMLParser::_GetNextRawToken()
// bisher gelesenen String zurueckgeben und dnach normal
// weitermachen
- bWeiter = FALSE;
+ bWeiter = sal_False;
// nToken==0 heisst, dass _GetNextToken gleich weiterliest
if( !aToken.Len() && (bReadStyle || bReadScript) )
{
// wir koennen sofort die Umgebung beeden und
// das End-Token parsen
- bReadScript = FALSE;
- bReadStyle = FALSE;
+ bReadScript = sal_False;
+ bReadStyle = sal_False;
aEndToken.Erase();
nToken = 0;
}
@@ -997,7 +997,7 @@ int HTMLParser::_GetNextRawToken()
// wir muessen bReadScript/bReadStyle noch am
// Leben lassen und koennen erst beim naechsten
// mal das End-Token Parsen
- bEndTokenFound = TRUE;
+ bEndTokenFound = sal_True;
}
// jetzt fahren wir im Stream auf das '<' zurueck
@@ -1017,7 +1017,7 @@ int HTMLParser::_GetNextRawToken()
if( bOffState )
aToken += (sal_Unicode)'/';
- bNextCh = FALSE;
+ bNextCh = sal_False;
}
}
break;
@@ -1025,11 +1025,11 @@ int HTMLParser::_GetNextRawToken()
sTmpBuffer.append( nNextCh );
if( bReadComment )
{
- BOOL bTwoMinus = FALSE;
+ sal_Bool bTwoMinus = sal_False;
nNextCh = GetNextChar();
while( '-' == nNextCh && IsParserWorking() )
{
- bTwoMinus = TRUE;
+ bTwoMinus = sal_True;
if( MAX_LEN == sTmpBuffer.getLength() )
aToken += String(sTmpBuffer.makeStringAndClear());
@@ -1038,9 +1038,9 @@ int HTMLParser::_GetNextRawToken()
}
if( '>' == nNextCh && IsParserWorking() && bTwoMinus )
- bReadComment = FALSE;
+ bReadComment = sal_False;
- bNextCh = FALSE;
+ bNextCh = sal_False;
}
break;
@@ -1049,27 +1049,27 @@ int HTMLParser::_GetNextRawToken()
nNextCh = GetNextChar();
if( nNextCh=='\n' )
nNextCh = GetNextChar();
- bWeiter = FALSE;
+ bWeiter = sal_False;
break;
case '\n':
// \n beendet das aktuelle Text-Token (auch wenn es leer ist)
nNextCh = GetNextChar();
- bWeiter = FALSE;
+ bWeiter = sal_False;
break;
case sal_Unicode(EOF):
// eof beendet das aktuelle Text-Token und tut so, als ob
// ein End-Token gelesen wurde
if( rInput.IsEof() )
{
- bWeiter = FALSE;
+ bWeiter = sal_False;
if( aToken.Len() || sTmpBuffer.getLength() )
{
- bEndTokenFound = TRUE;
+ bEndTokenFound = sal_True;
}
else
{
- bReadScript = FALSE;
- bReadStyle = FALSE;
+ bReadScript = sal_False;
+ bReadStyle = sal_False;
aEndToken.Erase();
nToken = 0;
}
@@ -1111,7 +1111,7 @@ int HTMLParser::_GetNextToken()
if( !IsParserWorking() ) // wenn schon Fehler, dann nicht weiter!
return 0;
- BOOL bReadNextCharSave = bReadNextChar;
+ sal_Bool bReadNextCharSave = bReadNextChar;
if( bReadNextChar )
{
DBG_ASSERT( !bEndTokenFound,
@@ -1119,7 +1119,7 @@ int HTMLParser::_GetNextToken()
nNextCh = GetNextChar();
if( !IsParserWorking() ) // wenn schon Fehler, dann nicht weiter!
return 0;
- bReadNextChar = FALSE;
+ bReadNextChar = sal_False;
}
if( bReadScript || bReadStyle || aEndToken.Len() )
@@ -1130,19 +1130,19 @@ int HTMLParser::_GetNextToken()
}
do {
- int bNextCh = TRUE;
+ int bNextCh = sal_True;
switch( nNextCh )
{
case '<':
{
- ULONG nStreamPos = rInput.Tell();
- ULONG nLineNr = GetLineNr();
- ULONG nLinePos = GetLinePos();
+ sal_uLong nStreamPos = rInput.Tell();
+ sal_uLong nLineNr = GetLineNr();
+ sal_uLong nLinePos = GetLinePos();
- int bOffState = FALSE;
+ int bOffState = sal_False;
if( '/' == (nNextCh = GetNextChar()) )
{
- bOffState = TRUE;
+ bOffState = sal_True;
nNextCh = GetNextChar();
}
if( HTML_ISALPHA( nNextCh ) || '!'==nNextCh ) // fix #26984#
@@ -1202,12 +1202,12 @@ int HTMLParser::_GetNextToken()
aToken = sSaveToken;
if( '>'!=nNextCh )
aToken += (sal_Unicode)' ';
- ULONG nCStreamPos = 0;
- ULONG nCLineNr = 0;
- ULONG nCLinePos = 0;
+ sal_uLong nCStreamPos = 0;
+ sal_uLong nCLineNr = 0;
+ sal_uLong nCLinePos = 0;
xub_StrLen nCStrLen = 0;
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
// bis zum schliessenden --> lesen. wenn keins gefunden
// wurde beim der ersten > wieder aufsetzen
while( !bDone && !rInput.IsEof() && IsParserWorking() )
@@ -1264,7 +1264,7 @@ int HTMLParser::_GetNextToken()
aToken = '<';
nRet = HTML_TEXTTOKEN;
nNextCh = GetNextChar();
- bNextCh = FALSE;
+ bNextCh = sal_False;
break;
}
}
@@ -1289,7 +1289,7 @@ int HTMLParser::_GetNextToken()
aToken = '<';
nRet = HTML_TEXTTOKEN;
nNextCh = GetNextChar();
- bNextCh = FALSE;
+ bNextCh = sal_False;
break;
}
if( SVPAR_PENDING == eState )
@@ -1300,10 +1300,10 @@ int HTMLParser::_GetNextToken()
{
nRet = HTML_UNKNOWNCONTROL_ON;
- ULONG nCStreamPos = rInput.Tell();
- ULONG nCLineNr = GetLineNr(), nCLinePos = GetLinePos();
+ sal_uLong nCStreamPos = rInput.Tell();
+ sal_uLong nCLineNr = GetLineNr(), nCLinePos = GetLinePos();
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
// bis zum schliessenden %> lesen. wenn keins gefunden
// wurde beim der ersten > wieder aufsetzen
while( !bDone && !rInput.IsEof() && IsParserWorking() )
@@ -1336,7 +1336,7 @@ int HTMLParser::_GetNextToken()
{
aToken = '<';
nRet = HTML_TEXTTOKEN;
- bNextCh = FALSE;
+ bNextCh = sal_False;
break;
}
}
@@ -1347,32 +1347,32 @@ int HTMLParser::_GetNextToken()
switch( nRet )
{
case HTML_TEXTAREA_ON:
- bReadTextArea = TRUE;
+ bReadTextArea = sal_True;
break;
case HTML_TEXTAREA_OFF:
- bReadTextArea = FALSE;
+ bReadTextArea = sal_False;
break;
case HTML_SCRIPT_ON:
if( !bReadTextArea )
- bReadScript = TRUE;
+ bReadScript = sal_True;
break;
case HTML_SCRIPT_OFF:
if( !bReadTextArea )
{
- bReadScript = FALSE;
+ bReadScript = sal_False;
// JavaScript kann den Stream veraendern
// also muss das letzte Zeichen nochmals
// gelesen werden
- bReadNextChar = TRUE;
- bNextCh = FALSE;
+ bReadNextChar = sal_True;
+ bNextCh = sal_False;
}
break;
case HTML_STYLE_ON:
- bReadStyle = TRUE;
+ bReadStyle = sal_True;
break;
case HTML_STYLE_OFF:
- bReadStyle = FALSE;
+ bReadStyle = sal_False;
break;
}
@@ -1406,7 +1406,7 @@ int HTMLParser::_GetNextToken()
if( ( '\n' != nNextCh || '\r' != c ) &&
( '\r' != nNextCh || '\n' != c ) )
{
- bNextCh = FALSE;
+ bNextCh = sal_False;
nNextCh = c;
}
nRet = HTML_NEWPARA;
@@ -1433,7 +1433,7 @@ scan_text:
if( !bNextCh && eState == SVPAR_PENDING )
{
eState = SVPAR_WORKING;
- bReadNextChar = TRUE;
+ bReadNextChar = sal_True;
}
break;
@@ -1444,7 +1444,7 @@ scan_text:
nNextCh = GetNextChar();
if( SVPAR_PENDING == eState && nRet && HTML_TEXTTOKEN != nRet )
{
- bReadNextChar = TRUE;
+ bReadNextChar = sal_True;
eState = SVPAR_WORKING;
}
}
@@ -1461,15 +1461,15 @@ void HTMLParser::UnescapeToken()
{
xub_StrLen nPos=0;
- BOOL bEscape = FALSE;
+ sal_Bool bEscape = sal_False;
while( nPos < aToken.Len() )
{
- BOOL bOldEscape = bEscape;
- bEscape = FALSE;
+ sal_Bool bOldEscape = bEscape;
+ bEscape = sal_False;
if( '\\'==aToken.GetChar(nPos) && !bOldEscape )
{
aToken.Erase( nPos, 1 );
- bEscape = TRUE;
+ bEscape = sal_True;
}
else
{
@@ -1479,7 +1479,7 @@ void HTMLParser::UnescapeToken()
}
// hole die Optionen
-const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const
+const HTMLOptions *HTMLParser::GetOptions( sal_uInt16 *pNoConvertToken ) const
{
// wenn die Option fuer das aktuelle Token schon einmal
// geholt wurden, geben wir sie noch einmal zurueck
@@ -1517,7 +1517,7 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const
nToken = GetHTMLOption( sNameUpperCase ); // der Name ist fertig
DBG_ASSERTWARNING( nToken!=HTML_O_UNKNOWN,
"GetOption: unbekannte HTML-Option" );
- BOOL bStripCRLF = (nToken < HTML_OPTION_SCRIPT_START ||
+ sal_Bool bStripCRLF = (nToken < HTML_OPTION_SCRIPT_START ||
nToken >= HTML_OPTION_SCRIPT_END) &&
(!pNoConvertToken || nToken != *pNoConvertToken);
@@ -1544,12 +1544,12 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const
{
sal_Unicode cEnd = cChar;
nPos++; nStt++;
- BOOL bDone = FALSE;
- BOOL bEscape = FALSE;
+ sal_Bool bDone = sal_False;
+ sal_Bool bEscape = sal_False;
while( nPos < aToken.Len() && !bDone )
{
- BOOL bOldEscape = bEscape;
- bEscape = FALSE;
+ sal_Bool bOldEscape = bEscape;
+ bEscape = sal_False;
cChar = aToken.GetChar(nPos);
switch( cChar )
{
@@ -1568,7 +1568,7 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const
else
{
((String &)aToken).Erase( nPos, 1 );
- bEscape = TRUE;
+ bEscape = sal_True;
}
break;
case '"':
@@ -1589,12 +1589,12 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const
{
// hier sind wir etwas laxer als der
// Standard und erlauben alles druckbare
- BOOL bEscape = FALSE;
- BOOL bDone = FALSE;
+ sal_Bool bEscape = sal_False;
+ sal_Bool bDone = sal_False;
while( nPos < aToken.Len() && !bDone )
{
- BOOL bOldEscape = bEscape;
- bEscape = FALSE;
+ sal_Bool bOldEscape = bEscape;
+ bEscape = sal_False;
sal_Unicode c = aToken.GetChar(nPos);
switch( c )
{
@@ -1607,7 +1607,7 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const
case '\t':
case '\r':
case '\n':
- bDone = TRUE;
+ bDone = sal_True;
break;
case '\\':
@@ -1618,7 +1618,7 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const
else
{
((String &)aToken).Erase( nPos, 1 );
- bEscape = TRUE;
+ bEscape = sal_True;
}
break;
@@ -1626,7 +1626,7 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const
if( HTML_ISPRINTABLE( c ) )
nPos++, nLen++;
else
- bDone = TRUE;
+ bDone = sal_True;
break;
}
}
@@ -1831,7 +1831,7 @@ int HTMLParser::FilterPRE( int nToken )
break;
}
- bPre_IgnoreNewPara = FALSE;
+ bPre_IgnoreNewPara = sal_False;
return nToken;
}
@@ -1872,7 +1872,7 @@ int HTMLParser::FilterXMP( int nToken )
break;
}
- bPre_IgnoreNewPara = FALSE;
+ bPre_IgnoreNewPara = sal_False;
return nToken;
}
@@ -1900,13 +1900,13 @@ int HTMLParser::FilterListing( int nToken )
break;
}
- bPre_IgnoreNewPara = FALSE;
+ bPre_IgnoreNewPara = sal_False;
return nToken;
}
bool HTMLParser::IsHTMLFormat( const sal_Char* pHeader,
- BOOL bSwitchToUCS2,
+ sal_Bool bSwitchToUCS2,
rtl_TextEncoding eEnc )
{
// Einer der folgenden regulaeren Ausdrucke muss sich auf den String
@@ -1920,14 +1920,14 @@ bool HTMLParser::IsHTMLFormat( const sal_Char* pHeader,
// ensprechen muss
ByteString sCmp;
- BOOL bUCS2B = FALSE;
+ sal_Bool bUCS2B = sal_False;
if( bSwitchToUCS2 )
{
if( 0xfeU == (sal_uChar)pHeader[0] &&
0xffU == (sal_uChar)pHeader[1] )
{
eEnc = RTL_TEXTENCODING_UCS2;
- bUCS2B = TRUE;
+ bUCS2B = sal_True;
}
else if( 0xffU == (sal_uChar)pHeader[0] &&
0xfeU == (sal_uChar)pHeader[1] )
@@ -1945,7 +1945,7 @@ bool HTMLParser::IsHTMLFormat( const sal_Char* pHeader,
)
{
if( 0xfe == (sal_uChar)pHeader[0] )
- bUCS2B = TRUE;
+ bUCS2B = sal_True;
xub_StrLen nLen;
for( nLen = 2;
@@ -1978,7 +1978,7 @@ bool HTMLParser::IsHTMLFormat( const sal_Char* pHeader,
// Ein HTML-Dokument muss in der ersten Zeile ein '<' besitzen
xub_StrLen nStart = sCmp.Search( '<' );
if( STRING_NOTFOUND == nStart )
- return FALSE;
+ return sal_False;
nStart++;
// danach duerfen beliebige andere Zeichen bis zu einem blank oder
@@ -1993,7 +1993,7 @@ bool HTMLParser::IsHTMLFormat( const sal_Char* pHeader,
// wenn das Dokeument hinter dem < aufhoert ist es wohl kein HTML
if( nPos==nStart )
- return FALSE;
+ return sal_False;
// die Zeichenkette nach dem '<' muss ausserdem ein bekanntes
// HTML Token sein. Damit die Ausgabe eines DOS-dir-Befehls nicht
@@ -2002,30 +2002,30 @@ bool HTMLParser::IsHTMLFormat( const sal_Char* pHeader,
String sTest( sCmp.Copy( nStart, nPos-nStart ), RTL_TEXTENCODING_ASCII_US );
int nTok = GetHTMLToken( sTest );
if( 0 != nTok && HTML_DIRLIST_ON != nTok )
- return TRUE;
+ return sal_True;
// oder es handelt sich um ein "<!" ganz am Anfang der Datei (fix #27092#)
if( nStart == 1 && '!' == sCmp.GetChar( 1 ) )
- return TRUE;
+ return sal_True;
// oder wir finden irgendwo ein <HTML> in den ersten 80 Zeichen
nStart = sCmp.Search( OOO_STRING_SVTOOLS_HTML_html );
if( nStart!=STRING_NOTFOUND &&
nStart>0 && '<'==sCmp.GetChar(nStart-1) &&
nStart+4 < sCmp.Len() && '>'==sCmp.GetChar(nStart+4) )
- return TRUE;
+ return sal_True;
// sonst ist es wohl doch eher kein HTML-Dokument
- return FALSE;
+ return sal_False;
}
-BOOL HTMLParser::InternalImgToPrivateURL( String& rURL )
+sal_Bool HTMLParser::InternalImgToPrivateURL( String& rURL )
{
if( rURL.Len() < 19 || 'i' != rURL.GetChar(0) ||
rURL.CompareToAscii( OOO_STRING_SVTOOLS_HTML_internal_gopher, 9 ) != COMPARE_EQUAL )
- return FALSE;
+ return sal_False;
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
if( rURL.CompareToAscii( OOO_STRING_SVTOOLS_HTML_internal_gopher,16) == COMPARE_EQUAL )
{
@@ -2133,10 +2133,10 @@ bool HTMLParser::ParseMetaOptionsImpl(
rtl_TextEncoding& o_rEnc )
{
String aName, aContent;
- USHORT nAction = HTML_META_NONE;
+ sal_uInt16 nAction = HTML_META_NONE;
bool bHTTPEquiv = false, bChanged = false;
- for ( USHORT i = i_pOptions->Count(); i; )
+ for ( sal_uInt16 i = i_pOptions->Count(); i; )
{
const HTMLOption *pOption = (*i_pOptions)[ --i ];
switch ( pOption->GetToken() )
@@ -2222,8 +2222,8 @@ bool HTMLParser::ParseMetaOptionsImpl(
if ( i_xDocProps.is() && aContent.Len() &&
aContent.GetTokenCount() == 2 )
{
- Date aDate( (ULONG)aContent.GetToken(0).ToInt32() );
- Time aTime( (ULONG)aContent.GetToken(1).ToInt32() );
+ Date aDate( (sal_uLong)aContent.GetToken(0).ToInt32() );
+ Time aTime( (sal_uLong)aContent.GetToken(1).ToInt32() );
DateTime aDateTime( aDate, aTime );
::util::DateTime uDT(aDateTime.Get100Sec(),
aDateTime.GetSec(), aDateTime.GetMin(),
@@ -2279,7 +2279,7 @@ bool HTMLParser::ParseMetaOptions(
const uno::Reference<document::XDocumentProperties> & i_xDocProps,
SvKeyValueIterator *i_pHeader )
{
- USHORT nContentOption = HTML_O_CONTENT;
+ sal_uInt16 nContentOption = HTML_O_CONTENT;
rtl_TextEncoding eEnc = RTL_TEXTENCODING_DONTKNOW;
bool bRet = ParseMetaOptionsImpl( i_xDocProps, i_pHeader,
@@ -2287,7 +2287,7 @@ bool HTMLParser::ParseMetaOptions(
eEnc );
// If the encoding is set by a META tag, it may only overwrite the
- // current encoding if both, the current and the new encoding, are 1-BYTE
+ // current encoding if both, the current and the new encoding, are 1-sal_uInt8
// encodings. Everything else cannot lead to reasonable results.
if (RTL_TEXTENCODING_DONTKNOW != eEnc &&
rtl_isOctetTextEncoding( eEnc ) &&
@@ -2326,7 +2326,7 @@ rtl_TextEncoding HTMLParser::GetEncodingByHttpHeader( SvKeyValueIterator *pHTTPH
if( pHTTPHeader )
{
SvKeyValue aKV;
- for( BOOL bCont = pHTTPHeader->GetFirst( aKV ); bCont;
+ for( sal_Bool bCont = pHTTPHeader->GetFirst( aKV ); bCont;
bCont = pHTTPHeader->GetNext( aKV ) )
{
if( aKV.GetKey().EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_META_content_type ) )
@@ -2341,15 +2341,15 @@ rtl_TextEncoding HTMLParser::GetEncodingByHttpHeader( SvKeyValueIterator *pHTTPH
return eRet;
}
-BOOL HTMLParser::SetEncodingByHTTPHeader(
+sal_Bool HTMLParser::SetEncodingByHTTPHeader(
SvKeyValueIterator *pHTTPHeader )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
rtl_TextEncoding eEnc = HTMLParser::GetEncodingByHttpHeader( pHTTPHeader );
if(RTL_TEXTENCODING_DONTKNOW != eEnc)
{
SetSrcEncoding( eEnc );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
}
diff --git a/svtools/source/svrtf/makefile.mk b/svtools/source/svrtf/makefile.mk
deleted file mode 100644
index 5ebb0e28c69e..000000000000
--- a/svtools/source/svrtf/makefile.mk
+++ /dev/null
@@ -1,49 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=svrtf
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(SLO)$/svparser.obj \
- $(SLO)$/parrtf.obj \
- $(SLO)$/rtfout.obj \
- $(SLO)$/rtfkeywd.obj
-
-# ==========================================================================
-
-.INCLUDE : target.mk
-
diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx
index 8ddcdb70a37b..a475343dcaac 100644
--- a/svtools/source/svrtf/parrtf.cxx
+++ b/svtools/source/svrtf/parrtf.cxx
@@ -33,8 +33,8 @@
#include <rtl/tencinfo.h>
#include <tools/stream.hxx>
#include <tools/debug.hxx>
-#include "rtftoken.h"
-#include "rtfkeywd.hxx"
+#include <svtools/rtftoken.h>
+#include <svtools/rtfkeywd.hxx>
#include <svtools/parrtf.hxx>
const int MAX_STRING_LEN = 1024;
@@ -43,9 +43,7 @@ const int MAX_TOKEN_LEN = 128;
#define RTF_ISDIGIT( c ) (c >= '0' && c <= '9')
#define RTF_ISALPHA( c ) ( (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') )
-SV_IMPL_VARARR( RtfParserStates_Impl, RtfParserState_Impl )
-
-SvRTFParser::SvRTFParser( SvStream& rIn, BYTE nStackSize )
+SvRTFParser::SvRTFParser( SvStream& rIn, sal_uInt8 nStackSize )
: SvParser( rIn, nStackSize ),
eUNICodeSet( RTL_TEXTENCODING_MS_1252 ), // default ist ANSI-CodeSet
nUCharOverread( 1 )
@@ -171,17 +169,16 @@ int SvRTFParser::_GetNextToken()
case RTF_UC:
if( 0 <= nTokenValue )
{
- nUCharOverread = (BYTE)nTokenValue;
+ nUCharOverread = (sal_uInt8)nTokenValue;
#if 1
//cmc: other ifdef breaks #i3584
- aParserStates[ aParserStates.Count()-1].
+ aParserStates.top().
nUCharOverread = nUCharOverread;
#else
if( !nUCharOverread )
- nUCharOverread = aParserStates[
- aParserStates.Count()-1].nUCharOverread;
+ nUCharOverread = aParserStates.top().nUCharOverread;
else
- aParserStates[ aParserStates.Count()-1].
+ aParserStates.top().
nUCharOverread = nUCharOverread;
#endif
}
@@ -210,7 +207,7 @@ int SvRTFParser::_GetNextToken()
// overread the next n "RTF" characters. This
// can be also \{, \}, \'88
- for( BYTE m = 0; m < nUCharOverread; ++m )
+ for( sal_uInt8 m = 0; m < nUCharOverread; ++m )
{
sal_Unicode cAnsi = nNextCh;
while( 0xD == cAnsi )
@@ -251,12 +248,12 @@ int SvRTFParser::_GetNextToken()
if( 0 <= nOpenBrakets )
{
RtfParserState_Impl aState( nUCharOverread, GetSrcEncoding() );
- aParserStates.Insert(
- aState, sal::static_int_cast< USHORT >(nOpenBrakets) );
+ aParserStates.push( aState );
}
++nOpenBrakets;
- DBG_ASSERT( nOpenBrakets == aParserStates.Count(),
- "ParserStateStack unequal to bracket count" );
+ DBG_ASSERT(
+ static_cast<size_t>(nOpenBrakets) == aParserStates.size(),
+ "ParserStateStack unequal to bracket count" );
nRet = nNextCh;
}
break;
@@ -265,12 +262,11 @@ int SvRTFParser::_GetNextToken()
--nOpenBrakets;
if( 0 <= nOpenBrakets )
{
- aParserStates.Remove(
- sal::static_int_cast< USHORT >(nOpenBrakets) );
- if( aParserStates.Count() )
+ aParserStates.pop();
+ if( !aParserStates.empty() )
{
const RtfParserState_Impl& rRPS =
- aParserStates[ aParserStates.Count() - 1 ];
+ aParserStates.top();
nUCharOverread = rRPS.nUCharOverread;
SetSrcEncoding( rRPS.eCodeSet );
}
@@ -280,8 +276,9 @@ int SvRTFParser::_GetNextToken()
SetSrcEncoding( GetCodeSet() );
}
}
- DBG_ASSERT( nOpenBrakets == aParserStates.Count(),
- "ParserStateStack unequal to bracket count" );
+ DBG_ASSERT(
+ static_cast<size_t>(nOpenBrakets) == aParserStates.size(),
+ "ParserStateStack unequal to bracket count" );
nRet = nNextCh;
break;
@@ -432,7 +429,7 @@ void SvRTFParser::ScanText( const sal_Unicode cBreak )
// overread the next n "RTF" characters. This
// can be also \{, \}, \'88
- for( BYTE m = 0; m < nUCharOverread; ++m )
+ for( sal_uInt8 m = 0; m < nUCharOverread; ++m )
{
sal_Unicode cAnsi = nNextCh;
while( 0xD == cAnsi )
@@ -682,8 +679,8 @@ void SvRTFParser::SetEncoding( rtl_TextEncoding eEnc )
if (eEnc == RTL_TEXTENCODING_DONTKNOW)
eEnc = GetCodeSet();
- if (aParserStates.Count())
- aParserStates[aParserStates.Count() - 1].eCodeSet = eEnc;
+ if (!aParserStates.empty())
+ aParserStates.top().eCodeSet = eEnc;
SetSrcEncoding(eEnc);
}
diff --git a/svtools/source/svrtf/rtfkey2.cxx b/svtools/source/svrtf/rtfkey2.cxx
deleted file mode 100644
index e2e2bef0f721..000000000000
--- a/svtools/source/svrtf/rtfkey2.cxx
+++ /dev/null
@@ -1,1159 +0,0 @@
-/* -*- 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 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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-
-#include "rtfkeywd.hxx"
-
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HEXCHAR, "\\'" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_IGNORE, "\\*" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OPTHYPH, "\\-" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SUBENTRY, "\\:" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ABSH, "\\absh" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ABSW, "\\absw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ALT, "\\alt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ANNOTATION, "\\annotation" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ANSI, "\\ansi" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ATNID, "\\atnid" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AUTHOR, "\\author" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_B, "\\b" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGBDIAG, "\\bgbdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGCROSS, "\\bgcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGDCROSS, "\\bgdcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGDKBDIAG, "\\bgdkbdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGDKCROSS, "\\bgdkcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGDKDCROSS, "\\bgdkdcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGDKFDIAG, "\\bgdkfdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGDKHORIZ, "\\bgdkhoriz" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGDKVERT, "\\bgdkvert" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGFDIAG, "\\bgfdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGHORIZ, "\\bghoriz" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGVERT, "\\bgvert" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BIN, "\\bin" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BINFSXN, "\\binfsxn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BINSXN, "\\binsxn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BKMKCOLF, "\\bkmkcolf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BKMKCOLL, "\\bkmkcoll" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BKMKEND, "\\bkmkend" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BKMKSTART, "\\bkmkstart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BLUE, "\\blue" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BOX, "\\box" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRB, "\\brdrb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRBAR, "\\brdrbar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRBTW, "\\brdrbtw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRCF, "\\brdrcf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRDB, "\\brdrdb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRDOT, "\\brdrdot" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRHAIR, "\\brdrhair" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRL, "\\brdrl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRR, "\\brdrr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRS, "\\brdrs" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRSH, "\\brdrsh" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRT, "\\brdrt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTH, "\\brdrth" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRW, "\\brdrw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRSP, "\\brsp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BULLET, "\\bullet" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BUPTIM, "\\buptim" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BXE, "\\bxe" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CAPS, "\\caps" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CB, "\\cb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CBPAT, "\\cbpat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CELL, "\\cell" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CELLX, "\\cellx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CF, "\\cf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CFPAT, "\\cfpat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHATN, "\\chatn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHDATE, "\\chdate" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHDPA, "\\chdpa" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHDPL, "\\chdpl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHFTN, "\\chftn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHFTNSEP, "\\chftnsep" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHFTNSEPC, "\\chftnsepc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHPGN, "\\chpgn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHTIME, "\\chtime" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGBDIAG, "\\clbgbdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGCROSS, "\\clbgcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGDCROSS, "\\clbgdcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGDKBDIAG, "\\clbgdkbdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGDKCROSS, "\\clbgdkcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGDKDCROSS, "\\clbgdkdcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGDKFDIAG, "\\clbgdkfdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGDKHOR, "\\clbgdkhor" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGDKVERT, "\\clbgdkvert" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGFDIAG, "\\clbgfdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGHORIZ, "\\clbghoriz" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGVERT, "\\clbgvert" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBRDRB, "\\clbrdrb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBRDRL, "\\clbrdrl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBRDRR, "\\clbrdrr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBRDRT, "\\clbrdrt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLCBPAT, "\\clcbpat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLCFPAT, "\\clcfpat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLMGF, "\\clmgf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLMRG, "\\clmrg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLSHDNG, "\\clshdng" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_COLNO, "\\colno" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_COLORTBL, "\\colortbl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_COLS, "\\cols" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_COLSR, "\\colsr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_COLSX, "\\colsx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_COLUMN, "\\column" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_COLW, "\\colw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_COMMENT, "\\comment" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CREATIM, "\\creatim" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CTRL, "\\ctrl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DEFF, "\\deff" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DEFFORMAT, "\\defformat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DEFLANG, "\\deflang" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DEFTAB, "\\deftab" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DELETED, "\\deleted" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DFRMTXTX, "\\dfrmtxtx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DFRMTXTY, "\\dfrmtxty" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DIBITMAP, "\\dibitmap" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DN, "\\dn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DOCCOMM, "\\doccomm" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DOCTEMP, "\\doctemp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DROPCAPLI, "\\dropcapli" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DROPCAPT, "\\dropcapt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ABSNOOVRLP, "\\absnoovrlp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DXFRTEXT, "\\dxfrtext" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DY, "\\dy" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_EDMINS, "\\edmins" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_EMDASH, "\\emdash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ENDASH, "\\endash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ENDDOC, "\\enddoc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ENDNHERE, "\\endnhere" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ENDNOTES, "\\endnotes" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_EXPND, "\\expnd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_EXPNDTW, "\\expndtw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_F, "\\f" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FACINGP, "\\facingp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FACPGSXN, "\\facpgsxn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FALT, "\\falt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FCHARSET, "\\fcharset" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FDECOR, "\\fdecor" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FI, "\\fi" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FIELD, "\\field" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLDDIRTY, "\\flddirty" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLDEDIT, "\\fldedit" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLDINST, "\\fldinst" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLDLOCK, "\\fldlock" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLDPRIV, "\\fldpriv" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLDRSLT, "\\fldrslt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FMODERN, "\\fmodern" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FN, "\\fn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FNIL, "\\fnil" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FONTTBL, "\\fonttbl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FOOTER, "\\footer" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERF, "\\footerf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERL, "\\footerl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERR, "\\footerr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERY, "\\footery" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FOOTNOTE, "\\footnote" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FPRQ, "\\fprq" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FRACWIDTH, "\\fracwidth" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FROMAN, "\\froman" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FS, "\\fs" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FSCRIPT, "\\fscript" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FSWISS, "\\fswiss" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTECH, "\\ftech" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNBJ, "\\ftnbj" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNCN, "\\ftncn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNRESTART, "\\ftnrestart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNSEP, "\\ftnsep" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNSEPC, "\\ftnsepc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNSTART, "\\ftnstart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNTJ, "\\ftntj" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_GREEN, "\\green" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_GUTTER, "\\gutter" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_GUTTERSXN, "\\guttersxn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HEADER, "\\header" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HEADERF, "\\headerf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HEADERL, "\\headerl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HEADERR, "\\headerr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HEADERY, "\\headery" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HR, "\\hr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HYPHHOTZ, "\\hyphhotz" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_I, "\\i" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ID, "\\id" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_INFO, "\\info" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_INTBL, "\\intbl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_IXE, "\\ixe" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_KEEP, "\\keep" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_KEEPN, "\\keepn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_KERNING, "\\kerning" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_KEYCODE, "\\keycode" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_KEYWORDS, "\\keywords" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LANDSCAPE, "\\landscape" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LANG, "\\lang" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LDBLQUOTE, "\\ldblquote" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVEL, "\\level" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LI, "\\li" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LIN, "\\lin" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINE, "\\line" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINEBETCOL, "\\linebetcol" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINECONT, "\\linecont" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINEMOD, "\\linemod" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINEPPAGE, "\\lineppage" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINERESTART, "\\linerestart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINESTART, "\\linestart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINESTARTS, "\\linestarts" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINEX, "\\linex" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LNDSCPSXN, "\\lndscpsxn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LQUOTE, "\\lquote" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MAC, "\\mac" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MACPICT, "\\macpict" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MAKEBACKUP, "\\makebackup" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MARGB, "\\margb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MARGBSXN, "\\margbsxn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MARGL, "\\margl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MARGLSXN, "\\marglsxn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MARGMIRROR, "\\margmirror" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MARGR, "\\margr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MARGRSXN, "\\margrsxn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MARGT, "\\margt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MARGTSXN, "\\margtsxn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MIN, "\\min" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MO, "\\mo" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NEXTCSET, "\\nextcset" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NEXTFILE, "\\nextfile" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOFCHARS, "\\nofchars" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOFPAGES, "\\nofpages" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOFWORDS, "\\nofwords" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOLINE, "\\noline" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOSUPERSUB, "\\nosupersub" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOWRAP, "\\nowrap" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OPERATOR, "\\operator" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OUTL, "\\outl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PAGE, "\\page" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PAGEBB, "\\pagebb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PAPERH, "\\paperh" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PAPERW, "\\paperw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PAR, "\\par" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PARD, "\\pard" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PC, "\\pc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PCA, "\\pca" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGHSXN, "\\pghsxn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNCONT, "\\pgncont" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNDEC, "\\pgndec" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNLCLTR, "\\pgnlcltr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNLCRM, "\\pgnlcrm" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNRESTART, "\\pgnrestart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNSTART, "\\pgnstart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNSTARTS, "\\pgnstarts" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNUCLTR, "\\pgnucltr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNUCRM, "\\pgnucrm" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNX, "\\pgnx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNY, "\\pgny" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGWSXN, "\\pgwsxn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PHCOL, "\\phcol" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PHMRG, "\\phmrg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PHPG, "\\phpg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICCROPB, "\\piccropb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICCROPL, "\\piccropl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICCROPR, "\\piccropr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICCROPT, "\\piccropt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICH, "\\pich" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICHGOAL, "\\pichgoal" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICSCALED, "\\picscaled" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICSCALEX, "\\picscalex" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICSCALEY, "\\picscaley" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICT, "\\pict" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICW, "\\picw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICWGOAL, "\\picwgoal" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PLAIN, "\\plain" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PMMETAFILE, "\\pmmetafile" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSNEGX, "\\posnegx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSNEGY, "\\posnegy" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSX, "\\posx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSXC, "\\posxc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSXI, "\\posxi" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSXL, "\\posxl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSXO, "\\posxo" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSXR, "\\posxr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSY, "\\posy" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSYB, "\\posyb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSYC, "\\posyc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSYIL, "\\posyil" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSYT, "\\posyt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PRINTIM, "\\printim" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PSOVER, "\\psover" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PVMRG, "\\pvmrg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PVPARA, "\\pvpara" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PVPG, "\\pvpg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_QC, "\\qc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_QJ, "\\qj" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_QL, "\\ql" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_QR, "\\qr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RDBLQUOTE, "\\rdblquote" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RED, "\\red" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_REVBAR, "\\revbar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_REVISED, "\\revised" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_REVISIONS, "\\revisions" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_REVPROP, "\\revprop" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_REVTIM, "\\revtim" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RI, "\\ri" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RIN, "\\rin" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ROW, "\\row" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RQUOTE, "\\rquote" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RTF, "\\rtf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RXE, "\\rxe" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_S, "\\s" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SA, "\\sa" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SB, "\\sb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SBASEDON, "\\sbasedon" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SBKCOL, "\\sbkcol" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SBKEVEN, "\\sbkeven" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SBKNONE, "\\sbknone" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SBKODD, "\\sbkodd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SBKPAGE, "\\sbkpage" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SBYS, "\\sbys" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SCAPS, "\\scaps" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SECT, "\\sect" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SECTD, "\\sectd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHAD, "\\shad" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHADING, "\\shading" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHIFT, "\\shift" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SL, "\\sl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SNEXT, "\\snext" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_STRIKE, "\\strike" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_STYLESHEET, "\\stylesheet" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SUB, "\\sub" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SUBJECT, "\\subject" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SUPER, "\\super" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TAB, "\\tab" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TB, "\\tb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TC, "\\tc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TCF, "\\tcf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TCL, "\\tcl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TEMPLATE, "\\template" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TITLE, "\\title" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TITLEPG, "\\titlepg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TLDOT, "\\tldot" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TLEQ, "\\tleq" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TLHYPH, "\\tlhyph" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TLTH, "\\tlth" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TLUL, "\\tlul" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TQC, "\\tqc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TQDEC, "\\tqdec" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TQR, "\\tqr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TQL, "\\tql" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRGAPH, "\\trgaph" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRLEFT, "\\trleft" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TROWD, "\\trowd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRQC, "\\trqc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRQL, "\\trql" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRQR, "\\trqr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRRH, "\\trrh" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TX, "\\tx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TXE, "\\txe" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_UL, "\\ul" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULD, "\\uld" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULDB, "\\uldb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULNONE, "\\ulnone" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULW, "\\ulw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_UP, "\\up" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_V, "\\v" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_VERN, "\\vern" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_VERSION, "\\version" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_VERTALB, "\\vertalb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_VERTALC, "\\vertalc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_VERTALJ, "\\vertalj" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_VERTALT, "\\vertalt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WBITMAP, "\\wbitmap" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WBMBITSPIXEL, "\\wbmbitspixel" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WBMPLANES, "\\wbmplanes" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WBMWIDTHBYTES, "\\wbmwidthbytes" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WIDOWCTRL, "\\widowctrl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WMETAFILE, "\\wmetafile" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_XE, "\\xe" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_YR, "\\yr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOBRKHYPH, "\\_" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FORMULA, "\\|" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOBREAK, "\\~" );
-
-
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AB, "\\ab" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ACAPS, "\\acaps" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ACF, "\\acf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ADDITIVE, "\\additive" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ADN, "\\adn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AENDDOC, "\\aenddoc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AENDNOTES, "\\aendnotes" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AEXPND, "\\aexpnd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AF, "\\af" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFS, "\\afs" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNBJ, "\\aftnbj" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNCN, "\\aftncn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNALC, "\\aftnnalc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNAR, "\\aftnnar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNAUC, "\\aftnnauc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNCHI, "\\aftnnchi" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNRLC, "\\aftnnrlc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNRUC, "\\aftnnruc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNRESTART, "\\aftnrestart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNRSTCONT, "\\aftnrstcont" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNSEP, "\\aftnsep" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNSEPC, "\\aftnsepc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNSTART, "\\aftnstart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNTJ, "\\aftntj" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AI, "\\ai" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ALANG, "\\alang" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ALLPROT, "\\allprot" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ANNOTPROT, "\\annotprot" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AOUTL, "\\aoutl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ASCAPS, "\\ascaps" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ASHAD, "\\ashad" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ASTRIKE, "\\astrike" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ATNAUTHOR, "\\atnauthor" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ATNICN, "\\atnicn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ATNREF, "\\atnref" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ATNTIME, "\\atntime" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ATRFEND, "\\atrfend" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ATRFSTART, "\\atrfstart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AUL, "\\aul" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AULD, "\\auld" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AULDB, "\\auldb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AULNONE, "\\aulnone" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AULW, "\\aulw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AUP, "\\aup" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BKMKPUB, "\\bkmkpub" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRDASH, "\\brdrdash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRKFRM, "\\brkfrm" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CCHS, "\\cchs" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CPG, "\\cpg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CS, "\\cs" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CVMME, "\\cvmme" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DATAFIELD, "\\datafield" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DO, "\\do" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DOBXCOLUMN, "\\dobxcolumn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DOBXMARGIN, "\\dobxmargin" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DOBXPAGE, "\\dobxpage" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DOBYMARGIN, "\\dobymargin" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DOBYPAGE, "\\dobypage" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DOBYPARA, "\\dobypara" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DODHGT, "\\dodhgt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DOLOCK, "\\dolock" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPAENDHOL, "\\dpaendhol" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPAENDL, "\\dpaendl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPAENDSOL, "\\dpaendsol" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPAENDW, "\\dpaendw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPARC, "\\dparc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPARCFLIPX, "\\dparcflipx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPARCFLIPY, "\\dparcflipy" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPASTARTHOL, "\\dpastarthol" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPASTARTL, "\\dpastartl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPASTARTSOL, "\\dpastartsol" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPASTARTW, "\\dpastartw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCALLOUT, "\\dpcallout" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOA, "\\dpcoa" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOACCENT, "\\dpcoaccent" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOBESTFIT, "\\dpcobestfit" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOBORDER, "\\dpcoborder" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCODABS, "\\dpcodabs" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCODBOTTOM, "\\dpcodbottom" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCODCENTER, "\\dpcodcenter" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCODTOP, "\\dpcodtop" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOLENGTH, "\\dpcolength" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOMINUSX, "\\dpcominusx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOMINUSY, "\\dpcominusy" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOOFFSET, "\\dpcooffset" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOSMARTA, "\\dpcosmarta" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOTDOUBLE, "\\dpcotdouble" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOTRIGHT, "\\dpcotright" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOTSINGLE, "\\dpcotsingle" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOTTRIPLE, "\\dpcottriple" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOUNT, "\\dpcount" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPELLIPSE, "\\dpellipse" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPENDGROUP, "\\dpendgroup" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLBGCB, "\\dpfillbgcb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLBGCG, "\\dpfillbgcg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLBGCR, "\\dpfillbgcr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLBGGRAY, "\\dpfillbggray" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLBGPAL, "\\dpfillbgpal" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLFGCB, "\\dpfillfgcb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLFGCG, "\\dpfillfgcg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLFGCR, "\\dpfillfgcr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLFGGRAY, "\\dpfillfggray" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLFGPAL, "\\dpfillfgpal" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLPAT, "\\dpfillpat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPGROUP, "\\dpgroup" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINE, "\\dpline" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINECOB, "\\dplinecob" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINECOG, "\\dplinecog" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINECOR, "\\dplinecor" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEDADO, "\\dplinedado" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEDADODO, "\\dplinedadodo" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEDASH, "\\dplinedash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEDOT, "\\dplinedot" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEGRAY, "\\dplinegray" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEHOLLOW, "\\dplinehollow" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEPAL, "\\dplinepal" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINESOLID, "\\dplinesolid" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEW, "\\dplinew" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPPOLYCOUNT, "\\dppolycount" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPPOLYGON, "\\dppolygon" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPPOLYLINE, "\\dppolyline" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPPTX, "\\dpptx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPPTY, "\\dppty" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPRECT, "\\dprect" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPROUNDR, "\\dproundr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPSHADOW, "\\dpshadow" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPSHADX, "\\dpshadx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPSHADY, "\\dpshady" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPTXBX, "\\dptxbx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPTXBXMAR, "\\dptxbxmar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPTXBXTEXT, "\\dptxbxtext" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPX, "\\dpx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPXSIZE, "\\dpxsize" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPY, "\\dpy" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPYSIZE, "\\dpysize" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DS, "\\ds" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_EMSPACE, "\\emspace" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ENSPACE, "\\enspace" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FBIDI, "\\fbidi" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FET, "\\fet" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FID, "\\fid" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FILE, "\\file" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FILETBL, "\\filetbl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLDALT, "\\fldalt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FNETWORK, "\\fnetwork" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FONTEMB, "\\fontemb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FONTFILE, "\\fontfile" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FORMDISP, "\\formdisp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FORMPROT, "\\formprot" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FORMSHADE, "\\formshade" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FOSNUM, "\\fosnum" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FRELATIVE, "\\frelative" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNALT, "\\ftnalt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNIL, "\\ftnil" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNALC, "\\ftnnalc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNAR, "\\ftnnar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNAUC, "\\ftnnauc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNCHI, "\\ftnnchi" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNRLC, "\\ftnnrlc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNRUC, "\\ftnnruc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNRSTCONT, "\\ftnrstcont" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNRSTPG, "\\ftnrstpg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTTRUETYPE, "\\fttruetype" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FVALIDDOS, "\\fvaliddos" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FVALIDHPFS, "\\fvalidhpfs" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FVALIDMAC, "\\fvalidmac" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FVALIDNTFS, "\\fvalidntfs" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HYPHAUTO, "\\hyphauto" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HYPHCAPS, "\\hyphcaps" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HYPHCONSEC, "\\hyphconsec" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HYPHPAR, "\\hyphpar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINKSELF, "\\linkself" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINKSTYLES, "\\linkstyles" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LTRCH, "\\ltrch" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LTRDOC, "\\ltrdoc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LTRMARK, "\\ltrmark" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LTRPAR, "\\ltrpar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LTRROW, "\\ltrrow" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LTRSECT, "\\ltrsect" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOCOLBAL, "\\nocolbal" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOEXTRASPRL, "\\noextrasprl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOTABIND, "\\notabind" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOWIDCTLPAR, "\\nowidctlpar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJALIAS, "\\objalias" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJALIGN, "\\objalign" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJAUTLINK, "\\objautlink" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJCLASS, "\\objclass" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJCROPB, "\\objcropb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJCROPL, "\\objcropl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJCROPR, "\\objcropr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJCROPT, "\\objcropt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJDATA, "\\objdata" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJECT, "\\object" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJEMB, "\\objemb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJH, "\\objh" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJICEMB, "\\objicemb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJLINK, "\\objlink" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJLOCK, "\\objlock" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJNAME, "\\objname" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJPUB, "\\objpub" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJSCALEX, "\\objscalex" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJSCALEY, "\\objscaley" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJSECT, "\\objsect" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJSETSIZE, "\\objsetsize" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJSUB, "\\objsub" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJTIME, "\\objtime" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJTRANSY, "\\objtransy" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJUPDATE, "\\objupdate" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJW, "\\objw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OTBLRUL, "\\otblrul" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNHN, "\\pgnhn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNHNSC, "\\pgnhnsc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNHNSH, "\\pgnhnsh" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNHNSM, "\\pgnhnsm" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNHNSN, "\\pgnhnsn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNHNSP, "\\pgnhnsp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICBMP, "\\picbmp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICBPP, "\\picbpp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PN, "\\pn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNACROSS, "\\pnacross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNB, "\\pnb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNCAPS, "\\pncaps" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNCARD, "\\pncard" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNCF, "\\pncf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNDEC, "\\pndec" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNF, "\\pnf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNFS, "\\pnfs" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNHANG, "\\pnhang" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNI, "\\pni" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNINDENT, "\\pnindent" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNLCLTR, "\\pnlcltr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNLCRM, "\\pnlcrm" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNLVL, "\\pnlvl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNLVLBLT, "\\pnlvlblt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNLVLBODY, "\\pnlvlbody" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNLVLCONT, "\\pnlvlcont" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNNUMONCE, "\\pnnumonce" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNORD, "\\pnord" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNORDT, "\\pnordt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNPREV, "\\pnprev" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNQC, "\\pnqc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNQL, "\\pnql" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNQR, "\\pnqr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNRESTART, "\\pnrestart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNSCAPS, "\\pnscaps" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNSECLVL, "\\pnseclvl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNSP, "\\pnsp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNSTART, "\\pnstart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNSTRIKE, "\\pnstrike" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNTEXT, "\\pntext" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNTXTA, "\\pntxta" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNTXTB, "\\pntxtb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNUCLTR, "\\pnucltr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNUCRM, "\\pnucrm" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNUL, "\\pnul" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNULD, "\\pnuld" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNULDB, "\\pnuldb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNULNONE, "\\pnulnone" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNULW, "\\pnulw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PRCOLBL, "\\prcolbl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PRINTDATA, "\\printdata" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PSZ, "\\psz" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PUBAUTO, "\\pubauto" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RESULT, "\\result" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_REVAUTH, "\\revauth" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_REVDTTM, "\\revdttm" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_REVPROT, "\\revprot" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_REVTBL, "\\revtbl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RSLTBMP, "\\rsltbmp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RSLTMERGE, "\\rsltmerge" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RSLTPICT, "\\rsltpict" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RSLTRTF, "\\rsltrtf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RSLTTXT, "\\rslttxt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RTLCH, "\\rtlch" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RTLDOC, "\\rtldoc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RTLMARK, "\\rtlmark" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RTLPAR, "\\rtlpar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RTLROW, "\\rtlrow" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RTLSECT, "\\rtlsect" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SEC, "\\sec" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SECTNUM, "\\sectnum" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SECTUNLOCKED, "\\sectunlocked" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SLMULT, "\\slmult" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SOFTCOL, "\\softcol" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SOFTLHEIGHT, "\\softlheight" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SOFTLINE, "\\softline" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SOFTPAGE, "\\softpage" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SPRSSPBF, "\\sprsspbf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SPRSTSP, "\\sprstsp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SUBDOCUMENT, "\\subdocument" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SWPBDR, "\\swpbdr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TCN, "\\tcn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRANSMF, "\\transmf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRBRDRB, "\\trbrdrb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRBRDRH, "\\trbrdrh" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRBRDRL, "\\trbrdrl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRBRDRR, "\\trbrdrr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRBRDRT, "\\trbrdrt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRBRDRV, "\\trbrdrv" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRHDR, "\\trhdr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRKEEP, "\\trkeep" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRPADDB, "\\trpaddb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRPADDL, "\\trpaddl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRPADDR, "\\trpaddr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRPADDT, "\\trpaddt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRPADDFB, "\\trpaddfb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRPADDFL, "\\trpaddfl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRPADDFR, "\\trpaddfr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRPADDFT, "\\trpaddft" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WRAPTRSP, "\\wraptrsp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_XEF, "\\xef" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ZWJ, "\\zwj" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ZWNJ, "\\zwnj" );
-
-// neue Tokens zur 1.5
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ABSLOCK, "\\abslock" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ADJUSTRIGHT, "\\adjustright" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNCHOSUNG, "\\aftnnchosung" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNCNUM, "\\aftnncnum" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNDBAR, "\\aftnndbar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNDBNUM, "\\aftnndbnum" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNDBNUMD, "\\aftnndbnumd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNDBNUMK, "\\aftnndbnumk" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNDBNUMT, "\\aftnndbnumt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNGANADA, "\\aftnnganada" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNGBNUM, "\\aftnngbnum" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNGBNUMD, "\\aftnngbnumd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNGBNUMK, "\\aftnngbnumk" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNGBNUML, "\\aftnngbnuml" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNZODIAC, "\\aftnnzodiac" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNZODIACD, "\\aftnnzodiacd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNZODIACL, "\\aftnnzodiacl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ANIMTEXT, "\\animtext" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ANSICPG, "\\ansicpg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BACKGROUND, "\\background" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BDBFHDR, "\\bdbfhdr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BLIPTAG, "\\bliptag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BLIPUID, "\\blipuid" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BLIPUPI, "\\blipupi" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRART, "\\brdrart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRDASHD, "\\brdrdashd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRDASHDD, "\\brdrdashdd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRDASHDOTSTR, "\\brdrdashdotstr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRDASHSM, "\\brdrdashsm" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDREMBOSS, "\\brdremboss" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRENGRAVE, "\\brdrengrave" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRFRAME, "\\brdrframe" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTHTNLG, "\\brdrthtnlg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTHTNMG, "\\brdrthtnmg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTHTNSG, "\\brdrthtnsg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTNTHLG, "\\brdrtnthlg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTNTHMG, "\\brdrtnthmg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTNTHSG, "\\brdrtnthsg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTNTHTNLG, "\\brdrtnthtnlg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTNTHTNMG, "\\brdrtnthtnmg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTNTHTNSG, "\\brdrtnthtnsg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTRIPLE, "\\brdrtriple" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRWAVY, "\\brdrwavy" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRWAVYDB, "\\brdrwavydb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CATEGORY, "\\category" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CGRID, "\\cgrid" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHARSCALEX, "\\charscalex" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGBDIAG, "\\chbgbdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGCROSS, "\\chbgcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGDCROSS, "\\chbgdcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGDKBDIAG, "\\chbgdkbdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGDKCROSS, "\\chbgdkcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGDKDCROSS, "\\chbgdkdcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGDKFDIAG, "\\chbgdkfdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGDKHORIZ, "\\chbgdkhoriz" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGDKVERT, "\\chbgdkvert" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGFDIAG, "\\chbgfdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGHORIZ, "\\chbghoriz" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGVERT, "\\chbgvert" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBRDR, "\\chbrdr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHCBPAT, "\\chcbpat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHCFPAT, "\\chcfpat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHSHDNG, "\\chshdng" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLPADL, "\\clpadl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLPADT, "\\clpadt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLPADB, "\\clpadb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLPADR, "\\clpadr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLPADFL, "\\clpadfl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLPADFT, "\\clpadft" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLPADFB, "\\clpadfb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLPADFR, "\\clpadfr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLTXLRTB, "\\cltxlrtb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLTXTBRL, "\\cltxtbrl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLVERTALB, "\\clvertalb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLVERTALC, "\\clvertalc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLVERTALT, "\\clvertalt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLVMGF, "\\clvmgf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLVMRG, "\\clvmrg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLTXTBRLV, "\\cltxtbrlv" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLTXBTLR, "\\cltxbtlr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLTXLRTBV, "\\cltxlrtbv" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_COMPANY, "\\company" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CRAUTH, "\\crauth" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CRDATE, "\\crdate" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DATE, "\\date" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DEFLANGFE, "\\deflangfe" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DFRAUTH, "\\dfrauth" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DFRDATE, "\\dfrdate" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DFRSTART, "\\dfrstart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DFRSTOP, "\\dfrstop" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DFRXST, "\\dfrxst" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DGMARGIN, "\\dgmargin" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DNTBLNSBDB, "\\dntblnsbdb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DOCTYPE, "\\doctype" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DOCVAR, "\\docvar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCODESCENT, "\\dpcodescent" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_EMBO, "\\embo" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_EMFBLIP, "\\emfblip" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_EXPSHRTN, "\\expshrtn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FAAUTO, "\\faauto" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FBIAS, "\\fbias" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFDEFRES, "\\ffdefres" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFDEFTEXT, "\\ffdeftext" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFENTRYMCR, "\\ffentrymcr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFEXITMCR, "\\ffexitmcr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFFORMAT, "\\ffformat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFHASLISTBOX, "\\ffhaslistbox" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFHELPTEXT, "\\ffhelptext" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFHPS, "\\ffhps" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFL, "\\ffl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFMAXLEN, "\\ffmaxlen" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFNAME, "\\ffname" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFOWNHELP, "\\ffownhelp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFOWNSTAT, "\\ffownstat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFPROT, "\\ffprot" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFRECALC, "\\ffrecalc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFRES, "\\ffres" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFSIZE, "\\ffsize" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFSTATTEXT, "\\ffstattext" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFTYPE, "\\fftype" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFTYPETXT, "\\fftypetxt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLDTYPE, "\\fldtype" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FNAME, "\\fname" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FORMFIELD, "\\formfield" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FROMTEXT, "\\fromtext" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNCHOSUNG, "\\ftnnchosung" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNCNUM, "\\ftnncnum" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNDBAR, "\\ftnndbar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNDBNUM, "\\ftnndbnum" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNDBNUMD, "\\ftnndbnumd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNDBNUMK, "\\ftnndbnumk" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNDBNUMT, "\\ftnndbnumt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNGANADA, "\\ftnnganada" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNGBNUM, "\\ftnngbnum" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNGBNUMD, "\\ftnngbnumd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNGBNUMK, "\\ftnngbnumk" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNGBNUML, "\\ftnngbnuml" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNZODIAC, "\\ftnnzodiac" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNZODIACD, "\\ftnnzodiacd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNZODIACL, "\\ftnnzodiacl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_G, "\\g" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_GCW, "\\gcw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_GRIDTBL, "\\gridtbl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HIGHLIGHT, "\\highlight" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HLFR, "\\hlfr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HLINKBASE, "\\hlinkbase" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HLLOC, "\\hlloc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HLSRC, "\\hlsrc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ILVL, "\\ilvl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_IMPR, "\\impr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_JPEGBLIP, "\\jpegblip" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELFOLLOW, "\\levelfollow" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELINDENT, "\\levelindent" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELJC, "\\leveljc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELLEGAL, "\\levellegal" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELNFC, "\\levelnfc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELNORESTART, "\\levelnorestart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELNUMBERS, "\\levelnumbers" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELOLD, "\\levelold" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELPREV, "\\levelprev" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELPREVSPACE, "\\levelprevspace" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELSPACE, "\\levelspace" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELSTARTAT, "\\levelstartat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELTEXT, "\\leveltext" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINKVAL, "\\linkval" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LIST, "\\list" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTID, "\\listid" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTLEVEL, "\\listlevel" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTNAME, "\\listname" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTOVERRIDE, "\\listoverride" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTOVERRIDECOUNT, "\\listoverridecount" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTOVERRIDEFORMAT, "\\listoverrideformat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTOVERRIDESTART, "\\listoverridestart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTOVERRIDETABLE, "\\listoverridetable" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTRESTARTHDN, "\\listrestarthdn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTSIMPLE, "\\listsimple" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTTABLE, "\\listtable" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTTEMPLATEID, "\\listtemplateid" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTTEXT, "\\listtext" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LS, "\\ls" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LYTEXCTTP, "\\lytexcttp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LYTPRTMET, "\\lytprtmet" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MANAGER, "\\manager" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MSMCAP, "\\msmcap" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOFCHARSWS, "\\nofcharsws" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOLEAD, "\\nolead" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NONSHPPICT, "\\nonshppict" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOSECTEXPAND, "\\nosectexpand" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOSNAPLINEGRID, "\\nosnaplinegrid" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOSPACEFORUL, "\\nospaceforul" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOULTRLSPC, "\\noultrlspc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOXLATTOYEN, "\\noxlattoyen" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJATTPH, "\\objattph" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJHTML, "\\objhtml" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJOCX, "\\objocx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLDLINEWRAP, "\\oldlinewrap" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OUTLINELEVEL, "\\outlinelevel" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OVERLAY, "\\overlay" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PANOSE, "\\panose" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDRB, "\\pgbrdrb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDRFOOT, "\\pgbrdrfoot" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDRHEAD, "\\pgbrdrhead" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDRL, "\\pgbrdrl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDROPT, "\\pgbrdropt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDRR, "\\pgbrdrr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDRSNAP, "\\pgbrdrsnap" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDRT, "\\pgbrdrt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNCHOSUNG, "\\pgnchosung" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNCNUM, "\\pgncnum" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNDBNUMK, "\\pgndbnumk" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNDBNUMT, "\\pgndbnumt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNGANADA, "\\pgnganada" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNGBNUM, "\\pgngbnum" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNGBNUMD, "\\pgngbnumd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNGBNUMK, "\\pgngbnumk" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNGBNUML, "\\pgngbnuml" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNZODIAC, "\\pgnzodiac" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNZODIACD, "\\pgnzodiacd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNZODIACL, "\\pgnzodiacl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICPROP, "\\picprop" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNAIUEO, "\\pnaiueo" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNAIUEOD, "\\pnaiueod" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNCHOSUNG, "\\pnchosung" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNDBNUMD, "\\pndbnumd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNDBNUMK, "\\pndbnumk" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNDBNUML, "\\pndbnuml" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNDBNUMT, "\\pndbnumt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNGANADA, "\\pnganada" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNGBLIP, "\\pngblip" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNGBNUM, "\\pngbnum" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNGBNUMD, "\\pngbnumd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNGBNUMK, "\\pngbnumk" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNGBNUML, "\\pngbnuml" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNRAUTH, "\\pnrauth" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNRDATE, "\\pnrdate" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNRNFC, "\\pnrnfc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNRNOT, "\\pnrnot" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNRPNBR, "\\pnrpnbr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNRRGB, "\\pnrrgb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNRSTART, "\\pnrstart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNRSTOP, "\\pnrstop" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNRXST, "\\pnrxst" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNZODIAC, "\\pnzodiac" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNZODIACD, "\\pnzodiacd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNZODIACL, "\\pnzodiacl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LFOLEVEL, "\\lfolevel" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSYIN, "\\posyin" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSYOUT, "\\posyout" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PRIVATE, "\\private" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PROPNAME, "\\propname" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PROPTYPE, "\\proptype" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_REVAUTHDEL, "\\revauthdel" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_REVDTTMDEL, "\\revdttmdel" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SAUTOUPD, "\\sautoupd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SECTDEFAULTCL, "\\sectdefaultcl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SECTEXPAND, "\\sectexpand" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SECTLINEGRID, "\\sectlinegrid" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SECTSPECIFYCL, "\\sectspecifycl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SECTSPECIFYL, "\\sectspecifyl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHIDDEN, "\\shidden" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPBOTTOM, "\\shpbottom" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPBXCOLUMN, "\\shpbxcolumn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPBXMARGIN, "\\shpbxmargin" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPBXPAGE, "\\shpbxpage" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPBYMARGIN, "\\shpbymargin" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPBYPAGE, "\\shpbypage" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPBYPARA, "\\shpbypara" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPFBLWTXT, "\\shpfblwtxt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPFHDR, "\\shpfhdr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPGRP, "\\shpgrp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPLEFT, "\\shpleft" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPLID, "\\shplid" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPLOCKANCHOR, "\\shplockanchor" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPPICT, "\\shppict" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPRIGHT, "\\shpright" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPRSLT, "\\shprslt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPTOP, "\\shptop" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPTXT, "\\shptxt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPWRK, "\\shpwrk" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPWR, "\\shpwr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPZ, "\\shpz" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SPRSBSP, "\\sprsbsp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SPRSLNSP, "\\sprslnsp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SPRSTSM, "\\sprstsm" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_STATICVAL, "\\staticval" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_STEXTFLOW, "\\stextflow" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_STRIKED, "\\striked" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SUBFONTBYSIZE, "\\subfontbysize" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TCELLD, "\\tcelld" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TIME, "\\time" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRUNCATEFONTHEIGHT, "\\truncatefontheight" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_UC, "\\uc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_UD, "\\ud" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULDASH, "\\uldash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULDASHD, "\\uldashd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULDASHDD, "\\uldashdd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULTH, "\\ulth" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULWAVE, "\\ulwave" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULC, "\\ulc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_U, "\\u" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_UPR, "\\upr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_USERPROPS, "\\userprops" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_VIEWKIND, "\\viewkind" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_VIEWSCALE, "\\viewscale" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_VIEWZK, "\\viewzk" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WIDCTLPAR, "\\widctlpar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WINDOWCAPTION, "\\windowcaption" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WPEQN, "\\wpeqn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WPJST, "\\wpjst" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WPSP, "\\wpsp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_YXE, "\\yxe" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FRMTXLRTB, "\\frmtxlrtb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FRMTXTBRL, "\\frmtxtbrl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FRMTXBTLR, "\\frmtxbtlr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FRMTXLRTBV, "\\frmtxlrtbv" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FRMTXTBRLV, "\\frmtxtbrlv" );
-
-// MS-2000 Tokens
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULTHD, "\\ulthd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULTHDASH, "\\ulthdash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULLDASH, "\\ulldash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULTHLDASH, "\\ulthldash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULTHDASHD, "\\ulthdashd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULTHDASHDD, "\\ulthdashdd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULHWAVE, "\\ulhwave" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULULDBWAVE, "\\ululdbwave" );
-
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LOCH, "\\loch" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HICH, "\\hich" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DBCH, "\\dbch" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LANGFE, "\\langfe" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ADEFLANG, "\\adeflang" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ADEFF, "\\adeff" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ACCNONE, "\\accnone" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ACCDOT, "\\accdot" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ACCCOMMA, "\\acccomma" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TWOINONE, "\\twoinone" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HORZVERT, "\\horzvert" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FAHANG, "\\fahang" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FAVAR, "\\favar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FACENTER, "\\facenter" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FAROMAN, "\\faroman" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FAFIXED, "\\fafixed" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOCWRAP, "\\nocwrap" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOOVERFLOW,"\\nooverflow" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ASPALPHA, "\\aspalpha" );
-
-// SWG spezifische Attribute
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_GRFALIGNV, "\\grfalignv" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_GRFALIGNH, "\\grfalignh" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_GRFMIRROR, "\\grfmirror" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HEADERYB, "\\headeryb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HEADERXL, "\\headerxl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HEADERXR, "\\headerxr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERYT, "\\footeryt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERXL, "\\footerxl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERXR, "\\footerxr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HEADERYH, "\\headeryh" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERYH, "\\footeryh" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BALANCEDCOLUMN, "\\swcolmnblnc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_UPDNPROP, "\\updnprop" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PRTDATA, "\\prtdata" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BKMKKEY, "\\bkmkkey" );
-
-// Attribute fuer die freifliegenden Rahmen
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLYPRINT, "\\flyprint" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLYOPAQUE, "\\flyopaque" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLYPRTCTD, "\\flyprtctd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLYMAINCNT, "\\flymaincnt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLYVERT, "\\flyvert" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLYHORZ, "\\flyhorz" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DFRMTXTL, "\\dfrmtxtl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DFRMTXTR, "\\dfrmtxtr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DFRMTXTU, "\\dfrmtxtu" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DFRMTXTW, "\\dfrmtxtw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLYANCHOR, "\\flyanchor" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLYCNTNT, "\\flycntnt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLYCOLUMN, "\\flycolumn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLYPAGE, "\\flypage" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLYINPARA, "\\flyinpara" );
-
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDBOX, "\\brdbox" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDLNCOL, "\\brdlncol" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDLNIN, "\\brdlnin" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDLNOUT, "\\brdlnout" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDLNDIST, "\\brdlndist" );
-
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHADOW, "\\shadow" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHDWDIST, "\\shdwdist" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHDWSTYLE, "\\shdwstyle" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHDWCOL, "\\shdwcol" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHDWFCOL, "\\shdwfcol" );
-
-
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGDSCTBL, "\\pgdsctbl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGDSC, "\\pgdsc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGDSCUSE, "\\pgdscuse" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGDSCNXT, "\\pgdscnxt" );
-
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HYPHEN, "\\hyphen" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HYPHLEAD, "\\hyphlead" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HYPHTRAIL, "\\hyphtrail" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HYPHMAX, "\\hyphmax" );
-
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TLSWG, "\\tlswg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGBRK, "\\pgbrk" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGDSCNO, "\\pgdscno" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SOUTLVL, "\\soutlvl" );
-
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHP, "\\shp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SN, "\\sn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SV, "\\sv" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SP, "\\sp" );
-/*
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPLEFT, "\\shpleft" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPTOP, "\\shptop" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPBOTTOM, "\\shpbottom" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPRIGHT, "\\shpright" );
-*/
-
-// Support for overline attributes
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OL, "\\ol" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLD, "\\old" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLDB, "\\oldb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLNONE, "\\olnone" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLW, "\\olw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLDASH, "\\oldash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLDASHD, "\\oldashd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLDASHDD, "\\oldashdd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLTH, "\\olth" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLWAVE, "\\olwave" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLC, "\\olc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLTHD, "\\olthd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLTHDASH, "\\olthdash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLLDASH, "\\olldash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLTHLDASH, "\\olthldash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLTHDASHD, "\\olthdashd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLTHDASHDD, "\\olthdashdd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLHWAVE, "\\olhwave" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLOLDBWAVE, "\\ololdbwave" );
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/svrtf/rtfkeywd.cxx b/svtools/source/svrtf/rtfkeywd.cxx
index dc189d2f9f38..db41d05bfa28 100644
--- a/svtools/source/svrtf/rtfkeywd.cxx
+++ b/svtools/source/svrtf/rtfkeywd.cxx
@@ -29,8 +29,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "rtfkeywd.hxx"
-#include "rtftoken.h"
+#include <svtools/rtfkeywd.hxx>
+#include <svtools/rtftoken.h>
#include "tools/string.hxx"
#include <string.h>
@@ -48,7 +48,7 @@ struct RTF_TokenEntry
};
// Flag: RTF-Token Tabelle wurde schon sortiert
-static int bSortKeyWords = FALSE;
+static int bSortKeyWords = sal_False;
static RTF_TokenEntry aRTFTokenTab[] = {
{{OOO_STRING_SVTOOLS_RTF_IGNORE}, RTF_IGNOREFLAG},
@@ -1227,7 +1227,7 @@ int GetRTFToken( const String& rSearch )
sizeof( aRTFTokenTab ) / sizeof( RTF_TokenEntry ),
sizeof( RTF_TokenEntry ),
RTFKeyCompare );
- bSortKeyWords = TRUE;
+ bSortKeyWords = sal_True;
}
int nRet = 0;
diff --git a/svtools/source/svrtf/rtfout.cxx b/svtools/source/svrtf/rtfout.cxx
index e9cca4d402fa..21368c0b14d3 100644
--- a/svtools/source/svrtf/rtfout.cxx
+++ b/svtools/source/svrtf/rtfout.cxx
@@ -33,8 +33,8 @@
#include <tools/string.hxx>
#include <rtl/string.hxx>
#include <rtl/ustrbuf.hxx>
-#include <rtfkeywd.hxx>
-#include <rtfout.hxx>
+#include <svtools/rtfkeywd.hxx>
+#include <svtools/rtfout.hxx>
using ::rtl::OUString;
using ::rtl::OString;
@@ -47,7 +47,7 @@ const sal_Char RTFOutFuncs::sNewLine[] = "\015\012";
SvStream& RTFOutFuncs::Out_Char(SvStream& rStream, sal_Unicode c,
- int *pUCMode, rtl_TextEncoding eDestEnc, BOOL bWriteHelpFile)
+ int *pUCMode, rtl_TextEncoding eDestEnc, sal_Bool bWriteHelpFile)
{
const sal_Char* pStr = 0;
switch (c)
@@ -166,7 +166,7 @@ SvStream& RTFOutFuncs::Out_Char(SvStream& rStream, sal_Unicode c,
}
SvStream& RTFOutFuncs::Out_String( SvStream& rStream, const String& rStr,
- rtl_TextEncoding eDestEnc, BOOL bWriteHelpFile)
+ rtl_TextEncoding eDestEnc, sal_Bool bWriteHelpFile)
{
int nUCMode = 1;
for (xub_StrLen n = 0; n < rStr.Len(); ++n)
@@ -177,7 +177,7 @@ SvStream& RTFOutFuncs::Out_String( SvStream& rStream, const String& rStr,
}
SvStream& RTFOutFuncs::Out_Fontname(SvStream& rStream, const String& rStr,
- rtl_TextEncoding eDestEnc, BOOL bWriteHelpFile)
+ rtl_TextEncoding eDestEnc, sal_Bool bWriteHelpFile)
{
//Fontnames in word have a quirk in that \uc and usage of ansi replacement
//chars after a \u don't work and in wordpad \u doesn't work, so we are
@@ -187,7 +187,7 @@ SvStream& RTFOutFuncs::Out_Fontname(SvStream& rStream, const String& rStr,
return rStream;
}
-SvStream& RTFOutFuncs::Out_Hex( SvStream& rStream, ULONG nHex, BYTE nLen )
+SvStream& RTFOutFuncs::Out_Hex( SvStream& rStream, sal_uLong nHex, sal_uInt8 nLen )
{
sal_Char aNToABuf[] = "0000000000000000";
@@ -197,7 +197,7 @@ SvStream& RTFOutFuncs::Out_Hex( SvStream& rStream, ULONG nHex, BYTE nLen )
// Pointer an das Bufferende setzen
sal_Char* pStr = aNToABuf + (sizeof(aNToABuf)-1);
- for( BYTE n = 0; n < nLen; ++n )
+ for( sal_uInt8 n = 0; n < nLen; ++n )
{
*(--pStr) = (sal_Char)(nHex & 0xf ) + 48;
if( *pStr > '9' )
diff --git a/svtools/source/svrtf/svparser.cxx b/svtools/source/svrtf/svparser.cxx
index 227de97e3cb1..11ecfe25bcef 100644
--- a/svtools/source/svrtf/svparser.cxx
+++ b/svtools/source/svrtf/svparser.cxx
@@ -50,11 +50,11 @@
struct SvParser_Impl
{
String aToken; // gescanntes Token
- ULONG nFilePos; // akt. Position im Stream
- ULONG nlLineNr; // akt. Zeilen Nummer
- ULONG nlLinePos; // akt. Spalten Nummer
+ sal_uLong nFilePos; // akt. Position im Stream
+ sal_uLong nlLineNr; // akt. Zeilen Nummer
+ sal_uLong nlLinePos; // akt. Spalten Nummer
long nTokenValue; // zusaetzlicher Wert (RTF)
- BOOL bTokenHasValue; // indicates whether nTokenValue is valid
+ sal_Bool bTokenHasValue; // indicates whether nTokenValue is valid
int nToken; // akt. Token
sal_Unicode nNextCh; // akt. Zeichen
@@ -77,7 +77,7 @@ struct SvParser_Impl
// Konstruktor
-SvParser::SvParser( SvStream& rIn, BYTE nStackSize )
+SvParser::SvParser( SvStream& rIn, sal_uInt8 nStackSize )
: rInput( rIn )
, nlLineNr( 1 )
, nlLinePos( 1 )
@@ -86,11 +86,11 @@ SvParser::SvParser( SvStream& rIn, BYTE nStackSize )
, bTokenHasValue( false )
, eState( SVPAR_NOTSTARTED )
, eSrcEnc( RTL_TEXTENCODING_DONTKNOW )
- , bDownloadingFile( FALSE )
+ , bDownloadingFile( sal_False )
, nTokenStackSize( nStackSize )
, nTokenStackPos( 0 )
{
- bUCS2BSrcEnc = bSwitchToUCS2 = FALSE;
+ bUCS2BSrcEnc = bSwitchToUCS2 = sal_False;
eState = SVPAR_NOTSTARTED;
if( nTokenStackSize < 3 )
nTokenStackSize = 3;
@@ -191,11 +191,11 @@ sal_Unicode SvParser::GetNextChar()
// When reading muliple bytes, we don't have to care about the file
// position when we run inti the pending state. The file position is
// maintained by SaveState/RestoreState.
- BOOL bErr;
+ sal_Bool bErr;
if( bSwitchToUCS2 && 0 == rInput.Tell() )
{
sal_uChar c1, c2;
- BOOL bSeekBack = TRUE;
+ sal_Bool bSeekBack = sal_True;
rInput >> c1;
bErr = rInput.IsEof() || rInput.GetError();
@@ -210,14 +210,14 @@ sal_Unicode SvParser::GetNextChar()
if( 0xfe == c1 && 0xff == c2 )
{
eSrcEnc = RTL_TEXTENCODING_UCS2;
- bUCS2BSrcEnc = TRUE;
- bSeekBack = FALSE;
+ bUCS2BSrcEnc = sal_True;
+ bSeekBack = sal_False;
}
else if( 0xff == c1 && 0xfe == c2 )
{
eSrcEnc = RTL_TEXTENCODING_UCS2;
- bUCS2BSrcEnc = FALSE;
- bSeekBack = FALSE;
+ bUCS2BSrcEnc = sal_False;
+ bSeekBack = sal_False;
}
}
}
@@ -225,7 +225,7 @@ sal_Unicode SvParser::GetNextChar()
if( bSeekBack )
rInput.Seek( 0 );
- bSwitchToUCS2 = FALSE;
+ bSwitchToUCS2 = sal_False;
}
nNextChPos = rInput.Tell();
@@ -480,7 +480,7 @@ int SvParser::SkipToken( short nCnt ) // n Tokens zurueck "skippen"
nTmp = 0;
else if( nTmp > nTokenStackSize )
nTmp = nTokenStackSize;
- nTokenStackPos = BYTE(nTmp);
+ nTokenStackPos = sal_uInt8(nTmp);
// und die Werte zurueck
aToken = pTokenStackPos->sToken;
@@ -492,15 +492,15 @@ int SvParser::SkipToken( short nCnt ) // n Tokens zurueck "skippen"
SvParser::TokenStackType* SvParser::GetStackPtr( short nCnt )
{
- BYTE nAktPos = BYTE(pTokenStackPos - pTokenStack );
+ sal_uInt8 nAktPos = sal_uInt8(pTokenStackPos - pTokenStack );
if( nCnt > 0 )
{
if( nCnt >= nTokenStackSize )
nCnt = (nTokenStackSize-1);
if( nAktPos + nCnt < nTokenStackSize )
- nAktPos = sal::static_int_cast< BYTE >(nAktPos + nCnt);
+ nAktPos = sal::static_int_cast< sal_uInt8 >(nAktPos + nCnt);
else
- nAktPos = sal::static_int_cast< BYTE >(
+ nAktPos = sal::static_int_cast< sal_uInt8 >(
nAktPos + (nCnt - nTokenStackSize));
}
else if( nCnt < 0 )
@@ -508,9 +508,9 @@ SvParser::TokenStackType* SvParser::GetStackPtr( short nCnt )
if( -nCnt >= nTokenStackSize )
nCnt = -nTokenStackSize+1;
if( -nCnt <= nAktPos )
- nAktPos = sal::static_int_cast< BYTE >(nAktPos + nCnt);
+ nAktPos = sal::static_int_cast< sal_uInt8 >(nAktPos + nCnt);
else
- nAktPos = sal::static_int_cast< BYTE >(
+ nAktPos = sal::static_int_cast< sal_uInt8 >(
nAktPos + (nCnt + nTokenStackSize));
}
return pTokenStack + nAktPos;
@@ -574,32 +574,32 @@ void SvParser::Continue( int )
}
void SvParser::BuildWhichTbl( SvUShorts &rWhichMap,
- USHORT *pWhichIds,
- USHORT nWhichIds )
+ sal_uInt16 *pWhichIds,
+ sal_uInt16 nWhichIds )
{
- USHORT aNewRange[2];
+ sal_uInt16 aNewRange[2];
- for( USHORT nCnt = 0; nCnt < nWhichIds; ++nCnt, ++pWhichIds )
+ for( sal_uInt16 nCnt = 0; nCnt < nWhichIds; ++nCnt, ++pWhichIds )
if( *pWhichIds )
{
aNewRange[0] = aNewRange[1] = *pWhichIds;
- BOOL bIns = TRUE;
+ sal_Bool bIns = sal_True;
// Position suchen
- for ( USHORT nOfs = 0; rWhichMap[nOfs]; nOfs += 2 )
+ for ( sal_uInt16 nOfs = 0; rWhichMap[nOfs]; nOfs += 2 )
{
if( *pWhichIds < rWhichMap[nOfs] - 1 )
{
// neuen Range davor
rWhichMap.Insert( aNewRange, 2, nOfs );
- bIns = FALSE;
+ bIns = sal_False;
break;
}
else if( *pWhichIds == rWhichMap[nOfs] - 1 )
{
// diesen Range nach unten erweitern
rWhichMap[nOfs] = *pWhichIds;
- bIns = FALSE;
+ bIns = sal_False;
break;
}
else if( *pWhichIds == rWhichMap[nOfs+1] + 1 )
@@ -613,7 +613,7 @@ void SvParser::BuildWhichTbl( SvUShorts &rWhichMap,
else
// diesen Range nach oben erweitern
rWhichMap[nOfs+1] = *pWhichIds;
- bIns = FALSE;
+ bIns = sal_False;
break;
}
}
@@ -691,7 +691,7 @@ SvKeyValueIterator::~SvKeyValueIterator (void)
/*
* GetFirst.
*/
-BOOL SvKeyValueIterator::GetFirst (SvKeyValue &rKeyVal)
+sal_Bool SvKeyValueIterator::GetFirst (SvKeyValue &rKeyVal)
{
m_nPos = m_pList->Count();
return GetNext (rKeyVal);
@@ -700,17 +700,17 @@ BOOL SvKeyValueIterator::GetFirst (SvKeyValue &rKeyVal)
/*
* GetNext.
*/
-BOOL SvKeyValueIterator::GetNext (SvKeyValue &rKeyVal)
+sal_Bool SvKeyValueIterator::GetNext (SvKeyValue &rKeyVal)
{
if (m_nPos > 0)
{
rKeyVal = *m_pList->GetObject(--m_nPos);
- return TRUE;
+ return sal_True;
}
else
{
// Nothing to do.
- return FALSE;
+ return sal_False;
}
}
diff --git a/svtools/source/table/cellvalueconversion.cxx b/svtools/source/table/cellvalueconversion.cxx
new file mode 100755
index 000000000000..286ca505bb30
--- /dev/null
+++ b/svtools/source/table/cellvalueconversion.cxx
@@ -0,0 +1,77 @@
+/*************************************************************************
+ * 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.
+ *
+ ************************************************************************/
+
+#include "precompiled_svtools.hxx"
+
+#include "cellvalueconversion.hxx"
+
+/** === begin UNO includes === **/
+/** === end UNO includes === **/
+
+//......................................................................................................................
+namespace svt
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Any;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= CellValueConversion
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString CellValueConversion::convertToString( const Any& i_value )
+ {
+ ::rtl::OUString sConvertString;
+ if ( !i_value.hasValue() )
+ return sConvertString;
+
+
+ // TODO: use css.script.XTypeConverter?
+
+ sal_Int32 nInt = 0;
+ sal_Bool bBool = false;
+ double fDouble = 0;
+
+ ::rtl::OUString sStringValue;
+ if ( i_value >>= sConvertString )
+ sStringValue = sConvertString;
+ else if ( i_value >>= nInt )
+ sStringValue = sConvertString.valueOf( nInt );
+ else if ( i_value >>= bBool )
+ sStringValue = sConvertString.valueOf( bBool );
+ else if ( i_value >>= fDouble )
+ sStringValue = sConvertString.valueOf( fDouble );
+ else
+ OSL_ENSURE( !i_value.hasValue(), "CellValueConversion::convertToString: cannot handle the given cell content type!" );
+
+ return sStringValue;
+ }
+
+//......................................................................................................................
+} // namespace svt
+//......................................................................................................................
diff --git a/svtools/source/inc/accessibletableimp.hxx b/svtools/source/table/cellvalueconversion.hxx
index ffeba9b1deef..4d6b8c8d6aac 100644..100755
--- a/svtools/source/inc/accessibletableimp.hxx
+++ b/svtools/source/table/cellvalueconversion.hxx
@@ -1,4 +1,3 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,43 +22,31 @@
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
-************************************************************************/
+ ************************************************************************/
-#ifndef SVTOOLS_SOURCE_INC_ACCESSIBLETABLEIMP_HXX
-#define SVTOOLS_SOURCE_INC_ACCESSIBLETABLEIMP_HXX
+#ifndef SVTOOLS_CELLVALUECONVERSION_HXX
+#define SVTOOLS_CELLVALUECONVERSION_HXX
-#include "svtaccessiblefactory.hxx"
+/** === begin UNO includes === **/
+#include <com/sun/star/uno/Any.hxx>
+/** === end UNO includes === **/
-namespace svt { namespace table
+//......................................................................................................................
+namespace svt
{
-//........................................................................
+//......................................................................................................................
-
- class AccessibleTableControl_Impl
+ //==================================================================================================================
+ //= CellValueConversion
+ //==================================================================================================================
+ class CellValueConversion
{
- public:
- AccessibleFactoryAccess m_aFactoryAccess;
- IAccessibleTableControl* m_pAccessible;
-
- public:
- AccessibleTableControl_Impl() : m_pAccessible(NULL)
- {
- }
-
-
- /// @see AccessibleTableControl::getTableRowHeader
- ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
- getAccessibleTableHeader( AccessibleTableControlObjType _eObjType );
- /// @see AccessibleTableControl::getTable
- ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
- getAccessibleTable( );
-
+ public:
+ static ::rtl::OUString convertToString( const ::com::sun::star::uno::Any& i_cellValue );
};
-//........................................................................
-} } // namespace svt::table
-//........................................................................
-
-#endif // SVTOOLS_SOURCE_INC_ACCESSIBLETABLEIMP_HXX
+//......................................................................................................................
+} // namespace svt
+//......................................................................................................................
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+#endif // SVTOOLS_CELLVALUECONVERSION_HXX
diff --git a/svtools/source/table/defaultinputhandler.cxx b/svtools/source/table/defaultinputhandler.cxx
index b0c4a8c1bf9b..d0ecdb546837 100644
--- a/svtools/source/table/defaultinputhandler.cxx
+++ b/svtools/source/table/defaultinputhandler.cxx
@@ -29,121 +29,133 @@
#include "precompiled_svtools.hxx"
#include "svtools/table/defaultinputhandler.hxx"
-#include "svtools/table/abstracttablecontrol.hxx"
+#include "svtools/table/tablecontrolinterface.hxx"
+
+#include "tabledatawindow.hxx"
+#include "mousefunction.hxx"
#include <tools/debug.hxx>
#include <vcl/event.hxx>
#include <vcl/cursor.hxx>
-#include "svtools/table/tabledatawindow.hxx"
-//........................................................................
+//......................................................................................................................
namespace svt { namespace table
{
-//.......................................................................
+//......................................................................................................................
+ typedef ::rtl::Reference< IMouseFunction > PMouseFunction;
+ typedef ::std::vector< PMouseFunction > MouseFunctions;
struct DefaultInputHandler_Impl
{
+ PMouseFunction pActiveFunction;
+ MouseFunctions aMouseFunctions;
};
- //====================================================================
+ //==================================================================================================================
//= DefaultInputHandler
- //====================================================================
- //--------------------------------------------------------------------
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
DefaultInputHandler::DefaultInputHandler()
:m_pImpl( new DefaultInputHandler_Impl )
- ,m_bResize(false)
{
+ m_pImpl->aMouseFunctions.push_back( new ColumnResize );
+ m_pImpl->aMouseFunctions.push_back( new RowSelection );
+ m_pImpl->aMouseFunctions.push_back( new ColumnSortHandler );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
DefaultInputHandler::~DefaultInputHandler()
{
- DELETEZ( m_pImpl );
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::MouseMove( IAbstractTableControl& _rControl, const MouseEvent& _rMEvt )
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
{
- Point aPoint = _rMEvt.GetPosPixel();
- if(m_bResize)
+ bool lcl_delegateMouseEvent( DefaultInputHandler_Impl& i_impl, ITableControl& i_control, const MouseEvent& i_event,
+ FunctionResult ( IMouseFunction::*i_handlerMethod )( ITableControl&, const MouseEvent& ) )
{
- _rControl.resizeColumn(aPoint);
- return true;
- }
- return false;
- }
-
- //--------------------------------------------------------------------
- bool DefaultInputHandler::MouseButtonDown( IAbstractTableControl& _rControl, const MouseEvent& _rMEvt )
- {
- bool bHandled = false;
- Point aPoint = _rMEvt.GetPosPixel();
- RowPos nRow = _rControl.getCurrentRow(aPoint);
- if(nRow == -1)
- {
- m_bResize = _rControl.startResizeColumn(aPoint);
- bHandled = true;
- }
- else if(nRow >= 0)
- {
- if(_rControl.getSelEngine()->GetSelectionMode() == NO_SELECTION)
+ if ( i_impl.pActiveFunction.is() )
{
- _rControl.setCursorAtCurrentCell(aPoint);
- bHandled = true;
+ bool furtherHandler = false;
+ switch ( (i_impl.pActiveFunction.get()->*i_handlerMethod)( i_control, i_event ) )
+ {
+ case ActivateFunction:
+ OSL_ENSURE( false, "lcl_delegateMouseEvent: unexpected - function already *is* active!" );
+ break;
+ case ContinueFunction:
+ break;
+ case DeactivateFunction:
+ i_impl.pActiveFunction.clear();
+ break;
+ case SkipFunction:
+ furtherHandler = true;
+ break;
+ }
+ if ( !furtherHandler )
+ // handled the event
+ return true;
}
- else
+
+ // ask all other handlers
+ bool handled = false;
+ for ( MouseFunctions::iterator handler = i_impl.aMouseFunctions.begin();
+ ( handler != i_impl.aMouseFunctions.end() ) && !handled;
+ ++handler
+ )
{
- if(!_rControl.isRowSelected(nRow))
- bHandled = _rControl.getSelEngine()->SelMouseButtonDown(_rMEvt);
- else
- bHandled = true;
+ if ( *handler == i_impl.pActiveFunction )
+ // we already invoked this function
+ continue;
+
+ switch ( (handler->get()->*i_handlerMethod)( i_control, i_event ) )
+ {
+ case ActivateFunction:
+ i_impl.pActiveFunction = *handler;
+ handled = true;
+ break;
+ case ContinueFunction:
+ case DeactivateFunction:
+ OSL_ENSURE( false, "lcl_delegateMouseEvent: unexpected: inactivate handler cannot be continued or deactivated!" );
+ break;
+ case SkipFunction:
+ handled = false;
+ break;
+ }
}
+ return handled;
}
- return bHandled;
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::MouseButtonUp( IAbstractTableControl& _rControl, const MouseEvent& _rMEvt )
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::MouseMove( ITableControl& i_tableControl, const MouseEvent& i_event )
{
- bool bHandled = false;
- Point aPoint = _rMEvt.GetPosPixel();
- if(_rControl.getCurrentRow(aPoint) >= 0)
- {
- if(m_bResize)
- {
- m_bResize = _rControl.endResizeColumn(aPoint);
- bHandled = true;
- }
- else if(_rControl.getSelEngine()->GetSelectionMode() == NO_SELECTION)
- {
- bHandled = true;
- }
- else
- {
- bHandled = _rControl.getSelEngine()->SelMouseButtonUp(_rMEvt);
- }
- }
- else
- {
- if(m_bResize)
- {
- m_bResize = _rControl.endResizeColumn(aPoint);
- bHandled = true;
- }
- }
- return bHandled;
+ return lcl_delegateMouseEvent( *m_pImpl, i_tableControl, i_event, &IMouseFunction::handleMouseMove );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::MouseButtonDown( ITableControl& i_tableControl, const MouseEvent& i_event )
+ {
+ return lcl_delegateMouseEvent( *m_pImpl, i_tableControl, i_event, &IMouseFunction::handleMouseDown );
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::KeyInput( IAbstractTableControl& _rControl, const KeyEvent& rKEvt )
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::MouseButtonUp( ITableControl& i_tableControl, const MouseEvent& i_event )
+ {
+ return lcl_delegateMouseEvent( *m_pImpl, i_tableControl, i_event, &IMouseFunction::handleMouseUp );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::KeyInput( ITableControl& _rControl, const KeyEvent& rKEvt )
{
bool bHandled = false;
const KeyCode& rKeyCode = rKEvt.GetKeyCode();
- USHORT nKeyCode = rKeyCode.GetCode();
+ sal_uInt16 nKeyCode = rKeyCode.GetCode();
struct _ActionMapEntry
{
- USHORT nKeyCode;
- USHORT nKeyModifier;
+ sal_uInt16 nKeyCode;
+ sal_uInt16 nKeyModifier;
TableControlAction eAction;
}
static aKnownActions[] = {
@@ -159,11 +171,11 @@ namespace svt { namespace table
{ KEY_PAGEDOWN, KEY_MOD1, cursorToLastLine },
{ KEY_HOME, KEY_MOD1, cursorTopLeft },
{ KEY_END, KEY_MOD1, cursorBottomRight },
- { KEY_SPACE, KEY_MOD1, cursorSelectRow },
- { KEY_UP, KEY_SHIFT, cursorSelectRowUp },
- { KEY_DOWN, KEY_SHIFT, cursorSelectRowDown },
- { KEY_END, KEY_SHIFT, cursorSelectRowAreaBottom },
- { KEY_HOME, KEY_SHIFT, cursorSelectRowAreaTop },
+ { KEY_SPACE, KEY_MOD1, cursorSelectRow },
+ { KEY_UP, KEY_SHIFT, cursorSelectRowUp },
+ { KEY_DOWN, KEY_SHIFT, cursorSelectRowDown },
+ { KEY_END, KEY_SHIFT, cursorSelectRowAreaBottom },
+ { KEY_HOME, KEY_SHIFT, cursorSelectRowAreaTop },
{ 0, 0, invalidTableControlAction }
};
@@ -174,7 +186,6 @@ namespace svt { namespace table
if ( ( pActions->nKeyCode == nKeyCode ) && ( pActions->nKeyModifier == rKeyCode.GetAllModifier() ) )
{
bHandled = _rControl.dispatchAction( pActions->eAction );
- bHandled = true; // always handled issue #i114340
break;
}
}
@@ -182,22 +193,22 @@ namespace svt { namespace table
return bHandled;
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::GetFocus( IAbstractTableControl& _rControl )
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::GetFocus( ITableControl& _rControl )
{
_rControl.showCursor();
return false; // continue processing
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::LoseFocus( IAbstractTableControl& _rControl )
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::LoseFocus( ITableControl& _rControl )
{
_rControl.hideCursor();
return false; // continue processing
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::RequestHelp( IAbstractTableControl& _rControl, const HelpEvent& _rHEvt )
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::RequestHelp( ITableControl& _rControl, const HelpEvent& _rHEvt )
{
(void)_rControl;
(void)_rHEvt;
@@ -205,8 +216,8 @@ namespace svt { namespace table
return false;
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::Command( IAbstractTableControl& _rControl, const CommandEvent& _rCEvt )
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::Command( ITableControl& _rControl, const CommandEvent& _rCEvt )
{
(void)_rControl;
(void)_rCEvt;
@@ -214,8 +225,8 @@ namespace svt { namespace table
return false;
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::PreNotify( IAbstractTableControl& _rControl, NotifyEvent& _rNEvt )
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::PreNotify( ITableControl& _rControl, NotifyEvent& _rNEvt )
{
(void)_rControl;
(void)_rNEvt;
@@ -223,16 +234,16 @@ namespace svt { namespace table
return false;
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::Notify( IAbstractTableControl& _rControl, NotifyEvent& _rNEvt )
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::Notify( ITableControl& _rControl, NotifyEvent& _rNEvt )
{
(void)_rControl;
(void)_rNEvt;
// TODO
return false;
}
-//........................................................................
+//......................................................................................................................
} } // namespace svt::table
-//........................................................................
+//......................................................................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/table/gridtablerenderer.cxx b/svtools/source/table/gridtablerenderer.cxx
index 1be46204a9d3..e69ad5589087 100644
--- a/svtools/source/table/gridtablerenderer.cxx
+++ b/svtools/source/table/gridtablerenderer.cxx
@@ -28,51 +28,209 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
+#include "cellvalueconversion.hxx"
#include "svtools/table/gridtablerenderer.hxx"
+#include "svtools/colorcfg.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/graphic/XGraphic.hpp>
+/** === end UNO includes === **/
#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
#include <vcl/window.hxx>
#include <vcl/image.hxx>
+#include <vcl/virdev.hxx>
+#include <vcl/decoview.hxx>
-//........................................................................
+//......................................................................................................................
namespace svt { namespace table
{
-//........................................................................
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::TypeClass_INTERFACE;
+ using ::com::sun::star::graphic::XGraphic;
+ using ::com::sun::star::style::HorizontalAlignment;
+ using ::com::sun::star::style::HorizontalAlignment_LEFT;
+ using ::com::sun::star::style::HorizontalAlignment_CENTER;
+ using ::com::sun::star::style::HorizontalAlignment_RIGHT;
+ using ::com::sun::star::style::VerticalAlignment;
+ using ::com::sun::star::style::VerticalAlignment_TOP;
+ using ::com::sun::star::style::VerticalAlignment_MIDDLE;
+ using ::com::sun::star::style::VerticalAlignment_BOTTOM;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= CachedSortIndicator
+ //==================================================================================================================
+ class CachedSortIndicator
+ {
+ public:
+ CachedSortIndicator()
+ :m_lastHeaderHeight( 0 )
+ ,m_lastArrowColor( COL_TRANSPARENT )
+ {
+ }
+
+ BitmapEx const & getBitmapFor( OutputDevice const & i_device, long const i_headerHeight, StyleSettings const & i_style, bool const i_sortAscending );
+
+ private:
+ long m_lastHeaderHeight;
+ Color m_lastArrowColor;
+ BitmapEx m_sortAscending;
+ BitmapEx m_sortDescending;
+ };
+
+ //------------------------------------------------------------------------------------------------------------------
+ BitmapEx const & CachedSortIndicator::getBitmapFor( OutputDevice const & i_device, long const i_headerHeight,
+ StyleSettings const & i_style, bool const i_sortAscending )
+ {
+ BitmapEx & rBitmap( i_sortAscending ? m_sortAscending : m_sortDescending );
+ if ( !rBitmap || ( i_headerHeight != m_lastHeaderHeight ) || ( i_style.GetActiveColor() != m_lastArrowColor ) )
+ {
+ long const nSortIndicatorWidth = 2 * i_headerHeight / 3;
+ long const nSortIndicatorHeight = 2 * nSortIndicatorWidth / 3;
+
+ Point const aBitmapPos( 0, 0 );
+ Size const aBitmapSize( nSortIndicatorWidth, nSortIndicatorHeight );
+ VirtualDevice aDevice( i_device, 0, 0 );
+ aDevice.SetOutputSizePixel( aBitmapSize );
+
+ DecorationView aDecoView( &aDevice );
+ aDecoView.DrawSymbol(
+ Rectangle( aBitmapPos, aBitmapSize ),
+ i_sortAscending ? SYMBOL_SPIN_UP : SYMBOL_SPIN_DOWN,
+ i_style.GetActiveColor()
+ );
+
+ rBitmap = aDevice.GetBitmapEx( aBitmapPos, aBitmapSize );
+ m_lastHeaderHeight = i_headerHeight;
+ m_lastArrowColor = i_style.GetActiveColor();
+ }
+ return rBitmap;
+ }
+ //==================================================================================================================
+ //= GridTableRenderer_Impl
+ //==================================================================================================================
struct GridTableRenderer_Impl
{
- ITableModel& rModel;
- RowPos nCurrentRow;
+ ITableModel& rModel;
+ RowPos nCurrentRow;
+ bool bUseGridLines;
+ CachedSortIndicator aSortIndicator;
GridTableRenderer_Impl( ITableModel& _rModel )
:rModel( _rModel )
,nCurrentRow( ROW_INVALID )
+ ,bUseGridLines( true )
{
}
};
- //====================================================================
+ //==================================================================================================================
+ //= helper
+ //==================================================================================================================
+ namespace
+ {
+ static Rectangle lcl_getContentArea( GridTableRenderer_Impl const & i_impl, Rectangle const & i_cellArea )
+ {
+ Rectangle aContentArea( i_cellArea );
+ if ( i_impl.bUseGridLines )
+ {
+ --aContentArea.Right();
+ --aContentArea.Bottom();
+ }
+ return aContentArea;
+ }
+ static Rectangle lcl_getTextRenderingArea( Rectangle const & i_contentArea )
+ {
+ Rectangle aTextArea( i_contentArea );
+ aTextArea.Left() += 2; aTextArea.Right() -= 2;
+ ++aTextArea.Top(); --aTextArea.Bottom();
+ return aTextArea;
+ }
+
+ static sal_uLong lcl_getAlignmentTextDrawFlags( GridTableRenderer_Impl const & i_impl, ColPos const i_columnPos )
+ {
+ sal_uLong nVertFlag = TEXT_DRAW_TOP;
+ VerticalAlignment const eVertAlign = i_impl.rModel.getVerticalAlign();
+ switch ( eVertAlign )
+ {
+ case VerticalAlignment_MIDDLE: nVertFlag = TEXT_DRAW_VCENTER; break;
+ case VerticalAlignment_BOTTOM: nVertFlag = TEXT_DRAW_BOTTOM; break;
+ default:
+ break;
+ }
+
+ sal_uLong nHorzFlag = TEXT_DRAW_LEFT;
+ HorizontalAlignment const eHorzAlign = i_impl.rModel.getColumnModel( i_columnPos )->getHorizontalAlign();
+ switch ( eHorzAlign )
+ {
+ case HorizontalAlignment_CENTER: nHorzFlag = TEXT_DRAW_CENTER; break;
+ case HorizontalAlignment_RIGHT: nHorzFlag = TEXT_DRAW_RIGHT; break;
+ default:
+ break;
+ }
+
+ return nVertFlag | nHorzFlag;
+ }
+
+ }
+
+ //==================================================================================================================
//= GridTableRenderer
- //====================================================================
- //--------------------------------------------------------------------
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
GridTableRenderer::GridTableRenderer( ITableModel& _rModel )
:m_pImpl( new GridTableRenderer_Impl( _rModel ) )
{
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
GridTableRenderer::~GridTableRenderer()
{
- DELETEZ( m_pImpl );
}
- //--------------------------------------------------------------------
- RowPos GridTableRenderer::getCurrentRow()
+ //------------------------------------------------------------------------------------------------------------------
+ RowPos GridTableRenderer::getCurrentRow() const
{
return m_pImpl->nCurrentRow;
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ bool GridTableRenderer::useGridLines() const
+ {
+ return m_pImpl->bUseGridLines;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void GridTableRenderer::useGridLines( bool const i_use )
+ {
+ m_pImpl->bUseGridLines = i_use;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ Color lcl_getEffectiveColor(
+ ::boost::optional< ::Color > const & i_modelColor,
+ StyleSettings const & i_styleSettings,
+ ::Color const & ( StyleSettings::*i_getDefaultColor ) () const
+ )
+ {
+ if ( !!i_modelColor )
+ return *i_modelColor;
+ return ( i_styleSettings.*i_getDefaultColor )();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
void GridTableRenderer::PaintHeaderArea(
OutputDevice& _rDevice, const Rectangle& _rArea, bool _bIsColHeaderArea, bool _bIsRowHeaderArea,
const StyleSettings& _rStyle )
@@ -80,15 +238,18 @@ namespace svt { namespace table
OSL_PRECOND( _bIsColHeaderArea || _bIsRowHeaderArea,
"GridTableRenderer::PaintHeaderArea: invalid area flags!" );
- _rDevice.Push( PUSH_FILLCOLOR | PUSH_LINECOLOR);
- Color background = m_pImpl->rModel.getHeaderBackgroundColor();
- if( background != 0xFFFFFF)
- _rDevice.SetFillColor(background);
- else
- _rDevice.SetFillColor(_rStyle.GetDialogColor());
- _rDevice.SetLineColor(_rStyle.GetSeparatorColor());
+ _rDevice.Push( PUSH_FILLCOLOR | PUSH_LINECOLOR );
+
+ Color const background = lcl_getEffectiveColor( m_pImpl->rModel.getHeaderBackgroundColor(), _rStyle, &StyleSettings::GetDialogColor );
+ _rDevice.SetFillColor( background );
+
+ _rDevice.SetLineColor();
_rDevice.DrawRect( _rArea );
+
// delimiter lines at bottom/right
+ ::boost::optional< ::Color > aLineColor( m_pImpl->rModel.getLineColor() );
+ ::Color const lineColor = !aLineColor ? _rStyle.GetSeparatorColor() : *aLineColor;
+ _rDevice.SetLineColor( lineColor );
_rDevice.DrawLine( _rArea.BottomLeft(), _rArea.BottomRight() );
_rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight() );
@@ -97,48 +258,73 @@ namespace svt { namespace table
(void)_bIsRowHeaderArea;
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void GridTableRenderer::PaintColumnHeader( ColPos _nCol, bool _bActive, bool _bSelected,
OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle )
{
_rDevice.Push( PUSH_LINECOLOR);
- _rDevice.SetLineColor(_rStyle.GetSeparatorColor());
- _rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight());
String sHeaderText;
- PColumnModel pColumn = m_pImpl->rModel.getColumnModel( _nCol );
+ PColumnModel const pColumn = m_pImpl->rModel.getColumnModel( _nCol );
DBG_ASSERT( !!pColumn, "GridTableRenderer::PaintColumnHeader: invalid column model object!" );
if ( !!pColumn )
sHeaderText = pColumn->getName();
- if(m_pImpl->rModel.getTextColor() != 0x000000)
- _rDevice.SetTextColor(m_pImpl->rModel.getTextColor());
- else
- _rDevice.SetTextColor(_rStyle.GetFieldTextColor());
- ULONG nHorFlag = TEXT_DRAW_LEFT;
- ULONG nVerFlag = TEXT_DRAW_TOP;
- if(m_pImpl->rModel.getVerticalAlign() == 1)
- nVerFlag = TEXT_DRAW_VCENTER;
- else if(m_pImpl->rModel.getVerticalAlign() == 2)
- nVerFlag = TEXT_DRAW_BOTTOM;
- if(m_pImpl->rModel.getColumnModel(_nCol)->getHorizontalAlign() == 1)
- nHorFlag = TEXT_DRAW_CENTER;
- else if(m_pImpl->rModel.getColumnModel(_nCol)->getHorizontalAlign() == 2)
- nHorFlag = TEXT_DRAW_RIGHT;
- Rectangle aRect(_rArea);
- aRect.Left()+=4; aRect.Right()-=4;
- aRect.Bottom()-=2;
- _rDevice.DrawText( aRect, sHeaderText, nHorFlag | nVerFlag | TEXT_DRAW_CLIP);
+
+ ::Color const textColor = lcl_getEffectiveColor( m_pImpl->rModel.getTextColor(), _rStyle, &StyleSettings::GetFieldTextColor );
+ _rDevice.SetTextColor( textColor );
+
+ Rectangle const aTextRect( lcl_getTextRenderingArea( lcl_getContentArea( *m_pImpl, _rArea ) ) );
+ sal_uLong const nDrawTextFlags = lcl_getAlignmentTextDrawFlags( *m_pImpl, _nCol ) | TEXT_DRAW_CLIP;
+ _rDevice.DrawText( aTextRect, sHeaderText, nDrawTextFlags );
+
+ ::boost::optional< ::Color > const aLineColor( m_pImpl->rModel.getLineColor() );
+ ::Color const lineColor = !aLineColor ? _rStyle.GetSeparatorColor() : *aLineColor;
+ _rDevice.SetLineColor( lineColor );
+ _rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight());
_rDevice.DrawLine( _rArea.BottomLeft(), _rArea.BottomRight() );
+
+ // draw sort indicator if the model data is sorted by the given column
+ ITableDataSort const * pSortAdapter = m_pImpl->rModel.getSortAdapter();
+ ColumnSort aCurrentSortOrder;
+ if ( pSortAdapter != NULL )
+ aCurrentSortOrder = pSortAdapter->getCurrentSortOrder();
+ if ( aCurrentSortOrder.nColumnPos == _nCol )
+ {
+ long const nHeaderHeight( _rArea.GetHeight() );
+ BitmapEx const aIndicatorBitmap = m_pImpl->aSortIndicator.getBitmapFor( _rDevice, nHeaderHeight, _rStyle,
+ aCurrentSortOrder.eSortDirection == ColumnSortAscending );
+ Size const aBitmapSize( aIndicatorBitmap.GetSizePixel() );
+ long const nSortIndicatorPaddingX = 2;
+ long const nSortIndicatorPaddingY = ( nHeaderHeight - aBitmapSize.Height() ) / 2;
+
+ if ( ( nDrawTextFlags & TEXT_DRAW_RIGHT ) != 0 )
+ {
+ // text is right aligned => draw the sort indicator at the left hand side
+ _rDevice.DrawBitmapEx(
+ Point( _rArea.Left() + nSortIndicatorPaddingX, _rArea.Top() + nSortIndicatorPaddingY ),
+ aIndicatorBitmap
+ );
+ }
+ else
+ {
+ // text is left-aligned or centered => draw the sort indicator at the right hand side
+ _rDevice.DrawBitmapEx(
+ Point( _rArea.Right() - nSortIndicatorPaddingX - aBitmapSize.Width(), nSortIndicatorPaddingY ),
+ aIndicatorBitmap
+ );
+ }
+ }
+
_rDevice.Pop();
(void)_bActive;
// no special painting for the active column at the moment
(void)_bSelected;
- //selection for column header not yet implemented
+ // selection for column header not yet implemented
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void GridTableRenderer::PrepareRow( RowPos _nRow, bool _bActive, bool _bSelected,
OutputDevice& _rDevice, const Rectangle& _rRowArea, const StyleSettings& _rStyle )
{
@@ -147,238 +333,289 @@ namespace svt { namespace table
_rDevice.Push( PUSH_FILLCOLOR | PUSH_LINECOLOR);
- Color aRowBackground = m_pImpl->rModel.getOddRowBackgroundColor();
- Color line = m_pImpl->rModel.getLineColor();
- Color aRowBackground2 = m_pImpl->rModel.getEvenRowBackgroundColor();
- Color fieldColor = _rStyle.GetFieldColor();
- if(aRowBackground == 0xFFFFFF)
- aRowBackground = fieldColor;
- if(aRowBackground2 == 0xFFFFFF)
- aRowBackground2 = fieldColor;
- //if row is selected background color becomes blue, and lines should be also blue
- //if they aren't user defined
- if(_bSelected)
+ ::Color backgroundColor = _rStyle.GetFieldColor();
+
+ ::boost::optional< ::Color > aLineColor( m_pImpl->rModel.getLineColor() );
+ ::Color lineColor = !aLineColor ? _rStyle.GetSeparatorColor() : *aLineColor;
+
+ if ( _bSelected )
{
- Color aSelected(_rStyle.GetHighlightColor());
- aRowBackground = aSelected;
- if(line == 0xFFFFFF)
- _rDevice.SetLineColor(aRowBackground);
- else
- _rDevice.SetLineColor(line);
+ // selected rows use the background color from the style
+ backgroundColor = _rStyle.GetHighlightColor();
+ if ( !aLineColor )
+ lineColor = backgroundColor;
}
- //if row not selected, check the cases whether user defined backgrounds are set
- //and set line color to be the same
else
{
- if(aRowBackground2 != fieldColor && _nRow%2)
+ ::boost::optional< ::std::vector< ::Color > > aRowColors = m_pImpl->rModel.getRowBackgroundColors();
+ if ( !aRowColors )
{
- aRowBackground = aRowBackground2;
- if(line == 0xFFFFFF)
- _rDevice.SetLineColor(aRowBackground);
+ // use alternating default colors
+ Color const fieldColor = _rStyle.GetFieldColor();
+ if ( _rStyle.GetHighContrastMode() || ( ( m_pImpl->nCurrentRow % 2 ) == 0 ) )
+ {
+ backgroundColor = fieldColor;
+ }
else
- _rDevice.SetLineColor(line);
+ {
+ Color hilightColor = _rStyle.GetHighlightColor();
+ hilightColor.SetRed( 9 * ( fieldColor.GetRed() - hilightColor.GetRed() ) / 10 + hilightColor.GetRed() );
+ hilightColor.SetGreen( 9 * ( fieldColor.GetGreen() - hilightColor.GetGreen() ) / 10 + hilightColor.GetGreen() );
+ hilightColor.SetBlue( 9 * ( fieldColor.GetBlue() - hilightColor.GetBlue() ) / 10 + hilightColor.GetBlue() );
+ backgroundColor = hilightColor;
+ }
}
- //fill the rows with alternating background colors if second background color is specified
- else if(aRowBackground != fieldColor && line == 0xFFFFFF)
- _rDevice.SetLineColor(aRowBackground);
else
{
- //if Line color is set, then it was user defined and should be visible
- //if it wasn't set, it'll be the same as the default background color, so lines still won't be visible
- _rDevice.SetLineColor(line);
+ if ( aRowColors->empty() )
+ {
+ // all colors have the same background color
+ backgroundColor = _rStyle.GetFieldColor();
+ }
+ else
+ {
+ backgroundColor = aRowColors->at( m_pImpl->nCurrentRow % aRowColors->size() );
+ }
}
}
- _rDevice.SetFillColor( aRowBackground );
- _rDevice.DrawRect( _rRowArea );
- // TODO: active?
+ //m_pImpl->bUseGridLines ? _rDevice.SetLineColor( lineColor ) : _rDevice.SetLineColor();
+ _rDevice.SetLineColor();
+ _rDevice.SetFillColor( backgroundColor );
+ _rDevice.DrawRect( _rRowArea );
_rDevice.Pop();
+
(void)_bActive;
+ // row containing the active cell not rendered any special at the moment
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void GridTableRenderer::PaintRowHeader( bool _bActive, bool _bSelected, OutputDevice& _rDevice, const Rectangle& _rArea,
- const StyleSettings& _rStyle, rtl::OUString& _rText )
+ const StyleSettings& _rStyle )
{
- _rDevice.Push( PUSH_LINECOLOR);
- _rDevice.SetLineColor(_rStyle.GetSeparatorColor());
+ _rDevice.Push( PUSH_LINECOLOR | PUSH_TEXTCOLOR );
+
+ ::boost::optional< ::Color > const aLineColor( m_pImpl->rModel.getLineColor() );
+ ::Color const lineColor = !aLineColor ? _rStyle.GetSeparatorColor() : *aLineColor;
+ _rDevice.SetLineColor( lineColor );
_rDevice.DrawLine( _rArea.BottomLeft(), _rArea.BottomRight() );
- if(m_pImpl->rModel.getTextColor() != 0x000000)
- _rDevice.SetTextColor(m_pImpl->rModel.getTextColor());
- else
- _rDevice.SetTextColor(_rStyle.GetFieldTextColor());
- ULONG nHorFlag = TEXT_DRAW_LEFT;
- ULONG nVerFlag = TEXT_DRAW_TOP;
- if(m_pImpl->rModel.getVerticalAlign() == 1)
- nVerFlag = TEXT_DRAW_VCENTER;
- else if(m_pImpl->rModel.getVerticalAlign() == 2)
- nVerFlag = TEXT_DRAW_BOTTOM;
- if(m_pImpl->rModel.getColumnModel(0)->getHorizontalAlign() == 1)
- nHorFlag = TEXT_DRAW_CENTER;
- else if(m_pImpl->rModel.getColumnModel(0)->getHorizontalAlign() == 2)
- nHorFlag = TEXT_DRAW_RIGHT;
- Rectangle aRect(_rArea);
- aRect.Left()+=4; aRect.Right()-=4;
- aRect.Bottom()-=2;
- _rDevice.DrawText( aRect, _rText, nHorFlag | nVerFlag | TEXT_DRAW_CLIP);
+
+ Any const rowHeading( m_pImpl->rModel.getRowHeading( m_pImpl->nCurrentRow ) );
+ ::rtl::OUString const rowTitle( CellValueConversion::convertToString( rowHeading ) );
+ if ( rowTitle.getLength() )
+ {
+ ::Color const textColor = lcl_getEffectiveColor( m_pImpl->rModel.getHeaderTextColor(), _rStyle, &StyleSettings::GetFieldTextColor );
+ _rDevice.SetTextColor( textColor );
+
+ Rectangle const aTextRect( lcl_getTextRenderingArea( lcl_getContentArea( *m_pImpl, _rArea ) ) );
+ sal_uLong const nDrawTextFlags = lcl_getAlignmentTextDrawFlags( *m_pImpl, 0 ) | TEXT_DRAW_CLIP;
+ // TODO: is using the horizontal alignment of the 0'th column a good idea here? This is pretty ... arbitray ..
+ _rDevice.DrawText( aTextRect, rowTitle, nDrawTextFlags );
+ }
+
// TODO: active? selected?
(void)_bActive;
(void)_bSelected;
- //at the moment no special paint for selected row header
_rDevice.Pop();
}
- //--------------------------------------------------------------------
- void GridTableRenderer::PaintCellImage( ColPos _nColumn, bool _bSelected, bool _bActive,
- OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle, Image* _pCellData )
- {
- _rDevice.Push( PUSH_LINECOLOR | PUSH_FILLCOLOR);
- Color background1 = m_pImpl->rModel.getOddRowBackgroundColor();
- Color background2 = m_pImpl->rModel.getEvenRowBackgroundColor();
- Color line = m_pImpl->rModel.getLineColor();
- //if row is selected and line color isn't user specified, set it blue
- if(_bSelected)
+ //------------------------------------------------------------------------------------------------------------------
+ struct GridTableRenderer::CellRenderContext
+ {
+ OutputDevice& rDevice;
+ Rectangle const aContentArea;
+ StyleSettings const & rStyle;
+ ColPos const nColumn;
+ bool const bSelected;
+
+ CellRenderContext( OutputDevice& i_device, Rectangle const & i_contentArea,
+ StyleSettings const & i_style, ColPos const i_column, bool const i_selected )
+ :rDevice( i_device )
+ ,aContentArea( i_contentArea )
+ ,rStyle( i_style )
+ ,nColumn( i_column )
+ ,bSelected( i_selected )
{
- if(line == 0xFFFFFF)
- _rDevice.SetLineColor(_rStyle.GetHighlightColor());
- else
- _rDevice.SetLineColor(line);
}
- //else set line color to the color of row background
- else
+ };
+
+ //------------------------------------------------------------------------------------------------------------------
+ void GridTableRenderer::PaintCell( ColPos const i_column, bool _bSelected, bool _bActive,
+ OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle )
+ {
+ _rDevice.Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
+
+ Rectangle const aContentArea( lcl_getContentArea( *m_pImpl, _rArea ) );
+ CellRenderContext const aRenderContext( _rDevice, aContentArea, _rStyle, i_column, _bSelected );
+ impl_paintCellContent( aRenderContext );
+
+ if ( m_pImpl->bUseGridLines )
{
- if(background2 != 0xFFFFFF && m_pImpl->nCurrentRow%2)
- {
- if(line == 0xFFFFFF)
- _rDevice.SetLineColor(background2);
- else
- _rDevice.SetLineColor(line);
- }
- else if(background1 != 0xFFFFFF && line == 0xFFFFFF)
- _rDevice.SetLineColor(background1);
- else
+ ::boost::optional< ::Color > aLineColor( m_pImpl->rModel.getLineColor() );
+ ::Color lineColor = !aLineColor ? _rStyle.GetSeparatorColor() : *aLineColor;
+
+ if ( _bSelected && !aLineColor )
{
- //if line color is set, then it was user defined and should be visible
- //if it wasn't set, it'll be the same as the default background color, so lines still won't be visible
- _rDevice.SetLineColor(line);
+ // if no line color is specified by the model, use the usual selection color for lines in selected cells
+ lineColor = _rStyle.GetHighlightColor();
}
- }
- _rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight() );
- Rectangle aRect( _rArea );
- ++aRect.Left(); --aRect.Right();
- aRect.Top(); aRect.Bottom();
- Point imagePos(Point(aRect.Left(), aRect.Top()));
- Size imageSize = _pCellData->GetSizePixel();
- if(aRect.GetWidth() > imageSize.Width())
- {
- if(m_pImpl->rModel.getColumnModel(_nColumn)->getHorizontalAlign() == 1)
- imagePos.X() = aRect.Left()+((double)(aRect.GetWidth() - imageSize.Width()))/2;
- else if(m_pImpl->rModel.getColumnModel(_nColumn)->getHorizontalAlign() == 2)
- imagePos.X() = aRect.Right() - imageSize.Width();
- }
- else
- imageSize.Width() = aRect.GetWidth();
- if(aRect.GetHeight() > imageSize.Height())
- {
- if(m_pImpl->rModel.getVerticalAlign() == 1)
- imagePos.Y() = aRect.Top()+((double)(aRect.GetHeight() - imageSize.Height()))/2;
- else if(m_pImpl->rModel.getVerticalAlign() == 2)
- imagePos.Y() = aRect.Bottom() - imageSize.Height();
+ _rDevice.SetLineColor( lineColor );
+ _rDevice.DrawLine( _rArea.BottomLeft(), _rArea.BottomRight() );
+ _rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight() );
}
- else
- imageSize.Height() = aRect.GetHeight()-1;
- Image& image (*_pCellData);
- _rDevice.DrawImage(imagePos, imageSize, image, 0);
+
_rDevice.Pop();
(void)_bActive;
// no special painting for the active cell at the moment
}
- //--------------------------------------------------------------------
- void GridTableRenderer::PaintCellString( ColPos _nColumn, bool _bSelected, bool _bActive,
- OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle, rtl::OUString& _rText )
- {
- _rDevice.Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
- Color background1 = m_pImpl->rModel.getOddRowBackgroundColor();
- Color background2 = m_pImpl->rModel.getEvenRowBackgroundColor();
- Color line = m_pImpl->rModel.getLineColor();
- //if row is selected and line color isn't user specified, set it blue
- if(_bSelected)
+ //------------------------------------------------------------------------------------------------------------------
+ void GridTableRenderer::impl_paintCellImage( CellRenderContext const & i_context, Image const & i_image )
+ {
+ Point imagePos( Point( i_context.aContentArea.Left(), i_context.aContentArea.Top() ) );
+ Size imageSize = i_image.GetSizePixel();
+ if ( i_context.aContentArea.GetWidth() > imageSize.Width() )
{
- if(line == 0xFFFFFF)
- _rDevice.SetLineColor(_rStyle.GetHighlightColor());
- else
- _rDevice.SetLineColor(line);
+ const HorizontalAlignment eHorzAlign = m_pImpl->rModel.getColumnModel( i_context.nColumn )->getHorizontalAlign();
+ switch ( eHorzAlign )
+ {
+ case HorizontalAlignment_CENTER:
+ imagePos.X() += ( i_context.aContentArea.GetWidth() - imageSize.Width() ) / 2;
+ break;
+ case HorizontalAlignment_RIGHT:
+ imagePos.X() = i_context.aContentArea.Right() - imageSize.Width();
+ break;
+ default:
+ break;
+ }
+
}
- //else set line color to the color of row background
else
+ imageSize.Width() = i_context.aContentArea.GetWidth();
+
+ if ( i_context.aContentArea.GetHeight() > imageSize.Height() )
{
- if(background2 != 0xFFFFFF && m_pImpl->nCurrentRow%2)
+ const VerticalAlignment eVertAlign = m_pImpl->rModel.getVerticalAlign();
+ switch ( eVertAlign )
{
- if(line == 0xFFFFFF)
- _rDevice.SetLineColor(background2);
- else
- _rDevice.SetLineColor(line);
- }
- else if(background1 != 0xFFFFFF && line == 0xFFFFFF)
- _rDevice.SetLineColor(background1);
- else
- {
- //if Line color is set, then it was user defined and should be visible
- //if it wasn't set, it'll be the same as the default background color, so lines still won't be visible
- _rDevice.SetLineColor(line);
+ case VerticalAlignment_MIDDLE:
+ imagePos.Y() += ( i_context.aContentArea.GetHeight() - imageSize.Height() ) / 2;
+ break;
+ case VerticalAlignment_BOTTOM:
+ imagePos.Y() = i_context.aContentArea.Bottom() - imageSize.Height();
+ break;
+ default:
+ break;
}
}
- _rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight() );
+ else
+ imageSize.Height() = i_context.aContentArea.GetHeight() - 1;
+
+ i_context.rDevice.DrawImage( imagePos, imageSize, i_image, 0 );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void GridTableRenderer::impl_paintCellContent( CellRenderContext const & i_context )
+ {
+ Any aCellContent;
+ m_pImpl->rModel.getCellContent( i_context.nColumn, m_pImpl->nCurrentRow, aCellContent );
+
+ if ( aCellContent.getValueTypeClass() == TypeClass_INTERFACE )
+ {
+ Reference< XInterface > const xContentInterface( aCellContent, UNO_QUERY );
+ if ( !xContentInterface.is() )
+ // allowed. kind of.
+ return;
- Rectangle aRect( _rArea );
- ++aRect.Left(); --aRect.Right();
- aRect.Top(); aRect.Bottom();
- if(_bSelected)
- _rDevice.SetTextColor(_rStyle.GetHighlightTextColor());
- else if(m_pImpl->rModel.getTextColor() != 0x000000)
- _rDevice.SetTextColor(m_pImpl->rModel.getTextColor());
+ Reference< XGraphic > const xGraphic( aCellContent, UNO_QUERY );
+ ENSURE_OR_RETURN_VOID( xGraphic.is(), "GridTableRenderer::impl_paintCellContent: only XGraphic interfaces (or NULL) are supported for painting." );
+
+ const Image aImage( xGraphic );
+ impl_paintCellImage( i_context, aImage );
+ return;
+ }
+
+ const ::rtl::OUString sText( CellValueConversion::convertToString( aCellContent ) );
+ impl_paintCellText( i_context, sText );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void GridTableRenderer::impl_paintCellText( CellRenderContext const & i_context, ::rtl::OUString const & i_text )
+ {
+ if ( i_context.bSelected )
+ i_context.rDevice.SetTextColor( i_context.rStyle.GetHighlightTextColor() );
else
- _rDevice.SetTextColor(_rStyle.GetFieldTextColor());
- ULONG nHorFlag = TEXT_DRAW_LEFT;
- ULONG nVerFlag = TEXT_DRAW_TOP;
- if(m_pImpl->rModel.getVerticalAlign() == 1)
- nVerFlag = TEXT_DRAW_VCENTER;
- else if(m_pImpl->rModel.getVerticalAlign() == 2)
- nVerFlag = TEXT_DRAW_BOTTOM;
- if(m_pImpl->rModel.getColumnModel(_nColumn)->getHorizontalAlign() == 1)
- nHorFlag = TEXT_DRAW_CENTER;
- else if(m_pImpl->rModel.getColumnModel(_nColumn)->getHorizontalAlign() == 2)
- nHorFlag = TEXT_DRAW_RIGHT;
- Rectangle textRect(_rArea);
- textRect.Left()+=4; textRect.Right()-=4;
- textRect.Bottom()-=2;
- _rDevice.DrawText( textRect, _rText, nHorFlag | nVerFlag | TEXT_DRAW_CLIP);
+ {
+ ::Color const textColor = lcl_getEffectiveColor( m_pImpl->rModel.getTextColor(), i_context.rStyle, &StyleSettings::GetFieldTextColor );
+ i_context.rDevice.SetTextColor( textColor );
+ }
- _rDevice.Pop();
- (void)_bActive;
- // no special painting for the active cell at the moment
+ Rectangle const textRect( lcl_getTextRenderingArea( i_context.aContentArea ) );
+ sal_uLong const nDrawTextFlags = lcl_getAlignmentTextDrawFlags( *m_pImpl, i_context.nColumn ) | TEXT_DRAW_CLIP;
+ i_context.rDevice.DrawText( textRect, i_text, nDrawTextFlags );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void GridTableRenderer::ShowCellCursor( Window& _rView, const Rectangle& _rCursorRect)
{
_rView.ShowFocus( _rCursorRect );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void GridTableRenderer::HideCellCursor( Window& _rView, const Rectangle& _rCursorRect)
{
- (void)_rCursorRect;
+ (void)_rCursorRect;
_rView.HideFocus();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool GridTableRenderer::FitsIntoCell( Any const & i_cellContent, ColPos const i_colPos, RowPos const i_rowPos,
+ bool const i_active, bool const i_selected, OutputDevice& i_targetDevice, Rectangle const & i_targetArea )
+ {
+ if ( !i_cellContent.hasValue() )
+ return true;
+
+ if ( i_cellContent.getValueTypeClass() == TypeClass_INTERFACE )
+ {
+ Reference< XInterface > const xContentInterface( i_cellContent, UNO_QUERY );
+ if ( !xContentInterface.is() )
+ return true;
+
+ Reference< XGraphic > const xGraphic( i_cellContent, UNO_QUERY );
+ if ( xGraphic.is() )
+ // for the moment, assume it fits. We can always scale it down during painting ...
+ return true;
+
+ OSL_ENSURE( false, "GridTableRenderer::FitsIntoCell: only XGraphic interfaces (or NULL) are supported for painting." );
+ return true;
+ }
+
+ ::rtl::OUString const sText( CellValueConversion::convertToString( i_cellContent ) );
+ if ( sText.getLength() == 0 )
+ return true;
+
+ Rectangle const aTargetArea( lcl_getTextRenderingArea( lcl_getContentArea( *m_pImpl, i_targetArea ) ) );
+
+ long const nTextHeight = i_targetDevice.GetTextHeight();
+ if ( nTextHeight > aTargetArea.GetHeight() )
+ return false;
+
+ long const nTextWidth = i_targetDevice.GetTextWidth( sText );
+ if ( nTextWidth > aTargetArea.GetWidth() )
+ return false;
+ OSL_UNUSED( i_active );
+ OSL_UNUSED( i_selected );
+ OSL_UNUSED( i_rowPos );
+ OSL_UNUSED( i_colPos );
+ return true;
}
-//........................................................................
+//......................................................................................................................
} } // namespace svt::table
-//........................................................................
+//......................................................................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/table/makefile.mk b/svtools/source/table/makefile.mk
deleted file mode 100644
index 78c50f9eca4a..000000000000
--- a/svtools/source/table/makefile.mk
+++ /dev/null
@@ -1,51 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-ENABLE_EXCEPTIONS=TRUE
-PRJNAME=svtools
-TARGET=table
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES=\
- $(SLO)$/tablecontrol.obj \
- $(SLO)$/tablecontrol_impl.obj \
- $(SLO)$/gridtablerenderer.obj \
- $(SLO)$/tablegeometry.obj \
- $(SLO)$/defaultinputhandler.obj \
- $(SLO)$/tabledatawindow.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svtools/source/table/mousefunction.cxx b/svtools/source/table/mousefunction.cxx
new file mode 100755
index 000000000000..20d505e911e9
--- /dev/null
+++ b/svtools/source/table/mousefunction.cxx
@@ -0,0 +1,320 @@
+/*************************************************************************
+ * 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.
+ *
+ ************************************************************************/
+
+#include "precompiled_svtools.hxx"
+
+#include "mousefunction.hxx"
+#include "svtools/table/tablecontrolinterface.hxx"
+
+#include <tools/diagnose_ex.h>
+#include <vcl/window.hxx>
+
+//......................................................................................................................
+namespace svt { namespace table
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= MouseFunction
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ oslInterlockedCount MouseFunction::acquire()
+ {
+ return osl_incrementInterlockedCount( &m_refCount );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ oslInterlockedCount MouseFunction::release()
+ {
+ oslInterlockedCount newCount = osl_decrementInterlockedCount( &m_refCount );
+ if ( newCount == 0 )
+ {
+ delete this;
+ return 0;
+ }
+ return newCount;
+ }
+
+ //==================================================================================================================
+ //= ColumnResize
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult ColumnResize::handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ Point const aPoint = i_event.GetPosPixel();
+
+ if ( m_nResizingColumn == COL_INVALID )
+ {
+ // if we hit a column divider, change the mosue pointer accordingly
+ Pointer aNewPointer( POINTER_ARROW );
+ TableCell const tableCell = i_tableControl.hitTest( aPoint );
+ if ( ( tableCell.nRow == ROW_COL_HEADERS ) && ( tableCell.eArea == ColumnDivider ) )
+ {
+ aNewPointer = Pointer( POINTER_HSPLIT );
+ }
+ i_tableControl.setPointer( aNewPointer );
+
+ return SkipFunction; // TODO: is this correct?
+ }
+
+ ::Size const tableSize = i_tableControl.getTableSizePixel();
+
+ // set proper pointer
+ Pointer aNewPointer( POINTER_ARROW );
+ ColumnMetrics const & columnMetrics( i_tableControl.getColumnMetrics( m_nResizingColumn ) );
+ if ( ( aPoint.X() > tableSize.Width() )
+ || ( aPoint.X() < columnMetrics.nStartPixel )
+ )
+ {
+ aNewPointer = Pointer( POINTER_NOTALLOWED );
+ }
+ else
+ {
+ aNewPointer = Pointer( POINTER_HSPLIT );
+ }
+ i_tableControl.setPointer( aNewPointer );
+
+ // show tracking line
+ i_tableControl.hideTracking();
+ i_tableControl.showTracking(
+ Rectangle(
+ Point( aPoint.X(), 0 ),
+ Size( 1, tableSize.Height() )
+ ),
+ SHOWTRACK_SPLIT | SHOWTRACK_WINDOW
+ );
+
+ (void)i_event;
+ return ContinueFunction;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult ColumnResize::handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ if ( m_nResizingColumn != COL_INVALID )
+ {
+ OSL_ENSURE( false, "ColumnResize::handleMouseDown: suspicious: MouseButtonDown while still tracking?" );
+ return ContinueFunction;
+ }
+
+ TableCell const tableCell( i_tableControl.hitTest( i_event.GetPosPixel() ) );
+ if ( tableCell.nRow == ROW_COL_HEADERS )
+ {
+ if ( ( tableCell.nColumn != COL_INVALID )
+ && ( tableCell.eArea == ColumnDivider )
+ )
+ {
+ m_nResizingColumn = tableCell.nColumn;
+ i_tableControl.captureMouse();
+ return ActivateFunction;
+ }
+ }
+
+ return SkipFunction;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult ColumnResize::handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ if ( m_nResizingColumn == COL_INVALID )
+ return SkipFunction;
+
+ Point const aPoint = i_event.GetPosPixel();
+
+ i_tableControl.hideTracking();
+ PColumnModel const pColumn = i_tableControl.getModel()->getColumnModel( m_nResizingColumn );
+ long const maxWidthLogical = pColumn->getMaxWidth();
+ long const minWidthLogical = pColumn->getMinWidth();
+
+ // new position of mouse
+ long const requestedEnd = aPoint.X();
+
+ // old position of right border
+ long const oldEnd = i_tableControl.getColumnMetrics( m_nResizingColumn ).nEndPixel;
+
+ // position of left border if cursor in the to-be-resized column
+ long const columnStart = i_tableControl.getColumnMetrics( m_nResizingColumn ).nStartPixel;
+ long const requestedWidth = requestedEnd - columnStart;
+ // TODO: this is not correct, strictly: It assumes that the mouse was pressed exactly on the "end" pos,
+ // but for a while now, we have relaxed this, and allow clicking a few pixels aside, too
+
+ if ( requestedEnd >= columnStart )
+ {
+ long requestedWidthLogical = i_tableControl.pixelWidthToAppFont( requestedWidth );
+ // respect column width limits
+ if ( oldEnd > requestedEnd )
+ {
+ // column has become smaller, check against minimum width
+ if ( ( minWidthLogical != 0 ) && ( requestedWidthLogical < minWidthLogical ) )
+ requestedWidthLogical = minWidthLogical;
+ }
+ else if ( oldEnd < requestedEnd )
+ {
+ // column has become larger, check against max width
+ if ( ( maxWidthLogical != 0 ) && ( requestedWidthLogical >= maxWidthLogical ) )
+ requestedWidthLogical = maxWidthLogical;
+ }
+ pColumn->setWidth( requestedWidthLogical );
+ i_tableControl.invalidate( TableAreaAll );
+ }
+
+ i_tableControl.setPointer( Pointer() );
+ i_tableControl.releaseMouse();
+
+ m_nResizingColumn = COL_INVALID;
+ return DeactivateFunction;
+ }
+
+ //==================================================================================================================
+ //= RowSelection
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult RowSelection::handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ OSL_UNUSED( i_tableControl );
+ OSL_UNUSED( i_event );
+ return SkipFunction;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult RowSelection::handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ bool handled = false;
+
+ TableCell const tableCell( i_tableControl.hitTest( i_event.GetPosPixel() ) );
+ if ( tableCell.nRow >= 0 )
+ {
+ bool bSetCursor = false;
+ if ( i_tableControl.getSelEngine()->GetSelectionMode() == NO_SELECTION )
+ {
+ bSetCursor = true;
+ }
+ else
+ {
+ if ( !i_tableControl.isRowSelected( tableCell.nRow ) )
+ {
+ handled = i_tableControl.getSelEngine()->SelMouseButtonDown( i_event );
+ }
+ else
+ {
+ bSetCursor = true;
+ }
+ }
+
+ if ( bSetCursor )
+ {
+ i_tableControl.activateCell( tableCell.nColumn, tableCell.nRow );
+ handled = true;
+ }
+ }
+
+ if ( handled )
+ m_bActive = true;
+ return handled ? ActivateFunction : SkipFunction;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult RowSelection::handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ TableCell const tableCell = i_tableControl.hitTest( i_event.GetPosPixel() );
+ if ( tableCell.nRow >= 0 )
+ {
+ if ( i_tableControl.getSelEngine()->GetSelectionMode() != NO_SELECTION )
+ {
+ i_tableControl.getSelEngine()->SelMouseButtonUp( i_event );
+ }
+ }
+ if ( m_bActive )
+ {
+ m_bActive = false;
+ return DeactivateFunction;
+ }
+ return SkipFunction;
+ }
+
+ //==================================================================================================================
+ //= ColumnSortHandler
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult ColumnSortHandler::handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ OSL_UNUSED( i_tableControl );
+ OSL_UNUSED( i_event );
+ return SkipFunction;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult ColumnSortHandler::handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ if ( m_nActiveColumn != COL_INVALID )
+ {
+ OSL_ENSURE( false, "ColumnSortHandler::handleMouseDown: called while already active - suspicious!" );
+ return ContinueFunction;
+ }
+
+ if ( i_tableControl.getModel()->getSortAdapter() == NULL )
+ // no sorting support at the model
+ return SkipFunction;
+
+ TableCell const tableCell( i_tableControl.hitTest( i_event.GetPosPixel() ) );
+ if ( ( tableCell.nRow != ROW_COL_HEADERS ) || ( tableCell.nColumn < 0 ) )
+ return SkipFunction;
+
+ // TODO: ensure the column header is rendered in some special way, indicating its current state
+
+ m_nActiveColumn = tableCell.nColumn;
+ return ActivateFunction;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult ColumnSortHandler::handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ if ( m_nActiveColumn == COL_INVALID )
+ return SkipFunction;
+
+ TableCell const tableCell( i_tableControl.hitTest( i_event.GetPosPixel() ) );
+ if ( ( tableCell.nRow == ROW_COL_HEADERS ) && ( tableCell.nColumn == m_nActiveColumn ) )
+ {
+ ITableDataSort* pSort = i_tableControl.getModel()->getSortAdapter();
+ ENSURE_OR_RETURN( pSort != NULL, "ColumnSortHandler::handleMouseUp: somebody is mocking with us!", DeactivateFunction );
+ // in handleMousButtonDown, the model claimed to have sort support ...
+
+ ColumnSortDirection eSortDirection = ColumnSortAscending;
+ ColumnSort const aCurrentSort = pSort->getCurrentSortOrder();
+ if ( aCurrentSort.nColumnPos == m_nActiveColumn )
+ // invert existing sort order
+ eSortDirection = ( aCurrentSort.eSortDirection == ColumnSortAscending ) ? ColumnSortDescending : ColumnSortAscending;
+
+ pSort->sortByColumn( m_nActiveColumn, eSortDirection );
+ }
+
+ m_nActiveColumn = COL_INVALID;
+ return DeactivateFunction;
+ }
+
+//......................................................................................................................
+} } // namespace svt::table
+//......................................................................................................................
diff --git a/svtools/source/table/mousefunction.hxx b/svtools/source/table/mousefunction.hxx
new file mode 100755
index 000000000000..2149026a0923
--- /dev/null
+++ b/svtools/source/table/mousefunction.hxx
@@ -0,0 +1,161 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SVTOOLS_MOUSEFUNCTION_HXX
+#define SVTOOLS_MOUSEFUNCTION_HXX
+
+#include "svtools/table/tabletypes.hxx"
+
+#include <rtl/ref.hxx>
+
+#include <boost/noncopyable.hpp>
+
+class MouseEvent;
+
+//......................................................................................................................
+namespace svt { namespace table
+{
+//......................................................................................................................
+
+ class ITableControl;
+
+ //==================================================================================================================
+ //= FunctionResult
+ //==================================================================================================================
+ enum FunctionResult
+ {
+ ActivateFunction,
+ ContinueFunction,
+ DeactivateFunction,
+
+ SkipFunction
+ };
+
+ //==================================================================================================================
+ //= IMouseFunction
+ //==================================================================================================================
+ class IMouseFunction : public ::rtl::IReference, public ::boost::noncopyable
+ {
+ public:
+ virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event ) = 0;
+ virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event ) = 0;
+ virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event ) = 0;
+
+ protected:
+ virtual ~IMouseFunction() { }
+ };
+
+ //==================================================================================================================
+ //= MouseFunction
+ //==================================================================================================================
+ class MouseFunction : public IMouseFunction
+ {
+ public:
+ MouseFunction()
+ :m_refCount( 0 )
+ {
+ }
+ protected:
+ ~MouseFunction()
+ {
+ }
+
+ public:
+ virtual oslInterlockedCount SAL_CALL acquire();
+ virtual oslInterlockedCount SAL_CALL release();
+
+ private:
+ oslInterlockedCount m_refCount;
+ };
+
+ //==================================================================================================================
+ //= ColumnResize
+ //==================================================================================================================
+ class ColumnResize : public MouseFunction
+ {
+ public:
+ ColumnResize()
+ :m_nResizingColumn( COL_INVALID )
+ {
+ }
+
+ public:
+ // IMouseFunction
+ virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event );
+ virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event );
+ virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event );
+
+ private:
+ ColPos m_nResizingColumn;
+ };
+
+ //==================================================================================================================
+ //= RowSelection
+ //==================================================================================================================
+ class RowSelection : public MouseFunction
+ {
+ public:
+ RowSelection()
+ :m_bActive( false )
+ {
+ }
+
+ public:
+ // IMouseFunction
+ virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event );
+ virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event );
+ virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event );
+
+ private:
+ bool m_bActive;
+ };
+
+ //==================================================================================================================
+ //= ColumnSortHandler
+ //==================================================================================================================
+ class ColumnSortHandler : public MouseFunction
+ {
+ public:
+ ColumnSortHandler()
+ :m_nActiveColumn( COL_INVALID )
+ {
+ }
+
+ public:
+ // IMouseFunction
+ virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event );
+ virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event );
+ virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event );
+
+ private:
+ ColPos m_nActiveColumn;
+ };
+
+//......................................................................................................................
+} } // namespace svt::table
+//......................................................................................................................
+
+#endif // SVTOOLS_MOUSEFUNCTION_HXX
diff --git a/svtools/source/table/tablecontrol.cxx b/svtools/source/table/tablecontrol.cxx
index 2cbf8c8628f2..6ec1ec5e7121 100644
--- a/svtools/source/table/tablecontrol.cxx
+++ b/svtools/source/table/tablecontrol.cxx
@@ -29,54 +29,38 @@
#include "precompiled_svtools.hxx"
#include "svtools/table/tablecontrol.hxx"
+
#include "tablegeometry.hxx"
#include "tablecontrol_impl.hxx"
-#include "accessibletableimp.hxx"
-#include "svtools/table/tabledatawindow.hxx"
+#include "tabledatawindow.hxx"
+
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#include <tools/diagnose_ex.h>
+
using namespace ::com::sun::star::uno;
using ::com::sun::star::accessibility::XAccessible;
using namespace ::com::sun::star::accessibility;
using namespace ::com::sun::star::lang;
using namespace utl;
-//........................................................................
+//......................................................................................................................
namespace svt { namespace table
{
- //====================================================================
- //= AccessibleTableControl_Impl
- //====================================================================
- // ----------------------------------------------------------------------------
- Reference< XAccessible > AccessibleTableControl_Impl::getAccessibleTableHeader( AccessibleTableControlObjType _eObjType )
- {
- if ( m_pAccessible && m_pAccessible->isAlive() )
- return m_pAccessible->getTableHeader( _eObjType );
- return NULL;
- }
- // ----------------------------------------------------------------------------
- Reference< XAccessible > AccessibleTableControl_Impl::getAccessibleTable( )
- {
- if ( m_pAccessible && m_pAccessible->isAlive() )
- return m_pAccessible->getTable( );
- return NULL;
- }
+//......................................................................................................................
- //====================================================================
+ //==================================================================================================================
//= TableControl
- //====================================================================
- //--------------------------------------------------------------------
+ //==================================================================================================================
+ // -----------------------------------------------------------------------------------------------------------------
TableControl::TableControl( Window* _pParent, WinBits _nStyle )
:Control( _pParent, _nStyle )
,m_pImpl( new TableControl_Impl( *this ) )
- ,m_bSelectionChanged(false)
- ,m_bTooltip(false)
{
- TableDataWindow* aTableData = m_pImpl->getDataWindow();
- aTableData->SetMouseButtonDownHdl( LINK( this, TableControl, ImplMouseButtonDownHdl ) );
- aTableData->SetMouseButtonUpHdl( LINK( this, TableControl, ImplMouseButtonUpHdl ) );
- aTableData->SetSelectHdl( LINK( this, TableControl, ImplSelectHdl ) );
- m_pAccessTable.reset(new ::svt::table::AccessibleTableControl_Impl());
+ TableDataWindow& rDataWindow = m_pImpl->getDataWindow();
+ rDataWindow.SetMouseButtonDownHdl( LINK( this, TableControl, ImplMouseButtonDownHdl ) );
+ rDataWindow.SetMouseButtonUpHdl( LINK( this, TableControl, ImplMouseButtonUpHdl ) );
+ rDataWindow.SetSelectHdl( LINK( this, TableControl, ImplSelectHdl ) );
// by default, use the background as determined by the style settings
const Color aWindowColor( GetSettings().GetStyleSettings().GetFieldColor() );
@@ -84,51 +68,39 @@ namespace svt { namespace table
SetFillColor( aWindowColor );
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
TableControl::~TableControl()
{
ImplCallEventListeners( VCLEVENT_OBJECT_DYING );
- DELETEZ( m_pImpl );
- if ( m_pAccessTable->m_pAccessible )
- {
- m_pAccessTable->m_pAccessible->dispose();
- }
+
+ m_pImpl->setModel( PTableModel() );
+ m_pImpl->disposeAccessible();
+ m_pImpl.reset();
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
void TableControl::GetFocus()
{
if ( !m_pImpl->getInputHandler()->GetFocus( *m_pImpl ) )
- {
Control::GetFocus();
- Control::GrabFocus();
- }
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
void TableControl::LoseFocus()
{
if ( !m_pImpl->getInputHandler()->LoseFocus( *m_pImpl ) )
Control::LoseFocus();
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
void TableControl::KeyInput( const KeyEvent& rKEvt )
{
if ( !m_pImpl->getInputHandler()->KeyInput( *m_pImpl, rKEvt ) )
Control::KeyInput( rKEvt );
- else
- {
- if(m_bSelectionChanged)
- {
- Select();
- m_bSelectionChanged = false;
- }
- }
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
void TableControl::StateChanged( StateChangedType i_nStateChange )
{
Control::StateChanged( i_nStateChange );
@@ -138,156 +110,180 @@ namespace svt { namespace table
{
case STATE_CHANGE_CONTROLBACKGROUND:
if ( IsControlBackground() )
- getDataWindow()->SetControlBackground( GetControlBackground() );
+ getDataWindow().SetControlBackground( GetControlBackground() );
else
- getDataWindow()->SetControlBackground();
+ getDataWindow().SetControlBackground();
break;
case STATE_CHANGE_CONTROLFOREGROUND:
if ( IsControlForeground() )
- getDataWindow()->SetControlForeground( GetControlForeground() );
+ getDataWindow().SetControlForeground( GetControlForeground() );
else
- getDataWindow()->SetControlForeground();
+ getDataWindow().SetControlForeground();
break;
case STATE_CHANGE_CONTROLFONT:
if ( IsControlFont() )
- getDataWindow()->SetControlFont( GetControlFont() );
+ getDataWindow().SetControlFont( GetControlFont() );
else
- getDataWindow()->SetControlFont();
+ getDataWindow().SetControlFont();
break;
}
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
void TableControl::Resize()
{
Control::Resize();
m_pImpl->onResize();
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
void TableControl::SetModel( PTableModel _pModel )
{
m_pImpl->setModel( _pModel );
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
PTableModel TableControl::GetModel() const
{
return m_pImpl->getModel();
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
RowPos TableControl::GetTopRow() const
{
return m_pImpl->getTopRow();
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
void TableControl::SetTopRow( RowPos _nRow )
{
- // TODO
- (void)_nRow;
+ OSL_ENSURE( false, "TableControl::SetTopRow: not implemented!" );
+ OSL_UNUSED( _nRow );
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
sal_Int32 TableControl::GetCurrentRow() const
{
- return m_pImpl->getCurRow();
+ return m_pImpl->getCurrentRow();
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
sal_Int32 TableControl::GetCurrentColumn() const
{
- return m_pImpl->getCurColumn();
+ return m_pImpl->getCurrentColumn();
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
bool TableControl::GoTo( ColPos _nColumn, RowPos _nRow )
{
return m_pImpl->goTo( _nColumn, _nRow );
}
- //--------------------------------------------------------------------
+
+ // -----------------------------------------------------------------------------------------------------------------
sal_Bool TableControl::GoToCell(sal_Int32 _nColPos, sal_Int32 _nRowPos)
{
return m_pImpl->goTo( _nColPos, _nRowPos );
}
- //--------------------------------------------------------------------
- void TableControl::clearSelection()
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Int32 TableControl::GetSelectedRowCount() const
+ {
+ return sal_Int32( m_pImpl->getSelectedRowCount() );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Int32 TableControl::GetSelectedRowIndex( sal_Int32 const i_selectionIndex ) const
{
- m_pImpl->clearSelection();
+ return sal_Int32( m_pImpl->getSelectedRowIndex( i_selectionIndex ) );
}
- //--------------------------------------------------------------------
- void TableControl::InvalidateDataWindow(RowPos _nRowStart, RowPos _nRowEnd, bool _bRemoved)
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableControl::IsRowSelected( sal_Int32 const i_rowIndex ) const
{
- Rectangle _rRect;
- if(_bRemoved)
- m_pImpl->invalidateRows();
+ return m_pImpl->isRowSelected( i_rowIndex );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ void TableControl::SelectRow( RowPos const i_rowIndex, bool const i_select )
+ {
+ ENSURE_OR_RETURN_VOID( ( i_rowIndex >= 0 ) && ( i_rowIndex < m_pImpl->getModel()->getRowCount() ),
+ "TableControl::SelectRow: no control (anymore)!" );
+
+ if ( i_select )
+ {
+ if ( !m_pImpl->markRowAsSelected( i_rowIndex ) )
+ // nothing to do
+ return;
+ }
else
{
- if(m_bSelectionChanged)
- {
- m_pImpl->invalidateSelectedRegion(_nRowStart, _nRowEnd, _rRect);
- m_bSelectionChanged = false;
- }
- else
- m_pImpl->invalidateRow(_nRowStart, _rRect);
+ m_pImpl->markRowAsDeselected( i_rowIndex );
}
+
+ m_pImpl->invalidateRowRange( i_rowIndex, i_rowIndex );
+ Select();
}
- //--------------------------------------------------------------------
- std::vector<sal_Int32>& TableControl::GetSelectedRows()
- {
- return m_pImpl->getSelectedRows();
- }
- //--------------------------------------------------------------------
- void TableControl::RemoveSelectedRow(RowPos _nRowPos)
+
+ // -----------------------------------------------------------------------------------------------------------------
+ void TableControl::SelectAllRows( bool const i_select )
{
- m_pImpl->removeSelectedRow(_nRowPos);
+ if ( i_select )
+ {
+ if ( !m_pImpl->markAllRowsAsSelected() )
+ // nothing to do
+ return;
+ }
+ else
+ {
+ if ( !m_pImpl->markAllRowsAsDeselected() )
+ // nothing to do
+ return;
+ }
+
+
+ Invalidate();
+ // TODO: can't we do better than this, and invalidate only the rows which changed?
+ Select();
}
- //--------------------------------------------------------------------
- RowPos TableControl::GetCurrentRow(const Point& rPoint)
+ // -----------------------------------------------------------------------------------------------------------------
+ ITableControl& TableControl::getTableControlInterface()
{
- return m_pImpl->getCurrentRow( rPoint );
+ return *m_pImpl;
}
+ // -----------------------------------------------------------------------------------------------------------------
SelectionEngine* TableControl::getSelEngine()
{
return m_pImpl->getSelEngine();
}
- TableDataWindow* TableControl::getDataWindow()
+ // -----------------------------------------------------------------------------------------------------------------
+ Window& TableControl::getDataWindow()
{
return m_pImpl->getDataWindow();
}
+ // -----------------------------------------------------------------------------------------------------------------
Reference< XAccessible > TableControl::CreateAccessible()
{
Window* pParent = GetAccessibleParentWindow();
- DBG_ASSERT( pParent, "TableControl::CreateAccessible - parent not found" );
+ ENSURE_OR_RETURN( pParent, "TableControl::CreateAccessible - parent not found", NULL );
- if( pParent && !m_pAccessTable->m_pAccessible)
- {
- Reference< XAccessible > xAccParent = pParent->GetAccessible();
- if( xAccParent.is() )
- {
- m_pAccessTable->m_pAccessible = getAccessibleFactory().createAccessibleTableControl(
- xAccParent, *this
- );
- }
- }
- Reference< XAccessible > xAccessible;
- if ( m_pAccessTable->m_pAccessible )
- xAccessible = m_pAccessTable->m_pAccessible->getMyself();
- return xAccessible;
+ return m_pImpl->getAccessible( *pParent );
}
+
+ // -----------------------------------------------------------------------------------------------------------------
Reference<XAccessible> TableControl::CreateAccessibleControl( sal_Int32 _nIndex )
{
(void)_nIndex;
- DBG_ASSERT( FALSE, "TableControl::CreateAccessibleControl: to be overwritten!" );
+ DBG_ASSERT( sal_False, "TableControl::CreateAccessibleControl: to be overwritten!" );
return NULL;
}
+
+ // -----------------------------------------------------------------------------------------------------------------
::rtl::OUString TableControl::GetAccessibleObjectName( AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const
{
::rtl::OUString aRetText;
@@ -320,311 +316,298 @@ namespace svt { namespace table
}
return aRetText;
}
-// -----------------------------------------------------------------------------
-::rtl::OUString TableControl::GetAccessibleObjectDescription( AccessibleTableControlObjType eObjType, sal_Int32 ) const
-{
- ::rtl::OUString aRetText;
- switch( eObjType )
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString TableControl::GetAccessibleObjectDescription( AccessibleTableControlObjType eObjType, sal_Int32 ) const
{
- case TCTYPE_GRIDCONTROL:
- aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "GridControl description" ) );
- break;
- case TCTYPE_TABLE:
- aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TABLE description" ) );
- break;
- case TCTYPE_ROWHEADERBAR:
- aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ROWHEADERBAR description" ) );
- break;
- case TCTYPE_COLUMNHEADERBAR:
- aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "COLUMNHEADERBAR description" ) );
- break;
- case TCTYPE_TABLECELL:
- aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TABLECELL description" ) );
- break;
- case TCTYPE_ROWHEADERCELL:
- aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ROWHEADERCELL description" ) );
- break;
- case TCTYPE_COLUMNHEADERCELL:
- aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "COLUMNHEADERCELL description" ) );
- break;
+ ::rtl::OUString aRetText;
+ switch( eObjType )
+ {
+ case TCTYPE_GRIDCONTROL:
+ aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "GridControl description" ) );
+ break;
+ case TCTYPE_TABLE:
+ aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TABLE description" ) );
+ break;
+ case TCTYPE_ROWHEADERBAR:
+ aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ROWHEADERBAR description" ) );
+ break;
+ case TCTYPE_COLUMNHEADERBAR:
+ aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "COLUMNHEADERBAR description" ) );
+ break;
+ case TCTYPE_TABLECELL:
+ aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TABLECELL description" ) );
+ break;
+ case TCTYPE_ROWHEADERCELL:
+ aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ROWHEADERCELL description" ) );
+ break;
+ case TCTYPE_COLUMNHEADERCELL:
+ aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "COLUMNHEADERCELL description" ) );
+ break;
+ }
+ return aRetText;
}
- return aRetText;
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString TableControl::GetRowDescription( sal_Int32 _nRow) const
-{
- (void)_nRow;
- return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "row description" ) );
-}
-// -----------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString TableControl::GetRowDescription( sal_Int32 _nRow) const
+ {
+ (void)_nRow;
+ return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "row description" ) );
+ }
-::rtl::OUString TableControl::GetRowName( sal_Int32 _nIndex) const
-{
- return GetModel()->getRowHeaderName()[_nIndex];
-}
-// -----------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString TableControl::GetRowName( sal_Int32 _nIndex) const
+ {
+ ::rtl::OUString sRowName;
+ GetModel()->getRowHeading( _nIndex ) >>= sRowName;
+ return sRowName;
+ }
-::rtl::OUString TableControl::GetColumnDescription( sal_uInt16 _nColumn) const
-{
- (void)_nColumn;
- return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "col description" ) );
-}
-// -----------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString TableControl::GetColumnDescription( sal_uInt16 _nColumn) const
+ {
+ (void)_nColumn;
+ return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "col description" ) );
+ }
-::rtl::OUString TableControl::GetColumnName( sal_Int32 _nIndex) const
-{
- return GetModel()->getColumnModel(_nIndex)->getName();
-}
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString TableControl::GetColumnName( sal_Int32 _nIndex) const
+ {
+ return GetModel()->getColumnModel(_nIndex)->getName();
+ }
-// -----------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::com::sun::star::uno::Any TableControl::GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos ) const
+ {
+ Any aCellContent;
+ GetModel()->getCellContent( _nColPos, _nRowPos, aCellContent );
+ return aCellContent;
+ }
-::com::sun::star::uno::Any TableControl::GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos) const
-{
- ::com::sun::star::uno::Any cellContent(::com::sun::star::uno::Any(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("")) ));
- std::vector<std::vector< ::com::sun::star::uno::Any > >& aTableContent = GetModel()->getCellContent();
- if(&aTableContent)
- cellContent = aTableContent[_nRowPos][_nColPos];
- return cellContent;
-}
-// -----------------------------------------------------------------------------
-
-::rtl::OUString TableControl::GetAccessibleCellText( sal_Int32 _nRowPos, sal_Int32 _nColPos) const
-{
- const ::com::sun::star::uno::Any cellContent = GetCellContent(_nRowPos, _nColPos);
- return m_pImpl->convertToString(cellContent);
-}
-// -----------------------------------------------------------------------------
-
-void TableControl::FillAccessibleStateSet(
- ::utl::AccessibleStateSetHelper& rStateSet,
- AccessibleTableControlObjType eObjType ) const
-{
- switch( eObjType )
- {
- case TCTYPE_GRIDCONTROL:
- case TCTYPE_TABLE:
-
- rStateSet.AddState( AccessibleStateType::FOCUSABLE );
- rStateSet.AddState( AccessibleStateType::MULTI_SELECTABLE);
- if ( HasFocus() )
- rStateSet.AddState( AccessibleStateType::FOCUSED );
- if ( IsActive() )
- rStateSet.AddState( AccessibleStateType::ACTIVE );
- if ( IsEnabled() )
- rStateSet.AddState( AccessibleStateType::ENABLED );
- if ( IsReallyVisible() )
- rStateSet.AddState( AccessibleStateType::VISIBLE );
- rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString TableControl::GetAccessibleCellText( sal_Int32 _nRowPos, sal_Int32 _nColPos) const
+ {
+ return m_pImpl->getCellContentAsString( _nRowPos, _nColPos );
+ }
- break;
- case TCTYPE_ROWHEADERBAR:
- rStateSet.AddState( AccessibleStateType::VISIBLE );
- rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
- break;
- case TCTYPE_COLUMNHEADERBAR:
- rStateSet.AddState( AccessibleStateType::VISIBLE );
- rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
- break;
- case TCTYPE_TABLECELL:
- {
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl::FillAccessibleStateSet(
+ ::utl::AccessibleStateSetHelper& rStateSet,
+ AccessibleTableControlObjType eObjType ) const
+ {
+ switch( eObjType )
+ {
+ case TCTYPE_GRIDCONTROL:
+ case TCTYPE_TABLE:
+
+ rStateSet.AddState( AccessibleStateType::FOCUSABLE );
+ rStateSet.AddState( AccessibleStateType::MULTI_SELECTABLE);
+ if ( HasFocus() )
+ rStateSet.AddState( AccessibleStateType::FOCUSED );
+ if ( IsActive() )
+ rStateSet.AddState( AccessibleStateType::ACTIVE );
+ if ( IsEnabled() )
+ rStateSet.AddState( AccessibleStateType::ENABLED );
+ if ( IsReallyVisible() )
+ rStateSet.AddState( AccessibleStateType::VISIBLE );
+ rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
+
+ break;
+ case TCTYPE_ROWHEADERBAR:
+ rStateSet.AddState( AccessibleStateType::VISIBLE );
+ rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
+ break;
+ case TCTYPE_COLUMNHEADERBAR:
+ rStateSet.AddState( AccessibleStateType::VISIBLE );
+ rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
+ break;
+ case TCTYPE_TABLECELL:
+ {
+ rStateSet.AddState( AccessibleStateType::TRANSIENT );
+ rStateSet.AddState( AccessibleStateType::SELECTABLE);
+ if( GetSelectedRowCount()>0)
+ rStateSet.AddState( AccessibleStateType::SELECTED);
+ }
+ break;
+ case TCTYPE_ROWHEADERCELL:
+ rStateSet.AddState( AccessibleStateType::VISIBLE );
rStateSet.AddState( AccessibleStateType::TRANSIENT );
- rStateSet.AddState( AccessibleStateType::SELECTABLE);
- if( GetSelectedRowCount()>0)
- rStateSet.AddState( AccessibleStateType::SELECTED);
- }
- break;
- case TCTYPE_ROWHEADERCELL:
- rStateSet.AddState( AccessibleStateType::VISIBLE );
- rStateSet.AddState( AccessibleStateType::TRANSIENT );
- break;
- case TCTYPE_COLUMNHEADERCELL:
- rStateSet.AddState( AccessibleStateType::VISIBLE );
- break;
+ break;
+ case TCTYPE_COLUMNHEADERCELL:
+ rStateSet.AddState( AccessibleStateType::VISIBLE );
+ break;
+ }
}
-}
-Rectangle TableControl::GetWindowExtentsRelative( Window *pRelativeWindow ) const
-{
- return Control::GetWindowExtentsRelative( pRelativeWindow );
-}
-//-----------------------------------------------------------------------------
-void TableControl::GrabFocus()
-{
- Control::GrabFocus();
-}
-// -----------------------------------------------------------------------------
-Reference< XAccessible > TableControl::GetAccessible( BOOL bCreate )
-{
- return Control::GetAccessible( bCreate );
-}
-// -----------------------------------------------------------------------------
-Window* TableControl::GetAccessibleParentWindow() const
-{
- return Control::GetAccessibleParentWindow();
-}
-// -----------------------------------------------------------------------------
-Window* TableControl::GetWindowInstance()
-{
- return this;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ Rectangle TableControl::GetWindowExtentsRelative( Window *pRelativeWindow ) const
+ {
+ return Control::GetWindowExtentsRelative( pRelativeWindow );
+ }
-sal_Bool TableControl::HasRowHeader()
-{
- return GetModel()->hasRowHeaders();
-}
-//--------------------------------------------------------------------------------
-sal_Bool TableControl::HasColHeader()
-{
- return GetModel()->hasColumnHeaders();
-}
-//--------------------------------------------------------------------------------
-sal_Int32 TableControl::GetAccessibleControlCount() const
-{
- sal_Int32 count = 0;
- if(GetRowCount()>0)
- count+=1;
- if(GetModel()->hasRowHeaders())
- count+=1;
- if(GetModel()->hasColumnHeaders())
- count+=1;
- return count;
-}
-sal_Bool TableControl::ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint )
-{
- sal_Int32 nRow = m_pImpl->getCurrentRow(_rPoint);
- sal_Int32 nCol = GetCurrentColumn();
- _rnIndex = nRow * GetColumnCount() + nCol;
- return nRow>=0 ? sal_True : sal_False;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl::GrabFocus()
+ {
+ Control::GrabFocus();
+ }
-long TableControl::GetRowCount() const
-{
- return m_pImpl->getRowCount();
-}
-long TableControl::GetColumnCount() const
-{
- return m_pImpl->getColumnCount();
-}
-sal_Bool TableControl::HasRowHeader() const
-{
- PTableModel pModel = GetModel();
- return pModel->hasRowHeaders();
-}
-sal_Int32 TableControl::GetSelectedRowCount() const
-{
- return m_pImpl->getSelectedRows().size();
-}
-bool TableControl::IsRowSelected( long _nRow ) const
-{
- return m_pImpl->isRowSelected(m_pImpl->getSelectedRows(), _nRow);
-}
-sal_Bool TableControl::ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint )
-{
- _rnRow = m_pImpl->getCurrentRow(_rPoint);
- _rnColPos = GetCurrentColumn();
- return _rnRow>=0 ? sal_True : sal_False;
-}
-void TableControl::FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const
-{
- if ( GetCurrentRow() == _nRow && GetCurrentColumn() == _nColumnPos )
- _rStateSet.AddState( AccessibleStateType::FOCUSED );
- else // only transient when column is not focused
- _rStateSet.AddState( AccessibleStateType::TRANSIENT );
-}
-Rectangle TableControl::GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex)
-{
- (void)_nRow;
- (void)_nColumnPos;
- return GetCharacterBounds(nIndex);
-}
-sal_Int32 TableControl::GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint)
-{
- (void)_nRow;
- (void)_nColumnPos;
- return GetIndexForPoint(_rPoint);
-;
-}
- // -----------------------------------------------------------------------------
-sal_Bool TableControl::isAccessibleAlive( ) const
-{
- return ( NULL != m_pAccessTable->m_pAccessible ) && m_pAccessTable->m_pAccessible->isAlive();
-}
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XAccessible > TableControl::GetAccessible( sal_Bool bCreate )
+ {
+ return Control::GetAccessible( bCreate );
+ }
-// -----------------------------------------------------------------------------
-::svt::IAccessibleFactory& TableControl::getAccessibleFactory()
-{
- return m_pAccessTable->m_aFactoryAccess.getFactory();
-}
-// -----------------------------------------------------------------------------
-void TableControl::commitGridControlEvent( sal_Int16 _nEventId, const Any& _rNewValue, const Any& _rOldValue )
-{
- if ( isAccessibleAlive() )
- m_pAccessTable->m_pAccessible->commitEvent( _nEventId, _rNewValue, _rOldValue);
-}
-// -----------------------------------------------------------------------------
-Rectangle TableControl::calcHeaderRect(sal_Bool _bIsColumnBar,BOOL _bOnScreen)
-{
- (void)_bOnScreen;
- return m_pImpl->calcHeaderRect(_bIsColumnBar);
-}
-// -----------------------------------------------------------------------------
-Rectangle TableControl::calcTableRect(BOOL _bOnScreen)
-{
- (void)_bOnScreen;
- return m_pImpl->calcTableRect();
-}
-//--------------------------------------------------------------------
-::com::sun::star::uno::Sequence< sal_Int32 >& TableControl::getColumnsForTooltip()
-{
- return m_nCols;
-}
-//--------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::rtl::OUString >& TableControl::getTextForTooltip()
-{
- return m_aText;
-}
-//--------------------------------------------------------------------
-void TableControl::setTooltip(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aText, const ::com::sun::star::uno::Sequence< sal_Int32 >& nCols )
-{
- m_aText = aText;
- m_nCols = nCols;
- m_bTooltip = true;
-}
-// -----------------------------------------------------------------------
-void TableControl::selectionChanged(bool _bChanged)
-{
- m_bSelectionChanged = _bChanged;
-}
-// -----------------------------------------------------------------------
-bool TableControl::isTooltip()
-{
- return m_bTooltip;
-}
-// -----------------------------------------------------------------------
-IMPL_LINK( TableControl, ImplSelectHdl, void*, EMPTYARG )
-{
- Select();
- return 1;
-}
-IMPL_LINK( TableControl, ImplMouseButtonDownHdl, MouseEvent*, pData )
-{
- CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, pData );
- return 1;
-}
-IMPL_LINK( TableControl, ImplMouseButtonUpHdl, MouseEvent*, pData )
-{
- CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONUP, pData );
- return 1;
-}
-// -----------------------------------------------------------------------
-void TableControl::Select()
-{
- ImplCallEventListenersAndHandler( VCLEVENT_TABLEROW_SELECT, m_aSelectHdl, this );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ Window* TableControl::GetAccessibleParentWindow() const
+ {
+ return Control::GetAccessibleParentWindow();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Window* TableControl::GetWindowInstance()
+ {
+ return this;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool TableControl::HasRowHeader()
+ {
+ return GetModel()->hasRowHeaders();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool TableControl::HasColHeader()
+ {
+ return GetModel()->hasColumnHeaders();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Int32 TableControl::GetAccessibleControlCount() const
+ {
+ sal_Int32 count = 0;
+ if(GetRowCount()>0)
+ count+=1;
+ if(GetModel()->hasRowHeaders())
+ count+=1;
+ if(GetModel()->hasColumnHeaders())
+ count+=1;
+ return count;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool TableControl::ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint )
+ {
+ sal_Int32 nRow = m_pImpl->getRowAtPoint( _rPoint );
+ sal_Int32 nCol = m_pImpl->getColAtPoint( _rPoint );
+ _rnIndex = nRow * GetColumnCount() + nCol;
+ return nRow >= 0 ? sal_True : sal_False;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ long TableControl::GetRowCount() const
+ {
+ return GetModel()->getRowCount();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ long TableControl::GetColumnCount() const
+ {
+ return GetModel()->getColumnCount();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool TableControl::HasRowHeader() const
+ {
+ return GetModel()->hasRowHeaders();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool TableControl::ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint )
+ {
+ _rnRow = m_pImpl->getRowAtPoint( _rPoint );
+ _rnColPos = m_pImpl->getColAtPoint( _rPoint );
+ return _rnRow >= 0 ? sal_True : sal_False;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl::FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const
+ {
+ if ( GetCurrentRow() == _nRow && GetCurrentColumn() == _nColumnPos )
+ _rStateSet.AddState( AccessibleStateType::FOCUSED );
+ else // only transient when column is not focused
+ _rStateSet.AddState( AccessibleStateType::TRANSIENT );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Rectangle TableControl::GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex)
+ {
+ (void)_nRow;
+ (void)_nColumnPos;
+ return GetCharacterBounds(nIndex);
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Int32 TableControl::GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint)
+ {
+ (void)_nRow;
+ (void)_nColumnPos;
+ return GetIndexForPoint(_rPoint);
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Rectangle TableControl::calcHeaderRect(sal_Bool _bIsColumnBar,sal_Bool _bOnScreen)
+ {
+ (void)_bOnScreen;
+ return m_pImpl->calcHeaderRect( _bIsColumnBar ? false : true );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Rectangle TableControl::calcTableRect(sal_Bool _bOnScreen)
+ {
+ (void)_bOnScreen;
+ return m_pImpl->calcTableRect();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ IMPL_LINK( TableControl, ImplSelectHdl, void*, EMPTYARG )
+ {
+ Select();
+ return 1;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ IMPL_LINK( TableControl, ImplMouseButtonDownHdl, MouseEvent*, pData )
+ {
+ CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, pData );
+ return 1;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ IMPL_LINK( TableControl, ImplMouseButtonUpHdl, MouseEvent*, pData )
+ {
+ CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONUP, pData );
+ return 1;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl::Select()
+ {
+ ImplCallEventListenersAndHandler( VCLEVENT_TABLEROW_SELECT, m_pImpl->getSelectHandler(), this );
+ }
//........................................................................
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl::SetSelectHdl( const Link& i_selectHandler )
+ {
+ m_pImpl->setSelectHandler( i_selectHandler );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ const Link& TableControl::GetSelectHdl() const
+ {
+ return m_pImpl->getSelectHandler();
+ }
}} // namespace svt::table
-//........................................................................
+//......................................................................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx
index a02dd9a2a50d..bbcdbfaddeb6 100644..100755
--- a/svtools/source/table/tablecontrol_impl.cxx
+++ b/svtools/source/table/tablecontrol_impl.cxx
@@ -31,40 +31,60 @@
#include "svtools/table/tablecontrol.hxx"
#include "svtools/table/defaultinputhandler.hxx"
#include "svtools/table/tablemodel.hxx"
+
+#include "tabledatawindow.hxx"
#include "tablecontrol_impl.hxx"
#include "tablegeometry.hxx"
-#include "svtools/table/tabledatawindow.hxx"
-#include <com/sun/star/awt/XControl.hpp>
+#include "cellvalueconversion.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/AccessibleTableModelChange.hpp>
+#include <com/sun/star/accessibility/AccessibleEventId.hpp>
+#include <com/sun/star/accessibility/AccessibleTableModelChangeType.hpp>
+/** === end UNO includes === **/
+
+#include <comphelper/flagguard.hxx>
#include <vcl/scrbar.hxx>
#include <vcl/seleng.hxx>
#include <rtl/ref.hxx>
-#include <toolkit/awt/vclxwindow.hxx>
#include <vcl/image.hxx>
-#include <com/sun/star/graphic/XGraphic.hpp>
+#include <tools/diagnose_ex.h>
#include <functional>
-#include <stdlib.h>
-//........................................................................
+#define MIN_COLUMN_WIDTH_PIXEL 4
+
+//......................................................................................................................
namespace svt { namespace table
{
-//........................................................................
-
- //====================================================================
- //= TempHideCursor
- //====================================================================
- class TempHideCursor
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::accessibility::AccessibleTableModelChange;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::accessibility::XAccessible;
+ using ::com::sun::star::uno::Reference;
+ /** === end UNO using === **/
+ namespace AccessibleEventId = ::com::sun::star::accessibility::AccessibleEventId;
+ namespace AccessibleTableModelChangeType = ::com::sun::star::accessibility::AccessibleTableModelChangeType;
+
+ //==================================================================================================================
+ //= SuppressCursor
+ //==================================================================================================================
+ class SuppressCursor
{
private:
- IAbstractTableControl& m_rTable;
+ ITableControl& m_rTable;
public:
- TempHideCursor( IAbstractTableControl& _rTable )
+ SuppressCursor( ITableControl& _rTable )
:m_rTable( _rTable )
{
m_rTable.hideCursor();
}
- ~TempHideCursor()
+ ~SuppressCursor()
{
m_rTable.showCursor();
}
@@ -103,50 +123,18 @@ namespace svt { namespace table
{
return false;
}
- virtual void setRowHeaders(bool _bRowHeaders)
- {
- (void)_bRowHeaders;
- }
- virtual void setColumnHeaders(bool _bColumnHeaders)
- {
- (void)_bColumnHeaders;
- }
- void setColumnCount(TableSize _nColCount)
- {
- (void) _nColCount;
- }
- void setRowCount(TableSize _nRowCount)
- {
- (void)_nRowCount;
- }
virtual bool isCellEditable( ColPos col, RowPos row ) const
{
(void)col;
(void)row;
return false;
}
- virtual void addTableModelListener( const PTableModelListener& listener )
- {
- (void)listener;
- // ignore
- }
- virtual void removeTableModelListener( const PTableModelListener& listener )
- {
- (void)listener;
- // ignore
- }
virtual PColumnModel getColumnModel( ColPos column )
{
OSL_FAIL( "EmptyTableModel::getColumnModel: invalid call!" );
(void)column;
return PColumnModel();
}
- virtual PColumnModel getColumnModelByID( ColumnID id )
- {
- OSL_FAIL( "EmptyTableModel::getColumnModel: invalid call!" );
- (void)id;
- return PColumnModel();
- }
virtual PTableRenderer getRenderer() const
{
return PTableRenderer();
@@ -171,83 +159,68 @@ namespace svt { namespace table
{
return 0;
}
- virtual ScrollbarVisibility getVerticalScrollbarVisibility(int , int ) const
+ virtual ScrollbarVisibility getVerticalScrollbarVisibility() const
{
- return ScrollbarShowNever;
+ return ScrollbarShowNever;
}
- virtual ScrollbarVisibility getHorizontalScrollbarVisibility(int , int ) const
+ virtual ScrollbarVisibility getHorizontalScrollbarVisibility() const
{
- return ScrollbarShowNever;
+ return ScrollbarShowNever;
+ }
+ virtual void addTableModelListener( const PTableModelListener& i_listener )
+ {
+ (void)i_listener;
+ }
+ virtual void removeTableModelListener( const PTableModelListener& i_listener )
+ {
+ (void)i_listener;
+ }
+ virtual ::boost::optional< ::Color > getLineColor() const
+ {
+ return ::boost::optional< ::Color >();
+ }
+ virtual ::boost::optional< ::Color > getHeaderBackgroundColor() const
+ {
+ return ::boost::optional< ::Color >();
+ }
+ virtual ::boost::optional< ::Color > getHeaderTextColor() const
+ {
+ return ::boost::optional< ::Color >();
+ }
+ virtual ::boost::optional< ::Color > getTextColor() const
+ {
+ return ::boost::optional< ::Color >();
+ }
+ virtual ::boost::optional< ::Color > getTextLineColor() const
+ {
+ return ::boost::optional< ::Color >();
+ }
+ virtual ::boost::optional< ::std::vector< ::Color > > getRowBackgroundColors() const
+ {
+ return ::boost::optional< ::std::vector< ::Color > >();
+ }
+ virtual ::com::sun::star::style::VerticalAlignment getVerticalAlign() const
+ {
+ return com::sun::star::style::VerticalAlignment(0);
+ }
+ virtual ITableDataSort* getSortAdapter()
+ {
+ return NULL;
+ }
+ virtual void getCellContent( ColPos const i_col, RowPos const i_row, ::com::sun::star::uno::Any& o_cellContent )
+ {
+ (void)i_row;
+ (void)i_col;
+ o_cellContent.clear();
+ }
+ virtual void getCellToolTip( ColPos const, RowPos const, ::com::sun::star::uno::Any& )
+ {
+ }
+ virtual Any getRowHeading( RowPos const i_rowPos ) const
+ {
+ (void)i_rowPos;
+ return Any();
}
- virtual bool hasVerticalScrollbar()
- {
- return false;
- }
- virtual bool hasHorizontalScrollbar()
- {
- return false;
- }
- virtual void setCellContent(const std::vector<std::vector< ::com::sun::star::uno::Any > >& )
- {
- }
- virtual ::com::sun::star::util::Color getLineColor()
- {
- return 0;
- }
- virtual void setLineColor(::com::sun::star::util::Color )
- {
- }
- virtual ::com::sun::star::util::Color getHeaderBackgroundColor()
- {
- return -1;
- }
- virtual void setHeaderBackgroundColor(::com::sun::star::util::Color )
- {
- }
- virtual ::com::sun::star::util::Color getTextColor()
- {
- return 0;
- }
- virtual void setTextColor(::com::sun::star::util::Color )
- {
- }
- virtual ::com::sun::star::util::Color getOddRowBackgroundColor()
- {
- return -1;
- }
- virtual void setOddRowBackgroundColor(::com::sun::star::util::Color )
- {
- }
- virtual ::com::sun::star::style::VerticalAlignment getVerticalAlign()
- {
- return com::sun::star::style::VerticalAlignment(0);
- }
- virtual void setVerticalAlign(com::sun::star::style::VerticalAlignment )
- {
- }
- virtual ::com::sun::star::util::Color getEvenRowBackgroundColor()
- {
- return -1;
- }
- virtual void setEvenRowBackgroundColor(::com::sun::star::util::Color )
- {
- }
- virtual std::vector<std::vector< ::com::sun::star::uno::Any > >& getCellContent()
- {
- return m_aCellContent;
- }
- virtual void setRowHeaderName(const std::vector<rtl::OUString>& )
- {
- }
- virtual std::vector<rtl::OUString>& getRowHeaderName()
- {
- aRowHeaderNames.clear();
- aRowHeaderNames.push_back( rtl::OUString() );
- return aRowHeaderNames;
- }
- private:
- std::vector<rtl::OUString> aRowHeaderNames;
- std::vector<std::vector< ::com::sun::star::uno::Any > > m_aCellContent;
};
@@ -313,7 +286,7 @@ namespace svt { namespace table
}
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
const sal_Char* TableControl_Impl::impl_checkInvariants() const
{
if ( !m_pModel )
@@ -328,12 +301,9 @@ namespace svt { namespace table
if ( m_pModel->getRowCount() != m_nRowCount )
return "row counts are inconsistent!";
- if ( ( ( m_nCurColumn != COL_INVALID ) && !m_aColumnWidthsPixel.empty() && ( m_nCurColumn < 0 ) ) || ( m_nCurColumn >= (ColPos)m_aColumnWidthsPixel.size() ) )
+ if ( ( ( m_nCurColumn != COL_INVALID ) && !m_aColumnWidths.empty() && ( m_nCurColumn < 0 ) ) || ( m_nCurColumn >= (ColPos)m_aColumnWidths.size() ) )
return "current column is invalid!";
- if ( m_aColumnWidthsPixel.size() != m_aAccColumnWidthsPixel.size() )
- return "columnd width caches are inconsistent!";
-
if ( !lcl_checkLimitsExclusive_OrDefault_OrFallback( m_nTopRow, (RowPos)-1, m_nRowCount, getModel(), (RowPos)0 ) )
return "invalid top row value!";
@@ -349,6 +319,20 @@ namespace svt { namespace table
if ( m_pInputHandler != m_pModel->getInputHandler() )
return "input handler is not the model-provided one!";
+ // m_aSelectedRows should have reasonable content
+ {
+ if ( m_aSelectedRows.size() > size_t( m_pModel->getRowCount() ) )
+ return "there are more rows selected than actually exist";
+ for ( ::std::vector< RowPos >::const_iterator selRow = m_aSelectedRows.begin();
+ selRow != m_aSelectedRows.end();
+ ++selRow
+ )
+ {
+ if ( ( *selRow < 0 ) || ( *selRow >= m_pModel->getRowCount() ) )
+ return "a non-existent row is selected";
+ }
+ }
+
// m_nColHeaderHeightPixel consistent with the model's value?
{
TableMetrics nHeaderHeight = m_pModel->hasColumnHeaders() ? m_pModel->getColumnHeaderHeight() : 0;
@@ -374,7 +358,28 @@ namespace svt { namespace table
return "row header widths are inconsistent!";
}
- // TODO: check m_aColumnWidthsPixel and m_aAccColumnWidthsPixel
+ // m_aColumnWidths consistency
+ if ( size_t( m_nColumnCount ) != m_aColumnWidths.size() )
+ return "wrong number of cached column widths";
+
+ for ( ColumnPositions::const_iterator col = m_aColumnWidths.begin();
+ col != m_aColumnWidths.end();
+ )
+ {
+ if ( col->getEnd() < col->getStart() )
+ return "column widths: 'end' is expected to not be smaller than start";
+
+ ColumnPositions::const_iterator nextCol = col + 1;
+ if ( nextCol != m_aColumnWidths.end() )
+ if ( col->getEnd() != nextCol->getStart() )
+ return "column widths: one column's end should be the next column's start";
+ col = nextCol;
+ }
+
+ if ( m_nLeftColumn < m_nColumnCount )
+ if ( m_aColumnWidths[ m_nLeftColumn ].getStart() != m_nRowHeaderWidthPixel )
+ return "the left-most column should start immediately after the row header";
+
if ( m_nCursorHidden < 0 )
return "invalid hidden count for the cursor!";
@@ -383,6 +388,8 @@ namespace svt { namespace table
DBG_SUSPEND_INV( INV_SCROLL_POSITION );
// prevent infinite recursion
+ if ( m_nLeftColumn < 0 )
+ return "invalid left-most column index";
if ( m_pVScroll->GetThumbPos() != m_nTopRow )
return "vertical scroll bar |position| is incorrect!";
if ( m_pVScroll->GetRange().Max() != m_nRowCount )
@@ -411,44 +418,44 @@ namespace svt { namespace table
#define DBG_CHECK_ME() \
DBG_CHKTHIS( TableControl_Impl, TableControl_Impl_checkInvariants )
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
TableControl_Impl::TableControl_Impl( TableControl& _rAntiImpl )
:m_rAntiImpl ( _rAntiImpl )
,m_pModel ( new EmptyTableModel )
,m_pInputHandler ( )
,m_nRowHeightPixel ( 15 )
- ,m_nColHeaderHeightPixel( 0 )
+ ,m_nColHeaderHeightPixel( 0 )
,m_nRowHeaderWidthPixel ( 0 )
,m_nColumnCount ( 0 )
,m_nRowCount ( 0 )
+ ,m_bColumnsFit ( true )
,m_nCurColumn ( COL_INVALID )
,m_nCurRow ( ROW_INVALID )
,m_nLeftColumn ( 0 )
- ,m_nTopRow ( 0 )
+ ,m_nTopRow ( 0 )
,m_nCursorHidden ( 1 )
,m_pDataWindow ( new TableDataWindow( *this ) )
- ,m_pVScroll ( NULL )
+ ,m_pVScroll ( NULL )
,m_pHScroll ( NULL )
,m_pScrollCorner ( NULL )
- ,m_pSelEngine ( )
- ,m_nRowSelected ( )
- ,m_pTableFunctionSet ( new TableFunctionSet(this ) )
- ,m_nAnchor (-1 )
- ,m_bResizing ( false )
- ,m_nResizingColumn ( 0 )
- ,m_bResizingGrid ( false )
+ ,m_pSelEngine ( )
+ ,m_aSelectedRows ( )
+ ,m_pTableFunctionSet ( new TableFunctionSet( this ) )
+ ,m_nAnchor ( -1 )
+ ,m_bUpdatingColWidths ( false )
+ ,m_pAccessibleTable ( NULL )
#if DBG_UTIL
,m_nRequiredInvariants ( INV_SCROLL_POSITION )
#endif
{
DBG_CTOR( TableControl_Impl, TableControl_Impl_checkInvariants );
- m_pSelEngine = new SelectionEngine(m_pDataWindow, m_pTableFunctionSet);
- m_pSelEngine->SetSelectionMode(SINGLE_SELECTION);
+ m_pSelEngine = new SelectionEngine( m_pDataWindow.get(), m_pTableFunctionSet );
+ m_pSelEngine->SetSelectionMode(SINGLE_SELECTION);
m_pDataWindow->SetPosPixel( Point( 0, 0 ) );
m_pDataWindow->Show();
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
TableControl_Impl::~TableControl_Impl()
{
DBG_DTOR( TableControl_Impl, TableControl_Impl_checkInvariants );
@@ -458,35 +465,30 @@ namespace svt { namespace table
DELETEZ( m_pScrollCorner );
DELETEZ( m_pTableFunctionSet );
DELETEZ( m_pSelEngine );
- DELETEZ( m_pDataWindow );
}
- //--------------------------------------------------------------------
- PTableModel TableControl_Impl::getModel() const
- {
- if ( dynamic_cast< const EmptyTableModel* >( m_pModel.get() ) != NULL )
- // if it's an EmptyTableModel, pretend that there is no model
- return PTableModel();
-
- return m_pModel;
- }
-
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::setModel( PTableModel _pModel )
{
DBG_CHECK_ME();
- TempHideCursor aHideCursor( *this );
+ SuppressCursor aHideCursor( *this );
+
+ if ( !!m_pModel )
+ m_pModel->removeTableModelListener( shared_from_this() );
m_pModel = _pModel;
if ( !m_pModel)
m_pModel.reset( new EmptyTableModel );
+ m_pModel->addTableModelListener( shared_from_this() );
+
m_nCurRow = ROW_INVALID;
m_nCurColumn = COL_INVALID;
// recalc some model-dependent cached info
impl_ni_updateCachedModelValues();
+ impl_ni_updateScrollbars();
// completely invalidate
m_rAntiImpl.Invalidate();
@@ -496,67 +498,308 @@ namespace svt { namespace table
if ( m_nColumnCount ) m_nCurColumn = 0;
}
- //--------------------------------------------------------------------
- void TableControl_Impl::impl_getAllVisibleCellsArea( Rectangle& _rCellArea ) const
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ bool lcl_adjustSelectedRows( ::std::vector< RowPos >& io_selectionIndexes, RowPos const i_firstAffectedRowIndex, TableSize const i_offset )
+ {
+ bool didChanges = false;
+ for ( ::std::vector< RowPos >::iterator selPos = io_selectionIndexes.begin();
+ selPos != io_selectionIndexes.end();
+ ++selPos
+ )
+ {
+ if ( *selPos < i_firstAffectedRowIndex )
+ continue;
+ *selPos += i_offset;
+ didChanges = true;
+ }
+ return didChanges;
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::rowsInserted( RowPos i_first, RowPos i_last )
{
DBG_CHECK_ME();
+ OSL_PRECOND( i_last >= i_first, "TableControl_Impl::rowsInserted: invalid row indexes!" );
+
+ TableSize const insertedRows = i_last - i_first + 1;
+
+ // adjust selection, if necessary
+ bool const selectionChanged = lcl_adjustSelectedRows( m_aSelectedRows, i_first, insertedRows );
+
+ // adjust our cached row count
+ m_nRowCount = m_pModel->getRowCount();
+
+ // if the rows have been inserted before the current row, adjust this
+ if ( i_first <= m_nCurRow )
+ goTo( m_nCurColumn, m_nCurRow + insertedRows );
+
+ // adjust scrollbars
+ impl_ni_updateScrollbars();
+
+ // notify A1YY events
+ if ( impl_isAccessibleAlive() )
+ {
+ impl_commitAccessibleEvent( AccessibleEventId::TABLE_MODEL_CHANGED,
+ makeAny( AccessibleTableModelChange( AccessibleTableModelChangeType::INSERT, i_first, i_last, 0, m_pModel->getColumnCount() ) ),
+ Any()
+ );
+ impl_commitAccessibleEvent( AccessibleEventId::CHILD,
+ makeAny( m_pAccessibleTable->getTableHeader( TCTYPE_ROWHEADERBAR ) ),
+ Any()
+ );
+
+// for ( sal_Int32 i = 0 ; i <= m_pModel->getColumnCount(); ++i )
+// {
+// impl_commitAccessibleEvent(
+// CHILD,
+// makeAny( m_pAccessibleTable->getTable() ),
+// Any());
+// }
+ // Huh? What's that? We're notifying |columnCount| CHILD events here, claiming the *table* itself
+ // has been inserted. Doesn't make much sense, does it?
+ }
+
+ // schedule repaint
+ invalidateRowRange( i_first, ROW_INVALID );
+
+ // call selection handlers, if necessary
+ if ( selectionChanged )
+ m_rAntiImpl.Select();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::rowsRemoved( RowPos i_first, RowPos i_last )
+ {
+ sal_Int32 firstRemovedRow = i_first;
+ sal_Int32 lastRemovedRow = i_last;
+
+ // adjust selection, if necessary
+ bool selectionChanged = false;
+ if ( i_first == -1 )
+ {
+ selectionChanged = markAllRowsAsDeselected();
+
+ firstRemovedRow = 0;
+ lastRemovedRow = m_nRowCount - 1;
+ }
+ else
+ {
+ ENSURE_OR_RETURN_VOID( i_last >= i_first, "TableControl_Impl::rowsRemoved: illegal indexes!" );
+
+ for ( sal_Int32 row = i_first; row <= i_last; ++row )
+ {
+ if ( markRowAsDeselected( row ) )
+ selectionChanged = true;
+ }
+
+ if ( lcl_adjustSelectedRows( m_aSelectedRows, i_last + 1, i_first - i_last - 1 ) )
+ selectionChanged = true;
+ }
+
+ // adjust cached row count
+ m_nRowCount = m_pModel->getRowCount();
+
+ // adjust the current row, if it is larger than the row count now
+ if ( m_nCurRow >= m_nRowCount )
+ {
+ if ( m_nRowCount > 0 )
+ goTo( m_nCurColumn, m_nRowCount - 1 );
+ else
+ m_nCurRow = ROW_INVALID;
+ }
+
+ // adjust scrollbars
+ impl_ni_updateScrollbars();
+
+ // notify A11Y events
+ if ( impl_isAccessibleAlive() )
+ {
+ impl_commitAccessibleEvent(
+ AccessibleEventId::TABLE_MODEL_CHANGED,
+ makeAny( AccessibleTableModelChange(
+ AccessibleTableModelChangeType::DELETE,
+ firstRemovedRow,
+ lastRemovedRow,
+ 0,
+ m_pModel->getColumnCount()
+ ) ),
+ Any()
+ );
+ }
+
+ // schedule a repaint
+ invalidateRowRange( firstRemovedRow, ROW_INVALID );
- _rCellArea.Left() = 0;
- _rCellArea.Top() = 0;
+ // call selection handlers, if necessary
+ if ( selectionChanged )
+ m_rAntiImpl.Select();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::columnInserted( ColPos const i_colIndex )
+ {
+ m_nColumnCount = m_pModel->getColumnCount();
+ impl_ni_updateColumnWidths();
+ impl_ni_updateScrollbars();
+
+ m_rAntiImpl.Invalidate();
+
+ OSL_UNUSED( i_colIndex );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::columnRemoved( ColPos const i_colIndex )
+ {
+ m_nColumnCount = m_pModel->getColumnCount();
+ impl_ni_updateColumnWidths();
+ impl_ni_updateScrollbars();
+
+ m_rAntiImpl.Invalidate();
+
+ OSL_UNUSED( i_colIndex );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::allColumnsRemoved()
+ {
+ m_nColumnCount = m_pModel->getColumnCount();
+ impl_ni_updateColumnWidths();
+ impl_ni_updateScrollbars();
+
+ m_rAntiImpl.Invalidate();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::cellsUpdated( ColPos const i_firstCol, ColPos i_lastCol, RowPos const i_firstRow, RowPos const i_lastRow )
+ {
+ invalidateRowRange( i_firstRow, i_lastRow );
+
+ OSL_UNUSED( i_firstCol );
+ OSL_UNUSED( i_lastCol );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::tableMetricsChanged()
+ {
+ long const oldRowHeaderWidthPixel = m_nRowHeaderWidthPixel;
+ impl_ni_updateCachedTableMetrics();
+ if ( oldRowHeaderWidthPixel != m_nRowHeaderWidthPixel )
+ impl_ni_updateColumnWidths();
+ impl_ni_updateScrollbars();
+ m_rAntiImpl.Invalidate();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::impl_invalidateColumn( ColPos const i_column )
+ {
+ DBG_CHECK_ME();
+
+ Rectangle const aAllCellsArea( impl_getAllVisibleCellsArea() );
+
+ const TableColumnGeometry aColumn( *this, aAllCellsArea, i_column );
+ if ( aColumn.isValid() )
+ m_rAntiImpl.Invalidate( aColumn.getRect() );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::columnChanged( ColPos const i_column, ColumnAttributeGroup const i_attributeGroup )
+ {
+ ColumnAttributeGroup nGroup( i_attributeGroup );
+ if ( nGroup & COL_ATTRS_APPEARANCE )
+ {
+ impl_invalidateColumn( i_column );
+ nGroup &= ~COL_ATTRS_APPEARANCE;
+ }
+
+ if ( nGroup & COL_ATTRS_WIDTH )
+ {
+ if ( !m_bUpdatingColWidths )
+ {
+ impl_ni_updateColumnWidths( i_column );
+ invalidate( TableAreaAll );
+ impl_ni_updateScrollbars();
+ }
+
+ nGroup &= ~COL_ATTRS_WIDTH;
+ }
+
+ OSL_ENSURE( ( nGroup == COL_ATTRS_NONE ) || ( i_attributeGroup == COL_ATTRS_ALL ),
+ "TableControl_Impl::columnChanged: don't know how to handle this change!" );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Rectangle TableControl_Impl::impl_getAllVisibleCellsArea() const
+ {
+ DBG_CHECK_ME();
+
+ Rectangle aArea( Point( 0, 0 ), Size( 0, 0 ) );
// determine the right-most border of the last column which is
// at least partially visible
- _rCellArea.Right() = m_nRowHeaderWidthPixel;
- if ( !m_aAccColumnWidthsPixel.empty() )
+ aArea.Right() = m_nRowHeaderWidthPixel;
+ if ( !m_aColumnWidths.empty() )
{
- // the number of pixels which are scroll out of the left hand
+ // the number of pixels which are scrolled out of the left hand
// side of the window
- long nScrolledOutLeft = m_nLeftColumn == 0 ? 0 : m_aAccColumnWidthsPixel[ m_nLeftColumn - 1 ];
+ const long nScrolledOutLeft = m_nLeftColumn == 0 ? 0 : m_aColumnWidths[ m_nLeftColumn - 1 ].getEnd();
- ArrayOfLong::const_reverse_iterator loop = m_aAccColumnWidthsPixel.rbegin();
+ ColumnPositions::const_reverse_iterator loop = m_aColumnWidths.rbegin();
do
{
- _rCellArea.Right() = *loop++ - nScrolledOutLeft + m_nRowHeaderWidthPixel;
+ aArea.Right() = loop->getEnd() - nScrolledOutLeft + m_nRowHeaderWidthPixel;
+ ++loop;
}
- while ( ( loop != m_aAccColumnWidthsPixel.rend() )
- && ( *loop - nScrolledOutLeft >= _rCellArea.Right() )
+ while ( ( loop != m_aColumnWidths.rend() )
+ && ( loop->getEnd() - nScrolledOutLeft >= aArea.Right() )
);
}
- // so far, _rCellArea.Right() denotes the first pixel *after* the cell area
- --_rCellArea.Right();
+ // so far, aArea.Right() denotes the first pixel *after* the cell area
+ --aArea.Right();
// determine the last row which is at least partially visible
- _rCellArea.Bottom() =
+ aArea.Bottom() =
m_nColHeaderHeightPixel
+ impl_getVisibleRows( true ) * m_nRowHeightPixel
- 1;
+
+ return aArea;
}
- //--------------------------------------------------------------------
- void TableControl_Impl::impl_getAllVisibleDataCellArea( Rectangle& _rCellArea ) const
+ //------------------------------------------------------------------------------------------------------------------
+ Rectangle TableControl_Impl::impl_getAllVisibleDataCellArea() const
{
DBG_CHECK_ME();
- impl_getAllVisibleCellsArea( _rCellArea );
- _rCellArea.Left() = m_nRowHeaderWidthPixel;
- _rCellArea.Top() = m_nColHeaderHeightPixel;
+ Rectangle aArea( impl_getAllVisibleCellsArea() );
+ aArea.Left() = m_nRowHeaderWidthPixel;
+ aArea.Top() = m_nColHeaderHeightPixel;
+ return aArea;
}
- //--------------------------------------------------------------------
- void TableControl_Impl::impl_ni_updateCachedModelValues()
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::impl_ni_updateCachedTableMetrics()
{
- m_nRowHeightPixel = 15;
- m_nColHeaderHeightPixel = 0;
- m_nRowHeaderWidthPixel = 0;
- m_pInputHandler.reset();
- m_nColumnCount = m_nRowCount = 0;
+ m_nRowHeightPixel = m_rAntiImpl.LogicToPixel( Size( 0, m_pModel->getRowHeight() ), MAP_APPFONT ).Height();
- m_nRowHeightPixel = m_rAntiImpl.LogicToPixel( Size( 0, m_pModel->getRowHeight() ), MAP_APPFONT ).Height();
- if ( m_pModel->hasColumnHeaders() )
+ m_nColHeaderHeightPixel = 0;
+ if ( m_pModel->hasColumnHeaders() )
m_nColHeaderHeightPixel = m_rAntiImpl.LogicToPixel( Size( 0, m_pModel->getColumnHeaderHeight() ), MAP_APPFONT ).Height();
+
+ m_nRowHeaderWidthPixel = 0;
if ( m_pModel->hasRowHeaders() )
m_nRowHeaderWidthPixel = m_rAntiImpl.LogicToPixel( Size( m_pModel->getRowHeaderWidth(), 0 ), MAP_APPFONT).Width();
+ }
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::impl_ni_updateCachedModelValues()
+ {
+ m_pInputHandler.reset();
+ m_nColumnCount = m_nRowCount = 0;
+
+ impl_ni_updateCachedTableMetrics();
impl_ni_updateColumnWidths();
m_pInputHandler = m_pModel->getInputHandler();
@@ -567,145 +810,280 @@ namespace svt { namespace table
m_nRowCount = m_pModel->getRowCount();
}
- //--------------------------------------------------------------------
- void TableControl_Impl::impl_ni_updateColumnWidths()
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::impl_ni_updateColumnWidths( ColPos const i_assumeInflexibleColumnsUpToIncluding )
{
- m_aColumnWidthsPixel.resize( 0 );
- m_aAccColumnWidthsPixel.resize( 0 );
+ ENSURE_OR_RETURN_VOID( !m_bUpdatingColWidths, "TableControl_Impl::impl_ni_updateColumnWidths: recursive call detected!" );
+
+ m_aColumnWidths.resize( 0 );
if ( !m_pModel )
return;
- TableSize colCount = m_pModel->getColumnCount();
+ const TableSize colCount = m_pModel->getColumnCount();
+ if ( colCount == 0 )
+ return;
+
+ m_bUpdatingColWidths = true;
+ const ::comphelper::FlagGuard aWidthUpdateFlag( m_bUpdatingColWidths );
+
+ m_aColumnWidths.reserve( colCount );
- m_aColumnWidthsPixel.reserve( colCount );
- m_aAccColumnWidthsPixel.reserve( colCount );
- if(colCount>0)
+ // the available horizontal space
+ long gridWidthPixel = m_rAntiImpl.GetOutputSizePixel().Width();
+ if ( m_pModel->hasRowHeaders() && ( gridWidthPixel != 0 ) )
{
- std::vector<sal_Int32> aPrePixelWidths(0);
- long accumulatedPixelWidth = 0;
- int lastResizableCol = -1;
- double gridWidth = m_rAntiImpl.GetOutputSizePixel().Width();
- if(m_pModel->hasRowHeaders())
- {
- TableMetrics rowHeaderWidth = m_pModel->getRowHeaderWidth();
- gridWidth-= m_rAntiImpl.LogicToPixel( Size( rowHeaderWidth, 0 ), MAP_APPFONT ).Width();
- }
- if(m_pModel->hasVerticalScrollbar())
+ gridWidthPixel -= m_nRowHeaderWidthPixel;
+ }
+ if ( m_pModel->getVerticalScrollbarVisibility() != ScrollbarShowNever )
+ {
+ long nScrollbarMetrics = m_rAntiImpl.GetSettings().GetStyleSettings().GetScrollBarSize();
+ gridWidthPixel -= nScrollbarMetrics;
+ }
+
+ // TODO: shouldn't we take the visibility of the vertical scroll bar into account here, too?
+ long const gridWidthAppFont = m_rAntiImpl.PixelToLogic( Size( gridWidthPixel, 0 ), MAP_APPFONT ).Width();
+
+ // determine the accumulated current width of all columns
+ for ( ColPos col = 0; col < colCount; ++col )
+ {
+ const PColumnModel pColumn = m_pModel->getColumnModel( col );
+ ENSURE_OR_THROW( !!pColumn, "invalid column returned by the model!" );
+
+ }
+
+ // collect some meta data for our columns:
+ // - their current (appt-font) metrics
+ long accumulatedCurrentWidth = 0;
+ ::std::vector< long > currentColWidths;
+ currentColWidths.reserve( colCount );
+ // - their effective minimal and maximal width (app-font!)
+ typedef ::std::vector< ::std::pair< long, long > > ColumnLimits;
+ ColumnLimits effectiveColumnLimits;
+ effectiveColumnLimits.reserve( colCount );
+ long accumulatedMinWidth = 0;
+ long accumulatedMaxWidth = 0;
+ // - their relative flexibility
+ ::std::vector< ::sal_Int32 > columnFlexibilities;
+ columnFlexibilities.reserve( colCount );
+ long flexibilityDenominator = 0;
+ for ( ColPos col = 0; col < colCount; ++col )
+ {
+ PColumnModel const pColumn = m_pModel->getColumnModel( col );
+ ENSURE_OR_THROW( !!pColumn, "invalid column returned by the model!" );
+
+ // current width
+ TableMetrics const currentWidth = pColumn->getWidth();
+ currentColWidths.push_back( currentWidth );
+
+ // accumulated width
+ accumulatedCurrentWidth += currentWidth;
+
+ // flexibility
+ ::sal_Int32 flexibility = pColumn->getFlexibility();
+ OSL_ENSURE( flexibility >= 0, "TableControl_Impl::impl_ni_updateColumnWidths: a column's flexibility should be non-negative." );
+ if ( ( flexibility < 0 ) // normalization
+ || ( !pColumn->isResizable() ) // column not resizeable => no auto-resize
+ || ( col <= i_assumeInflexibleColumnsUpToIncluding ) // column shall be treated as inflexible => respec this
+ )
+ flexibility = 0;
+
+ // min/max width
+ long effectiveMin = currentWidth, effectiveMax = currentWidth;
+ // if the column is not flexible, it will not be asked for min/max, but we assume the current width as limit then
+ if ( flexibility > 0 )
{
- sal_Int32 scrollbarWidth = m_rAntiImpl.GetSettings().GetStyleSettings().GetScrollBarSize();
- gridWidth-=scrollbarWidth;
+ long const minWidth = pColumn->getMinWidth();
+ if ( minWidth > 0 )
+ effectiveMin = minWidth;
+ else
+ effectiveMin = MIN_COLUMN_WIDTH_PIXEL;
+
+ long const maxWidth = pColumn->getMaxWidth();
+ OSL_ENSURE( minWidth <= maxWidth, "TableControl_Impl::impl_ni_updateColumnWidths: pretty undecided 'bout its width limits, this column!" );
+ if ( ( maxWidth > 0 ) && ( maxWidth >= minWidth ) )
+ effectiveMax = maxWidth;
+ else
+ effectiveMax = gridWidthAppFont; // TODO: any better guess here?
+
+ if ( effectiveMin == effectiveMax )
+ // if the min and the max are identical, this implies no flexibility at all
+ flexibility = 0;
}
- double colWidthsSum = 0.0;
- double colWithoutFixedWidthsSum = 0.0;
- double minColWithoutFixedSum = 0.0;
- for ( ColPos col = 0; col < colCount; ++col )
+
+ columnFlexibilities.push_back( flexibility );
+ flexibilityDenominator += flexibility;
+
+ effectiveColumnLimits.push_back( ::std::pair< long, long >( effectiveMin, effectiveMax ) );
+ accumulatedMinWidth += effectiveMin;
+ accumulatedMaxWidth += effectiveMax;
+ }
+
+ ::std::vector< long > newWidths( currentColWidths );
+ if ( flexibilityDenominator == 0 )
+ {
+ // no column is flexible => don't adjust anything
+ }
+ else if ( gridWidthAppFont > accumulatedCurrentWidth )
+ { // we have space to give away ...
+ long distributeAppFontUnits = gridWidthAppFont - accumulatedCurrentWidth;
+ if ( gridWidthAppFont > accumulatedMaxWidth )
{
- PColumnModel pColumn = m_pModel->getColumnModel( col );
- DBG_ASSERT( !!pColumn, "TableControl_Impl::impl_ni_updateColumnWidths: invalid column returned by the model!" );
- if ( !pColumn )
- continue;
- TableMetrics colWidth = 0;
- TableMetrics colPrefWidth = pColumn->getPreferredWidth();
- bool bResizable = pColumn->isResizable();
- if(pColumn->getMinWidth() == 0 && bResizable)
+ // ... but the column's maximal widths are still less than we have
+ // => set them all to max
+ for ( size_t i = 0; i < size_t( colCount ); ++i )
{
- pColumn->setMinWidth(1);
- minColWithoutFixedSum+=m_rAntiImpl.PixelToLogic( Size( 1, 0 ), MAP_APPFONT ).Width();
- }
- if(pColumn->getMaxWidth() == 0 && bResizable)
- pColumn->setMaxWidth(m_rAntiImpl.PixelToLogic( Size( (int)gridWidth, 0 ), MAP_APPFONT ).Width());
- if( colPrefWidth != 0)
- {
- if(m_bResizingGrid)
- {
- colWidth = pColumn->getWidth();
- pColumn->setPreferredWidth(0);
- }
- else
- {
- colWidth = colPrefWidth;
- pColumn->setWidth(colPrefWidth);
- }
+ newWidths[i] = effectiveColumnLimits[i].second;
}
- else
- colWidth = pColumn->getWidth();
- long pixelWidth = m_rAntiImpl.LogicToPixel( Size( colWidth, 0 ), MAP_APPFONT ).Width();
- if(bResizable && colPrefWidth == 0)
- {
- colWithoutFixedWidthsSum+=pixelWidth;
- lastResizableCol = col;
- }
- colWidthsSum+=pixelWidth;
- aPrePixelWidths.push_back(pixelWidth);
- }
- double gridWidthWithoutFixed = gridWidth - colWidthsSum + colWithoutFixedWidthsSum;
- double scalingFactor = 1.0;
- if(m_bResizingGrid)
- {
- if(gridWidthWithoutFixed > (minColWithoutFixedSum+colWidthsSum - colWithoutFixedWidthsSum))
- scalingFactor = gridWidthWithoutFixed/colWithoutFixedWidthsSum;
}
else
{
- if(colWidthsSum < gridWidthWithoutFixed)
+ bool startOver = false;
+ do
{
- if(colWithoutFixedWidthsSum>0)
- scalingFactor = gridWidthWithoutFixed/colWithoutFixedWidthsSum;
+ startOver = false;
+ // distribute the remaining space amongst all columns with a positive flexibility
+ for ( size_t i=0; i<newWidths.size() && !startOver; ++i )
+ {
+ long const columnFlexibility = columnFlexibilities[i];
+ if ( columnFlexibility == 0 )
+ continue;
+
+ long newColWidth = currentColWidths[i] + columnFlexibility * distributeAppFontUnits / flexibilityDenominator;
+
+ if ( newColWidth > effectiveColumnLimits[i].second )
+ { // that was too much, we hit the col's maximum
+ // set the new width to exactly this maximum
+ newColWidth = effectiveColumnLimits[i].second;
+ // adjust the flexibility denominator ...
+ flexibilityDenominator -= columnFlexibility;
+ columnFlexibilities[i] = 0;
+ // ... and the remaining width ...
+ long const difference = newColWidth - currentColWidths[i];
+ distributeAppFontUnits -= difference;
+ // ... this way, we ensure that the width not taken up by this column is consumed by the other
+ // flexible ones (if there are some)
+
+ // and start over with the first column, since there might be earlier columns which need
+ // to be recalculated now
+ startOver = true;
+ }
+
+ newWidths[i] = newColWidth;
+ }
}
+ while ( startOver );
}
- for ( ColPos i = 0; i < colCount; ++i )
+ }
+ else if ( gridWidthAppFont < accumulatedCurrentWidth )
+ { // we need to take away some space from the columns which allow it ...
+ long takeAwayAppFontUnits = accumulatedCurrentWidth - gridWidthAppFont;
+ if ( gridWidthAppFont < accumulatedMinWidth )
{
- PColumnModel pColumn = m_pModel->getColumnModel( i );
- DBG_ASSERT( !!pColumn, "TableControl_Impl::impl_ni_updateColumnWidths: invalid column returned by the model!" );
- if ( !pColumn )
- continue;
- if(pColumn->isResizable() && pColumn->getPreferredWidth() == 0)
+ // ... but the column's minimal widths are still more than we have
+ // => set them all to min
+ for ( size_t i = 0; i < size_t( colCount ); ++i )
{
- aPrePixelWidths[i]*=scalingFactor;
- TableMetrics logicColWidth = m_rAntiImpl.PixelToLogic( Size( aPrePixelWidths[i], 0 ), MAP_APPFONT ).Width();
- pColumn->setWidth(logicColWidth);
+ newWidths[i] = effectiveColumnLimits[i].first;
}
- m_aColumnWidthsPixel.push_back( aPrePixelWidths[i] );
- m_aAccColumnWidthsPixel.push_back( accumulatedPixelWidth += aPrePixelWidths[i] );
}
- if(gridWidth > m_aAccColumnWidthsPixel[colCount-1])
+ else
{
- if(lastResizableCol >= 0)
+ bool startOver = false;
+ do
{
- PColumnModel pColumn = m_pModel->getColumnModel(lastResizableCol);
- m_aColumnWidthsPixel[lastResizableCol]+=gridWidth-m_aAccColumnWidthsPixel[colCount-1];
- TableMetrics logicColWidth1 = m_rAntiImpl.PixelToLogic( Size( m_aColumnWidthsPixel[lastResizableCol], 0 ), MAP_APPFONT ).Width();
- pColumn->setWidth(logicColWidth1);
- while(lastResizableCol < colCount)
+ startOver = false;
+ // take away the space we need from the columns with a positive flexibility
+ for ( size_t i=0; i<newWidths.size() && !startOver; ++i )
{
- if(lastResizableCol == 0)
- m_aAccColumnWidthsPixel[0] = m_aColumnWidthsPixel[lastResizableCol];
- else
- m_aAccColumnWidthsPixel[lastResizableCol]=m_aAccColumnWidthsPixel[lastResizableCol-1]+m_aColumnWidthsPixel[lastResizableCol];
- ++lastResizableCol;
+ long const columnFlexibility = columnFlexibilities[i];
+ if ( columnFlexibility == 0 )
+ continue;
+
+ long newColWidth = currentColWidths[i] - columnFlexibility * takeAwayAppFontUnits / flexibilityDenominator;
+
+ if ( newColWidth < effectiveColumnLimits[i].first )
+ { // that was too much, we hit the col's minimum
+ // set the new width to exactly this minimum
+ newColWidth = effectiveColumnLimits[i].first;
+ // adjust the flexibility denominator ...
+ flexibilityDenominator -= columnFlexibility;
+ columnFlexibilities[i] = 0;
+ // ... and the remaining width ...
+ long const difference = currentColWidths[i] - newColWidth;
+ takeAwayAppFontUnits -= difference;
+
+ // and start over with the first column, since there might be earlier columns which need
+ // to be recalculated now
+ startOver = true;
+ }
+
+ newWidths[i] = newColWidth;
}
}
+ while ( startOver );
+ }
+ }
+
+ // now that we have calculated the app-font widths, get the actual pixels
+ long accumulatedWidthPixel = m_nRowHeaderWidthPixel;
+ for ( ColPos col = 0; col < colCount; ++col )
+ {
+ long const colWidth = m_rAntiImpl.LogicToPixel( Size( newWidths[col], 0 ), MAP_APPFONT ).Width();
+ const long columnStart = accumulatedWidthPixel;
+ const long columnEnd = columnStart + colWidth;
+ m_aColumnWidths.push_back( MutableColumnMetrics( columnStart, columnEnd ) );
+ accumulatedWidthPixel = columnEnd;
+
+ // and don't forget to forward this to the column models
+ PColumnModel const pColumn = m_pModel->getColumnModel( col );
+ ENSURE_OR_THROW( !!pColumn, "invalid column returned by the model!" );
+ pColumn->setWidth( newWidths[col] );
+ }
+
+ // if the column resizing happened to leave some space at the right, but there are columns
+ // scrolled out to the left, scroll them in
+ while ( ( m_nLeftColumn > 0 )
+ && ( accumulatedWidthPixel - m_aColumnWidths[ m_nLeftColumn - 1 ].getStart() <= gridWidthPixel )
+ )
+ {
+ --m_nLeftColumn;
+ }
+
+ // now adjust the column metrics, since they currently ignore the horizontal scroll position
+ if ( m_nLeftColumn > 0 )
+ {
+ const long offsetPixel = m_aColumnWidths[ 0 ].getStart() - m_aColumnWidths[ m_nLeftColumn ].getStart();
+ for ( ColumnPositions::iterator colPos = m_aColumnWidths.begin();
+ colPos != m_aColumnWidths.end();
+ ++colPos
+ )
+ {
+ colPos->move( offsetPixel );
}
}
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
namespace
{
- //................................................................
+ //..............................................................................................................
/// determines whether a scrollbar is needed for the given values
- bool lcl_determineScrollbarNeed( ScrollbarVisibility _eVisibility,
- long _nVisibleUnits, long _nRange )
+ bool lcl_determineScrollbarNeed( long const i_position, ScrollbarVisibility const i_visibility,
+ long const i_availableSpace, long const i_neededSpace )
{
- if ( _eVisibility == ScrollbarShowNever )
+ if ( i_visibility == ScrollbarShowNever )
return false;
- if ( _eVisibility == ScrollbarShowAlways )
+ if ( i_visibility == ScrollbarShowAlways )
+ return true;
+ if ( i_position > 0 )
return true;
- return _nVisibleUnits > _nRange;
+ if ( i_availableSpace >= i_neededSpace )
+ return false;
+ return true;
}
- //................................................................
- void lcl_setButtonRepeat( Window& _rWindow, ULONG _nDelay )
+ //..............................................................................................................
+ void lcl_setButtonRepeat( Window& _rWindow, sal_uLong _nDelay )
{
AllSettings aSettings = _rWindow.GetSettings();
MouseSettings aMouseSettings = aSettings.GetMouseSettings();
@@ -713,27 +1091,26 @@ namespace svt { namespace table
aMouseSettings.SetButtonRepeat( _nDelay );
aSettings.SetMouseSettings( aMouseSettings );
- _rWindow.SetSettings( aSettings, TRUE );
+ _rWindow.SetSettings( aSettings, sal_True );
}
- //................................................................
+ //..............................................................................................................
void lcl_updateScrollbar( Window& _rParent, ScrollBar*& _rpBar,
- ScrollbarVisibility _eVisibility, long _nVisibleUnits,
+ bool const i_needBar, long _nVisibleUnits,
long _nPosition, long _nLineSize, long _nRange,
bool _bHorizontal, const Link& _rScrollHandler )
{
- // do we need the scrollbar?
- bool bNeedBar = lcl_determineScrollbarNeed( _eVisibility, _nVisibleUnits, _nRange );
-
// do we currently have the scrollbar?
bool bHaveBar = _rpBar != NULL;
// do we need to correct the scrollbar visibility?
- if ( bHaveBar && !bNeedBar )
+ if ( bHaveBar && !i_needBar )
{
+ if ( _rpBar->IsTracking() )
+ _rpBar->EndTracking();
DELETEZ( _rpBar );
}
- else if ( !bHaveBar && bNeedBar )
+ else if ( !bHaveBar && i_needBar )
{
_rpBar = new ScrollBar(
&_rParent,
@@ -755,7 +1132,7 @@ namespace svt { namespace table
}
}
- //................................................................
+ //..............................................................................................................
/** returns the number of rows fitting into the given range,
for the given row height. Partially fitting rows are counted, too, if the
respective parameter says so.
@@ -767,7 +1144,7 @@ namespace svt { namespace table
: _nOverallHeight / _nRowHeightPixel;
}
- //................................................................
+ //..............................................................................................................
/** returns the number of columns fitting into the given area,
with the first visible column as given. Partially fitting columns are counted, too,
if the respective parameter says so.
@@ -792,15 +1169,13 @@ namespace svt { namespace table
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::impl_ni_updateScrollbars()
{
- TempHideCursor aHideCursor( *this );
+ SuppressCursor aHideCursor( *this );
// the width/height of a scrollbar, needed several times below
- long nScrollbarMetrics = m_rAntiImpl.GetSettings().GetStyleSettings().GetScrollBarSize();
- if ( m_rAntiImpl.IsZoom() )
- nScrollbarMetrics = (long)( nScrollbarMetrics * (double)m_rAntiImpl.GetZoom() );
+ long const nScrollbarMetrics = m_rAntiImpl.GetSettings().GetStyleSettings().GetScrollBarSize();
// determine the playground for the data cells (excluding headers)
// TODO: what if the control is smaller than needed for the headers/scrollbars?
@@ -810,26 +1185,28 @@ namespace svt { namespace table
m_nRowCount = m_pModel->getRowCount();
m_nColumnCount = m_pModel->getColumnCount();
- if(m_aAccColumnWidthsPixel.empty())
- {
+ if ( m_aColumnWidths.empty() )
impl_ni_updateColumnWidths();
- }
+ OSL_ENSURE( m_aColumnWidths.size() == size_t( m_nColumnCount ), "TableControl_Impl::impl_ni_updateScrollbars: inconsistency!" );
+ const long nAllColumnsWidth = m_aColumnWidths.empty()
+ ? 0
+ : m_aColumnWidths[ m_nColumnCount - 1 ].getEnd() - m_aColumnWidths[ 0 ].getStart();
+
+ const ScrollbarVisibility eVertScrollbar = m_pModel->getVerticalScrollbarVisibility();
+ const ScrollbarVisibility eHorzScrollbar = m_pModel->getHorizontalScrollbarVisibility();
// do we need a vertical scrollbar?
+ bool bNeedVerticalScrollbar = lcl_determineScrollbarNeed(
+ m_nTopRow, eVertScrollbar, aDataCellPlayground.GetHeight(), m_nRowHeightPixel * m_nRowCount );
bool bFirstRoundVScrollNeed = false;
- if ( lcl_determineScrollbarNeed(
- m_pModel->getVerticalScrollbarVisibility(aDataCellPlayground.GetHeight(), m_nRowHeightPixel*m_nRowCount),
- lcl_getRowsFittingInto( aDataCellPlayground.GetHeight(), m_nRowHeightPixel ),
- m_nRowCount ) )
+ if ( bNeedVerticalScrollbar )
{
aDataCellPlayground.Right() -= nScrollbarMetrics;
bFirstRoundVScrollNeed = true;
}
// do we need a horizontal scrollbar?
- if ( lcl_determineScrollbarNeed(
- m_pModel->getHorizontalScrollbarVisibility(aDataCellPlayground.GetWidth(), m_aAccColumnWidthsPixel[m_nColumnCount-1]),
- lcl_getColumnsVisibleWithin( aDataCellPlayground, m_nLeftColumn, *this, false ),
- m_nColumnCount ) )
+ const bool bNeedHorizontalScrollbar = lcl_determineScrollbarNeed( m_nLeftColumn, eHorzScrollbar, aDataCellPlayground.GetWidth(), nAllColumnsWidth );
+ if ( bNeedHorizontalScrollbar )
{
aDataCellPlayground.Bottom() -= nScrollbarMetrics;
@@ -837,19 +1214,21 @@ namespace svt { namespace table
// the need for a vertical one may have changed, since the horizontal
// SB might just occupy enough space so that not all rows do fit
// anymore
- if ( !bFirstRoundVScrollNeed && lcl_determineScrollbarNeed(
- m_pModel->getVerticalScrollbarVisibility(aDataCellPlayground.GetHeight(),m_nRowHeightPixel*m_nRowCount),
- lcl_getRowsFittingInto( aDataCellPlayground.GetHeight(), m_nRowHeightPixel ),
- m_nRowCount ) )
+ if ( !bFirstRoundVScrollNeed )
{
- aDataCellPlayground.Right() -= nScrollbarMetrics;
+ bNeedVerticalScrollbar = lcl_determineScrollbarNeed(
+ m_nTopRow, eVertScrollbar, aDataCellPlayground.GetHeight(), m_nRowHeightPixel * m_nRowCount );
+ if ( bNeedVerticalScrollbar )
+ {
+ aDataCellPlayground.Right() -= nScrollbarMetrics;
+ }
}
}
// create or destroy the vertical scrollbar, as needed
lcl_updateScrollbar(
m_rAntiImpl,
m_pVScroll,
- m_pModel->getVerticalScrollbarVisibility(aDataCellPlayground.GetHeight(),m_nRowHeightPixel*m_nRowCount),
+ bNeedVerticalScrollbar,
lcl_getRowsFittingInto( aDataCellPlayground.GetHeight(), m_nRowHeightPixel ),
// visible units
m_nTopRow, // current position
@@ -873,7 +1252,7 @@ namespace svt { namespace table
lcl_updateScrollbar(
m_rAntiImpl,
m_pHScroll,
- m_pModel->getHorizontalScrollbarVisibility(aDataCellPlayground.GetWidth(), m_aAccColumnWidthsPixel[m_nColumnCount-1]),
+ bNeedHorizontalScrollbar,
lcl_getColumnsVisibleWithin( aDataCellPlayground, m_nLeftColumn, *this, false ),
// visible units
m_nLeftColumn, // current position
@@ -885,14 +1264,14 @@ namespace svt { namespace table
// position it
if ( m_pHScroll )
{
- TableSize nVisibleUnits = lcl_getColumnsVisibleWithin( aDataCellPlayground, m_nLeftColumn, *this, false );
- int nRange = m_nColumnCount;
- if( m_nLeftColumn + nVisibleUnits == nRange-1)
+ TableSize const nVisibleUnits = lcl_getColumnsVisibleWithin( aDataCellPlayground, m_nLeftColumn, *this, false );
+ TableMetrics const nRange = m_nColumnCount;
+ if( m_nLeftColumn + nVisibleUnits == nRange - 1 )
{
- if(m_aAccColumnWidthsPixel[nRange-2] - m_aAccColumnWidthsPixel[m_nLeftColumn] + m_aColumnWidthsPixel[nRange-1]>aDataCellPlayground.GetWidth())
+ if ( m_aColumnWidths[ nRange - 1 ].getStart() - m_aColumnWidths[ m_nLeftColumn ].getEnd() + m_aColumnWidths[ nRange-1 ].getWidth() > aDataCellPlayground.GetWidth() )
{
m_pHScroll->SetVisibleSize( nVisibleUnits -1 );
- m_pHScroll->SetPageSize(nVisibleUnits -1);
+ m_pHScroll->SetPageSize( nVisibleUnits - 1 );
}
}
Rectangle aScrollbarArea(
@@ -930,33 +1309,17 @@ namespace svt { namespace table
) );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::onResize()
{
DBG_CHECK_ME();
- if(m_nRowCount != 0)
- {
- if(m_nColumnCount != 0)
- {
- if(m_bResizingGrid)
- impl_ni_updateColumnWidths();
- invalidateRows();
- m_bResizingGrid = true;
- }
- }
- else
- {
- //In the case that column headers are defined but data hasn't yet been set,
- //only column headers will be shown
- if(m_pModel->hasColumnHeaders())
- if(m_nColHeaderHeightPixel>1)
- m_pDataWindow->SetSizePixel( m_rAntiImpl.GetOutputSizePixel());
- if(m_nColumnCount != 0)
- impl_ni_updateScrollbars();
- }
+
+ impl_ni_updateColumnWidths();
+ impl_ni_updateScrollbars();
+ checkCursorPosition();
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::doPaintContent( const Rectangle& _rUpdateRect )
{
DBG_CHECK_ME();
@@ -964,32 +1327,24 @@ namespace svt { namespace table
if ( !getModel() )
return;
PTableRenderer pRenderer = getModel()->getRenderer();
- DBG_ASSERT( !!pRenderer, "TableDataWindow::Paint: invalid renderer!" );
+ DBG_ASSERT( !!pRenderer, "TableDataWindow::doPaintContent: invalid renderer!" );
if ( !pRenderer )
return;
// our current style settings, to be passed to the renderer
const StyleSettings& rStyle = m_rAntiImpl.GetSettings().GetStyleSettings();
m_nRowCount = m_pModel->getRowCount();
- TableSize nVisibleRows = impl_getVisibleRows(true);
- TableSize nActualRows = m_nRowCount;
- if(m_nRowCount>nVisibleRows)
- nActualRows = nVisibleRows;
// the area occupied by all (at least partially) visible cells, including
// headers
- Rectangle aAllCellsWithHeaders;
- impl_getAllVisibleCellsArea( aAllCellsWithHeaders );
+ Rectangle const aAllCellsWithHeaders( impl_getAllVisibleCellsArea() );
// ............................
// draw the header column area
if ( m_pModel->hasColumnHeaders() )
{
- TableRowGeometry aHeaderRow( *this, Rectangle( Point( 0, 0 ),
+ TableRowGeometry const aHeaderRow( *this, Rectangle( Point( 0, 0 ),
aAllCellsWithHeaders.BottomRight() ), ROW_COL_HEADERS );
- Rectangle aColRect(aHeaderRow.getRect());
- //to avoid double lines when scrolling horizontally
- if(m_nLeftColumn != 0)
- --aColRect.Left();
+ Rectangle const aColRect(aHeaderRow.getRect());
pRenderer->PaintHeaderArea(
*m_pDataWindow, aColRect, true, false, rStyle
);
@@ -1005,7 +1360,7 @@ namespace svt { namespace table
if ( _rUpdateRect.GetIntersection( aCell.getRect() ).IsEmpty() )
continue;
- bool isActiveColumn = ( aCell.getColumn() == getCurColumn() );
+ bool isActiveColumn = ( aCell.getColumn() == getCurrentColumn() );
bool isSelectedColumn = false;
pRenderer->PaintColumnHeader( aCell.getColumn(), isActiveColumn, isSelectedColumn,
*m_pDataWindow, aCell.getRect(), rStyle );
@@ -1017,31 +1372,23 @@ namespace svt { namespace table
{
aRowHeaderArea = aAllCellsWithHeaders;
aRowHeaderArea.Right() = m_nRowHeaderWidthPixel - 1;
- if(m_nTopRow+nActualRows>m_nRowCount)
- aRowHeaderArea.Bottom() = m_nRowHeightPixel * (nActualRows -1)+ m_nColHeaderHeightPixel - 1;
- else
- aRowHeaderArea.Bottom() = m_nRowHeightPixel * nActualRows + m_nColHeaderHeightPixel - 1;
- //to avoid double lines when scrolling vertically
- if(m_nTopRow != 0)
- --aRowHeaderArea.Top();
- --aRowHeaderArea.Right();
- pRenderer->PaintHeaderArea(*m_pDataWindow, aRowHeaderArea, false, true, rStyle);
+
+ TableSize const nVisibleRows = impl_getVisibleRows( true );
+ TableSize nActualRows = nVisibleRows;
+ if ( m_nTopRow + nActualRows > m_nRowCount )
+ nActualRows = m_nRowCount - m_nTopRow;
+ aRowHeaderArea.Bottom() = m_nColHeaderHeightPixel + m_nRowHeightPixel * nActualRows - 1;
+
+ pRenderer->PaintHeaderArea( *m_pDataWindow, aRowHeaderArea, false, true, rStyle );
// Note that strictly, aRowHeaderArea also contains the intersection between column
// and row header area. However, below we go to paint this intersection, again,
// so this hopefully doesn't hurt if we already paint it here.
if ( m_pModel->hasColumnHeaders() )
{
- TableCellGeometry aIntersection( *this, Rectangle( Point( 0, 0 ),
+ TableCellGeometry const aIntersection( *this, Rectangle( Point( 0, 0 ),
aAllCellsWithHeaders.BottomRight() ), COL_ROW_HEADERS, ROW_COL_HEADERS );
- Rectangle aInters(aIntersection.getRect());
- //to avoid double line when scrolling vertically
- if( m_nTopRow != 0 )
- {
- --aInters.Top();
- --aInters.Bottom();
- }
- --aInters.Right();
+ Rectangle const aInters( aIntersection.getRect() );
pRenderer->PaintHeaderArea(
*m_pDataWindow, aInters, true, true, rStyle
);
@@ -1054,51 +1401,36 @@ namespace svt { namespace table
TableSize colCount = getModel()->getColumnCount();
// paint all rows
- Rectangle aAllDataCellsArea;
- impl_getAllVisibleDataCellArea( aAllDataCellsArea );
- ::std::vector< std::vector< ::com::sun::star::uno::Any > >& aCellContent = m_pModel->getCellContent();
+ Rectangle const aAllDataCellsArea( impl_getAllVisibleDataCellArea() );
for ( TableRowGeometry aRowIterator( *this, aAllCellsWithHeaders, getTopRow() );
aRowIterator.isValid();
aRowIterator.moveDown() )
{
if ( _rUpdateRect.GetIntersection( aRowIterator.getRect() ).IsEmpty() )
continue;
- bool isActiveRow = ( aRowIterator.getRow() == getCurRow() );
- bool isSelectedRow = false;
- if(!m_nRowSelected.empty())
- {
- for(std::vector<RowPos>::iterator itSel=m_nRowSelected.begin();
- itSel!=m_nRowSelected.end();++itSel)
- {
- if(*itSel == aRowIterator.getRow())
- isSelectedRow = true;
- }
- }
- Rectangle aRect = aRowIterator.getRect().GetIntersection( aAllDataCellsArea );
- //to avoid double lines
- if( aRowIterator.getRow() != 0 )
- --aRect.Top();
- if(m_nLeftColumn != 0)
- --aRect.Left();
- else
- {
- if(m_pModel->hasRowHeaders())
- --aRect.Left();
- }
+
+ bool const isActiveRow = ( aRowIterator.getRow() == getCurrentRow() );
+ bool const isSelectedRow = isRowSelected( aRowIterator.getRow() );
+
+ Rectangle const aRect = aRowIterator.getRect().GetIntersection( aAllDataCellsArea );
+
// give the redenderer a chance to prepare the row
- pRenderer->PrepareRow( aRowIterator.getRow(), isActiveRow, isSelectedRow,
- *m_pDataWindow, aRect, rStyle );
+ pRenderer->PrepareRow(
+ aRowIterator.getRow(), isActiveRow, isSelectedRow,
+ *m_pDataWindow, aRect, rStyle
+ );
// paint the row header
if ( m_pModel->hasRowHeaders() )
{
- Rectangle aCurrentRowHeader( aRowHeaderArea.GetIntersection( aRowIterator.getRect() ) );
- rtl::OUString rowHeaderName = m_pModel->getRowHeaderName()[aRowIterator.getRow()];
+ const Rectangle aCurrentRowHeader( aRowHeaderArea.GetIntersection( aRowIterator.getRect() ) );
pRenderer->PaintRowHeader( isActiveRow, isSelectedRow, *m_pDataWindow, aCurrentRowHeader,
- rStyle, rowHeaderName );
+ rStyle );
}
+
if ( !colCount )
continue;
+
// paint all cells in this row
for ( TableCellGeometry aCell( aRowIterator, m_nLeftColumn );
aCell.isValid();
@@ -1106,25 +1438,12 @@ namespace svt { namespace table
)
{
bool isSelectedColumn = false;
- ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >xGraphic;
- ::com::sun::star::uno::Any rCellData = aCellContent[aRowIterator.getRow()][aCell.getColumn()];
- if(rCellData>>=xGraphic)
- {
- Image* pImage = new Image(xGraphic);
- if(pImage!=NULL)
- pRenderer->PaintCellImage( aCell.getColumn(), isSelectedRow || isSelectedColumn, isActiveRow,
- *m_pDataWindow, aCell.getRect(), rStyle, pImage );
- }
- else
- {
- ::rtl::OUString sContent = convertToString(rCellData);
- pRenderer->PaintCellString( aCell.getColumn(), isSelectedRow || isSelectedColumn, isActiveRow,
- *m_pDataWindow, aCell.getRect(), rStyle, sContent );
- }
+ pRenderer->PaintCell( aCell.getColumn(), isSelectedRow || isSelectedColumn, isActiveRow,
+ *m_pDataWindow, aCell.getRect(), rStyle );
}
}
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::hideCursor()
{
DBG_CHECK_ME();
@@ -1133,7 +1452,7 @@ namespace svt { namespace table
impl_ni_doSwitchCursor( false );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::showCursor()
{
DBG_CHECK_ME();
@@ -1143,12 +1462,14 @@ namespace svt { namespace table
impl_ni_doSwitchCursor( true );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
bool TableControl_Impl::dispatchAction( TableControlAction _eAction )
{
DBG_CHECK_ME();
bool bSuccess = false;
+ bool selectionChanged = false;
+
Rectangle rCells;
switch ( _eAction )
{
@@ -1156,25 +1477,25 @@ namespace svt { namespace table
if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
{
//if other rows already selected, deselect them
- if(m_nRowSelected.size()>0)
+ if(m_aSelectedRows.size()>0)
{
- for(std::vector<RowPos>::iterator it=m_nRowSelected.begin();
- it!=m_nRowSelected.end();++it)
+ for(std::vector<RowPos>::iterator it=m_aSelectedRows.begin();
+ it!=m_aSelectedRows.end();++it)
{
invalidateSelectedRegion(*it, *it, rCells);
}
- m_nRowSelected.clear();
+ m_aSelectedRows.clear();
}
if(m_nCurRow < m_nRowCount-1)
{
++m_nCurRow;
- m_nRowSelected.push_back(m_nCurRow);
+ m_aSelectedRows.push_back(m_nCurRow);
}
else
- m_nRowSelected.push_back(m_nCurRow);
+ m_aSelectedRows.push_back(m_nCurRow);
invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
ensureVisible(m_nCurColumn,m_nCurRow,false);
- m_rAntiImpl.selectionChanged(true);
+ selectionChanged = true;
bSuccess = true;
}
else
@@ -1187,28 +1508,28 @@ namespace svt { namespace table
case cursorUp:
if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
{
- if(m_nRowSelected.size()>0)
+ if(m_aSelectedRows.size()>0)
{
- for(std::vector<RowPos>::iterator it=m_nRowSelected.begin();
- it!=m_nRowSelected.end();++it)
+ for(std::vector<RowPos>::iterator it=m_aSelectedRows.begin();
+ it!=m_aSelectedRows.end();++it)
{
invalidateSelectedRegion(*it, *it, rCells);
}
- m_nRowSelected.clear();
+ m_aSelectedRows.clear();
}
if(m_nCurRow>0)
{
--m_nCurRow;
- m_nRowSelected.push_back(m_nCurRow);
+ m_aSelectedRows.push_back(m_nCurRow);
invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
}
else
{
- m_nRowSelected.push_back(m_nCurRow);
+ m_aSelectedRows.push_back(m_nCurRow);
invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
}
ensureVisible(m_nCurColumn,m_nCurRow,false);
- m_rAntiImpl.selectionChanged(true);
+ selectionChanged = true;
bSuccess = true;
}
else
@@ -1270,259 +1591,269 @@ namespace svt { namespace table
case cursorBottomRight:
bSuccess = goTo( m_nColumnCount - 1, m_nRowCount - 1 );
break;
- case cursorSelectRow:
- {
- if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
- return bSuccess = false;
- //pos is the position of the current row in the vector of selected rows, if current row is selected
- int pos = getRowSelectedNumber(m_nRowSelected, m_nCurRow);
- //if current row is selected, it should be deselected, when ALT+SPACE are pressed
- if(pos>-1)
- {
- m_nRowSelected.erase(m_nRowSelected.begin()+pos);
- if(m_nRowSelected.empty() && m_nAnchor != -1)
- m_nAnchor = -1;
- }
- //else select the row->put it in the vector
- else
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
- m_rAntiImpl.selectionChanged(true);
- bSuccess = true;
- }
- break;
- case cursorSelectRowUp:
- {
- if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
- return bSuccess = false;
- else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
+
+ case cursorSelectRow:
{
- //if there are other selected rows, deselect them
- return false;
+ if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
+ return bSuccess = false;
+ //pos is the position of the current row in the vector of selected rows, if current row is selected
+ int pos = getRowSelectedNumber(m_aSelectedRows, m_nCurRow);
+ //if current row is selected, it should be deselected, when ALT+SPACE are pressed
+ if(pos>-1)
+ {
+ m_aSelectedRows.erase(m_aSelectedRows.begin()+pos);
+ if(m_aSelectedRows.empty() && m_nAnchor != -1)
+ m_nAnchor = -1;
+ }
+ //else select the row->put it in the vector
+ else
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ selectionChanged = true;
+ bSuccess = true;
}
- else
+ break;
+ case cursorSelectRowUp:
{
- //there are other selected rows
- if(m_nRowSelected.size()>0)
+ if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
+ return bSuccess = false;
+ else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
+ {
+ //if there are other selected rows, deselect them
+ return false;
+ }
+ else
{
- //the anchor wasn't set -> a region is not selected, that's why clear all selection
- //and select the current row
- if(m_nAnchor==-1)
+ //there are other selected rows
+ if(m_aSelectedRows.size()>0)
{
- for(std::vector<RowPos>::iterator it=m_nRowSelected.begin();
- it!=m_nRowSelected.end();++it)
+ //the anchor wasn't set -> a region is not selected, that's why clear all selection
+ //and select the current row
+ if(m_nAnchor==-1)
{
- invalidateSelectedRegion(*it, *it, rCells);
- }
- m_nRowSelected.clear();
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
- }
- else
- {
- //a region is already selected, prevRow is last selected row and the row above - nextRow - should be selected
- int prevRow = getRowSelectedNumber(m_nRowSelected, m_nCurRow);
- int nextRow = getRowSelectedNumber(m_nRowSelected, m_nCurRow-1);
- if(prevRow>-1)
- {
- //if m_nCurRow isn't the upper one, can move up, otherwise not
- if(m_nCurRow>0)
- m_nCurRow--;
- else
- return bSuccess = true;
- //if nextRow already selected, deselect it, otherwise select it
- if(nextRow>-1 && m_nRowSelected[nextRow] == m_nCurRow)
- {
- m_nRowSelected.erase(m_nRowSelected.begin()+prevRow);
- invalidateSelectedRegion(m_nCurRow+1, m_nCurRow+1, rCells);
- }
- else
+ for(std::vector<RowPos>::iterator it=m_aSelectedRows.begin();
+ it!=m_aSelectedRows.end();++it)
{
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
- }
- }
+ invalidateSelectedRegion(*it, *it, rCells);
+ }
+ m_aSelectedRows.clear();
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ }
else
{
- if(m_nCurRow>0)
+ //a region is already selected, prevRow is last selected row and the row above - nextRow - should be selected
+ int prevRow = getRowSelectedNumber(m_aSelectedRows, m_nCurRow);
+ int nextRow = getRowSelectedNumber(m_aSelectedRows, m_nCurRow-1);
+ if(prevRow>-1)
+ {
+ //if m_nCurRow isn't the upper one, can move up, otherwise not
+ if(m_nCurRow>0)
+ m_nCurRow--;
+ else
+ return bSuccess = true;
+ //if nextRow already selected, deselect it, otherwise select it
+ if(nextRow>-1 && m_aSelectedRows[nextRow] == m_nCurRow)
+ {
+ m_aSelectedRows.erase(m_aSelectedRows.begin()+prevRow);
+ invalidateSelectedRegion(m_nCurRow+1, m_nCurRow+1, rCells);
+ }
+ else
+ {
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ }
+ }
+ else
{
- m_nRowSelected.push_back(m_nCurRow);
- m_nCurRow--;
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow+1, m_nCurRow, rCells);
+ if(m_nCurRow>0)
+ {
+ m_aSelectedRows.push_back(m_nCurRow);
+ m_nCurRow--;
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow+1, m_nCurRow, rCells);
+ }
}
}
}
- }
- else
- {
- //if nothing is selected and the current row isn't the upper one
- //select the current and one row above
- //otherwise select only the upper row
- if(m_nCurRow>0)
- {
- m_nRowSelected.push_back(m_nCurRow);
- m_nCurRow--;
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow+1, m_nCurRow, rCells);
- }
else
{
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ //if nothing is selected and the current row isn't the upper one
+ //select the current and one row above
+ //otherwise select only the upper row
+ if(m_nCurRow>0)
+ {
+ m_aSelectedRows.push_back(m_nCurRow);
+ m_nCurRow--;
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow+1, m_nCurRow, rCells);
+ }
+ else
+ {
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ }
}
+ m_pSelEngine->SetAnchor(sal_True);
+ m_nAnchor = m_nCurRow;
+ ensureVisible(m_nCurColumn, m_nCurRow, false);
+ selectionChanged = true;
+ bSuccess = true;
}
- m_pSelEngine->SetAnchor(TRUE);
- m_nAnchor = m_nCurRow;
- ensureVisible(m_nCurColumn, m_nCurRow, false);
- m_rAntiImpl.selectionChanged(true);
- bSuccess = true;
- }
- }
- break;
- case cursorSelectRowDown:
- {
- if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
- bSuccess = false;
- else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
- {
- bSuccess = false;
}
- else
+ break;
+ case cursorSelectRowDown:
{
- if(m_nRowSelected.size()>0)
+ if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
+ bSuccess = false;
+ else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
+ {
+ bSuccess = false;
+ }
+ else
{
- //the anchor wasn't set -> a region is not selected, that's why clear all selection
- //and select the current row
- if(m_nAnchor==-1)
+ if(m_aSelectedRows.size()>0)
{
- for(std::vector<RowPos>::iterator it=m_nRowSelected.begin();
- it!=m_nRowSelected.end();++it)
+ //the anchor wasn't set -> a region is not selected, that's why clear all selection
+ //and select the current row
+ if(m_nAnchor==-1)
{
- invalidateSelectedRegion(*it, *it, rCells);
- }
- m_nRowSelected.clear();
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ for(std::vector<RowPos>::iterator it=m_aSelectedRows.begin();
+ it!=m_aSelectedRows.end();++it)
+ {
+ invalidateSelectedRegion(*it, *it, rCells);
+ }
+ m_aSelectedRows.clear();
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ }
+ else
+ {
+ //a region is already selected, prevRow is last selected row and the row beneath - nextRow - should be selected
+ int prevRow = getRowSelectedNumber(m_aSelectedRows, m_nCurRow);
+ int nextRow = getRowSelectedNumber(m_aSelectedRows, m_nCurRow+1);
+ if(prevRow>-1)
+ {
+ //if m_nCurRow isn't the last one, can move down, otherwise not
+ if(m_nCurRow<m_nRowCount-1)
+ m_nCurRow++;
+ else
+ return bSuccess = true;
+ //if next row already selected, deselect it, otherwise select it
+ if(nextRow>-1 && m_aSelectedRows[nextRow] == m_nCurRow)
+ {
+ m_aSelectedRows.erase(m_aSelectedRows.begin()+prevRow);
+ invalidateSelectedRegion(m_nCurRow-1, m_nCurRow-1, rCells);
+ }
+ else
+ {
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ }
+ }
+ else
+ {
+ if(m_nCurRow<m_nRowCount-1)
+ {
+ m_aSelectedRows.push_back(m_nCurRow);
+ m_nCurRow++;
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow-1, m_nCurRow, rCells);
+ }
+ }
}
+ }
else
{
- //a region is already selected, prevRow is last selected row and the row beneath - nextRow - should be selected
- int prevRow = getRowSelectedNumber(m_nRowSelected, m_nCurRow);
- int nextRow = getRowSelectedNumber(m_nRowSelected, m_nCurRow+1);
- if(prevRow>-1)
- {
- //if m_nCurRow isn't the last one, can move down, otherwise not
- if(m_nCurRow<m_nRowCount-1)
- m_nCurRow++;
- else
- return bSuccess = true;
- //if next row already selected, deselect it, otherwise select it
- if(nextRow>-1 && m_nRowSelected[nextRow] == m_nCurRow)
- {
- m_nRowSelected.erase(m_nRowSelected.begin()+prevRow);
- invalidateSelectedRegion(m_nCurRow-1, m_nCurRow-1, rCells);
- }
- else
- {
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
- }
+ //there wasn't any selection, select current and row beneath, otherwise only row beneath
+ if(m_nCurRow<m_nRowCount-1)
+ {
+ m_aSelectedRows.push_back(m_nCurRow);
+ m_nCurRow++;
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow-1, m_nCurRow, rCells);
}
else
{
- if(m_nCurRow<m_nRowCount-1)
- {
- m_nRowSelected.push_back(m_nCurRow);
- m_nCurRow++;
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow-1, m_nCurRow, rCells);
- }
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
}
}
+ m_pSelEngine->SetAnchor(sal_True);
+ m_nAnchor = m_nCurRow;
+ ensureVisible(m_nCurColumn, m_nCurRow, false);
+ selectionChanged = true;
+ bSuccess = true;
}
+ }
+ break;
+
+ case cursorSelectRowAreaTop:
+ {
+ if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
+ bSuccess = false;
+ else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
+ bSuccess = false;
else
{
- //there wasn't any selection, select current and row beneath, otherwise only row beneath
- if(m_nCurRow<m_nRowCount-1)
- {
- m_nRowSelected.push_back(m_nCurRow);
- m_nCurRow++;
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow-1, m_nCurRow, rCells);
- }
- else
+ //select the region between the current and the upper row
+ RowPos iter = m_nCurRow;
+ invalidateSelectedRegion(m_nCurRow, 0, rCells);
+ //put the rows in vector
+ while(iter>=0)
{
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ if ( !isRowSelected( iter ) )
+ m_aSelectedRows.push_back(iter);
+ --iter;
}
+ m_nCurRow = 0;
+ m_nAnchor = m_nCurRow;
+ m_pSelEngine->SetAnchor(sal_True);
+ ensureVisible(m_nCurColumn, 0, false);
+ selectionChanged = true;
+ bSuccess = true;
}
- m_pSelEngine->SetAnchor(TRUE);
- m_nAnchor = m_nCurRow;
- ensureVisible(m_nCurColumn, m_nCurRow, false);
- m_rAntiImpl.selectionChanged(true);
- bSuccess = true;
}
- }
break;
- case cursorSelectRowAreaTop:
- {
- if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
- bSuccess = false;
- else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
- bSuccess = false;
- else
+
+ case cursorSelectRowAreaBottom:
{
- //select the region between the current and the upper row
+ if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
+ return bSuccess = false;
+ else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
+ return bSuccess = false;
+ //select the region between the current and the last row
RowPos iter = m_nCurRow;
- invalidateSelectedRegion(m_nCurRow, 0, rCells);
- //put the rows in vector
- while(iter>=0)
+ invalidateSelectedRegion(m_nCurRow, m_nRowCount-1, rCells);
+ //put the rows in the vector
+ while(iter<=m_nRowCount)
{
- if(!isRowSelected(m_nRowSelected, iter))
- m_nRowSelected.push_back(iter);
- --iter;
+ if ( !isRowSelected( iter ) )
+ m_aSelectedRows.push_back(iter);
+ ++iter;
}
- m_nCurRow = 0;
+ m_nCurRow = m_nRowCount-1;
m_nAnchor = m_nCurRow;
- m_pSelEngine->SetAnchor(TRUE);
- ensureVisible(m_nCurColumn, 0, false);
- m_rAntiImpl.selectionChanged(true);
+ m_pSelEngine->SetAnchor(sal_True);
+ ensureVisible(m_nCurColumn, m_nRowCount-1, false);
+ selectionChanged = true;
bSuccess = true;
}
- }
- break;
- case cursorSelectRowAreaBottom:
- {
- if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
- return bSuccess = false;
- else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
- return bSuccess = false;
- //select the region between the current and the last row
- RowPos iter = m_nCurRow;
- invalidateSelectedRegion(m_nCurRow, m_nRowCount-1, rCells);
- //put the rows in the vector
- while(iter<=m_nRowCount)
- {
- if(!isRowSelected(m_nRowSelected, iter))
- m_nRowSelected.push_back(iter);
- ++iter;
- }
- m_nCurRow = m_nRowCount-1;
- m_nAnchor = m_nCurRow;
- m_pSelEngine->SetAnchor(TRUE);
- ensureVisible(m_nCurColumn, m_nRowCount-1, false);
- m_rAntiImpl.selectionChanged(true);
- bSuccess = true;
- }
break;
default:
OSL_FAIL( "TableControl_Impl::dispatchAction: unsupported action!" );
+ break;
}
+
+ if ( bSuccess && selectionChanged )
+ {
+ m_rAntiImpl.Select();
+ }
+
return bSuccess;
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::impl_ni_doSwitchCursor( bool _bShow )
{
PTableRenderer pRenderer = !!m_pModel ? m_pModel->getRenderer() : PTableRenderer();
@@ -1530,16 +1861,14 @@ namespace svt { namespace table
{
Rectangle aCellRect;
impl_getCellRect( m_nCurColumn, m_nCurRow, aCellRect );
- if(!m_pModel->hasRowHeaders() && m_nCurColumn == 0)
- aCellRect.Left()++;
if ( _bShow )
- pRenderer->ShowCellCursor( *m_pDataWindow, aCellRect);
+ pRenderer->ShowCellCursor( *m_pDataWindow, aCellRect );
else
- pRenderer->HideCellCursor( *m_pDataWindow, aCellRect);
+ pRenderer->HideCellCursor( *m_pDataWindow, aCellRect );
}
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::impl_getCellRect( ColPos _nColumn, RowPos _nRow, Rectangle& _rCellRect ) const
{
DBG_CHECK_ME();
@@ -1553,164 +1882,236 @@ namespace svt { namespace table
return;
}
- Rectangle aAllCells;
- impl_getAllVisibleCellsArea( aAllCells );
-
- TableCellGeometry aCell( *this, aAllCells, _nColumn, _nRow );
+ TableCellGeometry aCell( *this, impl_getAllVisibleCellsArea(), _nColumn, _nRow );
_rCellRect = aCell.getRect();
- _rCellRect.Top()--;_rCellRect.Left()--;
}
- //-------------------------------------------------------------------------------
- RowPos TableControl_Impl::getCurrentRow(const Point& rPoint)
+
+ //------------------------------------------------------------------------------------------------------------------
+ RowPos TableControl_Impl::getRowAtPoint( const Point& rPoint ) const
+ {
+ DBG_CHECK_ME();
+ return impl_getRowForAbscissa( rPoint.Y() );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ColPos TableControl_Impl::getColAtPoint( const Point& rPoint ) const
{
DBG_CHECK_ME();
- Rectangle rCellRect;
- RowPos newRowPos = -2;//-1 is HeaderRow
- ColPos newColPos = 0;
- for(int i=-1;i<m_nRowCount;i++)
+ return impl_getColumnForOrdinate( rPoint.X() );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ TableCell TableControl_Impl::hitTest( Point const & i_point ) const
+ {
+ TableCell aCell( getColAtPoint( i_point ), getRowAtPoint( i_point ) );
+ if ( aCell.nColumn > COL_ROW_HEADERS )
{
- for(int j=-1;j<m_nColumnCount;j++)
+ PColumnModel const pColumn = m_pModel->getColumnModel( aCell.nColumn );
+ MutableColumnMetrics const & rColInfo( m_aColumnWidths[ aCell.nColumn ] );
+ if ( ( rColInfo.getEnd() - 3 <= i_point.X() )
+ && ( rColInfo.getEnd() >= i_point.X() )
+ && pColumn->isResizable()
+ )
{
- impl_getCellRect(j,i,rCellRect);
- if((rPoint.X() >= rCellRect.Left() && rPoint.X() <= rCellRect.Right()) && rPoint.Y() >= rCellRect.Top() && rPoint.Y() <= rCellRect.Bottom())
- {
- newRowPos = i;
- newColPos = j;
- if(newColPos != -1)
- m_nCurColumn = newColPos;
- return newRowPos;
- }
+ aCell.eArea = ColumnDivider;
}
}
- return newRowPos;
+ return aCell;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ColumnMetrics TableControl_Impl::getColumnMetrics( ColPos const i_column ) const
+ {
+ DBG_CHECK_ME();
+
+ ENSURE_OR_RETURN( ( i_column >= 0 ) && ( i_column < m_pModel->getColumnCount() ),
+ "TableControl_Impl::getColumnMetrics: illegal column index!", ColumnMetrics() );
+ return (ColumnMetrics const &)m_aColumnWidths[ i_column ];
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ PTableModel TableControl_Impl::getModel() const
+ {
+ return m_pModel;
}
- //-------------------------------------------------------------------------------
- void TableControl_Impl::setCursorAtCurrentCell(const Point& rPoint)
+
+ //------------------------------------------------------------------------------------------------------------------
+ RowPos TableControl_Impl::getCurrentColumn() const
+ {
+ return m_nCurColumn;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ RowPos TableControl_Impl::getCurrentRow() const
+ {
+ return m_nCurRow;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::Size TableControl_Impl::getTableSizePixel() const
+ {
+ return m_pDataWindow->GetOutputSizePixel();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::setPointer( Pointer const & i_pointer )
{
DBG_CHECK_ME();
- hideCursor();
- Rectangle rCellRect;
- RowPos newRowPos = -2;//-1 is HeaderRow
- ColPos newColPos = 0;
- for(int i=0;i<m_nRowCount;i++)
+ m_pDataWindow->SetPointer( i_pointer );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::captureMouse()
+ {
+ m_pDataWindow->CaptureMouse();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::releaseMouse()
+ {
+ m_pDataWindow->ReleaseMouse();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::invalidate( TableArea const i_what )
+ {
+ switch ( i_what )
{
- for(int j=-1;j<m_nColumnCount;j++)
- {
- impl_getCellRect(j,i,rCellRect);
- if((rPoint.X() >= rCellRect.Left() && rPoint.X() <= rCellRect.Right()) && rPoint.Y() >= rCellRect.Top() && rPoint.Y() <= rCellRect.Bottom())
- {
- newRowPos = i;
- m_nCurRow = newRowPos;
- newColPos = j;
- if(newColPos == -1)
- m_nCurColumn = 0;
- else
- m_nCurColumn = newColPos;
- }
- }
+ case TableAreaColumnHeaders:
+ m_pDataWindow->Invalidate( calcHeaderRect( true ) );
+ break;
+
+ case TableAreaRowHeaders:
+ m_pDataWindow->Invalidate( calcHeaderRect( false ) );
+ break;
+
+ case TableAreaDataArea:
+ m_pDataWindow->Invalidate( impl_getAllVisibleDataCellArea() );
+ break;
+
+ case TableAreaAll:
+ m_pDataWindow->Invalidate();
+ break;
}
- showCursor();
}
- //-------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
+ long TableControl_Impl::pixelWidthToAppFont( long const i_pixels ) const
+ {
+ return m_pDataWindow->PixelToLogic( Size( i_pixels, 0 ), MAP_APPFONT ).Width();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::hideTracking()
+ {
+ m_pDataWindow->HideTracking();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::showTracking( Rectangle const & i_location, sal_uInt16 const i_flags )
+ {
+ m_pDataWindow->ShowTracking( i_location, i_flags );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableControl_Impl::activateCell( ColPos const i_col, RowPos const i_row )
+ {
+ DBG_CHECK_ME();
+ return goTo( i_col, i_row );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::invalidateSelectedRegion(RowPos _nPrevRow, RowPos _nCurRow, Rectangle& _rCellRect)
{
DBG_CHECK_ME();
- Rectangle aAllCells;
//get the visible area of the table control and set the Left and right border of the region to be repainted
- impl_getAllVisibleCellsArea( aAllCells );
+ Rectangle const aAllCells( impl_getAllVisibleCellsArea() );
_rCellRect.Left() = aAllCells.Left();
_rCellRect.Right() = aAllCells.Right();
- Rectangle rCells;
//if only one row is selected
if(_nPrevRow == _nCurRow)
{
- impl_getCellRect(m_nCurColumn,_nCurRow,rCells);
- _rCellRect.Top()=--rCells.Top();
- _rCellRect.Bottom()=rCells.Bottom();
+ Rectangle aCellRect;
+ impl_getCellRect( m_nCurColumn, _nCurRow, aCellRect );
+ _rCellRect.Top() = aCellRect.Top();
+ _rCellRect.Bottom() = aCellRect.Bottom();
}
//if the region is above the current row
else if(_nPrevRow < _nCurRow )
{
- impl_getCellRect(m_nCurColumn,_nPrevRow,rCells);
- _rCellRect.Top()= --rCells.Top();
- impl_getCellRect(m_nCurColumn,_nCurRow,rCells);
- _rCellRect.Bottom()=rCells.Bottom();
+ Rectangle aCellRect;
+ impl_getCellRect( m_nCurColumn, _nPrevRow, aCellRect );
+ _rCellRect.Top() = aCellRect.Top();
+ impl_getCellRect( m_nCurColumn, _nCurRow, aCellRect );
+ _rCellRect.Bottom() = aCellRect.Bottom();
}
//if the region is beneath the current row
else
{
- impl_getCellRect(m_nCurColumn,_nCurRow,rCells);
- _rCellRect.Top()= --rCells.Top();
- impl_getCellRect(m_nCurColumn,_nPrevRow,rCells);
- _rCellRect.Bottom()=rCells.Bottom();
+ Rectangle aCellRect;
+ impl_getCellRect( m_nCurColumn, _nCurRow, aCellRect );
+ _rCellRect.Top() = aCellRect.Top();
+ impl_getCellRect( m_nCurColumn, _nPrevRow, aCellRect );
+ _rCellRect.Bottom() = aCellRect.Bottom();
}
m_pDataWindow->Invalidate(_rCellRect);
}
- //-------------------------------------------------------------------------------
- //this method is to be called, when a new row is added
- void TableControl_Impl::invalidateRow(RowPos _nRowPos, Rectangle& _rCellRect)
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::invalidateRowRange( RowPos const i_firstRow, RowPos const i_lastRow )
{
- if(m_nCurRow < 0)
- m_nCurRow = 0;
- if(m_nCursorHidden == 2)
+ if ( m_nCursorHidden == 2 )
+ // WTF? what kind of hack is this?
--m_nCursorHidden;
- impl_getAllVisibleCellsArea( _rCellRect );
- TableRowGeometry _rRow( *this, _rCellRect, _nRowPos);
- impl_ni_updateScrollbars();
- m_pDataWindow->Invalidate(_rRow.getRect());
- }
- //-------------------------------------------------------------------------------
- std::vector<RowPos>& TableControl_Impl::getSelectedRows()
- {
- return m_nRowSelected;
- }
- //--------------------------------------------------------------------
- void TableControl_Impl::clearSelection()
- {
- m_nRowSelected.clear();
- }
- //--------------------------------------------------------------------
- //-------------------------------------------------------------------------------
- void TableControl_Impl::removeSelectedRow(RowPos _nRowPos)
- {
- int i =0;
- //if the row is selected, remove it from the selection vector
- if(isRowSelected(m_nRowSelected, _nRowPos))
+
+ RowPos const firstRow = i_firstRow < m_nTopRow ? m_nTopRow : i_firstRow;
+ RowPos const lastVisibleRow = m_nTopRow + impl_getVisibleRows( true ) - 1;
+ RowPos const lastRow = ( ( i_lastRow == ROW_INVALID ) || ( i_lastRow > lastVisibleRow ) ) ? lastVisibleRow : i_lastRow;
+
+ Rectangle aInvalidateRect;
+
+ Rectangle const aVisibleCellsArea( impl_getAllVisibleCellsArea() );
+ TableRowGeometry aRow( *this, aVisibleCellsArea, firstRow, true );
+ while ( aRow.isValid() && ( aRow.getRow() <= lastRow ) )
{
- if(m_nRowSelected.size()>1)
- m_nRowSelected.erase(m_nRowSelected.begin()+_nRowPos);
- else
- m_nRowSelected.clear();
+ aInvalidateRect.Union( aRow.getRect() );
+ aRow.moveDown();
}
- //after removing a row, row positions must be updated, so selected rows could stay selected
- if(m_nRowSelected.size()>1)
- {
- for(std::vector<RowPos>::iterator it=m_nRowSelected.begin();it!=m_nRowSelected.end();++it)
- {
- if(*it > _nRowPos)
- m_nRowSelected[i]=*it-1;
- ++i;
- }
- }
- if(_nRowPos == 0)
- m_nCurRow = 0;
- else
- m_nCurRow = _nRowPos-1;
+
+ if ( i_lastRow == ROW_INVALID )
+ aInvalidateRect.Bottom() = m_pDataWindow->GetOutputSizePixel().Height();
+
+ m_pDataWindow->Invalidate( aInvalidateRect );
}
+
//------------------------------------------------------------------------------
- void TableControl_Impl::invalidateRows()
+ void TableControl_Impl::checkCursorPosition()
{
- impl_ni_updateScrollbars();
+ DBG_CHECK_ME();
+
TableSize nVisibleRows = impl_getVisibleRows(true);
TableSize nVisibleCols = impl_getVisibleColumns(true);
- if(m_nTopRow+nVisibleRows>m_nRowCount && m_nRowCount>=nVisibleRows)
- m_nTopRow--;
+ if ( ( m_nTopRow + nVisibleRows > m_nRowCount )
+ && ( m_nRowCount >= nVisibleRows )
+ )
+ {
+ --m_nTopRow;
+ }
else
+ {
m_nTopRow = 0;
- if(m_nLeftColumn+nVisibleCols>m_nColumnCount && m_nColumnCount>=nVisibleCols)
- m_nLeftColumn--;
+ }
+
+ if ( ( m_nLeftColumn + nVisibleCols > m_nColumnCount )
+ && ( m_nColumnCount >= nVisibleCols )
+ )
+ {
+ --m_nLeftColumn;
+ }
else
+ {
m_nLeftColumn = 0;
+ }
+
m_pDataWindow->Invalidate();
}
@@ -1729,7 +2130,7 @@ namespace svt { namespace table
}
//--------------------------------------------------------------------
- TableSize TableControl_Impl::impl_getVisibleColumns( bool _bAcceptPartialRow ) const
+ TableSize TableControl_Impl::impl_getVisibleColumns( bool _bAcceptPartialCol ) const
{
DBG_CHECK_ME();
@@ -1739,7 +2140,7 @@ namespace svt { namespace table
Rectangle( Point( 0, 0 ), m_pDataWindow->GetOutputSizePixel() ),
m_nLeftColumn,
*this,
- _bAcceptPartialRow
+ _bAcceptPartialCol
);
}
@@ -1750,12 +2151,15 @@ namespace svt { namespace table
// TODO: give veto listeners a chance
- if ( ( _nColumn < -1 ) || ( _nColumn >= m_nColumnCount )
- || ( _nRow < -1 ) || ( _nRow >= m_nRowCount )
+ if ( ( _nColumn < 0 ) || ( _nColumn >= m_nColumnCount )
+ || ( _nRow < 0 ) || ( _nRow >= m_nRowCount )
)
+ {
+ OSL_ENSURE( false, "TableControl_Impl::goTo: invalid row or column index!" );
return false;
+ }
- TempHideCursor aHideCursor( *this );
+ SuppressCursor aHideCursor( *this );
m_nCurColumn = _nColumn;
m_nCurRow = _nRow;
@@ -1772,32 +2176,40 @@ namespace svt { namespace table
&& ( _nRow >= 0 ) && ( _nRow < m_nRowCount ),
"TableControl_Impl::ensureVisible: invalid coordinates!" );
- TempHideCursor aHideCursor( *this );
+ SuppressCursor aHideCursor( *this );
if ( _nColumn < m_nLeftColumn )
- impl_ni_ScrollColumns( _nColumn - m_nLeftColumn );
+ impl_scrollColumns( _nColumn - m_nLeftColumn );
else
{
TableSize nVisibleColumns = impl_getVisibleColumns( _bAcceptPartialVisibility );
if ( _nColumn > m_nLeftColumn + nVisibleColumns - 1 )
{
- impl_ni_ScrollColumns( _nColumn - ( m_nLeftColumn + nVisibleColumns - 1 ) );
+ impl_scrollColumns( _nColumn - ( m_nLeftColumn + nVisibleColumns - 1 ) );
// TODO: since not all columns have the same width, this might in theory result
// in the column still not being visible.
}
}
if ( _nRow < m_nTopRow )
- impl_ni_ScrollRows( _nRow - m_nTopRow );
+ impl_scrollRows( _nRow - m_nTopRow );
else
{
TableSize nVisibleRows = impl_getVisibleRows( _bAcceptPartialVisibility );
if ( _nRow > m_nTopRow + nVisibleRows - 1 )
- impl_ni_ScrollRows( _nRow - ( m_nTopRow + nVisibleRows - 1 ) );
+ impl_scrollRows( _nRow - ( m_nTopRow + nVisibleRows - 1 ) );
}
}
//--------------------------------------------------------------------
+ ::rtl::OUString TableControl_Impl::getCellContentAsString( RowPos const i_row, ColPos const i_col )
+ {
+ ::com::sun::star::uno::Any content;
+ m_pModel->getCellContent( i_col, i_row, content );
+ return CellValueConversion::convertToString( content );
+ }
+
+ //--------------------------------------------------------------------
TableSize TableControl_Impl::impl_ni_ScrollRows( TableSize _nRowDelta )
{
// compute new top row
@@ -1811,10 +2223,10 @@ namespace svt { namespace table
m_nTopRow = nNewTopRow;
// if updates are enabled currently, scroll the viewport
- if ( m_rAntiImpl.IsUpdateMode() && ( m_nTopRow != nOldTopRow ) )
+ if ( m_nTopRow != nOldTopRow )
{
DBG_SUSPEND_INV( INV_SCROLL_POSITION );
- TempHideCursor aHideCursor( *this );
+ SuppressCursor aHideCursor( *this );
// TODO: call a onStartScroll at our listener (or better an own onStartScroll,
// which hides the cursor and then calls the listener)
// Same for onEndScroll
@@ -1837,43 +2249,68 @@ namespace svt { namespace table
m_pVScroll->SetThumbPos( m_nTopRow );
}
+ // The scroll bar availaility might change when we scrolled. This is because we do not hide
+ // the scrollbar when it is, in theory, unnecessary, but currently at a position > 0. In this case, it will
+ // be auto-hidden when it's scrolled back to pos 0.
+ if ( m_nTopRow == 0 )
+ m_rAntiImpl.PostUserEvent( LINK( this, TableControl_Impl, OnUpdateScrollbars ) );
+
return (TableSize)( m_nTopRow - nOldTopRow );
}
//--------------------------------------------------------------------
+ TableSize TableControl_Impl::impl_scrollRows( TableSize const i_rowDelta )
+ {
+ DBG_CHECK_ME();
+ return impl_ni_ScrollRows( i_rowDelta );
+ }
+
+ //--------------------------------------------------------------------
TableSize TableControl_Impl::impl_ni_ScrollColumns( TableSize _nColumnDelta )
{
// compute new left column
- ColPos nNewLeftColumn =
+ const ColPos nNewLeftColumn =
::std::max(
::std::min( (ColPos)( m_nLeftColumn + _nColumnDelta ), (ColPos)( m_nColumnCount - 1 ) ),
(ColPos)0
);
- ColPos nOldLeftColumn = m_nLeftColumn;
+ const ColPos nOldLeftColumn = m_nLeftColumn;
m_nLeftColumn = nNewLeftColumn;
// if updates are enabled currently, scroll the viewport
- if ( m_rAntiImpl.IsUpdateMode() && ( m_nLeftColumn != nOldLeftColumn ) )
+ if ( m_nLeftColumn != nOldLeftColumn )
{
DBG_SUSPEND_INV( INV_SCROLL_POSITION );
- TempHideCursor aHideCursor( *this );
+ SuppressCursor aHideCursor( *this );
// TODO: call a onStartScroll at our listener (or better an own onStartScroll,
// which hides the cursor and then calls the listener)
// Same for onEndScroll
// scroll the view port, if possible
- Rectangle aDataArea( Point( m_nRowHeaderWidthPixel, 0 ), m_pDataWindow->GetOutputSizePixel() );
+ const Rectangle aDataArea( Point( m_nRowHeaderWidthPixel, 0 ), m_pDataWindow->GetOutputSizePixel() );
long nPixelDelta =
- ( m_nLeftColumn > 0 ? m_aAccColumnWidthsPixel[ m_nLeftColumn - 1 ] : 0 )
- - ( nOldLeftColumn > 0 ? m_aAccColumnWidthsPixel[ nOldLeftColumn - 1 ] : 0 );
+ m_aColumnWidths[ nOldLeftColumn ].getStart()
+ - m_aColumnWidths[ m_nLeftColumn ].getStart();
+
+ // update our column positions
+ // Do this *before* scrolling, as SCROLL_UPDATE will trigger a paint, which already needs the correct
+ // information in m_aColumnWidths
+ for ( ColumnPositions::iterator colPos = m_aColumnWidths.begin();
+ colPos != m_aColumnWidths.end();
+ ++colPos
+ )
+ {
+ colPos->move( nPixelDelta );
+ }
+ // scroll the window content (if supported and possible), or invalidate the complete window
if ( m_pDataWindow->GetBackground().IsScrollable()
&& abs( nPixelDelta ) < aDataArea.GetWidth()
)
{
- m_pDataWindow->Scroll( (long)-nPixelDelta, 0, aDataArea, SCROLL_CLIP | SCROLL_UPDATE );
+ m_pDataWindow->Scroll( nPixelDelta, 0, aDataArea, SCROLL_CLIP | SCROLL_UPDATE );
}
else
m_pDataWindow->Invalidate( INVALIDATE_UPDATE );
@@ -1882,39 +2319,55 @@ namespace svt { namespace table
m_pHScroll->SetThumbPos( m_nLeftColumn );
}
+ // The scroll bar availaility might change when we scrolled. This is because we do not hide
+ // the scrollbar when it is, in theory, unnecessary, but currently at a position > 0. In this case, it will
+ // be auto-hidden when it's scrolled back to pos 0.
+ if ( m_nLeftColumn == 0 )
+ m_rAntiImpl.PostUserEvent( LINK( this, TableControl_Impl, OnUpdateScrollbars ) );
+
return (TableSize)( m_nLeftColumn - nOldLeftColumn );
}
- //-------------------------------------------------------------------------------
- SelectionEngine* TableControl_Impl::getSelEngine()
+
+ //------------------------------------------------------------------------------------------------------------------
+ TableSize TableControl_Impl::impl_scrollColumns( TableSize const i_columnDelta )
{
- return m_pSelEngine;
+ DBG_CHECK_ME();
+ return impl_ni_ScrollColumns( i_columnDelta );
}
- //-------------------------------------------------------------------------------
- TableDataWindow* TableControl_Impl::getDataWindow()
+
+ //------------------------------------------------------------------------------------------------------------------
+ SelectionEngine* TableControl_Impl::getSelEngine()
{
- return m_pDataWindow;
+ return m_pSelEngine;
}
- //-------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
ScrollBar* TableControl_Impl::getHorzScrollbar()
{
return m_pHScroll;
}
- //-------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
ScrollBar* TableControl_Impl::getVertScrollbar()
{
return m_pVScroll;
}
- //-------------------------------------------------------------------------------
- BOOL TableControl_Impl::isRowSelected(const ::std::vector<RowPos>& selectedRows, RowPos current)
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableControl_Impl::isRowSelected( RowPos i_row ) const
{
- return ::std::find(selectedRows.begin(),selectedRows.end(),current) != selectedRows.end();
+ return ::std::find( m_aSelectedRows.begin(), m_aSelectedRows.end(), i_row ) != m_aSelectedRows.end();
}
- //-------------------------------------------------------------------------------
- bool TableControl_Impl::isRowSelected(RowPos current)
+
+ //------------------------------------------------------------------------------------------------------------------
+ RowPos TableControl_Impl::getSelectedRowIndex( size_t const i_selectionIndex ) const
{
- return ::std::find(m_nRowSelected.begin(),m_nRowSelected.end(),current) != m_nRowSelected.end();
+ if ( i_selectionIndex < m_aSelectedRows.size() )
+ return m_aSelectedRows[ i_selectionIndex ];
+ return ROW_INVALID;
}
- //-------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
int TableControl_Impl::getRowSelectedNumber(const ::std::vector<RowPos>& selectedRows, RowPos current)
{
std::vector<RowPos>::const_iterator it = ::std::find(selectedRows.begin(),selectedRows.end(),current);
@@ -1924,272 +2377,158 @@ namespace svt { namespace table
}
return -1;
}
- //-------------------------------------------------------------------------------
- bool TableControl_Impl::isTooltipActive()
- {
- return m_rAntiImpl.isTooltip();
- }
- //-------------------------------------------------------------------------------
- ::rtl::OUString& TableControl_Impl::setTooltip(const Point& rPoint )
+
+ //--------------------------------------------------------------------
+ ColPos TableControl_Impl::impl_getColumnForOrdinate( long const i_ordinate ) const
{
- ::rtl::OUString aTooltipText;
- RowPos current = getCurrentRow(rPoint);
- com::sun::star::uno::Sequence< sal_Int32 > cols = m_rAntiImpl.getColumnsForTooltip();
- com::sun::star::uno::Sequence< ::rtl::OUString > text = m_rAntiImpl.getTextForTooltip();
- if(text.getLength()==0 && cols.getLength()==0)
- {
- ::com::sun::star::uno::Any content = m_pModel->getCellContent()[current][m_nCurColumn];
- aTooltipText = convertToString(content);
- }
- else if(text.getLength() == 0)
- {
- for(int i=0; i<cols.getLength(); i++)
- {
- if(i==0)
- {
- ::com::sun::star::uno::Any content = m_pModel->getCellContent()[current][cols[i]];
- aTooltipText = convertToString(content);
- }
- else
- {
- aTooltipText+= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "\n" ));
- ::com::sun::star::uno::Any content = m_pModel->getCellContent()[current][cols[i]];
- aTooltipText += convertToString(content);
- }
- }
- }
- else if(cols.getLength() == 0)
- {
- for(int i=0; i<text.getLength(); i++)
- {
- if(i==0)
- aTooltipText = text[i];
- else
- {
- aTooltipText+= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "\n" ));
- aTooltipText+= text[i];
- }
- }
- }
- else
+ DBG_CHECK_ME();
+
+ if ( ( m_aColumnWidths.empty() ) || ( i_ordinate < 0 ) )
+ return COL_INVALID;
+
+ if ( i_ordinate < m_nRowHeaderWidthPixel )
+ return COL_ROW_HEADERS;
+
+ long const ordinate = i_ordinate - m_nRowHeaderWidthPixel;
+
+ ColumnPositions::const_iterator lowerBound = ::std::lower_bound(
+ m_aColumnWidths.begin(),
+ m_aColumnWidths.end(),
+ ordinate + 1,
+ ColumnInfoPositionLess()
+ );
+ if ( lowerBound == m_aColumnWidths.end() )
{
- int nCols = cols.getLength();
- int mText = text.getLength();
- if(nCols < mText )
- cols.realloc(mText);
- else if(mText < nCols)
- text.realloc(nCols);
- for(int i=0; i<cols.getLength(); i++)
- {
- if(i==0)
- {
- ::com::sun::star::uno::Any content = m_pModel->getCellContent()[current][cols[i]];
- aTooltipText = text[i] + convertToString(content);
- }
- else
- {
- aTooltipText+= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "\n" ));
- aTooltipText+= text[i];
- if(nCols > i)
- {
- ::com::sun::star::uno::Any content = m_pModel->getCellContent()[current][cols[i]];
- ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >xGraphic;
- aTooltipText += convertToString(content);
- }
- }
- }
+ // point is *behind* the start of the last column ...
+ if ( ordinate < m_aColumnWidths.rbegin()->getEnd() )
+ // ... but still before its end
+ return m_nColumnCount - 1;
+ return COL_INVALID;
}
- return m_aTooltipText = aTooltipText;
+ return lowerBound - m_aColumnWidths.begin();
}
+
//--------------------------------------------------------------------
- void TableControl_Impl::resizeColumn(const Point& rPoint)
- {
- Pointer aNewPointer(POINTER_ARROW);
- int resizingColumn=m_nCurColumn-m_nLeftColumn;
- PColumnModel pColumn = m_pModel->getColumnModel(m_nCurColumn);
- impl_ni_getAccVisibleColWidths();
- int newColWidth = m_aColumnWidthsPixel[m_nCurColumn];
- //subtract 1 from m_aAccColumnWidthPixel because right border should be part of the current cell
- if(m_aVisibleColumnWidthsPixel[resizingColumn]-1 == rPoint.X() && pColumn->isResizable())
- aNewPointer = Pointer( POINTER_HSPLIT );
- //MouseButton was pressed but not yet released, mouse is moving
- if(m_bResizing)
- {
- if(rPoint.X() > m_pDataWindow->GetOutputSizePixel().Width() || rPoint.X() < m_aVisibleColumnWidthsPixel[resizingColumn]-newColWidth)
- aNewPointer = Pointer( POINTER_NOTALLOWED);
- else
- aNewPointer = Pointer( POINTER_HSPLIT );
- m_pDataWindow->HideTracking();
- int lineHeight = 0;
- if(m_pModel->hasColumnHeaders())
- lineHeight+= m_nColHeaderHeightPixel;
- lineHeight+=m_nRowHeightPixel*m_nRowCount;
- int gridHeight = m_pDataWindow->GetOutputSizePixel().Height();
- if(lineHeight >= gridHeight)
- lineHeight = gridHeight;
- m_pDataWindow->ShowTracking(Rectangle(Point(rPoint.X(),0), Size(1, lineHeight )),
- SHOWTRACK_SPLIT | SHOWTRACK_WINDOW);
- }
- m_pDataWindow->SetPointer(aNewPointer);
+ RowPos TableControl_Impl::impl_getRowForAbscissa( long const i_abscissa ) const
+ {
+ DBG_CHECK_ME();
+
+ if ( i_abscissa < 0 )
+ return ROW_INVALID;
+
+ if ( i_abscissa < m_nColHeaderHeightPixel )
+ return ROW_COL_HEADERS;
+
+ long const abscissa = i_abscissa - m_nColHeaderHeightPixel;
+ long const row = m_nTopRow + abscissa / m_nRowHeightPixel;
+ return row < m_pModel->getRowCount() ? row : ROW_INVALID;
}
+
//--------------------------------------------------------------------
- bool TableControl_Impl::startResizeColumn(const Point& rPoint)
+ bool TableControl_Impl::markRowAsDeselected( RowPos const i_rowIndex )
{
- m_bResizingGrid = false;
- m_nResizingColumn = m_nCurColumn;
- PColumnModel pColumn = m_pModel->getColumnModel(m_nResizingColumn);
- if(m_aVisibleColumnWidthsPixel[m_nResizingColumn-m_nLeftColumn]-1 == rPoint.X() && pColumn->isResizable())
- {
- m_pDataWindow->CaptureMouse();
- m_bResizing = true;
- }
- return m_bResizing;
+ DBG_CHECK_ME();
+
+ ::std::vector< RowPos >::iterator selPos = ::std::find( m_aSelectedRows.begin(), m_aSelectedRows.end(), i_rowIndex );
+ if ( selPos == m_aSelectedRows.end() )
+ return false;
+
+ m_aSelectedRows.erase( selPos );
+ return true;
}
+
//--------------------------------------------------------------------
- bool TableControl_Impl::endResizeColumn(const Point& rPoint)
- {
- if(m_bResizing)
- {
- m_pDataWindow->HideTracking();
- PColumnModel pColumn = m_pModel->getColumnModel(m_nResizingColumn);
- int maxWidth = m_rAntiImpl.LogicToPixel( Size( pColumn->getMaxWidth(), 0 ), MAP_APPFONT ).Width();
- int minWidth = m_rAntiImpl.LogicToPixel( Size( pColumn->getMinWidth(), 0 ), MAP_APPFONT ).Width();
- int resizeCol = m_nResizingColumn-m_nLeftColumn;
- //new position of mouse
- int actX = rPoint.X();
- //old position of right border
- int oldX = m_aVisibleColumnWidthsPixel[resizeCol];
- //position of left border if cursor in the first cell
- int leftX = 0;
- if(m_nResizingColumn > m_nLeftColumn)
- leftX = m_aVisibleColumnWidthsPixel[resizeCol-1];
- else if(m_nResizingColumn == m_nLeftColumn && m_pModel->hasRowHeaders())
- leftX = m_rAntiImpl.LogicToPixel( Size( m_pModel->getRowHeaderWidth(), 0 ), MAP_APPFONT ).Width();
- int actWidth = actX - leftX;
- int newActWidth = 0;
- //minimize the column width
- if(oldX > actX && actX >= leftX)
+ bool TableControl_Impl::markRowAsSelected( RowPos const i_rowIndex )
+ {
+ DBG_CHECK_ME();
+
+ if ( isRowSelected( i_rowIndex ) )
+ return false;
+
+ SelectionMode const eSelMode = getSelEngine()->GetSelectionMode();
+ switch ( eSelMode )
+ {
+ case SINGLE_SELECTION:
+ if ( !m_aSelectedRows.empty() )
{
- if(minWidth < actWidth)
- {
- newActWidth = m_rAntiImpl.PixelToLogic( Size( actWidth, 0 ), MAP_APPFONT ).Width();
- pColumn->setPreferredWidth(newActWidth);
- }
- else
- pColumn->setPreferredWidth(pColumn->getMinWidth());
- if(m_nLeftColumn != 0)
- impl_updateLeftColumn();
+ OSL_ENSURE( m_aSelectedRows.size() == 1, "TableControl::markRowAsSelected: SingleSelection with more than one selected element?" );
+ m_aSelectedRows[0] = i_rowIndex;
+ break;
+ }
+ // fall through
+
+ case MULTIPLE_SELECTION:
+ m_aSelectedRows.push_back( i_rowIndex );
+ break;
+
+ default:
+ OSL_ENSURE( false, "TableControl_Impl::markRowAsSelected: unsupported selection mode!" );
+ return false;
}
- else if(oldX < actX)
+
+ return true;
+ }
+
+ //--------------------------------------------------------------------
+ bool TableControl_Impl::markAllRowsAsDeselected()
+ {
+ if ( m_aSelectedRows.empty() )
+ return false;
+
+ m_aSelectedRows.clear();
+ return true;
+ }
+
+ //--------------------------------------------------------------------
+ bool TableControl_Impl::markAllRowsAsSelected()
+ {
+ DBG_CHECK_ME();
+
+ SelectionMode const eSelMode = getSelEngine()->GetSelectionMode();
+ ENSURE_OR_RETURN_FALSE( eSelMode == MULTIPLE_SELECTION, "TableControl_Impl::markAllRowsAsSelected: unsupported selection mode!" );
+
+ if ( m_aSelectedRows.size() == size_t( m_pModel->getRowCount() ) )
{
- if(actWidth < maxWidth)
+ #if OSL_DEBUG_LEVEL > 0
+ for ( TableSize row = 0; row < m_pModel->getRowCount(); ++row )
{
- newActWidth = m_rAntiImpl.PixelToLogic( Size( actWidth, 0 ), MAP_APPFONT ).Width();
- pColumn->setPreferredWidth(newActWidth);
+ OSL_ENSURE( isRowSelected( row ), "TableControl_Impl::markAllRowsAsSelected: inconsistency in the selected rows!" );
}
- else
- pColumn->setPreferredWidth(pColumn->getMaxWidth());
+ #endif
+ // already all rows marked as selected
+ return false;
}
- m_nCurColumn = m_nResizingColumn;
- impl_ni_updateColumnWidths();
- impl_ni_updateScrollbars();
- m_pDataWindow->Invalidate(INVALIDATE_UPDATE);
- m_pDataWindow->SetPointer(Pointer());
- m_bResizing = false;
- m_bResizingGrid = true;
- }
- m_pDataWindow->ReleaseMouse();
- return m_bResizing;
- }
- //-------------------------------------------------------------------------------
- void TableControl_Impl::impl_ni_getAccVisibleColWidths()
- {
- TableSize nVisCols = impl_getVisibleColumns(true);
- int widthsPixel = 0;
- m_aVisibleColumnWidthsPixel.resize(0);
- m_aVisibleColumnWidthsPixel.reserve(nVisCols);
- int headerRowWidth = 0;
- if(m_pModel->hasRowHeaders())
- {
- headerRowWidth = m_rAntiImpl.LogicToPixel( Size(m_pModel->getRowHeaderWidth(), 0 ), MAP_APPFONT ).Width();
- widthsPixel+=headerRowWidth;
- }
- int col = m_nLeftColumn;
- while(nVisCols)
- {
- m_aVisibleColumnWidthsPixel.push_back(widthsPixel+=m_aColumnWidthsPixel[col]);
- col++;
- nVisCols--;
- }
- }
- //-------------------------------------------------------------------------------
- void TableControl_Impl::impl_updateLeftColumn()
- {
- int nVisCols = m_aVisibleColumnWidthsPixel.size();
- int headerRowWidth = 0;
- //sum of currently visible columns
- int widthsPixel = 0;
- //header pixel should be added, because header doesn't vanish when scrolling
- if(m_pModel->hasRowHeaders())
- {
- headerRowWidth = m_rAntiImpl.LogicToPixel( Size(m_pModel->getRowHeaderWidth(), 0 ), MAP_APPFONT ).Width();
- widthsPixel+=headerRowWidth;
- }
- int col = m_nLeftColumn;
- //add column width of the neighbour of the left column
- widthsPixel+=m_aColumnWidthsPixel[col-1];
- //compute the sum of the new column widths
- while(nVisCols)
- {
- PColumnModel pColumn = m_pModel->getColumnModel(col);
- int colWidth = pColumn->getWidth();
- int colPrefWidth = pColumn->getPreferredWidth();
- if(colPrefWidth!=0)
- colWidth = colPrefWidth;
- widthsPixel += m_rAntiImpl.LogicToPixel( Size( colWidth, 0 ), MAP_APPFONT ).Width();
- col++;
- nVisCols--;
- }
- //when the sum of all visible columns and the next to the left column is smaller than
- //window width, then update m_nLeftColumn
- if(widthsPixel<m_pDataWindow->GetOutputSizePixel().Width())
- m_nLeftColumn--;
+
+ m_aSelectedRows.clear();
+ for ( RowPos i=0; i < m_pModel->getRowCount(); ++i )
+ m_aSelectedRows.push_back(i);
+
+ return true;
}
+
//--------------------------------------------------------------------
- rtl::OUString TableControl_Impl::convertToString(const ::com::sun::star::uno::Any& value)
- {
- sal_Int32 nInt = 0;
- sal_Bool bBool = false;
- double fDouble = 0;
- ::rtl::OUString sNewString;
- ::rtl::OUString sConvertString;
- if(value >>= sConvertString)
- sNewString = sConvertString;
- else if(value >>= nInt)
- sNewString = sConvertString.valueOf(nInt);
- else if(value >>= bBool)
- sNewString = sConvertString.valueOf(bBool);
- else if(value >>= fDouble)
- sNewString = sConvertString.valueOf(fDouble);
- return sNewString;
- }
Rectangle TableControl_Impl::calcHeaderRect(bool bColHeader)
{
- Rectangle aRectTable, aRectTableWithHeaders;
- impl_getAllVisibleDataCellArea(aRectTable);
- impl_getAllVisibleCellsArea(aRectTableWithHeaders);
- Size aSizeTable(aRectTable.GetSize());
- Size aSizeTableWithHeaders(aRectTableWithHeaders.GetSize());
- if(bColHeader)
- return Rectangle(aRectTableWithHeaders.TopLeft(),Size(aSizeTableWithHeaders.Width()-aSizeTable.Width(), aSizeTableWithHeaders.Height()));
+ Rectangle const aRectTableWithHeaders( impl_getAllVisibleCellsArea() );
+ Size const aSizeTableWithHeaders( aRectTableWithHeaders.GetSize() );
+ if ( bColHeader )
+ return Rectangle( aRectTableWithHeaders.TopLeft(), Size( aSizeTableWithHeaders.Width(), m_nColHeaderHeightPixel ) );
else
- return Rectangle(aRectTableWithHeaders.TopLeft(),Size(aSizeTableWithHeaders.Width(), aSizeTableWithHeaders.Height()-aSizeTable.Height()));
+ return Rectangle( aRectTableWithHeaders.TopLeft(), Size( m_nRowHeaderWidthPixel, aSizeTableWithHeaders.Height() ) );
}
+
+ //--------------------------------------------------------------------
Rectangle TableControl_Impl::calcTableRect()
{
- Rectangle aRect;
- impl_getAllVisibleDataCellArea(aRect);
- return aRect;
+ return impl_getAllVisibleDataCellArea();
+ }
+
+ //--------------------------------------------------------------------
+ IMPL_LINK( TableControl_Impl, OnUpdateScrollbars, void*, /**/ )
+ {
+ DBG_CHECK_ME();
+ impl_ni_updateScrollbars();
+ return 1L;
}
//--------------------------------------------------------------------
@@ -2205,159 +2544,202 @@ namespace svt { namespace table
return 0L;
}
- //---------------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XAccessible > TableControl_Impl::getAccessible( Window& i_parentWindow )
+ {
+ DBG_TESTSOLARMUTEX();
+ if ( m_pAccessibleTable == NULL )
+ {
+ Reference< XAccessible > const xAccParent = i_parentWindow.GetAccessible();
+ if ( xAccParent.is() )
+ {
+ m_pAccessibleTable = m_aFactoryAccess.getFactory().createAccessibleTableControl(
+ xAccParent, m_rAntiImpl
+ );
+ }
+ }
+
+ Reference< XAccessible > xAccessible;
+ if ( m_pAccessibleTable )
+ xAccessible = m_pAccessibleTable->getMyself();
+ return xAccessible;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::disposeAccessible()
+ {
+ if ( m_pAccessibleTable )
+ m_pAccessibleTable->dispose();
+ m_pAccessibleTable = NULL;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableControl_Impl::impl_isAccessibleAlive() const
+ {
+ DBG_CHECK_ME();
+ return ( NULL != m_pAccessibleTable ) && m_pAccessibleTable->isAlive();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::impl_commitAccessibleEvent( sal_Int16 const i_eventID, Any const & i_newValue, Any const & i_oldValue )
+ {
+ DBG_CHECK_ME();
+ if ( impl_isAccessibleAlive() )
+ m_pAccessibleTable->commitEvent( i_eventID, i_newValue, i_oldValue );
+ }
+
+ //==================================================================================================================
+ //= TableFunctionSet
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
TableFunctionSet::TableFunctionSet(TableControl_Impl* _pTableControl)
:m_pTableControl( _pTableControl)
- ,m_nCurrentRow (-2)
+ ,m_nCurrentRow( ROW_INVALID )
{
}
- //-------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
TableFunctionSet::~TableFunctionSet()
{
}
- //-------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableFunctionSet::BeginDrag()
{
}
- //-------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableFunctionSet::CreateAnchor()
{
- m_pTableControl->m_nAnchor = m_pTableControl->m_nCurRow;
+ m_pTableControl->setAnchor( m_pTableControl->getCurRow() );
}
- //-------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
void TableFunctionSet::DestroyAnchor()
{
- m_pTableControl->m_nAnchor = -1;
+ m_pTableControl->setAnchor( ROW_INVALID );
}
- //-------------------------------------------------------------------------------
- BOOL TableFunctionSet::SetCursorAtPoint(const Point& rPoint, BOOL bDontSelectAtCursor)
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool TableFunctionSet::SetCursorAtPoint(const Point& rPoint, sal_Bool bDontSelectAtCursor)
{
- BOOL bHandled = FALSE;
- Rectangle rCells;
- //curRow is the row where the mouse click happened, m_nCurRow is the last selected row, before the mouse click
- RowPos curRow = m_pTableControl->getCurrentRow(rPoint);
- if(curRow == -2)
- return FALSE;
- if( bDontSelectAtCursor )
+ sal_Bool bHandled = sal_False;
+ // newRow is the row which includes the point, getCurRow() is the last selected row, before the mouse click
+ RowPos newRow = m_pTableControl->getRowAtPoint( rPoint );
+ if ( newRow == ROW_COL_HEADERS )
+ newRow = m_pTableControl->getTopRow();
+
+ ColPos newCol = m_pTableControl->getColAtPoint( rPoint );
+ if ( newCol == COL_ROW_HEADERS )
+ newCol = m_pTableControl->getLeftColumn();
+
+ if ( ( newRow == ROW_INVALID ) || ( newCol == COL_INVALID ) )
+ return sal_False;
+
+ if ( bDontSelectAtCursor )
{
- if(m_pTableControl->m_nRowSelected.size()>1)
- m_pTableControl->m_pSelEngine->AddAlways(TRUE);
- bHandled = TRUE;
+ if ( m_pTableControl->getSelectedRowCount() > 1 )
+ m_pTableControl->getSelEngine()->AddAlways(sal_True);
+ bHandled = sal_True;
}
- else if(m_pTableControl->m_nAnchor == m_pTableControl->m_nCurRow)
+ else if ( m_pTableControl->getAnchor() == m_pTableControl->getCurRow() )
{
//selecting region,
- int diff = m_pTableControl->m_nCurRow - curRow;
+ int diff = m_pTableControl->getCurRow() - newRow;
//selected region lies above the last selection
if( diff >= 0)
{
//put selected rows in vector
- while(m_pTableControl->m_nAnchor>=curRow)
+ while ( m_pTableControl->getAnchor() >= newRow )
{
- bool isAlreadySelected = m_pTableControl->isRowSelected(m_pTableControl->m_nRowSelected, m_pTableControl->m_nAnchor);
- //if row isn't selected, put it in vector, otherwise don't put it there, because it will be twice there
- if(!isAlreadySelected)
- m_pTableControl->m_nRowSelected.push_back(m_pTableControl->m_nAnchor);
- m_pTableControl->m_nAnchor--;
+ m_pTableControl->markRowAsSelected( m_pTableControl->getAnchor() );
+ m_pTableControl->setAnchor( m_pTableControl->getAnchor() - 1 );
diff--;
}
- m_pTableControl->m_nAnchor++;
+ m_pTableControl->setAnchor( m_pTableControl->getAnchor() + 1 );
}
//selected region lies beneath the last selected row
else
{
- while(m_pTableControl->m_nAnchor<=curRow)
+ while ( m_pTableControl->getAnchor() <= newRow )
{
- bool isAlreadySelected = m_pTableControl->isRowSelected(m_pTableControl->m_nRowSelected, m_pTableControl->m_nAnchor);
- if(!isAlreadySelected)
- m_pTableControl->m_nRowSelected.push_back(m_pTableControl->m_nAnchor);
- m_pTableControl->m_nAnchor++;
+ m_pTableControl->markRowAsSelected( m_pTableControl->getAnchor() );
+ m_pTableControl->setAnchor( m_pTableControl->getAnchor() + 1 );
diff++;
}
- m_pTableControl->m_nAnchor--;
+ m_pTableControl->setAnchor( m_pTableControl->getAnchor() - 1 );
}
- m_pTableControl->invalidateSelectedRegion(m_pTableControl->m_nCurRow, curRow, rCells);
- bHandled = TRUE;
+ Rectangle aCellRect;
+ m_pTableControl->invalidateSelectedRegion( m_pTableControl->getCurRow(), newRow, aCellRect );
+ bHandled = sal_True;
}
//no region selected
else
{
- if(m_pTableControl->m_nRowSelected.empty())
- m_pTableControl->m_nRowSelected.push_back(curRow);
+ if ( !m_pTableControl->hasRowSelection() )
+ m_pTableControl->markRowAsSelected( newRow );
else
{
- if(m_pTableControl->m_pSelEngine->GetSelectionMode()==SINGLE_SELECTION)
+ if ( m_pTableControl->getSelEngine()->GetSelectionMode() == SINGLE_SELECTION )
{
DeselectAll();
- m_pTableControl->m_nRowSelected.push_back(curRow);
+ m_pTableControl->markRowAsSelected( newRow );
}
else
{
- bool isAlreadySelected = m_pTableControl->isRowSelected(m_pTableControl->m_nRowSelected, curRow);
- if(!isAlreadySelected)
- m_pTableControl->m_nRowSelected.push_back(curRow);
+ m_pTableControl->markRowAsSelected( newRow );
}
}
- if(m_pTableControl->m_nRowSelected.size()>1 && m_pTableControl->m_pSelEngine->GetSelectionMode()!=SINGLE_SELECTION)
- m_pTableControl->m_pSelEngine->AddAlways(TRUE);
- m_pTableControl->invalidateSelectedRegion(curRow, curRow, rCells);
- bHandled = TRUE;
+ if ( m_pTableControl->getSelectedRowCount() > 1 && m_pTableControl->getSelEngine()->GetSelectionMode() != SINGLE_SELECTION )
+ m_pTableControl->getSelEngine()->AddAlways(sal_True);
+
+ Rectangle aCellRect;
+ m_pTableControl->invalidateSelectedRegion( newRow, newRow, aCellRect );
+ bHandled = sal_True;
}
- m_pTableControl->m_nCurRow = curRow;
- m_pTableControl->ensureVisible(m_pTableControl->m_nCurColumn,m_pTableControl->m_nCurRow,false);
+ m_pTableControl->goTo( newCol, newRow );
return bHandled;
}
- //-------------------------------------------------------------------------------
- BOOL TableFunctionSet::IsSelectionAtPoint( const Point& rPoint )
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool TableFunctionSet::IsSelectionAtPoint( const Point& rPoint )
{
- m_pTableControl->m_pSelEngine->AddAlways(FALSE);
- if(m_pTableControl->m_nRowSelected.empty())
- return FALSE;
+ m_pTableControl->getSelEngine()->AddAlways(sal_False);
+ if ( !m_pTableControl->hasRowSelection() )
+ return sal_False;
else
{
- RowPos curRow = m_pTableControl->getCurrentRow(rPoint);
- m_pTableControl->m_nAnchor = -1;
- bool selected = m_pTableControl->isRowSelected(m_pTableControl->m_nRowSelected, curRow);
+ RowPos curRow = m_pTableControl->getRowAtPoint( rPoint );
+ m_pTableControl->setAnchor( ROW_INVALID );
+ bool selected = m_pTableControl->isRowSelected( curRow );
m_nCurrentRow = curRow;
return selected;
}
}
- //-------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableFunctionSet::DeselectAtPoint( const Point& rPoint )
{
(void)rPoint;
- long pos = 0;
- long i = 0;
- Rectangle rCells;
- for(std::vector<RowPos>::iterator it=m_pTableControl->m_nRowSelected.begin();
- it!=m_pTableControl->m_nRowSelected.end();++it)
- {
- if(*it == m_nCurrentRow)
- {
- pos = i;
- m_pTableControl->invalidateSelectedRegion(*it, *it, rCells);
- }
- ++i;
- }
- m_pTableControl->m_nRowSelected.erase(m_pTableControl->m_nRowSelected.begin()+pos);
+ Rectangle aCellRange;
+ m_pTableControl->invalidateSelectedRegion( m_nCurrentRow, m_nCurrentRow, aCellRange );
+ m_pTableControl->markRowAsDeselected( m_nCurrentRow );
}
- //-------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
void TableFunctionSet::DeselectAll()
{
- if(!m_pTableControl->m_nRowSelected.empty())
+ if ( m_pTableControl->hasRowSelection() )
{
- Rectangle rCells;
- for(std::vector<RowPos>::iterator it=m_pTableControl->m_nRowSelected.begin();
- it!=m_pTableControl->m_nRowSelected.end();++it)
+ Rectangle aCellRange;
+ for ( size_t i=0; i<m_pTableControl->getSelectedRowCount(); ++i )
{
- m_pTableControl->invalidateSelectedRegion(*it, *it, rCells);
+ RowPos const rowIndex = m_pTableControl->getSelectedRowIndex(i);
+ m_pTableControl->invalidateSelectedRegion( rowIndex, rowIndex, aCellRange );
}
- m_pTableControl->m_nRowSelected.clear();
+
+ m_pTableControl->markAllRowsAsDeselected();
}
}
-//........................................................................
+//......................................................................................................................
} } // namespace svt::table
-//........................................................................
+//......................................................................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/table/tablecontrol_impl.hxx b/svtools/source/table/tablecontrol_impl.hxx
index 3f10f9ce2830..2f9cffd3089b 100644..100755
--- a/svtools/source/table/tablecontrol_impl.hxx
+++ b/svtools/source/table/tablecontrol_impl.hxx
@@ -28,14 +28,16 @@
#ifndef SVTOOLS_TABLECONTROL_IMPL_HXX
#define SVTOOLS_TABLECONTROL_IMPL_HXX
-#include <svtools/table/tablemodel.hxx>
+#include "svtools/table/tablemodel.hxx"
+#include "svtools/table/tablecontrolinterface.hxx"
-#include <svtools/table/abstracttablecontrol.hxx>
+#include "svtaccessiblefactory.hxx"
-#include <svtools/table/tablemodel.hxx>
-#include <vector>
#include <vcl/seleng.hxx>
+#include <vector>
+
+#include <boost/scoped_ptr.hpp>
class ScrollBar;
class ScrollBarBox;
@@ -45,7 +47,42 @@ namespace svt { namespace table
{
//........................................................................
- typedef ::std::vector< long > ArrayOfLong;
+ struct MutableColumnMetrics : protected ColumnMetrics
+ {
+ MutableColumnMetrics()
+ :ColumnMetrics()
+ {
+ }
+
+ MutableColumnMetrics( long const i_startPixel, long const i_endPixel )
+ :ColumnMetrics( i_startPixel, i_endPixel )
+ {
+ }
+
+ long getStart() const { return nStartPixel; }
+ long getEnd() const { return nEndPixel; }
+
+ void setEnd( long const i_end ) { nEndPixel = i_end; }
+ void move( long const i_offset ) { nStartPixel += i_offset; nEndPixel += i_offset; }
+
+ long getWidth() const { return nEndPixel - nStartPixel; }
+
+ ColumnMetrics const & operator()() { return *this; }
+ };
+
+ struct ColumnInfoPositionLess
+ {
+ bool operator()( MutableColumnMetrics const& i_colInfo, long const i_position )
+ {
+ return i_colInfo.getEnd() < i_position;
+ }
+ bool operator()( long const i_position, MutableColumnMetrics const& i_colInfo )
+ {
+ return i_position < i_colInfo.getStart();
+ }
+ };
+
+ typedef ::std::vector< MutableColumnMetrics > ColumnPositions;
class TableControl;
class TableDataWindow;
@@ -54,13 +91,14 @@ namespace svt { namespace table
//====================================================================
//= TableControl_Impl
//====================================================================
- class TableControl_Impl : public IAbstractTableControl
+ class TableControl_Impl :public ITableControl
+ ,public ITableModelListener
{
friend class TableGeometry;
friend class TableRowGeometry;
friend class TableColumnGeometry;
friend class SuspendInvariants;
- friend class TableFunctionSet;
+
private:
/// the control whose impl-instance we implemnt
TableControl& m_rAntiImpl;
@@ -68,14 +106,9 @@ namespace svt { namespace table
PTableModel m_pModel;
/// the input handler to use, usually the input handler as provided by ->m_pModel
PTableInputHandler m_pInputHandler;
- /// the widths of the single columns, measured in pixel
- ArrayOfLong m_aColumnWidthsPixel;
- /** the accumulated widths of the single columns, i.e. their exclusive right borders,
- <strong<not</strong> counting the space for a possible row header column
- */
- ArrayOfLong m_aAccColumnWidthsPixel;
+ /// info about the widths of our columns
+ ColumnPositions m_aColumnWidths;
- ArrayOfLong m_aVisibleColumnWidthsPixel;
/// the height of a single row in the table, measured in pixels
long m_nRowHeightPixel;
/// the height of the column header row in the table, measured in pixels
@@ -85,9 +118,13 @@ namespace svt { namespace table
/// the number of columns in the table control. Cached model value.
TableSize m_nColumnCount;
+
/// the number of rows in the table control. Cached model value.
TableSize m_nRowCount;
+ /// denotes whether or not the columns fitted into the available width, last time we checked
+ long m_bColumnsFit;
+
ColPos m_nCurColumn;
RowPos m_nCurRow;
ColPos m_nLeftColumn;
@@ -100,24 +137,27 @@ namespace svt { namespace table
The window's upper left corner is at position (0,0), relative to the
table control, which is the direct parent of the data window.
*/
- TableDataWindow* m_pDataWindow;
+ ::boost::scoped_ptr< TableDataWindow >
+ m_pDataWindow;
/// the vertical scrollbar, if any
ScrollBar* m_pVScroll;
/// the horizontal scrollbar, if any
- ScrollBar* m_pHScroll;
+ ScrollBar* m_pHScroll;
ScrollBarBox* m_pScrollCorner;
- //selection engine - for determining selection range, e.g. single, multiple
- SelectionEngine* m_pSelEngine;
- //vector which contains the selected rows
- std::vector<RowPos> m_nRowSelected;
- //part of selection engine
- TableFunctionSet* m_pTableFunctionSet;
- //part of selection engine
- RowPos m_nAnchor;
- bool m_bResizing;
- ColPos m_nResizingColumn;
- bool m_bResizingGrid;
- rtl::OUString m_aTooltipText;
+ //selection engine - for determining selection range, e.g. single, multiple
+ SelectionEngine* m_pSelEngine;
+ //vector which contains the selected rows
+ std::vector<RowPos> m_aSelectedRows;
+ //part of selection engine
+ TableFunctionSet* m_pTableFunctionSet;
+ //part of selection engine
+ RowPos m_nAnchor;
+ bool m_bUpdatingColWidths;
+
+ Link m_aSelectHdl;
+
+ AccessibleFactoryAccess m_aFactoryAccess;
+ IAccessibleTableControl* m_pAccessibleTable;
#if DBG_UTIL
#define INV_SCROLL_POSITION 1
@@ -130,21 +170,18 @@ namespace svt { namespace table
#endif
public:
-
-
- PTableModel getModel() const;
void setModel( PTableModel _pModel );
inline const PTableInputHandler& getInputHandler() const { return m_pInputHandler; }
- inline ColPos getCurColumn() const { return m_nCurColumn; }
- inline RowPos getCurRow() const { return m_nCurRow; }
- inline void setCurRow(RowPos curRow){ m_nCurRow = curRow; }
- inline RowPos getTopRow() const { return m_nTopRow; }
- inline long getRowCount() const { return m_nRowCount; }
- inline long getColumnCount() const { return m_nColumnCount; }
+ inline RowPos getCurRow() const { return m_nCurRow; }
+ inline void setCurRow( RowPos i_curRow ){ m_nCurRow = i_curRow; }
+
+ RowPos getAnchor() const { return m_nAnchor; }
+ void setAnchor( RowPos const i_anchor ) { m_nAnchor = i_anchor; }
- inline long getColHeaderHightPixel() const { return m_nColHeaderHeightPixel; }
+ inline RowPos getTopRow() const { return m_nTopRow; }
+ inline ColPos getLeftColumn() const { return m_nLeftColumn; }
inline const TableControl& getAntiImpl() const { return m_rAntiImpl; }
inline TableControl& getAntiImpl() { return m_rAntiImpl; }
@@ -182,45 +219,115 @@ namespace svt { namespace table
<TRUE/> if it's okay that the given cooordinate is only partially visible
*/
void ensureVisible( ColPos _nColumn, RowPos _nRow, bool _bAcceptPartialVisibility );
- /** returns the row, which contains the input point*/
- virtual RowPos getCurrentRow (const Point& rPoint);
-
- void setCursorAtCurrentCell(const Point& rPoint);
- /** checks whether the vector with the selected rows contains the current row*/
- BOOL isRowSelected(const ::std::vector<RowPos>& selectedRows, RowPos current);
-
- bool isRowSelected(RowPos current);
- /** returns the position of the current row in the selection vector */
- int getRowSelectedNumber(const ::std::vector<RowPos>& selectedRows, RowPos current);
- /** _rCellRect contains the region, which should be invalidate after some action e.g. selecting row*/
- void invalidateSelectedRegion(RowPos _nPrevRow, RowPos _nCurRow, Rectangle& _rCellRect );
- /** to be called when a new row is added to the control*/
- void invalidateRow(RowPos _nRowPos, Rectangle& _rCellRect );
- /** returns the vector, which contains the selected rows*/
- std::vector<RowPos>& getSelectedRows();
- /** updates the vector, which contains the selected rows after removing the row nRowPos*/
- void removeSelectedRow(RowPos _nRowPos);
- void invalidateRows();
- void clearSelection();
- // IAbstractTableControl
- virtual void hideCursor();
- virtual void showCursor();
- virtual bool dispatchAction( TableControlAction _eAction );
- virtual SelectionEngine* getSelEngine();
- virtual bool isTooltipActive();
- virtual rtl::OUString& setTooltip(const Point& rPoint );
- virtual void resizeColumn(const Point& rPoint);
- virtual bool startResizeColumn(const Point& rPoint);
- virtual bool endResizeColumn(const Point& rPoint);
-
- TableDataWindow* getDataWindow();
- ScrollBar* getHorzScrollbar();
- ScrollBar* getVertScrollbar();
-
- ::rtl::OUString convertToString(const ::com::sun::star::uno::Any& _value);
- Rectangle calcHeaderRect(bool bColHeader);
- Rectangle calcTableRect();
+
+ /** retrieves the content of the given cell, converted to a string
+ */
+ ::rtl::OUString getCellContentAsString( RowPos const i_row, ColPos const i_col );
+
+ /** returns the position of the current row in the selection vector */
+ int getRowSelectedNumber(const ::std::vector<RowPos>& selectedRows, RowPos current);
+
+ /** _rCellRect contains the region, which should be invalidate after some action e.g. selecting row*/
+ void invalidateSelectedRegion(RowPos _nPrevRow, RowPos _nCurRow, Rectangle& _rCellRect );
+
+ /** invalidates the part of the data window which is covered by the given row
+ @param i_firstRow
+ the index of the first row to include in the invalidation
+ @param i_lastRow
+ the index of the last row to include in the invalidation, or ROW_INVALID if the invalidation
+ should happen down to the bottom of the data window.
+ */
+ void invalidateRowRange( RowPos const i_firstRow, RowPos const i_lastRow );
+
+ void checkCursorPosition();
+
+ bool hasRowSelection() const { return !m_aSelectedRows.empty(); }
+ size_t getSelectedRowCount() const { return m_aSelectedRows.size(); }
+ RowPos getSelectedRowIndex( size_t const i_selectionIndex ) const;
+
+ /** removes the given row index from m_aSelectedRows
+
+ @return
+ <TRUE/> if and only if the row was previously marked as selected
+ */
+ bool markRowAsDeselected( RowPos const i_rowIndex );
+
+ /** marks the given row as selectged, by putting it into m_aSelectedRows
+ @return
+ <TRUE/> if and only if the row was previously <em>not</em> marked as selected
+ */
+ bool markRowAsSelected( RowPos const i_rowIndex );
+
+ /** marks all rows as deselected
+ @return
+ <TRUE/> if and only if the selection actually changed by this operation
+ */
+ bool markAllRowsAsDeselected();
+
+ /** marks all rows as selected
+ @return
+ <FALSE/> if and only if all rows were selected already.
+ */
+ bool markAllRowsAsSelected();
+
+ void setSelectHandler( Link const & i_selectHandler ) { m_aSelectHdl = i_selectHandler; }
+ Link const& getSelectHandler() const { return m_aSelectHdl; }
+
+ // ITableControl
+ virtual void hideCursor();
+ virtual void showCursor();
+ virtual bool dispatchAction( TableControlAction _eAction );
+ virtual SelectionEngine* getSelEngine();
+ virtual PTableModel getModel() const;
+ virtual ColPos getCurrentColumn() const;
+ virtual RowPos getCurrentRow() const;
+ virtual bool activateCell( ColPos const i_col, RowPos const i_row );
+ virtual ::Size getTableSizePixel() const;
+ virtual void setPointer( Pointer const & i_pointer );
+ virtual void captureMouse();
+ virtual void releaseMouse();
+ virtual void invalidate( TableArea const i_what );
+ virtual long pixelWidthToAppFont( long const i_pixels ) const;
+ virtual void hideTracking();
+ virtual void showTracking( Rectangle const & i_location, sal_uInt16 const i_flags );
+ virtual RowPos getRowAtPoint( const Point& rPoint ) const;
+ virtual ColPos getColAtPoint( const Point& rPoint ) const;
+ virtual TableCell hitTest( const Point& rPoint ) const;
+ virtual ColumnMetrics getColumnMetrics( ColPos const i_column ) const;
+ virtual bool isRowSelected( RowPos i_row ) const;
+
+
+ TableDataWindow& getDataWindow() { return *m_pDataWindow; }
+ const TableDataWindow& getDataWindow() const { return *m_pDataWindow; }
+ ScrollBar* getHorzScrollbar();
+ ScrollBar* getVertScrollbar();
+
+ Rectangle calcHeaderRect(bool bColHeader);
+ Rectangle calcTableRect();
+
+ // A11Y
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ getAccessible( Window& i_parentWindow );
+ void disposeAccessible();
+
+ // ITableModelListener
+ virtual void rowsInserted( RowPos first, RowPos last );
+ virtual void rowsRemoved( RowPos first, RowPos last );
+ virtual void columnInserted( ColPos const i_colIndex );
+ virtual void columnRemoved( ColPos const i_colIndex );
+ virtual void allColumnsRemoved();
+ virtual void cellsUpdated( ColPos const i_firstCol, ColPos i_lastCol, RowPos const i_firstRow, RowPos const i_lastRow );
+ virtual void columnChanged( ColPos const i_column, ColumnAttributeGroup const i_attributeGroup );
+ virtual void tableMetricsChanged();
+
private:
+ bool impl_isAccessibleAlive() const;
+ void impl_commitAccessibleEvent(
+ sal_Int16 const i_eventID,
+ ::com::sun::star::uno::Any const & i_newValue,
+ ::com::sun::star::uno::Any const & i_oldValue
+ );
+
/** toggles the cursor visibility
The method is not bound to the classes public invariants, as it's used in
@@ -248,7 +355,7 @@ namespace svt { namespace table
specifies whether a possible only partially visible last row is
counted, too.
*/
- TableSize impl_getVisibleColumns( bool _bAcceptPartialRow ) const;
+ TableSize impl_getVisibleColumns( bool _bAcceptPartialCol ) const;
/** determines the rectangle occupied by the given cell
*/
@@ -261,15 +368,20 @@ namespace svt { namespace table
*/
void impl_ni_updateCachedModelValues();
- /** updates ->m_aColumnWidthsPixel with the current pixel widths of all model columns
+ /** updates the cached table metrics (row height etc.)
+ */
+ void impl_ni_updateCachedTableMetrics();
- The method takes into account the current zoom factor and map mode of the table
- control, plus any possible COLWIDTH_FIT_TO_VIEW widths in the model columns.
+ /** updates ->m_aColumnWidthsPixel with the current pixel widths of all model columns
The method is not bound to the classes public invariants, as it's used in
situations where the they must not necessarily be fullfilled.
+
+ @param i_assumeInflexibleColumnsUpToIncluding
+ the index of a column up to which all columns should be considered as inflexible, or
+ <code>COL_INVALID</code>.
*/
- void impl_ni_updateColumnWidths();
+ void impl_ni_updateColumnWidths( ColPos const i_assumeInflexibleColumnsUpToIncluding = COL_INVALID );
/** updates the scrollbars of the control
@@ -293,6 +405,10 @@ namespace svt { namespace table
*/
TableSize impl_ni_ScrollRows( TableSize _nRowDelta );
+ /** equivalent to impl_ni_ScrollRows, but checks the instances invariants beforehand (in a non-product build only)
+ */
+ TableSize impl_scrollRows( TableSize const i_rowDelta );
+
/** scrolls the view by the given number of columns
The method is not bound to the classes public invariants, as it's used in
@@ -303,8 +419,13 @@ namespace svt { namespace table
from the given numbers to scroll in case the begin or the end of the
column range were reached.
*/
- TableSize impl_ni_ScrollColumns( TableSize _nRowDelta );
- /** retrieves the area occupied by the totality of (at least partially) visible cells
+ TableSize impl_ni_ScrollColumns( TableSize _nColumnDelta );
+
+ /** equivalent to impl_ni_ScrollColumns, but checks the instances invariants beforehand (in a non-product build only)
+ */
+ TableSize impl_scrollColumns( TableSize const i_columnDelta );
+
+ /** retrieves the area occupied by the totality of (at least partially) visible cells
The returned area includes row and column headers. Also, it takes into
account the the fact that there might be less columns than would normally
@@ -313,27 +434,37 @@ namespace svt { namespace table
As a result of respecting the partial visibility of rows and columns,
the returned area might be larger than the data window's output size.
*/
- void impl_getAllVisibleCellsArea( Rectangle& _rCellArea ) const;
+ Rectangle impl_getAllVisibleCellsArea() const;
/** retrieves the area occupied by all (at least partially) visible data cells.
Effectively, the returned area is the same as returned by ->impl_getAllVisibleCellsArea,
minus the row and column header areas.
*/
- void impl_getAllVisibleDataCellArea( Rectangle& _rCellArea ) const;
+ Rectangle impl_getAllVisibleDataCellArea() const;
+
+ /** retrieves the column which covers the given ordinate
+ */
+ ColPos impl_getColumnForOrdinate( long const i_ordinate ) const;
- void impl_ni_getAccVisibleColWidths();
- void impl_updateLeftColumn();
+ /** retrieves the row which covers the given abscissa
+ */
+ RowPos impl_getRowForAbscissa( long const i_abscissa ) const;
+
+ /// invalidates the window area occupied by the given column
+ void impl_invalidateColumn( ColPos const i_column );
DECL_LINK( OnScroll, ScrollBar* );
+ DECL_LINK( OnUpdateScrollbars, void* );
};
+
//see seleng.hxx, seleng.cxx, FunctionSet overridables, part of selection engine
class TableFunctionSet : public FunctionSet
{
- friend class TableDataWindow;
private:
- TableControl_Impl* m_pTableControl;
- RowPos m_nCurrentRow;
+ TableControl_Impl* m_pTableControl;
+ RowPos m_nCurrentRow;
+
public:
TableFunctionSet(TableControl_Impl* _pTableControl);
virtual ~TableFunctionSet();
@@ -341,8 +472,8 @@ namespace svt { namespace table
virtual void BeginDrag();
virtual void CreateAnchor();
virtual void DestroyAnchor();
- virtual BOOL SetCursorAtPoint(const Point& rPoint, BOOL bDontSelectAtCursor);
- virtual BOOL IsSelectionAtPoint( const Point& rPoint );
+ virtual sal_Bool SetCursorAtPoint(const Point& rPoint, sal_Bool bDontSelectAtCursor);
+ virtual sal_Bool IsSelectionAtPoint( const Point& rPoint );
virtual void DeselectAtPoint( const Point& rPoint );
virtual void DeselectAll();
};
diff --git a/svtools/source/table/tabledatawindow.cxx b/svtools/source/table/tabledatawindow.cxx
index 9607ec93036c..7c546421555d 100644
--- a/svtools/source/table/tabledatawindow.cxx
+++ b/svtools/source/table/tabledatawindow.cxx
@@ -29,23 +29,31 @@
#include "precompiled_svtools.hxx"
#include "svtools/table/tablecontrol.hxx"
-#include "svtools/table/tabledatawindow.hxx"
+
+#include "tabledatawindow.hxx"
#include "tablecontrol_impl.hxx"
+#include "tablegeometry.hxx"
+#include "cellvalueconversion.hxx"
+
#include <vcl/help.hxx>
-//........................................................................
+//......................................................................................................................
namespace svt { namespace table
{
- class TableControl_Impl;
-//........................................................................
+//......................................................................................................................
- //====================================================================
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Any;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
//= TableDataWindow
- //====================================================================
- //--------------------------------------------------------------------
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
TableDataWindow::TableDataWindow( TableControl_Impl& _rTableControl )
:Window( &_rTableControl.getAntiImpl() )
- ,m_rTableControl ( _rTableControl )
+ ,m_rTableControl( _rTableControl )
+ ,m_nTipWindowHandle( 0 )
{
// by default, use the background as determined by the style settings
const Color aWindowColor( GetSettings().GetStyleSettings().GetFieldColor() );
@@ -53,105 +61,164 @@ namespace svt { namespace table
SetFillColor( aWindowColor );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ TableDataWindow::~TableDataWindow()
+ {
+ impl_hideTipWindow();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
void TableDataWindow::Paint( const Rectangle& rUpdateRect )
{
m_rTableControl.doPaintContent( rUpdateRect );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableDataWindow::SetBackground( const Wallpaper& rColor )
{
Window::SetBackground( rColor );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableDataWindow::SetControlBackground( const Color& rColor )
{
Window::SetControlBackground( rColor );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableDataWindow::SetBackground()
{
Window::SetBackground();
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableDataWindow::SetControlBackground()
{
Window::SetControlBackground();
}
- //--------------------------------------------------------------------
- void TableDataWindow::MouseMove( const MouseEvent& rMEvt )
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableDataWindow::RequestHelp( const HelpEvent& rHEvt )
{
- Point aPoint = rMEvt.GetPosPixel();
- if ( !m_rTableControl.getInputHandler()->MouseMove( m_rTableControl, rMEvt ) )
+ sal_uInt16 const nHelpMode = rHEvt.GetMode();
+ if ( ( IsMouseCaptured() )
+ || ( ( nHelpMode & HELPMODE_QUICK ) == 0 )
+ )
+ {
+ Window::RequestHelp( rHEvt );
+ return;
+ }
+
+ ::rtl::OUString sHelpText;
+ sal_uInt16 nHelpStyle = 0;
+
+ Point const aMousePos( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
+ RowPos const hitRow = m_rTableControl.getRowAtPoint( aMousePos );
+ ColPos const hitCol = m_rTableControl.getColAtPoint( aMousePos );
+
+ PTableModel const pTableModel( m_rTableControl.getModel() );
+ if ( ( hitCol >= 0 ) && ( hitCol < pTableModel->getColumnCount() ) )
{
- if(m_rTableControl.getCurrentRow(aPoint)>=0 && m_rTableControl.isTooltipActive() )
+ if ( hitRow == ROW_COL_HEADERS )
{
- SetPointer(POINTER_ARROW);
- rtl::OUString& rHelpText = m_rTableControl.setTooltip(aPoint);
- Help::EnableBalloonHelp();
- Window::SetHelpText( rHelpText.getStr());
+ sHelpText = pTableModel->getColumnModel( hitCol )->getHelpText();
}
- else if(m_rTableControl.getCurrentRow(aPoint) == -1)
+ else if ( ( hitRow >= 0 ) && ( hitRow < pTableModel->getRowCount() ) )
{
- if(Help::IsBalloonHelpEnabled())
- Help::DisableBalloonHelp();
- m_rTableControl.resizeColumn(aPoint);
+ Any aCellToolTip;
+ pTableModel->getCellToolTip( hitCol, hitRow, aCellToolTip );
+ if ( !aCellToolTip.hasValue() )
+ {
+ // use the cell content
+ pTableModel->getCellContent( hitCol, hitRow, aCellToolTip );
+
+ // use the cell content as tool tip only if it doesn't fit into the cell.
+ bool const activeCell = ( hitRow == m_rTableControl.getCurrentRow() ) && ( hitCol == m_rTableControl.getCurrentColumn() );
+ bool const selectedCell = m_rTableControl.isRowSelected( hitRow );
+
+ Rectangle const aWindowRect( Point( 0, 0 ), GetOutputSizePixel() );
+ TableCellGeometry const aCell( m_rTableControl, aWindowRect, hitCol, hitRow );
+ Rectangle const aCellRect( aCell.getRect() );
+
+ PTableRenderer const pRenderer = pTableModel->getRenderer();
+ if ( pRenderer->FitsIntoCell( aCellToolTip, hitCol, hitRow, activeCell, selectedCell, *this, aCellRect ) )
+ aCellToolTip.clear();
+ }
+
+ sHelpText = CellValueConversion::convertToString( aCellToolTip );
+
+ if ( sHelpText.indexOf( '\n' ) >= 0 )
+ nHelpStyle = QUICKHELP_TIP_STYLE_BALLOON;
}
+ }
+
+ if ( sHelpText.getLength() )
+ {
+ Rectangle const aControlScreenRect(
+ OutputToScreenPixel( Point( 0, 0 ) ),
+ GetOutputSizePixel()
+ );
+
+ if ( m_nTipWindowHandle )
+ Help::UpdateTip( m_nTipWindowHandle, this, aControlScreenRect, sHelpText );
else
- {
- if(Help::IsBalloonHelpEnabled())
- Help::DisableBalloonHelp();
- Window::MouseMove( rMEvt );
- }
+ m_nTipWindowHandle = Help::ShowTip( this, aControlScreenRect, sHelpText, nHelpStyle );
}
+ else
+ impl_hideTipWindow();
}
- //--------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableDataWindow::impl_hideTipWindow()
+ {
+ if ( m_nTipWindowHandle != 0 )
+ {
+ Help::HideTip( m_nTipWindowHandle );
+ m_nTipWindowHandle = 0;
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableDataWindow::MouseMove( const MouseEvent& rMEvt )
+ {
+ if ( rMEvt.IsLeaveWindow() )
+ impl_hideTipWindow();
+
+ if ( !m_rTableControl.getInputHandler()->MouseMove( m_rTableControl, rMEvt ) )
+ {
+ Window::MouseMove( rMEvt );
+ }
+ }
+ //------------------------------------------------------------------------------------------------------------------
void TableDataWindow::MouseButtonDown( const MouseEvent& rMEvt )
{
- Point aPoint = rMEvt.GetPosPixel();
- RowPos nCurRow = m_rTableControl.getCurrentRow(aPoint);
- std::vector<RowPos> selectedRows(m_rTableControl.getSelectedRows());
+ impl_hideTipWindow();
+
+ Point const aPoint = rMEvt.GetPosPixel();
+ RowPos const hitRow = m_rTableControl.getRowAtPoint( aPoint );
+ bool const wasRowSelected = m_rTableControl.isRowSelected( hitRow );
+
if ( !m_rTableControl.getInputHandler()->MouseButtonDown( m_rTableControl, rMEvt ) )
- Window::MouseButtonDown( rMEvt );
- else
{
- if(nCurRow >= 0 && m_rTableControl.getSelEngine()->GetSelectionMode() != NO_SELECTION)
- {
- bool found = std::find(selectedRows.begin(),selectedRows.end(), nCurRow) != selectedRows.end();
+ Window::MouseButtonDown( rMEvt );
+ return;
+ }
- if( !found )
- {
- m_aSelectHdl.Call( NULL );
- }
- }
+ bool const isRowSelected = m_rTableControl.isRowSelected( hitRow );
+ if ( isRowSelected != wasRowSelected )
+ {
+ m_aSelectHdl.Call( NULL );
}
m_aMouseButtonDownHdl.Call((MouseEvent*) &rMEvt);
- m_rTableControl.getAntiImpl().LoseFocus();
}
- //--------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
void TableDataWindow::MouseButtonUp( const MouseEvent& rMEvt )
{
if ( !m_rTableControl.getInputHandler()->MouseButtonUp( m_rTableControl, rMEvt ) )
Window::MouseButtonUp( rMEvt );
+
m_aMouseButtonUpHdl.Call((MouseEvent*) &rMEvt);
- m_rTableControl.getAntiImpl().GetFocus();
+ m_rTableControl.getAntiImpl().GrabFocus();
}
- //--------------------------------------------------------------------
- void TableDataWindow::SetPointer( const Pointer& rPointer )
- {
- Window::SetPointer(rPointer);
- }
- //--------------------------------------------------------------------
- void TableDataWindow::CaptureMouse()
- {
- Window::CaptureMouse();
- }
- //--------------------------------------------------------------------
- void TableDataWindow::ReleaseMouse( )
- {
- Window::ReleaseMouse();
- }
- // -----------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
long TableDataWindow::Notify(NotifyEvent& rNEvt )
{
long nDone = 0;
@@ -169,8 +236,8 @@ namespace svt { namespace table
}
return nDone ? nDone : Window::Notify( rNEvt );
}
-//........................................................................
+//......................................................................................................................
} } // namespace svt::table
-//........................................................................
+//......................................................................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/table/tabledatawindow.hxx b/svtools/source/table/tabledatawindow.hxx
new file mode 100644
index 000000000000..c26cd6ccd596
--- /dev/null
+++ b/svtools/source/table/tabledatawindow.hxx
@@ -0,0 +1,92 @@
+/* -*- 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 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+************************************************************************/
+
+#ifndef SVTOOLS_SOURCE_TABLE_TABLEDATAWINDOW_HXX
+#define SVTOOLS_SOURCE_TABLE_TABLEDATAWINDOW_HXX
+
+#include <vcl/window.hxx>
+#include <vcl/seleng.hxx>
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+
+ class TableControl_Impl;
+ class TableFunctionSet;
+
+
+ //====================================================================
+ //= TableDataWindow
+ //====================================================================
+ /** the window containing the content area (including headers) of
+ a table control
+ */
+ class TableDataWindow : public Window
+ {
+ friend class TableFunctionSet;
+ private:
+ TableControl_Impl& m_rTableControl;
+ Link m_aMouseButtonDownHdl;
+ Link m_aMouseButtonUpHdl;
+ Link m_aSelectHdl;
+ sal_uLong m_nTipWindowHandle;
+
+ public:
+ TableDataWindow( TableControl_Impl& _rTableControl );
+ ~TableDataWindow();
+
+ inline void SetMouseButtonDownHdl( const Link& rLink ) { m_aMouseButtonDownHdl = rLink; }
+ inline const Link& GetMouseButtonDownHdl() const { return m_aMouseButtonDownHdl; }
+ inline void SetMouseButtonUpHdl( const Link& rLink ) { m_aMouseButtonUpHdl = rLink; }
+ inline const Link& GetMouseButtonUpHdl() const { return m_aMouseButtonUpHdl; }
+ inline void SetSelectHdl( const Link& rLink ) { m_aSelectHdl = rLink; }
+ inline const Link& GetSelectHdl() const { return m_aSelectHdl; }
+
+ // Window overridables
+ virtual void Paint( const Rectangle& rRect );
+ virtual void MouseMove( const MouseEvent& rMEvt);
+ virtual void MouseButtonDown( const MouseEvent& rMEvt);
+ virtual void MouseButtonUp( const MouseEvent& rMEvt);
+ virtual long Notify(NotifyEvent& rNEvt);
+ virtual void SetControlBackground(const Color& rColor);
+ virtual void SetControlBackground();
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+
+ void SetBackground(const Wallpaper& rColor);
+ void SetBackground();
+
+ private:
+ void impl_hideTipWindow();
+ };
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_SOURCE_TABLE_TABLEDATAWINDOW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/table/tablegeometry.cxx b/svtools/source/table/tablegeometry.cxx
index edd2a73cd624..e00e21c28911 100644
--- a/svtools/source/table/tablegeometry.cxx
+++ b/svtools/source/table/tablegeometry.cxx
@@ -28,107 +28,141 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-
#include "tablegeometry.hxx"
#include "tablecontrol_impl.hxx"
#include <tools/debug.hxx>
-//........................................................................
+//......................................................................................................................
namespace svt { namespace table
{
-//........................................................................
+//......................................................................................................................
- //====================================================================
+ //==================================================================================================================
//= TableRowGeometry
- //====================================================================
- //--------------------------------------------------------------------
- TableRowGeometry::TableRowGeometry( const TableControl_Impl& _rControl, const Rectangle& _rBoundaries,
- RowPos _nRow )
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ TableRowGeometry::TableRowGeometry( TableControl_Impl const & _rControl, Rectangle const & _rBoundaries,
+ RowPos const _nRow, bool const i_allowVirtualRows )
:TableGeometry( _rControl, _rBoundaries )
,m_nRowPos( _nRow )
+ ,m_bAllowVirtualRows( i_allowVirtualRows )
{
if ( m_nRowPos == ROW_COL_HEADERS )
{
- //DBG_ASSERT( m_rControl.m_pModel->hasColumnHeaders(),
- // "TableRowGeometry::TableRowGeometry: why asking for the geoemtry of the non-existent column header row?" );
m_aRect.Top() = 0;
m_aRect.Bottom() = m_rControl.m_nColHeaderHeightPixel - 1;
}
else
{
- if ( ( m_nRowPos >= m_rControl.m_nTopRow ) && ( m_nRowPos < m_rControl.m_pModel->getRowCount() ) )
- {
- m_aRect.Top() = m_rControl.m_nColHeaderHeightPixel + ( m_nRowPos - m_rControl.m_nTopRow ) * m_rControl.m_nRowHeightPixel;
- m_aRect.Bottom() = m_aRect.Top() + m_rControl.m_nRowHeightPixel - 1;
- }
- else
- m_aRect.SetEmpty();
+ impl_initRect();
}
}
- //--------------------------------------------------------------------
- bool TableRowGeometry::moveDown()
+ //------------------------------------------------------------------------------------------------------------------
+ void TableRowGeometry::impl_initRect()
{
- if ( ++m_nRowPos < m_rControl.m_pModel->getRowCount() )
- m_aRect.Move( 0, m_rControl.m_nRowHeightPixel );
+ if ( ( m_nRowPos >= m_rControl.m_nTopRow ) && impl_isValidRow( m_nRowPos ) )
+ {
+ m_aRect.Top() = m_rControl.m_nColHeaderHeightPixel + ( m_nRowPos - m_rControl.m_nTopRow ) * m_rControl.m_nRowHeightPixel;
+ m_aRect.Bottom() = m_aRect.Top() + m_rControl.m_nRowHeightPixel - 1;
+ }
else
m_aRect.SetEmpty();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableRowGeometry::impl_isValidRow( RowPos const i_row ) const
+ {
+ return m_bAllowVirtualRows || ( i_row < m_rControl.m_pModel->getRowCount() );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableRowGeometry::moveDown()
+ {
+ if ( m_nRowPos == ROW_COL_HEADERS )
+ {
+ m_nRowPos = m_rControl.m_nTopRow;
+ impl_initRect();
+ }
+ else
+ {
+ if ( impl_isValidRow( ++m_nRowPos ) )
+ m_aRect.Move( 0, m_rControl.m_nRowHeightPixel );
+ else
+ m_aRect.SetEmpty();
+ }
return isValid();
}
- //====================================================================
+ //==================================================================================================================
//= TableColumnGeometry
- //====================================================================
- //--------------------------------------------------------------------
- TableColumnGeometry::TableColumnGeometry( const TableControl_Impl& _rControl, const Rectangle& _rBoundaries,
- ColPos _nCol )
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ TableColumnGeometry::TableColumnGeometry( TableControl_Impl const & _rControl, Rectangle const & _rBoundaries,
+ ColPos const _nCol, bool const i_allowVirtualColumns )
:TableGeometry( _rControl, _rBoundaries )
,m_nColPos( _nCol )
+ ,m_bAllowVirtualColumns( i_allowVirtualColumns )
{
if ( m_nColPos == COL_ROW_HEADERS )
{
-/* DBG_ASSERT( m_rControl.m_pModel->hasRowHeaders(),
- "TableColumnGeometry::TableColumnGeometry: why asking for the geoemtry of the non-existent row header column?" )*/;
m_aRect.Left() = 0;
m_aRect.Right() = m_rControl.m_nRowHeaderWidthPixel - 1;
}
else
{
- ColPos nLeftColumn = m_rControl.m_nLeftColumn;
- if ( ( m_nColPos >= nLeftColumn ) && ( m_nColPos < (ColPos)m_rControl.m_aColumnWidthsPixel.size() ) )
- {
- m_aRect.Left() = m_rControl.m_nRowHeaderWidthPixel;
- // TODO: take into account any possibly frozen columns
+ impl_initRect();
+ }
+ }
- for ( ColPos col = nLeftColumn; col < m_nColPos; ++col )
- m_aRect.Left() += m_rControl.m_aColumnWidthsPixel[ col ];
- m_aRect.Right() = m_aRect.Left() + m_rControl.m_aColumnWidthsPixel[ m_nColPos ] - 1;
- }
- else
- m_aRect.SetEmpty();
+ //------------------------------------------------------------------------------------------------------------------
+ void TableColumnGeometry::impl_initRect()
+ {
+ ColPos nLeftColumn = m_rControl.m_nLeftColumn;
+ if ( ( m_nColPos >= nLeftColumn ) && impl_isValidColumn( m_nColPos ) )
+ {
+ m_aRect.Left() = m_rControl.m_nRowHeaderWidthPixel;
+ // TODO: take into account any possibly frozen columns
+
+ for ( ColPos col = nLeftColumn; col < m_nColPos; ++col )
+ m_aRect.Left() += m_rControl.m_aColumnWidths[ col ].getWidth();
+ m_aRect.Right() = m_aRect.Left() + m_rControl.m_aColumnWidths[ m_nColPos ].getWidth() - 1;
}
+ else
+ m_aRect.SetEmpty();
}
- //--------------------------------------------------------------------
- bool TableColumnGeometry::moveRight()
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableColumnGeometry::impl_isValidColumn( ColPos const i_column ) const
{
- DBG_ASSERT( m_nColPos != COL_ROW_HEADERS, "TableColumnGeometry::moveRight: cannot move the row header column!" );
- // what would be COL_ROW_HEADERS + 1?
+ return m_bAllowVirtualColumns || ( i_column < ColPos( m_rControl.m_aColumnWidths.size() ) );
+ }
- if ( ++m_nColPos < (ColPos)m_rControl.m_aColumnWidthsPixel.size() )
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableColumnGeometry::moveRight()
+ {
+ if ( m_nColPos == COL_ROW_HEADERS )
{
- m_aRect.Left() = m_aRect.Right() + 1;
- m_aRect.Right() += m_rControl.m_aColumnWidthsPixel[ m_nColPos ];
+ m_nColPos = m_rControl.m_nLeftColumn;
+ impl_initRect();
}
else
- m_aRect.SetEmpty();
+ {
+ if ( impl_isValidColumn( ++m_nColPos ) )
+ {
+ m_aRect.Left() = m_aRect.Right() + 1;
+ m_aRect.Right() += m_rControl.m_aColumnWidths[ m_nColPos ].getWidth();
+ }
+ else
+ m_aRect.SetEmpty();
+ }
return isValid();
}
-//........................................................................
+//......................................................................................................................
} } // namespace svt::table
-//........................................................................
+//......................................................................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/table/tablegeometry.hxx b/svtools/source/table/tablegeometry.hxx
index 979a78d0a5a2..9520e4992411 100644
--- a/svtools/source/table/tablegeometry.hxx
+++ b/svtools/source/table/tablegeometry.hxx
@@ -28,7 +28,7 @@
#ifndef SVTOOLS_TABLEGEOMETRY_HXX
#define SVTOOLS_TABLEGEOMETRY_HXX
-#include <svtools/table/tabletypes.hxx>
+#include "svtools/table/tabletypes.hxx"
#include <tools/gen.hxx>
@@ -76,18 +76,25 @@ namespace svt { namespace table
{
protected:
RowPos m_nRowPos;
+ bool m_bAllowVirtualRows;
public:
TableRowGeometry(
- const TableControl_Impl& _rControl,
- const Rectangle& _rBoundaries,
- RowPos _nRow
+ TableControl_Impl const & _rControl,
+ Rectangle const & _rBoundaries,
+ RowPos const _nRow,
+ bool const i_allowVirtualRows = false
+ // allow rows >= getRowCount()?
);
// status
RowPos getRow() const { return m_nRowPos; }
// operations
bool moveDown();
+
+ private:
+ void impl_initRect();
+ bool impl_isValidRow( RowPos const i_row ) const;
};
//====================================================================
@@ -97,18 +104,24 @@ namespace svt { namespace table
{
protected:
ColPos m_nColPos;
+ bool m_bAllowVirtualColumns;
public:
TableColumnGeometry(
- const TableControl_Impl& _rControl,
- const Rectangle& _rBoundaries,
- ColPos _nCol
+ TableControl_Impl const & _rControl,
+ Rectangle const & _rBoundaries,
+ ColPos const _nCol,
+ bool const i_allowVirtualColumns = false
);
// status
ColPos getCol() const { return m_nColPos; }
// operations
bool moveRight();
+
+ private:
+ void impl_initRect();
+ bool impl_isValidColumn( ColPos const i_column ) const;
};
//====================================================================
@@ -124,13 +137,14 @@ namespace svt { namespace table
public:
TableCellGeometry(
- const TableControl_Impl& _rControl,
- const Rectangle& _rBoundaries,
- ColPos _nCol,
- RowPos _nRow
+ TableControl_Impl const & _rControl,
+ Rectangle const & _rBoundaries,
+ ColPos const _nCol,
+ RowPos const _nRow,
+ bool const i_alllowVirtualCells = false
)
- :m_aRow( _rControl, _rBoundaries, _nRow )
- ,m_aCol( _rControl, _rBoundaries, _nCol )
+ :m_aRow( _rControl, _rBoundaries, _nRow, i_alllowVirtualCells )
+ ,m_aCol( _rControl, _rBoundaries, _nCol, i_alllowVirtualCells )
{
}
diff --git a/svtools/source/toolpanel/drawerlayouter.cxx b/svtools/source/toolpanel/drawerlayouter.cxx
index 4a5ebfc95260..f6c36d673691 100644
--- a/svtools/source/toolpanel/drawerlayouter.cxx
+++ b/svtools/source/toolpanel/drawerlayouter.cxx
@@ -148,10 +148,10 @@ namespace svt
const PToolPanelDrawer pDrawer( m_aDrawers[ i_nChildIndex ] );
- Reference< XAccessible > xItemAccessible = pDrawer->GetAccessible( FALSE );
+ Reference< XAccessible > xItemAccessible = pDrawer->GetAccessible( sal_False );
if ( !xItemAccessible.is() )
{
- xItemAccessible = pDrawer->GetAccessible( TRUE );
+ xItemAccessible = pDrawer->GetAccessible( sal_True );
ENSURE_OR_RETURN( xItemAccessible.is(), "illegal accessible provided by the drawer implementation!", NULL );
OSL_VERIFY( ::comphelper::OAccessibleImplementationAccess::setAccessibleParent( xItemAccessible->getAccessibleContext(),
i_rParentAccessible ) );
@@ -166,7 +166,7 @@ namespace svt
OSL_PRECOND( i_nPosition <= m_aDrawers.size(), "DrawerDeckLayouter::PanelInserted: inconsistency!" );
PToolPanelDrawer pDrawer( new ToolPanelDrawer( m_rParentWindow, i_pPanel->GetDisplayName() ) );
- pDrawer->SetSmartHelpId( i_pPanel->GetHelpID() );
+ pDrawer->SetHelpId( i_pPanel->GetHelpID() );
// proper Z-Order
if ( i_nPosition == 0 )
{
diff --git a/svtools/source/toolpanel/dummypanel.cxx b/svtools/source/toolpanel/dummypanel.cxx
index a5f1a6907750..a9bb28a097e8 100644
--- a/svtools/source/toolpanel/dummypanel.cxx
+++ b/svtools/source/toolpanel/dummypanel.cxx
@@ -81,9 +81,9 @@ namespace svt
}
//--------------------------------------------------------------------
- SmartId DummyPanel::GetHelpID() const
+ rtl::OString DummyPanel::GetHelpID() const
{
- return SmartId();
+ return rtl::OString();
}
//--------------------------------------------------------------------
diff --git a/svtools/source/toolpanel/dummypanel.hxx b/svtools/source/toolpanel/dummypanel.hxx
index 7d71dfb68d8b..8a34f429d726 100644
--- a/svtools/source/toolpanel/dummypanel.hxx
+++ b/svtools/source/toolpanel/dummypanel.hxx
@@ -50,7 +50,7 @@ namespace svt
// IToolPanel
virtual ::rtl::OUString GetDisplayName() const;
virtual Image GetImage() const;
- virtual SmartId GetHelpID() const;
+ virtual rtl::OString GetHelpID() const;
virtual void Activate( Window& i_rParentWindow );
virtual void Deactivate();
virtual void SetSizePixel( const Size& i_rPanelWindowSize );
diff --git a/svtools/source/toolpanel/makefile.mk b/svtools/source/toolpanel/makefile.mk
deleted file mode 100755
index 698c9ee68ff3..000000000000
--- a/svtools/source/toolpanel/makefile.mk
+++ /dev/null
@@ -1,64 +0,0 @@
-#*************************************************************************
-#
-# 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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=toolpanel
-
-# --- Settings -----------------------------------------------------
-
-ENABLE_EXCEPTIONS=TRUE
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SRS1NAME=$(TARGET)
-SRC1FILES=\
- toolpanel.src
-
-SLOFILES=\
- $(SLO)$/drawerlayouter.obj \
- $(SLO)$/dummypanel.obj \
- $(SLO)$/paneldecklisteners.obj \
- $(SLO)$/paneltabbar.obj \
- $(SLO)$/paneltabbarpeer.obj \
- $(SLO)$/refbase.obj \
- $(SLO)$/tabbargeometry.obj \
- $(SLO)$/tablayouter.obj \
- $(SLO)$/toolpanel.obj \
- $(SLO)$/toolpanelcollection.obj \
- $(SLO)$/toolpaneldrawer.obj \
- $(SLO)$/toolpaneldrawerpeer.obj \
- $(SLO)$/toolpaneldeck.obj \
- $(SLO)$/toolpaneldeckpeer.obj \
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx
index 21d110a13105..37bbcf4678c2 100644
--- a/svtools/source/toolpanel/paneltabbar.cxx
+++ b/svtools/source/toolpanel/paneltabbar.cxx
@@ -169,8 +169,8 @@ namespace svt
aSelectionRect,
( bHovered || bFocused ) ? ( bActive ? 1 : 2 ) : 0 /* hilight */,
bActive /* check */,
- TRUE /* border */,
- FALSE /* ext border only */,
+ sal_True /* border */,
+ sal_False /* ext border only */,
0 /* corner radius */,
NULL,
NULL
@@ -686,7 +686,7 @@ namespace svt
Font aFont( m_rTabBar.GetFont() );
aFont.SetOrientation( 2700 );
- aFont.SetVertical( TRUE );
+ aFont.SetVertical( sal_True );
m_rTabBar.SetFont( aFont );
aTextPos.X() += aTextSize.Height();
@@ -788,7 +788,7 @@ namespace svt
return;
}
- m_rTabBar.SetUpdateMode( FALSE );
+ m_rTabBar.SetUpdateMode( sal_False );
// the aligned bounding and content rect
const Rectangle aActualBounds = m_aNormalizer.getTransformed( aNormalizedBounds, m_eTabAlignment );
@@ -806,7 +806,7 @@ namespace svt
// render item "foreground" layer
m_pRenderer->postRenderItem( m_rTabBar, aActualBounds, nItemFlags );
- m_rTabBar.SetUpdateMode( TRUE );
+ m_rTabBar.SetUpdateMode( sal_True );
}
//------------------------------------------------------------------------------------------------------------------
@@ -1339,9 +1339,9 @@ namespace svt
}
//------------------------------------------------------------------------------------------------------------------
- Reference< XWindowPeer > PanelTabBar::GetComponentInterface( BOOL i_bCreate )
+ Reference< XWindowPeer > PanelTabBar::GetComponentInterface( sal_Bool i_bCreate )
{
- Reference< XWindowPeer > xWindowPeer( Control::GetComponentInterface( FALSE ) );
+ Reference< XWindowPeer > xWindowPeer( Control::GetComponentInterface( sal_False ) );
if ( !xWindowPeer.is() && i_bCreate )
{
xWindowPeer.set( new PanelTabBarPeer( *this ) );
diff --git a/svtools/source/toolpanel/tablayouter.cxx b/svtools/source/toolpanel/tablayouter.cxx
index 3c209ab0503d..b9615dffc774 100644
--- a/svtools/source/toolpanel/tablayouter.cxx
+++ b/svtools/source/toolpanel/tablayouter.cxx
@@ -255,7 +255,7 @@ namespace svt
if ( lcl_checkDisposed( *m_pData ) )
return NULL;
- return m_pData->pTabBar->GetAccessible( TRUE );
+ return m_pData->pTabBar->GetAccessible( sal_True );
}
//........................................................................
diff --git a/svtools/source/toolpanel/toolpaneldeck.cxx b/svtools/source/toolpanel/toolpaneldeck.cxx
index dd053f67082e..ccf3df37a527 100644
--- a/svtools/source/toolpanel/toolpaneldeck.cxx
+++ b/svtools/source/toolpanel/toolpaneldeck.cxx
@@ -545,9 +545,9 @@ namespace svt
}
//--------------------------------------------------------------------
- Reference< XWindowPeer > ToolPanelDeck::GetComponentInterface( BOOL i_bCreate )
+ Reference< XWindowPeer > ToolPanelDeck::GetComponentInterface( sal_Bool i_bCreate )
{
- Reference< XWindowPeer > xWindowPeer( Control::GetComponentInterface( FALSE ) );
+ Reference< XWindowPeer > xWindowPeer( Control::GetComponentInterface( sal_False ) );
if ( !xWindowPeer.is() && i_bCreate )
{
xWindowPeer.set( new ToolPanelDeckPeer( *this ) );
diff --git a/svtools/source/toolpanel/toolpaneldrawer.cxx b/svtools/source/toolpanel/toolpaneldrawer.cxx
index 41593b1d6897..06712deb2775 100644
--- a/svtools/source/toolpanel/toolpaneldrawer.cxx
+++ b/svtools/source/toolpanel/toolpaneldrawer.cxx
@@ -58,7 +58,7 @@ namespace svt
:Window( &i_rParent )
,m_rDrawer( i_rParent )
{
- SetMouseTransparent( TRUE );
+ SetMouseTransparent( sal_True );
Show();
SetAccessibleRole( AccessibleRole::LABEL );
}
@@ -86,7 +86,7 @@ namespace svt
,m_bFocused( false )
,m_bExpanded( false )
{
- EnableMapMode( FALSE );
+ EnableMapMode( sal_False );
SetBackground( Wallpaper() );
SetPointer( POINTER_REFHAND );
@@ -162,7 +162,7 @@ namespace svt
Image ToolPanelDrawer::impl_getExpansionIndicator() const
{
- USHORT nResourceId = 0;
+ sal_uInt16 nResourceId = 0;
if ( m_bExpanded )
nResourceId = IMG_TRIANGLE_DOWN;
else
@@ -171,9 +171,9 @@ namespace svt
}
- USHORT ToolPanelDrawer::impl_getTextStyle() const
+ sal_uInt16 ToolPanelDrawer::impl_getTextStyle() const
{
- const USHORT nBasicStyle = TEXT_DRAW_LEFT
+ const sal_uInt16 nBasicStyle = TEXT_DRAW_LEFT
| TEXT_DRAW_TOP
| TEXT_DRAW_WORDBREAK;
@@ -206,7 +206,7 @@ namespace svt
{
const Rectangle aTextPixelBox( m_pPaintDevice->LogicToPixel( i_rTextBox ) );
- m_pPaintDevice->EnableMapMode( FALSE );
+ m_pPaintDevice->EnableMapMode( sal_False );
m_pPaintDevice->SetFillColor();
Rectangle aBox( i_rTextBox );
@@ -223,7 +223,7 @@ namespace svt
m_pPaintDevice->SetLineColor( COL_BLACK );
m_pPaintDevice->DrawPolyLine( Polygon( aTextPixelBox ), aDottedStyle );
- m_pPaintDevice->EnableMapMode( FALSE );
+ m_pPaintDevice->EnableMapMode( sal_False );
}
else
HideFocus();
@@ -300,9 +300,9 @@ namespace svt
}
//------------------------------------------------------------------------------------------------------------------
- Reference< XWindowPeer > ToolPanelDrawer::GetComponentInterface( BOOL i_bCreate )
+ Reference< XWindowPeer > ToolPanelDrawer::GetComponentInterface( sal_Bool i_bCreate )
{
- Reference< XWindowPeer > xWindowPeer( Window::GetComponentInterface( FALSE ) );
+ Reference< XWindowPeer > xWindowPeer( Window::GetComponentInterface( sal_False ) );
if ( !xWindowPeer.is() && i_bCreate )
{
xWindowPeer.set( new ToolPanelDrawerPeer() );
diff --git a/svtools/source/toolpanel/toolpaneldrawer.hxx b/svtools/source/toolpanel/toolpaneldrawer.hxx
index 40a34b5b2431..943228a63030 100644
--- a/svtools/source/toolpanel/toolpaneldrawer.hxx
+++ b/svtools/source/toolpanel/toolpaneldrawer.hxx
@@ -87,13 +87,13 @@ namespace svt
virtual void MouseButtonDown( const MouseEvent& i_rMouseEvent );
virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >
- GetComponentInterface( BOOL i_bCreate );
+ GetComponentInterface( sal_Bool i_bCreate );
private:
Rectangle impl_calcTextBoundingBox() const;
Rectangle impl_calcTitleBarBox( const Rectangle& i_rTextBox ) const;
void impl_paintBackground( const Rectangle& i_rTitleBarBox );
- USHORT impl_getTextStyle() const;
+ sal_uInt16 impl_getTextStyle() const;
void impl_paintFocusIndicator( const Rectangle& i_rTextBox );
Rectangle impl_paintExpansionIndicator( const Rectangle& i_rTextBox );
Image impl_getExpansionIndicator() const;
diff --git a/svtools/source/uno/addrtempuno.cxx b/svtools/source/uno/addrtempuno.cxx
index 48010373a091..8cb5a4945e2e 100644
--- a/svtools/source/uno/addrtempuno.cxx
+++ b/svtools/source/uno/addrtempuno.cxx
@@ -29,8 +29,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
#include "svtools/genericunodialog.hxx"
-#include "addresstemplate.hxx"
-#include <cppuhelper/extract.hxx>
+#include <svtools/addresstemplate.hxx>
+#include <comphelper/extract.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <comphelper/property.hxx>
#include <com/sun/star/sdbc/XDataSource.hpp>
diff --git a/svtools/source/uno/contextmenuhelper.cxx b/svtools/source/uno/contextmenuhelper.cxx
index 16a1bcc8ec96..82ae79fa2c92 100644
--- a/svtools/source/uno/contextmenuhelper.cxx
+++ b/svtools/source/uno/contextmenuhelper.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "contextmenuhelper.hxx"
+#include <svtools/contextmenuhelper.hxx>
#include <svtools/menuoptions.hxx>
#include <svtools/miscopt.hxx>
diff --git a/svtools/source/uno/framestatuslistener.cxx b/svtools/source/uno/framestatuslistener.cxx
index 0f6d93bc9bad..2c228f28e5e6 100644
--- a/svtools/source/uno/framestatuslistener.cxx
+++ b/svtools/source/uno/framestatuslistener.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include <framestatuslistener.hxx>
+#include <svtools/framestatuslistener.hxx>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <osl/mutex.hxx>
diff --git a/svtools/source/uno/generictoolboxcontroller.cxx b/svtools/source/uno/generictoolboxcontroller.cxx
index 5d3a3bcdd53c..0c3ef6129e5a 100644
--- a/svtools/source/uno/generictoolboxcontroller.cxx
+++ b/svtools/source/uno/generictoolboxcontroller.cxx
@@ -71,7 +71,7 @@ struct ExecuteInfo
GenericToolboxController::GenericToolboxController( const Reference< XMultiServiceFactory >& rServiceManager,
const Reference< XFrame >& rFrame,
ToolBox* pToolbox,
- USHORT nID,
+ sal_uInt16 nID,
const ::rtl::OUString& aCommand ) :
svt::ToolboxController( rServiceManager, rFrame, aCommand )
, m_pToolbox( pToolbox )
@@ -158,7 +158,7 @@ throw ( RuntimeException )
{
m_pToolbox->EnableItem( m_nID, Event.IsEnabled );
- USHORT nItemBits = m_pToolbox->GetItemBits( m_nID );
+ sal_uInt16 nItemBits = m_pToolbox->GetItemBits( m_nID );
nItemBits &= ~TIB_CHECKABLE;
TriState eTri = STATE_NOCHECK;
diff --git a/svtools/source/uno/genericunodialog.cxx b/svtools/source/uno/genericunodialog.cxx
index a5bffed006b7..065c6207317a 100644
--- a/svtools/source/uno/genericunodialog.cxx
+++ b/svtools/source/uno/genericunodialog.cxx
@@ -35,7 +35,7 @@
#include <com/sun/star/ucb/AlreadyInitializedException.hpp>
#include <toolkit/awt/vclxwindow.hxx>
-#include <cppuhelper/extract.hxx>
+#include <comphelper/extract.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <comphelper/property.hxx>
#include <osl/diagnose.h>
diff --git a/svtools/source/uno/makefile.mk b/svtools/source/uno/makefile.mk
deleted file mode 100644
index 7c1c44006047..000000000000
--- a/svtools/source/uno/makefile.mk
+++ /dev/null
@@ -1,61 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=unoiface
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/addrtempuno.obj \
- $(SLO)$/contextmenuhelper.obj \
- $(SLO)$/framestatuslistener.obj \
- $(SLO)$/generictoolboxcontroller.obj \
- $(SLO)$/genericunodialog.obj \
- $(SLO)$/miscservices.obj\
- $(SLO)$/statusbarcontroller.obj \
- $(SLO)$/toolboxcontroller.obj \
- $(SLO)$/treecontrolpeer.obj \
- $(SLO)$/unocontroltablemodel.obj \
- $(SLO)$/unoevent.obj \
- $(SLO)$/unoiface.obj \
- $(SLO)$/unoimap.obj \
- $(SLO)$/svtxgridcontrol.obj \
- $(SLO)$/popupwindowcontroller.obj \
- $(SLO)$/popupmenucontrollerbase.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svtools/source/uno/miscservices.cxx b/svtools/source/uno/miscservices.cxx
index ad614a3f7b88..c652b6028bf0 100644
--- a/svtools/source/uno/miscservices.cxx
+++ b/svtools/source/uno/miscservices.cxx
@@ -102,55 +102,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
- void * pServiceManager, void * _pRegistryKey )
-{
- if (_pRegistryKey)
- {
- Reference< XRegistryKey > xRegistryKey (
- reinterpret_cast< XRegistryKey* >( _pRegistryKey ));
- Reference< XRegistryKey > xNewKey;
- uno::Sequence< ::rtl::OUString > aServices;
-
- xNewKey = xRegistryKey->createKey (
- OUString( RTL_CONSTASCII_USTRINGPARAM( "/com.sun.star.comp.svtools.OAddressBookSourceDialogUno/UNO/SERVICES" )) );
- xNewKey->createKey(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.AddressBookSourceDialog" )) );
-
- xNewKey = xRegistryKey->createKey (
- OUString( RTL_CONSTASCII_USTRINGPARAM( "/com.sun.star.svtools.SvFilterOptionsDialog/UNO/SERVICES" )) );
- xNewKey->createKey (
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilterOptionsDialog" )) );
-
- // GraphicProvider
- xNewKey = reinterpret_cast< registry::XRegistryKey * >( _pRegistryKey )->createKey(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
- GraphicProvider::getImplementationName_Static() +
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) );
-
- aServices = GraphicProvider::getSupportedServiceNames_Static();
- int i;
- for( i = 0; i < aServices.getLength(); i++ )
- xNewKey->createKey( aServices.getConstArray()[ i ] );
-
- // GraphicRendererVCL
- xNewKey = reinterpret_cast< registry::XRegistryKey * >( _pRegistryKey )->createKey(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
- GraphicRendererVCL::getImplementationName_Static() +
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) );
-
- aServices = ( GraphicRendererVCL::getSupportedServiceNames_Static() );
- for( i = 0; i < aServices.getLength(); i++ )
- xNewKey->createKey( aServices.getConstArray()[ i ] );
-
- if ( !component_writeInfoHelper( reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ), reinterpret_cast< registry::XRegistryKey* >( _pRegistryKey ), serviceDecl ) )
- return false;
-
- return ::cppu::component_writeInfoHelper( pServiceManager, _pRegistryKey, s_aServiceEntries );
- }
- return sal_False;
-}
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
const sal_Char * pImplementationName, void * _pServiceManager, void * pRegistryKey)
{
diff --git a/svtools/source/uno/statusbarcontroller.cxx b/svtools/source/uno/statusbarcontroller.cxx
index 3ba2ecf2ddb2..a64117823c60 100644
--- a/svtools/source/uno/statusbarcontroller.cxx
+++ b/svtools/source/uno/statusbarcontroller.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include <statusbarcontroller.hxx>
+#include <svtools/statusbarcontroller.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
@@ -38,7 +38,7 @@
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
#include <vcl/status.hxx>
-#include <imgdef.hxx>
+#include <svtools/imgdef.hxx>
#include <svtools/miscopt.hxx>
#include <toolkit/unohlp.hxx>
diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx
index e0d51e32aa63..778925a60c44 100644
--- a/svtools/source/uno/svtxgridcontrol.cxx
+++ b/svtools/source/uno/svtxgridcontrol.cxx
@@ -29,22 +29,18 @@
#include "precompiled_svtools.hxx"
#include "svtxgridcontrol.hxx"
-#include "accessibletableimp.hxx"
#include <com/sun/star/view/SelectionType.hpp>
+#include "svtools/table/tablecontrolinterface.hxx"
#include "svtools/table/gridtablerenderer.hxx"
-#include "svtools/table/defaultinputhandler.hxx"
#include "svtools/table/tablecontrol.hxx"
#include "unocontroltablemodel.hxx"
#include <comphelper/sequence.hxx>
#include <rtl/ref.hxx>
-#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
#include <toolkit/helper/property.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/awt/grid/XGridColumn.hpp>
-#include <com/sun/star/accessibility/AccessibleTableModelChange.hpp>
-#include <com/sun/star/accessibility/AccessibleTableModelChangeType.hpp>
-#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/awt/XControl.hpp>
#include <com/sun/star/awt/grid/GridInvalidDataException.hpp>
#include <com/sun/star/awt/grid/GridInvalidModelException.hpp>
@@ -53,93 +49,175 @@
#include <vcl/svapp.hxx>
-using ::rtl::OUString;
using namespace ::svt::table;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::awt::grid;
using namespace ::com::sun::star::view;
-using namespace ::toolkit;
+using namespace ::com::sun::star::style;
+using namespace ::com::sun::star::container;
using namespace ::com::sun::star::accessibility;
-using namespace ::com::sun::star::accessibility::AccessibleEventId;
-using namespace ::com::sun::star::accessibility::AccessibleTableModelChangeType;
-using ::com::sun::star::accessibility::AccessibleTableModelChange;
SVTXGridControl::SVTXGridControl()
- :m_pTableModel (new UnoControlTableModel()),
- m_xDataModel(0),
- m_xColumnModel(0),
- m_bHasColumnHeaders(false),
- m_bHasRowHeaders(false),
- m_bVScroll(false),
- m_bHScroll(false),
- m_bUpdate(false),
- m_nSelectedRowCount(0),
- m_aSelectionListeners( *this )
+ :m_pTableModel( new UnoControlTableModel() )
+ ,m_bHasColumnHeaders( false )
+ ,m_bHasRowHeaders( false )
+ ,m_bTableModelInitCompleted( false )
+ ,m_nSelectedRowCount( 0 )
+ ,m_aSelectionListeners( *this )
{
}
-//--------------------------------------------------------------------
+// ---------------------------------------------------------------------------------------------------------------------
SVTXGridControl::~SVTXGridControl()
{
}
-::com::sun::star::uno::Any SVTXGridControl::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
+// ---------------------------------------------------------------------------------------------------------------------
+void SVTXGridControl::SetWindow( Window* pWindow )
{
- ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
- SAL_STATIC_CAST( ::com::sun::star::awt::grid::XGridControl*, this ),
- SAL_STATIC_CAST( ::com::sun::star::awt::grid::XGridDataListener*, this ),
- SAL_STATIC_CAST( ::com::sun::star::awt::grid::XGridColumnListener*, this ),
- SAL_STATIC_CAST( ::com::sun::star::lang::XTypeProvider*, this ) );
- return (aRet.hasValue() ? aRet : VCLXWindow::queryInterface( rType ));
+ SVTXGridControl_Base::SetWindow( pWindow );
+ impl_checkTableModelInit();
}
-// ::com::sun::star::lang::XTypeProvider
-IMPL_XTYPEPROVIDER_START( SVTXGridControl )
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridControl>* ) NULL ),
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataModel>* ) NULL ),
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener>* ) NULL ),
- VCLXWindow::getTypes()
-IMPL_XTYPEPROVIDER_END
+// ---------------------------------------------------------------------------------------------------------------------
+sal_Int32 SAL_CALL SVTXGridControl::getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException)
+{
+ SolarMutexGuard aGuard;
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getRowAtPoint: no control (anymore)!", -1 );
+
+ TableCell const tableCell = pTable->getTableControlInterface().hitTest( Point( x, y ) );
+ return ( tableCell.nRow >= 0 ) ? tableCell.nRow : -1;
+}
-sal_Int32 SAL_CALL SVTXGridControl::getItemIndexAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException)
+// ---------------------------------------------------------------------------------------------------------------------
+sal_Int32 SAL_CALL SVTXGridControl::getColumnAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- return pTable->GetCurrentRow( Point(x,y) );
+ SolarMutexGuard aGuard;
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getColumnAtPoint: no control (anymore)!", -1 );
+
+ TableCell const tableCell = pTable->getTableControlInterface().hitTest( Point( x, y ) );
+ return ( tableCell.nColumn >= 0 ) ? tableCell.nColumn : -1;
}
-void SAL_CALL SVTXGridControl::setToolTip(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& text, const com::sun::star::uno::Sequence< sal_Int32 >& columns) throw (::com::sun::star::uno::RuntimeException)
+// ---------------------------------------------------------------------------------------------------------------------
+sal_Int32 SAL_CALL SVTXGridControl::getCurrentColumn( ) throw (RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- pTable->setTooltip(text, columns);
+ SolarMutexGuard aGuard;
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getCurrentColumn: no control (anymore)!", -1 );
+
+ sal_Int32 const nColumn = pTable->GetCurrentColumn();
+ return ( nColumn >= 0 ) ? nColumn : -1;
}
+// ---------------------------------------------------------------------------------------------------------------------
+sal_Int32 SAL_CALL SVTXGridControl::getCurrentRow( ) throw (RuntimeException)
+{
+ SolarMutexGuard aGuard;
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getCurrentRow: no control (anymore)!", -1 );
+
+ sal_Int32 const nRow = pTable->GetCurrentRow();
+ return ( nRow >= 0 ) ? nRow : -1;
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
void SAL_CALL SVTXGridControl::addSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException)
{
m_aSelectionListeners.addInterface(listener);
}
+// ---------------------------------------------------------------------------------------------------------------------
void SAL_CALL SVTXGridControl::removeSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException)
{
m_aSelectionListeners.removeInterface(listener);
}
+// ---------------------------------------------------------------------------------------------------------------------
void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const Any& aValue) throw(RuntimeException)
{
SolarMutexGuard aGuard;
- TableControl* pTable = (TableControl*)GetWindow();
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable != NULL, "SVTXGridControl::setProperty: no control (anymore)!" );
+
switch( GetPropertyId( PropertyName ) )
{
+ case BASEPROPERTY_ROW_HEADER_WIDTH:
+ {
+ sal_Int32 rowHeaderWidth( -1 );
+ aValue >>= rowHeaderWidth;
+ ENSURE_OR_BREAK( rowHeaderWidth > 0, "SVTXGridControl::setProperty: illegal row header width!" );
+ m_pTableModel->setRowHeaderWidth( rowHeaderWidth );
+ // TODO: the model should broadcast this change itself, and the table should invalidate itself as needed
+ pTable->Invalidate();
+ }
+ break;
+
+ case BASEPROPERTY_COLUMN_HEADER_HEIGHT:
+ {
+ sal_Int32 columnHeaderHeight = 0;
+ if ( !aValue.hasValue() )
+ {
+ columnHeaderHeight = pTable->PixelToLogic( Size( 0, pTable->GetTextHeight() + 3 ), MAP_APPFONT ).Height();
+ }
+ else
+ {
+ aValue >>= columnHeaderHeight;
+ }
+ ENSURE_OR_BREAK( columnHeaderHeight > 0, "SVTXGridControl::setProperty: illegal column header height!" );
+ m_pTableModel->setColumnHeaderHeight( columnHeaderHeight );
+ // TODO: the model should broadcast this change itself, and the table should invalidate itself as needed
+ pTable->Invalidate();
+ }
+ break;
+
+ case BASEPROPERTY_USE_GRID_LINES:
+ {
+ GridTableRenderer* pGridRenderer = dynamic_cast< GridTableRenderer* >(
+ m_pTableModel->getRenderer().get() );
+ ENSURE_OR_BREAK( pGridRenderer != NULL, "SVTXGridControl::setProperty(UseGridLines): invalid renderer!" );
+ sal_Bool bUseGridLines = sal_False;
+ OSL_VERIFY( aValue >>= bUseGridLines );
+ pGridRenderer->useGridLines( bUseGridLines );
+ pTable->Invalidate();
+ }
+ break;
+
+ case BASEPROPERTY_ROW_HEIGHT:
+ {
+ sal_Int32 rowHeight = 0;
+ if ( !aValue.hasValue() )
+ {
+ rowHeight = pTable->PixelToLogic( Size( 0, pTable->GetTextHeight() + 3 ), MAP_APPFONT ).Height();
+ }
+ else
+ {
+ aValue >>= rowHeight;
+ }
+ m_pTableModel->setRowHeight( rowHeight );
+ ENSURE_OR_BREAK( rowHeight > 0, "SVTXGridControl::setProperty: illegal row height!" );
+ // TODO: the model should broadcast this change itself, and the table should invalidate itself as needed
+ pTable->Invalidate();
+ }
+ break;
+
case BASEPROPERTY_BACKGROUNDCOLOR:
{
// let the base class handle this for the TableControl
VCLXWindow::setProperty( PropertyName, aValue );
// and forward to the grid control's data window
if ( pTable->IsBackground() )
- pTable->getDataWindow()->SetBackground( pTable->GetBackground() );
+ pTable->getDataWindow().SetBackground( pTable->GetBackground() );
else
- pTable->getDataWindow()->SetBackground();
+ pTable->getDataWindow().SetBackground();
}
break;
@@ -154,7 +232,6 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An
case SelectionType_SINGLE: eSelMode = SINGLE_SELECTION; break;
case SelectionType_RANGE: eSelMode = RANGE_SELECTION; break;
case SelectionType_MULTI: eSelMode = MULTIPLE_SELECTION; break;
- // case SelectionType_NONE:
default: eSelMode = NO_SELECTION; break;
}
if( pTable->getSelEngine()->GetSelectionMode() != eSelMode )
@@ -166,19 +243,16 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An
{
sal_Bool bHScroll = true;
if( aValue >>= bHScroll )
- {
- m_bHScroll = bHScroll;
- m_pTableModel->setHorizontalScrollbarVisibility(bHScroll);
- }
+ m_pTableModel->setHorizontalScrollbarVisibility( bHScroll ? ScrollbarShowAlways : ScrollbarShowSmart );
break;
}
+
case BASEPROPERTY_VSCROLL:
{
sal_Bool bVScroll = true;
if( aValue >>= bVScroll )
{
- m_bVScroll = bVScroll;
- m_pTableModel->setVerticalScrollbarVisibility(bVScroll);
+ m_pTableModel->setVerticalScrollbarVisibility( bVScroll ? ScrollbarShowAlways : ScrollbarShowSmart );
}
break;
}
@@ -192,64 +266,42 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An
}
break;
}
- case BASEPROPERTY_GRID_HEADER_BACKGROUND:
- {
- sal_Int32 colorHeader = 0xFFFFFF;
- if( aValue >>= colorHeader )
- {
- m_pTableModel->setHeaderBackgroundColor(colorHeader);
- }
+
+ case BASEPROPERTY_GRID_ROW_BACKGROUND_COLORS:
+ m_pTableModel->setRowBackgroundColors( aValue );
+ pTable->Invalidate();
break;
- }
+
case BASEPROPERTY_GRID_LINE_COLOR:
- {
- sal_Int32 colorLine = 0xFFFFFF;
- if( aValue >>= colorLine )
- {
- m_pTableModel->setLineColor(colorLine);
- }
+ m_pTableModel->setLineColor( aValue );
+ pTable->Invalidate();
break;
- }
- case BASEPROPERTY_GRID_EVEN_ROW_BACKGROUND:
- {
- sal_Int32 colorEvenRow = 0xFFFFFF;
- if( aValue >>= colorEvenRow )
- {
- m_pTableModel->setEvenRowBackgroundColor(colorEvenRow);
- }
+
+ case BASEPROPERTY_GRID_HEADER_BACKGROUND:
+ m_pTableModel->setHeaderBackgroundColor( aValue );
+ pTable->Invalidate();
break;
- }
- case BASEPROPERTY_GRID_ROW_BACKGROUND:
- {
- sal_Int32 colorBackground = 0xFFFFFF;
- if( aValue >>= colorBackground )
- {
- m_pTableModel->setOddRowBackgroundColor(colorBackground);
- }
+
+ case BASEPROPERTY_GRID_HEADER_TEXT_COLOR:
+ m_pTableModel->setHeaderTextColor( aValue );
+ pTable->Invalidate();
break;
- }
+
case BASEPROPERTY_TEXTCOLOR:
- {
- sal_Int32 colorText = 0x000000;
- if( aValue >>= colorText )
- {
- m_pTableModel->setTextColor(colorText);
- }
+ m_pTableModel->setTextColor( aValue );
+ pTable->Invalidate();
break;
- }
+
+ case BASEPROPERTY_TEXTLINECOLOR:
+ m_pTableModel->setTextLineColor( aValue );
+ pTable->Invalidate();
+ break;
+
case BASEPROPERTY_VERTICALALIGN:
{
- com::sun::star::style::VerticalAlignment vAlign(com::sun::star::style::VerticalAlignment(0));
- if( aValue >>= vAlign )
- {
- switch( vAlign )
- {
- case com::sun::star::style::VerticalAlignment_TOP: m_pTableModel->setVerticalAlign(com::sun::star::style::VerticalAlignment(0)); break;
- case com::sun::star::style::VerticalAlignment_MIDDLE: m_pTableModel->setVerticalAlign(com::sun::star::style::VerticalAlignment(1)); break;
- case com::sun::star::style::VerticalAlignment_BOTTOM: m_pTableModel->setVerticalAlign(com::sun::star::style::VerticalAlignment(2)); break;
- default: m_pTableModel->setVerticalAlign(com::sun::star::style::VerticalAlignment(0)); break;
- }
- }
+ VerticalAlignment eAlign( VerticalAlignment_TOP );
+ if ( aValue >>= eAlign )
+ m_pTableModel->setVerticalAlign( eAlign );
break;
}
@@ -264,97 +316,31 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An
}
case BASEPROPERTY_GRID_DATAMODEL:
{
- {
- m_xDataModel = Reference< XGridDataModel >( aValue, UNO_QUERY );
- if(m_xDataModel != NULL)
- {
- Sequence<Sequence< Any > > cellData = m_xDataModel->getData();
- if(cellData.getLength()!= 0)
- {
- for (int i = 0; i < cellData.getLength(); i++)
- {
- std::vector< Any > newRow;
- Sequence< Any > rawRowData = cellData[i];
- //check whether the data row vector length matches with the column count
- if(m_xColumnModel->getColumnCount() == 0)
- {
- for ( ::svt::table::ColPos col = 0; col < rawRowData.getLength(); ++col )
- {
- UnoControlTableColumn* tableColumn = new UnoControlTableColumn();
- m_pTableModel->getColumnModel().push_back((PColumnModel)tableColumn);
- }
- m_xColumnModel->setDefaultColumns(rawRowData.getLength());
- }
- else
- if((unsigned int)rawRowData.getLength()!=(unsigned)m_pTableModel->getColumnCount())
- throw GridInvalidDataException(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The column count doesn't match with the length of row data" )), m_xDataModel);
-
- for ( int k = 0; k < rawRowData.getLength(); k++)
- {
- newRow.push_back(rawRowData[k]);
- }
- m_pTableModel->getCellContent().push_back(newRow);
- }
-
- Sequence< ::rtl::OUString > rowHeaders = m_xDataModel->getRowHeaders();
- std::vector< rtl::OUString > newRow(
- comphelper::sequenceToContainer< std::vector<rtl::OUString > >(rowHeaders));
- m_pTableModel->setRowCount(m_xDataModel->getRowCount());
- m_pTableModel->setRowHeaderName(newRow);
- }
- }
- else
- throw GridInvalidDataException(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The data model isn't set!" )), m_xDataModel);
- sal_Int32 fontHeight = pTable->PixelToLogic( Size( 0, pTable->GetTextHeight()+3 ), MAP_APPFONT ).Height();
- if(m_xDataModel->getRowHeight() == 0)
- {
- m_pTableModel->setRowHeight(fontHeight);
- m_xDataModel->setRowHeight(fontHeight);
- }
- else
- m_pTableModel->setRowHeight(m_xDataModel->getRowHeight());
- m_pTableModel->setRowHeaderWidth(m_xDataModel->getRowHeaderWidth());
- }
- break;
+ Reference< XGridDataModel > const xDataModel( aValue, UNO_QUERY );
+ if ( !xDataModel.is() )
+ throw GridInvalidDataException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid data model." ) ), *this );
+
+ m_pTableModel->setDataModel( xDataModel );
+ impl_checkTableModelInit();
}
+ break;
+
case BASEPROPERTY_GRID_COLUMNMODEL:
{
- m_xColumnModel = Reference< XGridColumnModel >( aValue, UNO_QUERY );
- if(m_xColumnModel != NULL)
- {
- if(m_xColumnModel->getColumnCount() != 0)
- {
- Sequence<Reference< XGridColumn > > columns = m_xColumnModel->getColumns();
- std::vector<Reference< XGridColumn > > aNewColumns(
- comphelper::sequenceToContainer<std::vector<Reference< XGridColumn > > >(columns));
- sal_Int32 fontHeight = pTable->PixelToLogic( Size( 0, pTable->GetTextHeight()+3 ), MAP_APPFONT ).Height();
- if(m_xColumnModel->getColumnHeaderHeight() == 0)
- {
- m_pTableModel->setColumnHeaderHeight(fontHeight);
- m_xColumnModel->setColumnHeaderHeight(fontHeight);
- }
- else
- m_pTableModel->setColumnHeaderHeight(m_xColumnModel->getColumnHeaderHeight());
- for ( ::svt::table::ColPos col = 0; col < m_xColumnModel->getColumnCount(); ++col )
- {
- UnoControlTableColumn* tableColumn = new UnoControlTableColumn(aNewColumns[col]);
- Reference< XGridColumn > xGridColumn = m_xColumnModel->getColumn(col);
- m_pTableModel->getColumnModel().push_back((PColumnModel)tableColumn);
- tableColumn->setHorizontalAlign(xGridColumn->getHorizontalAlign());
- tableColumn->setWidth(xGridColumn->getColumnWidth());
- if(xGridColumn->getPreferredWidth() != 0)
- tableColumn->setPreferredWidth(xGridColumn->getPreferredWidth());
- if(xGridColumn->getMaxWidth() != 0)
- tableColumn->setMaxWidth(xGridColumn->getMaxWidth());
- if(xGridColumn->getMinWidth() != 0)
- tableColumn->setMinWidth(xGridColumn->getMinWidth());
- tableColumn->setResizable(xGridColumn->getResizeable());
- }
- }
- }
- else
- throw GridInvalidModelException(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The column model isn't set!" )), m_xColumnModel);
+ // obtain new col model
+ Reference< XGridColumnModel > const xColumnModel( aValue, UNO_QUERY );
+ if ( !xColumnModel.is() )
+ throw GridInvalidModelException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid column model." ) ), *this );
+
+ // remove all old columns
+ m_pTableModel->removeAllColumns();
+
+ // announce to the TableModel
+ m_pTableModel->setColumnModel( xColumnModel );
+ impl_checkTableModelInit();
+ // add new columns
+ impl_updateColumnsFromModel_nothrow();
break;
}
default:
@@ -363,489 +349,354 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An
}
}
+
+void SVTXGridControl::impl_checkTableModelInit()
+{
+ if ( !m_bTableModelInitCompleted && m_pTableModel->hasColumnModel() && m_pTableModel->hasDataModel() )
+ {
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ if ( pTable )
+ {
+ pTable->SetModel( PTableModel( m_pTableModel ) );
+
+ m_bTableModelInitCompleted = true;
+
+ // ensure default columns exist, if they have not previously been added
+ Reference< XGridDataModel > const xDataModel( m_pTableModel->getDataModel(), UNO_QUERY_THROW );
+ Reference< XGridColumnModel > const xColumnModel( m_pTableModel->getColumnModel(), UNO_QUERY_THROW );
+
+ sal_Int32 const nDataColumnCount = xDataModel->getColumnCount();
+ if ( ( nDataColumnCount > 0 ) && ( xColumnModel->getColumnCount() == 0 ) )
+ xColumnModel->setDefaultColumns( nDataColumnCount );
+ // this will trigger notifications, which in turn will let us update our m_pTableModel
+ }
+ }
+}
+
+namespace
+{
+ void lcl_convertColor( ::boost::optional< ::Color > const & i_color, Any & o_colorValue )
+ {
+ if ( !i_color )
+ o_colorValue.clear();
+ else
+ o_colorValue <<= i_color->GetColor();
+ }
+}
+
Any SVTXGridControl::getProperty( const ::rtl::OUString& PropertyName ) throw(RuntimeException)
{
SolarMutexGuard aGuard;
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getProperty: no control (anymore)!", Any() );
+
+ Any aPropertyValue;
+
const sal_uInt16 nPropId = GetPropertyId( PropertyName );
- TableControl* pTable = (TableControl*)GetWindow();
- if(pTable)
+ switch(nPropId)
+ {
+ case BASEPROPERTY_GRID_SELECTIONMODE:
{
- switch(nPropId)
+ SelectionType eSelectionType;
+
+ SelectionMode eSelMode = pTable->getSelEngine()->GetSelectionMode();
+ switch( eSelMode )
{
- case BASEPROPERTY_GRID_SELECTIONMODE:
+ case SINGLE_SELECTION: eSelectionType = SelectionType_SINGLE; break;
+ case RANGE_SELECTION: eSelectionType = SelectionType_RANGE; break;
+ case MULTIPLE_SELECTION:eSelectionType = SelectionType_MULTI; break;
+ default: eSelectionType = SelectionType_NONE; break;
+ }
+ aPropertyValue <<= eSelectionType;
+ break;
+ }
+
+ case BASEPROPERTY_GRID_SHOWROWHEADER:
+ aPropertyValue <<= sal_Bool( m_pTableModel->hasRowHeaders() );
+ break;
+
+ case BASEPROPERTY_GRID_SHOWCOLUMNHEADER:
+ aPropertyValue <<= sal_Bool( m_pTableModel->hasColumnHeaders() );
+ break;
+
+ case BASEPROPERTY_GRID_DATAMODEL:
+ aPropertyValue <<= m_pTableModel->getDataModel();
+ break;
+
+ case BASEPROPERTY_GRID_COLUMNMODEL:
+ aPropertyValue <<= m_pTableModel->getColumnModel();
+ break;
+
+ case BASEPROPERTY_HSCROLL:
{
- SelectionType eSelectionType;
+ sal_Bool const bHasScrollbar = ( m_pTableModel->getHorizontalScrollbarVisibility() != ScrollbarShowNever );
+ aPropertyValue <<= bHasScrollbar;
+ break;
+ }
- SelectionMode eSelMode = pTable->getSelEngine()->GetSelectionMode();
- switch( eSelMode )
- {
- case SINGLE_SELECTION: eSelectionType = SelectionType_SINGLE; break;
- case RANGE_SELECTION: eSelectionType = SelectionType_RANGE; break;
- case MULTIPLE_SELECTION:eSelectionType = SelectionType_MULTI; break;
-// case NO_SELECTION:
- default: eSelectionType = SelectionType_NONE; break;
- }
- return Any( eSelectionType );
+ case BASEPROPERTY_VSCROLL:
+ {
+ sal_Bool const bHasScrollbar = ( m_pTableModel->getVerticalScrollbarVisibility() != ScrollbarShowNever );
+ aPropertyValue <<= bHasScrollbar;
+ break;
}
- case BASEPROPERTY_GRID_SHOWROWHEADER:
+
+ case BASEPROPERTY_USE_GRID_LINES:
+ {
+ GridTableRenderer* pGridRenderer = dynamic_cast< GridTableRenderer* >(
+ m_pTableModel->getRenderer().get() );
+ ENSURE_OR_BREAK( pGridRenderer != NULL, "SVTXGridControl::getProperty(UseGridLines): invalid renderer!" );
+ aPropertyValue <<= pGridRenderer->useGridLines();
+ }
+ break;
+
+ case BASEPROPERTY_GRID_ROW_BACKGROUND_COLORS:
+ {
+ ::boost::optional< ::std::vector< ::Color > > aColors( m_pTableModel->getRowBackgroundColors() );
+ if ( !aColors )
+ aPropertyValue.clear();
+ else
+ {
+ Sequence< ::com::sun::star::util::Color > aAPIColors( aColors->size() );
+ for ( size_t i=0; i<aColors->size(); ++i )
{
- return Any ((sal_Bool) m_pTableModel->hasRowHeaders());
+ aAPIColors[i] = aColors->at(i).GetColor();
}
- case BASEPROPERTY_GRID_SHOWCOLUMNHEADER:
- return Any ((sal_Bool) m_pTableModel->hasColumnHeaders());
- case BASEPROPERTY_GRID_DATAMODEL:
- return Any ( m_xDataModel );
- case BASEPROPERTY_GRID_COLUMNMODEL:
- return Any ( m_xColumnModel);
- case BASEPROPERTY_HSCROLL:
- return Any ( m_bHScroll);
- case BASEPROPERTY_VSCROLL:
- return Any ( m_bVScroll);
+ aPropertyValue <<= aAPIColors;
}
}
- return VCLXWindow::getProperty( PropertyName );
+ break;
+
+ case BASEPROPERTY_GRID_LINE_COLOR:
+ lcl_convertColor( m_pTableModel->getLineColor(), aPropertyValue );
+ break;
+
+ case BASEPROPERTY_GRID_HEADER_BACKGROUND:
+ lcl_convertColor( m_pTableModel->getHeaderBackgroundColor(), aPropertyValue );
+ break;
+
+ case BASEPROPERTY_GRID_HEADER_TEXT_COLOR:
+ lcl_convertColor( m_pTableModel->getHeaderTextColor(), aPropertyValue );
+ break;
+
+ case BASEPROPERTY_TEXTCOLOR:
+ lcl_convertColor( m_pTableModel->getTextColor(), aPropertyValue );
+ break;
+
+ case BASEPROPERTY_TEXTLINECOLOR:
+ lcl_convertColor( m_pTableModel->getTextLineColor(), aPropertyValue );
+ break;
+
+ default:
+ aPropertyValue = VCLXWindow::getProperty( PropertyName );
+ break;
+ }
+
+ return aPropertyValue;
}
void SVTXGridControl::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
{
PushPropertyIds( rIds,
- BASEPROPERTY_GRID_SHOWROWHEADER,
- BASEPROPERTY_GRID_SHOWCOLUMNHEADER,
- BASEPROPERTY_GRID_DATAMODEL,
- BASEPROPERTY_GRID_COLUMNMODEL,
- BASEPROPERTY_GRID_SELECTIONMODE,
- BASEPROPERTY_GRID_EVEN_ROW_BACKGROUND,
- BASEPROPERTY_GRID_HEADER_BACKGROUND,
- BASEPROPERTY_GRID_LINE_COLOR,
- BASEPROPERTY_GRID_ROW_BACKGROUND,
- 0);
+ BASEPROPERTY_GRID_SHOWROWHEADER,
+ BASEPROPERTY_GRID_SHOWCOLUMNHEADER,
+ BASEPROPERTY_GRID_DATAMODEL,
+ BASEPROPERTY_GRID_COLUMNMODEL,
+ BASEPROPERTY_GRID_SELECTIONMODE,
+ BASEPROPERTY_GRID_HEADER_BACKGROUND,
+ BASEPROPERTY_GRID_HEADER_TEXT_COLOR,
+ BASEPROPERTY_GRID_LINE_COLOR,
+ BASEPROPERTY_GRID_ROW_BACKGROUND_COLORS,
+ 0
+ );
VCLXWindow::ImplGetPropertyIds( rIds, true );
}
-void SAL_CALL SVTXGridControl::setVisible( sal_Bool bVisible ) throw(::com::sun::star::uno::RuntimeException)
+
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::rowsInserted( const GridDataEvent& i_event ) throw (RuntimeException)
{
SolarMutexGuard aGuard;
- TableControl* pTable = (TableControl*)GetWindow();
- if ( pTable )
- {
- pTable->SetModel(PTableModel(m_pTableModel));
- pTable->Show( bVisible );
- }
+ m_pTableModel->notifyRowsInserted( i_event );
}
-void SAL_CALL SVTXGridControl::setFocus() throw(::com::sun::star::uno::RuntimeException)
+
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL//----------------------------------------------------------------------------------------------------------------------
+ SVTXGridControl::rowsRemoved( const GridDataEvent& i_event ) throw (RuntimeException)
{
SolarMutexGuard aGuard;
- if ( GetWindow())
- GetWindow()->GrabFocus();
+ m_pTableModel->notifyRowsRemoved( i_event );
}
-void SAL_CALL SVTXGridControl::rowAdded(const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException)
+
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::dataChanged( const GridDataEvent& i_event ) throw (RuntimeException)
{
SolarMutexGuard aGuard;
- std::vector< Any > newRow;
- Sequence< Any > rawRowData = Event.rowData;
- int colCount = m_xColumnModel->getColumnCount();
- if(colCount == 0)
- {
- Reference<XGridColumnListener> listener(*this,UNO_QUERY_THROW);
- m_xColumnModel->setDefaultColumns(rawRowData.getLength());
- for ( ::svt::table::ColPos col = 0; col < rawRowData.getLength(); ++col )
- {
- UnoControlTableColumn* tableColumn = new UnoControlTableColumn();
- m_pTableModel->getColumnModel().push_back((PColumnModel)tableColumn);
- m_xColumnModel->getColumn(col)->addColumnListener(listener);
- }
+ m_pTableModel->notifyDataChanged( i_event );
- }
- else if((unsigned int)rawRowData.getLength()!=(unsigned)colCount)
- throw GridInvalidDataException(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The column count doesn't match with the length of row data" )), m_xDataModel);
-
- for ( int k = 0; k < rawRowData.getLength(); k++)
- newRow.push_back(rawRowData[k]);
- m_pTableModel->getCellContent().push_back(newRow);
- if(m_pTableModel->hasRowHeaders())
- m_pTableModel->getRowHeaderName().push_back(Event.headerName);
- m_pTableModel->setRowCount(m_pTableModel->getCellContent().size());
- TableControl* pTable = (TableControl*)GetWindow();
- pTable->InvalidateDataWindow(m_pTableModel->getCellContent().size()-1, 0, false);
- if(pTable->isAccessibleAlive())
- {
- pTable->commitGridControlEvent(TABLE_MODEL_CHANGED,
- makeAny( AccessibleTableModelChange(INSERT, m_pTableModel->getRowCount()-1, m_pTableModel->getRowCount(), 0, m_pTableModel->getColumnCount())),
- Any());
- pTable->commitGridControlEvent(CHILD,
- makeAny( pTable->m_pAccessTable->m_pAccessible->getTableHeader(TCTYPE_ROWHEADERBAR)),
- Any());
- for (sal_Int32 i = 0 ; i <= m_pTableModel->getColumnCount() ; ++i)
- {
- pTable->commitGridControlEvent(
- CHILD,
- makeAny( pTable->m_pAccessTable->m_pAccessible->getTable() ),
- Any());
- }
- }
+ // if the data model is sortable, a dataChanged event is also fired in case the sort order changed.
+ // So, just in case, invalidate the column header area, too.
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::dataChanged: no control (anymore)!" );
+ pTable->getTableControlInterface().invalidate( TableAreaColumnHeaders );
}
-void SAL_CALL SVTXGridControl::rowRemoved(const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::rowHeadingChanged( const GridDataEvent& i_event ) throw (RuntimeException)
{
SolarMutexGuard aGuard;
+ OSL_UNUSED( i_event );
- TableControl* pTable = (TableControl*)GetWindow();
- if(Event.index == -1)
- {
- if(!isSelectionEmpty())
- deselectAllRows();
- if(m_pTableModel->hasRowHeaders())
- m_pTableModel->getRowHeaderName().clear();
- pTable->clearSelection();
- m_pTableModel->getCellContent().clear();
- if(pTable->isAccessibleAlive())
- {
- pTable->commitGridControlEvent(TABLE_MODEL_CHANGED,
- makeAny( AccessibleTableModelChange(DELETE, 0, m_pTableModel->getColumnCount(), 0, m_pTableModel->getColumnCount())),
- Any());
- }
- }
- else if(Event.index >= 0 && Event.index < m_pTableModel->getRowCount())
- {
- if(isSelectedIndex(Event.index))
- {
- Sequence<sal_Int32> selected(1);
- selected[0]=Event.index;
- deselectRows(selected);
- }
- if(m_pTableModel->hasRowHeaders())
- m_pTableModel->getRowHeaderName().erase(m_pTableModel->getRowHeaderName().begin()+Event.index);
- std::vector<std::vector<Any> >::iterator rowPos =m_pTableModel->getCellContent().begin() + Event.index;
- m_pTableModel->getCellContent().erase( rowPos );
- }
- m_pTableModel->setRowCount(m_pTableModel->getCellContent().size());
- pTable->InvalidateDataWindow(Event.index, Event.index, true);
- if(pTable->isAccessibleAlive())
- {
- pTable->commitGridControlEvent(TABLE_MODEL_CHANGED,
- makeAny( AccessibleTableModelChange(DELETE, Event.index, Event.index+1, 0, m_pTableModel->getColumnCount())),
- Any());
- }
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::rowHeadingChanged: no control (anymore)!" );
+
+ // TODO: we could do better than this - invalidate the header area only
+ pTable->getTableControlInterface().invalidate( TableAreaRowHeaders );
}
-void SAL_CALL SVTXGridControl::columnChanged(const ::com::sun::star::awt::grid::GridColumnEvent& Event ) throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::elementInserted( const ContainerEvent& i_event ) throw (RuntimeException)
{
SolarMutexGuard aGuard;
- TableControl* pTable = (TableControl*)GetWindow();
- if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ColumnResize" )))
- {
- bool resizable = m_pTableModel->getColumnModel()[Event.index]->isResizable();
- Event.newValue>>=resizable;
- m_pTableModel->getColumnModel()[Event.index]->setResizable(resizable);
- }
- else if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ColWidth" )))
- {
- sal_Int32 colWidth = m_pTableModel->getColumnModel()[Event.index]->getWidth();
- Event.newValue>>=colWidth;
- m_pTableModel->getColumnModel()[Event.index]->setWidth(colWidth);
- }
- else if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxWidth" )))
- {
- sal_Int32 maxWidth = m_pTableModel->getColumnModel()[Event.index]->getMaxWidth();
- Event.newValue>>=maxWidth;
- m_pTableModel->getColumnModel()[Event.index]->setMaxWidth(maxWidth);
- }
- else if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MinWidth" )))
- {
- sal_Int32 minWidth = m_pTableModel->getColumnModel()[Event.index]->getMinWidth();
- Event.newValue>>=minWidth;
- m_pTableModel->getColumnModel()[Event.index]->setMinWidth(minWidth);
- }
- else if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrefWidth" )))
- {
- sal_Int32 prefWidth = m_pTableModel->getColumnModel()[Event.index]->getPreferredWidth();
- Event.newValue>>=prefWidth;
- m_pTableModel->getColumnModel()[Event.index]->setPreferredWidth(prefWidth);
- }
- else if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HAlign" )))
- {
- ::com::sun::star::style::HorizontalAlignment hAlign = m_pTableModel->getColumnModel()[Event.index]->getHorizontalAlign();
- Event.newValue>>=hAlign;
- m_pTableModel->getColumnModel()[Event.index]->setHorizontalAlign(hAlign);
- }
- else if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UpdateWidth" )))
- {
- if(m_pTableModel->getColumnModel()[Event.index]->getPreferredWidth() != 0)
- m_xColumnModel->getColumn(Event.index)->updateColumn(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrefWidth" )), m_pTableModel->getColumnModel()[Event.index]->getPreferredWidth());
- m_xColumnModel->getColumn(Event.index)->updateColumn(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ColWidth" )), m_pTableModel->getColumnModel()[Event.index]->getWidth());
- }
- pTable->Invalidate();
+ Reference< XGridColumn > const xGridColumn( i_event.Element, UNO_QUERY_THROW );
+
+ sal_Int32 nIndex( m_pTableModel->getColumnCount() );
+ OSL_VERIFY( i_event.Accessor >>= nIndex );
+ m_pTableModel->insertColumn( nIndex, xGridColumn );
}
-void SAL_CALL SVTXGridControl::dataChanged(const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException)
+
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::elementRemoved( const ContainerEvent& i_event ) throw (RuntimeException)
{
SolarMutexGuard aGuard;
- TableControl* pTable = (TableControl*)GetWindow();
- if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RowHeight" )))
- {
- sal_Int32 rowHeight = m_pTableModel->getRowHeight();
- Event.newValue>>=rowHeight;
- m_pTableModel->setRowHeight(rowHeight);
- pTable->Invalidate();
- }
- else if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RowHeaderWidth" )))
- {
- sal_Int32 rowHeaderWidth = m_pTableModel->getRowHeaderWidth();
- Event.newValue>>=rowHeaderWidth;
- m_pTableModel->setRowHeaderWidth(rowHeaderWidth);
- pTable->Invalidate();
- }
- else if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RowHeaders" )))
- {
- Sequence< rtl::OUString > headers(0);
- Event.newValue>>=headers;
- std::vector< rtl::OUString > headerNames( comphelper::sequenceToContainer <std::vector< rtl::OUString > >(headers) );
- m_pTableModel->setRowHeaderName(headerNames);
- pTable->Invalidate();
- }
- else if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CellUpdated" )))
- {
- std::vector< std::vector< Any > >& rowContent = m_pTableModel->getCellContent();
- sal_Int32 col(0);
- Event.oldValue>>=col;
- rowContent[Event.index][col] = Event.newValue;
- pTable->InvalidateDataWindow(Event.index, Event.index, false);
- }
- else if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RowUpdated" )))
- {
- std::vector<std::vector< Any > >& rowContent = m_pTableModel->getCellContent();
- Sequence< sal_Int32 > cols(0);
- Sequence< Any > values(0);
- Event.oldValue>>=cols;
- Event.newValue>>=values;
- for(int i = 0; i< cols.getLength(); i++)
- {
- if(cols[i]>=0 && cols[i]<m_pTableModel->getColumnCount())
- rowContent[Event.index][cols[i]]=values[i];
- else
- break;
- }
- pTable->InvalidateDataWindow(Event.index, Event.index, false);
- }
+ sal_Int32 nIndex( -1 );
+ OSL_VERIFY( i_event.Accessor >>= nIndex );
+ m_pTableModel->removeColumn( nIndex );
}
-void SAL_CALL SVTXGridControl::disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::elementReplaced( const ContainerEvent& i_event ) throw (RuntimeException)
{
- VCLXWindow::disposing( Source );
+ OSL_ENSURE( false, "SVTXGridControl::elementReplaced: not implemented!" );
+ // at the moment, the XGridColumnModel API does not allow replacing columns
+ OSL_UNUSED( i_event );
+ // TODO: replace the respective column in our table model
}
-::sal_Int32 SAL_CALL SVTXGridControl::getMinSelectionIndex() throw (::com::sun::star::uno::RuntimeException)
-{
- TableControl* pTable = (TableControl*)GetWindow();
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- if(selectedRows.empty())
- return -1;
- else
- {
- std::vector<RowPos>::iterator itStart = selectedRows.begin();
- std::vector<RowPos>::iterator itEnd = selectedRows.end();
- return *(std::min_element(itStart, itEnd));
- }
-}
-::sal_Int32 SAL_CALL SVTXGridControl::getMaxSelectionIndex() throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- if(selectedRows.empty())
- return -1;
- else
- {
- std::vector<RowPos>::iterator itStart = selectedRows.begin();
- std::vector<RowPos>::iterator itEnd = selectedRows.end();
- return *(std::max_element(itStart, itEnd));
- }
+ VCLXWindow::disposing( Source );
}
-void SAL_CALL SVTXGridControl::selectRows(const ::com::sun::star::uno::Sequence< ::sal_Int32 >& rangeOfRows) throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::selectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- SelectionMode eSelMode = pTable->getSelEngine()->GetSelectionMode();
- if(eSelMode != NO_SELECTION)
- {
- sal_Int32 start = rangeOfRows[0];
- int seqSize = rangeOfRows.getLength();
- sal_Int32 end = rangeOfRows[seqSize-1];
- if((start >= 0 && start < m_pTableModel->getRowCount()) && (end >= 0 && end < m_pTableModel->getRowCount()))
- {
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- if(eSelMode == SINGLE_SELECTION)
- {
- if(!selectedRows.empty())
- selectedRows.clear();
- if(rangeOfRows.getLength() == 1)
- selectedRows.push_back(start);
- else
- return;
- }
- else
- {
- for(int i=0;i<seqSize;i++)
- {
- if(!isSelectedIndex(rangeOfRows[i]))
- selectedRows.push_back(rangeOfRows[i]);
- }
- }
- pTable->selectionChanged(true);
- pTable->InvalidateDataWindow(start, end, false);
- SetSynthesizingVCLEvent( sal_True );
- pTable->Select();
- SetSynthesizingVCLEvent( sal_False );
- }
- }
+ SolarMutexGuard aGuard;
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::selectRow: no control (anymore)!" );
+
+ pTable->SelectRow( i_rowIndex, true );
}
+//----------------------------------------------------------------------------------------------------------------------
void SAL_CALL SVTXGridControl::selectAllRows() throw (::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- SelectionMode eSelMode = pTable->getSelEngine()->GetSelectionMode();
- if(eSelMode != NO_SELECTION)
- {
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- if(!selectedRows.empty())
- selectedRows.clear();
- for(int i=0;i<m_pTableModel->getRowCount();i++)
- selectedRows.push_back(i);
- pTable->Invalidate();
- SetSynthesizingVCLEvent( sal_True );
- pTable->Select();
- SetSynthesizingVCLEvent( sal_False );
- }
+ SolarMutexGuard aGuard;
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::selectAllRows: no control (anymore)!" );
+
+ pTable->SelectAllRows( true );
}
-void SAL_CALL SVTXGridControl::deselectRows(const ::com::sun::star::uno::Sequence< ::sal_Int32 >& rangeOfRows) throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::deselectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- std::vector<RowPos>::iterator itStart = selectedRows.begin();
- std::vector<RowPos>::iterator itEnd = selectedRows.end();
- for(int i = 0; i < rangeOfRows.getLength(); i++ )
- {
- std::vector<RowPos>::iterator iter = std::find(itStart, itEnd, rangeOfRows[i]);
- selectedRows.erase(iter);
- }
- pTable->selectionChanged(true);
- pTable->Invalidate();
- SetSynthesizingVCLEvent( sal_True );
- pTable->Select();
- SetSynthesizingVCLEvent( sal_False );
+ SolarMutexGuard aGuard;
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::deselectRow: no control (anymore)!" );
+
+ pTable->SelectRow( i_rowIndex, false );
}
+//----------------------------------------------------------------------------------------------------------------------
void SAL_CALL SVTXGridControl::deselectAllRows() throw (::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- if(!selectedRows.empty())
- selectedRows.clear();
- pTable->Invalidate();
- SetSynthesizingVCLEvent( sal_True );
- pTable->Select();
- SetSynthesizingVCLEvent( sal_False );
+ SolarMutexGuard aGuard;
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::deselectAllRows: no control (anymore)!" );
+
+ pTable->SelectAllRows( false );
}
+//----------------------------------------------------------------------------------------------------------------------
::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL SVTXGridControl::getSelection() throw (::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- Sequence<sal_Int32> selectedRowsToSequence(comphelper::containerToSequence(selectedRows));
- return selectedRowsToSequence;
-}
+ SolarMutexGuard aGuard;
-::sal_Bool SAL_CALL SVTXGridControl::isCellEditable() throw (::com::sun::star::uno::RuntimeException)
-{
- return sal_False;
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable, "SVTXGridControl::getSelection: no control (anymore)!", Sequence< sal_Int32 >() );
+
+ sal_Int32 selectionCount = pTable->GetSelectedRowCount();
+ Sequence< sal_Int32 > selectedRows( selectionCount );
+ for ( sal_Int32 i=0; i<selectionCount; ++i )
+ selectedRows[i] = pTable->GetSelectedRowIndex(i);
+ return selectedRows;
}
+//----------------------------------------------------------------------------------------------------------------------
::sal_Bool SAL_CALL SVTXGridControl::isSelectionEmpty() throw (::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- if(selectedRows.empty())
- return sal_True;
- else
- return sal_False;
-}
+ SolarMutexGuard aGuard;
-::sal_Bool SAL_CALL SVTXGridControl::isSelectedIndex(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException)
-{
- TableControl* pTable = (TableControl*)GetWindow();
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- return std::find(selectedRows.begin(),selectedRows.end(), index) != selectedRows.end();
-}
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable, "SVTXGridControl::getSelection: no control (anymore)!", sal_True );
-void SAL_CALL SVTXGridControl::selectRow(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException)
-{
- if(index<0 || index>=m_pTableModel->getRowCount())
- return;
- TableControl* pTable = (TableControl*)GetWindow();
- SelectionMode eSelMode = pTable->getSelEngine()->GetSelectionMode();
- if(eSelMode != NO_SELECTION)
- {
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- if(eSelMode == MULTIPLE_SELECTION)
- {
- if(!isSelectedIndex(index))
- selectedRows.push_back(index);
- else
- return;
- }
- else if(eSelMode == SINGLE_SELECTION)
- {
- if(!selectedRows.empty())
- {
- if(!isSelectedIndex(index))
- deselectRows(getSelection());
- else
- return;
- }
- selectedRows.push_back(index);
- }
- pTable->selectionChanged(true);
- pTable->InvalidateDataWindow(index, index, false);
- SetSynthesizingVCLEvent( sal_True );
- pTable->Select();
- SetSynthesizingVCLEvent( sal_False );
- }
+ return pTable->GetSelectedRowCount() > 0;
}
-void SAL_CALL SVTXGridControl::selectColumn(::sal_Int32 x) throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+::sal_Bool SAL_CALL SVTXGridControl::isSelectedIndex( ::sal_Int32 index ) throw (::com::sun::star::uno::RuntimeException)
{
- (void)x;
+ SolarMutexGuard aGuard;
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable, "SVTXGridControl::isSelectedIndex: no control (anymore)!", sal_False );
+
+ return pTable->IsRowSelected( index );
}
+
+//----------------------------------------------------------------------------------------------------------------------
void SVTXGridControl::dispose() throw(::com::sun::star::uno::RuntimeException)
{
- SolarMutexGuard aGuard;
-
::com::sun::star::lang::EventObject aObj;
aObj.Source = (::cppu::OWeakObject*)this;
m_aSelectionListeners.disposeAndClear( aObj );
VCLXWindow::dispose();
}
+//----------------------------------------------------------------------------------------------------------------------
void SVTXGridControl::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
{
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xKeepAlive( this );
+ SolarMutexGuard aGuard;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xKeepAlive( this );
switch ( rVclWindowEvent.GetId() )
{
case VCLEVENT_TABLEROW_SELECT:
{
- TableControl* pTable = (TableControl*)GetWindow();
-
- if( pTable )
- {
- if ( m_aSelectionListeners.getLength() )
- {
- ImplCallItemListeners();
- }
- }
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_BREAK( pTable, "SVTXGridControl::ProcessWindowEvent: no control (anymore)!" );
+ if ( m_aSelectionListeners.getLength() )
+ ImplCallItemListeners();
}
break;
@@ -855,28 +706,30 @@ void SVTXGridControl::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent
}
}
+//----------------------------------------------------------------------------------------------------------------------
void SVTXGridControl::ImplCallItemListeners()
{
- TableControl* pTable = (TableControl*) GetWindow();
- if ( pTable && m_aSelectionListeners.getLength() )
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::ImplCallItemListeners: no control (anymore)!" );
+
+ if ( m_aSelectionListeners.getLength() )
{
- ::std::vector<sal_Int32> selRows = pTable->GetSelectedRows();
+ sal_Int32 const actSelRowCount = pTable->GetSelectedRowCount();
::com::sun::star::awt::grid::GridSelectionEvent aEvent;
aEvent.Source = (::cppu::OWeakObject*)this;
aEvent.Column = 0;
- sal_Int32 actSelRowCount = selRows.size();
sal_Int32 diff = actSelRowCount - m_nSelectedRowCount;
//row added to selection
if(diff >= 1)
{
aEvent.Action = com::sun::star::awt::grid::SelectionEventType(0);
- aEvent.Row = selRows[actSelRowCount-1];
+ aEvent.Row = pTable->GetSelectedRowIndex( actSelRowCount - 1 );
aEvent.Range = diff;
}
//selected row changed
else if(diff == 0 && actSelRowCount != 0)
{
- aEvent.Row = selRows[actSelRowCount-1];
+ aEvent.Row = pTable->GetSelectedRowIndex( actSelRowCount - 1 );
aEvent.Action = com::sun::star::awt::grid::SelectionEventType(2);
aEvent.Range = 0;
}
@@ -885,7 +738,7 @@ void SVTXGridControl::ImplCallItemListeners()
//selection changed: multiple row deselected, only 1 row is selected
if(actSelRowCount == 1)
{
- aEvent.Row = selRows[actSelRowCount-1];
+ aEvent.Row = pTable->GetSelectedRowIndex( actSelRowCount - 1 );
aEvent.Action = com::sun::star::awt::grid::SelectionEventType(2);
}
//row is deselected
@@ -901,4 +754,31 @@ void SVTXGridControl::ImplCallItemListeners()
}
}
+//----------------------------------------------------------------------------------------------------------------------
+void SVTXGridControl::impl_updateColumnsFromModel_nothrow()
+{
+ Reference< XGridColumnModel > const xColumnModel( m_pTableModel->getColumnModel() );
+ ENSURE_OR_RETURN_VOID( xColumnModel.is(), "no model!" );
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable != NULL, "no table!" );
+
+ try
+ {
+ const Sequence< Reference< XGridColumn > > columns = xColumnModel->getColumns();
+ for ( const Reference< XGridColumn >* colRef = columns.getConstArray();
+ colRef != columns.getConstArray() + columns.getLength();
+ ++colRef
+ )
+ {
+ ENSURE_OR_CONTINUE( colRef->is(), "illegal column!" );
+
+ m_pTableModel->appendColumn( *colRef );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/uno/svtxgridcontrol.hxx b/svtools/source/uno/svtxgridcontrol.hxx
index ef94979d79eb..6e4eb807667e 100644
--- a/svtools/source/uno/svtxgridcontrol.hxx
+++ b/svtools/source/uno/svtxgridcontrol.hxx
@@ -33,88 +33,90 @@
#include <svtools/table/tablecontrol.hxx>
#include <com/sun/star/awt/grid/XGridControl.hpp>
#include <com/sun/star/awt/grid/XGridDataListener.hpp>
-#include <com/sun/star/awt/grid/XGridColumnListener.hpp>
#include <com/sun/star/awt/grid/GridDataEvent.hpp>
#include <com/sun/star/awt/grid/GridColumnEvent.hpp>
#include <com/sun/star/awt/grid/XGridColumnModel.hpp>
#include <com/sun/star/awt/grid/XGridDataModel.hpp>
#include <com/sun/star/awt/grid/XGridSelectionListener.hpp>
+#include <com/sun/star/container/XContainerListener.hpp>
#include <toolkit/awt/vclxwindow.hxx>
#include <toolkit/awt/vclxwindows.hxx>
#include <cppuhelper/typeprovider.hxx>
-#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/implbase4.hxx>
#include <toolkit/helper/listenermultiplexer.hxx>
using namespace ::svt::table;
-class SVTXGridControl : public ::cppu::ImplInheritanceHelper3< VCLXWindow, ::com::sun::star::awt::grid::XGridControl,
- ::com::sun::star::awt::grid::XGridDataListener, ::com::sun::star::awt::grid::XGridColumnListener>
+typedef ::cppu::ImplInheritanceHelper3 < VCLXWindow
+ , ::com::sun::star::awt::grid::XGridControl
+ , ::com::sun::star::awt::grid::XGridDataListener
+ , ::com::sun::star::container::XContainerListener
+ > SVTXGridControl_Base;
+class SVTXGridControl : public SVTXGridControl_Base
{
private:
- ::boost::shared_ptr< UnoControlTableModel > m_pTableModel;
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataModel >m_xDataModel;
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnModel >m_xColumnModel;
- bool m_bHasColumnHeaders;
- bool m_bHasRowHeaders;
- bool m_bVScroll;
- bool m_bHScroll;
- bool m_bUpdate;
- sal_Int32 m_nSelectedRowCount;
- SelectionListenerMultiplexer m_aSelectionListeners;
+ ::boost::shared_ptr< UnoControlTableModel > m_pTableModel;
+ bool m_bHasColumnHeaders;
+ bool m_bHasRowHeaders;
+ bool m_bTableModelInitCompleted;
+ sal_Int32 m_nSelectedRowCount;
+ SelectionListenerMultiplexer m_aSelectionListeners;
protected:
virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
void ImplCallItemListeners();
public:
- SVTXGridControl();
+ SVTXGridControl();
~SVTXGridControl();
- //XGridDataListener overridables
- virtual void SAL_CALL rowAdded(const ::com::sun::star::awt::grid::GridDataEvent& Event) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL rowRemoved(const ::com::sun::star::awt::grid::GridDataEvent & Event) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL dataChanged(const ::com::sun::star::awt::grid::GridDataEvent & Event) throw (::com::sun::star::uno::RuntimeException);
- //XGridColumnListener overridables
- virtual void SAL_CALL columnChanged(const ::com::sun::star::awt::grid::GridColumnEvent & Event) throw (::com::sun::star::uno::RuntimeException);
+ // XGridDataListener
+ virtual void SAL_CALL rowsInserted( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL rowsRemoved( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dataChanged( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL rowHeadingChanged( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
-
- ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL acquire() throw() { VCLXWindow::acquire(); }
- void SAL_CALL release() throw() { VCLXWindow::release(); }
+ // XContainerListener
+ virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
- // ::com::sun::star::lang::XTypeProvider
- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
- //::com::sun::star::awt::grid::XGridControl
- virtual ::sal_Int32 SAL_CALL getMinSelectionIndex() throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL getMaxSelectionIndex() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL selectRows(const ::com::sun::star::uno::Sequence< ::sal_Int32 >& rangeOfRows) throw (::com::sun::star::uno::RuntimeException);
+ // XGridSelection
+ virtual void SAL_CALL selectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL selectAllRows() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deselectRows(const ::com::sun::star::uno::Sequence< ::sal_Int32 >& rangeOfRows) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL deselectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL deselectAllRows() throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL getSelection() throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Bool SAL_CALL isCellEditable() throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL isSelectionEmpty() throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL isSelectedIndex(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL selectRow(::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL selectColumn(::sal_Int32 x) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL addSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removeSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL getItemIndexAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setToolTip(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& text, const ::com::sun::star::uno::Sequence< sal_Int32 >& columns) throw (::com::sun::star::uno::RuntimeException);
+
+ // XGridControl
+ virtual ::sal_Int32 SAL_CALL getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getColumnAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getCurrentColumn( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getCurrentRow( ) throw (::com::sun::star::uno::RuntimeException);
void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
- void SAL_CALL setVisible(sal_Bool bVisible) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setFocus() throw(::com::sun::star::uno::RuntimeException);
// ::com::sun::star::lang::XComponent
void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
- };
- #endif // _SVT_GRIDCONTROL_HXX_
+
+protected:
+ // VCLXWindow
+ virtual void SetWindow( Window* pWindow );
+
+private:
+ void impl_updateColumnsFromModel_nothrow();
+ void impl_checkTableModelInit();
+};
+#endif // _SVT_GRIDCONTROL_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx
index b6575c475b12..110a9d3f4ce5 100644
--- a/svtools/source/uno/toolboxcontroller.cxx
+++ b/svtools/source/uno/toolboxcontroller.cxx
@@ -36,9 +36,8 @@
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
-#include <imgdef.hxx>
+#include <svtools/imgdef.hxx>
#include <svtools/miscopt.hxx>
-
#include <toolkit/unohlp.hxx>
#include <vcl/toolbox.hxx>
//shizhobo
@@ -789,7 +788,7 @@ sal_Bool SAL_CALL ToolboxController::convertFastPropertyValue( com::sun::star::u
{
case TOOLBARCONTROLLER_PROPHANDLE_SUPPORTSVISIABLE:
{
- sal_Bool aNewValue;
+ sal_Bool aNewValue(sal_False);
aValue >>= aNewValue;
if (aNewValue != m_bSupportVisiable)
{
@@ -832,7 +831,7 @@ void ToolboxController::enable( bool bEnable )
sal_uInt16 nItemId = 0;
if( getToolboxId( nItemId, &pToolBox ) )
{
- pToolBox->EnableItem( nItemId, bEnable ? TRUE : FALSE );
+ pToolBox->EnableItem( nItemId, bEnable ? sal_True : sal_False );
}
}
diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx
index a4d63c4aa144..e3cf909ea31c 100644
--- a/svtools/source/uno/treecontrolpeer.cxx
+++ b/svtools/source/uno/treecontrolpeer.cxx
@@ -83,7 +83,7 @@ public:
class ImplGraphicItem : public SvLBoxBmp
{
public:
- ImplGraphicItem( SvLBoxEntry* pEntry, USHORT nFlags, Image& aImage ) : SvLBoxBmp( pEntry, nFlags, aImage ) {}
+ ImplGraphicItem( SvLBoxEntry* pEntry, sal_uInt16 nFlags, Image& aImage ) : SvLBoxBmp( pEntry, nFlags, aImage ) {}
OUString msGraphicURL;
};
@@ -93,7 +93,7 @@ public:
class ImplContextGraphicItem : public SvLBoxContextBmp
{
public:
- ImplContextGraphicItem( SvLBoxEntry* pEntry,USHORT nFlags,Image& rI1,Image& rI2, USHORT nEntryFlagsBmp1)
+ ImplContextGraphicItem( SvLBoxEntry* pEntry,sal_uInt16 nFlags,Image& rI1,Image& rI2, sal_uInt16 nEntryFlagsBmp1)
: SvLBoxContextBmp( pEntry, nFlags, rI1, rI2, nEntryFlagsBmp1 ) {}
OUString msExpandedGraphicURL;
@@ -108,12 +108,12 @@ public:
UnoTreeListBoxImpl( TreeControlPeer* pPeer, Window* pParent, WinBits nWinStyle );
~UnoTreeListBoxImpl();
- sal_uInt32 insert( SvLBoxEntry* pEntry,SvLBoxEntry* pParent,ULONG nPos=LIST_APPEND );
+ sal_uInt32 insert( SvLBoxEntry* pEntry,SvLBoxEntry* pParent,sal_uLong nPos=LIST_APPEND );
virtual void RequestingChilds( SvLBoxEntry* pParent );
- virtual BOOL EditingEntry( SvLBoxEntry* pEntry, Selection& );
- virtual BOOL EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText );
+ virtual sal_Bool EditingEntry( SvLBoxEntry* pEntry, Selection& );
+ virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText );
DECL_LINK( OnSelectionChangeHdl, UnoTreeListBoxImpl* );
DECL_LINK( OnExpandingHdl, UnoTreeListBoxImpl* );
@@ -131,7 +131,7 @@ public:
UnoTreeListItem( SvLBoxEntry* );
UnoTreeListItem();
virtual ~UnoTreeListItem();
- virtual USHORT IsA();
+ virtual sal_uInt16 IsA();
void InitViewData( SvLBox*,SvLBoxEntry*,SvViewDataItem* );
OUString GetText() const;
void SetText( const OUString& rText );
@@ -139,7 +139,7 @@ public:
void SetImage( const Image& rImage );
OUString GetGraphicURL() const;
void SetGraphicURL( const OUString& rGraphicURL );
- void Paint( const Point&, SvLBox& rDev, USHORT nFlags,SvLBoxEntry* );
+ void Paint( const Point&, SvLBox& rDev, sal_uInt16 nFlags,SvLBoxEntry* );
SvLBoxItem* Create() const;
void Clone( SvLBoxItem* pSource );
@@ -261,7 +261,7 @@ void TreeControlPeer::SetWindow( Window* pWindow )
// --------------------------------------------------------------------
-UnoTreeListEntry* TreeControlPeer::createEntry( const Reference< XTreeNode >& xNode, UnoTreeListEntry* pParent, ULONG nPos /* = LIST_APPEND */ )
+UnoTreeListEntry* TreeControlPeer::createEntry( const Reference< XTreeNode >& xNode, UnoTreeListEntry* pParent, sal_uLong nPos /* = LIST_APPEND */ )
{
UnoTreeListEntry* pEntry = 0;
if( mpTreeImpl )
@@ -328,9 +328,9 @@ bool TreeControlPeer::updateEntry( UnoTreeListEntry* pEntry )
}
}
- if( (pEntry->mxNode->hasChildrenOnDemand() == sal_True) != (pEntry->HasChildsOnDemand() == TRUE) )
+ if( (pEntry->mxNode->hasChildrenOnDemand() == sal_True) != (pEntry->HasChildsOnDemand() == sal_True) )
{
- pEntry->EnableChildsOnDemand( pEntry->mxNode->hasChildrenOnDemand() ? TRUE : FALSE );
+ pEntry->EnableChildsOnDemand( pEntry->mxNode->hasChildrenOnDemand() ? sal_True : sal_False );
bChanged = true;
}
@@ -532,14 +532,14 @@ void TreeControlPeer::ChangeNodesSelection( const Any& rSelection, bool bSelect,
}
if( bSetSelection )
- rTree.SelectAll( FALSE );
+ rTree.SelectAll( sal_False );
if( pNodes && nCount )
{
while( nCount-- )
{
UnoTreeListEntry* pEntry = getEntry( *pNodes++ );
- rTree.Select( pEntry, bSelect ? TRUE : FALSE );
+ rTree.Select( pEntry, bSelect ? sal_True : sal_False );
}
}
}
@@ -565,7 +565,7 @@ Any SAL_CALL TreeControlPeer::getSelection() throw (RuntimeException)
Any aRet;
- ULONG nSelectionCount = rTree.GetSelectionCount();
+ sal_uLong nSelectionCount = rTree.GetSelectionCount();
if( nSelectionCount == 1 )
{
UnoTreeListEntry* pEntry = dynamic_cast< UnoTreeListEntry* >( rTree.FirstSelected() );
@@ -627,7 +627,7 @@ void SAL_CALL TreeControlPeer::removeSelection( const Any& rSelection ) throw (I
void SAL_CALL TreeControlPeer::clearSelection() throw (RuntimeException)
{
SolarMutexGuard aGuard;
- getTreeListBoxOrThrow().SelectAll( FALSE );
+ getTreeListBoxOrThrow().SelectAll( sal_False );
}
// -------------------------------------------------------------------
@@ -893,7 +893,7 @@ Reference< XTreeNode > SAL_CALL TreeControlPeer::getNodeForLocation( sal_Int32 x
Reference< XTreeNode > xNode;
const Point aPos( x, y );
- UnoTreeListEntry* pEntry = dynamic_cast< UnoTreeListEntry* >( rTree.GetEntry( aPos, TRUE ) );
+ UnoTreeListEntry* pEntry = dynamic_cast< UnoTreeListEntry* >( rTree.GetEntry( aPos, sal_True ) );
if( pEntry )
xNode = pEntry->mxNode;
@@ -911,7 +911,7 @@ Reference< XTreeNode > SAL_CALL TreeControlPeer::getClosestNodeForLocation( sal_
Reference< XTreeNode > xNode;
const Point aPos( x, y );
- UnoTreeListEntry* pEntry = dynamic_cast< UnoTreeListEntry* >( rTree.GetEntry( aPos, TRUE ) );
+ UnoTreeListEntry* pEntry = dynamic_cast< UnoTreeListEntry* >( rTree.GetEntry( aPos, sal_True ) );
if( pEntry )
xNode = pEntry->mxNode;
@@ -950,7 +950,7 @@ sal_Bool SAL_CALL TreeControlPeer::stopEditing() throw (RuntimeException)
UnoTreeListBoxImpl& rTree = getTreeListBoxOrThrow();
if( rTree.IsEditingActive() )
{
- rTree.EndEditing(FALSE);
+ rTree.EndEditing(sal_False);
return sal_True;
}
else
@@ -966,7 +966,7 @@ void SAL_CALL TreeControlPeer::cancelEditing( ) throw (RuntimeException)
SolarMutexGuard aGuard;
UnoTreeListBoxImpl& rTree = getTreeListBoxOrThrow();
- rTree.EndEditing(FALSE);
+ rTree.EndEditing(sal_False);
}
// -------------------------------------------------------------------
@@ -1106,7 +1106,7 @@ void TreeControlPeer::updateNode( UnoTreeListBoxImpl& rTree, const Reference< XT
{
Reference< XTreeNode > xParentNode( xNode->getParent() );
UnoTreeListEntry* pParentEntry = 0;
- ULONG nChild = LIST_APPEND;
+ sal_uLong nChild = LIST_APPEND;
if( xParentNode.is() )
{
@@ -1329,12 +1329,12 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An
sal_Bool bEnabled = sal_False;
if ( aValue >>= bEnabled )
{
- WinBits nStyle = rTree.GetWindowBits();
+ WinBits nStyle = rTree.GetStyle();
if ( bEnabled )
nStyle |= WB_HIDESELECTION;
else
nStyle &= ~WB_HIDESELECTION;
- rTree.SetWindowBits( nStyle );
+ rTree.SetStyle( nStyle );
}
}
break;
@@ -1362,7 +1362,7 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An
case BASEPROPERTY_TREE_DATAMODEL:
onChangeDataModel( rTree, Reference< XTreeDataModel >( aValue, UNO_QUERY ) );
break;
- case BASEPROPERTY_TREE_ROWHEIGHT:
+ case BASEPROPERTY_ROW_HEIGHT:
{
sal_Int32 nHeight = 0;
if( aValue >>= nHeight )
@@ -1373,7 +1373,7 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An
{
sal_Bool bEnabled = false;
if( aValue >>= bEnabled )
- rTree.EnableInplaceEditing( bEnabled ? TRUE : FALSE );
+ rTree.EnableInplaceEditing( bEnabled ? sal_True : sal_False );
break;
}
case BASEPROPERTY_TREE_INVOKESSTOPNODEEDITING:
@@ -1392,11 +1392,11 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An
sal_Bool bEnabled = false;
if( aValue >>= bEnabled )
{
- WinBits nBits = rTree.GetWindowBits() & (~WB_HASLINES);
+ WinBits nBits = rTree.GetStyle() & (~WB_HASLINES);
if( bEnabled )
nBits |= WB_HASLINES;
- if( nBits != rTree.GetWindowBits() )
- rTree.SetWindowBits( nBits );
+ if( nBits != rTree.GetStyle() )
+ rTree.SetStyle( nBits );
}
break;
}
@@ -1405,11 +1405,11 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An
sal_Bool bEnabled = false;
if( aValue >>= bEnabled )
{
- WinBits nBits = rTree.GetWindowBits() & (~WB_HASLINESATROOT);
+ WinBits nBits = rTree.GetStyle() & (~WB_HASLINESATROOT);
if( bEnabled )
nBits |= WB_HASLINESATROOT;
- if( nBits != rTree.GetWindowBits() )
- rTree.SetWindowBits( nBits );
+ if( nBits != rTree.GetStyle() )
+ rTree.SetStyle( nBits );
}
break;
}
@@ -1430,7 +1430,7 @@ Any TreeControlPeer::getProperty( const ::rtl::OUString& PropertyName ) throw(Ru
switch(nPropId)
{
case BASEPROPERTY_HIDEINACTIVESELECTION:
- return Any( ( rTree.GetWindowBits() & WB_HIDESELECTION ) != 0 ? sal_True : sal_False );
+ return Any( ( rTree.GetStyle() & WB_HIDESELECTION ) != 0 ? sal_True : sal_False );
case BASEPROPERTY_TREE_SELECTIONTYPE:
{
@@ -1447,7 +1447,7 @@ Any TreeControlPeer::getProperty( const ::rtl::OUString& PropertyName ) throw(Ru
}
return Any( eSelectionType );
}
- case BASEPROPERTY_TREE_ROWHEIGHT:
+ case BASEPROPERTY_ROW_HEIGHT:
return Any( (sal_Int32)rTree.GetEntryHeight() );
case BASEPROPERTY_TREE_DATAMODEL:
return Any( mxDataModel );
@@ -1458,9 +1458,9 @@ Any TreeControlPeer::getProperty( const ::rtl::OUString& PropertyName ) throw(Ru
case BASEPROPERTY_TREE_ROOTDISPLAYED:
return Any( mbIsRootDisplayed );
case BASEPROPERTY_TREE_SHOWSHANDLES:
- return Any( (rTree.GetWindowBits() & WB_HASLINES) != 0 ? sal_True : sal_False );
+ return Any( (rTree.GetStyle() & WB_HASLINES) != 0 ? sal_True : sal_False );
case BASEPROPERTY_TREE_SHOWSROOTHANDLES:
- return Any( (rTree.GetWindowBits() & WB_HASLINESATROOT) != 0 ? sal_True : sal_False );
+ return Any( (rTree.GetStyle() & WB_HASLINESATROOT) != 0 ? sal_True : sal_False );
}
}
return VCLXWindow::getProperty( PropertyName );
@@ -1529,7 +1529,7 @@ UnoTreeListBoxImpl::UnoTreeListBoxImpl( TreeControlPeer* pPeer, Window* pParent,
: SvTreeListBox( pParent, nWinStyle )
, mxPeer( pPeer )
{
- SetWindowBits( WB_BORDER | WB_HASLINES |WB_HASBUTTONS | WB_HASLINESATROOT | WB_HASBUTTONSATROOT | WB_HSCROLL );
+ SetStyle( WB_BORDER | WB_HASLINES |WB_HASBUTTONS | WB_HASLINESATROOT | WB_HASBUTTONSATROOT | WB_HSCROLL );
SetNodeDefaultImages();
SetSelectHdl( LINK(this, UnoTreeListBoxImpl, OnSelectionChangeHdl) );
SetDeselectHdl( LINK(this, UnoTreeListBoxImpl, OnSelectionChangeHdl) );
@@ -1583,7 +1583,7 @@ IMPL_LINK(UnoTreeListBoxImpl, OnExpandedHdl, UnoTreeListBoxImpl*, EMPTYARG )
// --------------------------------------------------------------------
-sal_uInt32 UnoTreeListBoxImpl::insert( SvLBoxEntry* pEntry,SvLBoxEntry* pParent,ULONG nPos )
+sal_uInt32 UnoTreeListBoxImpl::insert( SvLBoxEntry* pEntry,SvLBoxEntry* pParent,sal_uLong nPos )
{
if( pParent )
return SvTreeListBox::Insert( pEntry, pParent, nPos );
@@ -1602,14 +1602,14 @@ void UnoTreeListBoxImpl::RequestingChilds( SvLBoxEntry* pParent )
// --------------------------------------------------------------------
-BOOL UnoTreeListBoxImpl::EditingEntry( SvLBoxEntry* pEntry, Selection& )
+sal_Bool UnoTreeListBoxImpl::EditingEntry( SvLBoxEntry* pEntry, Selection& )
{
return mxPeer.is() ? mxPeer->onEditingEntry( dynamic_cast< UnoTreeListEntry* >( pEntry ) ) : false;
}
// --------------------------------------------------------------------
-BOOL UnoTreeListBoxImpl::EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText )
+sal_Bool UnoTreeListBoxImpl::EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText )
{
return mxPeer.is() ? mxPeer->onEditedEntry( dynamic_cast< UnoTreeListEntry* >( pEntry ), rNewText ) : false;
}
@@ -1638,14 +1638,14 @@ UnoTreeListItem::~UnoTreeListItem()
// --------------------------------------------------------------------
-USHORT UnoTreeListItem::IsA()
+sal_uInt16 UnoTreeListItem::IsA()
{
return 0;
}
// --------------------------------------------------------------------
-void UnoTreeListItem::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */, SvLBoxEntry* _pEntry)
+void UnoTreeListItem::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */, SvLBoxEntry* _pEntry)
{
Point aPos( rPos );
if( _pEntry )
diff --git a/svtools/source/uno/treecontrolpeer.hxx b/svtools/source/uno/treecontrolpeer.hxx
index 5e3a9a1668ef..4c13acde8648 100644
--- a/svtools/source/uno/treecontrolpeer.hxx
+++ b/svtools/source/uno/treecontrolpeer.hxx
@@ -129,7 +129,7 @@ private:
void fillTree( UnoTreeListBoxImpl& rTree, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tree::XTreeDataModel >& xDataModel );
void addNode( UnoTreeListBoxImpl& rTree, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tree::XTreeNode >& xNode, UnoTreeListEntry* pParentEntry );
- UnoTreeListEntry* createEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tree::XTreeNode >& xNode, UnoTreeListEntry* pParent, ULONG nPos = LIST_APPEND );
+ UnoTreeListEntry* createEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tree::XTreeNode >& xNode, UnoTreeListEntry* pParent, sal_uLong nPos = LIST_APPEND );
bool updateEntry( UnoTreeListEntry* pEntry );
void updateTree( const ::com::sun::star::awt::tree::TreeDataModelEvent& rEvent, bool bRecursive );
diff --git a/svtools/source/uno/unocontroltablemodel.cxx b/svtools/source/uno/unocontroltablemodel.cxx
index 26084690c137..73085561e542 100644
--- a/svtools/source/uno/unocontroltablemodel.cxx
+++ b/svtools/source/uno/unocontroltablemodel.cxx
@@ -29,487 +29,867 @@
#include "precompiled_svtools.hxx"
#include "unocontroltablemodel.hxx"
-#include <com/sun/star/view/SelectionType.hpp>
-#include "svtools/table/gridtablerenderer.hxx"
+#include "unogridcolumnfacade.hxx"
+
#include "svtools/table/defaultinputhandler.hxx"
+#include "svtools/table/gridtablerenderer.hxx"
#include "svtools/table/tablecontrol.hxx"
-#include <comphelper/sequence.hxx>
-#include <rtl/ref.hxx>
-#include <tools/debug.hxx>
-#include <toolkit/helper/property.hxx>
-#include <comphelper/processfactory.hxx>
+
+/** === begin UNO includes === **/
#include <com/sun/star/awt/grid/XGridColumn.hpp>
+#include <com/sun/star/view/SelectionType.hpp>
+#include <com/sun/star/awt/grid/XGridColumnListener.hpp>
+#include <com/sun/star/awt/grid/XSortableGridData.hpp>
+/** === end UNO includes === **/
-using ::rtl::OUString;
-using namespace ::svt::table;
-using namespace ::com::sun::star::uno;
+#include <comphelper/stlunosequence.hxx>
+#include <cppuhelper/weakref.hxx>
+#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
+#include <vcl/svapp.hxx>
+#include <osl/mutex.hxx>
+
+// .....................................................................................................................
+namespace svt { namespace table
+{
+// .....................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::awt::grid::XGridColumn;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::awt::grid::XGridColumnListener;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::awt::grid::GridColumnEvent;
+ using ::com::sun::star::awt::grid::XGridDataModel;
+ using ::com::sun::star::awt::grid::XGridColumnModel;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::style::HorizontalAlignment_LEFT;
+ using ::com::sun::star::style::HorizontalAlignment;
+ using ::com::sun::star::style::VerticalAlignment_TOP;
+ using ::com::sun::star::style::VerticalAlignment;
+ using ::com::sun::star::uno::WeakReference;
+ using ::com::sun::star::awt::grid::GridDataEvent;
+ using ::com::sun::star::awt::grid::XSortableGridData;
+ using ::com::sun::star::beans::Pair;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= UnoControlTableModel_Impl
+ //==================================================================================================================
+ typedef ::std::vector< PTableModelListener > ModellListeners;
+ typedef ::std::vector< PColumnModel > ColumnModels;
+ struct UnoControlTableModel_Impl
+ {
+ ColumnModels aColumns;
+ bool bHasColumnHeaders;
+ bool bHasRowHeaders;
+ ScrollbarVisibility eVScrollMode;
+ ScrollbarVisibility eHScrollMode;
+ PTableRenderer pRenderer;
+ PTableInputHandler pInputHandler;
+ TableMetrics nRowHeight;
+ TableMetrics nColumnHeaderHeight;
+ TableMetrics nRowHeaderWidth;
+ ::boost::optional< ::Color > m_aGridLineColor;
+ ::boost::optional< ::Color > m_aHeaderBackgroundColor;
+ ::boost::optional< ::Color > m_aHeaderTextColor;
+ ::boost::optional< ::Color > m_aTextColor;
+ ::boost::optional< ::Color > m_aTextLineColor;
+ ::boost::optional< ::std::vector< ::Color > > m_aRowColors;
+ VerticalAlignment m_eVerticalAlign;
+ ModellListeners m_aListeners;
+ WeakReference< XGridDataModel > m_aDataModel;
+ WeakReference< XGridColumnModel > m_aColumnModel;
+ UnoControlTableModel_Impl()
+ :aColumns ( )
+ ,bHasColumnHeaders ( true )
+ ,bHasRowHeaders ( false )
+ ,eVScrollMode ( ScrollbarShowNever )
+ ,eHScrollMode ( ScrollbarShowNever )
+ ,pRenderer ( )
+ ,pInputHandler ( )
+ ,nRowHeight ( 10 )
+ ,nColumnHeaderHeight ( 10 )
+ ,nRowHeaderWidth ( 10 )
+ ,m_aGridLineColor ( )
+ ,m_aHeaderBackgroundColor ( )
+ ,m_aHeaderTextColor ( )
+ ,m_aTextColor ( )
+ ,m_aTextLineColor ( )
+ ,m_aRowColors ( )
+ ,m_eVerticalAlign ( VerticalAlignment_TOP )
+ {
+ }
+ };
- //--------------------------------------------------------------------
- UnoControlTableColumn::UnoControlTableColumn(Reference<XGridColumn> m_xGridColumn)
- :m_nID( 0 )
- ,m_sName()
- ,m_bIsResizable( true )
- ,m_nWidth( 4 )
- ,m_nMinWidth( 0 )
- ,m_nMaxWidth( 0 )
- ,m_nPrefWidth ( 0 )
- ,m_xHorizontalAlign(com::sun::star::style::HorizontalAlignment(0))
- {
- m_sName = m_xGridColumn->getTitle();
- }
- //--------------------------------------------------------------------
- UnoControlTableColumn::UnoControlTableColumn()
- :m_nID( 0 )
- ,m_sName()
- ,m_bIsResizable( true )
- ,m_nWidth( 4 )
- ,m_nMinWidth( 0 )
- ,m_nMaxWidth( 0 )
- ,m_nPrefWidth ( 0 )
- ,m_xHorizontalAlign(com::sun::star::style::HorizontalAlignment(0))
+ //==================================================================================================================
+ //= UnoControlTableModel
+ //==================================================================================================================
+#ifdef DBG_UTIL
+ const char* UnoControlTableModel_checkInvariants( const void* _pInstance )
{
+ return static_cast< const UnoControlTableModel* >( _pInstance )->checkInvariants();
}
- //--------------------------------------------------------------------
- ColumnID UnoControlTableColumn::getID() const
+ //------------------------------------------------------------------------------------------------------------------
+ const char* UnoControlTableModel::checkInvariants() const
{
- return m_nID;
- }
+ Reference< XGridDataModel > const xDataModel( m_pImpl->m_aDataModel );
+ if ( !xDataModel.is() )
+ return "data model anymore";
- //--------------------------------------------------------------------
- bool UnoControlTableColumn::setID( const ColumnID _nID )
- {
- m_nID = _nID;
- return true;
- }
+ // TODO: more?
- //--------------------------------------------------------------------
- String UnoControlTableColumn::getName() const
- {
- return m_sName;
+ return NULL;
}
+#endif
- //--------------------------------------------------------------------
- void UnoControlTableColumn::setName( const String& _rName )
+#define DBG_CHECK_ME() \
+ DBG_TESTSOLARMUTEX(); \
+ DBG_CHKTHIS( UnoControlTableModel, UnoControlTableModel_checkInvariants )
+
+ //------------------------------------------------------------------------------------------------------------------
+ DBG_NAME( UnoControlTableModel )
+ UnoControlTableModel::UnoControlTableModel()
+ :m_pImpl( new UnoControlTableModel_Impl )
{
- m_sName = _rName;
+ DBG_CTOR( UnoControlTableModel, UnoControlTableModel_checkInvariants );
+ m_pImpl->bHasColumnHeaders = true;
+ m_pImpl->bHasRowHeaders = false;
+ m_pImpl->pRenderer.reset( new GridTableRenderer( *this ) );
+ m_pImpl->pInputHandler.reset( new DefaultInputHandler );
}
- //--------------------------------------------------------------------
- bool UnoControlTableColumn::isResizable() const
+
+ //------------------------------------------------------------------------------------------------------------------
+ UnoControlTableModel::~UnoControlTableModel()
{
- return m_bIsResizable;
+ DBG_DTOR( UnoControlTableModel, UnoControlTableModel_checkInvariants );
+ DELETEZ( m_pImpl );
}
- //--------------------------------------------------------------------
- void UnoControlTableColumn::setResizable( bool _bResizable )
+ //------------------------------------------------------------------------------------------------------------------
+ TableSize UnoControlTableModel::getColumnCount() const
{
- m_bIsResizable = _bResizable;
+ DBG_CHECK_ME();
+ return (TableSize)m_pImpl->aColumns.size();
}
- //--------------------------------------------------------------------
- TableMetrics UnoControlTableColumn::getWidth() const
+ //------------------------------------------------------------------------------------------------------------------
+ TableSize UnoControlTableModel::getRowCount() const
{
- return m_nWidth;
+ DBG_CHECK_ME();
+
+ TableSize nRowCount = 0;
+ try
+ {
+ Reference< XGridDataModel > const xDataModel( m_pImpl->m_aDataModel );
+ ENSURE_OR_THROW( xDataModel.is(), "no data model anymore!" );
+ nRowCount = xDataModel->getRowCount();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return nRowCount;
}
- //--------------------------------------------------------------------
- void UnoControlTableColumn::setWidth( TableMetrics _nWidth )
+ //------------------------------------------------------------------------------------------------------------------
+ bool UnoControlTableModel::hasColumnHeaders() const
{
- m_nWidth = _nWidth;
+ DBG_CHECK_ME();
+ return m_pImpl->bHasColumnHeaders;
}
- //--------------------------------------------------------------------
- TableMetrics UnoControlTableColumn::getMinWidth() const
+ //------------------------------------------------------------------------------------------------------------------
+ bool UnoControlTableModel::hasRowHeaders() const
{
- return m_nMinWidth;
+ DBG_CHECK_ME();
+ return m_pImpl->bHasRowHeaders;
}
- //--------------------------------------------------------------------
- void UnoControlTableColumn::setMinWidth( TableMetrics _nMinWidth )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setRowHeaders(bool _bRowHeaders)
{
- m_nMinWidth = _nMinWidth;
+ DBG_CHECK_ME();
+ if ( m_pImpl->bHasRowHeaders == _bRowHeaders )
+ return;
+
+ m_pImpl->bHasRowHeaders = _bRowHeaders;
+ impl_notifyTableMetricsChanged();
}
- //--------------------------------------------------------------------
- TableMetrics UnoControlTableColumn::getMaxWidth() const
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setColumnHeaders(bool _bColumnHeaders)
{
- return m_nMaxWidth;
+ DBG_CHECK_ME();
+ if ( m_pImpl->bHasColumnHeaders == _bColumnHeaders )
+ return;
+
+ m_pImpl->bHasColumnHeaders = _bColumnHeaders;
+ impl_notifyTableMetricsChanged();
}
- //--------------------------------------------------------------------
- void UnoControlTableColumn::setMaxWidth( TableMetrics _nMaxWidth )
+ //------------------------------------------------------------------------------------------------------------------
+ bool UnoControlTableModel::isCellEditable( ColPos col, RowPos row ) const
{
- m_nMaxWidth = _nMaxWidth;
+ DBG_CHECK_ME();
+ (void)col;
+ (void)row;
+ return false;
}
- //--------------------------------------------------------------------
- TableMetrics UnoControlTableColumn::getPreferredWidth() const
+
+ //------------------------------------------------------------------------------------------------------------------
+ PColumnModel UnoControlTableModel::getColumnModel( ColPos column )
{
- return m_nPrefWidth;
+ DBG_CHECK_ME();
+ ENSURE_OR_RETURN( ( column >= 0 ) && ( column < getColumnCount() ),
+ "DefaultTableModel::getColumnModel: invalid index!", PColumnModel() );
+ return m_pImpl->aColumns[ column ];
}
- //--------------------------------------------------------------------
- void UnoControlTableColumn::setPreferredWidth( TableMetrics _nPrefWidth )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::appendColumn( Reference< XGridColumn > const & i_column )
{
- m_nPrefWidth = _nPrefWidth;
+ DBG_CHECK_ME();
+ insertColumn( m_pImpl->aColumns.size(), i_column );
}
- //--------------------------------------------------------------------
- ::com::sun::star::style::HorizontalAlignment UnoControlTableColumn::getHorizontalAlign()
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::insertColumn( ColPos const i_position, Reference< XGridColumn > const & i_column )
{
- return m_xHorizontalAlign;
+ DBG_CHECK_ME();
+ ENSURE_OR_RETURN_VOID( ( i_position >= 0 ) && ( size_t( i_position ) <= m_pImpl->aColumns.size() ),
+ "UnoControlTableModel::insertColumn: illegal position!" );
+
+ const PColumnModel pColumn( new UnoGridColumnFacade( *this, i_column ) );
+ m_pImpl->aColumns.insert( m_pImpl->aColumns.begin() + i_position, pColumn );
+
+ // notify listeners
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->columnInserted( i_position );
+ }
}
- //--------------------------------------------------------------------
- void UnoControlTableColumn::setHorizontalAlign( com::sun::star::style::HorizontalAlignment _align )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::removeColumn( ColPos const i_position )
{
- m_xHorizontalAlign = _align;
+ DBG_CHECK_ME();
+ ENSURE_OR_RETURN_VOID( ( i_position >= 0 ) && ( size_t( i_position ) <= m_pImpl->aColumns.size() ),
+ "UnoControlTableModel::removeColumn: illegal position!" );
+
+ // remove the column
+ ColumnModels::iterator pos = m_pImpl->aColumns.begin() + i_position;
+ const PColumnModel pColumn = *pos;
+ m_pImpl->aColumns.erase( pos );
+
+ // notify listeners
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->columnRemoved( i_position );
+ }
+
+ // dispose the column
+ UnoGridColumnFacade* pColumnImpl = dynamic_cast< UnoGridColumnFacade* >( pColumn.get() );
+ OSL_ENSURE( pColumnImpl != NULL, "UnoControlTableModel::removeColumn: illegal column implementation!" );
+ if ( pColumnImpl )
+ pColumnImpl->dispose();
}
- //====================================================================
- //= DefaultTableModel_Impl
- //====================================================================
- struct UnoControlTableModel_Impl
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::removeAllColumns()
{
- ::std::vector< PColumnModel > aColumns;
- TableSize nRowCount;
- bool bHasColumnHeaders;
- bool bHasRowHeaders;
- bool bVScroll;
- bool bHScroll;
- PTableRenderer pRenderer;
- PTableInputHandler pInputHandler;
- TableMetrics nRowHeight;
- TableMetrics nColumnHeaderHeight;
- TableMetrics nRowHeaderWidth;
- std::vector<rtl::OUString> aRowHeadersTitle;
- std::vector<std::vector< Any > > aCellContent;
- ::com::sun::star::util::Color m_xLineColor;
- ::com::sun::star::util::Color m_xHeaderColor;
- ::com::sun::star::util::Color m_xTextColor;
- ::com::sun::star::util::Color m_xRowColor1;
- ::com::sun::star::util::Color m_xRowColor2;
- ::com::sun::star::style::VerticalAlignment m_xVerticalAlign;
+ DBG_CHECK_ME();
+ if ( m_pImpl->aColumns.empty() )
+ return;
- UnoControlTableModel_Impl()
- :aColumns ( )
- ,nRowCount ( 0 )
- ,bHasColumnHeaders ( false )
- ,bHasRowHeaders ( false )
- ,bVScroll ( false )
- ,bHScroll ( false )
- ,pRenderer ( )
- ,pInputHandler ( )
- ,nRowHeight ( 0 )
- ,nColumnHeaderHeight( 0 )
- ,nRowHeaderWidth ( 10 )
- ,aRowHeadersTitle ( )
- ,aCellContent ( )
- ,m_xLineColor ( 0xFFFFFF )
- ,m_xHeaderColor ( 0xFFFFFF )
- ,m_xTextColor ( 0 )//black as default
- ,m_xRowColor1 ( 0xFFFFFF )
- ,m_xRowColor2 ( 0xFFFFFF )
- ,m_xVerticalAlign (com::sun::star::style::VerticalAlignment(0))
+ // dispose the column instances
+ for ( ColumnModels::const_iterator col = m_pImpl->aColumns.begin();
+ col != m_pImpl->aColumns.end();
+ ++col
+ )
{
+ UnoGridColumnFacade* pColumn = dynamic_cast< UnoGridColumnFacade* >( col->get() );
+ ENSURE_OR_CONTINUE( pColumn != NULL, "UnoControlTableModel::removeAllColumns: illegal column implementation!" );
+ pColumn->dispose();
}
- };
+ m_pImpl->aColumns.clear();
+
+ // notify listeners
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->allColumnsRemoved();
+ }
+ }
- //====================================================================
- //= UnoControlTableModel
- //====================================================================
- //--------------------------------------------------------------------
- UnoControlTableModel::UnoControlTableModel()
- :m_pImpl( new UnoControlTableModel_Impl )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::impl_notifyTableMetricsChanged() const
{
- m_pImpl->bHasColumnHeaders = false;
- m_pImpl->bHasRowHeaders = false;
- m_pImpl->pRenderer.reset( new GridTableRenderer( *this ) );
- m_pImpl->pInputHandler.reset( new DefaultInputHandler );
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->tableMetricsChanged();
+ }
}
- //--------------------------------------------------------------------
- UnoControlTableModel::~UnoControlTableModel()
+ //------------------------------------------------------------------------------------------------------------------
+ PTableRenderer UnoControlTableModel::getRenderer() const
{
- DELETEZ( m_pImpl );
+ DBG_CHECK_ME();
+ return m_pImpl->pRenderer;
}
- //--------------------------------------------------------------------
- TableSize UnoControlTableModel::getColumnCount() const
+ //------------------------------------------------------------------------------------------------------------------
+ PTableInputHandler UnoControlTableModel::getInputHandler() const
{
- return (TableSize)m_pImpl->aColumns.size();
+ DBG_CHECK_ME();
+ return m_pImpl->pInputHandler;
}
- //--------------------------------------------------------------------
- TableSize UnoControlTableModel::getRowCount() const
+ //------------------------------------------------------------------------------------------------------------------
+ TableMetrics UnoControlTableModel::getRowHeight() const
{
- return m_pImpl->nRowCount;
+ DBG_CHECK_ME();
+ return m_pImpl->nRowHeight;
}
- //--------------------------------------------------------------------
- bool UnoControlTableModel::hasColumnHeaders() const
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setRowHeight(TableMetrics _nRowHeight)
{
- return m_pImpl->bHasColumnHeaders;
+ DBG_CHECK_ME();
+ if ( m_pImpl->nRowHeight == _nRowHeight )
+ return;
+
+ m_pImpl->nRowHeight = _nRowHeight;
+ impl_notifyTableMetricsChanged();
}
- //--------------------------------------------------------------------
- bool UnoControlTableModel::hasRowHeaders() const
+ //------------------------------------------------------------------------------------------------------------------
+ TableMetrics UnoControlTableModel::getColumnHeaderHeight() const
{
- return m_pImpl->bHasRowHeaders;
+ DBG_CHECK_ME();
+ DBG_ASSERT( hasColumnHeaders(), "DefaultTableModel::getColumnHeaderHeight: invalid call!" );
+ return m_pImpl->nColumnHeaderHeight;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setRowHeaders(bool _bRowHeaders)
+ //------------------------------------------------------------------------------------------------------------------
+ TableMetrics UnoControlTableModel::getRowHeaderWidth() const
{
- m_pImpl->bHasRowHeaders = _bRowHeaders;
+ DBG_CHECK_ME();
+ DBG_ASSERT( hasRowHeaders(), "DefaultTableModel::getRowHeaderWidth: invalid call!" );
+ return m_pImpl->nRowHeaderWidth;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setColumnHeaders(bool _bColumnHeaders)
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setColumnHeaderHeight(TableMetrics _nHeight)
{
- m_pImpl->bHasColumnHeaders = _bColumnHeaders;
+ DBG_CHECK_ME();
+ if ( m_pImpl->nColumnHeaderHeight == _nHeight )
+ return;
+
+ m_pImpl->nColumnHeaderHeight = _nHeight;
+ impl_notifyTableMetricsChanged();
}
- void UnoControlTableModel::setColumnCount(TableSize _nColCount)
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setRowHeaderWidth(TableMetrics _nWidth)
{
- m_pImpl->aColumns.resize( _nColCount);
+ DBG_CHECK_ME();
+ if ( m_pImpl->nRowHeaderWidth == _nWidth )
+ return;
+
+ m_pImpl->nRowHeaderWidth = _nWidth;
+ impl_notifyTableMetricsChanged();
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setRowCount(TableSize _nRowCount)
+
+ //------------------------------------------------------------------------------------------------------------------
+ ScrollbarVisibility UnoControlTableModel::getVerticalScrollbarVisibility() const
{
- m_pImpl->nRowCount = _nRowCount;
+ DBG_CHECK_ME();
+ return m_pImpl->eVScrollMode;
}
- //--------------------------------------------------------------------
- bool UnoControlTableModel::isCellEditable( ColPos col, RowPos row ) const
+
+ //------------------------------------------------------------------------------------------------------------------
+ ScrollbarVisibility UnoControlTableModel::getHorizontalScrollbarVisibility() const
{
- (void)col;
- (void)row;
- return false;
+ DBG_CHECK_ME();
+ return m_pImpl->eHScrollMode;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::addTableModelListener( const PTableModelListener& listener )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::addTableModelListener( const PTableModelListener& i_listener )
{
- (void) listener;
- // TODO
- OSL_FAIL( "DefaultTableModel::addTableModelListener: not yet implemented!" );
+ DBG_CHECK_ME();
+ ENSURE_OR_RETURN_VOID( !!i_listener, "illegal NULL listener" );
+ m_pImpl->m_aListeners.push_back( i_listener );
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::removeTableModelListener( const PTableModelListener& listener )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::removeTableModelListener( const PTableModelListener& i_listener )
{
- (void)listener;
- // TODO
- OSL_FAIL( "DefaultTableModel::removeTableModelListener: not yet implemented!" );
+ DBG_CHECK_ME();
+ for ( ModellListeners::iterator lookup = m_pImpl->m_aListeners.begin();
+ lookup != m_pImpl->m_aListeners.end();
+ ++lookup
+ )
+ {
+ if ( *lookup == i_listener )
+ {
+ m_pImpl->m_aListeners.erase( lookup );
+ return;
+ }
+ }
+ OSL_ENSURE( false, "UnoControlTableModel::removeTableModelListener: listener is not registered - sure you're doing the right thing here?" );
}
- //--------------------------------------------------------------------
- PColumnModel UnoControlTableModel::getColumnModel( ColPos column )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setVerticalScrollbarVisibility( ScrollbarVisibility const i_visibility ) const
{
- DBG_ASSERT( ( column >= 0 ) && ( column < getColumnCount() ),
- "DefaultTableModel::getColumnModel: invalid index!" );
- return m_pImpl->aColumns[ column ];
+ DBG_CHECK_ME();
+ m_pImpl->eVScrollMode = i_visibility;
}
- //--------------------------------------------------------------------
- std::vector<PColumnModel>& UnoControlTableModel::getColumnModel()
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setHorizontalScrollbarVisibility( ScrollbarVisibility const i_visibility ) const
{
- return m_pImpl->aColumns;
+ DBG_CHECK_ME();
+ m_pImpl->eHScrollMode = i_visibility;
}
- //--------------------------------------------------------------------
- PColumnModel UnoControlTableModel::getColumnModelByID( ColumnID id )
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setDataModel( Reference< XGridDataModel > const & i_gridDataModel )
{
- (void)id;
- // TODO
- OSL_FAIL( "DefaultTableModel::getColumnModelByID: not yet implemented!" );
- return PColumnModel();
+ DBG_CHECK_ME();
+ m_pImpl->m_aDataModel = i_gridDataModel;
+ // TODO: register as listener, so we're notified of row/data changes, and can multiplex them to our
+ // own listeners
}
- //--------------------------------------------------------------------
- PTableRenderer UnoControlTableModel::getRenderer() const
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XGridDataModel > UnoControlTableModel::getDataModel() const
{
- return m_pImpl->pRenderer;
+ Reference< XGridDataModel > const xDataModel( m_pImpl->m_aDataModel );
+ return xDataModel;
}
- //--------------------------------------------------------------------
- PTableInputHandler UnoControlTableModel::getInputHandler() const
+ //------------------------------------------------------------------------------------------------------------------
+ bool UnoControlTableModel::hasDataModel() const
{
- return m_pImpl->pInputHandler;
+ return getDataModel().is();
}
- //--------------------------------------------------------------------
- TableMetrics UnoControlTableModel::getRowHeight() const
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setColumnModel( Reference< XGridColumnModel > const & i_gridColumnModel )
{
- return m_pImpl->nRowHeight;
+ DBG_CHECK_ME();
+ m_pImpl->m_aColumnModel = i_gridColumnModel;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setRowHeight(TableMetrics _nRowHeight)
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XGridColumnModel > UnoControlTableModel::getColumnModel() const
{
- m_pImpl->nRowHeight = _nRowHeight;
+ Reference< XGridColumnModel > const xColumnModel( m_pImpl->m_aColumnModel );
+ return xColumnModel;
}
- //--------------------------------------------------------------------
- TableMetrics UnoControlTableModel::getColumnHeaderHeight() const
+ //------------------------------------------------------------------------------------------------------------------
+ bool UnoControlTableModel::hasColumnModel() const
{
- DBG_ASSERT( hasColumnHeaders(), "DefaultTableModel::getColumnHeaderHeight: invalid call!" );
- return m_pImpl->nColumnHeaderHeight;
+ return getColumnModel().is();
}
- //--------------------------------------------------------------------
- TableMetrics UnoControlTableModel::getRowHeaderWidth() const
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::getCellContent( ColPos const i_col, RowPos const i_row, Any& o_cellContent )
{
- DBG_ASSERT( hasRowHeaders(), "DefaultTableModel::getRowHeaderWidth: invalid call!" );
- return m_pImpl->nRowHeaderWidth;
+ DBG_CHECK_ME();
+
+ o_cellContent.clear();
+ try
+ {
+ Reference< XGridDataModel > const xDataModel( m_pImpl->m_aDataModel );
+ ENSURE_OR_RETURN_VOID( xDataModel.is(), "UnoControlTableModel::getCellContent: no data model anymore!" );
+
+ PColumnModel const pColumn = getColumnModel( i_col );
+ UnoGridColumnFacade* pColumnImpl = dynamic_cast< UnoGridColumnFacade* >( pColumn.get() );
+ ENSURE_OR_RETURN_VOID( pColumnImpl != NULL, "UnoControlTableModel::getCellContent: no (valid) column at this position!" );
+ sal_Int32 const nDataColumnIndex = pColumnImpl->getDataColumnIndex() >= 0 ? pColumnImpl->getDataColumnIndex() : i_col;
+
+ if ( nDataColumnIndex >= xDataModel->getColumnCount() )
+ {
+ // this is allowed, in case the column model has been dynamically extended, but the data model does
+ // not (yet?) know about it.
+ // So, handle it gracefully.
+ #if OSL_DEBUG_LEVEL > 0
+ {
+ Reference< XGridColumnModel > const xColumnModel( m_pImpl->m_aColumnModel );
+ OSL_ENSURE( xColumnModel.is() && i_col < xColumnModel->getColumnCount(),
+ "UnoControlTableModel::getCellContent: request a column's value which the ColumnModel doesn't know about!" );
+ }
+ #endif
+ }
+ else
+ {
+ o_cellContent = xDataModel->getCellData( nDataColumnIndex, i_row );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setColumnHeaderHeight(TableMetrics _nHeight)
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::getCellToolTip( ColPos const i_col, RowPos const i_row, Any& o_cellToolTip )
{
- m_pImpl->nColumnHeaderHeight = _nHeight;
+ DBG_CHECK_ME();
+ try
+ {
+ Reference< XGridDataModel > const xDataModel( m_pImpl->m_aDataModel );
+ ENSURE_OR_THROW( xDataModel.is(), "no data model anymore!" );
+
+ o_cellToolTip = xDataModel->getCellToolTip( i_col, i_row );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setRowHeaderWidth(TableMetrics _nWidth)
+ //------------------------------------------------------------------------------------------------------------------
+ Any UnoControlTableModel::getRowHeading( RowPos const i_rowPos ) const
{
- m_pImpl->nRowHeaderWidth = _nWidth;
+ DBG_CHECK_ME();
+
+ Any aRowHeading;
+
+ Reference< XGridDataModel > const xDataModel( m_pImpl->m_aDataModel );
+ ENSURE_OR_RETURN( xDataModel.is(), "UnoControlTableModel::getRowHeading: no data model anymore!", aRowHeading );
+
+ try
+ {
+ aRowHeading = xDataModel->getRowHeading( i_rowPos );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return aRowHeading;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::SetTitleHeight( TableMetrics _nHeight )
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
{
- DBG_ASSERT( _nHeight > 0, "DefaultTableModel::SetTitleHeight: invalid height value!" );
- m_pImpl->nColumnHeaderHeight = _nHeight;
- // TODO: notification
+ void lcl_setColor( Any const & i_color, ::boost::optional< ::Color > & o_convertedColor )
+ {
+ if ( !i_color.hasValue() )
+ o_convertedColor.reset();
+ else
+ {
+ sal_Int32 nColor = COL_TRANSPARENT;
+ if ( i_color >>= nColor )
+ {
+ o_convertedColor.reset( ::Color( nColor ) );
+ }
+ else
+ {
+ OSL_ENSURE( false, "lcl_setColor: could not extract color value!" );
+ }
+ }
+ }
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::SetHandleWidth( TableMetrics _nWidth )
+ //------------------------------------------------------------------------------------------------------------------
+ ::boost::optional< ::Color > UnoControlTableModel::getLineColor() const
{
- DBG_ASSERT( _nWidth > 0, "DefaultTableModel::SetHandleWidth: invalid width value!" );
- m_pImpl->nRowHeaderWidth = _nWidth;
- // TODO: notification
+ DBG_CHECK_ME();
+ return m_pImpl->m_aGridLineColor;
}
- //--------------------------------------------------------------------
- ScrollbarVisibility UnoControlTableModel::getVerticalScrollbarVisibility(int overAllHeight, int actHeight) const
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setLineColor( Any const & i_color )
{
- if(overAllHeight>=actHeight && !m_pImpl->bVScroll)
- return ScrollbarShowNever;
- else
- return ScrollbarShowAlways;
+ DBG_CHECK_ME();
+ lcl_setColor( i_color, m_pImpl->m_aGridLineColor );
}
- //--------------------------------------------------------------------
- ScrollbarVisibility UnoControlTableModel::getHorizontalScrollbarVisibility(int overAllWidth, int actWidth) const
+ //------------------------------------------------------------------------------------------------------------------
+ ::boost::optional< ::Color > UnoControlTableModel::getHeaderBackgroundColor() const
{
- if(overAllWidth>=actWidth && !m_pImpl->bHScroll)
- return ScrollbarShowNever;
- else
- return ScrollbarShowAlways;
+ DBG_CHECK_ME();
+ return m_pImpl->m_aHeaderBackgroundColor;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setVerticalScrollbarVisibility(bool _bVScroll) const
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setHeaderBackgroundColor( Any const & i_color )
{
- m_pImpl->bVScroll = _bVScroll;
+ DBG_CHECK_ME();
+ lcl_setColor( i_color, m_pImpl->m_aHeaderBackgroundColor );
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setHorizontalScrollbarVisibility(bool _bHScroll) const
+ //------------------------------------------------------------------------------------------------------------------
+ ::boost::optional< ::Color > UnoControlTableModel::getHeaderTextColor() const
{
- m_pImpl->bHScroll = _bHScroll;
+ DBG_CHECK_ME();
+ return m_pImpl->m_aHeaderTextColor;
}
- //--------------------------------------------------------------------
- bool UnoControlTableModel::hasVerticalScrollbar()
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setHeaderTextColor( Any const & i_color )
{
- return m_pImpl->bVScroll;
+ DBG_CHECK_ME();
+ lcl_setColor( i_color, m_pImpl->m_aHeaderTextColor );
}
- //--------------------------------------------------------------------
- bool UnoControlTableModel::hasHorizontalScrollbar()
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::boost::optional< ::Color > UnoControlTableModel::getTextColor() const
{
- return m_pImpl->bHScroll;
+ DBG_CHECK_ME();
+ return m_pImpl->m_aTextColor;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setCellContent(const std::vector<std::vector< Any > >& cellContent)
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setTextColor( Any const & i_color )
{
- m_pImpl->aCellContent = cellContent;
+ DBG_CHECK_ME();
+ lcl_setColor( i_color, m_pImpl->m_aTextColor );
}
- std::vector<std::vector< Any > >& UnoControlTableModel::getCellContent()
+ //------------------------------------------------------------------------------------------------------------------
+ ::boost::optional< ::Color > UnoControlTableModel::getTextLineColor() const
{
- return m_pImpl->aCellContent;
+ DBG_CHECK_ME();
+ return m_pImpl->m_aTextColor;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setRowHeaderName(const std::vector<rtl::OUString>& cellColumnContent)
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setTextLineColor( Any const & i_color )
{
- m_pImpl->aRowHeadersTitle = cellColumnContent;
+ DBG_CHECK_ME();
+ lcl_setColor( i_color, m_pImpl->m_aTextLineColor );
}
- std::vector<rtl::OUString>& UnoControlTableModel::getRowHeaderName()
+ //------------------------------------------------------------------------------------------------------------------
+ ::boost::optional< ::std::vector< ::Color > > UnoControlTableModel::getRowBackgroundColors() const
{
- return m_pImpl->aRowHeadersTitle;
+ DBG_CHECK_ME();
+ return m_pImpl->m_aRowColors;
}
- //--------------------------------------------------------------------
- ::com::sun::star::util::Color UnoControlTableModel::getLineColor()
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setRowBackgroundColors( ::com::sun::star::uno::Any const & i_APIValue )
{
- return m_pImpl->m_xLineColor;
+ DBG_CHECK_ME();
+ Sequence< ::com::sun::star::util::Color > aAPIColors;
+ if ( !( i_APIValue >>= aAPIColors ) )
+ m_pImpl->m_aRowColors.reset();
+ else
+ {
+ ::std::vector< ::Color > aColors( aAPIColors.getLength() );
+ for ( sal_Int32 i=0; i<aAPIColors.getLength(); ++i )
+ {
+ aColors[i] = ::Color( aAPIColors[i] );
+ }
+ m_pImpl->m_aRowColors.reset( aColors );
+ }
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setLineColor( ::com::sun::star::util::Color _rColor )
+ //------------------------------------------------------------------------------------------------------------------
+ VerticalAlignment UnoControlTableModel::getVerticalAlign() const
{
- m_pImpl->m_xLineColor = _rColor;
+ DBG_CHECK_ME();
+ return m_pImpl->m_eVerticalAlign;
}
- //--------------------------------------------------------------------
- ::com::sun::star::util::Color UnoControlTableModel::getHeaderBackgroundColor()
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setVerticalAlign( VerticalAlignment _xAlign )
{
- return m_pImpl->m_xHeaderColor;
+ DBG_CHECK_ME();
+ m_pImpl->m_eVerticalAlign = _xAlign;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setHeaderBackgroundColor( ::com::sun::star::util::Color _rColor )
+ //------------------------------------------------------------------------------------------------------------------
+ ColPos UnoControlTableModel::getColumnPos( UnoGridColumnFacade const & i_column ) const
{
- m_pImpl->m_xHeaderColor = _rColor;
+ DBG_CHECK_ME();
+ for ( ColumnModels::const_iterator col = m_pImpl->aColumns.begin();
+ col != m_pImpl->aColumns.end();
+ ++col
+ )
+ {
+ if ( &i_column == col->get() )
+ return col - m_pImpl->aColumns.begin();
+ }
+ OSL_ENSURE( false, "UnoControlTableModel::getColumnPos: column not found!" );
+ return COL_INVALID;
}
- //--------------------------------------------------------------------
- ::com::sun::star::util::Color UnoControlTableModel::getTextColor()
+
+ //------------------------------------------------------------------------------------------------------------------
+ ITableDataSort* UnoControlTableModel::getSortAdapter()
{
- return m_pImpl->m_xTextColor;
+ DBG_CHECK_ME();
+
+ Reference< XSortableGridData > const xSortAccess( getDataModel(), UNO_QUERY );
+ if ( xSortAccess.is() )
+ return this;
+ return NULL;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setTextColor( ::com::sun::star::util::Color _rColor )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::sortByColumn( ColPos const i_column, ColumnSortDirection const i_sortDirection )
{
- m_pImpl->m_xTextColor = _rColor;
+ DBG_CHECK_ME();
+
+ try
+ {
+ Reference< XSortableGridData > const xSortAccess( getDataModel(), UNO_QUERY_THROW );
+ xSortAccess->sortByColumn( i_column, i_sortDirection == ColumnSortAscending );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
- //--------------------------------------------------------------------
- ::com::sun::star::util::Color UnoControlTableModel::getOddRowBackgroundColor()
+
+ //------------------------------------------------------------------------------------------------------------------
+ ColumnSort UnoControlTableModel::getCurrentSortOrder() const
{
- return m_pImpl->m_xRowColor1;
+ DBG_CHECK_ME();
+
+ ColumnSort currentSort;
+ try
+ {
+ Reference< XSortableGridData > const xSortAccess( getDataModel(), UNO_QUERY_THROW );
+ Pair< ::sal_Int32, ::sal_Bool > const aCurrentSortOrder( xSortAccess->getCurrentSortOrder() );
+ currentSort.nColumnPos = aCurrentSortOrder.First;
+ currentSort.eSortDirection = aCurrentSortOrder.Second ? ColumnSortAscending : ColumnSortDescending;
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return currentSort;
}
//--------------------------------------------------------------------
- void UnoControlTableModel::setOddRowBackgroundColor( ::com::sun::star::util::Color _rColor )
+ void UnoControlTableModel::notifyColumnChange( ColPos const i_columnPos, ColumnAttributeGroup const i_attributeGroup ) const
{
- m_pImpl->m_xRowColor1 = _rColor;
+ DBG_CHECK_ME();
+ ENSURE_OR_RETURN_VOID( ( i_columnPos >= 0 ) && ( i_columnPos < getColumnCount() ),
+ "UnoControlTableModel::notifyColumnChange: invalid column index!" );
+
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->columnChanged( i_columnPos, i_attributeGroup );
+ }
}
- //--------------------------------------------------------------------
- ::com::sun::star::util::Color UnoControlTableModel::getEvenRowBackgroundColor()
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::notifyRowsInserted( GridDataEvent const & i_event ) const
{
- return m_pImpl->m_xRowColor2;
+ // check sanity of the event
+ ENSURE_OR_RETURN_VOID( i_event.FirstRow >= 0, "UnoControlTableModel::notifyRowsInserted: invalid first row!" );
+ ENSURE_OR_RETURN_VOID( i_event.LastRow >= i_event.FirstRow, "UnoControlTableModel::notifyRowsInserted: invalid row indexes!" );
+
+ // check own sanity
+ Reference< XGridColumnModel > const xColumnModel( m_pImpl->m_aColumnModel );
+ ENSURE_OR_RETURN_VOID( xColumnModel.is(), "UnoControlTableModel::notifyRowsInserted: no column model anymore!" );
+
+ Reference< XGridDataModel > const xDataModel( m_pImpl->m_aDataModel );
+ ENSURE_OR_RETURN_VOID( xDataModel.is(), "UnoControlTableModel::notifyRowsInserted: no data model anymore!" );
+
+ // implicitly add columns to the column model
+ // TODO: is this really a good idea?
+ sal_Int32 const dataColumnCount = xDataModel->getColumnCount();
+ OSL_ENSURE( dataColumnCount > 0, "UnoControlTableModel::notifyRowsInserted: no columns at all?" );
+
+ sal_Int32 const modelColumnCount = xColumnModel->getColumnCount();
+ if ( ( modelColumnCount == 0 ) && ( dataColumnCount > 0 ) )
+ {
+ // TODO: shouldn't we clear the mutexes guard for this call?
+ xColumnModel->setDefaultColumns( dataColumnCount );
+ }
+
+ // multiplex the event to our own listeners
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->rowsInserted( i_event.FirstRow, i_event.LastRow );
+ }
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setEvenRowBackgroundColor( ::com::sun::star::util::Color _rColor )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::notifyRowsRemoved( GridDataEvent const & i_event ) const
{
- m_pImpl->m_xRowColor2 = _rColor;
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->rowsRemoved( i_event.FirstRow, i_event.LastRow );
+ }
}
- //--------------------------------------------------------------------
- ::com::sun::star::style::VerticalAlignment UnoControlTableModel::getVerticalAlign()
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::notifyDataChanged( ::com::sun::star::awt::grid::GridDataEvent const & i_event ) const
{
- return m_pImpl->m_xVerticalAlign;
+ ColPos const firstCol = i_event.FirstColumn == -1 ? 0 : i_event.FirstColumn;
+ ColPos const lastCol = i_event.FirstColumn == -1 ? getColumnCount() - 1 : i_event.LastColumn;
+ RowPos const firstRow = i_event.FirstRow == -1 ? 0 : i_event.FirstRow;
+ RowPos const lastRow = i_event.FirstRow == -1 ? getRowCount() - 1 : i_event.LastRow;
+
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->cellsUpdated( firstCol, lastCol, firstRow, lastRow );
+ }
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setVerticalAlign( com::sun::star::style::VerticalAlignment _xAlign )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::notifyAllDataChanged() const
{
- m_pImpl->m_xVerticalAlign = _xAlign;
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->cellsUpdated( 0, getColumnCount() - 1, 0, getRowCount() - 1 );
+ }
}
+// .....................................................................................................................
+} } // svt::table
+// .....................................................................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/uno/unocontroltablemodel.hxx b/svtools/source/uno/unocontroltablemodel.hxx
index b17911b8ab85..d804ca0f03b4 100644
--- a/svtools/source/uno/unocontroltablemodel.hxx
+++ b/svtools/source/uno/unocontroltablemodel.hxx
@@ -29,67 +29,37 @@
#ifndef _UNOCONTROL_TABLEMODEL_HXX_
#define _UNOCONTROL_TABLEMODEL_HXX_
-#include <svtools/table/tablemodel.hxx>
-#include <svtools/table/tablecontrol.hxx>
+#include "svtools/table/tablemodel.hxx"
+#include "svtools/table/tablecontrol.hxx"
+
+/** === begin UNO includes === **/
#include <com/sun/star/awt/grid/XGridControl.hpp>
-#include <com/sun/star/awt/grid/XGridDataListener.hpp>
#include <com/sun/star/awt/grid/GridDataEvent.hpp>
#include <com/sun/star/awt/grid/XGridColumnModel.hpp>
#include <com/sun/star/awt/grid/XGridDataModel.hpp>
#include <com/sun/star/awt/grid/XGridSelectionListener.hpp>
-#include <toolkit/awt/vclxwindow.hxx>
-#include <toolkit/awt/vclxwindows.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <cppuhelper/implbase2.hxx>
#include <com/sun/star/awt/grid/XGridColumn.hpp>
#include <com/sun/star/util/Color.hpp>
#include <com/sun/star/style/VerticalAlignment.hpp>
-#include <com/sun/star/style/HorizontalAlignment.hpp>
+/** === end UNO includes === **/
+#include <cppuhelper/implbase2.hxx>
+#include <rtl/ref.hxx>
-using namespace ::svt::table;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::awt::grid;
+#include <boost/noncopyable.hpp>
-class UnoControlTableColumn : public IColumnModel
-{
- private:
- ColumnID m_nID;
- String m_sName;
- bool m_bIsResizable;
- TableMetrics m_nWidth;
- TableMetrics m_nMinWidth;
- TableMetrics m_nMaxWidth;
- TableMetrics m_nPrefWidth;
- ::com::sun::star::style::HorizontalAlignment m_xHorizontalAlign;
-
- public:
- UnoControlTableColumn(Reference<XGridColumn>);
- UnoControlTableColumn();
-
- // IColumnModel overridables
- virtual ColumnID getID() const;
- virtual bool setID( const ColumnID _nID );
- virtual String getName() const;
- virtual void setName( const String& _rName );
- virtual bool isResizable() const;
- virtual void setResizable( bool _bResizable );
- virtual TableMetrics getWidth() const;
- virtual void setWidth( TableMetrics _nWidth );
- virtual TableMetrics getMinWidth() const;
- virtual void setMinWidth( TableMetrics _nMinWidth );
- virtual TableMetrics getMaxWidth() const;
- virtual void setMaxWidth( TableMetrics _nMaxWidth );
- virtual TableMetrics getPreferredWidth() const;
- virtual void setPreferredWidth( TableMetrics _nPrefWidth );
- virtual ::com::sun::star::style::HorizontalAlignment getHorizontalAlign();
- virtual void setHorizontalAlign(::com::sun::star::style::HorizontalAlignment _xAlign);
-};
-
-struct UnoControlTableModel_Impl;
-
-class UnoControlTableModel : public ITableModel
+// .....................................................................................................................
+namespace svt { namespace table
{
+// .....................................................................................................................
+
+ //==================================================================================================================
+ //= UnoControlTableModel
+ //==================================================================================================================
+ class UnoGridColumnFacade;
+ struct UnoControlTableModel_Impl;
+ class UnoControlTableModel : public ITableModel, public ITableDataSort
+ {
private:
UnoControlTableModel_Impl* m_pImpl;
@@ -97,84 +67,104 @@ class UnoControlTableModel : public ITableModel
UnoControlTableModel();
~UnoControlTableModel();
- /// returns the current row height, in 1/100 millimeters
- inline TableMetrics GetRowHeight() const { return getRowHeight(); }
- /// sets a new row height.
- void setRowHeight( TableMetrics _nHeight );
- /// sets a new row header width.
- void setRowHeaderWidth( TableMetrics _nWidth );
- /// sets a new column header height.
- void setColumnHeaderHeight( TableMetrics _nHeight );
-
- /// returns the height of the title row (containing the column headers)
- inline TableMetrics GetTitleHeight() const { return getColumnHeaderHeight(); }
- /// sets a new height for the title row (containing the column headers)
- void SetTitleHeight( TableMetrics _nHeight );
-
- /// returns the width of the handle column (containing the row headers)
- inline TableMetrics GetHandleWidth() const { return getRowHeaderWidth(); }
- /// sets a new width for the handle column (containing the row headers)
- void SetHandleWidth( TableMetrics _nWidth );
-
- /// sets the width of a column
- inline void SetColumnWidth( ColPos _nColumn, TableMetrics _nWidth100thMM );
- /// retrieves the width of a column, in 1/100th millimeters
- inline TableMetrics GetColumnWidth( ColPos _nColumn );
-
public:
// ITableModel overridables
- virtual TableSize getColumnCount() const;
- virtual TableSize getRowCount() const;
- virtual void setColumnCount(TableSize _nColCount);
- virtual void setRowCount(TableSize _nRowCount);
- virtual bool hasColumnHeaders() const;
- virtual bool hasRowHeaders() const;
- virtual void setRowHeaders(bool _bRowHeaders);
- virtual void setColumnHeaders(bool _bColumnHeaders);
- virtual bool isCellEditable( ColPos col, RowPos row ) const;
- virtual void addTableModelListener( const PTableModelListener& listener );
- virtual void removeTableModelListener( const PTableModelListener& listener );
- virtual PColumnModel getColumnModel( ColPos column );
- virtual std::vector<PColumnModel>& getColumnModel();
- virtual PColumnModel getColumnModelByID( ColumnID id );
- virtual PTableRenderer getRenderer() const;
- virtual PTableInputHandler getInputHandler() const;
- virtual TableMetrics getRowHeight() const;
- virtual TableMetrics getColumnHeaderHeight() const;
- virtual TableMetrics getRowHeaderWidth() const;
- virtual ScrollbarVisibility getVerticalScrollbarVisibility(int overAllHeight, int actHeight) const;
- virtual ScrollbarVisibility getHorizontalScrollbarVisibility(int overAllWidth, int actWidth) const;
- virtual void setVerticalScrollbarVisibility(bool _bVScroll) const;
- virtual void setHorizontalScrollbarVisibility(bool _bHScroll) const;
- virtual void setCellContent(const std::vector<std::vector< Any > >& cellContent);
- virtual std::vector<std::vector< Any > >& getCellContent();
- virtual void setRowHeaderName(const std::vector<rtl::OUString>& cellColumnContent);
- virtual std::vector<rtl::OUString>& getRowHeaderName();
- virtual ::com::sun::star::util::Color getLineColor();
- virtual void setLineColor(::com::sun::star::util::Color _rColor);
- virtual ::com::sun::star::util::Color getHeaderBackgroundColor();
- virtual void setHeaderBackgroundColor(::com::sun::star::util::Color _rColor);
- virtual ::com::sun::star::util::Color getTextColor();
- virtual void setTextColor(::com::sun::star::util::Color _rColor);
- virtual ::com::sun::star::util::Color getOddRowBackgroundColor();
- virtual void setOddRowBackgroundColor(::com::sun::star::util::Color _rColor);
- virtual ::com::sun::star::util::Color getEvenRowBackgroundColor();
- virtual void setEvenRowBackgroundColor(::com::sun::star::util::Color _rColor);
- virtual ::com::sun::star::style::VerticalAlignment getVerticalAlign();
- virtual void setVerticalAlign(::com::sun::star::style::VerticalAlignment _rAlign);
- virtual bool hasVerticalScrollbar();
- virtual bool hasHorizontalScrollbar();
-};
-
-inline void UnoControlTableModel::SetColumnWidth( ColPos _nColumn, TableMetrics _nWidth100thMM )
-{
- getColumnModel( _nColumn )->setWidth( _nWidth100thMM );
-}
+ virtual TableSize getColumnCount() const;
+ virtual TableSize getRowCount() const;
+ virtual bool hasColumnHeaders() const;
+ virtual bool hasRowHeaders() const;
+ virtual bool isCellEditable( ColPos col, RowPos row ) const;
+ virtual PColumnModel getColumnModel( ColPos column );
+ virtual PTableRenderer getRenderer() const;
+ virtual PTableInputHandler getInputHandler() const;
+ virtual TableMetrics getRowHeight() const;
+ virtual TableMetrics getColumnHeaderHeight() const;
+ virtual TableMetrics getRowHeaderWidth() const;
+ virtual ScrollbarVisibility getVerticalScrollbarVisibility() const;
+ virtual ScrollbarVisibility getHorizontalScrollbarVisibility() const;
+ virtual void addTableModelListener( const PTableModelListener& i_listener );
+ virtual void removeTableModelListener( const PTableModelListener& i_listener );
+ virtual void getCellContent( ColPos const i_col, RowPos const i_row, ::com::sun::star::uno::Any& o_cellContent );
+ virtual void getCellToolTip( ColPos const i_col, RowPos const i_row, ::com::sun::star::uno::Any & o_cellToolTip );
+ virtual ::com::sun::star::uno::Any getRowHeading( RowPos const i_rowPos ) const;
+ virtual ::boost::optional< ::Color > getLineColor() const;
+ virtual ::boost::optional< ::Color > getHeaderBackgroundColor() const;
+ virtual ::boost::optional< ::Color > getHeaderTextColor() const;
+ virtual ::boost::optional< ::Color > getTextColor() const;
+ virtual ::boost::optional< ::Color > getTextLineColor() const;
+ virtual ::boost::optional< ::std::vector< ::Color > >
+ getRowBackgroundColors() const;
+ virtual ::com::sun::star::style::VerticalAlignment
+ getVerticalAlign() const;
+ virtual ITableDataSort* getSortAdapter();
+
+ // ITableDataSort overridables
+ virtual void sortByColumn( ColPos const i_column, ColumnSortDirection const i_sortDirection );
+ virtual ColumnSort getCurrentSortOrder() const;
+
+ // column write access
+ void appendColumn( ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > const & i_column );
+ void insertColumn( ColPos const i_position, ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > const & i_column );
+ void removeColumn( ColPos const i_position );
+ void removeAllColumns();
+
+ // other operations
+ void setVerticalScrollbarVisibility( ScrollbarVisibility const i_visibility ) const;
+ void setHorizontalScrollbarVisibility( ScrollbarVisibility const i_visibility ) const;
+
+ void setDataModel( ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataModel > const & i_gridDataModel );
+ bool hasDataModel() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataModel >
+ getDataModel() const;
+ void setColumnModel( ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnModel > const & i_gridColumnModel );
+ bool hasColumnModel() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnModel >
+ getColumnModel() const;
+
+ void setRowHeaders(bool _bRowHeaders);
+ void setColumnHeaders(bool _bColumnHeaders);
+
+ void setRowHeight( TableMetrics _nHeight );
+ void setRowHeaderWidth( TableMetrics _nWidth );
+ void setColumnHeaderHeight( TableMetrics _nHeight );
+
+ void setLineColor( ::com::sun::star::uno::Any const & i_color );
+ void setHeaderBackgroundColor( ::com::sun::star::uno::Any const & i_color );
+ void setHeaderTextColor( ::com::sun::star::uno::Any const & i_color );
+ void setTextColor( ::com::sun::star::uno::Any const & i_color );
+ void setTextLineColor( ::com::sun::star::uno::Any const & i_color );
+ void setRowBackgroundColors( ::com::sun::star::uno::Any const & i_APIValue );
+
+ void setVerticalAlign(::com::sun::star::style::VerticalAlignment _rAlign);
+
+ // multiplexing of XGridDataListener events
+ void notifyRowsInserted( ::com::sun::star::awt::grid::GridDataEvent const & i_event ) const;
+ void notifyRowsRemoved( ::com::sun::star::awt::grid::GridDataEvent const & i_event ) const;
+ void notifyDataChanged( ::com::sun::star::awt::grid::GridDataEvent const & i_event ) const;
+
+ /// retrieves the index of a column within the model
+ ColPos getColumnPos( UnoGridColumnFacade const & i_column ) const;
+
+ /// notifies a change in a column belonging to the model
+ void notifyColumnChange( ColPos const i_columnPos, ColumnAttributeGroup const i_attributeGroup ) const;
+
+ /** notifies a change in all data represented by the model. To be used if you cannot specified the changed data
+ in more detail.
+ */
+ void notifyAllDataChanged() const;
+
+#ifdef DBG_UTIL
+ const char* checkInvariants() const;
+#endif
-inline TableMetrics UnoControlTableModel::GetColumnWidth( ColPos _nColumn )
-{
- return getColumnModel( _nColumn )->getWidth();
-}
- #endif // _UNOCONTROL_TABLEMODEL_HXX_
+ private:
+ void impl_notifyTableMetricsChanged() const;
+ };
+
+// .....................................................................................................................
+} } // svt::table
+// .....................................................................................................................
+
+#endif // _UNOCONTROL_TABLEMODEL_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/uno/unoevent.cxx b/svtools/source/uno/unoevent.cxx
index 7ae5fab30b7c..f06f809af319 100644
--- a/svtools/source/uno/unoevent.cxx
+++ b/svtools/source/uno/unoevent.cxx
@@ -31,11 +31,9 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <rtl/ustrbuf.hxx>
-
-
#include <tools/rtti.hxx>
#include <tools/solar.h>
-#include "unoevent.hxx"
+#include <svtools/unoevent.hxx>
#include <svl/macitem.hxx>
using namespace ::com::sun::star;
diff --git a/svtools/source/uno/unogridcolumnfacade.cxx b/svtools/source/uno/unogridcolumnfacade.cxx
new file mode 100755
index 000000000000..5f1286b90ed6
--- /dev/null
+++ b/svtools/source/uno/unogridcolumnfacade.cxx
@@ -0,0 +1,427 @@
+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svtools.hxx"
+
+#include "unogridcolumnfacade.hxx"
+#include "unocontroltablemodel.hxx"
+
+#include "svtools/table/defaultinputhandler.hxx"
+#include "svtools/table/gridtablerenderer.hxx"
+#include "svtools/table/tablecontrol.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/awt/grid/XGridColumn.hpp>
+#include <com/sun/star/view/SelectionType.hpp>
+#include <com/sun/star/awt/grid/XGridColumnListener.hpp>
+/** === end UNO includes === **/
+
+#include <comphelper/stlunosequence.hxx>
+#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
+#include <vcl/svapp.hxx>
+#include <osl/mutex.hxx>
+
+// .....................................................................................................................
+namespace svt { namespace table
+{
+// .....................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::awt::grid::XGridColumn;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::awt::grid::XGridColumnListener;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::awt::grid::GridColumnEvent;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::style::HorizontalAlignment_LEFT;
+ using ::com::sun::star::style::HorizontalAlignment;
+ /** === end UNO using === **/
+
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ template< class ATTRIBUTE_TYPE >
+ void lcl_set( Reference< XGridColumn > const & i_column, void ( SAL_CALL XGridColumn::*i_setter )( ATTRIBUTE_TYPE ),
+ ATTRIBUTE_TYPE i_value )
+ {
+ try
+ {
+ (i_column.get()->*i_setter) ( i_value );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ template< class ATTRIBUTE_TYPE >
+ ATTRIBUTE_TYPE lcl_get( Reference< XGridColumn > const & i_column, ATTRIBUTE_TYPE ( SAL_CALL XGridColumn::*i_getter )() )
+ {
+ ATTRIBUTE_TYPE value = ATTRIBUTE_TYPE();
+ try
+ {
+ value = (i_column.get()->*i_getter)();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return value;
+ }
+ }
+
+ //==================================================================================================================
+ //= ColumnChangeMultiplexer
+ //==================================================================================================================
+ typedef ::cppu::WeakImplHelper1 < XGridColumnListener
+ > ColumnChangeMultiplexer_Base;
+ class ColumnChangeMultiplexer :public ColumnChangeMultiplexer_Base
+ ,public ::boost::noncopyable
+ {
+ public:
+ ColumnChangeMultiplexer( UnoGridColumnFacade& i_colImpl );
+
+ void dispose();
+
+ protected:
+ ~ColumnChangeMultiplexer();
+
+ // XGridColumnListener
+ virtual void SAL_CALL columnChanged( const GridColumnEvent& i_event ) throw (RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const EventObject& i_event ) throw (RuntimeException);
+
+ private:
+ UnoGridColumnFacade* m_pColumnImplementation;
+ };
+
+ //------------------------------------------------------------------------------------------------------------------
+ ColumnChangeMultiplexer::ColumnChangeMultiplexer( UnoGridColumnFacade& i_colImpl )
+ :m_pColumnImplementation( &i_colImpl )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ColumnChangeMultiplexer::~ColumnChangeMultiplexer()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ColumnChangeMultiplexer::dispose()
+ {
+ DBG_TESTSOLARMUTEX();
+ m_pColumnImplementation = NULL;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL ColumnChangeMultiplexer::columnChanged( const GridColumnEvent& i_event ) throw (RuntimeException)
+ {
+ if ( i_event.AttributeName.equalsAscii( "DataColumnIndex" ) )
+ {
+ SolarMutexGuard aGuard;
+ if ( m_pColumnImplementation != NULL )
+ m_pColumnImplementation->dataColumnIndexChanged();
+ return;
+ }
+
+ ColumnAttributeGroup nChangedAttributes( COL_ATTRS_NONE );
+
+ if ( i_event.AttributeName.equalsAscii( "HorizontalAlign" ) )
+ nChangedAttributes |= COL_ATTRS_APPEARANCE;
+
+ if ( i_event.AttributeName.equalsAscii( "ColumnWidth" )
+ || i_event.AttributeName.equalsAscii( "MaxWidth" )
+ || i_event.AttributeName.equalsAscii( "MinWidth" )
+ || i_event.AttributeName.equalsAscii( "PreferredWidth" )
+ || i_event.AttributeName.equalsAscii( "Resizeable" )
+ || i_event.AttributeName.equalsAscii( "Flexibility" )
+ )
+ nChangedAttributes |= COL_ATTRS_WIDTH;
+
+ OSL_ENSURE( nChangedAttributes != COL_ATTRS_NONE,
+ "ColumnChangeMultiplexer::columnChanged: unknown column attributed changed!" );
+
+ SolarMutexGuard aGuard;
+ if ( m_pColumnImplementation != NULL )
+ m_pColumnImplementation->columnChanged( nChangedAttributes );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL ColumnChangeMultiplexer::disposing( const EventObject& i_event ) throw (RuntimeException)
+ {
+ OSL_UNUSED( i_event );
+ }
+
+ //==================================================================================================================
+ //= UnoGridColumnFacade
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ UnoGridColumnFacade::UnoGridColumnFacade( UnoControlTableModel const & i_owner, Reference< XGridColumn > const & i_gridColumn )
+ :m_pOwner( &i_owner )
+ ,m_nDataColumnIndex( -1 )
+ ,m_xGridColumn( i_gridColumn, UNO_QUERY_THROW )
+ ,m_pChangeMultiplexer( new ColumnChangeMultiplexer( *this ) )
+ {
+ m_xGridColumn->addGridColumnListener( m_pChangeMultiplexer.get() );
+ impl_updateDataColumnIndex_nothrow();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ UnoGridColumnFacade::~UnoGridColumnFacade()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::dispose()
+ {
+ DBG_TESTSOLARMUTEX();
+ ENSURE_OR_RETURN_VOID( m_pOwner != NULL, "UnoGridColumnFacade::dispose: already disposed!" );
+
+ m_xGridColumn->removeGridColumnListener( m_pChangeMultiplexer.get() );
+ m_pChangeMultiplexer->dispose();
+ m_pChangeMultiplexer.clear();
+ m_xGridColumn.clear();
+ m_pOwner = NULL;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::impl_updateDataColumnIndex_nothrow()
+ {
+ m_nDataColumnIndex = -1;
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ try
+ {
+ m_nDataColumnIndex = m_xGridColumn->getDataColumnIndex();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::dataColumnIndexChanged()
+ {
+ DBG_TESTSOLARMUTEX();
+ impl_updateDataColumnIndex_nothrow();
+ if ( m_pOwner != NULL )
+ m_pOwner->notifyAllDataChanged();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::columnChanged( ColumnAttributeGroup const i_attributeGroup )
+ {
+ DBG_TESTSOLARMUTEX();
+ if ( m_pOwner != NULL )
+ m_pOwner->notifyColumnChange( m_pOwner->getColumnPos( *this ), i_attributeGroup );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Any UnoGridColumnFacade::getID() const
+ {
+ Any aID;
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", aID );
+ try
+ {
+ aID = m_xGridColumn->getIdentifier();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return aID;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setID( const Any& i_ID )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ try
+ {
+ m_xGridColumn->setIdentifier( i_ID );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ String UnoGridColumnFacade::getName() const
+ {
+ ::rtl::OUString sName;
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", sName );
+ try
+ {
+ sName = m_xGridColumn->getTitle();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return sName;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setName( const String& _rName )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ try
+ {
+ m_xGridColumn->setTitle( _rName );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ String UnoGridColumnFacade::getHelpText() const
+ {
+ ::rtl::OUString sHelpText;
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", sHelpText );
+ try
+ {
+ sHelpText = m_xGridColumn->getHelpText();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return sHelpText;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setHelpText( const String& i_helpText )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ try
+ {
+ m_xGridColumn->setHelpText( i_helpText );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool UnoGridColumnFacade::isResizable() const
+ {
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", false );
+ return lcl_get( m_xGridColumn, &XGridColumn::getResizeable );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setResizable( bool i_resizable )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ lcl_set( m_xGridColumn, &XGridColumn::setResizeable, sal_Bool( i_resizable ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Int32 UnoGridColumnFacade::getFlexibility() const
+ {
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", 1 );
+ return lcl_get( m_xGridColumn, &XGridColumn::getFlexibility );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setFlexibility( sal_Int32 const i_flexibility )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ lcl_set( m_xGridColumn, &XGridColumn::setFlexibility, i_flexibility );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ TableMetrics UnoGridColumnFacade::getWidth() const
+ {
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", 0 );
+ return lcl_get( m_xGridColumn, &XGridColumn::getColumnWidth );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setWidth( TableMetrics _nWidth )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ lcl_set( m_xGridColumn, &XGridColumn::setColumnWidth, _nWidth );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ TableMetrics UnoGridColumnFacade::getMinWidth() const
+ {
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", 0 );
+ return lcl_get( m_xGridColumn, &XGridColumn::getMinWidth );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setMinWidth( TableMetrics _nMinWidth )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ lcl_set( m_xGridColumn, &XGridColumn::setMinWidth, _nMinWidth );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ TableMetrics UnoGridColumnFacade::getMaxWidth() const
+ {
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", 0 );
+ return lcl_get( m_xGridColumn, &XGridColumn::getMaxWidth );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setMaxWidth( TableMetrics _nMaxWidth )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ lcl_set( m_xGridColumn, &XGridColumn::setMinWidth, _nMaxWidth );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::com::sun::star::style::HorizontalAlignment UnoGridColumnFacade::getHorizontalAlign()
+ {
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", HorizontalAlignment_LEFT );
+ return lcl_get( m_xGridColumn, &XGridColumn::getHorizontalAlign );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setHorizontalAlign( com::sun::star::style::HorizontalAlignment _align )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ lcl_set( m_xGridColumn, &XGridColumn::setHorizontalAlign, _align );
+ }
+
+// .....................................................................................................................
+} } // svt::table
+// .....................................................................................................................
diff --git a/svtools/source/uno/unogridcolumnfacade.hxx b/svtools/source/uno/unogridcolumnfacade.hxx
new file mode 100755
index 000000000000..7499621ba8af
--- /dev/null
+++ b/svtools/source/uno/unogridcolumnfacade.hxx
@@ -0,0 +1,114 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SVTOOLS_GRIDCOLUMNFACADE_HXX
+#define SVTOOLS_GRIDCOLUMNFACADE_HXX
+
+#include "svtools/table/tablemodel.hxx"
+#include "svtools/table/tablecontrol.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/awt/grid/XGridColumn.hpp>
+#include <com/sun/star/style/VerticalAlignment.hpp>
+#include <com/sun/star/style/HorizontalAlignment.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/implbase2.hxx>
+#include <rtl/ref.hxx>
+
+#include <boost/noncopyable.hpp>
+
+// .....................................................................................................................
+namespace svt { namespace table
+{
+// .....................................................................................................................
+
+ //==================================================================================================================
+ //= UnoGridColumnFacade
+ //==================================================================================================================
+ class ColumnChangeMultiplexer;
+ class UnoControlTableModel;
+ class UnoGridColumnFacade :public IColumnModel
+ ,public ::boost::noncopyable
+ {
+ public:
+ UnoGridColumnFacade(
+ UnoControlTableModel const & i_owner,
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > const & i_gridColumn
+ );
+ ~UnoGridColumnFacade();
+
+ // IColumnModel overridables
+ virtual ::com::sun::star::uno::Any
+ getID() const;
+ virtual void setID( const ::com::sun::star::uno::Any& i_ID );
+ virtual String getName() const;
+ virtual void setName( const String& _rName );
+ virtual String getHelpText() const;
+ virtual void setHelpText( const String& i_helpText );
+ virtual bool isResizable() const;
+ virtual void setResizable( bool _bResizable );
+ virtual sal_Int32 getFlexibility() const;
+ virtual void setFlexibility( sal_Int32 const i_flexibility );
+ virtual TableMetrics getWidth() const;
+ virtual void setWidth( TableMetrics _nWidth );
+ virtual TableMetrics getMinWidth() const;
+ virtual void setMinWidth( TableMetrics _nMinWidth );
+ virtual TableMetrics getMaxWidth() const;
+ virtual void setMaxWidth( TableMetrics _nMaxWidth );
+ virtual ::com::sun::star::style::HorizontalAlignment getHorizontalAlign();
+ virtual void setHorizontalAlign(::com::sun::star::style::HorizontalAlignment _xAlign);
+
+ /** disposes the column wrapper
+
+ Note that the XGridColumn which is wrapped by the instance is <strong>not</strong> disposed, as we
+ do not own it.
+ */
+ void dispose();
+
+ sal_Int32
+ getDataColumnIndex() const { return m_nDataColumnIndex; }
+
+ // callbacks for the XGridColumnListener
+ void columnChanged( ColumnAttributeGroup const i_attributeGroup );
+ void dataColumnIndexChanged();
+
+ private:
+ void impl_updateDataColumnIndex_nothrow();
+
+ private:
+ UnoControlTableModel const * m_pOwner;
+ sal_Int32 m_nDataColumnIndex;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > m_xGridColumn;
+ ::rtl::Reference< ColumnChangeMultiplexer > m_pChangeMultiplexer;
+ };
+
+// .....................................................................................................................
+} } // svt::table
+// .....................................................................................................................
+
+#endif // SVTOOLS_GRIDCOLUMNFACADE_HXX
diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx
index a58ce80bdcad..e58a4789428b 100644
--- a/svtools/source/uno/unoiface.cxx
+++ b/svtools/source/uno/unoiface.cxx
@@ -32,12 +32,11 @@
#define _SVT_UNOIFACE_CXX
#include <tools/debug.hxx>
#include <vcl/svapp.hxx>
-
#include <svtools/svmedit.hxx>
#include <unoiface.hxx>
-#include "filedlg.hxx"
-#include "filectrl.hxx"
-#include "roadmap.hxx"
+#include <svtools/filedlg.hxx>
+#include <svtools/filectrl.hxx>
+#include <svtools/roadmap.hxx>
#include <svtools/fixedhyper.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
@@ -47,9 +46,8 @@
#include <toolkit/helper/property.hxx>
#include <svtools/fmtfield.hxx>
#include <svl/numuno.hxx>
-#include <calendar.hxx>
-#include <prgsbar.hxx>
-
+#include <svtools/calendar.hxx>
+#include <svtools/prgsbar.hxx>
#include <svtools/svtreebx.hxx>
#include "treecontrolpeer.hxx"
#include "svtxgridcontrol.hxx"
@@ -124,7 +122,7 @@ SAL_DLLPUBLIC_EXPORT Window* CreateWindow( VCLXWindow** ppNewComp, const ::com::
pWindow = new CalendarField( pParent, nWinBits);
static_cast<CalendarField*>(pWindow)->EnableToday();
static_cast<CalendarField*>(pWindow)->EnableNone();
- static_cast<CalendarField*>(pWindow)->EnableEmptyFieldValue( TRUE );
+ static_cast<CalendarField*>(pWindow)->EnableEmptyFieldValue( sal_True );
*ppNewComp = new SVTXDateField;
((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(DateField*)pWindow );
}
@@ -841,7 +839,7 @@ void SVTXFormattedField::SetWindow( Window* _pWindow )
{
VCLXSpinField::SetWindow(_pWindow);
if (GetFormattedField())
- GetFormattedField()->SetAutoColor(TRUE);
+ GetFormattedField()->SetAutoColor(sal_True);
}
// --------------------------------------------------------------------------------------
@@ -1651,7 +1649,7 @@ void SVTXRoadmap::ImplSetNewImage()
{
OSL_PRECOND( GetWindow(), "SVTXRoadmap::ImplSetNewImage: window is required to be not-NULL!" );
::svt::ORoadmap* pButton = static_cast< ::svt::ORoadmap* >( GetWindow() );
- pButton->SetRoadmapBitmap( GetBitmap() );
+ pButton->SetRoadmapBitmap( GetImage().GetBitmapEx() );
}
void SVTXRoadmap::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
@@ -2135,7 +2133,7 @@ void VCLXProgressBar::ImplUpdateValue()
}
// set progressbar value
- pProgressBar->SetValue( (USHORT) nPercent );
+ pProgressBar->SetValue( (sal_uInt16) nPercent );
}
}
diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx
index 37fcc45f20f9..4c20ca232902 100644
--- a/svtools/source/uno/unoimap.cxx
+++ b/svtools/source/uno/unoimap.cxx
@@ -37,21 +37,17 @@
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/drawing/PointSequence.hpp>
-
#include <comphelper/servicehelper.hxx>
#include <comphelper/propertysethelper.hxx>
#include <comphelper/propertysetinfo.hxx>
#include <cppuhelper/weakagg.hxx>
-
#include <cppuhelper/implbase3.hxx>
-
#include <list>
#include <rtl/uuid.h>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
-
-#include "unoevent.hxx"
-#include "unoimap.hxx"
+#include <svtools/unoevent.hxx>
+#include <svtools/unoimap.hxx>
#include <svtools/imap.hxx>
#include <svtools/imapcirc.hxx>
#include <svtools/imaprect.hxx>
@@ -97,7 +93,7 @@ class SvUnoImageMapObject : public OWeakAggObject,
public XUnoTunnel
{
public:
- SvUnoImageMapObject( UINT16 nType, const SvEventDescription* pSupportedMacroItems );
+ SvUnoImageMapObject( sal_uInt16 nType, const SvEventDescription* pSupportedMacroItems );
SvUnoImageMapObject( const IMapObject& rMapObject, const SvEventDescription* pSupportedMacroItems );
virtual ~SvUnoImageMapObject() throw();
@@ -130,10 +126,10 @@ public:
virtual Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw( RuntimeException );
private:
- static PropertySetInfo* createPropertySetInfo( UINT16 nType );
+ static PropertySetInfo* createPropertySetInfo( sal_uInt16 nType );
- UINT16 mnType;
+ sal_uInt16 mnType;
::rtl::OUString maURL;
::rtl::OUString maAltText;
@@ -149,7 +145,7 @@ private:
UNO3_GETIMPLEMENTATION_IMPL( SvUnoImageMapObject );
-PropertySetInfo* SvUnoImageMapObject::createPropertySetInfo( UINT16 nType )
+PropertySetInfo* SvUnoImageMapObject::createPropertySetInfo( sal_uInt16 nType )
{
switch( nType )
{
@@ -206,7 +202,7 @@ PropertySetInfo* SvUnoImageMapObject::createPropertySetInfo( UINT16 nType )
}
}
-SvUnoImageMapObject::SvUnoImageMapObject( UINT16 nType, const SvEventDescription* pSupportedMacroItems )
+SvUnoImageMapObject::SvUnoImageMapObject( sal_uInt16 nType, const SvEventDescription* pSupportedMacroItems )
: PropertySetHelper( createPropertySetInfo( nType ) ),
mnType( nType )
, mbIsActive( true )
@@ -254,11 +250,11 @@ SvUnoImageMapObject::SvUnoImageMapObject( const IMapObject& rMapObject, const Sv
{
const Polygon aPoly( ((IMapPolygonObject*)&rMapObject)->GetPolygon(sal_False) );
- const USHORT nCount = aPoly.GetSize();
+ const sal_uInt16 nCount = aPoly.GetSize();
maPolygon.realloc( nCount );
awt::Point* pPoints = maPolygon.getArray();
- for( USHORT nPoint = 0; nPoint < nCount; nPoint++ )
+ for( sal_uInt16 nPoint = 0; nPoint < nCount; nPoint++ )
{
const Point& rPoint = aPoly.GetPoint( nPoint );
pPoints->X = rPoint.X();
@@ -610,8 +606,8 @@ SvUnoImageMap::SvUnoImageMap( const ImageMap& rMap, const SvEventDescription* pS
{
maName = rMap.GetName();
- const UINT16 nCount = rMap.GetIMapObjectCount();
- for( UINT16 nPos = 0; nPos < nCount; nPos++ )
+ const sal_uInt16 nCount = rMap.GetIMapObjectCount();
+ for( sal_uInt16 nPos = 0; nPos < nCount; nPos++ )
{
IMapObject* pMapObject = rMap.GetIMapObject( nPos );
SvUnoImageMapObject* pUnoObj = new SvUnoImageMapObject( *pMapObject, pSupportedMacroItems );
diff --git a/svtools/source/uno/wizard/makefile.mk b/svtools/source/uno/wizard/makefile.mk
deleted file mode 100644
index 521496fc5d48..000000000000
--- a/svtools/source/uno/wizard/makefile.mk
+++ /dev/null
@@ -1,48 +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.
-#
-#*************************************************************************
-
-PRJ=../../..
-
-PRJNAME=svtools
-TARGET=unowiz
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/unowizard.obj \
- $(SLO)$/wizardshell.obj \
- $(SLO)$/wizardpagecontroller.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svtools/source/uno/wizard/unowizard.cxx b/svtools/source/uno/wizard/unowizard.cxx
index e9300e2e12eb..e8d7adaf58a2 100644
--- a/svtools/source/uno/wizard/unowizard.cxx
+++ b/svtools/source/uno/wizard/unowizard.cxx
@@ -43,6 +43,7 @@
#include <rtl/strbuf.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
+#include <tools/urlobj.hxx>
//......................................................................................................................
namespace svt { namespace uno
@@ -207,11 +208,32 @@ namespace svt { namespace uno
m_bInitialized = true;
}
+ static rtl::OString lcl_getHelpId( const ::rtl::OUString& _rHelpURL )
+ {
+ INetURLObject aHID( _rHelpURL );
+ if ( aHID.GetProtocol() == INET_PROT_HID )
+ return rtl::OUStringToOString( aHID.GetURLPath(), RTL_TEXTENCODING_UTF8 );
+ else
+ return rtl::OUStringToOString( _rHelpURL, RTL_TEXTENCODING_UTF8 );
+ }
+
+ //------------------------------------------------------------------------
+ static ::rtl::OUString lcl_getHelpURL( const rtl::OString& sHelpId )
+ {
+ ::rtl::OUStringBuffer aBuffer;
+ ::rtl::OUString aTmp( sHelpId, sHelpId.getLength(), RTL_TEXTENCODING_UTF8 );
+ INetURLObject aHID( aTmp );
+ if ( aHID.GetProtocol() == INET_PROT_NOT_VALID )
+ aBuffer.appendAscii( INET_HID_SCHEME );
+ aBuffer.append( aTmp.getStr() );
+ return aBuffer.makeStringAndClear();
+ }
+
//--------------------------------------------------------------------
Dialog* Wizard::createDialog( Window* i_pParent )
{
WizardShell* pDialog( new WizardShell( i_pParent, this, m_xController, m_aWizardSteps ) );
- pDialog->SetSmartHelpId( SmartId( m_sHelpURL ) );
+ pDialog->SetHelpId( lcl_getHelpId( m_sHelpURL ) );
pDialog->setTitleBase( m_sTitle );
return pDialog;
}
@@ -220,7 +242,7 @@ namespace svt { namespace uno
void Wizard::destroyDialog()
{
if ( m_pDialog )
- m_sHelpURL = m_pDialog->GetSmartHelpId().GetStr();
+ m_sHelpURL = lcl_getHelpURL( m_pDialog->GetHelpId() );
Wizard_Base::destroyDialog();
}
@@ -280,8 +302,7 @@ namespace svt { namespace uno
if ( !m_pDialog )
return m_sHelpURL;
- const SmartId aSmartId( m_pDialog->GetSmartHelpId() );
- return aSmartId.GetStr();
+ return lcl_getHelpURL( m_pDialog->GetHelpId() );
}
//------------------------------------------------------------------------------------------------------------------
@@ -293,7 +314,7 @@ namespace svt { namespace uno
if ( !m_pDialog )
m_sHelpURL = i_HelpURL;
else
- m_pDialog->SetSmartHelpId( SmartId( i_HelpURL ) );
+ m_pDialog->SetHelpId( lcl_getHelpId( i_HelpURL ) );
}
//------------------------------------------------------------------------------------------------------------------
diff --git a/svtools/source/uno/wizard/wizardpagecontroller.cxx b/svtools/source/uno/wizard/wizardpagecontroller.cxx
index fc6ab72ff6e9..eec2fe98dfde 100644
--- a/svtools/source/uno/wizard/wizardpagecontroller.cxx
+++ b/svtools/source/uno/wizard/wizardpagecontroller.cxx
@@ -76,7 +76,7 @@ namespace svt { namespace uno
try
{
m_xWizardPage.set( m_xController->createPage(
- Reference< XWindow >( i_rParent.GetComponentInterface( TRUE ), UNO_QUERY_THROW ),
+ Reference< XWindow >( i_rParent.GetComponentInterface( sal_True ), UNO_QUERY_THROW ),
m_nPageId
), UNO_SET_THROW );
diff --git a/svtools/source/urlobj/inetimg.cxx b/svtools/source/urlobj/inetimg.cxx
index cf6f211a739c..1994acdf5ceb 100644
--- a/svtools/source/urlobj/inetimg.cxx
+++ b/svtools/source/urlobj/inetimg.cxx
@@ -32,11 +32,11 @@
#include <sot/formats.hxx>
#include <tools/stream.hxx>
-#include "inetimg.hxx"
+#include <svtools/inetimg.hxx>
#define TOKEN_SEPARATOR '\001'
-sal_Bool INetImage::Write( SvStream& rOStm, ULONG nFormat ) const
+sal_Bool INetImage::Write( SvStream& rOStm, sal_uLong nFormat ) const
{
sal_Bool bRet = sal_False;
switch( nFormat )
@@ -66,7 +66,7 @@ sal_Bool INetImage::Write( SvStream& rOStm, ULONG nFormat ) const
return bRet;
}
-sal_Bool INetImage::Read( SvStream& rIStm, ULONG nFormat )
+sal_Bool INetImage::Read( SvStream& rIStm, sal_uLong nFormat )
{
sal_Bool bRet = sal_False;
switch( nFormat )
@@ -93,12 +93,12 @@ sal_Bool INetImage::Read( SvStream& rIStm, ULONG nFormat )
/*
--> structure size MUST - alignment of 4!
int iSize; // size of all data, including variable length strings
- BOOL bIsMap; // For server side maps
- INT32 iWidth; // Fixed size data correspond to fields in LO_ImageDataStruct
- INT32 iHeight; // and EDT_ImageData
- INT32 iHSpace;
- INT32 iVSpace;
- INT32 iBorder;
+ sal_Bool bIsMap; // For server side maps
+ sal_Int32 iWidth; // Fixed size data correspond to fields in LO_ImageDataStruct
+ sal_Int32 iHeight; // and EDT_ImageData
+ sal_Int32 iHSpace;
+ sal_Int32 iVSpace;
+ sal_Int32 iBorder;
int iLowResOffset; // Offsets into string_data. If 0, string is NULL (not used)
int iAltOffset; // (alternate text?)
int iAnchorOffset; // HREF in image
@@ -110,12 +110,12 @@ sal_Bool INetImage::Read( SvStream& rIStm, ULONG nFormat )
ByteString sData;
nFilePos = rIStm.Tell();
- // skip over iSize (int), bIsMao ( BOOL ) alignment of 4 !!!!
+ // skip over iSize (int), bIsMao ( sal_Bool ) alignment of 4 !!!!
rIStm.SeekRel( 8 );
rIStm >> nVal; aSizePixel.Width() = nVal;
rIStm >> nVal; aSizePixel.Height() = nVal;
// skip over iHSpace, iVSpace, iBorder, iLowResOffset
- rIStm.SeekRel( 3 * sizeof( INT32 ) + sizeof( int ) );
+ rIStm.SeekRel( 3 * sizeof( sal_Int32 ) + sizeof( int ) );
rIStm >> nAltOffset;
rIStm >> nAnchorOffset;
// skip over iExtraHTML_Offset
diff --git a/svtools/source/urlobj/makefile.mk b/svtools/source/urlobj/makefile.mk
deleted file mode 100644
index c75e592ea10b..000000000000
--- a/svtools/source/urlobj/makefile.mk
+++ /dev/null
@@ -1,46 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=urlobj
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(SLO)$/inetimg.obj
-
-# --- Tagets -------------------------------------------------------
-
-.INCLUDE : target.mk
-