summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/aqua/inc/aqua11yfactory.h4
-rw-r--r--vcl/aqua/inc/aqua11ywrapper.h16
-rw-r--r--vcl/aqua/inc/aquaprintview.h2
-rw-r--r--vcl/aqua/inc/salbmp.h6
-rw-r--r--vcl/aqua/inc/saldata.hxx2
-rw-r--r--vcl/aqua/inc/salframe.h42
-rw-r--r--vcl/aqua/inc/salframeview.h33
-rw-r--r--vcl/aqua/inc/salgdi.h62
-rw-r--r--vcl/aqua/inc/salinst.h29
-rw-r--r--vcl/aqua/inc/salmenu.h18
-rw-r--r--vcl/aqua/inc/salobj.h9
-rw-r--r--vcl/aqua/inc/salprn.h40
-rw-r--r--vcl/aqua/inc/salsys.h5
-rw-r--r--vcl/aqua/inc/saltimer.h2
-rw-r--r--vcl/aqua/inc/salvd.h4
-rw-r--r--vcl/aqua/inc/vclnsapp.h8
-rw-r--r--vcl/aqua/source/a11y/aqua11ycomponentwrapper.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm4
-rw-r--r--vcl/aqua/source/a11y/aqua11yfactory.mm4
-rw-r--r--vcl/aqua/source/a11y/aqua11yselectionwrapper.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11yselectionwrapper.mm2
-rw-r--r--vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm10
-rw-r--r--vcl/aqua/source/a11y/aqua11ytextwrapper.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ytextwrapper.mm4
-rw-r--r--vcl/aqua/source/a11y/aqua11yvaluewrapper.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11yvaluewrapper.mm4
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrapper.mm28
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappercheckbox.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappercombobox.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappercombobox.mm2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrapperradiobutton.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm2
-rw-r--r--vcl/aqua/source/app/salinst.cxx58
-rw-r--r--vcl/aqua/source/app/salsys.cxx101
-rw-r--r--vcl/aqua/source/app/saltimer.cxx6
-rwxr-xr-xvcl/aqua/source/app/vclnsapp.mm83
-rw-r--r--vcl/aqua/source/dtrans/DataFlavorMapping.cxx10
-rw-r--r--vcl/aqua/source/dtrans/DragSource.cxx29
-rw-r--r--vcl/aqua/source/dtrans/DragSource.hxx4
-rw-r--r--vcl/aqua/source/dtrans/DropTarget.cxx8
-rw-r--r--vcl/aqua/source/dtrans/DropTarget.hxx8
-rw-r--r--vcl/aqua/source/dtrans/aqua_service.cxx22
-rw-r--r--vcl/aqua/source/dtrans/service_entry.cxx24
-rw-r--r--vcl/aqua/source/gdi/aquaprintaccessoryview.mm737
-rwxr-xr-xvcl/aqua/source/gdi/aquaprintview.mm2
-rw-r--r--vcl/aqua/source/gdi/salatslayout.cxx2
-rw-r--r--vcl/aqua/source/gdi/salbmp.cxx16
-rw-r--r--vcl/aqua/source/gdi/salgdi.cxx161
-rw-r--r--vcl/aqua/source/gdi/salgdiutils.cxx4
-rw-r--r--vcl/aqua/source/gdi/salnativewidgets.cxx64
-rw-r--r--vcl/aqua/source/gdi/salprn.cxx78
-rw-r--r--vcl/aqua/source/gdi/salvd.cxx31
-rw-r--r--vcl/aqua/source/window/salframe.cxx245
-rwxr-xr-xvcl/aqua/source/window/salframeview.mm112
-rw-r--r--vcl/aqua/source/window/salmenu.cxx35
-rw-r--r--vcl/aqua/source/window/salobj.cxx14
-rw-r--r--vcl/inc/cupsmgr.hxx4
-rw-r--r--vcl/inc/vcl/abstdlg.hxx2
-rw-r--r--vcl/inc/vcl/accel.h6
-rw-r--r--vcl/inc/vcl/accel.hxx54
-rw-r--r--vcl/inc/vcl/accmgr.hxx8
-rw-r--r--vcl/inc/vcl/alpha.hxx42
-rw-r--r--vcl/inc/vcl/animate.hxx86
-rw-r--r--vcl/inc/vcl/apptypes.hxx24
-rw-r--r--vcl/inc/vcl/arrange.hxx77
-rw-r--r--vcl/inc/vcl/bitmap.hxx256
-rw-r--r--vcl/inc/vcl/bitmapex.hxx94
-rw-r--r--vcl/inc/vcl/bmpacc.hxx78
-rw-r--r--vcl/inc/vcl/brdwin.hxx190
-rw-r--r--vcl/inc/vcl/btndlg.hxx56
-rw-r--r--vcl/inc/vcl/button.hxx131
-rw-r--r--vcl/inc/vcl/canvasbitmap.hxx2
-rw-r--r--vcl/inc/vcl/cmdevt.hxx208
-rw-r--r--vcl/inc/vcl/combobox.h8
-rw-r--r--vcl/inc/vcl/combobox.hxx100
-rw-r--r--vcl/inc/vcl/ctrl.hxx10
-rw-r--r--vcl/inc/vcl/cursor.hxx18
-rw-r--r--vcl/inc/vcl/cvtgrf.hxx8
-rw-r--r--vcl/inc/vcl/cvtsvm.hxx8
-rw-r--r--vcl/inc/vcl/dbggui.hxx2
-rw-r--r--vcl/inc/vcl/decoview.hxx74
-rw-r--r--vcl/inc/vcl/dialog.hxx28
-rw-r--r--vcl/inc/vcl/displayconnectiondispatch.hxx52
-rw-r--r--vcl/inc/vcl/dllapi.h6
-rw-r--r--vcl/inc/vcl/dockingarea.hxx2
-rw-r--r--vcl/inc/vcl/dockwin.hxx132
-rwxr-xr-x[-rw-r--r--]vcl/inc/vcl/edit.hxx44
-rw-r--r--vcl/inc/vcl/event.hxx190
-rw-r--r--vcl/inc/vcl/evntpost.hxx4
-rw-r--r--vcl/inc/vcl/field.hxx200
-rw-r--r--vcl/inc/vcl/fixbrd.hxx16
-rw-r--r--vcl/inc/vcl/fixed.hxx28
-rw-r--r--vcl/inc/vcl/fldunit.hxx36
-rw-r--r--vcl/inc/vcl/floatwin.hxx128
-rw-r--r--vcl/inc/vcl/fntstyle.hxx2
-rw-r--r--vcl/inc/vcl/font.hxx28
-rw-r--r--vcl/inc/vcl/fontcache.hxx2
-rw-r--r--vcl/inc/vcl/fontmanager.hxx2
-rw-r--r--vcl/inc/vcl/gdimtf.hxx70
-rw-r--r--vcl/inc/vcl/gfxlink.hxx38
-rw-r--r--vcl/inc/vcl/glyphcache.hxx37
-rw-r--r--vcl/inc/vcl/gradient.hxx50
-rw-r--r--vcl/inc/vcl/graph.h8
-rw-r--r--vcl/inc/vcl/graph.hxx44
-rw-r--r--vcl/inc/vcl/graphite_layout.hxx4
-rw-r--r--vcl/inc/vcl/graphite_serverfont.hxx6
-rw-r--r--vcl/inc/vcl/group.hxx6
-rw-r--r--vcl/inc/vcl/hatch.hxx16
-rw-r--r--vcl/inc/vcl/help.hxx75
-rw-r--r--vcl/inc/vcl/helpwin.hxx17
-rw-r--r--vcl/inc/vcl/i18nhelp.hxx2
-rw-r--r--vcl/inc/vcl/idlemgr.hxx2
-rw-r--r--vcl/inc/vcl/ilstbox.hxx318
-rw-r--r--vcl/inc/vcl/image.h42
-rw-r--r--vcl/inc/vcl/image.hxx52
-rw-r--r--vcl/inc/vcl/imgctrl.hxx12
-rw-r--r--vcl/inc/vcl/impbmp.hxx24
-rw-r--r--vcl/inc/vcl/impfont.hxx28
-rw-r--r--vcl/inc/vcl/impgraph.hxx52
-rw-r--r--vcl/inc/vcl/impoct.hxx16
-rw-r--r--vcl/inc/vcl/inputctx.hxx22
-rw-r--r--vcl/inc/vcl/javachild.hxx2
-rw-r--r--vcl/inc/vcl/jobdata.hxx4
-rw-r--r--vcl/inc/vcl/jobset.h10
-rw-r--r--vcl/inc/vcl/jobset.hxx4
-rw-r--r--vcl/inc/vcl/keycod.hxx44
-rw-r--r--vcl/inc/vcl/keycodes.hxx264
-rw-r--r--vcl/inc/vcl/lazydelete.hxx39
-rw-r--r--vcl/inc/vcl/lineinfo.hxx24
-rw-r--r--vcl/inc/vcl/longcurr.hxx26
-rw-r--r--vcl/inc/vcl/lstbox.h8
-rw-r--r--vcl/inc/vcl/lstbox.hxx116
-rw-r--r--vcl/inc/vcl/mapmod.hxx14
-rw-r--r--vcl/inc/vcl/mapunit.hxx36
-rw-r--r--vcl/inc/vcl/menu.hxx280
-rw-r--r--vcl/inc/vcl/menubtn.hxx12
-rw-r--r--vcl/inc/vcl/metaact.hxx112
-rw-r--r--vcl/inc/vcl/metric.hxx38
-rw-r--r--vcl/inc/vcl/mnemonic.hxx8
-rw-r--r--vcl/inc/vcl/mnemonicengine.hxx6
-rw-r--r--vcl/inc/vcl/morebtn.hxx14
-rw-r--r--vcl/inc/vcl/msgbox.hxx18
-rw-r--r--vcl/inc/vcl/octree.hxx54
-rw-r--r--vcl/inc/vcl/outdev.h30
-rwxr-xr-x[-rw-r--r--]vcl/inc/vcl/outdev.hxx399
-rw-r--r--vcl/inc/vcl/outfont.hxx34
-rw-r--r--vcl/inc/vcl/pdfextoutdevdata.hxx2
-rw-r--r--vcl/inc/vcl/pdfwriter.hxx135
-rw-r--r--vcl/inc/vcl/pointr.hxx4
-rw-r--r--vcl/inc/vcl/polyscan.hxx20
-rw-r--r--vcl/inc/vcl/ppdparser.hxx8
-rw-r--r--vcl/inc/vcl/print.h2
-rw-r--r--vcl/inc/vcl/print.hxx199
-rw-r--r--vcl/inc/vcl/printergfx.hxx6
-rw-r--r--vcl/inc/vcl/printerinfomanager.hxx6
-rw-r--r--vcl/inc/vcl/prndlg.hxx22
-rw-r--r--vcl/inc/vcl/prntypes.hxx75
-rw-r--r--vcl/inc/vcl/ptrstyle.hxx2
-rw-r--r--vcl/inc/vcl/quickselectionengine.hxx95
-rw-r--r--vcl/inc/vcl/regband.hxx22
-rw-r--r--vcl/inc/vcl/region.h16
-rwxr-xr-x[-rw-r--r--]vcl/inc/vcl/region.hxx55
-rw-r--r--vcl/inc/vcl/salatype.hxx50
-rw-r--r--vcl/inc/vcl/salbmp.hxx8
-rw-r--r--vcl/inc/vcl/salbtype.hxx324
-rw-r--r--vcl/inc/vcl/salctrlhandle.hxx51
-rw-r--r--vcl/inc/vcl/salctype.hxx22
-rw-r--r--vcl/inc/vcl/saldatabasic.hxx12
-rw-r--r--vcl/inc/vcl/salframe.hxx109
-rwxr-xr-x[-rw-r--r--]vcl/inc/vcl/salgdi.hxx106
-rw-r--r--vcl/inc/vcl/salgtype.hxx14
-rw-r--r--vcl/inc/vcl/salimestatus.hxx2
-rw-r--r--vcl/inc/vcl/salinst.hxx63
-rw-r--r--vcl/inc/vcl/sallayout.hxx12
-rw-r--r--vcl/inc/vcl/salmenu.hxx22
-rwxr-xr-x[-rw-r--r--]vcl/inc/vcl/salnativewidgets.hxx37
-rw-r--r--vcl/inc/vcl/salobj.hxx34
-rw-r--r--vcl/inc/vcl/salprn.hxx40
-rw-r--r--vcl/inc/vcl/salptype.hxx8
-rw-r--r--vcl/inc/vcl/salsession.hxx2
-rw-r--r--vcl/inc/vcl/salsys.hxx2
-rw-r--r--vcl/inc/vcl/saltimer.hxx4
-rw-r--r--vcl/inc/vcl/salvd.hxx4
-rw-r--r--vcl/inc/vcl/salwtype.hxx234
-rw-r--r--vcl/inc/vcl/scrbar.hxx28
-rw-r--r--vcl/inc/vcl/seleng.hxx106
-rw-r--r--vcl/inc/vcl/settings.hxx606
-rw-r--r--vcl/inc/vcl/slider.hxx28
-rw-r--r--vcl/inc/vcl/smartid.hxx90
-rw-r--r--vcl/inc/vcl/sndstyle.hxx2
-rw-r--r--vcl/inc/vcl/spin.h8
-rw-r--r--vcl/inc/vcl/spin.hxx26
-rw-r--r--vcl/inc/vcl/spinfld.hxx8
-rw-r--r--vcl/inc/vcl/split.hxx10
-rw-r--r--vcl/inc/vcl/splitwin.hxx156
-rw-r--r--vcl/inc/vcl/status.hxx120
-rw-r--r--vcl/inc/vcl/stdtext.hxx6
-rw-r--r--vcl/inc/vcl/strhelper.hxx6
-rw-r--r--vcl/inc/vcl/svapp.hxx190
-rw-r--r--vcl/inc/vcl/svcompat.hxx22
-rw-r--r--vcl/inc/vcl/svdata.hxx166
-rw-r--r--vcl/inc/vcl/svids.hrc19
-rw-r--r--vcl/inc/vcl/symbol.hxx5
-rw-r--r--vcl/inc/vcl/syschild.hxx15
-rw-r--r--vcl/inc/vcl/sysdata.hxx1
-rw-r--r--vcl/inc/vcl/syswin.hxx96
-rw-r--r--vcl/inc/vcl/tabctrl.hxx105
-rw-r--r--vcl/inc/vcl/tabdlg.hxx2
-rw-r--r--vcl/inc/vcl/tabpage.hxx2
-rw-r--r--vcl/inc/vcl/taskpanelist.hxx10
-rwxr-xr-x[-rw-r--r--]vcl/inc/vcl/textlayout.hxx2
-rw-r--r--vcl/inc/vcl/throbber.hxx101
-rw-r--r--vcl/inc/vcl/timer.hxx12
-rw-r--r--vcl/inc/vcl/toolbox.h32
-rw-r--r--vcl/inc/vcl/toolbox.hxx392
-rw-r--r--vcl/inc/vcl/vclenum.hxx2
-rw-r--r--vcl/inc/vcl/vclevent.hxx26
-rw-r--r--vcl/inc/vcl/virdev.hxx22
-rw-r--r--vcl/inc/vcl/wall.hxx18
-rw-r--r--vcl/inc/vcl/wall2.hxx2
-rw-r--r--vcl/inc/vcl/windata.hxx52
-rw-r--r--vcl/inc/vcl/window.h125
-rwxr-xr-x[-rw-r--r--]vcl/inc/vcl/window.hxx708
-rw-r--r--vcl/inc/vcl/wintypes.hxx35
-rw-r--r--vcl/inc/vcl/wpropset.hxx (renamed from vcl/inc/vcl/impbmpconv.hxx)37
-rw-r--r--vcl/inc/vcl/wrkwin.hxx34
-rw-r--r--vcl/inc/vcl/xconnection.hxx15
-rw-r--r--vcl/os2/inc/salgdi.h12
-rw-r--r--vcl/os2/inc/salinst.h5
-rw-r--r--vcl/os2/inc/salobj.h1
-rw-r--r--vcl/os2/source/app/salinst.cxx14
-rw-r--r--vcl/os2/source/gdi/salgdi.cxx50
-rw-r--r--vcl/os2/source/gdi/salgdi3.cxx10
-rw-r--r--vcl/os2/source/window/makefile.mk2
-rw-r--r--vcl/os2/source/window/salframe.cxx51
-rw-r--r--vcl/os2/source/window/salmenu.cxx134
-rw-r--r--vcl/os2/source/window/salobj.cxx6
-rw-r--r--vcl/prj/build.lst9
-rw-r--r--vcl/prj/d.lst14
-rw-r--r--vcl/qa/complex/memCheck/CheckMemoryUsage.java600
-rw-r--r--vcl/qa/complex/memCheck/FileHelper.java90
-rw-r--r--vcl/qa/complex/memCheck/TestDocument.java45
-rwxr-xr-xvcl/qa/complex/memCheck/makefile.mk138
-rwxr-xr-xvcl/qa/complex/memCheck/testdocuments/CalcDoc.sxc (renamed from vcl/qa/testdocuments/CalcDoc.sxc)bin9547 -> 9547 bytes
-rwxr-xr-xvcl/qa/complex/memCheck/testdocuments/ImpressDoc.sxi (renamed from vcl/qa/testdocuments/ImpressDoc.sxi)bin35135 -> 35135 bytes
-rwxr-xr-xvcl/qa/complex/memCheck/testdocuments/WriterDoc.sxw (renamed from vcl/qa/testdocuments/WriterDoc.sxw)bin5754 -> 5754 bytes
-rw-r--r--vcl/qa/complex/persistent_window_states/DocumentHandle.java11
-rw-r--r--vcl/qa/complex/persistent_window_states/PersistentWindowTest.java420
-rw-r--r--vcl/qa/complex/persistent_window_states/makefile.mk62
-rw-r--r--vcl/source/app/dbggui.cxx227
-rw-r--r--vcl/source/app/help.cxx170
-rw-r--r--vcl/source/app/i18nhelp.cxx10
-rw-r--r--vcl/source/app/idlemgr.cxx16
-rw-r--r--vcl/source/app/salvtables.cxx37
-rw-r--r--vcl/source/app/session.cxx44
-rw-r--r--vcl/source/app/settings.cxx257
-rw-r--r--vcl/source/app/sound.cxx5
-rw-r--r--vcl/source/app/stdtext.cxx4
-rw-r--r--vcl/source/app/svapp.cxx218
-rw-r--r--vcl/source/app/svdata.cxx153
-rw-r--r--vcl/source/app/svmain.cxx57
-rw-r--r--vcl/source/app/svmainhook.cxx10
-rw-r--r--vcl/source/app/timer.cxx64
-rw-r--r--vcl/source/app/unohelp2.cxx4
-rw-r--r--vcl/source/app/vclevent.cxx10
-rw-r--r--vcl/source/components/factory.cxx66
-rw-r--r--vcl/source/components/makefile.mk7
-rw-r--r--vcl/source/components/stringmirror.cxx123
-rw-r--r--vcl/source/control/button.cxx512
-rw-r--r--vcl/source/control/combobox.cxx254
-rw-r--r--vcl/source/control/ctrl.cxx24
-rwxr-xr-x[-rw-r--r--]vcl/source/control/edit.cxx299
-rw-r--r--vcl/source/control/field.cxx343
-rw-r--r--vcl/source/control/field2.cxx542
-rw-r--r--vcl/source/control/fixbrd.cxx24
-rw-r--r--vcl/source/control/fixed.cxx155
-rw-r--r--vcl/source/control/group.cxx30
-rw-r--r--vcl/source/control/ilstbox.cxx823
-rw-r--r--vcl/source/control/imgctrl.cxx184
-rw-r--r--vcl/source/control/longcurr.cxx128
-rw-r--r--vcl/source/control/lstbox.cxx214
-rw-r--r--vcl/source/control/makefile.mk37
-rw-r--r--vcl/source/control/menubtn.cxx19
-rw-r--r--vcl/source/control/morebtn.cxx8
-rw-r--r--vcl/source/control/quickselectionengine.cxx183
-rw-r--r--vcl/source/control/scrbar.cxx199
-rw-r--r--vcl/source/control/slider.cxx105
-rw-r--r--vcl/source/control/spinbtn.cxx68
-rw-r--r--vcl/source/control/spinfld.cxx106
-rw-r--r--vcl/source/control/tabctrl.cxx441
-rw-r--r--vcl/source/control/throbber.cxx325
-rw-r--r--vcl/source/fontsubset/gsub.cxx132
-rw-r--r--vcl/source/fontsubset/sft.cxx2
-rw-r--r--vcl/source/gdi/alpha.cxx58
-rw-r--r--vcl/source/gdi/animate.cxx200
-rw-r--r--vcl/source/gdi/bitmap.cxx242
-rw-r--r--vcl/source/gdi/bitmap2.cxx266
-rw-r--r--vcl/source/gdi/bitmap3.cxx370
-rw-r--r--vcl/source/gdi/bitmap4.cxx154
-rw-r--r--vcl/source/gdi/bitmapex.cxx134
-rw-r--r--vcl/source/gdi/bmpacc.cxx30
-rw-r--r--vcl/source/gdi/bmpacc2.cxx8
-rw-r--r--vcl/source/gdi/bmpacc3.cxx24
-rw-r--r--vcl/source/gdi/bmpconv.cxx18
-rw-r--r--vcl/source/gdi/bmpfast.cxx34
-rw-r--r--vcl/source/gdi/cvtgrf.cxx22
-rw-r--r--vcl/source/gdi/cvtsvm.cxx612
-rw-r--r--vcl/source/gdi/font.cxx76
-rw-r--r--vcl/source/gdi/gdimtf.cxx300
-rw-r--r--vcl/source/gdi/gfxlink.cxx40
-rw-r--r--vcl/source/gdi/gradient.cxx28
-rw-r--r--vcl/source/gdi/graph.cxx72
-rw-r--r--vcl/source/gdi/graphictools.cxx20
-rw-r--r--vcl/source/gdi/hatch.cxx10
-rw-r--r--vcl/source/gdi/image.cxx82
-rw-r--r--vcl/source/gdi/impanmvw.cxx42
-rw-r--r--vcl/source/gdi/impanmvw.hxx30
-rw-r--r--vcl/source/gdi/impbmp.cxx16
-rw-r--r--vcl/source/gdi/impgraph.cxx186
-rw-r--r--vcl/source/gdi/impimage.cxx70
-rw-r--r--vcl/source/gdi/impvect.cxx192
-rw-r--r--vcl/source/gdi/impvect.hxx14
-rw-r--r--vcl/source/gdi/jobset.cxx42
-rw-r--r--vcl/source/gdi/lineinfo.cxx34
-rwxr-xr-x[-rw-r--r--]vcl/source/gdi/makefile.mk1
-rw-r--r--vcl/source/gdi/mapmod.cxx26
-rw-r--r--vcl/source/gdi/metaact.cxx110
-rw-r--r--vcl/source/gdi/metric.cxx108
-rw-r--r--vcl/source/gdi/octree.cxx84
-rwxr-xr-x[-rw-r--r--]vcl/source/gdi/outdev.cxx1067
-rw-r--r--vcl/source/gdi/outdev2.cxx134
-rw-r--r--vcl/source/gdi/outdev3.cxx653
-rw-r--r--vcl/source/gdi/outdev4.cxx120
-rw-r--r--vcl/source/gdi/outdev5.cxx2
-rw-r--r--vcl/source/gdi/outdev6.cxx102
-rwxr-xr-x[-rw-r--r--]vcl/source/gdi/outdevnative.cxx53
-rw-r--r--vcl/source/gdi/outmap.cxx78
-rw-r--r--vcl/source/gdi/pdfextoutdevdata.cxx2
-rw-r--r--vcl/source/gdi/pdfwriter.cxx48
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx961
-rw-r--r--vcl/source/gdi/pdfwriter_impl.hxx205
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx2037
-rw-r--r--vcl/source/gdi/pngread.cxx236
-rw-r--r--vcl/source/gdi/pngwrite.cxx140
-rw-r--r--vcl/source/gdi/polyscan.cxx32
-rw-r--r--vcl/source/gdi/print.cxx389
-rw-r--r--vcl/source/gdi/print2.cxx103
-rw-r--r--vcl/source/gdi/print3.cxx199
-rw-r--r--vcl/source/gdi/regband.cxx86
-rwxr-xr-x[-rw-r--r--]vcl/source/gdi/region.cxx435
-rw-r--r--vcl/source/gdi/salgdilayout.cxx120
-rw-r--r--vcl/source/gdi/salmisc.cxx24
-rw-r--r--vcl/source/gdi/salnativewidgets-none.cxx30
-rw-r--r--vcl/source/gdi/svcompat.cxx6
-rwxr-xr-x[-rw-r--r--]vcl/source/gdi/textlayout.cxx8
-rw-r--r--vcl/source/gdi/virdev.cxx56
-rw-r--r--vcl/source/gdi/wall.cxx58
-rw-r--r--vcl/source/glyphs/gcach_ftyp.cxx264
-rw-r--r--vcl/source/glyphs/gcach_ftyp.hxx13
-rwxr-xr-x[-rw-r--r--]vcl/source/glyphs/gcach_layout.cxx2
-rwxr-xr-x[-rw-r--r--]vcl/source/glyphs/gcach_rbmp.cxx6
-rw-r--r--vcl/source/glyphs/gcach_vdev.cxx10
-rw-r--r--vcl/source/glyphs/gcach_vdev.hxx2
-rw-r--r--vcl/source/glyphs/glyphcache.cxx16
-rw-r--r--vcl/source/glyphs/graphite_layout.cxx2
-rw-r--r--vcl/source/helper/canvasbitmap.cxx48
-rw-r--r--vcl/source/helper/canvastools.cxx20
-rw-r--r--vcl/source/helper/lazydelete.cxx2
-rw-r--r--vcl/source/helper/makefile.mk1
-rw-r--r--vcl/source/helper/smartid.cxx267
-rw-r--r--vcl/source/helper/strhelper.cxx16
-rw-r--r--vcl/source/helper/threadex.cxx4
-rw-r--r--vcl/source/helper/xconnection.cxx77
-rw-r--r--vcl/source/salmain/makefile.mk5
-rw-r--r--vcl/source/src/images.src39
-rw-r--r--vcl/source/src/makefile.mk2
-rw-r--r--vcl/source/src/print.src126
-rw-r--r--vcl/source/src/stdtext.src5
-rwxr-xr-xvcl/source/src/throbber.src114
-rw-r--r--vcl/source/window/accel.cxx128
-rw-r--r--vcl/source/window/accmgr.cxx42
-rw-r--r--vcl/source/window/arrange.cxx303
-rw-r--r--vcl/source/window/brdwin.cxx196
-rw-r--r--vcl/source/window/btndlg.cxx68
-rw-r--r--vcl/source/window/cmdevt.cxx16
-rw-r--r--vcl/source/window/cursor.cxx32
-rw-r--r--vcl/source/window/decoview.cxx154
-rw-r--r--vcl/source/window/dialog.cxx120
-rw-r--r--vcl/source/window/dlgctrl.cxx319
-rw-r--r--vcl/source/window/dockingarea.cxx14
-rw-r--r--vcl/source/window/dockmgr.cxx226
-rw-r--r--vcl/source/window/dockwin.cxx142
-rw-r--r--vcl/source/window/floatwin.cxx122
-rw-r--r--vcl/source/window/javachild.cxx152
-rw-r--r--vcl/source/window/keycod.cxx30
-rw-r--r--vcl/source/window/keyevent.cxx4
-rw-r--r--vcl/source/window/makefile.mk2
-rwxr-xr-x[-rw-r--r--]vcl/source/window/menu.cxx1421
-rw-r--r--vcl/source/window/mnemonic.cxx48
-rw-r--r--vcl/source/window/mnemonicengine.cxx2
-rw-r--r--vcl/source/window/mouseevent.cxx2
-rw-r--r--vcl/source/window/msgbox.cxx67
-rw-r--r--vcl/source/window/printdlg.cxx529
-rw-r--r--vcl/source/window/scrwnd.cxx40
-rw-r--r--vcl/source/window/scrwnd.hxx16
-rw-r--r--vcl/source/window/seleng.cxx64
-rw-r--r--vcl/source/window/split.cxx28
-rw-r--r--vcl/source/window/splitwin.cxx651
-rw-r--r--vcl/source/window/status.cxx294
-rw-r--r--vcl/source/window/syschild.cxx194
-rw-r--r--vcl/source/window/syswin.cxx106
-rw-r--r--vcl/source/window/tabdlg.cxx10
-rw-r--r--vcl/source/window/tabpage.cxx12
-rw-r--r--vcl/source/window/taskpanelist.cxx48
-rw-r--r--vcl/source/window/toolbox.cxx962
-rw-r--r--vcl/source/window/toolbox2.cxx571
-rw-r--r--vcl/source/window/window.cxx1423
-rw-r--r--vcl/source/window/window2.cxx346
-rw-r--r--vcl/source/window/window4.cxx224
-rw-r--r--vcl/source/window/winproc.cxx303
-rw-r--r--vcl/source/window/wpropset.cxx346
-rw-r--r--vcl/source/window/wrkwin.cxx66
-rw-r--r--vcl/test/canvasbitmaptest.cxx2
-rw-r--r--vcl/unx/gtk/a11y/atkutil.cxx2
-rw-r--r--vcl/unx/gtk/a11y/atkwindow.cxx2
-rw-r--r--vcl/unx/gtk/a11y/makefile.mk4
-rw-r--r--vcl/unx/gtk/app/gtkdata.cxx12
-rw-r--r--vcl/unx/gtk/app/gtkinst.cxx33
-rw-r--r--vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx315
-rw-r--r--vcl/unx/gtk/window/gtkframe.cxx204
-rw-r--r--vcl/unx/gtk/window/gtkobject.cxx16
-rw-r--r--vcl/unx/headless/svpbmp.cxx14
-rw-r--r--vcl/unx/headless/svpbmp.hxx6
-rw-r--r--vcl/unx/headless/svpdummies.cxx9
-rw-r--r--vcl/unx/headless/svpdummies.hxx10
-rw-r--r--vcl/unx/headless/svpframe.cxx42
-rw-r--r--vcl/unx/headless/svpframe.hxx40
-rw-r--r--vcl/unx/headless/svpgdi.cxx82
-rw-r--r--vcl/unx/headless/svpgdi.hxx41
-rw-r--r--vcl/unx/headless/svpinst.cxx62
-rw-r--r--vcl/unx/headless/svpinst.hxx39
-rw-r--r--vcl/unx/headless/svpprn.cxx6
-rw-r--r--vcl/unx/headless/svpprn.hxx6
-rw-r--r--vcl/unx/headless/svppspgraphics.cxx97
-rw-r--r--vcl/unx/headless/svppspgraphics.hxx39
-rw-r--r--vcl/unx/headless/svptext.cxx36
-rw-r--r--vcl/unx/headless/svpvd.cxx2
-rw-r--r--vcl/unx/headless/svpvd.hxx6
-rw-r--r--vcl/unx/inc/dtint.hxx9
-rw-r--r--vcl/unx/inc/i18n_cb.hxx2
-rw-r--r--vcl/unx/inc/i18n_ic.hxx2
-rw-r--r--vcl/unx/inc/i18n_im.hxx4
-rw-r--r--vcl/unx/inc/kde_headers.h98
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkdata.hxx2
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkframe.hxx50
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkgdi.hxx65
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkinst.hxx8
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkobject.hxx13
-rw-r--r--vcl/unx/inc/plugins/kde/kdedata.hxx6
-rw-r--r--vcl/unx/inc/pspgraphics.h39
-rw-r--r--vcl/unx/inc/salbmp.h16
-rw-r--r--vcl/unx/inc/saldata.hxx8
-rw-r--r--vcl/unx/inc/saldisp.hxx80
-rw-r--r--vcl/unx/inc/salframe.h64
-rw-r--r--vcl/unx/inc/salgdi.h102
-rw-r--r--vcl/unx/inc/salinst.h23
-rw-r--r--vcl/unx/inc/salobj.h21
-rw-r--r--vcl/unx/inc/salprn.h34
-rw-r--r--vcl/unx/inc/saltimer.h2
-rw-r--r--vcl/unx/inc/salunx.h6
-rw-r--r--vcl/unx/inc/salvd.h18
-rw-r--r--vcl/unx/inc/soicon.hxx4
-rw-r--r--vcl/unx/inc/wmadaptor.hxx6
-rw-r--r--vcl/unx/inc/xfont.hxx165
-rw-r--r--vcl/unx/kde/kdedata.cxx4
-rw-r--r--vcl/unx/kde/salnativewidgets-kde.cxx130
-rw-r--r--vcl/unx/kde4/KDESalFrame.cxx8
-rw-r--r--vcl/unx/kde4/KDESalFrame.hxx2
-rw-r--r--vcl/unx/kde4/KDESalGraphics.cxx2
-rw-r--r--vcl/unx/kde4/KDESalInstance.cxx2
-rw-r--r--vcl/unx/kde4/KDESalInstance.hxx2
-rw-r--r--vcl/unx/kde4/KDEXLib.cxx4
-rw-r--r--vcl/unx/kde4/KDEXLib.hxx2
-rw-r--r--vcl/unx/source/app/i18n_cb.cxx12
-rw-r--r--vcl/unx/source/app/i18n_ic.cxx4
-rw-r--r--vcl/unx/source/app/i18n_status.cxx10
-rw-r--r--vcl/unx/source/app/saldata.cxx6
-rw-r--r--vcl/unx/source/app/saldisp.cxx150
-rw-r--r--vcl/unx/source/app/salinst.cxx47
-rw-r--r--vcl/unx/source/app/salsys.cxx6
-rw-r--r--vcl/unx/source/app/saltimer.cxx4
-rw-r--r--vcl/unx/source/app/sm.cxx8
-rw-r--r--vcl/unx/source/app/soicon.cxx14
-rw-r--r--vcl/unx/source/app/wmadaptor.cxx56
-rw-r--r--vcl/unx/source/dtrans/X11_clipboard.hxx26
-rw-r--r--vcl/unx/source/dtrans/X11_dndcontext.hxx6
-rw-r--r--vcl/unx/source/dtrans/X11_selection.cxx68
-rw-r--r--vcl/unx/source/dtrans/X11_selection.hxx39
-rw-r--r--vcl/unx/source/dtrans/X11_service.cxx22
-rw-r--r--vcl/unx/source/dtrans/X11_transferable.hxx4
-rw-r--r--vcl/unx/source/fontmanager/fontconfig.cxx75
-rw-r--r--vcl/unx/source/fontmanager/fontmanager.cxx10
-rw-r--r--vcl/unx/source/gdi/cdeint.cxx6
-rw-r--r--vcl/unx/source/gdi/gcach_xpeer.cxx6
-rw-r--r--vcl/unx/source/gdi/makefile.mk37
-rw-r--r--vcl/unx/source/gdi/pspgraphics.cxx97
-rw-r--r--vcl/unx/source/gdi/salbmp.cxx58
-rw-r--r--vcl/unx/source/gdi/salgdi.cxx284
-rw-r--r--vcl/unx/source/gdi/salgdi2.cxx40
-rw-r--r--vcl/unx/source/gdi/salgdi3.cxx639
-rw-r--r--vcl/unx/source/gdi/salprnpsp.cxx379
-rw-r--r--vcl/unx/source/gdi/salvd.cxx30
-rw-r--r--vcl/unx/source/gdi/xfont.cxx763
-rw-r--r--vcl/unx/source/gdi/xlfd_attr.cxx698
-rw-r--r--vcl/unx/source/gdi/xlfd_attr.hxx230
-rw-r--r--vcl/unx/source/gdi/xlfd_extd.cxx1002
-rw-r--r--vcl/unx/source/gdi/xlfd_extd.hxx271
-rw-r--r--vcl/unx/source/gdi/xlfd_smpl.cxx270
-rw-r--r--vcl/unx/source/gdi/xlfd_smpl.hxx94
-rw-r--r--vcl/unx/source/plugadapt/salplug.cxx5
-rw-r--r--vcl/unx/source/printer/cupsmgr.cxx42
-rw-r--r--vcl/unx/source/printer/jobdata.cxx43
-rw-r--r--vcl/unx/source/printer/ppdparser.cxx82
-rw-r--r--vcl/unx/source/printer/printerinfomanager.cxx58
-rw-r--r--vcl/unx/source/printergfx/common_gfx.cxx8
-rw-r--r--vcl/unx/source/printergfx/printerjob.cxx15
-rw-r--r--vcl/unx/source/window/makefile.mk2
-rw-r--r--vcl/unx/source/window/salframe.cxx284
-rw-r--r--vcl/unx/source/window/salmenu.cxx134
-rw-r--r--vcl/unx/source/window/salobj.cxx36
-rwxr-xr-xvcl/util/makefile.mk19
-rw-r--r--vcl/util/target.pmk5
-rw-r--r--vcl/util/vcl.component49
-rw-r--r--vcl/util/vcl.macosx.component49
-rw-r--r--vcl/util/vcl.windows.component40
-rw-r--r--vcl/win/inc/salbmp.h12
-rw-r--r--vcl/win/inc/saldata.hxx62
-rw-r--r--vcl/win/inc/salframe.h82
-rw-r--r--vcl/win/inc/salgdi.h106
-rw-r--r--vcl/win/inc/salinst.h28
-rw-r--r--vcl/win/inc/salmenu.h8
-rw-r--r--vcl/win/inc/salobj.h12
-rw-r--r--vcl/win/inc/salprn.h44
-rw-r--r--vcl/win/inc/salsys.h2
-rw-r--r--vcl/win/inc/saltimer.h2
-rw-r--r--vcl/win/inc/salvd.h8
-rw-r--r--vcl/win/inc/wincomp.hxx6
-rw-r--r--vcl/win/source/app/saldata.cxx10
-rw-r--r--vcl/win/source/app/salinfo.cxx6
-rw-r--r--vcl/win/source/app/salinst.cxx81
-rw-r--r--vcl/win/source/app/salshl.cxx8
-rw-r--r--vcl/win/source/app/saltimer.cxx6
-rw-r--r--vcl/win/source/gdi/salbmp.cxx46
-rw-r--r--vcl/win/source/gdi/salgdi.cxx297
-rw-r--r--vcl/win/source/gdi/salgdi2.cxx15
-rw-r--r--vcl/win/source/gdi/salgdi3.cxx345
-rw-r--r--vcl/win/source/gdi/salnativewidgets-luna.cxx173
-rw-r--r--vcl/win/source/gdi/salprn.cxx128
-rw-r--r--vcl/win/source/gdi/salvd.cxx8
-rw-r--r--vcl/win/source/gdi/winlayout.cxx105
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/ase.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/asn.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/asne.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/asns.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/asnswe.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/asnw.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/ass.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/asse.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/assw.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/asw.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/aswe.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/chain.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/chainnot.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/timemove.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/timesize.curbin326 -> 326 bytes
-rw-r--r--vcl/win/source/window/salframe.cxx397
-rw-r--r--vcl/win/source/window/salmenu.cxx10
-rw-r--r--vcl/win/source/window/salobj.cxx79
-rw-r--r--vcl/workben/makefile.mk24
-rw-r--r--vcl/workben/outdevgrind.cxx44
-rw-r--r--vcl/workben/svdem.cxx2
-rw-r--r--vcl/workben/svpclient.cxx10
-rw-r--r--vcl/workben/svptest.cxx4
-rw-r--r--vcl/workben/vcldemo.cxx2
585 files changed, 26926 insertions, 26526 deletions
diff --git a/vcl/aqua/inc/aqua11yfactory.h b/vcl/aqua/inc/aqua11yfactory.h
index 15ba372ed320..2fa38d9901db 100644
--- a/vcl/aqua/inc/aqua11yfactory.h
+++ b/vcl/aqua/inc/aqua11yfactory.h
@@ -39,8 +39,8 @@
+(void)insertIntoWrapperRepository: (NSView *) viewElement forAccessibleContext: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) rxAccessibleContext;
+(AquaA11yWrapper *)wrapperForAccessible: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessible >) rxAccessible;
+(AquaA11yWrapper *)wrapperForAccessibleContext: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) rxAccessibleContext;
-+(AquaA11yWrapper *)wrapperForAccessibleContext: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) rxAccessibleContext createIfNotExists:(MacOSBOOL) bCreate;
-+(AquaA11yWrapper *)wrapperForAccessibleContext: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) rxAccessibleContext createIfNotExists:(MacOSBOOL) bCreate asRadioGroup:(MacOSBOOL) asRadioGroup;
++(AquaA11yWrapper *)wrapperForAccessibleContext: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) rxAccessibleContext createIfNotExists:(BOOL) bCreate;
++(AquaA11yWrapper *)wrapperForAccessibleContext: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) rxAccessibleContext createIfNotExists:(BOOL) bCreate asRadioGroup:(BOOL) asRadioGroup;
+(void)removeFromWrapperRepositoryFor: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) rxAccessibleContext;
+(void)registerView: (NSView *) theView;
+(void)revokeView: (NSView *) theViewt;
diff --git a/vcl/aqua/inc/aqua11ywrapper.h b/vcl/aqua/inc/aqua11ywrapper.h
index 66faca457622..aebea78f0394 100644
--- a/vcl/aqua/inc/aqua11ywrapper.h
+++ b/vcl/aqua/inc/aqua11ywrapper.h
@@ -63,16 +63,16 @@ struct ReferenceWrapper
ReferenceWrapper * mpReferenceWrapper;
NSString * mpDefaultFontname;
float mDefaultFontsize;
- MacOSBOOL mActsAsRadioGroup;
- MacOSBOOL mIsTableCell;
+ BOOL mActsAsRadioGroup;
+ BOOL mIsTableCell;
}
// NSAccessibility Protocol
-(id)accessibilityAttributeValue:(NSString *)attribute;
--(MacOSBOOL)accessibilityIsIgnored;
+-(BOOL)accessibilityIsIgnored;
-(NSArray *)accessibilityAttributeNames;
--(MacOSBOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
+-(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
-(NSArray *)accessibilityParameterizedAttributeNames;
--(MacOSBOOL)accessibilitySetOverrideValue:(id)value forAttribute:(NSString *)attribute;
+-(BOOL)accessibilitySetOverrideValue:(id)value forAttribute:(NSString *)attribute;
-(void)accessibilitySetValue:(id)value forAttribute:(NSString *)attribute;
-(id)accessibilityAttributeValue:(NSString *)attribute forParameter:(id)parameter;
-(id)accessibilityFocusedUIElement;
@@ -93,8 +93,8 @@ struct ReferenceWrapper
-(id)orientationAttribute;
-(id)windowAttribute;
// Wrapper-specific
--(void)setActsAsRadioGroup:(MacOSBOOL)actsAsRadioGroup;
--(MacOSBOOL)actsAsRadioGroup;
+-(void)setActsAsRadioGroup:(BOOL)actsAsRadioGroup;
+-(BOOL)actsAsRadioGroup;
-(NSView *)viewElementForParent;
-(id)initWithAccessibleContext: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) anAccessibleContext;
-(void) setDefaults: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) rxAccessibleContext;
@@ -103,7 +103,7 @@ struct ReferenceWrapper
-(NSString *)defaultFontname;
-(void)setDefaultFontsize:(float)fontsize;
-(float)defaultFontsize;
-+(void)setPopupMenuOpen:(MacOSBOOL)popupMenuOpen;
++(void)setPopupMenuOpen:(BOOL)popupMenuOpen;
-(::com::sun::star::accessibility::XAccessibleAction *)accessibleAction;
-(::com::sun::star::accessibility::XAccessibleContext *)accessibleContext;
-(::com::sun::star::accessibility::XAccessibleComponent *)accessibleComponent;
diff --git a/vcl/aqua/inc/aquaprintview.h b/vcl/aqua/inc/aquaprintview.h
index 5e209bfa6233..2c5849f10e65 100644
--- a/vcl/aqua/inc/aquaprintview.h
+++ b/vcl/aqua/inc/aquaprintview.h
@@ -52,7 +52,7 @@ struct PrintAccessoryViewState
AquaSalInfoPrinter* mpInfoPrinter;
}
-(id)initWithController: (vcl::PrinterController*)pController withInfoPrinter: (AquaSalInfoPrinter*)pInfoPrinter;
--(MacOSBOOL)knowsPageRange: (NSRangePointer)range;
+-(BOOL)knowsPageRange: (NSRangePointer)range;
-(NSRect)rectForPage: (int)page;
-(NSPoint)locationOfPrintRect: (NSRect)aRect;
-(void)drawRect: (NSRect)rect;
diff --git a/vcl/aqua/inc/salbmp.h b/vcl/aqua/inc/salbmp.h
index 818b25d38772..33e671b05735 100644
--- a/vcl/aqua/inc/salbmp.h
+++ b/vcl/aqua/inc/salbmp.h
@@ -71,10 +71,10 @@ public:
public:
// SalBitmap methods
- bool Create( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal );
+ bool Create( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal );
bool Create( const SalBitmap& rSalBmp );
bool Create( const SalBitmap& rSalBmp, SalGraphics* pGraphics );
- bool Create( const SalBitmap& rSalBmp, USHORT nNewBitCount );
+ bool Create( const SalBitmap& rSalBmp, sal_uInt16 nNewBitCount );
virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
Size& rSize,
bool bMask = false );
@@ -82,7 +82,7 @@ public:
void Destroy();
Size GetSize() const;
- USHORT GetBitCount() const;
+ sal_uInt16 GetBitCount() const;
BitmapBuffer *AcquireBuffer( bool bReadOnly );
void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly );
diff --git a/vcl/aqua/inc/saldata.hxx b/vcl/aqua/inc/saldata.hxx
index ef5adced5506..d87938bd4474 100644
--- a/vcl/aqua/inc/saldata.hxx
+++ b/vcl/aqua/inc/saldata.hxx
@@ -132,7 +132,7 @@ inline SalData *GetAppSalData() { return (SalData*)ImplGetAppSVData()->mpSalData
// --- Prototypes ---
-BOOL ImplSalYieldMutexTryToAcquire();
+sal_Bool ImplSalYieldMutexTryToAcquire();
void ImplSalYieldMutexAcquire();
void ImplSalYieldMutexRelease();
diff --git a/vcl/aqua/inc/salframe.h b/vcl/aqua/inc/salframe.h
index bd0929829bc1..4025b0aea70a 100644
--- a/vcl/aqua/inc/salframe.h
+++ b/vcl/aqua/inc/salframe.h
@@ -80,10 +80,10 @@ public:
bool mbSized:1;
bool mbPresentation:1;
- ULONG mnStyle;
+ sal_uLong mnStyle;
unsigned int mnStyleMask; // our style mask from NSWindow creation
- ULONG mnLastEventTime;
+ sal_uLong mnLastEventTime;
unsigned int mnLastModifierFlags;
AquaSalMenu* mpMenu;
@@ -100,7 +100,7 @@ public:
Rectangle maInvalidRect;
- ULONG mnICOptions;
+ sal_uLong mnICOptions;
boost::shared_ptr< Timer > mpActivityTimer; // Timer to prevent system sleep during presentation
public:
@@ -110,43 +110,43 @@ public:
@throws std::runtime_error in case window creation fails
*/
- AquaSalFrame( SalFrame* pParent, ULONG salFrameStyle );
+ AquaSalFrame( SalFrame* pParent, sal_uLong salFrameStyle );
virtual ~AquaSalFrame();
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual BOOL PostEvent( void* pData );
+ virtual sal_Bool PostEvent( void* pData );
virtual void SetTitle( const XubString& rTitle );
- virtual void SetIcon( USHORT nIcon );
+ virtual void SetIcon( sal_uInt16 nIcon );
virtual void SetRepresentedURL( const rtl::OUString& );
virtual void SetMenu( SalMenu* pSalMenu );
virtual void DrawMenuBar();
- virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE );
- virtual void Enable( BOOL bEnable );
+ virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = sal_False );
+ virtual void Enable( sal_Bool bEnable );
virtual void SetMinClientSize( long nWidth, long nHeight );
virtual void SetMaxClientSize( long nWidth, long nHeight );
- virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags );
+ virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags );
virtual void GetClientSize( long& rWidth, long& rHeight );
virtual void GetWorkArea( Rectangle& rRect );
virtual SalFrame* GetParent() const;
virtual void SetWindowState( const SalFrameState* pState );
- virtual BOOL GetWindowState( SalFrameState* pState );
- virtual void ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay );
- virtual void StartPresentation( BOOL bStart );
- virtual void SetAlwaysOnTop( BOOL bOnTop );
- virtual void ToTop( USHORT nFlags );
+ virtual sal_Bool GetWindowState( SalFrameState* pState );
+ virtual void ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay );
+ virtual void StartPresentation( sal_Bool bStart );
+ virtual void SetAlwaysOnTop( sal_Bool bOnTop );
+ virtual void ToTop( sal_uInt16 nFlags );
virtual void SetPointer( PointerStyle ePointerStyle );
- virtual void CaptureMouse( BOOL bMouse );
+ virtual void CaptureMouse( sal_Bool bMouse );
virtual void SetPointerPos( long nX, long nY );
virtual void Flush( void );
virtual void Flush( const Rectangle& );
virtual void Sync();
virtual void SetInputContext( SalInputContext* pContext );
- virtual void EndExtTextInput( USHORT nFlags );
- virtual String GetKeyName( USHORT nKeyCode );
- virtual String GetSymbolKeyName( const XubString& rFontName, USHORT nKeyCode );
- virtual BOOL MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode );
+ virtual void EndExtTextInput( sal_uInt16 nFlags );
+ virtual String GetKeyName( sal_uInt16 nKeyCode );
+ virtual String GetSymbolKeyName( const XubString& rFontName, sal_uInt16 nKeyCode );
+ virtual sal_Bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode );
virtual LanguageType GetInputLanguage();
virtual SalBitmap* SnapShot();
virtual void UpdateSettings( AllSettings& rSettings );
@@ -154,7 +154,7 @@ public:
virtual const SystemEnvData* GetSystemData() const;
virtual SalPointerState GetPointerState();
virtual SalIndicatorState GetIndicatorState();
- virtual void SimulateKeyPress( USHORT nKeyCode );
+ virtual void SimulateKeyPress( sal_uInt16 nKeyCode );
virtual void SetParent( SalFrame* pNewParent );
virtual bool SetPluginParent( SystemParentData* pNewParent );
virtual void SetExtendedFrameStyle( SalExtStyle );
@@ -166,7 +166,7 @@ public:
// set clip region to none (-> rectangular windows, normal state)
virtual void ResetClipRegion();
// start setting the clipregion consisting of nRects rectangles
- virtual void BeginSetClipRegion( ULONG nRects );
+ virtual void BeginSetClipRegion( sal_uLong nRects );
// add a rectangle to the clip region
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
// done setting up the clipregion
diff --git a/vcl/aqua/inc/salframeview.h b/vcl/aqua/inc/salframeview.h
index 55fbc3bf66c5..1df070829fc7 100644
--- a/vcl/aqua/inc/salframeview.h
+++ b/vcl/aqua/inc/salframeview.h
@@ -37,7 +37,8 @@
id mDraggingDestinationHandler;
}
-(id)initWithSalFrame: (AquaSalFrame*)pFrame;
--(MacOSBOOL)canBecomeKeyWindow;
+-(BOOL)canBecomeKeyWindow;
+-(void)displayIfNeeded;
-(void)windowDidBecomeKey: (NSNotification*)pNotification;
-(void)windowDidResignKey: (NSNotification*)pNotification;
-(void)windowDidChangeScreen: (NSNotification*)pNotification;
@@ -45,10 +46,10 @@
-(void)windowDidResize: (NSNotification*)pNotification;
-(void)windowDidMiniaturize: (NSNotification*)pNotification;
-(void)windowDidDeminiaturize: (NSNotification*)pNotification;
--(MacOSBOOL)windowShouldClose: (NSNotification*)pNotification;
+-(BOOL)windowShouldClose: (NSNotification*)pNotification;
-(void)dockMenuItemTriggered: (id)sender;
-(AquaSalFrame*)getSalFrame;
--(MacOSBOOL)containsMouse;
+-(BOOL)containsMouse;
-(::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >)accessibleContext;
/* NSDraggingDestination protocol methods
@@ -56,8 +57,8 @@
-(NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender;
-(NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender;
-(void)draggingExited:(id <NSDraggingInfo>)sender;
--(MacOSBOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
--(MacOSBOOL)performDragOperation:(id <NSDraggingInfo>)sender;
+-(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
+-(BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
-(void)concludeDragOperation:(id <NSDraggingInfo>)sender;
-(void)registerDraggingDestinationHandler:(id)theHandler;
@@ -85,9 +86,9 @@
}
+(void)unsetMouseFrame: (AquaSalFrame*)pFrame;
-(id)initWithSalFrame: (AquaSalFrame*)pFrame;
--(MacOSBOOL)acceptsFirstResponder;
--(MacOSBOOL)acceptsFirstMouse: (NSEvent *)pEvent;
--(MacOSBOOL)isOpaque;
+-(BOOL)acceptsFirstResponder;
+-(BOOL)acceptsFirstMouse: (NSEvent *)pEvent;
+-(BOOL)isOpaque;
-(void)drawRect: (NSRect)aRect;
-(void)mouseDown: (NSEvent*)pEvent;
-(void)mouseDragged: (NSEvent*)pEvent;
@@ -107,12 +108,12 @@
-(void)swipeWithEvent: (NSEvent*)pEvent;
-(void)keyDown: (NSEvent*)pEvent;
-(void)flagsChanged: (NSEvent*)pEvent;
--(void)sendMouseEventToFrame:(NSEvent*)pEvent button:(USHORT)nButton eventtype:(USHORT)nEvent;
--(MacOSBOOL)sendKeyInputAndReleaseToFrame: (USHORT)nKeyCode character: (sal_Unicode)aChar;
--(MacOSBOOL)sendKeyInputAndReleaseToFrame: (USHORT)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod;
--(MacOSBOOL)sendKeyToFrameDirect: (USHORT)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod;
--(MacOSBOOL)sendSingleCharacter:(NSEvent*)pEvent;
--(MacOSBOOL)handleKeyDownException:(NSEvent*)pEvent;
+-(void)sendMouseEventToFrame:(NSEvent*)pEvent button:(sal_uInt16)nButton eventtype:(sal_uInt16)nEvent;
+-(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar;
+-(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod;
+-(BOOL)sendKeyToFrameDirect: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod;
+-(BOOL)sendSingleCharacter:(NSEvent*)pEvent;
+-(BOOL)handleKeyDownException:(NSEvent*)pEvent;
-(void)clearLastEvent;
/*
text action methods
@@ -201,8 +202,8 @@
-(NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender;
-(NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender;
-(void)draggingExited:(id <NSDraggingInfo>)sender;
--(MacOSBOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
--(MacOSBOOL)performDragOperation:(id <NSDraggingInfo>)sender;
+-(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
+-(BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
-(void)concludeDragOperation:(id <NSDraggingInfo>)sender;
-(void)registerDraggingDestinationHandler:(id)theHandler;
diff --git a/vcl/aqua/inc/salgdi.h b/vcl/aqua/inc/salgdi.h
index 5e4276c725d8..c69f5d70bf96 100644
--- a/vcl/aqua/inc/salgdi.h
+++ b/vcl/aqua/inc/salgdi.h
@@ -61,7 +61,7 @@ public:
virtual ImplFontEntry* CreateFontInstance( ImplFontSelectData& ) const;
virtual sal_IntPtr GetFontId() const;
- ImplFontCharMap* GetImplFontCharMap() const;
+ const ImplFontCharMap* GetImplFontCharMap() const;
bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
bool HasChar( sal_uInt32 cChar ) const;
@@ -71,7 +71,7 @@ public:
private:
const ATSUFontID mnFontId;
- mutable ImplFontCharMap* mpCharMap;
+ mutable const ImplFontCharMap* mpCharMap;
mutable vcl::FontCapabilities maFontCapabilities;
mutable bool mbOs2Read; // true if OS2-table related info is valid
mutable bool mbHasOs2Table;
@@ -181,26 +181,25 @@ public:
// InvalidateContext does an UnsetState and sets mrContext to 0
void InvalidateContext();
- virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
+ virtual bool setClipRegion( const Region& );
// draw --> LineColor and FillColor and RasterOp and ClipRegion
virtual void drawPixel( long nX, long nY );
virtual void drawPixel( long nX, long nY, SalColor nSalColor );
virtual void drawLine( long nX1, long nY1, long nX2, long nY2 );
virtual void drawRect( long nX, long nY, long nWidth, long nHeight );
- virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry );
- virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry );
- virtual void drawPolyPolygon( ULONG nPoly, const ULONG* pPoints, PCONSTSALPOINT* pPtAry );
+ virtual void drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry );
+ virtual void drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry );
+ virtual void drawPolyPolygon( sal_uLong nPoly, const sal_uLong* pPoints, PCONSTSALPOINT* pPtAry );
virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency );
- virtual sal_Bool drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry );
- virtual sal_Bool drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry );
- virtual sal_Bool drawPolyPolygonBezier( ULONG nPoly, const ULONG* pPoints, const SalPoint* const* pPtAry, const BYTE* const* pFlgAry );
+ virtual sal_Bool drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry );
+ virtual sal_Bool drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry );
+ virtual sal_Bool drawPolyPolygonBezier( sal_uLong nPoly, const sal_uLong* pPoints, const SalPoint* const* pPtAry, const sal_uInt8* const* pFlgAry );
virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin );
// CopyArea --> No RasterOp, but ClipRegion
virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,
- long nSrcHeight, USHORT nFlags );
+ long nSrcHeight, sal_uInt16 nFlags );
// CopyBits and DrawBitmap --> RasterOp and ClipRegion
// CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
@@ -221,9 +220,9 @@ public:
// invert --> ClipRegion (only Windows or VirDevs)
virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags);
- virtual void invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags );
+ virtual void invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags );
- virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize );
+ virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize );
virtual bool drawAlphaBitmap( const SalTwoRect&,
const SalBitmap& rSourceBitmap,
@@ -232,34 +231,29 @@ public:
virtual bool drawAlphaRect( long nX, long nY, long nWidth,
long nHeight, sal_uInt8 nTransparency );
- CGPoint* makeCGptArray(ULONG nPoints, const SalPoint* pPtAry);
+ CGPoint* makeCGptArray(sal_uLong nPoints, const SalPoint* pPtAry);
// native widget rendering methods that require mirroring
- virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
- const Point& aPos, BOOL& rIsInside );
- virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ virtual sal_Bool hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ const Point& aPos, sal_Bool& rIsInside );
+ virtual sal_Bool drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ virtual sal_Bool drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
+ virtual sal_Bool getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const rtl::OUString& aCaption,
Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion );
// get device resolution
virtual void GetResolution( long& rDPIX, long& rDPIY );
// get the depth of the device
- virtual USHORT GetBitCount() const;
+ virtual sal_uInt16 GetBitCount() const;
// get the width of the device
virtual long GetGraphicsWidth() const;
// set the clip region to empty
virtual void ResetClipRegion();
- // begin setting the clip region, add rectangles to the
- // region with the UnionClipRegion call
- virtual void BeginSetClipRegion( ULONG nCount );
- // all rectangles were added and the clip region should be set now
- virtual void EndSetClipRegion();
// set the line color to transparent (= don't draw lines)
virtual void SetLineColor();
@@ -279,14 +273,14 @@ public:
// set the text color to a specific color
virtual void SetTextColor( SalColor nSalColor );
// set the font
- virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
+ virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel );
// get the current font's etrics
virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
// get kernign pairs of the current font
// return only PairCount if (pKernPairs == NULL)
- virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
+ virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs );
// get the repertoire of the current font
- virtual ImplFontCharMap* GetImplFontCharMap() const;
+ virtual const ImplFontCharMap* GetImplFontCharMap() const;
virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
// graphics must fill supplied font list
virtual void GetDevFontList( ImplDevFontList* );
@@ -306,7 +300,7 @@ public:
// rInfo: additional outgoing information
// implementation note: encoding 0 with glyph id 0 should be added implicitly
// as "undefined character"
- virtual BOOL CreateFontSubset( const rtl::OUString& rToFile,
+ virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData* pFont,
long* pGlyphIDs,
sal_uInt8* pEncoding,
@@ -344,15 +338,15 @@ public:
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc );
- virtual BOOL GetGlyphBoundRect( long nIndex, Rectangle& );
- virtual BOOL GetGlyphOutline( long nIndex, basegfx::B2DPolyPolygon& );
+ virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& );
+ virtual sal_Bool GetGlyphOutline( long nIndex, basegfx::B2DPolyPolygon& );
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
virtual void DrawServerFontLayout( const ServerFontLayout& );
virtual bool supportsOperation( OutDevSupportType ) const;
// Query the platform layer for control support
- virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
+ virtual sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart );
virtual SystemGraphicsData GetGraphicsData() const;
virtual SystemFontData GetSysFontData( int /* nFallbacklevel */ ) const;
@@ -387,8 +381,8 @@ private:
CGContextRef mxTargetContext;
CGContextRef mxMaskContext;
CGContextRef mxTempContext;
- ULONG* mpMaskBuffer;
- ULONG* mpTempBuffer;
+ sal_uLong* mpMaskBuffer;
+ sal_uLong* mpTempBuffer;
int mnBufferLongs;
bool mbIsEnabled;
};
diff --git a/vcl/aqua/inc/salinst.h b/vcl/aqua/inc/salinst.h
index db5b0219f821..9bd65be14ac8 100644
--- a/vcl/aqua/inc/salinst.h
+++ b/vcl/aqua/inc/salinst.h
@@ -50,7 +50,7 @@ class Image;
class SalYieldMutex : public vcl::SolarMutexObject
{
- ULONG mnCount;
+ sal_uLong mnCount;
oslThreadIdentifier mnThreadId;
public:
@@ -58,7 +58,7 @@ public:
virtual void acquire();
virtual void release();
virtual sal_Bool tryToAcquire();
- ULONG GetAcquireCount() const { return mnCount; }
+ sal_uLong GetAcquireCount() const { return mnCount; }
oslThreadIdentifier GetThreadId() const { return mnThreadId; }
};
@@ -84,9 +84,9 @@ class AquaSalInstance : public SalInstance
{
AquaSalFrame* mpFrame;
void* mpData;
- USHORT mnType;
+ sal_uInt16 mnType;
- SalUserEvent( AquaSalFrame* pFrame, void* pData, USHORT nType ) :
+ SalUserEvent( AquaSalFrame* pFrame, void* pData, sal_uInt16 nType ) :
mpFrame( pFrame ), mpData( pData ), mnType( nType )
{}
};
@@ -110,14 +110,14 @@ public:
virtual SalSystem* CreateSystem();
virtual void DestroySystem(SalSystem*);
- virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle );
- virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
+ virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle );
+ virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle );
virtual void DestroyFrame( SalFrame* pFrame );
- virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE );
+ virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True );
virtual void DestroyObject( SalObject* pObject );
virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
long nDX, long nDY,
- USHORT nBitCount, const SystemGraphicsData *pData );
+ sal_uInt16 nBitCount, const SystemGraphicsData *pData );
virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice );
virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
@@ -134,11 +134,12 @@ public:
virtual SalSystem* CreateSalSystem();
virtual SalBitmap* CreateSalBitmap();
virtual osl::SolarMutex* GetYieldMutex();
- virtual ULONG ReleaseYieldMutex();
- virtual void AcquireYieldMutex( ULONG nCount );
+ virtual sal_uLong ReleaseYieldMutex();
+ virtual void AcquireYieldMutex( sal_uLong nCount );
+ virtual bool CheckYieldMutex();
virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
- virtual bool AnyInput( USHORT nType );
- virtual SalMenu* CreateMenu( BOOL bMenuBar );
+ virtual bool AnyInput( sal_uInt16 nType );
+ virtual SalMenu* CreateMenu( sal_Bool bMenuBar, Menu* pVCLMenu );
virtual void DestroyMenu( SalMenu* );
virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData );
virtual void DestroyMenuItem( SalMenuItem* );
@@ -165,7 +166,7 @@ public:
public:
friend class AquaSalFrame;
- void PostUserEvent( AquaSalFrame* pFrame, USHORT nType, void* pData );
+ void PostUserEvent( AquaSalFrame* pFrame, sal_uInt16 nType, void* pData );
void delayedSettingsChanged( bool bInvalidate );
bool isNSAppThread() const;
@@ -186,7 +187,7 @@ public:
// helper class: inverted solar guard
class YieldMutexReleaser
{
- ULONG mnCount;
+ sal_uLong mnCount;
public:
YieldMutexReleaser();
~YieldMutexReleaser();
diff --git a/vcl/aqua/inc/salmenu.h b/vcl/aqua/inc/salmenu.h
index 0d30deedb176..71081ad48b77 100644
--- a/vcl/aqua/inc/salmenu.h
+++ b/vcl/aqua/inc/salmenu.h
@@ -59,32 +59,32 @@ public: // for OOStatusView
private:
std::vector< MenuBarButtonEntry > maButtons;
- MenuBarButtonEntry* findButtonItem( USHORT i_nItemId );
+ MenuBarButtonEntry* findButtonItem( sal_uInt16 i_nItemId );
void releaseButtonEntry( MenuBarButtonEntry& i_rEntry );
static void statusLayout();
public:
AquaSalMenu( bool bMenuBar );
virtual ~AquaSalMenu();
- virtual BOOL VisibleMenuBar(); // must return TRUE to actually DISPLAY native menu bars
+ virtual sal_Bool VisibleMenuBar(); // must return TRUE to actually DISPLAY native menu bars
// otherwise only menu messages are processed (eg, OLE on Windows)
virtual void InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos );
virtual void RemoveItem( unsigned nPos );
virtual void SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos );
virtual void SetFrame( const SalFrame* pFrame );
- virtual void CheckItem( unsigned nPos, BOOL bCheck );
- virtual void EnableItem( unsigned nPos, BOOL bEnable );
+ virtual void CheckItem( unsigned nPos, sal_Bool bCheck );
+ virtual void EnableItem( unsigned nPos, sal_Bool bEnable );
virtual void SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const XubString& rText );
virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage);
virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const XubString& rKeyName );
virtual void GetSystemMenuData( SystemMenuData* pData );
- virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, ULONG nFlags);
+ virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, sal_uLong nFlags);
virtual bool AddMenuBarButton( const SalMenuButtonItem& );
- virtual void RemoveMenuBarButton( USHORT nId );
- virtual Rectangle GetMenuBarButtonRectPixel( USHORT i_nItemId, SalFrame* i_pReferenceFrame );
+ virtual void RemoveMenuBarButton( sal_uInt16 nId );
+ virtual Rectangle GetMenuBarButtonRectPixel( sal_uInt16 i_nItemId, SalFrame* i_pReferenceFrame );
- int getItemIndexByPos( USHORT nPos ) const;
+ int getItemIndexByPos( sal_uInt16 nPos ) const;
const AquaSalFrame* getFrame() const;
void setMainMenu();
@@ -112,7 +112,7 @@ public:
AquaSalMenuItem( const SalItemParams* );
virtual ~AquaSalMenuItem();
- USHORT mnId; // Item ID
+ sal_uInt16 mnId; // Item ID
Menu* mpVCLMenu; // VCL Menu into which this MenuItem is inserted
AquaSalMenu* mpParentMenu; // The menu in which this menu item is inserted
AquaSalMenu* mpSubMenu; // Sub menu of this item (if defined)
diff --git a/vcl/aqua/inc/salobj.h b/vcl/aqua/inc/salobj.h
index 99dea9483b4b..63f5fecb7279 100644
--- a/vcl/aqua/inc/salobj.h
+++ b/vcl/aqua/inc/salobj.h
@@ -71,17 +71,18 @@ public:
virtual ~AquaSalObject();
virtual void ResetClipRegion();
- virtual USHORT GetClipRegionType();
- virtual void BeginSetClipRegion( ULONG nRects );
+ virtual sal_uInt16 GetClipRegionType();
+ virtual void BeginSetClipRegion( sal_uLong nRects );
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
virtual void EndSetClipRegion();
virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight );
- virtual void Show( BOOL bVisible );
- virtual void Enable( BOOL nEnable );
+ virtual void Show( sal_Bool bVisible );
+ virtual void Enable( sal_Bool nEnable );
virtual void GrabFocus();
virtual void SetBackground();
virtual void SetBackground( SalColor nSalColor );
virtual const SystemEnvData* GetSystemData() const;
+ virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
};
#endif // _SV_SALOBJ_H
diff --git a/vcl/aqua/inc/salprn.h b/vcl/aqua/inc/salprn.h
index 3682ea6b5a9f..86d456907a67 100644
--- a/vcl/aqua/inc/salprn.h
+++ b/vcl/aqua/inc/salprn.h
@@ -82,16 +82,16 @@ class AquaSalInfoPrinter : public SalInfoPrinter
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics* i_pGraphics );
- virtual BOOL Setup( SalFrame* i_pFrame, ImplJobSetup* i_pSetupData );
- virtual BOOL SetPrinterData( ImplJobSetup* pSetupData );
- virtual BOOL SetData( ULONG i_nFlags, ImplJobSetup* i_pSetupData );
+ virtual sal_Bool Setup( SalFrame* i_pFrame, ImplJobSetup* i_pSetupData );
+ virtual sal_Bool SetPrinterData( ImplJobSetup* pSetupData );
+ virtual sal_Bool SetData( sal_uLong i_nFlags, ImplJobSetup* i_pSetupData );
virtual void GetPageInfo( const ImplJobSetup* i_pSetupData,
long& o_rOutWidth, long& o_rOutHeight,
long& o_rPageOffX, long& o_rPageOffY,
long& o_rPageWidth, long& o_rPageHeight );
- virtual ULONG GetCapabilities( const ImplJobSetup* i_pSetupData, USHORT i_nType );
- virtual ULONG GetPaperBinCount( const ImplJobSetup* i_pSetupData );
- virtual String GetPaperBinName( const ImplJobSetup* i_pSetupData, ULONG i_nPaperBin );
+ virtual sal_uLong GetCapabilities( const ImplJobSetup* i_pSetupData, sal_uInt16 i_nType );
+ virtual sal_uLong GetPaperBinCount( const ImplJobSetup* i_pSetupData );
+ virtual String GetPaperBinName( const ImplJobSetup* i_pSetupData, sal_uLong i_nPaperBin );
virtual void InitPaperFormats( const ImplJobSetup* i_pSetupData );
virtual int GetLandscapeAngle( const ImplJobSetup* i_pSetupData );
@@ -100,16 +100,16 @@ class AquaSalInfoPrinter : public SalInfoPrinter
// so let's make AquaSalPrinter just a forwarder to AquaSalInfoPrinter
// and concentrate the real work in one class
// implement pull model print system
- BOOL StartJob( const String* i_pFileName,
+ sal_Bool StartJob( const String* i_pFileName,
const String& rJobName,
const String& i_rAppName,
ImplJobSetup* i_pSetupData,
vcl::PrinterController& i_rController );
- BOOL EndJob();
- BOOL AbortJob();
- SalGraphics* StartPage( ImplJobSetup* i_pSetupData, BOOL i_bNewJobData );
- BOOL EndPage();
- ULONG GetErrorCode() const;
+ sal_Bool EndJob();
+ sal_Bool AbortJob();
+ SalGraphics* StartPage( ImplJobSetup* i_pSetupData, sal_Bool i_bNewJobData );
+ sal_Bool EndPage();
+ sal_uLong GetErrorCode() const;
NSPrintInfo* getPrintInfo() const { return mpPrintInfo; }
void setStartPageOffset( int nOffsetX, int nOffsetY ) { mnStartPageOffsetX = nOffsetX; mnStartPageOffsetY = nOffsetY; }
@@ -136,25 +136,25 @@ class AquaSalPrinter : public SalPrinter
AquaSalPrinter( AquaSalInfoPrinter* i_pInfoPrinter );
virtual ~AquaSalPrinter();
- virtual BOOL StartJob( const XubString* i_pFileName,
+ virtual sal_Bool StartJob( const XubString* i_pFileName,
const XubString& i_rJobName,
const XubString& i_rAppName,
- ULONG i_nCopies,
+ sal_uLong i_nCopies,
bool i_bCollate,
bool i_bDirect,
ImplJobSetup* i_pSetupData );
// implement pull model print system
- virtual BOOL StartJob( const String* i_pFileName,
+ virtual sal_Bool StartJob( const String* i_pFileName,
const String& rJobName,
const String& i_rAppName,
ImplJobSetup* i_pSetupData,
vcl::PrinterController& i_rListener );
- virtual BOOL EndJob();
- virtual BOOL AbortJob();
- virtual SalGraphics* StartPage( ImplJobSetup* i_pSetupData, BOOL i_bNewJobData );
- virtual BOOL EndPage();
- virtual ULONG GetErrorCode();
+ virtual sal_Bool EndJob();
+ virtual sal_Bool AbortJob();
+ virtual SalGraphics* StartPage( ImplJobSetup* i_pSetupData, sal_Bool i_bNewJobData );
+ virtual sal_Bool EndPage();
+ virtual sal_uLong GetErrorCode();
private:
AquaSalPrinter( const AquaSalPrinter& );
diff --git a/vcl/aqua/inc/salsys.h b/vcl/aqua/inc/salsys.h
index 964da669301b..64e1791668b1 100644
--- a/vcl/aqua/inc/salsys.h
+++ b/vcl/aqua/inc/salsys.h
@@ -56,11 +56,6 @@ public:
virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen );
virtual rtl::OUString GetScreenName( unsigned int nScreen );
- // overload pure virtual methods
- virtual int ShowNativeDialog( const String& rTitle,
- const String& rMessage,
- const std::list< String >& rButtons,
- int nDefButton );
virtual int ShowNativeMessageBox( const String& rTitle,
const String& rMessage,
int nButtonCombination,
diff --git a/vcl/aqua/inc/saltimer.h b/vcl/aqua/inc/saltimer.h
index 0651ec584fef..03772a2dfc2c 100644
--- a/vcl/aqua/inc/saltimer.h
+++ b/vcl/aqua/inc/saltimer.h
@@ -42,7 +42,7 @@ class AquaSalTimer : public SalTimer
AquaSalTimer();
virtual ~AquaSalTimer();
- void Start( ULONG nMS );
+ void Start( sal_uLong nMS );
void Stop();
static void handleStartTimerEvent( NSEvent* pEvent );
diff --git a/vcl/aqua/inc/salvd.h b/vcl/aqua/inc/salvd.h
index 5970c07f7f9c..6333fd31e460 100644
--- a/vcl/aqua/inc/salvd.h
+++ b/vcl/aqua/inc/salvd.h
@@ -81,12 +81,12 @@ private:
void Destroy();
public:
- AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long nDX, long nDY, USHORT nBitCount, const SystemGraphicsData *pData );
+ AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData );
virtual ~AquaSalVirtualDevice();
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual BOOL SetSize( long nNewDX, long nNewDY );
+ virtual sal_Bool SetSize( long nNewDX, long nNewDY );
virtual void GetSize( long& rWidth, long& rHeight );
};
diff --git a/vcl/aqua/inc/vclnsapp.h b/vcl/aqua/inc/vclnsapp.h
index 316f7e6af153..bdbe15840e0f 100644
--- a/vcl/aqua/inc/vclnsapp.h
+++ b/vcl/aqua/inc/vclnsapp.h
@@ -48,10 +48,10 @@ class AquaSalFrame;
-(void)sendEvent:(NSEvent*)pEvent;
-(void)sendSuperEvent:(NSEvent*)pEvent;
-(NSMenu*)applicationDockMenu:(NSApplication *)sender;
--(MacOSBOOL)application: (NSApplication*) app openFile: (NSString*)file;
+-(BOOL)application: (NSApplication*) app openFile: (NSString*)file;
-(void)application: (NSApplication*) app openFiles: (NSArray*)files;
--(MacOSBOOL)application: (NSApplication*) app printFile: (NSString*)file;
--(NSApplicationPrintReply)application: (NSApplication *) app printFiles:(NSArray *)files withSettings: (NSDictionary *)printSettings showPrintPanels:(MacOSBOOL)bShowPrintPanels;
+-(BOOL)application: (NSApplication*) app printFile: (NSString*)file;
+-(NSApplicationPrintReply)application: (NSApplication *) app printFiles:(NSArray *)files withSettings: (NSDictionary *)printSettings showPrintPanels:(BOOL)bShowPrintPanels;
-(NSApplicationTerminateReply)applicationShouldTerminate: (NSApplication *) app;
-(void)systemColorsChanged: (NSNotification*) pNotification;
-(void)screenParametersChanged: (NSNotification*) pNotification;
@@ -62,7 +62,7 @@ class AquaSalFrame;
-(void)addDockMenuItem: (NSMenuItem*)pNewItem;
-(void)applicationWillBecomeActive: (NSNotification *)pNotification;
-(void)applicationWillResignActive: (NSNotification *)pNotification;
--(MacOSBOOL)applicationShouldHandleReopen: (NSApplication*)pApp hasVisibleWindows: (MacOSBOOL)bWinVisible;
+-(BOOL)applicationShouldHandleReopen: (NSApplication*)pApp hasVisibleWindows: (BOOL)bWinVisible;
-(void)setDockIconClickHandler: (NSObject*)pHandler;
-(void)cycleFrameForward: (AquaSalFrame*)pCurFrame;
-(void)cycleFrameBackward: (AquaSalFrame*)pCurFrame;
diff --git a/vcl/aqua/source/a11y/aqua11ycomponentwrapper.h b/vcl/aqua/source/a11y/aqua11ycomponentwrapper.h
index 3968e71f4992..f7ec6e513fa7 100644
--- a/vcl/aqua/source/a11y/aqua11ycomponentwrapper.h
+++ b/vcl/aqua/source/a11y/aqua11ycomponentwrapper.h
@@ -39,7 +39,7 @@
+(id)positionAttributeForElement:(AquaA11yWrapper *)wrapper;
+(id)descriptionAttributeForElement:(AquaA11yWrapper *)wrapper;
+(void)addAttributeNamesTo:(NSMutableArray *)attributeNames;
-+(MacOSBOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
++(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
+(void)setFocusedAttributeForElement:(AquaA11yWrapper *)wrapper to:(id)value;
@end
diff --git a/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm b/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm
index a700b0b89ae9..c66e7c3d8515 100644
--- a/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm
@@ -75,8 +75,8 @@ using namespace ::com::sun::star::uno;
[ pool release ];
}
-+(MacOSBOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper {
- MacOSBOOL isSettable = NO;
++(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper {
+ BOOL isSettable = NO;
NSAutoreleasePool * pool = [ [ NSAutoreleasePool alloc ] init ];
if ( [ attribute isEqualToString: NSAccessibilityFocusedAttribute ]
&& ! [ [ AquaA11yRoleHelper getNativeRoleFrom: [ wrapper accessibleContext ] ] isEqualToString: NSAccessibilityScrollBarRole ]
diff --git a/vcl/aqua/source/a11y/aqua11yfactory.mm b/vcl/aqua/source/a11y/aqua11yfactory.mm
index 7732ce202cd2..5dcdf4bb9f61 100644
--- a/vcl/aqua/source/a11y/aqua11yfactory.mm
+++ b/vcl/aqua/source/a11y/aqua11yfactory.mm
@@ -95,11 +95,11 @@ static bool enabled = false;
return [ AquaA11yFactory wrapperForAccessibleContext: rxAccessibleContext createIfNotExists: YES asRadioGroup: NO ];
}
-+(AquaA11yWrapper *)wrapperForAccessibleContext: (Reference < XAccessibleContext >) rxAccessibleContext createIfNotExists:(MacOSBOOL) bCreate {
++(AquaA11yWrapper *)wrapperForAccessibleContext: (Reference < XAccessibleContext >) rxAccessibleContext createIfNotExists:(BOOL) bCreate {
return [ AquaA11yFactory wrapperForAccessibleContext: rxAccessibleContext createIfNotExists: bCreate asRadioGroup: NO ];
}
-+(AquaA11yWrapper *)wrapperForAccessibleContext: (Reference < XAccessibleContext >) rxAccessibleContext createIfNotExists:(MacOSBOOL) bCreate asRadioGroup:(MacOSBOOL) asRadioGroup{
++(AquaA11yWrapper *)wrapperForAccessibleContext: (Reference < XAccessibleContext >) rxAccessibleContext createIfNotExists:(BOOL) bCreate asRadioGroup:(BOOL) asRadioGroup{
NSMutableDictionary * dAllWrapper = [ AquaA11yFactory allWrapper ];
NSValue * nKey = nil;
if ( asRadioGroup ) {
diff --git a/vcl/aqua/source/a11y/aqua11yselectionwrapper.h b/vcl/aqua/source/a11y/aqua11yselectionwrapper.h
index 56a77ae9b728..0585f01c9360 100644
--- a/vcl/aqua/source/a11y/aqua11yselectionwrapper.h
+++ b/vcl/aqua/source/a11y/aqua11yselectionwrapper.h
@@ -37,7 +37,7 @@
}
+(id)selectedChildrenAttributeForElement:(AquaA11yWrapper *)wrapper;
+(void)addAttributeNamesTo:(NSMutableArray *)attributeNames;
-+(MacOSBOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
++(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
+(void)setSelectedChildrenAttributeForElement:(AquaA11yWrapper *)wrapper to:(id)value;
@end
diff --git a/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm b/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm
index 81f203da5d68..66f19b80a9f9 100644
--- a/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm
@@ -65,7 +65,7 @@ using namespace ::com::sun::star::uno;
[ attributeNames addObject: NSAccessibilitySelectedChildrenAttribute ];
}
-+(MacOSBOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper
++(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper
{
if ( [ attribute isEqualToString: NSAccessibilitySelectedChildrenAttribute ] )
{
diff --git a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm
index 7bee05d49ce6..f0d0e46a517e 100644
--- a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm
@@ -77,8 +77,8 @@ using namespace ::rtl;
return italicStyle;
}
-+(MacOSBOOL)isStrikethrough:(PropertyValue)property {
- MacOSBOOL strikethrough = NO;
++(BOOL)isStrikethrough:(PropertyValue)property {
+ BOOL strikethrough = NO;
sal_Int16 value = 0;
property.Value >>= value;
if ( value != FontStrikeout::NONE
@@ -88,8 +88,8 @@ using namespace ::rtl;
return strikethrough;
}
-+(MacOSBOOL)convertBoolean:(PropertyValue)property {
- MacOSBOOL myBoolean = NO;
++(BOOL)convertBoolean:(PropertyValue)property {
+ BOOL myBoolean = NO;
bool value = sal_False;
property.Value >>= value;
if ( value ) {
@@ -149,7 +149,7 @@ using namespace ::rtl;
int fonttraits = 0;
float fontsize = 0.0;
sal_Int32 underlineColor = 0;
- MacOSBOOL underlineHasColor = NO;
+ BOOL underlineHasColor = NO;
// add attributes to string
for ( int attrIndex = 0; attrIndex < attributes.getLength(); attrIndex++ ) {
PropertyValue property = attributes [ attrIndex ];
diff --git a/vcl/aqua/source/a11y/aqua11ytextwrapper.h b/vcl/aqua/source/a11y/aqua11ytextwrapper.h
index c793ae01a69e..ceb9bcbe393d 100644
--- a/vcl/aqua/source/a11y/aqua11ytextwrapper.h
+++ b/vcl/aqua/source/a11y/aqua11ytextwrapper.h
@@ -55,7 +55,7 @@
+(void)addParameterizedAttributeNamesTo:(NSMutableArray *)attributeNames;
+(NSArray *)specialAttributeNames;
+(NSArray *)specialParameterizedAttributeNames;
-+(MacOSBOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
++(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
+(void)setVisibleCharacterRangeAttributeForElement:(AquaA11yWrapper *)wrapper to:(id)value;
+(void)setSelectedTextRangeAttributeForElement:(AquaA11yWrapper *)wrapper to:(id)value;
+(void)setSelectedTextAttributeForElement:(AquaA11yWrapper *)wrapper to:(id)value;
diff --git a/vcl/aqua/source/a11y/aqua11ytextwrapper.mm b/vcl/aqua/source/a11y/aqua11ytextwrapper.mm
index 2033135564d8..89c164e5e0b9 100644
--- a/vcl/aqua/source/a11y/aqua11ytextwrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11ytextwrapper.mm
@@ -273,8 +273,8 @@ using namespace ::rtl;
return rtfData;
}
-+(MacOSBOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper {
- MacOSBOOL isSettable = NO;
++(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper {
+ BOOL isSettable = NO;
if ( [ attribute isEqualToString: NSAccessibilityValueAttribute ]
|| [ attribute isEqualToString: NSAccessibilitySelectedTextAttribute ]
|| [ attribute isEqualToString: NSAccessibilitySelectedTextRangeAttribute ]
diff --git a/vcl/aqua/source/a11y/aqua11yvaluewrapper.h b/vcl/aqua/source/a11y/aqua11yvaluewrapper.h
index 6b92718cc808..1292ef5ab77b 100644
--- a/vcl/aqua/source/a11y/aqua11yvaluewrapper.h
+++ b/vcl/aqua/source/a11y/aqua11yvaluewrapper.h
@@ -40,7 +40,7 @@
+(id)minValueAttributeForElement:(AquaA11yWrapper *)wrapper;
+(id)maxValueAttributeForElement:(AquaA11yWrapper *)wrapper;
+(void)addAttributeNamesTo:(NSMutableArray *)attributeNames;
-+(MacOSBOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
++(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
+(void)setValueAttributeForElement:(AquaA11yWrapper *)wrapper to:(id)value;
@end
diff --git a/vcl/aqua/source/a11y/aqua11yvaluewrapper.mm b/vcl/aqua/source/a11y/aqua11yvaluewrapper.mm
index 85ef0041da95..fb257921b13e 100644
--- a/vcl/aqua/source/a11y/aqua11yvaluewrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11yvaluewrapper.mm
@@ -82,8 +82,8 @@ using namespace ::com::sun::star::uno;
[ attributeNames addObject: NSAccessibilityValueAttribute ];
}
-+(MacOSBOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper {
- MacOSBOOL isSettable = NO;
++(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper {
+ BOOL isSettable = NO;
if ( [ wrapper accessibleValue ] != nil
&& [ attribute isEqualToString: NSAccessibilityValueAttribute ]
&& ! [ wrapper isKindOfClass: [ AquaA11yWrapperStaticText class ] ] ) {
diff --git a/vcl/aqua/source/a11y/aqua11ywrapper.mm b/vcl/aqua/source/a11y/aqua11ywrapper.mm
index e86676e725f2..c2724a372f9f 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrapper.mm
@@ -63,7 +63,7 @@ using namespace ::com::sun::star::uno;
-(Reference<XAccessibleContext>)accessibleContext;
@end
-static MacOSBOOL isPopupMenuOpen = NO;
+static BOOL isPopupMenuOpen = NO;
@implementation AquaA11yWrapper : NSView
@@ -154,7 +154,7 @@ static MacOSBOOL isPopupMenuOpen = NO;
// (getter without parameter) attributeNameHereAttribute
// (getter with parameter) attributeNameHereAttributeForParameter:
// (setter) setAttributeNameHereAttributeForElement:to:
--(SEL)selectorForAttribute:(NSString *)attribute asGetter:(MacOSBOOL)asGetter withGetterParameter:(MacOSBOOL)withGetterParameter {
+-(SEL)selectorForAttribute:(NSString *)attribute asGetter:(BOOL)asGetter withGetterParameter:(BOOL)withGetterParameter {
SEL selector = nil;
NSAutoreleasePool * pool = [ [ NSAutoreleasePool alloc ] init ];
@try {
@@ -197,7 +197,7 @@ static MacOSBOOL isPopupMenuOpen = NO;
return Reference < XAccessible > ();
}
--(MacOSBOOL)isFirstRadioButtonInGroup {
+-(BOOL)isFirstRadioButtonInGroup {
Reference < XAccessible > rFirstMateAccessible = [ self getFirstRadioButtonInGroup ];
if ( rFirstMateAccessible.is() && rFirstMateAccessible -> getAccessibleContext().get() == [ self accessibleContext ] ) {
return YES;
@@ -693,12 +693,12 @@ static MacOSBOOL isPopupMenuOpen = NO;
return value;
}
--(MacOSBOOL)accessibilityIsIgnored {
+-(BOOL)accessibilityIsIgnored {
// #i90575# guard NSAccessibility protocol against unwanted access
if ( isPopupMenuOpen ) {
return nil;
}
- MacOSBOOL ignored = NO;
+ BOOL ignored = NO;
sal_Int16 nRole = [ self accessibleContext ] -> getAccessibleRole();
switch ( nRole ) {
case AccessibleRole::PANEL:
@@ -796,8 +796,8 @@ static MacOSBOOL isPopupMenuOpen = NO;
}
}
--(MacOSBOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
- MacOSBOOL isSettable = NO;
+-(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
+ BOOL isSettable = NO;
if ( [ self accessibleText ] != nil ) {
isSettable = [ AquaA11yTextWrapper isAttributeSettable: attribute forElement: self ];
}
@@ -830,7 +830,7 @@ static MacOSBOOL isPopupMenuOpen = NO;
return nil; // TODO: to be completed
}
--(MacOSBOOL)accessibilitySetOverrideValue:(id)value forAttribute:(NSString *)attribute {
+-(BOOL)accessibilitySetOverrideValue:(id)value forAttribute:(NSString *)attribute {
return NO; // TODO
}
@@ -904,7 +904,7 @@ static MacOSBOOL isPopupMenuOpen = NO;
// get some information
NSString * role = (NSString *) [ self accessibilityAttributeValue: NSAccessibilityRoleAttribute ];
id enabledAttr = [ self enabledAttribute ];
- MacOSBOOL enabled = [ enabledAttr boolValue ];
+ BOOL enabled = [ enabledAttr boolValue ];
NSView * parent = (NSView *) [ self accessibilityAttributeValue: NSAccessibilityParentAttribute ];
AquaA11yWrapper * parentAsWrapper = nil;
if ( [ parent isKindOfClass: [ AquaA11yWrapper class ] ] ) {
@@ -947,8 +947,8 @@ static MacOSBOOL isPopupMenuOpen = NO;
#pragma mark -
#pragma mark Hit Test
--(MacOSBOOL)isViewElement:(NSObject *)viewElement hitByPoint:(NSPoint)point {
- MacOSBOOL hit = NO;
+-(BOOL)isViewElement:(NSObject *)viewElement hitByPoint:(NSPoint)point {
+ BOOL hit = NO;
NSAutoreleasePool * pool = [ [ NSAutoreleasePool alloc ] init ];
NSValue * position = [ viewElement accessibilityAttributeValue: NSAccessibilityPositionAttribute ];
NSValue * size = [ viewElement accessibilityAttributeValue: NSAccessibilitySizeAttribute ];
@@ -1127,15 +1127,15 @@ Reference < XAccessibleContext > hitTestRunner ( com::sun::star::awt::Point poin
return mDefaultFontsize;
}
--(void)setActsAsRadioGroup:(MacOSBOOL)actsAsRadioGroup {
+-(void)setActsAsRadioGroup:(BOOL)actsAsRadioGroup {
mActsAsRadioGroup = actsAsRadioGroup;
}
--(MacOSBOOL)actsAsRadioGroup {
+-(BOOL)actsAsRadioGroup {
return mActsAsRadioGroup;
}
-+(void)setPopupMenuOpen:(MacOSBOOL)popupMenuOpen {
++(void)setPopupMenuOpen:(BOOL)popupMenuOpen {
isPopupMenuOpen = popupMenuOpen;
}
diff --git a/vcl/aqua/source/a11y/aqua11ywrappercheckbox.h b/vcl/aqua/source/a11y/aqua11ywrappercheckbox.h
index e689e829a6e2..192e528e930d 100644
--- a/vcl/aqua/source/a11y/aqua11ywrappercheckbox.h
+++ b/vcl/aqua/source/a11y/aqua11ywrappercheckbox.h
@@ -35,7 +35,7 @@
{
}
-(id)valueAttribute;
--(MacOSBOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
+-(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
-(NSArray *)accessibilityAttributeNames;
@end
diff --git a/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm b/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm
index c4ac34dc5bce..25f012e1163f 100644
--- a/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm
@@ -44,7 +44,7 @@
return [ NSNumber numberWithInt: 0 ];
}
--(MacOSBOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
+-(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
if ( [ attribute isEqualToString: NSAccessibilityValueAttribute ] ) {
return NO;
}
diff --git a/vcl/aqua/source/a11y/aqua11ywrappercombobox.h b/vcl/aqua/source/a11y/aqua11ywrappercombobox.h
index ea58a227ed95..5ca5c967234f 100644
--- a/vcl/aqua/source/a11y/aqua11ywrappercombobox.h
+++ b/vcl/aqua/source/a11y/aqua11ywrappercombobox.h
@@ -43,7 +43,7 @@
-(id)selectedTextRangeAttribute;
-(id)visibleCharacterRangeAttribute;
// Accessibility Protocol
--(MacOSBOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
+-(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
-(void)accessibilitySetValue:(id)value forAttribute:(NSString *)attribute;
-(NSArray *)accessibilityAttributeNames;
@end
diff --git a/vcl/aqua/source/a11y/aqua11ywrappercombobox.mm b/vcl/aqua/source/a11y/aqua11ywrappercombobox.mm
index 85aed320e470..16fa1372fe4e 100644
--- a/vcl/aqua/source/a11y/aqua11ywrappercombobox.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrappercombobox.mm
@@ -117,7 +117,7 @@ using namespace ::com::sun::star::uno;
#pragma mark -
#pragma mark Accessibility Protocol
--(MacOSBOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
+-(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
if ( [ self textArea ] != nil && (
[ attribute isEqualToString: NSAccessibilitySelectedTextAttribute ]
|| [ attribute isEqualToString: NSAccessibilitySelectedTextRangeAttribute ]
diff --git a/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.h b/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.h
index 6edc9b139b70..ac9e0e7022ff 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.h
+++ b/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.h
@@ -35,7 +35,7 @@
{
}
-(id)valueAttribute;
--(MacOSBOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
+-(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
-(NSArray *)accessibilityAttributeNames;
@end
diff --git a/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm b/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm
index 54d6edac619a..930f940c4971 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm
@@ -44,7 +44,7 @@
return [ NSNumber numberWithInt: 0 ];
}
--(MacOSBOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
+-(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
if ( [ attribute isEqualToString: NSAccessibilityValueAttribute ] ) {
return NO;
}
diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx
index da5b92b7ff7f..20ac4e2251d6 100644
--- a/vcl/aqua/source/app/salinst.cxx
+++ b/vcl/aqua/source/app/salinst.cxx
@@ -73,7 +73,7 @@
using namespace std;
using namespace ::com::sun::star;
-extern BOOL ImplSVMain();
+extern sal_Bool ImplSVMain();
static int* gpnInit = 0;
static NSMenu* pDockMenu = nil;
@@ -209,7 +209,7 @@ static void initNSApp()
[NSApp activateIgnoringOtherApps: YES];
}
-BOOL ImplSVMainHook( int * pnInit )
+sal_Bool ImplSVMainHook( int * pnInit )
{
gpnInit = pnInit;
@@ -404,7 +404,7 @@ sal_Bool SalYieldMutex::tryToAcquire()
// some convenience functions regarding the yield mutex, aka solar mutex
-BOOL ImplSalYieldMutexTryToAcquire()
+sal_Bool ImplSalYieldMutexTryToAcquire()
{
AquaSalInstance* pInst = (AquaSalInstance*) GetSalData()->mpFirstInstance;
if ( pInst )
@@ -451,7 +451,7 @@ SalInstance* CreateSalInstance()
ImplGetSVData()->maNWFData.mbCenteredTabs = true;
ImplGetSVData()->maNWFData.mbProgressNeedsErase = true;
ImplGetSVData()->maNWFData.mbCheckBoxNeedsErase = true;
- ImplGetSVData()->maGDIData.mbPrinterPullModel = true;
+ ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset = 10;
ImplGetSVData()->maGDIData.mbNoXORClipping = true;
ImplGetSVData()->maWinData.mbNoSaveBackground = true;
@@ -515,7 +515,7 @@ void AquaSalInstance::wakeupYield()
// -----------------------------------------------------------------------
-void AquaSalInstance::PostUserEvent( AquaSalFrame* pFrame, USHORT nType, void* pData )
+void AquaSalInstance::PostUserEvent( AquaSalFrame* pFrame, sal_uInt16 nType, void* pData )
{
osl_acquireMutex( maUserEventListMutex );
maUserEvents.push_back( SalUserEvent( pFrame, pData, nType ) );
@@ -534,14 +534,14 @@ osl::SolarMutex* AquaSalInstance::GetYieldMutex()
// -----------------------------------------------------------------------
-ULONG AquaSalInstance::ReleaseYieldMutex()
+sal_uLong AquaSalInstance::ReleaseYieldMutex()
{
SalYieldMutex* pYieldMutex = mpSalYieldMutex;
if ( pYieldMutex->GetThreadId() ==
osl::Thread::getCurrentIdentifier() )
{
- ULONG nCount = pYieldMutex->GetAcquireCount();
- ULONG n = nCount;
+ sal_uLong nCount = pYieldMutex->GetAcquireCount();
+ sal_uLong n = nCount;
while ( n )
{
pYieldMutex->release();
@@ -556,7 +556,7 @@ ULONG AquaSalInstance::ReleaseYieldMutex()
// -----------------------------------------------------------------------
-void AquaSalInstance::AcquireYieldMutex( ULONG nCount )
+void AquaSalInstance::AcquireYieldMutex( sal_uLong nCount )
{
SalYieldMutex* pYieldMutex = mpSalYieldMutex;
while ( nCount )
@@ -568,6 +568,21 @@ void AquaSalInstance::AcquireYieldMutex( ULONG nCount )
// -----------------------------------------------------------------------
+bool AquaSalInstance::CheckYieldMutex()
+{
+ bool bRet = true;
+
+ SalYieldMutex* pYieldMutex = mpSalYieldMutex;
+ if ( pYieldMutex->GetThreadId() != osl::Thread::getCurrentIdentifier())
+ {
+ bRet = false;
+ }
+
+ return bRet;
+}
+
+// -----------------------------------------------------------------------
+
bool AquaSalInstance::isNSAppThread() const
{
return osl::Thread::getCurrentIdentifier() == maMainThread;
@@ -697,7 +712,7 @@ void AquaSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
bool bDispatchUser = true;
while( bDispatchUser )
{
- ULONG nCount = ReleaseYieldMutex();
+ sal_uLong nCount = ReleaseYieldMutex();
// get one user event
osl_acquireMutex( maUserEventListMutex );
@@ -738,7 +753,7 @@ void AquaSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
bool bHadEvent = false;
do
{
- ULONG nCount = ReleaseYieldMutex();
+ sal_uLong nCount = ReleaseYieldMutex();
pEvent = [NSApp nextEventMatchingMask: NSAnyEventMask untilDate: nil
inMode: NSDefaultRunLoopMode dequeue: YES];
@@ -755,7 +770,7 @@ void AquaSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
// if we had no event yet, wait for one if requested
if( bWait && ! bHadEvent )
{
- ULONG nCount = ReleaseYieldMutex();
+ sal_uLong nCount = ReleaseYieldMutex();
NSDate* pDt = AquaSalTimer::pRunningTimer ? [AquaSalTimer::pRunningTimer fireDate] : [NSDate distantFuture];
pEvent = [NSApp nextEventMatchingMask: NSAnyEventMask untilDate: pDt
@@ -799,7 +814,7 @@ void AquaSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
// has dispatched an event, cop out at 200 ms
osl_resetCondition( maWaitingYieldCond );
TimeValue aVal = { 0, 200000000 };
- ULONG nCount = ReleaseYieldMutex();
+ sal_uLong nCount = ReleaseYieldMutex();
osl_waitCondition( maWaitingYieldCond, &aVal );
AcquireYieldMutex( nCount );
}
@@ -830,7 +845,7 @@ void AquaSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
// -----------------------------------------------------------------------
-bool AquaSalInstance::AnyInput( USHORT nType )
+bool AquaSalInstance::AnyInput( sal_uInt16 nType )
{
if( nType & INPUT_APPEVENT )
{
@@ -876,14 +891,14 @@ bool AquaSalInstance::AnyInput( USHORT nType )
// -----------------------------------------------------------------------
-SalFrame* AquaSalInstance::CreateChildFrame( SystemParentData* pSystemParentData, ULONG nSalFrameStyle )
+SalFrame* AquaSalInstance::CreateChildFrame( SystemParentData* pSystemParentData, sal_uLong nSalFrameStyle )
{
return NULL;
}
// -----------------------------------------------------------------------
-SalFrame* AquaSalInstance::CreateFrame( SalFrame* pParent, ULONG nSalFrameStyle )
+SalFrame* AquaSalInstance::CreateFrame( SalFrame* pParent, sal_uLong nSalFrameStyle )
{
SalData::ensureThreadAutoreleasePool();
@@ -900,7 +915,7 @@ void AquaSalInstance::DestroyFrame( SalFrame* pFrame )
// -----------------------------------------------------------------------
-SalObject* AquaSalInstance::CreateObject( SalFrame* pParent, SystemWindowData* /* pWindowData */, BOOL /* bShow */ )
+SalObject* AquaSalInstance::CreateObject( SalFrame* pParent, SystemWindowData* /* pWindowData */, sal_Bool /* bShow */ )
{
// SystemWindowData is meaningless on Mac OS X
AquaSalObject *pObject = NULL;
@@ -977,6 +992,9 @@ void AquaSalInstance::DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo )
XubString AquaSalInstance::GetDefaultPrinter()
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( ! maDefaultPrinter.getLength() )
{
NSPrintInfo* pPI = [NSPrintInfo sharedPrintInfo];
@@ -1001,6 +1019,9 @@ XubString AquaSalInstance::GetDefaultPrinter()
SalInfoPrinter* AquaSalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
ImplJobSetup* pSetupData )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
SalInfoPrinter* pNewInfoPrinter = NULL;
if( pQueueInfo )
{
@@ -1016,6 +1037,9 @@ SalInfoPrinter* AquaSalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueI
void AquaSalInstance::DestroyInfoPrinter( SalInfoPrinter* pPrinter )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
delete pPrinter;
}
diff --git a/vcl/aqua/source/app/salsys.cxx b/vcl/aqua/source/app/salsys.cxx
index 91f5e4df0180..ea588c9de132 100644
--- a/vcl/aqua/source/app/salsys.cxx
+++ b/vcl/aqua/source/app/salsys.cxx
@@ -31,9 +31,11 @@
#include "tools/rc.hxx"
#include "vcl/svids.hrc"
+#include "vcl/button.hxx"
#include "salsys.h"
#include "saldata.hxx"
+#include "salinst.h"
#include "rtl/ustrbuf.hxx"
using ::rtl::OUString;
@@ -115,12 +117,22 @@ rtl::OUString AquaSalSystem::GetScreenName( unsigned int nScreen )
return aRet;
}
-int AquaSalSystem::ShowNativeDialog( const String& rTitle,
- const String& rMessage,
- const std::list< String >& rButtons,
- int nDefButton )
+static NSString* getStandardString( int nButtonId )
{
- return 0;
+ rtl::OUString aText( Button::GetStandardText( nButtonId ) );
+ if( ! aText.getLength() ) // this is for bad cases, we might be missing the vcl resource
+ {
+ switch( nButtonId )
+ {
+ case BUTTON_OK: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OK" ) );break;
+ case BUTTON_ABORT: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) );break;
+ case BUTTON_CANCEL: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cancel" ) );break;
+ case BUTTON_RETRY: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Retry" ) );break;
+ case BUTTON_YES: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Yes" ) );break;
+ case BUTTON_NO : aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "No" ) );break;
+ }
+ }
+ return aText.getLength() ? CreateNSString( aText) : nil;
}
int AquaSalSystem::ShowNativeMessageBox( const String& rTitle,
@@ -128,7 +140,84 @@ int AquaSalSystem::ShowNativeMessageBox( const String& rTitle,
int nButtonCombination,
int nDefaultButton)
{
- return 0;
+ NSString* pTitle = CreateNSString( rTitle );
+ NSString* pMessage = CreateNSString( rMessage );
+
+ struct id_entry
+ {
+ int nCombination;
+ int nDefaultButton;
+ int nTextIds[3];
+ } aButtonIds[] =
+ {
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK, { BUTTON_OK, -1, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK, { BUTTON_OK, BUTTON_CANCEL, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, { BUTTON_CANCEL, BUTTON_OK, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_ABORT, { BUTTON_ABORT, BUTTON_IGNORE, BUTTON_RETRY } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY, { BUTTON_RETRY, BUTTON_IGNORE, BUTTON_ABORT } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE, { BUTTON_IGNORE, BUTTON_IGNORE, BUTTON_ABORT } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES, { BUTTON_YES, BUTTON_NO, BUTTON_CANCEL } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO, { BUTTON_NO, BUTTON_YES, BUTTON_CANCEL } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, { BUTTON_CANCEL, BUTTON_YES, BUTTON_NO } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES, { BUTTON_YES, BUTTON_NO, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO, { BUTTON_NO, BUTTON_YES, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY, { BUTTON_RETRY, BUTTON_CANCEL, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, { BUTTON_CANCEL, BUTTON_RETRY, -1 } }
+ };
+
+ NSString* pDefText = nil;
+ NSString* pAltText = nil;
+ NSString* pOthText = nil;
+
+ unsigned int nC;
+ for( nC = 0; nC < sizeof(aButtonIds)/sizeof(aButtonIds[0]); nC++ )
+ {
+ if( aButtonIds[nC].nCombination == nButtonCombination )
+ {
+ if( aButtonIds[nC].nDefaultButton == nDefaultButton )
+ {
+ if( aButtonIds[nC].nTextIds[0] != -1 )
+ pDefText = getStandardString( aButtonIds[nC].nTextIds[0] );
+ if( aButtonIds[nC].nTextIds[1] != -1 )
+ pAltText = getStandardString( aButtonIds[nC].nTextIds[1] );
+ if( aButtonIds[nC].nTextIds[2] != -1 )
+ pOthText = getStandardString( aButtonIds[nC].nTextIds[2] );
+ break;
+ }
+ }
+ }
+
+
+ int nResult = NSRunAlertPanel( pTitle, pMessage, pDefText, pAltText, pOthText );
+
+ if( pTitle )
+ [pTitle release];
+ if( pMessage )
+ [pMessage release];
+ if( pDefText )
+ [pDefText release];
+ if( pAltText )
+ [pAltText release];
+ if( pOthText )
+ [pOthText release];
+
+ int nRet = 0;
+ if( nC < sizeof(aButtonIds)/sizeof(aButtonIds[0]) && nResult >= 1 && nResult <= 3 )
+ {
+ int nPressed = aButtonIds[nC].nTextIds[nResult-1];
+ switch( nPressed )
+ {
+ case BUTTON_NO: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO; break;
+ case BUTTON_YES: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES; break;
+ case BUTTON_OK: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK; break;
+ case BUTTON_CANCEL: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL; break;
+ case BUTTON_ABORT: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_ABORT; break;
+ case BUTTON_RETRY: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY; break;
+ case BUTTON_IGNORE: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE; break;
+ }
+ }
+
+ return nRet;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/app/saltimer.cxx b/vcl/aqua/source/app/saltimer.cxx
index 75c5f92f820b..e0c406a6a589 100644
--- a/vcl/aqua/source/app/saltimer.cxx
+++ b/vcl/aqua/source/app/saltimer.cxx
@@ -41,7 +41,7 @@ NSTimer* AquaSalTimer::pRunningTimer = nil;
bool AquaSalTimer::bDispatchTimer = false;
-void ImplSalStartTimer( ULONG nMS )
+void ImplSalStartTimer( sal_uLong nMS )
{
SalData* pSalData = GetSalData();
if( pSalData->mpFirstInstance->isNSAppThread() )
@@ -109,7 +109,7 @@ void AquaSalTimer::handleStartTimerEvent( NSEvent* pEvent )
// timer already elapsed since event posted
pSVData->mpSalTimer->CallCallback();
}
- ImplSalStartTimer( ULONG( [pEvent data1] ) );
+ ImplSalStartTimer( sal_uLong( [pEvent data1] ) );
}
}
@@ -123,7 +123,7 @@ AquaSalTimer::~AquaSalTimer()
ImplSalStopTimer();
}
-void AquaSalTimer::Start( ULONG nMS )
+void AquaSalTimer::Start( sal_uLong nMS )
{
ImplSalStartTimer( nMS );
}
diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm
index 4264f8802126..455e7c64c6a4 100755
--- a/vcl/aqua/source/app/vclnsapp.mm
+++ b/vcl/aqua/source/app/vclnsapp.mm
@@ -287,7 +287,7 @@
return AquaSalInstance::GetDynamicDockMenu();
}
--(MacOSBOOL)application: (NSApplication*)app openFile: (NSString*)pFile
+-(BOOL)application: (NSApplication*)app openFile: (NSString*)pFile
{
const rtl::OUString aFile( GetOUString( pFile ) );
if( ! AquaSalInstance::isOnCommandLine( aFile ) )
@@ -328,7 +328,7 @@
}
}
--(MacOSBOOL)application: (NSApplication*)app printFile: (NSString*)pFile
+-(BOOL)application: (NSApplication*)app printFile: (NSString*)pFile
{
const rtl::OUString aFile( GetOUString( pFile ) );
const ApplicationEvent* pAppEvent = new ApplicationEvent( String(), ApplicationAddress(),
@@ -336,7 +336,7 @@
AquaSalInstance::aAppEventList.push_back( pAppEvent );
return YES;
}
--(NSApplicationPrintReply)application: (NSApplication *) app printFiles:(NSArray *)files withSettings: (NSDictionary *)printSettings showPrintPanels:(MacOSBOOL)bShowPrintPanels
+-(NSApplicationPrintReply)application: (NSApplication *) app printFiles:(NSArray *)files withSettings: (NSDictionary *)printSettings showPrintPanels:(BOOL)bShowPrintPanels
{
// currently ignores print settings an bShowPrintPanels
rtl::OUStringBuffer aFileList( 256 );
@@ -360,70 +360,35 @@
-(NSApplicationTerminateReply)applicationShouldTerminate: (NSApplication *) app
{
- SalData* pSalData = GetSalData();
- #if 1 // currently do some really bad hack
- if( ! pSalData->maFrames.empty() )
+ NSApplicationTerminateReply aReply = NSTerminateNow;
{
- /* #i92766# something really weird is going on with the retain count of
- our windows; sometimes we get a duplicate free before exit on one of our
- NSWindows. The reason is unclear; to avoid this currently we retain them once more
-
- FIXME: this is a really bad hack, relying on the system to catch the leaked
- resources. Find out what really goes on here and fix it !
- */
- std::vector< NSWindow* > aHackRetainedWindows;
- for( std::list< AquaSalFrame* >::iterator it = pSalData->maFrames.begin();
- it != pSalData->maFrames.end(); ++it )
- {
- #if OSL_DEBUG_LEVEL > 1
- Window* pWin = (*it)->GetWindow();
- String aTitle = pWin->GetText();
- Window* pClient = pWin->ImplGetClientWindow();
- fprintf( stderr, "retaining %p (old count %d) windowtype=%s clienttyp=%s title=%s\n",
- (*it)->mpWindow, [(*it)->mpWindow retainCount],
- typeid(*pWin).name(), pClient ? typeid(*pClient).name() : "<nil>",
- rtl::OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ).getStr()
- );
- #endif
- [(*it)->mpWindow retain];
- aHackRetainedWindows.push_back( (*it)->mpWindow );
- }
- if( pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, NULL ) )
+ YIELD_GUARD;
+
+ SalData* pSalData = GetSalData();
+ if( ! pSalData->maFrames.empty() )
{
- for( std::vector< NSWindow* >::iterator it = aHackRetainedWindows.begin();
- it != aHackRetainedWindows.end(); ++it )
- {
- // clean up the retaing count again from the shutdown workaround
- #if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "releasing %p\n", (*it) );
- #endif
- [(*it) release];
- }
- return NSTerminateCancel;
+ // the following QueryExit will likely present a message box, activate application
+ [NSApp activateIgnoringOtherApps: YES];
+ aReply = pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, NULL ) ? NSTerminateCancel : NSTerminateNow;
}
- #if OSL_DEBUG_LEVEL > 1
- for( std::list< AquaSalFrame* >::iterator it = pSalData->maFrames.begin();
- it != pSalData->maFrames.end(); ++it )
+
+ if( aReply == NSTerminateNow )
{
- Window* pWin = (*it)->GetWindow();
- String aTitle = pWin->GetText();
- Window* pClient = pWin->ImplGetClientWindow();
- fprintf( stderr, "frame still alive: NSWindow %p windowtype=%s clienttyp=%s title=%s\n",
- (*it)->mpWindow, typeid(*pWin).name(), pClient ? typeid(*pClient).name() : "<nil>",
- rtl::OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ).getStr()
- );
+ ApplicationEvent aEv( String(), ApplicationAddress(), ByteString( "PRIVATE:DOSHUTDOWN" ), String() );
+ GetpApp()->AppEvent( aEv );
+ ImplImageTreeSingletonRef()->shutDown();
+ // DeInitVCL should be called in ImplSVMain - unless someon _exits first which
+ // can occur in Desktop::doShutdown for example
}
- #endif
}
- #else // the clean version follows
- return pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, NULL ) ? NSTerminateCancel : NSTerminateNow;
- #endif
- ImplImageTreeSingletonRef()->shutDown();
- return NSTerminateNow;
+
+ return aReply;
}
-(void)systemColorsChanged: (NSNotification*) pNotification
{
+ YIELD_GUARD;
+
const SalData* pSalData = GetSalData();
if( !pSalData->maFrames.empty() )
pSalData->maFrames.front()->CallCallback( SALEVENT_SETTINGSCHANGED, NULL );
@@ -431,6 +396,8 @@
-(void)screenParametersChanged: (NSNotification*) pNotification
{
+ YIELD_GUARD;
+
SalData* pSalData = GetSalData();
std::list< AquaSalFrame* >::iterator it;
for( it = pSalData->maFrames.begin(); it != pSalData->maFrames.end(); ++it )
@@ -501,7 +468,7 @@
}
}
-- (MacOSBOOL)applicationShouldHandleReopen: (NSApplication*)pApp hasVisibleWindows: (MacOSBOOL) bWinVisible
+- (BOOL)applicationShouldHandleReopen: (NSApplication*)pApp hasVisibleWindows: (BOOL) bWinVisible
{
NSObject* pHdl = GetSalData()->mpDockIconClickHandler;
if( pHdl && [pHdl respondsToSelector: @selector(dockIconClicked:)] )
diff --git a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
index 0c388e4643d9..c660dbc0616d 100644
--- a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
+++ b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
@@ -579,11 +579,19 @@ DataProviderPtr_t DataFlavorMapper::getDataProvider(NSString* systemFlavor, Refe
if (isByteSequenceType(data.getValueType()))
{
+ /*
+ the HTMLFormatDataProvider prepends segment information to HTML
+ this is useful for exchange with MS Word (which brings this stuff from Windows)
+ but annoying for other applications. Since this extension is not a standard datatype
+ on the Mac, let us not provide but provide normal HTML
+
if ([systemFlavor caseInsensitiveCompare: NSHTMLPboardType] == NSOrderedSame)
{
dp = DataProviderPtr_t(new HTMLFormatDataProvider(data));
}
- else if ([systemFlavor caseInsensitiveCompare: NSPICTPboardType] == NSOrderedSame)
+ else
+ */
+ if ([systemFlavor caseInsensitiveCompare: NSPICTPboardType] == NSOrderedSame)
{
dp = DataProviderPtr_t(new BMPDataProvider(data, PICTImageFileType));
}
diff --git a/vcl/aqua/source/dtrans/DragSource.cxx b/vcl/aqua/source/dtrans/DragSource.cxx
index 93871add6ffa..bef1e639caf9 100644
--- a/vcl/aqua/source/dtrans/DragSource.cxx
+++ b/vcl/aqua/source/dtrans/DragSource.cxx
@@ -39,6 +39,7 @@
#include "DragSourceContext.hxx"
#include "aqua_clipboard.hxx"
#include "DragActionConversion.hxx"
+#include "salframe.h"
#include <rtl/ustring.h>
#include <memory>
@@ -46,6 +47,7 @@
using namespace cppu;
using namespace osl;
+using namespace com::sun::star;
using namespace com::sun::star::datatransfer;
using namespace com::sun::star::datatransfer::clipboard;
using namespace com::sun::star::datatransfer::dnd;
@@ -61,7 +63,7 @@ using ::rtl::OUString;
// For OOo internal D&D we provide the Transferable without NSDragPboard
// interference as a shortcut
-Reference<XTransferable> DragSource::g_XTransferable = Reference<XTransferable>();
+uno::Reference<XTransferable> DragSource::g_XTransferable;
NSView* DragSource::g_DragSourceView = nil;
bool DragSource::g_DropSuccessSet = false;
bool DragSource::g_DropSuccess = false;
@@ -105,7 +107,7 @@ Sequence<OUString> dragSource_getSupportedServiceNames()
}
--(unsigned int)draggingSourceOperationMaskForLocal: (MacOSBOOL)isLocal
+-(unsigned int)draggingSourceOperationMaskForLocal: (BOOL)isLocal
{
return mDragSource->getSupportedDragOperations(isLocal);
}
@@ -138,7 +140,7 @@ Sequence<OUString> dragSource_getSupportedServiceNames()
bDropSuccess );
mDragSource->mXDragSrcListener->dragDropEnd(dsde);
- mDragSource->mXDragSrcListener = Reference<XDragSourceListener>();
+ mDragSource->mXDragSrcListener = uno::Reference<XDragSourceListener>();
}
@@ -159,6 +161,7 @@ Sequence<OUString> dragSource_getSupportedServiceNames()
DragSource::DragSource():
WeakComponentImplHelper3<XDragSource, XInitialization, XServiceInfo>(m_aMutex),
mView(NULL),
+ mpFrame(NULL),
mLastMouseEventBeforeStartDrag(nil),
m_MouseButton(0)
{
@@ -167,8 +170,9 @@ DragSource::DragSource():
DragSource::~DragSource()
{
- [(id <MouseEventListener>)mView unregisterMouseEventListener: mDragSourceHelper];
- [mDragSourceHelper release];
+ if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
+ [(id <MouseEventListener>)mView unregisterMouseEventListener: mDragSourceHelper];
+ [mDragSourceHelper release];
}
@@ -198,6 +202,13 @@ void SAL_CALL DragSource::initialize(const Sequence< Any >& aArguments)
throw Exception(OUString(RTL_CONSTASCII_USTRINGPARAM("DragSource::initialize: Provided view doesn't support mouse listener")),
static_cast<OWeakObject*>(this));
}
+ NSWindow* pWin = [mView window];
+ if( ! pWin || ![pWin respondsToSelector: @selector(getSalFrame)] )
+ {
+ throw Exception(OUString(RTL_CONSTASCII_USTRINGPARAM("DragSource::initialize: Provided view is not attached to a vcl frame")),
+ static_cast<OWeakObject*>(this));
+ }
+ mpFrame = (AquaSalFrame*)[pWin performSelector: @selector(getSalFrame)];
mDragSourceHelper = [[DragSourceHelper alloc] initWithDragSource: this];
@@ -233,8 +244,8 @@ void SAL_CALL DragSource::startDrag(const DragGestureEvent& trigger,
sal_Int8 sourceActions,
sal_Int32 cursor,
sal_Int32 image,
- const Reference<XTransferable >& transferable,
- const Reference<XDragSourceListener >& listener )
+ const uno::Reference<XTransferable >& transferable,
+ const uno::Reference<XDragSourceListener >& listener )
throw( RuntimeException)
{
MutexGuard guard(m_aMutex);
@@ -248,7 +259,7 @@ void SAL_CALL DragSource::startDrag(const DragGestureEvent& trigger,
mXCurrentContext = static_cast<XDragSourceContext*>(new DragSourceContext(this));
auto_ptr<AquaClipboard> clipb(new AquaClipboard(NULL, false));
g_XTransferable = transferable;
- clipb->setContents(g_XTransferable, Reference<XClipboardOwner>());
+ clipb->setContents(g_XTransferable, uno::Reference<XClipboardOwner>());
mDragSourceActions = sourceActions;
g_DragSourceView = mView;
@@ -288,7 +299,7 @@ void SAL_CALL DragSource::startDrag(const DragGestureEvent& trigger,
[dragImage release];
- g_XTransferable = Reference<XTransferable>();
+ g_XTransferable = uno::Reference<XTransferable>();
g_DragSourceView = nil;
// reset drop success flags
diff --git a/vcl/aqua/source/dtrans/DragSource.hxx b/vcl/aqua/source/dtrans/DragSource.hxx
index 498feaf819bb..943c84c5036e 100644
--- a/vcl/aqua/source/dtrans/DragSource.hxx
+++ b/vcl/aqua/source/dtrans/DragSource.hxx
@@ -47,6 +47,7 @@
class DragSource;
+class AquaSalFrame;
/* The functions declared in this protocol are actually
declared in vcl/aqua/inc/salframe.h. Because we want
@@ -72,7 +73,7 @@ class DragSource;
-(void)mouseDown: (NSEvent*)theEvent;
-(void)mouseDragged: (NSEvent*)theEvent;
--(unsigned int)draggingSourceOperationMaskForLocal:(MacOSBOOL)isLocal;
+-(unsigned int)draggingSourceOperationMaskForLocal:(BOOL)isLocal;
-(void)draggedImage:(NSImage*)anImage beganAt:(NSPoint)aPoint;
-(void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint operation:(NSDragOperation)operation;
-(void)draggedImage:(NSImage *)draggedImage movedTo:(NSPoint)screenPoint;
@@ -121,6 +122,7 @@ public:
com::sun::star::uno::Reference< com::sun::star::datatransfer::dnd::XDragSourceContext > mXCurrentContext;
id mView;
+ AquaSalFrame* mpFrame;
NSEvent* mLastMouseEventBeforeStartDrag;
DragSourceHelper* mDragSourceHelper;
com::sun::star::awt::MouseEvent mMouseEvent;
diff --git a/vcl/aqua/source/dtrans/DropTarget.cxx b/vcl/aqua/source/dtrans/DropTarget.cxx
index 6d5335dba6af..1fb6b9bb2d53 100644
--- a/vcl/aqua/source/dtrans/DropTarget.cxx
+++ b/vcl/aqua/source/dtrans/DropTarget.cxx
@@ -126,13 +126,13 @@ namespace /* private */
}
--(MacOSBOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
+-(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
{
return mDropTarget->prepareForDragOperation(sender);
}
--(MacOSBOOL)performDragOperation:(id <NSDraggingInfo>)sender
+-(BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
return mDropTarget->performDragOperation(sender);
}
@@ -321,13 +321,13 @@ NSDragOperation DropTarget::draggingUpdated(id sender)
}
- MacOSBOOL DropTarget::prepareForDragOperation(id sender)
+ BOOL DropTarget::prepareForDragOperation(id sender)
{
return 1;
}
-MacOSBOOL DropTarget::performDragOperation(id sender)
+BOOL DropTarget::performDragOperation(id sender)
{
bool bSuccess = false;
diff --git a/vcl/aqua/source/dtrans/DropTarget.hxx b/vcl/aqua/source/dtrans/DropTarget.hxx
index bb25497244a6..293db4d4eb39 100644
--- a/vcl/aqua/source/dtrans/DropTarget.hxx
+++ b/vcl/aqua/source/dtrans/DropTarget.hxx
@@ -75,8 +75,8 @@ class DropTarget;
-(NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender;
-(NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender;
-(void)draggingExited:(id <NSDraggingInfo>)sender;
--(MacOSBOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
--(MacOSBOOL)performDragOperation:(id <NSDraggingInfo>)sender;
+-(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
+-(BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
-(void)concludeDragOperation:(id <NSDraggingInfo>)sender;
@end
@@ -134,8 +134,8 @@ public:
virtual NSDragOperation draggingEntered(id sender);
virtual NSDragOperation draggingUpdated(id sender);
virtual void draggingExited(id sender);
- virtual MacOSBOOL prepareForDragOperation(id sender);
- virtual MacOSBOOL performDragOperation(id sender);
+ virtual BOOL prepareForDragOperation(id sender);
+ virtual BOOL performDragOperation(id sender);
virtual void concludeDragOperation(id sender);
/* If multiple actions are supported by the drag source and
diff --git a/vcl/aqua/source/dtrans/aqua_service.cxx b/vcl/aqua/source/dtrans/aqua_service.cxx
index d27548354022..aa46713bce1f 100644
--- a/vcl/aqua/source/dtrans/aqua_service.cxx
+++ b/vcl/aqua/source/dtrans/aqua_service.cxx
@@ -60,28 +60,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey )
-{
- sal_Bool bRetVal = sal_False;
-
- if ( pRegistryKey )
- {
- try
- {
- Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
- pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( AQUA_CLIPBOARD_REGKEY_NAME ) ) );
- bRetVal = sal_True;
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- bRetVal = sal_False;
- }
- }
-
- return bRetVal;
-}
-
void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* pRegistryKey )
{
void* pRet = 0;
diff --git a/vcl/aqua/source/dtrans/service_entry.cxx b/vcl/aqua/source/dtrans/service_entry.cxx
index 73476525b6b4..661d87576fa8 100644
--- a/vcl/aqua/source/dtrans/service_entry.cxx
+++ b/vcl/aqua/source/dtrans/service_entry.cxx
@@ -35,32 +35,42 @@
#include "DropTarget.hxx"
#include "aqua_clipboard.hxx"
#include "osl/diagnose.h"
+#include "vcl/svapp.hxx"
using namespace ::osl;
using namespace ::rtl;
+using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::cppu;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::datatransfer::clipboard;
-Reference< XInterface > AquaSalInstance::CreateClipboard( const Sequence< Any >& i_rArguments )
+uno::Reference< XInterface > AquaSalInstance::CreateClipboard( const Sequence< Any >& i_rArguments )
{
+ if ( Application::IsHeadlessModeEnabled() )
+ return SalInstance::CreateClipboard( i_rArguments );
+
SalData* pSalData = GetSalData();
if( ! pSalData->mxClipboard.is() )
- pSalData->mxClipboard = Reference<XInterface>(static_cast< XClipboard* >(new AquaClipboard()), UNO_QUERY);
+ pSalData->mxClipboard = uno::Reference<XInterface>(static_cast< XClipboard* >(new AquaClipboard()), UNO_QUERY);
return pSalData->mxClipboard;
}
-
-Reference<XInterface> AquaSalInstance::CreateDragSource()
+uno::Reference<XInterface> AquaSalInstance::CreateDragSource()
{
- return Reference<XInterface>(static_cast< XInitialization* >(new DragSource()), UNO_QUERY);
+ if ( Application::IsHeadlessModeEnabled() )
+ return SalInstance::CreateDragSource();
+
+ return uno::Reference<XInterface>(static_cast< XInitialization* >(new DragSource()), UNO_QUERY);
}
-Reference<XInterface> AquaSalInstance::CreateDropTarget()
+uno::Reference<XInterface> AquaSalInstance::CreateDropTarget()
{
- return Reference<XInterface>(static_cast< XInitialization* >(new DropTarget()), UNO_QUERY);
+ if ( Application::IsHeadlessModeEnabled() )
+ return SalInstance::CreateDropTarget();
+
+ return uno::Reference<XInterface>(static_cast< XInitialization* >(new DropTarget()), UNO_QUERY);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
index 8f0e080e5fb2..e62a950129e4 100644
--- a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
+++ b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
@@ -112,7 +112,7 @@ class ControllerProperties
maLocalizedStrings( VclResId( SV_PRINT_NATIVE_STRINGS ) )
{
mpState->bNeedRestart = false;
- DBG_ASSERT( maLocalizedStrings.Count() >= 4, "resources not found !" );
+ DBG_ASSERT( maLocalizedStrings.Count() >= 5, "resources not found !" );
}
rtl::OUString getMoreString()
@@ -122,6 +122,13 @@ class ControllerProperties
: rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "More" ) );
}
+ rtl::OUString getPrintSelectionString()
+ {
+ return maLocalizedStrings.Count() >= 5
+ ? rtl::OUString( maLocalizedStrings.GetString( 4 ) )
+ : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Print selection only" ) );
+ }
+
void updatePrintJob()
{
// TODO: refresh page count etc from mpController
@@ -246,7 +253,11 @@ class ControllerProperties
PropertyValue* pVal = mpController->getValue( name_it->second );
if( pVal )
{
- pVal->Value <<= i_bValue;
+ // ugly
+ if( name_it->second.equalsAscii( "PrintContent" ) )
+ pVal->Value <<= i_bValue ? sal_Int32(2) : sal_Int32(0);
+ else
+ pVal->Value <<= i_bValue;
updatePrintJob();
}
}
@@ -283,9 +294,9 @@ class ControllerProperties
-1;
std::map< int, rtl::OUString >::const_iterator name_it = maTagToPropertyName.find( nTag );
- if( name_it != maTagToPropertyName.end() )
+ if( name_it != maTagToPropertyName.end() && ! name_it->second.equalsAscii( "PrintContent" ) )
{
- MacOSBOOL bEnabled = mpController->isUIOptionEnabled( name_it->second ) ? YES : NO;
+ BOOL bEnabled = mpController->isUIOptionEnabled( name_it->second ) ? YES : NO;
if( pCtrl )
{
[pCtrl setEnabled: bEnabled];
@@ -311,6 +322,9 @@ class ControllerProperties
GDIMetaFile aMtf;
PrinterController::PageSize aPageSize( mpController->getFilteredPageFile( i_nPage, aMtf, false ) );
VirtualDevice aDev;
+ if( mpController->getPrinter()->GetPrinterOptions().IsConvertToGreyscales() )
+ aDev.SetDrawMode( aDev.GetDrawMode() | ( DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_GRAYTEXT |
+ DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT ) );
// see salprn.cxx, currently we pretend to be a 720dpi device on printers
aDev.SetReferenceDevice( 720, 720 );
aDev.EnableOutput( TRUE );
@@ -768,6 +782,325 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText )
}
}
+static void addSubgroup( NSView* pCurParent, long& rCurY, const rtl::OUString& rText )
+{
+ NSControl* pTextView = createLabel( rText );
+ [pCurParent addSubview: [pTextView autorelease]];
+ NSRect aTextRect = [pTextView frame];
+ // move to nCurY
+ aTextRect.origin.y = rCurY - aTextRect.size.height;
+ [pTextView setFrame: aTextRect];
+
+ NSRect aSepRect = { { aTextRect.size.width + 1, aTextRect.origin.y }, { 100, 6 } };
+ NSBox* pBox = [[NSBox alloc] initWithFrame: aSepRect];
+ [pBox setBoxType: NSBoxSeparator];
+ [pCurParent addSubview: [pBox autorelease]];
+
+ // update nCurY
+ rCurY = aTextRect.origin.y - 5;
+}
+
+static void addBool( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachOffset,
+ const rtl::OUString& rText, sal_Bool bEnabled,
+ const rtl::OUString& rProperty, sal_Bool bValue,
+ std::vector<ColumnItem >& rRightColumn,
+ ControllerProperties* pControllerProperties,
+ ControlTarget* pCtrlTarget
+ )
+{
+ NSRect aCheckRect = { { rCurX + nAttachOffset, 0 }, { 0, 15 } };
+ NSButton* pBtn = [[NSButton alloc] initWithFrame: aCheckRect];
+ [pBtn setButtonType: NSSwitchButton];
+ [pBtn setState: bValue ? NSOnState : NSOffState];
+ if( ! bEnabled )
+ [pBtn setEnabled: NO];
+ linebreakCell( [pBtn cell], rText );
+ [pBtn sizeToFit];
+
+ rRightColumn.push_back( ColumnItem( pBtn ) );
+
+ // connect target
+ [pBtn setTarget: pCtrlTarget];
+ [pBtn setAction: @selector(triggered:)];
+ int nTag = pControllerProperties->addNameTag( rProperty );
+ pControllerProperties->addObservedControl( pBtn );
+ [pBtn setTag: nTag];
+
+ aCheckRect = [pBtn frame];
+ // #i115837# add a murphy factor; it can apparently occasionally happen
+ // that sizeToFit does not a perfect job and that the button linebreaks again
+ // if - and only if - there is already a '\n' contained in the text and the width
+ // is minimally of
+ aCheckRect.size.width += 1;
+
+ // move to rCurY
+ aCheckRect.origin.y = rCurY - aCheckRect.size.height;
+ [pBtn setFrame: aCheckRect];
+
+ [pCurParent addSubview: [pBtn autorelease]];
+
+ // update rCurY
+ rCurY = aCheckRect.origin.y - 5;
+}
+
+static void addRadio( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachOffset,
+ const rtl::OUString& rText,
+ const rtl::OUString& rProperty, Sequence< rtl::OUString > rChoices, sal_Int32 nSelectValue,
+ std::vector<ColumnItem >& rLeftColumn,
+ std::vector<ColumnItem >& rRightColumn,
+ ControllerProperties* pControllerProperties,
+ ControlTarget* pCtrlTarget
+ )
+{
+ sal_Int32 nOff = 0;
+ if( rText.getLength() )
+ {
+ // add a label
+ NSControl* pTextView = createLabel( rText );
+ NSRect aTextRect = [pTextView frame];
+ aTextRect.origin.x = rCurX + nAttachOffset;
+ [pCurParent addSubview: [pTextView autorelease]];
+
+ rLeftColumn.push_back( ColumnItem( pTextView ) );
+
+ // move to nCurY
+ aTextRect.origin.y = rCurY - aTextRect.size.height;
+ [pTextView setFrame: aTextRect];
+
+ // update nCurY
+ rCurY = aTextRect.origin.y - 5;
+
+ // indent the radio group relative to the text
+ // nOff = 20;
+ }
+
+ // setup radio matrix
+ NSButtonCell* pProto = [[NSButtonCell alloc] init];
+
+ NSRect aRadioRect = { { rCurX + nOff, 0 }, { 280 - rCurX, 5*rChoices.getLength() } };
+ [pProto setTitle: @"RadioButtonGroup"];
+ [pProto setButtonType: NSRadioButton];
+ NSMatrix* pMatrix = [[NSMatrix alloc] initWithFrame: aRadioRect
+ mode: NSRadioModeMatrix
+ prototype: (NSCell*)pProto
+ numberOfRows: rChoices.getLength()
+ numberOfColumns: 1];
+ // set individual titles
+ NSArray* pCells = [pMatrix cells];
+ for( sal_Int32 m = 0; m < rChoices.getLength(); m++ )
+ {
+ NSCell* pCell = [pCells objectAtIndex: m];
+ filterAccelerator( rChoices[m] );
+ linebreakCell( pCell, rChoices[m] );
+ // connect target and action
+ [pCell setTarget: pCtrlTarget];
+ [pCell setAction: @selector(triggered:)];
+ int nTag = pControllerProperties->addNameAndValueTag( rProperty, m );
+ pControllerProperties->addObservedControl( pCell );
+ [pCell setTag: nTag];
+ // set current selection
+ if( nSelectValue == m )
+ [pMatrix selectCellAtRow: m column: 0];
+ }
+ [pMatrix sizeToFit];
+ aRadioRect = [pMatrix frame];
+
+ // move it down, so it comes to the correct position
+ aRadioRect.origin.y = rCurY - aRadioRect.size.height;
+ [pMatrix setFrame: aRadioRect];
+ [pCurParent addSubview: [pMatrix autorelease]];
+
+ rRightColumn.push_back( ColumnItem( pMatrix ) );
+
+ // update nCurY
+ rCurY = aRadioRect.origin.y - 5;
+
+ [pProto release];
+}
+
+static void addList( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachOffset,
+ const rtl::OUString& rText,
+ const rtl::OUString& rProperty, const Sequence< rtl::OUString > rChoices, sal_Int32 nSelectValue,
+ std::vector<ColumnItem >& rLeftColumn,
+ std::vector<ColumnItem >& rRightColumn,
+ ControllerProperties* pControllerProperties,
+ ControlTarget* pCtrlTarget
+ )
+{
+ // don't indent attached lists, looks bad in the existing cases
+ NSControl* pTextView = createLabel( rText );
+ [pCurParent addSubview: [pTextView autorelease]];
+ rLeftColumn.push_back( ColumnItem( pTextView ) );
+ NSRect aTextRect = [pTextView frame];
+ aTextRect.origin.x = rCurX /* + nAttachOffset*/;
+
+ // don't indent attached lists, looks bad in the existing cases
+ NSRect aBtnRect = { { rCurX /*+ nAttachOffset*/ + aTextRect.size.width, 0 }, { 0, 15 } };
+ NSPopUpButton* pBtn = [[NSPopUpButton alloc] initWithFrame: aBtnRect pullsDown: NO];
+
+ // iterate options
+ for( sal_Int32 m = 0; m < rChoices.getLength(); m++ )
+ {
+ NSString* pItemText = CreateNSString( rChoices[m] );
+ [pBtn addItemWithTitle: pItemText];
+ NSMenuItem* pItem = [pBtn itemWithTitle: pItemText];
+ int nTag = pControllerProperties->addNameAndValueTag( rProperty, m );
+ [pItem setTag: nTag];
+ [pItemText release];
+ }
+
+ [pBtn selectItemAtIndex: nSelectValue];
+
+ // add the button to observed controls for enabled state changes
+ // also add a tag just for this purpose
+ pControllerProperties->addObservedControl( pBtn );
+ [pBtn setTag: pControllerProperties->addNameTag( rProperty )];
+
+ [pBtn sizeToFit];
+ [pCurParent addSubview: [pBtn autorelease]];
+
+ rRightColumn.push_back( ColumnItem( pBtn ) );
+
+ // connect target and action
+ [pBtn setTarget: pCtrlTarget];
+ [pBtn setAction: @selector(triggered:)];
+
+ // move to nCurY
+ aBtnRect = [pBtn frame];
+ aBtnRect.origin.y = rCurY - aBtnRect.size.height;
+ [pBtn setFrame: aBtnRect];
+
+ // align label
+ aTextRect.origin.y = aBtnRect.origin.y + (aBtnRect.size.height - aTextRect.size.height)/2;
+ [pTextView setFrame: aTextRect];
+
+ // update rCurY
+ rCurY = aBtnRect.origin.y - 5;
+}
+
+static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachOffset,
+ const rtl::OUString rCtrlType,
+ const rtl::OUString& rText,
+ const rtl::OUString& rProperty, const PropertyValue* pValue,
+ sal_Int64 nMinValue, sal_Int64 nMaxValue,
+ std::vector<ColumnItem >& rLeftColumn,
+ std::vector<ColumnItem >& rRightColumn,
+ ControllerProperties* pControllerProperties,
+ ControlTarget* pCtrlTarget
+ )
+{
+ sal_Int32 nOff = 0;
+ if( rText.getLength() )
+ {
+ // add a label
+ NSControl* pTextView = createLabel( rText );
+ [pCurParent addSubview: [pTextView autorelease]];
+
+ rLeftColumn.push_back( ColumnItem( pTextView ) );
+
+ // move to nCurY
+ NSRect aTextRect = [pTextView frame];
+ aTextRect.origin.x = rCurX + nAttachOffset;
+ aTextRect.origin.y = rCurY - aTextRect.size.height;
+ [pTextView setFrame: aTextRect];
+
+ // update nCurY
+ rCurY = aTextRect.origin.y - 5;
+
+ // and set the offset for the real edit field
+ nOff = aTextRect.size.width + 5;
+ }
+
+ NSRect aFieldRect = { { rCurX + nOff + nAttachOffset, 0 }, { 100, 25 } };
+ NSTextField* pFieldView = [[NSTextField alloc] initWithFrame: aFieldRect];
+ [pFieldView setEditable: YES];
+ [pFieldView setSelectable: YES];
+ [pFieldView setDrawsBackground: YES];
+ [pFieldView sizeToFit]; // FIXME: this does nothing
+ [pCurParent addSubview: [pFieldView autorelease]];
+
+ rRightColumn.push_back( ColumnItem( pFieldView ) );
+
+ // add the field to observed controls for enabled state changes
+ // also add a tag just for this purpose
+ pControllerProperties->addObservedControl( pFieldView );
+ int nTag = pControllerProperties->addNameTag( rProperty );
+ [pFieldView setTag: nTag];
+ // pControllerProperties->addNamedView( pFieldView, aPropertyName );
+
+ // move to nCurY
+ aFieldRect.origin.y = rCurY - aFieldRect.size.height;
+ [pFieldView setFrame: aFieldRect];
+
+ if( rCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Range" ) ) )
+ {
+ // add a stepper control
+ NSRect aStepFrame = { { aFieldRect.origin.x + aFieldRect.size.width + 5,
+ aFieldRect.origin.y },
+ { 15, aFieldRect.size.height } };
+ NSStepper* pStep = [[NSStepper alloc] initWithFrame: aStepFrame];
+ [pStep setIncrement: 1];
+ [pStep setValueWraps: NO];
+ [pStep setTag: nTag];
+ [pCurParent addSubview: [pStep autorelease]];
+
+ rRightColumn.back().pSubControl = pStep;
+
+ pControllerProperties->addObservedControl( pStep );
+ [pStep setTarget: pCtrlTarget];
+ [pStep setAction: @selector(triggered:)];
+
+ // constrain the text field to decimal numbers
+ NSNumberFormatter* pFormatter = [[NSNumberFormatter alloc] init];
+ [pFormatter setFormatterBehavior: NSNumberFormatterBehavior10_4];
+ [pFormatter setNumberStyle: NSNumberFormatterDecimalStyle];
+ [pFormatter setAllowsFloats: NO];
+ [pFormatter setMaximumFractionDigits: 0];
+ if( nMinValue != nMaxValue )
+ {
+ [pFormatter setMinimum: [[NSNumber numberWithInt: nMinValue] autorelease]];
+ [pStep setMinValue: nMinValue];
+ [pFormatter setMaximum: [[NSNumber numberWithInt: nMaxValue] autorelease]];
+ [pStep setMaxValue: nMaxValue];
+ }
+ [pFieldView setFormatter: pFormatter];
+
+ sal_Int64 nSelectVal = 0;
+ if( pValue && pValue->Value.hasValue() )
+ pValue->Value >>= nSelectVal;
+
+ [pFieldView setIntValue: nSelectVal];
+ [pStep setIntValue: nSelectVal];
+
+ pControllerProperties->addViewPair( pFieldView, pStep );
+ // connect target and action
+ [pFieldView setTarget: pCtrlTarget];
+ [pFieldView setAction: @selector(triggeredNumeric:)];
+ [pStep setTarget: pCtrlTarget];
+ [pStep setAction: @selector(triggeredNumeric:)];
+ }
+ else
+ {
+ // connect target and action
+ [pFieldView setTarget: pCtrlTarget];
+ [pFieldView setAction: @selector(triggered:)];
+
+ if( pValue && pValue->Value.hasValue() )
+ {
+ rtl::OUString aValue;
+ pValue->Value >>= aValue;
+ if( aValue.getLength() )
+ {
+ NSString* pText = CreateNSString( aValue );
+ [pFieldView setStringValue: pText];
+ [pText release];
+ }
+ }
+ }
+
+ // update nCurY
+ rCurY = aFieldRect.origin.y - 5;
+}
@implementation AquaPrintAccessoryView
+(NSObject*)setupPrinterPanel: (NSPrintOperation*)pOp withController: (vcl::PrinterController*)pController withState: (PrintAccessoryViewState*)pState;
@@ -792,6 +1125,54 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText )
ControlTarget* pCtrlTarget = [[ControlTarget alloc] initWithControllerMap: pControllerProperties];
std::vector< ColumnItem > aLeftColumn, aRightColumn;
+
+ // ugly:
+ // prepend a "selection" checkbox if the properties have such a selection in PrintContent
+ bool bAddSelectionCheckBox = false, bSelectionBoxEnabled = false, bSelectionBoxChecked = false;
+ for( int i = 0; i < rOptions.getLength(); i++ )
+ {
+ Sequence< beans::PropertyValue > aOptProp;
+ rOptions[i].Value >>= aOptProp;
+
+ rtl::OUString aCtrlType;
+ rtl::OUString aPropertyName;
+ Sequence< rtl::OUString > aChoices;
+ Sequence< sal_Bool > aChoicesDisabled;
+ sal_Int32 aSelectionChecked = 0;
+ for( int n = 0; n < aOptProp.getLength(); n++ )
+ {
+ const beans::PropertyValue& rEntry( aOptProp[ n ] );
+ if( rEntry.Name.equalsAscii( "ControlType" ) )
+ {
+ rEntry.Value >>= aCtrlType;
+ }
+ else if( rEntry.Name.equalsAscii( "Choices" ) )
+ {
+ rEntry.Value >>= aChoices;
+ }
+ else if( rEntry.Name.equalsAscii( "ChoicesDisabled" ) )
+ {
+ rEntry.Value >>= aChoicesDisabled;
+ }
+ else if( rEntry.Name.equalsAscii( "Property" ) )
+ {
+ PropertyValue aVal;
+ rEntry.Value >>= aVal;
+ aPropertyName = aVal.Name;
+ if( aPropertyName.equalsAscii( "PrintContent" ) )
+ aVal.Value >>= aSelectionChecked;
+ }
+ }
+ if( aCtrlType.equalsAscii( "Radio" ) &&
+ aPropertyName.equalsAscii( "PrintContent" ) &&
+ aChoices.getLength() > 2 )
+ {
+ bAddSelectionCheckBox = true;
+ bSelectionBoxEnabled = aChoicesDisabled.getLength() < 2 || ! aChoicesDisabled[2];
+ bSelectionBoxChecked = (aSelectionChecked==2);
+ break;
+ }
+ }
for( int i = 0; i < rOptions.getLength(); i++ )
{
@@ -803,6 +1184,7 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText )
rtl::OUString aCtrlType;
rtl::OUString aText;
rtl::OUString aPropertyName;
+ rtl::OUString aGroupHint;
Sequence< rtl::OUString > aChoices;
sal_Int64 nMinValue = 0, nMaxValue = 0;
long nAttachOffset = 0;
@@ -811,66 +1193,70 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText )
for( int n = 0; n < aOptProp.getLength(); n++ )
{
const beans::PropertyValue& rEntry( aOptProp[ n ] );
- if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Text" ) ) )
+ if( rEntry.Name.equalsAscii( "Text" ) )
{
rEntry.Value >>= aText;
filterAccelerator( aText );
}
- else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ControlType" ) ) )
+ else if( rEntry.Name.equalsAscii( "ControlType" ) )
{
rEntry.Value >>= aCtrlType;
}
- else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Choices" ) ) )
+ else if( rEntry.Name.equalsAscii( "Choices" ) )
{
rEntry.Value >>= aChoices;
}
- else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Property" ) ) )
+ else if( rEntry.Name.equalsAscii( "Property" ) )
{
PropertyValue aVal;
rEntry.Value >>= aVal;
aPropertyName = aVal.Name;
}
- else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Enabled" ) ) )
+ else if( rEntry.Name.equalsAscii( "Enabled" ) )
{
sal_Bool bValue = sal_True;
rEntry.Value >>= bValue;
bEnabled = bValue;
}
- else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MinValue" ) ) )
+ else if( rEntry.Name.equalsAscii( "MinValue" ) )
{
rEntry.Value >>= nMinValue;
}
- else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MaxValue" ) ) )
+ else if( rEntry.Name.equalsAscii( "MaxValue" ) )
{
rEntry.Value >>= nMaxValue;
}
- else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "AttachToDependency" ) ) )
+ else if( rEntry.Name.equalsAscii( "AttachToDependency" ) )
{
nAttachOffset = 20;
}
- else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "InternalUIOnly" ) ) )
+ else if( rEntry.Name.equalsAscii( "InternalUIOnly" ) )
{
rEntry.Value >>= bIgnore;
}
+ else if( rEntry.Name.equalsAscii( "GroupingHint" ) )
+ {
+ rEntry.Value >>= aGroupHint;
+ }
}
- if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Group" ) ) ||
- aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Subgroup" ) ) ||
- aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Radio" ) ) ||
- aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "List" ) ) ||
- aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Edit" ) ) ||
- aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Range" ) ) ||
- aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Bool" ) ) )
+ if( aCtrlType.equalsAscii( "Group" ) ||
+ aCtrlType.equalsAscii( "Subgroup" ) ||
+ aCtrlType.equalsAscii( "Radio" ) ||
+ aCtrlType.equalsAscii( "List" ) ||
+ aCtrlType.equalsAscii( "Edit" ) ||
+ aCtrlType.equalsAscii( "Range" ) ||
+ aCtrlType.equalsAscii( "Bool" ) )
{
// since our build target is MacOSX 10.4 we can have only one accessory view
// so we have a single accessory view that is tabbed for grouping
- if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Group" ) )
+ if( aCtrlType.equalsAscii( "Group" )
|| ! pCurParent
- || ( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Subgroup" ) ) && nCurY < -250 && ! bIgnore )
+ || ( aCtrlType.equalsAscii( "Subgroup" ) && nCurY < -250 && ! bIgnore )
)
{
rtl::OUString aGroupTitle( aText );
- if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Subgroup" ) ) )
+ if( aCtrlType.equalsAscii( "Subgroup" ) )
aGroupTitle = pControllerProperties->getMoreString();
// set size of current parent
if( pCurParent )
@@ -894,310 +1280,73 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText )
// clear columns
aLeftColumn.clear();
aRightColumn.clear();
+
+ if( bAddSelectionCheckBox )
+ {
+ addBool( pCurParent, nCurX, nCurY, 0,
+ pControllerProperties->getPrintSelectionString(), bSelectionBoxEnabled,
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ), bSelectionBoxChecked,
+ aRightColumn, pControllerProperties, pCtrlTarget );
+ bAddSelectionCheckBox = false;
+ }
}
- if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Subgroup" ) ) && pCurParent )
+ if( aCtrlType.equalsAscii( "Subgroup" ) && pCurParent )
{
bIgnoreSubgroup = bIgnore;
if( bIgnore )
continue;
- NSControl* pTextView = createLabel( aText );
- [pCurParent addSubview: [pTextView autorelease]];
- NSRect aTextRect = [pTextView frame];
- // move to nCurY
- aTextRect.origin.y = nCurY - aTextRect.size.height;
- [pTextView setFrame: aTextRect];
-
- NSRect aSepRect = { { aTextRect.size.width + 1, aTextRect.origin.y }, { 100, 6 } };
- NSBox* pBox = [[NSBox alloc] initWithFrame: aSepRect];
- [pBox setBoxType: NSBoxSeparator];
- [pCurParent addSubview: [pBox autorelease]];
-
- // update nCurY
- nCurY = aTextRect.origin.y - 5;
+ addSubgroup( pCurParent, nCurY, aText );
}
else if( bIgnoreSubgroup || bIgnore )
+ {
continue;
- else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Bool" ) ) && pCurParent )
+ }
+ else if( aCtrlType.equalsAscii( "Bool" ) && pCurParent )
{
- NSRect aCheckRect = { { nCurX + nAttachOffset, 0 }, { 0, 15 } };
- NSButton* pBtn = [[NSButton alloc] initWithFrame: aCheckRect];
- [pBtn setButtonType: NSSwitchButton];
sal_Bool bVal = sal_False;
PropertyValue* pVal = pController->getValue( aPropertyName );
if( pVal )
pVal->Value >>= bVal;
- [pBtn setState: bVal ? NSOnState : NSOffState];
- linebreakCell( [pBtn cell], aText );
- [pBtn sizeToFit];
- [pCurParent addSubview: [pBtn autorelease]];
-
- aRightColumn.push_back( ColumnItem( pBtn ) );
-
- // connect target
- [pBtn setTarget: pCtrlTarget];
- [pBtn setAction: @selector(triggered:)];
- int nTag = pControllerProperties->addNameTag( aPropertyName );
- pControllerProperties->addObservedControl( pBtn );
- [pBtn setTag: nTag];
-
- aCheckRect = [pBtn frame];
-
- // move to nCurY
- aCheckRect.origin.y = nCurY - aCheckRect.size.height;
- [pBtn setFrame: aCheckRect];
-
- // update nCurY
- nCurY = aCheckRect.origin.y - 5;
+ addBool( pCurParent, nCurX, nCurY, nAttachOffset,
+ aText, true, aPropertyName, bVal,
+ aRightColumn, pControllerProperties, pCtrlTarget );
}
- else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Radio" ) ) && pCurParent )
+ else if( aCtrlType.equalsAscii( "Radio" ) && pCurParent )
{
- sal_Int32 nOff = 0;
- if( aText.getLength() )
- {
- // add a label
- NSControl* pTextView = createLabel( aText );
- NSRect aTextRect = [pTextView frame];
- aTextRect.origin.x = nCurX + nAttachOffset;
- [pCurParent addSubview: [pTextView autorelease]];
-
- aLeftColumn.push_back( ColumnItem( pTextView ) );
-
- // move to nCurY
- aTextRect.origin.y = nCurY - aTextRect.size.height;
- [pTextView setFrame: aTextRect];
-
- // update nCurY
- nCurY = aTextRect.origin.y - 5;
-
- // indent the radio group relative to the text
- // nOff = 20;
- }
-
- // setup radio matrix
- NSButtonCell* pProto = [[NSButtonCell alloc] init];
-
- NSRect aRadioRect = { { nCurX + nOff, 0 }, { 280 - nCurX, 5*aChoices.getLength() } };
- [pProto setTitle: @"RadioButtonGroup"];
- [pProto setButtonType: NSRadioButton];
- NSMatrix* pMatrix = [[NSMatrix alloc] initWithFrame: aRadioRect
- mode: NSRadioModeMatrix
- prototype: (NSCell*)pProto
- numberOfRows: aChoices.getLength()
- numberOfColumns: 1];
// get currently selected value
sal_Int32 nSelectVal = 0;
PropertyValue* pVal = pController->getValue( aPropertyName );
if( pVal && pVal->Value.hasValue() )
pVal->Value >>= nSelectVal;
- // set individual titles
- NSArray* pCells = [pMatrix cells];
- for( sal_Int32 m = 0; m < aChoices.getLength(); m++ )
- {
- NSCell* pCell = [pCells objectAtIndex: m];
- filterAccelerator( aChoices[m] );
- linebreakCell( pCell, aChoices[m] );
- //NSString* pTitle = CreateNSString( aChoices[m] );
- //[pCell setTitle: pTitle];
- // connect target and action
- [pCell setTarget: pCtrlTarget];
- [pCell setAction: @selector(triggered:)];
- int nTag = pControllerProperties->addNameAndValueTag( aPropertyName, m );
- pControllerProperties->addObservedControl( pCell );
- [pCell setTag: nTag];
- //[pTitle release];
- // set current selection
- if( nSelectVal == m )
- [pMatrix selectCellAtRow: m column: 0];
- }
- [pMatrix sizeToFit];
- aRadioRect = [pMatrix frame];
-
- // move it down, so it comes to the correct position
- aRadioRect.origin.y = nCurY - aRadioRect.size.height;
- [pMatrix setFrame: aRadioRect];
- [pCurParent addSubview: [pMatrix autorelease]];
- aRightColumn.push_back( ColumnItem( pMatrix ) );
-
- // update nCurY
- nCurY = aRadioRect.origin.y - 5;
-
- [pProto release];
+ addRadio( pCurParent, nCurX, nCurY, nAttachOffset,
+ aText, aPropertyName, aChoices, nSelectVal,
+ aLeftColumn, aRightColumn,
+ pControllerProperties, pCtrlTarget );
}
- else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "List" ) ) && pCurParent )
+ else if( aCtrlType.equalsAscii( "List" ) && pCurParent )
{
- // don't indent attached lists, looks bad in the existing cases
- NSControl* pTextView = createLabel( aText );
- [pCurParent addSubview: [pTextView autorelease]];
- aLeftColumn.push_back( ColumnItem( pTextView ) );
- NSRect aTextRect = [pTextView frame];
- aTextRect.origin.x = nCurX /* + nAttachOffset*/;
-
- // don't indent attached lists, looks bad in the existing cases
- NSRect aBtnRect = { { nCurX /*+ nAttachOffset*/ + aTextRect.size.width, 0 }, { 0, 15 } };
- NSPopUpButton* pBtn = [[NSPopUpButton alloc] initWithFrame: aBtnRect pullsDown: NO];
-
- // iterate options
- for( sal_Int32 m = 0; m < aChoices.getLength(); m++ )
- {
- NSString* pItemText = CreateNSString( aChoices[m] );
- [pBtn addItemWithTitle: pItemText];
- NSMenuItem* pItem = [pBtn itemWithTitle: pItemText];
- int nTag = pControllerProperties->addNameAndValueTag( aPropertyName, m );
- [pItem setTag: nTag];
- [pItemText release];
- }
-
PropertyValue* pVal = pController->getValue( aPropertyName );
sal_Int32 aSelectVal = 0;
if( pVal && pVal->Value.hasValue() )
pVal->Value >>= aSelectVal;
- [pBtn selectItemAtIndex: aSelectVal];
-
- // add the button to observed controls for enabled state changes
- // also add a tag just for this purpose
- pControllerProperties->addObservedControl( pBtn );
- [pBtn setTag: pControllerProperties->addNameTag( aPropertyName )];
-
- [pBtn sizeToFit];
- [pCurParent addSubview: [pBtn autorelease]];
-
- aRightColumn.push_back( ColumnItem( pBtn ) );
-
- // connect target and action
- [pBtn setTarget: pCtrlTarget];
- [pBtn setAction: @selector(triggered:)];
-
- // move to nCurY
- aBtnRect = [pBtn frame];
- aBtnRect.origin.y = nCurY - aBtnRect.size.height;
- [pBtn setFrame: aBtnRect];
-
- // align label
- aTextRect.origin.y = aBtnRect.origin.y + (aBtnRect.size.height - aTextRect.size.height)/2;
- [pTextView setFrame: aTextRect];
- // update nCurY
- nCurY = aBtnRect.origin.y - 5;
+ addList( pCurParent, nCurX, nCurY, nAttachOffset,
+ aText, aPropertyName, aChoices, aSelectVal,
+ aLeftColumn, aRightColumn,
+ pControllerProperties, pCtrlTarget );
}
- else if( (aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Edit" ) ) || aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Range" ) )) && pCurParent )
+ else if( (aCtrlType.equalsAscii( "Edit" ) || aCtrlType.equalsAscii( "Range" )) && pCurParent )
{
- sal_Int32 nOff = 0;
- if( aText.getLength() )
- {
- // add a label
- NSControl* pTextView = createLabel( aText );
- [pCurParent addSubview: [pTextView autorelease]];
-
- aLeftColumn.push_back( ColumnItem( pTextView ) );
-
- // move to nCurY
- NSRect aTextRect = [pTextView frame];
- aTextRect.origin.x = nCurX + nAttachOffset;
- aTextRect.origin.y = nCurY - aTextRect.size.height;
- [pTextView setFrame: aTextRect];
-
- // update nCurY
- nCurY = aTextRect.origin.y - 5;
-
- // and set the offset for the real edit field
- nOff = aTextRect.size.width + 5;
- }
-
- NSRect aFieldRect = { { nCurX + nOff + nAttachOffset, 0 }, { 100, 25 } };
- NSTextField* pFieldView = [[NSTextField alloc] initWithFrame: aFieldRect];
- [pFieldView setEditable: YES];
- [pFieldView setSelectable: YES];
- [pFieldView setDrawsBackground: YES];
- [pFieldView sizeToFit]; // FIXME: this does nothing
- [pCurParent addSubview: [pFieldView autorelease]];
-
- aRightColumn.push_back( ColumnItem( pFieldView ) );
-
- // add the field to observed controls for enabled state changes
- // also add a tag just for this purpose
- pControllerProperties->addObservedControl( pFieldView );
- int nTag = pControllerProperties->addNameTag( aPropertyName );
- [pFieldView setTag: nTag];
- // pControllerProperties->addNamedView( pFieldView, aPropertyName );
-
- // move to nCurY
- aFieldRect.origin.y = nCurY - aFieldRect.size.height;
- [pFieldView setFrame: aFieldRect];
-
// current value
PropertyValue* pVal = pController->getValue( aPropertyName );
- if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Range" ) ) )
- {
- // add a stepper control
- NSRect aStepFrame = { { aFieldRect.origin.x + aFieldRect.size.width + 5,
- aFieldRect.origin.y },
- { 15, aFieldRect.size.height } };
- NSStepper* pStep = [[NSStepper alloc] initWithFrame: aStepFrame];
- [pStep setIncrement: 1];
- [pStep setValueWraps: NO];
- [pStep setTag: nTag];
- [pCurParent addSubview: [pStep autorelease]];
-
- aRightColumn.back().pSubControl = pStep;
-
- pControllerProperties->addObservedControl( pStep );
- [pStep setTarget: pCtrlTarget];
- [pStep setAction: @selector(triggered:)];
-
- // constrain the text field to decimal numbers
- NSNumberFormatter* pFormatter = [[NSNumberFormatter alloc] init];
- [pFormatter setFormatterBehavior: NSNumberFormatterBehavior10_4];
- [pFormatter setNumberStyle: NSNumberFormatterDecimalStyle];
- [pFormatter setAllowsFloats: NO];
- [pFormatter setMaximumFractionDigits: 0];
- if( nMinValue != nMaxValue )
- {
- [pFormatter setMinimum: [[NSNumber numberWithInt: nMinValue] autorelease]];
- [pStep setMinValue: nMinValue];
- [pFormatter setMaximum: [[NSNumber numberWithInt: nMaxValue] autorelease]];
- [pStep setMaxValue: nMaxValue];
- }
- [pFieldView setFormatter: pFormatter];
-
- sal_Int64 nSelectVal = 0;
- if( pVal && pVal->Value.hasValue() )
- pVal->Value >>= nSelectVal;
-
- [pFieldView setIntValue: nSelectVal];
- [pStep setIntValue: nSelectVal];
-
- pControllerProperties->addViewPair( pFieldView, pStep );
- // connect target and action
- [pFieldView setTarget: pCtrlTarget];
- [pFieldView setAction: @selector(triggeredNumeric:)];
- [pStep setTarget: pCtrlTarget];
- [pStep setAction: @selector(triggeredNumeric:)];
- }
- else
- {
- // connect target and action
- [pFieldView setTarget: pCtrlTarget];
- [pFieldView setAction: @selector(triggered:)];
-
- if( pVal && pVal->Value.hasValue() )
- {
- rtl::OUString aValue;
- pVal->Value >>= aValue;
- if( aValue.getLength() )
- {
- NSString* pText = CreateNSString( aValue );
- [pFieldView setStringValue: pText];
- [pText release];
- }
- }
- }
-
- // update nCurY
- nCurY = aFieldRect.origin.y - 5;
-
+ addEdit( pCurParent, nCurX, nCurY, nAttachOffset,
+ aCtrlType, aText, aPropertyName, pVal,
+ nMinValue, nMaxValue,
+ aLeftColumn, aRightColumn,
+ pControllerProperties, pCtrlTarget );
}
}
else
@@ -1205,7 +1354,7 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText )
OSL_FAIL( "Unsupported UI option" );
}
}
-
+
pControllerProperties->updateEnableState();
adjustViewAndChildren( pCurParent, aMaxTabSize, aLeftColumn, aRightColumn );
diff --git a/vcl/aqua/source/gdi/aquaprintview.mm b/vcl/aqua/source/gdi/aquaprintview.mm
index ae42c5c09e8d..11b4b9088591 100755
--- a/vcl/aqua/source/gdi/aquaprintview.mm
+++ b/vcl/aqua/source/gdi/aquaprintview.mm
@@ -44,7 +44,7 @@
return self;
}
--(MacOSBOOL)knowsPageRange: (NSRangePointer)range
+-(BOOL)knowsPageRange: (NSRangePointer)range
{
range->location = 1;
range->length = mpInfoPrinter->getCurPageRangeCount();
diff --git a/vcl/aqua/source/gdi/salatslayout.cxx b/vcl/aqua/source/gdi/salatslayout.cxx
index f79da3559b35..3a88422a2160 100644
--- a/vcl/aqua/source/gdi/salatslayout.cxx
+++ b/vcl/aqua/source/gdi/salatslayout.cxx
@@ -267,7 +267,7 @@ bool ATSLayout::LayoutText( ImplLayoutArgs& rArgs )
if( (rArgs.mnFlags & SAL_LAYOUT_BIDI_STRONG) != 0 )
{
// control BiDi defaults
- MacOSBOOL nLineDirTag = kATSULeftToRightBaseDirection;
+ BOOL nLineDirTag = kATSULeftToRightBaseDirection;
if( (rArgs.mnFlags & SAL_LAYOUT_BIDI_RTL) != 0 )
nLineDirTag = kATSURightToLeftBaseDirection;
aTagAttrs[0] = kATSULineDirectionTag;
diff --git a/vcl/aqua/source/gdi/salbmp.cxx b/vcl/aqua/source/gdi/salbmp.cxx
index 2a531f243de2..7fc5ff74ed2e 100644
--- a/vcl/aqua/source/gdi/salbmp.cxx
+++ b/vcl/aqua/source/gdi/salbmp.cxx
@@ -105,7 +105,7 @@ bool AquaSalBitmap::Create( CGLayerRef xLayer, int nBitmapBits,
// ------------------------------------------------------------------
-bool AquaSalBitmap::Create( const Size& rSize, USHORT nBits, const BitmapPalette& rBitmapPalette )
+bool AquaSalBitmap::Create( const Size& rSize, sal_uInt16 nBits, const BitmapPalette& rBitmapPalette )
{
if( !isValidBitCount( nBits ) )
return false;
@@ -132,7 +132,7 @@ bool AquaSalBitmap::Create( const SalBitmap& rSalBmp, SalGraphics* pGraphics )
// ------------------------------------------------------------------
-bool AquaSalBitmap::Create( const SalBitmap& rSalBmp, USHORT nNewBitCount )
+bool AquaSalBitmap::Create( const SalBitmap& rSalBmp, sal_uInt16 nNewBitCount )
{
const AquaSalBitmap& rSourceBitmap = static_cast<const AquaSalBitmap&>(rSalBmp);
@@ -568,7 +568,7 @@ Size AquaSalBitmap::GetSize() const
// ------------------------------------------------------------------
-USHORT AquaSalBitmap::GetBitCount() const
+sal_uInt16 AquaSalBitmap::GetBitCount() const
{
return mnBits;
}
@@ -577,9 +577,9 @@ USHORT AquaSalBitmap::GetBitCount() const
static struct pal_entry
{
- BYTE mnRed;
- BYTE mnGreen;
- BYTE mnBlue;
+ sal_uInt8 mnRed;
+ sal_uInt8 mnGreen;
+ sal_uInt8 mnBlue;
}
const aImplSalSysPalEntryAry[ 16 ] =
{
@@ -634,9 +634,9 @@ const BitmapPalette& GetDefaultPalette( int mnBits, bool bMonochrome )
// own palette (6/6/6)
const int DITHER_PAL_STEPS = 6;
- const BYTE DITHER_PAL_DELTA = 51;
+ const sal_uInt8 DITHER_PAL_DELTA = 51;
int nB, nG, nR;
- BYTE nRed, nGreen, nBlue;
+ sal_uInt8 nRed, nGreen, nBlue;
for( nB=0, nBlue=0; nB < DITHER_PAL_STEPS; nB++, nBlue += DITHER_PAL_DELTA )
{
for( nG=0, nGreen=0; nG < DITHER_PAL_STEPS; nG++, nGreen += DITHER_PAL_DELTA )
diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx
index cd32820f258c..4eadc86ff15d 100644
--- a/vcl/aqua/source/gdi/salgdi.cxx
+++ b/vcl/aqua/source/gdi/salgdi.cxx
@@ -42,6 +42,7 @@
#include "vcl/sysdata.hxx"
#include "vcl/sallayout.hxx"
#include "vcl/svapp.hxx"
+#include "vcl/region.h"
#include "osl/file.hxx"
#include "osl/process.h"
@@ -59,7 +60,7 @@
using namespace vcl;
-typedef unsigned char Boolean; // copied from MacTypes.h, should be properly included
+//typedef unsigned char Boolean; // copied from MacTypes.h, should be properly included
typedef std::vector<unsigned char> ByteVector;
@@ -118,17 +119,15 @@ inline FourCharCode GetTag(const char aTagName[5])
static unsigned GetUShort( const unsigned char* p ){return((p[0]<<8)+p[1]);}
static unsigned GetUInt( const unsigned char* p ) { return((p[0]<<24)+(p[1]<<16)+(p[2]<<8)+p[3]);}
-ImplFontCharMap* ImplMacFontData::GetImplFontCharMap() const
+const ImplFontCharMap* ImplMacFontData::GetImplFontCharMap() const
{
+ // return the cached charmap
if( mpCharMap )
- {
- // return the cached charmap
- mpCharMap->AddReference();
return mpCharMap;
- }
// set the default charmap
mpCharMap = ImplFontCharMap::GetDefaultMap();
+ mpCharMap->AddReference();
// get the CMAP byte size
ATSFontRef rFont = FMGetATSFontRefFromFont( mnFontId );
@@ -502,9 +501,9 @@ void AquaSalGraphics::copyResolution( AquaSalGraphics& rGraphics )
// -----------------------------------------------------------------------
-USHORT AquaSalGraphics::GetBitCount() const
+sal_uInt16 AquaSalGraphics::GetBitCount() const
{
- USHORT nBits = mnBitmapDepth ? mnBitmapDepth : 32;//24;
+ sal_uInt16 nBits = mnBitmapDepth ? mnBitmapDepth : 32;//24;
return nBits;
}
@@ -611,7 +610,7 @@ void AquaSalGraphics::ResetClipRegion()
// -----------------------------------------------------------------------
-void AquaSalGraphics::BeginSetClipRegion( ULONG nRectCount )
+bool AquaSalGraphics::setClipRegion( const Region& i_rClip )
{
// release old clip path
if( mxClipPath )
@@ -619,41 +618,33 @@ void AquaSalGraphics::BeginSetClipRegion( ULONG nRectCount )
CGPathRelease( mxClipPath );
mxClipPath = NULL;
}
-}
-
-// -----------------------------------------------------------------------
-
-BOOL AquaSalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeight )
-{
- if( (nWidth <= 0) || (nHeight <= 0) )
- return TRUE;
-
- if( !mxClipPath )
- mxClipPath = CGPathCreateMutable();
- const CGRect aClipRect = {{nX,nY},{nWidth,nHeight}};
- CGPathAddRect( mxClipPath, NULL, aClipRect );
- return TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-bool AquaSalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& rPolyPolygon )
-{
- if( rPolyPolygon.count() <= 0 )
- return true;
-
- if( !mxClipPath )
- mxClipPath = CGPathCreateMutable();
- AddPolyPolygonToPath( mxClipPath, rPolyPolygon, !getAntiAliasB2DDraw(), false );
- return true;
-}
+ mxClipPath = CGPathCreateMutable();
-// -----------------------------------------------------------------------
-
-void AquaSalGraphics::EndSetClipRegion()
-{
+ // set current path, either as polypolgon or sequence of rectangles
+ if( i_rClip.HasPolyPolygon() )
+ {
+ basegfx::B2DPolyPolygon aClip( const_cast<Region&>(i_rClip).ConvertToB2DPolyPolygon() );
+ AddPolyPolygonToPath( mxClipPath, aClip, !getAntiAliasB2DDraw(), false );
+ }
+ else
+ {
+ long nX, nY, nW, nH;
+ ImplRegionInfo aInfo;
+ bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
+ while( bRegionRect )
+ {
+ if( nW && nH )
+ {
+ CGRect aRect = {{nX,nY}, {nW,nH}};
+ CGPathAddRect( mxClipPath, NULL, aRect );
+ }
+ bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
+ }
+ }
+ // set the current path as clip region
if( CheckContext() )
SetState();
+ return true;
}
// -----------------------------------------------------------------------
@@ -796,13 +787,13 @@ void AquaSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight )
// -----------------------------------------------------------------------
-static void getBoundRect( ULONG nPoints, const SalPoint *pPtAry, long &rX, long& rY, long& rWidth, long& rHeight )
+static void getBoundRect( sal_uLong nPoints, const SalPoint *pPtAry, long &rX, long& rY, long& rWidth, long& rHeight )
{
long nX1 = pPtAry->mnX;
long nX2 = nX1;
long nY1 = pPtAry->mnY;
long nY2 = nY1;
- for( ULONG n = 1; n < nPoints; n++ )
+ for( sal_uLong n = 1; n < nPoints; n++ )
{
if( pPtAry[n].mnX < nX1 )
nX1 = pPtAry[n].mnX;
@@ -826,7 +817,7 @@ static inline void alignLinePoint( const SalPoint* i_pIn, float& o_fX, float& o_
o_fY = static_cast<float>(i_pIn->mnY ) + 0.5;
}
-void AquaSalGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry )
+void AquaSalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry )
{
if( nPoints < 1 )
return;
@@ -842,7 +833,7 @@ void AquaSalGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry )
alignLinePoint( pPtAry, fX, fY );
CGContextMoveToPoint( mrContext, fX, fY );
pPtAry++;
- for( ULONG nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
+ for( sal_uLong nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
{
alignLinePoint( pPtAry, fX, fY );
CGContextAddLineToPoint( mrContext, fX, fY );
@@ -854,7 +845,7 @@ void AquaSalGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry )
// -----------------------------------------------------------------------
-void AquaSalGraphics::drawPolygon( ULONG nPoints, const SalPoint *pPtAry )
+void AquaSalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint *pPtAry )
{
if( nPoints <= 1 )
return;
@@ -882,7 +873,7 @@ void AquaSalGraphics::drawPolygon( ULONG nPoints, const SalPoint *pPtAry )
alignLinePoint( pPtAry, fX, fY );
CGContextMoveToPoint( mrContext, fX, fY );
pPtAry++;
- for( ULONG nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
+ for( sal_uLong nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
{
alignLinePoint( pPtAry, fX, fY );
CGContextAddLineToPoint( mrContext, fX, fY );
@@ -892,7 +883,7 @@ void AquaSalGraphics::drawPolygon( ULONG nPoints, const SalPoint *pPtAry )
{
CGContextMoveToPoint( mrContext, pPtAry->mnX, pPtAry->mnY );
pPtAry++;
- for( ULONG nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
+ for( sal_uLong nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
CGContextAddLineToPoint( mrContext, pPtAry->mnX, pPtAry->mnY );
}
@@ -902,7 +893,7 @@ void AquaSalGraphics::drawPolygon( ULONG nPoints, const SalPoint *pPtAry )
// -----------------------------------------------------------------------
-void AquaSalGraphics::drawPolyPolygon( ULONG nPolyCount, const ULONG *pPoints, PCONSTSALPOINT *ppPtAry )
+void AquaSalGraphics::drawPolyPolygon( sal_uLong nPolyCount, const sal_uLong *pPoints, PCONSTSALPOINT *ppPtAry )
{
if( nPolyCount <= 0 )
return;
@@ -912,7 +903,7 @@ void AquaSalGraphics::drawPolyPolygon( ULONG nPolyCount, const ULONG *pPoints, P
// find bound rect
long leftX = 0, topY = 0, maxWidth = 0, maxHeight = 0;
getBoundRect( pPoints[0], ppPtAry[0], leftX, topY, maxWidth, maxHeight );
- for( ULONG n = 1; n < nPolyCount; n++ )
+ for( sal_uLong n = 1; n < nPolyCount; n++ )
{
long nX = leftX, nY = topY, nW = maxWidth, nH = maxHeight;
getBoundRect( pPoints[n], ppPtAry[n], nX, nY, nW, nH );
@@ -947,9 +938,9 @@ void AquaSalGraphics::drawPolyPolygon( ULONG nPolyCount, const ULONG *pPoints, P
CGContextBeginPath( mrContext );
if( IsPenVisible() )
{
- for( ULONG nPoly = 0; nPoly < nPolyCount; nPoly++ )
+ for( sal_uLong nPoly = 0; nPoly < nPolyCount; nPoly++ )
{
- const ULONG nPoints = pPoints[nPoly];
+ const sal_uLong nPoints = pPoints[nPoly];
if( nPoints > 1 )
{
const SalPoint *pPtAry = ppPtAry[nPoly];
@@ -957,7 +948,7 @@ void AquaSalGraphics::drawPolyPolygon( ULONG nPolyCount, const ULONG *pPoints, P
alignLinePoint( pPtAry, fX, fY );
CGContextMoveToPoint( mrContext, fX, fY );
pPtAry++;
- for( ULONG nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
+ for( sal_uLong nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
{
alignLinePoint( pPtAry, fX, fY );
CGContextAddLineToPoint( mrContext, fX, fY );
@@ -968,15 +959,15 @@ void AquaSalGraphics::drawPolyPolygon( ULONG nPolyCount, const ULONG *pPoints, P
}
else
{
- for( ULONG nPoly = 0; nPoly < nPolyCount; nPoly++ )
+ for( sal_uLong nPoly = 0; nPoly < nPolyCount; nPoly++ )
{
- const ULONG nPoints = pPoints[nPoly];
+ const sal_uLong nPoints = pPoints[nPoly];
if( nPoints > 1 )
{
const SalPoint *pPtAry = ppPtAry[nPoly];
CGContextMoveToPoint( mrContext, pPtAry->mnX, pPtAry->mnY );
pPtAry++;
- for( ULONG nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
+ for( sal_uLong nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
CGContextAddLineToPoint( mrContext, pPtAry->mnX, pPtAry->mnY );
CGContextClosePath(mrContext);
}
@@ -1101,22 +1092,22 @@ bool AquaSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon& rPolyLine,
// -----------------------------------------------------------------------
-sal_Bool AquaSalGraphics::drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
+sal_Bool AquaSalGraphics::drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry )
{
return sal_False;
}
// -----------------------------------------------------------------------
-sal_Bool AquaSalGraphics::drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
+sal_Bool AquaSalGraphics::drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry )
{
return sal_False;
}
// -----------------------------------------------------------------------
-sal_Bool AquaSalGraphics::drawPolyPolygonBezier( ULONG nPoly, const ULONG* pPoints,
- const SalPoint* const* pPtAry, const BYTE* const* pFlgAry )
+sal_Bool AquaSalGraphics::drawPolyPolygonBezier( sal_uLong nPoly, const sal_uLong* pPoints,
+ const SalPoint* const* pPtAry, const sal_uInt8* const* pFlgAry )
{
return sal_False;
}
@@ -1202,7 +1193,7 @@ void AquaSalGraphics::copyBits( const SalTwoRect *pPosAry, SalGraphics *pSrcGrap
// -----------------------------------------------------------------------
-void AquaSalGraphics::copyArea( long nDstX, long nDstY,long nSrcX, long nSrcY, long nSrcWidth, long nSrcHeight, USHORT nFlags )
+void AquaSalGraphics::copyArea( long nDstX, long nDstY,long nSrcX, long nSrcY, long nSrcWidth, long nSrcHeight, sal_uInt16 nFlags )
{
ApplyXorContext();
@@ -1429,7 +1420,7 @@ void AquaSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalIn
// -----------------------------------------------------------------------
-void AquaSalGraphics::invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nSalFlags )
+void AquaSalGraphics::invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nSalFlags )
{
CGPoint* CGpoints ;
if ( CheckContext() )
@@ -1466,8 +1457,8 @@ void AquaSalGraphics::invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert
// -----------------------------------------------------------------------
-BOOL AquaSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight,
- void* pEpsData, ULONG nByteCount )
+sal_Bool AquaSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight,
+ void* pEpsData, sal_uLong nByteCount )
{
// convert the raw data to an NSImageRef
NSData* xNSData = [NSData dataWithBytes:(void*)pEpsData length:(int)nByteCount];
@@ -1636,7 +1627,7 @@ void AquaSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackL
// -----------------------------------------------------------------------
-ULONG AquaSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
+sal_uLong AquaSalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs )
{
return 0;
}
@@ -1817,7 +1808,7 @@ static OSStatus GgoMoveToProc( const Float32Point* pPoint, void* pData )
return eStatus;
}
-BOOL AquaSalGraphics::GetGlyphOutline( long nGlyphId, basegfx::B2DPolyPolygon& rPolyPoly )
+sal_Bool AquaSalGraphics::GetGlyphOutline( long nGlyphId, basegfx::B2DPolyPolygon& rPolyPoly )
{
GgoData aGgoData;
aGgoData.mpPolyPoly = &rPolyPoly;
@@ -1859,7 +1850,7 @@ long AquaSalGraphics::GetGraphicsWidth() const
// -----------------------------------------------------------------------
-BOOL AquaSalGraphics::GetGlyphBoundRect( long nGlyphId, Rectangle& rRect )
+sal_Bool AquaSalGraphics::GetGlyphBoundRect( long nGlyphId, Rectangle& rRect )
{
ATSUStyle rATSUStyle = maATSUStyle; // TODO: handle glyph fallback
GlyphID aGlyphId = nGlyphId;
@@ -1892,7 +1883,7 @@ void AquaSalGraphics::DrawServerFontLayout( const ServerFontLayout& )
// -----------------------------------------------------------------------
-USHORT AquaSalGraphics::SetFont( ImplFontSelectData* pReqFont, int nFallbackLevel )
+sal_uInt16 AquaSalGraphics::SetFont( ImplFontSelectData* pReqFont, int nFallbackLevel )
{
if( !pReqFont )
{
@@ -2026,7 +2017,7 @@ USHORT AquaSalGraphics::SetFont( ImplFontSelectData* pReqFont, int nFallbackLeve
// -----------------------------------------------------------------------
-ImplFontCharMap* AquaSalGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* AquaSalGraphics::GetImplFontCharMap() const
{
if( !mpMacFontData )
return ImplFontCharMap::GetDefaultMap();
@@ -2217,10 +2208,10 @@ static bool GetRawFontData( const ImplFontData* pFontData,
DBG_ASSERT( (nOfs==nTotalLen), "AquaSalGraphics::CreateFontSubset (nOfs!=nTotalLen)");
- return true;
+ return sal_True;
}
-BOOL AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
+sal_Bool AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData* pFontData, long* pGlyphIDs, sal_uInt8* pEncoding,
sal_Int32* pGlyphWidths, int nGlyphCount, FontSubsetInfo& rInfo )
{
@@ -2229,7 +2220,7 @@ BOOL AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
// prepare the requested file name for writing the font-subset file
rtl::OUString aSysPath;
if( osl_File_E_None != osl_getSystemPathFromFileURL( rToFile.pData, &aSysPath.pData ) )
- return FALSE;
+ return sal_False;
const rtl_TextEncoding aThreadEncoding = osl_getThreadTextEncoding();
const ByteString aToFile( rtl::OUStringToOString( aSysPath, aThreadEncoding ) );
@@ -2290,7 +2281,7 @@ BOOL AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
// subset glyphs and get their properties
// take care that subset fonts require the NotDef glyph in pos 0
int nOrigCount = nGlyphCount;
- USHORT aShortIDs[ 256 ];
+ sal_uInt16 aShortIDs[ 256 ];
sal_uInt8 aTempEncs[ 256 ];
int nNotDef = -1;
@@ -2310,7 +2301,7 @@ BOOL AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
nGlyphIdx = ::MapChar( pSftFont, static_cast<sal_uInt16>(nGlyphIdx), bVertical );
}
}
- aShortIDs[i] = static_cast<USHORT>( nGlyphIdx );
+ aShortIDs[i] = static_cast<sal_uInt16>( nGlyphIdx );
if( !nGlyphIdx )
if( nNotDef < 0 )
nNotDef = i; // first NotDef glyph found
@@ -2338,7 +2329,7 @@ BOOL AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
TTSimpleGlyphMetrics* pGlyphMetrics =
::GetTTSimpleGlyphMetrics( pSftFont, aShortIDs, nGlyphCount, bVertical );
if( !pGlyphMetrics )
- return FALSE;
+ return sal_False;
sal_uInt16 nNotDefAdv = pGlyphMetrics[0].adv;
pGlyphMetrics[0].adv = pGlyphMetrics[nNotDef].adv;
pGlyphMetrics[nNotDef].adv = nNotDefAdv;
@@ -2396,8 +2387,10 @@ void AquaSalGraphics::GetGlyphWidths( const ImplFontData* pFontData, bool bVerti
const ImplFontCharMap* pMap = mpMacFontData->GetImplFontCharMap();
DBG_ASSERT( pMap && pMap->GetCharCount(), "no charmap" );
+ pMap->AddReference(); // TODO: add and use RAII object instead
// get unicode<->glyph encoding
+ // TODO? avoid sft mapping by using the pMap itself
int nCharCount = pMap->GetCharCount();
sal_uInt32 nChar = pMap->GetFirstChar();
for(; --nCharCount >= 0; nChar = pMap->GetNextChar( nChar ) )
@@ -2409,6 +2402,8 @@ void AquaSalGraphics::GetGlyphWidths( const ImplFontData* pFontData, bool bVerti
if( nGlyph > 0 )
rUnicodeEnc[ nUcsChar ] = nGlyph;
}
+
+ pMap->DeReference(); // TODO: add and use RAII object instead
}
::CloseTTFont( pSftFont );
@@ -2625,24 +2620,24 @@ void XorEmulation::SetTarget( int nWidth, int nHeight, int nTargetDepth,
nBytesPerRow = 1;
}
nBytesPerRow *= nWidth;
- mnBufferLongs = (nHeight * nBytesPerRow + sizeof(ULONG)-1) / sizeof(ULONG);
+ mnBufferLongs = (nHeight * nBytesPerRow + sizeof(sal_uLong)-1) / sizeof(sal_uLong);
// create a XorMask context
- mpMaskBuffer = new ULONG[ mnBufferLongs ];
+ mpMaskBuffer = new sal_uLong[ mnBufferLongs ];
mxMaskContext = ::CGBitmapContextCreate( mpMaskBuffer,
nWidth, nHeight, nBitsPerComponent, nBytesPerRow,
aCGColorSpace, aCGBmpInfo );
// reset the XOR mask to black
- memset( mpMaskBuffer, 0, mnBufferLongs * sizeof(ULONG) );
+ memset( mpMaskBuffer, 0, mnBufferLongs * sizeof(sal_uLong) );
// a bitmap context will be needed for manual XORing
// create one unless the target context is a bitmap context
if( nTargetDepth )
- mpTempBuffer = (ULONG*)CGBitmapContextGetData( mxTargetContext );
+ mpTempBuffer = (sal_uLong*)CGBitmapContextGetData( mxTargetContext );
if( !mpTempBuffer )
{
// create a bitmap context matching to the target context
- mpTempBuffer = new ULONG[ mnBufferLongs ];
+ mpTempBuffer = new sal_uLong[ mnBufferLongs ];
mxTempContext = ::CGBitmapContextCreate( mpTempBuffer,
nWidth, nHeight, nBitsPerComponent, nBytesPerRow,
aCGColorSpace, aCGBmpInfo );
@@ -2682,8 +2677,8 @@ bool XorEmulation::UpdateTarget()
// do a manual XOR with the XorMask
// this approach suffices for simple color manipulations
// and also the complex-clipping-XOR-trick used in metafiles
- const ULONG* pSrc = mpMaskBuffer;
- ULONG* pDst = mpTempBuffer;
+ const sal_uLong* pSrc = mpMaskBuffer;
+ sal_uLong* pDst = mpTempBuffer;
for( int i = mnBufferLongs; --i >= 0;)
*(pDst++) ^= *(pSrc++);
@@ -2701,7 +2696,7 @@ bool XorEmulation::UpdateTarget()
// reset the XorMask to black again
// TODO: not needed for last update
- memset( mpMaskBuffer, 0, mnBufferLongs * sizeof(ULONG) );
+ memset( mpMaskBuffer, 0, mnBufferLongs * sizeof(sal_uLong) );
// TODO: return FALSE if target was not changed
return true;
diff --git a/vcl/aqua/source/gdi/salgdiutils.cxx b/vcl/aqua/source/gdi/salgdiutils.cxx
index 56d40d3c7e72..22316a50da8d 100644
--- a/vcl/aqua/source/gdi/salgdiutils.cxx
+++ b/vcl/aqua/source/gdi/salgdiutils.cxx
@@ -254,12 +254,12 @@ void AquaSalGraphics::RefreshRect(float lX, float lY, float lWidth, float lHeigh
}
}
-CGPoint* AquaSalGraphics::makeCGptArray(ULONG nPoints, const SalPoint* pPtAry)
+CGPoint* AquaSalGraphics::makeCGptArray(sal_uLong nPoints, const SalPoint* pPtAry)
{
CGPoint *CGpoints = new (CGPoint[nPoints]);
if ( CGpoints )
{
- for(ULONG i=0;i<nPoints;i++)
+ for(sal_uLong i=0;i<nPoints;i++)
{
CGpoints[i].x = (float)(pPtAry[i].mnX);
CGpoints[i].y = (float)(pPtAry[i].mnY);
diff --git a/vcl/aqua/source/gdi/salnativewidgets.cxx b/vcl/aqua/source/gdi/salnativewidgets.cxx
index 4e40bfa7077d..1ad5f5d3919c 100644
--- a/vcl/aqua/source/gdi/salnativewidgets.cxx
+++ b/vcl/aqua/source/gdi/salnativewidgets.cxx
@@ -237,13 +237,13 @@ static bool AquaGetScrollRect( /* TODO: int nScreen, */ ControlPart nPart,
/*
* IsNativeControlSupported()
* --------------------------
- * Returns TRUE if the platform supports native
+ * Returns sal_True if the platform supports native
* drawing of the control defined by nPart.
*
*/
-BOOL AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
+sal_Bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
{
- bool bOk = FALSE;
+ bool bOk = sal_False;
// Native controls are now defaults
// If you want to disable experimental native controls code,
@@ -372,18 +372,18 @@ BOOL AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n
/*
* HitTestNativeControl()
*
- * If the return value is TRUE, bIsInside contains information whether
+ * If the return value is sal_True, bIsInside contains information whether
* aPos was or was not inside the native widget specified by the
* nType/nPart combination.
*/
-BOOL AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
- const Point& rPos, BOOL& rIsInside )
+sal_Bool AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ const Point& rPos, sal_Bool& rIsInside )
{
if ( nType == CTRL_SCROLLBAR )
{
Rectangle aRect;
bool bValid = AquaGetScrollRect( /* TODO: m_nScreen */ nPart, rControlRegion, aRect );
- rIsInside = bValid ? aRect.IsInside( rPos ) : FALSE;
+ rIsInside = bValid ? aRect.IsInside( rPos ) : sal_False;
if( GetSalData()->mbIsScrollbarDoubleMax )
{
// in double max mode the actual trough is a little smaller than the track
@@ -394,20 +394,20 @@ BOOL AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart
{
// the left 4 pixels are not hit sensitive
if( rPos.X() - aRect.Left() < 4 )
- rIsInside = FALSE;
+ rIsInside = sal_False;
}
else if( nPart == PART_TRACK_VERT_AREA )
{
// the top 4 pixels are not hit sensitive
if( rPos.Y() - aRect.Top() < 4 )
- rIsInside = FALSE;
+ rIsInside = sal_False;
}
}
}
return bValid;
} // CTRL_SCROLLBAR
- return FALSE;
+ return sal_False;
}
/*
@@ -467,14 +467,14 @@ UInt32 AquaSalGraphics::getTrackState( ControlState nState )
* aValue: An optional value (tristate/numerical/string)
* aCaption: A caption or title string (like button text etc)
*/
-BOOL AquaSalGraphics::drawNativeControl(ControlType nType,
+sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
const rtl::OUString& aCaption )
{
- BOOL bOK = FALSE;
+ sal_Bool bOK = sal_False;
if( ! CheckContext() )
return false;
@@ -1148,7 +1148,7 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType,
case CTRL_FRAME:
{
- USHORT nStyle = aValue.getNumericVal();
+ sal_uInt16 nStyle = aValue.getNumericVal();
if( nPart == PART_BORDER ) {
if(!( nStyle & FRAME_DRAW_MENU ) && !(nStyle & FRAME_DRAW_WINDOWBORDER) )
{
@@ -1225,18 +1225,18 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType,
* aValue: An optional value (tristate/numerical/string)
* aCaption: A caption or title string (like button text etc)
*/
-BOOL AquaSalGraphics::drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+sal_Bool AquaSalGraphics::drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption )
{
- return( FALSE );
+ return( sal_False );
}
/*
* GetNativeControlRegion()
*
- * If the return value is TRUE, rNativeBoundingRegion
+ * If the return value is sal_True, rNativeBoundingRegion
* contains the true bounding region covered by the control
* including any adornment, while rNativeContentRegion contains the area
* within the control that can be safely drawn into without drawing over
@@ -1246,12 +1246,12 @@ BOOL AquaSalGraphics::drawNativeControlText( ControlType nType, ControlPart nPar
* aValue: An optional value (tristate/numerical/string)
* aCaption: A caption or title string (like button text etc)
*/
-BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
+sal_Bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const rtl::OUString& aCaption,
Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion )
{
- BOOL toReturn = FALSE;
+ sal_Bool toReturn = sal_False;
Rectangle aCtrlBoundRect( rControlRegion );
short x = aCtrlBoundRect.Left();
@@ -1286,7 +1286,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
Rectangle aRect;
if( AquaGetScrollRect( /* m_nScreen */ nPart, aCtrlBoundRect, aRect ) )
{
- toReturn = TRUE;
+ toReturn = sal_True;
rNativeBoundingRegion = aRect;
rNativeContentRegion = aRect;
}
@@ -1316,7 +1316,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h + nBorderCleanup) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) );
- toReturn = TRUE;
+ toReturn = sal_True;
}
break;
case CTRL_PROGRESS:
@@ -1328,7 +1328,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
aRect.Bottom() = aRect.Top() + 15; // values taken from HIG for large progress
rNativeBoundingRegion = aRect;
rNativeContentRegion = aRect;
- toReturn = TRUE;
+ toReturn = sal_True;
}
break;
@@ -1338,7 +1338,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
aRect.Bottom() = aRect.Top() + INTRO_PROGRESS_HEIGHT; // values taken from HIG for medium progress
rNativeBoundingRegion = aRect;
rNativeContentRegion = aRect;
- toReturn = TRUE;
+ toReturn = sal_True;
}
break;
@@ -1354,7 +1354,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) );
- toReturn = TRUE;
+ toReturn = sal_True;
break;
@@ -1370,7 +1370,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
rNativeContentRegion = Rectangle( Point( x+FOCUS_RING_WIDTH, y+FOCUS_RING_WIDTH ), Size( w-2*(FOCUS_RING_WIDTH+1), h-2*(FOCUS_RING_WIDTH+1) ) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) );
- toReturn = TRUE;
+ toReturn = sal_True;
}
break;
case CTRL_LISTBOX:
@@ -1384,7 +1384,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
rNativeContentRegion = Rectangle( Point( x+FOCUS_RING_WIDTH, y+FOCUS_RING_WIDTH ), Size( w-2*FOCUS_RING_WIDTH, h ) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h+2*FOCUS_RING_WIDTH ) );
- toReturn = TRUE;
+ toReturn = sal_True;
}
else if( nPart == PART_BUTTON_DOWN )
{
@@ -1433,7 +1433,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
rNativeContentRegion = Rectangle( Point( x+FOCUS_RING_WIDTH, y ), Size( w-2*FOCUS_RING_WIDTH, h ) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h+2*FOCUS_RING_WIDTH ) );
- toReturn = TRUE;
+ toReturn = sal_True;
}
else if( nPart == PART_SUB_EDIT ) {
w = aCtrlBoundRect.GetWidth() - SPIN_BUTTON_SPACE - SPIN_BUTTON_WIDTH;
@@ -1446,7 +1446,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
rNativeContentRegion = Rectangle( Point( x + FOCUS_RING_WIDTH, y + FOCUS_RING_WIDTH ), Size( w - 2* FOCUS_RING_WIDTH, h ) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h+2*FOCUS_RING_WIDTH ) );
- toReturn = TRUE;
+ toReturn = sal_True;
}
else if( nPart == PART_BUTTON_UP ) {
//aCtrlBoundRect.GetWidth() contains the width of the full control
@@ -1460,7 +1460,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) );
- toReturn = TRUE;
+ toReturn = sal_True;
}
else if( nPart == PART_BUTTON_DOWN ) {
x += aCtrlBoundRect.GetWidth() - SPIN_BUTTON_WIDTH - SPIN_BUTTON_SPACE - CLIP_FUZZ;
@@ -1471,12 +1471,12 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) );
- toReturn = TRUE;
+ toReturn = sal_True;
}
break;
case CTRL_FRAME:
{
- USHORT nStyle = aValue.getNumericVal();
+ sal_uInt16 nStyle = aValue.getNumericVal();
if( ( nPart == PART_BORDER ) &&
!( nStyle & (FRAME_DRAW_MENU | FRAME_DRAW_WINDOWBORDER | FRAME_DRAW_BORDERWINDOWBORDER) ) )
{
@@ -1499,7 +1499,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
rNativeContentRegion = aRect;
rNativeBoundingRegion = aRect;
- toReturn = TRUE;
+ toReturn = sal_True;
}
}
break;
@@ -1515,7 +1515,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) );
- toReturn = TRUE;
+ toReturn = sal_True;
}
}
break;
diff --git a/vcl/aqua/source/gdi/salprn.cxx b/vcl/aqua/source/gdi/salprn.cxx
index 3d6eba93a59b..3e25d9eb111d 100644
--- a/vcl/aqua/source/gdi/salprn.cxx
+++ b/vcl/aqua/source/gdi/salprn.cxx
@@ -174,9 +174,9 @@ void AquaSalInfoPrinter::ReleaseGraphics( SalGraphics* )
// -----------------------------------------------------------------------
-BOOL AquaSalInfoPrinter::Setup( SalFrame* i_pFrame, ImplJobSetup* i_pSetupData )
+sal_Bool AquaSalInfoPrinter::Setup( SalFrame* i_pFrame, ImplJobSetup* i_pSetupData )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -249,14 +249,14 @@ static Paper recognizePaper( double i_fWidth, double i_fHeight )
return aPaper;
}
-BOOL AquaSalInfoPrinter::SetPrinterData( ImplJobSetup* io_pSetupData )
+sal_Bool AquaSalInfoPrinter::SetPrinterData( ImplJobSetup* io_pSetupData )
{
// FIXME: implement driver data
if( io_pSetupData && io_pSetupData->mpDriverData )
return SetData( ~0, io_pSetupData );
- BOOL bSuccess = TRUE;
+ sal_Bool bSuccess = sal_True;
// set system type
io_pSetupData->mnSystem = JOBSETUP_SYSTEM_MAC;
@@ -283,11 +283,11 @@ BOOL AquaSalInfoPrinter::SetPrinterData( ImplJobSetup* io_pSetupData )
io_pSetupData->meOrientation = mePageOrientation;
io_pSetupData->mnPaperBin = 0;
- io_pSetupData->mpDriverData = reinterpret_cast<BYTE*>(rtl_allocateMemory( 4 ));
+ io_pSetupData->mpDriverData = reinterpret_cast<sal_uInt8*>(rtl_allocateMemory( 4 ));
io_pSetupData->mnDriverDataLen = 4;
}
else
- bSuccess = FALSE;
+ bSuccess = sal_False;
return bSuccess;
@@ -317,10 +317,10 @@ void AquaSalInfoPrinter::setPaperSize( long i_nWidth, long i_nHeight, Orientatio
// -----------------------------------------------------------------------
-BOOL AquaSalInfoPrinter::SetData( ULONG i_nFlags, ImplJobSetup* io_pSetupData )
+sal_Bool AquaSalInfoPrinter::SetData( sal_uLong i_nFlags, ImplJobSetup* io_pSetupData )
{
if( ! io_pSetupData || io_pSetupData->mnSystem != JOBSETUP_SYSTEM_MAC )
- return FALSE;
+ return sal_False;
if( mpPrintInfo )
@@ -358,14 +358,14 @@ BOOL AquaSalInfoPrinter::SetData( ULONG i_nFlags, ImplJobSetup* io_pSetupData )
// -----------------------------------------------------------------------
-ULONG AquaSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* i_pSetupData )
+sal_uLong AquaSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* i_pSetupData )
{
return 0;
}
// -----------------------------------------------------------------------
-XubString AquaSalInfoPrinter::GetPaperBinName( const ImplJobSetup* i_pSetupData, ULONG i_nPaperBin )
+XubString AquaSalInfoPrinter::GetPaperBinName( const ImplJobSetup* i_pSetupData, sal_uLong i_nPaperBin )
{
return XubString();
}
@@ -378,14 +378,14 @@ static bool getUseNativeDialog()
try
{
// get service provider
- Reference< XMultiServiceFactory > xSMgr( unohelper::GetMultiServiceFactory() );
+ uno::Reference< XMultiServiceFactory > xSMgr( unohelper::GetMultiServiceFactory() );
// create configuration hierachical access name
if( xSMgr.is() )
{
try
{
- Reference< XMultiServiceFactory > xConfigProvider(
- Reference< XMultiServiceFactory >(
+ uno::Reference< XMultiServiceFactory > xConfigProvider(
+ uno::Reference< XMultiServiceFactory >(
xSMgr->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.configuration.ConfigurationProvider" ))),
UNO_QUERY )
@@ -397,8 +397,8 @@ static bool getUseNativeDialog()
aVal.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) );
aVal.Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common/Misc" ) );
aArgs.getArray()[0] <<= aVal;
- Reference< XNameAccess > xConfigAccess(
- Reference< XNameAccess >(
+ uno::Reference< XNameAccess > xConfigAccess(
+ uno::Reference< XNameAccess >(
xConfigProvider->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.configuration.ConfigurationAccess" )),
aArgs ),
@@ -434,7 +434,7 @@ static bool getUseNativeDialog()
return bNative;
}
-ULONG AquaSalInfoPrinter::GetCapabilities( const ImplJobSetup* i_pSetupData, USHORT i_nType )
+sal_uLong AquaSalInfoPrinter::GetCapabilities( const ImplJobSetup* i_pSetupData, sal_uInt16 i_nType )
{
switch( i_nType )
{
@@ -458,6 +458,8 @@ ULONG AquaSalInfoPrinter::GetCapabilities( const ImplJobSetup* i_pSetupData, USH
return getUseNativeDialog() ? 1 : 0;
case PRINTER_CAPABILITIES_PDF:
return 1;
+ case PRINTER_CAPABILITIES_USEPULLMODEL:
+ return 1;
default: break;
};
return 0;
@@ -514,7 +516,7 @@ static Size getPageSize( vcl::PrinterController& i_rController, sal_Int32 i_nPag
return aPageSize;
}
-BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName,
+sal_Bool AquaSalInfoPrinter::StartJob( const String* i_pFileName,
const String& i_rJobName,
const String& i_rAppName,
ImplJobSetup* i_pSetupData,
@@ -522,9 +524,9 @@ BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName,
)
{
if( mbJob )
- return FALSE;
+ return sal_False;
- BOOL bSuccess = FALSE;
+ sal_Bool bSuccess = sal_False;
bool bWasAborted = false;
AquaSalInstance* pInst = GetSalData()->mpFirstInstance;
PrintAccessoryViewState aAccViewState;
@@ -659,7 +661,7 @@ BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName,
if( bShowPanel && mnCurPageRangeStart == 0 && nCurJob == 0) // only the first range of pages (in the first job) gets the accesory view
pReleaseAfterUse = [AquaPrintAccessoryView setupPrinterPanel: pPrintOperation withController: &i_rController withState: &aAccViewState];
- bSuccess = TRUE;
+ bSuccess = sal_True;
mbJob = true;
pInst->startedPrintJob();
[pPrintOperation runOperation];
@@ -677,7 +679,7 @@ BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName,
// inform application that it can release its data
// this is awkward, but the XRenderable interface has no method for this,
- // so we need to call XRenderadble::render one last time with IsLastPage = TRUE
+ // so we need to call XRenderadble::render one last time with IsLastPage = sal_True
i_rController.setLastPage( sal_True );
GDIMetaFile aPageFile;
if( mrContext )
@@ -695,26 +697,26 @@ BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName,
// -----------------------------------------------------------------------
-BOOL AquaSalInfoPrinter::EndJob()
+sal_Bool AquaSalInfoPrinter::EndJob()
{
mnStartPageOffsetX = mnStartPageOffsetY = 0;
mbJob = false;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL AquaSalInfoPrinter::AbortJob()
+sal_Bool AquaSalInfoPrinter::AbortJob()
{
mbJob = false;
// FIXME: implementation
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-SalGraphics* AquaSalInfoPrinter::StartPage( ImplJobSetup* i_pSetupData, BOOL i_bNewJobData )
+SalGraphics* AquaSalInfoPrinter::StartPage( ImplJobSetup* i_pSetupData, sal_Bool i_bNewJobData )
{
if( i_bNewJobData && i_pSetupData )
SetPrinterData( i_pSetupData );
@@ -728,15 +730,15 @@ SalGraphics* AquaSalInfoPrinter::StartPage( ImplJobSetup* i_pSetupData, BOOL i_b
// -----------------------------------------------------------------------
-BOOL AquaSalInfoPrinter::EndPage()
+sal_Bool AquaSalInfoPrinter::EndPage()
{
mpGraphics->InvalidateContext();
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-ULONG AquaSalInfoPrinter::GetErrorCode() const
+sal_uLong AquaSalInfoPrinter::GetErrorCode() const
{
return 0;
}
@@ -756,7 +758,7 @@ AquaSalPrinter::~AquaSalPrinter()
// -----------------------------------------------------------------------
-BOOL AquaSalPrinter::StartJob( const String* i_pFileName,
+sal_Bool AquaSalPrinter::StartJob( const String* i_pFileName,
const String& i_rJobName,
const String& i_rAppName,
ImplJobSetup* i_pSetupData,
@@ -767,49 +769,49 @@ BOOL AquaSalPrinter::StartJob( const String* i_pFileName,
// -----------------------------------------------------------------------
-BOOL AquaSalPrinter::StartJob( const XubString* i_pFileName,
+sal_Bool AquaSalPrinter::StartJob( const XubString* i_pFileName,
const XubString& i_rJobName,
const XubString& i_rAppName,
- ULONG i_nCopies,
+ sal_uLong i_nCopies,
bool i_bCollate,
bool i_bDirect,
ImplJobSetup* i_pSetupData )
{
OSL_FAIL( "should never be called" );
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL AquaSalPrinter::EndJob()
+sal_Bool AquaSalPrinter::EndJob()
{
return mpInfoPrinter->EndJob();
}
// -----------------------------------------------------------------------
-BOOL AquaSalPrinter::AbortJob()
+sal_Bool AquaSalPrinter::AbortJob()
{
return mpInfoPrinter->AbortJob();
}
// -----------------------------------------------------------------------
-SalGraphics* AquaSalPrinter::StartPage( ImplJobSetup* i_pSetupData, BOOL i_bNewJobData )
+SalGraphics* AquaSalPrinter::StartPage( ImplJobSetup* i_pSetupData, sal_Bool i_bNewJobData )
{
return mpInfoPrinter->StartPage( i_pSetupData, i_bNewJobData );
}
// -----------------------------------------------------------------------
-BOOL AquaSalPrinter::EndPage()
+sal_Bool AquaSalPrinter::EndPage()
{
return mpInfoPrinter->EndPage();
}
// -----------------------------------------------------------------------
-ULONG AquaSalPrinter::GetErrorCode()
+sal_uLong AquaSalPrinter::GetErrorCode()
{
return mpInfoPrinter->GetErrorCode();
}
diff --git a/vcl/aqua/source/gdi/salvd.cxx b/vcl/aqua/source/gdi/salvd.cxx
index de09867e4071..2aa8357b28f6 100644
--- a/vcl/aqua/source/gdi/salvd.cxx
+++ b/vcl/aqua/source/gdi/salvd.cxx
@@ -34,13 +34,14 @@
#include "salgdi.h"
#include "saldata.hxx"
#include "salframe.h"
+#include <vcl/svapp.hxx>
#include "vcl/sysdata.hxx"
// -----------------------------------------------------------------------
SalVirtualDevice* AquaSalInstance::CreateVirtualDevice( SalGraphics* pGraphics,
- long nDX, long nDY, USHORT nBitCount, const SystemGraphicsData *pData )
+ long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData )
{
// #i92075# can be called first in a thread
SalData::ensureThreadAutoreleasePool();
@@ -57,7 +58,7 @@ void AquaSalInstance::DestroyVirtualDevice( SalVirtualDevice* pDevice )
// =======================================================================
-AquaSalVirtualDevice::AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long nDX, long nDY, USHORT nBitCount, const SystemGraphicsData *pData )
+AquaSalVirtualDevice::AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData )
: mbGraphicsUsed( false )
, mxBitmapContext( NULL )
, mnBitmapDepth( 0 )
@@ -156,7 +157,7 @@ void AquaSalVirtualDevice::ReleaseGraphics( SalGraphics *pGraphics )
// -----------------------------------------------------------------------
-BOOL AquaSalVirtualDevice::SetSize( long nDX, long nDY )
+sal_Bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
{
if( mbForeignContext )
{
@@ -198,9 +199,27 @@ BOOL AquaSalVirtualDevice::SetSize( long nDX, long nDY )
pSalFrame = *GetSalData()->maFrames.begin();
if( pSalFrame )
{
- NSGraphicsContext* pNSContext = [NSGraphicsContext graphicsContextWithWindow: pSalFrame->getWindow()];
- if( pNSContext )
- xCGContext = reinterpret_cast<CGContextRef>([pNSContext graphicsPort]);
+ // #i91990#
+ NSWindow* pWindow = pSalFrame->getWindow();
+ if ( pWindow )
+ {
+ NSGraphicsContext* pNSContext = [NSGraphicsContext graphicsContextWithWindow: pWindow];
+ if( pNSContext )
+ xCGContext = reinterpret_cast<CGContextRef>([pNSContext graphicsPort]);
+ }
+ else
+ {
+ // fall back to a bitmap context
+ mnBitmapDepth = 32;
+ const CGColorSpaceRef aCGColorSpace = GetSalData()->mxRGBSpace;
+ const CGBitmapInfo aCGBmpInfo = kCGImageAlphaNoneSkipFirst;
+ const int nBytesPerRow = (mnBitmapDepth * nDX) / 8;
+
+ void* pRawData = rtl_allocateMemory( nBytesPerRow * nDY );
+ mxBitmapContext = ::CGBitmapContextCreate( pRawData, nDX, nDY,
+ 8, nBytesPerRow, aCGColorSpace, aCGBmpInfo );
+ xCGContext = mxBitmapContext;
+ }
}
}
diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx
index ca99a2ca6a2d..9c136fba262e 100644
--- a/vcl/aqua/source/window/salframe.cxx
+++ b/vcl/aqua/source/window/salframe.cxx
@@ -62,7 +62,7 @@ AquaSalFrame* AquaSalFrame::s_pCaptureFrame = NULL;
// =======================================================================
-AquaSalFrame::AquaSalFrame( SalFrame* pParent, ULONG salFrameStyle ) :
+AquaSalFrame::AquaSalFrame( SalFrame* pParent, sal_uLong salFrameStyle ) :
mpWindow(nil),
mpView(nil),
mpDockMenuEntry(nil),
@@ -192,8 +192,17 @@ void AquaSalFrame::initWindowAndView()
mnStyleMask |= NSTitledWindowMask;
}
+ // #i91990# support GUI-less (daemon) execution
+ @try
+ {
mpWindow = [[SalFrameWindow alloc] initWithSalFrame: this];
mpView = [[SalFrameView alloc] initWithSalFrame: this];
+ }
+ @catch ( id exception )
+ {
+ return;
+ }
+
if( (mnStyle & SAL_FRAME_STYLE_TOOLTIP) )
[mpWindow setIgnoresMouseEvents: YES];
else
@@ -208,8 +217,6 @@ void AquaSalFrame::initWindowAndView()
UpdateFrameGeometry();
- // setContentView causes a display; in multithreaded use this can deadlock
- //YieldMutexReleaser aRel;
[mpWindow setContentView: mpView];
}
@@ -285,7 +292,7 @@ void AquaSalFrame::ReleaseGraphics( SalGraphics *pGraphics )
// -----------------------------------------------------------------------
-BOOL AquaSalFrame::PostEvent( void *pData )
+sal_Bool AquaSalFrame::PostEvent( void *pData )
{
GetSalData()->mpFirstInstance->PostUserEvent( this, SALEVENT_USEREVENT, pData );
return TRUE;
@@ -294,11 +301,17 @@ BOOL AquaSalFrame::PostEvent( void *pData )
// -----------------------------------------------------------------------
void AquaSalFrame::SetTitle(const XubString& rTitle)
{
+ if ( !mpWindow )
+ return;
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
NSString* pTitle = CreateNSString( rTitle );
[mpWindow setTitle: pTitle];
// create an entry in the dock menu
- const ULONG nAppWindowStyle = (SAL_FRAME_STYLE_CLOSEABLE | SAL_FRAME_STYLE_MOVEABLE);
+ const sal_uLong nAppWindowStyle = (SAL_FRAME_STYLE_CLOSEABLE | SAL_FRAME_STYLE_MOVEABLE);
if( mpParent == NULL &&
(mnStyle & nAppWindowStyle) == nAppWindowStyle )
{
@@ -324,7 +337,7 @@ void AquaSalFrame::SetTitle(const XubString& rTitle)
// -----------------------------------------------------------------------
-void AquaSalFrame::SetIcon( USHORT )
+void AquaSalFrame::SetIcon( sal_uInt16 )
{
}
@@ -332,6 +345,9 @@ void AquaSalFrame::SetIcon( USHORT )
void AquaSalFrame::SetRepresentedURL( const rtl::OUString& i_rDocURL )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( i_rDocURL.indexOfAsciiL( "file:", 5 ) == 0 )
{
rtl::OUString aSysPath;
@@ -357,12 +373,12 @@ void AquaSalFrame::initShow()
if( mpParent ) // center relative to parent
{
// center on parent
- long nNewX = mpParent->maGeometry.nX + (mpParent->maGeometry.nWidth - maGeometry.nWidth)/2;
+ long nNewX = mpParent->maGeometry.nX + ((long)mpParent->maGeometry.nWidth - (long)maGeometry.nWidth)/2;
if( nNewX < aScreenRect.Left() )
nNewX = aScreenRect.Left();
if( long(nNewX + maGeometry.nWidth) > aScreenRect.Right() )
nNewX = aScreenRect.Right() - maGeometry.nWidth-1;
- long nNewY = mpParent->maGeometry.nY + (mpParent->maGeometry.nHeight - maGeometry.nHeight)/2;
+ long nNewY = mpParent->maGeometry.nY + ((long)mpParent->maGeometry.nHeight - (long)maGeometry.nHeight)/2;
if( nNewY < aScreenRect.Top() )
nNewY = aScreenRect.Top();
if( nNewY > aScreenRect.Bottom() )
@@ -400,8 +416,14 @@ void AquaSalFrame::SendPaintEvent( const Rectangle* pRect )
// -----------------------------------------------------------------------
-void AquaSalFrame::Show(BOOL bVisible, BOOL bNoActivate)
+void AquaSalFrame::Show(sal_Bool bVisible, sal_Bool bNoActivate)
{
+ if ( !mpWindow )
+ return;
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
mbShown = bVisible;
if(bVisible)
{
@@ -412,8 +434,6 @@ void AquaSalFrame::Show(BOOL bVisible, BOOL bNoActivate)
// trigger filling our backbuffer
SendPaintEvent();
- //YieldMutexReleaser aRel;
-
if( bNoActivate || [mpWindow canBecomeKeyWindow] == NO )
[mpWindow orderFront: NSApp];
else
@@ -444,8 +464,6 @@ void AquaSalFrame::Show(BOOL bVisible, BOOL bNoActivate)
if( mpMenu && mpMenu->mbMenuBar && AquaSalMenu::pCurrentMenuBar == mpMenu )
AquaSalMenu::setDefaultMenu();
- //YieldMutexReleaser aRel;
-
// #i90440# #i94443# work around the focus going back to some other window
// if a child gets hidden for a parent window
if( mpParent && mpParent->mbShown && [mpWindow isKeyWindow] )
@@ -461,7 +479,7 @@ void AquaSalFrame::Show(BOOL bVisible, BOOL bNoActivate)
// -----------------------------------------------------------------------
-void AquaSalFrame::Enable( BOOL bEnable )
+void AquaSalFrame::Enable( sal_Bool bEnable )
{
}
@@ -469,6 +487,9 @@ void AquaSalFrame::Enable( BOOL bEnable )
void AquaSalFrame::SetMinClientSize( long nWidth, long nHeight )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
mnMinWidth = nWidth;
mnMinHeight = nHeight;
@@ -491,6 +512,9 @@ void AquaSalFrame::SetMinClientSize( long nWidth, long nHeight )
void AquaSalFrame::SetMaxClientSize( long nWidth, long nHeight )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
mnMaxWidth = nWidth;
mnMaxHeight = nHeight;
@@ -517,6 +541,9 @@ void AquaSalFrame::SetMaxClientSize( long nWidth, long nHeight )
void AquaSalFrame::SetClientSize( long nWidth, long nHeight )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( mpWindow )
{
NSSize aSize = { nWidth, nHeight };
@@ -549,6 +576,11 @@ void AquaSalFrame::GetClientSize( long& rWidth, long& rHeight )
void AquaSalFrame::SetWindowState( const SalFrameState* pState )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
+ if ( mpWindow )
+ {
// set normal state
NSRect aStateRect = [mpWindow frame];
aStateRect = [NSWindow contentRectForFrameRect: aStateRect styleMask: mnStyleMask];
@@ -564,18 +596,33 @@ void AquaSalFrame::SetWindowState( const SalFrameState* pState )
VCLToCocoa( aStateRect );
aStateRect = [NSWindow frameRectForContentRect: aStateRect styleMask: mnStyleMask];
- // relase and acquire mutex again since this call can block waiting for an internal lock
+ [mpWindow setFrame: aStateRect display: NO];
+ if( pState->mnState == SAL_FRAMESTATE_MINIMIZED )
+ [mpWindow miniaturize: NSApp];
+ else if( [mpWindow isMiniaturized] )
+ [mpWindow deminiaturize: NSApp];
+
+
+ /* ZOOMED is not really maximized (actually it toggles between a user set size and
+ the program specified one), but comes closest since the default behavior is
+ "maximized" if the user did not intervene
+ */
+ if( pState->mnState == SAL_FRAMESTATE_MAXIMIZED )
{
- //YieldMutexReleaser aRel;
- [mpWindow setFrame: aStateRect display: NO];
+ if(! [mpWindow isZoomed])
+ [mpWindow zoom: NSApp];
+ }
+ else
+ {
+ if( [mpWindow isZoomed] )
+ [mpWindow zoom: NSApp];
+ }
}
-
- // FIXME: HTH maximized state ?
// get new geometry
UpdateFrameGeometry();
- USHORT nEvent = 0;
+ sal_uInt16 nEvent = 0;
if( pState->mnMask & (SAL_FRAMESTATE_MASK_X | SAL_FRAMESTATE_MASK_X) )
{
mbPositioned = true;
@@ -591,22 +638,26 @@ void AquaSalFrame::SetWindowState( const SalFrameState* pState )
if( nEvent )
CallCallback( nEvent, NULL );
- if( mbShown )
+ if( mbShown && mpWindow )
{
// trigger filling our backbuffer
SendPaintEvent();
// tell the system the views need to be updated
- //YieldMutexReleaser aRel;
-
[mpWindow display];
}
}
// -----------------------------------------------------------------------
-BOOL AquaSalFrame::GetWindowState( SalFrameState* pState )
+sal_Bool AquaSalFrame::GetWindowState( SalFrameState* pState )
{
+ if ( !mpWindow )
+ return FALSE;
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
pState->mnMask = SAL_FRAMESTATE_MASK_X |
SAL_FRAMESTATE_MASK_Y |
SAL_FRAMESTATE_MASK_WIDTH |
@@ -621,8 +672,6 @@ BOOL AquaSalFrame::GetWindowState( SalFrameState* pState )
pState->mnWidth = long(aStateRect.size.width);
pState->mnHeight = long(aStateRect.size.height);
- // FIXME: HTH maximized state ?
-
if( [mpWindow isMiniaturized] )
pState->mnState = SAL_FRAMESTATE_MINIMIZED;
else if( ! [mpWindow isZoomed] )
@@ -637,6 +686,12 @@ BOOL AquaSalFrame::GetWindowState( SalFrameState* pState )
void AquaSalFrame::SetScreenNumber(unsigned int nScreen)
{
+ if ( !mpWindow )
+ return;
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
NSArray* pScreens = [NSScreen screens];
Rectangle aRet;
NSScreen* pScreen = nil;
@@ -670,8 +725,14 @@ void AquaSalFrame::SetApplicationID( const rtl::OUString &/*rApplicationID*/ )
// -----------------------------------------------------------------------
-void AquaSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay )
+void AquaSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay )
{
+ if ( !mpWindow )
+ return;
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( mbFullScreen == bFullScreen )
return;
@@ -730,7 +791,6 @@ void AquaSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay )
maFullScreenRect = [mpWindow frame];
{
- //YieldMutexReleaser aRel;
[mpWindow setFrame: [NSWindow frameRectForContentRect: aNewContentRect styleMask: mnStyleMask] display: mbShown ? YES : NO];
}
@@ -742,7 +802,6 @@ void AquaSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay )
else
{
{
- //YieldMutexReleaser aRel;
[mpWindow setFrame: maFullScreenRect display: mbShown ? YES : NO];
}
UpdateFrameGeometry();
@@ -779,8 +838,14 @@ public:
}
};
-void AquaSalFrame::StartPresentation( BOOL bStart )
+void AquaSalFrame::StartPresentation( sal_Bool bStart )
{
+ if ( !mpWindow )
+ return;
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( bStart )
{
mpActivityTimer.reset( new PreventSleepTimer() );
@@ -797,14 +862,23 @@ void AquaSalFrame::StartPresentation( BOOL bStart )
// -----------------------------------------------------------------------
-void AquaSalFrame::SetAlwaysOnTop( BOOL bOnTop )
+void AquaSalFrame::SetAlwaysOnTop( sal_Bool bOnTop )
{
}
// -----------------------------------------------------------------------
-void AquaSalFrame::ToTop(USHORT nFlags)
+void AquaSalFrame::ToTop(sal_uInt16 nFlags)
{
+ if ( !mpWindow )
+ return;
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( ! (nFlags & SAL_FRAME_TOTOP_RESTOREWHENMIN) )
{
if( ! [mpWindow isVisible] || [mpWindow isMiniaturized] )
@@ -858,6 +932,12 @@ NSCursor* AquaSalFrame::getCurrentCursor() const
void AquaSalFrame::SetPointer( PointerStyle ePointerStyle )
{
+ if ( !mpWindow )
+ return;
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( ePointerStyle >= POINTER_COUNT || ePointerStyle == mePointerStyle )
return;
mePointerStyle = ePointerStyle;
@@ -884,6 +964,10 @@ void AquaSalFrame::Flush( void )
if( !(mbGraphics && mpGraphics && mpView && mbShown) )
return;
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
+
[mpView setNeedsDisplay: YES];
// outside of the application's event loop (e.g. IntroWindow)
@@ -902,6 +986,9 @@ void AquaSalFrame::Flush( const Rectangle& rRect )
if( !(mbGraphics && mpGraphics && mpView && mbShown) )
return;
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
NSRect aNSRect = { {rRect.Left(), rRect.Top()}, { rRect.GetWidth(), rRect.GetHeight() } };
VCLToCocoa( aNSRect, false );
[mpView setNeedsDisplayInRect: aNSRect];
@@ -921,7 +1008,8 @@ void AquaSalFrame::Sync()
{
if( mbGraphics && mpGraphics && mpView && mbShown )
{
- //YieldMutexReleaser aRel;
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
[mpView setNeedsDisplay: YES];
[mpView display];
@@ -946,18 +1034,18 @@ void AquaSalFrame::SetInputContext( SalInputContext* pContext )
// -----------------------------------------------------------------------
-void AquaSalFrame::EndExtTextInput( USHORT nFlags )
+void AquaSalFrame::EndExtTextInput( sal_uInt16 nFlags )
{
}
// -----------------------------------------------------------------------
-XubString AquaSalFrame::GetKeyName( USHORT nKeyCode )
+XubString AquaSalFrame::GetKeyName( sal_uInt16 nKeyCode )
{
- static std::map< USHORT, rtl::OUString > aKeyMap;
+ static std::map< sal_uInt16, rtl::OUString > aKeyMap;
if( aKeyMap.empty() )
{
- USHORT i;
+ sal_uInt16 i;
for( i = KEY_A; i <= KEY_Z; i++ )
aKeyMap[ i ] = rtl::OUString( sal_Unicode( 'A' + (i - KEY_A) ) );
for( i = KEY_0; i <= KEY_9; i++ )
@@ -1018,8 +1106,8 @@ XubString AquaSalFrame::GetKeyName( USHORT nKeyCode )
rtl::OUStringBuffer aResult( 16 );
- USHORT nUnmodifiedCode = (nKeyCode & KEY_CODE);
- std::map< USHORT, rtl::OUString >::const_iterator it = aKeyMap.find( nUnmodifiedCode );
+ sal_uInt16 nUnmodifiedCode = (nKeyCode & KEY_CODE);
+ std::map< sal_uInt16, rtl::OUString >::const_iterator it = aKeyMap.find( nUnmodifiedCode );
if( it != aKeyMap.end() )
{
if( (nKeyCode & KEY_SHIFT) != 0 )
@@ -1039,7 +1127,7 @@ XubString AquaSalFrame::GetKeyName( USHORT nKeyCode )
// -----------------------------------------------------------------------
-XubString AquaSalFrame::GetSymbolKeyName( const XubString&, USHORT nKeyCode )
+XubString AquaSalFrame::GetSymbolKeyName( const XubString&, sal_uInt16 nKeyCode )
{
return GetKeyName( nKeyCode );
}
@@ -1145,6 +1233,12 @@ void AquaSalFrame::getResolution( long& o_rDPIX, long& o_rDPIY )
// doesn't make the anything cleaner for now
void AquaSalFrame::UpdateSettings( AllSettings& rSettings )
{
+ if ( !mpWindow )
+ return;
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
[mpView lockFocus];
StyleSettings aStyleSettings = rSettings.GetStyleSettings();
@@ -1256,9 +1350,15 @@ void AquaSalFrame::Beep( SoundType eSoundType )
// -----------------------------------------------------------------------
-void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, USHORT nFlags)
+void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags)
{
- USHORT nEvent = 0;
+ if ( !mpWindow )
+ return;
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
+ sal_uInt16 nEvent = 0;
if( [mpWindow isMiniaturized] )
[mpWindow deminiaturize: NSApp]; // expand the window
@@ -1322,7 +1422,6 @@ void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, USHOR
// do not display yet, we need to update our backbuffer
{
- //YieldMutexReleaser aRel;
[mpWindow setFrame: [NSWindow frameRectForContentRect: aContentRect styleMask: mnStyleMask] display: NO];
}
@@ -1337,13 +1436,18 @@ void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, USHOR
SendPaintEvent();
// now inform the system that the views need to be drawn
- //YieldMutexReleaser aRel;
[mpWindow display];
}
}
void AquaSalFrame::GetWorkArea( Rectangle& rRect )
{
+ if ( !mpWindow )
+ return;
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
NSScreen* pScreen = [mpWindow screen];
if( pScreen == nil )
pScreen = [NSScreen mainScreen];
@@ -1357,6 +1461,9 @@ void AquaSalFrame::GetWorkArea( Rectangle& rRect )
SalPointerState AquaSalFrame::GetPointerState()
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
SalPointerState state;
state.mnState = 0;
@@ -1444,7 +1551,7 @@ SalFrame::SalIndicatorState AquaSalFrame::GetIndicatorState()
return aState;
}
-void AquaSalFrame::SimulateKeyPress( USHORT /*nKeyCode*/ )
+void AquaSalFrame::SimulateKeyPress( sal_uInt16 /*nKeyCode*/ )
{
}
@@ -1457,7 +1564,7 @@ bool AquaSalFrame::SetPluginParent( SystemParentData* pNewParent )
return sal_False;
}
-BOOL AquaSalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& )
+sal_Bool AquaSalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& )
{
// not supported yet
return FALSE;
@@ -1475,6 +1582,9 @@ void AquaSalFrame::DrawMenuBar()
void AquaSalFrame::SetMenu( SalMenu* pSalMenu )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
AquaSalMenu* pMenu = static_cast<AquaSalMenu*>(pSalMenu);
DBG_ASSERT( ! pMenu || pMenu->mbMenuBar, "setting non menubar on frame" );
mpMenu = pMenu;
@@ -1484,8 +1594,15 @@ void AquaSalFrame::SetMenu( SalMenu* pSalMenu )
void AquaSalFrame::SetExtendedFrameStyle( SalExtStyle nStyle )
{
+ if ( mpWindow )
+ {
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( (mnExtStyle & SAL_FRAME_EXT_STYLE_DOCMODIFIED) != (nStyle & SAL_FRAME_EXT_STYLE_DOCMODIFIED) )
[mpWindow setDocumentEdited: (nStyle & SAL_FRAME_EXT_STYLE_DOCMODIFIED) ? YES : NO];
+ }
+
mnExtStyle = nStyle;
}
@@ -1516,6 +1633,11 @@ void AquaSalFrame::SetParent( SalFrame* pNewParent )
void AquaSalFrame::UpdateFrameGeometry()
{
+ if ( !mpWindow )
+ {
+ return;
+ }
+
// keep in mind that view and window coordinates are lower left
// whereas vcl's are upper left
@@ -1559,7 +1681,7 @@ void AquaSalFrame::UpdateFrameGeometry()
// -----------------------------------------------------------------------
-void AquaSalFrame::CaptureMouse( BOOL bCapture )
+void AquaSalFrame::CaptureMouse( sal_Bool bCapture )
{
/* Remark:
we'll try to use a pidgin version of capture mouse
@@ -1588,6 +1710,14 @@ void AquaSalFrame::CaptureMouse( BOOL bCapture )
void AquaSalFrame::ResetClipRegion()
{
+ if ( !mpWindow )
+ {
+ return;
+ }
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
// release old path and indicate no clipping
CGPathRelease( mrClippingPath );
mrClippingPath = NULL;
@@ -1601,8 +1731,16 @@ void AquaSalFrame::ResetClipRegion()
}
}
-void AquaSalFrame::BeginSetClipRegion( ULONG nRects )
+void AquaSalFrame::BeginSetClipRegion( sal_uLong nRects )
{
+ if ( !mpWindow )
+ {
+ return;
+ }
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
// release old path
if( mrClippingPath )
{
@@ -1621,6 +1759,9 @@ void AquaSalFrame::BeginSetClipRegion( ULONG nRects )
void AquaSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( nWidth && nHeight )
{
NSRect aRect = { { nX, nY }, { nWidth, nHeight } };
@@ -1631,6 +1772,14 @@ void AquaSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight
void AquaSalFrame::EndSetClipRegion()
{
+ if ( !mpWindow )
+ {
+ return;
+ }
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( ! maClippingRects.empty() )
{
mrClippingPath = CGPathCreateMutable();
diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm
index 8da1bf9f3085..a72810986c76 100755
--- a/vcl/aqua/source/window/salframeview.mm
+++ b/vcl/aqua/source/window/salframeview.mm
@@ -41,9 +41,9 @@
#define WHEEL_EVENT_FACTOR 1.5
-static USHORT ImplGetModifierMask( unsigned int nMask )
+static sal_uInt16 ImplGetModifierMask( unsigned int nMask )
{
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
if( (nMask & NSShiftKeyMask) != 0 )
nRet |= KEY_SHIFT;
if( (nMask & NSControlKeyMask) != 0 )
@@ -55,9 +55,9 @@ static USHORT ImplGetModifierMask( unsigned int nMask )
return nRet;
}
-static USHORT ImplMapCharCode( sal_Unicode aCode )
+static sal_uInt16 ImplMapCharCode( sal_Unicode aCode )
{
- static USHORT aKeyCodeMap[ 128 ] =
+ static sal_uInt16 aKeyCodeMap[ 128 ] =
{
0, 0, 0, 0, 0, 0, 0, 0,
KEY_BACKSPACE, KEY_TAB, KEY_RETURN, 0, 0, KEY_RETURN, 0, 0,
@@ -85,7 +85,7 @@ static USHORT ImplMapCharCode( sal_Unicode aCode )
// tab alone is reported as 0x09 (as expected) but shift-tab is
// reported as 0x19 (end of medium)
- static USHORT aFunctionKeyCodeMap[ 128 ] =
+ static sal_uInt16 aFunctionKeyCodeMap[ 128 ] =
{
KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, KEY_F1, KEY_F2, KEY_F3, KEY_F4,
KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11, KEY_F12,
@@ -105,7 +105,7 @@ static USHORT ImplMapCharCode( sal_Unicode aCode )
0, 0, 0, 0, 0, 0, 0, 0
};
- USHORT nKeyCode = 0;
+ sal_uInt16 nKeyCode = 0;
if( aCode < SAL_N_ELEMENTS( aKeyCodeMap) )
nKeyCode = aKeyCodeMap[ aCode ];
else if( aCode >= 0xf700 && aCode < 0xf780 )
@@ -117,12 +117,12 @@ static USHORT ImplMapCharCode( sal_Unicode aCode )
static AquaSalFrame* s_pMouseFrame = NULL;
// store the last pressed button for enter/exit events
// which lack that information
-static USHORT s_nLastButton = 0;
+static sal_uInt16 s_nLastButton = 0;
// combinations of keys we need to handle ourselves
static const struct ExceptionalKey
{
- const USHORT nKeyCode;
+ const sal_uInt16 nKeyCode;
const unsigned int nModifierMask;
} aExceptionalKeys[] =
{
@@ -155,7 +155,9 @@ static AquaSalFrame* getMouseContainerFrame()
NSRect aRect = { { pFrame->maGeometry.nX, pFrame->maGeometry.nY },
{ pFrame->maGeometry.nWidth, pFrame->maGeometry.nHeight } };
pFrame->VCLToCocoa( aRect );
- return [super initWithContentRect: aRect styleMask: mpFrame->getStyleMask() backing: NSBackingStoreBuffered defer: NO ];
+ NSWindow* pNSWindow = [super initWithContentRect: aRect styleMask: mpFrame->getStyleMask() backing: NSBackingStoreBuffered defer: NO ];
+ [pNSWindow useOptimizedDrawing: YES]; // OSX recommendation when there are no overlapping subviews within the receiver
+ return pNSWindow;
}
-(AquaSalFrame*)getSalFrame
@@ -163,16 +165,30 @@ static AquaSalFrame* getMouseContainerFrame()
return mpFrame;
}
--(MacOSBOOL)containsMouse
+-(void)displayIfNeeded
+{
+ if( GetSalData() && GetSalData()->mpFirstInstance )
+ {
+ osl::SolarMutex* pMutex = GetSalData()->mpFirstInstance->GetYieldMutex();
+ if( pMutex )
+ {
+ pMutex->acquire();
+ [super displayIfNeeded];
+ pMutex->release();
+ }
+ }
+}
+
+-(BOOL)containsMouse
{
// is this event actually inside that NSWindow ?
NSPoint aPt = [NSEvent mouseLocation];
NSRect aFrameRect = [self frame];
- MacOSBOOL bInRect = NSPointInRect( aPt, aFrameRect );
+ BOOL bInRect = NSPointInRect( aPt, aFrameRect );
return bInRect;
}
--(MacOSBOOL)canBecomeKeyWindow
+-(BOOL)canBecomeKeyWindow
{
if( (mpFrame->mnStyle &
( SAL_FRAME_STYLE_FLOAT |
@@ -195,7 +211,7 @@ static AquaSalFrame* getMouseContainerFrame()
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
{
- static const ULONG nGuessDocument = SAL_FRAME_STYLE_MOVEABLE|
+ static const sal_uLong nGuessDocument = SAL_FRAME_STYLE_MOVEABLE|
SAL_FRAME_STYLE_SIZEABLE|
SAL_FRAME_STYLE_CLOSEABLE;
@@ -285,11 +301,11 @@ static AquaSalFrame* getMouseContainerFrame()
}
}
--(MacOSBOOL)windowShouldClose: (NSNotification*)pNotification
+-(BOOL)windowShouldClose: (NSNotification*)pNotification
{
YIELD_GUARD;
- MacOSBOOL bRet = YES;
+ BOOL bRet = YES;
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
{
// #i84461# end possible input
@@ -332,12 +348,12 @@ static AquaSalFrame* getMouseContainerFrame()
[mDraggingDestinationHandler draggingExited: sender];
}
--(MacOSBOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
+-(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
{
return [mDraggingDestinationHandler prepareForDragOperation: sender];
}
--(MacOSBOOL)performDragOperation:(id <NSDraggingInfo>)sender
+-(BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
return [mDraggingDestinationHandler performDragOperation: sender];
}
@@ -393,17 +409,17 @@ static AquaSalFrame* getMouseContainerFrame()
}
}
--(MacOSBOOL)acceptsFirstResponder
+-(BOOL)acceptsFirstResponder
{
return YES;
}
--(MacOSBOOL)acceptsFirstMouse: (NSEvent*)pEvent
+-(BOOL)acceptsFirstMouse: (NSEvent*)pEvent
{
return YES;
}
--(MacOSBOOL)isOpaque
+-(BOOL)isOpaque
{
return mpFrame ? (mpFrame->getClipPath() != 0 ? NO : YES) : YES;
}
@@ -451,7 +467,7 @@ private:
}
}
--(void)sendMouseEventToFrame: (NSEvent*)pEvent button:(USHORT)nButton eventtype:(USHORT)nEvent
+-(void)sendMouseEventToFrame: (NSEvent*)pEvent button:(sal_uInt16)nButton eventtype:(sal_uInt16)nEvent
{
YIELD_GUARD;
@@ -507,13 +523,13 @@ private:
if( pDispatchFrame && AquaSalFrame::isAlive( pDispatchFrame ) )
{
- pDispatchFrame->mnLastEventTime = static_cast<ULONG>( [pEvent timestamp] * 1000.0 );
+ pDispatchFrame->mnLastEventTime = static_cast<sal_uLong>( [pEvent timestamp] * 1000.0 );
pDispatchFrame->mnLastModifierFlags = [pEvent modifierFlags];
NSPoint aPt = [NSEvent mouseLocation];
pDispatchFrame->CocoaToVCL( aPt );
- USHORT nModMask = ImplGetModifierMask( [pEvent modifierFlags] );
+ sal_uInt16 nModMask = ImplGetModifierMask( [pEvent modifierFlags] );
// #i82284# emulate ctrl left
if( nModMask == KEY_MOD3 && nButton == MOUSE_LEFT )
{
@@ -574,8 +590,11 @@ private:
-(void)mouseEntered: (NSEvent*)pEvent
{
s_pMouseFrame = mpFrame;
-
- [self sendMouseEventToFrame:pEvent button:s_nLastButton eventtype:SALEVENT_MOUSEMOVE];
+
+ // #i107215# the only mouse events we get when inactive are enter/exit
+ // actually we would like to have all of them, but better none than some
+ if( [NSApp isActive] )
+ [self sendMouseEventToFrame:pEvent button:s_nLastButton eventtype:SALEVENT_MOUSEMOVE];
}
-(void)mouseExited: (NSEvent*)pEvent
@@ -583,7 +602,10 @@ private:
if( s_pMouseFrame == mpFrame )
s_pMouseFrame = NULL;
- [self sendMouseEventToFrame:pEvent button:s_nLastButton eventtype:SALEVENT_MOUSELEAVE];
+ // #i107215# the only mouse events we get when inactive are enter/exit
+ // actually we would like to have all of them, but better none than some
+ if( [NSApp isActive] )
+ [self sendMouseEventToFrame:pEvent button:s_nLastButton eventtype:SALEVENT_MOUSELEAVE];
}
-(void)rightMouseDown: (NSEvent*)pEvent
@@ -641,7 +663,7 @@ private:
if( AquaSalFrame::isAlive( mpFrame ) )
{
const NSTimeInterval fMagnifyTime = [pEvent timestamp];
- mpFrame->mnLastEventTime = static_cast<ULONG>( fMagnifyTime * 1000.0 );
+ mpFrame->mnLastEventTime = static_cast<sal_uLong>( fMagnifyTime * 1000.0 );
mpFrame->mnLastModifierFlags = [pEvent modifierFlags];
// check if this is a new series of magnify events
@@ -712,7 +734,7 @@ private:
if( AquaSalFrame::isAlive( mpFrame ) )
{
- mpFrame->mnLastEventTime = static_cast<ULONG>( [pEvent timestamp] * 1000.0 );
+ mpFrame->mnLastEventTime = static_cast<sal_uLong>( [pEvent timestamp] * 1000.0 );
mpFrame->mnLastModifierFlags = [pEvent modifierFlags];
// merge pending scroll wheel events
@@ -772,7 +794,7 @@ private:
if( AquaSalFrame::isAlive( mpFrame ) )
{
- mpFrame->mnLastEventTime = static_cast<ULONG>( [pEvent timestamp] * 1000.0 );
+ mpFrame->mnLastEventTime = static_cast<sal_uLong>( [pEvent timestamp] * 1000.0 );
mpFrame->mnLastModifierFlags = [pEvent modifierFlags];
// merge pending scroll wheel events
@@ -844,7 +866,7 @@ private:
mbNeedSpecialKeyHandle = false;
mbKeyHandled = false;
- mpFrame->mnLastEventTime = static_cast<ULONG>( [pEvent timestamp] * 1000.0 );
+ mpFrame->mnLastEventTime = static_cast<sal_uLong>( [pEvent timestamp] * 1000.0 );
mpFrame->mnLastModifierFlags = [pEvent modifierFlags];
if( ! [self handleKeyDownException: pEvent] )
@@ -857,7 +879,7 @@ private:
}
}
--(MacOSBOOL)handleKeyDownException:(NSEvent*)pEvent
+-(BOOL)handleKeyDownException:(NSEvent*)pEvent
{
// check for a very special set of modified characters
NSString* pUnmodifiedString = [pEvent charactersIgnoringModifiers];
@@ -875,7 +897,7 @@ private:
return YES;
}
unichar keyChar = [pUnmodifiedString characterAtIndex: 0];
- USHORT nKeyCode = ImplMapCharCode( keyChar );
+ sal_uInt16 nKeyCode = ImplMapCharCode( keyChar );
// Caution: should the table grow to more than 5 or 6 entries,
// we must consider moving it to a kind of hash map
@@ -901,7 +923,7 @@ private:
if( AquaSalFrame::isAlive( mpFrame ) )
{
- mpFrame->mnLastEventTime = static_cast<ULONG>( [pEvent timestamp] * 1000.0 );
+ mpFrame->mnLastEventTime = static_cast<sal_uLong>( [pEvent timestamp] * 1000.0 );
mpFrame->mnLastModifierFlags = [pEvent modifierFlags];
}
}
@@ -931,7 +953,7 @@ private:
! [self hasMarkedText ]
)
{
- USHORT nKeyCode = ImplMapCharCode( aCharCode );
+ sal_uInt16 nKeyCode = ImplMapCharCode( aCharCode );
unsigned int nLastModifiers = mpFrame->mnLastModifierFlags;
// #i99567#
@@ -1307,18 +1329,18 @@ private:
}
}
--(MacOSBOOL)sendKeyInputAndReleaseToFrame: (USHORT)nKeyCode character: (sal_Unicode)aChar
+-(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar
{
return [self sendKeyInputAndReleaseToFrame: nKeyCode character: aChar modifiers: mpFrame->mnLastModifierFlags];
}
--(MacOSBOOL)sendKeyInputAndReleaseToFrame: (USHORT)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod
+-(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod
{
return [self sendKeyToFrameDirect: nKeyCode character: aChar modifiers: nMod] ||
[self sendSingleCharacter: mpLastEvent];
}
--(MacOSBOOL)sendKeyToFrameDirect: (USHORT)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod
+-(BOOL)sendKeyToFrameDirect: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod
{
YIELD_GUARD;
@@ -1341,20 +1363,20 @@ private:
}
--(MacOSBOOL)sendSingleCharacter: (NSEvent *)pEvent
+-(BOOL)sendSingleCharacter: (NSEvent *)pEvent
{
NSString* pUnmodifiedString = [pEvent charactersIgnoringModifiers];
if( pUnmodifiedString && [pUnmodifiedString length] == 1 )
{
unichar keyChar = [pUnmodifiedString characterAtIndex: 0];
- USHORT nKeyCode = ImplMapCharCode( keyChar );
+ sal_uInt16 nKeyCode = ImplMapCharCode( keyChar );
if( nKeyCode != 0 )
{
// don't send unicodes in the private use area
if( keyChar >= 0xf700 && keyChar < 0xf780 )
keyChar = 0;
- MacOSBOOL bRet = [self sendKeyToFrameDirect: nKeyCode character: keyChar modifiers: mpFrame->mnLastModifierFlags];
+ BOOL bRet = [self sendKeyToFrameDirect: nKeyCode character: keyChar modifiers: mpFrame->mnLastModifierFlags];
mbInKeyInput = false;
return bRet;
@@ -1370,9 +1392,9 @@ private:
return [NSArray arrayWithObjects:NSUnderlineStyleAttributeName, nil];
}
-- (MacOSBOOL)hasMarkedText
+- (BOOL)hasMarkedText
{
- MacOSBOOL bHasMarkedText;
+ BOOL bHasMarkedText;
bHasMarkedText = ( mMarkedRange.location != NSNotFound ) &&
( mMarkedRange.length != 0 );
@@ -1439,7 +1461,7 @@ private:
if( len > 0 ) {
NSString *pString = [aString string];
OUString aInsertString( GetOUString( pString ) );
- std::vector<USHORT> aInputFlags = std::vector<USHORT>( std::max( 1, len ), 0 );
+ std::vector<sal_uInt16> aInputFlags = std::vector<sal_uInt16>( std::max( 1, len ), 0 );
for ( int i = 0; i < len; i++ )
{
unsigned int nUnderlineValue;
@@ -1598,12 +1620,12 @@ private:
[mDraggingDestinationHandler draggingExited: sender];
}
--(MacOSBOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
+-(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
{
return [mDraggingDestinationHandler prepareForDragOperation: sender];
}
--(MacOSBOOL)performDragOperation:(id <NSDraggingInfo>)sender
+-(BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
return [mDraggingDestinationHandler performDragOperation: sender];
}
diff --git a/vcl/aqua/source/window/salmenu.cxx b/vcl/aqua/source/window/salmenu.cxx
index a124201480b5..0b4f41651aa0 100644
--- a/vcl/aqua/source/window/salmenu.cxx
+++ b/vcl/aqua/source/window/salmenu.cxx
@@ -80,10 +80,14 @@ const AquaSalMenu* AquaSalMenu::pCurrentMenuBar = NULL;
-(void)showPreferences: (id) sender
{
+ YIELD_GUARD;
+
[self showDialog: SHOWDIALOG_ID_PREFERENCES];
}
-(void)showAbout: (id) sender
{
+ YIELD_GUARD;
+
[self showDialog: SHOWDIALOG_ID_ABOUT];
}
@end
@@ -204,11 +208,12 @@ static void initAppMenu()
// =======================================================================
-SalMenu* AquaSalInstance::CreateMenu( BOOL bMenuBar )
+SalMenu* AquaSalInstance::CreateMenu( sal_Bool bMenuBar, Menu* pVCLMenu )
{
initAppMenu();
AquaSalMenu *pAquaSalMenu = new AquaSalMenu( bMenuBar );
+ pAquaSalMenu->mpVCLMenu = pVCLMenu;
return pAquaSalMenu;
}
@@ -335,9 +340,9 @@ sal_Int32 removeUnusedItemsRunner(NSMenu * pMenu)
return drawnItems;
}
-bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, ULONG nFlags)
+bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, sal_uLong nFlags)
{
- // do not use native popup menu when AQUA_NATIVE_MENUS is set to FALSE
+ // do not use native popup menu when AQUA_NATIVE_MENUS is set to sal_False
if( ! VisibleMenuBar() ) {
return false;
}
@@ -365,7 +370,7 @@ bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rR
// do the same strange semantics as vcl popup windows to arrive at a frame geometry
// in mirrored UI case; best done by actually executing the same code
- USHORT nArrangeIndex;
+ sal_uInt16 nArrangeIndex;
pWin->SetPosPixel( pWin->ImplCalcPos( pWin, rRect, nFlags, nArrangeIndex ) );
displayPopupFrame.origin.x = pWin->ImplGetFrame()->maGeometry.nX - pParentAquaSalFrame->maGeometry.nX + offset;
displayPopupFrame.origin.y = pWin->ImplGetFrame()->maGeometry.nY - pParentAquaSalFrame->maGeometry.nY + offset;
@@ -389,7 +394,7 @@ bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rR
return true;
}
-int AquaSalMenu::getItemIndexByPos( USHORT nPos ) const
+int AquaSalMenu::getItemIndexByPos( sal_uInt16 nPos ) const
{
int nIndex = 0;
if( nPos == MENU_APPEND )
@@ -515,7 +520,7 @@ void AquaSalMenu::removeFallbackMenuItem( NSMenuItem* pOldItem )
}
}
-BOOL AquaSalMenu::VisibleMenuBar()
+sal_Bool AquaSalMenu::VisibleMenuBar()
{
// Enable/disable experimental native menus code?
//
@@ -524,11 +529,11 @@ BOOL AquaSalMenu::VisibleMenuBar()
static const char *pExperimental = getenv ("AQUA_NATIVE_MENUS");
if ( ImplGetSVData()->mbIsTestTool || (pExperimental && !strcasecmp(pExperimental, "FALSE")) )
- return FALSE;
+ return sal_False;
// End of experimental code enable/disable part
- return TRUE;
+ return sal_True;
}
void AquaSalMenu::SetFrame( const SalFrame *pFrame )
@@ -627,7 +632,7 @@ void AquaSalMenu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsi
}
}
-void AquaSalMenu::CheckItem( unsigned nPos, BOOL bCheck )
+void AquaSalMenu::CheckItem( unsigned nPos, sal_Bool bCheck )
{
if( nPos < maItems.size() )
{
@@ -636,7 +641,7 @@ void AquaSalMenu::CheckItem( unsigned nPos, BOOL bCheck )
}
}
-void AquaSalMenu::EnableItem( unsigned nPos, BOOL bEnable )
+void AquaSalMenu::EnableItem( unsigned nPos, sal_Bool bEnable )
{
if( nPos < maItems.size() )
{
@@ -697,10 +702,10 @@ void AquaSalMenu::SetItemText( unsigned i_nPos, SalMenuItem* i_pSalMenuItem, con
void AquaSalMenu::SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const XubString& rKeyName )
{
- USHORT nModifier;
+ sal_uInt16 nModifier;
sal_Unicode nCommandKey = 0;
- USHORT nKeyCode=rKeyCode.GetCode();
+ sal_uInt16 nKeyCode=rKeyCode.GetCode();
if( nKeyCode )
{
if ((nKeyCode>=KEY_A) && (nKeyCode<=KEY_Z)) // letter A..Z
@@ -782,7 +787,7 @@ void AquaSalMenu::GetSystemMenuData( SystemMenuData* pData )
{
}
-AquaSalMenu::MenuBarButtonEntry* AquaSalMenu::findButtonItem( USHORT i_nItemId )
+AquaSalMenu::MenuBarButtonEntry* AquaSalMenu::findButtonItem( sal_uInt16 i_nItemId )
{
for( size_t i = 0; i < maButtons.size(); ++i )
{
@@ -848,7 +853,7 @@ bool AquaSalMenu::AddMenuBarButton( const SalMenuButtonItem& i_rNewItem )
return true;
}
-void AquaSalMenu::RemoveMenuBarButton( USHORT i_nId )
+void AquaSalMenu::RemoveMenuBarButton( sal_uInt16 i_nId )
{
MenuBarButtonEntry* pEntry = findButtonItem( i_nId );
if( pEntry )
@@ -862,7 +867,7 @@ void AquaSalMenu::RemoveMenuBarButton( USHORT i_nId )
statusLayout();
}
-Rectangle AquaSalMenu::GetMenuBarButtonRectPixel( USHORT i_nItemId, SalFrame* i_pReferenceFrame )
+Rectangle AquaSalMenu::GetMenuBarButtonRectPixel( sal_uInt16 i_nItemId, SalFrame* i_pReferenceFrame )
{
if( GetSalData()->mnSystemVersion < VER_LEOPARD )
return Rectangle( Point( -1, -1 ), Size( 1, 1 ) );
diff --git a/vcl/aqua/source/window/salobj.cxx b/vcl/aqua/source/window/salobj.cxx
index 23df35581ecb..5bc239e26f29 100644
--- a/vcl/aqua/source/window/salobj.cxx
+++ b/vcl/aqua/source/window/salobj.cxx
@@ -108,14 +108,14 @@ void AquaSalObject::ResetClipRegion()
// -----------------------------------------------------------------------
-USHORT AquaSalObject::GetClipRegionType()
+sal_uInt16 AquaSalObject::GetClipRegionType()
{
return SAL_OBJECT_CLIP_INCLUDERECTS;
}
// -----------------------------------------------------------------------
-void AquaSalObject::BeginSetClipRegion( ULONG nRectCount )
+void AquaSalObject::BeginSetClipRegion( sal_uLong nRectCount )
{
mbClip = false;
}
@@ -201,7 +201,7 @@ void AquaSalObject::setClippedPosSize()
// -----------------------------------------------------------------------
-void AquaSalObject::Show( BOOL bVisible )
+void AquaSalObject::Show( sal_Bool bVisible )
{
if( mpClipView )
[mpClipView setHidden: (bVisible ? NO : YES)];
@@ -209,7 +209,7 @@ void AquaSalObject::Show( BOOL bVisible )
// -----------------------------------------------------------------------
-void AquaSalObject::Enable( BOOL bEnable )
+void AquaSalObject::Enable( sal_Bool bEnable )
{
}
@@ -238,4 +238,10 @@ const SystemEnvData* AquaSalObject::GetSystemData() const
return &maSysData;
}
+// -----------------------------------------------------------------------
+
+void AquaSalObject::InterceptChildWindowKeyDown( sal_Bool /*bIntercept*/ )
+{
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/cupsmgr.hxx b/vcl/inc/cupsmgr.hxx
index 295f479d5cb8..b76e8ef99289 100644
--- a/vcl/inc/cupsmgr.hxx
+++ b/vcl/inc/cupsmgr.hxx
@@ -71,7 +71,7 @@ class CUPSManager : public PrinterInfoManager
virtual void initialize();
- void getOptionsFromDocumentSetup( const JobData& rJob, int& rNumOptions, void** rOptions ) const;
+ void getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner, int& rNumOptions, void** rOptions ) const;
void runDests();
public:
// public for stub
@@ -85,7 +85,7 @@ public:
const char* authenticateUser( const char* );
virtual FILE* startSpool( const rtl::OUString& rPrinterName, bool bQuickCommand );
- virtual int endSpool( const rtl::OUString& rPrinterName, const rtl::OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData );
+ virtual int endSpool( const rtl::OUString& rPrinterName, const rtl::OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner );
virtual void setupJobContextData( JobData& rData );
// changes the info about a named printer
diff --git a/vcl/inc/vcl/abstdlg.hxx b/vcl/inc/vcl/abstdlg.hxx
index 3e2ef6554079..012981fba7cf 100644
--- a/vcl/inc/vcl/abstdlg.hxx
+++ b/vcl/inc/vcl/abstdlg.hxx
@@ -42,7 +42,7 @@ class VCL_DLLPUBLIC VclAbstractDialog
{
public:
virtual short Execute() = 0;
- //virtual void Show( BOOL bVisible = TRUE, USHORT nFlags = 0 ) = 0;
+ //virtual void Show( sal_Bool bVisible = sal_True, sal_uInt16 nFlags = 0 ) = 0;
virtual ~VclAbstractDialog();
};
diff --git a/vcl/inc/vcl/accel.h b/vcl/inc/vcl/accel.h
index aec7e7c1bbd2..bf3006c9ca7b 100644
--- a/vcl/inc/vcl/accel.h
+++ b/vcl/inc/vcl/accel.h
@@ -43,11 +43,11 @@ class Accelerator;
class ImplAccelEntry
{
public:
- USHORT mnId;
+ sal_uInt16 mnId;
KeyCode maKeyCode;
Accelerator* mpAccel;
Accelerator* mpAutoAccel;
- BOOL mbEnabled;
+ sal_Bool mbEnabled;
};
// -----------------
@@ -55,7 +55,7 @@ public:
// -----------------
// in KEYCOD.CXX
-void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT& rCode3, USHORT& rCode4 );
+void ImplGetKeyCode( KeyFuncType eFunc, sal_uInt16& rCode1, sal_uInt16& rCode2, sal_uInt16& rCode3, sal_uInt16& rCode4 );
#endif // _SV_ACCEL_H
diff --git a/vcl/inc/vcl/accel.hxx b/vcl/inc/vcl/accel.hxx
index 8c5ee6dfeb68..a7bf623cb20a 100644
--- a/vcl/inc/vcl/accel.hxx
+++ b/vcl/inc/vcl/accel.hxx
@@ -55,16 +55,16 @@ private:
// Werden vom AcceleratorManager gesetzt
KeyCode maCurKeyCode;
- USHORT mnCurId;
- USHORT mnCurRepeat;
- BOOL mbIsCancel;
- BOOL* mpDel;
+ sal_uInt16 mnCurId;
+ sal_uInt16 mnCurRepeat;
+ sal_Bool mbIsCancel;
+ sal_Bool* mpDel;
SAL_DLLPRIVATE void ImplInit();
SAL_DLLPRIVATE void ImplCopyData( ImplAccelData& rAccelData );
SAL_DLLPRIVATE void ImplDeleteData();
- SAL_DLLPRIVATE void ImplInsertAccel( USHORT nItemId, const KeyCode& rKeyCode,
- BOOL bEnable, Accelerator* pAutoAccel );
+ SAL_DLLPRIVATE void ImplInsertAccel( sal_uInt16 nItemId, const KeyCode& rKeyCode,
+ sal_Bool bEnable, Accelerator* pAutoAccel );
SAL_DLLPRIVATE ImplAccelEntry* ImplGetAccelData( const KeyCode& rKeyCode ) const;
@@ -81,35 +81,35 @@ public:
virtual void Deactivate();
virtual void Select();
- void InsertItem( USHORT nItemId, const KeyCode& rKeyCode );
+ void InsertItem( sal_uInt16 nItemId, const KeyCode& rKeyCode );
void InsertItem( const ResId& rResId );
- void RemoveItem( USHORT nItemId );
+ void RemoveItem( sal_uInt16 nItemId );
void RemoveItem( const KeyCode rKeyCode );
void Clear();
- USHORT GetCurItemId() const { return mnCurId; }
+ sal_uInt16 GetCurItemId() const { return mnCurId; }
const KeyCode& GetCurKeyCode() const { return maCurKeyCode; }
- USHORT GetCurRepeat() const { return mnCurRepeat; }
- BOOL IsCancel() const { return mbIsCancel; }
-
- USHORT GetItemCount() const;
- USHORT GetItemId( USHORT nPos ) const;
- KeyCode GetItemKeyCode( USHORT nPos ) const;
- USHORT GetItemId( const KeyCode& rKeyCode ) const;
- KeyCode GetKeyCode( USHORT nItemId ) const;
- BOOL IsIdValid( USHORT nItemId ) const;
- BOOL IsKeyCodeValid( const KeyCode rKeyCode ) const;
- BOOL Call( const KeyCode& rKeyCode, USHORT nRepeat = 0 );
-
- void SetAccel( USHORT nItemId, Accelerator* pAccel );
- Accelerator* GetAccel( USHORT nItemId ) const;
+ sal_uInt16 GetCurRepeat() const { return mnCurRepeat; }
+ sal_Bool IsCancel() const { return mbIsCancel; }
+
+ sal_uInt16 GetItemCount() const;
+ sal_uInt16 GetItemId( sal_uInt16 nPos ) const;
+ KeyCode GetItemKeyCode( sal_uInt16 nPos ) const;
+ sal_uInt16 GetItemId( const KeyCode& rKeyCode ) const;
+ KeyCode GetKeyCode( sal_uInt16 nItemId ) const;
+ sal_Bool IsIdValid( sal_uInt16 nItemId ) const;
+ sal_Bool IsKeyCodeValid( const KeyCode rKeyCode ) const;
+ sal_Bool Call( const KeyCode& rKeyCode, sal_uInt16 nRepeat = 0 );
+
+ void SetAccel( sal_uInt16 nItemId, Accelerator* pAccel );
+ Accelerator* GetAccel( sal_uInt16 nItemId ) const;
void SetAccel( const KeyCode rKeyCode, Accelerator* pAccel );
Accelerator* GetAccel( const KeyCode rKeyCode ) const;
- void EnableItem( USHORT nItemId, BOOL bEnable = TRUE );
- BOOL IsItemEnabled( USHORT nItemId ) const;
- void EnableItem( const KeyCode rKeyCode, BOOL bEnable = TRUE );
- BOOL IsItemEnabled( const KeyCode rKeyCode ) const;
+ void EnableItem( sal_uInt16 nItemId, sal_Bool bEnable = sal_True );
+ sal_Bool IsItemEnabled( sal_uInt16 nItemId ) const;
+ void EnableItem( const KeyCode rKeyCode, sal_Bool bEnable = sal_True );
+ sal_Bool IsItemEnabled( const KeyCode rKeyCode ) const;
void SetHelpText( const XubString& rHelpText ) { maHelpStr = rHelpText; }
const XubString& GetHelpText() const { return maHelpStr; }
diff --git a/vcl/inc/vcl/accmgr.hxx b/vcl/inc/vcl/accmgr.hxx
index 5b9880532b98..2ffa2b366920 100644
--- a/vcl/inc/vcl/accmgr.hxx
+++ b/vcl/inc/vcl/accmgr.hxx
@@ -55,13 +55,13 @@ public:
}
~ImplAccelManager();
- BOOL InsertAccel( Accelerator* pAccel );
+ sal_Bool InsertAccel( Accelerator* pAccel );
void RemoveAccel( Accelerator* pAccel );
- void EndSequence( BOOL bCancel = FALSE );
- void FlushAccel() { EndSequence( TRUE ); }
+ void EndSequence( sal_Bool bCancel = sal_False );
+ void FlushAccel() { EndSequence( sal_True ); }
- BOOL IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat );
+ sal_Bool IsAccelKey( const KeyCode& rKeyCode, sal_uInt16 nRepeat );
};
#endif // _SV_ACCMGR_HXX
diff --git a/vcl/inc/vcl/alpha.hxx b/vcl/inc/vcl/alpha.hxx
index a31e68832ba1..8bcaf3789528 100644
--- a/vcl/inc/vcl/alpha.hxx
+++ b/vcl/inc/vcl/alpha.hxx
@@ -55,14 +55,14 @@ public:
AlphaMask();
AlphaMask( const Bitmap& rBitmap );
AlphaMask( const AlphaMask& rAlphaMask );
- AlphaMask( const Size& rSizePixel, BYTE* pEraseTransparency = NULL );
+ AlphaMask( const Size& rSizePixel, sal_uInt8* pEraseTransparency = NULL );
~AlphaMask();
AlphaMask& operator=( const Bitmap& rBitmap );
AlphaMask& operator=( const AlphaMask& rAlphaMask ) { return (AlphaMask&) Bitmap::operator=( rAlphaMask ); }
- BOOL operator!() const { return Bitmap::operator!(); }
- BOOL operator==( const AlphaMask& rAlphaMask ) const { return Bitmap::operator==( rAlphaMask ); }
- BOOL operator!=( const AlphaMask& rAlphaMask ) const { return Bitmap::operator!=( rAlphaMask ); }
+ sal_Bool operator!() const { return Bitmap::operator!(); }
+ sal_Bool operator==( const AlphaMask& rAlphaMask ) const { return Bitmap::operator==( rAlphaMask ); }
+ sal_Bool operator!=( const AlphaMask& rAlphaMask ) const { return Bitmap::operator!=( rAlphaMask ); }
const MapMode& GetPrefMapMode() const { return Bitmap::GetPrefMapMode(); }
void SetPrefMapMode( const MapMode& rMapMode ) { Bitmap::SetPrefMapMode( rMapMode ); }
@@ -73,26 +73,26 @@ public:
Size GetSizePixel() const { return Bitmap::GetSizePixel(); }
void SetSizePixel( const Size& rNewSize ) { Bitmap::SetSizePixel( rNewSize ); }
- ULONG GetSizeBytes() const { return Bitmap::GetSizeBytes(); }
- ULONG GetChecksum() const { return Bitmap::GetChecksum(); }
+ sal_uLong GetSizeBytes() const { return Bitmap::GetSizeBytes(); }
+ sal_uLong GetChecksum() const { return Bitmap::GetChecksum(); }
Bitmap GetBitmap() const;
public:
- BOOL Crop( const Rectangle& rRectPixel );
- BOOL Expand( ULONG nDX, ULONG nDY, BYTE* pInitTransparency = NULL );
- BOOL CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc, const AlphaMask* pAlphaSrc = NULL );
- BOOL Erase( BYTE cTransparency );
- BOOL Invert();
- BOOL Mirror( ULONG nMirrorFlags );
- BOOL Scale( const Size& rNewSize, ULONG nScaleFlag = BMP_SCALE_FAST );
- BOOL Scale( const double& rScaleX, const double& rScaleY, ULONG nScaleFlag = BMP_SCALE_FAST );
- BOOL Rotate( long nAngle10, BYTE cFillTransparency );
- BOOL Replace( const Bitmap& rMask, BYTE rReplaceTransparency );
- BOOL Replace( BYTE cSearchTransparency, BYTE cReplaceTransparency, ULONG nTol = 0UL );
- BOOL Replace( BYTE* pSearchTransparencies, BYTE* pReplaceTransparencies,
- ULONG nColorCount, ULONG* pTols = NULL );
+ sal_Bool Crop( const Rectangle& rRectPixel );
+ sal_Bool Expand( sal_uLong nDX, sal_uLong nDY, sal_uInt8* pInitTransparency = NULL );
+ sal_Bool CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc, const AlphaMask* pAlphaSrc = NULL );
+ sal_Bool Erase( sal_uInt8 cTransparency );
+ sal_Bool Invert();
+ sal_Bool Mirror( sal_uLong nMirrorFlags );
+ sal_Bool Scale( const Size& rNewSize, sal_uLong nScaleFlag = BMP_SCALE_FAST );
+ sal_Bool Scale( const double& rScaleX, const double& rScaleY, sal_uLong nScaleFlag = BMP_SCALE_FAST );
+ sal_Bool Rotate( long nAngle10, sal_uInt8 cFillTransparency );
+ sal_Bool Replace( const Bitmap& rMask, sal_uInt8 rReplaceTransparency );
+ sal_Bool Replace( sal_uInt8 cSearchTransparency, sal_uInt8 cReplaceTransparency, sal_uLong nTol = 0UL );
+ sal_Bool Replace( sal_uInt8* pSearchTransparencies, sal_uInt8* pReplaceTransparencies,
+ sal_uLong nColorCount, sal_uLong* pTols = NULL );
public:
@@ -102,8 +102,8 @@ public:
public:
- BOOL Read( SvStream& rIStm, BOOL bFileHeader = TRUE ) { return Bitmap::Read( rIStm, bFileHeader ); }
- BOOL Write( SvStream& rOStm, BOOL bCompressed = TRUE, BOOL bFileHeader = TRUE ) const { return Bitmap::Write( rOStm, bCompressed, bFileHeader ); }
+ sal_Bool Read( SvStream& rIStm, sal_Bool bFileHeader = sal_True ) { return Bitmap::Read( rIStm, bFileHeader ); }
+ sal_Bool Write( SvStream& rOStm, sal_Bool bCompressed = sal_True, sal_Bool bFileHeader = sal_True ) const { return Bitmap::Write( rOStm, bCompressed, bFileHeader ); }
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const BitmapEx& rBitmapEx );
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx );
diff --git a/vcl/inc/vcl/animate.hxx b/vcl/inc/vcl/animate.hxx
index 5a9b1b6dfc4f..e53a51e0e932 100644
--- a/vcl/inc/vcl/animate.hxx
+++ b/vcl/inc/vcl/animate.hxx
@@ -71,7 +71,7 @@ struct VCL_DLLPUBLIC AnimationBitmap
Size aSizePix;
long nWait;
Disposal eDisposal;
- BOOL bUserInput;
+ sal_Bool bUserInput;
AnimationBitmap() {}
AnimationBitmap( const BitmapEx& rBmpEx, const Point& rPosPix,
@@ -82,9 +82,9 @@ struct VCL_DLLPUBLIC AnimationBitmap
aSizePix ( rSizePix ),
nWait ( _nWait ),
eDisposal ( _eDisposal ),
- bUserInput ( FALSE ) {}
+ bUserInput ( sal_False ) {}
- BOOL operator==( const AnimationBitmap& rAnimBmp ) const
+ sal_Bool operator==( const AnimationBitmap& rAnimBmp ) const
{
return( rAnimBmp.aBmpEx == aBmpEx &&
rAnimBmp.aPosPix == aPosPix &&
@@ -94,9 +94,9 @@ struct VCL_DLLPUBLIC AnimationBitmap
rAnimBmp.bUserInput == bUserInput );
}
- BOOL operator!=( const AnimationBitmap& rAnimBmp ) const { return !( *this == rAnimBmp ); }
+ sal_Bool operator!=( const AnimationBitmap& rAnimBmp ) const { return !( *this == rAnimBmp ); }
- BOOL IsEqual( const AnimationBitmap& rAnimBmp ) const
+ sal_Bool IsEqual( const AnimationBitmap& rAnimBmp ) const
{
return( rAnimBmp.aPosPix == aPosPix &&
rAnimBmp.aSizePix == aSizePix &&
@@ -106,7 +106,7 @@ struct VCL_DLLPUBLIC AnimationBitmap
rAnimBmp.aBmpEx.IsEqual( aBmpEx ) );
}
- ULONG GetChecksum() const;
+ sal_uLong GetChecksum() const;
};
// -------------------
@@ -125,14 +125,14 @@ struct AInfo
OutputDevice* pOutDev;
void* pViewData;
long nExtraData;
- BOOL bWithSize;
- BOOL bPause;
+ sal_Bool bWithSize;
+ sal_Bool bPause;
AInfo() : pOutDev( NULL ),
pViewData( NULL ),
nExtraData( 0L ),
- bWithSize( FALSE ),
- bPause( FALSE ) {}
+ bWithSize( sal_False ),
+ bPause( sal_False ) {}
};
// -------------------
@@ -141,7 +141,7 @@ struct AInfo
class VCL_DLLPUBLIC Animation
{
- SAL_DLLPRIVATE static ULONG mnAnimCount;
+ SAL_DLLPRIVATE static sal_uLong mnAnimCount;
List maList;
List maAInfoList;
@@ -156,21 +156,21 @@ class VCL_DLLPUBLIC Animation
long mnPos;
Disposal meLastDisposal;
CycleMode meCycleMode;
- BOOL mbFirst;
- BOOL mbIsInAnimation;
- BOOL mbWithSize;
- BOOL mbLoopTerminated;
- BOOL mbIsWaiting;
+ sal_Bool mbFirst;
+ sal_Bool mbIsInAnimation;
+ sal_Bool mbWithSize;
+ sal_Bool mbLoopTerminated;
+ sal_Bool mbIsWaiting;
- SAL_DLLPRIVATE void ImplRestartTimer( ULONG nTimeout );
+ SAL_DLLPRIVATE void ImplRestartTimer( sal_uLong nTimeout );
DECL_DLLPRIVATE_LINK( ImplTimeoutHdl, Timer* );
public:
SAL_DLLPRIVATE static void ImplIncAnimCount() { mnAnimCount++; }
SAL_DLLPRIVATE static void ImplDecAnimCount() { mnAnimCount--; }
- SAL_DLLPRIVATE ULONG ImplGetCurPos() const { return mnPos; }
+ SAL_DLLPRIVATE sal_uLong ImplGetCurPos() const { return mnPos; }
public:
@@ -179,28 +179,28 @@ public:
~Animation();
Animation& operator=( const Animation& rAnimation );
- BOOL operator==( const Animation& rAnimation ) const;
- BOOL operator!=( const Animation& rAnimation ) const { return !(*this==rAnimation); }
+ sal_Bool operator==( const Animation& rAnimation ) const;
+ sal_Bool operator!=( const Animation& rAnimation ) const { return !(*this==rAnimation); }
- BOOL IsEqual( const Animation& rAnimation ) const;
+ sal_Bool IsEqual( const Animation& rAnimation ) const;
- BOOL IsEmpty() const;
+ sal_Bool IsEmpty() const;
void SetEmpty();
void Clear();
- BOOL Start( OutputDevice* pOutDev, const Point& rDestPt, long nExtraData = 0,
+ sal_Bool Start( OutputDevice* pOutDev, const Point& rDestPt, long nExtraData = 0,
OutputDevice* pFirstFrameOutDev = NULL );
- BOOL Start( OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSz, long nExtraData = 0,
+ sal_Bool Start( OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSz, long nExtraData = 0,
OutputDevice* pFirstFrameOutDev = NULL );
void Stop( OutputDevice* pOutDev = NULL, long nExtraData = 0 );
void Draw( OutputDevice* pOutDev, const Point& rDestPt ) const;
void Draw( OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSz ) const;
- BOOL IsInAnimation() const { return mbIsInAnimation; }
- BOOL IsTransparent() const;
- BOOL IsTerminated() const { return mbLoopTerminated; }
+ sal_Bool IsInAnimation() const { return mbIsInAnimation; }
+ sal_Bool IsTransparent() const;
+ sal_Bool IsTerminated() const { return mbLoopTerminated; }
const Size& GetDisplaySizePixel() const { return maGlobalSize; }
void SetDisplaySizePixel( const Size& rSize ) { maGlobalSize = rSize; }
@@ -208,8 +208,8 @@ public:
const BitmapEx& GetBitmapEx() const { return maBitmapEx; }
void SetBitmapEx( const BitmapEx& rBmpEx ) { maBitmapEx = rBmpEx; }
- ULONG GetLoopCount() const { return mnLoopCount; }
- void SetLoopCount( const ULONG nLoopCount );
+ sal_uLong GetLoopCount() const { return mnLoopCount; }
+ void SetLoopCount( const sal_uLong nLoopCount );
void ResetLoopCount();
void SetCycleMode( CycleMode eMode );
@@ -218,31 +218,31 @@ public:
void SetNotifyHdl( const Link& rLink ) { maNotifyLink = rLink; }
const Link& GetNotifyHdl() const { return maNotifyLink; }
- USHORT Count() const { return (USHORT) maList.Count(); }
- BOOL Insert( const AnimationBitmap& rAnimationBitmap );
- const AnimationBitmap& Get( USHORT nAnimation ) const;
- void Replace( const AnimationBitmap& rNewAnimationBmp, USHORT nAnimation );
+ sal_uInt16 Count() const { return (sal_uInt16) maList.Count(); }
+ sal_Bool Insert( const AnimationBitmap& rAnimationBitmap );
+ const AnimationBitmap& Get( sal_uInt16 nAnimation ) const;
+ void Replace( const AnimationBitmap& rNewAnimationBmp, sal_uInt16 nAnimation );
List* GetAInfoList() { return &maAInfoList; }
- ULONG GetSizeBytes() const;
- ULONG GetChecksum() const;
+ sal_uLong GetSizeBytes() const;
+ sal_uLong GetChecksum() const;
public:
- BOOL Convert( BmpConversion eConversion );
- BOOL ReduceColors( USHORT nNewColorCount,
+ sal_Bool Convert( BmpConversion eConversion );
+ sal_Bool ReduceColors( sal_uInt16 nNewColorCount,
BmpReduce eReduce = BMP_REDUCE_SIMPLE );
- BOOL Invert();
- BOOL Mirror( ULONG nMirrorFlags );
- BOOL Dither( ULONG nDitherFlags = BMP_DITHER_MATRIX );
- BOOL Adjust( short nLuminancePercent = 0,
+ sal_Bool Invert();
+ sal_Bool Mirror( sal_uLong nMirrorFlags );
+ sal_Bool Dither( sal_uLong nDitherFlags = BMP_DITHER_MATRIX );
+ sal_Bool Adjust( short nLuminancePercent = 0,
short nContrastPercent = 0,
short nChannelRPercent = 0,
short nChannelGPercent = 0,
short nChannelBPercent = 0,
double fGamma = 1.0,
- BOOL bInvert = FALSE );
- BOOL Filter( BmpFilter eFilter,
+ sal_Bool bInvert = sal_False );
+ sal_Bool Filter( BmpFilter eFilter,
const BmpFilterParam* pFilterParam = NULL,
const Link* pProgress = NULL );
diff --git a/vcl/inc/vcl/apptypes.hxx b/vcl/inc/vcl/apptypes.hxx
index eba7f779ee81..42273f6a292c 100644
--- a/vcl/inc/vcl/apptypes.hxx
+++ b/vcl/inc/vcl/apptypes.hxx
@@ -37,14 +37,14 @@
// - Application-Types -
// ---------------------
-#define EXC_RSCNOTLOADED ((USHORT)0x0100)
-#define EXC_SYSOBJNOTCREATED ((USHORT)0x0200)
-#define EXC_SYSTEM ((USHORT)0x0300)
-#define EXC_DISPLAY ((USHORT)0x0400)
-#define EXC_REMOTE ((USHORT)0x0500)
-#define EXC_USER ((USHORT)0x1000)
-#define EXC_MAJORTYPE ((USHORT)0xFF00)
-#define EXC_MINORTYPE ((USHORT)0x00FF)
+#define EXC_RSCNOTLOADED ((sal_uInt16)0x0100)
+#define EXC_SYSOBJNOTCREATED ((sal_uInt16)0x0200)
+#define EXC_SYSTEM ((sal_uInt16)0x0300)
+#define EXC_DISPLAY ((sal_uInt16)0x0400)
+#define EXC_REMOTE ((sal_uInt16)0x0500)
+#define EXC_USER ((sal_uInt16)0x1000)
+#define EXC_MAJORTYPE ((sal_uInt16)0xFF00)
+#define EXC_MINORTYPE ((sal_uInt16)0x00FF)
#define UNIQUEID_SV_BEGIN 64000
@@ -72,10 +72,10 @@ public:
// - UserActive -
// --------------
-#define USERACTIVE_MOUSEDRAG ((USHORT)0x0001)
-#define USERACTIVE_INPUT ((USHORT)0x0002)
-#define USERACTIVE_MODALDIALOG ((USHORT)0x0004)
-#define USERACTIVE_ALL ((USHORT)0xFFFF)
+#define USERACTIVE_MOUSEDRAG ((sal_uInt16)0x0001)
+#define USERACTIVE_INPUT ((sal_uInt16)0x0002)
+#define USERACTIVE_MODALDIALOG ((sal_uInt16)0x0004)
+#define USERACTIVE_ALL ((sal_uInt16)0xFFFF)
#endif // _VCL_APPTYPES_HXX
diff --git a/vcl/inc/vcl/arrange.hxx b/vcl/inc/vcl/arrange.hxx
index 45433f4f351e..5568cc3b05d8 100644
--- a/vcl/inc/vcl/arrange.hxx
+++ b/vcl/inc/vcl/arrange.hxx
@@ -49,7 +49,7 @@ namespace vcl
or a child WindowArranger (a node in the hierarchy), but never both
*/
- class WindowArranger
+ class VCL_DLLPUBLIC WindowArranger
{
protected:
struct Element
@@ -77,11 +77,13 @@ namespace vcl
Element( Window* i_pWin,
boost::shared_ptr<WindowArranger> const & i_pChild = boost::shared_ptr<WindowArranger>(),
- sal_Int32 i_nExpandPriority = 0
+ sal_Int32 i_nExpandPriority = 0,
+ const Size& i_rMinSize = Size()
)
: m_pElement( i_pWin )
, m_pChild( i_pChild )
, m_nExpandPriority( i_nExpandPriority )
+ , m_aMinSize( i_rMinSize )
, m_bHidden( false )
, m_nLeftBorder( 0 )
, m_nTopBorder( 0 )
@@ -102,12 +104,19 @@ namespace vcl
Rectangle m_aManagedArea;
long m_nOuterBorder;
+ rtl::OUString m_aIdentifier;
+
virtual Element* getElement( size_t i_nIndex ) = 0;
const Element* getConstElement( size_t i_nIndex ) const
{ return const_cast<WindowArranger*>(this)->getElement( i_nIndex ); }
public:
+ static long getDefaultBorder();
+
+ static long getBorderValue( long nBorder )
+ { return nBorder >= 0 ? nBorder : -nBorder * getDefaultBorder(); }
+
WindowArranger( WindowArranger* i_pParent = NULL )
: m_pParentWindow( i_pParent ? i_pParent->m_pParentWindow : NULL )
, m_pParentArranger( i_pParent )
@@ -142,6 +151,9 @@ namespace vcl
virtual bool isVisible() const; // true if any element is visible
+ virtual com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getProperties() const;
+ virtual void setProperties( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& );
+
sal_Int32 getExpandPriority( size_t i_nIndex ) const
{
const Element* pEle = getConstElement( i_nIndex );
@@ -174,6 +186,19 @@ namespace vcl
}
}
+ void getBorders( size_t i_nIndex, long* i_pLeft = NULL, long* i_pTop = NULL, long* i_pRight = NULL, long* i_pBottom = NULL ) const
+ {
+ const Element* pEle = getConstElement( i_nIndex );
+ if( pEle )
+ {
+ if( i_pLeft ) *i_pLeft = pEle->m_nLeftBorder;
+ if( i_pTop ) *i_pTop = pEle->m_nTopBorder;
+ if( i_pRight ) *i_pRight = pEle->m_nRightBorder;
+ if( i_pBottom ) *i_pBottom = pEle->m_nBottomBorder;
+ }
+ }
+
+
void show( bool i_bShow = true, bool i_bImmediateUpdate = true );
void setManagedArea( const Rectangle& i_rArea )
@@ -188,9 +213,15 @@ namespace vcl
m_nOuterBorder = i_nBorder;
resize();
}
+
+ const rtl::OUString getIdentifier() const
+ { return m_aIdentifier; }
+
+ void setIdentifier( const rtl::OUString& i_rId )
+ { m_aIdentifier = i_rId; }
};
- class RowOrColumn : public WindowArranger
+ class VCL_DLLPUBLIC RowOrColumn : public WindowArranger
{
long m_nBorderWidth;
bool m_bColumn;
@@ -205,7 +236,7 @@ namespace vcl
public:
RowOrColumn( WindowArranger* i_pParent = NULL,
- bool bColumn = true, long i_nBorderWidth = 5 )
+ bool bColumn = true, long i_nBorderWidth = -1 )
: WindowArranger( i_pParent )
, m_nBorderWidth( i_nBorderWidth )
, m_bColumn( bColumn )
@@ -219,7 +250,7 @@ namespace vcl
// add a managed window at the given index
// an index smaller than zero means add the window at the end
- size_t addWindow( Window*, sal_Int32 i_nExpandPrio = 0, size_t i_nIndex = ~0 );
+ size_t addWindow( Window*, sal_Int32 i_nExpandPrio = 0, const Size& i_rMinSize = Size(), size_t i_nIndex = ~0 );
void remove( Window* );
size_t addChild( boost::shared_ptr<WindowArranger> const &, sal_Int32 i_nExpandPrio = 0, size_t i_nIndex = ~0 );
@@ -231,7 +262,7 @@ namespace vcl
long getBorderWidth() const { return m_nBorderWidth; }
};
- class LabeledElement : public WindowArranger
+ class VCL_DLLPUBLIC LabeledElement : public WindowArranger
{
WindowArranger::Element m_aLabel;
WindowArranger::Element m_aElement;
@@ -249,7 +280,7 @@ namespace vcl
}
public:
- LabeledElement( WindowArranger* i_pParent = NULL, int i_nLabelStyle = 0, long i_nDistance = 5 )
+ LabeledElement( WindowArranger* i_pParent = NULL, int i_nLabelStyle = 0, long i_nDistance = -1 )
: WindowArranger( i_pParent )
, m_nDistance( i_nDistance )
, m_nLabelColumnWidth( 0 )
@@ -275,11 +306,11 @@ namespace vcl
{ return m_aElement.getOptimalSize( i_eType ); }
};
- class LabelColumn : public RowOrColumn
+ class VCL_DLLPUBLIC LabelColumn : public RowOrColumn
{
long getLabelWidth() const;
public:
- LabelColumn( WindowArranger* i_pParent = NULL, long i_nBorderWidth = 5 )
+ LabelColumn( WindowArranger* i_pParent = NULL, long i_nBorderWidth = -1 )
: RowOrColumn( i_pParent, true, i_nBorderWidth )
{}
virtual ~LabelColumn();
@@ -289,10 +320,10 @@ namespace vcl
// returns the index of the added label
size_t addRow( Window* i_pLabel, boost::shared_ptr<WindowArranger> const& i_rElement, long i_nIndent = 0 );
- size_t addRow( Window* i_pLabel, Window* i_pElement, long i_nIndent = 0 );
+ size_t addRow( Window* i_pLabel, Window* i_pElement, long i_nIndent = 0, const Size& i_rElementMinSize = Size() );
};
- class Indenter : public WindowArranger
+ class VCL_DLLPUBLIC Indenter : public WindowArranger
{
long m_nIndent;
WindowArranger::Element m_aElement;
@@ -302,7 +333,7 @@ namespace vcl
{ return i_nIndex == 0 ? &m_aElement : NULL; }
public:
- Indenter( WindowArranger* i_pParent = NULL, long i_nIndent = 15 )
+ Indenter( WindowArranger* i_pParent = NULL, long i_nIndent = 3*getDefaultBorder() )
: WindowArranger( i_pParent )
, m_nIndent( i_nIndent )
{}
@@ -326,7 +357,7 @@ namespace vcl
{ setChild( boost::shared_ptr<WindowArranger>( i_pChild ), i_nExpandPrio ); }
};
- class Spacer : public WindowArranger
+ class VCL_DLLPUBLIC Spacer : public WindowArranger
{
WindowArranger::Element m_aElement;
Size m_aSize;
@@ -352,7 +383,7 @@ namespace vcl
virtual bool isVisible() const { return true; }
};
- class MatrixArranger : public WindowArranger
+ class VCL_DLLPUBLIC MatrixArranger : public WindowArranger
{
long m_nBorderX;
long m_nBorderY;
@@ -371,9 +402,10 @@ namespace vcl
MatrixElement( Window* i_pWin,
sal_uInt32 i_nX, sal_uInt32 i_nY,
boost::shared_ptr<WindowArranger> const & i_pChild = boost::shared_ptr<WindowArranger>(),
- sal_Int32 i_nExpandPriority = 0
+ sal_Int32 i_nExpandPriority = 0,
+ const Size& i_rMinSize = Size()
)
- : WindowArranger::Element( i_pWin, i_pChild, i_nExpandPriority )
+ : WindowArranger::Element( i_pWin, i_pChild, i_nExpandPriority, i_rMinSize )
, m_nX( i_nX )
, m_nY( i_nY )
{
@@ -386,15 +418,20 @@ namespace vcl
sal_uInt64 getMap( sal_uInt32 i_nX, sal_uInt32 i_nY )
{ return static_cast< sal_uInt64 >(i_nX) | (static_cast< sal_uInt64>(i_nY) << 32 ); }
- Size getOptimalSize( WindowSizeType, std::vector<long>& o_rColumnWidths, std::vector<long>& o_rRowHeights ) const;
+ static void distributeExtraSize( std::vector<long>& io_rSizes, const std::vector<sal_Int32>& i_rPrios, long i_nExtraWidth );
+
+ Size getOptimalSize( WindowSizeType,
+ std::vector<long>& o_rColumnWidths, std::vector<long>& o_rRowHeights,
+ std::vector<sal_Int32>& o_rColumnPrio, std::vector<sal_Int32>& o_rRowPrio
+ ) const;
protected:
virtual Element* getElement( size_t i_nIndex )
{ return i_nIndex < m_aElements.size() ? &m_aElements[ i_nIndex ] : 0; }
public:
MatrixArranger( WindowArranger* i_pParent = NULL,
- long i_nBorderX = 5,
- long i_nBorderY = 5 )
+ long i_nBorderX = -1,
+ long i_nBorderY = -1 )
: WindowArranger( i_pParent )
, m_nBorderX( i_nBorderX )
, m_nBorderY( i_nBorderY )
@@ -407,7 +444,7 @@ namespace vcl
virtual size_t countElements() const { return m_aElements.size(); }
// add a managed window at the given matrix position
- size_t addWindow( Window*, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio = 0 );
+ size_t addWindow( Window*, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio = 0, const Size& i_rMinSize = Size() );
void remove( Window* );
size_t addChild( boost::shared_ptr<WindowArranger> const &, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio = 0 );
diff --git a/vcl/inc/vcl/bitmap.hxx b/vcl/inc/vcl/bitmap.hxx
index 6127dca70510..d514977fda38 100644
--- a/vcl/inc/vcl/bitmap.hxx
+++ b/vcl/inc/vcl/bitmap.hxx
@@ -157,27 +157,27 @@ class VCL_DLLPUBLIC BmpFilterParam
private:
BmpFilter meFilter;
- ULONG mnProgressStart;
- ULONG mnProgressEnd;
+ sal_uLong mnProgressStart;
+ sal_uLong mnProgressEnd;
public:
struct MosaicTileSize
{
- ULONG mnTileWidth;
- ULONG mnTileHeight;
+ sal_uLong mnTileWidth;
+ sal_uLong mnTileHeight;
};
struct EmbossAngles
{
- USHORT mnAzimuthAngle100;
- USHORT mnElevationAngle100;
+ sal_uInt16 mnAzimuthAngle100;
+ sal_uInt16 mnElevationAngle100;
};
private:
union
{
- USHORT mnSepiaPercent;
- BYTE mcSolarGreyThreshold;
+ sal_uInt16 mnSepiaPercent;
+ sal_uInt8 mcSolarGreyThreshold;
MosaicTileSize maMosaicTileSize;
EmbossAngles maEmbossAngles;
@@ -185,25 +185,25 @@ private:
public:
- BmpFilterParam( ULONG nProgressStart = 0, ULONG nProgressEnd = 0 ) :
+ BmpFilterParam( sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
meFilter( BMP_FILTER_UNKNOWN ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd ) {}
- BmpFilterParam( BYTE cSolarGreyThreshold, ULONG nProgressStart = 0, ULONG nProgressEnd = 0 ) :
+ BmpFilterParam( sal_uInt8 cSolarGreyThreshold, sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
meFilter( BMP_FILTER_SOLARIZE ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd ),
mcSolarGreyThreshold( cSolarGreyThreshold ) {}
- BmpFilterParam( USHORT nSepiaPercent, ULONG nProgressStart = 0, ULONG nProgressEnd = 0 ) :
+ BmpFilterParam( sal_uInt16 nSepiaPercent, sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
meFilter( BMP_FILTER_SEPIA ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd ),
mnSepiaPercent( nSepiaPercent ) {}
- BmpFilterParam( const Size& rMosaicTileSize, ULONG nProgressStart = 0, ULONG nProgressEnd = 0 ) :
+ BmpFilterParam( const Size& rMosaicTileSize, sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
meFilter( BMP_FILTER_MOSAIC ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd )
{
maMosaicTileSize.mnTileWidth = rMosaicTileSize.Width();
maMosaicTileSize.mnTileHeight= rMosaicTileSize.Height();
}
- BmpFilterParam( USHORT nEmbossAzimuthAngle100, USHORT nEmbossElevationAngle100,
- ULONG nProgressStart = 0, ULONG nProgressEnd = 0 ) :
+ BmpFilterParam( sal_uInt16 nEmbossAzimuthAngle100, sal_uInt16 nEmbossElevationAngle100,
+ sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
meFilter( BMP_FILTER_EMBOSS_GREY ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd )
{
maEmbossAngles.mnAzimuthAngle100 = nEmbossAzimuthAngle100;
@@ -259,65 +259,65 @@ public:
SAL_DLLPRIVATE void ImplSetImpBitmap( ImpBitmap* pImpBmp );
SAL_DLLPRIVATE void ImplAssignWithSize( const Bitmap& rBitmap );
- SAL_DLLPRIVATE static BOOL ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, ULONG nOffset, BOOL bMSOFormat=FALSE );
- SAL_DLLPRIVATE static BOOL ImplReadDIBFileHeader( SvStream& rIStm, ULONG& rOffset );
- SAL_DLLPRIVATE static BOOL ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal_Bool& bTopDown, BOOL bMSOFormat = FALSE );
- SAL_DLLPRIVATE static BOOL ImplReadDIBPalette( SvStream& rIStm, BitmapWriteAccess& rAcc, BOOL bQuad );
- SAL_DLLPRIVATE static BOOL ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWriteAccess& rAcc, sal_Bool bTopDown );
- SAL_DLLPRIVATE BOOL ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bCompressed ) const;
- SAL_DLLPRIVATE static BOOL ImplWriteDIBFileHeader( SvStream& rOStm, BitmapReadAccess& rAcc );
- SAL_DLLPRIVATE static BOOL ImplWriteDIBPalette( SvStream& rOStm, BitmapReadAccess& rAcc );
- SAL_DLLPRIVATE static BOOL ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
- ULONG nCompression, sal_uInt32& rImageSize );
- SAL_DLLPRIVATE static void ImplDecodeRLE( BYTE* pBuffer, DIBInfoHeader& rHeader,
- BitmapWriteAccess& rAcc, BOOL bRLE4 );
- SAL_DLLPRIVATE static BOOL ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bRLE4 );
-
- SAL_DLLPRIVATE BOOL ImplScaleFast( const double& rScaleX, const double& rScaleY );
- SAL_DLLPRIVATE BOOL ImplScaleInterpolate( const double& rScaleX, const double& rScaleY );
- SAL_DLLPRIVATE BOOL ImplMakeMono( BYTE cThreshold );
- SAL_DLLPRIVATE BOOL ImplMakeMonoDither();
- SAL_DLLPRIVATE BOOL ImplMakeGreyscales( USHORT nGreyscales );
- SAL_DLLPRIVATE BOOL ImplConvertUp( USHORT nBitCount, Color* pExtColor = NULL );
- SAL_DLLPRIVATE BOOL ImplConvertDown( USHORT nBitCount, Color* pExtColor = NULL );
- SAL_DLLPRIVATE BOOL ImplConvertGhosted();
- SAL_DLLPRIVATE BOOL ImplDitherMatrix();
- SAL_DLLPRIVATE BOOL ImplDitherFloyd();
- SAL_DLLPRIVATE BOOL ImplDitherFloyd16();
- SAL_DLLPRIVATE BOOL ImplReduceSimple( USHORT nColorCount );
- SAL_DLLPRIVATE BOOL ImplReducePopular( USHORT nColorCount );
- SAL_DLLPRIVATE BOOL ImplReduceMedian( USHORT nColorCount );
- SAL_DLLPRIVATE void ImplMedianCut( ULONG* pColBuf, BitmapPalette& rPal,
+ SAL_DLLPRIVATE static sal_Bool ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, sal_uLong nOffset, sal_Bool bMSOFormat = sal_False );
+ SAL_DLLPRIVATE static sal_Bool ImplReadDIBFileHeader( SvStream& rIStm, sal_uLong& rOffset );
+ SAL_DLLPRIVATE static sal_Bool ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal_Bool& bTopDown, sal_Bool bMSOFormat = sal_False );
+ SAL_DLLPRIVATE static sal_Bool ImplReadDIBPalette( SvStream& rIStm, BitmapWriteAccess& rAcc, sal_Bool bQuad );
+ SAL_DLLPRIVATE static sal_Bool ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWriteAccess& rAcc, sal_Bool bTopDown );
+ SAL_DLLPRIVATE sal_Bool ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool bCompressed ) const;
+ SAL_DLLPRIVATE static sal_Bool ImplWriteDIBFileHeader( SvStream& rOStm, BitmapReadAccess& rAcc );
+ SAL_DLLPRIVATE static sal_Bool ImplWriteDIBPalette( SvStream& rOStm, BitmapReadAccess& rAcc );
+ SAL_DLLPRIVATE static sal_Bool ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
+ sal_uLong nCompression, sal_uInt32& rImageSize );
+ SAL_DLLPRIVATE static void ImplDecodeRLE( sal_uInt8* pBuffer, DIBInfoHeader& rHeader,
+ BitmapWriteAccess& rAcc, sal_Bool bRLE4 );
+ SAL_DLLPRIVATE static sal_Bool ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool bRLE4 );
+
+ SAL_DLLPRIVATE sal_Bool ImplScaleFast( const double& rScaleX, const double& rScaleY );
+ SAL_DLLPRIVATE sal_Bool ImplScaleInterpolate( const double& rScaleX, const double& rScaleY );
+ SAL_DLLPRIVATE sal_Bool ImplMakeMono( sal_uInt8 cThreshold );
+ SAL_DLLPRIVATE sal_Bool ImplMakeMonoDither();
+ SAL_DLLPRIVATE sal_Bool ImplMakeGreyscales( sal_uInt16 nGreyscales );
+ SAL_DLLPRIVATE sal_Bool ImplConvertUp( sal_uInt16 nBitCount, Color* pExtColor = NULL );
+ SAL_DLLPRIVATE sal_Bool ImplConvertDown( sal_uInt16 nBitCount, Color* pExtColor = NULL );
+ SAL_DLLPRIVATE sal_Bool ImplConvertGhosted();
+ SAL_DLLPRIVATE sal_Bool ImplDitherMatrix();
+ SAL_DLLPRIVATE sal_Bool ImplDitherFloyd();
+ SAL_DLLPRIVATE sal_Bool ImplDitherFloyd16();
+ SAL_DLLPRIVATE sal_Bool ImplReduceSimple( sal_uInt16 nColorCount );
+ SAL_DLLPRIVATE sal_Bool ImplReducePopular( sal_uInt16 nColorCount );
+ SAL_DLLPRIVATE sal_Bool ImplReduceMedian( sal_uInt16 nColorCount );
+ SAL_DLLPRIVATE void ImplMedianCut( sal_uLong* pColBuf, BitmapPalette& rPal,
long nR1, long nR2, long nG1, long nG2, long nB1, long nB2,
long nColors, long nPixels, long& rIndex );
- SAL_DLLPRIVATE BOOL ImplConvolute3( const long* pMatrix, long nDivisor,
+ SAL_DLLPRIVATE sal_Bool ImplConvolute3( const long* pMatrix, long nDivisor,
const BmpFilterParam* pFilterParam, const Link* pProgress );
- SAL_DLLPRIVATE BOOL ImplMedianFilter( const BmpFilterParam* pFilterParam, const Link* pProgress );
- SAL_DLLPRIVATE BOOL ImplSobelGrey( const BmpFilterParam* pFilterParam, const Link* pProgress );
- SAL_DLLPRIVATE BOOL ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link* pProgress );
- SAL_DLLPRIVATE BOOL ImplSolarize( const BmpFilterParam* pFilterParam, const Link* pProgress );
- SAL_DLLPRIVATE BOOL ImplSepia( const BmpFilterParam* pFilterParam, const Link* pProgress );
- SAL_DLLPRIVATE BOOL ImplMosaic( const BmpFilterParam* pFilterParam, const Link* pProgress );
- SAL_DLLPRIVATE BOOL ImplPopArt( const BmpFilterParam* pFilterParam, const Link* pProgress );
+ SAL_DLLPRIVATE sal_Bool ImplMedianFilter( const BmpFilterParam* pFilterParam, const Link* pProgress );
+ SAL_DLLPRIVATE sal_Bool ImplSobelGrey( const BmpFilterParam* pFilterParam, const Link* pProgress );
+ SAL_DLLPRIVATE sal_Bool ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link* pProgress );
+ SAL_DLLPRIVATE sal_Bool ImplSolarize( const BmpFilterParam* pFilterParam, const Link* pProgress );
+ SAL_DLLPRIVATE sal_Bool ImplSepia( const BmpFilterParam* pFilterParam, const Link* pProgress );
+ SAL_DLLPRIVATE sal_Bool ImplMosaic( const BmpFilterParam* pFilterParam, const Link* pProgress );
+ SAL_DLLPRIVATE sal_Bool ImplPopArt( const BmpFilterParam* pFilterParam, const Link* pProgress );
public:
Bitmap();
Bitmap( const Bitmap& rBitmap );
- Bitmap( const Size& rSizePixel, USHORT nBitCount, const BitmapPalette* pPal = NULL );
+ Bitmap( const Size& rSizePixel, sal_uInt16 nBitCount, const BitmapPalette* pPal = NULL );
Bitmap( const ResId& rResId );
Bitmap( SalBitmap* pSalBitmap );
~Bitmap();
Bitmap& operator=( const Bitmap& rBitmap );
- inline BOOL operator!() const;
- inline BOOL operator==( const Bitmap& rBitmap ) const;
- inline BOOL operator!=( const Bitmap& rBitmap ) const;
+ inline sal_Bool operator!() const;
+ inline sal_Bool operator==( const Bitmap& rBitmap ) const;
+ inline sal_Bool operator!=( const Bitmap& rBitmap ) const;
- inline BOOL IsSameInstance( const Bitmap& rBmp ) const;
- BOOL IsEqual( const Bitmap& rBmp ) const;
+ inline sal_Bool IsSameInstance( const Bitmap& rBmp ) const;
+ sal_Bool IsEqual( const Bitmap& rBmp ) const;
- inline BOOL IsEmpty() const;
+ inline sal_Bool IsEmpty() const;
void SetEmpty();
inline const MapMode& GetPrefMapMode() const;
@@ -338,20 +338,20 @@ public:
void SetSourceSizePixel( const Size& );
- USHORT GetBitCount() const;
- inline ULONG GetColorCount() const;
- inline ULONG GetSizeBytes() const;
- BOOL HasGreyPalette() const;
+ sal_uInt16 GetBitCount() const;
+ inline sal_uLong GetColorCount() const;
+ inline sal_uLong GetSizeBytes() const;
+ sal_Bool HasGreyPalette() const;
/** get system dependent bitmap data
@param rData
The system dependent BitmapSystemData structure to be filled
- @return TRUE if the bitmap has a valid system object (e.g. not empty)
+ @return sal_True if the bitmap has a valid system object (e.g. not empty)
*/
bool GetSystemData( BitmapSystemData& rData ) const;
- ULONG GetChecksum() const;
+ sal_uLong GetChecksum() const;
Bitmap CreateDisplayBitmap( OutputDevice* pDisplay );
Bitmap GetColorTransformedBitmap() const;
@@ -360,7 +360,7 @@ public:
public:
- BOOL MakeMono( BYTE cThreshold );
+ sal_Bool MakeMono( sal_uInt8 cThreshold );
/** Convert bitmap format
@@ -368,9 +368,9 @@ public:
@param eConversion
The format this bitmap should be converted to.
- @return TRUE, if the conversion was completed successfully.
+ @return sal_True, if the conversion was completed successfully.
*/
- BOOL Convert( BmpConversion eConversion );
+ sal_Bool Convert( BmpConversion eConversion );
/** Reduce number of colors for the bitmap
@@ -380,9 +380,9 @@ public:
@param eReduce
Algorithm to use for color reduction
- @return TRUE, if the color reduction operation was completed successfully.
+ @return sal_True, if the color reduction operation was completed successfully.
*/
- BOOL ReduceColors( USHORT nNewColorCount,
+ sal_Bool ReduceColors( sal_uInt16 nNewColorCount,
BmpReduce eReduce = BMP_REDUCE_SIMPLE );
/** Apply a dither algorithm to the bitmap
@@ -397,7 +397,7 @@ public:
@param pDitherPal
A custom palette to be used when dithering (not yet implemented, leave NULL)
*/
- BOOL Dither( ULONG nDitherFlags = BMP_DITHER_MATRIX );
+ sal_Bool Dither( sal_uLong nDitherFlags = BMP_DITHER_MATRIX );
/** Crop the bitmap
@@ -409,11 +409,11 @@ public:
dimension, i.e. negative left,top rectangle coordinates or
exceeding width or height is ignored.
- @return TRUE, if cropping was performed successfully. If
+ @return sal_True, if cropping was performed successfully. If
nothing had to be cropped, because e.g. the crop rectangle
- included the bitmap, FALSE is returned, too!
+ included the bitmap, sal_False is returned, too!
*/
- BOOL Crop( const Rectangle& rRectPixel );
+ sal_Bool Crop( const Rectangle& rRectPixel );
/** Expand the bitmap by pixel padding
@@ -426,11 +426,11 @@ public:
@param pInitColor
Color to use for padded pixel
- @return TRUE, if padding was performed successfully. FALSE is
+ @return sal_True, if padding was performed successfully. sal_False is
not only returned when the operation failed, but also if
nothing had to be done, e.g. because nDX and nDY were zero.
*/
- BOOL Expand( ULONG nDX, ULONG nDY,
+ sal_Bool Expand( sal_uLong nDX, sal_uLong nDY,
const Color* pInitColor = NULL );
/** Copy a rectangular area from another bitmap
@@ -450,12 +450,12 @@ public:
equal to the object this method is called on, copying takes
place within the same bitmap.
- @return TRUE, if the operation completed successfully. FALSE
+ @return sal_True, if the operation completed successfully. sal_False
is not only returned when the operation failed, but also if
nothing had to be done, e.g. because one of the rectangles are
empty.
*/
- BOOL CopyPixel( const Rectangle& rRectDst,
+ sal_Bool CopyPixel( const Rectangle& rRectDst,
const Rectangle& rRectSrc,
const Bitmap* pBmpSrc = NULL );
@@ -467,9 +467,9 @@ public:
@param eCombine
The combine operation to perform on the bitmap
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL CombineSimple( const Bitmap& rMask,
+ sal_Bool CombineSimple( const Bitmap& rMask,
BmpCombine eCombine );
/** Alpha-blend the given bitmap against a specified uniform
@@ -486,9 +486,9 @@ public:
@param rBackgroundColor
Background color to use for every pixel during alpha blending
- @return TRUE, if blending was successful, FALSE otherwise
+ @return sal_True, if blending was successful, sal_False otherwise
*/
- BOOL Blend( const AlphaMask& rAlpha,
+ sal_Bool Blend( const AlphaMask& rAlpha,
const Color& rBackgroundColor );
/** Fill the entire bitmap with the given color
@@ -496,24 +496,24 @@ public:
@param rFillColor
Color value to use for filling
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Erase( const Color& rFillColor );
+ sal_Bool Erase( const Color& rFillColor );
/** Perform the Invert operation on every pixel
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Invert();
+ sal_Bool Invert();
/** Mirror the bitmap
@param nMirrorFlags
About which axis (horizontal, vertical, or both) to mirror
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Mirror( ULONG nMirrorFlags );
+ sal_Bool Mirror( sal_uLong nMirrorFlags );
/** Scale the bitmap
@@ -523,10 +523,10 @@ public:
@param nScaleFlag
The algorithm to be used for scaling
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Scale( const Size& rNewSize,
- ULONG nScaleFlag = BMP_SCALE_FAST );
+ sal_Bool Scale( const Size& rNewSize,
+ sal_uLong nScaleFlag = BMP_SCALE_FAST );
/** Scale the bitmap
@@ -536,10 +536,10 @@ public:
@param rScaleY
The scale factor in y direction.
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Scale( const double& rScaleX, const double& rScaleY,
- ULONG nScaleFlag = BMP_SCALE_FAST );
+ sal_Bool Scale( const double& rScaleX, const double& rScaleY,
+ sal_uLong nScaleFlag = BMP_SCALE_FAST );
/** Rotate bitmap by the specified angle
@@ -552,9 +552,9 @@ public:
in. The empty spaces around that rotated original bitmap are
then filled with this color.
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Rotate( long nAngle10, const Color& rFillColor );
+ sal_Bool Rotate( long nAngle10, const Color& rFillColor );
/** Create on-off mask from bitmap
@@ -572,7 +572,7 @@ public:
@return the resulting bitmask.
*/
- Bitmap CreateMask( const Color& rTransColor, ULONG nTol = 0UL ) const;
+ Bitmap CreateMask( const Color& rTransColor, sal_uLong nTol = 0UL ) const;
/** Create region of similar colors in a given rectangle
@@ -595,9 +595,9 @@ public:
@param rReplaceColor
Color to be placed in all changed pixel
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Replace( const Bitmap& rMask, const Color& rReplaceColor );
+ sal_Bool Replace( const Bitmap& rMask, const Color& rReplaceColor );
/** Merge bitmap with given background color according to specified alpha mask
@@ -607,9 +607,9 @@ public:
@param rMergeColor
Background color to be used for merging
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Replace( const AlphaMask& rAlpha, const Color& rMergeColor );
+ sal_Bool Replace( const AlphaMask& rAlpha, const Color& rMergeColor );
/** Replace all pixel having the search color with the specified color
@@ -624,9 +624,9 @@ public:
rSearchColor and the individual pixel values, such that the
corresponding pixel is still regarded a match.
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Replace( const Color& rSearchColor, const Color& rReplaceColor, ULONG nTol = 0 );
+ sal_Bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol = 0 );
/** Replace all pixel having one the search colors with the corresponding replace color
@@ -644,10 +644,10 @@ public:
pSearchColor colors and the individual pixel values, such that
the corresponding pixel is still regarded a match.
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Replace( const Color* pSearchColors, const Color* rReplaceColors,
- ULONG nColorCount, ULONG* pTols = NULL );
+ sal_Bool Replace( const Color* pSearchColors, const Color* rReplaceColors,
+ sal_uLong nColorCount, sal_uLong* pTols = NULL );
/** Convert the bitmap to a PolyPolygon
@@ -664,10 +664,10 @@ public:
@param pProgress
A callback for showing the progress of the vectorization
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Vectorize( PolyPolygon& rPolyPoly,
- ULONG nFlags = BMP_VECTORIZE_OUTER,
+ sal_Bool Vectorize( PolyPolygon& rPolyPoly,
+ sal_uLong nFlags = BMP_VECTORIZE_OUTER,
const Link* pProgress = NULL );
/** Convert the bitmap to a meta file
@@ -689,10 +689,10 @@ public:
@param pProgress
A callback for showing the progress of the vectorization
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Vectorize( GDIMetaFile& rMtf, BYTE cReduce = 0,
- ULONG nFlags = BMP_VECTORIZE_INNER,
+ sal_Bool Vectorize( GDIMetaFile& rMtf, sal_uInt8 cReduce = 0,
+ sal_uLong nFlags = BMP_VECTORIZE_INNER,
const Link* pProgress = NULL );
/** Change various global color characteristics
@@ -718,17 +718,17 @@ public:
(0.0,10.0]. Values outside this range are regarded as 1.0.
@param bInvert
- If TRUE, invert the channel values with the logical 'not' operator
+ If sal_True, invert the channel values with the logical 'not' operator
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Adjust( short nLuminancePercent = 0,
+ sal_Bool Adjust( short nLuminancePercent = 0,
short nContrastPercent = 0,
short nChannelRPercent = 0,
short nChannelGPercent = 0,
short nChannelBPercent = 0,
double fGamma = 1.0,
- BOOL bInvert = FALSE );
+ sal_Bool bInvert = sal_False );
/** Apply specified filter to the bitmap
@@ -741,9 +741,9 @@ public:
@param pProgress
A callback for showing the progress of the vectorization
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Filter( BmpFilter eFilter,
+ sal_Bool Filter( BmpFilter eFilter,
const BmpFilterParam* pFilterParam = NULL,
const Link* pProgress = NULL );
@@ -754,8 +754,8 @@ public:
public:
- BOOL Read( SvStream& rIStm, BOOL bFileHeader = TRUE, BOOL bMSOFormat = FALSE );
- BOOL Write( SvStream& rOStm, BOOL bCompressed = TRUE, BOOL bFileHeader = TRUE ) const;
+ sal_Bool Read( SvStream& rIStm, sal_Bool bFileHeader = sal_True, sal_Bool bMSOFormat = sal_False );
+ sal_Bool Write( SvStream& rOStm, sal_Bool bCompressed = sal_True, sal_Bool bFileHeader = sal_True ) const;
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Bitmap& rBitmap );
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Bitmap& rBitmap );
@@ -765,35 +765,35 @@ public:
// - Inlines -
// -----------
-inline BOOL Bitmap::operator!() const
+inline sal_Bool Bitmap::operator!() const
{
return( mpImpBmp == NULL );
}
// ------------------------------------------------------------------
-inline BOOL Bitmap::operator==( const Bitmap& rBitmap ) const
+inline sal_Bool Bitmap::operator==( const Bitmap& rBitmap ) const
{
return( rBitmap.mpImpBmp == mpImpBmp );
}
// ------------------------------------------------------------------
-inline BOOL Bitmap::operator!=( const Bitmap& rBitmap ) const
+inline sal_Bool Bitmap::operator!=( const Bitmap& rBitmap ) const
{
return( rBitmap.mpImpBmp != mpImpBmp );
}
// ------------------------------------------------------------------
-inline BOOL Bitmap::IsSameInstance( const Bitmap& rBitmap ) const
+inline sal_Bool Bitmap::IsSameInstance( const Bitmap& rBitmap ) const
{
return( rBitmap.mpImpBmp == mpImpBmp );
}
// ------------------------------------------------------------------
-inline BOOL Bitmap::IsEmpty() const
+inline sal_Bool Bitmap::IsEmpty() const
{
return( mpImpBmp == NULL );
}
@@ -828,17 +828,17 @@ inline void Bitmap::SetPrefSize( const Size& rSize )
// ------------------------------------------------------------------
-inline ULONG Bitmap::GetColorCount() const
+inline sal_uLong Bitmap::GetColorCount() const
{
- return( 1UL << (ULONG) GetBitCount() );
+ return( 1UL << (sal_uLong) GetBitCount() );
}
// ------------------------------------------------------------------
-inline ULONG Bitmap::GetSizeBytes() const
+inline sal_uLong Bitmap::GetSizeBytes() const
{
const Size aSizePix( GetSizePixel() );
- return( ( (ULONG) aSizePix.Width() * aSizePix.Height() * GetBitCount() ) >> 3UL );
+ return( ( (sal_uLong) aSizePix.Width() * aSizePix.Height() * GetBitCount() ) >> 3UL );
}
#endif // _SV_BITMAP_HXX
diff --git a/vcl/inc/vcl/bitmapex.hxx b/vcl/inc/vcl/bitmapex.hxx
index 965f9e611818..9a6259fa61eb 100644
--- a/vcl/inc/vcl/bitmapex.hxx
+++ b/vcl/inc/vcl/bitmapex.hxx
@@ -60,7 +60,7 @@ private:
Size aBitmapSize;
Color aTransparentColor;
TransparentType eTransparent;
- BOOL bAlpha;
+ sal_Bool bAlpha;
public:
@@ -81,13 +81,13 @@ public:
~BitmapEx();
BitmapEx& operator=( const BitmapEx& rBitmapEx );
- BOOL operator==( const BitmapEx& rBitmapEx ) const;
- BOOL operator!=( const BitmapEx& rBitmapEx ) const { return !(*this==rBitmapEx); }
- BOOL operator!() const { return !aBitmap; }
+ sal_Bool operator==( const BitmapEx& rBitmapEx ) const;
+ sal_Bool operator!=( const BitmapEx& rBitmapEx ) const { return !(*this==rBitmapEx); }
+ sal_Bool operator!() const { return !aBitmap; }
- BOOL IsEqual( const BitmapEx& rBmpEx ) const;
+ sal_Bool IsEqual( const BitmapEx& rBmpEx ) const;
- BOOL IsEmpty() const;
+ sal_Bool IsEmpty() const;
void SetEmpty();
void Clear();
@@ -99,7 +99,7 @@ public:
const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel ) const;
- BOOL IsTransparent() const;
+ sal_Bool IsTransparent() const;
TransparentType GetTransparentType() const { return eTransparent; }
Bitmap GetBitmap( const Color* pTransReplaceColor = NULL ) const;
@@ -107,7 +107,7 @@ public:
BitmapEx GetColorTransformedBitmapEx() const;
- BOOL IsAlpha() const;
+ sal_Bool IsAlpha() const;
AlphaMask GetAlpha() const;
const Size& GetSizePixel() const { return aBitmapSize; }
@@ -122,9 +122,9 @@ public:
const Color& GetTransparentColor() const { return aTransparentColor; }
void SetTransparentColor( const Color& rColor ) { aTransparentColor = rColor; }
- USHORT GetBitCount() const { return aBitmap.GetBitCount(); }
- ULONG GetSizeBytes() const;
- ULONG GetChecksum() const;
+ sal_uInt16 GetBitCount() const { return aBitmap.GetBitCount(); }
+ sal_uLong GetSizeBytes() const;
+ sal_uLong GetChecksum() const;
public:
@@ -133,9 +133,9 @@ public:
@param eConversion
The format this bitmap should be converted to.
- @return TRUE, if the conversion was completed successfully.
+ @return sal_True, if the conversion was completed successfully.
*/
- BOOL Convert( BmpConversion eConversion );
+ sal_Bool Convert( BmpConversion eConversion );
/** Reduce number of colors for the bitmap
@@ -145,9 +145,9 @@ public:
@param eReduce
Algorithm to use for color reduction
- @return TRUE, if the color reduction operation was completed successfully.
+ @return sal_True, if the color reduction operation was completed successfully.
*/
- BOOL ReduceColors( USHORT nNewColorCount,
+ sal_Bool ReduceColors( sal_uInt16 nNewColorCount,
BmpReduce eReduce = BMP_REDUCE_SIMPLE );
/** Apply a dither algorithm to the bitmap
@@ -159,7 +159,7 @@ public:
@param nDitherFlags
The algorithm to be used for dithering
*/
- BOOL Dither( ULONG nDitherFlags = BMP_DITHER_MATRIX );
+ sal_Bool Dither( sal_uLong nDitherFlags = BMP_DITHER_MATRIX );
/** Crop the bitmap
@@ -171,11 +171,11 @@ public:
dimension, i.e. negative left,top rectangle coordinates or
exceeding width or height is ignored.
- @return TRUE, if cropping was performed successfully. If
+ @return sal_True, if cropping was performed successfully. If
nothing had to be cropped, because e.g. the crop rectangle
- included the bitmap, FALSE is returned, too!
+ included the bitmap, sal_False is returned, too!
*/
- BOOL Crop( const Rectangle& rRectPixel );
+ sal_Bool Crop( const Rectangle& rRectPixel );
/** Expand the bitmap by pixel padding
@@ -188,13 +188,13 @@ public:
@param pInitColor
Color to use for padded pixel
- @return TRUE, if padding was performed successfully. FALSE is
+ @return sal_True, if padding was performed successfully. sal_False is
not only returned when the operation failed, but also if
nothing had to be done, e.g. because nDX and nDY were zero.
*/
- BOOL Expand( ULONG nDX, ULONG nDY,
+ sal_Bool Expand( sal_uLong nDX, sal_uLong nDY,
const Color* pInitColor = NULL,
- BOOL bExpandTransparent = FALSE );
+ sal_Bool bExpandTransparent = sal_False );
/** Copy a rectangular area from another bitmap
@@ -213,12 +213,12 @@ public:
equal to the object this method is called on, copying takes
place within the same bitmap.
- @return TRUE, if the operation completed successfully. FALSE
+ @return sal_True, if the operation completed successfully. sal_False
is not only returned when the operation failed, but also if
nothing had to be done, e.g. because one of the rectangles are
empty.
*/
- BOOL CopyPixel( const Rectangle& rRectDst,
+ sal_Bool CopyPixel( const Rectangle& rRectDst,
const Rectangle& rRectSrc,
const BitmapEx* pBmpExSrc = NULL );
@@ -228,24 +228,24 @@ public:
Color value to use for filling. Set the transparency part of
the color to fill the mask.
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Erase( const Color& rFillColor );
+ sal_Bool Erase( const Color& rFillColor );
/** Perform the Invert operation on every pixel
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Invert();
+ sal_Bool Invert();
/** Mirror the bitmap
@param nMirrorFlags
About which axis (horizontal, vertical, or both) to mirror
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Mirror( ULONG nMirrorFlags );
+ sal_Bool Mirror( sal_uLong nMirrorFlags );
/** Scale the bitmap
@@ -255,9 +255,9 @@ public:
@param nScaleFlag
The algorithm to be used for scaling
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Scale( const Size& rNewSize, ULONG nScaleFlag = BMP_SCALE_FAST );
+ sal_Bool Scale( const Size& rNewSize, sal_uLong nScaleFlag = BMP_SCALE_FAST );
/** Scale the bitmap
@@ -267,9 +267,9 @@ public:
@param rScaleY
The scale factor in y direction.
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Scale( const double& rScaleX, const double& rScaleY, ULONG nScaleFlag = BMP_SCALE_FAST );
+ sal_Bool Scale( const double& rScaleX, const double& rScaleY, sal_uLong nScaleFlag = BMP_SCALE_FAST );
/** Rotate bitmap by the specified angle
@@ -282,9 +282,9 @@ public:
in. The empty spaces around that rotated original bitmap are
then filled with this color.
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Rotate( long nAngle10, const Color& rFillColor );
+ sal_Bool Rotate( long nAngle10, const Color& rFillColor );
/** Replace all pixel having the search color with the specified color
@@ -299,9 +299,9 @@ public:
rSearchColor and the individual pixel values, such that the
corresponding pixel is still regarded a match.
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Replace( const Color& rSearchColor, const Color& rReplaceColor, ULONG nTol = 0 );
+ sal_Bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol = 0 );
/** Replace all pixel having one the search colors with the corresponding replace color
@@ -319,10 +319,10 @@ public:
pSearchColor colors and the individual pixel values, such that
the corresponding pixel is still regarded a match.
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Replace( const Color* pSearchColors, const Color* pReplaceColors,
- ULONG nColorCount, const ULONG* pTols = NULL );
+ sal_Bool Replace( const Color* pSearchColors, const Color* pReplaceColors,
+ sal_uLong nColorCount, const sal_uLong* pTols = NULL );
/** Change various global color characteristics
@@ -347,17 +347,17 @@ public:
(0.0,10.0]. Values outside this range are regarded as 1.0.
@param bInvert
- If TRUE, invert the channel values with the logical 'not' operator
+ If sal_True, invert the channel values with the logical 'not' operator
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Adjust( short nLuminancePercent = 0,
+ sal_Bool Adjust( short nLuminancePercent = 0,
short nContrastPercent = 0,
short nChannelRPercent = 0,
short nChannelGPercent = 0,
short nChannelBPercent = 0,
double fGamma = 1.0,
- BOOL bInvert = FALSE );
+ sal_Bool bInvert = sal_False );
/** Apply specified filter to the bitmap
@@ -370,9 +370,9 @@ public:
@param pProgress
A callback for showing the progress of the vectorization
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Filter( BmpFilter eFilter,
+ sal_Bool Filter( BmpFilter eFilter,
const BmpFilterParam* pFilterParam = NULL,
const Link* pProgress = NULL );
diff --git a/vcl/inc/vcl/bmpacc.hxx b/vcl/inc/vcl/bmpacc.hxx
index e3530b786e65..650a60a69077 100644
--- a/vcl/inc/vcl/bmpacc.hxx
+++ b/vcl/inc/vcl/bmpacc.hxx
@@ -98,12 +98,12 @@ protected:
ColorMask maColorMask;
FncGetPixel mFncGetPixel;
FncSetPixel mFncSetPixel;
- BOOL mbModify;
+ sal_Bool mbModify;
SAL_DLLPRIVATE void ImplCreate( Bitmap& rBitmap );
SAL_DLLPRIVATE void ImplDestroy();
-SAL_DLLPRIVATE BOOL ImplSetAccessPointers( ULONG nFormat );
+SAL_DLLPRIVATE sal_Bool ImplSetAccessPointers( sal_uLong nFormat );
public:
@@ -127,49 +127,49 @@ SAL_DLLPRIVATE BitmapBuffer* ImplGetBitmapBuffer() const { return mpBuffer; }
DECL_FORMAT( _32BIT_TC_RGBA )
DECL_FORMAT( _32BIT_TC_MASK )
protected:
- BitmapReadAccess( Bitmap& rBitmap, BOOL bModify );
+ BitmapReadAccess( Bitmap& rBitmap, sal_Bool bModify );
void Flush();
- void ReAccess( BOOL bModify );
+ void ReAccess( sal_Bool bModify );
public:
BitmapReadAccess( Bitmap& rBitmap );
virtual ~BitmapReadAccess();
- inline BOOL operator!() const;
+ inline sal_Bool operator!() const;
inline long Width() const;
inline long Height() const;
inline Point TopLeft() const;
inline Point BottomRight() const;
- inline BOOL IsTopDown() const;
- inline BOOL IsBottomUp() const;
+ inline sal_Bool IsTopDown() const;
+ inline sal_Bool IsBottomUp() const;
- inline ULONG GetScanlineFormat() const;
- inline ULONG GetScanlineSize() const;
+ inline sal_uLong GetScanlineFormat() const;
+ inline sal_uLong GetScanlineSize() const;
- inline USHORT GetBitCount() const;
+ inline sal_uInt16 GetBitCount() const;
inline BitmapColor GetBestMatchingColor( const BitmapColor& rBitmapColor );
inline Scanline GetBuffer() const;
inline Scanline GetScanline( long nY ) const;
- inline BOOL HasPalette() const;
+ inline sal_Bool HasPalette() const;
inline const BitmapPalette& GetPalette() const;
- inline USHORT GetPaletteEntryCount() const;
- inline const BitmapColor& GetPaletteColor( USHORT nColor ) const;
+ inline sal_uInt16 GetPaletteEntryCount() const;
+ inline const BitmapColor& GetPaletteColor( sal_uInt16 nColor ) const;
inline const BitmapColor& GetBestPaletteColor( const BitmapColor& rBitmapColor ) const;
- USHORT GetBestPaletteIndex( const BitmapColor& rBitmapColor ) const;
+ sal_uInt16 GetBestPaletteIndex( const BitmapColor& rBitmapColor ) const;
- inline BOOL HasColorMask() const;
+ inline sal_Bool HasColorMask() const;
inline ColorMask& GetColorMask() const;
- inline BitmapColor GetPixelFromData( const BYTE* pData, long nX ) const;
- inline void SetPixelOnData( BYTE* pData, long nX, const BitmapColor& rBitmapColor );
+ inline BitmapColor GetPixelFromData( const sal_uInt8* pData, long nX ) const;
+ inline void SetPixelOnData( sal_uInt8* pData, long nX, const BitmapColor& rBitmapColor );
inline BitmapColor GetPixel( long nY, long nX ) const;
inline BitmapColor GetColor( long nY, long nX ) const;
- inline BYTE GetLuminance( long nY, long nX ) const;
+ inline sal_uInt8 GetLuminance( long nY, long nX ) const;
};
// ---------------------
@@ -185,13 +185,13 @@ public:
void CopyScanline( long nY, const BitmapReadAccess& rReadAcc );
void CopyScanline( long nY, ConstScanline aSrcScanline,
- ULONG nSrcScanlineFormat, ULONG nSrcScanlineSize );
+ sal_uLong nSrcScanlineFormat, sal_uLong nSrcScanlineSize );
void CopyBuffer( const BitmapReadAccess& rReadAcc );
inline void SetPalette( const BitmapPalette& rPalette );
- inline void SetPaletteEntryCount( USHORT nCount );
- inline void SetPaletteColor( USHORT nColor, const BitmapColor& rBitmapColor );
+ inline void SetPaletteEntryCount( sal_uInt16 nCount );
+ inline void SetPaletteColor( sal_uInt16 nColor, const BitmapColor& rBitmapColor );
inline void SetPixel( long nY, long nX, const BitmapColor& rBitmapColor );
@@ -296,7 +296,7 @@ typedef ScopedBitmapAccess< BitmapWriteAccess > ScopedBitmapWriteAccess;
// - Inlines -
// -----------
-inline BOOL BitmapReadAccess::operator!() const
+inline sal_Bool BitmapReadAccess::operator!() const
{
return( mpBuffer == NULL );
}
@@ -331,22 +331,22 @@ inline Point BitmapReadAccess::BottomRight() const
// ------------------------------------------------------------------
-inline BOOL BitmapReadAccess::IsTopDown() const
+inline sal_Bool BitmapReadAccess::IsTopDown() const
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
- return( mpBuffer ? sal::static_int_cast<BOOL>( BMP_SCANLINE_ADJUSTMENT( mpBuffer->mnFormat ) == BMP_FORMAT_TOP_DOWN ) : FALSE );
+ return( mpBuffer ? sal::static_int_cast<sal_Bool>( BMP_SCANLINE_ADJUSTMENT( mpBuffer->mnFormat ) == BMP_FORMAT_TOP_DOWN ) : sal_False );
}
// ------------------------------------------------------------------
-inline BOOL BitmapReadAccess::IsBottomUp() const
+inline sal_Bool BitmapReadAccess::IsBottomUp() const
{
return !IsTopDown();
}
// ------------------------------------------------------------------
-inline ULONG BitmapReadAccess::GetScanlineFormat() const
+inline sal_uLong BitmapReadAccess::GetScanlineFormat() const
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
return( mpBuffer ? BMP_SCANLINE_FORMAT( mpBuffer->mnFormat ) : 0UL );
@@ -354,7 +354,7 @@ inline ULONG BitmapReadAccess::GetScanlineFormat() const
// ------------------------------------------------------------------
-inline ULONG BitmapReadAccess::GetScanlineSize() const
+inline sal_uLong BitmapReadAccess::GetScanlineSize() const
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
return( mpBuffer ? mpBuffer->mnScanlineSize : 0UL );
@@ -362,7 +362,7 @@ inline ULONG BitmapReadAccess::GetScanlineSize() const
// ------------------------------------------------------------------
-inline USHORT BitmapReadAccess::GetBitCount() const
+inline sal_uInt16 BitmapReadAccess::GetBitCount() const
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
return( mpBuffer ? mpBuffer->mnBitCount : 0 );
@@ -373,7 +373,7 @@ inline USHORT BitmapReadAccess::GetBitCount() const
inline BitmapColor BitmapReadAccess::GetBestMatchingColor( const BitmapColor& rBitmapColor )
{
if( HasPalette() )
- return BitmapColor( (BYTE) GetBestPaletteIndex( rBitmapColor ) );
+ return BitmapColor( (sal_uInt8) GetBestPaletteIndex( rBitmapColor ) );
else
return rBitmapColor;
}
@@ -397,7 +397,7 @@ inline Scanline BitmapReadAccess::GetScanline( long nY ) const
// ------------------------------------------------------------------
-inline BOOL BitmapReadAccess::HasPalette() const
+inline sal_Bool BitmapReadAccess::HasPalette() const
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
return( mpBuffer && !!mpBuffer->maPalette );
@@ -413,7 +413,7 @@ inline const BitmapPalette& BitmapReadAccess::GetPalette() const
// ------------------------------------------------------------------
-inline USHORT BitmapReadAccess::GetPaletteEntryCount() const
+inline sal_uInt16 BitmapReadAccess::GetPaletteEntryCount() const
{
DBG_ASSERT( HasPalette(), "Bitmap has no palette!" );
return( HasPalette() ? mpBuffer->maPalette.GetEntryCount() : 0 );
@@ -421,7 +421,7 @@ inline USHORT BitmapReadAccess::GetPaletteEntryCount() const
// ------------------------------------------------------------------
-inline const BitmapColor& BitmapReadAccess::GetPaletteColor( USHORT nColor ) const
+inline const BitmapColor& BitmapReadAccess::GetPaletteColor( sal_uInt16 nColor ) const
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
DBG_ASSERT( HasPalette(), "Bitmap has no palette!" );
@@ -437,10 +437,10 @@ inline const BitmapColor& BitmapReadAccess::GetBestPaletteColor( const BitmapCol
// ------------------------------------------------------------------
-inline BOOL BitmapReadAccess::HasColorMask() const
+inline sal_Bool BitmapReadAccess::HasColorMask() const
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
- const ULONG nFormat = BMP_SCANLINE_FORMAT( mpBuffer->mnFormat );
+ const sal_uLong nFormat = BMP_SCANLINE_FORMAT( mpBuffer->mnFormat );
return( nFormat == BMP_FORMAT_8BIT_TC_MASK ||
nFormat == BMP_FORMAT_16BIT_TC_MSB_MASK ||
@@ -469,7 +469,7 @@ inline BitmapColor BitmapReadAccess::GetPixel( long nY, long nX ) const
// ------------------------------------------------------------------
-inline BitmapColor BitmapReadAccess::GetPixelFromData( const BYTE* pData, long nX ) const
+inline BitmapColor BitmapReadAccess::GetPixelFromData( const sal_uInt8* pData, long nX ) const
{
DBG_ASSERT( pData, "Access is not valid!" );
return mFncGetPixel( pData, nX, maColorMask );
@@ -477,7 +477,7 @@ inline BitmapColor BitmapReadAccess::GetPixelFromData( const BYTE* pData, long n
// ------------------------------------------------------------------
-inline void BitmapReadAccess::SetPixelOnData( BYTE* pData, long nX, const BitmapColor& rBitmapColor )
+inline void BitmapReadAccess::SetPixelOnData( sal_uInt8* pData, long nX, const BitmapColor& rBitmapColor )
{
DBG_ASSERT( pData, "Access is not valid!" );
mFncSetPixel( pData, nX, rBitmapColor, maColorMask );
@@ -498,7 +498,7 @@ inline BitmapColor BitmapReadAccess::GetColor( long nY, long nX ) const
// ------------------------------------------------------------------
-inline BYTE BitmapReadAccess::GetLuminance( long nY, long nX ) const
+inline sal_uInt8 BitmapReadAccess::GetLuminance( long nY, long nX ) const
{
return GetColor( nY, nX ).GetLuminance();
}
@@ -513,7 +513,7 @@ inline void BitmapWriteAccess::SetPalette( const BitmapPalette& rPalette )
// ------------------------------------------------------------------
-inline void BitmapWriteAccess::SetPaletteEntryCount( USHORT nCount )
+inline void BitmapWriteAccess::SetPaletteEntryCount( sal_uInt16 nCount )
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
mpBuffer->maPalette.SetEntryCount( nCount );
@@ -521,7 +521,7 @@ inline void BitmapWriteAccess::SetPaletteEntryCount( USHORT nCount )
// ------------------------------------------------------------------
-inline void BitmapWriteAccess::SetPaletteColor( USHORT nColor, const BitmapColor& rBitmapColor )
+inline void BitmapWriteAccess::SetPaletteColor( sal_uInt16 nColor, const BitmapColor& rBitmapColor )
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
DBG_ASSERT( HasPalette(), "Bitmap has no palette!" );
diff --git a/vcl/inc/vcl/brdwin.hxx b/vcl/inc/vcl/brdwin.hxx
index 016e50e1366e..e6374ea032f5 100644
--- a/vcl/inc/vcl/brdwin.hxx
+++ b/vcl/inc/vcl/brdwin.hxx
@@ -38,39 +38,39 @@ class ImplBorderWindowView;
// - ImplBorderWindow-Types -
// --------------------------
-#define BORDERWINDOW_STYLE_OVERLAP ((USHORT)0x0001)
-#define BORDERWINDOW_STYLE_BORDER ((USHORT)0x0002)
-#define BORDERWINDOW_STYLE_FLOAT ((USHORT)0x0004)
-#define BORDERWINDOW_STYLE_FRAME ((USHORT)0x0008)
-#define BORDERWINDOW_STYLE_APP ((USHORT)0x0010)
-
-#define BORDERWINDOW_HITTEST_TITLE ((USHORT)0x0001)
-#define BORDERWINDOW_HITTEST_LEFT ((USHORT)0x0002)
-#define BORDERWINDOW_HITTEST_MENU ((USHORT)0x0004)
-#define BORDERWINDOW_HITTEST_TOP ((USHORT)0x0008)
-#define BORDERWINDOW_HITTEST_RIGHT ((USHORT)0x0010)
-#define BORDERWINDOW_HITTEST_BOTTOM ((USHORT)0x0020)
-#define BORDERWINDOW_HITTEST_TOPLEFT ((USHORT)0x0040)
-#define BORDERWINDOW_HITTEST_TOPRIGHT ((USHORT)0x0080)
-#define BORDERWINDOW_HITTEST_BOTTOMLEFT ((USHORT)0x0100)
-#define BORDERWINDOW_HITTEST_BOTTOMRIGHT ((USHORT)0x0200)
-#define BORDERWINDOW_HITTEST_CLOSE ((USHORT)0x0400)
-#define BORDERWINDOW_HITTEST_ROLL ((USHORT)0x0800)
-#define BORDERWINDOW_HITTEST_DOCK ((USHORT)0x1000)
-#define BORDERWINDOW_HITTEST_HIDE ((USHORT)0x2000)
-#define BORDERWINDOW_HITTEST_HELP ((USHORT)0x4000)
-#define BORDERWINDOW_HITTEST_PIN ((USHORT)0x8000)
-
-#define BORDERWINDOW_DRAW_TITLE ((USHORT)0x0001)
-#define BORDERWINDOW_DRAW_BORDER ((USHORT)0x0002)
-#define BORDERWINDOW_DRAW_FRAME ((USHORT)0x0004)
-#define BORDERWINDOW_DRAW_CLOSE ((USHORT)0x0008)
-#define BORDERWINDOW_DRAW_ROLL ((USHORT)0x0010)
-#define BORDERWINDOW_DRAW_DOCK ((USHORT)0x0020)
-#define BORDERWINDOW_DRAW_HIDE ((USHORT)0x0040)
-#define BORDERWINDOW_DRAW_HELP ((USHORT)0x0080)
-#define BORDERWINDOW_DRAW_PIN ((USHORT)0x0100)
-#define BORDERWINDOW_DRAW_MENU ((USHORT)0x0200)
+#define BORDERWINDOW_STYLE_OVERLAP ((sal_uInt16)0x0001)
+#define BORDERWINDOW_STYLE_BORDER ((sal_uInt16)0x0002)
+#define BORDERWINDOW_STYLE_FLOAT ((sal_uInt16)0x0004)
+#define BORDERWINDOW_STYLE_FRAME ((sal_uInt16)0x0008)
+#define BORDERWINDOW_STYLE_APP ((sal_uInt16)0x0010)
+
+#define BORDERWINDOW_HITTEST_TITLE ((sal_uInt16)0x0001)
+#define BORDERWINDOW_HITTEST_LEFT ((sal_uInt16)0x0002)
+#define BORDERWINDOW_HITTEST_MENU ((sal_uInt16)0x0004)
+#define BORDERWINDOW_HITTEST_TOP ((sal_uInt16)0x0008)
+#define BORDERWINDOW_HITTEST_RIGHT ((sal_uInt16)0x0010)
+#define BORDERWINDOW_HITTEST_BOTTOM ((sal_uInt16)0x0020)
+#define BORDERWINDOW_HITTEST_TOPLEFT ((sal_uInt16)0x0040)
+#define BORDERWINDOW_HITTEST_TOPRIGHT ((sal_uInt16)0x0080)
+#define BORDERWINDOW_HITTEST_BOTTOMLEFT ((sal_uInt16)0x0100)
+#define BORDERWINDOW_HITTEST_BOTTOMRIGHT ((sal_uInt16)0x0200)
+#define BORDERWINDOW_HITTEST_CLOSE ((sal_uInt16)0x0400)
+#define BORDERWINDOW_HITTEST_ROLL ((sal_uInt16)0x0800)
+#define BORDERWINDOW_HITTEST_DOCK ((sal_uInt16)0x1000)
+#define BORDERWINDOW_HITTEST_HIDE ((sal_uInt16)0x2000)
+#define BORDERWINDOW_HITTEST_HELP ((sal_uInt16)0x4000)
+#define BORDERWINDOW_HITTEST_PIN ((sal_uInt16)0x8000)
+
+#define BORDERWINDOW_DRAW_TITLE ((sal_uInt16)0x0001)
+#define BORDERWINDOW_DRAW_BORDER ((sal_uInt16)0x0002)
+#define BORDERWINDOW_DRAW_FRAME ((sal_uInt16)0x0004)
+#define BORDERWINDOW_DRAW_CLOSE ((sal_uInt16)0x0008)
+#define BORDERWINDOW_DRAW_ROLL ((sal_uInt16)0x0010)
+#define BORDERWINDOW_DRAW_DOCK ((sal_uInt16)0x0020)
+#define BORDERWINDOW_DRAW_HIDE ((sal_uInt16)0x0040)
+#define BORDERWINDOW_DRAW_HELP ((sal_uInt16)0x0080)
+#define BORDERWINDOW_DRAW_PIN ((sal_uInt16)0x0100)
+#define BORDERWINDOW_DRAW_MENU ((sal_uInt16)0x0200)
#define BORDERWINDOW_DRAW_ALL (BORDERWINDOW_DRAW_TITLE | \
BORDERWINDOW_DRAW_BORDER | \
BORDERWINDOW_DRAW_FRAME | \
@@ -82,11 +82,11 @@ class ImplBorderWindowView;
BORDERWINDOW_DRAW_PIN | \
BORDERWINDOW_DRAW_MENU)
-#define BORDERWINDOW_TITLE_NORMAL ((USHORT)0x0001)
-#define BORDERWINDOW_TITLE_SMALL ((USHORT)0x0002)
-#define BORDERWINDOW_TITLE_TEAROFF ((USHORT)0x0004)
-#define BORDERWINDOW_TITLE_POPUP ((USHORT)0x0008)
-#define BORDERWINDOW_TITLE_NONE ((USHORT)0x0010)
+#define BORDERWINDOW_TITLE_NORMAL ((sal_uInt16)0x0001)
+#define BORDERWINDOW_TITLE_SMALL ((sal_uInt16)0x0002)
+#define BORDERWINDOW_TITLE_TEAROFF ((sal_uInt16)0x0004)
+#define BORDERWINDOW_TITLE_POPUP ((sal_uInt16)0x0008)
+#define BORDERWINDOW_TITLE_NONE ((sal_uInt16)0x0010)
// --------------------
// - ImplBorderWindow -
@@ -108,26 +108,26 @@ private:
long mnMaxHeight;
long mnRollHeight;
long mnOrgMenuHeight;
- USHORT mnTitleType;
- USHORT mnBorderStyle;
- BOOL mbFloatWindow;
- BOOL mbSmallOutBorder;
- BOOL mbFrameBorder;
- BOOL mbPined;
- BOOL mbRollUp;
- BOOL mbMenuHide;
- BOOL mbDockBtn;
- BOOL mbHideBtn;
- BOOL mbHelpBtn;
- BOOL mbMenuBtn;
- BOOL mbDisplayActive;
+ sal_uInt16 mnTitleType;
+ sal_uInt16 mnBorderStyle;
+ sal_Bool mbFloatWindow;
+ sal_Bool mbSmallOutBorder;
+ sal_Bool mbFrameBorder;
+ sal_Bool mbPined;
+ sal_Bool mbRollUp;
+ sal_Bool mbMenuHide;
+ sal_Bool mbDockBtn;
+ sal_Bool mbHideBtn;
+ sal_Bool mbHelpBtn;
+ sal_Bool mbMenuBtn;
+ sal_Bool mbDisplayActive;
using Window::ImplInit;
void ImplInit( Window* pParent,
- WinBits nStyle, USHORT nTypeStyle,
+ WinBits nStyle, sal_uInt16 nTypeStyle,
SystemParentData* pParentData );
void ImplInit( Window* pParent,
- WinBits nStyle, USHORT nTypeStyle,
+ WinBits nStyle, sal_uInt16 nTypeStyle,
const ::com::sun::star::uno::Any& );
// Copy assignment is forbidden and not implemented.
@@ -138,11 +138,11 @@ public:
ImplBorderWindow( Window* pParent,
SystemParentData* pParentData,
WinBits nStyle = 0,
- USHORT nTypeStyle = 0 );
+ sal_uInt16 nTypeStyle = 0 );
ImplBorderWindow( Window* pParent, WinBits nStyle = 0,
- USHORT nTypeStyle = 0 );
+ sal_uInt16 nTypeStyle = 0 );
ImplBorderWindow( Window* pParent,
- WinBits nStyle, USHORT nTypeStyle,
+ WinBits nStyle, sal_uInt16 nTypeStyle,
const ::com::sun::star::uno::Any& );
~ImplBorderWindow();
@@ -158,28 +158,28 @@ public:
virtual void DataChanged( const DataChangedEvent& rDCEvt );
void InitView();
- void UpdateView( BOOL bNewView, const Size& rNewOutSize );
+ void UpdateView( sal_Bool bNewView, const Size& rNewOutSize );
void InvalidateBorder();
using Window::Draw;
void Draw( const Rectangle& rRect, OutputDevice* pDev, const Point& rPos );
- void SetDisplayActive( BOOL bActive );
- BOOL IsDisplayActive() const { return mbDisplayActive; }
- void SetTitleType( USHORT nTitleType, const Size& rSize );
- void SetBorderStyle( USHORT nStyle );
- USHORT GetBorderStyle() const { return mnBorderStyle; }
- void SetPin( BOOL bPin );
- void SetRollUp( BOOL bRollUp, const Size& rSize );
+ void SetDisplayActive( sal_Bool bActive );
+ sal_Bool IsDisplayActive() const { return mbDisplayActive; }
+ void SetTitleType( sal_uInt16 nTitleType, const Size& rSize );
+ void SetBorderStyle( sal_uInt16 nStyle );
+ sal_uInt16 GetBorderStyle() const { return mnBorderStyle; }
+ void SetPin( sal_Bool bPin );
+ void SetRollUp( sal_Bool bRollUp, const Size& rSize );
void SetCloser();
- void SetDockButton( BOOL bDockButton );
- void SetHideButton( BOOL bHideButton );
- void SetHelpButton( BOOL bHelpButton );
- void SetMenuButton( BOOL bMenuButton );
+ void SetDockButton( sal_Bool bDockButton );
+ void SetHideButton( sal_Bool bHideButton );
+ void SetHelpButton( sal_Bool bHelpButton );
+ void SetMenuButton( sal_Bool bMenuButton );
void UpdateMenuHeight();
void SetMenuBarWindow( Window* pWindow );
- void SetMenuBarMode( BOOL bHide );
+ void SetMenuBarMode( sal_Bool bHide );
void SetMinOutputSize( long nWidth, long nHeight )
{ mnMinWidth = nWidth; mnMinHeight = nHeight; }
@@ -226,18 +226,18 @@ struct ImplBorderFrameData
long mnBorderSize;
long mnTitleHeight;
long mnTitleOff;
- USHORT mnHitTest;
- USHORT mnPinState;
- USHORT mnCloseState;
- USHORT mnRollState;
- USHORT mnDockState;
- USHORT mnMenuState;
- USHORT mnHideState;
- USHORT mnHelpState;
- USHORT mnTitleType;
- BOOL mbFloatWindow;
- BOOL mbDragFull;
- BOOL mbTitleClipped;
+ sal_uInt16 mnHitTest;
+ sal_uInt16 mnPinState;
+ sal_uInt16 mnCloseState;
+ sal_uInt16 mnRollState;
+ sal_uInt16 mnDockState;
+ sal_uInt16 mnMenuState;
+ sal_uInt16 mnHideState;
+ sal_uInt16 mnHelpState;
+ sal_uInt16 mnTitleType;
+ sal_Bool mbFloatWindow;
+ sal_Bool mbDragFull;
+ sal_Bool mbTitleClipped;
};
// =======================================================================
@@ -251,23 +251,23 @@ class ImplBorderWindowView
public:
virtual ~ImplBorderWindowView();
- virtual BOOL MouseMove( const MouseEvent& rMEvt );
- virtual BOOL MouseButtonDown( const MouseEvent& rMEvt );
- virtual BOOL Tracking( const TrackingEvent& rTEvt );
+ virtual sal_Bool MouseMove( const MouseEvent& rMEvt );
+ virtual sal_Bool MouseButtonDown( const MouseEvent& rMEvt );
+ virtual sal_Bool Tracking( const TrackingEvent& rTEvt );
virtual String RequestHelp( const Point& rPos, Rectangle& rHelpRect );
virtual void Init( OutputDevice* pDev, long nWidth, long nHeight ) = 0;
virtual void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const = 0;
virtual long CalcTitleWidth() const = 0;
- virtual void DrawWindow( USHORT nDrawFlags, OutputDevice* pOutDev = NULL, const Point* pOffset = NULL ) = 0;
+ virtual void DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* pOutDev = NULL, const Point* pOffset = NULL ) = 0;
virtual Rectangle GetMenuRect() const;
void ImplInitTitle( ImplBorderFrameData* pData );
- USHORT ImplHitTest( ImplBorderFrameData* pData, const Point& rPos );
- BOOL ImplMouseMove( ImplBorderFrameData* pData, const MouseEvent& rMEvt );
- BOOL ImplMouseButtonDown( ImplBorderFrameData* pData, const MouseEvent& rMEvt );
- BOOL ImplTracking( ImplBorderFrameData* pData, const TrackingEvent& rTEvt );
+ sal_uInt16 ImplHitTest( ImplBorderFrameData* pData, const Point& rPos );
+ sal_Bool ImplMouseMove( ImplBorderFrameData* pData, const MouseEvent& rMEvt );
+ sal_Bool ImplMouseButtonDown( ImplBorderFrameData* pData, const MouseEvent& rMEvt );
+ sal_Bool ImplTracking( ImplBorderFrameData* pData, const TrackingEvent& rTEvt );
String ImplRequestHelp( ImplBorderFrameData* pData, const Point& rPos, Rectangle& rHelpRect );
long ImplCalcTitleWidth( const ImplBorderFrameData* pData ) const;
};
@@ -287,7 +287,7 @@ public:
virtual void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
virtual long CalcTitleWidth() const;
- virtual void DrawWindow( USHORT nDrawFlags, OutputDevice* pOutDev, const Point* pOffset );
+ virtual void DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* pOutDev, const Point* pOffset );
};
@@ -316,7 +316,7 @@ public:
virtual void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
virtual long CalcTitleWidth() const;
- virtual void DrawWindow( USHORT nDrawFlags, OutputDevice* pOutDev, const Point* pOffset );
+ virtual void DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* pOutDev, const Point* pOffset );
};
@@ -337,9 +337,9 @@ public:
ImplStdBorderWindowView( ImplBorderWindow* pBorderWindow );
~ImplStdBorderWindowView();
- virtual BOOL MouseMove( const MouseEvent& rMEvt );
- virtual BOOL MouseButtonDown( const MouseEvent& rMEvt );
- virtual BOOL Tracking( const TrackingEvent& rTEvt );
+ virtual sal_Bool MouseMove( const MouseEvent& rMEvt );
+ virtual sal_Bool MouseButtonDown( const MouseEvent& rMEvt );
+ virtual sal_Bool Tracking( const TrackingEvent& rTEvt );
virtual String RequestHelp( const Point& rPos, Rectangle& rHelpRect );
virtual Rectangle GetMenuRect() const;
@@ -347,7 +347,7 @@ public:
virtual void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
virtual long CalcTitleWidth() const;
- virtual void DrawWindow( USHORT nDrawFlags, OutputDevice* pOutDev, const Point* pOffset );
+ virtual void DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* pOutDev, const Point* pOffset );
};
diff --git a/vcl/inc/vcl/btndlg.hxx b/vcl/inc/vcl/btndlg.hxx
index a3bfaf55caad..ec537f517374 100644
--- a/vcl/inc/vcl/btndlg.hxx
+++ b/vcl/inc/vcl/btndlg.hxx
@@ -42,13 +42,13 @@ class PushButton;
// - ButtonDialog-Types -
// ----------------------
-#define BUTTONDIALOG_BUTTON_NOTFOUND ((USHORT)0xFFFF)
+#define BUTTONDIALOG_BUTTON_NOTFOUND ((sal_uInt16)0xFFFF)
-#define BUTTONDIALOG_DEFBUTTON ((USHORT)0x0001)
-#define BUTTONDIALOG_OKBUTTON ((USHORT)0x0002)
-#define BUTTONDIALOG_CANCELBUTTON ((USHORT)0x0004)
-#define BUTTONDIALOG_HELPBUTTON ((USHORT)0x0008)
-#define BUTTONDIALOG_FOCUSBUTTON ((USHORT)0x0010)
+#define BUTTONDIALOG_DEFBUTTON ((sal_uInt16)0x0001)
+#define BUTTONDIALOG_OKBUTTON ((sal_uInt16)0x0002)
+#define BUTTONDIALOG_CANCELBUTTON ((sal_uInt16)0x0004)
+#define BUTTONDIALOG_HELPBUTTON ((sal_uInt16)0x0008)
+#define BUTTONDIALOG_FOCUSBUTTON ((sal_uInt16)0x0010)
// ----------------
// - ButtonDialog -
@@ -61,14 +61,14 @@ private:
Size maPageSize;
Size maCtrlSize;
long mnButtonSize;
- USHORT mnCurButtonId;
- USHORT mnFocusButtonId;
- BOOL mbFormat;
+ sal_uInt16 mnCurButtonId;
+ sal_uInt16 mnFocusButtonId;
+ sal_Bool mbFormat;
Link maClickHdl;
SAL_DLLPRIVATE void ImplInitButtonDialogData();
- SAL_DLLPRIVATE PushButton* ImplCreatePushButton( USHORT nBtnFlags );
- SAL_DLLPRIVATE ImplBtnDlgItem* ImplGetItem( USHORT nId ) const;
+ SAL_DLLPRIVATE PushButton* ImplCreatePushButton( sal_uInt16 nBtnFlags );
+ SAL_DLLPRIVATE ImplBtnDlgItem* ImplGetItem( sal_uInt16 nId ) const;
DECL_DLLPRIVATE_LINK( ImplClickHdl, PushButton* pBtn );
SAL_DLLPRIVATE void ImplPosControls();
@@ -92,25 +92,25 @@ public:
void SetPageSizePixel( const Size& rSize ) { maPageSize = rSize; }
const Size& GetPageSizePixel() const { return maPageSize; }
- USHORT GetCurButtonId() const { return mnCurButtonId; }
+ sal_uInt16 GetCurButtonId() const { return mnCurButtonId; }
- void AddButton( const XubString& rText, USHORT nId, USHORT nBtnFlags, long nSepPixel = 0 );
- void AddButton( StandardButtonType eType, USHORT nId, USHORT nBtnFlags, long nSepPixel = 0 );
- void AddButton( PushButton* pBtn, USHORT nId, USHORT nBtnFlags, long nSepPixel = 0 );
- void RemoveButton( USHORT nId );
+ void AddButton( const XubString& rText, sal_uInt16 nId, sal_uInt16 nBtnFlags, long nSepPixel = 0 );
+ void AddButton( StandardButtonType eType, sal_uInt16 nId, sal_uInt16 nBtnFlags, long nSepPixel = 0 );
+ void AddButton( PushButton* pBtn, sal_uInt16 nId, sal_uInt16 nBtnFlags, long nSepPixel = 0 );
+ void RemoveButton( sal_uInt16 nId );
void Clear();
- USHORT GetButtonCount() const;
- USHORT GetButtonId( USHORT nButton ) const;
- PushButton* GetPushButton( USHORT nId ) const;
- void SetButtonText( USHORT nId, const XubString& rText );
- XubString GetButtonText( USHORT nId ) const;
- void SetButtonHelpText( USHORT nId, const XubString& rText );
- XubString GetButtonHelpText( USHORT nId ) const;
- void SetButtonHelpId( USHORT nId, ULONG nHelpId );
- ULONG GetButtonHelpId( USHORT nId ) const;
-
- void SetFocusButton( USHORT nId = BUTTONDIALOG_BUTTON_NOTFOUND ) { mnFocusButtonId = nId; }
- USHORT GetFocusButton() const { return mnFocusButtonId; }
+ sal_uInt16 GetButtonCount() const;
+ sal_uInt16 GetButtonId( sal_uInt16 nButton ) const;
+ PushButton* GetPushButton( sal_uInt16 nId ) const;
+ void SetButtonText( sal_uInt16 nId, const XubString& rText );
+ XubString GetButtonText( sal_uInt16 nId ) const;
+ void SetButtonHelpText( sal_uInt16 nId, const XubString& rText );
+ XubString GetButtonHelpText( sal_uInt16 nId ) const;
+ void SetButtonHelpId( sal_uInt16 nId, const rtl::OString& rHelpId );
+ rtl::OString GetButtonHelpId( sal_uInt16 nId ) const;
+
+ void SetFocusButton( sal_uInt16 nId = BUTTONDIALOG_BUTTON_NOTFOUND ) { mnFocusButtonId = nId; }
+ sal_uInt16 GetFocusButton() const { return mnFocusButtonId; }
void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
const Link& GetClickHdl() const { return maClickHdl; }
diff --git a/vcl/inc/vcl/button.hxx b/vcl/inc/vcl/button.hxx
index 41d3899366bf..9205f9df7661 100644
--- a/vcl/inc/vcl/button.hxx
+++ b/vcl/inc/vcl/button.hxx
@@ -56,17 +56,17 @@ private:
SAL_DLLPRIVATE Button (const Button &);
SAL_DLLPRIVATE Button & operator= (const Button &);
public:
- SAL_DLLPRIVATE USHORT ImplGetButtonState() const;
- SAL_DLLPRIVATE USHORT& ImplGetButtonState();
- SAL_DLLPRIVATE USHORT ImplGetTextStyle( XubString& rText, WinBits nWinStyle, ULONG nDrawFlags );
+ SAL_DLLPRIVATE sal_uInt16 ImplGetButtonState() const;
+ SAL_DLLPRIVATE sal_uInt16& ImplGetButtonState();
+ SAL_DLLPRIVATE sal_uInt16 ImplGetTextStyle( XubString& rText, WinBits nWinStyle, sal_uLong nDrawFlags );
SAL_DLLPRIVATE void ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos, Size& rSize,
- BOOL bLayout, ULONG nImageSep, ULONG nDrawFlags,
- USHORT nTextStyle, Rectangle *pSymbolRect=NULL, bool bAddImageSep = false );
+ sal_Bool bLayout, sal_uLong nImageSep, sal_uLong nDrawFlags,
+ sal_uInt16 nTextStyle, Rectangle *pSymbolRect=NULL, bool bAddImageSep = false );
SAL_DLLPRIVATE void ImplSetFocusRect( const Rectangle &rFocusRect );
SAL_DLLPRIVATE const Rectangle& ImplGetFocusRect() const;
SAL_DLLPRIVATE void ImplSetSymbolAlign( SymbolAlign eAlign );
SAL_DLLPRIVATE SymbolAlign ImplGetSymbolAlign() const;
- SAL_DLLPRIVATE void ImplSetSmallSymbol( BOOL bSmall = TRUE );
+ SAL_DLLPRIVATE void ImplSetSmallSymbol( sal_Bool bSmall = sal_True );
SAL_DLLPRIVATE const Rectangle& ImplGetSymbolRect() const;
SAL_DLLPRIVATE void ImplSetSymbolRect(const Rectangle&);
@@ -79,7 +79,6 @@ public:
~Button();
virtual void Click();
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
const Link& GetClickHdl() const { return maClickHdl; }
@@ -87,19 +86,19 @@ public:
static XubString GetStandardText( StandardButtonType eButton );
static XubString GetStandardHelpText( StandardButtonType eButton );
- BOOL SetModeImage( const Image& rImage );
+ sal_Bool SetModeImage( const Image& rImage );
const Image GetModeImage( ) const;
- BOOL HasImage() const;
+ sal_Bool HasImage() const;
void SetImageAlign( ImageAlign eAlign );
ImageAlign GetImageAlign() const;
- BOOL SetModeBitmap( const BitmapEx& rBitmap );
+ sal_Bool SetModeBitmap( const BitmapEx& rBitmap );
BitmapEx GetModeBitmap( ) const;
- void EnableImageDisplay( BOOL bEnable );
- BOOL IsImageDisplayEnabled();
- void EnableTextDisplay( BOOL bEnable );
- BOOL IsTextDisplayEnabled();
+ void EnableImageDisplay( sal_Bool bEnable );
+ sal_Bool IsImageDisplayEnabled();
+ void EnableTextDisplay( sal_Bool bEnable );
+ sal_Bool IsTextDisplayEnabled();
void SetFocusRect( const Rectangle& rFocusRect );
const Rectangle& GetFocusRect() const;
@@ -111,8 +110,8 @@ public:
// - PushButton-Types -
// --------------------
-#define PUSHBUTTON_DROPDOWN_TOOLBOX ((USHORT)0x0001)
-#define PUSHBUTTON_DROPDOWN_MENUBUTTON ((USHORT)0x0002)
+#define PUSHBUTTON_DROPDOWN_TOOLBOX ((sal_uInt16)0x0001)
+#define PUSHBUTTON_DROPDOWN_MENUBUTTON ((sal_uInt16)0x0002)
// --------------
// - PushButton -
@@ -124,21 +123,21 @@ protected:
SymbolType meSymbol;
TriState meState;
TriState meSaveValue;
- USHORT mnDDStyle;
- BOOL mbPressed;
- BOOL mbInUserDraw;
+ sal_uInt16 mnDDStyle;
+ sal_Bool mbPressed;
+ sal_Bool mbInUserDraw;
Link maToggleHdl;
SAL_DLLPRIVATE void ImplInitPushButtonData();
SAL_DLLPRIVATE WinBits ImplInitStyle( const Window* pPrevWindow, WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
- SAL_DLLPRIVATE void ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags,
- const Rectangle& rRect, bool bLayout );
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE void ImplDrawPushButtonContent( OutputDevice* pDev, sal_uLong nDrawFlags,
+ const Rectangle& rRect, bool bLayout, bool bMenuBtnSep );
SAL_DLLPRIVATE void ImplDrawPushButton( bool bLayout = false );
using Button::ImplGetTextStyle;
- SAL_DLLPRIVATE USHORT ImplGetTextStyle( ULONG nDrawFlags ) const;
- SAL_DLLPRIVATE BOOL IsSymbol() const { return ( (meSymbol != SYMBOL_NOSYMBOL) && (meSymbol != SYMBOL_IMAGE) ); }
- SAL_DLLPRIVATE BOOL IsImage() const { return Button::HasImage(); }
+ SAL_DLLPRIVATE sal_uInt16 ImplGetTextStyle( sal_uLong nDrawFlags ) const;
+ SAL_DLLPRIVATE sal_Bool IsSymbol() const { return ( (meSymbol != SYMBOL_NOSYMBOL) && (meSymbol != SYMBOL_IMAGE) ); }
+ SAL_DLLPRIVATE sal_Bool IsImage() const { return Button::HasImage(); }
// Copy assignment is forbidden and not implemented.
SAL_DLLPRIVATE PushButton( const PushButton & );
@@ -149,10 +148,10 @@ protected:
using Control::ImplInitSettings;
using Window::ImplInit;
public:
- SAL_DLLPRIVATE void ImplSetDefButton( BOOL bSet );
- SAL_DLLPRIVATE static void ImplDrawPushButtonFrame( Window* pDev, Rectangle& rRect, USHORT nStyle );
- SAL_DLLPRIVATE static BOOL ImplHitTestPushButton( Window* pDev, const Point& rPos );
- SAL_DLLPRIVATE BOOL ImplIsDefButton() const;
+ SAL_DLLPRIVATE void ImplSetDefButton( sal_Bool bSet );
+ SAL_DLLPRIVATE static void ImplDrawPushButtonFrame( Window* pDev, Rectangle& rRect, sal_uInt16 nStyle );
+ SAL_DLLPRIVATE static sal_Bool ImplHitTestPushButton( Window* pDev, const Point& rPos );
+ SAL_DLLPRIVATE sal_Bool ImplIsDefButton() const;
protected:
PushButton( WindowType nType );
@@ -172,7 +171,7 @@ public:
virtual void KeyInput( const KeyEvent& rKEvt );
virtual void KeyUp( const KeyEvent& rKEvt );
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual void GetFocus();
virtual void LoseFocus();
@@ -188,17 +187,17 @@ public:
void SetSymbolAlign( SymbolAlign eAlign );
SymbolAlign GetSymbolAlign() const;
- void SetDropDown( USHORT nStyle );
- USHORT GetDropDown() const { return mnDDStyle; }
+ void SetDropDown( sal_uInt16 nStyle );
+ sal_uInt16 GetDropDown() const { return mnDDStyle; }
void SetState( TriState eState );
TriState GetState() const { return meState; }
- void Check( BOOL bCheck = TRUE );
- BOOL IsChecked() const;
+ void Check( sal_Bool bCheck = sal_True );
+ sal_Bool IsChecked() const;
- void SetPressed( BOOL bPressed );
- BOOL IsPressed() const { return mbPressed; }
+ void SetPressed( sal_Bool bPressed );
+ sal_Bool IsPressed() const { return mbPressed; }
void EndSelection();
@@ -212,12 +211,12 @@ public:
const Link& GetToggleHdl() const { return maToggleHdl; }
};
-inline void PushButton::Check( BOOL bCheck )
+inline void PushButton::Check( sal_Bool bCheck )
{
SetState( (bCheck) ? STATE_CHECK : STATE_NOCHECK );
}
-inline BOOL PushButton::IsChecked() const
+inline sal_Bool PushButton::IsChecked() const
{
return (GetState() == STATE_CHECK);
}
@@ -298,17 +297,17 @@ private:
Rectangle maStateRect;
Rectangle maMouseRect;
Image maImage;
- BOOL mbChecked;
- BOOL mbSaveValue;
- BOOL mbRadioCheck;
- BOOL mbStateChanged;
+ sal_Bool mbChecked;
+ sal_Bool mbSaveValue;
+ sal_Bool mbRadioCheck;
+ sal_Bool mbStateChanged;
Link maToggleHdl;
SAL_DLLPRIVATE void ImplInitRadioButtonData();
SAL_DLLPRIVATE WinBits ImplInitStyle( const Window* pPrevWindow, WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
SAL_DLLPRIVATE void ImplDrawRadioButtonState();
- SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize,
const Size& rImageSize, Rectangle& rStateRect,
Rectangle& rMouseRect, bool bLayout = false );
@@ -329,7 +328,7 @@ protected:
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
public:
- SAL_DLLPRIVATE void ImplCallClick( BOOL bGrabFocus = FALSE, USHORT nFocusFlags = 0 );
+ SAL_DLLPRIVATE void ImplCallClick( sal_Bool bGrabFocus = sal_False, sal_uInt16 nFocusFlags = 0 );
SAL_DLLPRIVATE void ImplSetMinimumNWFSize();
protected:
@@ -358,7 +357,7 @@ public:
virtual void KeyInput( const KeyEvent& rKEvt );
virtual void KeyUp( const KeyEvent& rKEvt );
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual void GetFocus();
virtual void LoseFocus();
@@ -368,22 +367,22 @@ public:
virtual void Toggle();
- BOOL IsStateChanged() const { return mbStateChanged; }
+ sal_Bool IsStateChanged() const { return mbStateChanged; }
- void EnableRadioCheck( BOOL bRadioCheck = TRUE ) { mbRadioCheck = bRadioCheck; }
- BOOL IsRadioCheckEnabled() const { return mbRadioCheck; }
+ void EnableRadioCheck( sal_Bool bRadioCheck = sal_True ) { mbRadioCheck = bRadioCheck; }
+ sal_Bool IsRadioCheckEnabled() const { return mbRadioCheck; }
- BOOL SetModeRadioImage( const Image& rImage );
+ sal_Bool SetModeRadioImage( const Image& rImage );
const Image& GetModeRadioImage( ) const;
- void SetState( BOOL bCheck );
- void Check( BOOL bCheck = TRUE );
- BOOL IsChecked() const { return mbChecked; }
+ void SetState( sal_Bool bCheck );
+ void Check( sal_Bool bCheck = sal_True );
+ sal_Bool IsChecked() const { return mbChecked; }
void SaveValue() { mbSaveValue = IsChecked(); }
- BOOL GetSavedValue() const { return mbSaveValue; }
+ sal_Bool GetSavedValue() const { return mbSaveValue; }
- static Image GetRadioImage( const AllSettings& rSettings, USHORT nFlags );
+ static Image GetRadioImage( const AllSettings& rSettings, sal_uInt16 nFlags );
Size CalcMinimumSize( long nMaxWidth = 0 ) const;
virtual Size GetOptimalSize(WindowSizeType eType) const;
@@ -418,14 +417,14 @@ private:
Rectangle maMouseRect;
TriState meState;
TriState meSaveValue;
- BOOL mbTriState;
+ sal_Bool mbTriState;
Link maToggleHdl;
SAL_DLLPRIVATE void ImplInitCheckBoxData();
SAL_DLLPRIVATE WinBits ImplInitStyle( const Window* pPrevWindow, WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
SAL_DLLPRIVATE void ImplInvalidateOrDrawCheckBoxState();
- SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize,
const Size& rImageSize, Rectangle& rStateRect,
Rectangle& rMouseRect, bool bLayout );
@@ -463,7 +462,7 @@ public:
virtual void KeyInput( const KeyEvent& rKEvt );
virtual void KeyUp( const KeyEvent& rKEvt );
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual void GetFocus();
virtual void LoseFocus();
@@ -476,16 +475,16 @@ public:
void SetState( TriState eState );
TriState GetState() const { return meState; }
- void Check( BOOL bCheck = TRUE );
- BOOL IsChecked() const;
+ void Check( sal_Bool bCheck = sal_True );
+ sal_Bool IsChecked() const;
- void EnableTriState( BOOL bTriState = TRUE );
- BOOL IsTriStateEnabled() const { return mbTriState; }
+ void EnableTriState( sal_Bool bTriState = sal_True );
+ sal_Bool IsTriStateEnabled() const { return mbTriState; }
void SaveValue() { meSaveValue = GetState(); }
TriState GetSavedValue() const { return meSaveValue; }
- static Image GetCheckImage( const AllSettings& rSettings, USHORT nFlags );
+ static Image GetCheckImage( const AllSettings& rSettings, sal_uInt16 nFlags );
Size CalcMinimumSize( long nMaxWidth = 0 ) const;
virtual Size GetOptimalSize(WindowSizeType eType) const;
@@ -494,12 +493,12 @@ public:
const Link& GetToggleHdl() const { return maToggleHdl; }
};
-inline void CheckBox::Check( BOOL bCheck )
+inline void CheckBox::Check( sal_Bool bCheck )
{
SetState( (bCheck) ? STATE_CHECK : STATE_NOCHECK );
}
-inline BOOL CheckBox::IsChecked() const
+inline sal_Bool CheckBox::IsChecked() const
{
return (GetState() == STATE_CHECK);
}
diff --git a/vcl/inc/vcl/canvasbitmap.hxx b/vcl/inc/vcl/canvasbitmap.hxx
index 4c4ef77ff5f7..e0773257b029 100644
--- a/vcl/inc/vcl/canvasbitmap.hxx
+++ b/vcl/inc/vcl/canvasbitmap.hxx
@@ -67,7 +67,7 @@ namespace unotools
bool m_bSwap;
bool m_bPalette;
- SAL_DLLPRIVATE void setComponentInfo( ULONG redShift, ULONG greenShift, ULONG blueShift );
+ SAL_DLLPRIVATE void setComponentInfo( sal_uLong redShift, sal_uLong greenShift, sal_uLong blueShift );
virtual ~VclCanvasBitmap();
diff --git a/vcl/inc/vcl/cmdevt.hxx b/vcl/inc/vcl/cmdevt.hxx
index 529dba50fb3d..c71160b3fce1 100644
--- a/vcl/inc/vcl/cmdevt.hxx
+++ b/vcl/inc/vcl/cmdevt.hxx
@@ -39,54 +39,54 @@
// - CommandExtTextInputData -
// ---------------------------
-#define EXTTEXTINPUT_ATTR_GRAYWAVELINE ((USHORT)0x0100)
-#define EXTTEXTINPUT_ATTR_UNDERLINE ((USHORT)0x0200)
-#define EXTTEXTINPUT_ATTR_BOLDUNDERLINE ((USHORT)0x0400)
-#define EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE ((USHORT)0x0800)
-#define EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE ((USHORT)0x1000)
-#define EXTTEXTINPUT_ATTR_HIGHLIGHT ((USHORT)0x2000)
-#define EXTTEXTINPUT_ATTR_REDTEXT ((USHORT)0x4000)
-#define EXTTEXTINPUT_ATTR_HALFTONETEXT ((USHORT)0x8000)
-
-#define EXTTEXTINPUT_CURSOR_INVISIBLE ((USHORT)0x0001)
-#define EXTTEXTINPUT_CURSOR_OVERWRITE ((USHORT)0x0002)
+#define EXTTEXTINPUT_ATTR_GRAYWAVELINE ((sal_uInt16)0x0100)
+#define EXTTEXTINPUT_ATTR_UNDERLINE ((sal_uInt16)0x0200)
+#define EXTTEXTINPUT_ATTR_BOLDUNDERLINE ((sal_uInt16)0x0400)
+#define EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE ((sal_uInt16)0x0800)
+#define EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE ((sal_uInt16)0x1000)
+#define EXTTEXTINPUT_ATTR_HIGHLIGHT ((sal_uInt16)0x2000)
+#define EXTTEXTINPUT_ATTR_REDTEXT ((sal_uInt16)0x4000)
+#define EXTTEXTINPUT_ATTR_HALFTONETEXT ((sal_uInt16)0x8000)
+
+#define EXTTEXTINPUT_CURSOR_INVISIBLE ((sal_uInt16)0x0001)
+#define EXTTEXTINPUT_CURSOR_OVERWRITE ((sal_uInt16)0x0002)
class VCL_DLLPUBLIC CommandExtTextInputData
{
private:
XubString maText;
- USHORT* mpTextAttr;
+ sal_uInt16* mpTextAttr;
xub_StrLen mnCursorPos;
xub_StrLen mnDeltaStart;
xub_StrLen mnOldTextLen;
- USHORT mnCursorFlags;
- BOOL mbOnlyCursor;
+ sal_uInt16 mnCursorFlags;
+ sal_Bool mbOnlyCursor;
public:
CommandExtTextInputData();
CommandExtTextInputData( const XubString& rText,
- const USHORT* pTextAttr,
+ const sal_uInt16* pTextAttr,
xub_StrLen nCursorPos,
- USHORT nCursorFlags,
+ sal_uInt16 nCursorFlags,
xub_StrLen nDeltaStart,
xub_StrLen nOldTextLen,
- BOOL bOnlyCursor );
+ sal_Bool bOnlyCursor );
CommandExtTextInputData( const CommandExtTextInputData& rData );
~CommandExtTextInputData();
const XubString& GetText() const { return maText; }
- const USHORT* GetTextAttr() const { return mpTextAttr; }
- USHORT GetCharTextAttr( USHORT nIndex ) const;
+ const sal_uInt16* GetTextAttr() const { return mpTextAttr; }
+ sal_uInt16 GetCharTextAttr( sal_uInt16 nIndex ) const;
xub_StrLen GetCursorPos() const { return mnCursorPos; }
- BOOL IsCursorVisible() const { return (mnCursorFlags & EXTTEXTINPUT_CURSOR_INVISIBLE) == 0; }
- BOOL IsCursorOverwrite() const { return (mnCursorFlags & EXTTEXTINPUT_CURSOR_OVERWRITE) != 0; }
- USHORT GetCursorFlags() const { return mnCursorFlags; }
+ sal_Bool IsCursorVisible() const { return (mnCursorFlags & EXTTEXTINPUT_CURSOR_INVISIBLE) == 0; }
+ sal_Bool IsCursorOverwrite() const { return (mnCursorFlags & EXTTEXTINPUT_CURSOR_OVERWRITE) != 0; }
+ sal_uInt16 GetCursorFlags() const { return mnCursorFlags; }
xub_StrLen GetDeltaStart() const { return mnDeltaStart; }
xub_StrLen GetOldTextLen() const { return mnOldTextLen; }
- BOOL IsOnlyCursorChanged() const { return mbOnlyCursor; }
+ sal_Bool IsOnlyCursorChanged() const { return mbOnlyCursor; }
};
-inline USHORT CommandExtTextInputData::GetCharTextAttr( USHORT nIndex ) const
+inline sal_uInt16 CommandExtTextInputData::GetCharTextAttr( sal_uInt16 nIndex ) const
{
if ( mpTextAttr && (nIndex < maText.Len()) )
return mpTextAttr[nIndex];
@@ -124,47 +124,47 @@ inline CommandInputContextData::CommandInputContextData( LanguageType eLang )
// - CommandWheelData -
// --------------------
-#define COMMAND_WHEEL_SCROLL ((USHORT)0x0001)
-#define COMMAND_WHEEL_ZOOM ((USHORT)0x0002)
-#define COMMAND_WHEEL_DATAZOOM ((USHORT)0x0004)
+#define COMMAND_WHEEL_SCROLL ((sal_uInt16)0x0001)
+#define COMMAND_WHEEL_ZOOM ((sal_uInt16)0x0002)
+#define COMMAND_WHEEL_DATAZOOM ((sal_uInt16)0x0004)
-#define COMMAND_WHEEL_PAGESCROLL ((ULONG)0xFFFFFFFF)
+#define COMMAND_WHEEL_PAGESCROLL ((sal_uLong)0xFFFFFFFF)
class VCL_DLLPUBLIC CommandWheelData
{
private:
long mnDelta;
long mnNotchDelta;
- ULONG mnLines;
- USHORT mnMode;
- USHORT mnCode;
- BOOL mbHorz;
- BOOL mbDeltaIsPixel;
+ sal_uLong mnLines;
+ sal_uInt16 mnMode;
+ sal_uInt16 mnCode;
+ sal_Bool mbHorz;
+ sal_Bool mbDeltaIsPixel;
public:
CommandWheelData();
CommandWheelData( long nWheelDelta, long nWheelNotchDelta,
- ULONG nScrollLines,
- USHORT nWheelMode, USHORT nKeyModifier,
- BOOL bHorz = FALSE, BOOL bDeltaIsPixel = FALSE );
+ sal_uLong nScrollLines,
+ sal_uInt16 nWheelMode, sal_uInt16 nKeyModifier,
+ sal_Bool bHorz = sal_False, sal_Bool bDeltaIsPixel = sal_False );
long GetDelta() const { return mnDelta; }
long GetNotchDelta() const { return mnNotchDelta; }
- ULONG GetScrollLines() const { return mnLines; }
- BOOL IsHorz() const { return mbHorz; }
- BOOL IsDeltaPixel() const { return mbDeltaIsPixel; }
+ sal_uLong GetScrollLines() const { return mnLines; }
+ sal_Bool IsHorz() const { return mbHorz; }
+ sal_Bool IsDeltaPixel() const { return mbDeltaIsPixel; }
- USHORT GetMode() const { return mnMode; }
+ sal_uInt16 GetMode() const { return mnMode; }
- USHORT GetModifier() const
+ sal_uInt16 GetModifier() const
{ return (mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)); }
bool IsShift() const
{ return ((mnCode & KEY_SHIFT) != 0); }
- BOOL IsMod1() const
+ sal_Bool IsMod1() const
{ return ((mnCode & KEY_MOD1) != 0); }
- BOOL IsMod2() const
+ sal_Bool IsMod2() const
{ return ((mnCode & KEY_MOD2) != 0); }
- BOOL IsMod3() const
+ sal_Bool IsMod3() const
{ return ((mnCode & KEY_MOD3) != 0); }
};
@@ -175,14 +175,14 @@ inline CommandWheelData::CommandWheelData()
mnLines = 0;
mnMode = 0;
mnCode = 0;
- mbHorz = FALSE;
- mbDeltaIsPixel = FALSE;
+ mbHorz = sal_False;
+ mbDeltaIsPixel = sal_False;
}
inline CommandWheelData::CommandWheelData( long nWheelDelta, long nWheelNotchDelta,
- ULONG nScrollLines,
- USHORT nWheelMode, USHORT nKeyModifier,
- BOOL bHorz, BOOL bDeltaIsPixel )
+ sal_uLong nScrollLines,
+ sal_uInt16 nWheelMode, sal_uInt16 nKeyModifier,
+ sal_Bool bHorz, sal_Bool bDeltaIsPixel )
{
mnDelta = nWheelDelta;
mnNotchDelta = nWheelNotchDelta;
@@ -237,17 +237,17 @@ class VCL_DLLPUBLIC CommandVoiceData
{
private:
XubString maText;
- USHORT mnCommand;
+ sal_uInt16 mnCommand;
DictationCommandType meType;
public:
CommandVoiceData();
CommandVoiceData( const XubString& rStr,
DictationCommandType eType,
- USHORT nCommand );
+ sal_uInt16 nCommand );
const XubString& GetText() const { return maText; }
- USHORT GetCommand() const { return mnCommand; }
+ sal_uInt16 GetCommand() const { return mnCommand; }
DictationCommandType GetType() const { return meType; }
};
@@ -259,7 +259,7 @@ inline CommandVoiceData::CommandVoiceData()
inline CommandVoiceData::CommandVoiceData( const XubString& rStr,
DictationCommandType eType,
- USHORT nCommand ) :
+ sal_uInt16 nCommand ) :
maText( rStr ),
mnCommand( nCommand ),
meType( eType )
@@ -273,26 +273,26 @@ inline CommandVoiceData::CommandVoiceData( const XubString& rStr,
class VCL_DLLPUBLIC CommandModKeyData
{
private:
- USHORT mnCode;
+ sal_uInt16 mnCode;
public:
CommandModKeyData();
- CommandModKeyData( USHORT nCode );
+ CommandModKeyData( sal_uInt16 nCode );
bool IsShift() const { return (mnCode & MODKEY_SHIFT) ? true : false; }
- BOOL IsMod1() const { return (mnCode & MODKEY_MOD1) ? TRUE : FALSE; }
- BOOL IsMod2() const { return (mnCode & MODKEY_MOD2) ? TRUE : FALSE; }
- BOOL IsMod3() const { return (mnCode & MODKEY_MOD3) ? TRUE : FALSE; }
-
- BOOL IsLeftShift() const { return (mnCode & MODKEY_LSHIFT) ? TRUE : FALSE; }
- BOOL IsLeftMod1() const { return (mnCode & MODKEY_LMOD1) ? TRUE : FALSE; }
- BOOL IsLeftMod2() const { return (mnCode & MODKEY_LMOD2) ? TRUE : FALSE; }
- BOOL IsLeftMod3() const { return (mnCode & MODKEY_LMOD3) ? TRUE : FALSE; }
-
- BOOL IsRightShift() const { return (mnCode & MODKEY_RSHIFT) ? TRUE : FALSE; }
- BOOL IsRightMod1() const { return (mnCode & MODKEY_RMOD1) ? TRUE : FALSE; }
- BOOL IsRightMod2() const { return (mnCode & MODKEY_RMOD2) ? TRUE : FALSE; }
- BOOL IsRightMod3() const { return (mnCode & MODKEY_RMOD3) ? TRUE : FALSE; }
+ sal_Bool IsMod1() const { return (mnCode & MODKEY_MOD1) ? sal_True : sal_False; }
+ sal_Bool IsMod2() const { return (mnCode & MODKEY_MOD2) ? sal_True : sal_False; }
+ sal_Bool IsMod3() const { return (mnCode & MODKEY_MOD3) ? sal_True : sal_False; }
+
+ sal_Bool IsLeftShift() const { return (mnCode & MODKEY_LSHIFT) ? sal_True : sal_False; }
+ sal_Bool IsLeftMod1() const { return (mnCode & MODKEY_LMOD1) ? sal_True : sal_False; }
+ sal_Bool IsLeftMod2() const { return (mnCode & MODKEY_LMOD2) ? sal_True : sal_False; }
+ sal_Bool IsLeftMod3() const { return (mnCode & MODKEY_LMOD3) ? sal_True : sal_False; }
+
+ sal_Bool IsRightShift() const { return (mnCode & MODKEY_RSHIFT) ? sal_True : sal_False; }
+ sal_Bool IsRightMod1() const { return (mnCode & MODKEY_RMOD1) ? sal_True : sal_False; }
+ sal_Bool IsRightMod2() const { return (mnCode & MODKEY_RMOD2) ? sal_True : sal_False; }
+ sal_Bool IsRightMod3() const { return (mnCode & MODKEY_RMOD3) ? sal_True : sal_False; }
};
inline CommandModKeyData::CommandModKeyData()
@@ -300,7 +300,7 @@ inline CommandModKeyData::CommandModKeyData()
mnCode = 0L;
}
-inline CommandModKeyData::CommandModKeyData( USHORT nCode )
+inline CommandModKeyData::CommandModKeyData( sal_uInt16 nCode )
{
mnCode = nCode;
}
@@ -358,15 +358,15 @@ class VCL_DLLPUBLIC CommandDialogData
class VCL_DLLPUBLIC CommandSelectionChangeData
{
private:
- ULONG mnStart;
- ULONG mnEnd;
+ sal_uLong mnStart;
+ sal_uLong mnEnd;
public:
CommandSelectionChangeData();
- CommandSelectionChangeData( ULONG nStart, ULONG nEnd );
+ CommandSelectionChangeData( sal_uLong nStart, sal_uLong nEnd );
- ULONG GetStart() const { return mnStart; }
- ULONG GetEnd() const { return mnEnd; }
+ sal_uLong GetStart() const { return mnStart; }
+ sal_uLong GetEnd() const { return mnEnd; }
};
inline CommandSelectionChangeData::CommandSelectionChangeData()
@@ -374,8 +374,8 @@ inline CommandSelectionChangeData::CommandSelectionChangeData()
mnStart = mnEnd = 0;
}
-inline CommandSelectionChangeData::CommandSelectionChangeData( ULONG nStart,
- ULONG nEnd )
+inline CommandSelectionChangeData::CommandSelectionChangeData( sal_uLong nStart,
+ sal_uLong nEnd )
{
mnStart = nStart;
mnEnd = nEnd;
@@ -385,43 +385,43 @@ inline CommandSelectionChangeData::CommandSelectionChangeData( ULONG nStart,
// - CommandEvent -
// ----------------
-#define COMMAND_CONTEXTMENU ((USHORT)1)
-#define COMMAND_STARTDRAG ((USHORT)2)
-#define COMMAND_WHEEL ((USHORT)3)
-#define COMMAND_STARTAUTOSCROLL ((USHORT)4)
-#define COMMAND_AUTOSCROLL ((USHORT)5)
-#define COMMAND_VOICE ((USHORT)6)
-#define COMMAND_STARTEXTTEXTINPUT ((USHORT)7)
-#define COMMAND_EXTTEXTINPUT ((USHORT)8)
-#define COMMAND_ENDEXTTEXTINPUT ((USHORT)9)
-#define COMMAND_INPUTCONTEXTCHANGE ((USHORT)10)
-#define COMMAND_CURSORPOS ((USHORT)11)
-#define COMMAND_PASTESELECTION ((USHORT)12)
-#define COMMAND_MODKEYCHANGE ((USHORT)13)
-#define COMMAND_HANGUL_HANJA_CONVERSION ((USHORT)14)
-#define COMMAND_INPUTLANGUAGECHANGE ((USHORT)15)
-#define COMMAND_SHOWDIALOG ((USHORT)16)
-#define COMMAND_MEDIA ((USHORT)17)
-#define COMMAND_SELECTIONCHANGE ((USHORT)18)
-#define COMMAND_PREPARERECONVERSION ((USHORT)19)
-#define COMMAND_USER ((USHORT)4096)
+#define COMMAND_CONTEXTMENU ((sal_uInt16)1)
+#define COMMAND_STARTDRAG ((sal_uInt16)2)
+#define COMMAND_WHEEL ((sal_uInt16)3)
+#define COMMAND_STARTAUTOSCROLL ((sal_uInt16)4)
+#define COMMAND_AUTOSCROLL ((sal_uInt16)5)
+#define COMMAND_VOICE ((sal_uInt16)6)
+#define COMMAND_STARTEXTTEXTINPUT ((sal_uInt16)7)
+#define COMMAND_EXTTEXTINPUT ((sal_uInt16)8)
+#define COMMAND_ENDEXTTEXTINPUT ((sal_uInt16)9)
+#define COMMAND_INPUTCONTEXTCHANGE ((sal_uInt16)10)
+#define COMMAND_CURSORPOS ((sal_uInt16)11)
+#define COMMAND_PASTESELECTION ((sal_uInt16)12)
+#define COMMAND_MODKEYCHANGE ((sal_uInt16)13)
+#define COMMAND_HANGUL_HANJA_CONVERSION ((sal_uInt16)14)
+#define COMMAND_INPUTLANGUAGECHANGE ((sal_uInt16)15)
+#define COMMAND_SHOWDIALOG ((sal_uInt16)16)
+#define COMMAND_MEDIA ((sal_uInt16)17)
+#define COMMAND_SELECTIONCHANGE ((sal_uInt16)18)
+#define COMMAND_PREPARERECONVERSION ((sal_uInt16)19)
+#define COMMAND_USER ((sal_uInt16)4096)
class VCL_DLLPUBLIC CommandEvent
{
private:
Point maPos;
void* mpData;
- USHORT mnCommand;
- BOOL mbMouseEvent;
+ sal_uInt16 mnCommand;
+ sal_Bool mbMouseEvent;
public:
CommandEvent();
- CommandEvent( const Point& rMousePos, USHORT nCmd,
- BOOL bMEvt = FALSE, const void* pCmdData = NULL );
+ CommandEvent( const Point& rMousePos, sal_uInt16 nCmd,
+ sal_Bool bMEvt = sal_False, const void* pCmdData = NULL );
- USHORT GetCommand() const { return mnCommand; }
+ sal_uInt16 GetCommand() const { return mnCommand; }
const Point& GetMousePosPixel() const { return maPos; }
- BOOL IsMouseEvent() const { return mbMouseEvent; }
+ sal_Bool IsMouseEvent() const { return mbMouseEvent; }
void* GetData() const { return mpData; }
const CommandExtTextInputData* GetExtTextInputData() const;
@@ -439,11 +439,11 @@ inline CommandEvent::CommandEvent()
{
mpData = NULL;
mnCommand = 0;
- mbMouseEvent = FALSE;
+ mbMouseEvent = sal_False;
}
inline CommandEvent::CommandEvent( const Point& rMousePos,
- USHORT nCmd, BOOL bMEvt, const void* pCmdData ) :
+ sal_uInt16 nCmd, sal_Bool bMEvt, const void* pCmdData ) :
maPos( rMousePos )
{
mpData = (void*)pCmdData;
diff --git a/vcl/inc/vcl/combobox.h b/vcl/inc/vcl/combobox.h
index cfcec12d75bc..387c20d544be 100644
--- a/vcl/inc/vcl/combobox.h
+++ b/vcl/inc/vcl/combobox.h
@@ -29,11 +29,11 @@
#ifndef _SV_COMBOBOX_H
#define _SV_COMBOBOX_H
-#define COMBOBOX_APPEND ((USHORT)0xFFFF)
-#define COMBOBOX_ENTRY_NOTFOUND ((USHORT)0xFFFF)
-#define COMBOBOX_ERROR ((USHORT)0xFFFF)
+#define COMBOBOX_APPEND ((sal_uInt16)0xFFFF)
+#define COMBOBOX_ENTRY_NOTFOUND ((sal_uInt16)0xFFFF)
+#define COMBOBOX_ERROR ((sal_uInt16)0xFFFF)
-#define COMBOBOX_USERDRAW_SELECTED ((USHORT)0x0001)
+#define COMBOBOX_USERDRAW_SELECTED ((sal_uInt16)0x0001)
#endif // _SV_COMBOBOX_H
diff --git a/vcl/inc/vcl/combobox.hxx b/vcl/inc/vcl/combobox.hxx
index 3ab9f6dfa630..12385c9bd9e2 100644
--- a/vcl/inc/vcl/combobox.hxx
+++ b/vcl/inc/vcl/combobox.hxx
@@ -51,11 +51,11 @@ private:
ImplListBox* mpImplLB;
ImplBtn* mpBtn;
ImplListBoxFloatingWindow* mpFloatWin;
- USHORT mnDDHeight;
+ sal_uInt16 mnDDHeight;
xub_Unicode mcMultiSep;
- BOOL mbDDAutoSize : 1;
- BOOL mbSyntheticModify : 1;
- BOOL mbMatchCase : 1;
+ sal_Bool mbDDAutoSize : 1;
+ sal_Bool mbSyntheticModify : 1;
+ sal_Bool mbMatchCase : 1;
Link maSelectHdl;
Link maDoubleClickHdl;
@@ -81,7 +81,7 @@ protected:
protected:
ComboBox( WindowType nType );
- BOOL IsDropDownBox() const { return mpFloatWin ? TRUE : FALSE; }
+ sal_Bool IsDropDownBox() const { return mpFloatWin ? sal_True : sal_False; }
virtual void FillLayoutData() const;
public:
@@ -89,7 +89,7 @@ public:
ComboBox( Window* pParent, const ResId& rResId );
~ComboBox();
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual long PreNotify( NotifyEvent& rNEvt );
virtual long Notify( NotifyEvent& rNEvt );
@@ -104,7 +104,7 @@ public:
virtual const Wallpaper& GetDisplayBackground() const;
- virtual void SetPosSizePixel( long nX, long nY, long nWidth, long nHeight, USHORT nFlags = WINDOW_POSSIZE_ALL );
+ virtual void SetPosSizePixel( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize )
{ Edit::SetPosSizePixel( rNewPos, rNewSize ); }
void SetDropDownSizePixel( const Size& rNewSize )
@@ -115,56 +115,56 @@ public:
// returns empty rectangle in DropDown mode,
// else it returns the PosSize of the ListBox
- void SetDropDownLineCount( USHORT nLines );
- USHORT GetDropDownLineCount() const;
+ void SetDropDownLineCount( sal_uInt16 nLines );
+ sal_uInt16 GetDropDownLineCount() const;
- void EnableAutoSize( BOOL bAuto );
- BOOL IsAutoSizeEnabled() const { return mbDDAutoSize; }
+ void EnableAutoSize( sal_Bool bAuto );
+ sal_Bool IsAutoSizeEnabled() const { return mbDDAutoSize; }
- void EnableDDAutoWidth( BOOL b );
- BOOL IsDDAutoWidthEnabled() const;
+ void EnableDDAutoWidth( sal_Bool b );
+ sal_Bool IsDDAutoWidthEnabled() const;
void SetText( const XubString& rStr );
void SetText( const XubString& rStr, const Selection& rNewSelection );
- USHORT InsertEntry( const XubString& rStr, USHORT nPos = COMBOBOX_APPEND );
- USHORT InsertEntry( const XubString& rStr, const Image& rImage, USHORT nPos = COMBOBOX_APPEND );
+ sal_uInt16 InsertEntry( const XubString& rStr, sal_uInt16 nPos = COMBOBOX_APPEND );
+ sal_uInt16 InsertEntry( const XubString& rStr, const Image& rImage, sal_uInt16 nPos = COMBOBOX_APPEND );
void RemoveEntry( const XubString& rStr );
- void RemoveEntry( USHORT nPos );
+ void RemoveEntry( sal_uInt16 nPos );
void Clear();
- USHORT GetEntryPos( const XubString& rStr ) const;
- USHORT GetEntryPos( const void* pData ) const;
- Image GetEntryImage( USHORT nPos ) const;
- XubString GetEntry( USHORT nPos ) const;
- USHORT GetEntryCount() const;
+ sal_uInt16 GetEntryPos( const XubString& rStr ) const;
+ sal_uInt16 GetEntryPos( const void* pData ) const;
+ Image GetEntryImage( sal_uInt16 nPos ) const;
+ XubString GetEntry( sal_uInt16 nPos ) const;
+ sal_uInt16 GetEntryCount() const;
- BOOL IsTravelSelect() const;
- BOOL IsInDropDown() const;
+ sal_Bool IsTravelSelect() const;
+ sal_Bool IsInDropDown() const;
void ToggleDropDown();
- long CalcWindowSizePixel( USHORT nLines ) const;
+ long CalcWindowSizePixel( sal_uInt16 nLines ) const;
void SetUserItemSize( const Size& rSz );
const Size& GetUserItemSize() const;
- void EnableUserDraw( BOOL bUserDraw );
- BOOL IsUserDrawEnabled() const;
+ void EnableUserDraw( sal_Bool bUserDraw );
+ sal_Bool IsUserDrawEnabled() const;
- void DrawEntry( const UserDrawEvent& rEvt, BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos = FALSE );
- void SetBorderStyle( USHORT nBorderStyle );
+ void DrawEntry( const UserDrawEvent& rEvt, sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos = sal_False );
+ void SetBorderStyle( sal_uInt16 nBorderStyle );
- void SetSeparatorPos( USHORT n );
+ void SetSeparatorPos( sal_uInt16 n );
void SetSeparatorPos();
- USHORT GetSeparatorPos() const;
+ sal_uInt16 GetSeparatorPos() const;
- void EnableAutocomplete( BOOL bEnable, BOOL bMatchCase = FALSE );
- BOOL IsAutocompleteEnabled() const;
+ void EnableAutocomplete( sal_Bool bEnable, sal_Bool bMatchCase = sal_False );
+ sal_Bool IsAutocompleteEnabled() const;
- void EnableMultiSelection( BOOL bMulti );
- BOOL IsMultiSelectionEnabled() const;
+ void EnableMultiSelection( sal_Bool bMulti );
+ sal_Bool IsMultiSelectionEnabled() const;
void SetMultiSelectionSeparator( xub_Unicode cSep ) { mcMultiSep = cSep; }
xub_Unicode GetMultiSelectionSeparator() const { return mcMultiSep; }
@@ -177,32 +177,32 @@ public:
virtual Size GetOptimalSize(WindowSizeType eType) const;
Size CalcAdjustedSize( const Size& rPrefSize ) const;
using Edit::CalcSize;
- 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 SetMRUEntries( const XubString& rEntries, xub_Unicode cSep = ';' );
XubString GetMRUEntries( xub_Unicode cSep = ';' ) const;
- void SetMaxMRUCount( USHORT n );
- USHORT GetMaxMRUCount() const;
+ void SetMaxMRUCount( sal_uInt16 n );
+ sal_uInt16 GetMaxMRUCount() const;
- void SetEntryData( USHORT nPos, void* pNewData );
- void* GetEntryData( USHORT nPos ) const;
+ void SetEntryData( sal_uInt16 nPos, void* pNewData );
+ void* GetEntryData( sal_uInt16 nPos ) const;
- void SetTopEntry( USHORT nPos );
- void ShowProminentEntry( USHORT nPos );
- USHORT GetTopEntry() const;
+ void SetTopEntry( sal_uInt16 nPos );
+ void ShowProminentEntry( sal_uInt16 nPos );
+ sal_uInt16 GetTopEntry() const;
void SetProminentEntryType( ProminentEntry eType );
ProminentEntry GetProminentEntryType() const;
- USHORT GetDisplayLineCount() const;
+ sal_uInt16 GetDisplayLineCount() const;
- USHORT GetSelectEntryCount() const;
- USHORT GetSelectEntryPos( USHORT nSelIndex = 0 ) const;
- BOOL IsEntryPosSelected( USHORT nPos ) const;
- void SelectEntryPos( USHORT nPos, BOOL bSelect = TRUE );
+ sal_uInt16 GetSelectEntryCount() const;
+ sal_uInt16 GetSelectEntryPos( sal_uInt16 nSelIndex = 0 ) const;
+ sal_Bool IsEntryPosSelected( sal_uInt16 nPos ) const;
+ void SelectEntryPos( sal_uInt16 nPos, sal_Bool bSelect = sal_True );
void SetNoSelection();
- Rectangle GetBoundingRectangle( USHORT nItem ) const;
+ Rectangle GetBoundingRectangle( sal_uInt16 nItem ) const;
/** checks whether a certain point lies within the bounds of
a list item and returns the item as well as the character position
@@ -223,7 +223,7 @@ public:
if no item is at that point.
*/
using Control::GetIndexForPoint;
- long GetIndexForPoint( const Point& rPoint, USHORT& rPos ) const;
+ long GetIndexForPoint( const Point& rPoint, sal_uInt16& rPos ) const;
};
#endif // _COMBOBOX_HXX
diff --git a/vcl/inc/vcl/ctrl.hxx b/vcl/inc/vcl/ctrl.hxx
index 1790096f8cdd..71d7d88d6003 100644
--- a/vcl/inc/vcl/ctrl.hxx
+++ b/vcl/inc/vcl/ctrl.hxx
@@ -48,7 +48,7 @@ protected:
::vcl::ImplControlData* mpControlData;
private:
- BOOL mbHasFocus;
+ sal_Bool mbHasFocus;
Link maGetFocusHdl;
Link maLoseFocusHdl;
@@ -87,8 +87,8 @@ protected:
@return
if the Control instance has been destroyed in any of the call
*/
- BOOL ImplCallEventListenersAndHandler(
- ULONG nEvent, const Link& rHandler, void* pCaller
+ sal_Bool ImplCallEventListenersAndHandler(
+ sal_uLong nEvent, const Link& rHandler, void* pCaller
);
/** draws the given text onto the given device
@@ -100,7 +100,7 @@ protected:
directly at the target device, or taking the reference device into account) when returning.
*/
void DrawControlText( OutputDevice& _rTargetDevice, Rectangle& _io_rRect,
- const XubString& _rStr, USHORT _nStyle,
+ const XubString& _rStr, sal_uInt16 _nStyle,
MetricVector* _pVector, String* _pDisplayText ) const;
virtual const Font&
@@ -108,7 +108,7 @@ protected:
virtual const Color&
GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
- void ImplInitSettings( const BOOL _bFont, const BOOL _bForeground );
+ void ImplInitSettings( const sal_Bool _bFont, const sal_Bool _bForeground );
public:
SAL_DLLPRIVATE void ImplClearLayoutData() const;
diff --git a/vcl/inc/vcl/cursor.hxx b/vcl/inc/vcl/cursor.hxx
index f1f07957db96..8a6ecf482413 100644
--- a/vcl/inc/vcl/cursor.hxx
+++ b/vcl/inc/vcl/cursor.hxx
@@ -42,7 +42,7 @@ class Window;
// - Cursor-Styles -
// -----------------
-#define CURSOR_SHADOW ((USHORT)0x0001)
+#define CURSOR_SHADOW ((sal_uInt16)0x0001)
#define CURSOR_DIRECTION_NONE ((unsigned char)0x00)
#define CURSOR_DIRECTION_LTR ((unsigned char)0x01)
#define CURSOR_DIRECTION_RTL ((unsigned char)0x02)
@@ -61,15 +61,15 @@ private:
Size maSize; // Groesse
Point maPos; // Position
short mnOrientation; // Rotation
- USHORT mnStyle; // Style
- BOOL mbVisible; // Ist Cursor sichtbar
+ sal_uInt16 mnStyle; // Style
+ sal_Bool mbVisible; // Ist Cursor sichtbar
unsigned char mnDirection; // indicates direction
public:
SAL_DLLPRIVATE void ImplDraw();
SAL_DLLPRIVATE void ImplRestore();
DECL_DLLPRIVATE_LINK( ImplTimerHdl, AutoTimer* );
- SAL_DLLPRIVATE void ImplShow( BOOL bDrawDirect = TRUE );
+ SAL_DLLPRIVATE void ImplShow( sal_Bool bDrawDirect = sal_True );
SAL_DLLPRIVATE void ImplHide();
SAL_DLLPRIVATE void ImplNew();
@@ -78,12 +78,12 @@ public:
Cursor( const Cursor& rCursor );
~Cursor();
- void SetStyle( USHORT nStyle );
- USHORT GetStyle() const { return mnStyle; }
+ void SetStyle( sal_uInt16 nStyle );
+ sal_uInt16 GetStyle() const { return mnStyle; }
void Show();
void Hide();
- BOOL IsVisible() const { return mbVisible; }
+ sal_Bool IsVisible() const { return mbVisible; }
void SetWindow( Window* pWindow );
Window* GetWindow() const { return mpWindow; }
@@ -110,8 +110,8 @@ public:
unsigned char GetDirection() const { return mnDirection; }
Cursor& operator=( const Cursor& rCursor );
- BOOL operator==( const Cursor& rCursor ) const;
- BOOL operator!=( const Cursor& rCursor ) const
+ sal_Bool operator==( const Cursor& rCursor ) const;
+ sal_Bool operator!=( const Cursor& rCursor ) const
{ return !(Cursor::operator==( rCursor )); }
};
diff --git a/vcl/inc/vcl/cvtgrf.hxx b/vcl/inc/vcl/cvtgrf.hxx
index 37a3c271b52c..50d766f5565c 100644
--- a/vcl/inc/vcl/cvtgrf.hxx
+++ b/vcl/inc/vcl/cvtgrf.hxx
@@ -48,16 +48,16 @@ private:
ConvertData* mpConvertData;
public:
- SAL_DLLPRIVATE ULONG ImplConvert( ULONG nInFormat, void* pInBuffer, ULONG nInBufSize,
- void** ppOutBuffer, ULONG nOutFormat );
+ SAL_DLLPRIVATE sal_uLong ImplConvert( sal_uLong nInFormat, void* pInBuffer, sal_uLong nInBufSize,
+ void** ppOutBuffer, sal_uLong nOutFormat );
public:
GraphicConverter();
~GraphicConverter();
- static ULONG Import( SvStream& rIStm, Graphic& rGraphic, ULONG nFormat = CVT_UNKNOWN );
- static ULONG Export( SvStream& rOStm, const Graphic& rGraphic, ULONG nFormat );
+ static sal_uLong Import( SvStream& rIStm, Graphic& rGraphic, sal_uLong nFormat = CVT_UNKNOWN );
+ static sal_uLong Export( SvStream& rOStm, const Graphic& rGraphic, sal_uLong nFormat );
ConvertData* GetConvertData() { return mpConvertData; }
diff --git a/vcl/inc/vcl/cvtsvm.hxx b/vcl/inc/vcl/cvtsvm.hxx
index f7c45f50ed16..de4158e08efc 100644
--- a/vcl/inc/vcl/cvtsvm.hxx
+++ b/vcl/inc/vcl/cvtsvm.hxx
@@ -93,18 +93,18 @@
class Stack;
-class VCL_DLLPUBLIC SVMConverter
+class VCL_PLUGIN_PUBLIC SVMConverter
{
private:
SAL_DLLPRIVATE void ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf );
SAL_DLLPRIVATE void ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf );
- SAL_DLLPRIVATE ULONG ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
- VirtualDevice& rSaveVDev, BOOL& rRop_0_1,
+ SAL_DLLPRIVATE sal_uLong ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
+ VirtualDevice& rSaveVDev, sal_Bool& rRop_0_1,
Color& rLineCol, Stack& rLineColStack,
rtl_TextEncoding& rActualCharSet );
public:
- SVMConverter( SvStream& rIStm, GDIMetaFile& rMtf, ULONG nConvertMode );
+ SVMConverter( SvStream& rIStm, GDIMetaFile& rMtf, sal_uLong nConvertMode );
~SVMConverter() {}
private:
diff --git a/vcl/inc/vcl/dbggui.hxx b/vcl/inc/vcl/dbggui.hxx
index 326111273a1c..61d878de3451 100644
--- a/vcl/inc/vcl/dbggui.hxx
+++ b/vcl/inc/vcl/dbggui.hxx
@@ -51,7 +51,7 @@ void DbgDialogTest( Window* pWindow );
->DbgData::nWarningOut and ->DbgData::nTraceOut
@see DBG_OUT_USER_CHANNEL_0
*/
-USHORT DbgRegisterNamedUserChannel( const XubString& _rChannelUIName, DbgPrintLine pProc );
+sal_uInt16 DbgRegisterNamedUserChannel( const XubString& _rChannelUIName, DbgPrintLine pProc );
#define DBGGUI_INIT() DbgGUIInit()
#define DBGGUI_DEINIT() DbgGUIDeInit()
diff --git a/vcl/inc/vcl/decoview.hxx b/vcl/inc/vcl/decoview.hxx
index f5317c204a29..63434bea2830 100644
--- a/vcl/inc/vcl/decoview.hxx
+++ b/vcl/inc/vcl/decoview.hxx
@@ -43,45 +43,45 @@ class OutputDevice;
// ------------------------
// Flags for DrawSymbol()
-#define SYMBOL_DRAW_MONO ((USHORT)0x0001)
-#define SYMBOL_DRAW_DISABLE ((USHORT)0x0002)
+#define SYMBOL_DRAW_MONO ((sal_uInt16)0x0001)
+#define SYMBOL_DRAW_DISABLE ((sal_uInt16)0x0002)
// Flags for DrawFrame()
-#define FRAME_DRAW_IN ((USHORT)0x0001)
-#define FRAME_DRAW_OUT ((USHORT)0x0002)
-#define FRAME_DRAW_GROUP ((USHORT)0x0003)
-#define FRAME_DRAW_DOUBLEIN ((USHORT)0x0004)
-#define FRAME_DRAW_DOUBLEOUT ((USHORT)0x0005)
-#define FRAME_DRAW_MENU ((USHORT)0x0010)
-#define FRAME_DRAW_WINDOWBORDER ((USHORT)0x0020)
-#define FRAME_DRAW_BORDERWINDOWBORDER ((USHORT)0x0040)
-#define FRAME_DRAW_MONO ((USHORT)0x1000)
-#define FRAME_DRAW_NODRAW ((USHORT)0x8000)
-#define FRAME_DRAW_STYLE ((USHORT)0x000F)
+#define FRAME_DRAW_IN ((sal_uInt16)0x0001)
+#define FRAME_DRAW_OUT ((sal_uInt16)0x0002)
+#define FRAME_DRAW_GROUP ((sal_uInt16)0x0003)
+#define FRAME_DRAW_DOUBLEIN ((sal_uInt16)0x0004)
+#define FRAME_DRAW_DOUBLEOUT ((sal_uInt16)0x0005)
+#define FRAME_DRAW_MENU ((sal_uInt16)0x0010)
+#define FRAME_DRAW_WINDOWBORDER ((sal_uInt16)0x0020)
+#define FRAME_DRAW_BORDERWINDOWBORDER ((sal_uInt16)0x0040)
+#define FRAME_DRAW_MONO ((sal_uInt16)0x1000)
+#define FRAME_DRAW_NODRAW ((sal_uInt16)0x8000)
+#define FRAME_DRAW_STYLE ((sal_uInt16)0x000F)
// Flags for DrawHighlightFrame()
-#define FRAME_HIGHLIGHT_IN ((USHORT)0x0001)
-#define FRAME_HIGHLIGHT_OUT ((USHORT)0x0002)
-#define FRAME_HIGHLIGHT_TESTBACKGROUND ((USHORT)0x4000)
-#define FRAME_HIGHLIGHT_STYLE ((USHORT)0x000F)
+#define FRAME_HIGHLIGHT_IN ((sal_uInt16)0x0001)
+#define FRAME_HIGHLIGHT_OUT ((sal_uInt16)0x0002)
+#define FRAME_HIGHLIGHT_TESTBACKGROUND ((sal_uInt16)0x4000)
+#define FRAME_HIGHLIGHT_STYLE ((sal_uInt16)0x000F)
// Flags for DrawButton()
-#define BUTTON_DRAW_DEFAULT ((USHORT)0x0001)
-#define BUTTON_DRAW_NOLIGHTBORDER ((USHORT)0x0002)
-#define BUTTON_DRAW_PRESSED ((USHORT)0x0004)
-#define BUTTON_DRAW_CHECKED ((USHORT)0x0008)
-#define BUTTON_DRAW_DONTKNOW ((USHORT)0x0010)
-#define BUTTON_DRAW_MONO ((USHORT)0x0020)
-#define BUTTON_DRAW_NOFILL ((USHORT)0x0040)
-#define BUTTON_DRAW_DISABLED ((USHORT)0x0080)
-#define BUTTON_DRAW_HIGHLIGHT ((USHORT)0x0100)
-#define BUTTON_DRAW_FLAT ((USHORT)0x0200)
-#define BUTTON_DRAW_NOTOPLIGHTBORDER ((USHORT)0x0400)
-#define BUTTON_DRAW_NOBOTTOMSHADOWBORDER ((USHORT)0x0800)
-#define BUTTON_DRAW_NOLEFTLIGHTBORDER ((USHORT)0x1000)
-#define BUTTON_DRAW_NOTEXT ((USHORT)0x2000)
-#define BUTTON_DRAW_NOIMAGE ((USHORT)0x4000)
-#define BUTTON_DRAW_NODRAW ((USHORT)0x8000)
+#define BUTTON_DRAW_DEFAULT ((sal_uInt16)0x0001)
+#define BUTTON_DRAW_NOLIGHTBORDER ((sal_uInt16)0x0002)
+#define BUTTON_DRAW_PRESSED ((sal_uInt16)0x0004)
+#define BUTTON_DRAW_CHECKED ((sal_uInt16)0x0008)
+#define BUTTON_DRAW_DONTKNOW ((sal_uInt16)0x0010)
+#define BUTTON_DRAW_MONO ((sal_uInt16)0x0020)
+#define BUTTON_DRAW_NOFILL ((sal_uInt16)0x0040)
+#define BUTTON_DRAW_DISABLED ((sal_uInt16)0x0080)
+#define BUTTON_DRAW_HIGHLIGHT ((sal_uInt16)0x0100)
+#define BUTTON_DRAW_FLAT ((sal_uInt16)0x0200)
+#define BUTTON_DRAW_NOTOPLIGHTBORDER ((sal_uInt16)0x0400)
+#define BUTTON_DRAW_NOBOTTOMSHADOWBORDER ((sal_uInt16)0x0800)
+#define BUTTON_DRAW_NOLEFTLIGHTBORDER ((sal_uInt16)0x1000)
+#define BUTTON_DRAW_NOTEXT ((sal_uInt16)0x2000)
+#define BUTTON_DRAW_NOIMAGE ((sal_uInt16)0x4000)
+#define BUTTON_DRAW_NODRAW ((sal_uInt16)0x8000)
// ------------------
// - DecorationView -
@@ -97,14 +97,14 @@ public:
{ mpOutDev = pOutDev; }
void DrawSymbol( const Rectangle& rRect, SymbolType eType,
- const Color& rColor, USHORT nStyle = 0 );
+ const Color& rColor, sal_uInt16 nStyle = 0 );
void DrawFrame( const Rectangle& rRect,
const Color& rLeftTopColor,
const Color& rRightBottomColor );
void DrawHighlightFrame( const Rectangle& rRect,
- USHORT nStyle = FRAME_HIGHLIGHT_OUT );
- Rectangle DrawFrame( const Rectangle& rRect, USHORT nStyle = FRAME_DRAW_OUT );
- Rectangle DrawButton( const Rectangle& rRect, USHORT nStyle );
+ sal_uInt16 nStyle = FRAME_HIGHLIGHT_OUT );
+ Rectangle DrawFrame( const Rectangle& rRect, sal_uInt16 nStyle = FRAME_DRAW_OUT );
+ Rectangle DrawButton( const Rectangle& rRect, sal_uInt16 nStyle );
void DrawSeparator( const Point& rStart, const Point& rStop, bool bVertical = true );
};
diff --git a/vcl/inc/vcl/dialog.hxx b/vcl/inc/vcl/dialog.hxx
index 404b18127af8..7b8c3ac032f2 100644
--- a/vcl/inc/vcl/dialog.hxx
+++ b/vcl/inc/vcl/dialog.hxx
@@ -50,10 +50,10 @@ private:
Dialog* mpPrevExecuteDlg;
DialogImpl* mpDialogImpl;
long mnMousePositioned;
- BOOL mbInExecute;
- BOOL mbOldSaveBack;
- BOOL mbInClose;
- BOOL mbModalMode;
+ sal_Bool mbInExecute;
+ sal_Bool mbOldSaveBack;
+ sal_Bool mbInClose;
+ sal_Bool mbModalMode;
sal_Int8 mnCancelClose; //liuchen 2009-7-22, support Excel VBA UserForm_QueryClose event
SAL_DLLPRIVATE void ImplInitDialogData();
@@ -71,11 +71,11 @@ protected:
SAL_DLLPRIVATE void ImplCenterDialog();
public:
- SAL_DLLPRIVATE BOOL IsInClose() const { return mbInClose; }
+ SAL_DLLPRIVATE sal_Bool IsInClose() const { return mbInClose; }
protected:
Dialog( WindowType nType );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
public:
Dialog( Window* pParent, WinBits nStyle = WB_STDDIALOG );
@@ -86,10 +86,10 @@ public:
virtual void StateChanged( StateChangedType nStateChange );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
- virtual BOOL Close();
+ virtual sal_Bool Close();
virtual short Execute();
- BOOL IsInExecute() const { return mbInExecute; }
+ sal_Bool IsInExecute() const { return mbInExecute; }
sal_Int8 GetCloseFlag() const { return mnCancelClose; } //liuchen 2009-7-22, support Excel VBA UserForm_QueryClose event
void SetCloseFlag( sal_Int8 nCancel ) { mnCancelClose = nCancel; } //liuchen 2009-7-22, support Excel VBA UserForm_QueryClose event
@@ -99,10 +99,10 @@ public:
public:
// Link impl: DECL_LINK( MyEndDialogHdl, Dialog* ); <= param is dialog just ended
virtual void StartExecuteModal( const Link& rEndDialogHdl );
- BOOL IsStartedModal() const;
+ sal_Bool IsStartedModal() const;
long GetResult() const;
private:
- BOOL ImplStartExecuteModal();
+ sal_Bool ImplStartExecuteModal();
void ImplEndExecuteModal();
public:
@@ -115,9 +115,9 @@ public:
void GetDrawWindowBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
- void SetModalInputMode( BOOL bModal );
- void SetModalInputMode( BOOL bModal, BOOL bSubModalDialogs );
- BOOL IsModalInputMode() const { return mbModalMode; }
+ void SetModalInputMode( sal_Bool bModal );
+ void SetModalInputMode( sal_Bool bModal, sal_Bool bSubModalDialogs );
+ sal_Bool IsModalInputMode() const { return mbModalMode; }
void GrabFocusToFirstControl();
};
@@ -149,7 +149,7 @@ public:
private:
using Window::Show;
- void Show( BOOL bVisible = TRUE );
+ void Show( sal_Bool bVisible = sal_True );
using Window::Hide;
void Hide();
diff --git a/vcl/inc/vcl/displayconnectiondispatch.hxx b/vcl/inc/vcl/displayconnectiondispatch.hxx
new file mode 100644
index 000000000000..fea1d0b7cba9
--- /dev/null
+++ b/vcl/inc/vcl/displayconnectiondispatch.hxx
@@ -0,0 +1,52 @@
+/*************************************************************************
+*
+* 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 INCLUDED_VCL_DISPLAYCONNECTIONDISPATCH_HXX
+#define INCLUDED_VCL_DISPLAYCONNECTIONDISPATCH_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/awt/XDisplayConnection.hpp"
+#include "cppuhelper/implbase1.hxx"
+
+namespace vcl {
+
+class DisplayConnectionDispatch:
+ public cppu::WeakImplHelper1< com::sun::star::awt::XDisplayConnection >
+{
+public:
+ virtual bool dispatchEvent(void * pData, int nBytes) = 0;
+
+ virtual bool dispatchErrorEvent(void * pData, int nBytes) = 0;
+
+protected:
+ virtual ~DisplayConnectionDispatch() {}
+};
+
+}
+
+#endif
diff --git a/vcl/inc/vcl/dllapi.h b/vcl/inc/vcl/dllapi.h
index dfe59bb5b739..3ec80dd0ec7d 100644
--- a/vcl/inc/vcl/dllapi.h
+++ b/vcl/inc/vcl/dllapi.h
@@ -38,6 +38,12 @@
#define VCL_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
#endif
+#if defined UNX && ! defined MACOS
+#define VCL_PLUGIN_PUBLIC VCL_DLLPUBLIC
+#else
+#define VCL_PLUGIN_PUBLIC SAL_DLLPRIVATE
+#endif
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/dockingarea.hxx b/vcl/inc/vcl/dockingarea.hxx
index cc56a57f3315..7ba82d380f58 100644
--- a/vcl/inc/vcl/dockingarea.hxx
+++ b/vcl/inc/vcl/dockingarea.hxx
@@ -54,7 +54,7 @@ public:
void SetAlign( WindowAlign eNewAlign );
WindowAlign GetAlign() const;
- BOOL IsHorizontal() const;
+ sal_Bool IsHorizontal() const;
virtual void Paint( const Rectangle& rRect );
virtual void Resize();
diff --git a/vcl/inc/vcl/dockwin.hxx b/vcl/inc/vcl/dockwin.hxx
index 4950e267a786..5721d979b188 100644
--- a/vcl/inc/vcl/dockwin.hxx
+++ b/vcl/inc/vcl/dockwin.hxx
@@ -39,24 +39,24 @@ struct DockingData
{
Point maMousePos; // in
Rectangle maTrackRect; // in/out
- BOOL mbFloating; // out
- BOOL mbLivemode; // in
- BOOL mbInteractive; // in
+ sal_Bool mbFloating; // out
+ sal_Bool mbLivemode; // in
+ sal_Bool mbInteractive; // in
DockingData() {};
- DockingData( const Point& rPt, const Rectangle& rRect, BOOL b) :
- maMousePos( rPt ), maTrackRect( rRect ), mbFloating( b ), mbLivemode( FALSE ), mbInteractive( TRUE )
+ DockingData( const Point& rPt, const Rectangle& rRect, sal_Bool b) :
+ maMousePos( rPt ), maTrackRect( rRect ), mbFloating( b ), mbLivemode( sal_False ), mbInteractive( sal_True )
{};
};
struct EndDockingData
{
Rectangle maWindowRect; // in
- BOOL mbFloating; // in
- BOOL mbCancelled; // in
+ sal_Bool mbFloating; // in
+ sal_Bool mbCancelled; // in
EndDockingData() {};
- EndDockingData( const Rectangle& rRect, BOOL b, BOOL bCancelled ) :
+ EndDockingData( const Rectangle& rRect, sal_Bool b, sal_Bool bCancelled ) :
maWindowRect( rRect ), mbFloating( b ), mbCancelled( bCancelled )
{};
};
@@ -64,10 +64,10 @@ struct EndDockingData
struct EndPopupModeData
{
Point maFloatingPos; // in
- BOOL mbTearoff; // in
+ sal_Bool mbTearoff; // in
EndPopupModeData() {};
- EndPopupModeData( const Point& rPos, BOOL bTearoff ) :
+ EndPopupModeData( const Point& rPos, sal_Bool bTearoff ) :
maFloatingPos( rPos ), mbTearoff( bTearoff )
{};
};
@@ -111,7 +111,7 @@ private:
sal_Int32 mnDockRight;
sal_Int32 mnDockBottom;
WinBits mnFloatBits;
- BOOL mbDockCanceled:1,
+ sal_Bool mbDockCanceled:1,
mbFloatPrevented:1,
mbDockable:1,
mbDocking:1,
@@ -129,21 +129,21 @@ private:
void ImplInitData();
DECL_LINK( PopupModeEnd, void* );
- void ImplEnableStartDocking( BOOL bEnable = TRUE ) { mbStartDockingEnabled = bEnable; }
- BOOL ImplStartDockingEnabled() { return mbStartDockingEnabled; }
+ void ImplEnableStartDocking( sal_Bool bEnable = sal_True ) { mbStartDockingEnabled = bEnable; }
+ sal_Bool ImplStartDockingEnabled() { return mbStartDockingEnabled; }
public:
ImplDockingWindowWrapper( const Window *pWindow );
virtual ~ImplDockingWindowWrapper();
Window* GetWindow() { return mpDockingWindow; }
- BOOL ImplStartDocking( const Point& rPos );
+ sal_Bool ImplStartDocking( const Point& rPos );
// those methods actually call the corresponding handlers
void StartDocking( const Point& rPos, Rectangle& rRect );
- BOOL Docking( const Point& rPos, Rectangle& rRect );
- void EndDocking( const Rectangle& rRect, BOOL bFloatMode );
- BOOL PrepareToggleFloatingMode();
+ sal_Bool Docking( const Point& rPos, Rectangle& rRect );
+ void EndDocking( const Rectangle& rRect, sal_Bool bFloatMode );
+ sal_Bool PrepareToggleFloatingMode();
void ToggleFloatingMode();
void SetDragArea( const Rectangle& rRect );
@@ -151,29 +151,29 @@ public:
void Lock();
void Unlock();
- BOOL IsLocked() const;
+ sal_Bool IsLocked() const;
- void StartPopupMode( ToolBox* pParentToolBox, ULONG nPopupModeFlags );
- BOOL IsInPopupMode() const;
+ void StartPopupMode( ToolBox* pParentToolBox, sal_uLong nPopupModeFlags );
+ sal_Bool IsInPopupMode() const;
- void TitleButtonClick( USHORT nButton );
+ void TitleButtonClick( sal_uInt16 nButton );
void Pin();
void Roll();
void PopupModeEnd();
void Resizing( Size& rSize );
- BOOL Close();
+ sal_Bool Close();
void Tracking( const TrackingEvent& rTEvt );
long Notify( NotifyEvent& rNEvt );
- void ShowTitleButton( USHORT nButton, BOOL bVisible = TRUE );
- BOOL IsTitleButtonVisible( USHORT nButton ) const;
+ void ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible = sal_True );
+ sal_Bool IsTitleButtonVisible( sal_uInt16 nButton ) const;
- void SetPin( BOOL bPin );
- BOOL IsPined() const;
+ void SetPin( sal_Bool bPin );
+ sal_Bool IsPined() const;
void RollUp();
void RollDown();
- BOOL IsRollUp() const;
+ sal_Bool IsRollUp() const;
void SetRollUpOutputSizePixel( const Size& rSize );
Size GetRollUpOutputSizePixel() const;
@@ -184,13 +184,13 @@ public:
void SetMaxOutputSizePixel( const Size& rSize );
const Size& GetMaxOutputSizePixel() const;
- BOOL IsDocking() const { return mbDocking; }
- BOOL IsDockable() const { return mbDockable; }
- BOOL IsDockingCanceled() const { return mbDockCanceled; }
- BOOL IsFloatingPrevented() const { return mbFloatPrevented; }
+ sal_Bool IsDocking() const { return mbDocking; }
+ sal_Bool IsDockable() const { return mbDockable; }
+ sal_Bool IsDockingCanceled() const { return mbDockCanceled; }
+ sal_Bool IsFloatingPrevented() const { return mbFloatPrevented; }
- void SetFloatingMode( BOOL bFloatMode = FALSE );
- BOOL IsFloatingMode() const;
+ void SetFloatingMode( sal_Bool bFloatMode = sal_False );
+ sal_Bool IsFloatingMode() const;
FloatingWindow* GetFloatingWindow() const { return mpFloatWin; }
void SetFloatingPos( const Point& rNewPos );
@@ -202,7 +202,7 @@ public:
virtual void SetPosSizePixel( long nX, long nY,
long nWidth, long nHeight,
- USHORT nFlags = WINDOW_POSSIZE_ALL );
+ sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
void SetPosSizePixel( const Point& rNewPos,
const Size& rNewSize )
{ mpDockingWindow->SetPosSizePixel( rNewPos, rNewSize ); }
@@ -225,26 +225,26 @@ public:
void RemoveWindow( const Window *pWin );
ImplDockingWindowWrapper* GetDockingWindowWrapper( const Window *pWin );
- BOOL IsDockable( const Window *pWin );
+ sal_Bool IsDockable( const Window *pWin );
- BOOL IsFloating( const Window *pWin );
- void SetFloatingMode( const Window *pWin, BOOL bFloating );
+ sal_Bool IsFloating( const Window *pWin );
+ void SetFloatingMode( const Window *pWin, sal_Bool bFloating );
void Lock( const Window *pWin );
void Unlock( const Window *pWin );
- BOOL IsLocked( const Window *pWin );
+ sal_Bool IsLocked( const Window *pWin );
void StartPopupMode( ToolBox *pParentToolBox, const Window *pWin );
- void StartPopupMode( ToolBox *pParentToolBox, const Window *pWin, ULONG nPopupModeFlags );
+ void StartPopupMode( ToolBox *pParentToolBox, const Window *pWin, sal_uLong nPopupModeFlags );
- BOOL IsInPopupMode( const Window *pWin );
+ sal_Bool IsInPopupMode( const Window *pWin );
void EndPopupMode( const Window *pWin );
// required because those methods are not virtual in Window (!!!) and must
// be availbale from the toolkit
void SetPosSizePixel( Window *pWin, long nX, long nY,
long nWidth, long nHeight,
- USHORT nFlags = WINDOW_POSSIZE_ALL );
+ sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
Rectangle GetPosSizePixel( const Window *pWin );
};
@@ -274,7 +274,7 @@ private:
sal_Int32 mnDockRight;
sal_Int32 mnDockBottom;
WinBits mnFloatBits;
- BOOL mbDockCanceled:1,
+ sal_Bool mbDockCanceled:1,
mbDockPrevented:1,
mbFloatPrevented:1,
mbDockable:1,
@@ -301,7 +301,7 @@ protected:
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
public:
- SAL_DLLPRIVATE BOOL ImplStartDocking( const Point& rPos );
+ SAL_DLLPRIVATE sal_Bool ImplStartDocking( const Point& rPos );
protected:
DockingWindow( WindowType nType );
@@ -312,31 +312,31 @@ public:
~DockingWindow();
virtual void StartDocking();
- virtual BOOL Docking( const Point& rPos, Rectangle& rRect );
- virtual void EndDocking( const Rectangle& rRect, BOOL bFloatMode );
- virtual BOOL PrepareToggleFloatingMode();
+ virtual sal_Bool Docking( const Point& rPos, Rectangle& rRect );
+ virtual void EndDocking( const Rectangle& rRect, sal_Bool bFloatMode );
+ virtual sal_Bool PrepareToggleFloatingMode();
virtual void ToggleFloatingMode();
- virtual void TitleButtonClick( USHORT nButton );
+ virtual void TitleButtonClick( sal_uInt16 nButton );
virtual void Pin();
virtual void Roll();
virtual void PopupModeEnd();
virtual void Resizing( Size& rSize );
- virtual BOOL Close();
+ virtual sal_Bool Close();
virtual void Tracking( const TrackingEvent& rTEvt );
virtual long Notify( NotifyEvent& rNEvt );
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
- void ShowTitleButton( USHORT nButton, BOOL bVisible = TRUE );
- BOOL IsTitleButtonVisible( USHORT nButton ) const;
+ void ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible = sal_True );
+ sal_Bool IsTitleButtonVisible( sal_uInt16 nButton ) const;
- void SetPin( BOOL bPin );
- BOOL IsPined() const;
+ void SetPin( sal_Bool bPin );
+ sal_Bool IsPined() const;
void RollUp();
void RollDown();
- BOOL IsRollUp() const;
+ sal_Bool IsRollUp() const;
void SetRollUpOutputSizePixel( const Size& rSize );
Size GetRollUpOutputSizePixel() const;
@@ -347,14 +347,14 @@ public:
void SetMaxOutputSizePixel( const Size& rSize );
const Size& GetMaxOutputSizePixel() const;
- BOOL IsDocking() const { return mbDocking; }
- BOOL IsDockable() const { return mbDockable; }
- BOOL IsDockingCanceled() const { return mbDockCanceled; }
- BOOL IsDockingPrevented() const { return mbDockPrevented; }
- BOOL IsFloatingPrevented() const { return mbFloatPrevented; }
+ sal_Bool IsDocking() const { return mbDocking; }
+ sal_Bool IsDockable() const { return mbDockable; }
+ sal_Bool IsDockingCanceled() const { return mbDockCanceled; }
+ sal_Bool IsDockingPrevented() const { return mbDockPrevented; }
+ sal_Bool IsFloatingPrevented() const { return mbFloatPrevented; }
- void SetFloatingMode( BOOL bFloatMode = FALSE );
- BOOL IsFloatingMode() const;
+ void SetFloatingMode( sal_Bool bFloatMode = sal_False );
+ sal_Bool IsFloatingMode() const;
FloatingWindow* GetFloatingWindow() const { return mpFloatWin; }
void SetFloatingPos( const Point& rNewPos );
@@ -366,7 +366,7 @@ public:
virtual void SetPosSizePixel( long nX, long nY,
long nWidth, long nHeight,
- USHORT nFlags = WINDOW_POSSIZE_ALL );
+ sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
void SetPosSizePixel( const Point& rNewPos,
const Size& rNewSize )
{ Window::SetPosSizePixel( rNewPos, rNewSize ); }
@@ -376,14 +376,14 @@ public:
Size GetOutputSizePixel() const;
};
-inline void DockingWindow::SetPin( BOOL bPin )
+inline void DockingWindow::SetPin( sal_Bool bPin )
{
if ( mpFloatWin )
mpFloatWin->SetPin( bPin );
mbPined = bPin;
}
-inline BOOL DockingWindow::IsPined() const
+inline sal_Bool DockingWindow::IsPined() const
{
if ( mpFloatWin )
return mpFloatWin->IsPined();
@@ -394,17 +394,17 @@ inline void DockingWindow::RollUp()
{
if ( mpFloatWin )
mpFloatWin->RollUp();
- mbRollUp = TRUE;
+ mbRollUp = sal_True;
}
inline void DockingWindow::RollDown()
{
if ( mpFloatWin )
mpFloatWin->RollDown();
- mbRollUp = FALSE;
+ mbRollUp = sal_False;
}
-inline BOOL DockingWindow::IsRollUp() const
+inline sal_Bool DockingWindow::IsRollUp() const
{
if ( mpFloatWin )
return mpFloatWin->IsRollUp();
diff --git a/vcl/inc/vcl/edit.hxx b/vcl/inc/vcl/edit.hxx
index 6b0ca12eae8e..0263daa5a427 100644..100755
--- a/vcl/inc/vcl/edit.hxx
+++ b/vcl/inc/vcl/edit.hxx
@@ -77,11 +77,11 @@ private:
XubString maRedoText;
long mnXOffset;
Selection maSelection;
- USHORT mnAlign;
+ sal_uInt16 mnAlign;
xub_StrLen mnMaxTextLen;
AutocompleteAction meAutocompleteAction;
xub_Unicode mcEchoChar;
- BOOL mbModified:1,
+ sal_Bool mbModified:1,
mbInternModified:1,
mbReadOnly:1,
mbInsertMode:1,
@@ -101,19 +101,19 @@ private:
SAL_DLLPRIVATE XubString ImplGetText() const;
SAL_DLLPRIVATE void ImplRepaint( xub_StrLen nStart = 0, xub_StrLen nEnd = STRING_LEN, bool bLayout = false );
SAL_DLLPRIVATE void ImplInvalidateOrRepaint( xub_StrLen nStart = 0, xub_StrLen nEnd = STRING_LEN );
- SAL_DLLPRIVATE void ImplDelete( const Selection& rSelection, BYTE nDirection, BYTE nMode );
+ SAL_DLLPRIVATE void ImplDelete( const Selection& rSelection, sal_uInt8 nDirection, sal_uInt8 nMode );
SAL_DLLPRIVATE void ImplSetText( const XubString& rStr, const Selection* pNewSelection = 0 );
SAL_DLLPRIVATE void ImplInsertText( const XubString& rStr, const Selection* pNewSelection = 0, sal_Bool bIsUserInput = sal_False );
SAL_DLLPRIVATE String ImplGetValidString( const String& rString ) const;
SAL_DLLPRIVATE void ImplClearBackground( long nXStart, long nXEnd );
- SAL_DLLPRIVATE void ImplShowCursor( BOOL bOnlyIfVisible = TRUE );
+ SAL_DLLPRIVATE void ImplShowCursor( sal_Bool bOnlyIfVisible = sal_True );
SAL_DLLPRIVATE void ImplAlign();
SAL_DLLPRIVATE void ImplAlignAndPaint();
SAL_DLLPRIVATE xub_StrLen ImplGetCharPos( const Point& rWindowPos ) const;
- SAL_DLLPRIVATE void ImplSetCursorPos( xub_StrLen nChar, BOOL bSelect );
+ SAL_DLLPRIVATE void ImplSetCursorPos( xub_StrLen nChar, sal_Bool bSelect );
SAL_DLLPRIVATE void ImplShowDDCursor();
SAL_DLLPRIVATE void ImplHideDDCursor();
- SAL_DLLPRIVATE BOOL ImplHandleKeyEvent( const KeyEvent& rKEvt );
+ SAL_DLLPRIVATE sal_Bool ImplHandleKeyEvent( const KeyEvent& rKEvt );
SAL_DLLPRIVATE void ImplCopyToSelectionClipboard();
SAL_DLLPRIVATE void ImplCopy( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard );
SAL_DLLPRIVATE void ImplPaste( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard );
@@ -127,9 +127,9 @@ protected:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- SAL_DLLPRIVATE void ImplSetSelection( const Selection& rSelection, BOOL bPaint = TRUE );
+ SAL_DLLPRIVATE void ImplSetSelection( const Selection& rSelection, sal_Bool bPaint = sal_True );
SAL_DLLPRIVATE int ImplGetNativeControlType();
static SAL_DLLPRIVATE void ImplInvalidateOutermostBorder( Window* pWin );
@@ -165,7 +165,7 @@ public:
virtual void KeyInput( const KeyEvent& rKEvt );
virtual void Paint( const Rectangle& rRect );
virtual void Resize();
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void GetFocus();
virtual void LoseFocus();
virtual void Tracking( const TrackingEvent& rTEvt );
@@ -177,24 +177,24 @@ public:
virtual void Modify();
virtual void UpdateData();
- static BOOL IsCharInput( const KeyEvent& rKEvt );
+ static sal_Bool IsCharInput( const KeyEvent& rKEvt );
virtual void SetModifyFlag();
virtual void ClearModifyFlag();
- virtual BOOL IsModified() const { return mpSubEdit ? mpSubEdit->mbModified : mbModified; }
+ virtual sal_Bool IsModified() const { return mpSubEdit ? mpSubEdit->mbModified : mbModified; }
- virtual void EnableUpdateData( ULONG nTimeout = EDIT_UPDATEDATA_TIMEOUT );
+ virtual void EnableUpdateData( sal_uLong nTimeout = EDIT_UPDATEDATA_TIMEOUT );
virtual void DisableUpdateData() { delete mpUpdateDataTimer; mpUpdateDataTimer = NULL; }
- virtual ULONG IsUpdateDataEnabled() const;
+ virtual sal_uLong IsUpdateDataEnabled() const;
void SetEchoChar( xub_Unicode c );
xub_Unicode GetEchoChar() const { return mcEchoChar; }
- virtual void SetReadOnly( BOOL bReadOnly = TRUE );
- virtual BOOL IsReadOnly() const { return mbReadOnly; }
+ virtual void SetReadOnly( sal_Bool bReadOnly = sal_True );
+ virtual sal_Bool IsReadOnly() const { return mbReadOnly; }
- void SetInsertMode( BOOL bInsert );
- BOOL IsInsertMode() const;
+ void SetInsertMode( sal_Bool bInsert );
+ sal_Bool IsInsertMode() const;
virtual void SetMaxTextLen( xub_StrLen nMaxLen = EDIT_NOLIMIT );
virtual xub_StrLen GetMaxTextLen() const { return mnMaxTextLen; }
@@ -232,7 +232,7 @@ public:
virtual Size CalcMinimumSize() const;
virtual Size GetOptimalSize(WindowSizeType eType) const;
- virtual Size CalcSize( USHORT nChars ) const;
+ virtual Size CalcSize( sal_uInt16 nChars ) const;
virtual xub_StrLen GetMaxVisChars() const;
xub_StrLen GetCharPos( const Point& rWindowPos ) const;
@@ -248,14 +248,18 @@ public:
virtual XubString GetSurroundingText() const;
virtual Selection GetSurroundingTextSelection() const;
+
+ // returns the minimum size a bordered Edit should have given the current
+ // global style settings (needed by sc's inputwin.cxx)
+ static Size GetMinimumEditSize();
};
-inline ULONG Edit::IsUpdateDataEnabled() const
+inline sal_uLong Edit::IsUpdateDataEnabled() const
{
if ( mpUpdateDataTimer )
return mpUpdateDataTimer->GetTimeout();
else
- return FALSE;
+ return sal_False;
}
#endif // _SV_EDIT_HXX
diff --git a/vcl/inc/vcl/event.hxx b/vcl/inc/vcl/event.hxx
index 83902ad6b1af..9e8666ea7c78 100644
--- a/vcl/inc/vcl/event.hxx
+++ b/vcl/inc/vcl/event.hxx
@@ -58,13 +58,13 @@ class VCL_DLLPUBLIC KeyEvent
{
private:
KeyCode maKeyCode;
- USHORT mnRepeat;
+ sal_uInt16 mnRepeat;
xub_Unicode mnCharCode;
public:
KeyEvent();
KeyEvent( xub_Unicode nChar, const KeyCode& rKeyCode,
- USHORT nRepeat = 0 );
+ sal_uInt16 nRepeat = 0 );
/** inits this vcl KeyEvent with all settings from the given awt event **/
KeyEvent( const ::com::sun::star::awt::KeyEvent& rEvent );
@@ -74,7 +74,7 @@ public:
xub_Unicode GetCharCode() const { return mnCharCode; }
const KeyCode& GetKeyCode() const { return maKeyCode; }
- USHORT GetRepeat() const { return mnRepeat; }
+ sal_uInt16 GetRepeat() const { return mnRepeat; }
KeyEvent LogicalTextDirectionality (TextDirectionality eMode) const;
KeyEvent (const KeyEvent& rKeyEvent);
@@ -88,7 +88,7 @@ inline KeyEvent::KeyEvent()
}
inline KeyEvent::KeyEvent( xub_Unicode nChar, const KeyCode& rKeyCode,
- USHORT nRepeat ) :
+ sal_uInt16 nRepeat ) :
maKeyCode( rKeyCode )
{
@@ -101,24 +101,24 @@ inline KeyEvent::KeyEvent( xub_Unicode nChar, const KeyCode& rKeyCode,
// --------------------
// Maus-Move-Modi
-#define MOUSE_SIMPLEMOVE ((USHORT)0x0001)
-#define MOUSE_DRAGMOVE ((USHORT)0x0002)
-#define MOUSE_DRAGCOPY ((USHORT)0x0004)
-#define MOUSE_ENTERWINDOW ((USHORT)0x0010)
-#define MOUSE_LEAVEWINDOW ((USHORT)0x0020)
-#define MOUSE_SYNTHETIC ((USHORT)0x0040)
-#define MOUSE_MODIFIERCHANGED ((USHORT)0x0080)
+#define MOUSE_SIMPLEMOVE ((sal_uInt16)0x0001)
+#define MOUSE_DRAGMOVE ((sal_uInt16)0x0002)
+#define MOUSE_DRAGCOPY ((sal_uInt16)0x0004)
+#define MOUSE_ENTERWINDOW ((sal_uInt16)0x0010)
+#define MOUSE_LEAVEWINDOW ((sal_uInt16)0x0020)
+#define MOUSE_SYNTHETIC ((sal_uInt16)0x0040)
+#define MOUSE_MODIFIERCHANGED ((sal_uInt16)0x0080)
// Maus-Button-Down/Up-Modi
-#define MOUSE_SIMPLECLICK ((USHORT)0x0001)
-#define MOUSE_SELECT ((USHORT)0x0002)
-#define MOUSE_MULTISELECT ((USHORT)0x0004)
-#define MOUSE_RANGESELECT ((USHORT)0x0008)
+#define MOUSE_SIMPLECLICK ((sal_uInt16)0x0001)
+#define MOUSE_SELECT ((sal_uInt16)0x0002)
+#define MOUSE_MULTISELECT ((sal_uInt16)0x0004)
+#define MOUSE_RANGESELECT ((sal_uInt16)0x0008)
// Maus-Buttons
-#define MOUSE_LEFT ((USHORT)0x0001)
-#define MOUSE_MIDDLE ((USHORT)0x0002)
-#define MOUSE_RIGHT ((USHORT)0x0004)
+#define MOUSE_LEFT ((sal_uInt16)0x0001)
+#define MOUSE_MIDDLE ((sal_uInt16)0x0002)
+#define MOUSE_RIGHT ((sal_uInt16)0x0004)
// --------------
// - MouseEvent -
@@ -128,53 +128,53 @@ class VCL_DLLPUBLIC MouseEvent
{
private:
Point maPos;
- USHORT mnMode;
- USHORT mnClicks;
- USHORT mnCode;
+ sal_uInt16 mnMode;
+ sal_uInt16 mnClicks;
+ sal_uInt16 mnCode;
public:
MouseEvent();
- MouseEvent( const Point& rPos, USHORT nClicks = 1,
- USHORT nMode = 0, USHORT nButtons = 0,
- USHORT nModifier = 0 );
+ MouseEvent( const Point& rPos, sal_uInt16 nClicks = 1,
+ sal_uInt16 nMode = 0, sal_uInt16 nButtons = 0,
+ sal_uInt16 nModifier = 0 );
const Point& GetPosPixel() const { return maPos; }
- USHORT GetMode() const { return mnMode; }
+ sal_uInt16 GetMode() const { return mnMode; }
/** inits this vcl KeyEvent with all settings from the given awt event **/
MouseEvent( const ::com::sun::star::awt::MouseEvent& rEvent );
/** fills out the given awt KeyEvent with all settings from this vcl event **/
void InitMouseEvent( ::com::sun::star::awt::MouseEvent& rEvent ) const;
- USHORT GetClicks() const { return mnClicks; }
+ sal_uInt16 GetClicks() const { return mnClicks; }
- BOOL IsEnterWindow() const
+ sal_Bool IsEnterWindow() const
{ return ((mnMode & MOUSE_ENTERWINDOW) != 0); }
- BOOL IsLeaveWindow() const
+ sal_Bool IsLeaveWindow() const
{ return ((mnMode & MOUSE_LEAVEWINDOW) != 0); }
- BOOL IsSynthetic() const
+ sal_Bool IsSynthetic() const
{ return ((mnMode & MOUSE_SYNTHETIC) != 0); }
- BOOL IsModifierChanged() const
+ sal_Bool IsModifierChanged() const
{ return ((mnMode & MOUSE_MODIFIERCHANGED) != 0); }
- USHORT GetButtons() const
+ sal_uInt16 GetButtons() const
{ return (mnCode & (MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT)); }
- BOOL IsLeft() const
+ sal_Bool IsLeft() const
{ return ((mnCode & MOUSE_LEFT) != 0); }
- BOOL IsMiddle() const
+ sal_Bool IsMiddle() const
{ return ((mnCode & MOUSE_MIDDLE) != 0); }
- BOOL IsRight() const
+ sal_Bool IsRight() const
{ return ((mnCode & MOUSE_RIGHT) != 0); }
- USHORT GetModifier() const
+ sal_uInt16 GetModifier() const
{ return (mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)); }
bool IsShift() const
{ return ((mnCode & KEY_SHIFT) != 0); }
- BOOL IsMod1() const
+ sal_Bool IsMod1() const
{ return ((mnCode & KEY_MOD1) != 0); }
- BOOL IsMod2() const
+ sal_Bool IsMod2() const
{ return ((mnCode & KEY_MOD2) != 0); }
- BOOL IsMod3() const
+ sal_Bool IsMod3() const
{ return ((mnCode & KEY_MOD3) != 0); }
};
@@ -185,9 +185,9 @@ inline MouseEvent::MouseEvent()
mnCode = 0;
}
-inline MouseEvent::MouseEvent( const Point& rPos, USHORT nClicks,
- USHORT nMode,
- USHORT nButtons, USHORT nModifier ) :
+inline MouseEvent::MouseEvent( const Point& rPos, sal_uInt16 nClicks,
+ sal_uInt16 nMode,
+ sal_uInt16 nButtons, sal_uInt16 nModifier ) :
maPos( rPos )
{
mnClicks = nClicks;
@@ -199,46 +199,46 @@ inline MouseEvent::MouseEvent( const Point& rPos, USHORT nClicks,
// - HelpEvent -
// -------------
-#define HELPMODE_CONTEXT ((USHORT)0x0001)
-#define HELPMODE_EXTENDED ((USHORT)0x0002)
-#define HELPMODE_BALLOON ((USHORT)0x0004)
-#define HELPMODE_QUICK ((USHORT)0x0008)
+#define HELPMODE_CONTEXT ((sal_uInt16)0x0001)
+#define HELPMODE_EXTENDED ((sal_uInt16)0x0002)
+#define HELPMODE_BALLOON ((sal_uInt16)0x0004)
+#define HELPMODE_QUICK ((sal_uInt16)0x0008)
class VCL_DLLPUBLIC HelpEvent
{
private:
Point maPos;
- USHORT mnMode;
- BOOL mbKeyboardActivated;
+ sal_uInt16 mnMode;
+ sal_Bool mbKeyboardActivated;
public:
HelpEvent();
- HelpEvent( USHORT nHelpMode );
- HelpEvent( const Point& rMousePos, USHORT nHelpMode );
+ HelpEvent( sal_uInt16 nHelpMode );
+ HelpEvent( const Point& rMousePos, sal_uInt16 nHelpMode );
const Point& GetMousePosPixel() const;
- USHORT GetMode() const { return mnMode; }
- BOOL KeyboardActivated() const { return mbKeyboardActivated; }
- void SetKeyboardActivated( BOOL bKeyboard ) { mbKeyboardActivated = bKeyboard; }
+ sal_uInt16 GetMode() const { return mnMode; }
+ sal_Bool KeyboardActivated() const { return mbKeyboardActivated; }
+ void SetKeyboardActivated( sal_Bool bKeyboard ) { mbKeyboardActivated = bKeyboard; }
};
inline HelpEvent::HelpEvent()
{
mnMode = HELPMODE_CONTEXT;
- mbKeyboardActivated = TRUE;
+ mbKeyboardActivated = sal_True;
}
-inline HelpEvent::HelpEvent( const Point& rMousePos, USHORT nHelpMode ) :
+inline HelpEvent::HelpEvent( const Point& rMousePos, sal_uInt16 nHelpMode ) :
maPos( rMousePos )
{
mnMode = nHelpMode;
- mbKeyboardActivated = FALSE;
+ mbKeyboardActivated = sal_False;
}
-inline HelpEvent::HelpEvent( USHORT nHelpMode )
+inline HelpEvent::HelpEvent( sal_uInt16 nHelpMode )
{
mnMode = nHelpMode;
- mbKeyboardActivated = TRUE;
+ mbKeyboardActivated = sal_True;
}
// -----------------
@@ -250,19 +250,19 @@ class VCL_DLLPUBLIC UserDrawEvent
private:
OutputDevice* mpOutDev;
Rectangle maOutRect;
- USHORT mnItemId;
- USHORT mnStyle;
+ sal_uInt16 mnItemId;
+ sal_uInt16 mnStyle;
public:
UserDrawEvent();
UserDrawEvent( OutputDevice* pOut,
const Rectangle& rOutRect,
- USHORT nId, USHORT nStyle = 0 );
+ sal_uInt16 nId, sal_uInt16 nStyle = 0 );
OutputDevice* GetDevice() const { return mpOutDev; }
const Rectangle& GetRect() const { return maOutRect; }
- USHORT GetItemId() const { return mnItemId; }
- USHORT GetStyle() const { return mnStyle; }
+ sal_uInt16 GetItemId() const { return mnItemId; }
+ sal_uInt16 GetStyle() const { return mnStyle; }
};
inline UserDrawEvent::UserDrawEvent()
@@ -274,7 +274,7 @@ inline UserDrawEvent::UserDrawEvent()
inline UserDrawEvent::UserDrawEvent( OutputDevice* pOut,
const Rectangle& rOutRect,
- USHORT nId, USHORT nStyle ) :
+ sal_uInt16 nId, sal_uInt16 nStyle ) :
maOutRect( rOutRect )
{
mpOutDev = pOut;
@@ -286,13 +286,13 @@ inline UserDrawEvent::UserDrawEvent( OutputDevice* pOut,
// - Tracking-Types -
// ------------------
-#define ENDTRACK_CANCEL ((USHORT)0x0001)
-#define ENDTRACK_KEY ((USHORT)0x0002)
-#define ENDTRACK_FOCUS ((USHORT)0x0004)
-#define ENDTRACK_END ((USHORT)0x1000)
-#define ENDTRACK_DONTCALLHDL ((USHORT)0x8000)
+#define ENDTRACK_CANCEL ((sal_uInt16)0x0001)
+#define ENDTRACK_KEY ((sal_uInt16)0x0002)
+#define ENDTRACK_FOCUS ((sal_uInt16)0x0004)
+#define ENDTRACK_END ((sal_uInt16)0x1000)
+#define ENDTRACK_DONTCALLHDL ((sal_uInt16)0x8000)
-#define TRACKING_REPEAT ((USHORT)0x0100)
+#define TRACKING_REPEAT ((sal_uInt16)0x0100)
// -----------------
// - TrackingEvent -
@@ -302,23 +302,23 @@ class VCL_DLLPUBLIC TrackingEvent
{
private:
MouseEvent maMEvt;
- USHORT mnFlags;
+ sal_uInt16 mnFlags;
public:
TrackingEvent();
TrackingEvent( const MouseEvent& rMEvt,
- USHORT nTrackFlags = 0 );
+ sal_uInt16 nTrackFlags = 0 );
const MouseEvent& GetMouseEvent() const { return maMEvt; }
- BOOL IsTrackingRepeat() const
+ sal_Bool IsTrackingRepeat() const
{ return ((mnFlags & TRACKING_REPEAT) != 0); }
- BOOL IsTrackingEnded() const
+ sal_Bool IsTrackingEnded() const
{ return ((mnFlags & ENDTRACK_END) != 0); }
- BOOL IsTrackingCanceled() const
+ sal_Bool IsTrackingCanceled() const
{ return ((mnFlags & ENDTRACK_CANCEL) != 0); }
- USHORT GetTrackingFlags() const { return mnFlags; }
+ sal_uInt16 GetTrackingFlags() const { return mnFlags; }
};
inline TrackingEvent::TrackingEvent()
@@ -327,7 +327,7 @@ inline TrackingEvent::TrackingEvent()
}
inline TrackingEvent::TrackingEvent( const MouseEvent& rMEvt,
- USHORT nTrackFlags ) :
+ sal_uInt16 nTrackFlags ) :
maMEvt( rMEvt )
{
mnFlags = nTrackFlags;
@@ -357,17 +357,17 @@ class VCL_DLLPUBLIC NotifyEvent
private:
Window* mpWindow;
void* mpData;
- USHORT mnType;
+ sal_uInt16 mnType;
long mnRetValue;
public:
NotifyEvent();
- NotifyEvent( USHORT nType,
+ NotifyEvent( sal_uInt16 nType,
Window* pWindow,
const void* pEvent = NULL,
long nRet = 0 );
- USHORT GetType() const { return mnType; }
+ sal_uInt16 GetType() const { return mnType; }
Window* GetWindow() const { return mpWindow; }
void* GetData() const { return mpData; }
@@ -387,7 +387,7 @@ inline NotifyEvent::NotifyEvent()
mnRetValue = 0;
}
-inline NotifyEvent::NotifyEvent( USHORT nType, Window* pWindow,
+inline NotifyEvent::NotifyEvent( sal_uInt16 nType, Window* pWindow,
const void* pEvent, long nRet )
{
mpWindow = pWindow;
@@ -424,30 +424,30 @@ inline const CommandEvent* NotifyEvent::GetCommandEvent() const
// - DataChangedEvent -
// --------------------
-#define DATACHANGED_SETTINGS ((USHORT)1)
-#define DATACHANGED_DISPLAY ((USHORT)2)
-#define DATACHANGED_DATETIME ((USHORT)3)
-#define DATACHANGED_FONTS ((USHORT)4)
-#define DATACHANGED_PRINTER ((USHORT)5)
-#define DATACHANGED_FONTSUBSTITUTION ((USHORT)6)
-#define DATACHANGED_USER ((USHORT)10000)
+#define DATACHANGED_SETTINGS ((sal_uInt16)1)
+#define DATACHANGED_DISPLAY ((sal_uInt16)2)
+#define DATACHANGED_DATETIME ((sal_uInt16)3)
+#define DATACHANGED_FONTS ((sal_uInt16)4)
+#define DATACHANGED_PRINTER ((sal_uInt16)5)
+#define DATACHANGED_FONTSUBSTITUTION ((sal_uInt16)6)
+#define DATACHANGED_USER ((sal_uInt16)10000)
class VCL_DLLPUBLIC DataChangedEvent
{
private:
void* mpData;
- ULONG mnFlags;
- USHORT mnType;
+ sal_uLong mnFlags;
+ sal_uInt16 mnType;
public:
DataChangedEvent();
- DataChangedEvent( USHORT nType,
+ DataChangedEvent( sal_uInt16 nType,
const void* pData = NULL,
- ULONG nFlags = 0 );
+ sal_uLong nFlags = 0 );
- USHORT GetType() const { return mnType; }
+ sal_uInt16 GetType() const { return mnType; }
void* GetData() const { return mpData; }
- ULONG GetFlags() const { return mnFlags; }
+ sal_uLong GetFlags() const { return mnFlags; }
const AllSettings* GetOldSettings() const;
};
@@ -459,9 +459,9 @@ inline DataChangedEvent::DataChangedEvent()
mnType = 0;
}
-inline DataChangedEvent::DataChangedEvent( USHORT nType,
+inline DataChangedEvent::DataChangedEvent( sal_uInt16 nType,
const void* pData,
- ULONG nChangeFlags )
+ sal_uLong nChangeFlags )
{
mpData = (void*)pData;
mnFlags = nChangeFlags;
diff --git a/vcl/inc/vcl/evntpost.hxx b/vcl/inc/vcl/evntpost.hxx
index 2a27bbfff033..90a165506c65 100644
--- a/vcl/inc/vcl/evntpost.hxx
+++ b/vcl/inc/vcl/evntpost.hxx
@@ -37,13 +37,13 @@ namespace vcl
{
struct UserEvent
{
- ULONG m_nWhich;
+ sal_uLong m_nWhich;
void* m_pData;
};
class VCL_DLLPUBLIC EventPoster
{
- ULONG m_nId;
+ sal_uLong m_nId;
Link m_aLink;
DECL_DLLPRIVATE_LINK( DoEvent_Impl, UserEvent* );
diff --git a/vcl/inc/vcl/field.hxx b/vcl/inc/vcl/field.hxx
index c5cfe8947796..fd0ce90cb0d7 100644
--- a/vcl/inc/vcl/field.hxx
+++ b/vcl/inc/vcl/field.hxx
@@ -35,7 +35,7 @@
#include <tools/time.hxx>
#include <vcl/spinfld.hxx>
#include <vcl/combobox.hxx>
-#include <vcl/fldunit.hxx>
+#include <tools/fldunit.hxx>
namespace com { namespace sun { namespace star { namespace lang { struct Locale; } } } }
@@ -52,21 +52,21 @@ private:
Edit* mpField;
LocaleDataWrapper* mpLocaleDataWrapper;
Link maErrorLink;
- BOOL mbReformat;
- BOOL mbStrictFormat;
- BOOL mbEmptyFieldValue;
- BOOL mbEmptyFieldValueEnabled;
- BOOL mbDefaultLocale;
+ sal_Bool mbReformat;
+ sal_Bool mbStrictFormat;
+ sal_Bool mbEmptyFieldValue;
+ sal_Bool mbEmptyFieldValueEnabled;
+ sal_Bool mbDefaultLocale;
protected:
SAL_DLLPRIVATE void ImplSetText( const XubString& rText, Selection* pNewSel = NULL );
- SAL_DLLPRIVATE BOOL ImplGetEmptyFieldValue() const { return mbEmptyFieldValue; }
+ SAL_DLLPRIVATE sal_Bool ImplGetEmptyFieldValue() const { return mbEmptyFieldValue; }
- void SetFieldText( const XubString& rText, BOOL bKeepSelection );
- void SetEmptyFieldValueData( BOOL bValue ) { mbEmptyFieldValue = bValue; }
+ void SetFieldText( const XubString& rText, sal_Bool bKeepSelection );
+ void SetEmptyFieldValueData( sal_Bool bValue ) { mbEmptyFieldValue = bValue; }
SAL_DLLPRIVATE LocaleDataWrapper& ImplGetLocaleDataWrapper() const;
- BOOL IsDefaultLocale() const { return mbDefaultLocale; }
+ sal_Bool IsDefaultLocale() const { return mbDefaultLocale; }
public:
FormatterBase( Edit* pField = NULL );
@@ -77,11 +77,11 @@ public:
void SetField( Edit* pField ) { mpField = pField; }
Edit* GetField() const { return mpField; }
- BOOL MustBeReformatted() const { return mbReformat; }
- void MarkToBeReformatted( BOOL b ) { mbReformat = b; }
+ sal_Bool MustBeReformatted() const { return mbReformat; }
+ void MarkToBeReformatted( sal_Bool b ) { mbReformat = b; }
- void SetStrictFormat( BOOL bStrict );
- BOOL IsStrictFormat() const { return mbStrictFormat; }
+ void SetStrictFormat( sal_Bool bStrict );
+ sal_Bool IsStrictFormat() const { return mbStrictFormat; }
virtual void Reformat();
virtual void ReformatAll();
@@ -95,10 +95,10 @@ public:
const Link& GetErrorHdl() const { return maErrorLink; }
void SetEmptyFieldValue();
- BOOL IsEmptyFieldValue() const;
+ sal_Bool IsEmptyFieldValue() const;
- void EnableEmptyFieldValue( BOOL bEnable ) { mbEmptyFieldValueEnabled = bEnable; }
- BOOL IsEmptyFieldValueEnabled() const { return mbEmptyFieldValueEnabled; }
+ void EnableEmptyFieldValue( sal_Bool bEnable ) { mbEmptyFieldValueEnabled = bEnable; }
+ sal_Bool IsEmptyFieldValueEnabled() const { return mbEmptyFieldValueEnabled; }
};
@@ -106,7 +106,7 @@ public:
// - PatternFormatter -
// --------------------
-#define PATTERN_FORMAT_EMPTYLITERALS ((USHORT)0x0001)
+#define PATTERN_FORMAT_EMPTYLITERALS ((sal_uInt16)0x0001)
class VCL_DLLPUBLIC PatternFormatter : public FormatterBase
{
@@ -114,17 +114,17 @@ private:
ByteString maEditMask;
XubString maFieldString;
XubString maLiteralMask;
- USHORT mnFormatFlags;
- BOOL mbSameMask;
- BOOL mbInPattKeyInput;
+ sal_uInt16 mnFormatFlags;
+ sal_Bool mbSameMask;
+ sal_Bool mbInPattKeyInput;
protected:
PatternFormatter();
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
SAL_DLLPRIVATE void ImplSetMask( const ByteString& rEditMask, const XubString& rLiteralMask );
- SAL_DLLPRIVATE BOOL ImplIsSameMask() const { return mbSameMask; }
- SAL_DLLPRIVATE BOOL& ImplGetInPattKeyInput() { return mbInPattKeyInput; }
+ SAL_DLLPRIVATE sal_Bool ImplIsSameMask() const { return mbSameMask; }
+ SAL_DLLPRIVATE sal_Bool& ImplGetInPattKeyInput() { return mbInPattKeyInput; }
public:
~PatternFormatter();
@@ -136,12 +136,12 @@ public:
const ByteString& GetEditMask() const { return maEditMask; }
const XubString& GetLiteralMask() const { return maLiteralMask; }
- void SetFormatFlags( USHORT nFlags ) { mnFormatFlags = nFlags; }
- USHORT GetFormatFlags() const { return mnFormatFlags; }
+ void SetFormatFlags( sal_uInt16 nFlags ) { mnFormatFlags = nFlags; }
+ sal_uInt16 GetFormatFlags() const { return mnFormatFlags; }
void SetString( const XubString& rStr );
XubString GetString() const;
- BOOL IsStringModified() const { return !(GetString().Equals( maFieldString )); }
+ sal_Bool IsStringModified() const { return !(GetString().Equals( maFieldString )); }
void SelectFixedFont();
};
@@ -161,10 +161,10 @@ protected:
sal_Int64 mnMin;
sal_Int64 mnMax;
sal_Int64 mnCorrectedValue;
- USHORT mnType;
- USHORT mnDecimalDigits;
- BOOL mbThousandSep;
- BOOL mbShowTrailingZeros;
+ sal_uInt16 mnType;
+ sal_uInt16 mnDecimalDigits;
+ sal_Bool mbThousandSep;
+ sal_Bool mbShowTrailingZeros;
// the members below are used in all derivatives of NumericFormatter
// not in NumericFormatter itself.
@@ -183,7 +183,7 @@ protected:
void FieldLast();
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- SAL_DLLPRIVATE BOOL ImplNumericReformat( const XubString& rStr, double& rValue, XubString& rOutStr );
+ SAL_DLLPRIVATE sal_Bool ImplNumericReformat( const XubString& rStr, double& rValue, XubString& rOutStr );
SAL_DLLPRIVATE void ImplNewFieldValue( sal_Int64 nNewValue );
SAL_DLLPRIVATE void ImplSetUserValue( sal_Int64 nNewValue, Selection* pNewSelection = NULL );
@@ -204,20 +204,20 @@ public:
void SetSpinSize( sal_Int64 nNewSize ) { mnSpinSize = nNewSize; }
sal_Int64 GetSpinSize() const { return mnSpinSize; }
- void SetDecimalDigits( USHORT nDigits );
- USHORT GetDecimalDigits() const;
+ void SetDecimalDigits( sal_uInt16 nDigits );
+ sal_uInt16 GetDecimalDigits() const;
- void SetUseThousandSep( BOOL b );
- BOOL IsUseThousandSep() const { return mbThousandSep; }
+ void SetUseThousandSep( sal_Bool b );
+ sal_Bool IsUseThousandSep() const { return mbThousandSep; }
- void SetShowTrailingZeros( BOOL bShowTrailingZeros );
- BOOL IsShowTrailingZeros() const { return mbShowTrailingZeros; }
+ void SetShowTrailingZeros( sal_Bool bShowTrailingZeros );
+ sal_Bool IsShowTrailingZeros() const { return mbShowTrailingZeros; }
void SetUserValue( sal_Int64 nNewValue );
virtual void SetValue( sal_Int64 nNewValue );
virtual sal_Int64 GetValue() const;
- BOOL IsValueModified() const;
+ sal_Bool IsValueModified() const;
sal_Int64 GetCorrectedValue() const { return mnCorrectedValue; }
Fraction ConvertToFraction( sal_Int64 nValue );
@@ -248,7 +248,7 @@ protected:
virtual XubString CreateFieldText( sal_Int64 nValue ) const;
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- SAL_DLLPRIVATE BOOL ImplMetricReformat( const XubString& rStr, double& rValue, XubString& rOutStr );
+ SAL_DLLPRIVATE sal_Bool ImplMetricReformat( const XubString& rStr, double& rValue, XubString& rOutStr );
public:
~MetricFormatter();
@@ -301,7 +301,7 @@ private:
protected:
CurrencyFormatter();
virtual XubString CreateFieldText( sal_Int64 nValue ) const;
- SAL_DLLPRIVATE BOOL ImplCurrencyReformat( const XubString& rStr, XubString& rOutStr );
+ SAL_DLLPRIVATE sal_Bool ImplCurrencyReformat( const XubString& rStr, XubString& rOutStr );
public:
~CurrencyFormatter();
@@ -329,12 +329,12 @@ private:
Date maMin;
Date maMax;
Date maCorrectedDate;
- BOOL mbLongFormat;
- BOOL mbEmptyDate;
- BOOL mbShowDateCentury;
- USHORT mnDateFormat;
- ULONG mnExtDateFormat;
- BOOL mbEnforceValidValue;
+ sal_Bool mbLongFormat;
+ sal_Bool mbEmptyDate;
+ sal_Bool mbShowDateCentury;
+ sal_uInt16 mnDateFormat;
+ sal_uLong mnExtDateFormat;
+ sal_Bool mbEnforceValidValue;
SAL_DLLPRIVATE void ImplInit();
@@ -343,7 +343,7 @@ protected:
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
SAL_DLLPRIVATE const Date& ImplGetFieldDate() const { return maFieldDate; }
- SAL_DLLPRIVATE BOOL ImplDateReformat( const XubString& rStr, XubString& rOutStr,
+ SAL_DLLPRIVATE sal_Bool ImplDateReformat( const XubString& rStr, XubString& rOutStr,
const AllSettings& rSettings );
SAL_DLLPRIVATE void ImplSetUserDate( const Date& rNewDate,
Selection* pNewSelection = NULL );
@@ -352,7 +352,7 @@ protected:
SAL_DLLPRIVATE void ImplNewFieldValue( const Date& rDate );
CalendarWrapper& GetCalendarWrapper() const;
- SAL_DLLPRIVATE BOOL ImplAllowMalformedInput() const;
+ SAL_DLLPRIVATE sal_Bool ImplAllowMalformedInput() const;
public:
~DateFormatter();
@@ -364,7 +364,7 @@ public:
void SetExtDateFormat( ExtDateFieldFormat eFormat );
- ExtDateFieldFormat GetExtDateFormat( BOOL bResolveSystemFormat = FALSE ) const;
+ ExtDateFieldFormat GetExtDateFormat( sal_Bool bResolveSystemFormat = sal_False ) const;
void SetMin( const Date& rNewMin );
const Date& GetMin() const { return maMin; }
@@ -375,27 +375,27 @@ public:
// --------------------------------------------------------------
// MT: Remove these methods too, ExtDateFormat should be enough!
- // What should happen if using DDMMYYYY, but ShowCentury=FALSE?
+ // What should happen if using DDMMYYYY, but ShowCentury=sal_False?
// --------------------------------------------------------------
- void SetLongFormat( BOOL bLong );
- BOOL IsLongFormat() const { return mbLongFormat; }
- void SetShowDateCentury( BOOL bShowCentury );
- BOOL IsShowDateCentury() const { return mbShowDateCentury; }
+ void SetLongFormat( sal_Bool bLong );
+ sal_Bool IsLongFormat() const { return mbLongFormat; }
+ void SetShowDateCentury( sal_Bool bShowCentury );
+ sal_Bool IsShowDateCentury() const { return mbShowDateCentury; }
// --------------------------------------------------------------
void SetDate( const Date& rNewDate );
void SetUserDate( const Date& rNewDate );
Date GetDate() const;
Date GetRealDate() const;
- BOOL IsDateModified() const;
+ sal_Bool IsDateModified() const;
void SetEmptyDate();
- BOOL IsEmptyDate() const;
+ sal_Bool IsEmptyDate() const;
Date GetCorrectedDate() const { return maCorrectedDate; }
void ResetLastDate() { maLastDate = Date( 0, 0, 0 ); }
static void ExpandCentury( Date& rDate );
- static void ExpandCentury( Date& rDate, USHORT nTwoDigitYearStart );
+ static void ExpandCentury( Date& rDate, sal_uInt16 nTwoDigitYearStart );
static Date GetInvalidDate() { return Date( 0, 0, 0 ); }
@@ -411,8 +411,8 @@ public:
In addition, if this is set to <FALSE/>, the text in the field will <em>not</em> be corrected
when the control loses the focus - instead, the invalid input will be preserved.
*/
- void EnforceValidValue( BOOL _bEnforce ) { mbEnforceValidValue = _bEnforce; }
- inline BOOL IsEnforceValidValue( ) const { return mbEnforceValidValue; }
+ void EnforceValidValue( sal_Bool _bEnforce ) { mbEnforceValidValue = _bEnforce; }
+ inline sal_Bool IsEnforceValidValue( ) const { return mbEnforceValidValue; }
};
@@ -428,10 +428,10 @@ private:
Time maMax;
Time maCorrectedTime;
TimeFieldFormat meFormat;
- USHORT mnTimeFormat;
- BOOL mbDuration;
- BOOL mbEmptyTime;
- BOOL mbEnforceValidValue;
+ sal_uInt16 mnTimeFormat;
+ sal_Bool mbDuration;
+ sal_Bool mbEmptyTime;
+ sal_Bool mbEnforceValidValue;
SAL_DLLPRIVATE void ImplInit();
@@ -441,10 +441,10 @@ protected:
TimeFormatter();
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- SAL_DLLPRIVATE BOOL ImplTimeReformat( const XubString& rStr, XubString& rOutStr );
+ SAL_DLLPRIVATE sal_Bool ImplTimeReformat( const XubString& rStr, XubString& rOutStr );
SAL_DLLPRIVATE void ImplNewFieldValue( const Time& rTime );
SAL_DLLPRIVATE void ImplSetUserTime( const Time& rNewTime, Selection* pNewSelection = NULL );
- SAL_DLLPRIVATE BOOL ImplAllowMalformedInput() const;
+ SAL_DLLPRIVATE sal_Bool ImplAllowMalformedInput() const;
public:
@@ -469,16 +469,16 @@ public:
void SetFormat( TimeFieldFormat eNewFormat );
TimeFieldFormat GetFormat() const { return meFormat; }
- void SetDuration( BOOL mbDuration );
- BOOL IsDuration() const { return mbDuration; }
+ void SetDuration( sal_Bool mbDuration );
+ sal_Bool IsDuration() const { return mbDuration; }
void SetTime( const Time& rNewTime );
void SetUserTime( const Time& rNewTime );
Time GetTime() const;
Time GetRealTime() const;
- BOOL IsTimeModified() const;
+ sal_Bool IsTimeModified() const;
void SetEmptyTime() { FormatterBase::SetEmptyFieldValue(); }
- BOOL IsEmptyTime() const { return FormatterBase::IsEmptyFieldValue(); }
+ sal_Bool IsEmptyTime() const { return FormatterBase::IsEmptyFieldValue(); }
Time GetCorrectedTime() const { return maCorrectedTime; }
static Time GetInvalidTime() { return Time( 99, 99, 99 ); }
@@ -495,8 +495,8 @@ public:
In addition, if this is set to <FALSE/>, the text in the field will <em>not</em> be corrected
when the control loses the focus - instead, the invalid input will be preserved.
*/
- void EnforceValidValue( BOOL _bEnforce ) { mbEnforceValidValue = _bEnforce; }
- inline BOOL IsEnforceValidValue( ) const { return mbEnforceValidValue; }
+ void EnforceValidValue( sal_Bool _bEnforce ) { mbEnforceValidValue = _bEnforce; }
+ inline sal_Bool IsEnforceValidValue( ) const { return mbEnforceValidValue; }
};
@@ -583,31 +583,31 @@ public:
static void SetDefaultUnit( FieldUnit eDefaultUnit );
static FieldUnit GetDefaultUnit();
- static sal_Int64 ConvertValue( sal_Int64 nValue, sal_Int64 mnBaseValue, USHORT nDecDigits,
+ static sal_Int64 ConvertValue( sal_Int64 nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits,
FieldUnit eInUnit, FieldUnit eOutUnit );
- static sal_Int64 ConvertValue( sal_Int64 nValue, USHORT nDecDigits,
+ static sal_Int64 ConvertValue( sal_Int64 nValue, sal_uInt16 nDecDigits,
FieldUnit eInUnit, MapUnit eOutUnit );
- static sal_Int64 ConvertValue( sal_Int64 nValue, USHORT nDecDigits,
+ static sal_Int64 ConvertValue( sal_Int64 nValue, sal_uInt16 nDecDigits,
MapUnit eInUnit, FieldUnit eOutUnit );
// for backwards compatibility
// caution: conversion to double loses precision
- static double ConvertDoubleValue( double nValue, sal_Int64 mnBaseValue, USHORT nDecDigits,
+ static double ConvertDoubleValue( double nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits,
FieldUnit eInUnit, FieldUnit eOutUnit );
- static double ConvertDoubleValue( double nValue, USHORT nDecDigits,
+ static double ConvertDoubleValue( double nValue, sal_uInt16 nDecDigits,
FieldUnit eInUnit, MapUnit eOutUnit );
- static double ConvertDoubleValue( double nValue, USHORT nDecDigits,
+ static double ConvertDoubleValue( double nValue, sal_uInt16 nDecDigits,
MapUnit eInUnit, FieldUnit eOutUnit );
// for backwards compatibility
// caution: conversion to double loses precision
- static double ConvertDoubleValue( sal_Int64 nValue, sal_Int64 nBaseValue, USHORT nDecDigits,
+ static double ConvertDoubleValue( sal_Int64 nValue, sal_Int64 nBaseValue, sal_uInt16 nDecDigits,
FieldUnit eInUnit, FieldUnit eOutUnit )
{ return ConvertDoubleValue( static_cast<double>(nValue), nBaseValue, nDecDigits, eInUnit, eOutUnit ); }
- static double ConvertDoubleValue( sal_Int64 nValue, USHORT nDecDigits,
+ static double ConvertDoubleValue( sal_Int64 nValue, sal_uInt16 nDecDigits,
FieldUnit eInUnit, MapUnit eOutUnit )
{ return ConvertDoubleValue( static_cast<double>(nValue), nDecDigits, eInUnit, eOutUnit ); }
- static double ConvertDoubleValue( sal_Int64 nValue, USHORT nDecDigits,
+ static double ConvertDoubleValue( sal_Int64 nValue, sal_uInt16 nDecDigits,
MapUnit eInUnit, FieldUnit eOutUnit )
{ return ConvertDoubleValue( static_cast<double>(nValue), nDecDigits, eInUnit, eOutUnit ); }
};
@@ -651,7 +651,7 @@ private:
Date maLast;
protected:
- SAL_DLLPRIVATE void ImplDateSpinArea( BOOL bUp );
+ SAL_DLLPRIVATE void ImplDateSpinArea( sal_Bool bUp );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
public:
@@ -687,7 +687,7 @@ private:
Time maLast;
protected:
- SAL_DLLPRIVATE void ImplTimeSpinArea( BOOL bUp );
+ SAL_DLLPRIVATE void ImplTimeSpinArea( sal_Bool bUp );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
public:
@@ -734,11 +734,11 @@ public:
virtual void ReformatAll();
void InsertString( const XubString& rStr,
- USHORT nPos = COMBOBOX_APPEND );
+ sal_uInt16 nPos = COMBOBOX_APPEND );
void RemoveString( const XubString& rStr );
using PatternFormatter::GetString;
- XubString GetString( USHORT nPos ) const;
- USHORT GetStringPos( const XubString& rStr ) const;
+ XubString GetString( sal_uInt16 nPos ) const;
+ sal_uInt16 GetStringPos( const XubString& rStr ) const;
};
@@ -761,11 +761,11 @@ public:
virtual void ReformatAll();
- void InsertValue( sal_Int64 nValue, USHORT nPos = COMBOBOX_APPEND );
+ void InsertValue( sal_Int64 nValue, sal_uInt16 nPos = COMBOBOX_APPEND );
void RemoveValue( sal_Int64 nValue );
using NumericFormatter::GetValue;
- sal_Int64 GetValue( USHORT nPos ) const;
- USHORT GetValuePos( sal_Int64 nPos ) const;
+ sal_Int64 GetValue( sal_uInt16 nPos ) const;
+ sal_uInt16 GetValuePos( sal_Int64 nPos ) const;
};
@@ -790,10 +790,10 @@ public:
virtual void ReformatAll();
void InsertValue( sal_Int64 nValue, FieldUnit eInUnit = FUNIT_NONE,
- USHORT nPos = COMBOBOX_APPEND );
+ sal_uInt16 nPos = COMBOBOX_APPEND );
void RemoveValue( sal_Int64 nValue, FieldUnit eInUnit = FUNIT_NONE );
- sal_Int64 GetValue( USHORT nPos, FieldUnit eOutUnit = FUNIT_NONE ) const;
- USHORT GetValuePos( sal_Int64 nValue,
+ sal_Int64 GetValue( sal_uInt16 nPos, FieldUnit eOutUnit = FUNIT_NONE ) const;
+ sal_uInt16 GetValuePos( sal_Int64 nValue,
FieldUnit eInUnit = FUNIT_NONE ) const;
// Needed, because GetValue() with nPos hide these functions
@@ -821,10 +821,10 @@ public:
virtual void ReformatAll();
- void InsertValue( sal_Int64 nValue, USHORT nPos = COMBOBOX_APPEND );
+ void InsertValue( sal_Int64 nValue, sal_uInt16 nPos = COMBOBOX_APPEND );
void RemoveValue( sal_Int64 nValue );
- sal_Int64 GetValue( USHORT nPos ) const;
- USHORT GetValuePos( sal_Int64 nValue ) const;
+ sal_Int64 GetValue( sal_uInt16 nPos ) const;
+ sal_uInt16 GetValuePos( sal_Int64 nValue ) const;
// Needed, because GetValue() with nPos hide this function
virtual sal_Int64 GetValue() const;
@@ -850,11 +850,11 @@ public:
virtual void ReformatAll();
- void InsertDate( const Date& rDate, USHORT nPos = COMBOBOX_APPEND );
+ void InsertDate( const Date& rDate, sal_uInt16 nPos = COMBOBOX_APPEND );
void RemoveDate( const Date& rDate );
using DateFormatter::GetDate;
- Date GetDate( USHORT nPos ) const;
- USHORT GetDatePos( const Date& rDate ) const;
+ Date GetDate( sal_uInt16 nPos ) const;
+ sal_uInt16 GetDatePos( const Date& rDate ) const;
};
@@ -877,11 +877,11 @@ public:
virtual void ReformatAll();
- void InsertTime( const Time& rTime, USHORT nPos = COMBOBOX_APPEND );
+ void InsertTime( const Time& rTime, sal_uInt16 nPos = COMBOBOX_APPEND );
void RemoveTime( const Time& rTime );
using TimeFormatter::GetTime;
- Time GetTime( USHORT nPos ) const;
- USHORT GetTimePos( const Time& rTime ) const;
+ Time GetTime( sal_uInt16 nPos ) const;
+ sal_uInt16 GetTimePos( const Time& rTime ) const;
};
#endif // _SV_FIELD_HXX
diff --git a/vcl/inc/vcl/fixbrd.hxx b/vcl/inc/vcl/fixbrd.hxx
index 70916cfb8704..e091f68d4fad 100644
--- a/vcl/inc/vcl/fixbrd.hxx
+++ b/vcl/inc/vcl/fixbrd.hxx
@@ -51,8 +51,8 @@
class VCL_DLLPUBLIC FixedBorder : public Control
{
private:
- USHORT mnType;
- BOOL mbTransparent;
+ sal_uInt16 mnType;
+ sal_Bool mbTransparent;
private:
using Control::ImplInitSettings;
@@ -60,7 +60,7 @@ private:
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
SAL_DLLPRIVATE void ImplInitSettings();
- SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize );
public:
@@ -69,15 +69,15 @@ public:
~FixedBorder();
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
- void SetTransparent( BOOL bTransparent );
- BOOL IsTransparent() const { return mbTransparent; }
- void SetBorderType( USHORT nType );
- USHORT GetBorderType() const { return mnType; }
+ void SetTransparent( sal_Bool bTransparent );
+ sal_Bool IsTransparent() const { return mbTransparent; }
+ void SetBorderType( sal_uInt16 nType );
+ sal_uInt16 GetBorderType() const { return mnType; }
};
#endif // _SV_FIXBRD_HXX
diff --git a/vcl/inc/vcl/fixed.hxx b/vcl/inc/vcl/fixed.hxx
index 42061cfa09ea..3912f19e778a 100644
--- a/vcl/inc/vcl/fixed.hxx
+++ b/vcl/inc/vcl/fixed.hxx
@@ -48,11 +48,11 @@ private:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
- SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize, bool bFillLayout = false ) const;
public:
- SAL_DLLPRIVATE static USHORT ImplGetTextStyle( WinBits nWinBits );
+ SAL_DLLPRIVATE static sal_uInt16 ImplGetTextStyle( WinBits nWinBits );
protected:
virtual void FillLayoutData() const;
virtual const Font&
@@ -66,7 +66,7 @@ public:
FixedText( Window* pParent, const ResId& rResId, bool bDisableAccessibleLabelForRelation );
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
@@ -87,7 +87,7 @@ private:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
SAL_DLLPRIVATE void ImplDraw( bool bLayout = false );
protected:
@@ -102,7 +102,7 @@ public:
FixedLine( Window* pParent, const ResId& rResId );
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
@@ -124,7 +124,7 @@ private:
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
SAL_DLLPRIVATE void ImplInitSettings();
- SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize );
protected:
@@ -136,7 +136,7 @@ public:
~FixedBitmap();
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
@@ -144,7 +144,7 @@ public:
void SetBitmap( const Bitmap& rBitmap );
using OutputDevice::GetBitmap;
const Bitmap& GetBitmap() const { return maBitmap; }
- BOOL SetModeBitmap( const Bitmap& rBitmap );
+ sal_Bool SetModeBitmap( const Bitmap& rBitmap );
const Bitmap& GetModeBitmap( ) const;
};
@@ -156,7 +156,7 @@ class VCL_DLLPUBLIC FixedImage : public Control
{
private:
Image maImage;
- BOOL mbInUserDraw;
+ sal_Bool mbInUserDraw;
private:
using Control::ImplInitSettings;
@@ -164,10 +164,10 @@ private:
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
SAL_DLLPRIVATE void ImplInitSettings();
- SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
- const Point& rPos, const Size& rSize );
protected:
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
+ const Point& rPos, const Size& rSize );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
public:
@@ -176,7 +176,7 @@ public:
~FixedImage();
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
@@ -186,7 +186,7 @@ public:
void SetImage( const Image& rImage );
const Image& GetImage() const { return maImage; }
- BOOL SetModeImage( const Image& rImage );
+ sal_Bool SetModeImage( const Image& rImage );
const Image& GetModeImage( ) const;
Point CalcImagePos( const Point& rPos,
diff --git a/vcl/inc/vcl/fldunit.hxx b/vcl/inc/vcl/fldunit.hxx
deleted file mode 100644
index 93c89ada98a0..000000000000
--- a/vcl/inc/vcl/fldunit.hxx
+++ /dev/null
@@ -1,36 +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 _VCL_FLDUNIT_HXX
-#define _VCL_FLDUNIT_HXX
-
-#include <tools/fldunit.hxx>
-
-#endif // _VCL_FLDUNIT_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/floatwin.hxx b/vcl/inc/vcl/floatwin.hxx
index eb15b116938e..e6a5b58eea32 100644
--- a/vcl/inc/vcl/floatwin.hxx
+++ b/vcl/inc/vcl/floatwin.hxx
@@ -40,34 +40,34 @@ class PopupModeEvent;
// - FloatingWindow-Types -
// ------------------------
-#define FLOATWIN_POPUPMODE_ALLOWTEAROFF ((ULONG)0x00000001)
-#define FLOATWIN_POPUPMODE_ANIMATIONSLIDE ((ULONG)0x00000002)
-#define FLOATWIN_POPUPMODE_NOAUTOARRANGE ((ULONG)0x00000004)
-#define FLOATWIN_POPUPMODE_NOANIMATION ((ULONG)0x00000008)
-#define FLOATWIN_POPUPMODE_DOWN ((ULONG)0x00000010)
-#define FLOATWIN_POPUPMODE_UP ((ULONG)0x00000020)
-#define FLOATWIN_POPUPMODE_LEFT ((ULONG)0x00000040)
-#define FLOATWIN_POPUPMODE_RIGHT ((ULONG)0x00000080)
-#define FLOATWIN_POPUPMODE_NOFOCUSCLOSE ((ULONG)0x00000100)
-#define FLOATWIN_POPUPMODE_NOKEYCLOSE ((ULONG)0x00000200)
-#define FLOATWIN_POPUPMODE_NOMOUSECLOSE ((ULONG)0x00000400)
-#define FLOATWIN_POPUPMODE_NOMOUSERECTCLOSE ((ULONG)0x00000800)
-#define FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE ((ULONG)0x00001000)
-#define FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE ((ULONG)0x00002000)
-#define FLOATWIN_POPUPMODE_PATHMOUSECANCELCLICK ((ULONG)0x00004000)
-#define FLOATWIN_POPUPMODE_NEWLEVEL ((ULONG)0x00008000)
-#define FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE ((ULONG)0x00010000)
-#define FLOATWIN_POPUPMODE_GRABFOCUS ((ULONG)0x00020000)
-
-#define FLOATWIN_POPUPMODEEND_CANCEL ((USHORT)0x0001)
-#define FLOATWIN_POPUPMODEEND_TEAROFF ((USHORT)0x0002)
-#define FLOATWIN_POPUPMODEEND_DONTCALLHDL ((USHORT)0x0004)
-#define FLOATWIN_POPUPMODEEND_CLOSEALL ((USHORT)0x0008)
-
-#define FLOATWIN_TITLE_NORMAL ((USHORT)0x0001)
-#define FLOATWIN_TITLE_TEAROFF ((USHORT)0x0002)
-#define FLOATWIN_TITLE_POPUP ((USHORT)0x0004)
-#define FLOATWIN_TITLE_NONE ((USHORT)0x0008)
+#define FLOATWIN_POPUPMODE_ALLOWTEAROFF ((sal_uLong)0x00000001)
+#define FLOATWIN_POPUPMODE_ANIMATIONSLIDE ((sal_uLong)0x00000002)
+#define FLOATWIN_POPUPMODE_NOAUTOARRANGE ((sal_uLong)0x00000004)
+#define FLOATWIN_POPUPMODE_NOANIMATION ((sal_uLong)0x00000008)
+#define FLOATWIN_POPUPMODE_DOWN ((sal_uLong)0x00000010)
+#define FLOATWIN_POPUPMODE_UP ((sal_uLong)0x00000020)
+#define FLOATWIN_POPUPMODE_LEFT ((sal_uLong)0x00000040)
+#define FLOATWIN_POPUPMODE_RIGHT ((sal_uLong)0x00000080)
+#define FLOATWIN_POPUPMODE_NOFOCUSCLOSE ((sal_uLong)0x00000100)
+#define FLOATWIN_POPUPMODE_NOKEYCLOSE ((sal_uLong)0x00000200)
+#define FLOATWIN_POPUPMODE_NOMOUSECLOSE ((sal_uLong)0x00000400)
+#define FLOATWIN_POPUPMODE_NOMOUSERECTCLOSE ((sal_uLong)0x00000800)
+#define FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE ((sal_uLong)0x00001000)
+#define FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE ((sal_uLong)0x00002000)
+#define FLOATWIN_POPUPMODE_PATHMOUSECANCELCLICK ((sal_uLong)0x00004000)
+#define FLOATWIN_POPUPMODE_NEWLEVEL ((sal_uLong)0x00008000)
+#define FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE ((sal_uLong)0x00010000)
+#define FLOATWIN_POPUPMODE_GRABFOCUS ((sal_uLong)0x00020000)
+
+#define FLOATWIN_POPUPMODEEND_CANCEL ((sal_uInt16)0x0001)
+#define FLOATWIN_POPUPMODEEND_TEAROFF ((sal_uInt16)0x0002)
+#define FLOATWIN_POPUPMODEEND_DONTCALLHDL ((sal_uInt16)0x0004)
+#define FLOATWIN_POPUPMODEEND_CLOSEALL ((sal_uInt16)0x0008)
+
+#define FLOATWIN_TITLE_NORMAL ((sal_uInt16)0x0001)
+#define FLOATWIN_TITLE_TEAROFF ((sal_uInt16)0x0002)
+#define FLOATWIN_TITLE_POPUP ((sal_uInt16)0x0004)
+#define FLOATWIN_TITLE_NONE ((sal_uInt16)0x0008)
// ------------------
// - FloatingWindow -
@@ -81,18 +81,18 @@ private:
Window* mpFirstPopupModeWin;
ImplData* mpImplData;
Rectangle maFloatRect;
- ULONG mnPostId;
- ULONG mnPopupModeFlags;
- USHORT mnTitle;
- USHORT mnOldTitle;
- BOOL mbInPopupMode;
- BOOL mbPopupMode;
- BOOL mbPopupModeCanceled;
- BOOL mbPopupModeTearOff;
- BOOL mbMouseDown;
- BOOL mbOldSaveBackMode;
- BOOL mbGrabFocus; // act as key input window, although focus is not set
- BOOL mbInCleanUp;
+ sal_uLong mnPostId;
+ sal_uLong mnPopupModeFlags;
+ sal_uInt16 mnTitle;
+ sal_uInt16 mnOldTitle;
+ sal_Bool mbInPopupMode;
+ sal_Bool mbPopupMode;
+ sal_Bool mbPopupModeCanceled;
+ sal_Bool mbPopupModeTearOff;
+ sal_Bool mbMouseDown;
+ sal_Bool mbOldSaveBackMode;
+ sal_Bool mbGrabFocus; // act as key input window, although focus is not set
+ sal_Bool mbInCleanUp;
Link maPopupModeEndHdl;
SAL_DLLPRIVATE void ImplCallPopupModeEnd();
@@ -109,20 +109,20 @@ protected:
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
public:
-#define IMPL_FLOATWIN_HITTEST_OUTSIDE ((USHORT)0x0001)
-#define IMPL_FLOATWIN_HITTEST_WINDOW ((USHORT)0x0002)
-#define IMPL_FLOATWIN_HITTEST_RECT ((USHORT)0x0004)
- SAL_DLLPRIVATE FloatingWindow* ImplFloatHitTest( Window* pReference, const Point& rPos, USHORT& rHitTest );
+#define IMPL_FLOATWIN_HITTEST_OUTSIDE ((sal_uInt16)0x0001)
+#define IMPL_FLOATWIN_HITTEST_WINDOW ((sal_uInt16)0x0002)
+#define IMPL_FLOATWIN_HITTEST_RECT ((sal_uInt16)0x0004)
+ SAL_DLLPRIVATE FloatingWindow* ImplFloatHitTest( Window* pReference, const Point& rPos, sal_uInt16& rHitTest );
SAL_DLLPRIVATE FloatingWindow* ImplFindLastLevelFloat();
- SAL_DLLPRIVATE BOOL ImplIsFloatPopupModeWindow( const Window* pWindow );
- SAL_DLLPRIVATE void ImplSetMouseDown() { mbMouseDown = TRUE; }
- SAL_DLLPRIVATE BOOL ImplIsMouseDown() const { return mbMouseDown; }
+ SAL_DLLPRIVATE sal_Bool ImplIsFloatPopupModeWindow( const Window* pWindow );
+ SAL_DLLPRIVATE void ImplSetMouseDown() { mbMouseDown = sal_True; }
+ SAL_DLLPRIVATE sal_Bool ImplIsMouseDown() const { return mbMouseDown; }
SAL_DLLPRIVATE static Point ImplCalcPos( Window* pWindow,
- const Rectangle& rRect, ULONG nFlags,
- USHORT& rArrangeIndex );
- SAL_DLLPRIVATE void ImplEndPopupMode( USHORT nFlags = 0, ULONG nFocusId = 0 );
+ const Rectangle& rRect, sal_uLong nFlags,
+ sal_uInt16& rArrangeIndex );
+ SAL_DLLPRIVATE void ImplEndPopupMode( sal_uInt16 nFlags = 0, sal_uLong nFocusId = 0 );
SAL_DLLPRIVATE Rectangle& ImplGetItemEdgeClipRect();
- SAL_DLLPRIVATE BOOL ImplIsInPrivatePopupMode() const { return mbInPopupMode; }
+ SAL_DLLPRIVATE sal_Bool ImplIsInPrivatePopupMode() const { return mbInPopupMode; }
public:
FloatingWindow( Window* pParent, WinBits nStyle = WB_STDFLOATWIN );
@@ -135,27 +135,27 @@ public:
virtual void PopupModeEnd();
- void SetTitleType( USHORT nTitle );
- USHORT GetTitleType() const { return mnTitle; }
+ void SetTitleType( sal_uInt16 nTitle );
+ sal_uInt16 GetTitleType() const { return mnTitle; }
- void StartPopupMode( const Rectangle& rRect, ULONG nFlags = 0 );
- void StartPopupMode( ToolBox* pBox, ULONG nFlags = 0 );
- void EndPopupMode( USHORT nFlags = 0 );
+ void StartPopupMode( const Rectangle& rRect, sal_uLong nFlags = 0 );
+ void StartPopupMode( ToolBox* pBox, sal_uLong nFlags = 0 );
+ void EndPopupMode( sal_uInt16 nFlags = 0 );
void AddPopupModeWindow( Window* pWindow );
void RemovePopupModeWindow( Window* pWindow );
- ULONG GetPopupModeFlags() const { return mnPopupModeFlags; }
- void SetPopupModeFlags( ULONG nFlags ) { mnPopupModeFlags = nFlags; }
- BOOL IsInPopupMode() const { return mbPopupMode; }
- BOOL IsInCleanUp() const { return mbInCleanUp; }
- BOOL IsPopupModeCanceled() const { return mbPopupModeCanceled; }
- BOOL IsPopupModeTearOff() const { return mbPopupModeTearOff; }
+ sal_uLong GetPopupModeFlags() const { return mnPopupModeFlags; }
+ void SetPopupModeFlags( sal_uLong nFlags ) { mnPopupModeFlags = nFlags; }
+ sal_Bool IsInPopupMode() const { return mbPopupMode; }
+ sal_Bool IsInCleanUp() const { return mbInCleanUp; }
+ sal_Bool IsPopupModeCanceled() const { return mbPopupModeCanceled; }
+ sal_Bool IsPopupModeTearOff() const { return mbPopupModeTearOff; }
void SetPopupModeEndHdl( const Link& rLink ) { maPopupModeEndHdl = rLink; }
const Link& GetPopupModeEndHdl() const { return maPopupModeEndHdl; }
- BOOL GrabsFocus() const { return mbGrabFocus; }
+ sal_Bool GrabsFocus() const { return mbGrabFocus; }
- static Point CalcFloatingPosition( Window* pWindow, const Rectangle& rRect, ULONG nFlags, USHORT& rArrangeIndex );
+ static Point CalcFloatingPosition( Window* pWindow, const Rectangle& rRect, sal_uLong nFlags, sal_uInt16& rArrangeIndex );
};
#endif // _SV_FLOATWIN_HXX
diff --git a/vcl/inc/vcl/fntstyle.hxx b/vcl/inc/vcl/fntstyle.hxx
index 72705fde16f2..82c8c8ad5932 100644
--- a/vcl/inc/vcl/fntstyle.hxx
+++ b/vcl/inc/vcl/fntstyle.hxx
@@ -47,7 +47,7 @@ enum FontRelief { RELIEF_NONE, RELIEF_EMBOSSED, RELIEF_ENGRAVED, FontRelief_FORC
// - Font types -
// --------------
-typedef BYTE FontKerning;
+typedef sal_uInt8 FontKerning;
#define KERNING_FONTSPECIFIC ((FontKerning)0x01)
#define KERNING_ASIAN ((FontKerning)0x02)
diff --git a/vcl/inc/vcl/font.hxx b/vcl/inc/vcl/font.hxx
index d9c4d62f57d0..8ca4ba5bbb87 100644
--- a/vcl/inc/vcl/font.hxx
+++ b/vcl/inc/vcl/font.hxx
@@ -65,8 +65,8 @@ public:
const Color& GetColor() const;
void SetFillColor( const Color& );
const Color& GetFillColor() const;
- void SetTransparent( BOOL bTransparent );
- BOOL IsTransparent() const;
+ void SetTransparent( sal_Bool bTransparent );
+ sal_Bool IsTransparent() const;
void SetAlign( FontAlign );
FontAlign GetAlign() const;
@@ -94,11 +94,11 @@ public:
void SetOrientation( short nLineOrientation );
short GetOrientation() const;
- void SetVertical( BOOL bVertical );
- BOOL IsVertical() const;
+ void SetVertical( sal_Bool bVertical );
+ sal_Bool IsVertical() const;
void SetKerning( FontKerning nKerning );
FontKerning GetKerning() const;
- BOOL IsKerning() const;
+ sal_Bool IsKerning() const;
void SetWeight( FontWeight );
FontWeight GetWeight() const;
@@ -106,10 +106,10 @@ public:
FontWidth GetWidthType() const;
void SetItalic( FontItalic );
FontItalic GetItalic() const;
- void SetOutline( BOOL bOutline );
- BOOL IsOutline() const;
- void SetShadow( BOOL bShadow );
- BOOL IsShadow() const;
+ void SetOutline( sal_Bool bOutline );
+ sal_Bool IsOutline() const;
+ void SetShadow( sal_Bool bShadow );
+ sal_Bool IsShadow() const;
void SetRelief( FontRelief );
FontRelief GetRelief() const;
void SetUnderline( FontUnderline );
@@ -120,17 +120,17 @@ public:
FontStrikeout GetStrikeout() const;
void SetEmphasisMark( FontEmphasisMark );
FontEmphasisMark GetEmphasisMark() const;
- void SetWordLineMode( BOOL bWordLine );
- BOOL IsWordLineMode() const;
+ void SetWordLineMode( sal_Bool bWordLine );
+ sal_Bool IsWordLineMode() const;
void Merge( const Font& rFont );
void GetFontAttributes( ImplFontAttributes& rAttrs ) const;
Font& operator=( const Font& );
- BOOL operator==( const Font& ) const;
- BOOL operator!=( const Font& rFont ) const
+ sal_Bool operator==( const Font& ) const;
+ sal_Bool operator!=( const Font& rFont ) const
{ return !(Font::operator==( rFont )); }
- BOOL IsSameInstance( const Font& ) const;
+ sal_Bool IsSameInstance( const Font& ) const;
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Font& );
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Font& );
diff --git a/vcl/inc/vcl/fontcache.hxx b/vcl/inc/vcl/fontcache.hxx
index f15be8dd1af7..ad261e8d8e6d 100644
--- a/vcl/inc/vcl/fontcache.hxx
+++ b/vcl/inc/vcl/fontcache.hxx
@@ -39,7 +39,7 @@
namespace psp
{
-class VCL_DLLPUBLIC FontCache
+class VCL_PLUGIN_PUBLIC FontCache
{
struct FontDir;
friend class FontDir;
diff --git a/vcl/inc/vcl/fontmanager.hxx b/vcl/inc/vcl/fontmanager.hxx
index d6d926f051d5..25674b76ae8a 100644
--- a/vcl/inc/vcl/fontmanager.hxx
+++ b/vcl/inc/vcl/fontmanager.hxx
@@ -225,7 +225,7 @@ class FontCache;
class FontCache;
-class VCL_DLLPUBLIC PrintFontManager
+class VCL_PLUGIN_PUBLIC PrintFontManager
{
struct PrintFont;
struct TrueTypeFontFile;
diff --git a/vcl/inc/vcl/gdimtf.hxx b/vcl/inc/vcl/gdimtf.hxx
index ec0a8261e61d..ffbd4867ecb8 100644
--- a/vcl/inc/vcl/gdimtf.hxx
+++ b/vcl/inc/vcl/gdimtf.hxx
@@ -51,8 +51,8 @@ class Gradient;
// - GDIMetaFile-Types -
// ---------------------
-#define GDI_METAFILE_END ((ULONG)0xFFFFFFFF)
-#define GDI_METAFILE_LABEL_NOTFOUND ((ULONG)0xFFFFFFFF)
+#define GDI_METAFILE_END ((sal_uLong)0xFFFFFFFF)
+#define GDI_METAFILE_LABEL_NOTFOUND ((sal_uLong)0xFFFFFFFF)
#ifndef METAFILE_END
#define METAFILE_END GDI_METAFILE_END
@@ -104,9 +104,9 @@ private:
GDIMetaFile* pNext;
OutputDevice* pOutDev;
ImpLabelList* pLabelList;
- BOOL bPause;
- BOOL bRecord;
- BOOL bUseCanvas;
+ sal_Bool bPause;
+ sal_Bool bRecord;
+ sal_Bool bUseCanvas;
SAL_DLLPRIVATE static Color ImplColAdjustFnc( const Color& rColor, const void* pColParam );
@@ -140,7 +140,7 @@ private:
protected:
- virtual void Linker( OutputDevice* pOut, BOOL bLink );
+ virtual void Linker( OutputDevice* pOut, sal_Bool bLink );
virtual long Hook();
public:
@@ -151,12 +151,12 @@ public:
using List::operator==;
using List::operator!=;
GDIMetaFile& operator=( const GDIMetaFile& rMtf );
- BOOL operator==( const GDIMetaFile& rMtf ) const;
- BOOL operator!=( const GDIMetaFile& rMtf ) const { return !( *this == rMtf ); }
+ sal_Bool operator==( const GDIMetaFile& rMtf ) const;
+ sal_Bool operator!=( const GDIMetaFile& rMtf ) const { return !( *this == rMtf ); }
void Clear();
sal_Bool IsEqual( const GDIMetaFile& rMtf ) const;
- BOOL Mirror( ULONG nMirrorFlags );
+ sal_Bool Mirror( sal_uLong nMirrorFlags );
void Move( long nX, long nY );
// additional Move method getting specifics how to handle MapMode( MAP_PIXEL )
void Move( long nX, long nY, long nDPIX, long nDPIY );
@@ -175,52 +175,52 @@ public:
void Adjust( short nLuminancePercent = 0, short nContrastPercent = 0,
short nChannelRPercent = 0, short nChannelGPercent = 0,
- short nChannelBPercent = 0, double fGamma = 1.0, BOOL bInvert = FALSE );
+ short nChannelBPercent = 0, double fGamma = 1.0, sal_Bool bInvert = sal_False );
void Convert( MtfConversion eConversion );
- void ReplaceColors( const Color& rSearchColor, const Color& rReplaceColor, ULONG nTol = 0 );
+ void ReplaceColors( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol = 0 );
void ReplaceColors( const Color* pSearchColors, const Color* rReplaceColors,
- ULONG nColorCount, ULONG* pTols = NULL );
+ sal_uLong nColorCount, sal_uLong* pTols = NULL );
GDIMetaFile GetMonochromeMtf( const Color& rCol ) const;
void Record( OutputDevice* pOutDev );
- BOOL IsRecord() const { return bRecord; }
+ sal_Bool IsRecord() const { return bRecord; }
- void Play( GDIMetaFile& rMtf, ULONG nPos = GDI_METAFILE_END );
- void Play( OutputDevice* pOutDev, ULONG nPos = GDI_METAFILE_END );
+ void Play( GDIMetaFile& rMtf, sal_uLong nPos = GDI_METAFILE_END );
+ void Play( OutputDevice* pOutDev, sal_uLong nPos = GDI_METAFILE_END );
void Play( OutputDevice* pOutDev, const Point& rPos,
- const Size& rSize, ULONG nPos = GDI_METAFILE_END );
+ const Size& rSize, sal_uLong nPos = GDI_METAFILE_END );
- void Pause( BOOL bPause );
- BOOL IsPause() const { return bPause; }
+ void Pause( sal_Bool bPause );
+ sal_Bool IsPause() const { return bPause; }
void Stop();
void WindStart();
void WindEnd();
- void Wind( ULONG nAction );
+ void Wind( sal_uLong nAction );
void WindPrev();
void WindNext();
- ULONG GetActionCount() const { return Count(); }
+ sal_uLong GetActionCount() const { return Count(); }
void AddAction( MetaAction* pAction );
- void AddAction( MetaAction* pAction, ULONG nPos );
- void RemoveAction( ULONG nPos );
- MetaAction* CopyAction( ULONG nPos ) const;
+ void AddAction( MetaAction* pAction, sal_uLong nPos );
+ void RemoveAction( sal_uLong nPos );
+ MetaAction* CopyAction( sal_uLong nPos ) const;
MetaAction* GetCurAction() const { return (MetaAction*) GetCurObject(); }
- MetaAction* GetAction( ULONG nAction ) const { return (MetaAction*) GetObject( nAction ); }
+ MetaAction* GetAction( sal_uLong nAction ) const { return (MetaAction*) GetObject( nAction ); }
MetaAction* FirstAction() { return (MetaAction*) First(); }
MetaAction* NextAction() { return (MetaAction*) Next(); }
- MetaAction* ReplaceAction( MetaAction* pAction, ULONG nAction ) { return (MetaAction*) Replace( pAction, nAction ); }
+ MetaAction* ReplaceAction( MetaAction* pAction, sal_uLong nAction ) { return (MetaAction*) Replace( pAction, nAction ); }
- ULONG GetActionPos( const String& rLabel );
- BOOL InsertLabel( const String& rLabel, ULONG nActionPos );
+ sal_uLong GetActionPos( const String& rLabel );
+ sal_Bool InsertLabel( const String& rLabel, sal_uLong nActionPos );
void RemoveLabel( const String& rLabel );
void RenameLabel( const String& rLabel, const String& rNewLabel );
- ULONG GetLabelCount() const;
- String GetLabel( ULONG nLabel );
+ sal_uLong GetLabelCount() const;
+ String GetLabel( sal_uLong nLabel );
- BOOL SaveStatus();
+ sal_Bool SaveStatus();
const Size& GetPrefSize() const { return aPrefSize; }
void SetPrefSize( const Size& rSize ) { aPrefSize = rSize; }
@@ -231,8 +231,8 @@ public:
void SetHookHdl( const Link& rLink ) { aHookHdlLink = rLink; }
const Link& GetHookHdl() const { return aHookHdlLink; }
- ULONG GetChecksum() const;
- ULONG GetSizeBytes() const;
+ sal_uLong GetChecksum() const;
+ sal_uLong GetSizeBytes() const;
// Methoden zum Lesen und Schreiben des neuen Formats;
// die Read-Methode kann auch das alte Format lesen
@@ -244,10 +244,10 @@ public:
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, GDIMetaFile& rGDIMetaFile );
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const GDIMetaFile& rGDIMetaFile );
- BOOL CreateThumbnail( sal_uInt32 nMaximumExtent, BitmapEx& rBmpEx, const BitmapEx* pOverlay = NULL, const Rectangle* pOverlayRect = NULL ) const;
+ sal_Bool CreateThumbnail( sal_uInt32 nMaximumExtent, BitmapEx& rBmpEx, const BitmapEx* pOverlay = NULL, const Rectangle* pOverlayRect = NULL ) const;
- void UseCanvas( BOOL _bUseCanvas );
- BOOL GetUseCanvas() const { return bUseCanvas; }
+ void UseCanvas( sal_Bool _bUseCanvas );
+ sal_Bool GetUseCanvas() const { return bUseCanvas; }
};
/** Create a special metaaction that delegates rendering to specified
diff --git a/vcl/inc/vcl/gfxlink.hxx b/vcl/inc/vcl/gfxlink.hxx
index 5f1b593ba44a..1d4362f00dc1 100644
--- a/vcl/inc/vcl/gfxlink.hxx
+++ b/vcl/inc/vcl/gfxlink.hxx
@@ -40,16 +40,16 @@
struct ImpBuffer
{
- ULONG mnRefCount;
- BYTE* mpBuffer;
+ sal_uLong mnRefCount;
+ sal_uInt8* mpBuffer;
- ImpBuffer( ULONG nSize )
+ ImpBuffer( sal_uLong nSize )
{
mnRefCount = 1UL;
- mpBuffer = nSize ? new BYTE[ nSize ] : NULL;
+ mpBuffer = nSize ? new sal_uInt8[ nSize ] : NULL;
}
- ImpBuffer( BYTE* pBuf ) { mnRefCount = 1UL; mpBuffer = pBuf; }
+ ImpBuffer( sal_uInt8* pBuf ) { mnRefCount = 1UL; mpBuffer = pBuf; }
~ImpBuffer() { delete[] mpBuffer; }
};
@@ -61,15 +61,15 @@ struct ImpBuffer
struct ImpSwap
{
rtl::OUString maURL;
- ULONG mnDataSize;
- ULONG mnRefCount;
+ sal_uLong mnDataSize;
+ sal_uLong mnRefCount;
- ImpSwap( BYTE* pData, ULONG nDataSize );
+ ImpSwap( sal_uInt8* pData, sal_uLong nDataSize );
~ImpSwap();
- BYTE* GetData() const;
+ sal_uInt8* GetData() const;
- BOOL IsSwapped() const { return maURL.getLength() > 0; }
+ sal_Bool IsSwapped() const { return maURL.getLength() > 0; }
void WriteTo( SvStream& rOStm ) const;
};
@@ -135,7 +135,7 @@ private:
sal_uInt32 mnBufSize;
sal_uInt32 mnUserId;
ImpGfxLink* mpImpData;
- ULONG mnExtra2;
+ sal_uLong mnExtra2;
SAL_DLLPRIVATE void ImplCopy( const GfxLink& rGfxLink );
@@ -143,7 +143,7 @@ public:
GfxLink();
GfxLink( const GfxLink& );
GfxLink( const String& rPath, GfxLinkType nType );
- GfxLink( BYTE* pBuf, sal_uInt32 nBufSize, GfxLinkType nType, BOOL bOwns );
+ GfxLink( sal_uInt8* pBuf, sal_uInt32 nBufSize, GfxLinkType nType, sal_Bool bOwns );
~GfxLink();
GfxLink& operator=( const GfxLink& );
@@ -155,8 +155,8 @@ public:
sal_uInt32 GetUserId() const { return mnUserId; }
sal_uInt32 GetDataSize() const;
- void SetData( BYTE* pBuf, sal_uInt32 nSize, GfxLinkType nType, BOOL bOwns );
- const BYTE* GetData() const;
+ void SetData( sal_uInt8* pBuf, sal_uInt32 nSize, GfxLinkType nType, sal_Bool bOwns );
+ const sal_uInt8* GetData() const;
const Size& GetPrefSize() const;
void SetPrefSize( const Size& rPrefSize );
@@ -166,16 +166,16 @@ public:
void SetPrefMapMode( const MapMode& rPrefMapMode );
bool IsPrefMapModeValid();
- BOOL IsNative() const;
- BOOL IsUser() const { return( GFX_LINK_TYPE_USER == meType ); }
+ sal_Bool IsNative() const;
+ sal_Bool IsUser() const { return( GFX_LINK_TYPE_USER == meType ); }
- BOOL LoadNative( Graphic& rGraphic );
+ sal_Bool LoadNative( Graphic& rGraphic );
- BOOL ExportNative( SvStream& rOStream ) const;
+ sal_Bool ExportNative( SvStream& rOStream ) const;
void SwapOut();
void SwapIn();
- BOOL IsSwappedOut() const { return( mpSwap != NULL ); }
+ sal_Bool IsSwappedOut() const { return( mpSwap != NULL ); }
public:
diff --git a/vcl/inc/vcl/glyphcache.hxx b/vcl/inc/vcl/glyphcache.hxx
index 48eb16a7f17b..b346f55273ef 100644
--- a/vcl/inc/vcl/glyphcache.hxx
+++ b/vcl/inc/vcl/glyphcache.hxx
@@ -49,7 +49,6 @@ class ImplFontOptions;
namespace basegfx { class B2DPolyPolygon; }
class RawBitmap;
-class CmapResult;
#include <vcl/outfont.hxx>
#include <vcl/impfont.hxx>
@@ -64,7 +63,7 @@ namespace vcl
// =======================================================================
-class VCL_DLLPUBLIC GlyphCache
+class VCL_PLUGIN_PUBLIC GlyphCache
{
public:
explicit GlyphCache( GlyphCachePeer& );
@@ -96,7 +95,7 @@ private:
void GrowNotify();
private:
- ULONG CalcByteCount() const;
+ sal_uLong CalcByteCount() const;
void GarbageCollect();
// the GlyphCache's FontList matches a font request to a serverfont instance
@@ -105,8 +104,8 @@ private:
struct IFSD_Hash{ size_t operator()( const ImplFontSelectData& ) const; };
typedef ::boost::unordered_map<ImplFontSelectData,ServerFont*,IFSD_Hash,IFSD_Equal > FontList;
FontList maFontList;
- ULONG mnMaxSize; // max overall cache size in bytes
- mutable ULONG mnBytesUsed;
+ sal_uLong mnMaxSize; // max overall cache size in bytes
+ mutable sal_uLong mnBytesUsed;
mutable long mnLruIndex;
mutable int mnGlyphCount;
ServerFont* mpCurrentGCFont;
@@ -179,7 +178,7 @@ private:
// =======================================================================
-class VCL_DLLPUBLIC ServerFont
+class VCL_PLUGIN_PUBLIC ServerFont
{
public:
virtual const ::rtl::OString* GetFontFileName() const { return NULL; }
@@ -195,9 +194,9 @@ public:
const ImplFontSelectData& GetFontSelData() const { return maFontSelData; }
virtual void FetchFontMetric( ImplFontMetricData&, long& rFactor ) const = 0;
- virtual ULONG GetKernPairs( ImplKernPairData** ) const { return 0; }
+ virtual sal_uLong GetKernPairs( ImplKernPairData** ) const { return 0; }
virtual int GetGlyphKernValue( int, int ) const { return 0; }
- virtual bool GetFontCodeRanges( CmapResult& ) const { return false; }
+ virtual const ImplFontCharMap* GetImplFontCharMap() const = 0;
virtual bool GetFontCapabilities(vcl::FontCapabilities &) const { return false; }
Point TransformPoint( const Point& ) const;
@@ -225,7 +224,7 @@ protected:
void AddRef() const { ++mnRefCount; }
long GetRefCount() const { return mnRefCount; }
long Release() const;
- ULONG GetByteCount() const { return mnBytesUsed; }
+ sal_uLong GetByteCount() const { return mnBytesUsed; }
virtual void InitGlyphData( int nGlyphIndex, GlyphData& ) const = 0;
virtual void GarbageCollect( long );
@@ -245,7 +244,7 @@ private:
// used by GlyphCache for cache LRU algorithm
mutable long mnRefCount;
- mutable ULONG mnBytesUsed;
+ mutable sal_uLong mnBytesUsed;
ServerFont* mpPrevGCFont;
ServerFont* mpNextGCFont;
@@ -263,7 +262,7 @@ private:
// =======================================================================
// a class for cache entries for physical font instances that are based on serverfonts
-class VCL_DLLPUBLIC ImplServerFontEntry : public ImplFontEntry
+class VCL_PLUGIN_PUBLIC ImplServerFontEntry : public ImplFontEntry
{
private:
ServerFont* mpServerFont;
@@ -279,7 +278,7 @@ public:
// =======================================================================
-class VCL_DLLPUBLIC ServerFontLayout : public GenericSalLayout
+class VCL_PLUGIN_PUBLIC ServerFontLayout : public GenericSalLayout
{
private:
ServerFont& mrServerFont;
@@ -324,7 +323,7 @@ protected:
// =======================================================================
-class VCL_DLLPUBLIC RawBitmap
+class VCL_PLUGIN_PUBLIC RawBitmap
{
public:
RawBitmap();
@@ -333,13 +332,13 @@ public:
public:
unsigned char* mpBits;
- ULONG mnAllocated;
+ sal_uLong mnAllocated;
- ULONG mnWidth;
- ULONG mnHeight;
+ sal_uLong mnWidth;
+ sal_uLong mnHeight;
- ULONG mnScanlineSize;
- ULONG mnBitCount;
+ sal_uLong mnScanlineSize;
+ sal_uLong mnBitCount;
int mnXOffset;
int mnYOffset;
@@ -357,7 +356,7 @@ inline void ServerFont::SetExtended( int nInfo, void* pVoid )
// ExtraKernInfo allows an on-demand query of extra kerning info #i29881#
// The kerning values have to be scaled to match the font size before use
-class VCL_DLLPUBLIC ExtraKernInfo
+class VCL_PLUGIN_PUBLIC ExtraKernInfo
{
public:
ExtraKernInfo( sal_IntPtr nFontId );
diff --git a/vcl/inc/vcl/gradient.hxx b/vcl/inc/vcl/gradient.hxx
index e451e238b912..1ed0c12ce98f 100644
--- a/vcl/inc/vcl/gradient.hxx
+++ b/vcl/inc/vcl/gradient.hxx
@@ -56,17 +56,17 @@ class SvStream;
class Impl_Gradient
{
public:
- ULONG mnRefCount;
+ sal_uLong mnRefCount;
GradientStyle meStyle;
Color maStartColor;
Color maEndColor;
- USHORT mnAngle;
- USHORT mnBorder;
- USHORT mnOfsX;
- USHORT mnOfsY;
- USHORT mnIntensityStart;
- USHORT mnIntensityEnd;
- USHORT mnStepCount;
+ sal_uInt16 mnAngle;
+ sal_uInt16 mnBorder;
+ sal_uInt16 mnOfsX;
+ sal_uInt16 mnOfsY;
+ sal_uInt16 mnIntensityStart;
+ sal_uInt16 mnIntensityEnd;
+ sal_uInt16 mnStepCount;
friend SvStream& operator>>( SvStream& rIStm, Impl_Gradient& rImplGradient );
friend SvStream& operator<<( SvStream& rOStm, const Impl_Gradient& rImplGradient );
@@ -102,31 +102,31 @@ public:
void SetEndColor( const Color& rColor );
const Color& GetEndColor() const { return mpImplGradient->maEndColor; }
- void SetAngle( USHORT nAngle );
- USHORT GetAngle() const { return mpImplGradient->mnAngle; }
+ void SetAngle( sal_uInt16 nAngle );
+ sal_uInt16 GetAngle() const { return mpImplGradient->mnAngle; }
- void SetBorder( USHORT nBorder );
- USHORT GetBorder() const { return mpImplGradient->mnBorder; }
- void SetOfsX( USHORT nOfsX );
- USHORT GetOfsX() const { return mpImplGradient->mnOfsX; }
- void SetOfsY( USHORT nOfsY );
- USHORT GetOfsY() const { return mpImplGradient->mnOfsY; }
+ void SetBorder( sal_uInt16 nBorder );
+ sal_uInt16 GetBorder() const { return mpImplGradient->mnBorder; }
+ void SetOfsX( sal_uInt16 nOfsX );
+ sal_uInt16 GetOfsX() const { return mpImplGradient->mnOfsX; }
+ void SetOfsY( sal_uInt16 nOfsY );
+ sal_uInt16 GetOfsY() const { return mpImplGradient->mnOfsY; }
- void SetStartIntensity( USHORT nIntens );
- USHORT GetStartIntensity() const { return mpImplGradient->mnIntensityStart; }
- void SetEndIntensity( USHORT nIntens );
- USHORT GetEndIntensity() const { return mpImplGradient->mnIntensityEnd; }
+ void SetStartIntensity( sal_uInt16 nIntens );
+ sal_uInt16 GetStartIntensity() const { return mpImplGradient->mnIntensityStart; }
+ void SetEndIntensity( sal_uInt16 nIntens );
+ sal_uInt16 GetEndIntensity() const { return mpImplGradient->mnIntensityEnd; }
- void SetSteps( USHORT nSteps );
- USHORT GetSteps() const { return mpImplGradient->mnStepCount; }
+ void SetSteps( sal_uInt16 nSteps );
+ sal_uInt16 GetSteps() const { return mpImplGradient->mnStepCount; }
void GetBoundRect( const Rectangle& rRect, Rectangle &rBoundRect, Point& rCenter ) const;
Gradient& operator=( const Gradient& rGradient );
- BOOL operator==( const Gradient& rGradient ) const;
- BOOL operator!=( const Gradient& rGradient ) const
+ sal_Bool operator==( const Gradient& rGradient ) const;
+ sal_Bool operator!=( const Gradient& rGradient ) const
{ return !(Gradient::operator==( rGradient )); }
- BOOL IsSameInstance( const Gradient& rGradient ) const
+ sal_Bool IsSameInstance( const Gradient& rGradient ) const
{ return (mpImplGradient == rGradient.mpImplGradient); }
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Gradient& rGradient );
diff --git a/vcl/inc/vcl/graph.h b/vcl/inc/vcl/graph.h
index 803df074882d..1df2ee7a3df3 100644
--- a/vcl/inc/vcl/graph.h
+++ b/vcl/inc/vcl/graph.h
@@ -57,11 +57,11 @@ protected:
String maUpperName;
ReaderData* mpReaderData;
- BOOL mbIsReading;
+ sal_Bool mbIsReading;
GraphicReader() :
mpReaderData( NULL ),
- mbIsReading( FALSE ) {}
+ mbIsReading( sal_False ) {}
public:
@@ -69,11 +69,11 @@ public:
const String& GetUpperFilterName() const { return maUpperName; }
ReaderData* GetReaderData() const { return mpReaderData; }
- BOOL IsReading() const { return mbIsReading; }
+ sal_Bool IsReading() const { return mbIsReading; }
// TODO: when incompatible changes are possible again
// the preview size hint should be redone
- BOOL IsPreviewModeEnabled() const;
+ sal_Bool IsPreviewModeEnabled() const;
void DisablePreviewMode();
void SetPreviewSize( const Size& );
Size GetPreviewSize() const;
diff --git a/vcl/inc/vcl/graph.hxx b/vcl/inc/vcl/graph.hxx
index 78994327041e..3dfbb8d261d8 100644
--- a/vcl/inc/vcl/graph.hxx
+++ b/vcl/inc/vcl/graph.hxx
@@ -106,19 +106,19 @@ public:
virtual ~Graphic();
Graphic& operator=( const Graphic& rGraphic );
- BOOL operator==( const Graphic& rGraphic ) const;
- BOOL operator!=( const Graphic& rGraphic ) const;
- BOOL operator!() const;
+ sal_Bool operator==( const Graphic& rGraphic ) const;
+ sal_Bool operator!=( const Graphic& rGraphic ) const;
+ sal_Bool operator!() const;
void Clear();
GraphicType GetType() const;
void SetDefaultType();
- BOOL IsSupportedGraphic() const;
+ sal_Bool IsSupportedGraphic() const;
- BOOL IsTransparent() const;
- BOOL IsAlpha() const;
- BOOL IsAnimated() const;
+ sal_Bool IsTransparent() const;
+ sal_Bool IsAlpha() const;
+ sal_Bool IsAnimated() const;
// #i102089# Access of Bitmap potentially will have to rasterconvert the Graphic
// if it is a MetaFile. To be able to control this conversion it is necessary to
@@ -141,7 +141,7 @@ public:
Size GetSizePixel( const OutputDevice* pRefDevice = NULL ) const;
- ULONG GetSizeBytes() const;
+ sal_uLong GetSizeBytes() const;
void Draw( OutputDevice* pOutDev,
const Point& rDestPt ) const;
@@ -170,12 +170,12 @@ public:
void SetAnimationNotifyHdl( const Link& rLink );
Link GetAnimationNotifyHdl() const;
- ULONG GetAnimationLoopCount() const;
+ sal_uLong GetAnimationLoopCount() const;
void ResetAnimationLoopCount();
List* GetAnimationInfoList() const;
- ULONG GetChecksum() const;
+ sal_uLong GetChecksum() const;
public:
@@ -184,26 +184,26 @@ public:
public:
- static USHORT GetGraphicsCompressMode( SvStream& rIStm );
+ static sal_uInt16 GetGraphicsCompressMode( SvStream& rIStm );
- void SetDocFileName( const String& rName, ULONG nFilePos );
+ void SetDocFileName( const String& rName, sal_uLong nFilePos );
const String& GetDocFileName() const;
- ULONG GetDocFilePos() const;
+ sal_uLong GetDocFilePos() const;
- BOOL ReadEmbedded( SvStream& rIStream, BOOL bSwap = FALSE );
- BOOL WriteEmbedded( SvStream& rOStream );
+ sal_Bool ReadEmbedded( SvStream& rIStream, sal_Bool bSwap = sal_False );
+ sal_Bool WriteEmbedded( SvStream& rOStream );
- BOOL SwapOut();
- BOOL SwapOut( SvStream* pOStm );
- BOOL SwapIn();
- BOOL SwapIn( SvStream* pIStm );
- BOOL IsSwapOut() const;
+ sal_Bool SwapOut();
+ sal_Bool SwapOut( SvStream* pOStm );
+ sal_Bool SwapIn();
+ sal_Bool SwapIn( SvStream* pIStm );
+ sal_Bool IsSwapOut() const;
void SetLink( const GfxLink& );
GfxLink GetLink() const;
- BOOL IsLink() const;
+ sal_Bool IsLink() const;
- BOOL ExportNative( SvStream& rOStream ) const;
+ sal_Bool ExportNative( SvStream& rOStream ) const;
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStream, const Graphic& rGraphic );
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, Graphic& rGraphic );
diff --git a/vcl/inc/vcl/graphite_layout.hxx b/vcl/inc/vcl/graphite_layout.hxx
index de39ba36cdbc..f605f190f669 100644
--- a/vcl/inc/vcl/graphite_layout.hxx
+++ b/vcl/inc/vcl/graphite_layout.hxx
@@ -93,7 +93,7 @@ private:
// This class uses the SIL Graphite engine to provide complex text layout services to the VCL
// @author tse
//
-class VCL_DLLPUBLIC GraphiteLayout : public SalLayout
+class VCL_PLUGIN_PUBLIC GraphiteLayout : public SalLayout
{
public:
@@ -170,8 +170,6 @@ private:
long & rDXOffset, bool bIsBase, int baseChar);
};
-
-
#endif // _SV_GRAPHITELAYOUT_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/graphite_serverfont.hxx b/vcl/inc/vcl/graphite_serverfont.hxx
index 8de41337feae..b4a6e10be925 100644
--- a/vcl/inc/vcl/graphite_serverfont.hxx
+++ b/vcl/inc/vcl/graphite_serverfont.hxx
@@ -37,7 +37,7 @@
// Modules
-class VCL_DLLPUBLIC GraphiteLayoutImpl : public GraphiteLayout
+class VCL_PLUGIN_PUBLIC GraphiteLayoutImpl : public GraphiteLayout
{
public:
GraphiteLayoutImpl(const gr_face * pFace,
@@ -52,7 +52,7 @@ private:
// This class implments the server font specific parts.
// @author tse
//
-class VCL_DLLPUBLIC GraphiteServerFontLayout : public ServerFontLayout
+class VCL_PLUGIN_PUBLIC GraphiteServerFontLayout : public ServerFontLayout
{
private:
// mutable so that the DrawOffset/DrawBase can be set
@@ -102,8 +102,6 @@ public:
int getMaxCharPos() const { return mnEndCharPos; }
};
-
-
#endif
#endif //_SV_GRAPHITESERVERFONT_HXX
diff --git a/vcl/inc/vcl/group.hxx b/vcl/inc/vcl/group.hxx
index 765021fbe89b..3334988c7877 100644
--- a/vcl/inc/vcl/group.hxx
+++ b/vcl/inc/vcl/group.hxx
@@ -44,8 +44,8 @@ private:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
- SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize, bool bLayout = false );
virtual void FillLayoutData() const;
@@ -59,7 +59,7 @@ public:
GroupBox( Window* pParent, const ResId& rResId );
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
diff --git a/vcl/inc/vcl/hatch.hxx b/vcl/inc/vcl/hatch.hxx
index 3cdcd0e24c2c..947740229f7f 100644
--- a/vcl/inc/vcl/hatch.hxx
+++ b/vcl/inc/vcl/hatch.hxx
@@ -42,11 +42,11 @@ class SvStream;
struct ImplHatch
{
- ULONG mnRefCount;
+ sal_uLong mnRefCount;
Color maColor;
HatchStyle meStyle;
long mnDistance;
- USHORT mnAngle;
+ sal_uInt16 mnAngle;
ImplHatch();
ImplHatch( const ImplHatch& rImplHatch );
@@ -70,13 +70,13 @@ public:
Hatch();
Hatch( const Hatch& rHatch );
- Hatch( HatchStyle eStyle, const Color& rHatchColor, long nDistance, USHORT nAngle10 = 0 );
+ Hatch( HatchStyle eStyle, const Color& rHatchColor, long nDistance, sal_uInt16 nAngle10 = 0 );
~Hatch();
Hatch& operator=( const Hatch& rHatch );
- BOOL operator==( const Hatch& rHatch ) const;
- BOOL operator!=( const Hatch& rHatch ) const { return !(Hatch::operator==( rHatch ) ); }
- BOOL IsSameInstance( const Hatch& rHatch ) const { return( mpImplHatch == rHatch.mpImplHatch ); }
+ sal_Bool operator==( const Hatch& rHatch ) const;
+ sal_Bool operator!=( const Hatch& rHatch ) const { return !(Hatch::operator==( rHatch ) ); }
+ sal_Bool IsSameInstance( const Hatch& rHatch ) const { return( mpImplHatch == rHatch.mpImplHatch ); }
void SetStyle( HatchStyle eStyle );
HatchStyle GetStyle() const { return mpImplHatch->meStyle; }
@@ -87,8 +87,8 @@ public:
void SetDistance( long nDistance );
long GetDistance() const { return mpImplHatch->mnDistance; }
- void SetAngle( USHORT nAngle10 );
- USHORT GetAngle() const { return mpImplHatch->mnAngle; }
+ void SetAngle( sal_uInt16 nAngle10 );
+ sal_uInt16 GetAngle() const { return mpImplHatch->mnAngle; }
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Hatch& rHatch );
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Hatch& rHatch );
diff --git a/vcl/inc/vcl/help.hxx b/vcl/inc/vcl/help.hxx
index e91b459ee8cc..ce7d1baf4fd6 100644
--- a/vcl/inc/vcl/help.hxx
+++ b/vcl/inc/vcl/help.hxx
@@ -41,20 +41,26 @@ class Window;
// - Help-Types -
// --------------
-#define QUICKHELP_LEFT ((USHORT)0x0001)
-#define QUICKHELP_CENTER ((USHORT)0x0002)
-#define QUICKHELP_RIGHT ((USHORT)0x0004)
-#define QUICKHELP_TOP ((USHORT)0x0008)
-#define QUICKHELP_VCENTER ((USHORT)0x0010)
-#define QUICKHELP_BOTTOM ((USHORT)0x0020)
-#define QUICKHELP_NOAUTOPOS (QUICKHELP_LEFT | QUICKHELP_CENTER | QUICKHELP_RIGHT | QUICKHELP_TOP | QUICKHELP_VCENTER | QUICKHELP_BOTTOM)
-#define QUICKHELP_CTRLTEXT ((USHORT)0x0040)
-#define QUICKHELP_NOEVADEPOINTER ((USHORT)0x4000)
-#define QUICKHELP_BIDI_RTL ((USHORT)0x8000)
+#define QUICKHELP_LEFT ((sal_uInt16)0x0001)
+#define QUICKHELP_CENTER ((sal_uInt16)0x0002)
+#define QUICKHELP_RIGHT ((sal_uInt16)0x0004)
+#define QUICKHELP_TOP ((sal_uInt16)0x0008)
+#define QUICKHELP_VCENTER ((sal_uInt16)0x0010)
+#define QUICKHELP_BOTTOM ((sal_uInt16)0x0020)
+#define QUICKHELP_NOAUTOPOS (QUICKHELP_LEFT | QUICKHELP_CENTER | QUICKHELP_RIGHT | QUICKHELP_TOP | QUICKHELP_VCENTER | QUICKHELP_BOTTOM)
+#define QUICKHELP_CTRLTEXT ((sal_uInt16)0x0040)
+/// force the existent tip window to be re-positioned, even if the previous incarnation has the same text. Applies to ShowBallon and ShowQuickHelp.
+#define QUICKHELP_FORCE_REPOSITION ((sal_uInt16)0x0080)
+/// no delay when opening the quick help. Applies to ShowBallon and ShowQuickHelp
+#define QUICKHELP_NO_DELAY ((sal_uInt16)0x0100)
+/// force balloon-style in ShowTip
+#define QUICKHELP_TIP_STYLE_BALLOON ((sal_uInt16)0x0200)
+#define QUICKHELP_NOEVADEPOINTER ((sal_uInt16)0x4000)
+#define QUICKHELP_BIDI_RTL ((sal_uInt16)0x8000)
// By changes you must also change: rsc/vclrsc.hxx
-#define OOO_HELP_INDEX ((ULONG)0xFFFFFFFF)
-#define OOO_HELP_HELPONHELP ((ULONG)0xFFFFFFFE)
+#define OOO_HELP_INDEX ".help:index"
+#define OOO_HELP_HELPONHELP ".help:helponhelp"
// --------
// - Help -
@@ -72,53 +78,56 @@ public:
void SetHelpFile( const String& rFileName ) { maHelpFile = rFileName; }
const String& GetHelpFile() const { return maHelpFile; }
- virtual BOOL Start( ULONG nHelpId, const Window* pWindow );
- virtual BOOL Start( const XubString& rKeyWord, const Window* pWindow );
- virtual void OpenHelpAgent( ULONG nHelpId );
- virtual XubString GetHelpText( ULONG nHelpId, const Window* pWindow );
+ virtual sal_Bool Start( const XubString& rHelpId, const Window* pWindow );
+ virtual sal_Bool SearchKeyword( const XubString& rKeyWord );
+ virtual void OpenHelpAgent( const rtl::OString& rHelpId );
virtual XubString GetHelpText( const String& aHelpURL, const Window* pWindow );
static void EnableContextHelp();
static void DisableContextHelp();
- static BOOL IsContextHelpEnabled();
- static BOOL StartContextHelp();
+ static sal_Bool IsContextHelpEnabled();
+ static sal_Bool StartContextHelp();
static void EnableExtHelp();
static void DisableExtHelp();
- static BOOL IsExtHelpEnabled();
- static BOOL StartExtHelp();
- static BOOL EndExtHelp();
- static BOOL IsExtHelpActive();
+ static sal_Bool IsExtHelpEnabled();
+ static sal_Bool StartExtHelp();
+ static sal_Bool EndExtHelp();
+ static sal_Bool IsExtHelpActive();
static void EnableBalloonHelp();
static void DisableBalloonHelp();
- static BOOL IsBalloonHelpEnabled();
- static BOOL ShowBalloon( Window* pParent,
+ static sal_Bool IsBalloonHelpEnabled();
+ static sal_Bool ShowBalloon( Window* pParent,
const Point& rScreenPos,
const XubString& rHelpText );
- static BOOL ShowBalloon( Window* pParent,
+ static sal_Bool ShowBalloon( Window* pParent,
const Point& rScreenPos,
const Rectangle&,
const XubString& rHelpText );
static void EnableQuickHelp();
static void DisableQuickHelp();
- static BOOL IsQuickHelpEnabled();
- static BOOL ShowQuickHelp( Window* pParent,
+ static sal_Bool IsQuickHelpEnabled();
+ static sal_Bool ShowQuickHelp( Window* pParent,
const Rectangle& rScreenRect,
const XubString& rHelpText,
const XubString& rLongHelpText,
- USHORT nStyle = 0 );
- static BOOL ShowQuickHelp( Window* pParent,
+ sal_uInt16 nStyle = 0 );
+ static sal_Bool ShowQuickHelp( Window* pParent,
const Rectangle& rScreenRect,
const XubString& rHelpText,
- USHORT nStyle = 0 )
+ sal_uInt16 nStyle = 0 )
{ return Help::ShowQuickHelp( pParent, rScreenRect, rHelpText, XubString(), nStyle ); }
- static ULONG ShowTip( Window* pParent,
+ static sal_uLong ShowTip( Window* pParent,
const Rectangle& rScreenRect,
- const XubString& rText, USHORT nStyle = 0 );
- static void HideTip( ULONG nId );
+ const XubString& rText, sal_uInt16 nStyle = 0 );
+ static void UpdateTip( sal_uLong nId,
+ Window* pParent,
+ const Rectangle& rScreenRect,
+ const XubString& rText );
+ static void HideTip( sal_uLong nId );
};
#endif // _SV_HELP_HXX
diff --git a/vcl/inc/vcl/helpwin.hxx b/vcl/inc/vcl/helpwin.hxx
index 9066012d05f2..7862a4961bbd 100644
--- a/vcl/inc/vcl/helpwin.hxx
+++ b/vcl/inc/vcl/helpwin.hxx
@@ -50,8 +50,8 @@ private:
Timer maShowTimer;
Timer maHideTimer;
- USHORT mnHelpWinStyle;
- USHORT mnStyle;
+ sal_uInt16 mnHelpWinStyle;
+ sal_uInt16 mnStyle;
protected:
DECL_LINK( TimerHdl, Timer* );
@@ -61,33 +61,34 @@ protected:
void ImplShow();
public:
- HelpTextWindow( Window* pParent, const String& rText, USHORT nHelpWinStyle, USHORT nStyle );
+ HelpTextWindow( Window* pParent, const String& rText, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle );
~HelpTextWindow();
const String& GetHelpText() const { return maHelpText; }
void SetHelpText( const String& rHelpText );
- USHORT GetWinStyle() const { return mnHelpWinStyle; }
+ sal_uInt16 GetWinStyle() const { return mnHelpWinStyle; }
+ sal_uInt16 GetStyle() const { return mnStyle; }
// Nur merken:
void SetStatusText( const String& rStatusText ) { maStatusText = rStatusText; }
void SetHelpArea( const Rectangle& rRect ) { maHelpArea = rRect; }
- void ShowHelp( USHORT nDelayMode );
+ void ShowHelp( sal_uInt16 nDelayMode );
Size CalcOutSize() const;
const Rectangle& GetHelpArea() const { return maHelpArea; }
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
- BOOL RegisterAccessibleParent();
+ sal_Bool RegisterAccessibleParent();
void RevokeAccessibleParent();
};
-void ImplShowHelpWindow( Window* pParent, USHORT nHelpWinStyle, USHORT nStyle,
+void ImplShowHelpWindow( Window* pParent, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle,
const String& rHelpText, const String& rStatusText,
const Point& rScreenPos, const Rectangle* pHelpArea = NULL );
void ImplDestroyHelpWindow( bool bUpdateHideTime );
-void ImplSetHelpWindowPos( Window* pHelpWindow, USHORT nHelpWinStyle, USHORT nStyle,
+void ImplSetHelpWindowPos( Window* pHelpWindow, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle,
const Point& rPos, const Rectangle* pHelpArea );
#endif // _SV_HELPWIN_HXX
diff --git a/vcl/inc/vcl/i18nhelp.hxx b/vcl/inc/vcl/i18nhelp.hxx
index 428032ae2017..a83afa4510ab 100644
--- a/vcl/inc/vcl/i18nhelp.hxx
+++ b/vcl/inc/vcl/i18nhelp.hxx
@@ -87,7 +87,7 @@ public:
sal_Bool MatchMnemonic( const String& rString, sal_Unicode cMnemonicChar ) const;
String GetDate( const Date& rDate ) const;
- String GetNum( long nNumber, USHORT nDecimals, BOOL bUseThousandSep = TRUE, BOOL bTrailingZeros = TRUE ) const;
+ String GetNum( long nNumber, sal_uInt16 nDecimals, sal_Bool bUseThousandSep = sal_True, sal_Bool bTrailingZeros = sal_True ) const;
static String filterFormattingChars( const String& );
};
diff --git a/vcl/inc/vcl/idlemgr.hxx b/vcl/inc/vcl/idlemgr.hxx
index a0f5aa9a052c..674bdf070c3a 100644
--- a/vcl/inc/vcl/idlemgr.hxx
+++ b/vcl/inc/vcl/idlemgr.hxx
@@ -50,7 +50,7 @@ public:
ImplIdleMgr();
~ImplIdleMgr();
- BOOL InsertIdleHdl( const Link& rLink, USHORT nPriority );
+ sal_Bool InsertIdleHdl( const Link& rLink, sal_uInt16 nPriority );
void RemoveIdleHdl( const Link& rLink );
void RestartIdler()
diff --git a/vcl/inc/vcl/ilstbox.hxx b/vcl/inc/vcl/ilstbox.hxx
index b468978f247e..850531c64d9d 100644
--- a/vcl/inc/vcl/ilstbox.hxx
+++ b/vcl/inc/vcl/ilstbox.hxx
@@ -37,6 +37,7 @@
#include <vcl/lstbox.h>
#include <vcl/timer.hxx>
+#include "vcl/quickselectionengine.hxx"
class ScrollBar;
class ScrollBarBox;
@@ -66,7 +67,7 @@ struct ImplEntryType
XubString maStr;
Image maImage;
void* mpUserData;
- BOOL mbIsSelected;
+ sal_Bool mbIsSelected;
long mnFlags;
long mnHeight;
@@ -76,7 +77,7 @@ struct ImplEntryType
mnFlags( 0 ),
mnHeight( 0 )
{
- mbIsSelected = FALSE;
+ mbIsSelected = sal_False;
mpUserData = NULL;
}
@@ -85,7 +86,7 @@ struct ImplEntryType
mnFlags( 0 ),
mnHeight( 0 )
{
- mbIsSelected = FALSE;
+ mbIsSelected = sal_False;
mpUserData = NULL;
}
@@ -94,7 +95,7 @@ struct ImplEntryType
mnFlags( 0 ),
mnHeight( 0 )
{
- mbIsSelected = FALSE;
+ mbIsSelected = sal_False;
mpUserData = NULL;
}
};
@@ -107,100 +108,98 @@ class ImplEntryList : private List
{
private:
Window* mpWindow; // For getting the current locale when matching strings
- USHORT mnLastSelected;
- USHORT mnSelectionAnchor;
- USHORT mnImages;
+ sal_uInt16 mnLastSelected;
+ sal_uInt16 mnSelectionAnchor;
+ sal_uInt16 mnImages;
- USHORT mnMRUCount;
- USHORT mnMaxMRUCount;
+ sal_uInt16 mnMRUCount;
+ sal_uInt16 mnMaxMRUCount;
Link maSelectionChangedHdl;
- BOOL mbCallSelectionChangedHdl;
+ sal_Bool mbCallSelectionChangedHdl;
- ImplEntryType* GetEntry( USHORT nPos ) const { return (ImplEntryType*)List::GetObject( nPos ); }
+ ImplEntryType* GetEntry( sal_uInt16 nPos ) const { return (ImplEntryType*)List::GetObject( nPos ); }
public:
ImplEntryList( Window* pWindow );
~ImplEntryList();
- USHORT InsertEntry( USHORT nPos, ImplEntryType* pNewEntry, BOOL bSort );
- void RemoveEntry( USHORT nPos );
- const ImplEntryType* GetEntryPtr( USHORT nPos ) const { return (const ImplEntryType*) GetObject( nPos ); }
- ImplEntryType* GetMutableEntryPtr( USHORT nPos ) const { return (ImplEntryType*) GetObject( nPos ); }
+ sal_uInt16 InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry, sal_Bool bSort );
+ void RemoveEntry( sal_uInt16 nPos );
+ const ImplEntryType* GetEntryPtr( sal_uInt16 nPos ) const { return (const ImplEntryType*) GetObject( nPos ); }
+ ImplEntryType* GetMutableEntryPtr( sal_uInt16 nPos ) const { return (ImplEntryType*) GetObject( nPos ); }
void Clear();
- USHORT FindMatchingEntry( const XubString& rStr, USHORT nStart = 0, BOOL bForward = TRUE, BOOL bLazy = TRUE ) const;
- USHORT FindEntry( const XubString& rStr, BOOL bSearchMRUArea = FALSE ) const;
- USHORT FindEntry( const void* pData ) const;
+ sal_uInt16 FindMatchingEntry( const XubString& rStr, sal_uInt16 nStart = 0, sal_Bool bForward = sal_True, sal_Bool bLazy = sal_True ) const;
+ sal_uInt16 FindEntry( const XubString& rStr, sal_Bool bSearchMRUArea = sal_False ) const;
+ sal_uInt16 FindEntry( const void* pData ) const;
// helper: add up heights up to index nEndIndex.
// GetAddedHeight( 0 ) returns 0
// GetAddedHeight( LISTBOX_ENTRY_NOTFOUND ) returns 0
// GetAddedHeight( i, k ) with k > i is equivalent -GetAddedHeight( k, i )
- long GetAddedHeight( USHORT nEndIndex, USHORT nBeginIndex = 0, long nBeginHeight = 0 ) const;
- long GetEntryHeight( USHORT nPos ) const;
+ long GetAddedHeight( sal_uInt16 nEndIndex, sal_uInt16 nBeginIndex = 0, long nBeginHeight = 0 ) const;
+ long GetEntryHeight( sal_uInt16 nPos ) const;
- USHORT GetEntryCount() const { return (USHORT)List::Count(); }
- BOOL HasImages() const { return mnImages ? TRUE : FALSE; }
+ sal_uInt16 GetEntryCount() const { return (sal_uInt16)List::Count(); }
+ sal_Bool HasImages() const { return mnImages ? sal_True : sal_False; }
- XubString GetEntryText( USHORT nPos ) const;
+ XubString GetEntryText( sal_uInt16 nPos ) const;
- BOOL HasEntryImage( USHORT nPos ) const;
- Image GetEntryImage( USHORT nPos ) const;
+ sal_Bool HasEntryImage( sal_uInt16 nPos ) const;
+ Image GetEntryImage( sal_uInt16 nPos ) const;
- void SetEntryData( USHORT nPos, void* pNewData );
- void* GetEntryData( USHORT nPos ) const;
+ void SetEntryData( sal_uInt16 nPos, void* pNewData );
+ void* GetEntryData( sal_uInt16 nPos ) const;
- void SetEntryFlags( USHORT nPos, long nFlags );
- long GetEntryFlags( USHORT nPos ) const;
+ void SetEntryFlags( sal_uInt16 nPos, long nFlags );
+ long GetEntryFlags( sal_uInt16 nPos ) const;
- void SelectEntry( USHORT nPos, BOOL bSelect );
+ void SelectEntry( sal_uInt16 nPos, sal_Bool bSelect );
- USHORT GetSelectEntryCount() const;
- XubString GetSelectEntry( USHORT nIndex ) const;
- USHORT GetSelectEntryPos( USHORT nIndex ) const;
- BOOL IsEntrySelected( const XubString& rStr ) const;
- BOOL IsEntryPosSelected( USHORT nIndex ) const;
+ sal_uInt16 GetSelectEntryCount() const;
+ XubString GetSelectEntry( sal_uInt16 nIndex ) const;
+ sal_uInt16 GetSelectEntryPos( sal_uInt16 nIndex ) const;
+ sal_Bool IsEntrySelected( const XubString& rStr ) const;
+ sal_Bool IsEntryPosSelected( sal_uInt16 nIndex ) const;
- void SetLastSelected( USHORT nPos ) { mnLastSelected = nPos; }
- USHORT GetLastSelected() const { return mnLastSelected; }
+ void SetLastSelected( sal_uInt16 nPos ) { mnLastSelected = nPos; }
+ sal_uInt16 GetLastSelected() const { return mnLastSelected; }
- void SetSelectionAnchor( USHORT nPos ) { mnSelectionAnchor = nPos; }
- USHORT GetSelectionAnchor() const { return mnSelectionAnchor; }
+ void SetSelectionAnchor( sal_uInt16 nPos ) { mnSelectionAnchor = nPos; }
+ sal_uInt16 GetSelectionAnchor() const { return mnSelectionAnchor; }
void SetSelectionChangedHdl( const Link& rLnk ) { maSelectionChangedHdl = rLnk; }
- void SetCallSelectionChangedHdl( BOOL bCall ) { mbCallSelectionChangedHdl = bCall; }
+ void SetCallSelectionChangedHdl( sal_Bool bCall ) { mbCallSelectionChangedHdl = bCall; }
- void SetMRUCount( USHORT n ) { mnMRUCount = n; }
- USHORT GetMRUCount() const { return mnMRUCount; }
+ void SetMRUCount( sal_uInt16 n ) { mnMRUCount = n; }
+ sal_uInt16 GetMRUCount() const { return mnMRUCount; }
- void SetMaxMRUCount( USHORT n ) { mnMaxMRUCount = n; }
- USHORT GetMaxMRUCount() const { return mnMaxMRUCount; }
+ void SetMaxMRUCount( sal_uInt16 n ) { mnMaxMRUCount = n; }
+ sal_uInt16 GetMaxMRUCount() const { return mnMaxMRUCount; }
/** An Entry is selectable if its mnFlags does not have the
LISTBOX_ENTRY_FLAG_DISABLE_SELECTION flag set. */
- bool IsEntrySelectable( USHORT nPos ) const;
+ bool IsEntrySelectable( sal_uInt16 nPos ) const;
/** returns the first entry found from the given position nPos that is selectable
or LISTBOX_ENTRY_NOTFOUND if non is found. If the entry at nPos is not selectable,
it returns the first selectable entry after nPos if bForward is true and the
first selectable entry after nPos is bForward is false.
*/
- USHORT FindFirstSelectable( USHORT nPos, bool bForward = true );
+ sal_uInt16 FindFirstSelectable( sal_uInt16 nPos, bool bForward = true );
};
// ---------------------
// - ImplListBoxWindow -
// ---------------------
-class ImplListBoxWindow : public Control
+class ImplListBoxWindow : public Control, public ::vcl::ISearchableStringList
{
private:
ImplEntryList* mpEntryList; // EntryListe
Rectangle maFocusRect;
- String maSearchStr;
- Timer maSearchTimeout;
Size maUserItemSize;
@@ -214,22 +213,22 @@ private:
long mnMaxWidth; // Maximale Breite eines Eintrags
long mnMaxHeight; // Maximale Hoehe eines Eintrags
- USHORT mnCurrentPos; // Position (Focus)
- USHORT mnTrackingSaveSelection; // Selektion vor Tracking();
+ sal_uInt16 mnCurrentPos; // Position (Focus)
+ sal_uInt16 mnTrackingSaveSelection; // Selektion vor Tracking();
- USHORT mnSeparatorPos; // Separator
+ sal_uInt16 mnSeparatorPos; // Separator
- USHORT mnUserDrawEntry;
+ sal_uInt16 mnUserDrawEntry;
- USHORT mnTop; // Ausgabe ab Zeile
+ sal_uInt16 mnTop; // Ausgabe ab Zeile
long mnLeft; // Ausgabe ab Spalte
long mnBorder; // Abstand Rahmen - Text
long mnTextHeight; // Texthoehe
ProminentEntry meProminentType; // where is the "prominent" entry
- USHORT mnSelectModifier; // Modifiers
+ sal_uInt16 mnSelectModifier; // Modifiers
- BOOL mbHasFocusRect: 1,
+ sal_Bool mbHasFocusRect: 1,
mbSort: 1, // ListBox sortiert
mbTrack: 1, // Tracking
mbMulti: 1, // MultiListBox
@@ -255,9 +254,10 @@ private:
Link maUserDrawHdl;
Link maMRUChangedHdl;
-protected:
- DECL_LINK( SearchStringTimeout, Timer* );
+ ::vcl::QuickSelectionEngine
+ maQuickSelectionEngine;
+protected:
virtual void KeyInput( const KeyEvent& rKEvt );
virtual void MouseButtonDown( const MouseEvent& rMEvt );
virtual void MouseMove( const MouseEvent& rMEvt );
@@ -267,8 +267,8 @@ protected:
virtual void GetFocus();
virtual void LoseFocus();
- BOOL SelectEntries( USHORT nSelect, LB_EVENT_TYPE eLET, BOOL bShift = FALSE, BOOL bCtrl = FALSE );
- void ImplPaint( USHORT nPos, BOOL bErase = FALSE, bool bLayout = false );
+ sal_Bool SelectEntries( sal_uInt16 nSelect, LB_EVENT_TYPE eLET, sal_Bool bShift = sal_False, sal_Bool bCtrl = sal_False );
+ void ImplPaint( sal_uInt16 nPos, sal_Bool bErase = sal_False, bool bLayout = false );
void ImplDoPaint( const Rectangle& rRect, bool bLayout = false );
void ImplCalcMetrics();
void ImplUpdateEntryMetrics( ImplEntryType& rEntry );
@@ -289,65 +289,65 @@ public:
ImplEntryList* GetEntryList() const { return mpEntryList; }
- USHORT InsertEntry( USHORT nPos, ImplEntryType* pNewEntry );
- void RemoveEntry( USHORT nPos );
+ sal_uInt16 InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry );
+ void RemoveEntry( sal_uInt16 nPos );
void Clear();
void ResetCurrentPos() { mnCurrentPos = LISTBOX_ENTRY_NOTFOUND; }
- USHORT GetCurrentPos() const { return mnCurrentPos; }
- USHORT GetDisplayLineCount() const;
- void SetEntryFlags( USHORT nPos, long nFlags );
+ sal_uInt16 GetCurrentPos() const { return mnCurrentPos; }
+ sal_uInt16 GetDisplayLineCount() const;
+ void SetEntryFlags( sal_uInt16 nPos, long nFlags );
- void DrawEntry( USHORT nPos, BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos = FALSE, bool bLayout = false );
+ void DrawEntry( sal_uInt16 nPos, sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos = sal_False, bool bLayout = false );
- void SelectEntry( USHORT nPos, BOOL bSelect );
+ void SelectEntry( sal_uInt16 nPos, sal_Bool bSelect );
void DeselectAll();
- USHORT GetEntryPosForPoint( const Point& rPoint ) const;
- USHORT GetLastVisibleEntry() const;
+ sal_uInt16 GetEntryPosForPoint( const Point& rPoint ) const;
+ sal_uInt16 GetLastVisibleEntry() const;
- BOOL ProcessKeyInput( const KeyEvent& rKEvt );
+ sal_Bool ProcessKeyInput( const KeyEvent& rKEvt );
- void SetTopEntry( USHORT nTop );
- USHORT GetTopEntry() const { return mnTop; }
+ void SetTopEntry( sal_uInt16 nTop );
+ sal_uInt16 GetTopEntry() const { return mnTop; }
// ShowProminentEntry will set the entry correspoding to nEntryPos
// either at top or in the middle depending on the chosen style
- void ShowProminentEntry( USHORT nEntryPos );
+ void ShowProminentEntry( sal_uInt16 nEntryPos );
void SetProminentEntryType( ProminentEntry eType ) { meProminentType = eType; }
ProminentEntry GetProminentEntryType() const { return meProminentType; }
using Window::IsVisible;
- BOOL IsVisible( USHORT nEntry ) const;
+ sal_Bool IsVisible( sal_uInt16 nEntry ) const;
long GetLeftIndent() const { return mnLeft; }
void SetLeftIndent( long n );
void ScrollHorz( long nDiff );
- void AllowGrabFocus( BOOL b ) { mbGrabFocus = b; }
- BOOL IsGrabFocusAllowed() const { return mbGrabFocus; }
+ void AllowGrabFocus( sal_Bool b ) { mbGrabFocus = b; }
+ sal_Bool IsGrabFocusAllowed() const { return mbGrabFocus; }
- void SetSeparatorPos( USHORT n ) { mnSeparatorPos = n; }
- USHORT GetSeparatorPos() const { return mnSeparatorPos; }
+ void SetSeparatorPos( sal_uInt16 n ) { mnSeparatorPos = n; }
+ sal_uInt16 GetSeparatorPos() const { return mnSeparatorPos; }
- void SetTravelSelect( BOOL bTravelSelect ) { mbTravelSelect = bTravelSelect; }
- BOOL IsTravelSelect() const { return mbTravelSelect; }
- BOOL IsTrackingSelect() const { return mbTrackingSelect; }
+ void SetTravelSelect( sal_Bool bTravelSelect ) { mbTravelSelect = bTravelSelect; }
+ sal_Bool IsTravelSelect() const { return mbTravelSelect; }
+ sal_Bool IsTrackingSelect() const { return mbTrackingSelect; }
void SetUserItemSize( const Size& rSz );
const Size& GetUserItemSize() const { return maUserItemSize; }
- void EnableUserDraw( BOOL bUserDraw ) { mbUserDrawEnabled = bUserDraw; }
- BOOL IsUserDrawEnabled() const { return mbUserDrawEnabled; }
+ void EnableUserDraw( sal_Bool bUserDraw ) { mbUserDrawEnabled = bUserDraw; }
+ sal_Bool IsUserDrawEnabled() const { return mbUserDrawEnabled; }
- void EnableMultiSelection( BOOL bMulti, BOOL bStackMode ) { mbMulti = bMulti; mbStackMode = bStackMode; }
- BOOL IsMultiSelectionEnabled() const { return mbMulti; }
+ void EnableMultiSelection( sal_Bool bMulti, sal_Bool bStackMode ) { mbMulti = bMulti; mbStackMode = bStackMode; }
+ sal_Bool IsMultiSelectionEnabled() const { return mbMulti; }
- void SetMultiSelectionSimpleMode( BOOL bSimple ) { mbSimpleMode = bSimple; }
- BOOL IsMultiSelectionSimpleMode() const { return mbSimpleMode; }
+ void SetMultiSelectionSimpleMode( sal_Bool bSimple ) { mbSimpleMode = bSimple; }
+ sal_Bool IsMultiSelectionSimpleMode() const { return mbSimpleMode; }
- void EnableMouseMoveSelect( BOOL bMouseMoveSelect ) { mbMouseMoveSelect = bMouseMoveSelect; }
- BOOL IsMouseMoveSelectEnabled() const { return mbMouseMoveSelect; }
- BOOL IsMouseMoveSelect() const { return mbMouseMoveSelect||mbStackMode; }
+ void EnableMouseMoveSelect( sal_Bool bMouseMoveSelect ) { mbMouseMoveSelect = bMouseMoveSelect; }
+ sal_Bool IsMouseMoveSelectEnabled() const { return mbMouseMoveSelect; }
+ sal_Bool IsMouseMoveSelect() const { return mbMouseMoveSelect||mbStackMode; }
- Size CalcSize( USHORT nMaxLines ) const;
- Rectangle GetBoundingRectangle( USHORT nItem ) const;
+ Size CalcSize( sal_uInt16 nMaxLines ) const;
+ Rectangle GetBoundingRectangle( sal_uInt16 nItem ) const;
long GetEntryHeight() const { return mnMaxHeight; }
long GetMaxEntryWidth() const { return mnMaxWidth; }
@@ -365,21 +365,27 @@ public:
void SetMRUChangedHdl( const Link& rLink ) { maMRUChangedHdl = rLink; }
const Link& GetMRUChangedHdl() const { return maMRUChangedHdl; }
- BOOL IsSelectionChanged() const { return mbSelectionChanged; }
- USHORT GetSelectModifier() const { return mnSelectModifier; }
+ sal_Bool IsSelectionChanged() const { return mbSelectionChanged; }
+ sal_uInt16 GetSelectModifier() const { return mnSelectModifier; }
- void EnableSort( BOOL b ) { mbSort = b; }
+ void EnableSort( sal_Bool b ) { mbSort = b; }
- void SetReadOnly( BOOL bReadOnly ) { mbReadOnly = bReadOnly; }
- BOOL IsReadOnly() const { return mbReadOnly; }
+ void SetReadOnly( sal_Bool bReadOnly ) { mbReadOnly = bReadOnly; }
+ sal_Bool IsReadOnly() const { return mbReadOnly; }
using Control::ImplInitSettings;
- void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
- USHORT ImplGetTextStyle() const;
+ void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ sal_uInt16 ImplGetTextStyle() const;
// pb: #106948# explicit mirroring for calc
- inline void EnableMirroring() { mbMirroring = TRUE; }
- inline BOOL IsMirroring() const { return mbMirroring; }
+ inline void EnableMirroring() { mbMirroring = sal_True; }
+ inline sal_Bool IsMirroring() const { return mbMirroring; }
+
+protected:
+ // ISearchableStringList
+ virtual ::vcl::StringEntryIdentifier CurrentEntry( String& _out_entryText ) const;
+ virtual ::vcl::StringEntryIdentifier NextEntry( ::vcl::StringEntryIdentifier _currentEntry, String& _out_entryText ) const;
+ virtual void SelectEntry( ::vcl::StringEntryIdentifier _entry );
};
// ---------------
@@ -393,7 +399,7 @@ private:
ScrollBar* mpHScrollBar;
ScrollBar* mpVScrollBar;
ScrollBarBox* mpScrollBarBox;
- BOOL mbVScroll : 1, // VScroll an oder aus
+ sal_Bool mbVScroll : 1, // VScroll an oder aus
mbHScroll : 1, // HScroll an oder aus
mbAutoHScroll : 1; // AutoHScroll an oder aus
Link maScrollHdl; // Weil der vom ImplListBoxWindow selbst benoetigt wird.
@@ -425,55 +431,55 @@ public:
virtual const Wallpaper& GetDisplayBackground() const;
virtual Window* GetPreferredKeyInputWindow();
- USHORT InsertEntry( USHORT nPos, const XubString& rStr );
- USHORT InsertEntry( USHORT nPos, const Image& rImage );
- USHORT InsertEntry( USHORT nPos, const XubString& rStr, const Image& rImage );
- void RemoveEntry( USHORT nPos );
- void SetEntryData( USHORT nPos, void* pNewData ) { maLBWindow.GetEntryList()->SetEntryData( nPos, pNewData ); }
+ sal_uInt16 InsertEntry( sal_uInt16 nPos, const XubString& rStr );
+ sal_uInt16 InsertEntry( sal_uInt16 nPos, const Image& rImage );
+ sal_uInt16 InsertEntry( sal_uInt16 nPos, const XubString& rStr, const Image& rImage );
+ void RemoveEntry( sal_uInt16 nPos );
+ void SetEntryData( sal_uInt16 nPos, void* pNewData ) { maLBWindow.GetEntryList()->SetEntryData( nPos, pNewData ); }
void Clear();
- void SetEntryFlags( USHORT nPos, long nFlags );
- long GetEntryFlags( USHORT nPos ) const;
+ void SetEntryFlags( sal_uInt16 nPos, long nFlags );
+ long GetEntryFlags( sal_uInt16 nPos ) const;
- void SelectEntry( USHORT nPos, BOOL bSelect );
+ void SelectEntry( sal_uInt16 nPos, sal_Bool bSelect );
void SetNoSelection();
void ResetCurrentPos() { maLBWindow.ResetCurrentPos(); }
- USHORT GetCurrentPos() const { return maLBWindow.GetCurrentPos(); }
+ sal_uInt16 GetCurrentPos() const { return maLBWindow.GetCurrentPos(); }
- BOOL ProcessKeyInput( const KeyEvent& rKEvt ) { return maLBWindow.ProcessKeyInput( rKEvt ); }
- BOOL HandleWheelAsCursorTravel( const CommandEvent& rCEvt );
+ sal_Bool ProcessKeyInput( const KeyEvent& rKEvt ) { return maLBWindow.ProcessKeyInput( rKEvt ); }
+ sal_Bool HandleWheelAsCursorTravel( const CommandEvent& rCEvt );
- void SetSeparatorPos( USHORT n ) { maLBWindow.SetSeparatorPos( n ); }
- USHORT GetSeparatorPos() const { return maLBWindow.GetSeparatorPos(); }
+ void SetSeparatorPos( sal_uInt16 n ) { maLBWindow.SetSeparatorPos( n ); }
+ sal_uInt16 GetSeparatorPos() const { return maLBWindow.GetSeparatorPos(); }
- void SetTopEntry( USHORT nTop ) { maLBWindow.SetTopEntry( nTop ); }
- USHORT GetTopEntry() const { return maLBWindow.GetTopEntry(); }
- void ShowProminentEntry( USHORT nPos ) { maLBWindow.ShowProminentEntry( nPos ); }
+ void SetTopEntry( sal_uInt16 nTop ) { maLBWindow.SetTopEntry( nTop ); }
+ sal_uInt16 GetTopEntry() const { return maLBWindow.GetTopEntry(); }
+ void ShowProminentEntry( sal_uInt16 nPos ) { maLBWindow.ShowProminentEntry( nPos ); }
using Window::IsVisible;
- BOOL IsVisible( USHORT nEntry ) const { return maLBWindow.IsVisible( nEntry ); }
+ sal_Bool IsVisible( sal_uInt16 nEntry ) const { return maLBWindow.IsVisible( nEntry ); }
void SetProminentEntryType( ProminentEntry eType ) { maLBWindow.SetProminentEntryType( eType ); }
ProminentEntry GetProminentEntryType() const { return maLBWindow.GetProminentEntryType(); }
long GetLeftIndent() const { return maLBWindow.GetLeftIndent(); }
- void SetLeftIndent( USHORT n ) { maLBWindow.SetLeftIndent( n ); }
+ void SetLeftIndent( sal_uInt16 n ) { maLBWindow.SetLeftIndent( n ); }
void ScrollHorz( short nDiff ) { maLBWindow.ScrollHorz( nDiff ); }
- void SetTravelSelect( BOOL bTravelSelect ) { maLBWindow.SetTravelSelect( bTravelSelect ); }
- BOOL IsTravelSelect() const { return maLBWindow.IsTravelSelect(); }
- BOOL IsTrackingSelect() const { return maLBWindow.IsTrackingSelect(); }
+ void SetTravelSelect( sal_Bool bTravelSelect ) { maLBWindow.SetTravelSelect( bTravelSelect ); }
+ sal_Bool IsTravelSelect() const { return maLBWindow.IsTravelSelect(); }
+ sal_Bool IsTrackingSelect() const { return maLBWindow.IsTrackingSelect(); }
- void EnableMultiSelection( BOOL bMulti, BOOL bStackMode ) { maLBWindow.EnableMultiSelection( bMulti, bStackMode ); }
- BOOL IsMultiSelectionEnabled() const { return maLBWindow.IsMultiSelectionEnabled(); }
+ void EnableMultiSelection( sal_Bool bMulti, sal_Bool bStackMode ) { maLBWindow.EnableMultiSelection( bMulti, bStackMode ); }
+ sal_Bool IsMultiSelectionEnabled() const { return maLBWindow.IsMultiSelectionEnabled(); }
- void SetMultiSelectionSimpleMode( BOOL bSimple ) { maLBWindow.SetMultiSelectionSimpleMode( bSimple ); }
- BOOL IsMultiSelectionSimpleMode() const { return maLBWindow.IsMultiSelectionSimpleMode(); }
+ void SetMultiSelectionSimpleMode( sal_Bool bSimple ) { maLBWindow.SetMultiSelectionSimpleMode( bSimple ); }
+ sal_Bool IsMultiSelectionSimpleMode() const { return maLBWindow.IsMultiSelectionSimpleMode(); }
- void SetReadOnly( BOOL b ) { maLBWindow.SetReadOnly( b ); }
- BOOL IsReadOnly() const { return maLBWindow.IsReadOnly(); }
+ void SetReadOnly( sal_Bool b ) { maLBWindow.SetReadOnly( b ); }
+ sal_Bool IsReadOnly() const { return maLBWindow.IsReadOnly(); }
- Size CalcSize( USHORT nMaxLines ) const { return maLBWindow.CalcSize( nMaxLines ); }
+ Size CalcSize( sal_uInt16 nMaxLines ) const { return maLBWindow.CalcSize( nMaxLines ); }
long GetEntryHeight() const { return maLBWindow.GetEntryHeight(); }
long GetMaxEntryWidth() const { return maLBWindow.GetMaxEntryWidth(); }
@@ -489,15 +495,15 @@ public:
const Link& GetUserDrawHdl() const { return maLBWindow.GetUserDrawHdl(); }
void SetSelectionChangedHdl( const Link& rLnk ) { maLBWindow.GetEntryList()->SetSelectionChangedHdl( rLnk ); }
- void SetCallSelectionChangedHdl( BOOL bCall ) { maLBWindow.GetEntryList()->SetCallSelectionChangedHdl( bCall ); }
- BOOL IsSelectionChanged() const { return maLBWindow.IsSelectionChanged(); }
- USHORT GetSelectModifier() const { return maLBWindow.GetSelectModifier(); }
+ void SetCallSelectionChangedHdl( sal_Bool bCall ) { maLBWindow.GetEntryList()->SetCallSelectionChangedHdl( bCall ); }
+ sal_Bool IsSelectionChanged() const { return maLBWindow.IsSelectionChanged(); }
+ sal_uInt16 GetSelectModifier() const { return maLBWindow.GetSelectModifier(); }
void SetMRUEntries( const XubString& rEntries, xub_Unicode cSep );
XubString GetMRUEntries( xub_Unicode cSep ) const;
- void SetMaxMRUCount( USHORT n ) { maLBWindow.GetEntryList()->SetMaxMRUCount( n ); }
- USHORT GetMaxMRUCount() const { return maLBWindow.GetEntryList()->GetMaxMRUCount(); }
- USHORT GetDisplayLineCount() const
+ void SetMaxMRUCount( sal_uInt16 n ) { maLBWindow.GetEntryList()->SetMaxMRUCount( n ); }
+ sal_uInt16 GetMaxMRUCount() const { return maLBWindow.GetEntryList()->GetMaxMRUCount(); }
+ sal_uInt16 GetDisplayLineCount() const
{ return maLBWindow.GetDisplayLineCount(); }
// pb: #106948# explicit mirroring for calc
@@ -514,9 +520,9 @@ class ImplListBoxFloatingWindow : public FloatingWindow
private:
ImplListBox* mpImplLB;
Size maPrefSz;
- USHORT mnDDLineCount;
- USHORT mnPopupModeStartSaveSelection;
- BOOL mbAutoWidth;
+ sal_uInt16 mnDDLineCount;
+ sal_uInt16 mnPopupModeStartSaveSelection;
+ sal_Bool mbAutoWidth;
protected:
long PreNotify( NotifyEvent& rNEvt );
@@ -529,21 +535,21 @@ public:
void SetPrefSize( const Size& rSz ) { maPrefSz = rSz; }
const Size& GetPrefSize() const { return maPrefSz; }
- void SetAutoWidth( BOOL b ) { mbAutoWidth = b; }
- BOOL IsAutoWidth() const { return mbAutoWidth; }
+ void SetAutoWidth( sal_Bool b ) { mbAutoWidth = b; }
+ sal_Bool IsAutoWidth() const { return mbAutoWidth; }
Size CalcFloatSize();
- void StartFloat( BOOL bStartTracking );
+ void StartFloat( sal_Bool bStartTracking );
virtual void SetPosSizePixel( long nX, long nY,
- long nWidth, long nHeight, USHORT nFlags = WINDOW_POSSIZE_ALL );
+ long nWidth, long nHeight, sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize )
{ FloatingWindow::SetPosSizePixel( rNewPos, rNewSize ); }
- void SetDropDownLineCount( USHORT n ) { mnDDLineCount = n; }
- USHORT GetDropDownLineCount() const { return mnDDLineCount; }
+ void SetDropDownLineCount( sal_uInt16 n ) { mnDDLineCount = n; }
+ sal_uInt16 GetDropDownLineCount() const { return mnDDLineCount; }
- USHORT GetPopupModeStartSaveSelection() const { return mnPopupModeStartSaveSelection; }
+ sal_uInt16 GetPopupModeStartSaveSelection() const { return mnPopupModeStartSaveSelection; }
virtual void Resize();
};
@@ -556,7 +562,7 @@ class ImplWin : public Control
{
private:
- USHORT mnItemPos; // wegen UserDraw muss ich wissen, welches Item ich darstelle.
+ sal_uInt16 mnItemPos; // wegen UserDraw muss ich wissen, welches Item ich darstelle.
XubString maString;
Image maImage;
@@ -566,7 +572,7 @@ private:
Link maMBDownHdl;
Link maUserDrawHdl;
- BOOL mbUserDrawEnabled : 1,
+ sal_Bool mbUserDrawEnabled : 1,
mbInUserDraw : 1;
@@ -585,8 +591,8 @@ public:
virtual void LoseFocus();
virtual long PreNotify( NotifyEvent& rNEvt );
- USHORT GetItemPos() const { return mnItemPos; }
- void SetItemPos( USHORT n ) { mnItemPos = n; }
+ sal_uInt16 GetItemPos() const { return mnItemPos; }
+ void SetItemPos( sal_uInt16 n ) { mnItemPos = n; }
const XubString& GetString() const { return maString; }
void SetString( const XubString& rStr ) { maString = rStr; }
@@ -594,7 +600,7 @@ public:
const Image& GetImage() const { return maImage; }
void SetImage( const Image& rImg ) { maImage = rImg; }
- BOOL SetModeImage( const Image& rImage );
+ sal_Bool SetModeImage( const Image& rImage );
const Image& GetModeImage( ) const;
@@ -608,10 +614,10 @@ public:
void SetUserItemSize( const Size& rSz ) { maUserItemSize = rSz; }
const Size& GetUserItemSize() const { return maUserItemSize; }
- void EnableUserDraw( BOOL bUserDraw ) { mbUserDrawEnabled = bUserDraw; }
- BOOL IsUserDrawEnabled() const { return mbUserDrawEnabled; }
+ void EnableUserDraw( sal_Bool bUserDraw ) { mbUserDrawEnabled = bUserDraw; }
+ sal_Bool IsUserDrawEnabled() const { return mbUserDrawEnabled; }
- void DrawEntry( BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos = FALSE, bool bLayout = false );
+ void DrawEntry( sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos = sal_False, bool bLayout = false );
};
// -----------
@@ -621,7 +627,7 @@ public:
class ImplBtn : public PushButton
{
private:
- BOOL mbDown;
+ sal_Bool mbDown;
Link maMBDownHdl;
@@ -637,7 +643,7 @@ public:
};
-void ImplInitFieldSettings( Window* pWin, BOOL bFont, BOOL bForeground, BOOL bBackground );
+void ImplInitFieldSettings( Window* pWin, sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
void ImplInitDropDownButton( PushButton* pButton );
#endif // _SV_ILSTBOX_HXX
diff --git a/vcl/inc/vcl/image.h b/vcl/inc/vcl/image.h
index fede1f42178a..86f924993ed3 100644
--- a/vcl/inc/vcl/image.h
+++ b/vcl/inc/vcl/image.h
@@ -44,22 +44,22 @@ public:
ImplImageBmp();
~ImplImageBmp();
- void Create( long nItemWidth, long nItemHeight, USHORT nInitSize );
- void Create( const BitmapEx& rBmpEx, long nItemWidth, long nItemHeight,USHORT nInitSize );
+ void Create( long nItemWidth, long nItemHeight, sal_uInt16 nInitSize );
+ void Create( const BitmapEx& rBmpEx, long nItemWidth, long nItemHeight,sal_uInt16 nInitSize );
- void Expand( USHORT nGrowSize );
+ void Expand( sal_uInt16 nGrowSize );
- void Replace( USHORT nPos, USHORT nSrcPos );
- void Replace( USHORT nPos, const ImplImageBmp& rImageBmp, USHORT nSrcPos );
- void Replace( USHORT nPos, const BitmapEx& rBmpEx );
+ void Replace( sal_uInt16 nPos, sal_uInt16 nSrcPos );
+ void Replace( sal_uInt16 nPos, const ImplImageBmp& rImageBmp, sal_uInt16 nSrcPos );
+ void Replace( sal_uInt16 nPos, const BitmapEx& rBmpEx );
- void ReplaceColors( const Color* pSrcColors, const Color* pDstColors, ULONG nColorCount );
+ void ReplaceColors( const Color* pSrcColors, const Color* pDstColors, sal_uIntPtr nColorCount );
void ColorTransform();
void Invert();
- BitmapEx GetBitmapEx( USHORT nPosCount, USHORT* pPosAry ) const;
+ BitmapEx GetBitmapEx( sal_uInt16 nPosCount, sal_uInt16* pPosAry ) const;
- void Draw( USHORT nPos, OutputDevice* pDev, const Point& rPos, USHORT nStyle, const Size* pSize = NULL );
+ void Draw( sal_uInt16 nPos, OutputDevice* pDev, const Point& rPos, sal_uInt16 nStyle, const Size* pSize = NULL );
private:
@@ -67,8 +67,8 @@ private:
BitmapEx maDisabledBmpEx;
BitmapEx* mpDisplayBmp;
Size maSize;
- BYTE* mpInfoAry;
- USHORT mnSize;
+ sal_uInt8* mpInfoAry;
+ sal_uInt16 mnSize;
void ImplUpdateDisplayBmp( OutputDevice* pOutDev );
void ImplUpdateDisabledBmpEx( int nPos );
@@ -92,12 +92,12 @@ struct ImageAryData
{
::rtl::OUString maName;
// Images identified by either name, or by id
- USHORT mnId;
+ sal_uInt16 mnId;
BitmapEx maBitmapEx;
ImageAryData();
ImageAryData( const rtl::OUString &aName,
- USHORT nId, const BitmapEx &aBitmap );
+ sal_uInt16 nId, const BitmapEx &aBitmap );
ImageAryData( const ImageAryData& rData );
~ImageAryData();
@@ -119,16 +119,16 @@ struct ImplImageList
ImageAryDataNameHash maNameHash;
rtl::OUString maPrefix;
Size maImageSize;
- ULONG mnRefCount;
+ sal_uIntPtr mnRefCount;
ImplImageList();
ImplImageList( const ImplImageList &aSrc );
~ImplImageList();
void AddImage( const ::rtl::OUString &aName,
- USHORT nId, const BitmapEx &aBitmapEx );
- void RemoveImage( USHORT nPos );
- USHORT GetImageCount() const;
+ sal_uInt16 nId, const BitmapEx &aBitmapEx );
+ void RemoveImage( sal_uInt16 nPos );
+ sal_uInt16 GetImageCount() const;
};
// --------------------
@@ -138,12 +138,12 @@ struct ImplImageList
struct ImplImageRefData
{
ImplImageList* mpImplData;
- USHORT mnIndex;
+ sal_uInt16 mnIndex;
ImplImageRefData() {} // Um Warning zu umgehen
~ImplImageRefData();
- BOOL IsEqual( const ImplImageRefData& rData );
+ sal_Bool IsEqual( const ImplImageRefData& rData );
};
// ----------------
@@ -158,7 +158,7 @@ struct ImplImageData
ImplImageData( const BitmapEx& rBmpEx );
~ImplImageData();
- BOOL IsEqual( const ImplImageData& rData );
+ sal_Bool IsEqual( const ImplImageData& rData );
};
// -------------
@@ -167,7 +167,7 @@ struct ImplImageData
struct ImplImage
{
- ULONG mnRefCount;
+ sal_uIntPtr mnRefCount;
// TODO: use inheritance to get rid of meType+mpData
void* mpData;
ImageType meType;
diff --git a/vcl/inc/vcl/image.hxx b/vcl/inc/vcl/image.hxx
index c0c7cf63be51..d536d6bd03d7 100644
--- a/vcl/inc/vcl/image.hxx
+++ b/vcl/inc/vcl/image.hxx
@@ -47,7 +47,7 @@ namespace com { namespace sun { namespace star { namespace graphic { class XGrap
// -----------
#define IMAGE_STDBTN_COLOR Color( 0xC0, 0xC0, 0xC0 )
-#define IMAGELIST_IMAGE_NOTFOUND ((USHORT)0xFFFF)
+#define IMAGELIST_IMAGE_NOTFOUND ((sal_uInt16)0xFFFF)
// -----------------------
// - ImageColorTransform -
@@ -87,14 +87,14 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > GetXGraphic() const;
Image GetColorTransformedImage( ImageColorTransform eColorTransform ) const;
- static void GetColorTransformArrays( ImageColorTransform eColorTransform, Color*& rpSrcColor, Color*& rpDstColor, ULONG& rColorCount );
+ static void GetColorTransformArrays( ImageColorTransform eColorTransform, Color*& rpSrcColor, Color*& rpDstColor, sal_uLong& rColorCount );
void Invert();
- BOOL operator!() const { return( !mpImplData ? true : false ); }
+ sal_Bool operator!() const { return( !mpImplData ? true : false ); }
Image& operator=( const Image& rImage );
- BOOL operator==( const Image& rImage ) const;
- BOOL operator!=( const Image& rImage ) const { return !(Image::operator==( rImage )); }
+ sal_Bool operator==( const Image& rImage ) const;
+ sal_Bool operator!=( const Image& rImage ) const { return !(Image::operator==( rImage )); }
private:
@@ -110,7 +110,7 @@ private:
class VCL_DLLPUBLIC ImageList
{
public:
- ImageList( USHORT nInit = 8, USHORT nGrow = 4 );
+ ImageList( sal_uInt16 nInit = 8, sal_uInt16 nGrow = 4 );
ImageList( const ResId& rResId );
ImageList( const ::std::vector< ::rtl::OUString >& rNameVector,
const ::rtl::OUString& rPrefix,
@@ -122,57 +122,57 @@ public:
void InsertFromHorizontalStrip( const BitmapEx &rBitmapEx,
const std::vector< rtl::OUString > &rNameVector );
void InsertFromHorizontalBitmap( const ResId& rResId,
- USHORT nCount,
+ sal_uInt16 nCount,
const Color *pNonAlphaMaskColor,
const Color *pSearchColors = NULL,
const Color *pReplaceColors = NULL,
- ULONG nColorCount = 0);
+ sal_uLong nColorCount = 0);
BitmapEx GetAsHorizontalStrip() const;
- USHORT GetImageCount() const;
+ sal_uInt16 GetImageCount() const;
Size GetImageSize() const;
- void AddImage( USHORT nNewId, const Image& rImage );
+ void AddImage( sal_uInt16 nNewId, const Image& rImage );
void AddImage( const ::rtl::OUString& rImageName, const Image& rImage );
- void ReplaceImage( USHORT nId, const Image& rImage );
+ void ReplaceImage( sal_uInt16 nId, const Image& rImage );
void ReplaceImage( const ::rtl::OUString& rImageName, const Image& rImage );
- void ReplaceImage( USHORT nId, USHORT nReplaceId );
+ void ReplaceImage( sal_uInt16 nId, sal_uInt16 nReplaceId );
void ReplaceImage( const ::rtl::OUString& rImageName, const ::rtl::OUString& rReplaceName );
- void RemoveImage( USHORT nId );
+ void RemoveImage( sal_uInt16 nId );
void RemoveImage( const ::rtl::OUString& rImageName );
- Image GetImage( USHORT nId ) const;
+ Image GetImage( sal_uInt16 nId ) const;
Image GetImage( const ::rtl::OUString& rImageName ) const;
- USHORT GetImagePos( USHORT nId ) const;
- bool HasImageAtPos( USHORT nId ) const;
- USHORT GetImagePos( const ::rtl::OUString& rImageName ) const;
+ sal_uInt16 GetImagePos( sal_uInt16 nId ) const;
+ bool HasImageAtPos( sal_uInt16 nId ) const;
+ sal_uInt16 GetImagePos( const ::rtl::OUString& rImageName ) const;
- USHORT GetImageId( USHORT nPos ) const;
- void GetImageIds( ::std::vector< USHORT >& rIds ) const;
+ sal_uInt16 GetImageId( sal_uInt16 nPos ) const;
+ void GetImageIds( ::std::vector< sal_uInt16 >& rIds ) const;
- ::rtl::OUString GetImageName( USHORT nPos ) const;
+ ::rtl::OUString GetImageName( sal_uInt16 nPos ) const;
void GetImageNames( ::std::vector< ::rtl::OUString >& rNames ) const;
ImageList& operator=( const ImageList& rImageList );
- BOOL operator==( const ImageList& rImageList ) const;
- BOOL operator!=( const ImageList& rImageList ) const { return !(ImageList::operator==( rImageList )); }
+ sal_Bool operator==( const ImageList& rImageList ) const;
+ sal_Bool operator!=( const ImageList& rImageList ) const { return !(ImageList::operator==( rImageList )); }
private:
ImplImageList* mpImplData;
- USHORT mnInitSize;
- USHORT mnGrowSize;
+ sal_uInt16 mnInitSize;
+ sal_uInt16 mnGrowSize;
SAL_DLLPRIVATE void ImplInitBitmapEx( const ::rtl::OUString& rUserImageName,
const ::std::vector< ::rtl::OUString >& rImageNames,
const ::rtl::OUString& rSymbolsStyle,
BitmapEx& rBmpEx,
const Color* pMaskColor ) const;
- SAL_DLLPRIVATE void ImplInit( USHORT nItems, const Size &rSize );
- SAL_DLLPRIVATE USHORT ImplGetImageId( const ::rtl::OUString& rImageName ) const;
+ SAL_DLLPRIVATE void ImplInit( sal_uInt16 nItems, const Size &rSize );
+ SAL_DLLPRIVATE sal_uInt16 ImplGetImageId( const ::rtl::OUString& rImageName ) const;
SAL_DLLPRIVATE void ImplMakeUnique();
};
diff --git a/vcl/inc/vcl/imgctrl.hxx b/vcl/inc/vcl/imgctrl.hxx
index 5867a6ff16d0..ec8ed99c93bb 100644
--- a/vcl/inc/vcl/imgctrl.hxx
+++ b/vcl/inc/vcl/imgctrl.hxx
@@ -41,26 +41,26 @@
class VCL_DLLPUBLIC ImageControl : public FixedImage
{
private:
- BitmapEx maBmp;
::sal_Int16 mnScaleMode;
public:
ImageControl( Window* pParent, WinBits nStyle = 0 );
+ ImageControl( Window* pParent, const ResId& rResId );
// set/get the scale mode. This is one of the css.awt.ImageScaleMode constants
void SetScaleMode( const ::sal_Int16 _nMode );
::sal_Int16 GetScaleMode() const { return mnScaleMode; }
virtual void Resize();
- virtual void UserDraw( const UserDrawEvent& rUDEvt );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Paint( const Rectangle& rRect );
virtual void GetFocus();
virtual void LoseFocus();
- void SetBitmap( const BitmapEx& rBmp );
- using OutputDevice::GetBitmap;
- const BitmapEx& GetBitmap() const { return maBmp; }
- BOOL SetModeBitmap( const BitmapEx& rBitmap );
+protected:
+ void ImplDraw( OutputDevice& rDev, sal_uLong nDrawFlags, const Point& rPos, const Size& rSize ) const;
+private:
+ sal_Bool SetModeBitmap( const BitmapEx& rBitmap );
const BitmapEx& GetModeBitmap( ) const;
};
diff --git a/vcl/inc/vcl/impbmp.hxx b/vcl/inc/vcl/impbmp.hxx
index 1292cce59ef5..c77e906bd8ae 100644
--- a/vcl/inc/vcl/impbmp.hxx
+++ b/vcl/inc/vcl/impbmp.hxx
@@ -50,8 +50,8 @@ class ImpBitmap
{
private:
- ULONG mnRefCount;
- ULONG mnChecksum;
+ sal_uLong mnRefCount;
+ sal_uLong mnChecksum;
SalBitmap* mpSalBitmap;
Size maSourceSize;
@@ -69,29 +69,29 @@ public:
public:
- BOOL ImplCreate( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal );
- BOOL ImplCreate( const ImpBitmap& rImpBitmap );
- BOOL ImplCreate( const ImpBitmap& rImpBitmap, SalGraphics* pGraphics );
- BOOL ImplCreate( const ImpBitmap& rImpBitmap, USHORT nNewBitCount );
+ sal_Bool ImplCreate( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal );
+ sal_Bool ImplCreate( const ImpBitmap& rImpBitmap );
+ sal_Bool ImplCreate( const ImpBitmap& rImpBitmap, SalGraphics* pGraphics );
+ sal_Bool ImplCreate( const ImpBitmap& rImpBitmap, sal_uInt16 nNewBitCount );
void ImplDestroy();
Size ImplGetSize() const;
Size ImplGetSourceSize() const;
void ImplSetSourceSize( const Size&);
- USHORT ImplGetBitCount() const;
+ sal_uInt16 ImplGetBitCount() const;
- BitmapBuffer* ImplAcquireBuffer( BOOL bReadOnly );
- void ImplReleaseBuffer( BitmapBuffer* pBuffer, BOOL bReadOnly );
+ BitmapBuffer* ImplAcquireBuffer( sal_Bool bReadOnly );
+ void ImplReleaseBuffer( BitmapBuffer* pBuffer, sal_Bool bReadOnly );
public:
- ULONG ImplGetRefCount() const { return mnRefCount; }
+ sal_uLong ImplGetRefCount() const { return mnRefCount; }
void ImplIncRefCount() { mnRefCount++; }
void ImplDecRefCount() { mnRefCount--; }
- inline void ImplSetChecksum( ULONG nChecksum ) { mnChecksum = nChecksum; }
- inline ULONG ImplGetChecksum() const { return mnChecksum; }
+ inline void ImplSetChecksum( sal_uLong nChecksum ) { mnChecksum = nChecksum; }
+ inline sal_uLong ImplGetChecksum() const { return mnChecksum; }
#endif // PRIVATE
};
diff --git a/vcl/inc/vcl/impfont.hxx b/vcl/inc/vcl/impfont.hxx
index cc2807d3e420..630297e1d2f8 100644
--- a/vcl/inc/vcl/impfont.hxx
+++ b/vcl/inc/vcl/impfont.hxx
@@ -82,7 +82,7 @@ private:
FontType meType; // used by metrics only
short mnOrientation;
FontKerning mnKerning;
- BOOL mbWordLine:1,
+ sal_Bool mbWordLine:1,
mbOutline:1,
mbConfigLookup:1, // there was a config lookup
mbShadow:1,
@@ -108,8 +108,8 @@ private:
long mnExtLeading; // External Leading
long mnLineHeight; // Ascent+Descent+EmphasisMark
long mnSlant; // Slant
- USHORT mnMiscFlags; // Misc Flags
- UINT32 mnRefCount; // Reference Counter
+ sal_uInt16 mnMiscFlags; // Misc Flags
+ sal_uInt32 mnRefCount; // Reference Counter
enum { DEVICE_FLAG=1, SCALABLE_FLAG=2, LATIN_FLAG=4, CJK_FLAG=8, CTL_FLAG=16 };
@@ -176,7 +176,7 @@ public:
class CmapResult;
-class VCL_DLLPUBLIC ImplFontCharMap
+class VCL_PLUGIN_PUBLIC ImplFontCharMap
{
public:
explicit ImplFontCharMap( const CmapResult& );
@@ -198,8 +198,8 @@ public:
int GetIndexFromChar( sal_uInt32 ) const;
sal_uInt32 GetCharFromIndex( int ) const;
- void AddReference();
- void DeReference();
+ void AddReference() const;
+ void DeReference() const;
int GetGlyphIndex( sal_uInt32 ) const;
@@ -213,27 +213,23 @@ private:
private:
const sal_uInt32* mpRangeCodes; // pairs of StartCode/(EndCode+1)
const int* mpStartGlyphs; // range-specific mapper to glyphs
- const USHORT* mpGlyphIds; // individual glyphid mappings
+ const sal_uInt16* mpGlyphIds; // individual glyphid mappings
int mnRangeCount;
- int mnCharCount;
- int mnRefCount;
+ int mnCharCount; // covered codepoints
+ mutable int mnRefCount;
};
// CmapResult is a normalized version of the many CMAP formats
-class
-#ifdef UNX
- VCL_DLLPUBLIC // vcl-plugins need it
-#endif // UNX
-CmapResult
+class VCL_PLUGIN_PUBLIC CmapResult
{
public:
explicit CmapResult( bool bSymbolic = false,
const sal_uInt32* pRangeCodes = NULL, int nRangeCount = 0,
- const int* pStartGlyphs = 0, const USHORT* pGlyphIds = NULL );
+ const int* pStartGlyphs = 0, const sal_uInt16* pGlyphIds = NULL );
const sal_uInt32* mpRangeCodes;
const int* mpStartGlyphs;
- const USHORT* mpGlyphIds;
+ const sal_uInt16* mpGlyphIds;
int mnRangeCount;
bool mbSymbolic;
bool mbRecoded;
diff --git a/vcl/inc/vcl/impgraph.hxx b/vcl/inc/vcl/impgraph.hxx
index dfb47a153f2d..22c409fb476a 100644
--- a/vcl/inc/vcl/impgraph.hxx
+++ b/vcl/inc/vcl/impgraph.hxx
@@ -70,11 +70,11 @@ private:
GfxLink* mpGfxLink;
GraphicType meType;
String maDocFileURLStr;
- ULONG mnDocFilePos;
- mutable ULONG mnSizeBytes;
- ULONG mnRefCount;
- BOOL mbSwapOut;
- BOOL mbSwapUnderway;
+ sal_uLong mnDocFilePos;
+ mutable sal_uLong mnSizeBytes;
+ sal_uLong mnRefCount;
+ sal_Bool mbSwapOut;
+ sal_Bool mbSwapUnderway;
private:
@@ -87,19 +87,19 @@ private:
virtual ~ImpGraphic();
ImpGraphic& operator=( const ImpGraphic& rImpGraphic );
- BOOL operator==( const ImpGraphic& rImpGraphic ) const;
- BOOL operator!=( const ImpGraphic& rImpGraphic ) const { return !( *this == rImpGraphic ); }
+ sal_Bool operator==( const ImpGraphic& rImpGraphic ) const;
+ sal_Bool operator!=( const ImpGraphic& rImpGraphic ) const { return !( *this == rImpGraphic ); }
- void ImplClearGraphics( BOOL bCreateSwapInfo );
+ void ImplClearGraphics( sal_Bool bCreateSwapInfo );
void ImplClear();
GraphicType ImplGetType() const;
void ImplSetDefaultType();
- BOOL ImplIsSupportedGraphic() const;
+ sal_Bool ImplIsSupportedGraphic() const;
- BOOL ImplIsTransparent() const;
- BOOL ImplIsAlpha() const;
- BOOL ImplIsAnimated() const;
+ sal_Bool ImplIsTransparent() const;
+ sal_Bool ImplIsAlpha() const;
+ sal_Bool ImplIsAnimated() const;
Bitmap ImplGetBitmap(const GraphicConversionParameters& rParameters) const;
BitmapEx ImplGetBitmapEx(const GraphicConversionParameters& rParameters) const;
@@ -112,7 +112,7 @@ private:
MapMode ImplGetPrefMapMode() const;
void ImplSetPrefMapMode( const MapMode& rPrefMapMode );
- ULONG ImplGetSizeBytes() const;
+ sal_uLong ImplGetSizeBytes() const;
void ImplDraw( OutputDevice* pOutDev,
const Point& rDestPt ) const;
@@ -135,7 +135,7 @@ private:
void ImplSetAnimationNotifyHdl( const Link& rLink );
Link ImplGetAnimationNotifyHdl() const;
- ULONG ImplGetAnimationLoopCount() const;
+ sal_uLong ImplGetAnimationLoopCount() const;
void ImplResetAnimationLoopCount();
List* ImplGetAnimationInfoList() const;
@@ -147,28 +147,28 @@ private:
private:
- void ImplSetDocFileName( const String& rName, ULONG nFilePos );
+ void ImplSetDocFileName( const String& rName, sal_uLong nFilePos );
const String& ImplGetDocFileName() const;
- ULONG ImplGetDocFilePos() const;
+ sal_uLong ImplGetDocFilePos() const;
- BOOL ImplReadEmbedded( SvStream& rIStream, BOOL bSwap = FALSE );
- BOOL ImplWriteEmbedded( SvStream& rOStream );
+ sal_Bool ImplReadEmbedded( SvStream& rIStream, sal_Bool bSwap = sal_False );
+ sal_Bool ImplWriteEmbedded( SvStream& rOStream );
- BOOL ImplSwapIn();
- BOOL ImplSwapIn( SvStream* pIStm );
+ sal_Bool ImplSwapIn();
+ sal_Bool ImplSwapIn( SvStream* pIStm );
- BOOL ImplSwapOut();
- BOOL ImplSwapOut( SvStream* pOStm );
+ sal_Bool ImplSwapOut();
+ sal_Bool ImplSwapOut( SvStream* pOStm );
- BOOL ImplIsSwapOut() const;
+ sal_Bool ImplIsSwapOut() const;
void ImplSetLink( const GfxLink& );
GfxLink ImplGetLink();
- BOOL ImplIsLink() const;
+ sal_Bool ImplIsLink() const;
- ULONG ImplGetChecksum() const;
+ sal_uLong ImplGetChecksum() const;
- BOOL ImplExportNative( SvStream& rOStm ) const;
+ sal_Bool ImplExportNative( SvStream& rOStm ) const;
friend SvStream& operator<<( SvStream& rOStm, const ImpGraphic& rImpGraphic );
friend SvStream& operator>>( SvStream& rIStm, ImpGraphic& rImpGraphic );
diff --git a/vcl/inc/vcl/impoct.hxx b/vcl/inc/vcl/impoct.hxx
index 1679b4802c63..daf6a275ada1 100644
--- a/vcl/inc/vcl/impoct.hxx
+++ b/vcl/inc/vcl/impoct.hxx
@@ -121,9 +121,9 @@ inline void ImpErrorQuad::ImplAddColorError7( const ImpErrorQuad& rErrQuad )
inline BitmapColor ImpErrorQuad::ImplGetColor()
{
- return BitmapColor( (BYTE) ( ( nRed < 0L ? 0L : nRed > 8160L ? 8160L : nRed ) >> 5L ),
- (BYTE) ( ( nGreen < 0L ? 0L : nGreen > 8160L ? 8160L : nGreen ) >> 5L ),
- (BYTE) ( ( nBlue < 0L ? 0L : nBlue > 8160L ? 8160L : nBlue ) >> 5L ) );
+ return BitmapColor( (sal_uInt8) ( ( nRed < 0L ? 0L : nRed > 8160L ? 8160L : nRed ) >> 5L ),
+ (sal_uInt8) ( ( nGreen < 0L ? 0L : nGreen > 8160L ? 8160L : nGreen ) >> 5L ),
+ (sal_uInt8) ( ( nBlue < 0L ? 0L : nBlue > 8160L ? 8160L : nBlue ) >> 5L ) );
}
// -------------
@@ -133,14 +133,14 @@ inline BitmapColor ImpErrorQuad::ImplGetColor()
class ImpNodeCache
{
OctreeNode* pActNode;
- ULONG nNew;
- ULONG nDelete;
- ULONG nGet;
- ULONG nRelease;
+ sal_uLong nNew;
+ sal_uLong nDelete;
+ sal_uLong nGet;
+ sal_uLong nRelease;
public:
- ImpNodeCache( const ULONG nInitSize );
+ ImpNodeCache( const sal_uLong nInitSize );
~ImpNodeCache();
inline OctreeNode* ImplGetFreeNode();
diff --git a/vcl/inc/vcl/inputctx.hxx b/vcl/inc/vcl/inputctx.hxx
index 26a43530c8d0..eaaec5e7bd1d 100644
--- a/vcl/inc/vcl/inputctx.hxx
+++ b/vcl/inc/vcl/inputctx.hxx
@@ -37,10 +37,10 @@
// - InputContext-Flags -
// ----------------------
-#define INPUTCONTEXT_TEXT ((ULONG)0x00000001)
-#define INPUTCONTEXT_EXTTEXTINPUT ((ULONG)0x00000002)
-#define INPUTCONTEXT_EXTTEXTINPUT_ON ((ULONG)0x00000004)
-#define INPUTCONTEXT_EXTTEXTINPUT_OFF ((ULONG)0x00000008)
+#define INPUTCONTEXT_TEXT ((sal_uLong)0x00000001)
+#define INPUTCONTEXT_EXTTEXTINPUT ((sal_uLong)0x00000002)
+#define INPUTCONTEXT_EXTTEXTINPUT_ON ((sal_uLong)0x00000004)
+#define INPUTCONTEXT_EXTTEXTINPUT_OFF ((sal_uLong)0x00000008)
// ----------------
// - InputContext -
@@ -50,26 +50,26 @@ class VCL_DLLPUBLIC InputContext
{
private:
Font maFont;
- ULONG mnOptions;
+ sal_uLong mnOptions;
public:
InputContext() { mnOptions = 0; }
InputContext( const InputContext& rInputContext ) :
maFont( rInputContext.maFont )
{ mnOptions = rInputContext.mnOptions; }
- InputContext( const Font& rFont, ULONG nOptions = 0 ) :
+ InputContext( const Font& rFont, sal_uLong nOptions = 0 ) :
maFont( rFont )
{ mnOptions = nOptions; }
void SetFont( const Font& rFont ) { maFont = rFont; }
const Font& GetFont() const { return maFont; }
- void SetOptions( ULONG nOptions ) { mnOptions = nOptions; }
- ULONG GetOptions() const { return mnOptions; }
+ void SetOptions( sal_uLong nOptions ) { mnOptions = nOptions; }
+ sal_uLong GetOptions() const { return mnOptions; }
InputContext& operator=( const InputContext& rInputContext );
- BOOL operator==( const InputContext& rInputContext ) const;
- BOOL operator!=( const InputContext& rInputContext ) const
+ sal_Bool operator==( const InputContext& rInputContext ) const;
+ sal_Bool operator!=( const InputContext& rInputContext ) const
{ return !(InputContext::operator==( rInputContext )); }
};
@@ -80,7 +80,7 @@ inline InputContext& InputContext::operator=( const InputContext& rInputContext
return *this;
}
-inline BOOL InputContext::operator==( const InputContext& rInputContext ) const
+inline sal_Bool InputContext::operator==( const InputContext& rInputContext ) const
{
return ((mnOptions == rInputContext.mnOptions) &&
(maFont == rInputContext.maFont));
diff --git a/vcl/inc/vcl/javachild.hxx b/vcl/inc/vcl/javachild.hxx
index 5765adfd26f1..a7b39d0bff8f 100644
--- a/vcl/inc/vcl/javachild.hxx
+++ b/vcl/inc/vcl/javachild.hxx
@@ -48,8 +48,6 @@ public:
private:
- SAL_DLLPRIVATE void implTestJavaException( void* pEnv );
-
// Copy assignment is forbidden and not implemented.
SAL_DLLPRIVATE JavaChildWindow (const JavaChildWindow &);
SAL_DLLPRIVATE JavaChildWindow & operator= (const JavaChildWindow &);
diff --git a/vcl/inc/vcl/jobdata.hxx b/vcl/inc/vcl/jobdata.hxx
index b51282d57b1e..7517b41ef03c 100644
--- a/vcl/inc/vcl/jobdata.hxx
+++ b/vcl/inc/vcl/jobdata.hxx
@@ -51,6 +51,7 @@ struct JobData
int m_nColorDepth;
int m_nPSLevel; // 0: no override, else languaglevel to use
int m_nColorDevice; // 0: no override, -1 grey scale, +1 color
+ int m_nPDFDevice; // 0: PostScript, 1: PDF
orientation::type m_eOrientation;
::rtl::OUString m_aPrinterName;
const PPDParser* m_pParser;
@@ -65,6 +66,7 @@ struct JobData
m_nColorDepth( 24 ),
m_nPSLevel( 0 ),
m_nColorDevice( 0 ),
+ m_nPDFDevice( 0 ),
m_eOrientation( orientation::Portrait ),
m_pParser( NULL ) {}
@@ -73,6 +75,8 @@ struct JobData
JobData( const JobData& rData ) { *this = rData; }
void setCollate( bool bCollate );
+ bool setPaper( int nWidth, int nHeight ); // dimensions in pt
+ bool setPaperBin( int nPaperBin ); // dimensions in pt
// creates a new buffer using new
// it is up to the user to delete it again
diff --git a/vcl/inc/vcl/jobset.h b/vcl/inc/vcl/jobset.h
index 9b26c20dcd94..b1cbdb9853f9 100644
--- a/vcl/inc/vcl/jobset.h
+++ b/vcl/inc/vcl/jobset.h
@@ -53,18 +53,18 @@
struct ImplJobSetup
{
- USHORT mnRefCount; // RefCount (only independ data)
- USHORT mnSystem; // Sytem - JOBSETUP_SYSTEM_xxxx
+ sal_uInt16 mnRefCount; // RefCount (only independ data)
+ sal_uInt16 mnSystem; // Sytem - JOBSETUP_SYSTEM_xxxx
String maPrinterName; // Printer-Name
String maDriver; // Driver-Name
Orientation meOrientation; // Orientation
DuplexMode meDuplexMode; // Duplex
- USHORT mnPaperBin; // paper bin / in tray
+ sal_uInt16 mnPaperBin; // paper bin / in tray
Paper mePaperFormat; // paper format
long mnPaperWidth; // paper width (100th mm)
long mnPaperHeight; // paper height (100th mm)
- ULONG mnDriverDataLen; // length of system specific data
- BYTE* mpDriverData; // system specific data (will be streamed a byte block)
+ sal_uIntPtr mnDriverDataLen; // length of system specific data
+ sal_uInt8* mpDriverData; // system specific data (will be streamed a byte block)
::boost::unordered_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash > maValueMap;
ImplJobSetup();
diff --git a/vcl/inc/vcl/jobset.hxx b/vcl/inc/vcl/jobset.hxx
index a5a3735c3da5..0340f5dd8587 100644
--- a/vcl/inc/vcl/jobset.hxx
+++ b/vcl/inc/vcl/jobset.hxx
@@ -71,8 +71,8 @@ public:
JobSetup& operator=( const JobSetup& rJob );
- BOOL operator==( const JobSetup& rJobSetup ) const;
- BOOL operator!=( const JobSetup& rJobSetup ) const
+ sal_Bool operator==( const JobSetup& rJobSetup ) const;
+ sal_Bool operator!=( const JobSetup& rJobSetup ) const
{ return !(JobSetup::operator==( rJobSetup )); }
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup );
diff --git a/vcl/inc/vcl/keycod.hxx b/vcl/inc/vcl/keycod.hxx
index 8092f2a6d964..b5be547b1781 100644
--- a/vcl/inc/vcl/keycod.hxx
+++ b/vcl/inc/vcl/keycod.hxx
@@ -63,54 +63,54 @@ enum KeyFuncType { KEYFUNC_DONTKNOW, KEYFUNC_NEW, KEYFUNC_OPEN,
class VCL_DLLPUBLIC KeyCode
{
private:
- USHORT nCode;
+ sal_uInt16 nCode;
KeyFuncType eFunc;
public:
KeyCode() { nCode = 0; eFunc = KEYFUNC_DONTKNOW; }
KeyCode( const ResId& rResId );
- KeyCode( USHORT nKey, USHORT nModifier = 0 )
+ KeyCode( sal_uInt16 nKey, sal_uInt16 nModifier = 0 )
{ nCode = nKey | nModifier; eFunc = KEYFUNC_DONTKNOW; }
- KeyCode( USHORT nKey, BOOL bShift, BOOL bMod1, BOOL bMod2, BOOL bMod3 );
+ KeyCode( sal_uInt16 nKey, sal_Bool bShift, sal_Bool bMod1, sal_Bool bMod2, sal_Bool bMod3 );
KeyCode( KeyFuncType eFunction );
- USHORT GetFullCode() const { return nCode; }
- USHORT GetFullKeyCode() const { return (nCode) ; }
+ sal_uInt16 GetFullCode() const { return nCode; }
+ sal_uInt16 GetFullKeyCode() const { return (nCode) ; }
KeyFuncType GetFullFunction() const { return eFunc; }
- BOOL IsDefinedKeyCodeEqual( const KeyCode& rKeyCode ) const;
+ sal_Bool IsDefinedKeyCodeEqual( const KeyCode& rKeyCode ) const;
- USHORT GetCode() const
+ sal_uInt16 GetCode() const
{ return (nCode & KEY_CODE); }
- USHORT GetModifier() const
+ sal_uInt16 GetModifier() const
{ return (nCode & KEY_MODTYPE); }
- USHORT GetAllModifier() const
+ sal_uInt16 GetAllModifier() const
{ return (nCode & KEY_ALLMODTYPE); }
- BOOL IsShift() const
+ sal_Bool IsShift() const
{ return ((nCode & KEY_SHIFT) != 0); }
- BOOL IsMod1() const
+ sal_Bool IsMod1() const
{ return ((nCode & KEY_MOD1) != 0); }
- BOOL IsMod2() const
+ sal_Bool IsMod2() const
{ return ((nCode & KEY_MOD2) != 0); }
- BOOL IsMod3() const
+ sal_Bool IsMod3() const
{ return ((nCode & KEY_MOD3) != 0); }
- USHORT GetGroup() const
+ sal_uInt16 GetGroup() const
{ return (nCode & KEYGROUP_TYPE); }
XubString GetName( Window* pWindow = NULL ) const;
XubString GetSymbolName( const XubString& rFontName, Window* pWindow = NULL ) const;
- BOOL IsFunction() const
- { return ((eFunc != KEYFUNC_DONTKNOW) ? TRUE : FALSE); }
+ sal_Bool IsFunction() const
+ { return ((eFunc != KEYFUNC_DONTKNOW) ? sal_True : sal_False); }
KeyFuncType GetFunction() const;
KeyCode& operator = ( const KeyCode& rKeyCode );
- BOOL operator ==( const KeyCode& rKeyCode ) const;
- BOOL operator !=( const KeyCode& rKeyCode ) const;
+ sal_Bool operator ==( const KeyCode& rKeyCode ) const;
+ sal_Bool operator !=( const KeyCode& rKeyCode ) const;
};
-inline KeyCode::KeyCode( USHORT nKey, BOOL bShift, BOOL bMod1, BOOL bMod2, BOOL bMod3 )
+inline KeyCode::KeyCode( sal_uInt16 nKey, sal_Bool bShift, sal_Bool bMod1, sal_Bool bMod2, sal_Bool bMod3 )
{
nCode = nKey;
if( bShift )
@@ -124,7 +124,7 @@ inline KeyCode::KeyCode( USHORT nKey, BOOL bShift, BOOL bMod1, BOOL bMod2, BOOL
eFunc = KEYFUNC_DONTKNOW;
}
-inline BOOL KeyCode::operator ==( const KeyCode& rKeyCode ) const
+inline sal_Bool KeyCode::operator ==( const KeyCode& rKeyCode ) const
{
if ( (eFunc == KEYFUNC_DONTKNOW) && (rKeyCode.eFunc == KEYFUNC_DONTKNOW) )
return (nCode == rKeyCode.nCode);
@@ -132,7 +132,7 @@ inline BOOL KeyCode::operator ==( const KeyCode& rKeyCode ) const
return (GetFunction() == rKeyCode.GetFunction());
}
-inline BOOL KeyCode::operator !=( const KeyCode& rKeyCode ) const
+inline sal_Bool KeyCode::operator !=( const KeyCode& rKeyCode ) const
{
if ( (eFunc == KEYFUNC_DONTKNOW) && (rKeyCode.eFunc == KEYFUNC_DONTKNOW) )
return (nCode != rKeyCode.nCode);
@@ -140,7 +140,7 @@ inline BOOL KeyCode::operator !=( const KeyCode& rKeyCode ) const
return (GetFunction() != rKeyCode.GetFunction());
}
-inline BOOL KeyCode::IsDefinedKeyCodeEqual( const KeyCode& rKeyCode ) const
+inline sal_Bool KeyCode::IsDefinedKeyCodeEqual( const KeyCode& rKeyCode ) const
{
if ( (eFunc == KEYFUNC_DONTKNOW) && (rKeyCode.eFunc == KEYFUNC_DONTKNOW) )
return (GetFullKeyCode() == rKeyCode.GetFullKeyCode());
diff --git a/vcl/inc/vcl/keycodes.hxx b/vcl/inc/vcl/keycodes.hxx
index ace5df3343b4..9b4fc0893b34 100644
--- a/vcl/inc/vcl/keycodes.hxx
+++ b/vcl/inc/vcl/keycodes.hxx
@@ -40,139 +40,139 @@
// By changes you must also change: rsc/vclrsc.hxx
// Key-Gruppen
-#define KEYGROUP_NUM ((USHORT)::com::sun::star::awt::KeyGroup::NUM)
-#define KEYGROUP_ALPHA ((USHORT)::com::sun::star::awt::KeyGroup::ALPHA)
-#define KEYGROUP_FKEYS ((USHORT)::com::sun::star::awt::KeyGroup::FKEYS)
-#define KEYGROUP_CURSOR ((USHORT)::com::sun::star::awt::KeyGroup::CURSOR)
-#define KEYGROUP_MISC ((USHORT)::com::sun::star::awt::KeyGroup::MISC)
-#define KEYGROUP_TYPE ((USHORT)::com::sun::star::awt::KeyGroup::TYPE)
+#define KEYGROUP_NUM ((sal_uInt16)::com::sun::star::awt::KeyGroup::NUM)
+#define KEYGROUP_ALPHA ((sal_uInt16)::com::sun::star::awt::KeyGroup::ALPHA)
+#define KEYGROUP_FKEYS ((sal_uInt16)::com::sun::star::awt::KeyGroup::FKEYS)
+#define KEYGROUP_CURSOR ((sal_uInt16)::com::sun::star::awt::KeyGroup::CURSOR)
+#define KEYGROUP_MISC ((sal_uInt16)::com::sun::star::awt::KeyGroup::MISC)
+#define KEYGROUP_TYPE ((sal_uInt16)::com::sun::star::awt::KeyGroup::TYPE)
// Key-Codes
-#define KEY_0 ((USHORT)::com::sun::star::awt::Key::NUM0)
-#define KEY_1 ((USHORT)::com::sun::star::awt::Key::NUM1)
-#define KEY_2 ((USHORT)::com::sun::star::awt::Key::NUM2)
-#define KEY_3 ((USHORT)::com::sun::star::awt::Key::NUM3)
-#define KEY_4 ((USHORT)::com::sun::star::awt::Key::NUM4)
-#define KEY_5 ((USHORT)::com::sun::star::awt::Key::NUM5)
-#define KEY_6 ((USHORT)::com::sun::star::awt::Key::NUM6)
-#define KEY_7 ((USHORT)::com::sun::star::awt::Key::NUM7)
-#define KEY_8 ((USHORT)::com::sun::star::awt::Key::NUM8)
-#define KEY_9 ((USHORT)::com::sun::star::awt::Key::NUM9)
-
-#define KEY_A ((USHORT)::com::sun::star::awt::Key::A)
-#define KEY_B ((USHORT)::com::sun::star::awt::Key::B)
-#define KEY_C ((USHORT)::com::sun::star::awt::Key::C)
-#define KEY_D ((USHORT)::com::sun::star::awt::Key::D)
-#define KEY_E ((USHORT)::com::sun::star::awt::Key::E)
-#define KEY_F ((USHORT)::com::sun::star::awt::Key::F)
-#define KEY_G ((USHORT)::com::sun::star::awt::Key::G)
-#define KEY_H ((USHORT)::com::sun::star::awt::Key::H)
-#define KEY_I ((USHORT)::com::sun::star::awt::Key::I)
-#define KEY_J ((USHORT)::com::sun::star::awt::Key::J)
-#define KEY_K ((USHORT)::com::sun::star::awt::Key::K)
-#define KEY_L ((USHORT)::com::sun::star::awt::Key::L)
-#define KEY_M ((USHORT)::com::sun::star::awt::Key::M)
-#define KEY_N ((USHORT)::com::sun::star::awt::Key::N)
-#define KEY_O ((USHORT)::com::sun::star::awt::Key::O)
-#define KEY_P ((USHORT)::com::sun::star::awt::Key::P)
-#define KEY_Q ((USHORT)::com::sun::star::awt::Key::Q)
-#define KEY_R ((USHORT)::com::sun::star::awt::Key::R)
-#define KEY_S ((USHORT)::com::sun::star::awt::Key::S)
-#define KEY_T ((USHORT)::com::sun::star::awt::Key::T)
-#define KEY_U ((USHORT)::com::sun::star::awt::Key::U)
-#define KEY_V ((USHORT)::com::sun::star::awt::Key::V)
-#define KEY_W ((USHORT)::com::sun::star::awt::Key::W)
-#define KEY_X ((USHORT)::com::sun::star::awt::Key::X)
-#define KEY_Y ((USHORT)::com::sun::star::awt::Key::Y)
-#define KEY_Z ((USHORT)::com::sun::star::awt::Key::Z)
-
-#define KEY_F1 ((USHORT)::com::sun::star::awt::Key::F1)
-#define KEY_F2 ((USHORT)::com::sun::star::awt::Key::F2)
-#define KEY_F3 ((USHORT)::com::sun::star::awt::Key::F3)
-#define KEY_F4 ((USHORT)::com::sun::star::awt::Key::F4)
-#define KEY_F5 ((USHORT)::com::sun::star::awt::Key::F5)
-#define KEY_F6 ((USHORT)::com::sun::star::awt::Key::F6)
-#define KEY_F7 ((USHORT)::com::sun::star::awt::Key::F7)
-#define KEY_F8 ((USHORT)::com::sun::star::awt::Key::F8)
-#define KEY_F9 ((USHORT)::com::sun::star::awt::Key::F9)
-#define KEY_F10 ((USHORT)::com::sun::star::awt::Key::F10)
-#define KEY_F11 ((USHORT)::com::sun::star::awt::Key::F11)
-#define KEY_F12 ((USHORT)::com::sun::star::awt::Key::F12)
-#define KEY_F13 ((USHORT)::com::sun::star::awt::Key::F13)
-#define KEY_F14 ((USHORT)::com::sun::star::awt::Key::F14)
-#define KEY_F15 ((USHORT)::com::sun::star::awt::Key::F15)
-#define KEY_F16 ((USHORT)::com::sun::star::awt::Key::F16)
-#define KEY_F17 ((USHORT)::com::sun::star::awt::Key::F17)
-#define KEY_F18 ((USHORT)::com::sun::star::awt::Key::F18)
-#define KEY_F19 ((USHORT)::com::sun::star::awt::Key::F19)
-#define KEY_F20 ((USHORT)::com::sun::star::awt::Key::F20)
-#define KEY_F21 ((USHORT)::com::sun::star::awt::Key::F21)
-#define KEY_F22 ((USHORT)::com::sun::star::awt::Key::F22)
-#define KEY_F23 ((USHORT)::com::sun::star::awt::Key::F23)
-#define KEY_F24 ((USHORT)::com::sun::star::awt::Key::F24)
-#define KEY_F25 ((USHORT)::com::sun::star::awt::Key::F25)
-#define KEY_F26 ((USHORT)::com::sun::star::awt::Key::F26)
-
-#define KEY_DOWN ((USHORT)::com::sun::star::awt::Key::DOWN)
-#define KEY_UP ((USHORT)::com::sun::star::awt::Key::UP)
-#define KEY_LEFT ((USHORT)::com::sun::star::awt::Key::LEFT)
-#define KEY_RIGHT ((USHORT)::com::sun::star::awt::Key::RIGHT)
-#define KEY_HOME ((USHORT)::com::sun::star::awt::Key::HOME)
-#define KEY_END ((USHORT)::com::sun::star::awt::Key::END)
-#define KEY_PAGEUP ((USHORT)::com::sun::star::awt::Key::PAGEUP)
-#define KEY_PAGEDOWN ((USHORT)::com::sun::star::awt::Key::PAGEDOWN)
-
-#define KEY_RETURN ((USHORT)::com::sun::star::awt::Key::RETURN)
-#define KEY_ESCAPE ((USHORT)::com::sun::star::awt::Key::ESCAPE)
-#define KEY_TAB ((USHORT)::com::sun::star::awt::Key::TAB)
-#define KEY_BACKSPACE ((USHORT)::com::sun::star::awt::Key::BACKSPACE)
-#define KEY_SPACE ((USHORT)::com::sun::star::awt::Key::SPACE)
-#define KEY_INSERT ((USHORT)::com::sun::star::awt::Key::INSERT)
-#define KEY_DELETE ((USHORT)::com::sun::star::awt::Key::DELETE)
-
-#define KEY_ADD ((USHORT)::com::sun::star::awt::Key::ADD)
-#define KEY_SUBTRACT ((USHORT)::com::sun::star::awt::Key::SUBTRACT)
-#define KEY_MULTIPLY ((USHORT)::com::sun::star::awt::Key::MULTIPLY)
-#define KEY_DIVIDE ((USHORT)::com::sun::star::awt::Key::DIVIDE)
-#define KEY_POINT ((USHORT)::com::sun::star::awt::Key::POINT)
-#define KEY_COMMA ((USHORT)::com::sun::star::awt::Key::COMMA)
-#define KEY_LESS ((USHORT)::com::sun::star::awt::Key::LESS)
-#define KEY_GREATER ((USHORT)::com::sun::star::awt::Key::GREATER)
-#define KEY_EQUAL ((USHORT)::com::sun::star::awt::Key::EQUAL)
-
-#define KEY_OPEN ((USHORT)::com::sun::star::awt::Key::OPEN)
-#define KEY_CUT ((USHORT)::com::sun::star::awt::Key::CUT)
-#define KEY_COPY ((USHORT)::com::sun::star::awt::Key::COPY)
-#define KEY_PASTE ((USHORT)::com::sun::star::awt::Key::PASTE)
-#define KEY_UNDO ((USHORT)::com::sun::star::awt::Key::UNDO)
-#define KEY_REPEAT ((USHORT)::com::sun::star::awt::Key::REPEAT)
-#define KEY_FIND ((USHORT)::com::sun::star::awt::Key::FIND)
-#define KEY_PROPERTIES ((USHORT)::com::sun::star::awt::Key::PROPERTIES)
-#define KEY_FRONT ((USHORT)::com::sun::star::awt::Key::FRONT)
-#define KEY_CONTEXTMENU ((USHORT)::com::sun::star::awt::Key::CONTEXTMENU)
-#define KEY_MENU ((USHORT)::com::sun::star::awt::Key::MENU)
-#define KEY_HELP ((USHORT)::com::sun::star::awt::Key::HELP)
-#define KEY_HANGUL_HANJA ((USHORT)::com::sun::star::awt::Key::HANGUL_HANJA)
-#define KEY_DECIMAL ((USHORT)::com::sun::star::awt::Key::DECIMAL)
-#define KEY_TILDE ((USHORT)::com::sun::star::awt::Key::TILDE)
-#define KEY_QUOTELEFT ((USHORT)::com::sun::star::awt::Key::QUOTELEFT)
-#define KEY_BRACKETLEFT ((USHORT)::com::sun::star::awt::Key::BRACKETLEFT)
-#define KEY_BRACKETRIGHT ((USHORT)::com::sun::star::awt::Key::BRACKETRIGHT)
-#define KEY_SEMICOLON ((USHORT)::com::sun::star::awt::Key::SEMICOLON)
-
-#define KEY_CAPSLOCK ((USHORT)::com::sun::star::awt::Key::CAPSLOCK)
-#define KEY_NUMLOCK ((USHORT)::com::sun::star::awt::Key::NUMLOCK)
-#define KEY_SCROLLLOCK ((USHORT)::com::sun::star::awt::Key::SCROLLLOCK)
-
-#define KEY_CODE ((USHORT)0x0FFF)
+#define KEY_0 ((sal_uInt16)::com::sun::star::awt::Key::NUM0)
+#define KEY_1 ((sal_uInt16)::com::sun::star::awt::Key::NUM1)
+#define KEY_2 ((sal_uInt16)::com::sun::star::awt::Key::NUM2)
+#define KEY_3 ((sal_uInt16)::com::sun::star::awt::Key::NUM3)
+#define KEY_4 ((sal_uInt16)::com::sun::star::awt::Key::NUM4)
+#define KEY_5 ((sal_uInt16)::com::sun::star::awt::Key::NUM5)
+#define KEY_6 ((sal_uInt16)::com::sun::star::awt::Key::NUM6)
+#define KEY_7 ((sal_uInt16)::com::sun::star::awt::Key::NUM7)
+#define KEY_8 ((sal_uInt16)::com::sun::star::awt::Key::NUM8)
+#define KEY_9 ((sal_uInt16)::com::sun::star::awt::Key::NUM9)
+
+#define KEY_A ((sal_uInt16)::com::sun::star::awt::Key::A)
+#define KEY_B ((sal_uInt16)::com::sun::star::awt::Key::B)
+#define KEY_C ((sal_uInt16)::com::sun::star::awt::Key::C)
+#define KEY_D ((sal_uInt16)::com::sun::star::awt::Key::D)
+#define KEY_E ((sal_uInt16)::com::sun::star::awt::Key::E)
+#define KEY_F ((sal_uInt16)::com::sun::star::awt::Key::F)
+#define KEY_G ((sal_uInt16)::com::sun::star::awt::Key::G)
+#define KEY_H ((sal_uInt16)::com::sun::star::awt::Key::H)
+#define KEY_I ((sal_uInt16)::com::sun::star::awt::Key::I)
+#define KEY_J ((sal_uInt16)::com::sun::star::awt::Key::J)
+#define KEY_K ((sal_uInt16)::com::sun::star::awt::Key::K)
+#define KEY_L ((sal_uInt16)::com::sun::star::awt::Key::L)
+#define KEY_M ((sal_uInt16)::com::sun::star::awt::Key::M)
+#define KEY_N ((sal_uInt16)::com::sun::star::awt::Key::N)
+#define KEY_O ((sal_uInt16)::com::sun::star::awt::Key::O)
+#define KEY_P ((sal_uInt16)::com::sun::star::awt::Key::P)
+#define KEY_Q ((sal_uInt16)::com::sun::star::awt::Key::Q)
+#define KEY_R ((sal_uInt16)::com::sun::star::awt::Key::R)
+#define KEY_S ((sal_uInt16)::com::sun::star::awt::Key::S)
+#define KEY_T ((sal_uInt16)::com::sun::star::awt::Key::T)
+#define KEY_U ((sal_uInt16)::com::sun::star::awt::Key::U)
+#define KEY_V ((sal_uInt16)::com::sun::star::awt::Key::V)
+#define KEY_W ((sal_uInt16)::com::sun::star::awt::Key::W)
+#define KEY_X ((sal_uInt16)::com::sun::star::awt::Key::X)
+#define KEY_Y ((sal_uInt16)::com::sun::star::awt::Key::Y)
+#define KEY_Z ((sal_uInt16)::com::sun::star::awt::Key::Z)
+
+#define KEY_F1 ((sal_uInt16)::com::sun::star::awt::Key::F1)
+#define KEY_F2 ((sal_uInt16)::com::sun::star::awt::Key::F2)
+#define KEY_F3 ((sal_uInt16)::com::sun::star::awt::Key::F3)
+#define KEY_F4 ((sal_uInt16)::com::sun::star::awt::Key::F4)
+#define KEY_F5 ((sal_uInt16)::com::sun::star::awt::Key::F5)
+#define KEY_F6 ((sal_uInt16)::com::sun::star::awt::Key::F6)
+#define KEY_F7 ((sal_uInt16)::com::sun::star::awt::Key::F7)
+#define KEY_F8 ((sal_uInt16)::com::sun::star::awt::Key::F8)
+#define KEY_F9 ((sal_uInt16)::com::sun::star::awt::Key::F9)
+#define KEY_F10 ((sal_uInt16)::com::sun::star::awt::Key::F10)
+#define KEY_F11 ((sal_uInt16)::com::sun::star::awt::Key::F11)
+#define KEY_F12 ((sal_uInt16)::com::sun::star::awt::Key::F12)
+#define KEY_F13 ((sal_uInt16)::com::sun::star::awt::Key::F13)
+#define KEY_F14 ((sal_uInt16)::com::sun::star::awt::Key::F14)
+#define KEY_F15 ((sal_uInt16)::com::sun::star::awt::Key::F15)
+#define KEY_F16 ((sal_uInt16)::com::sun::star::awt::Key::F16)
+#define KEY_F17 ((sal_uInt16)::com::sun::star::awt::Key::F17)
+#define KEY_F18 ((sal_uInt16)::com::sun::star::awt::Key::F18)
+#define KEY_F19 ((sal_uInt16)::com::sun::star::awt::Key::F19)
+#define KEY_F20 ((sal_uInt16)::com::sun::star::awt::Key::F20)
+#define KEY_F21 ((sal_uInt16)::com::sun::star::awt::Key::F21)
+#define KEY_F22 ((sal_uInt16)::com::sun::star::awt::Key::F22)
+#define KEY_F23 ((sal_uInt16)::com::sun::star::awt::Key::F23)
+#define KEY_F24 ((sal_uInt16)::com::sun::star::awt::Key::F24)
+#define KEY_F25 ((sal_uInt16)::com::sun::star::awt::Key::F25)
+#define KEY_F26 ((sal_uInt16)::com::sun::star::awt::Key::F26)
+
+#define KEY_DOWN ((sal_uInt16)::com::sun::star::awt::Key::DOWN)
+#define KEY_UP ((sal_uInt16)::com::sun::star::awt::Key::UP)
+#define KEY_LEFT ((sal_uInt16)::com::sun::star::awt::Key::LEFT)
+#define KEY_RIGHT ((sal_uInt16)::com::sun::star::awt::Key::RIGHT)
+#define KEY_HOME ((sal_uInt16)::com::sun::star::awt::Key::HOME)
+#define KEY_END ((sal_uInt16)::com::sun::star::awt::Key::END)
+#define KEY_PAGEUP ((sal_uInt16)::com::sun::star::awt::Key::PAGEUP)
+#define KEY_PAGEDOWN ((sal_uInt16)::com::sun::star::awt::Key::PAGEDOWN)
+
+#define KEY_RETURN ((sal_uInt16)::com::sun::star::awt::Key::RETURN)
+#define KEY_ESCAPE ((sal_uInt16)::com::sun::star::awt::Key::ESCAPE)
+#define KEY_TAB ((sal_uInt16)::com::sun::star::awt::Key::TAB)
+#define KEY_BACKSPACE ((sal_uInt16)::com::sun::star::awt::Key::BACKSPACE)
+#define KEY_SPACE ((sal_uInt16)::com::sun::star::awt::Key::SPACE)
+#define KEY_INSERT ((sal_uInt16)::com::sun::star::awt::Key::INSERT)
+#define KEY_DELETE ((sal_uInt16)::com::sun::star::awt::Key::DELETE)
+
+#define KEY_ADD ((sal_uInt16)::com::sun::star::awt::Key::ADD)
+#define KEY_SUBTRACT ((sal_uInt16)::com::sun::star::awt::Key::SUBTRACT)
+#define KEY_MULTIPLY ((sal_uInt16)::com::sun::star::awt::Key::MULTIPLY)
+#define KEY_DIVIDE ((sal_uInt16)::com::sun::star::awt::Key::DIVIDE)
+#define KEY_POINT ((sal_uInt16)::com::sun::star::awt::Key::POINT)
+#define KEY_COMMA ((sal_uInt16)::com::sun::star::awt::Key::COMMA)
+#define KEY_LESS ((sal_uInt16)::com::sun::star::awt::Key::LESS)
+#define KEY_GREATER ((sal_uInt16)::com::sun::star::awt::Key::GREATER)
+#define KEY_EQUAL ((sal_uInt16)::com::sun::star::awt::Key::EQUAL)
+
+#define KEY_OPEN ((sal_uInt16)::com::sun::star::awt::Key::OPEN)
+#define KEY_CUT ((sal_uInt16)::com::sun::star::awt::Key::CUT)
+#define KEY_COPY ((sal_uInt16)::com::sun::star::awt::Key::COPY)
+#define KEY_PASTE ((sal_uInt16)::com::sun::star::awt::Key::PASTE)
+#define KEY_UNDO ((sal_uInt16)::com::sun::star::awt::Key::UNDO)
+#define KEY_REPEAT ((sal_uInt16)::com::sun::star::awt::Key::REPEAT)
+#define KEY_FIND ((sal_uInt16)::com::sun::star::awt::Key::FIND)
+#define KEY_PROPERTIES ((sal_uInt16)::com::sun::star::awt::Key::PROPERTIES)
+#define KEY_FRONT ((sal_uInt16)::com::sun::star::awt::Key::FRONT)
+#define KEY_CONTEXTMENU ((sal_uInt16)::com::sun::star::awt::Key::CONTEXTMENU)
+#define KEY_MENU ((sal_uInt16)::com::sun::star::awt::Key::MENU)
+#define KEY_HELP ((sal_uInt16)::com::sun::star::awt::Key::HELP)
+#define KEY_HANGUL_HANJA ((sal_uInt16)::com::sun::star::awt::Key::HANGUL_HANJA)
+#define KEY_DECIMAL ((sal_uInt16)::com::sun::star::awt::Key::DECIMAL)
+#define KEY_TILDE ((sal_uInt16)::com::sun::star::awt::Key::TILDE)
+#define KEY_QUOTELEFT ((sal_uInt16)::com::sun::star::awt::Key::QUOTELEFT)
+#define KEY_BRACKETLEFT ((sal_uInt16)::com::sun::star::awt::Key::BRACKETLEFT)
+#define KEY_BRACKETRIGHT ((sal_uInt16)::com::sun::star::awt::Key::BRACKETRIGHT)
+#define KEY_SEMICOLON ((sal_uInt16)::com::sun::star::awt::Key::SEMICOLON)
+
+#define KEY_CAPSLOCK ((sal_uInt16)::com::sun::star::awt::Key::CAPSLOCK)
+#define KEY_NUMLOCK ((sal_uInt16)::com::sun::star::awt::Key::NUMLOCK)
+#define KEY_SCROLLLOCK ((sal_uInt16)::com::sun::star::awt::Key::SCROLLLOCK)
+
+#define KEY_CODE ((sal_uInt16)0x0FFF)
// Modifier-Tasten
-#define KEY_SHIFT ((USHORT)0x1000)
-#define KEY_MOD1 ((USHORT)0x2000)
-#define KEY_MOD2 ((USHORT)0x4000)
-#define KEY_MOD3 ((USHORT)0x8000)
-#define KEY_MODTYPE ((USHORT)0xF000)
-#define KEY_ALLMODTYPE ((USHORT)0xF000)
+#define KEY_SHIFT ((sal_uInt16)0x1000)
+#define KEY_MOD1 ((sal_uInt16)0x2000)
+#define KEY_MOD2 ((sal_uInt16)0x4000)
+#define KEY_MOD3 ((sal_uInt16)0x8000)
+#define KEY_MODTYPE ((sal_uInt16)0xF000)
+#define KEY_ALLMODTYPE ((sal_uInt16)0xF000)
// extended Modifier-Keys (only used for modkey events)
#define MODKEY_LSHIFT 0x0001
@@ -192,9 +192,9 @@
// - Mouse-Types -
// ---------------
-#define MOUSE_LEFT ((USHORT)0x0001)
-#define MOUSE_MIDDLE ((USHORT)0x0002)
-#define MOUSE_RIGHT ((USHORT)0x0004)
+#define MOUSE_LEFT ((sal_uInt16)0x0001)
+#define MOUSE_MIDDLE ((sal_uInt16)0x0002)
+#define MOUSE_RIGHT ((sal_uInt16)0x0004)
// -------------------
// - Indicator-Types -
diff --git a/vcl/inc/vcl/lazydelete.hxx b/vcl/inc/vcl/lazydelete.hxx
index 0a1e2a30f5f5..e7edee035e4d 100644
--- a/vcl/inc/vcl/lazydelete.hxx
+++ b/vcl/inc/vcl/lazydelete.hxx
@@ -40,6 +40,8 @@
#include <stdio.h>
#endif
+#include <com/sun/star/lang/XComponent.hpp>
+
namespace vcl
{
/* Helpers for lazy object deletion
@@ -257,6 +259,43 @@ namespace vcl
// ownership is transfered !
T* set( T* i_pNew ) { T* pOld = m_pT; m_pT = i_pNew; return pOld; }
};
+
+ /** Similar to DeleteOnDeinit, the DeleteUnoReferenceOnDeinit
+ template class makes sure that a static UNO object is disposed
+ and released at the right time.
+
+ Use like
+ static DeleteUnoReferenceOnDeinit<lang::XMultiServiceFactory>
+ xStaticFactory (<create factory object>);
+ Reference<lang::XMultiServiceFactory> xFactory (xStaticFactory.get());
+ if (xFactory.is())
+ <do something with xFactory>
+ */
+ template <typename I>
+ class DeleteUnoReferenceOnDeinit : public ::vcl::DeleteOnDeinitBase
+ {
+ ::com::sun::star::uno::Reference<I> m_xI;
+ virtual void doCleanup() { set(NULL); }
+ public:
+ DeleteUnoReferenceOnDeinit(const ::com::sun::star::uno::Reference<I>& r_xI ) : m_xI( r_xI ) {
+ addDeinitContainer( this ); }
+ virtual ~DeleteUnoReferenceOnDeinit() {}
+
+ ::com::sun::star::uno::Reference<I> get (void) { return m_xI; }
+
+ void set (const ::com::sun::star::uno::Reference<I>& r_xNew )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> xComponent (m_xI, ::com::sun::star::uno::UNO_QUERY);
+ m_xI = r_xNew;
+ if (xComponent.is()) try
+ {
+ xComponent->dispose();
+ }
+ catch( ::com::sun::star::uno::Exception& )
+ {
+ }
+ }
+ };
}
#endif
diff --git a/vcl/inc/vcl/lineinfo.hxx b/vcl/inc/vcl/lineinfo.hxx
index be17988dd71d..046257cbdd9f 100644
--- a/vcl/inc/vcl/lineinfo.hxx
+++ b/vcl/inc/vcl/lineinfo.hxx
@@ -43,12 +43,12 @@ namespace basegfx { class B2DPolyPolygon; }
struct ImplLineInfo
{
- ULONG mnRefCount;
+ sal_uLong mnRefCount;
LineStyle meStyle;
long mnWidth;
- USHORT mnDashCount;
+ sal_uInt16 mnDashCount;
long mnDashLen;
- USHORT mnDotCount;
+ sal_uInt16 mnDotCount;
long mnDotLen;
long mnDistance;
@@ -57,6 +57,8 @@ struct ImplLineInfo
ImplLineInfo();
ImplLineInfo( const ImplLineInfo& rImplLineInfo );
+ bool operator==( const ImplLineInfo& ) const;
+
friend SvStream& operator>>( SvStream& rIStm, ImplLineInfo& rImplLineInfo );
friend SvStream& operator<<( SvStream& rOStm, const ImplLineInfo& rImplLineInfo );
};
@@ -83,9 +85,9 @@ public:
~LineInfo();
LineInfo& operator=( const LineInfo& rLineInfo );
- BOOL operator==( const LineInfo& rLineInfo ) const;
- BOOL operator!=( const LineInfo& rLineInfo ) const { return !(LineInfo::operator==( rLineInfo ) ); }
- BOOL IsSameInstance( const LineInfo& rLineInfo ) const { return( mpImplLineInfo == rLineInfo.mpImplLineInfo ); }
+ sal_Bool operator==( const LineInfo& rLineInfo ) const;
+ sal_Bool operator!=( const LineInfo& rLineInfo ) const { return !(LineInfo::operator==( rLineInfo ) ); }
+ sal_Bool IsSameInstance( const LineInfo& rLineInfo ) const { return( mpImplLineInfo == rLineInfo.mpImplLineInfo ); }
void SetStyle( LineStyle eStyle );
LineStyle GetStyle() const { return mpImplLineInfo->meStyle; }
@@ -93,14 +95,14 @@ public:
void SetWidth( long nWidth );
long GetWidth() const { return mpImplLineInfo->mnWidth; }
- void SetDashCount( USHORT nDashCount );
- USHORT GetDashCount() const { return mpImplLineInfo->mnDashCount; }
+ void SetDashCount( sal_uInt16 nDashCount );
+ sal_uInt16 GetDashCount() const { return mpImplLineInfo->mnDashCount; }
void SetDashLen( long nDashLen );
long GetDashLen() const { return mpImplLineInfo->mnDashLen; }
- void SetDotCount( USHORT nDotCount );
- USHORT GetDotCount() const { return mpImplLineInfo->mnDotCount; }
+ void SetDotCount( sal_uInt16 nDotCount );
+ sal_uInt16 GetDotCount() const { return mpImplLineInfo->mnDotCount; }
void SetDotLen( long nDotLen );
long GetDotLen() const { return mpImplLineInfo->mnDotLen; }
@@ -111,7 +113,7 @@ public:
void SetLineJoin(basegfx::B2DLineJoin eLineJoin);
basegfx::B2DLineJoin GetLineJoin() const { return mpImplLineInfo->meLineJoin; }
- BOOL IsDefault() const { return( !mpImplLineInfo->mnWidth && ( LINE_SOLID == mpImplLineInfo->meStyle ) ); }
+ sal_Bool IsDefault() const { return( !mpImplLineInfo->mnWidth && ( LINE_SOLID == mpImplLineInfo->meStyle ) ); }
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, LineInfo& rLineInfo );
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const LineInfo& rLineInfo );
diff --git a/vcl/inc/vcl/longcurr.hxx b/vcl/inc/vcl/longcurr.hxx
index fdbb36f7af6c..ca4ebcadc77e 100644
--- a/vcl/inc/vcl/longcurr.hxx
+++ b/vcl/inc/vcl/longcurr.hxx
@@ -42,7 +42,7 @@ class LocaleDataWrapper;
class VCL_DLLPUBLIC LongCurrencyFormatter : public FormatterBase
{
private:
- SAL_DLLPRIVATE friend BOOL ImplLongCurrencyReformat( const XubString&, BigInt, BigInt, USHORT, const LocaleDataWrapper&, XubString&, LongCurrencyFormatter& );
+ SAL_DLLPRIVATE friend sal_Bool ImplLongCurrencyReformat( const XubString&, BigInt, BigInt, sal_uInt16, const LocaleDataWrapper&, XubString&, LongCurrencyFormatter& );
SAL_DLLPRIVATE void ImpInit();
protected:
@@ -52,9 +52,9 @@ protected:
BigInt mnMax;
BigInt mnCorrectedValue;
String maCurrencySymbol;
- USHORT mnType;
- USHORT mnDecimalDigits;
- BOOL mbThousandSep;
+ sal_uInt16 mnType;
+ sal_uInt16 mnDecimalDigits;
+ sal_Bool mbThousandSep;
LongCurrencyFormatter();
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
@@ -65,8 +65,8 @@ public:
virtual void Reformat();
virtual void ReformatAll();
- void SetUseThousandSep( BOOL b );
- BOOL IsUseThousandSep() const { return mbThousandSep; }
+ void SetUseThousandSep( sal_Bool b );
+ sal_Bool IsUseThousandSep() const { return mbThousandSep; }
void SetCurrencySymbol( const String& rStr );
String GetCurrencySymbol() const;
@@ -76,15 +76,15 @@ public:
void SetMax( BigInt nNewMax );
BigInt GetMax() const { return mnMax; }
- void SetDecimalDigits( USHORT nDigits );
- USHORT GetDecimalDigits() const;
+ void SetDecimalDigits( sal_uInt16 nDigits );
+ sal_uInt16 GetDecimalDigits() const;
void SetValue( BigInt nNewValue );
void SetUserValue( BigInt nNewValue );
BigInt GetValue() const;
- BOOL IsValueModified() const;
+ sal_Bool IsValueModified() const;
void SetEmptyValue();
- BOOL IsEmptyValue() const { return !GetField()->GetText().Len(); }
+ sal_Bool IsEmptyValue() const { return !GetField()->GetText().Len(); }
BigInt GetCorrectedValue() const { return mnCorrectedValue; }
@@ -148,12 +148,12 @@ public:
void ReformatAll();
void InsertValue( BigInt nValue,
- USHORT nPos = COMBOBOX_APPEND );
+ sal_uInt16 nPos = COMBOBOX_APPEND );
void RemoveValue( BigInt nValue );
BigInt GetValue() const
{ return LongCurrencyFormatter::GetValue(); }
- BigInt GetValue( USHORT nPos ) const;
- USHORT GetValuePos( BigInt nValue ) const;
+ BigInt GetValue( sal_uInt16 nPos ) const;
+ sal_uInt16 GetValuePos( BigInt nValue ) const;
};
#endif // _LONGCURR_HXX
diff --git a/vcl/inc/vcl/lstbox.h b/vcl/inc/vcl/lstbox.h
index 454156f83627..f4577dc1e718 100644
--- a/vcl/inc/vcl/lstbox.h
+++ b/vcl/inc/vcl/lstbox.h
@@ -29,11 +29,11 @@
#ifndef _SV_LSTBOX_H
#define _SV_LSTBOX_H
-#define LISTBOX_APPEND ((USHORT)0xFFFF)
-#define LISTBOX_ENTRY_NOTFOUND ((USHORT)0xFFFF)
-#define LISTBOX_ERROR ((USHORT)0xFFFF)
+#define LISTBOX_APPEND ((sal_uInt16)0xFFFF)
+#define LISTBOX_ENTRY_NOTFOUND ((sal_uInt16)0xFFFF)
+#define LISTBOX_ERROR ((sal_uInt16)0xFFFF)
-#define LISTBOX_USERDRAW_SELECTED ((USHORT)0x0001)
+#define LISTBOX_USERDRAW_SELECTED ((sal_uInt16)0x0001)
// --------------------------------------------------------------------
diff --git a/vcl/inc/vcl/lstbox.hxx b/vcl/inc/vcl/lstbox.hxx
index 5d74ce5c7a99..cc1d0615cb7b 100644
--- a/vcl/inc/vcl/lstbox.hxx
+++ b/vcl/inc/vcl/lstbox.hxx
@@ -50,12 +50,12 @@ private:
ImplListBoxFloatingWindow* mpFloatWin;
ImplWin* mpImplWin;
ImplBtn* mpBtn;
- USHORT mnDDHeight;
- USHORT mnSaveValue;
- BOOL mbDDAutoSize;
+ sal_uInt16 mnDDHeight;
+ sal_uInt16 mnSaveValue;
+ sal_Bool mbDDAutoSize;
Link maSelectHdl;
Link maDoubleClickHdl;
- USHORT mnLineCount;
+ sal_uInt16 mnLineCount;
private:
SAL_DLLPRIVATE void ImplInitListBoxData();
@@ -74,7 +74,7 @@ protected:
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- BOOL IsDropDownBox() const { return mpFloatWin ? TRUE : FALSE; }
+ sal_Bool IsDropDownBox() const { return mpFloatWin ? sal_True : sal_False; }
protected:
ListBox( WindowType nType );
@@ -86,7 +86,7 @@ public:
ListBox( Window* pParent, const ResId& rResId );
~ListBox();
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual long PreNotify( NotifyEvent& rNEvt );
virtual void StateChanged( StateChangedType nType );
@@ -102,7 +102,7 @@ public:
virtual const Wallpaper& GetDisplayBackground() const;
virtual void SetPosSizePixel( long nX, long nY,
- long nWidth, long nHeight, USHORT nFlags = WINDOW_POSSIZE_ALL );
+ long nWidth, long nHeight, sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize )
{ Control::SetPosSizePixel( rNewPos, rNewSize ); }
void SetDropDownSizePixel( const Size& rNewSize )
@@ -110,42 +110,42 @@ public:
Rectangle GetDropDownPosSizePixel() const;
- void SetDropDownLineCount( USHORT nLines );
- USHORT GetDropDownLineCount() const;
+ void SetDropDownLineCount( sal_uInt16 nLines );
+ sal_uInt16 GetDropDownLineCount() const;
- void EnableAutoSize( BOOL bAuto );
- BOOL IsAutoSizeEnabled() const { return mbDDAutoSize; }
+ void EnableAutoSize( sal_Bool bAuto );
+ sal_Bool IsAutoSizeEnabled() const { return mbDDAutoSize; }
- void EnableDDAutoWidth( BOOL b );
- BOOL IsDDAutoWidthEnabled() const;
+ void EnableDDAutoWidth( sal_Bool b );
+ sal_Bool IsDDAutoWidthEnabled() const;
- virtual USHORT InsertEntry( const XubString& rStr, USHORT nPos = LISTBOX_APPEND );
- virtual USHORT InsertEntry( const Image& rImage, USHORT nPos = LISTBOX_APPEND );
- virtual USHORT InsertEntry( const XubString& rStr, const Image& rImage, USHORT nPos = LISTBOX_APPEND );
+ virtual sal_uInt16 InsertEntry( const XubString& rStr, sal_uInt16 nPos = LISTBOX_APPEND );
+ virtual sal_uInt16 InsertEntry( const Image& rImage, sal_uInt16 nPos = LISTBOX_APPEND );
+ virtual sal_uInt16 InsertEntry( const XubString& rStr, const Image& rImage, sal_uInt16 nPos = LISTBOX_APPEND );
virtual void RemoveEntry( const XubString& rStr );
- virtual void RemoveEntry( USHORT nPos );
+ virtual void RemoveEntry( sal_uInt16 nPos );
virtual void Clear();
- virtual USHORT GetEntryPos( const XubString& rStr ) const;
- virtual USHORT GetEntryPos( const void* pData ) const;
- Image GetEntryImage( USHORT nPos ) const;
- virtual XubString GetEntry( USHORT nPos ) const;
- virtual USHORT GetEntryCount() const;
+ virtual sal_uInt16 GetEntryPos( const XubString& rStr ) const;
+ virtual sal_uInt16 GetEntryPos( const void* pData ) const;
+ Image GetEntryImage( sal_uInt16 nPos ) const;
+ virtual XubString GetEntry( sal_uInt16 nPos ) const;
+ virtual sal_uInt16 GetEntryCount() const;
- virtual void SelectEntry( const XubString& rStr, BOOL bSelect = TRUE );
- virtual void SelectEntryPos( USHORT nPos, BOOL bSelect = TRUE );
+ virtual void SelectEntry( const XubString& rStr, sal_Bool bSelect = sal_True );
+ virtual void SelectEntryPos( sal_uInt16 nPos, sal_Bool bSelect = sal_True );
- virtual USHORT GetSelectEntryCount() const;
- virtual XubString GetSelectEntry( USHORT nSelIndex = 0 ) const;
- virtual USHORT GetSelectEntryPos( USHORT nSelIndex = 0 ) const;
+ virtual sal_uInt16 GetSelectEntryCount() const;
+ virtual XubString GetSelectEntry( sal_uInt16 nSelIndex = 0 ) const;
+ virtual sal_uInt16 GetSelectEntryPos( sal_uInt16 nSelIndex = 0 ) const;
- virtual BOOL IsEntrySelected( const XubString& rStr ) const;
- virtual BOOL IsEntryPosSelected( USHORT nPos ) const;
+ virtual sal_Bool IsEntrySelected( const XubString& rStr ) const;
+ virtual sal_Bool IsEntryPosSelected( sal_uInt16 nPos ) const;
virtual void SetNoSelection();
- void SetEntryData( USHORT nPos, void* pNewData );
- void* GetEntryData( USHORT nPos ) const;
+ void SetEntryData( sal_uInt16 nPos, void* pNewData );
+ void* GetEntryData( sal_uInt16 nPos ) const;
/** this methods stores a combination of flags from the
LISTBOX_ENTRY_FLAG_* defines at the given entry.
@@ -155,51 +155,51 @@ public:
to change the internal behaviour of the ListBox implementation
for specific entries.
*/
- void SetEntryFlags( USHORT nPos, long nFlags );
+ void SetEntryFlags( sal_uInt16 nPos, long nFlags );
/** this methods gets the current combination of flags from the
LISTBOX_ENTRY_FLAG_* defines from the given entry.
See description of the possible LISTBOX_ENTRY_FLAG_* flags
for details.
*/
- long GetEntryFlags( USHORT nPos ) const;
+ long GetEntryFlags( sal_uInt16 nPos ) const;
- void SetTopEntry( USHORT nPos );
- void ShowProminentEntry( USHORT nPos );
+ void SetTopEntry( sal_uInt16 nPos );
+ void ShowProminentEntry( sal_uInt16 nPos );
void SetTopEntryStr( const XubString& rStr );
- USHORT GetTopEntry() const;
+ sal_uInt16 GetTopEntry() const;
void SetProminentEntryType( ProminentEntry eType );
ProminentEntry GetProminentEntryType() const;
void SaveValue() { mnSaveValue = GetSelectEntryPos(); }
- USHORT GetSavedValue() const { return mnSaveValue; }
+ sal_uInt16 GetSavedValue() const { return mnSaveValue; }
- void SetSeparatorPos( USHORT n );
+ void SetSeparatorPos( sal_uInt16 n );
void SetSeparatorPos();
- USHORT GetSeparatorPos() const;
+ sal_uInt16 GetSeparatorPos() const;
- BOOL IsTravelSelect() const;
- BOOL IsInDropDown() const;
+ sal_Bool IsTravelSelect() const;
+ sal_Bool IsInDropDown() const;
void ToggleDropDown();
- void EnableMultiSelection( BOOL bMulti, BOOL bStackSelection );
- void EnableMultiSelection( BOOL bMulti );
- BOOL IsMultiSelectionEnabled() const;
+ void EnableMultiSelection( sal_Bool bMulti, sal_Bool bStackSelection );
+ void EnableMultiSelection( sal_Bool bMulti );
+ sal_Bool IsMultiSelectionEnabled() const;
- void SetReadOnly( BOOL bReadOnly = TRUE );
- BOOL IsReadOnly() const;
+ void SetReadOnly( sal_Bool bReadOnly = sal_True );
+ sal_Bool IsReadOnly() const;
- long CalcWindowSizePixel( USHORT nLines ) const;
- Rectangle GetBoundingRectangle( USHORT nItem ) const;
+ long CalcWindowSizePixel( sal_uInt16 nLines ) const;
+ Rectangle GetBoundingRectangle( sal_uInt16 nItem ) const;
void SetUserItemSize( const Size& rSz );
const Size& GetUserItemSize() const;
- void EnableUserDraw( BOOL bUserDraw );
- BOOL IsUserDrawEnabled() const;
+ void EnableUserDraw( sal_Bool bUserDraw );
+ sal_Bool IsUserDrawEnabled() const;
- void DrawEntry( const UserDrawEvent& rEvt, BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos = FALSE );
+ void DrawEntry( const UserDrawEvent& rEvt, sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos = sal_False );
void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
const Link& GetSelectHdl() const { return maSelectHdl; }
@@ -209,15 +209,15 @@ public:
Size CalcMinimumSize() const;
virtual Size GetOptimalSize(WindowSizeType eType) const;
Size CalcAdjustedSize( const Size& rPrefSize ) 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 SetMRUEntries( const XubString& rEntries, xub_Unicode cSep = ';' );
XubString GetMRUEntries( xub_Unicode cSep = ';' ) const;
- void SetMaxMRUCount( USHORT n );
- USHORT GetMaxMRUCount() const;
+ void SetMaxMRUCount( sal_uInt16 n );
+ sal_uInt16 GetMaxMRUCount() const;
- USHORT GetDisplayLineCount() const;
+ sal_uInt16 GetDisplayLineCount() const;
void EnableMirroring();
@@ -240,7 +240,7 @@ public:
if no item is at that point.
*/
using Control::GetIndexForPoint;
- long GetIndexForPoint( const Point& rPoint, USHORT& rPos ) const;
+ long GetIndexForPoint( const Point& rPoint, sal_uInt16& rPos ) const;
};
// ----------------
@@ -255,7 +255,7 @@ public:
private:
// Bei MultiListBox nicht erlaubt...
void SaveValue();
- USHORT GetSavedValue();
+ sal_uInt16 GetSavedValue();
public:
MultiListBox( Window* pParent, WinBits nStyle = 0 );
diff --git a/vcl/inc/vcl/mapmod.hxx b/vcl/inc/vcl/mapmod.hxx
index 53cea6801cb2..bf666bc782cb 100644
--- a/vcl/inc/vcl/mapmod.hxx
+++ b/vcl/inc/vcl/mapmod.hxx
@@ -34,7 +34,7 @@
#include <vcl/sv.h>
#include <vcl/dllapi.h>
#include <tools/resid.hxx>
-#include <vcl/mapunit.hxx>
+#include <tools/mapunit.hxx>
class SvStream;
@@ -50,12 +50,12 @@ class ImplMapMode
friend class OutputDevice;
private:
- ULONG mnRefCount;
+ sal_uLong mnRefCount;
MapUnit meUnit;
Point maOrigin;
Fraction maScaleX;
Fraction maScaleY;
- BOOL mbSimple;
+ sal_Bool mbSimple;
friend SvStream& operator>>( SvStream& rIStm, ImplMapMode& rMapMode );
friend SvStream& operator<<( SvStream& rOStm, const ImplMapMode& rMapMode );
@@ -103,11 +103,11 @@ public:
{ return mpImplMapMode->maScaleY; }
MapMode& operator=( const MapMode& rMapMode );
- BOOL operator==( const MapMode& rMapMode ) const;
- BOOL operator!=( const MapMode& rMapMode ) const
+ sal_Bool operator==( const MapMode& rMapMode ) const;
+ sal_Bool operator!=( const MapMode& rMapMode ) const
{ return !(MapMode::operator==( rMapMode )); }
- BOOL IsDefault() const;
- BOOL IsSameInstance( const MapMode& rMapMode ) const
+ sal_Bool IsDefault() const;
+ sal_Bool IsSameInstance( const MapMode& rMapMode ) const
{ return (mpImplMapMode == rMapMode.mpImplMapMode); }
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, MapMode& rMapMode );
diff --git a/vcl/inc/vcl/mapunit.hxx b/vcl/inc/vcl/mapunit.hxx
deleted file mode 100644
index f8fb7581c469..000000000000
--- a/vcl/inc/vcl/mapunit.hxx
+++ /dev/null
@@ -1,36 +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 _VCL_MAPUNIT_HXX
-#define _VCL_MAPUNIT_HXX
-
-#include <tools/mapunit.hxx>
-
-#endif // _VCL_MAPUNIT_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/menu.hxx b/vcl/inc/vcl/menu.hxx
index 751f4ac16ca5..2712cefbb5d8 100644
--- a/vcl/inc/vcl/menu.hxx
+++ b/vcl/inc/vcl/menu.hxx
@@ -68,22 +68,22 @@ namespace vcl { struct MenuLayoutData; }
// - Menu-Types -
// --------------
-#define MENU_APPEND ((USHORT)0xFFFF)
-#define MENU_ITEM_NOTFOUND ((USHORT)0xFFFF)
+#define MENU_APPEND ((sal_uInt16)0xFFFF)
+#define MENU_ITEM_NOTFOUND ((sal_uInt16)0xFFFF)
-#define POPUPMENU_EXECUTE_DOWN ((USHORT)0x0001)
-#define POPUPMENU_EXECUTE_UP ((USHORT)0x0002)
-#define POPUPMENU_EXECUTE_LEFT ((USHORT)0x0004)
-#define POPUPMENU_EXECUTE_RIGHT ((USHORT)0x0008)
+#define POPUPMENU_EXECUTE_DOWN ((sal_uInt16)0x0001)
+#define POPUPMENU_EXECUTE_UP ((sal_uInt16)0x0002)
+#define POPUPMENU_EXECUTE_LEFT ((sal_uInt16)0x0004)
+#define POPUPMENU_EXECUTE_RIGHT ((sal_uInt16)0x0008)
-#define POPUPMENU_NOMOUSEUPCLOSE ((USHORT)0x0010)
+#define POPUPMENU_NOMOUSEUPCLOSE ((sal_uInt16)0x0010)
// By changes you must also change: rsc/vclrsc.hxx
enum MenuItemType { MENUITEM_DONTKNOW, MENUITEM_STRING, MENUITEM_IMAGE,
MENUITEM_STRINGIMAGE, MENUITEM_SEPARATOR };
// By changes you must also change: rsc/vclrsc.hxx
-typedef USHORT MenuItemBits;
+typedef sal_uInt16 MenuItemBits;
#define MIB_CHECKABLE ((MenuItemBits)0x0001)
#define MIB_RADIOCHECK ((MenuItemBits)0x0002)
#define MIB_AUTOCHECK ((MenuItemBits)0x0004)
@@ -151,18 +151,18 @@ private:
XubString aTitleText; // PopupMenu-Text
- ULONG nEventId;
- USHORT mnHighlightedItemPos; // for native menues: keeps track of the highlighted item
- USHORT nMenuFlags;
- USHORT nDefaultItem; // Id vom Default-Item
- USHORT nSelectedId;
+ sal_uLong nEventId;
+ sal_uInt16 mnHighlightedItemPos; // for native menues: keeps track of the highlighted item
+ sal_uInt16 nMenuFlags;
+ sal_uInt16 nDefaultItem; // Id vom Default-Item
+ sal_uInt16 nSelectedId;
// Fuer Ausgabe:
- USHORT nCheckPos;
- USHORT nImagePos;
- USHORT nTextPos;
+ sal_uInt16 nCheckPos;
+ sal_uInt16 nImagePos;
+ sal_uInt16 nTextPos;
- BOOL bIsMenuBar : 1, // Handelt es sich um den MenuBar
+ sal_Bool bIsMenuBar : 1, // Handelt es sich um den MenuBar
bCanceled : 1, // Waehrend eines Callbacks abgebrochen
bInCallback : 1, // In Activate/Deactivate
bKilled : 1; // Gekillt...
@@ -176,24 +176,24 @@ protected:
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
SAL_DLLPRIVATE Menu* ImplGetStartMenu();
SAL_DLLPRIVATE Menu* ImplFindSelectMenu();
- SAL_DLLPRIVATE Menu* ImplFindMenu( USHORT nId );
+ SAL_DLLPRIVATE Menu* ImplFindMenu( sal_uInt16 nId );
SAL_DLLPRIVATE Size ImplCalcSize( Window* pWin );
- SAL_DLLPRIVATE BOOL ImplIsVisible( USHORT nPos ) const;
- SAL_DLLPRIVATE BOOL ImplIsSelectable( USHORT nPos ) const;
- SAL_DLLPRIVATE USHORT ImplGetVisibleItemCount() const;
- SAL_DLLPRIVATE USHORT ImplGetFirstVisible() const;
- SAL_DLLPRIVATE USHORT ImplGetPrevVisible( USHORT nPos ) const;
- SAL_DLLPRIVATE USHORT ImplGetNextVisible( USHORT nPos ) const;
- SAL_DLLPRIVATE void ImplPaint( Window* pWin, USHORT nBorder, long nOffY = 0, MenuItemData* pThisDataOnly = 0, BOOL bHighlighted = FALSE, bool bLayout = false ) const;
+ SAL_DLLPRIVATE sal_Bool ImplIsVisible( sal_uInt16 nPos ) const;
+ SAL_DLLPRIVATE sal_Bool ImplIsSelectable( sal_uInt16 nPos ) const;
+ SAL_DLLPRIVATE sal_uInt16 ImplGetVisibleItemCount() const;
+ SAL_DLLPRIVATE sal_uInt16 ImplGetFirstVisible() const;
+ SAL_DLLPRIVATE sal_uInt16 ImplGetPrevVisible( sal_uInt16 nPos ) const;
+ SAL_DLLPRIVATE sal_uInt16 ImplGetNextVisible( sal_uInt16 nPos ) const;
+ SAL_DLLPRIVATE void ImplPaint( Window* pWin, sal_uInt16 nBorder, long nOffY = 0, MenuItemData* pThisDataOnly = 0, sal_Bool bHighlighted = sal_False, bool bLayout = false ) const;
SAL_DLLPRIVATE void ImplSelect();
- SAL_DLLPRIVATE void ImplCallHighlight( USHORT nHighlightItem );
- SAL_DLLPRIVATE void ImplCallEventListeners( ULONG nEvent, USHORT nPos );
+ SAL_DLLPRIVATE void ImplCallHighlight( sal_uInt16 nHighlightItem );
+ SAL_DLLPRIVATE void ImplCallEventListeners( sal_uLong nEvent, sal_uInt16 nPos );
DECL_DLLPRIVATE_LINK( ImplCallSelect, Menu* );
SAL_DLLPRIVATE void ImplFillLayoutData() const;
SAL_DLLPRIVATE SalMenu* ImplGetSalMenu() { return mpSalMenu; }
SAL_DLLPRIVATE void ImplSetSalMenu( SalMenu *pMenu );
- SAL_DLLPRIVATE const XubString& ImplGetHelpText( USHORT nItemId ) const;
+ SAL_DLLPRIVATE const XubString& ImplGetHelpText( sal_uInt16 nItemId ) const;
// returns native check and option menu symbol height;
// return value is Max( rCheckHeight, rRadioHeight )
@@ -206,7 +206,7 @@ public:
SAL_DLLPRIVATE Menu* ImplGetStartedFrom() const;
Menu();
- Menu( BOOL bMenuBar );
+ Menu( sal_Bool bMenuBar );
SAL_DLLPRIVATE Window* ImplGetWindow() const { return pWindow; }
@@ -220,93 +220,93 @@ public:
virtual void Select();
virtual void RequestHelp( const HelpEvent& rHEvt );
- void InsertItem( USHORT nItemId, const XubString& rStr,
+ void InsertItem( sal_uInt16 nItemId, const XubString& rStr,
MenuItemBits nItemBits = 0,
- USHORT nPos = MENU_APPEND );
- void InsertItem( USHORT nItemId, const Image& rImage,
+ sal_uInt16 nPos = MENU_APPEND );
+ void InsertItem( sal_uInt16 nItemId, const Image& rImage,
MenuItemBits nItemBits = 0,
- USHORT nPos = MENU_APPEND );
- void InsertItem( USHORT nItemId,
+ sal_uInt16 nPos = MENU_APPEND );
+ void InsertItem( sal_uInt16 nItemId,
const XubString& rString, const Image& rImage,
MenuItemBits nItemBits = 0,
- USHORT nPos = MENU_APPEND );
- void InsertItem( const ResId& rResId, USHORT nPos = MENU_APPEND );
- void InsertSeparator( USHORT nPos = MENU_APPEND );
- void RemoveItem( USHORT nPos );
- void CopyItem( const Menu& rMenu, USHORT nPos,
- USHORT nNewPos = MENU_APPEND );
+ sal_uInt16 nPos = MENU_APPEND );
+ void InsertItem( const ResId& rResId, sal_uInt16 nPos = MENU_APPEND );
+ void InsertSeparator( sal_uInt16 nPos = MENU_APPEND );
+ void RemoveItem( sal_uInt16 nPos );
+ void CopyItem( const Menu& rMenu, sal_uInt16 nPos,
+ sal_uInt16 nNewPos = MENU_APPEND );
void Clear();
void CreateAutoMnemonics();
- void SetMenuFlags( USHORT nFlags ) { nMenuFlags = nFlags; }
- USHORT GetMenuFlags() const { return nMenuFlags; }
+ void SetMenuFlags( sal_uInt16 nFlags ) { nMenuFlags = nFlags; }
+ sal_uInt16 GetMenuFlags() const { return nMenuFlags; }
- USHORT GetItemCount() const;
- USHORT GetItemId( USHORT nPos ) const;
- USHORT GetItemPos( USHORT nItemId ) const;
- MenuItemType GetItemType( USHORT nPos ) const;
- USHORT GetCurItemId() const;
+ sal_uInt16 GetItemCount() const;
+ sal_uInt16 GetItemId( sal_uInt16 nPos ) const;
+ sal_uInt16 GetItemPos( sal_uInt16 nItemId ) const;
+ MenuItemType GetItemType( sal_uInt16 nPos ) const;
+ sal_uInt16 GetCurItemId() const;
- void SetDefaultItem( USHORT nItemId ) { nDefaultItem = nItemId; }
- USHORT GetDefaultItem() const { return nDefaultItem; }
+ void SetDefaultItem( sal_uInt16 nItemId ) { nDefaultItem = nItemId; }
+ sal_uInt16 GetDefaultItem() const { return nDefaultItem; }
- void SetItemBits( USHORT nItemId, MenuItemBits nBits );
- MenuItemBits GetItemBits( USHORT nItemId ) const;
+ void SetItemBits( sal_uInt16 nItemId, MenuItemBits nBits );
+ MenuItemBits GetItemBits( sal_uInt16 nItemId ) const;
- void SetUserValue( USHORT nItemId, ULONG nValue );
- ULONG GetUserValue( USHORT nItemId ) const;
+ void SetUserValue( sal_uInt16 nItemId, sal_uLong nValue );
+ sal_uLong GetUserValue( sal_uInt16 nItemId ) const;
- void SetPopupMenu( USHORT nItemId, PopupMenu* pMenu );
- PopupMenu* GetPopupMenu( USHORT nItemId ) const;
+ void SetPopupMenu( sal_uInt16 nItemId, PopupMenu* pMenu );
+ PopupMenu* GetPopupMenu( sal_uInt16 nItemId ) const;
- void SetAccelKey( USHORT nItemId, const KeyCode& rKeyCode );
- KeyCode GetAccelKey( USHORT nItemId ) const;
+ void SetAccelKey( sal_uInt16 nItemId, const KeyCode& rKeyCode );
+ KeyCode GetAccelKey( sal_uInt16 nItemId ) const;
- void CheckItem( USHORT nItemId, BOOL bCheck = TRUE );
- BOOL IsItemChecked( USHORT nItemId ) const;
+ void CheckItem( sal_uInt16 nItemId, sal_Bool bCheck = sal_True );
+ sal_Bool IsItemChecked( sal_uInt16 nItemId ) const;
- void SelectItem( USHORT nItemId );
+ void SelectItem( sal_uInt16 nItemId );
void DeSelect() { SelectItem( 0xFFFF ); } // MENUITEMPOS_INVALID
- void EnableItem( USHORT nItemId, BOOL bEnable = TRUE );
- BOOL IsItemEnabled( USHORT nItemId ) const;
+ void EnableItem( sal_uInt16 nItemId, sal_Bool bEnable = sal_True );
+ sal_Bool IsItemEnabled( sal_uInt16 nItemId ) const;
- void ShowItem( USHORT nItemId, BOOL bVisible = TRUE );
- void HideItem( USHORT nItemId ) { ShowItem( nItemId, FALSE ); }
+ void ShowItem( sal_uInt16 nItemId, sal_Bool bVisible = sal_True );
+ void HideItem( sal_uInt16 nItemId ) { ShowItem( nItemId, sal_False ); }
- BOOL IsItemVisible( USHORT nItemId ) const;
- BOOL IsItemPosVisible( USHORT nItemPos ) const;
- BOOL IsMenuVisible() const;
- BOOL IsMenuBar() const { return bIsMenuBar; }
+ sal_Bool IsItemVisible( sal_uInt16 nItemId ) const;
+ sal_Bool IsItemPosVisible( sal_uInt16 nItemPos ) const;
+ sal_Bool IsMenuVisible() const;
+ sal_Bool IsMenuBar() const { return bIsMenuBar; }
- void RemoveDisabledEntries( BOOL bCheckPopups = TRUE, BOOL bRemoveEmptyPopups = FALSE );
- BOOL HasValidEntries( BOOL bCheckPopups = TRUE );
+ void RemoveDisabledEntries( sal_Bool bCheckPopups = sal_True, sal_Bool bRemoveEmptyPopups = sal_False );
+ sal_Bool HasValidEntries( sal_Bool bCheckPopups = sal_True );
- void SetItemText( USHORT nItemId, const XubString& rStr );
- XubString GetItemText( USHORT nItemId ) const;
+ void SetItemText( sal_uInt16 nItemId, const XubString& rStr );
+ XubString GetItemText( sal_uInt16 nItemId ) const;
- void SetItemImage( USHORT nItemId, const Image& rImage );
- Image GetItemImage( USHORT nItemId ) const;
- void SetItemImageAngle( USHORT nItemId, long nAngle10 );
- long GetItemImageAngle( USHORT nItemId ) const;
- void SetItemImageMirrorMode( USHORT nItemId, BOOL bMirror );
- BOOL GetItemImageMirrorMode( USHORT ) const;
+ void SetItemImage( sal_uInt16 nItemId, const Image& rImage );
+ Image GetItemImage( sal_uInt16 nItemId ) const;
+ void SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 );
+ long GetItemImageAngle( sal_uInt16 nItemId ) const;
+ void SetItemImageMirrorMode( sal_uInt16 nItemId, sal_Bool bMirror );
+ sal_Bool GetItemImageMirrorMode( sal_uInt16 ) const;
- void SetItemCommand( USHORT nItemId, const XubString& rCommand );
- const XubString& GetItemCommand( USHORT nItemId ) const;
+ void SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand );
+ const XubString& GetItemCommand( sal_uInt16 nItemId ) const;
- void SetHelpText( USHORT nItemId, const XubString& rString );
- const XubString& GetHelpText( USHORT nItemId ) const;
+ void SetHelpText( sal_uInt16 nItemId, const XubString& rString );
+ const XubString& GetHelpText( sal_uInt16 nItemId ) const;
- void SetTipHelpText( USHORT nItemId, const XubString& rString );
- const XubString& GetTipHelpText( USHORT nItemId ) const;
+ void SetTipHelpText( sal_uInt16 nItemId, const XubString& rString );
+ const XubString& GetTipHelpText( sal_uInt16 nItemId ) const;
- void SetHelpCommand( USHORT nItemId, const XubString& rString );
- const XubString& GetHelpCommand( USHORT nItemId ) const;
+ void SetHelpCommand( sal_uInt16 nItemId, const XubString& rString );
+ const XubString& GetHelpCommand( sal_uInt16 nItemId ) const;
- void SetHelpId( USHORT nItemId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nItemId ) const;
+ void SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId );
+ rtl::OString GetHelpId( sal_uInt16 nItemId ) const;
void SetActivateHdl( const Link& rLink ) { aActivateHdl = rLink; }
const Link& GetActivateHdl() const { return aActivateHdl; }
@@ -322,7 +322,7 @@ public:
void SetLogo( const MenuLogo& rLogo );
void SetLogo();
- BOOL HasLogo() const { return pLogo ? TRUE : FALSE; }
+ sal_Bool HasLogo() const { return pLogo ? sal_True : sal_False; }
MenuLogo GetLogo() const;
void AddEventListener( const Link& rEventListener );
@@ -337,7 +337,7 @@ public:
// returns the system's menu handle if native menues are supported
// pData must point to a SystemMenuData structure
- BOOL GetSystemMenuData( SystemMenuData* pData ) const;
+ sal_Bool GetSystemMenuData( SystemMenuData* pData ) const;
// accessibility helpers
@@ -346,41 +346,41 @@ public:
// returns the bounding box for the character at index nIndex
// where nIndex is relative to the starting index of the item
// with id nItemId (in coordinates of the displaying window)
- Rectangle GetCharacterBounds( USHORT nItemId, long nIndex ) const;
+ Rectangle GetCharacterBounds( sal_uInt16 nItemId, long nIndex ) const;
// -1 is returned if no character is at that point
// if an index is found the corresponding item id is filled in (else 0)
- long GetIndexForPoint( const Point& rPoint, USHORT& rItemID ) const;
+ long GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const;
// returns the number of lines in the result of GetDisplayText()
long GetLineCount() const;
// returns the interval [start,end] of line nLine
// returns [-1,-1] for an invalid line
Pair GetLineStartEnd( long nLine ) const;
// like GetLineStartEnd but first finds the line number for the item
- Pair GetItemStartEnd( USHORT nItemId ) const;
+ Pair GetItemStartEnd( sal_uInt16 nItemId ) const;
// returns the item id for line nLine or 0 if nLine is invalid
- USHORT GetDisplayItemId( long nLine ) const;
+ sal_uInt16 GetDisplayItemId( long nLine ) const;
// returns the bounding rectangle for an item at pos nItemPos
- Rectangle GetBoundingRectangle( USHORT nItemPos ) const;
- BOOL ConvertPoint( Point& rPoint, Window* pReferenceWindow ) const;
+ Rectangle GetBoundingRectangle( sal_uInt16 nItemPos ) const;
+ sal_Bool ConvertPoint( Point& rPoint, Window* pReferenceWindow ) const;
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetAccessible();
void SetAccessible( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible );
// gets the activation key of the specified item
- KeyEvent GetActivationKey( USHORT nItemId ) const;
+ KeyEvent GetActivationKey( sal_uInt16 nItemId ) const;
Window* GetWindow() const { return pWindow; }
- void SetAccessibleName( USHORT nItemId, const XubString& rStr );
- XubString GetAccessibleName( USHORT nItemId ) const;
+ void SetAccessibleName( sal_uInt16 nItemId, const XubString& rStr );
+ XubString GetAccessibleName( sal_uInt16 nItemId ) const;
- void SetAccessibleDescription( USHORT nItemId, const XubString& rStr );
- XubString GetAccessibleDescription( USHORT nItemId ) const;
+ void SetAccessibleDescription( sal_uInt16 nItemId, const XubString& rStr );
+ XubString GetAccessibleDescription( sal_uInt16 nItemId ) const;
// returns whether the item a position nItemPos is highlighted or not.
- bool IsHighlighted( USHORT nItemPos ) const;
+ bool IsHighlighted( sal_uInt16 nItemPos ) const;
- void HighlightItem( USHORT nItemPos );
+ void HighlightItem( sal_uInt16 nItemPos );
void DeHighlight() { HighlightItem( 0xFFFF ); } // MENUITEMPOS_INVALID
@@ -396,10 +396,10 @@ class VCL_DLLPUBLIC MenuBar : public Menu
Link maCloserHdl;
Link maFloatHdl;
Link maHideHdl;
- BOOL mbCloserVisible;
- BOOL mbFloatBtnVisible;
- BOOL mbHideBtnVisible;
- BOOL mbDisplayable;
+ sal_Bool mbCloserVisible;
+ sal_Bool mbFloatBtnVisible;
+ sal_Bool mbHideBtnVisible;
+ sal_Bool mbDisplayable;
friend class Application;
friend class Menu;
@@ -408,8 +408,8 @@ class VCL_DLLPUBLIC MenuBar : public Menu
friend class SystemWindow;
SAL_DLLPRIVATE static Window* ImplCreate( Window* pParent, Window* pWindow, MenuBar* pMenu );
- SAL_DLLPRIVATE static void ImplDestroy( MenuBar* pMenu, BOOL bDelete );
- SAL_DLLPRIVATE BOOL ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu = TRUE );
+ SAL_DLLPRIVATE static void ImplDestroy( MenuBar* pMenu, sal_Bool bDelete );
+ SAL_DLLPRIVATE sal_Bool ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bFromMenu = sal_True );
public:
MenuBar();
@@ -419,20 +419,20 @@ public:
MenuBar& operator =( const MenuBar& rMenu );
- void ShowCloser( BOOL bShow = TRUE );
- BOOL HasCloser() const { return mbCloserVisible; }
- void ShowFloatButton( BOOL bShow = TRUE );
- BOOL HasFloatButton() const { return mbFloatBtnVisible; }
- void ShowHideButton( BOOL bShow = TRUE );
- BOOL HasHideButton() const { return mbHideBtnVisible; }
- void ShowButtons( BOOL bClose, BOOL bFloat, BOOL bHide );
-
- void SelectEntry( USHORT nId );
- BOOL HandleMenuActivateEvent( Menu *pMenu ) const;
- BOOL HandleMenuDeActivateEvent( Menu *pMenu ) const;
- BOOL HandleMenuHighlightEvent( Menu *pMenu, USHORT nEventId ) const;
- BOOL HandleMenuCommandEvent( Menu *pMenu, USHORT nEventId ) const;
- BOOL HandleMenuButtonEvent( Menu *pMenu, USHORT nEventId ) const;
+ void ShowCloser( sal_Bool bShow = sal_True );
+ sal_Bool HasCloser() const { return mbCloserVisible; }
+ void ShowFloatButton( sal_Bool bShow = sal_True );
+ sal_Bool HasFloatButton() const { return mbFloatBtnVisible; }
+ void ShowHideButton( sal_Bool bShow = sal_True );
+ sal_Bool HasHideButton() const { return mbHideBtnVisible; }
+ void ShowButtons( sal_Bool bClose, sal_Bool bFloat, sal_Bool bHide );
+
+ void SelectEntry( sal_uInt16 nId );
+ sal_Bool HandleMenuActivateEvent( Menu *pMenu ) const;
+ sal_Bool HandleMenuDeActivateEvent( Menu *pMenu ) const;
+ sal_Bool HandleMenuHighlightEvent( Menu *pMenu, sal_uInt16 nEventId ) const;
+ sal_Bool HandleMenuCommandEvent( Menu *pMenu, sal_uInt16 nEventId ) const;
+ sal_Bool HandleMenuButtonEvent( Menu *pMenu, sal_uInt16 nEventId ) const;
void SetCloserHdl( const Link& rLink ) { maCloserHdl = rLink; }
const Link& GetCloserHdl() const { return maCloserHdl; }
@@ -445,31 +445,31 @@ public:
// - if a menubar is not displayable, its MenuBarWindow will never be shown
// and it will be hidden if it was visible before
// - note: if a menubar is diplayable, this does not necessarily mean that it is currently visible
- void SetDisplayable( BOOL bDisplayable );
- BOOL IsDisplayable() const { return mbDisplayable; }
+ void SetDisplayable( sal_Bool bDisplayable );
+ sal_Bool IsDisplayable() const { return mbDisplayable; }
struct MenuBarButtonCallbackArg
{
- USHORT nId; // Id of the button
+ sal_uInt16 nId; // Id of the button
bool bHighlight; // highlight on/off
MenuBar* pMenuBar; // menubar the button belongs to
};
// add an arbitrary button to the menubar (will appear next to closer)
// passed link will be call with a MenuBarButtonCallbackArg on press
- USHORT AddMenuBarButton( const Image&, const Link&, USHORT nPos = 0 );
+ sal_uInt16 AddMenuBarButton( const Image&, const Link&, sal_uInt16 nPos = 0 );
// add an arbitrary button to the menubar (will appear next to closer)
// passed link will be call with a MenuBarButtonCallbackArg on press
// passed string will be set as tooltip
- USHORT AddMenuBarButton( const Image&, const Link&, const String&, USHORT nPos = 0 );
+ sal_uInt16 AddMenuBarButton( const Image&, const Link&, const String&, sal_uInt16 nPos = 0 );
// set the highlight link for additional button with ID nId
// highlight link will be called with a MenuBarButtonHighlightArg
// the bHighlight member of that struct shall contain the new state
- void SetMenuBarButtonHighlightHdl( USHORT nId, const Link& );
+ void SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link& );
// returns the rectangle occupied by the additional button named nId
// coordinates are relative to the systemwindiow the menubar is attached to
// if the menubar is unattached an empty rectangle is returned
- Rectangle GetMenuBarButtonRectPixel( USHORT nId );
- void RemoveMenuBarButton( USHORT nId );
+ Rectangle GetMenuBarButtonRectPixel( sal_uInt16 nId );
+ void RemoveMenuBarButton( sal_uInt16 nId );
};
inline MenuBar& MenuBar::operator =( const MenuBar& rMenu )
@@ -496,9 +496,9 @@ private:
SAL_DLLPRIVATE MenuFloatingWindow* ImplGetFloatingWindow() const { return (MenuFloatingWindow*)Menu::ImplGetWindow(); }
protected:
- SAL_DLLPRIVATE USHORT ImplExecute( Window* pWindow, const Rectangle& rRect, ULONG nPopupFlags, Menu* pStaredFrom, BOOL bPreSelectFirst );
- SAL_DLLPRIVATE long ImplCalcHeight( USHORT nEntries ) const;
- SAL_DLLPRIVATE USHORT ImplCalcVisEntries( long nMaxHeight, USHORT nStartEntry = 0, USHORT* pLastVisible = NULL ) const;
+ SAL_DLLPRIVATE sal_uInt16 ImplExecute( Window* pWindow, const Rectangle& rRect, sal_uLong nPopupFlags, Menu* pStaredFrom, sal_Bool bPreSelectFirst );
+ SAL_DLLPRIVATE long ImplCalcHeight( sal_uInt16 nEntries ) const;
+ SAL_DLLPRIVATE sal_uInt16 ImplCalcVisEntries( long nMaxHeight, sal_uInt16 nStartEntry = 0, sal_uInt16* pLastVisible = NULL ) const;
public:
PopupMenu();
@@ -509,15 +509,15 @@ public:
void SetText( const XubString& rTitle ) { aTitleText = rTitle; }
const XubString& GetText() const { return aTitleText; }
- USHORT Execute( Window* pWindow, const Point& rPopupPos );
- USHORT Execute( Window* pWindow, const Rectangle& rRect, USHORT nFlags = 0 );
+ sal_uInt16 Execute( Window* pWindow, const Point& rPopupPos );
+ sal_uInt16 Execute( Window* pWindow, const Rectangle& rRect, sal_uInt16 nFlags = 0 );
// Fuer das TestTool
- void EndExecute( USHORT nSelect = 0 );
- void SelectEntry( USHORT nId );
- void SetSelectedEntry( USHORT nId ); // for use by native submenu only
+ void EndExecute( sal_uInt16 nSelect = 0 );
+ void SelectEntry( sal_uInt16 nId );
+ void SetSelectedEntry( sal_uInt16 nId ); // for use by native submenu only
- static BOOL IsInExecute();
+ static sal_Bool IsInExecute();
static PopupMenu* GetActivePopupMenu();
PopupMenu& operator =( const PopupMenu& rMenu );
diff --git a/vcl/inc/vcl/menubtn.hxx b/vcl/inc/vcl/menubtn.hxx
index 588bdd4772cd..1e65504b97bc 100644
--- a/vcl/inc/vcl/menubtn.hxx
+++ b/vcl/inc/vcl/menubtn.hxx
@@ -40,7 +40,7 @@ class PopupMenu;
// - MenuButton-Types -
// --------------------
-#define MENUBUTTON_MENUMODE_TIMED ((USHORT)0x0001)
+#define MENUBUTTON_MENUMODE_TIMED ((sal_uInt16)0x0001)
// --------------
// - MenuButton -
@@ -53,8 +53,8 @@ private:
Timer* mpMenuTimer;
PopupMenu* mpOwnMenu;
PopupMenu* mpMenu;
- USHORT mnCurItemId;
- USHORT mnMenuMode;
+ sal_uInt16 mnCurItemId;
+ sal_uInt16 mnMenuMode;
Link maActivateHdl;
Link maSelectHdl;
@@ -82,13 +82,13 @@ public:
virtual void Activate();
virtual void Select();
- void SetMenuMode( USHORT nMode );
- USHORT GetMenuMode() const { return mnMenuMode; }
+ void SetMenuMode( sal_uInt16 nMode );
+ sal_uInt16 GetMenuMode() const { return mnMenuMode; }
void SetPopupMenu( PopupMenu* pNewMenu );
PopupMenu* GetPopupMenu() const { return mpMenu; }
- USHORT GetCurItemId() const { return mnCurItemId; }
+ sal_uInt16 GetCurItemId() const { return mnCurItemId; }
void SetActivateHdl( const Link& rLink ) { maActivateHdl = rLink; }
const Link& GetActivateHdl() const { return maActivateHdl; }
diff --git a/vcl/inc/vcl/metaact.hxx b/vcl/inc/vcl/metaact.hxx
index f507063982bb..fd8f3b8e985b 100644
--- a/vcl/inc/vcl/metaact.hxx
+++ b/vcl/inc/vcl/metaact.hxx
@@ -144,8 +144,8 @@ Meta##Name##Action::~Meta##Name##Action() {}
class VCL_DLLPUBLIC MetaAction
{
private:
- ULONG mnRefCount;
- UINT16 mnType;
+ sal_uLong mnRefCount;
+ sal_uInt16 mnType;
virtual sal_Bool Compare( const MetaAction& ) const;
@@ -154,7 +154,7 @@ protected:
public:
MetaAction();
- MetaAction( USHORT nType );
+ MetaAction( sal_uInt16 nType );
virtual void Execute( OutputDevice* pOut );
@@ -168,8 +168,8 @@ public:
sal_Bool IsEqual( const MetaAction& ) const;
- USHORT GetType() const { return mnType; }
- ULONG GetRefCount() const { return mnRefCount; }
+ sal_uInt16 GetType() const { return mnType; }
+ sal_uLong GetRefCount() const { return mnRefCount; }
void ResetRefCount() { mnRefCount = 1; }
void Duplicate() { mnRefCount++; }
void Delete() { if ( 0 == --mnRefCount ) delete this; }
@@ -492,8 +492,8 @@ private:
Point maPt;
XubString maStr;
- USHORT mnIndex;
- USHORT mnLen;
+ sal_uInt16 mnIndex;
+ sal_uInt16 mnLen;
virtual sal_Bool Compare( const MetaAction& ) const;
@@ -501,15 +501,15 @@ public:
DECL_META_ACTION( Text, META_TEXT_ACTION )
MetaTextAction( const Point& rPt, const XubString& rStr,
- USHORT nIndex, USHORT nLen );
+ sal_uInt16 nIndex, sal_uInt16 nLen );
virtual void Move( long nHorzMove, long nVertMove );
virtual void Scale( double fScaleX, double fScaleY );
const Point& GetPoint() const { return maPt; }
const XubString& GetText() const { return maStr; }
- USHORT GetIndex() const { return mnIndex; }
- USHORT GetLen() const { return mnLen; }
+ sal_uInt16 GetIndex() const { return mnIndex; }
+ sal_uInt16 GetLen() const { return mnLen; }
};
// -----------------------
@@ -523,8 +523,8 @@ private:
Point maStartPt;
XubString maStr;
sal_Int32* mpDXAry;
- USHORT mnIndex;
- USHORT mnLen;
+ sal_uInt16 mnIndex;
+ sal_uInt16 mnLen;
virtual sal_Bool Compare( const MetaAction& ) const;
@@ -537,8 +537,8 @@ public:
MetaTextArrayAction( const Point& rStartPt,
const XubString& rStr,
const sal_Int32* pDXAry,
- USHORT nIndex,
- USHORT nLen );
+ sal_uInt16 nIndex,
+ sal_uInt16 nLen );
virtual void Execute( OutputDevice* pOut );
@@ -552,8 +552,8 @@ public:
const Point& GetPoint() const { return maStartPt; }
const XubString& GetText() const { return maStr; }
- USHORT GetIndex() const { return mnIndex; }
- USHORT GetLen() const { return mnLen; }
+ sal_uInt16 GetIndex() const { return mnIndex; }
+ sal_uInt16 GetLen() const { return mnLen; }
sal_Int32* GetDXArray() const { return mpDXAry; }
};
@@ -568,8 +568,8 @@ private:
Point maPt;
XubString maStr;
sal_uInt32 mnWidth;
- USHORT mnIndex;
- USHORT mnLen;
+ sal_uInt16 mnIndex;
+ sal_uInt16 mnLen;
virtual sal_Bool Compare( const MetaAction& ) const;
@@ -578,7 +578,7 @@ public:
MetaStretchTextAction( const Point& rPt, sal_uInt32 nWidth,
const XubString& rStr,
- USHORT nIndex, USHORT nLen );
+ sal_uInt16 nIndex, sal_uInt16 nLen );
virtual void Move( long nHorzMove, long nVertMove );
virtual void Scale( double fScaleX, double fScaleY );
@@ -586,8 +586,8 @@ public:
const Point& GetPoint() const { return maPt; }
const XubString& GetText() const { return maStr; }
sal_uInt32 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; }
};
// ----------------------
@@ -600,7 +600,7 @@ private:
Rectangle maRect;
XubString maStr;
- USHORT mnStyle;
+ sal_uInt16 mnStyle;
virtual sal_Bool Compare( const MetaAction& ) const;
@@ -608,14 +608,14 @@ public:
DECL_META_ACTION( TextRect, META_TEXTRECT_ACTION )
MetaTextRectAction( const Rectangle& rRect,
- const XubString& rStr, USHORT nStyle );
+ const XubString& rStr, sal_uInt16 nStyle );
virtual void Move( long nHorzMove, long nVertMove );
virtual void Scale( double fScaleX, double fScaleY );
const Rectangle& GetRect() const { return maRect; }
const XubString& GetText() const { return maStr; }
- USHORT GetStyle() const { return mnStyle; }
+ sal_uInt16 GetStyle() const { return mnStyle; }
};
// ----------------------
@@ -1029,20 +1029,20 @@ class VCL_DLLPUBLIC MetaClipRegionAction : public MetaAction
private:
Region maRegion;
- BOOL mbClip;
+ sal_Bool mbClip;
virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( ClipRegion, META_CLIPREGION_ACTION )
- MetaClipRegionAction( const Region& rRegion, BOOL bClip );
+ MetaClipRegionAction( const Region& rRegion, sal_Bool bClip );
virtual void Move( long nHorzMove, long nVertMove );
virtual void Scale( double fScaleX, double fScaleY );
const Region& GetRegion() const { return maRegion; }
- BOOL IsClipping() const { return mbClip; }
+ sal_Bool IsClipping() const { return mbClip; }
};
// ---------------------------------
@@ -1124,17 +1124,17 @@ class VCL_DLLPUBLIC MetaLineColorAction : public MetaAction
private:
Color maColor;
- BOOL mbSet;
+ sal_Bool mbSet;
virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( LineColor, META_LINECOLOR_ACTION )
- MetaLineColorAction( const Color& rColor, BOOL bSet );
+ MetaLineColorAction( const Color& rColor, sal_Bool bSet );
const Color& GetColor() const { return maColor; }
- BOOL IsSetting() const { return mbSet; }
+ sal_Bool IsSetting() const { return mbSet; }
};
// -----------------------
@@ -1146,17 +1146,17 @@ class VCL_DLLPUBLIC MetaFillColorAction : public MetaAction
private:
Color maColor;
- BOOL mbSet;
+ sal_Bool mbSet;
virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( FillColor, META_FILLCOLOR_ACTION )
- MetaFillColorAction( const Color& rColor, BOOL bSet );
+ MetaFillColorAction( const Color& rColor, sal_Bool bSet );
const Color& GetColor() const { return maColor; }
- BOOL IsSetting() const { return mbSet; }
+ sal_Bool IsSetting() const { return mbSet; }
};
// -----------------------
@@ -1188,17 +1188,17 @@ class VCL_DLLPUBLIC MetaTextFillColorAction : public MetaAction
private:
Color maColor;
- BOOL mbSet;
+ sal_Bool mbSet;
virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( TextFillColor, META_TEXTFILLCOLOR_ACTION )
- MetaTextFillColorAction( const Color& rColor, BOOL bSet );
+ MetaTextFillColorAction( const Color& rColor, sal_Bool bSet );
const Color& GetColor() const { return maColor; }
- BOOL IsSetting() const { return mbSet; }
+ sal_Bool IsSetting() const { return mbSet; }
};
// ---------------------------
@@ -1210,17 +1210,17 @@ class VCL_DLLPUBLIC MetaTextLineColorAction : public MetaAction
private:
Color maColor;
- BOOL mbSet;
+ sal_Bool mbSet;
virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( TextLineColor, META_TEXTLINECOLOR_ACTION )
- MetaTextLineColorAction( const Color& rColor, BOOL bSet );
+ MetaTextLineColorAction( const Color& rColor, sal_Bool bSet );
const Color& GetColor() const { return maColor; }
- BOOL IsSetting() const { return mbSet; }
+ sal_Bool IsSetting() const { return mbSet; }
};
// ---------------------------
@@ -1232,17 +1232,17 @@ class VCL_DLLPUBLIC MetaOverlineColorAction : public MetaAction
private:
Color maColor;
- BOOL mbSet;
+ sal_Bool mbSet;
virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( OverlineColor, META_OVERLINECOLOR_ACTION )
- MetaOverlineColorAction( const Color& rColor, BOOL bSet );
+ MetaOverlineColorAction( const Color& rColor, sal_Bool bSet );
const Color& GetColor() const { return maColor; }
- BOOL IsSetting() const { return mbSet; }
+ sal_Bool IsSetting() const { return mbSet; }
};
// -----------------------
@@ -1317,16 +1317,16 @@ class VCL_DLLPUBLIC MetaPushAction : public MetaAction
{
private:
- USHORT mnFlags;
+ sal_uInt16 mnFlags;
virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( Push, META_PUSH_ACTION )
- MetaPushAction( USHORT nFlags );
+ MetaPushAction( sal_uInt16 nFlags );
- USHORT GetFlags() const { return mnFlags; }
+ sal_uInt16 GetFlags() const { return mnFlags; }
};
// -----------------
@@ -1369,20 +1369,20 @@ class VCL_DLLPUBLIC MetaTransparentAction : public MetaAction
private:
PolyPolygon maPolyPoly;
- USHORT mnTransPercent;
+ sal_uInt16 mnTransPercent;
virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( Transparent, META_TRANSPARENT_ACTION )
- MetaTransparentAction( const PolyPolygon& rPolyPoly, USHORT nTransPercent );
+ MetaTransparentAction( const PolyPolygon& rPolyPoly, sal_uInt16 nTransPercent );
virtual void Move( long nHorzMove, long nVertMove );
virtual void Scale( double fScaleX, double fScaleY );
const PolyPolygon& GetPolyPolygon() const { return maPolyPoly; }
- USHORT GetTransparence() const { return mnTransPercent; }
+ sal_uInt16 GetTransparence() const { return mnTransPercent; }
};
// ------------------------------
@@ -1454,17 +1454,17 @@ class VCL_DLLPUBLIC MetaRefPointAction : public MetaAction
private:
Point maRefPoint;
- BOOL mbSet;
+ sal_Bool mbSet;
virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( RefPoint, META_REFPOINT_ACTION )
- MetaRefPointAction( const Point& rRefPoint, BOOL bSet );
+ MetaRefPointAction( const Point& rRefPoint, sal_Bool bSet );
const Point& GetRefPoint() const { return maRefPoint; }
- BOOL IsSetting() const { return mbSet; }
+ sal_Bool IsSetting() const { return mbSet; }
};
// ---------------------
@@ -1478,9 +1478,9 @@ private:
ByteString maComment;
sal_Int32 mnValue;
sal_uInt32 mnDataSize;
- BYTE* mpData;
+ sal_uInt8* mpData;
- SAL_DLLPRIVATE void ImplInitDynamicData( const BYTE* pData, sal_uInt32 nDataSize );
+ SAL_DLLPRIVATE void ImplInitDynamicData( const sal_uInt8* pData, sal_uInt32 nDataSize );
virtual sal_Bool Compare( const MetaAction& ) const;
protected:
@@ -1489,8 +1489,8 @@ protected:
public:
MetaCommentAction( sal_Int32 nValue = 0L );
MetaCommentAction( const MetaCommentAction& rAct );
- MetaCommentAction( const ByteString& rComment, sal_Int32 nValue = 0L, const BYTE* pData = NULL, sal_uInt32 nDataSize = 0UL );
- MetaCommentAction( const BYTE* pData, sal_uInt32 nDataSize );
+ MetaCommentAction( const ByteString& rComment, sal_Int32 nValue = 0L, const sal_uInt8* pData = NULL, sal_uInt32 nDataSize = 0UL );
+ MetaCommentAction( const sal_uInt8* pData, sal_uInt32 nDataSize );
virtual void Move( long nHorzMove, long nVertMove );
virtual void Scale( double fScaleX, double fScaleY );
@@ -1503,7 +1503,7 @@ public:
const ByteString& GetComment() const { return maComment; }
sal_Int32 GetValue() const { return mnValue; }
sal_uInt32 GetDataSize() const { return mnDataSize; }
- const BYTE* GetData() const { return mpData; }
+ const sal_uInt8* GetData() const { return mpData; }
};
// ------------------------
diff --git a/vcl/inc/vcl/metric.hxx b/vcl/inc/vcl/metric.hxx
index 41cb707ffd62..677135b99990 100644
--- a/vcl/inc/vcl/metric.hxx
+++ b/vcl/inc/vcl/metric.hxx
@@ -54,14 +54,14 @@ public:
~FontInfo();
FontType GetType() const;
- BOOL IsDeviceFont() const;
- BOOL SupportsLatin() const;
- BOOL SupportsCJK() const;
- BOOL SupportsCTL() const;
+ sal_Bool IsDeviceFont() const;
+ sal_Bool SupportsLatin() const;
+ sal_Bool SupportsCJK() const;
+ sal_Bool SupportsCTL() const;
FontInfo& operator=( const FontInfo& );
- BOOL operator==( const FontInfo& ) const;
- BOOL operator!=( const FontInfo& rInfo ) const
+ sal_Bool operator==( const FontInfo& ) const;
+ sal_Bool operator!=( const FontInfo& rInfo ) const
{ return !operator==( rInfo ); }
};
@@ -84,8 +84,8 @@ public:
long GetSlant() const;
FontMetric& operator=( const FontMetric& rMetric );
- BOOL operator==( const FontMetric& rMetric ) const;
- BOOL operator!=( const FontMetric& rMetric ) const
+ sal_Bool operator==( const FontMetric& rMetric ) const;
+ sal_Bool operator!=( const FontMetric& rMetric ) const
{ return !operator==( rMetric ); }
};
@@ -96,14 +96,14 @@ public:
class VCL_DLLPUBLIC FontCharMap
{
private:
- ImplFontCharMap* mpImpl;
+ const ImplFontCharMap* mpImpl;
public:
FontCharMap();
~FontCharMap();
- BOOL IsDefaultMap() const;
- BOOL HasChar( sal_uInt32 ) const;
+ sal_Bool IsDefaultMap() const;
+ sal_Bool HasChar( sal_uInt32 ) const;
int CountCharsInRange( sal_uInt32 cMin, sal_uInt32 cMax ) const;
int GetCharCount() const;
@@ -119,7 +119,7 @@ public:
private:
friend class OutputDevice;
- void Reset( ImplFontCharMap* pNewMap = NULL );
+ void Reset( const ImplFontCharMap* pNewMap = NULL );
// prevent assignment and copy construction
FontCharMap( const FontCharMap& );
@@ -136,21 +136,21 @@ class VCL_DLLPUBLIC TextRectInfo
private:
long mnMaxWidth;
- USHORT mnLineCount;
- BOOL mbEllipsis;
+ sal_uInt16 mnLineCount;
+ sal_Bool mbEllipsis;
public:
TextRectInfo();
- USHORT GetLineCount() const { return mnLineCount; }
+ sal_uInt16 GetLineCount() const { return mnLineCount; }
long GetMaxLineWidth() const { return mnMaxWidth; }
- BOOL IsEllipses() const { return mbEllipsis; }
+ sal_Bool IsEllipses() const { return mbEllipsis; }
- BOOL operator ==( const TextRectInfo& rInfo ) const
+ sal_Bool operator ==( const TextRectInfo& rInfo ) const
{ return ((mnMaxWidth == rInfo.mnMaxWidth) &&
(mnLineCount == rInfo.mnLineCount) &&
(mbEllipsis == rInfo.mbEllipsis)); }
- BOOL operator !=( const TextRectInfo& rInfo ) const
+ sal_Bool operator !=( const TextRectInfo& rInfo ) const
{ return !(TextRectInfo::operator==( rInfo )); }
};
@@ -158,7 +158,7 @@ inline TextRectInfo::TextRectInfo()
{
mnMaxWidth = 0;
mnLineCount = 0;
- mbEllipsis = FALSE;
+ mbEllipsis = sal_False;
}
#endif // _SV_METRIC_HXX
diff --git a/vcl/inc/vcl/mnemonic.hxx b/vcl/inc/vcl/mnemonic.hxx
index 801ba7d26190..1a0aac80a4a4 100644
--- a/vcl/inc/vcl/mnemonic.hxx
+++ b/vcl/inc/vcl/mnemonic.hxx
@@ -58,7 +58,7 @@
(MNEMONIC_RANGE_4_END-MNEMONIC_RANGE_4_START+1))
#define MNEMONIC_CHAR ((sal_Unicode)'~')
-#define MNEMONIC_INDEX_NOTFOUND ((USHORT)0xFFFF)
+#define MNEMONIC_INDEX_NOTFOUND ((sal_uInt16)0xFFFF)
// -------------------------
// - MnemonicGenerator -
@@ -68,18 +68,18 @@ class VCL_DLLPUBLIC MnemonicGenerator
{
private:
// 0 == Mnemonic; >0 == count of characters
- BYTE maMnemonics[MAX_MNEMONICS];
+ sal_uInt8 maMnemonics[MAX_MNEMONICS];
::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCharacterClassification > mxCharClass;
protected:
- SAL_DLLPRIVATE USHORT ImplGetMnemonicIndex( sal_Unicode c );
+ SAL_DLLPRIVATE sal_uInt16 ImplGetMnemonicIndex( sal_Unicode c );
SAL_DLLPRIVATE sal_Unicode ImplFindMnemonic( const XubString& rKey );
public:
MnemonicGenerator();
void RegisterMnemonic( const XubString& rKey );
- BOOL CreateMnemonic( XubString& rKey );
+ sal_Bool CreateMnemonic( XubString& rKey );
::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCharacterClassification > GetCharClass();
// returns a string where all '~'-characters and CJK mnemonics of the form (~A) are completely removed
diff --git a/vcl/inc/vcl/mnemonicengine.hxx b/vcl/inc/vcl/mnemonicengine.hxx
index cf32d7b70626..79f6856cb704 100644
--- a/vcl/inc/vcl/mnemonicengine.hxx
+++ b/vcl/inc/vcl/mnemonicengine.hxx
@@ -60,7 +60,7 @@ namespace vcl
If this value is <NULL/>, searching stops.
*/
- virtual const void* FirstSearchEntry( String& _rEntryText ) = 0;
+ virtual const void* FirstSearchEntry( String& _rEntryText ) const = 0;
/** returns the next list entry for the mnemonic search
@@ -75,7 +75,7 @@ namespace vcl
to <member>FirstSearchEntry</member> (i.e. you cycled
around), then searching stops, too.
*/
- virtual const void* NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) = 0;
+ virtual const void* NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) const = 0;
/** "selects" a given entry.
@@ -118,7 +118,7 @@ namespace vcl
the entry to select. This is the return value of a previous call
to <member>FirstSearchEntry</member> or <member>NextSearchEntry</member>.
*/
- virtual void ExecuteSearchEntry( const void* _pEntry ) = 0;
+ virtual void ExecuteSearchEntry( const void* _pEntry ) const = 0;
};
//====================================================================
diff --git a/vcl/inc/vcl/morebtn.hxx b/vcl/inc/vcl/morebtn.hxx
index fe787d2b1b26..e84798479d7f 100644
--- a/vcl/inc/vcl/morebtn.hxx
+++ b/vcl/inc/vcl/morebtn.hxx
@@ -44,9 +44,9 @@ class VCL_DLLPUBLIC MoreButton : public PushButton
{
private:
ImplMoreButtonData* mpMBData;
- ULONG mnDelta;
+ sal_uLong mnDelta;
MapUnit meUnit;
- BOOL mbState;
+ sal_Bool mbState;
// Copy assignment is forbidden and not implemented.
SAL_DLLPRIVATE MoreButton( const MoreButton & );
@@ -68,15 +68,15 @@ public:
void AddWindow( Window* pWindow );
void RemoveWindow( Window* pWindow );
- void SetDelta( ULONG nNewDelta ) { mnDelta = nNewDelta; }
- ULONG GetDelta() const { return mnDelta; }
+ void SetDelta( sal_uLong nNewDelta ) { mnDelta = nNewDelta; }
+ sal_uLong GetDelta() const { return mnDelta; }
void SetMapUnit( MapUnit eNewUnit = MAP_PIXEL ) { meUnit = eNewUnit; }
MapUnit GetMapUnit() const { return meUnit; }
using PushButton::SetState;
- void SetState( BOOL bNewState = TRUE );
- BOOL GetState() const { return mbState; }
+ void SetState( sal_Bool bNewState = sal_True );
+ sal_Bool GetState() const { return mbState; }
void SetText( const XubString& rNewText );
XubString GetText() const;
@@ -87,7 +87,7 @@ public:
XubString GetLessText() const;
};
-inline void MoreButton::SetState( BOOL bNewState )
+inline void MoreButton::SetState( sal_Bool bNewState )
{
if ( mbState != bNewState )
Click();
diff --git a/vcl/inc/vcl/msgbox.hxx b/vcl/inc/vcl/msgbox.hxx
index 42eaeef2a7e4..326dae5616e3 100644
--- a/vcl/inc/vcl/msgbox.hxx
+++ b/vcl/inc/vcl/msgbox.hxx
@@ -45,8 +45,8 @@ class CheckBox;
// Return-Werte von Execute
//!!! bei Aenderungen \basic\source\runtime\methods.cxx msgbox anpassen
-#define RET_OK TRUE
-#define RET_CANCEL FALSE
+#define RET_OK sal_True
+#define RET_CANCEL sal_False
#define RET_YES 2
#define RET_NO 3
#define RET_RETRY 4
@@ -71,12 +71,12 @@ protected:
FixedImage* mpFixedImage;
XubString maMessText;
Image maImage;
- USHORT mnSoundType;
- BOOL mbHelpBtn;
- BOOL mbSound;
+ sal_uInt16 mnSoundType;
+ sal_Bool mbHelpBtn;
+ sal_Bool mbSound;
CheckBox* mpCheckBox;
XubString maCheckBoxText;
- BOOL mbCheck;
+ sal_Bool mbCheck;
SAL_DLLPRIVATE void ImplInitMessBoxData();
SAL_DLLPRIVATE void ImplInitButtons();
@@ -100,14 +100,14 @@ public:
void SetImage( const Image& rImage ) { maImage = rImage; }
const Image& GetImage() const { return maImage; }
- BOOL SetModeImage( const Image& rImage );
+ sal_Bool SetModeImage( const Image& rImage );
const Image& GetModeImage( ) const;
void SetDefaultCheckBoxText();
void SetCheckBoxText( const XubString& rText ) { maCheckBoxText = rText;}
const XubString& GetCheckBoxText() const { return maCheckBoxText;}
- void SetCheckBoxState( BOOL bCheck );
- BOOL GetCheckBoxState() const;
+ void SetCheckBoxState( sal_Bool bCheck );
+ sal_Bool GetCheckBoxState() const;
virtual Size GetOptimalSize(WindowSizeType eType) const;
};
diff --git a/vcl/inc/vcl/octree.hxx b/vcl/inc/vcl/octree.hxx
index 085ef648f98f..3cef6384a7d6 100644
--- a/vcl/inc/vcl/octree.hxx
+++ b/vcl/inc/vcl/octree.hxx
@@ -45,15 +45,15 @@
typedef struct OctreeNode
{
- ULONG nCount;
- ULONG nRed;
- ULONG nGreen;
- ULONG nBlue;
+ sal_uLong nCount;
+ sal_uLong nRed;
+ sal_uLong nGreen;
+ sal_uLong nBlue;
OctreeNode* pChild[ 8 ];
OctreeNode* pNext;
OctreeNode* pNextInCache;
- USHORT nPalIndex;
- BOOL bLeaf;
+ sal_uInt16 nPalIndex;
+ sal_Bool bLeaf;
} NODE;
typedef NODE* PNODE;
@@ -66,20 +66,20 @@ typedef PNODE* PPNODE;
class ImpNodeCache;
class BitmapReadAccess;
-class VCL_DLLPUBLIC Octree
+class VCL_PLUGIN_PUBLIC Octree
{
private:
BitmapPalette aPal;
- ULONG nMax;
- ULONG nLeafCount;
- ULONG nLevel;
+ sal_uLong nMax;
+ sal_uLong nLeafCount;
+ sal_uLong nLevel;
PNODE pTree;
PNODE pReduce[ OCTREE_BITS + 1 ];
BitmapColor* pColor;
ImpNodeCache* pNodeCache;
const BitmapReadAccess* pAcc;
- USHORT nPalIndex;
+ sal_uInt16 nPalIndex;
Octree() {};
@@ -93,21 +93,21 @@ private:
public:
- Octree( const BitmapReadAccess& rReadAcc, ULONG nColors );
- Octree( ULONG nColors );
+ Octree( const BitmapReadAccess& rReadAcc, sal_uLong nColors );
+ Octree( sal_uLong nColors );
~Octree();
void AddColor( const BitmapColor& rColor );
inline const BitmapPalette& GetPalette();
- inline USHORT GetBestPaletteIndex( const BitmapColor& rColor );
+ inline sal_uInt16 GetBestPaletteIndex( const BitmapColor& rColor );
};
// ------------------------------------------------------------------------
inline const BitmapPalette& Octree::GetPalette()
{
- aPal.SetEntryCount( (USHORT) nLeafCount );
+ aPal.SetEntryCount( (sal_uInt16) nLeafCount );
nPalIndex = 0;
CreatePalette( pTree );
return aPal;
@@ -115,7 +115,7 @@ inline const BitmapPalette& Octree::GetPalette()
// ------------------------------------------------------------------------
-inline USHORT Octree::GetBestPaletteIndex( const BitmapColor& rColor )
+inline sal_uInt16 Octree::GetBestPaletteIndex( const BitmapColor& rColor )
{
pColor = &(BitmapColor&) rColor;
nPalIndex = 65535;
@@ -128,32 +128,32 @@ inline USHORT Octree::GetBestPaletteIndex( const BitmapColor& rColor )
// - InverseColorMap -
// -------------------
-class VCL_DLLPUBLIC InverseColorMap
+class VCL_PLUGIN_PUBLIC InverseColorMap
{
private:
- BYTE* pBuffer;
- BYTE* pMap;
- const ULONG nBits;
+ sal_uInt8* pBuffer;
+ sal_uInt8* pMap;
+ const sal_uLong nBits;
- SAL_DLLPRIVATE void ImplCreateBuffers( const ULONG nMax );
+ SAL_DLLPRIVATE void ImplCreateBuffers( const sal_uLong nMax );
public:
- InverseColorMap( const BitmapPalette& rPal );
+ explicit InverseColorMap( const BitmapPalette& rPal );
~InverseColorMap();
- inline USHORT GetBestPaletteIndex( const BitmapColor& rColor );
+ inline sal_uInt16 GetBestPaletteIndex( const BitmapColor& rColor );
};
// ------------------------------------------------------------------------
-inline USHORT InverseColorMap::GetBestPaletteIndex( const BitmapColor& rColor )
+inline sal_uInt16 InverseColorMap::GetBestPaletteIndex( const BitmapColor& rColor )
{
- return pMap[ ( ( (ULONG) rColor.GetRed() >> nBits ) << OCTREE_BITS_1 ) |
- ( ( (ULONG) rColor.GetGreen() >> nBits ) << OCTREE_BITS ) |
- ( (ULONG) rColor.GetBlue() >> nBits ) ];
+ return pMap[ ( ( (sal_uLong) rColor.GetRed() >> nBits ) << OCTREE_BITS_1 ) |
+ ( ( (sal_uLong) rColor.GetGreen() >> nBits ) << OCTREE_BITS ) |
+ ( (sal_uLong) rColor.GetBlue() >> nBits ) ];
}
#endif // _SV_OCTREE_HXX
diff --git a/vcl/inc/vcl/outdev.h b/vcl/inc/vcl/outdev.h
index 163ca349ed97..fc6bab815c48 100644
--- a/vcl/inc/vcl/outdev.h
+++ b/vcl/inc/vcl/outdev.h
@@ -48,14 +48,14 @@ class GetDevSizeList;
// -----------------------
// flags for mnMatchType member
-#define IMPL_DEVFONT_SCALABLE ((ULONG)0x00000001)
-#define IMPL_DEVFONT_SYMBOL ((ULONG)0x00000002)
-#define IMPL_DEVFONT_NONESYMBOL ((ULONG)0x00000004)
-#define IMPL_DEVFONT_LIGHT ((ULONG)0x00000010)
-#define IMPL_DEVFONT_BOLD ((ULONG)0x00000020)
-#define IMPL_DEVFONT_NORMAL ((ULONG)0x00000040)
-#define IMPL_DEVFONT_NONEITALIC ((ULONG)0x00000100)
-#define IMPL_DEVFONT_ITALIC ((ULONG)0x00000200)
+#define IMPL_DEVFONT_SCALABLE ((sal_uIntPtr)0x00000001)
+#define IMPL_DEVFONT_SYMBOL ((sal_uIntPtr)0x00000002)
+#define IMPL_DEVFONT_NONESYMBOL ((sal_uIntPtr)0x00000004)
+#define IMPL_DEVFONT_LIGHT ((sal_uIntPtr)0x00000010)
+#define IMPL_DEVFONT_BOLD ((sal_uIntPtr)0x00000020)
+#define IMPL_DEVFONT_NORMAL ((sal_uIntPtr)0x00000040)
+#define IMPL_DEVFONT_NONEITALIC ((sal_uIntPtr)0x00000100)
+#define IMPL_DEVFONT_ITALIC ((sal_uIntPtr)0x00000200)
// TODO: rename ImplDevFontListData to PhysicalFontFamily
class ImplDevFontListData
@@ -86,8 +86,8 @@ friend class ImplDevFontList; // TODO: remove soon
String maName; // Fontname (original font family name)
String maSearchName; // normalized font family name
String maMapNames; // fontname aliases
- ULONG mnTypeFaces; // Typeface Flags
- ULONG mnMatchType; // MATCH - Type
+ sal_uIntPtr mnTypeFaces; // Typeface Flags
+ sal_uIntPtr mnMatchType; // MATCH - Type
String maMatchFamilyName; // MATCH - FamilyName
FontWeight meMatchWeight; // MATCH - Weight
FontWidth meMatchWidth; // MATCH - Width
@@ -162,9 +162,9 @@ struct ImplFontSubstEntry
String maReplaceName;
String maSearchName;
String maSearchReplaceName;
- USHORT mnFlags;
+ sal_uInt16 mnFlags;
- ImplFontSubstEntry( const String& rFontName, const String& rSubstFontName, USHORT nSubstFlags );
+ ImplFontSubstEntry( const String& rFontName, const String& rSubstFontName, sal_uInt16 nSubstFlags );
};
class ImplDirectFontSubstitution
@@ -174,14 +174,14 @@ private:
typedef std::list<ImplFontSubstEntry> FontSubstList;
FontSubstList maFontSubstList;
public:
- void AddFontSubstitute( const String& rFontName, const String& rSubstName, USHORT nFlags );
+ void AddFontSubstitute( const String& rFontName, const String& rSubstName, sal_uInt16 nFlags );
void RemoveFontSubstitute( int nIndex );
- bool GetFontSubstitute( int nIndex, String& rFontName, String& rSubstName, USHORT& rFlags ) const;
+ bool GetFontSubstitute( int nIndex, String& rFontName, String& rSubstName, sal_uInt16& rFlags ) const;
int GetFontSubstituteCount() const { return maFontSubstList.size(); };
bool Empty() const { return maFontSubstList.empty(); }
void Clear() { maFontSubstList.clear(); }
- bool FindFontSubstitute( String& rSubstName, const String& rFontName, USHORT nFlags ) const;
+ bool FindFontSubstitute( String& rSubstName, const String& rFontName, sal_uInt16 nFlags ) const;
};
// PreMatchFontSubstitution
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx
index 967ee09efada..e6aaec2c9971 100644..100755
--- a/vcl/inc/vcl/outdev.hxx
+++ b/vcl/inc/vcl/outdev.hxx
@@ -153,52 +153,55 @@ struct KerningPair
// ----------------------
// Flags for Push()
-#define PUSH_LINECOLOR ((USHORT)0x0001)
-#define PUSH_FILLCOLOR ((USHORT)0x0002)
-#define PUSH_FONT ((USHORT)0x0004)
-#define PUSH_TEXTCOLOR ((USHORT)0x0008)
-#define PUSH_MAPMODE ((USHORT)0x0010)
-#define PUSH_CLIPREGION ((USHORT)0x0020)
-#define PUSH_RASTEROP ((USHORT)0x0040)
-#define PUSH_TEXTFILLCOLOR ((USHORT)0x0080)
-#define PUSH_TEXTALIGN ((USHORT)0x0100)
-#define PUSH_REFPOINT ((USHORT)0x0200)
-#define PUSH_TEXTLINECOLOR ((USHORT)0x0400)
-#define PUSH_TEXTLAYOUTMODE ((USHORT)0x0800)
-#define PUSH_TEXTLANGUAGE ((USHORT)0x1000)
-#define PUSH_OVERLINECOLOR ((USHORT)0x2000)
+#define PUSH_LINECOLOR ((sal_uInt16)0x0001)
+#define PUSH_FILLCOLOR ((sal_uInt16)0x0002)
+#define PUSH_FONT ((sal_uInt16)0x0004)
+#define PUSH_TEXTCOLOR ((sal_uInt16)0x0008)
+#define PUSH_MAPMODE ((sal_uInt16)0x0010)
+#define PUSH_CLIPREGION ((sal_uInt16)0x0020)
+#define PUSH_RASTEROP ((sal_uInt16)0x0040)
+#define PUSH_TEXTFILLCOLOR ((sal_uInt16)0x0080)
+#define PUSH_TEXTALIGN ((sal_uInt16)0x0100)
+#define PUSH_REFPOINT ((sal_uInt16)0x0200)
+#define PUSH_TEXTLINECOLOR ((sal_uInt16)0x0400)
+#define PUSH_TEXTLAYOUTMODE ((sal_uInt16)0x0800)
+#define PUSH_TEXTLANGUAGE ((sal_uInt16)0x1000)
+#define PUSH_OVERLINECOLOR ((sal_uInt16)0x2000)
#define PUSH_ALLTEXT (PUSH_TEXTCOLOR | PUSH_TEXTFILLCOLOR | PUSH_TEXTLINECOLOR | PUSH_OVERLINECOLOR | PUSH_TEXTALIGN | PUSH_TEXTLAYOUTMODE | PUSH_TEXTLANGUAGE)
#define PUSH_ALLFONT (PUSH_ALLTEXT | PUSH_FONT)
-#define PUSH_ALL ((USHORT)0xFFFF)
+#define PUSH_ALL ((sal_uInt16)0xFFFF)
// Flags for DrawText()
-#define TEXT_DRAW_DISABLE ((USHORT)0x0001)
-#define TEXT_DRAW_MNEMONIC ((USHORT)0x0002)
-#define TEXT_DRAW_MONO ((USHORT)0x0004)
-#define TEXT_DRAW_CLIP ((USHORT)0x0008)
-#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_MULTILINE ((USHORT)0x1000)
-#define TEXT_DRAW_WORDBREAK ((USHORT)0x2000)
-#define TEXT_DRAW_NEWSELLIPSIS ((USHORT)0x4000)
-
-#define TEXT_DRAW_WORDBREAK_HYPHENATION (((USHORT)0x8000) | TEXT_DRAW_WORDBREAK)
+#define TEXT_DRAW_DISABLE ((sal_uInt16)0x0001)
+#define TEXT_DRAW_MNEMONIC ((sal_uInt16)0x0002)
+#define TEXT_DRAW_MONO ((sal_uInt16)0x0004)
+#define TEXT_DRAW_CLIP ((sal_uInt16)0x0008)
+#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_MULTILINE ((sal_uInt16)0x1000)
+#define TEXT_DRAW_WORDBREAK ((sal_uInt16)0x2000)
+#define TEXT_DRAW_NEWSELLIPSIS ((sal_uInt16)0x4000)
+// in the long run we should make text style flags longer
+// but at the moment we can get away with this 2 bit field for ellipsis style
+#define TEXT_DRAW_CENTERELLIPSIS (TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_PATHELLIPSIS)
+
+#define TEXT_DRAW_WORDBREAK_HYPHENATION (((sal_uInt16)0x8000) | TEXT_DRAW_WORDBREAK)
// Flags for CopyArea()
-#define COPYAREA_WINDOWINVALIDATE ((USHORT)0x0001)
+#define COPYAREA_WINDOWINVALIDATE ((sal_uInt16)0x0001)
// Flags for DrawImage()
-#define IMAGE_DRAW_DISABLE ((USHORT)0x0001)
-#define IMAGE_DRAW_HIGHLIGHT ((USHORT)0x0002)
-#define IMAGE_DRAW_DEACTIVE ((USHORT)0x0004)
-#define IMAGE_DRAW_COLORTRANSFORM ((USHORT)0x0008)
-#define IMAGE_DRAW_SEMITRANSPARENT ((USHORT)0x0010)
+#define IMAGE_DRAW_DISABLE ((sal_uInt16)0x0001)
+#define IMAGE_DRAW_HIGHLIGHT ((sal_uInt16)0x0002)
+#define IMAGE_DRAW_DEACTIVE ((sal_uInt16)0x0004)
+#define IMAGE_DRAW_COLORTRANSFORM ((sal_uInt16)0x0008)
+#define IMAGE_DRAW_SEMITRANSPARENT ((sal_uInt16)0x0010)
#define IMAGE_DRAW_3DLOOK 0
#define IMAGE_DRAW_BTNLOOK 0
@@ -208,63 +211,63 @@ struct KerningPair
#define WAVE_NORMAL 3
// Grid
-#define GRID_DOTS ((ULONG)0x00000001)
-#define GRID_HORZLINES ((ULONG)0x00000002)
-#define GRID_VERTLINES ((ULONG)0x00000004)
+#define GRID_DOTS ((sal_uLong)0x00000001)
+#define GRID_HORZLINES ((sal_uLong)0x00000002)
+#define GRID_VERTLINES ((sal_uLong)0x00000004)
#define GRID_LINES (GRID_HORZLINES | GRID_VERTLINES)
// LayoutModes for Complex Text Layout
-#define TEXT_LAYOUT_DEFAULT ((ULONG)0x00000000)
-#define TEXT_LAYOUT_BIDI_LTR ((ULONG)0x00000000)
-#define TEXT_LAYOUT_BIDI_RTL ((ULONG)0x00000001)
-#define TEXT_LAYOUT_BIDI_STRONG ((ULONG)0x00000002)
-#define TEXT_LAYOUT_TEXTORIGIN_LEFT ((ULONG)0x00000004)
-#define TEXT_LAYOUT_TEXTORIGIN_RIGHT ((ULONG)0x00000008)
-#define TEXT_LAYOUT_COMPLEX_DISABLED ((ULONG)0x00000100)
-#define TEXT_LAYOUT_ENABLE_LIGATURES ((ULONG)0x00000200)
-#define TEXT_LAYOUT_SUBSTITUTE_DIGITS ((ULONG)0x00000400)
+#define TEXT_LAYOUT_DEFAULT ((sal_uLong)0x00000000)
+#define TEXT_LAYOUT_BIDI_LTR ((sal_uLong)0x00000000)
+#define TEXT_LAYOUT_BIDI_RTL ((sal_uLong)0x00000001)
+#define TEXT_LAYOUT_BIDI_STRONG ((sal_uLong)0x00000002)
+#define TEXT_LAYOUT_TEXTORIGIN_LEFT ((sal_uLong)0x00000004)
+#define TEXT_LAYOUT_TEXTORIGIN_RIGHT ((sal_uLong)0x00000008)
+#define TEXT_LAYOUT_COMPLEX_DISABLED ((sal_uLong)0x00000100)
+#define TEXT_LAYOUT_ENABLE_LIGATURES ((sal_uLong)0x00000200)
+#define TEXT_LAYOUT_SUBSTITUTE_DIGITS ((sal_uLong)0x00000400)
// DrawModes
-#define DRAWMODE_DEFAULT ((ULONG)0x00000000)
-#define DRAWMODE_BLACKLINE ((ULONG)0x00000001)
-#define DRAWMODE_BLACKFILL ((ULONG)0x00000002)
-#define DRAWMODE_BLACKTEXT ((ULONG)0x00000004)
-#define DRAWMODE_BLACKBITMAP ((ULONG)0x00000008)
-#define DRAWMODE_BLACKGRADIENT ((ULONG)0x00000010)
-#define DRAWMODE_GRAYLINE ((ULONG)0x00000020)
-#define DRAWMODE_GRAYFILL ((ULONG)0x00000040)
-#define DRAWMODE_GRAYTEXT ((ULONG)0x00000080)
-#define DRAWMODE_GRAYBITMAP ((ULONG)0x00000100)
-#define DRAWMODE_GRAYGRADIENT ((ULONG)0x00000200)
-#define DRAWMODE_NOFILL ((ULONG)0x00000400)
-#define DRAWMODE_NOBITMAP ((ULONG)0x00000800)
-#define DRAWMODE_NOGRADIENT ((ULONG)0x00001000)
-#define DRAWMODE_GHOSTEDLINE ((ULONG)0x00002000)
-#define DRAWMODE_GHOSTEDFILL ((ULONG)0x00004000)
-#define DRAWMODE_GHOSTEDTEXT ((ULONG)0x00008000)
-#define DRAWMODE_GHOSTEDBITMAP ((ULONG)0x00010000)
-#define DRAWMODE_GHOSTEDGRADIENT ((ULONG)0x00020000)
-#define DRAWMODE_WHITELINE ((ULONG)0x00100000)
-#define DRAWMODE_WHITEFILL ((ULONG)0x00200000)
-#define DRAWMODE_WHITETEXT ((ULONG)0x00400000)
-#define DRAWMODE_WHITEBITMAP ((ULONG)0x00800000)
-#define DRAWMODE_WHITEGRADIENT ((ULONG)0x01000000)
-#define DRAWMODE_SETTINGSLINE ((ULONG)0x02000000)
-#define DRAWMODE_SETTINGSFILL ((ULONG)0x04000000)
-#define DRAWMODE_SETTINGSTEXT ((ULONG)0x08000000)
-#define DRAWMODE_SETTINGSGRADIENT ((ULONG)0x10000000)
-#define DRAWMODE_NOTRANSPARENCY ((ULONG)0x80000000)
+#define DRAWMODE_DEFAULT ((sal_uLong)0x00000000)
+#define DRAWMODE_BLACKLINE ((sal_uLong)0x00000001)
+#define DRAWMODE_BLACKFILL ((sal_uLong)0x00000002)
+#define DRAWMODE_BLACKTEXT ((sal_uLong)0x00000004)
+#define DRAWMODE_BLACKBITMAP ((sal_uLong)0x00000008)
+#define DRAWMODE_BLACKGRADIENT ((sal_uLong)0x00000010)
+#define DRAWMODE_GRAYLINE ((sal_uLong)0x00000020)
+#define DRAWMODE_GRAYFILL ((sal_uLong)0x00000040)
+#define DRAWMODE_GRAYTEXT ((sal_uLong)0x00000080)
+#define DRAWMODE_GRAYBITMAP ((sal_uLong)0x00000100)
+#define DRAWMODE_GRAYGRADIENT ((sal_uLong)0x00000200)
+#define DRAWMODE_NOFILL ((sal_uLong)0x00000400)
+#define DRAWMODE_NOBITMAP ((sal_uLong)0x00000800)
+#define DRAWMODE_NOGRADIENT ((sal_uLong)0x00001000)
+#define DRAWMODE_GHOSTEDLINE ((sal_uLong)0x00002000)
+#define DRAWMODE_GHOSTEDFILL ((sal_uLong)0x00004000)
+#define DRAWMODE_GHOSTEDTEXT ((sal_uLong)0x00008000)
+#define DRAWMODE_GHOSTEDBITMAP ((sal_uLong)0x00010000)
+#define DRAWMODE_GHOSTEDGRADIENT ((sal_uLong)0x00020000)
+#define DRAWMODE_WHITELINE ((sal_uLong)0x00100000)
+#define DRAWMODE_WHITEFILL ((sal_uLong)0x00200000)
+#define DRAWMODE_WHITETEXT ((sal_uLong)0x00400000)
+#define DRAWMODE_WHITEBITMAP ((sal_uLong)0x00800000)
+#define DRAWMODE_WHITEGRADIENT ((sal_uLong)0x01000000)
+#define DRAWMODE_SETTINGSLINE ((sal_uLong)0x02000000)
+#define DRAWMODE_SETTINGSFILL ((sal_uLong)0x04000000)
+#define DRAWMODE_SETTINGSTEXT ((sal_uLong)0x08000000)
+#define DRAWMODE_SETTINGSGRADIENT ((sal_uLong)0x10000000)
+#define DRAWMODE_NOTRANSPARENCY ((sal_uLong)0x80000000)
// Antialiasing
-#define ANTIALIASING_DISABLE_TEXT ((USHORT)0x0001)
-#define ANTIALIASING_ENABLE_B2DDRAW ((USHORT)0x0002)
-#define ANTIALIASING_PIXELSNAPHAIRLINE ((USHORT)0x0004)
+#define ANTIALIASING_DISABLE_TEXT ((sal_uInt16)0x0001)
+#define ANTIALIASING_ENABLE_B2DDRAW ((sal_uInt16)0x0002)
+#define ANTIALIASING_PIXELSNAPHAIRLINE ((sal_uInt16)0x0004)
// AddFontSubstitute
-#define FONT_SUBSTITUTE_ALWAYS ((USHORT)0x0001)
-#define FONT_SUBSTITUTE_SCREENONLY ((USHORT)0x0002)
+#define FONT_SUBSTITUTE_ALWAYS ((sal_uInt16)0x0001)
+#define FONT_SUBSTITUTE_SCREENONLY ((sal_uInt16)0x0002)
-#define DEFAULTFONT_FLAGS_ONLYONE ((ULONG)0x00000001)
+#define DEFAULTFONT_FLAGS_ONLYONE ((sal_uLong)0x00000001)
enum OutDevType { OUTDEV_DONTKNOW, OUTDEV_WINDOW, OUTDEV_PRINTER, OUTDEV_VIRDEV };
@@ -337,8 +340,8 @@ private:
mutable long mnTextOffY;
mutable long mnEmphasisAscent;
mutable long mnEmphasisDescent;
- ULONG mnDrawMode;
- ULONG mnTextLayoutMode;
+ sal_uLong mnDrawMode;
+ sal_uLong mnTextLayoutMode;
ImplMapRes maMapRes;
ImplThresholdRes maThresRes;
OutDevType meOutDevType;
@@ -356,9 +359,9 @@ private:
AllSettings maSettings;
MapMode maMapMode;
Point maRefPoint;
- USHORT mnAntialiasing;
+ sal_uInt16 mnAntialiasing;
LanguageType meTextLanguage;
- mutable BOOL mbMap:1,
+ mutable sal_Bool mbMap:1,
mbMapIsDefault:1,
mbClipRegion:1,
mbBackground:1,
@@ -384,8 +387,8 @@ public:
SAL_DLLPRIVATE sal_Int32 ImplGetDPIX() const { return mnDPIX; }
SAL_DLLPRIVATE sal_Int32 ImplGetDPIY() const { return mnDPIY; }
SAL_DLLPRIVATE int ImplGetGraphics() const;
- SAL_DLLPRIVATE void ImplReleaseGraphics( BOOL bRelease = TRUE );
- SAL_DLLPRIVATE BOOL ImplHasMirroredGraphics();
+ SAL_DLLPRIVATE void ImplReleaseGraphics( sal_Bool bRelease = sal_True );
+ SAL_DLLPRIVATE sal_Bool ImplHasMirroredGraphics();
SAL_DLLPRIVATE void ImplReMirror( Point &rPoint ) const;
SAL_DLLPRIVATE void ImplReMirror( Rectangle &rRect ) const;
SAL_DLLPRIVATE void ImplReMirror( Region &rRegion ) const;
@@ -399,7 +402,6 @@ public:
SAL_DLLPRIVATE void ImplInitClipRegion();
SAL_DLLPRIVATE bool ImplSelectClipRegion( const Region&, SalGraphics* pGraphics = NULL );
SAL_DLLPRIVATE void ImplSetClipRegion( const Region* pRegion );
- SAL_DLLPRIVATE void ImplSetTriangleClipRegion( const PolyPolygon &rPolyPolygon );
SAL_DLLPRIVATE SalLayout* ImplLayout( const String&, xub_StrLen nIndex,
xub_StrLen nLen, const Point& rLogicPos = Point(0,0),
@@ -414,15 +416,15 @@ public:
SAL_DLLPRIVATE long ImplGetTextWidth( const SalLayout& ) const;
static
SAL_DLLPRIVATE XubString ImplGetEllipsisString( const OutputDevice& rTargetDevice, const XubString& rStr,
- long nMaxWidth, USHORT nStyle, const ::vcl::ITextLayout& _rLayout );
+ long nMaxWidth, sal_uInt16 nStyle, const ::vcl::ITextLayout& _rLayout );
static
SAL_DLLPRIVATE void ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& rRect,
- const String& rOrigStr, USHORT nStyle,
+ const String& rOrigStr, sal_uInt16 nStyle,
MetricVector* pVector, String* pDisplayText, ::vcl::ITextLayout& _rLayout );
SAL_DLLPRIVATE void ImplDrawTextBackground( const SalLayout& );
- SAL_DLLPRIVATE void ImplDrawTextLines( SalLayout&, FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, BOOL bWordLine, BOOL bUnderlineAbove );
+ SAL_DLLPRIVATE void ImplDrawTextLines( SalLayout&, FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, sal_Bool bWordLine, sal_Bool bUnderlineAbove );
SAL_DLLPRIVATE bool ImplDrawRotateText( SalLayout& );
- SAL_DLLPRIVATE void ImplDrawTextDirect( SalLayout&, BOOL bTextLines );
+ SAL_DLLPRIVATE void ImplDrawTextDirect( SalLayout&, sal_Bool bTextLines );
SAL_DLLPRIVATE void ImplDrawSpecialText( SalLayout& );
SAL_DLLPRIVATE void ImplDrawText( SalLayout& );
SAL_DLLPRIVATE Rectangle ImplGetTextBoundRect( const SalLayout& );
@@ -433,16 +435,16 @@ public:
SAL_DLLPRIVATE void ImplInitTextLineSize();
SAL_DLLPRIVATE void ImplInitAboveTextLineSize();
SAL_DLLPRIVATE void ImplDrawWaveLine( long nBaseX, long nBaseY, long nStartX, long nStartY, long nWidth, long nHeight, long nLineWidth, short nOrientation, const Color& rColor );
- SAL_DLLPRIVATE void ImplDrawWaveTextLine( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontUnderline eTextLine, Color aColor, BOOL bIsAbove );
- SAL_DLLPRIVATE void ImplDrawStraightTextLine( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontUnderline eTextLine, Color aColor, BOOL bIsAbove );
+ SAL_DLLPRIVATE void ImplDrawWaveTextLine( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontUnderline eTextLine, Color aColor, sal_Bool bIsAbove );
+ SAL_DLLPRIVATE void ImplDrawStraightTextLine( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontUnderline eTextLine, Color aColor, sal_Bool bIsAbove );
SAL_DLLPRIVATE void ImplDrawStrikeoutLine( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontStrikeout eStrikeout, Color aColor );
SAL_DLLPRIVATE void ImplDrawStrikeoutChar( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontStrikeout eStrikeout, Color aColor );
- SAL_DLLPRIVATE void ImplDrawTextLine( long nBaseX, long nX, long nY, long nWidth, FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, BOOL bUnderlineAbove );
+ SAL_DLLPRIVATE void ImplDrawTextLine( long nBaseX, long nX, long nY, long nWidth, FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, sal_Bool bUnderlineAbove );
SAL_DLLPRIVATE void ImplDrawMnemonicLine( long nX, long nY, long nWidth );
- SAL_DLLPRIVATE void ImplGetEmphasisMark( PolyPolygon& rPolyPoly, BOOL& rPolyLine, Rectangle& rRect1, Rectangle& rRect2, long& rYOff, long& rWidth, FontEmphasisMark eEmphasis, long nHeight, short nOrient );
- SAL_DLLPRIVATE void ImplDrawEmphasisMark( long nBaseX, long nX, long nY, const PolyPolygon& rPolyPoly, BOOL bPolyLine, const Rectangle& rRect1, const Rectangle& rRect2 );
+ SAL_DLLPRIVATE void ImplGetEmphasisMark( PolyPolygon& rPolyPoly, sal_Bool& rPolyLine, Rectangle& rRect1, Rectangle& rRect2, long& rYOff, long& rWidth, FontEmphasisMark eEmphasis, long nHeight, short nOrient );
+ SAL_DLLPRIVATE void ImplDrawEmphasisMark( long nBaseX, long nX, long nY, const PolyPolygon& rPolyPoly, sal_Bool bPolyLine, const Rectangle& rRect1, const Rectangle& rRect2 );
static
- SAL_DLLPRIVATE long ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, long nWidth, const XubString& rStr, USHORT nStyle, const ::vcl::ITextLayout& _rLayout );
+ SAL_DLLPRIVATE long ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, long nWidth, const XubString& rStr, sal_uInt16 nStyle, const ::vcl::ITextLayout& _rLayout );
SAL_DLLPRIVATE void ImplInitFontList() const;
SAL_DLLPRIVATE void ImplUpdateFontData( bool bNewFontLists );
SAL_DLLPRIVATE static void ImplUpdateAllFontData( bool bNewFontLists );
@@ -472,13 +474,13 @@ public:
SAL_DLLPRIVATE void ImplDrawPolygon( const Polygon& rPoly, const PolyPolygon* pClipPolyPoly = NULL );
SAL_DLLPRIVATE void ImplDrawPolyPolygon( const PolyPolygon& rPolyPoly, const PolyPolygon* pClipPolyPoly = NULL );
- SAL_DLLPRIVATE void ImplDrawPolyPolygon( USHORT nPoly, const PolyPolygon& rPolyPoly );
- SAL_DLLPRIVATE void ImplDrawLinearGradient( const Rectangle& rRect, const Gradient& rGradient, BOOL bMtf, const PolyPolygon* pClipPolyPoly );
- SAL_DLLPRIVATE void ImplDrawComplexGradient( const Rectangle& rRect, const Gradient& rGradient, BOOL bMtf, const PolyPolygon* pClipPolyPoly );
+ SAL_DLLPRIVATE void ImplDrawPolyPolygon( sal_uInt16 nPoly, const PolyPolygon& rPolyPoly );
+ SAL_DLLPRIVATE void ImplDrawLinearGradient( const Rectangle& rRect, const Gradient& rGradient, sal_Bool bMtf, const PolyPolygon* pClipPolyPoly );
+ SAL_DLLPRIVATE void ImplDrawComplexGradient( const Rectangle& rRect, const Gradient& rGradient, sal_Bool bMtf, const PolyPolygon* pClipPolyPoly );
- SAL_DLLPRIVATE void ImplDrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch, BOOL bMtf );
- SAL_DLLPRIVATE void ImplCalcHatchValues( const Rectangle& rRect, long nDist, USHORT nAngle10, Point& rPt1, Point& rPt2, Size& rInc, Point& rEndPt1 );
- SAL_DLLPRIVATE void ImplDrawHatchLine( const Line& rLine, const PolyPolygon& rPolyPoly, Point* pPtBuffer, BOOL bMtf );
+ SAL_DLLPRIVATE void ImplDrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch, sal_Bool bMtf );
+ SAL_DLLPRIVATE void ImplCalcHatchValues( const Rectangle& rRect, long nDist, sal_uInt16 nAngle10, Point& rPt1, Point& rPt2, Size& rInc, Point& rEndPt1 );
+ SAL_DLLPRIVATE void ImplDrawHatchLine( const Line& rLine, const PolyPolygon& rPolyPoly, Point* pPtBuffer, sal_Bool bMtf );
SAL_DLLPRIVATE void ImplDrawWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
SAL_DLLPRIVATE void ImplDrawColorWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
@@ -489,14 +491,14 @@ public:
SAL_DLLPRIVATE void ImplDrawOutDevDirect( const OutputDevice* pSrcDev, void* pPosAry );
SAL_DLLPRIVATE void ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
- const Bitmap& rBitmap, const ULONG nAction );
+ const Bitmap& rBitmap, const sal_uLong nAction );
SAL_DLLPRIVATE void ImplDrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
- const BitmapEx& rBitmapEx, const ULONG nAction );
+ const BitmapEx& rBitmapEx, const sal_uLong nAction );
SAL_DLLPRIVATE void ImplDrawMask( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
const Bitmap& rBitmap, const Color& rMaskColor,
- const ULONG nAction );
+ const sal_uLong nAction );
SAL_DLLPRIVATE void ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha,
const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel );
@@ -536,14 +538,14 @@ public:
SAL_DLLPRIVATE void ImplGetFrameBitmap( const Point& rPt, const Size& rSize,
Bitmap& rBitmap ) const;
- SAL_DLLPRIVATE BOOL ImplIsRecordLayout() const;
+ SAL_DLLPRIVATE sal_Bool ImplIsRecordLayout() const;
void ImplAddDevFontSubstitute( const XubString& rFontName,
const XubString& rReplaceFontName,
- USHORT nFlags = 0 );
+ sal_uInt16 nFlags = 0 );
SAL_DLLPRIVATE static FontEmphasisMark ImplGetEmphasisMarkStyle( const Font& rFont );
- SAL_DLLPRIVATE static BOOL ImplIsUnderlineAbove( const Font& );
+ SAL_DLLPRIVATE static sal_Bool ImplIsUnderlineAbove( const Font& );
// tells whether this output device is RTL in an LTR UI or LTR in a RTL UI
SAL_DLLPRIVATE bool ImplIsAntiparallel() const ;
@@ -596,8 +598,8 @@ public:
FontStrikeout eStrikeout,
FontUnderline eUnderline,
FontUnderline eOverline,
- BOOL bUnderlineAbove = FALSE );
- static BOOL IsTextUnderlineAbove( const Font& rFont );
+ sal_Bool bUnderlineAbove = sal_False );
+ static sal_Bool IsTextUnderlineAbove( const Font& rFont );
void DrawText( const Point& rStartPt, const XubString& rStr,
xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
@@ -615,15 +617,15 @@ public:
bool GetCaretPositions( const XubString&, sal_Int32* pCaretXArray,
xub_StrLen nIndex, xub_StrLen nLen,
sal_Int32* pDXAry = NULL, long nWidth = 0,
- BOOL bCellBreaking = TRUE ) const;
- void DrawStretchText( const Point& rStartPt, ULONG nWidth,
+ sal_Bool bCellBreaking = sal_True ) const;
+ void DrawStretchText( const Point& rStartPt, sal_uLong nWidth,
const XubString& rStr,
xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN );
xub_StrLen GetTextBreak( const XubString& rStr, long nTextWidth,
xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
- long nCharExtra = 0, BOOL bCellBreaking = TRUE ) const;
+ long nCharExtra = 0, sal_Bool bCellBreaking = sal_True ) const;
xub_StrLen GetTextBreak( const XubString& rStr, long nTextWidth,
- USHORT nExtraChar, xub_StrLen& rExtraCharPos,
+ sal_uInt16 nExtraChar, xub_StrLen& rExtraCharPos,
xub_StrLen nIndex, xub_StrLen nLen,
long nCharExtra = 0 ) const;
/** Generate MetaTextActions for the text rect
@@ -636,47 +638,47 @@ public:
*/
void AddTextRectActions( const Rectangle& rRect,
const String& rOrigStr,
- USHORT nStyle,
+ sal_uInt16 nStyle,
GDIMetaFile& rMtf );
void DrawText( const Rectangle& rRect,
- const XubString& rStr, USHORT nStyle = 0,
+ const XubString& rStr, sal_uInt16 nStyle = 0,
MetricVector* pVector = NULL, String* pDisplayText = NULL,
::vcl::ITextLayout* _pTextLayout = NULL );
Rectangle GetTextRect( const Rectangle& rRect,
- const XubString& rStr, USHORT nStyle = TEXT_DRAW_WORDBREAK,
+ const XubString& rStr, sal_uInt16 nStyle = TEXT_DRAW_WORDBREAK,
TextRectInfo* pInfo = NULL,
const ::vcl::ITextLayout* _pTextLayout = NULL ) const;
XubString GetEllipsisString( const XubString& rStr, long nMaxWidth,
- USHORT nStyle = TEXT_DRAW_ENDELLIPSIS ) const;
+ sal_uInt16 nStyle = TEXT_DRAW_ENDELLIPSIS ) const;
void DrawCtrlText( const Point& rPos, const XubString& rStr,
xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
- USHORT nStyle = TEXT_DRAW_MNEMONIC, MetricVector* pVector = NULL, String* pDisplayText = NULL );
+ sal_uInt16 nStyle = TEXT_DRAW_MNEMONIC, MetricVector* pVector = NULL, String* pDisplayText = NULL );
long GetCtrlTextWidth( const XubString& rStr, xub_StrLen nIndex = 0,
xub_StrLen nLen = STRING_LEN,
- USHORT nStyle = TEXT_DRAW_MNEMONIC ) const;
+ sal_uInt16 nStyle = TEXT_DRAW_MNEMONIC ) const;
static XubString GetNonMnemonicString( const XubString& rStr, xub_StrLen& rMnemonicPos );
static XubString GetNonMnemonicString( const XubString& rStr )
{ xub_StrLen nDummy; return GetNonMnemonicString( rStr, nDummy ); }
- ULONG GetKerningPairCount() const;
- void GetKerningPairs( ULONG nPairs, KerningPair* pKernPairs ) const;
+ sal_uLong GetKerningPairCount() const;
+ void GetKerningPairs( sal_uLong nPairs, KerningPair* pKernPairs ) const;
- BOOL GetTextBoundRect( Rectangle& rRect,
+ sal_Bool GetTextBoundRect( Rectangle& rRect,
const String& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
- ULONG nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
- BOOL GetTextOutline( PolyPolygon&,
+ sal_uLong nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
+ sal_Bool GetTextOutline( PolyPolygon&,
const String& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0,
- xub_StrLen nLen = STRING_LEN, BOOL bOptimize = TRUE,
- ULONG nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
- BOOL GetTextOutlines( PolyPolyVector&,
+ xub_StrLen nLen = STRING_LEN, sal_Bool bOptimize = sal_True,
+ sal_uLong nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
+ sal_Bool GetTextOutlines( PolyPolyVector&,
const String& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0,
- xub_StrLen nLen = STRING_LEN, BOOL bOptimize = TRUE,
- ULONG nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
- BOOL GetTextOutlines( ::basegfx::B2DPolyPolygonVector&,
+ xub_StrLen nLen = STRING_LEN, sal_Bool bOptimize = sal_True,
+ sal_uLong nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
+ sal_Bool GetTextOutlines( ::basegfx::B2DPolyPolygonVector&,
const String& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0,
- xub_StrLen nLen = STRING_LEN, BOOL bOptimize = TRUE,
- ULONG nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
- BOOL GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex,
+ xub_StrLen nLen = STRING_LEN, sal_Bool bOptimize = sal_True,
+ sal_uLong nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
+ sal_Bool GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex,
int nLen, int nBase, MetricVector& rVector );
void DrawPixel( const Point& rPt );
@@ -740,7 +742,7 @@ public:
void DrawRect( const Rectangle& rRect );
void DrawRect( const Rectangle& rRect,
- ULONG nHorzRount, ULONG nVertRound );
+ sal_uLong nHorzRount, sal_uLong nVertRound );
void DrawEllipse( const Rectangle& rRect );
void DrawArc( const Rectangle& rRect,
const Point& rStartPt, const Point& rEndPt );
@@ -756,7 +758,7 @@ public:
const OutputDevice& rOutDev );
void CopyArea( const Point& rDestPt,
const Point& rSrcPt, const Size& rSrcSize,
- USHORT nFlags = 0 );
+ sal_uInt16 nFlags = 0 );
void DrawBitmap( const Point& rDestPt,
const Bitmap& rBitmap );
@@ -783,9 +785,9 @@ public:
const Bitmap& rBitmap, const Color& rMaskColor );
void DrawImage( const Point& rPos,
- const Image& rImage, USHORT nStyle = 0 );
+ const Image& rImage, sal_uInt16 nStyle = 0 );
void DrawImage( const Point& rPos, const Size& rSize,
- const Image& rImage, USHORT nStyle = 0 );
+ const Image& rImage, sal_uInt16 nStyle = 0 );
void DrawGradient( const Rectangle& rRect, const Gradient& rGradient );
void DrawGradient( const PolyPolygon& rPolyPoly, const Gradient& rGradient );
@@ -806,10 +808,10 @@ public:
#endif
void DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpaper );
- void DrawWaveLine( const Point& rStartPos, const Point& rEndPos, USHORT nStyle );
- void DrawGrid( const Rectangle& rRect, const Size& rDist, ULONG nFlags );
+ void DrawWaveLine( const Point& rStartPos, const Point& rEndPos, sal_uInt16 nStyle );
+ void DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLong nFlags );
- void DrawTransparent( const PolyPolygon& rPolyPoly, USHORT nTransparencePercent );
+ void DrawTransparent( const PolyPolygon& rPolyPoly, sal_uInt16 nTransparencePercent );
void DrawTransparent( const basegfx::B2DPolyPolygon& rB2DPolyPoly, double fTransparency);
void DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos, const Size& rSize, const Gradient& rTransparenceGradient );
@@ -822,41 +824,40 @@ public:
*/
BitmapEx GetBitmapEx( const Point& rSrcPt, const Size& rSize ) const;
- void EnableMapMode( BOOL bEnable = TRUE );
- BOOL IsMapModeEnabled() const { return mbMap; }
+ void EnableMapMode( sal_Bool bEnable = sal_True );
+ sal_Bool IsMapModeEnabled() const { return mbMap; }
// Enabling/disabling RTL only makes sense for OutputDevices that use a mirroring SalGraphisLayout
- void EnableRTL( BOOL bEnable = TRUE);
- BOOL IsRTLEnabled() const { return mbEnableRTL; }
+ void EnableRTL( sal_Bool bEnable = sal_True);
+ sal_Bool IsRTLEnabled() const { return mbEnableRTL; }
void SetConnectMetaFile( GDIMetaFile* pMtf );
GDIMetaFile* GetConnectMetaFile() const { return mpMetaFile; }
- void EnableOutput( BOOL bEnable = TRUE );
- BOOL IsOutputEnabled() const { return mbOutput; }
- BOOL IsDeviceOutput() const { return mbDevOutput; }
- BOOL IsDeviceOutputNecessary() const { return (mbOutput && mbDevOutput); }
- BOOL IsOutputNecessary() const { return ((mbOutput && mbDevOutput) || (mpMetaFile != NULL)); }
+ void EnableOutput( sal_Bool bEnable = sal_True );
+ sal_Bool IsOutputEnabled() const { return mbOutput; }
+ sal_Bool IsDeviceOutput() const { return mbDevOutput; }
+ sal_Bool IsDeviceOutputNecessary() const { return (mbOutput && mbDevOutput); }
+ sal_Bool IsOutputNecessary() const { return ((mbOutput && mbDevOutput) || (mpMetaFile != NULL)); }
void SetClipRegion();
void SetClipRegion( const Region& rRegion );
- void SetTriangleClipRegion( const PolyPolygon &rRegion );
Region GetClipRegion() const;
- BOOL IsClipRegion() const { return mbClipRegion; }
+ sal_Bool IsClipRegion() const { return mbClipRegion; }
Region GetActiveClipRegion() const;
void MoveClipRegion( long nHorzMove, long nVertMove );
void IntersectClipRegion( const Rectangle& rRect );
void IntersectClipRegion( const Region& rRegion );
- void SetAntialiasing( USHORT nMode = 0 );
- USHORT GetAntialiasing() const { return mnAntialiasing; }
+ void SetAntialiasing( sal_uInt16 nMode = 0 );
+ sal_uInt16 GetAntialiasing() const { return mnAntialiasing; }
- void SetDrawMode( ULONG nDrawMode );
- ULONG GetDrawMode() const { return mnDrawMode; }
+ void SetDrawMode( sal_uLong nDrawMode );
+ sal_uLong GetDrawMode() const { return mnDrawMode; }
- void SetLayoutMode( ULONG nTextLayoutMode );
- ULONG GetLayoutMode() const { return mnTextLayoutMode; }
+ void SetLayoutMode( sal_uLong nTextLayoutMode );
+ sal_uLong GetLayoutMode() const { return mnTextLayoutMode; }
void SetDigitLanguage( LanguageType );
LanguageType GetDigitLanguage() const { return meTextLanguage; }
@@ -877,18 +878,18 @@ public:
void SetLineColor();
void SetLineColor( const Color& rColor );
const Color& GetLineColor() const { return maLineColor; }
- BOOL IsLineColor() const { return mbLineColor; }
+ sal_Bool IsLineColor() const { return mbLineColor; }
void SetFillColor();
void SetFillColor( const Color& rColor );
const Color& GetFillColor() const { return maFillColor; }
- BOOL IsFillColor() const { return mbFillColor; }
+ sal_Bool IsFillColor() const { return mbFillColor; }
void SetBackground();
void SetBackground( const Wallpaper& rBackground );
const Wallpaper& GetBackground() const { return maBackground; }
- BOOL IsBackground() const { return mbBackground; }
+ sal_Bool IsBackground() const { return mbBackground; }
void SetFont( const Font& rNewFont );
const Font& GetFont() const { return maFont; }
@@ -904,15 +905,15 @@ public:
void SetTextFillColor( const Color& rColor );
Color GetTextFillColor() const;
- BOOL IsTextFillColor() const { return !maFont.IsTransparent(); }
+ sal_Bool IsTextFillColor() const { return !maFont.IsTransparent(); }
void SetTextLineColor();
void SetTextLineColor( const Color& rColor );
const Color& GetTextLineColor() const { return maTextLineColor; }
- BOOL IsTextLineColor() const { return (maTextLineColor.GetTransparency() == 0); }
+ sal_Bool IsTextLineColor() const { return (maTextLineColor.GetTransparency() == 0); }
void SetOverlineColor();
void SetOverlineColor( const Color& rColor );
const Color& GetOverlineColor() const { return maOverlineColor; }
- BOOL IsOverlineColor() const { return (maOverlineColor.GetTransparency() == 0); }
+ sal_Bool IsOverlineColor() const { return (maOverlineColor.GetTransparency() == 0); }
void SetTextAlign( TextAlign eAlign );
TextAlign GetTextAlign() const { return maFont.GetAlign(); }
@@ -926,12 +927,12 @@ public:
virtual void SetMapMode( const MapMode& rNewMapMode );
virtual void SetRelativeMapMode( const MapMode& rNewMapMode );
const MapMode& GetMapMode() const { return maMapMode; }
- BOOL IsMapMode() const { return mbMap; }
+ sal_Bool IsMapMode() const { return mbMap; }
void SetRefPoint();
void SetRefPoint( const Point& rRefPoint );
const Point& GetRefPoint() const { return maRefPoint; }
- BOOL IsRefPoint() const { return mbRefPoint; }
+ sal_Bool IsRefPoint() const { return mbRefPoint; }
// #i75163#
basegfx::B2DHomMatrix GetViewTransformation() const;
@@ -1032,7 +1033,7 @@ public:
const MapMode* pMapModeSource,
const MapMode* pMapModeDest ) const;
long* LogicToLogic( long* pX,
- USHORT nCount,
+ sal_uInt16 nCount,
const MapMode* pMapModeSource,
const MapMode* pMapModeDest ) const;
static Point LogicToLogic( const Point& rPtSource,
@@ -1068,16 +1069,16 @@ public:
void Erase();
void Erase( const Rectangle& rRect ) { DrawWallpaper( rRect, GetBackground() ); }
- BOOL AddTempDevFont( const String& rFileURL, const String& rFontName );
+ sal_Bool AddTempDevFont( const String& rFileURL, const String& rFontName );
int GetDevFontCount() const;
FontInfo GetDevFont( int nDevFontIndex ) const;
int GetDevFontSizeCount( const Font& ) const;
Size GetDevFontSize( const Font& rFont, int nSizeIndex ) const;
- BOOL IsFontAvailable( const String& rFontName ) const;
+ sal_Bool IsFontAvailable( const String& rFontName ) const;
FontMetric GetFontMetric() const;
FontMetric GetFontMetric( const Font& rFont ) const;
- BOOL GetFontCharMap( FontCharMap& rFontCharMap ) const;
+ sal_Bool GetFontCharMap( FontCharMap& rFontCharMap ) const;
bool GetFontCapabilities( vcl::FontCapabilities& rFontCapabilities ) const;
xub_StrLen HasGlyphs( const Font& rFont, const String& rStr,
@@ -1096,9 +1097,9 @@ public:
xub_StrLen* pKashidaPosDropped // invalid kashida positions (out)
) const;
- USHORT GetBitCount() const;
+ sal_uInt16 GetBitCount() const;
- BOOL GetTextIsRTL( const String&, xub_StrLen nIndex,
+ sal_Bool GetTextIsRTL( const String&, xub_StrLen nIndex,
xub_StrLen nLen ) const;
/** Query the existence and depth of the alpha channel
@@ -1106,21 +1107,25 @@ public:
@return 0, if no alpha channel available, and the bit depth of
the alpha channel otherwise.
*/
- USHORT GetAlphaBitCount() const;
- ULONG GetColorCount() const;
+ sal_uInt16 GetAlphaBitCount() const;
+ sal_uLong GetColorCount() const;
- void Push( USHORT nFlags = PUSH_ALL );
+ void Push( sal_uInt16 nFlags = PUSH_ALL );
void Pop();
+ // returns the curren stack depth; that is the number of Push() calls minus the number of Pop() calls
+ // this should not normally be used since Push and Pop must always be used symmetrically
+ // however this may be e.g. a help when debugging code in which this somehow is not the case
+ sal_uInt32 GetGCStackDepth() const;
/** Query availability of alpha channel
- @return TRUE, if this device has an alpha channel.
+ @return sal_True, if this device has an alpha channel.
*/
- BOOL HasAlpha();
+ sal_Bool HasAlpha();
/** Added return value to see if EPS could be painted directly.
Theoreticaly, handing over a matrix would be needed to handle
- painting rotated EPS files (e.g. contained mín Metafiles). This
+ painting rotated EPS files (e.g. contained in Metafiles). This
would then need to be supported for Mac and PS printers, but
that's too much for now, wrote #i107046# for this */
bool DrawEPS( const Point& rPt, const Size& rSz,
@@ -1138,17 +1143,17 @@ public:
static void EndFontSubstitution();
static void AddFontSubstitute( const XubString& rFontName,
const XubString& rReplaceFontName,
- USHORT nFlags = 0 );
- static void RemoveFontSubstitute( USHORT n );
- static USHORT GetFontSubstituteCount();
- static void GetFontSubstitute( USHORT n,
+ sal_uInt16 nFlags = 0 );
+ static void RemoveFontSubstitute( sal_uInt16 n );
+ static sal_uInt16 GetFontSubstituteCount();
+ static void GetFontSubstitute( sal_uInt16 n,
XubString& rFontName,
XubString& rReplaceFontName,
- USHORT& rFlags );
+ sal_uInt16& rFlags );
- static Font GetDefaultFont( USHORT nType,
+ static Font GetDefaultFont( sal_uInt16 nType,
LanguageType eLang,
- ULONG nFlags,
+ sal_uLong nFlags,
const OutputDevice* pOutDev = NULL );
/** helper method removing transparencies from a metafile (e.g. for printing)
@@ -1192,17 +1197,17 @@ public:
// These all just call through to the private mpGraphics functions of the same name.
// Query the platform layer for control support
- BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
+ sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart );
// Query the native control to determine if it was acted upon
- BOOL HitTestNativeControl( ControlType nType,
+ sal_Bool HitTestNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
const Point& aPos,
- BOOL& rIsInside );
+ sal_Bool& rIsInside );
// Request rendering of a particular control and/or part
- BOOL DrawNativeControl( ControlType nType,
+ sal_Bool DrawNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -1210,7 +1215,7 @@ public:
::rtl::OUString aCaption );
// Request rendering of a caption string for a control
- BOOL DrawNativeControlText( ControlType nType,
+ sal_Bool DrawNativeControlText( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -1218,7 +1223,7 @@ public:
::rtl::OUString aCaption );
// Query the native control's actual drawing region (including adornment)
- BOOL GetNativeControlRegion( ControlType nType,
+ sal_Bool GetNativeControlRegion( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
diff --git a/vcl/inc/vcl/outfont.hxx b/vcl/inc/vcl/outfont.hxx
index 17492c14a3be..faf2b00793f2 100644
--- a/vcl/inc/vcl/outfont.hxx
+++ b/vcl/inc/vcl/outfont.hxx
@@ -39,8 +39,6 @@
#include <boost/unordered_map.hpp>
-#include <com/sun/star/linguistic2/XLinguServiceManager.hpp>
-
class ImplDevFontListData;
class ImplGetDevFontList;
class ImplGetDevSizeList;
@@ -54,6 +52,8 @@ class ConvertChar;
struct FontMatchStatus;
class OutputDevice;
+namespace com { namespace sun { namespace star { namespace lang { struct Locale; }}}}
+
// ----------------------
// - ImplFontAttributes -
// ----------------------
@@ -116,7 +116,7 @@ public: // TODO: hide members behind accessor methods
// TODO: make cloning cheaper
// abstract base class for physical font faces
-class VCL_DLLPUBLIC ImplFontData : public ImplDevFontAttributes
+class VCL_PLUGIN_PUBLIC ImplFontData : public ImplDevFontAttributes
{
public:
// by using an ImplFontData object as a factory for its corresponding
@@ -140,7 +140,7 @@ public:
virtual ImplFontData* Clone() const = 0;
protected:
- ImplFontData( const ImplDevFontAttributes&, int nMagic );
+ explicit ImplFontData( const ImplDevFontAttributes&, int nMagic );
void SetBitmapSize( int nW, int nH ) { mnWidth=nW; mnHeight=nH; }
long mnWidth; // Width (in pixels)
@@ -185,7 +185,7 @@ public: // TODO: change to private
// TODO: merge with ImplFontCache
// TODO: rename to LogicalFontManager
-class VCL_DLLPUBLIC ImplDevFontList
+class VCL_PLUGIN_PUBLIC ImplDevFontList
{
private:
friend class WinGlyphFallbackSubstititution;
@@ -199,8 +199,8 @@ private:
ImplGlyphFallbackFontSubstitution* mpFallbackHook; // device specific glyh fallback substitution
public:
- ImplDevFontList();
- ~ImplDevFontList();
+ explicit ImplDevFontList();
+ virtual ~ImplDevFontList();
// fill the list with device fonts
void Add( ImplFontData* );
@@ -226,7 +226,7 @@ public:
ImplGetDevSizeList* GetDevSizeList( const String& rFontName ) const;
//used by 2-level font fallback
- ImplDevFontListData* ImplFindByLocale(com::sun::star::lang::Locale lc) const;
+ ImplDevFontListData* ImplFindByLocale( com::sun::star::lang::Locale& ) const;
protected:
void InitMatchData() const;
@@ -235,7 +235,7 @@ protected:
ImplDevFontListData* ImplFindByTokenNames( const String& ) const;
ImplDevFontListData* ImplFindByAliasName( const String& rSearchName, const String& rShortName ) const;
ImplDevFontListData* ImplFindBySubstFontAttr( const utl::FontNameAttr& ) const;
- ImplDevFontListData* ImplFindByAttributes( ULONG nSearchType, FontWeight, FontWidth,
+ ImplDevFontListData* ImplFindByAttributes( sal_uLong nSearchType, FontWeight, FontWidth,
FontFamily, FontItalic, const String& rSearchFamily ) const;
ImplDevFontListData* FindDefaultFont() const;
@@ -254,8 +254,8 @@ private:
struct ImplKernPairData
{
- USHORT mnChar1;
- USHORT mnChar2;
+ sal_uInt16 mnChar1;
+ sal_uInt16 mnChar2;
long mnKern;
};
@@ -267,7 +267,7 @@ struct ImplKernPairData
class ImplFontMetricData : public ImplFontAttributes
{
public:
- ImplFontMetricData( const ImplFontSelectData& );
+ explicit ImplFontMetricData( const ImplFontSelectData& );
void ImplInitTextLineSize( const OutputDevice* pDev );
void ImplInitAboveTextLineSize();
@@ -324,10 +324,10 @@ public: // TODO: hide members behind accessor methods
// TODO: rename ImplFontEntry to LogicalFontInstance
// TODO: allow sharing of metrics for related fonts
-class VCL_DLLPUBLIC ImplFontEntry
+class VCL_PLUGIN_PUBLIC ImplFontEntry
{
public:
- ImplFontEntry( const ImplFontSelectData& );
+ explicit ImplFontEntry( const ImplFontSelectData& );
virtual ~ImplFontEntry();
public: // TODO: make data members private
@@ -335,8 +335,8 @@ public: // TODO: make data members private
ImplFontMetricData maMetric; // Font Metric
const ConvertChar* mpConversion; // used e.g. for StarBats->StarSymbol
long mnLineHeight;
- ULONG mnRefCount;
- USHORT mnSetFontFlags; // Flags returned by SalGraphics::SetFont()
+ sal_uLong mnRefCount;
+ sal_uInt16 mnSetFontFlags; // Flags returned by SalGraphics::SetFont()
short mnOwnOrientation; // text angle if lower layers don't rotate text themselves
short mnOrientation; // text angle in 3600 system
bool mbInit; // true if maMetric member is valid
@@ -393,7 +393,7 @@ public:
void AddLine( ImplTextLineInfo* pLine );
void Clear();
- ImplTextLineInfo* GetLine( USHORT nLine ) const
+ ImplTextLineInfo* GetLine( sal_uInt16 nLine ) const
{ return mpLines[nLine]; }
xub_StrLen Count() const { return mnLines; }
diff --git a/vcl/inc/vcl/pdfextoutdevdata.hxx b/vcl/inc/vcl/pdfextoutdevdata.hxx
index 804e8c03287e..f4b8039fc9e8 100644
--- a/vcl/inc/vcl/pdfextoutdevdata.hxx
+++ b/vcl/inc/vcl/pdfextoutdevdata.hxx
@@ -171,7 +171,7 @@ public :
rOutputRect, e.g. for cropped graphics.
*/
void EndGroup( const Graphic& rGraphic,
- BYTE nTransparency,
+ sal_uInt8 nTransparency,
const Rectangle& rOutputRect,
const Rectangle& rVisibleOutputRect );
//--->i56629
diff --git a/vcl/inc/vcl/pdfwriter.hxx b/vcl/inc/vcl/pdfwriter.hxx
index f87ef312c8de..b1f76046678d 100644
--- a/vcl/inc/vcl/pdfwriter.hxx
+++ b/vcl/inc/vcl/pdfwriter.hxx
@@ -39,7 +39,8 @@
#include <vcl/font.hxx>
#include <vcl/graphictools.hxx>
-#include <com/sun/star/io/XOutputStream.hpp>
+#include "com/sun/star/io/XOutputStream.hpp"
+#include "com/sun/star/beans/XMaterialHolder.hpp"
#include <list>
#include <vector>
@@ -48,6 +49,7 @@
class Font;
class Point;
class OutputDevice;
+class GDIMetaFile;
class MapMode;
class Polygon;
class LineInfo;
@@ -62,15 +64,7 @@ class Wallpaper;
namespace vcl
{
-struct PDFDocInfo
-{
- String Title; // document title
- String Author; // document author
- String Subject; // subject
- String Keywords; // keywords
- String Creator; // application that created the original document
- String Producer; // OpenOffice
-};
+class PDFExtOutDevData;
struct PDFNote
{
@@ -236,7 +230,7 @@ public:
rtl::OUString Name; // a distinct name to identify the control
rtl::OUString Description;// descriptive text for the contro (e.g. for tool tip)
rtl::OUString Text; // user text to appear on the control
- USHORT TextStyle; // style flags
+ sal_uInt16 TextStyle; // style flags
bool ReadOnly;
Rectangle Location; // describes the area filled by the control
bool Border; // true: widget should have a border, false: no border
@@ -469,7 +463,7 @@ public:
FitVisible,
ActionZoom
};
-// These emuns are treated as integer while reading/writing to configuration
+// These enums are treated as integer while reading/writing to configuration
enum PDFPageLayout
{
DefaultLayout,
@@ -490,20 +484,35 @@ public:
/*
The following structure describes the permissions used in PDF security
*/
- struct PDFSecPermissions
+ struct PDFEncryptionProperties
{
-//for both 40 and 128 bit security, see 3.5.2 PDF v 1.4 table 3.15, v 1.5 and v 1.6 table 3.20.
- bool CanPrintTheDocument;
+
+ bool Security128bit; // true to select 128 bit encryption, false for 40 bit
+ //for both 40 and 128 bit security, see 3.5.2 PDF v 1.4 table 3.15, v 1.5 and v 1.6 table 3.20.
+ bool CanPrintTheDocument;
bool CanModifyTheContent;
bool CanCopyOrExtract;
bool CanAddOrModify;
-//for revision 3 (bit 128 security) only
+ //for revision 3 (bit 128 security) only
bool CanFillInteractive;
bool CanExtractForAccessibility;
bool CanAssemble;
bool CanPrintFull;
-//permission default set for 128 bit, accessibility only
- PDFSecPermissions() :
+
+ // encryption will only happen if EncryptionKey is not empty
+ // EncryptionKey is actually a construct out of OValue, UValue and DocumentIdentifier
+ // if these do not match, behavior is undefined, most likely an invalid PDF will be produced
+ // OValue, UValue, EncryptionKey and DocumentIdentifier can be computed from
+ // PDFDocInfo, Owner password and User password used the InitEncryption method which
+ // implements the algorithms described in the PDF reference chapter 3.5: Encryption
+ std::vector<sal_uInt8> OValue;
+ std::vector<sal_uInt8> UValue;
+ std::vector<sal_uInt8> EncryptionKey;
+ std::vector<sal_uInt8> DocumentIdentifier;
+
+ //permission default set for 128 bit, accessibility only
+ PDFEncryptionProperties() :
+ Security128bit ( true ),
CanPrintTheDocument ( false ),
CanModifyTheContent ( false ),
CanCopyOrExtract ( false ),
@@ -513,6 +522,25 @@ The following structure describes the permissions used in PDF security
CanAssemble ( false ),
CanPrintFull ( false )
{}
+
+
+ bool Encrypt() const
+ { return ! OValue.empty() && ! UValue.empty() && ! DocumentIdentifier.empty(); }
+ };
+
+ struct PDFDocInfo
+ {
+ String Title; // document title
+ String Author; // document author
+ String Subject; // subject
+ String Keywords; // keywords
+ String Creator; // application that created the original document
+ String Producer; // OpenOffice
+ };
+
+ enum ColorMode
+ {
+ DrawColor, DrawGreyscale
};
struct PDFWriterContext
@@ -571,14 +599,13 @@ The following structure describes the permissions used in PDF security
sal_Int32 InitialPage;
sal_Int32 OpenBookmarkLevels; // -1 means all levels
- struct PDFSecPermissions AccessPermissions;
-
- bool Encrypt; // main encryption flag, must be true to encript
- bool Security128bit; // true to select 128 bit encryption, false for 40 bit
- rtl::OUString OwnerPassword; // owner password for PDF, in clear text
- rtl::OUString UserPassword; // user password for PDF, in clear text
+ PDFWriter::PDFEncryptionProperties Encryption;
+ PDFWriter::PDFDocInfo DocumentInfo;
com::sun::star::lang::Locale DocumentLocale; // defines the document default language
+ sal_uInt32 DPIx, DPIy; // how to handle MapMode( MAP_PIXEL )
+ // 0 here specifies a default handling
+ PDFWriter::ColorMode ColorMode;
PDFWriterContext() :
RelFsys( false ), //i56629, i49415?, i64585?
@@ -605,13 +632,14 @@ The following structure describes the permissions used in PDF security
FirstPageLeft( false ),
InitialPage( 1 ),
OpenBookmarkLevels( -1 ),
- AccessPermissions( ),
- Encrypt( false ),
- Security128bit( true )
+ Encryption(),
+ DPIx( 0 ),
+ DPIy( 0 ),
+ ColorMode( PDFWriter::DrawColor )
{}
};
- PDFWriter( const PDFWriterContext& rContext );
+ PDFWriter( const PDFWriterContext& rContext, const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& );
~PDFWriter();
/** Returns an OutputDevice for formatting
@@ -636,17 +664,24 @@ The following structure describes the permissions used in PDF security
returns the page id of the new page
*/
sal_Int32 NewPage( sal_Int32 nPageWidth = 0, sal_Int32 nPageHeight = 0, Orientation eOrientation = Inherit );
+ /** Play a metafile like an outputdevice would do
+ */
+ struct PlayMetafileContext
+ {
+ int m_nMaxImageResolution;
+ bool m_bOnlyLosslessCompression;
+ int m_nJPEGQuality;
+ bool m_bTransparenciesWereRemoved;
+
+ PlayMetafileContext()
+ : m_nMaxImageResolution( 0 )
+ , m_bOnlyLosslessCompression( false )
+ , m_nJPEGQuality( 90 )
+ , m_bTransparenciesWereRemoved( false )
+ {}
- /*
- * set document info; due to the use of document information in building the PDF document ID, must be called before
- * emitting anything.
- */
- void SetDocInfo( const PDFDocInfo& rInfo );
-
- /*
- * get currently set document info
- */
- const PDFDocInfo& GetDocInfo() const;
+ };
+ void PlayMetafile( const GDIMetaFile&, const PlayMetafileContext&, vcl::PDFExtOutDevData* pDevDat = NULL );
/* sets the document locale originally passed with the context to a new value
* only affects the output if used before calling <code>Emit/code>.
@@ -665,9 +700,15 @@ The following structure describes the permissions used in PDF security
PDFVersion GetVersion() const;
+ static com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >
+ InitEncryption( const rtl::OUString& i_rOwnerPassword,
+ const rtl::OUString& i_rUserPassword,
+ bool b128Bit
+ );
+
/* functions for graphics state */
/* flag values: see vcl/outdev.hxx */
- void Push( USHORT nFlags = 0xffff );
+ void Push( sal_uInt16 nFlags = 0xffff );
void Pop();
void SetClipRegion();
@@ -676,9 +717,9 @@ The following structure describes the permissions used in PDF security
void IntersectClipRegion( const Rectangle& rRect );
void IntersectClipRegion( const basegfx::B2DPolyPolygon& rRegion );
- void SetAntialiasing( USHORT nMode = 0 );
+ void SetAntialiasing( sal_uInt16 nMode = 0 );
- void SetLayoutMode( ULONG nMode );
+ void SetLayoutMode( sal_uLong nMode );
void SetDigitLanguage( LanguageType eLang );
void SetLineColor( const Color& rColor );
@@ -709,16 +750,16 @@ The following structure describes the permissions used in PDF security
FontStrikeout eStrikeout,
FontUnderline eUnderline,
FontUnderline eOverline,
- BOOL bUnderlineAbove = FALSE );
+ sal_Bool bUnderlineAbove = sal_False );
void DrawTextArray( const Point& rStartPt, const XubString& rStr,
const sal_Int32* pDXAry = NULL,
xub_StrLen nIndex = 0,
xub_StrLen nLen = STRING_LEN );
- void DrawStretchText( const Point& rStartPt, ULONG nWidth,
+ void DrawStretchText( const Point& rStartPt, sal_uLong nWidth,
const XubString& rStr,
xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN );
void DrawText( const Rectangle& rRect,
- const XubString& rStr, USHORT nStyle = 0 );
+ const XubString& rStr, sal_uInt16 nStyle = 0 );
void DrawPixel( const Point& rPt, const Color& rColor );
void DrawPixel( const Point& rPt )
@@ -738,7 +779,7 @@ The following structure describes the permissions used in PDF security
void DrawPolyPolygon( const PolyPolygon& rPolyPoly );
void DrawRect( const Rectangle& rRect );
void DrawRect( const Rectangle& rRect,
- ULONG nHorzRount, ULONG nVertRound );
+ sal_uLong nHorzRount, sal_uLong nVertRound );
void DrawEllipse( const Rectangle& rRect );
void DrawArc( const Rectangle& rRect,
const Point& rStartPt, const Point& rEndPt );
@@ -778,7 +819,7 @@ The following structure describes the permissions used in PDF security
void DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpaper );
void DrawTransparent( const PolyPolygon& rPolyPoly,
- USHORT nTransparencePercent );
+ sal_uInt16 nTransparencePercent );
/** Start a transparency group
@@ -811,7 +852,7 @@ The following structure describes the permissions used in PDF security
@param nTransparencePercent
The transparency factor
*/
- void EndTransparencyGroup( const Rectangle& rBoundRect, USHORT nTransparencePercent );
+ void EndTransparencyGroup( const Rectangle& rBoundRect, sal_uInt16 nTransparencePercent );
/** End a transparency group with an alpha mask
diff --git a/vcl/inc/vcl/pointr.hxx b/vcl/inc/vcl/pointr.hxx
index f003300b1f56..d5d2a49b33f0 100644
--- a/vcl/inc/vcl/pointr.hxx
+++ b/vcl/inc/vcl/pointr.hxx
@@ -51,9 +51,9 @@ public:
PointerStyle GetStyle() const { return meStyle; }
- BOOL operator==( const Pointer& rPointer ) const
+ sal_Bool operator==( const Pointer& rPointer ) const
{ return (meStyle == rPointer.meStyle); }
- BOOL operator!=( const Pointer& rPointer ) const
+ sal_Bool operator!=( const Pointer& rPointer ) const
{ return !(Pointer::operator==( rPointer )); }
};
diff --git a/vcl/inc/vcl/polyscan.hxx b/vcl/inc/vcl/polyscan.hxx
index a8d9b6a31b5a..da91477f6a67 100644
--- a/vcl/inc/vcl/polyscan.hxx
+++ b/vcl/inc/vcl/polyscan.hxx
@@ -90,26 +90,26 @@ public:
void Set( long nStart, long nEnd );
void Set( const PolyScanSegment& rSegment ) { Set( rSegment.mnStart, rSegment.mnEnd ); }
- inline BOOL GetFirstX( long& rX );
- inline BOOL GetNextX( long& rX );
+ inline sal_Bool GetFirstX( long& rX );
+ inline sal_Bool GetNextX( long& rX );
- BOOL GetFirstSegment( PolyScanSegment& rSegment );
- BOOL GetNextSegment( PolyScanSegment& rSegment );
+ sal_Bool GetFirstSegment( PolyScanSegment& rSegment );
+ sal_Bool GetNextSegment( PolyScanSegment& rSegment );
};
// ------------------------------------------------------------------------
-inline BOOL PolyScanline::GetFirstX( long& rX )
+inline sal_Bool PolyScanline::GetFirstX( long& rX )
{
mpAct = mpFirst;
- return( mpAct ? ( rX = mpAct->mnX, mpAct = mpAct->mpNext, TRUE ) : FALSE );
+ return( mpAct ? ( rX = mpAct->mnX, mpAct = mpAct->mpNext, sal_True ) : sal_False );
}
// ------------------------------------------------------------------------
-inline BOOL PolyScanline::GetNextX( long& rX )
+inline sal_Bool PolyScanline::GetNextX( long& rX )
{
- return( mpAct ? ( rX = mpAct->mnX, mpAct = mpAct->mpNext, TRUE ) : FALSE );
+ return( mpAct ? ( rX = mpAct->mnX, mpAct = mpAct->mpNext, sal_True ) : sal_False );
}
// ---------------
@@ -149,8 +149,8 @@ public:
Rectangle GetBoundRect() const { return Rectangle( mnLeft, mnTop, mnRight, mnBottom ); }
- ULONG Count() const { return Height(); }
- PolyScanline* operator[]( ULONG nPos ) const;
+ sal_uLong Count() const { return Height(); }
+ PolyScanline* operator[]( sal_uLong nPos ) const;
};
#endif // _SV_POLYSCAN_HXX
diff --git a/vcl/inc/vcl/ppdparser.hxx b/vcl/inc/vcl/ppdparser.hxx
index e5ebf05c9415..846835e22d3b 100644
--- a/vcl/inc/vcl/ppdparser.hxx
+++ b/vcl/inc/vcl/ppdparser.hxx
@@ -154,7 +154,7 @@ private:
// some basic attributes
bool m_bColorDevice;
bool m_bType42Capable;
- ULONG m_nLanguageLevel;
+ sal_uLong m_nLanguageLevel;
rtl_TextEncoding m_aFileEncoding;
@@ -216,7 +216,7 @@ public:
bool isColorDevice() const { return m_bColorDevice; }
bool isType42Capable() const { return m_bType42Capable; }
- ULONG getLanguageLevel() const { return m_nLanguageLevel; }
+ sal_uLong getLanguageLevel() const { return m_nLanguageLevel; }
String getDefaultPaperDimension() const;
void getDefaultPaperDimension( int& rWidth, int& rHeight ) const
@@ -324,8 +324,8 @@ public:
void getUnconstrainedValues( const PPDKey*, ::std::list< const PPDValue* >& rValues );
// for printer setup
- void* getStreamableBuffer( ULONG& rBytes ) const;
- void rebuildFromStreamBuffer( void* pBuffer, ULONG nBytes );
+ void* getStreamableBuffer( sal_uLong& rBytes ) const;
+ void rebuildFromStreamBuffer( void* pBuffer, sal_uLong nBytes );
// convenience
int getRenderResolution() const;
diff --git a/vcl/inc/vcl/print.h b/vcl/inc/vcl/print.h
index 4fe4722714c4..db236f2a0f17 100644
--- a/vcl/inc/vcl/print.h
+++ b/vcl/inc/vcl/print.h
@@ -56,7 +56,7 @@ struct ImplPrnQueueData
// - ImplPrnQueueList -
// --------------------
-class VCL_DLLPUBLIC ImplPrnQueueList
+class VCL_PLUGIN_PUBLIC ImplPrnQueueList
{
public:
boost::unordered_map< rtl::OUString, sal_Int32, rtl::OUStringHash >
diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx
index 8214f3425848..182258aeb3c1 100644
--- a/vcl/inc/vcl/print.hxx
+++ b/vcl/inc/vcl/print.hxx
@@ -77,18 +77,18 @@ class VCL_DLLPUBLIC PrinterPage
{
GDIMetaFile* mpMtf;
JobSetup maJobSetup;
- UINT16 mbNewJobSetup;
+ sal_uInt16 mbNewJobSetup;
public:
PrinterPage() : mpMtf( new GDIMetaFile() ) {}
- PrinterPage( GDIMetaFile* pMtf, BOOL bNewJobSetup, const JobSetup& rSetup ) :
+ PrinterPage( GDIMetaFile* pMtf, sal_Bool bNewJobSetup, const JobSetup& rSetup ) :
mpMtf( pMtf ), maJobSetup( rSetup ), mbNewJobSetup( bNewJobSetup ) {}
~PrinterPage() { delete mpMtf; }
GDIMetaFile* GetGDIMetaFile() const { return mpMtf; }
const JobSetup& GetJobSetup() const { return maJobSetup; }
- BOOL IsNewJobSetup() const { return (mbNewJobSetup != 0); }
+ sal_Bool IsNewJobSetup() const { return (mbNewJobSetup != 0); }
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const PrinterPage& rPage )
{ rOStm << rPage.mbNewJobSetup; rOStm << rPage.maJobSetup; rPage.mpMtf->Write( rOStm ); return rOStm; }
@@ -164,51 +164,56 @@ class VCL_DLLPUBLIC PrinterOptions
{
private:
- BOOL mbReduceTransparency;
+ sal_Bool mbReduceTransparency;
PrinterTransparencyMode meReducedTransparencyMode;
- BOOL mbReduceGradients;
+ sal_Bool mbReduceGradients;
PrinterGradientMode meReducedGradientsMode;
- USHORT mnReducedGradientStepCount;
- BOOL mbReduceBitmaps;
+ sal_uInt16 mnReducedGradientStepCount;
+ sal_Bool mbReduceBitmaps;
PrinterBitmapMode meReducedBitmapMode;
- USHORT mnReducedBitmapResolution;
- BOOL mbReducedBitmapsIncludeTransparency;
- BOOL mbConvertToGreyscales;
+ sal_uInt16 mnReducedBitmapResolution;
+ sal_Bool mbReducedBitmapsIncludeTransparency;
+ sal_Bool mbConvertToGreyscales;
public:
PrinterOptions();
~PrinterOptions();
- BOOL IsReduceTransparency() const { return mbReduceTransparency; }
- void SetReduceTransparency( BOOL bSet ) { mbReduceTransparency = bSet; }
+ sal_Bool IsReduceTransparency() const { return mbReduceTransparency; }
+ void SetReduceTransparency( sal_Bool bSet ) { mbReduceTransparency = bSet; }
PrinterTransparencyMode GetReducedTransparencyMode() const { return meReducedTransparencyMode; }
void SetReducedTransparencyMode( PrinterTransparencyMode eMode ) { meReducedTransparencyMode = eMode; }
- BOOL IsReduceGradients() const { return mbReduceGradients; }
- void SetReduceGradients( BOOL bSet ) { mbReduceGradients = bSet; }
+ sal_Bool IsReduceGradients() const { return mbReduceGradients; }
+ void SetReduceGradients( sal_Bool bSet ) { mbReduceGradients = bSet; }
PrinterGradientMode GetReducedGradientMode() const { return meReducedGradientsMode; }
void SetReducedGradientMode( PrinterGradientMode eMode ) { meReducedGradientsMode = eMode; }
- USHORT GetReducedGradientStepCount() const { return mnReducedGradientStepCount; }
- void SetReducedGradientStepCount( USHORT nStepCount ) { mnReducedGradientStepCount = nStepCount; }
+ sal_uInt16 GetReducedGradientStepCount() const { return mnReducedGradientStepCount; }
+ void SetReducedGradientStepCount( sal_uInt16 nStepCount ) { mnReducedGradientStepCount = nStepCount; }
- BOOL IsReduceBitmaps() const { return mbReduceBitmaps; }
- void SetReduceBitmaps( BOOL bSet ) { mbReduceBitmaps = bSet; }
+ sal_Bool IsReduceBitmaps() const { return mbReduceBitmaps; }
+ void SetReduceBitmaps( sal_Bool bSet ) { mbReduceBitmaps = bSet; }
PrinterBitmapMode GetReducedBitmapMode() const { return meReducedBitmapMode; }
void SetReducedBitmapMode( PrinterBitmapMode eMode ) { meReducedBitmapMode = eMode; }
- USHORT GetReducedBitmapResolution() const { return mnReducedBitmapResolution; }
- void SetReducedBitmapResolution( USHORT nResolution ) { mnReducedBitmapResolution = nResolution; }
+ sal_uInt16 GetReducedBitmapResolution() const { return mnReducedBitmapResolution; }
+ void SetReducedBitmapResolution( sal_uInt16 nResolution ) { mnReducedBitmapResolution = nResolution; }
- BOOL IsReducedBitmapIncludesTransparency() const { return mbReducedBitmapsIncludeTransparency; }
- void SetReducedBitmapIncludesTransparency( BOOL bSet ) { mbReducedBitmapsIncludeTransparency = bSet; }
+ sal_Bool IsReducedBitmapIncludesTransparency() const { return mbReducedBitmapsIncludeTransparency; }
+ void SetReducedBitmapIncludesTransparency( sal_Bool bSet ) { mbReducedBitmapsIncludeTransparency = bSet; }
- BOOL IsConvertToGreyscales() const { return mbConvertToGreyscales; }
- void SetConvertToGreyscales( BOOL bSet ) { mbConvertToGreyscales = bSet; }
+ sal_Bool IsConvertToGreyscales() const { return mbConvertToGreyscales; }
+ void SetConvertToGreyscales( sal_Bool bSet ) { mbConvertToGreyscales = bSet; }
+
+ // read printer options from configuration, parameter decides whether the set for
+ // print "to printer" or "to file" should be read.
+ // returns true if config was read, false if an error occured
+ bool ReadFromConfig( bool bFile );
};
// -----------
@@ -235,21 +240,21 @@ private:
JobSetup maJobSetup;
Point maPageOffset;
Size maPaperSize;
- ULONG mnError;
- USHORT mnCurPage;
- USHORT mnCurPrintPage;
- USHORT mnPageQueueSize;
- USHORT mnCopyCount;
- BOOL mbDefPrinter;
- BOOL mbPrinting;
- BOOL mbJobActive;
- BOOL mbCollateCopy;
- BOOL mbPrintFile;
- BOOL mbInPrintPage;
- BOOL mbNewJobSetup;
- BOOL mbIsQueuePrinter;
- BOOL mbUserSetupCompleted;
- BOOL mbUserSetupResult;
+ sal_uLong mnError;
+ sal_uInt16 mnCurPage;
+ sal_uInt16 mnCurPrintPage;
+ sal_uInt16 mnPageQueueSize;
+ sal_uInt16 mnCopyCount;
+ sal_Bool mbDefPrinter;
+ sal_Bool mbPrinting;
+ sal_Bool mbJobActive;
+ sal_Bool mbCollateCopy;
+ sal_Bool mbPrintFile;
+ sal_Bool mbInPrintPage;
+ sal_Bool mbNewJobSetup;
+ sal_Bool mbIsQueuePrinter;
+ sal_Bool mbUserSetupCompleted;
+ sal_Bool mbUserSetupResult;
Link maErrorHdl;
SAL_DLLPRIVATE void ImplInitData();
@@ -264,11 +269,11 @@ private:
SAL_DLLPRIVATE bool StartJob( const rtl::OUString& rJobName, boost::shared_ptr<vcl::PrinterController>& );
- static SAL_DLLPRIVATE ULONG ImplSalPrinterErrorCodeToVCL( ULONG nError );
+ static SAL_DLLPRIVATE sal_uLong ImplSalPrinterErrorCodeToVCL( sal_uLong nError );
private:
SAL_DLLPRIVATE void ImplEndPrint();
- SAL_DLLPRIVATE BOOL EndJob();
+ SAL_DLLPRIVATE sal_Bool EndJob();
SAL_DLLPRIVATE Printer( const Printer& rPrinter );
SAL_DLLPRIVATE Printer& operator =( const Printer& rPrinter );
public:
@@ -280,8 +285,8 @@ public:
protected:
- void SetSelfAsQueuePrinter( BOOL bQueuePrinter ) { mbIsQueuePrinter = bQueuePrinter; }
- BOOL IsQueuePrinter() const { return mbIsQueuePrinter; }
+ void SetSelfAsQueuePrinter( sal_Bool bQueuePrinter ) { mbIsQueuePrinter = bQueuePrinter; }
+ sal_Bool IsQueuePrinter() const { return mbIsQueuePrinter; }
public:
Printer();
@@ -299,68 +304,72 @@ public:
const XubString& GetName() const { return maPrinterName; }
const XubString& GetDriverName() const { return maDriver; }
- BOOL IsDefPrinter() const { return mbDefPrinter; }
- BOOL IsDisplayPrinter() const { return mpDisplayDev != NULL; }
- BOOL IsValid() const { return !IsDisplayPrinter(); }
+ sal_Bool IsDefPrinter() const { return mbDefPrinter; }
+ sal_Bool IsDisplayPrinter() const { return mpDisplayDev != NULL; }
+ sal_Bool IsValid() const { return !IsDisplayPrinter(); }
- ULONG GetCapabilities( USHORT nType ) const;
- BOOL HasSupport( PrinterSupport eFeature ) const;
+ sal_uLong GetCapabilities( sal_uInt16 nType ) const;
+ sal_Bool HasSupport( PrinterSupport eFeature ) const;
- BOOL SetJobSetup( const JobSetup& rSetup );
+ sal_Bool SetJobSetup( const JobSetup& rSetup );
const JobSetup& GetJobSetup() const { return maJobSetup; }
String GetJobValue( const String& rKey ) const { return maJobSetup.GetValue( rKey ); }
void SetJobValue( const String& rKey, const String& rValue ) { maJobSetup.SetValue( rKey, rValue ); }
- BOOL Setup( Window* pWindow = NULL );
- BOOL SetPrinterProps( const Printer* pPrinter );
+ sal_Bool Setup( Window* pWindow = NULL );
+ sal_Bool SetPrinterProps( const Printer* pPrinter );
- void SetPrinterOptions( const PrinterOptions& rOptions ) { *mpPrinterOptions = rOptions; }
+ // SetPrinterOptions is used internally only now
+ // in earlier times it was used only to set the options loaded directly from the configuration
+ // in SfxPrinter::InitJob, this is now handled internally
+ // should the need arise to set the printer options outside vcl, also a method would have to be devised
+ // to not override these again internally
+ SAL_DLLPRIVATE void SetPrinterOptions( const PrinterOptions& rOptions );
const PrinterOptions& GetPrinterOptions() const { return( *mpPrinterOptions ); }
- BOOL SetOrientation( Orientation eOrient );
+ sal_Bool SetOrientation( Orientation eOrient );
Orientation GetOrientation() const;
DuplexMode GetDuplexMode() const;
- BOOL SetDuplexMode( DuplexMode );
+ sal_Bool SetDuplexMode( DuplexMode );
// returns the angle that a landscape page will be turned counterclockwise
// wrt to portrait. The return value may be only valid for
// the current paper
int GetLandscapeAngle() const;
- BOOL SetPaperBin( USHORT nPaperBin );
- USHORT GetPaperBin() const;
- BOOL SetPaper( Paper ePaper );
- BOOL SetPaperSizeUser( const Size& rSize );
- BOOL SetPaperSizeUser( const Size& rSize, bool bMatchNearest );
+ sal_Bool SetPaperBin( sal_uInt16 nPaperBin );
+ sal_uInt16 GetPaperBin() const;
+ sal_Bool SetPaper( Paper ePaper );
+ sal_Bool SetPaperSizeUser( const Size& rSize );
+ sal_Bool SetPaperSizeUser( const Size& rSize, bool bMatchNearest );
Paper GetPaper() const;
+ static rtl::OUString GetPaperName( Paper ePaper );
+ // return a UI string for the current paper; i_bPaperUser == false means an empty string for PAPER_USER
+ rtl::OUString GetPaperName( bool i_bPaperUser = true ) const;
// returns number of available paper formats
int GetPaperInfoCount() const;
// returns info about paper format nPaper
const PaperInfo& GetPaperInfo( int nPaper ) const;
- USHORT GetPaperBinCount() const;
- XubString GetPaperBinName( USHORT nPaperBin ) const;
+ sal_uInt16 GetPaperBinCount() const;
+ XubString GetPaperBinName( sal_uInt16 nPaperBin ) const;
const Size& GetPaperSizePixel() const { return maPaperSize; }
Size GetPaperSize() const { return PixelToLogic( maPaperSize ); }
const Point& GetPageOffsetPixel() const { return maPageOffset; }
Point GetPageOffset() const { return PixelToLogic( maPageOffset ); }
- BOOL SetCopyCount( USHORT nCopy, BOOL bCollate = FALSE );
- USHORT GetCopyCount() const { return mnCopyCount; }
- BOOL IsCollateCopy() const { return mbCollateCopy; }
+ sal_Bool SetCopyCount( sal_uInt16 nCopy, sal_Bool bCollate = sal_False );
+ sal_uInt16 GetCopyCount() const { return mnCopyCount; }
+ sal_Bool IsCollateCopy() const { return mbCollateCopy; }
- BOOL IsPrinting() const { return mbPrinting; }
+ sal_Bool IsPrinting() const { return mbPrinting; }
- void SetPrintFile( const XubString& rFileName ) { maPrintFile = rFileName; }
- const XubString& GetPrintFile() const { return maPrintFile; }
- void EnablePrintFile( BOOL bEnable ) { mbPrintFile = bEnable; }
- BOOL IsPrintFileEnabled() const { return mbPrintFile; }
- BOOL AbortJob();
+ sal_Bool AbortJob();
const XubString& GetCurJobName() const { return maJobName; }
- USHORT GetCurPage() const { return mnCurPage; }
- BOOL IsJobActive() const { return mbJobActive; }
+ sal_uInt16 GetCurPage() const { return mnCurPage; }
+ sal_Bool IsJobActive() const { return mbJobActive; }
- ULONG GetError() const { return ERRCODE_TOERROR(mnError); }
- ULONG GetErrorCode() const { return mnError; }
+ sal_uLong GetError() const { return ERRCODE_TOERROR(mnError); }
+ sal_uLong GetErrorCode() const { return mnError; }
void SetErrorHdl( const Link& rLink ) { maErrorHdl = rLink; }
const Link& GetErrorHdl() const { return maErrorHdl; }
@@ -401,7 +410,7 @@ protected:
PrinterController( const boost::shared_ptr<Printer>& );
public:
enum NupOrderType
- { LRTB, TBLR };
+ { LRTB, TBLR, TBRL, RLTB };
struct MultiPageSetup
{
// all metrics in 100th mm
@@ -479,6 +488,7 @@ public:
*/
void enableUIOption( const rtl::OUString& rPropName, bool bEnable );
bool isUIOptionEnabled( const rtl::OUString& rPropName ) const;
+ bool isUIChoiceEnabled( const rtl::OUString& rPropName, sal_Int32 nChoice ) const;
/* returns the property name rPropName depends on or an empty string
if no dependency exists.
*/
@@ -514,27 +524,31 @@ public:
bool isDirectPrint() const;
// implementation details, not usable outside vcl
- SAL_DLLPRIVATE int getFilteredPageCount();
+ // don't use outside vcl. Some of these are exported for
+ // the benefit of vcl's plugins.
+ // Still: DO NOT USE OUTSIDE VCL
+ VCL_PLUGIN_PUBLIC int getFilteredPageCount();
SAL_DLLPRIVATE PageSize getPageFile( int i_inUnfilteredPage, GDIMetaFile& rMtf, bool i_bMayUseCache = false );
- SAL_DLLPRIVATE PageSize getFilteredPageFile( int i_nFilteredPage, GDIMetaFile& o_rMtf, bool i_bMayUseCache = false );
+ VCL_PLUGIN_PUBLIC PageSize getFilteredPageFile( int i_nFilteredPage, GDIMetaFile& o_rMtf, bool i_bMayUseCache = false );
SAL_DLLPRIVATE void printFilteredPage( int i_nPage );
SAL_DLLPRIVATE void setPrinter( const boost::shared_ptr<Printer>& );
SAL_DLLPRIVATE void setOptionChangeHdl( const Link& );
- SAL_DLLPRIVATE void createProgressDialog();
- SAL_DLLPRIVATE bool isProgressCanceled() const;
+ VCL_PLUGIN_PUBLIC void createProgressDialog();
+ VCL_PLUGIN_PUBLIC bool isProgressCanceled() const;
SAL_DLLPRIVATE void setMultipage( const MultiPageSetup& );
SAL_DLLPRIVATE const MultiPageSetup& getMultipage() const;
- SAL_DLLPRIVATE void setLastPage( sal_Bool i_bLastPage );
+ VCL_PLUGIN_PUBLIC void setLastPage( sal_Bool i_bLastPage );
SAL_DLLPRIVATE void setReversePrint( sal_Bool i_bReverse );
SAL_DLLPRIVATE bool getReversePrint() const;
SAL_DLLPRIVATE void pushPropertiesToPrinter();
- SAL_DLLPRIVATE void setJobState( com::sun::star::view::PrintableState );
+ VCL_PLUGIN_PUBLIC void setJobState( com::sun::star::view::PrintableState );
SAL_DLLPRIVATE bool setupPrinter( Window* i_pDlgParent );
SAL_DLLPRIVATE int getPageCountProtected() const;
SAL_DLLPRIVATE com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getPageParametersProtected( int i_nPage ) const;
- SAL_DLLPRIVATE ULONG removeTransparencies( GDIMetaFile& i_rIn, GDIMetaFile& o_rOut );
+ SAL_DLLPRIVATE sal_uLong removeTransparencies( GDIMetaFile& i_rIn, GDIMetaFile& o_rOut );
+ SAL_DLLPRIVATE void resetPrinterOptions( bool i_bFileOutput );
};
class VCL_DLLPUBLIC PrinterOptionsHelper
@@ -617,28 +631,34 @@ class VCL_DLLPUBLIC PrinterOptionsHelper
, mbEnabled( i_bEnabled ) {}
};
+ // note: in the following helper functions HelpIds are expected as an rtl::OUString
+ // the normal HelpId form is rtl::OString (byte string instead of UTF16 string)
+ // this is because the whole interface is base on UNO properties; in fact the structures
+ // are passed over UNO interfaces. UNO does not know a byte string, hence the string is
+ // transported via UTF16 strings.
+
// general control
static com::sun::star::uno::Any getUIControlOpt( const rtl::OUString& i_rTitle,
- const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpText,
+ const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpId,
const rtl::OUString& i_rType,
const com::sun::star::beans::PropertyValue* i_pValue = NULL,
const UIControlOptions& i_rControlOptions = UIControlOptions()
);
// create a group (e.g. a TabPage); following controls will be grouped in it until the next
// group begins
- static com::sun::star::uno::Any getGroupControlOpt( const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpText );
+ static com::sun::star::uno::Any getGroupControlOpt( const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpId );
// create a subgroup (e.g. a FixedLine); following controls will be grouped in it until the next
// subgroup or group begins
// setting bJobPage = true will make the subgroup appear on the first page of the print dialog
static com::sun::star::uno::Any getSubgroupControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const UIControlOptions& i_rControlOptions = UIControlOptions()
);
// create a bool option (usually a checkbox)
static com::sun::star::uno::Any getBoolControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const rtl::OUString& i_rProperty,
sal_Bool i_bValue,
const UIControlOptions& i_rControlOptions = UIControlOptions()
@@ -646,18 +666,19 @@ class VCL_DLLPUBLIC PrinterOptionsHelper
// create a set of choices (either a radio button group or a list box)
static com::sun::star::uno::Any getChoiceControlOpt( const rtl::OUString& i_rTitle,
- const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpText,
+ const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpId,
const rtl::OUString& i_rProperty,
const com::sun::star::uno::Sequence< rtl::OUString >& i_rChoices,
sal_Int32 i_nValue,
const rtl::OUString& i_rType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Radio" ) ),
+ const com::sun::star::uno::Sequence< sal_Bool >& i_rDisabledChoices = com::sun::star::uno::Sequence< sal_Bool >(),
const UIControlOptions& i_rControlOptions = UIControlOptions()
);
// create an integer range (e.g. a spin field)
// note: max value < min value means do not apply min/max values
static com::sun::star::uno::Any getRangeControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const rtl::OUString& i_rProperty,
sal_Int32 i_nValue,
sal_Int32 i_nMinValue = -1,
@@ -668,7 +689,7 @@ class VCL_DLLPUBLIC PrinterOptionsHelper
// create a string field
// note: max value < min value means do not apply min/max values
static com::sun::star::uno::Any getEditControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const rtl::OUString& i_rProperty,
const rtl::OUString& i_rValue,
const UIControlOptions& i_rControlOptions = UIControlOptions()
diff --git a/vcl/inc/vcl/printergfx.hxx b/vcl/inc/vcl/printergfx.hxx
index fb1df7c94498..8bfd1c69a7d2 100644
--- a/vcl/inc/vcl/printergfx.hxx
+++ b/vcl/inc/vcl/printergfx.hxx
@@ -365,14 +365,14 @@ public:
const Point** pPolygonList);
void DrawPolyLineBezier (sal_uInt32 nPoints,
const Point* pPath,
- const BYTE* pFlgAry );
+ const sal_uInt8* pFlgAry );
void DrawPolygonBezier (sal_uInt32 nPoints,
const Point* pPath,
- const BYTE* pFlgAry);
+ const sal_uInt8* pFlgAry);
void DrawPolyPolygonBezier (sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const Point* const* pPtAry,
- const BYTE* const* pFlgAry);
+ const sal_uInt8* const* pFlgAry);
// eps
sal_Bool DrawEPS ( const Rectangle& rBoundingBox, void* pPtr, sal_uInt32 nSize);
diff --git a/vcl/inc/vcl/printerinfomanager.hxx b/vcl/inc/vcl/printerinfomanager.hxx
index 665f51933688..b6ebc072b8cf 100644
--- a/vcl/inc/vcl/printerinfomanager.hxx
+++ b/vcl/inc/vcl/printerinfomanager.hxx
@@ -157,6 +157,8 @@ public:
// there can only be one
static PrinterInfoManager& get();
+ // only called by SalData destructor, frees the global instance
+ static void release();
// get PrinterInfoManager type
Type getType() const { return m_eType; }
@@ -217,8 +219,10 @@ public:
// this may either be a regular file or the result of popen()
virtual FILE* startSpool( const rtl::OUString& rPrinterName, bool bQuickCommand );
// close the FILE* returned by startSpool and does the actual spooling
+ // set bBanner to "false" will attempt to suppress banner printing
+ // set bBanner to "true" will rely on the system default
// returns a numerical job id
- virtual int endSpool( const rtl::OUString& rPrinterName, const rtl::OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData );
+ virtual int endSpool( const rtl::OUString& rPrinterName, const rtl::OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner );
// for spadmin: whether adding or removing a printer is possible
virtual bool addOrRemovePossible() const;
diff --git a/vcl/inc/vcl/prndlg.hxx b/vcl/inc/vcl/prndlg.hxx
index 7549d1e5ea5e..247998303178 100644
--- a/vcl/inc/vcl/prndlg.hxx
+++ b/vcl/inc/vcl/prndlg.hxx
@@ -60,6 +60,9 @@ namespace vcl
VirtualDevice maPageVDev;
rtl::OUString maReplacementString;
rtl::OUString maToolTipString;
+ bool mbGreyscale;
+ FixedLine maHorzDim;
+ FixedLine maVertDim;
public:
PrintPreviewWindow( Window* pParent, const ResId& );
@@ -70,8 +73,11 @@ namespace vcl
virtual void Resize();
virtual void DataChanged( const DataChangedEvent& );
- void setPreview( const GDIMetaFile&, const Size&, const rtl::OUString&,
- sal_Int32 i_nDPIX, sal_Int32 i_nDPIY
+ void setPreview( const GDIMetaFile&, const Size& i_rPaperSize,
+ const rtl::OUString& i_rPaperName,
+ const rtl::OUString& i_rNoPageString,
+ sal_Int32 i_nDPIX, sal_Int32 i_nDPIY,
+ bool i_bGreyscale
);
};
@@ -126,7 +132,6 @@ namespace vcl
// border around each page
CheckBox maBorderCB;
- vcl::RowOrColumn maLayout;
boost::shared_ptr< vcl::RowOrColumn > mxBrochureDep;
boost::shared_ptr< vcl::LabeledElement >mxPagesBtnLabel;
@@ -142,7 +147,7 @@ namespace vcl
void showAdvancedControls( bool );
- virtual void Resize();
+ // virtual void Resize();
};
class JobTabPage : public TabPage
@@ -166,13 +171,13 @@ namespace vcl
NumericField maCopyCountField;
CheckBox maCollateBox;
FixedImage maCollateImage;
+ CheckBox maReverseOrderBox;
Image maCollateImg;
Image maNoCollateImg;
long mnCollateUIMode;
- vcl::RowOrColumn maLayout;
boost::shared_ptr<vcl::RowOrColumn> mxPrintRange;
boost::shared_ptr<vcl::WindowArranger> mxDetails;
@@ -182,7 +187,7 @@ namespace vcl
void readFromSettings();
void storeToSettings();
- virtual void Resize();
+ // virtual void Resize();
void setupLayout();
};
@@ -193,9 +198,7 @@ namespace vcl
FixedLine maOptionsLine;
CheckBox maToFileBox;
CheckBox maCollateSingleJobsBox;
- CheckBox maReverseOrderBox;
- vcl::RowOrColumn maLayout;
boost::shared_ptr<vcl::RowOrColumn> mxOptGroup;
OutputOptPage( Window*, const ResId& );
@@ -204,7 +207,7 @@ namespace vcl
void readFromSettings();
void storeToSettings();
- virtual void Resize();
+ // virtual void Resize();
void setupLayout();
};
@@ -249,7 +252,6 @@ namespace vcl
rtl::OUString maPrintText;
rtl::OUString maDefPrtText;
- vcl::RowOrColumn maLayout;
boost::shared_ptr<vcl::RowOrColumn> mxPreviewCtrls;
Size maDetailsCollapsedSize;
diff --git a/vcl/inc/vcl/prntypes.hxx b/vcl/inc/vcl/prntypes.hxx
index 086cc7314c7b..13d87a94d3ac 100644
--- a/vcl/inc/vcl/prntypes.hxx
+++ b/vcl/inc/vcl/prntypes.hxx
@@ -49,49 +49,50 @@ enum Orientation { ORIENTATION_PORTRAIT, ORIENTATION_LANDSCAPE };
// - QueueInfo-Types -
// -------------------
-#define QUEUE_STATUS_READY ((ULONG)0x00000001)
-#define QUEUE_STATUS_PAUSED ((ULONG)0x00000002)
-#define QUEUE_STATUS_PENDING_DELETION ((ULONG)0x00000004)
-#define QUEUE_STATUS_BUSY ((ULONG)0x00000008)
-#define QUEUE_STATUS_INITIALIZING ((ULONG)0x00000010)
-#define QUEUE_STATUS_WAITING ((ULONG)0x00000020)
-#define QUEUE_STATUS_WARMING_UP ((ULONG)0x00000040)
-#define QUEUE_STATUS_PROCESSING ((ULONG)0x00000080)
-#define QUEUE_STATUS_PRINTING ((ULONG)0x00000100)
-#define QUEUE_STATUS_OFFLINE ((ULONG)0x00000200)
-#define QUEUE_STATUS_ERROR ((ULONG)0x00000400)
-#define QUEUE_STATUS_SERVER_UNKNOWN ((ULONG)0x00000800)
-#define QUEUE_STATUS_PAPER_JAM ((ULONG)0x00001000)
-#define QUEUE_STATUS_PAPER_OUT ((ULONG)0x00002000)
-#define QUEUE_STATUS_MANUAL_FEED ((ULONG)0x00004000)
-#define QUEUE_STATUS_PAPER_PROBLEM ((ULONG)0x00008000)
-#define QUEUE_STATUS_IO_ACTIVE ((ULONG)0x00010000)
-#define QUEUE_STATUS_OUTPUT_BIN_FULL ((ULONG)0x00020000)
-#define QUEUE_STATUS_TONER_LOW ((ULONG)0x00040000)
-#define QUEUE_STATUS_NO_TONER ((ULONG)0x00080000)
-#define QUEUE_STATUS_PAGE_PUNT ((ULONG)0x00100000)
-#define QUEUE_STATUS_USER_INTERVENTION ((ULONG)0x00200000)
-#define QUEUE_STATUS_OUT_OF_MEMORY ((ULONG)0x00400000)
-#define QUEUE_STATUS_DOOR_OPEN ((ULONG)0x00800000)
-#define QUEUE_STATUS_POWER_SAVE ((ULONG)0x01000000)
+#define QUEUE_STATUS_READY ((sal_uLong)0x00000001)
+#define QUEUE_STATUS_PAUSED ((sal_uLong)0x00000002)
+#define QUEUE_STATUS_PENDING_DELETION ((sal_uLong)0x00000004)
+#define QUEUE_STATUS_BUSY ((sal_uLong)0x00000008)
+#define QUEUE_STATUS_INITIALIZING ((sal_uLong)0x00000010)
+#define QUEUE_STATUS_WAITING ((sal_uLong)0x00000020)
+#define QUEUE_STATUS_WARMING_UP ((sal_uLong)0x00000040)
+#define QUEUE_STATUS_PROCESSING ((sal_uLong)0x00000080)
+#define QUEUE_STATUS_PRINTING ((sal_uLong)0x00000100)
+#define QUEUE_STATUS_OFFLINE ((sal_uLong)0x00000200)
+#define QUEUE_STATUS_ERROR ((sal_uLong)0x00000400)
+#define QUEUE_STATUS_SERVER_UNKNOWN ((sal_uLong)0x00000800)
+#define QUEUE_STATUS_PAPER_JAM ((sal_uLong)0x00001000)
+#define QUEUE_STATUS_PAPER_OUT ((sal_uLong)0x00002000)
+#define QUEUE_STATUS_MANUAL_FEED ((sal_uLong)0x00004000)
+#define QUEUE_STATUS_PAPER_PROBLEM ((sal_uLong)0x00008000)
+#define QUEUE_STATUS_IO_ACTIVE ((sal_uLong)0x00010000)
+#define QUEUE_STATUS_OUTPUT_BIN_FULL ((sal_uLong)0x00020000)
+#define QUEUE_STATUS_TONER_LOW ((sal_uLong)0x00040000)
+#define QUEUE_STATUS_NO_TONER ((sal_uLong)0x00080000)
+#define QUEUE_STATUS_PAGE_PUNT ((sal_uLong)0x00100000)
+#define QUEUE_STATUS_USER_INTERVENTION ((sal_uLong)0x00200000)
+#define QUEUE_STATUS_OUT_OF_MEMORY ((sal_uLong)0x00400000)
+#define QUEUE_STATUS_DOOR_OPEN ((sal_uLong)0x00800000)
+#define QUEUE_STATUS_POWER_SAVE ((sal_uLong)0x01000000)
-#define QUEUE_JOBS_DONTKNOW ((ULONG)0xFFFFFFFF)
+#define QUEUE_JOBS_DONTKNOW ((sal_uLong)0xFFFFFFFF)
// -----------------
// - Printer-Types -
// -----------------
-#define PRINTER_CAPABILITIES_SUPPORTDIALOG ((USHORT)1)
-#define PRINTER_CAPABILITIES_COPIES ((USHORT)2)
-#define PRINTER_CAPABILITIES_COLLATECOPIES ((USHORT)3)
-#define PRINTER_CAPABILITIES_SETORIENTATION ((USHORT)4)
-#define PRINTER_CAPABILITIES_SETPAPERBIN ((USHORT)5)
-#define PRINTER_CAPABILITIES_SETPAPERSIZE ((USHORT)6)
-#define PRINTER_CAPABILITIES_SETPAPER ((USHORT)7)
-#define PRINTER_CAPABILITIES_FAX ((USHORT)8)
-#define PRINTER_CAPABILITIES_PDF ((USHORT)9)
-#define PRINTER_CAPABILITIES_EXTERNALDIALOG ((USHORT)10)
-#define PRINTER_CAPABILITIES_SETDUPLEX ((USHORT)11)
+#define PRINTER_CAPABILITIES_SUPPORTDIALOG ((sal_uInt16)1)
+#define PRINTER_CAPABILITIES_COPIES ((sal_uInt16)2)
+#define PRINTER_CAPABILITIES_COLLATECOPIES ((sal_uInt16)3)
+#define PRINTER_CAPABILITIES_SETORIENTATION ((sal_uInt16)4)
+#define PRINTER_CAPABILITIES_SETPAPERBIN ((sal_uInt16)5)
+#define PRINTER_CAPABILITIES_SETPAPERSIZE ((sal_uInt16)6)
+#define PRINTER_CAPABILITIES_SETPAPER ((sal_uInt16)7)
+#define PRINTER_CAPABILITIES_FAX ((sal_uInt16)8)
+#define PRINTER_CAPABILITIES_PDF ((sal_uInt16)9)
+#define PRINTER_CAPABILITIES_EXTERNALDIALOG ((sal_uInt16)10)
+#define PRINTER_CAPABILITIES_SETDUPLEX ((sal_uInt16)11)
+#define PRINTER_CAPABILITIES_USEPULLMODEL ((sal_uInt16)12)
#endif // _SV_PRNTYPES_HXX
diff --git a/vcl/inc/vcl/ptrstyle.hxx b/vcl/inc/vcl/ptrstyle.hxx
index 75502de85823..1f6b375e81b5 100644
--- a/vcl/inc/vcl/ptrstyle.hxx
+++ b/vcl/inc/vcl/ptrstyle.hxx
@@ -35,7 +35,7 @@
// - Pointer-Types -
// -----------------
-typedef USHORT PointerStyle;
+typedef sal_uInt16 PointerStyle;
#define POINTER_ARROW ((PointerStyle)0)
#define POINTER_NULL ((PointerStyle)1)
diff --git a/vcl/inc/vcl/quickselectionengine.hxx b/vcl/inc/vcl/quickselectionengine.hxx
new file mode 100644
index 000000000000..f70736428010
--- /dev/null
+++ b/vcl/inc/vcl/quickselectionengine.hxx
@@ -0,0 +1,95 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+#ifndef VCL_QUICKSELECTIONENGINE_HXX
+#define VCL_QUICKSELECTIONENGINE_HXX
+
+#include "dllapi.h"
+
+#include <tools/string.hxx>
+
+#include <memory>
+
+class KeyEvent;
+
+//........................................................................
+namespace vcl
+{
+//........................................................................
+
+ typedef const void* StringEntryIdentifier;
+
+ //====================================================================
+ //= ISearchableStringList
+ //====================================================================
+ // TODO: consolidate this with ::vcl::IMnemonicEntryList
+ class SAL_NO_VTABLE VCL_DLLPUBLIC ISearchableStringList
+ {
+ public:
+ /** returns the current entry in the list of searchable strings.
+
+ Search operations will start with this entry.
+ */
+ virtual StringEntryIdentifier CurrentEntry( String& _out_entryText ) const = 0;
+
+ /** returns the next entry in the list.
+
+ The implementation is expected to wrap around. That is, if the given entry denotes the last
+ entry in the list, then NextEntry should return the first entry.
+ */
+ virtual StringEntryIdentifier NextEntry( StringEntryIdentifier _currentEntry, String& _out_entryText ) const = 0;
+
+ /** selects a given entry
+ */
+ virtual void SelectEntry( StringEntryIdentifier _entry ) = 0;
+ };
+
+ //====================================================================
+ //= QuickSelectionEngine
+ //====================================================================
+ struct QuickSelectionEngine_Data;
+ class VCL_DLLPUBLIC QuickSelectionEngine
+ {
+ public:
+ QuickSelectionEngine( ISearchableStringList& _entryList );
+ ~QuickSelectionEngine();
+
+ bool HandleKeyEvent( const KeyEvent& _rKEvt );
+ void Reset();
+
+ private:
+ ::std::auto_ptr< QuickSelectionEngine_Data > m_pData;
+
+ private:
+ QuickSelectionEngine(); // never implemented
+ QuickSelectionEngine( const QuickSelectionEngine& ); // never implemented
+ QuickSelectionEngine& operator=( const QuickSelectionEngine& ); // never implemented
+ };
+
+//........................................................................
+} // namespace vcl
+//........................................................................
+
+#endif // VCL_QUICKSELECTIONENGINE_HXX
diff --git a/vcl/inc/vcl/regband.hxx b/vcl/inc/vcl/regband.hxx
index 39f0bd3b0a08..0ebacbdb93d4 100644
--- a/vcl/inc/vcl/regband.hxx
+++ b/vcl/inc/vcl/regband.hxx
@@ -58,7 +58,7 @@ struct ImplRegionBandSep
ImplRegionBandSep* mpNextSep;
long mnXLeft;
long mnXRight;
- BOOL mbRemoved;
+ sal_Bool mbRemoved;
};
enum LineType { LINE_ASCENDING, LINE_DESCENDING, LINE_HORIZONTAL };
@@ -69,7 +69,7 @@ struct ImplRegionBandPoint
ImplRegionBandPoint* mpNextBandPoint;
long mnX;
long mnLineId;
- BOOL mbEndPoint;
+ sal_Bool mbEndPoint;
LineType meLineType;
};
@@ -86,7 +86,7 @@ public:
ImplRegionBandPoint* mpFirstBandPoint; // root of the list with lines
long mnYTop; // actual boundary of the band
long mnYBottom;
- BOOL mbTouched;
+ sal_Bool mbTouched;
// create y-band with boundaries
ImplRegionBand( long nYTop, long nYBottom );
@@ -111,14 +111,14 @@ public:
long GetXRightBoundary() const;
// combine overlapping bands
- BOOL OptimizeBand();
+ sal_Bool OptimizeBand();
// generate separations from lines and process
// union with existing separations
void ProcessPoints();
// insert point in the list for later processing
- BOOL InsertPoint( long nX, long nLineID,
- BOOL bEndPoint, LineType eLineType );
+ sal_Bool InsertPoint( long nX, long nLineID,
+ sal_Bool bEndPoint, LineType eLineType );
void Union( long nXLeft, long nXRight );
void Intersect( long nXLeft, long nXRight );
@@ -128,13 +128,13 @@ public:
void MoveX( long nHorzMove );
void ScaleX( double fHorzScale );
- BOOL IsInside( long nX );
- BOOL IsInside( long nLeft, long nRight );
- BOOL IsOver( long nLeft, long nRight );
+ sal_Bool IsInside( long nX );
+ sal_Bool IsInside( long nLeft, long nRight );
+ sal_Bool IsOver( long nLeft, long nRight );
- BOOL IsEmpty() const { return ((!mpFirstSep) && (!mpFirstBandPoint)); }
+ sal_Bool IsEmpty() const { return ((!mpFirstSep) && (!mpFirstBandPoint)); }
- BOOL operator==( const ImplRegionBand& rRegionBand ) const;
+ sal_Bool operator==( const ImplRegionBand& rRegionBand ) const;
/** Split the called band at the given vertical coordinate. After the
split the called band will cover the upper part not including nY.
diff --git a/vcl/inc/vcl/region.h b/vcl/inc/vcl/region.h
index 62c5e51db070..5814e981aac2 100644
--- a/vcl/inc/vcl/region.h
+++ b/vcl/inc/vcl/region.h
@@ -50,7 +50,7 @@ struct ImplRegionHandle
Region* mpRegion;
ImplRegionBand* mpCurrRectBand;
ImplRegionBandSep* mpCurrRectBandSep;
- BOOL mbFirst;
+ sal_Bool mbFirst;
};
// ------------------
@@ -73,8 +73,8 @@ public:
ImplRegionBase( int nCount = 1 ); // TODO: replace manual refcounting
virtual ~ImplRegionBase();
public:
- ULONG mnRefCount;
- ULONG mnRectCount;
+ sal_uIntPtr mnRefCount;
+ sal_uIntPtr mnRectCount;
PolyPolygon* mpPolyPoly;
basegfx::B2DPolyPolygon* mpB2DPolyPoly;
};
@@ -99,14 +99,14 @@ public:
void CreateBandRange( long nYTop, long nYBottom );
void InsertBands( long nYTop, long nYBottom );
- BOOL InsertSingleBand( ImplRegionBand* mpImplRegionBand,
+ sal_Bool InsertSingleBand( ImplRegionBand* mpImplRegionBand,
long nYBandPosition );
- BOOL InsertLine( const Point & rFirstPoint,
+ sal_Bool InsertLine( const Point & rFirstPoint,
const Point & rSecondPoint,
long nLineID );
- BOOL InsertPoint( const Point &rPoint,
+ sal_Bool InsertPoint( const Point &rPoint,
long nLineID,
- BOOL bEndPoint, LineType eLineType );
+ sal_Bool bEndPoint, LineType eLineType );
/** Insert one band either after another band or as the first or only
band. Both the forward as well as the backward links are updated.
@@ -126,7 +126,7 @@ public:
void XOr( long nLeft, long nTop, long nRight, long nBottom );
// remove emtpy rects
- BOOL OptimizeBandList();
+ sal_Bool OptimizeBandList();
friend SvStream& operator>>( SvStream& rIStm, Region& rRegion );
friend SvStream& operator<<( SvStream& rOStm, const Region& rRegion );
diff --git a/vcl/inc/vcl/region.hxx b/vcl/inc/vcl/region.hxx
index 4a9c146a158c..f21cca472252 100644..100755
--- a/vcl/inc/vcl/region.hxx
+++ b/vcl/inc/vcl/region.hxx
@@ -70,14 +70,19 @@ private:
SAL_DLLPRIVATE inline void ImplPolyPolyRegionToBandRegion();
SAL_DLLPRIVATE const ImplRegion* ImplGetImplRegion() const { return mpImplRegion; }
SAL_DLLPRIVATE ImplRegion* ImplGetImplRegion() { return mpImplRegion; }
- SAL_DLLPRIVATE BOOL ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
- long& nX, long& nY, long& nWidth, long& nHeight ) const;
- SAL_DLLPRIVATE BOOL ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
- long& nX, long& nY, long& nWidth, long& nHeight ) const;
SAL_DLLPRIVATE void ImplBeginAddRect( );
- SAL_DLLPRIVATE BOOL ImplAddRect( const Rectangle& rRect );
+ SAL_DLLPRIVATE sal_Bool ImplAddRect( const Rectangle& rRect );
SAL_DLLPRIVATE void ImplEndAddRect( );
+ SAL_DLLPRIVATE void ImplIntersectWithPolyPolygon( const Region& );
+ SAL_DLLPRIVATE void ImplExcludePolyPolygon( const Region& );
+ SAL_DLLPRIVATE void ImplUnionPolyPolygon( const Region& );
+ SAL_DLLPRIVATE void ImplXOrPolyPolygon( const Region& );
+public: // public within vcl
+ VCL_PLUGIN_PUBLIC bool ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
+ long& nX, long& nY, long& nWidth, long& nHeight ) const;
+ VCL_PLUGIN_PUBLIC bool ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
+ long& nX, long& nY, long& nWidth, long& nHeight ) const;
#ifdef DBG_UTIL
friend const char* ImplDbgTestRegion( const void* pObj );
#endif
@@ -94,48 +99,48 @@ public:
void Move( long nHorzMove, long nVertMove );
void Scale( double fScaleX, double fScaleY );
- BOOL Union( const Rectangle& rRegion );
- BOOL Intersect( const Rectangle& rRegion );
- BOOL Exclude( const Rectangle& rRegion );
- BOOL XOr( const Rectangle& rRegion );
- BOOL Union( const Region& rRegion );
- BOOL Intersect( const Region& rRegion );
- BOOL Exclude( const Region& rRegion );
- BOOL XOr( const Region& rRegion );
+ sal_Bool Union( const Rectangle& rRegion );
+ sal_Bool Intersect( const Rectangle& rRegion );
+ sal_Bool Exclude( const Rectangle& rRegion );
+ sal_Bool XOr( const Rectangle& rRegion );
+ sal_Bool Union( const Region& rRegion );
+ sal_Bool Intersect( const Region& rRegion );
+ sal_Bool Exclude( const Region& rRegion );
+ sal_Bool XOr( const Region& rRegion );
RegionType GetType() const;
- BOOL IsEmpty() const { return GetType() == REGION_EMPTY; };
- BOOL IsNull() const { return GetType() == REGION_NULL; };
+ sal_Bool IsEmpty() const { return GetType() == REGION_EMPTY; };
+ sal_Bool IsNull() const { return GetType() == REGION_NULL; };
void SetEmpty();
void SetNull();
Rectangle GetBoundRect() const;
- BOOL HasPolyPolygon() const;
+ sal_Bool HasPolyPolygon() const;
PolyPolygon GetPolyPolygon() const;
- // returns an empty polypolygon in case HasPolyPolygon is FALSE
+ // returns an empty polypolygon in case HasPolyPolygon is sal_False
const basegfx::B2DPolyPolygon GetB2DPolyPolygon() const;
// returns a PolyPolygon either copied from the set PolyPolygon region
// or created from the constituent rectangles
basegfx::B2DPolyPolygon ConvertToB2DPolyPolygon();
- ULONG GetRectCount() const;
+ sal_uLong GetRectCount() const;
RegionHandle BeginEnumRects();
- BOOL GetEnumRects( RegionHandle hRegionHandle, Rectangle& rRect );
- BOOL GetNextEnumRect( RegionHandle hRegionHandle, Rectangle& rRect )
+ sal_Bool GetEnumRects( RegionHandle hRegionHandle, Rectangle& rRect );
+ sal_Bool GetNextEnumRect( RegionHandle hRegionHandle, Rectangle& rRect )
{ return GetEnumRects( hRegionHandle, rRect ); }
void EndEnumRects( RegionHandle hRegionHandle );
- BOOL IsInside( const Point& rPoint ) const;
- BOOL IsInside( const Rectangle& rRect ) const;
- BOOL IsOver( const Rectangle& rRect ) const;
+ sal_Bool IsInside( const Point& rPoint ) const;
+ sal_Bool IsInside( const Rectangle& rRect ) const;
+ sal_Bool IsOver( const Rectangle& rRect ) const;
Region& operator=( const Region& rRegion );
Region& operator=( const Rectangle& rRect );
- BOOL operator==( const Region& rRegion ) const;
- BOOL operator!=( const Region& rRegion ) const
+ sal_Bool operator==( const Region& rRegion ) const;
+ sal_Bool operator!=( const Region& rRegion ) const
{ return !(Region::operator==( rRegion )); }
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Region& rRegion );
diff --git a/vcl/inc/vcl/salatype.hxx b/vcl/inc/vcl/salatype.hxx
deleted file mode 100644
index 7507c6607dbe..000000000000
--- a/vcl/inc/vcl/salatype.hxx
+++ /dev/null
@@ -1,50 +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 _SV_SALATYPE_HXX
-#define _SV_SALATYPE_HXX
-
-#include <vcl/sv.h>
-
-// ---------------------
-// - Application-Types -
-// ---------------------
-
-// Derzeit doppelt und in apptypes.hxx auch vorhanden
-
-#define INPUT_MOUSE 0x0001
-#define INPUT_KEYBOARD 0x0002
-#define INPUT_PAINT 0x0004
-#define INPUT_TIMER 0x0008
-#define INPUT_OTHER 0x0010
-#define INPUT_MOUSEANDKEYBOARD (INPUT_MOUSE | INPUT_KEYBOARD)
-#define INPUT_ANY (INPUT_MOUSEANDKEYBOARD | INPUT_PAINT | INPUT_TIMER | INPUT_OTHER)
-
-#endif // _SV_SALATYPE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/salbmp.hxx b/vcl/inc/vcl/salbmp.hxx
index e2234323e80d..d880be0d6d37 100644
--- a/vcl/inc/vcl/salbmp.hxx
+++ b/vcl/inc/vcl/salbmp.hxx
@@ -39,26 +39,26 @@ class SalGraphics;
class BitmapPalette;
struct BitmapSystemData;
-class VCL_DLLPUBLIC SalBitmap
+class VCL_PLUGIN_PUBLIC SalBitmap
{
public:
SalBitmap() {}
virtual ~SalBitmap();
virtual bool Create( const Size& rSize,
- USHORT nBitCount,
+ sal_uInt16 nBitCount,
const BitmapPalette& rPal ) = 0;
virtual bool Create( const SalBitmap& rSalBmp ) = 0;
virtual bool Create( const SalBitmap& rSalBmp,
SalGraphics* pGraphics ) = 0;
virtual bool Create( const SalBitmap& rSalBmp,
- USHORT nNewBitCount ) = 0;
+ sal_uInt16 nNewBitCount ) = 0;
virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
Size& rSize,
bool bMask = false ) = 0;
virtual void Destroy() = 0;
virtual Size GetSize() const = 0;
- virtual USHORT GetBitCount() const = 0;
+ virtual sal_uInt16 GetBitCount() const = 0;
virtual BitmapBuffer* AcquireBuffer( bool bReadOnly ) = 0;
virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ) = 0;
diff --git a/vcl/inc/vcl/salbtype.hxx b/vcl/inc/vcl/salbtype.hxx
index 1721e201b1ae..111fdecda62d 100644
--- a/vcl/inc/vcl/salbtype.hxx
+++ b/vcl/inc/vcl/salbtype.hxx
@@ -43,9 +43,9 @@
// - Memory -
// ----------
-typedef BYTE* HPBYTE;
+typedef sal_uInt8* HPBYTE;
typedef HPBYTE Scanline;
-typedef const BYTE* ConstHPBYTE;
+typedef const sal_uInt8* ConstHPBYTE;
typedef ConstHPBYTE ConstScanline;
// ------------------
@@ -85,22 +85,22 @@ typedef ConstHPBYTE ConstScanline;
// ------------------------------------------------------------------
#define MASK_TO_COLOR( d_nVal, d_RM, d_GM, d_BM, d_RS, d_GS, d_BS, d_Col ) \
-ULONG _def_cR = (BYTE) ( d_RS < 0L ? ( (d_nVal) & d_RM ) << -d_RS : ( (d_nVal) & d_RM ) >> d_RS ); \
-ULONG _def_cG = (BYTE) ( d_GS < 0L ? ( (d_nVal) & d_GM ) << -d_GS : ( (d_nVal) & d_GM ) >> d_GS ); \
-ULONG _def_cB = (BYTE) ( d_BS < 0L ? ( (d_nVal) & d_BM ) << -d_BS : ( (d_nVal) & d_BM ) >> d_BS ); \
-d_Col = BitmapColor( (BYTE) ( _def_cR | ( ( _def_cR & mnROr ) >> mnROrShift ) ), \
- (BYTE) ( _def_cG | ( ( _def_cG & mnGOr ) >> mnGOrShift ) ), \
- (BYTE) ( _def_cB | ( ( _def_cB & mnBOr ) >> mnBOrShift ) ) );
+sal_uLong _def_cR = (sal_uInt8) ( d_RS < 0L ? ( (d_nVal) & d_RM ) << -d_RS : ( (d_nVal) & d_RM ) >> d_RS ); \
+sal_uLong _def_cG = (sal_uInt8) ( d_GS < 0L ? ( (d_nVal) & d_GM ) << -d_GS : ( (d_nVal) & d_GM ) >> d_GS ); \
+sal_uLong _def_cB = (sal_uInt8) ( d_BS < 0L ? ( (d_nVal) & d_BM ) << -d_BS : ( (d_nVal) & d_BM ) >> d_BS ); \
+d_Col = BitmapColor( (sal_uInt8) ( _def_cR | ( ( _def_cR & mnROr ) >> mnROrShift ) ), \
+ (sal_uInt8) ( _def_cG | ( ( _def_cG & mnGOr ) >> mnGOrShift ) ), \
+ (sal_uInt8) ( _def_cB | ( ( _def_cB & mnBOr ) >> mnBOrShift ) ) );
// ------------------------------------------------------------------
#define COLOR_TO_MASK( d_rCol, d_RM, d_GM, d_BM, d_RS, d_GS, d_BS ) \
-( ( ( ( d_RS < 0L ) ? ( (UINT32) (d_rCol).GetRed() >> -d_RS ) : \
- ( (UINT32) (d_rCol).GetRed() << d_RS ) ) & d_RM ) | \
- ( ( ( d_GS < 0L ) ? ( (UINT32) (d_rCol).GetGreen() >> -d_GS ) : \
- ( (UINT32) (d_rCol).GetGreen() << d_GS ) ) & d_GM ) | \
- ( ( ( d_BS < 0L ) ? ( (UINT32) (d_rCol).GetBlue() >> -d_BS ) : \
- ( (UINT32) (d_rCol).GetBlue() << d_BS ) ) & d_BM ) )
+( ( ( ( d_RS < 0L ) ? ( (sal_uInt32) (d_rCol).GetRed() >> -d_RS ) : \
+ ( (sal_uInt32) (d_rCol).GetRed() << d_RS ) ) & d_RM ) | \
+ ( ( ( d_GS < 0L ) ? ( (sal_uInt32) (d_rCol).GetGreen() >> -d_GS ) : \
+ ( (sal_uInt32) (d_rCol).GetGreen() << d_GS ) ) & d_GM ) | \
+ ( ( ( d_BS < 0L ) ? ( (sal_uInt32) (d_rCol).GetBlue() >> -d_BS ) : \
+ ( (sal_uInt32) (d_rCol).GetBlue() << d_BS ) ) & d_BM ) )
// ---------------
// - BitmapColor -
@@ -117,53 +117,53 @@ private:
// !!! zugegriffen wird, darf diese Klasse weder
// !!! in der Groesse noch der Reihenfolge der
// !!! Member veraendert werden (KA 02.09.97)
- BYTE mcBlueOrIndex;
- BYTE mcGreen;
- BYTE mcRed;
- BYTE mbIndex;
+ sal_uInt8 mcBlueOrIndex;
+ sal_uInt8 mcGreen;
+ sal_uInt8 mcRed;
+ sal_uInt8 mbIndex;
public:
inline BitmapColor();
inline BitmapColor( const BitmapColor& rBitmapColor );
- inline BitmapColor( BYTE cRed, BYTE cGreen, BYTE cBlue );
+ inline BitmapColor( sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBlue );
inline BitmapColor( const Color& rColor );
- inline BitmapColor( BYTE cIndex );
+ inline BitmapColor( sal_uInt8 cIndex );
inline ~BitmapColor() {};
- inline BOOL operator==( const BitmapColor& rBitmapColor ) const;
- inline BOOL operator!=( const BitmapColor& rBitmapColor ) const;
+ inline sal_Bool operator==( const BitmapColor& rBitmapColor ) const;
+ inline sal_Bool operator!=( const BitmapColor& rBitmapColor ) const;
inline BitmapColor& operator=( const BitmapColor& rBitmapColor );
- inline BOOL IsIndex() const;
+ inline sal_Bool IsIndex() const;
- inline BYTE GetRed() const;
- inline void SetRed( BYTE cRed );
+ inline sal_uInt8 GetRed() const;
+ inline void SetRed( sal_uInt8 cRed );
- inline BYTE GetGreen() const;
- inline void SetGreen( BYTE cGreen );
+ inline sal_uInt8 GetGreen() const;
+ inline void SetGreen( sal_uInt8 cGreen );
- inline BYTE GetBlue() const;
- inline void SetBlue( BYTE cBlue );
+ inline sal_uInt8 GetBlue() const;
+ inline void SetBlue( sal_uInt8 cBlue );
- inline BYTE GetIndex() const;
- inline void SetIndex( BYTE cIndex );
+ inline sal_uInt8 GetIndex() const;
+ inline void SetIndex( sal_uInt8 cIndex );
operator Color() const;
- inline operator BYTE() const;
+ inline operator sal_uInt8() const;
- inline BYTE GetBlueOrIndex() const;
+ inline sal_uInt8 GetBlueOrIndex() const;
inline BitmapColor& Invert();
- inline BYTE GetLuminance() const;
- inline BitmapColor& IncreaseLuminance( BYTE cGreyInc );
- inline BitmapColor& DecreaseLuminance( BYTE cGreyDec );
+ inline sal_uInt8 GetLuminance() const;
+ inline BitmapColor& IncreaseLuminance( sal_uInt8 cGreyInc );
+ inline BitmapColor& DecreaseLuminance( sal_uInt8 cGreyDec );
- inline BitmapColor& Merge( const BitmapColor& rColor, BYTE cTransparency );
- inline BitmapColor& Merge( BYTE cR, BYTE cG, BYTE cB, BYTE cTransparency );
+ inline BitmapColor& Merge( const BitmapColor& rColor, sal_uInt8 cTransparency );
+ inline BitmapColor& Merge( sal_uInt8 cR, sal_uInt8 cG, sal_uInt8 cB, sal_uInt8 cTransparency );
- inline ULONG GetColorError( const BitmapColor& rBitmapColor ) const;
+ inline sal_uLong GetColorError( const BitmapColor& rBitmapColor ) const;
};
// ---------------
@@ -180,7 +180,7 @@ class VCL_DLLPUBLIC BitmapPalette
private:
BitmapColor* mpBitmapColor;
- USHORT mnCount;
+ sal_uInt16 mnCount;
public:
@@ -192,21 +192,21 @@ public:
inline BitmapPalette();
inline BitmapPalette( const BitmapPalette& rBitmapPalette );
- inline BitmapPalette( USHORT nCount );
+ inline BitmapPalette( sal_uInt16 nCount );
inline ~BitmapPalette();
inline BitmapPalette& operator=( const BitmapPalette& rBitmapPalette );
- inline BOOL operator==( const BitmapPalette& rBitmapPalette ) const;
- inline BOOL operator!=( const BitmapPalette& rBitmapPalette ) const;
- inline BOOL operator!();
+ inline sal_Bool operator==( const BitmapPalette& rBitmapPalette ) const;
+ inline sal_Bool operator!=( const BitmapPalette& rBitmapPalette ) const;
+ inline sal_Bool operator!();
- inline USHORT GetEntryCount() const;
- inline void SetEntryCount( USHORT nCount );
+ inline sal_uInt16 GetEntryCount() const;
+ inline void SetEntryCount( sal_uInt16 nCount );
- inline const BitmapColor& operator[]( USHORT nIndex ) const;
- inline BitmapColor& operator[]( USHORT nIndex );
+ inline const BitmapColor& operator[]( sal_uInt16 nIndex ) const;
+ inline BitmapColor& operator[]( sal_uInt16 nIndex );
- inline USHORT GetBestIndex( const BitmapColor& rCol ) const;
+ inline sal_uInt16 GetBestIndex( const BitmapColor& rCol ) const;
bool IsGreyPalette() const;
};
@@ -216,29 +216,29 @@ public:
class VCL_DLLPUBLIC ColorMask
{
- ULONG mnRMask;
- ULONG mnGMask;
- ULONG mnBMask;
+ sal_uLong mnRMask;
+ sal_uLong mnGMask;
+ sal_uLong mnBMask;
long mnRShift;
long mnGShift;
long mnBShift;
- ULONG mnROrShift;
- ULONG mnGOrShift;
- ULONG mnBOrShift;
- ULONG mnROr;
- ULONG mnGOr;
- ULONG mnBOr;
+ sal_uLong mnROrShift;
+ sal_uLong mnGOrShift;
+ sal_uLong mnBOrShift;
+ sal_uLong mnROr;
+ sal_uLong mnGOr;
+ sal_uLong mnBOr;
- SAL_DLLPRIVATE inline long ImplCalcMaskShift( ULONG nMask, ULONG& rOr, ULONG& rOrShift ) const;
+ SAL_DLLPRIVATE inline long ImplCalcMaskShift( sal_uLong nMask, sal_uLong& rOr, sal_uLong& rOrShift ) const;
public:
- inline ColorMask( ULONG nRedMask = 0UL, ULONG nGreenMask = 0UL, ULONG nBlueMask = 0UL );
+ inline ColorMask( sal_uLong nRedMask = 0UL, sal_uLong nGreenMask = 0UL, sal_uLong nBlueMask = 0UL );
inline ~ColorMask() {}
- inline ULONG GetRedMask() const;
- inline ULONG GetGreenMask() const;
- inline ULONG GetBlueMask() const;
+ inline sal_uLong GetRedMask() const;
+ inline sal_uLong GetGreenMask() const;
+ inline sal_uLong GetBlueMask() const;
inline void GetColorFor8Bit( BitmapColor& rColor, ConstHPBYTE pPixel ) const;
inline void SetColorFor8Bit( const BitmapColor& rColor, HPBYTE pPixel ) const;
@@ -261,14 +261,14 @@ public:
struct VCL_DLLPUBLIC BitmapBuffer
{
- ULONG mnFormat;
+ sal_uLong mnFormat;
long mnWidth;
long mnHeight;
long mnScanlineSize;
- USHORT mnBitCount;
+ sal_uInt16 mnBitCount;
ColorMask maColorMask;
BitmapPalette maPalette;
- BYTE* mpBits;
+ sal_uInt8* mpBits;
BitmapBuffer(){}
~BitmapBuffer() {}
@@ -279,7 +279,7 @@ struct VCL_DLLPUBLIC BitmapBuffer
// ---------------------
VCL_DLLPUBLIC BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRect& rTwoRect,
- ULONG nDstBitmapFormat, BitmapPalette* pDstPal = NULL, ColorMask* pDstMask = NULL );
+ sal_uLong nDstBitmapFormat, BitmapPalette* pDstPal = NULL, ColorMask* pDstMask = NULL );
// ------------------------------------------------------------------
@@ -287,17 +287,17 @@ inline BitmapColor::BitmapColor() :
mcBlueOrIndex ( 0 ),
mcGreen ( 0 ),
mcRed ( 0 ),
- mbIndex ( FALSE )
+ mbIndex ( sal_False )
{
}
// ------------------------------------------------------------------
-inline BitmapColor::BitmapColor( BYTE cRed, BYTE cGreen, BYTE cBlue ) :
+inline BitmapColor::BitmapColor( sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBlue ) :
mcBlueOrIndex ( cBlue ),
mcGreen ( cGreen ),
mcRed ( cRed ),
- mbIndex ( FALSE )
+ mbIndex ( sal_False )
{
}
@@ -323,17 +323,17 @@ inline BitmapColor::BitmapColor( const Color& rColor ) :
// ------------------------------------------------------------------
-inline BitmapColor::BitmapColor( BYTE cIndex ) :
+inline BitmapColor::BitmapColor( sal_uInt8 cIndex ) :
mcBlueOrIndex ( cIndex ),
mcGreen ( 0 ),
mcRed ( 0 ),
- mbIndex ( TRUE )
+ mbIndex ( sal_True )
{
}
// ------------------------------------------------------------------
-inline BOOL BitmapColor::operator==( const BitmapColor& rBitmapColor ) const
+inline sal_Bool BitmapColor::operator==( const BitmapColor& rBitmapColor ) const
{
return( ( mcBlueOrIndex == rBitmapColor.mcBlueOrIndex ) &&
( mbIndex ? rBitmapColor.mbIndex :
@@ -342,7 +342,7 @@ inline BOOL BitmapColor::operator==( const BitmapColor& rBitmapColor ) const
// ------------------------------------------------------------------
-inline BOOL BitmapColor::operator!=( const BitmapColor& rBitmapColor ) const
+inline sal_Bool BitmapColor::operator!=( const BitmapColor& rBitmapColor ) const
{
return !( *this == rBitmapColor );
}
@@ -361,14 +361,14 @@ inline BitmapColor& BitmapColor::operator=( const BitmapColor& rBitmapColor )
// ------------------------------------------------------------------
-inline BOOL BitmapColor::IsIndex() const
+inline sal_Bool BitmapColor::IsIndex() const
{
return mbIndex;
}
// ------------------------------------------------------------------
-inline BYTE BitmapColor::GetRed() const
+inline sal_uInt8 BitmapColor::GetRed() const
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
return mcRed;
@@ -376,7 +376,7 @@ inline BYTE BitmapColor::GetRed() const
// ------------------------------------------------------------------
-inline void BitmapColor::SetRed( BYTE cRed )
+inline void BitmapColor::SetRed( sal_uInt8 cRed )
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
mcRed = cRed;
@@ -384,7 +384,7 @@ inline void BitmapColor::SetRed( BYTE cRed )
// ------------------------------------------------------------------
-inline BYTE BitmapColor::GetGreen() const
+inline sal_uInt8 BitmapColor::GetGreen() const
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
return mcGreen;
@@ -392,7 +392,7 @@ inline BYTE BitmapColor::GetGreen() const
// ------------------------------------------------------------------
-inline void BitmapColor::SetGreen( BYTE cGreen )
+inline void BitmapColor::SetGreen( sal_uInt8 cGreen )
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
mcGreen = cGreen;
@@ -400,7 +400,7 @@ inline void BitmapColor::SetGreen( BYTE cGreen )
// ------------------------------------------------------------------
-inline BYTE BitmapColor::GetBlue() const
+inline sal_uInt8 BitmapColor::GetBlue() const
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
return mcBlueOrIndex;
@@ -408,7 +408,7 @@ inline BYTE BitmapColor::GetBlue() const
// ------------------------------------------------------------------
-inline void BitmapColor::SetBlue( BYTE cBlue )
+inline void BitmapColor::SetBlue( sal_uInt8 cBlue )
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
mcBlueOrIndex = cBlue;
@@ -416,7 +416,7 @@ inline void BitmapColor::SetBlue( BYTE cBlue )
// ------------------------------------------------------------------
-inline BYTE BitmapColor::GetIndex() const
+inline sal_uInt8 BitmapColor::GetIndex() const
{
DBG_ASSERT( mbIndex, "Pixel represents color values!" );
return mcBlueOrIndex;
@@ -424,7 +424,7 @@ inline BYTE BitmapColor::GetIndex() const
// ------------------------------------------------------------------
-inline void BitmapColor::SetIndex( BYTE cIndex )
+inline void BitmapColor::SetIndex( sal_uInt8 cIndex )
{
DBG_ASSERT( mbIndex, "Pixel represents color values!" );
mcBlueOrIndex = cIndex;
@@ -440,7 +440,7 @@ inline BitmapColor::operator Color() const
// ------------------------------------------------------------------
-inline BitmapColor::operator BYTE() const
+inline BitmapColor::operator sal_uInt8() const
{
DBG_ASSERT( mbIndex, "Pixel represents color values!" );
return mcBlueOrIndex;
@@ -448,7 +448,7 @@ inline BitmapColor::operator BYTE() const
// ------------------------------------------------------------------
-inline BYTE BitmapColor::GetBlueOrIndex() const
+inline sal_uInt8 BitmapColor::GetBlueOrIndex() const
{
// #i47518# Yield a value regardless of mbIndex
return mcBlueOrIndex;
@@ -466,39 +466,39 @@ inline BitmapColor& BitmapColor::Invert()
// ------------------------------------------------------------------
-inline BYTE BitmapColor::GetLuminance() const
+inline sal_uInt8 BitmapColor::GetLuminance() const
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
- return( (BYTE) ( ( mcBlueOrIndex * 28UL + mcGreen * 151UL + mcRed * 77UL ) >> 8UL ) );
+ return( (sal_uInt8) ( ( mcBlueOrIndex * 28UL + mcGreen * 151UL + mcRed * 77UL ) >> 8UL ) );
}
// ------------------------------------------------------------------
-inline BitmapColor& BitmapColor::IncreaseLuminance( BYTE cGreyInc )
+inline BitmapColor& BitmapColor::IncreaseLuminance( sal_uInt8 cGreyInc )
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
- mcBlueOrIndex = (BYTE) MinMax( (long) mcBlueOrIndex + cGreyInc, 0L, 255L );
- mcGreen = (BYTE) MinMax( (long) mcGreen + cGreyInc, 0L, 255L );
- mcRed = (BYTE) MinMax( (long) mcRed + cGreyInc, 0L, 255L );
+ mcBlueOrIndex = (sal_uInt8) MinMax( (long) mcBlueOrIndex + cGreyInc, 0L, 255L );
+ mcGreen = (sal_uInt8) MinMax( (long) mcGreen + cGreyInc, 0L, 255L );
+ mcRed = (sal_uInt8) MinMax( (long) mcRed + cGreyInc, 0L, 255L );
return *this;
}
// ------------------------------------------------------------------
-inline BitmapColor& BitmapColor::DecreaseLuminance( BYTE cGreyDec )
+inline BitmapColor& BitmapColor::DecreaseLuminance( sal_uInt8 cGreyDec )
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
- mcBlueOrIndex = (BYTE) MinMax( (long) mcBlueOrIndex - cGreyDec, 0L, 255L );
- mcGreen = (BYTE) MinMax( (long) mcGreen - cGreyDec, 0L, 255L );
- mcRed = (BYTE) MinMax( (long) mcRed - cGreyDec, 0L, 255L );
+ mcBlueOrIndex = (sal_uInt8) MinMax( (long) mcBlueOrIndex - cGreyDec, 0L, 255L );
+ mcGreen = (sal_uInt8) MinMax( (long) mcGreen - cGreyDec, 0L, 255L );
+ mcRed = (sal_uInt8) MinMax( (long) mcRed - cGreyDec, 0L, 255L );
return *this;
}
// ------------------------------------------------------------------
-inline BitmapColor& BitmapColor::Merge( const BitmapColor& rBitmapColor, BYTE cTransparency )
+inline BitmapColor& BitmapColor::Merge( const BitmapColor& rBitmapColor, sal_uInt8 cTransparency )
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
DBG_ASSERT( !rBitmapColor.mbIndex, "Pixel represents index into colortable!" );
@@ -511,7 +511,7 @@ inline BitmapColor& BitmapColor::Merge( const BitmapColor& rBitmapColor, BYTE cT
// ------------------------------------------------------------------
-inline BitmapColor& BitmapColor::Merge( BYTE cR, BYTE cG, BYTE cB, BYTE cTransparency )
+inline BitmapColor& BitmapColor::Merge( sal_uInt8 cR, sal_uInt8 cG, sal_uInt8 cB, sal_uInt8 cTransparency )
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
mcBlueOrIndex = COLOR_CHANNEL_MERGE( mcBlueOrIndex, cB, cTransparency );
@@ -523,11 +523,11 @@ inline BitmapColor& BitmapColor::Merge( BYTE cR, BYTE cG, BYTE cB, BYTE cTranspa
// ------------------------------------------------------------------
-inline ULONG BitmapColor::GetColorError( const BitmapColor& rBitmapColor ) const
+inline sal_uLong BitmapColor::GetColorError( const BitmapColor& rBitmapColor ) const
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
DBG_ASSERT( !rBitmapColor.mbIndex, "Pixel represents index into colortable!" );
- return( (ULONG) ( labs( mcBlueOrIndex - rBitmapColor.mcBlueOrIndex ) +
+ return( (sal_uLong) ( labs( mcBlueOrIndex - rBitmapColor.mcBlueOrIndex ) +
labs( mcGreen - rBitmapColor.mcGreen ) +
labs( mcRed - rBitmapColor.mcRed ) ) );
}
@@ -547,8 +547,8 @@ inline BitmapPalette::BitmapPalette( const BitmapPalette& rBitmapPalette ) :
{
if( mnCount )
{
- const ULONG nSize = mnCount * sizeof( BitmapColor );
- mpBitmapColor = (BitmapColor*) new BYTE[ nSize ];
+ const sal_uLong nSize = mnCount * sizeof( BitmapColor );
+ mpBitmapColor = (BitmapColor*) new sal_uInt8[ nSize ];
memcpy( mpBitmapColor, rBitmapPalette.mpBitmapColor, nSize );
}
else
@@ -557,13 +557,13 @@ inline BitmapPalette::BitmapPalette( const BitmapPalette& rBitmapPalette ) :
// ------------------------------------------------------------------
-inline BitmapPalette::BitmapPalette( USHORT nCount ) :
+inline BitmapPalette::BitmapPalette( sal_uInt16 nCount ) :
mnCount( nCount )
{
if( mnCount )
{
- const ULONG nSize = mnCount * sizeof( BitmapColor );
- mpBitmapColor = (BitmapColor*) new BYTE[ nSize ];
+ const sal_uLong nSize = mnCount * sizeof( BitmapColor );
+ mpBitmapColor = (BitmapColor*) new sal_uInt8[ nSize ];
memset( mpBitmapColor, 0, nSize );
}
else
@@ -574,20 +574,20 @@ inline BitmapPalette::BitmapPalette( USHORT nCount ) :
inline BitmapPalette::~BitmapPalette()
{
- delete[] (BYTE*) mpBitmapColor;
+ delete[] (sal_uInt8*) mpBitmapColor;
}
// ------------------------------------------------------------------
inline BitmapPalette& BitmapPalette::operator=( const BitmapPalette& rBitmapPalette )
{
- delete[] (BYTE*) mpBitmapColor;
+ delete[] (sal_uInt8*) mpBitmapColor;
mnCount = rBitmapPalette.mnCount;
if( mnCount )
{
- const ULONG nSize = mnCount * sizeof( BitmapColor );
- mpBitmapColor = (BitmapColor*) new BYTE[ nSize ];
+ const sal_uLong nSize = mnCount * sizeof( BitmapColor );
+ mpBitmapColor = (BitmapColor*) new sal_uInt8[ nSize ];
memcpy( mpBitmapColor, rBitmapPalette.mpBitmapColor, nSize );
}
else
@@ -598,19 +598,19 @@ inline BitmapPalette& BitmapPalette::operator=( const BitmapPalette& rBitmapPale
// ------------------------------------------------------------------
-inline BOOL BitmapPalette::operator==( const BitmapPalette& rBitmapPalette ) const
+inline sal_Bool BitmapPalette::operator==( const BitmapPalette& rBitmapPalette ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( rBitmapPalette.mnCount == mnCount )
{
- bRet = TRUE;
+ bRet = sal_True;
- for( USHORT i = 0; i < mnCount; i++ )
+ for( sal_uInt16 i = 0; i < mnCount; i++ )
{
if( mpBitmapColor[ i ] != rBitmapPalette.mpBitmapColor[ i ] )
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
@@ -621,44 +621,44 @@ inline BOOL BitmapPalette::operator==( const BitmapPalette& rBitmapPalette ) con
// ------------------------------------------------------------------
-inline BOOL BitmapPalette::operator!=( const BitmapPalette& rBitmapPalette ) const
+inline sal_Bool BitmapPalette::operator!=( const BitmapPalette& rBitmapPalette ) const
{
return !( *this == rBitmapPalette );
}
// ------------------------------------------------------------------
-inline BOOL BitmapPalette::operator!()
+inline sal_Bool BitmapPalette::operator!()
{
return( !mnCount || !mpBitmapColor );
}
// ------------------------------------------------------------------
-inline USHORT BitmapPalette::GetEntryCount() const
+inline sal_uInt16 BitmapPalette::GetEntryCount() const
{
return mnCount;
}
// ------------------------------------------------------------------
-inline void BitmapPalette::SetEntryCount( USHORT nCount )
+inline void BitmapPalette::SetEntryCount( sal_uInt16 nCount )
{
if( !nCount )
{
- delete[] (BYTE*) mpBitmapColor;
+ delete[] (sal_uInt8*) mpBitmapColor;
mpBitmapColor = NULL;
mnCount = 0;
}
else if( nCount != mnCount )
{
- const ULONG nNewSize = nCount * sizeof( BitmapColor );
- const ULONG nMinSize = Min( mnCount, nCount ) * sizeof( BitmapColor );
- BYTE* pNewColor = new BYTE[ nNewSize ];
+ const sal_uLong nNewSize = nCount * sizeof( BitmapColor );
+ const sal_uLong nMinSize = Min( mnCount, nCount ) * sizeof( BitmapColor );
+ sal_uInt8* pNewColor = new sal_uInt8[ nNewSize ];
if ( nMinSize && mpBitmapColor )
memcpy( pNewColor, mpBitmapColor, nMinSize );
- delete[] (BYTE*) mpBitmapColor;
+ delete[] (sal_uInt8*) mpBitmapColor;
memset( pNewColor + nMinSize, 0, nNewSize - nMinSize );
mpBitmapColor = (BitmapColor*) pNewColor;
mnCount = nCount;
@@ -667,7 +667,7 @@ inline void BitmapPalette::SetEntryCount( USHORT nCount )
// ------------------------------------------------------------------
-inline const BitmapColor& BitmapPalette::operator[]( USHORT nIndex ) const
+inline const BitmapColor& BitmapPalette::operator[]( sal_uInt16 nIndex ) const
{
DBG_ASSERT( nIndex < mnCount, "Palette index is out of range!" );
return mpBitmapColor[ nIndex ];
@@ -675,7 +675,7 @@ inline const BitmapColor& BitmapPalette::operator[]( USHORT nIndex ) const
// ------------------------------------------------------------------
-inline BitmapColor& BitmapPalette::operator[]( USHORT nIndex )
+inline BitmapColor& BitmapPalette::operator[]( sal_uInt16 nIndex )
{
DBG_ASSERT( nIndex < mnCount, "Palette index is out of range!" );
return mpBitmapColor[ nIndex ];
@@ -690,17 +690,17 @@ inline BitmapColor* BitmapPalette::ImplGetColorBuffer() const
}
// ------------------------------------------------------------------
-inline USHORT BitmapPalette::GetBestIndex( const BitmapColor& rCol ) const
+inline sal_uInt16 BitmapPalette::GetBestIndex( const BitmapColor& rCol ) const
{
- USHORT nRetIndex = 0;
+ sal_uInt16 nRetIndex = 0;
if( mpBitmapColor && mnCount )
{
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
for( long j = 0L; ( j < mnCount ) && !bFound; j++ )
if( rCol == mpBitmapColor[ j ] )
- nRetIndex = ( (USHORT) j ), bFound = TRUE;
+ nRetIndex = ( (sal_uInt16) j ), bFound = sal_True;
if( !bFound )
{
@@ -708,7 +708,7 @@ inline USHORT BitmapPalette::GetBestIndex( const BitmapColor& rCol ) const
for( long i = nRetIndex - 1; i >= 0L; i-- )
if ( ( nActErr = rCol.GetColorError( mpBitmapColor[ i ] ) ) < nLastErr )
- nLastErr = nActErr, nRetIndex = (USHORT) i;
+ nLastErr = nActErr, nRetIndex = (sal_uInt16) i;
}
}
@@ -717,7 +717,7 @@ inline USHORT BitmapPalette::GetBestIndex( const BitmapColor& rCol ) const
// ------------------------------------------------------------------
-inline ColorMask::ColorMask( ULONG nRedMask, ULONG nGreenMask, ULONG nBlueMask ) :
+inline ColorMask::ColorMask( sal_uLong nRedMask, sal_uLong nGreenMask, sal_uLong nBlueMask ) :
mnRMask( nRedMask ),
mnGMask( nGreenMask ),
mnBMask( nBlueMask ),
@@ -735,48 +735,48 @@ inline ColorMask::ColorMask( ULONG nRedMask, ULONG nGreenMask, ULONG nBlueMask )
// ------------------------------------------------------------------
-inline long ColorMask::ImplCalcMaskShift( ULONG nMask, ULONG& rOr, ULONG& rOrShift ) const
+inline long ColorMask::ImplCalcMaskShift( sal_uLong nMask, sal_uLong& rOr, sal_uLong& rOrShift ) const
{
long nShift;
long nRet;
- ULONG nLen = 0UL;
+ sal_uLong nLen = 0UL;
// bei welchen Bits faengt die Maske an
- for( nShift = 31L; ( nShift >= 0L ) && !( nMask & ( 1 << (ULONG) nShift ) ); nShift-- )
+ for( nShift = 31L; ( nShift >= 0L ) && !( nMask & ( 1 << (sal_uLong) nShift ) ); nShift-- )
{}
nRet = nShift;
// XXX Anzahl der gesetzten Bits ermitteln => nach rechts bis Null laufen
- while( ( nShift >= 0L ) && ( nMask & ( 1 << (ULONG) nShift ) ) )
+ while( ( nShift >= 0L ) && ( nMask & ( 1 << (sal_uLong) nShift ) ) )
{
nShift--;
nLen++;
}
rOrShift = 8L - nLen;
- rOr = (BYTE) ( ( 0xffUL >> nLen ) << rOrShift );
+ rOr = (sal_uInt8) ( ( 0xffUL >> nLen ) << rOrShift );
return( nRet -= 7 );
}
// ------------------------------------------------------------------
-inline ULONG ColorMask::GetRedMask() const
+inline sal_uLong ColorMask::GetRedMask() const
{
return mnRMask;
}
// ------------------------------------------------------------------
-inline ULONG ColorMask::GetGreenMask() const
+inline sal_uLong ColorMask::GetGreenMask() const
{
return mnGMask;
}
// ------------------------------------------------------------------
-inline ULONG ColorMask::GetBlueMask() const
+inline sal_uLong ColorMask::GetBlueMask() const
{
return mnBMask;
}
@@ -785,7 +785,7 @@ inline ULONG ColorMask::GetBlueMask() const
inline void ColorMask::GetColorFor8Bit( BitmapColor& rColor, ConstHPBYTE pPixel ) const
{
- const UINT32 nVal = *pPixel;
+ const sal_uInt32 nVal = *pPixel;
MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor );
}
@@ -793,7 +793,7 @@ inline void ColorMask::GetColorFor8Bit( BitmapColor& rColor, ConstHPBYTE pPixel
inline void ColorMask::SetColorFor8Bit( const BitmapColor& rColor, HPBYTE pPixel ) const
{
- *pPixel = (BYTE) COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
+ *pPixel = (sal_uInt8) COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
}
// ------------------------------------------------------------------
@@ -801,9 +801,9 @@ inline void ColorMask::SetColorFor8Bit( const BitmapColor& rColor, HPBYTE pPixel
inline void ColorMask::GetColorFor16BitMSB( BitmapColor& rColor, ConstHPBYTE pPixel ) const
{
#ifdef OSL_BIGENDIAN
- const UINT32 nVal = *(UINT16*) pPixel;
+ const sal_uInt32 nVal = *(sal_uInt16*) pPixel;
#else
- const UINT32 nVal = pPixel[ 1 ] | ( (UINT32) pPixel[ 0 ] << 8UL );
+ const sal_uInt32 nVal = pPixel[ 1 ] | ( (sal_uInt32) pPixel[ 0 ] << 8UL );
#endif
MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor );
@@ -813,13 +813,13 @@ inline void ColorMask::GetColorFor16BitMSB( BitmapColor& rColor, ConstHPBYTE pPi
inline void ColorMask::SetColorFor16BitMSB( const BitmapColor& rColor, HPBYTE pPixel ) const
{
- const UINT16 nVal = (UINT16)COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
+ const sal_uInt16 nVal = (sal_uInt16)COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
#ifdef OSL_BIGENDIAN
- *(UINT16*) pPixel = nVal;
+ *(sal_uInt16*) pPixel = nVal;
#else
- pPixel[ 0 ] = (BYTE)(nVal >> 8U);
- pPixel[ 1 ] = (BYTE) nVal;
+ pPixel[ 0 ] = (sal_uInt8)(nVal >> 8U);
+ pPixel[ 1 ] = (sal_uInt8) nVal;
#endif
}
@@ -828,9 +828,9 @@ inline void ColorMask::SetColorFor16BitMSB( const BitmapColor& rColor, HPBYTE pP
inline void ColorMask::GetColorFor16BitLSB( BitmapColor& rColor, ConstHPBYTE pPixel ) const
{
#ifdef OSL_BIGENDIAN
- const UINT32 nVal = pPixel[ 0 ] | ( (UINT32) pPixel[ 1 ] << 8UL );
+ const sal_uInt32 nVal = pPixel[ 0 ] | ( (sal_uInt32) pPixel[ 1 ] << 8UL );
#else
- const UINT32 nVal = *(UINT16*) pPixel;
+ const sal_uInt32 nVal = *(sal_uInt16*) pPixel;
#endif
MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor );
@@ -840,13 +840,13 @@ inline void ColorMask::GetColorFor16BitLSB( BitmapColor& rColor, ConstHPBYTE pPi
inline void ColorMask::SetColorFor16BitLSB( const BitmapColor& rColor, HPBYTE pPixel ) const
{
- const UINT16 nVal = (UINT16)COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
+ const sal_uInt16 nVal = (sal_uInt16)COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
#ifdef OSL_BIGENDIAN
- pPixel[ 0 ] = (BYTE) nVal;
- pPixel[ 1 ] = (BYTE)(nVal >> 8U);
+ pPixel[ 0 ] = (sal_uInt8) nVal;
+ pPixel[ 1 ] = (sal_uInt8)(nVal >> 8U);
#else
- *(UINT16*) pPixel = nVal;
+ *(sal_uInt16*) pPixel = nVal;
#endif
}
@@ -855,7 +855,7 @@ inline void ColorMask::SetColorFor16BitLSB( const BitmapColor& rColor, HPBYTE pP
inline void ColorMask::GetColorFor24Bit( BitmapColor& rColor, ConstHPBYTE pPixel ) const
{
- const UINT32 nVal = pPixel[ 0 ] | ( (UINT32) pPixel[ 1 ] << 8UL ) | ( (UINT32) pPixel[ 2 ] << 16UL );
+ const sal_uInt32 nVal = pPixel[ 0 ] | ( (sal_uInt32) pPixel[ 1 ] << 8UL ) | ( (sal_uInt32) pPixel[ 2 ] << 16UL );
MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor );
}
@@ -863,8 +863,8 @@ inline void ColorMask::GetColorFor24Bit( BitmapColor& rColor, ConstHPBYTE pPixel
inline void ColorMask::SetColorFor24Bit( const BitmapColor& rColor, HPBYTE pPixel ) const
{
- const UINT32 nVal = COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
- pPixel[ 0 ] = (BYTE) nVal; pPixel[ 1 ] = (BYTE) ( nVal >> 8UL ); pPixel[ 2 ] = (BYTE) ( nVal >> 16UL );
+ const sal_uInt32 nVal = COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
+ pPixel[ 0 ] = (sal_uInt8) nVal; pPixel[ 1 ] = (sal_uInt8) ( nVal >> 8UL ); pPixel[ 2 ] = (sal_uInt8) ( nVal >> 16UL );
}
// ------------------------------------------------------------------
@@ -872,10 +872,10 @@ inline void ColorMask::SetColorFor24Bit( const BitmapColor& rColor, HPBYTE pPixe
inline void ColorMask::GetColorFor32Bit( BitmapColor& rColor, ConstHPBYTE pPixel ) const
{
#ifdef OSL_BIGENDIAN
- const UINT32 nVal = (UINT32) pPixel[ 0 ] | ( (UINT32) pPixel[ 1 ] << 8UL ) |
- ( (UINT32) pPixel[ 2 ] << 16UL ) | ( (UINT32) pPixel[ 3 ] << 24UL );
+ const sal_uInt32 nVal = (sal_uInt32) pPixel[ 0 ] | ( (sal_uInt32) pPixel[ 1 ] << 8UL ) |
+ ( (sal_uInt32) pPixel[ 2 ] << 16UL ) | ( (sal_uInt32) pPixel[ 3 ] << 24UL );
#else
- const UINT32 nVal = *(UINT32*) pPixel;
+ const sal_uInt32 nVal = *(sal_uInt32*) pPixel;
#endif
MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor );
@@ -886,11 +886,11 @@ inline void ColorMask::GetColorFor32Bit( BitmapColor& rColor, ConstHPBYTE pPixel
inline void ColorMask::SetColorFor32Bit( const BitmapColor& rColor, HPBYTE pPixel ) const
{
#ifdef OSL_BIGENDIAN
- const UINT32 nVal = COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
- pPixel[ 0 ] = (BYTE) nVal; pPixel[ 1 ] = (BYTE) ( nVal >> 8UL );
- pPixel[ 2 ] = (BYTE) ( nVal >> 16UL ); pPixel[ 3 ] = (BYTE) ( nVal >> 24UL );
+ const sal_uInt32 nVal = COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
+ pPixel[ 0 ] = (sal_uInt8) nVal; pPixel[ 1 ] = (sal_uInt8) ( nVal >> 8UL );
+ pPixel[ 2 ] = (sal_uInt8) ( nVal >> 16UL ); pPixel[ 3 ] = (sal_uInt8) ( nVal >> 24UL );
#else
- *(UINT32*) pPixel = COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
+ *(sal_uInt32*) pPixel = COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
#endif
}
diff --git a/vcl/inc/vcl/salctrlhandle.hxx b/vcl/inc/vcl/salctrlhandle.hxx
deleted file mode 100644
index 2cdb5af3a3e5..000000000000
--- a/vcl/inc/vcl/salctrlhandle.hxx
+++ /dev/null
@@ -1,51 +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 _SV_SALCTRLHANDLE_HXX
-#define _SV_SALCTRLHANDLE_HXX
-
-/* SalControlHandle:
- *
- * Container for platform-specific handles and data
- * about controls. Lives as long as the VCL control
- * lives.
- */
-
-class SalControlHandle
-{
- public:
- SalControlHandle() {}
- virtual ~SalControlHandle();
-
- // TODO: derive Sal implementation
- //SalControlHandleData maData;
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/salctype.hxx b/vcl/inc/vcl/salctype.hxx
index c7136b98b5bf..93eb69bd439d 100644
--- a/vcl/inc/vcl/salctype.hxx
+++ b/vcl/inc/vcl/salctype.hxx
@@ -29,6 +29,9 @@
#ifndef _SV_SALCTYPE_HXX
#define _SV_SALCTYPE_HXX
+#include <com/sun/star/script/XInvocation.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+
#include <vcl/graph.hxx>
// -----------
@@ -63,9 +66,9 @@ public:
Graphic maGraphic;
SvStream& mrStm;
- ULONG mnFormat;
+ sal_uLong mnFormat;
- ConvertData( const Graphic& rGraphic, SvStream& rStm, ULONG nFormat ) :
+ ConvertData( const Graphic& rGraphic, SvStream& rStm, sal_uLong nFormat ) :
maGraphic( rGraphic ), mrStm( rStm ), mnFormat( nFormat ) {}
~ConvertData() {}
};
@@ -74,9 +77,18 @@ public:
// - Callback -
// ------------
-typedef ULONG (*SALGRFCVTPROC)( void* pInst,
- ULONG nInFormat, void* pInBuffer, ULONG nInBufSize,
- ULONG nOutFormat, void** ppOutBuffer );
+typedef sal_uLong (*SALGRFCVTPROC)( void* pInst,
+ sal_uLong nInFormat, void* pInBuffer, sal_uLong nInBufSize,
+ sal_uLong nOutFormat, void** ppOutBuffer );
+
+// -------------------
+// - BitmapConverter -
+// -------------------
+
+namespace vcl
+{
+com::sun::star::uno::Reference< com::sun::star::script::XInvocation > createBmpConverter();
+}
#endif // _SV_SALCTYPE_HXX
diff --git a/vcl/inc/vcl/saldatabasic.hxx b/vcl/inc/vcl/saldatabasic.hxx
index c4716507e7e6..e080cb91ff99 100644
--- a/vcl/inc/vcl/saldatabasic.hxx
+++ b/vcl/inc/vcl/saldatabasic.hxx
@@ -33,11 +33,17 @@
#include <vcl/salinst.hxx>
#include <osl/module.h>
-class VCL_DLLPUBLIC SalData
+namespace psp
+{
+ class PrinterInfoManager;
+}
+
+class VCL_PLUGIN_PUBLIC SalData
{
public:
- SalInstance* m_pInstance; // pointer to instance
- oslModule m_pPlugin; // plugin library handle
+ SalInstance* m_pInstance; // pointer to instance
+ oslModule m_pPlugin; // plugin library handle
+ psp::PrinterInfoManager* m_pPIManager;
SalData();
virtual ~SalData();
diff --git a/vcl/inc/vcl/salframe.hxx b/vcl/inc/vcl/salframe.hxx
index c1fa3e2b9eb4..f5b98756f5f6 100644
--- a/vcl/inc/vcl/salframe.hxx
+++ b/vcl/inc/vcl/salframe.hxx
@@ -62,55 +62,55 @@ struct SystemEnvData;
// - SalFrameTypes -
// -----------------
-#define SAL_FRAME_TOTOP_RESTOREWHENMIN ((USHORT)0x0001)
-#define SAL_FRAME_TOTOP_FOREGROUNDTASK ((USHORT)0x0002)
-#define SAL_FRAME_TOTOP_GRABFOCUS ((USHORT)0x0004)
-#define SAL_FRAME_TOTOP_GRABFOCUS_ONLY ((USHORT)0x0008)
+#define SAL_FRAME_TOTOP_RESTOREWHENMIN ((sal_uInt16)0x0001)
+#define SAL_FRAME_TOTOP_FOREGROUNDTASK ((sal_uInt16)0x0002)
+#define SAL_FRAME_TOTOP_GRABFOCUS ((sal_uInt16)0x0004)
+#define SAL_FRAME_TOTOP_GRABFOCUS_ONLY ((sal_uInt16)0x0008)
-#define SAL_FRAME_ENDEXTTEXTINPUT_COMPLETE ((USHORT)0x0001)
-#define SAL_FRAME_ENDEXTTEXTINPUT_CANCEL ((USHORT)0x0002)
+#define SAL_FRAME_ENDEXTTEXTINPUT_COMPLETE ((sal_uInt16)0x0001)
+#define SAL_FRAME_ENDEXTTEXTINPUT_CANCEL ((sal_uInt16)0x0002)
// -----------------
// - SalFrameStyle -
// -----------------
-#define SAL_FRAME_STYLE_DEFAULT ((ULONG)0x00000001)
-#define SAL_FRAME_STYLE_MOVEABLE ((ULONG)0x00000002)
-#define SAL_FRAME_STYLE_SIZEABLE ((ULONG)0x00000004)
-#define SAL_FRAME_STYLE_CLOSEABLE ((ULONG)0x00000008)
+#define SAL_FRAME_STYLE_DEFAULT ((sal_uLong)0x00000001)
+#define SAL_FRAME_STYLE_MOVEABLE ((sal_uLong)0x00000002)
+#define SAL_FRAME_STYLE_SIZEABLE ((sal_uLong)0x00000004)
+#define SAL_FRAME_STYLE_CLOSEABLE ((sal_uLong)0x00000008)
// no shadow effect on WindowsXP
-#define SAL_FRAME_STYLE_NOSHADOW ((ULONG)0x00000010)
+#define SAL_FRAME_STYLE_NOSHADOW ((sal_uLong)0x00000010)
// indicate tooltip windows, so they can always be topmost
-#define SAL_FRAME_STYLE_TOOLTIP ((ULONG)0x00000020)
+#define SAL_FRAME_STYLE_TOOLTIP ((sal_uLong)0x00000020)
// windows without windowmanager decoration, this typically only applies to floating windows
-#define SAL_FRAME_STYLE_OWNERDRAWDECORATION ((ULONG)0x00000040)
+#define SAL_FRAME_STYLE_OWNERDRAWDECORATION ((sal_uLong)0x00000040)
// dialogs
-#define SAL_FRAME_STYLE_DIALOG ((ULONG)0x00000080)
+#define SAL_FRAME_STYLE_DIALOG ((sal_uLong)0x00000080)
// partial fullscreen: fullscreen on one monitor of a multimonitor display
-#define SAL_FRAME_STYLE_PARTIAL_FULLSCREEN ((ULONG)0x00800000)
+#define SAL_FRAME_STYLE_PARTIAL_FULLSCREEN ((sal_uLong)0x00800000)
// plugged system child window
-#define SAL_FRAME_STYLE_PLUG ((ULONG)0x10000000)
+#define SAL_FRAME_STYLE_PLUG ((sal_uLong)0x10000000)
// system child window inside another SalFrame
-#define SAL_FRAME_STYLE_SYSTEMCHILD ((ULONG)0x08000000)
+#define SAL_FRAME_STYLE_SYSTEMCHILD ((sal_uLong)0x08000000)
// floating window
-#define SAL_FRAME_STYLE_FLOAT ((ULONG)0x20000000)
+#define SAL_FRAME_STYLE_FLOAT ((sal_uLong)0x20000000)
// floating window that needs to be focusable
-#define SAL_FRAME_STYLE_FLOAT_FOCUSABLE ((ULONG)0x04000000)
+#define SAL_FRAME_STYLE_FLOAT_FOCUSABLE ((sal_uLong)0x04000000)
// toolwindows should be painted with a smaller decoration
-#define SAL_FRAME_STYLE_TOOLWINDOW ((ULONG)0x40000000)
+#define SAL_FRAME_STYLE_TOOLWINDOW ((sal_uLong)0x40000000)
// the window containing the intro bitmap, aka splashscreen
-#define SAL_FRAME_STYLE_INTRO ((ULONG)0x80000000)
+#define SAL_FRAME_STYLE_INTRO ((sal_uLong)0x80000000)
/*
-#define SAL_FRAME_STYLE_MINABLE ((ULONG)0x00000008)
-#define SAL_FRAME_STYLE_MAXABLE ((ULONG)0x00000010)
-#define SAL_FRAME_STYLE_BORDER ((ULONG)0x00000040)
-#define SAL_FRAME_STYLE_DOC ((ULONG)0x00004000)
-#define SAL_FRAME_STYLE_DIALOG ((ULONG)0x00008000)
-#define SAL_FRAME_STYLE_TOOL ((ULONG)0x00010000)
-#define SAL_FRAME_STYLE_FULLSIZE ((ULONG)0x00020000)
+#define SAL_FRAME_STYLE_MINABLE ((sal_uLong)0x00000008)
+#define SAL_FRAME_STYLE_MAXABLE ((sal_uLong)0x00000010)
+#define SAL_FRAME_STYLE_BORDER ((sal_uLong)0x00000040)
+#define SAL_FRAME_STYLE_DOC ((sal_uLong)0x00004000)
+#define SAL_FRAME_STYLE_DIALOG ((sal_uLong)0x00008000)
+#define SAL_FRAME_STYLE_TOOL ((sal_uLong)0x00010000)
+#define SAL_FRAME_STYLE_FULLSIZE ((sal_uLong)0x00020000)
*/
// ----------------------------------------
@@ -125,10 +125,10 @@ typedef sal_uInt64 SalExtStyle;
// - Flags for SetPosSize -
// ------------------------
-#define SAL_FRAME_POSSIZE_X ((USHORT)0x0001)
-#define SAL_FRAME_POSSIZE_Y ((USHORT)0x0002)
-#define SAL_FRAME_POSSIZE_WIDTH ((USHORT)0x0004)
-#define SAL_FRAME_POSSIZE_HEIGHT ((USHORT)0x0008)
+#define SAL_FRAME_POSSIZE_X ((sal_uInt16)0x0001)
+#define SAL_FRAME_POSSIZE_Y ((sal_uInt16)0x0002)
+#define SAL_FRAME_POSSIZE_WIDTH ((sal_uInt16)0x0004)
+#define SAL_FRAME_POSSIZE_HEIGHT ((sal_uInt16)0x0008)
#ifdef __cplusplus
@@ -141,7 +141,7 @@ using ::rtl::OString;
struct SystemParentData;
-class VCL_DLLPUBLIC SalFrame : public vcl::DeletionNotifier
+class VCL_PLUGIN_PUBLIC SalFrame : public vcl::DeletionNotifier
{
// the VCL window corresponding to this frame
Window* m_pWindow;
@@ -161,10 +161,10 @@ public:
// Event must be destroyed, when Frame is destroyed
// When Event is called, SalInstance::Yield() must be returned
- virtual BOOL PostEvent( void* pData ) = 0;
+ virtual sal_Bool PostEvent( void* pData ) = 0;
virtual void SetTitle( const XubString& rTitle ) = 0;
- virtual void SetIcon( USHORT nIcon ) = 0;
+ virtual void SetIcon( sal_uInt16 nIcon ) = 0;
virtual void SetRepresentedURL( const rtl::OUString& );
virtual void SetMenu( SalMenu *pSalMenu ) = 0;
virtual void DrawMenuBar() = 0;
@@ -173,13 +173,13 @@ public:
// Before the window is visible, a resize event
// must be sent with the correct size
- virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE ) = 0;
- virtual void Enable( BOOL bEnable ) = 0;
+ virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = sal_False ) = 0;
+ virtual void Enable( sal_Bool bEnable ) = 0;
// Set ClientSize and Center the Window to the desktop
// and send/post a resize message
virtual void SetMinClientSize( long nWidth, long nHeight ) = 0;
virtual void SetMaxClientSize( long nWidth, long nHeight ) = 0;
- virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags ) = 0;
+ virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) = 0;
virtual void GetClientSize( long& rWidth, long& rHeight ) = 0;
virtual void GetWorkArea( Rectangle& rRect ) = 0;
virtual SalFrame* GetParent() const = 0;
@@ -187,20 +187,20 @@ public:
SalFrameGeometry GetGeometry();
const SalFrameGeometry& GetUnmirroredGeometry() const { return maGeometry; }
virtual void SetWindowState( const SalFrameState* pState ) = 0;
- virtual BOOL GetWindowState( SalFrameState* pState ) = 0;
- virtual void ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay ) = 0;
+ virtual sal_Bool GetWindowState( SalFrameState* pState ) = 0;
+ virtual void ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay ) = 0;
// Enable/Disable ScreenSaver, SystemAgents, ...
- virtual void StartPresentation( BOOL bStart ) = 0;
+ virtual void StartPresentation( sal_Bool bStart ) = 0;
// Show Window over all other Windows
- virtual void SetAlwaysOnTop( BOOL bOnTop ) = 0;
+ virtual void SetAlwaysOnTop( sal_Bool bOnTop ) = 0;
// Window to top and grab focus
- virtual void ToTop( USHORT nFlags ) = 0;
+ virtual void ToTop( sal_uInt16 nFlags ) = 0;
// this function can call with the same
// pointer style
virtual void SetPointer( PointerStyle ePointerStyle ) = 0;
- virtual void CaptureMouse( BOOL bMouse ) = 0;
+ virtual void CaptureMouse( sal_Bool bMouse ) = 0;
virtual void SetPointerPos( long nX, long nY ) = 0;
// flush output buffer
@@ -210,15 +210,15 @@ public:
virtual void Sync() = 0;
virtual void SetInputContext( SalInputContext* pContext ) = 0;
- virtual void EndExtTextInput( USHORT nFlags ) = 0;
+ virtual void EndExtTextInput( sal_uInt16 nFlags ) = 0;
- virtual String GetKeyName( USHORT nKeyCode ) = 0;
- virtual String GetSymbolKeyName( const XubString& rFontName, USHORT nKeyCode ) = 0;
+ virtual String GetKeyName( sal_uInt16 nKeyCode ) = 0;
+ virtual String GetSymbolKeyName( const XubString& rFontName, sal_uInt16 nKeyCode ) = 0;
// returns in 'rKeyCode' the single keycode that translates to the given unicode when using a keyboard layout of language 'aLangType'
- // returns FALSE if no mapping exists or function not supported
+ // returns sal_False if no mapping exists or function not supported
// this is required for advanced menu support
- virtual BOOL MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode ) = 0;
+ virtual sal_Bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode ) = 0;
// returns the input language used for the last key stroke
// may be LANGUAGE_DONTKNOW if not supported by the OS
@@ -242,7 +242,7 @@ public:
// get current modifier, button mask and mouse position
struct SalPointerState
{
- ULONG mnState;
+ sal_uLong mnState;
Point maPos; // in frame coordinates
};
@@ -250,12 +250,12 @@ public:
struct SalIndicatorState
{
- USHORT mnState;
+ sal_uInt16 mnState;
};
virtual SalIndicatorState GetIndicatorState() = 0;
- virtual void SimulateKeyPress( USHORT nKeyCode ) = 0;
+ virtual void SimulateKeyPress( sal_uInt16 nKeyCode ) = 0;
// set new parent window
virtual void SetParent( SalFrame* pNewParent ) = 0;
@@ -273,13 +273,12 @@ public:
// set clip region to none (-> rectangular windows, normal state)
virtual void ResetClipRegion() = 0;
// start setting the clipregion consisting of nRects rectangles
- virtual void BeginSetClipRegion( ULONG nRects ) = 0;
+ virtual void BeginSetClipRegion( sal_uLong nRects ) = 0;
// add a rectangle to the clip region
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) = 0;
// done setting up the clipregion
virtual void EndSetClipRegion() = 0;
-
// Callbacks (indepent part in vcl/source/window/winproc.cxx)
// for default message handling return 0
void SetCallback( Window* pWindow, SALFRAMEPROC pProc )
@@ -291,7 +290,7 @@ public:
// Call the callback set; this sometimes necessary for implementation classes
// that should not now more than necessary about the SalFrame implementation
// (e.g. input methods, printer update handlers).
- long CallCallback( USHORT nEvent, const void* pEvent ) const
+ long CallCallback( sal_uInt16 nEvent, const void* pEvent ) const
{ return m_pProc ? m_pProc( m_pWindow, const_cast<SalFrame*>(this), nEvent, pEvent ) : 0; }
};
diff --git a/vcl/inc/vcl/salgdi.hxx b/vcl/inc/vcl/salgdi.hxx
index 20220151cafc..5b9e59f68d8f 100644..100755
--- a/vcl/inc/vcl/salgdi.hxx
+++ b/vcl/inc/vcl/salgdi.hxx
@@ -37,7 +37,6 @@
#include "osl/thread.hxx"
#include "vcl/outdev.hxx"
#include "vcl/salnativewidgets.hxx"
-#include "vcl/salctrlhandle.hxx"
#include <map>
@@ -67,13 +66,13 @@ namespace basegfx {
// - SalGraphics-Codes -
// ---------------------
-#define SAL_SETFONT_REMOVEANDMATCHNEW ((USHORT)0x0001)
-#define SAL_SETFONT_USEDRAWTEXT ((USHORT)0x0002)
-#define SAL_SETFONT_USEDRAWTEXTARRAY ((USHORT)0x0004)
-#define SAL_SETFONT_UNICODE ((USHORT)0x0008)
-#define SAL_SETFONT_BADFONT ((USHORT)0x1000)
+#define SAL_SETFONT_REMOVEANDMATCHNEW ((sal_uInt16)0x0001)
+#define SAL_SETFONT_USEDRAWTEXT ((sal_uInt16)0x0002)
+#define SAL_SETFONT_USEDRAWTEXTARRAY ((sal_uInt16)0x0004)
+#define SAL_SETFONT_UNICODE ((sal_uInt16)0x0008)
+#define SAL_SETFONT_BADFONT ((sal_uInt16)0x1000)
-#define SAL_COPYAREA_WINDOWINVALIDATE ((USHORT)0x0001)
+#define SAL_COPYAREA_WINDOWINVALIDATE ((sal_uInt16)0x0001)
// -------------------
// - common typedefs -
@@ -98,7 +97,7 @@ typedef std::vector< sal_Int32 > Int32Vector;
// note: all positions are in pixel and relative to
// the top/left-position of the virtual output area
-class VCL_DLLPUBLIC SalGraphics
+class VCL_PLUGIN_PUBLIC SalGraphics
{
int m_nLayout; // 0: mirroring off, 1: mirror x-axis
@@ -115,25 +114,24 @@ public:
virtual ~SalGraphics();
protected:
- virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight ) = 0;
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& ) = 0;
+ virtual bool setClipRegion( const Region& ) = 0;
// draw --> LineColor and FillColor and RasterOp and ClipRegion
virtual void drawPixel( long nX, long nY ) = 0;
virtual void drawPixel( long nX, long nY, SalColor nSalColor ) = 0;
virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ) = 0;
virtual void drawRect( long nX, long nY, long nWidth, long nHeight ) = 0;
- virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry ) = 0;
- virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry ) = 0;
+ virtual void drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry ) = 0;
+ virtual void drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry ) = 0;
virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ) = 0;
virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ) = 0;
virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ) = 0;
- virtual sal_Bool drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ) = 0;
- virtual sal_Bool drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ) = 0;
- virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, const BYTE* const* pFlgAry ) = 0;
+ virtual sal_Bool drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) = 0;
+ virtual sal_Bool drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) = 0;
+ virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, const sal_uInt8* const* pFlgAry ) = 0;
// CopyArea --> No RasterOp, but ClipRegion
virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,
- long nSrcHeight, USHORT nFlags ) = 0;
+ long nSrcHeight, sal_uInt16 nFlags ) = 0;
// CopyBits and DrawBitmap --> RasterOp and ClipRegion
// CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
@@ -154,20 +152,20 @@ protected:
// invert --> ClipRegion (only Windows or VirDevs)
virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags) = 0;
- virtual void invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags ) = 0;
+ virtual void invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags ) = 0;
- virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize ) = 0;
+ virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize ) = 0;
// native widget rendering methods that require mirroring
- virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
- const Point& aPos, BOOL& rIsInside );
- virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ virtual sal_Bool hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ const Point& aPos, sal_Bool& rIsInside );
+ virtual sal_Bool drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ virtual sal_Bool drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
+ virtual sal_Bool getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const rtl::OUString& aCaption,
Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion );
@@ -200,17 +198,12 @@ public:
// get device resolution
virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) = 0;
// get the depth of the device
- virtual USHORT GetBitCount() const = 0;
+ virtual sal_uInt16 GetBitCount() const = 0;
// get the width of the device
virtual long GetGraphicsWidth() const = 0;
// set the clip region to empty
virtual void ResetClipRegion() = 0;
- // begin setting the clip region, add rectangles to the
- // region with the UnionClipRegion call
- virtual void BeginSetClipRegion( ULONG nCount ) = 0;
- // all rectangles were added and the clip region should be set now
- virtual void EndSetClipRegion() = 0;
// set the line color to transparent (= don't draw lines)
virtual void SetLineColor() = 0;
@@ -230,7 +223,7 @@ public:
// set the text color to a specific color
virtual void SetTextColor( SalColor nSalColor ) = 0;
// set the font
- virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel ) = 0;
+ virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ) = 0;
// release the fonts
void ReleaseFonts() { SetFont( NULL, 0 ); }
// get the current font's metrics
@@ -238,9 +231,9 @@ public:
// get kernign pairs of the current font
// return only PairCount if (pKernPairs == NULL)
- virtual ULONG GetKernPairs( ULONG nMaxPairCount, ImplKernPairData* ) = 0;
+ virtual sal_uLong GetKernPairs( sal_uLong nMaxPairCount, ImplKernPairData* ) = 0;
// get the repertoire of the current font
- virtual ImplFontCharMap* GetImplFontCharMap() const = 0;
+ virtual const ImplFontCharMap* GetImplFontCharMap() const = 0;
// get the layout capabilities of the current font
virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const = 0;
// graphics must fill supplied font list
@@ -251,7 +244,7 @@ public:
virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ) = 0;
// CreateFontSubset: a method to get a subset of glyhps of a font
// inside a new valid font file
- // returns TRUE if creation of subset was successfull
+ // returns sal_True if creation of subset was successfull
// parameters: rToFile: contains a osl file URL to write the subset to
// pFont: describes from which font to create a subset
// pGlyphIDs: the glyph ids to be extracted
@@ -261,7 +254,7 @@ public:
// rInfo: additional outgoing information
// implementation note: encoding 0 with glyph id 0 should be added implicitly
// as "undefined character"
- virtual BOOL CreateFontSubset( const rtl::OUString& rToFile,
+ virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData* pFont,
sal_Int32* pGlyphIDs,
sal_uInt8* pEncoding,
@@ -305,8 +298,8 @@ public:
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc ) = 0;
- virtual BOOL GetGlyphBoundRect( long nIndex, Rectangle& ) = 0;
- virtual BOOL GetGlyphOutline( long nIndex, basegfx::B2DPolyPolygon& ) = 0;
+ virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& ) = 0;
+ virtual sal_Bool GetGlyphOutline( long nIndex, basegfx::B2DPolyPolygon& ) = 0;
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) = 0;
virtual void DrawServerFontLayout( const ServerFontLayout& ) = 0;
@@ -351,7 +344,7 @@ public:
void mirror( long& nX, const OutputDevice *pOutDev, bool bBack = false ) const;
void mirror( long& nX, long& nWidth, const OutputDevice *pOutDev, bool bBack = false ) const;
- BOOL mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev, bool bBack = false ) const;
+ sal_Bool mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev, bool bBack = false ) const;
void mirror( Rectangle& rRect, const OutputDevice*, bool bBack = false ) const;
void mirror( Region& rRgn, const OutputDevice *pOutDev, bool bBack = false ) const;
void mirror( ControlType,const ImplControlValue&,const OutputDevice*,bool bBack = false) const;
@@ -359,36 +352,35 @@ public:
basegfx::B2DPolygon mirror( const basegfx::B2DPolygon& i_rPoly, const OutputDevice *pOutDev, bool bBack = false ) const;
basegfx::B2DPolyPolygon mirror( const basegfx::B2DPolyPolygon& i_rPoly, const OutputDevice *pOutDev, bool bBack = false ) const;
- // non virtual methods; these do eventual coordinate mirroring and
+ // non virtual methods; these do possible coordinate mirroring and
// then delegate to protected virtual methods
- BOOL UnionClipRegion( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev );
- BOOL UnionClipRegion( const ::basegfx::B2DPolyPolygon&, const OutputDevice* );
+ bool SetClipRegion( const Region&, const OutputDevice *pOutDev );
// draw --> LineColor and FillColor and RasterOp and ClipRegion
void DrawPixel( long nX, long nY, const OutputDevice *pOutDev );
void DrawPixel( long nX, long nY, SalColor nSalColor, const OutputDevice *pOutDev );
void DrawLine( long nX1, long nY1, long nX2, long nY2, const OutputDevice *pOutDev );
void DrawRect( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev );
- void DrawPolyLine( ULONG nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev );
- void DrawPolygon( ULONG nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev );
+ void DrawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev );
+ void DrawPolygon( sal_uLong nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev );
void DrawPolyPolygon( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
PCONSTSALPOINT* pPtAry,
const OutputDevice *pOutDev );
bool DrawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency, const OutputDevice* );
bool DrawPolyLine( const basegfx::B2DPolygon&, double fTransparency, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin, const OutputDevice* );
- sal_Bool DrawPolyLineBezier( ULONG nPoints,
+ sal_Bool DrawPolyLineBezier( sal_uLong nPoints,
const SalPoint* pPtAry,
- const BYTE* pFlgAry,
+ const sal_uInt8* pFlgAry,
const OutputDevice *pOutDev );
- sal_Bool DrawPolygonBezier( ULONG nPoints,
+ sal_Bool DrawPolygonBezier( sal_uLong nPoints,
const SalPoint* pPtAry,
- const BYTE* pFlgAry,
+ const sal_uInt8* pFlgAry,
const OutputDevice *pOutDev );
sal_Bool DrawPolyPolygonBezier( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
- const BYTE* const* pFlgAry,
+ const sal_uInt8* const* pFlgAry,
const OutputDevice *pOutDev );
// CopyArea --> No RasterOp, but ClipRegion
@@ -398,7 +390,7 @@ public:
long nSrcY,
long nSrcWidth,
long nSrcHeight,
- USHORT nFlags,
+ sal_uInt16 nFlags,
const OutputDevice *pOutDev );
// CopyBits and DrawBitmap --> RasterOp and ClipRegion
@@ -429,27 +421,27 @@ public:
// invert --> ClipRegion (only Windows)
void Invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags, const OutputDevice *pOutDev );
- void Invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags, const OutputDevice *pOutDev );
+ void Invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags, const OutputDevice *pOutDev );
- BOOL DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize, const OutputDevice *pOutDev );
+ sal_Bool DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize, const OutputDevice *pOutDev );
//-------------------------------------
// Native Widget Rendering functions
//-------------------------------------
// Query the platform layer for control support
- virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
+ virtual sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart );
// Query the native control to determine if it was acted upon
- BOOL HitTestNativeControl( ControlType nType,
+ sal_Bool HitTestNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
const Point& aPos,
- BOOL& rIsInside,
+ sal_Bool& rIsInside,
const OutputDevice *pOutDev );
// Request rendering of a particular control and/or part
- BOOL DrawNativeControl( ControlType nType,
+ sal_Bool DrawNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -458,7 +450,7 @@ public:
const OutputDevice *pOutDev );
// Request rendering of a caption string for a control
- BOOL DrawNativeControlText( ControlType nType,
+ sal_Bool DrawNativeControlText( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -467,7 +459,7 @@ public:
const OutputDevice *pOutDev );
// Query the native control's actual drawing region (including adornment)
- BOOL GetNativeControlRegion( ControlType nType,
+ sal_Bool GetNativeControlRegion( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -480,7 +472,7 @@ public:
static void AddDevFontSubstitute( OutputDevice* pOutDev,
const String& rFontName,
const String& rReplaceFontName,
- USHORT nFlags = 0 );
+ sal_uInt16 nFlags = 0 );
bool DrawAlphaBitmap( const SalTwoRect&,
const SalBitmap& rSourceBitmap,
diff --git a/vcl/inc/vcl/salgtype.hxx b/vcl/inc/vcl/salgtype.hxx
index d6f0b6d7de2f..7f994f452f2c 100644
--- a/vcl/inc/vcl/salgtype.hxx
+++ b/vcl/inc/vcl/salgtype.hxx
@@ -35,11 +35,11 @@
// - SalColor -
// ------------
-typedef UINT32 SalColor;
-#define MAKE_SALCOLOR( r, g, b ) ((SalColor)(((UINT32)((UINT8)(b))))|(((UINT32)((UINT8)(g)))<<8)|(((UINT32)((UINT8)(r)))<<16))
-#define SALCOLOR_RED( n ) ((UINT8)((n)>>16))
-#define SALCOLOR_GREEN( n ) ((UINT8)(((UINT16)(n)) >> 8))
-#define SALCOLOR_BLUE( n ) ((UINT8)(n))
+typedef sal_uInt32 SalColor;
+#define MAKE_SALCOLOR( r, g, b ) ((SalColor)(((sal_uInt32)((sal_uInt8)(b))))|(((sal_uInt32)((sal_uInt8)(g)))<<8)|(((sal_uInt32)((sal_uInt8)(r)))<<16))
+#define SALCOLOR_RED( n ) ((sal_uInt8)((n)>>16))
+#define SALCOLOR_GREEN( n ) ((sal_uInt8)(((sal_uInt16)(n)) >> 8))
+#define SALCOLOR_BLUE( n ) ((sal_uInt8)(n))
#define SALCOLOR_NONE (~(SalColor)0)
// ------------
// - SalPoint -
@@ -74,7 +74,7 @@ struct SalTwoRect
// - SalROPColor -
// ---------------
-typedef USHORT SalROPColor;
+typedef sal_uInt16 SalROPColor;
#define SAL_ROP_0 ((SalROPColor)0)
#define SAL_ROP_1 ((SalROPColor)1)
#define SAL_ROP_INVERT ((SalROPColor)2)
@@ -83,7 +83,7 @@ typedef USHORT SalROPColor;
// - SalInvert -
// -------------
-typedef USHORT SalInvert;
+typedef sal_uInt16 SalInvert;
#define SAL_INVERT_HIGHLIGHT ((SalInvert)0x0001)
#define SAL_INVERT_50 ((SalInvert)0x0002)
#define SAL_INVERT_TRACKFRAME ((SalInvert)0x0004)
diff --git a/vcl/inc/vcl/salimestatus.hxx b/vcl/inc/vcl/salimestatus.hxx
index 76255e4f495c..13362c20071d 100644
--- a/vcl/inc/vcl/salimestatus.hxx
+++ b/vcl/inc/vcl/salimestatus.hxx
@@ -31,7 +31,7 @@
#include <vcl/dllapi.h>
-class VCL_DLLPUBLIC SalI18NImeStatus
+class VCL_PLUGIN_PUBLIC SalI18NImeStatus
{
public:
SalI18NImeStatus() {}
diff --git a/vcl/inc/vcl/salinst.hxx b/vcl/inc/vcl/salinst.hxx
index 45c354ff4d5c..d878dd7fea80 100644
--- a/vcl/inc/vcl/salinst.hxx
+++ b/vcl/inc/vcl/salinst.hxx
@@ -32,10 +32,12 @@
#include "com/sun/star/uno/Reference.hxx"
#include "vcl/sv.h"
+#include "vcl/displayconnectiondispatch.hxx"
#include "vcl/dllapi.h"
#include "tools/string.hxx"
+#include "rtl/ref.hxx"
#include "rtl/string.hxx"
#include <list>
@@ -61,38 +63,29 @@ struct SalItemParams;
class SalSession;
struct SystemGraphicsData;
struct SystemWindowData;
+class Menu;
// ---------------
// - SalInstance -
// ---------------
-class VCL_DLLPUBLIC SalInstance
+class VCL_PLUGIN_PUBLIC SalInstance
{
-public:
- typedef bool(*Callback)(void*,void*,int);
private:
- void* m_pEventInst;
- void* m_pErrorInst;
- Callback m_pEventCallback;
- Callback m_pErrorCallback;
+ rtl::Reference< vcl::DisplayConnectionDispatch > m_pEventInst;
public:
- SalInstance() :
- m_pEventInst( NULL ),
- m_pErrorInst( NULL ),
- m_pEventCallback( NULL ),
- m_pErrorCallback( NULL )
- {}
+ SalInstance() {}
virtual ~SalInstance();
// Frame
// DisplayName for Unix ???
- virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle ) = 0;
- virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle ) = 0;
+ virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle ) = 0;
+ virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle ) = 0;
virtual void DestroyFrame( SalFrame* pFrame ) = 0;
// Object (System Child Window)
- virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE ) = 0;
+ virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True ) = 0;
virtual void DestroyObject( SalObject* pObject ) = 0;
// VirtualDevice
@@ -101,7 +94,7 @@ public:
// pData allows for using a system dependent graphics or device context
virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
long nDX, long nDY,
- USHORT nBitCount, const SystemGraphicsData *pData = NULL ) = 0;
+ sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL ) = 0;
virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice ) = 0;
// Printer
@@ -130,42 +123,34 @@ public:
// YieldMutex
virtual osl::SolarMutex* GetYieldMutex() = 0;
- virtual ULONG ReleaseYieldMutex() = 0;
- virtual void AcquireYieldMutex( ULONG nCount ) = 0;
+ virtual sal_uLong ReleaseYieldMutex() = 0;
+ virtual void AcquireYieldMutex( sal_uLong nCount ) = 0;
+ // return true, if yield mutex is owned by this thread, else false
+ virtual bool CheckYieldMutex() = 0;
// wait next event and dispatch
// must returned by UserEvent (SalFrame::PostEvent)
// and timer
virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ) = 0;
- virtual bool AnyInput( USHORT nType ) = 0;
+ virtual bool AnyInput( sal_uInt16 nType ) = 0;
// Menues
- virtual SalMenu* CreateMenu( BOOL bMenuBar ) = 0;
- virtual void DestroyMenu( SalMenu* pMenu) = 0;
- virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ) = 0;
- virtual void DestroyMenuItem( SalMenuItem* pItem ) = 0;
+ virtual SalMenu* CreateMenu( sal_Bool bMenuBar, Menu* pMenu );
+ virtual void DestroyMenu( SalMenu* pMenu);
+ virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData );
+ virtual void DestroyMenuItem( SalMenuItem* pItem );
// may return NULL to disable session management
virtual SalSession* CreateSalSession() = 0;
// methods for XDisplayConnection
- // the parameters for the callbacks are:
- // void* pInst: pInstance form the SetCallback call
- // void* pEvent: address of the system specific event structure
- // int nBytes: length of the system specific event structure
- void SetEventCallback( void* pInstance, Callback pCallback )
- { m_pEventInst = pInstance; m_pEventCallback = pCallback; }
- Callback GetEventCallback() const
- { return m_pEventCallback; }
+ void SetEventCallback( rtl::Reference< vcl::DisplayConnectionDispatch > const & pInstance )
+ { m_pEventInst = pInstance; }
bool CallEventCallback( void* pEvent, int nBytes )
- { return m_pEventCallback ? m_pEventCallback( m_pEventInst, pEvent, nBytes ) : false; }
- void SetErrorEventCallback( void* pInstance, Callback pCallback )
- { m_pErrorInst = pInstance; m_pErrorCallback = pCallback; }
- Callback GetErrorEventCallback() const
- { return m_pErrorCallback; }
+ { return m_pEventInst.is() && m_pEventInst->dispatchEvent( pEvent, nBytes ); }
bool CallErrorCallback( void* pEvent, int nBytes )
- { return m_pErrorCallback ? m_pErrorCallback( m_pErrorInst, pEvent, nBytes ) : false; }
+ { return m_pEventInst.is() && m_pEventInst->dispatchErrorEvent( pEvent, nBytes ); }
enum ConnectionIdentifierType { AsciiCString, Blob };
virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ) = 0;
@@ -198,7 +183,7 @@ void DestroySalInstance( SalInstance* pInst );
void SalAbort( const XubString& rErrorText );
-VCL_DLLPUBLIC const ::rtl::OUString& SalGetDesktopEnvironment();
+VCL_PLUGIN_PUBLIC const ::rtl::OUString& SalGetDesktopEnvironment();
// -----------
// - SalData -
diff --git a/vcl/inc/vcl/sallayout.hxx b/vcl/inc/vcl/sallayout.hxx
index b26970c708d5..b91185769b27 100644
--- a/vcl/inc/vcl/sallayout.hxx
+++ b/vcl/inc/vcl/sallayout.hxx
@@ -73,7 +73,7 @@ class ImplFontData;
// -----------------
// used for managing runs e.g. for BiDi, glyph and script fallback
-class VCL_DLLPUBLIC ImplLayoutRuns
+class VCL_PLUGIN_PUBLIC ImplLayoutRuns
{
private:
int mnRunIndex;
@@ -149,7 +149,7 @@ sal_UCS4 GetVerticalChar( sal_UCS4 );
// #i80090# GetMirroredChar also needed outside vcl, moved to svapp.hxx
// VCL_DLLPUBLIC sal_UCS4 GetMirroredChar( sal_UCS4 );
sal_UCS4 GetLocalizedChar( sal_UCS4, LanguageType );
-VCL_DLLPUBLIC const char* GetAutofallback( sal_UCS4 ) ;
+VCL_PLUGIN_PUBLIC const char* GetAutofallback( sal_UCS4 ) ;
// -------------
// - SalLayout -
@@ -180,7 +180,7 @@ typedef sal_uInt32 sal_GlyphId;
// all positions/widths are in font units
// one exception: drawposition is in pixel units
-class VCL_DLLPUBLIC SalLayout
+class VCL_PLUGIN_PUBLIC SalLayout
{
public:
// used by upper layers
@@ -259,7 +259,7 @@ protected:
// - MultiSalLayout -
// ------------------
-class VCL_DLLPUBLIC MultiSalLayout : public SalLayout
+class VCL_PLUGIN_PUBLIC MultiSalLayout : public SalLayout
{
public:
virtual void DrawText( SalGraphics& ) const;
@@ -272,7 +272,7 @@ public:
virtual bool GetBoundRect( SalGraphics&, Rectangle& ) const;
// used only by OutputDevice::ImplLayout, TODO: make friend
- MultiSalLayout( SalLayout& rBaseLayout,
+ explicit MultiSalLayout( SalLayout& rBaseLayout,
const ImplFontData* pBaseFont = NULL );
virtual bool AddFallback( SalLayout& rFallbackLayout,
ImplLayoutRuns&, const ImplFontData* pFallbackFont );
@@ -342,7 +342,7 @@ typedef std::vector<GlyphItem> GlyphVector;
// ---------------
-class VCL_DLLPUBLIC GenericSalLayout : public SalLayout
+class VCL_PLUGIN_PUBLIC GenericSalLayout : public SalLayout
{
public:
// used by layout engines
diff --git a/vcl/inc/vcl/salmenu.hxx b/vcl/inc/vcl/salmenu.hxx
index 3ddcb95d4475..63fb12ee4a84 100644
--- a/vcl/inc/vcl/salmenu.hxx
+++ b/vcl/inc/vcl/salmenu.hxx
@@ -41,7 +41,7 @@ class SalFrame;
struct SalItemParams
{
- USHORT nId; // item Id
+ sal_uInt16 nId; // item Id
MenuItemType eType; // MenuItem-Type
MenuItemBits nBits; // MenuItem-Bits
Menu* pMenu; // Pointer to Menu
@@ -52,49 +52,49 @@ struct SalItemParams
struct SalMenuButtonItem
{
- USHORT mnId;
+ sal_uInt16 mnId;
Image maImage;
rtl::OUString maToolTipText;
SalMenuButtonItem() : mnId( 0 ) {}
- SalMenuButtonItem( USHORT i_nId, const Image& rImg, const rtl::OUString& i_rTTText = rtl::OUString() )
+ SalMenuButtonItem( sal_uInt16 i_nId, const Image& rImg, const rtl::OUString& i_rTTText = rtl::OUString() )
: mnId( i_nId ), maImage( rImg ), maToolTipText( i_rTTText ) {}
};
-class VCL_DLLPUBLIC SalMenuItem
+class VCL_PLUGIN_PUBLIC SalMenuItem
{
public:
SalMenuItem() {}
virtual ~SalMenuItem();
};
-class VCL_DLLPUBLIC SalMenu
+class VCL_PLUGIN_PUBLIC SalMenu
{
public:
SalMenu() {}
virtual ~SalMenu();
- virtual BOOL VisibleMenuBar() = 0; // must return TRUE to actually DISPLAY native menu bars
+ virtual sal_Bool VisibleMenuBar() = 0; // must return sal_True to actually DISPLAY native menu bars
// otherwise only menu messages are processed (eg, OLE on Windows)
virtual void InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos ) = 0;
virtual void RemoveItem( unsigned nPos ) = 0;
virtual void SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos ) = 0;
virtual void SetFrame( const SalFrame* pFrame ) = 0;
- virtual void CheckItem( unsigned nPos, BOOL bCheck ) = 0;
- virtual void EnableItem( unsigned nPos, BOOL bEnable ) = 0;
+ virtual void CheckItem( unsigned nPos, sal_Bool bCheck ) = 0;
+ virtual void EnableItem( unsigned nPos, sal_Bool bEnable ) = 0;
virtual void SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const XubString& rText )= 0;
virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage ) = 0;
virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const XubString& rKeyName ) = 0;
virtual void GetSystemMenuData( SystemMenuData* pData ) = 0;
- virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, ULONG nFlags);
+ virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, sal_uLong nFlags);
virtual bool AddMenuBarButton( const SalMenuButtonItem& ); // return false if not implemented or failure
- virtual void RemoveMenuBarButton( USHORT nId );
+ virtual void RemoveMenuBarButton( sal_uInt16 nId );
// return an empty rectangle if not implemented
// return Rectangle( Point( -1, -1 ), Size( 1, 1 ) ) if menu bar buttons implemented
// but rectangle cannot be determined
- virtual Rectangle GetMenuBarButtonRectPixel( USHORT i_nItemId, SalFrame* i_pReferenceFrame );
+ virtual Rectangle GetMenuBarButtonRectPixel( sal_uInt16 i_nItemId, SalFrame* i_pReferenceFrame );
};
diff --git a/vcl/inc/vcl/salnativewidgets.hxx b/vcl/inc/vcl/salnativewidgets.hxx
index bea43a41c24f..696a8660bb2f 100644..100755
--- a/vcl/inc/vcl/salnativewidgets.hxx
+++ b/vcl/inc/vcl/salnativewidgets.hxx
@@ -177,6 +177,7 @@ typedef sal_uInt32 ControlPart;
#define PART_MENU_ITEM 250
#define PART_MENU_ITEM_CHECK_MARK 251
#define PART_MENU_ITEM_RADIO_MARK 252
+#define PART_MENU_SEPARATOR 253
/* #i77549#
HACK: for scrollbars in case of thumb rect, page up and page down rect we
@@ -308,7 +309,7 @@ class VCL_DLLPUBLIC ImplControlValue
*
* Value container for scrollbars.
*/
- class VCL_DLLPUBLIC ScrollbarValue : public ImplControlValue
+class VCL_DLLPUBLIC ScrollbarValue : public ImplControlValue
{
public:
long mnMin;
@@ -374,12 +375,12 @@ class VCL_DLLPUBLIC TabitemValue : public ImplControlValue
};
virtual ~TabitemValue();
- BOOL isLeftAligned() const { return (mnAlignment & TABITEM_LEFTALIGNED) != 0; }
- BOOL isRightAligned() const { return (mnAlignment & TABITEM_RIGHTALIGNED) != 0; }
- BOOL isBothAligned() const { return isLeftAligned() && isRightAligned(); }
- BOOL isNotAligned() const { return (mnAlignment & (TABITEM_LEFTALIGNED | TABITEM_RIGHTALIGNED)) == 0; }
- BOOL isFirst() const { return (mnAlignment & TABITEM_FIRST_IN_GROUP) != 0; }
- BOOL isLast() const { return (mnAlignment & TABITEM_LAST_IN_GROUP) != 0; }
+ sal_Bool isLeftAligned() const { return (mnAlignment & TABITEM_LEFTALIGNED) != 0; }
+ sal_Bool isRightAligned() const { return (mnAlignment & TABITEM_RIGHTALIGNED) != 0; }
+ sal_Bool isBothAligned() const { return isLeftAligned() && isRightAligned(); }
+ sal_Bool isNotAligned() const { return (mnAlignment & (TABITEM_LEFTALIGNED | TABITEM_RIGHTALIGNED)) == 0; }
+ sal_Bool isFirst() const { return (mnAlignment & TABITEM_FIRST_IN_GROUP) != 0; }
+ sal_Bool isLast() const { return (mnAlignment & TABITEM_LAST_IN_GROUP) != 0; }
};
/* SpinbuttonValue:
@@ -414,10 +415,10 @@ class ToolbarValue : public ImplControlValue
{
public:
ToolbarValue() : ImplControlValue( CTRL_TOOLBAR, BUTTONVALUE_DONTKNOW, 0 )
- { mbIsTopDockingArea = FALSE; }
+ { mbIsTopDockingArea = sal_False; }
virtual ~ToolbarValue();
Rectangle maGripRect;
- BOOL mbIsTopDockingArea; // indicates that this is the top aligned dockingarea
+ sal_Bool mbIsTopDockingArea; // indicates that this is the top aligned dockingarea
// adjacent to the menubar
};
@@ -434,6 +435,24 @@ public:
int maTopDockingAreaHeight;
};
+/* MenupopupValue:
+ *
+ * Value container for menu items; specifies the rectangle for the whole item which
+ * may be useful when drawing parts with a smaller rectangle.
+ */
+class MenupopupValue : public ImplControlValue
+{
+public:
+ MenupopupValue() : ImplControlValue( CTRL_MENU_POPUP, BUTTONVALUE_DONTKNOW, 0 )
+ {}
+ MenupopupValue( long i_nGutterWidth, const Rectangle& i_rItemRect )
+ : ImplControlValue( CTRL_MENU_POPUP, BUTTONVALUE_DONTKNOW, i_nGutterWidth )
+ , maItemRect( i_rItemRect )
+ {}
+ virtual ~MenupopupValue();
+ Rectangle maItemRect;
+};
+
/* PushButtonValue:
*
* Value container for pushbuttons specifying additional drawing hints
diff --git a/vcl/inc/vcl/salobj.hxx b/vcl/inc/vcl/salobj.hxx
index 6ba025befdbe..4e781787b0c9 100644
--- a/vcl/inc/vcl/salobj.hxx
+++ b/vcl/inc/vcl/salobj.hxx
@@ -40,53 +40,55 @@ struct SystemEnvData;
// - SalObject-Types -
// -------------------
-#define SAL_OBJECT_CLIP_INCLUDERECTS ((USHORT)0x0001)
-#define SAL_OBJECT_CLIP_EXCLUDERECTS ((USHORT)0x0002)
-#define SAL_OBJECT_CLIP_ABSOLUTE ((USHORT)0x0004)
+#define SAL_OBJECT_CLIP_INCLUDERECTS ((sal_uInt16)0x0001)
+#define SAL_OBJECT_CLIP_EXCLUDERECTS ((sal_uInt16)0x0002)
+#define SAL_OBJECT_CLIP_ABSOLUTE ((sal_uInt16)0x0004)
// -------------
// - SalObject -
// -------------
-class VCL_DLLPUBLIC SalObject
+class VCL_PLUGIN_PUBLIC SalObject
{
void* m_pInst;
SALOBJECTPROC m_pCallback;
- BOOL m_bMouseTransparent:1,
+ sal_Bool m_bMouseTransparent:1,
m_bEraseBackground:1;
public:
- SalObject() : m_pInst( NULL ), m_pCallback( NULL ), m_bMouseTransparent( FALSE ), m_bEraseBackground( TRUE ) {}
+ SalObject() : m_pInst( NULL ), m_pCallback( NULL ), m_bMouseTransparent( sal_False ), m_bEraseBackground( sal_True ) {}
virtual ~SalObject();
virtual void ResetClipRegion() = 0;
- virtual USHORT GetClipRegionType() = 0;
- virtual void BeginSetClipRegion( ULONG nRects ) = 0;
+ virtual sal_uInt16 GetClipRegionType() = 0;
+ virtual void BeginSetClipRegion( sal_uLong nRects ) = 0;
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) = 0;
virtual void EndSetClipRegion() = 0;
virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight ) = 0;
- virtual void Show( BOOL bVisible ) = 0;
- virtual void Enable( BOOL nEnable ) = 0;
+ virtual void Show( sal_Bool bVisible ) = 0;
+ virtual void Enable( sal_Bool nEnable ) = 0;
virtual void GrabFocus() = 0;
virtual void SetBackground() = 0;
virtual void SetBackground( SalColor nSalColor ) = 0;
- virtual void SetForwardKey( BOOL /*bEnable*/ ) {}
+ virtual void SetForwardKey( sal_Bool /*bEnable*/ ) {}
virtual const SystemEnvData* GetSystemData() const = 0;
+ virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ) = 0;
+
void SetCallback( void* pInst, SALOBJECTPROC pProc )
{ m_pInst = pInst; m_pCallback = pProc; }
- long CallCallback( USHORT nEvent, const void* pEvent )
+ long CallCallback( sal_uInt16 nEvent, const void* pEvent )
{ return m_pCallback ? m_pCallback( m_pInst, this, nEvent, pEvent ) : 0; }
- void SetMouseTransparent( BOOL bMouseTransparent )
+ void SetMouseTransparent( sal_Bool bMouseTransparent )
{ m_bMouseTransparent = bMouseTransparent; }
- BOOL IsMouseTransparent()
+ sal_Bool IsMouseTransparent()
{ return m_bMouseTransparent; }
- void EnableEraseBackground( BOOL bEnable )
+ void EnableEraseBackground( sal_Bool bEnable )
{ m_bEraseBackground = bEnable; }
- BOOL IsEraseBackgroundEnabled()
+ sal_Bool IsEraseBackgroundEnabled()
{ return m_bEraseBackground; }
};
diff --git a/vcl/inc/vcl/salprn.hxx b/vcl/inc/vcl/salprn.hxx
index be387b4f1c7f..e820614e4cdd 100644
--- a/vcl/inc/vcl/salprn.hxx
+++ b/vcl/inc/vcl/salprn.hxx
@@ -45,14 +45,14 @@ namespace vcl { class PrinterController; }
// - SalPrinterQueueInfo -
// -----------------------
-struct VCL_DLLPUBLIC SalPrinterQueueInfo
+struct VCL_PLUGIN_PUBLIC SalPrinterQueueInfo
{
XubString maPrinterName;
XubString maDriver;
XubString maLocation;
XubString maComment;
- ULONG mnStatus;
- ULONG mnJobs;
+ sal_uLong mnStatus;
+ sal_uLong mnJobs;
void* mpSysData;
SalPrinterQueueInfo();
@@ -63,7 +63,7 @@ struct VCL_DLLPUBLIC SalPrinterQueueInfo
// - SalInfoPrinter -
// ------------------
-class VCL_DLLPUBLIC SalInfoPrinter
+class VCL_PLUGIN_PUBLIC SalInfoPrinter
{
public:
std::vector< PaperInfo > m_aPaperFormats; // all printer supported formats
@@ -78,23 +78,23 @@ public:
virtual SalGraphics* GetGraphics() = 0;
virtual void ReleaseGraphics( SalGraphics* pGraphics ) = 0;
- virtual BOOL Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ) = 0;
+ virtual sal_Bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ) = 0;
// This function set the driver data and
// set the new indepen data in pSetupData
- virtual BOOL SetPrinterData( ImplJobSetup* pSetupData ) = 0;
+ virtual sal_Bool SetPrinterData( ImplJobSetup* pSetupData ) = 0;
// This function merged the indepen driver data
// and set the new indepen data in pSetupData
// Only the data must changed, where the bit
// in nFlags is set
- virtual BOOL SetData( ULONG nFlags, ImplJobSetup* pSetupData ) = 0;
+ virtual sal_Bool SetData( sal_uLong nFlags, ImplJobSetup* pSetupData ) = 0;
virtual void GetPageInfo( const ImplJobSetup* pSetupData,
long& rOutWidth, long& rOutHeight,
long& rPageOffX, long& rPageOffY,
long& rPageWidth, long& rPageHeight ) = 0;
- virtual ULONG GetCapabilities( const ImplJobSetup* pSetupData, USHORT nType ) = 0;
- virtual ULONG GetPaperBinCount( const ImplJobSetup* pSetupData ) = 0;
- virtual String GetPaperBinName( const ImplJobSetup* pSetupData, ULONG nPaperBin ) = 0;
+ virtual sal_uLong GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType ) = 0;
+ virtual sal_uLong GetPaperBinCount( const ImplJobSetup* pSetupData ) = 0;
+ virtual String GetPaperBinName( const ImplJobSetup* pSetupData, sal_uLong nPaperBin ) = 0;
// fills m_aPaperFormats and sets m_bPapersInit to true
virtual void InitPaperFormats( const ImplJobSetup* pSetupData ) = 0;
// returns angle that a landscape page will be turned counterclockwise wrt to portrait
@@ -105,33 +105,33 @@ public:
// - SalPrinter -
// --------------
-class VCL_DLLPUBLIC SalPrinter
+class VCL_PLUGIN_PUBLIC SalPrinter
{
public: // public for Sal Implementation
SalPrinter() {}
virtual ~SalPrinter();
- virtual BOOL StartJob( const String* pFileName,
+ virtual sal_Bool StartJob( const String* pFileName,
const String& rJobName,
const String& rAppName,
- ULONG nCopies,
+ sal_uLong nCopies,
bool bCollate,
bool bDirect,
ImplJobSetup* pSetupData ) = 0;
// implement for pull model print systems only,
- // default implementations (see salvtables.cxx) just returns FALSE
- virtual BOOL StartJob( const String* pFileName,
+ // default implementations (see salvtables.cxx) just returns sal_False
+ virtual sal_Bool StartJob( const String* pFileName,
const String& rJobName,
const String& rAppName,
ImplJobSetup* pSetupData,
vcl::PrinterController& rController );
- virtual BOOL EndJob() = 0;
- virtual BOOL AbortJob() = 0;
- virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData ) = 0;
- virtual BOOL EndPage() = 0;
- virtual ULONG GetErrorCode() = 0;
+ virtual sal_Bool EndJob() = 0;
+ virtual sal_Bool AbortJob() = 0;
+ virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData ) = 0;
+ virtual sal_Bool EndPage() = 0;
+ virtual sal_uLong GetErrorCode() = 0;
};
diff --git a/vcl/inc/vcl/salptype.hxx b/vcl/inc/vcl/salptype.hxx
index 7ad8b2a2c5f9..ca47f599271c 100644
--- a/vcl/inc/vcl/salptype.hxx
+++ b/vcl/inc/vcl/salptype.hxx
@@ -35,10 +35,10 @@
// - SalJobSetupFlags -
// --------------------
-#define SAL_JOBSET_ORIENTATION ((ULONG)0x00000001)
-#define SAL_JOBSET_PAPERBIN ((ULONG)0x00000002)
-#define SAL_JOBSET_PAPERSIZE ((ULONG)0x00000004)
-#define SAL_JOBSET_DUPLEXMODE ((ULONG)0x00000008)
+#define SAL_JOBSET_ORIENTATION ((sal_uLong)0x00000001)
+#define SAL_JOBSET_PAPERBIN ((sal_uLong)0x00000002)
+#define SAL_JOBSET_PAPERSIZE ((sal_uLong)0x00000004)
+#define SAL_JOBSET_DUPLEXMODE ((sal_uLong)0x00000008)
#define SAL_JOBSET_ALL (SAL_JOBSET_ORIENTATION |\
SAL_JOBSET_PAPERBIN |\
SAL_JOBSET_PAPERSIZE |\
diff --git a/vcl/inc/vcl/salsession.hxx b/vcl/inc/vcl/salsession.hxx
index 5d2fc5cf34ff..c912565a920c 100644
--- a/vcl/inc/vcl/salsession.hxx
+++ b/vcl/inc/vcl/salsession.hxx
@@ -86,7 +86,7 @@ struct SalSessionQuitEvent : public SalSessionEvent
typedef void(*SessionProc)( SalSessionEvent *pEvent);
-class VCL_DLLPUBLIC SalSession
+class VCL_PLUGIN_PUBLIC SalSession
{
SessionProc m_aProc;
public:
diff --git a/vcl/inc/vcl/salsys.hxx b/vcl/inc/vcl/salsys.hxx
index df8223ca8759..2f2f6d08e9e6 100644
--- a/vcl/inc/vcl/salsys.hxx
+++ b/vcl/inc/vcl/salsys.hxx
@@ -59,7 +59,7 @@ const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO = 7;
// - SalSystem -
// -------------
-class VCL_DLLPUBLIC SalSystem
+class VCL_PLUGIN_PUBLIC SalSystem
{
public:
SalSystem() {}
diff --git a/vcl/inc/vcl/saltimer.hxx b/vcl/inc/vcl/saltimer.hxx
index 78c27769c7a6..4bbaddb65b31 100644
--- a/vcl/inc/vcl/saltimer.hxx
+++ b/vcl/inc/vcl/saltimer.hxx
@@ -43,7 +43,7 @@
* this needed to be virtualized for the sal plugin migration
*/
-class VCL_DLLPUBLIC SalTimer
+class VCL_PLUGIN_PUBLIC SalTimer
{
SALTIMERPROC m_pProc;
public:
@@ -51,7 +51,7 @@ public:
virtual ~SalTimer();
// AutoRepeat and Restart
- virtual void Start( ULONG nMS ) = 0;
+ virtual void Start( sal_uLong nMS ) = 0;
virtual void Stop() = 0;
// Callbacks (indepen in \sv\source\app\timer.cxx)
diff --git a/vcl/inc/vcl/salvd.hxx b/vcl/inc/vcl/salvd.hxx
index 2b6c6191add6..68ed56a901d8 100644
--- a/vcl/inc/vcl/salvd.hxx
+++ b/vcl/inc/vcl/salvd.hxx
@@ -38,7 +38,7 @@ class SalGraphics;
// - SalVirtualDevice -
// --------------------
-class VCL_DLLPUBLIC SalVirtualDevice
+class VCL_PLUGIN_PUBLIC SalVirtualDevice
{
public: // public for Sal Implementation
SalVirtualDevice() {}
@@ -50,7 +50,7 @@ public: // public for Sal Implementation
virtual void ReleaseGraphics( SalGraphics* pGraphics ) = 0;
// Set new size, without saving the old contents
- virtual BOOL SetSize( long nNewDX, long nNewDY ) = 0;
+ virtual sal_Bool SetSize( long nNewDX, long nNewDY ) = 0;
/// Get actual VDev size in pixel
virtual void GetSize( long& rWidth, long& rHeight ) = 0;
diff --git a/vcl/inc/vcl/salwtype.hxx b/vcl/inc/vcl/salwtype.hxx
index 90ccb92af6a2..d8bd6c527f85 100644
--- a/vcl/inc/vcl/salwtype.hxx
+++ b/vcl/inc/vcl/salwtype.hxx
@@ -46,68 +46,68 @@ class ImplFontSelectData;
// Muessen mit den Defines in cmdevt.hxx uebereinstimmen, da diese
// nicht konvertiert werden
-#define SAL_EXTTEXTINPUT_ATTR_GRAYWAVELINE ((USHORT)0x0100)
-#define SAL_EXTTEXTINPUT_ATTR_UNDERLINE ((USHORT)0x0200)
-#define SAL_EXTTEXTINPUT_ATTR_BOLDUNDERLINE ((USHORT)0x0400)
-#define SAL_EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE ((USHORT)0x0800)
-#define SAL_EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE ((USHORT)0x1000)
-#define SAL_EXTTEXTINPUT_ATTR_HIGHLIGHT ((USHORT)0x2000)
-#define SAL_EXTTEXTINPUT_ATTR_REDTEXT ((USHORT)0x4000)
-#define SAL_EXTTEXTINPUT_ATTR_HALFTONETEXT ((USHORT)0x8000)
-
-#define SAL_EXTTEXTINPUT_CURSOR_INVISIBLE ((USHORT)0x0001)
-#define SAL_EXTTEXTINPUT_CURSOR_OVERWRITE ((USHORT)0x0002)
+#define SAL_EXTTEXTINPUT_ATTR_GRAYWAVELINE ((sal_uInt16)0x0100)
+#define SAL_EXTTEXTINPUT_ATTR_UNDERLINE ((sal_uInt16)0x0200)
+#define SAL_EXTTEXTINPUT_ATTR_BOLDUNDERLINE ((sal_uInt16)0x0400)
+#define SAL_EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE ((sal_uInt16)0x0800)
+#define SAL_EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE ((sal_uInt16)0x1000)
+#define SAL_EXTTEXTINPUT_ATTR_HIGHLIGHT ((sal_uInt16)0x2000)
+#define SAL_EXTTEXTINPUT_ATTR_REDTEXT ((sal_uInt16)0x4000)
+#define SAL_EXTTEXTINPUT_ATTR_HALFTONETEXT ((sal_uInt16)0x8000)
+
+#define SAL_EXTTEXTINPUT_CURSOR_INVISIBLE ((sal_uInt16)0x0001)
+#define SAL_EXTTEXTINPUT_CURSOR_OVERWRITE ((sal_uInt16)0x0002)
// ------------
// - SalEvent -
// ------------
-#define SALEVENT_MOUSEMOVE ((USHORT)1)
-#define SALEVENT_MOUSELEAVE ((USHORT)2)
-#define SALEVENT_MOUSEBUTTONDOWN ((USHORT)3)
-#define SALEVENT_MOUSEBUTTONUP ((USHORT)4)
-#define SALEVENT_KEYINPUT ((USHORT)5)
-#define SALEVENT_KEYUP ((USHORT)6)
-#define SALEVENT_KEYMODCHANGE ((USHORT)7)
-#define SALEVENT_PAINT ((USHORT)8)
-#define SALEVENT_RESIZE ((USHORT)9)
-#define SALEVENT_GETFOCUS ((USHORT)10)
-#define SALEVENT_LOSEFOCUS ((USHORT)11)
-#define SALEVENT_CLOSE ((USHORT)12)
-#define SALEVENT_SHUTDOWN ((USHORT)13)
-#define SALEVENT_SETTINGSCHANGED ((USHORT)14)
-#define SALEVENT_VOLUMECHANGED ((USHORT)15)
-#define SALEVENT_PRINTERCHANGED ((USHORT)16)
-#define SALEVENT_DISPLAYCHANGED ((USHORT)17)
-#define SALEVENT_FONTCHANGED ((USHORT)18)
-#define SALEVENT_DATETIMECHANGED ((USHORT)19)
-#define SALEVENT_KEYBOARDCHANGED ((USHORT)20)
-#define SALEVENT_WHEELMOUSE ((USHORT)21)
-#define SALEVENT_USEREVENT ((USHORT)22)
-#define SALEVENT_MOUSEACTIVATE ((USHORT)23)
-#define SALEVENT_EXTTEXTINPUT ((USHORT)24)
-#define SALEVENT_ENDEXTTEXTINPUT ((USHORT)25)
-#define SALEVENT_EXTTEXTINPUTPOS ((USHORT)26)
-#define SALEVENT_INPUTCONTEXTCHANGE ((USHORT)27)
-#define SALEVENT_MOVE ((USHORT)28)
-#define SALEVENT_MOVERESIZE ((USHORT)29)
-#define SALEVENT_CLOSEPOPUPS ((USHORT)30)
-#define SALEVENT_EXTERNALKEYINPUT ((USHORT)31)
-#define SALEVENT_EXTERNALKEYUP ((USHORT)32)
-#define SALEVENT_MENUCOMMAND ((USHORT)33)
-#define SALEVENT_MENUHIGHLIGHT ((USHORT)34)
-#define SALEVENT_MENUACTIVATE ((USHORT)35)
-#define SALEVENT_MENUDEACTIVATE ((USHORT)36)
-#define SALEVENT_EXTERNALMOUSEMOVE ((USHORT)37)
-#define SALEVENT_EXTERNALMOUSEBUTTONDOWN ((USHORT)38)
-#define SALEVENT_EXTERNALMOUSEBUTTONUP ((USHORT)39)
-#define SALEVENT_INPUTLANGUAGECHANGE ((USHORT)40)
-#define SALEVENT_SHOWDIALOG ((USHORT)41)
-#define SALEVENT_MENUBUTTONCOMMAND ((USHORT)42)
-#define SALEVENT_SURROUNDINGTEXTREQUEST ((USHORT)43)
-#define SALEVENT_SURROUNDINGTEXTSELECTIONCHANGE ((USHORT)44)
-#define SALEVENT_STARTRECONVERSION ((USHORT)45)
-#define SALEVENT_COUNT ((USHORT)45)
+#define SALEVENT_MOUSEMOVE ((sal_uInt16)1)
+#define SALEVENT_MOUSELEAVE ((sal_uInt16)2)
+#define SALEVENT_MOUSEBUTTONDOWN ((sal_uInt16)3)
+#define SALEVENT_MOUSEBUTTONUP ((sal_uInt16)4)
+#define SALEVENT_KEYINPUT ((sal_uInt16)5)
+#define SALEVENT_KEYUP ((sal_uInt16)6)
+#define SALEVENT_KEYMODCHANGE ((sal_uInt16)7)
+#define SALEVENT_PAINT ((sal_uInt16)8)
+#define SALEVENT_RESIZE ((sal_uInt16)9)
+#define SALEVENT_GETFOCUS ((sal_uInt16)10)
+#define SALEVENT_LOSEFOCUS ((sal_uInt16)11)
+#define SALEVENT_CLOSE ((sal_uInt16)12)
+#define SALEVENT_SHUTDOWN ((sal_uInt16)13)
+#define SALEVENT_SETTINGSCHANGED ((sal_uInt16)14)
+#define SALEVENT_VOLUMECHANGED ((sal_uInt16)15)
+#define SALEVENT_PRINTERCHANGED ((sal_uInt16)16)
+#define SALEVENT_DISPLAYCHANGED ((sal_uInt16)17)
+#define SALEVENT_FONTCHANGED ((sal_uInt16)18)
+#define SALEVENT_DATETIMECHANGED ((sal_uInt16)19)
+#define SALEVENT_KEYBOARDCHANGED ((sal_uInt16)20)
+#define SALEVENT_WHEELMOUSE ((sal_uInt16)21)
+#define SALEVENT_USEREVENT ((sal_uInt16)22)
+#define SALEVENT_MOUSEACTIVATE ((sal_uInt16)23)
+#define SALEVENT_EXTTEXTINPUT ((sal_uInt16)24)
+#define SALEVENT_ENDEXTTEXTINPUT ((sal_uInt16)25)
+#define SALEVENT_EXTTEXTINPUTPOS ((sal_uInt16)26)
+#define SALEVENT_INPUTCONTEXTCHANGE ((sal_uInt16)27)
+#define SALEVENT_MOVE ((sal_uInt16)28)
+#define SALEVENT_MOVERESIZE ((sal_uInt16)29)
+#define SALEVENT_CLOSEPOPUPS ((sal_uInt16)30)
+#define SALEVENT_EXTERNALKEYINPUT ((sal_uInt16)31)
+#define SALEVENT_EXTERNALKEYUP ((sal_uInt16)32)
+#define SALEVENT_MENUCOMMAND ((sal_uInt16)33)
+#define SALEVENT_MENUHIGHLIGHT ((sal_uInt16)34)
+#define SALEVENT_MENUACTIVATE ((sal_uInt16)35)
+#define SALEVENT_MENUDEACTIVATE ((sal_uInt16)36)
+#define SALEVENT_EXTERNALMOUSEMOVE ((sal_uInt16)37)
+#define SALEVENT_EXTERNALMOUSEBUTTONDOWN ((sal_uInt16)38)
+#define SALEVENT_EXTERNALMOUSEBUTTONUP ((sal_uInt16)39)
+#define SALEVENT_INPUTLANGUAGECHANGE ((sal_uInt16)40)
+#define SALEVENT_SHOWDIALOG ((sal_uInt16)41)
+#define SALEVENT_MENUBUTTONCOMMAND ((sal_uInt16)42)
+#define SALEVENT_SURROUNDINGTEXTREQUEST ((sal_uInt16)43)
+#define SALEVENT_SURROUNDINGTEXTSELECTIONCHANGE ((sal_uInt16)44)
+#define SALEVENT_STARTRECONVERSION ((sal_uInt16)45)
+#define SALEVENT_COUNT ((sal_uInt16)45)
// MOUSELEAVE must send, when the pointer leave the client area and
// the mouse is not captured
@@ -115,39 +115,39 @@ class ImplFontSelectData;
// MAC: Ctrl+Button is MOUSE_RIGHT
struct SalMouseEvent
{
- ULONG mnTime; // Time in ms, when event is created
+ sal_uLong mnTime; // Time in ms, when event is created
long mnX; // X-Position (Pixel, TopLeft-Output)
long mnY; // Y-Position (Pixel, TopLeft-Output)
- USHORT mnButton; // 0-MouseMove/MouseLeave, MOUSE_LEFT, MOUSE_RIGHT, MOUSE_MIDDLE
- USHORT mnCode; // SV-ModifierCode (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT)
+ sal_uInt16 mnButton; // 0-MouseMove/MouseLeave, MOUSE_LEFT, MOUSE_RIGHT, MOUSE_MIDDLE
+ sal_uInt16 mnCode; // SV-ModifierCode (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT)
};
// KEYINPUT and KEYUP
struct SalKeyEvent
{
- ULONG mnTime; // Time in ms, when event is created
- USHORT mnCode; // SV-KeyCode (KEY_xxx | KEY_SHIFT | KEY_MOD1 | KEY_MOD2)
- USHORT mnCharCode; // SV-CharCode
- USHORT mnRepeat; // Repeat-Count (KeyInputs-1)
+ sal_uLong mnTime; // Time in ms, when event is created
+ sal_uInt16 mnCode; // SV-KeyCode (KEY_xxx | KEY_SHIFT | KEY_MOD1 | KEY_MOD2)
+ sal_uInt16 mnCharCode; // SV-CharCode
+ sal_uInt16 mnRepeat; // Repeat-Count (KeyInputs-1)
};
// MENUEVENT
struct SalMenuEvent
{
- USHORT mnId; // Menu item ID
+ sal_uInt16 mnId; // Menu item ID
void* mpMenu; // pointer to VCL menu (class Menu)
SalMenuEvent() : mnId( 0 ), mpMenu( NULL ) {}
- SalMenuEvent( USHORT i_nId, void* i_pMenu )
+ SalMenuEvent( sal_uInt16 i_nId, void* i_pMenu )
: mnId( i_nId ), mpMenu( i_pMenu ) {}
};
// KEYMODCHANGE
struct SalKeyModEvent
{
- ULONG mnTime; // Time in ms, when event is created
- USHORT mnCode; // SV-ModifierCode (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)
- USHORT mnModKeyCode; // extended Modifier (MODKEY_LEFT, MODKEY_RIGHT, MODKEY_PRESS, MODKEY_RELEASE)
+ sal_uLong mnTime; // Time in ms, when event is created
+ sal_uInt16 mnCode; // SV-ModifierCode (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)
+ sal_uInt16 mnModKeyCode; // extended Modifier (MODKEY_LEFT, MODKEY_RIGHT, MODKEY_PRESS, MODKEY_RELEASE)
};
// PAINT
@@ -170,21 +170,21 @@ struct SalPaintEvent
// pEvent == pData
// WHEELMOUSE
-#define SAL_WHEELMOUSE_EVENT_PAGESCROLL ((ULONG)0xFFFFFFFF)
+#define SAL_WHEELMOUSE_EVENT_PAGESCROLL ((sal_uLong)0xFFFFFFFF)
struct SalWheelMouseEvent
{
- ULONG mnTime; // Time in ms, when event is created
+ sal_uLong mnTime; // Time in ms, when event is created
long mnX; // X-Position (Pixel, TopLeft-Output)
long mnY; // Y-Position (Pixel, TopLeft-Output)
long mnDelta; // Anzahl Drehungen
long mnNotchDelta; // Anzahl feste Drehungen
- ULONG mnScrollLines; // Aktuelle Anzahl zu scrollende Zeilen
- USHORT mnCode; // SV-ModifierCode (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT)
- BOOL mbHorz; // Horizontal
- BOOL mbDeltaIsPixel; // delta value is a pixel value (on mac)
+ sal_uLong mnScrollLines; // Aktuelle Anzahl zu scrollende Zeilen
+ sal_uInt16 mnCode; // SV-ModifierCode (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT)
+ sal_Bool mbHorz; // Horizontal
+ sal_Bool mbDeltaIsPixel; // delta value is a pixel value (on mac)
SalWheelMouseEvent()
- : mnTime( 0 ), mnX( 0 ), mnY( 0 ), mnDelta( 0 ), mnNotchDelta( 0 ), mnScrollLines( 0 ), mnCode( 0 ), mbHorz( FALSE ), mbDeltaIsPixel( FALSE )
+ : mnTime( 0 ), mnX( 0 ), mnY( 0 ), mnDelta( 0 ), mnNotchDelta( 0 ), mnScrollLines( 0 ), mnCode( 0 ), mbHorz( sal_False ), mbDeltaIsPixel( sal_False )
{}
};
@@ -200,13 +200,13 @@ struct SalMouseActivateEvent
// EXTTEXTINPUT
struct SalExtTextInputEvent
{
- ULONG mnTime; // Time in ms, when event is created
+ sal_uLong mnTime; // Time in ms, when event is created
UniString maText; // Text
- const USHORT* mpTextAttr; // Text-Attribute
- ULONG mnCursorPos; // Cursor-Position
- ULONG mnDeltaStart; // Start-Position der letzten Aenderung
- BYTE mnCursorFlags; // SAL_EXTTEXTINPUT_CURSOR_xxx
- BOOL mbOnlyCursor; // TRUE: Nur Cursor-Position wurde geaendert
+ const sal_uInt16* mpTextAttr; // Text-Attribute
+ sal_uLong mnCursorPos; // Cursor-Position
+ sal_uLong mnDeltaStart; // Start-Position der letzten Aenderung
+ sal_uInt8 mnCursorFlags; // SAL_EXTTEXTINPUT_CURSOR_xxx
+ sal_Bool mbOnlyCursor; // sal_True: Nur Cursor-Position wurde geaendert
};
#endif // __cplusplus
@@ -238,8 +238,8 @@ struct SalInputContextChangeEvent
struct SalSurroundingTextRequestEvent
{
UniString maText; // Text
- ULONG mnStart; // The beggining index of selected range
- ULONG mnEnd; // The end index of selected range
+ sal_uLong mnStart; // The beggining index of selected range
+ sal_uLong mnEnd; // The end index of selected range
};
#endif // __cplusplus
@@ -249,8 +249,8 @@ struct SalSurroundingTextRequestEvent
// SURROUNDINGTEXTSELECTIONCHANGE
struct SalSurroundingTextSelectionChangeEvent
{
- ULONG mnStart; // The beggining index of selected range
- ULONG mnEnd; // The end index of selected range
+ sal_uLong mnStart; // The beggining index of selected range
+ sal_uLong mnEnd; // The end index of selected range
};
#endif // __cplusplus
@@ -260,50 +260,50 @@ struct SalSurroundingTextSelectionChangeEvent
// ------------------
typedef long (*SALFRAMEPROC)( Window* pInst, SalFrame* pFrame,
- USHORT nEvent, const void* pEvent );
+ sal_uInt16 nEvent, const void* pEvent );
// --------------------
// - SalObject-Events -
// --------------------
-#define SALOBJ_EVENT_GETFOCUS ((USHORT)1)
-#define SALOBJ_EVENT_LOSEFOCUS ((USHORT)2)
-#define SALOBJ_EVENT_TOTOP ((USHORT)3)
-#define SALOBJ_EVENT_COUNT ((USHORT)4)
+#define SALOBJ_EVENT_GETFOCUS ((sal_uInt16)1)
+#define SALOBJ_EVENT_LOSEFOCUS ((sal_uInt16)2)
+#define SALOBJ_EVENT_TOTOP ((sal_uInt16)3)
+#define SALOBJ_EVENT_COUNT ((sal_uInt16)4)
// ------------------
// - SalObject-Types -
// ------------------
typedef long (*SALOBJECTPROC)( void* pInst, SalObject* pObject,
- USHORT nEvent, const void* pEvent );
+ sal_uInt16 nEvent, const void* pEvent );
// -----------------
// - SalFrameState -
// -----------------
// Must be the same as in syswin.hxx
-#define SAL_FRAMESTATE_MASK_X ((ULONG)0x00000001)
-#define SAL_FRAMESTATE_MASK_Y ((ULONG)0x00000002)
-#define SAL_FRAMESTATE_MASK_WIDTH ((ULONG)0x00000004)
-#define SAL_FRAMESTATE_MASK_HEIGHT ((ULONG)0x00000008)
-#define SAL_FRAMESTATE_MASK_MAXIMIZED_X ((ULONG)0x00000100)
-#define SAL_FRAMESTATE_MASK_MAXIMIZED_Y ((ULONG)0x00000200)
-#define SAL_FRAMESTATE_MASK_MAXIMIZED_WIDTH ((ULONG)0x00000400)
-#define SAL_FRAMESTATE_MASK_MAXIMIZED_HEIGHT ((ULONG)0x00000800)
-#define SAL_FRAMESTATE_MASK_STATE ((ULONG)0x00000010)
-
-#define SAL_FRAMESTATE_NORMAL ((ULONG)0x00000001)
-#define SAL_FRAMESTATE_MINIMIZED ((ULONG)0x00000002)
-#define SAL_FRAMESTATE_MAXIMIZED ((ULONG)0x00000004)
-#define SAL_FRAMESTATE_ROLLUP ((ULONG)0x00000008)
-#define SAL_FRAMESTATE_MAXIMIZED_HORZ ((ULONG)0x00000010)
-#define SAL_FRAMESTATE_MAXIMIZED_VERT ((ULONG)0x00000020)
-#define SAL_FRAMESTATE_SYSTEMMASK ((ULONG)0x0000FFFF)
+#define SAL_FRAMESTATE_MASK_X ((sal_uLong)0x00000001)
+#define SAL_FRAMESTATE_MASK_Y ((sal_uLong)0x00000002)
+#define SAL_FRAMESTATE_MASK_WIDTH ((sal_uLong)0x00000004)
+#define SAL_FRAMESTATE_MASK_HEIGHT ((sal_uLong)0x00000008)
+#define SAL_FRAMESTATE_MASK_MAXIMIZED_X ((sal_uLong)0x00000100)
+#define SAL_FRAMESTATE_MASK_MAXIMIZED_Y ((sal_uLong)0x00000200)
+#define SAL_FRAMESTATE_MASK_MAXIMIZED_WIDTH ((sal_uLong)0x00000400)
+#define SAL_FRAMESTATE_MASK_MAXIMIZED_HEIGHT ((sal_uLong)0x00000800)
+#define SAL_FRAMESTATE_MASK_STATE ((sal_uLong)0x00000010)
+
+#define SAL_FRAMESTATE_NORMAL ((sal_uLong)0x00000001)
+#define SAL_FRAMESTATE_MINIMIZED ((sal_uLong)0x00000002)
+#define SAL_FRAMESTATE_MAXIMIZED ((sal_uLong)0x00000004)
+#define SAL_FRAMESTATE_ROLLUP ((sal_uLong)0x00000008)
+#define SAL_FRAMESTATE_MAXIMIZED_HORZ ((sal_uLong)0x00000010)
+#define SAL_FRAMESTATE_MAXIMIZED_VERT ((sal_uLong)0x00000020)
+#define SAL_FRAMESTATE_SYSTEMMASK ((sal_uLong)0x0000FFFF)
struct SalFrameState
{
- ULONG mnMask;
+ sal_uLong mnMask;
long mnX;
long mnY;
long mnWidth;
@@ -312,7 +312,7 @@ struct SalFrameState
long mnMaximizedY;
long mnMaximizedWidth;
long mnMaximizedHeight;
- ULONG mnState;
+ sal_uLong mnState;
};
// -------------------
@@ -321,11 +321,11 @@ struct SalFrameState
// Muessen mit den Defines in inputctx.hxx uebereinstimmen, da diese
// nicht konvertiert werden
-#define SAL_INPUTCONTEXT_TEXT ((ULONG)0x00000001)
-#define SAL_INPUTCONTEXT_EXTTEXTINPUT ((ULONG)0x00000002)
-#define SAL_INPUTCONTEXT_EXTTEXTINPUT_ON ((ULONG)0x00000004)
-#define SAL_INPUTCONTEXT_EXTTEXTINPUT_OFF ((ULONG)0x00000008)
-#define SAL_INPUTCONTEXT_CHANGELANGUAGE ((ULONG)0x00000010)
+#define SAL_INPUTCONTEXT_TEXT ((sal_uLong)0x00000001)
+#define SAL_INPUTCONTEXT_EXTTEXTINPUT ((sal_uLong)0x00000002)
+#define SAL_INPUTCONTEXT_EXTTEXTINPUT_ON ((sal_uLong)0x00000004)
+#define SAL_INPUTCONTEXT_EXTTEXTINPUT_OFF ((sal_uLong)0x00000008)
+#define SAL_INPUTCONTEXT_CHANGELANGUAGE ((sal_uLong)0x00000010)
#ifdef __cplusplus
@@ -333,7 +333,7 @@ struct SalInputContext
{
ImplFontSelectData* mpFont;
LanguageType meLanguage;
- ULONG mnOptions;
+ sal_uLong mnOptions;
};
#endif // __cplusplus
diff --git a/vcl/inc/vcl/scrbar.hxx b/vcl/inc/vcl/scrbar.hxx
index fd675461cac5..6e894bc2263b 100644
--- a/vcl/inc/vcl/scrbar.hxx
+++ b/vcl/inc/vcl/scrbar.hxx
@@ -68,12 +68,12 @@ private:
long mnLineSize;
long mnPageSize;
long mnDelta;
- USHORT mnDragDraw;
- USHORT mnStateFlags;
+ sal_uInt16 mnDragDraw;
+ sal_uInt16 mnStateFlags;
ScrollType meScrollType;
ScrollType meDDScrollType;
- BOOL mbCalcSize;
- BOOL mbFullDrag;
+ sal_Bool mbCalcSize;
+ sal_Bool mbFullDrag;
Link maScrollHdl;
Link maEndScrollHdl;
@@ -82,17 +82,17 @@ private:
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE void ImplInitStyle( WinBits nStyle );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- SAL_DLLPRIVATE void ImplUpdateRects( BOOL bUpdate = TRUE );
+ SAL_DLLPRIVATE void ImplUpdateRects( sal_Bool bUpdate = sal_True );
SAL_DLLPRIVATE long ImplCalcThumbPos( long nPixPos );
SAL_DLLPRIVATE long ImplCalcThumbPosPix( long nPos );
- SAL_DLLPRIVATE void ImplCalc( BOOL bUpdate = TRUE );
- SAL_DLLPRIVATE void ImplDraw( USHORT nDrawFlags, OutputDevice* pOutDev );
+ SAL_DLLPRIVATE void ImplCalc( sal_Bool bUpdate = sal_True );
+ SAL_DLLPRIVATE void ImplDraw( sal_uInt16 nDrawFlags, OutputDevice* pOutDev );
using Window::ImplScroll;
- SAL_DLLPRIVATE long ImplScroll( long nNewPos, BOOL bCallEndScroll );
- SAL_DLLPRIVATE long ImplDoAction( BOOL bCallEndScroll );
- SAL_DLLPRIVATE void ImplDoMouseAction( const Point& rPos, BOOL bCallAction = TRUE );
+ SAL_DLLPRIVATE long ImplScroll( long nNewPos, sal_Bool bCallEndScroll );
+ SAL_DLLPRIVATE long ImplDoAction( sal_Bool bCallEndScroll );
+ SAL_DLLPRIVATE void ImplDoMouseAction( const Point& rPos, sal_Bool bCallAction = sal_True );
SAL_DLLPRIVATE void ImplInvert();
- SAL_DLLPRIVATE BOOL ImplDrawNative( USHORT nDrawFlags );
+ SAL_DLLPRIVATE sal_Bool ImplDrawNative( sal_uInt16 nDrawFlags );
SAL_DLLPRIVATE void ImplDragThumb( const Point& rMousePos );
DECL_DLLPRIVATE_LINK( ImplTimerHdl, Timer* );
DECL_DLLPRIVATE_LINK( ImplAutoTimerHdl, AutoTimer* );
@@ -106,7 +106,7 @@ public:
virtual void Tracking( const TrackingEvent& rTEvt );
virtual void KeyInput( const KeyEvent& rKEvt );
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
@@ -121,9 +121,9 @@ public:
long DoScroll( long nNewPos );
long DoScrollAction( ScrollType eScrollType );
- void EnableDrag( BOOL bEnable = TRUE )
+ void EnableDrag( sal_Bool bEnable = sal_True )
{ mbFullDrag = bEnable; }
- BOOL IsDragEnabled() const { return mbFullDrag; }
+ sal_Bool IsDragEnabled() const { return mbFullDrag; }
void SetRangeMin( long nNewRange );
long GetRangeMin() const { return mnMinRange; }
diff --git a/vcl/inc/vcl/seleng.hxx b/vcl/inc/vcl/seleng.hxx
index 67c2f735ac71..8466df46a901 100644
--- a/vcl/inc/vcl/seleng.hxx
+++ b/vcl/inc/vcl/seleng.hxx
@@ -57,11 +57,11 @@ public:
virtual void DestroyAnchor() = 0;
// Cursor neu setzen, dabei die beim Anker beginnende
- // Selektion der neuen Cursor-Position anpassen. TRUE == Ok
- virtual BOOL SetCursorAtPoint( const Point& rPointPixel,
- BOOL bDontSelectAtCursor = FALSE ) = 0;
+ // Selektion der neuen Cursor-Position anpassen. sal_True == Ok
+ virtual sal_Bool SetCursorAtPoint( const Point& rPointPixel,
+ sal_Bool bDontSelectAtCursor = sal_False ) = 0;
- virtual BOOL IsSelectionAtPoint( const Point& rPointPixel ) = 0;
+ virtual sal_Bool IsSelectionAtPoint( const Point& rPointPixel ) = 0;
virtual void DeselectAtPoint( const Point& rPointPixel ) = 0;
// Anker loeschen & alles deselektieren
virtual void DeselectAll() = 0;
@@ -90,29 +90,29 @@ private:
Timer aWTimer; // erzeugt kuenstliche Mouse-Moves
MouseEvent aLastMove;
SelectionMode eSelMode;
- ULONG nUpdateInterval;
+ sal_uLong nUpdateInterval;
// Stufigkeit fuer Mausbewegungen waehrend einer Selektion
- USHORT nMouseSensitivity;
- USHORT nLockedMods;
- USHORT nFlags;
+ sal_uInt16 nMouseSensitivity;
+ sal_uInt16 nLockedMods;
+ sal_uInt16 nFlags;
DECL_DLLPRIVATE_LINK( ImpWatchDog, Timer * );
- inline BOOL ShouldDeselect( BOOL bModifierKey1 ) const;
+ inline sal_Bool ShouldDeselect( sal_Bool bModifierKey1 ) const;
// determines to deselect or not when Ctrl-key is pressed on CursorPosChanging
public:
SelectionEngine( Window* pWindow,
FunctionSet* pFunctions = NULL,
- ULONG nAutoRepeatInterval = SELENG_AUTOREPEAT_INTERVAL );
+ sal_uLong nAutoRepeatInterval = SELENG_AUTOREPEAT_INTERVAL );
~SelectionEngine();
- // TRUE: Event wurde von Selection-Engine verarbeitet.
- BOOL SelMouseButtonDown( const MouseEvent& rMEvt );
- BOOL SelMouseButtonUp( const MouseEvent& rMEvt );
- BOOL SelMouseMove( const MouseEvent& rMEvt );
+ // sal_True: Event wurde von Selection-Engine verarbeitet.
+ sal_Bool SelMouseButtonDown( const MouseEvent& rMEvt );
+ sal_Bool SelMouseButtonUp( const MouseEvent& rMEvt );
+ sal_Bool SelMouseMove( const MouseEvent& rMEvt );
// Tastatur
- void CursorPosChanging( BOOL bShift, BOOL bMod1 );
+ void CursorPosChanging( sal_Bool bShift, sal_Bool bMod1 );
// wird benoetigt, um bei ausserhalb des Bereichs stehender
// Maus ueber einen Timer Move-Events zu erzeugen
@@ -120,16 +120,16 @@ public:
{ aArea = rNewArea; }
const Rectangle& GetVisibleArea() const { return aArea; }
- void SetAddMode( BOOL);
- BOOL IsAddMode() const;
+ void SetAddMode( sal_Bool);
+ sal_Bool IsAddMode() const;
- void AddAlways( BOOL bOn );
- BOOL IsAlwaysAdding() const;
+ void AddAlways( sal_Bool bOn );
+ sal_Bool IsAlwaysAdding() const;
- void EnableDrag( BOOL bOn );
- BOOL IsDragEnabled() const;
+ void EnableDrag( sal_Bool bOn );
+ sal_Bool IsDragEnabled() const;
void ActivateDragMode();
- BOOL IsInDragMode() const;
+ sal_Bool IsInDragMode() const;
void SetSelectionMode( SelectionMode eMode );
SelectionMode GetSelectionMode() const { return eSelMode; }
@@ -138,9 +138,9 @@ public:
{ pFunctionSet = pFuncs; }
const FunctionSet* GetFunctionSet() const { return pFunctionSet; }
- void SetMouseSensitivity( USHORT nSensitivity )
+ void SetMouseSensitivity( sal_uInt16 nSensitivity )
{ nMouseSensitivity = nSensitivity; }
- USHORT GetMouseSensitivity() const
+ sal_uInt16 GetMouseSensitivity() const
{ return nMouseSensitivity; }
const Point& GetMousePosPixel() const
@@ -150,22 +150,22 @@ public:
void SetWindow( Window*);
Window* GetWindow() const { return pWin; }
- void LockModifiers( USHORT nModifiers )
+ void LockModifiers( sal_uInt16 nModifiers )
{ nLockedMods = nModifiers; }
- USHORT GetLockedModifiers() const { return nLockedMods; }
+ sal_uInt16 GetLockedModifiers() const { return nLockedMods; }
- BOOL IsInSelection() const;
+ sal_Bool IsInSelection() const;
void Reset();
void Command( const CommandEvent& rCEvt );
- BOOL HasAnchor() const;
- void SetAnchor( BOOL bAnchor );
+ sal_Bool HasAnchor() const;
+ void SetAnchor( sal_Bool bAnchor );
- void SetUpdateInterval( ULONG nInterval );
+ void SetUpdateInterval( sal_uLong nInterval );
// wird im Ctor eingeschaltet
- void ExpandSelectionOnMouseMove( BOOL bExpand = TRUE )
+ void ExpandSelectionOnMouseMove( sal_Bool bExpand = sal_True )
{
if( bExpand )
nFlags |= SELENG_EXPANDONMOVE;
@@ -174,23 +174,23 @@ public:
}
};
-inline BOOL SelectionEngine::IsDragEnabled() const
+inline sal_Bool SelectionEngine::IsDragEnabled() const
{
if ( nFlags & SELENG_DRG_ENAB )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
-inline BOOL SelectionEngine::IsAddMode() const
+inline sal_Bool SelectionEngine::IsAddMode() const
{
if ( nFlags & (SELENG_IN_ADD | SELENG_ADD_ALW) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
-inline void SelectionEngine::SetAddMode( BOOL bNewMode )
+inline void SelectionEngine::SetAddMode( sal_Bool bNewMode )
{
if ( bNewMode )
nFlags |= SELENG_IN_ADD;
@@ -198,7 +198,7 @@ inline void SelectionEngine::SetAddMode( BOOL bNewMode )
nFlags &= (~SELENG_IN_ADD);
}
-inline void SelectionEngine::EnableDrag( BOOL bOn )
+inline void SelectionEngine::EnableDrag( sal_Bool bOn )
{
if ( bOn )
nFlags |= SELENG_DRG_ENAB;
@@ -206,7 +206,7 @@ inline void SelectionEngine::EnableDrag( BOOL bOn )
nFlags &= (~SELENG_DRG_ENAB);
}
-inline void SelectionEngine::AddAlways( BOOL bOn )
+inline void SelectionEngine::AddAlways( sal_Bool bOn )
{
if( bOn )
nFlags |= SELENG_ADD_ALW;
@@ -214,39 +214,39 @@ inline void SelectionEngine::AddAlways( BOOL bOn )
nFlags &= (~SELENG_ADD_ALW);
}
-inline BOOL SelectionEngine::IsAlwaysAdding() const
+inline sal_Bool SelectionEngine::IsAlwaysAdding() const
{
if ( nFlags & SELENG_ADD_ALW )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
-inline BOOL SelectionEngine::IsInDragMode() const
+inline sal_Bool SelectionEngine::IsInDragMode() const
{
if ( nFlags & SELENG_IN_DRG )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
-inline BOOL SelectionEngine::IsInSelection() const
+inline sal_Bool SelectionEngine::IsInSelection() const
{
if ( nFlags & SELENG_IN_SEL )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
-inline BOOL SelectionEngine::HasAnchor() const
+inline sal_Bool SelectionEngine::HasAnchor() const
{
if ( nFlags & SELENG_HAS_ANCH )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
-inline void SelectionEngine::SetAnchor( BOOL bAnchor )
+inline void SelectionEngine::SetAnchor( sal_Bool bAnchor )
{
if ( bAnchor )
nFlags |= SELENG_HAS_ANCH;
diff --git a/vcl/inc/vcl/settings.hxx b/vcl/inc/vcl/settings.hxx
index dc51764b6554..cc5b44169ff6 100644
--- a/vcl/inc/vcl/settings.hxx
+++ b/vcl/inc/vcl/settings.hxx
@@ -57,10 +57,10 @@ class ImplMachineData
ImplMachineData( const ImplMachineData& rData );
private:
- ULONG mnRefCount;
- ULONG mnOptions;
- ULONG mnScreenOptions;
- ULONG mnPrintOptions;
+ sal_uLong mnRefCount;
+ sal_uLong mnOptions;
+ sal_uLong mnScreenOptions;
+ sal_uLong mnPrintOptions;
long mnScreenRasterFontDeviation;
};
@@ -80,17 +80,17 @@ public:
MachineSettings( const MachineSettings& rSet );
~MachineSettings();
- void SetOptions( ULONG nOptions )
+ void SetOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnOptions = nOptions; }
- ULONG GetOptions() const
+ sal_uLong GetOptions() const
{ return mpData->mnOptions; }
- void SetScreenOptions( ULONG nOptions )
+ void SetScreenOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnScreenOptions = nOptions; }
- ULONG GetScreenOptions() const
+ sal_uLong GetScreenOptions() const
{ return mpData->mnScreenOptions; }
- void SetPrintOptions( ULONG nOptions )
+ void SetPrintOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnPrintOptions = nOptions; }
- ULONG GetPrintOptions() const
+ sal_uLong GetPrintOptions() const
{ return mpData->mnPrintOptions; }
void SetScreenRasterFontDeviation( long nDeviation )
@@ -100,8 +100,8 @@ public:
const MachineSettings& operator =( const MachineSettings& rSet );
- BOOL operator ==( const MachineSettings& rSet ) const;
- BOOL operator !=( const MachineSettings& rSet ) const
+ sal_Bool operator ==( const MachineSettings& rSet ) const;
+ sal_Bool operator !=( const MachineSettings& rSet ) const
{ return !(*this == rSet); }
};
@@ -117,49 +117,49 @@ class ImplMouseData
ImplMouseData( const ImplMouseData& rData );
private:
- ULONG mnRefCount;
- ULONG mnOptions;
- ULONG mnDoubleClkTime;
+ sal_uLong mnRefCount;
+ sal_uLong mnOptions;
+ sal_uLong mnDoubleClkTime;
long mnDoubleClkWidth;
long mnDoubleClkHeight;
long mnStartDragWidth;
long mnStartDragHeight;
- USHORT mnStartDragCode;
- USHORT mnDragMoveCode;
- USHORT mnDragCopyCode;
- USHORT mnDragLinkCode;
- USHORT mnContextMenuCode;
- USHORT mnContextMenuClicks;
- BOOL mbContextMenuDown;
- ULONG mnScrollRepeat;
- ULONG mnButtonStartRepeat;
- ULONG mnButtonRepeat;
- ULONG mnActionDelay;
- ULONG mnMenuDelay;
- ULONG mnFollow;
- USHORT mnMiddleButtonAction;
- USHORT mnWheelBehavior;
- BOOL mbAlign1;
+ sal_uInt16 mnStartDragCode;
+ sal_uInt16 mnDragMoveCode;
+ sal_uInt16 mnDragCopyCode;
+ sal_uInt16 mnDragLinkCode;
+ sal_uInt16 mnContextMenuCode;
+ sal_uInt16 mnContextMenuClicks;
+ sal_Bool mbContextMenuDown;
+ sal_uLong mnScrollRepeat;
+ sal_uLong mnButtonStartRepeat;
+ sal_uLong mnButtonRepeat;
+ sal_uLong mnActionDelay;
+ sal_uLong mnMenuDelay;
+ sal_uLong mnFollow;
+ sal_uInt16 mnMiddleButtonAction;
+ sal_uInt16 mnWheelBehavior;
+ sal_Bool mbAlign1;
};
// -----------------
// - MouseSettings -
// -----------------
-#define MOUSE_OPTION_AUTOFOCUS ((ULONG)0x00000001)
-#define MOUSE_OPTION_AUTOCENTERPOS ((ULONG)0x00000002)
-#define MOUSE_OPTION_AUTODEFBTNPOS ((ULONG)0x00000004)
+#define MOUSE_OPTION_AUTOFOCUS ((sal_uLong)0x00000001)
+#define MOUSE_OPTION_AUTOCENTERPOS ((sal_uLong)0x00000002)
+#define MOUSE_OPTION_AUTODEFBTNPOS ((sal_uLong)0x00000004)
-#define MOUSE_FOLLOW_MENU ((ULONG)0x00000001)
-#define MOUSE_FOLLOW_DDLIST ((ULONG)0x00000002)
+#define MOUSE_FOLLOW_MENU ((sal_uLong)0x00000001)
+#define MOUSE_FOLLOW_DDLIST ((sal_uLong)0x00000002)
-#define MOUSE_MIDDLE_NOTHING ((USHORT)0)
-#define MOUSE_MIDDLE_AUTOSCROLL ((USHORT)1)
-#define MOUSE_MIDDLE_PASTESELECTION ((USHORT)2)
+#define MOUSE_MIDDLE_NOTHING ((sal_uInt16)0)
+#define MOUSE_MIDDLE_AUTOSCROLL ((sal_uInt16)1)
+#define MOUSE_MIDDLE_PASTESELECTION ((sal_uInt16)2)
-#define MOUSE_WHEEL_DISABLE ((USHORT)0)
-#define MOUSE_WHEEL_FOCUS_ONLY ((USHORT)1)
-#define MOUSE_WHEEL_ALWAYS ((USHORT)2)
+#define MOUSE_WHEEL_DISABLE ((sal_uInt16)0)
+#define MOUSE_WHEEL_FOCUS_ONLY ((sal_uInt16)1)
+#define MOUSE_WHEEL_ALWAYS ((sal_uInt16)2)
class VCL_DLLPUBLIC MouseSettings
{
@@ -173,14 +173,14 @@ public:
MouseSettings( const MouseSettings& rSet );
~MouseSettings();
- void SetOptions( ULONG nOptions )
+ void SetOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnOptions = nOptions; }
- ULONG GetOptions() const
+ sal_uLong GetOptions() const
{ return mpData->mnOptions; }
- void SetDoubleClickTime( ULONG nDoubleClkTime )
+ void SetDoubleClickTime( sal_uLong nDoubleClkTime )
{ CopyData(); mpData->mnDoubleClkTime = nDoubleClkTime; }
- ULONG GetDoubleClickTime() const
+ sal_uLong GetDoubleClickTime() const
{ return mpData->mnDoubleClkTime; }
void SetDoubleClickWidth( long nDoubleClkWidth )
{ CopyData(); mpData->mnDoubleClkWidth = nDoubleClkWidth; }
@@ -199,76 +199,76 @@ public:
{ CopyData(); mpData->mnStartDragHeight = nDragHeight; }
long GetStartDragHeight() const
{ return mpData->mnStartDragHeight; }
- void SetStartDragCode( USHORT nCode )
+ void SetStartDragCode( sal_uInt16 nCode )
{ CopyData(); mpData->mnStartDragCode = nCode; }
- USHORT GetStartDragCode() const
+ sal_uInt16 GetStartDragCode() const
{ return mpData->mnStartDragCode; }
- void SetDragMoveCode( USHORT nCode )
+ void SetDragMoveCode( sal_uInt16 nCode )
{ CopyData(); mpData->mnDragMoveCode = nCode; }
- USHORT GetDragMoveCode() const
+ sal_uInt16 GetDragMoveCode() const
{ return mpData->mnDragMoveCode; }
- void SetDragCopyCode( USHORT nCode )
+ void SetDragCopyCode( sal_uInt16 nCode )
{ CopyData(); mpData->mnDragCopyCode = nCode; }
- USHORT GetDragCopyCode() const
+ sal_uInt16 GetDragCopyCode() const
{ return mpData->mnDragCopyCode; }
- void SetDragLinkCode( USHORT nCode )
+ void SetDragLinkCode( sal_uInt16 nCode )
{ CopyData(); mpData->mnDragLinkCode = nCode; }
- USHORT GetDragLinkCode() const
+ sal_uInt16 GetDragLinkCode() const
{ return mpData->mnDragLinkCode; }
- void SetContextMenuCode( USHORT nCode )
+ void SetContextMenuCode( sal_uInt16 nCode )
{ CopyData(); mpData->mnContextMenuCode = nCode; }
- USHORT GetContextMenuCode() const
+ sal_uInt16 GetContextMenuCode() const
{ return mpData->mnContextMenuCode; }
- void SetContextMenuClicks( USHORT nClicks )
+ void SetContextMenuClicks( sal_uInt16 nClicks )
{ CopyData(); mpData->mnContextMenuClicks = nClicks; }
- USHORT GetContextMenuClicks() const
+ sal_uInt16 GetContextMenuClicks() const
{ return mpData->mnContextMenuClicks; }
- void SetContextMenuDown( BOOL bDown )
+ void SetContextMenuDown( sal_Bool bDown )
{ CopyData(); mpData->mbContextMenuDown = bDown; }
- BOOL GetContextMenuDown() const
+ sal_Bool GetContextMenuDown() const
{ return mpData->mbContextMenuDown; }
- void SetScrollRepeat( ULONG nRepeat )
+ void SetScrollRepeat( sal_uLong nRepeat )
{ CopyData(); mpData->mnScrollRepeat = nRepeat; }
- ULONG GetScrollRepeat() const
+ sal_uLong GetScrollRepeat() const
{ return mpData->mnScrollRepeat; }
- void SetButtonStartRepeat( ULONG nRepeat )
+ void SetButtonStartRepeat( sal_uLong nRepeat )
{ CopyData(); mpData->mnButtonStartRepeat = nRepeat; }
- ULONG GetButtonStartRepeat() const
+ sal_uLong GetButtonStartRepeat() const
{ return mpData->mnButtonStartRepeat; }
- void SetButtonRepeat( ULONG nRepeat )
+ void SetButtonRepeat( sal_uLong nRepeat )
{ CopyData(); mpData->mnButtonRepeat = nRepeat; }
- ULONG GetButtonRepeat() const
+ sal_uLong GetButtonRepeat() const
{ return mpData->mnButtonRepeat; }
- void SetActionDelay( ULONG nDelay )
+ void SetActionDelay( sal_uLong nDelay )
{ CopyData(); mpData->mnActionDelay = nDelay; }
- ULONG GetActionDelay() const
+ sal_uLong GetActionDelay() const
{ return mpData->mnActionDelay; }
- void SetMenuDelay( ULONG nDelay )
+ void SetMenuDelay( sal_uLong nDelay )
{ CopyData(); mpData->mnMenuDelay = nDelay; }
- ULONG GetMenuDelay() const
+ sal_uLong GetMenuDelay() const
{ return mpData->mnMenuDelay; }
- void SetFollow( ULONG nFollow )
+ void SetFollow( sal_uLong nFollow )
{ CopyData(); mpData->mnFollow = nFollow; }
- ULONG GetFollow() const
+ sal_uLong GetFollow() const
{ return mpData->mnFollow; }
- void SetMiddleButtonAction( USHORT nAction )
+ void SetMiddleButtonAction( sal_uInt16 nAction )
{ CopyData(); mpData->mnMiddleButtonAction = nAction; }
- USHORT GetMiddleButtonAction() const
+ sal_uInt16 GetMiddleButtonAction() const
{ return mpData->mnMiddleButtonAction; }
- void SetWheelBehavior( USHORT nBehavior )
+ void SetWheelBehavior( sal_uInt16 nBehavior )
{ CopyData(); mpData->mnWheelBehavior = nBehavior; }
- USHORT GetWheelBehavior() const
+ sal_uInt16 GetWheelBehavior() const
{ return mpData->mnWheelBehavior; }
const MouseSettings& operator =( const MouseSettings& rSet );
- BOOL operator ==( const MouseSettings& rSet ) const;
- BOOL operator !=( const MouseSettings& rSet ) const
+ sal_Bool operator ==( const MouseSettings& rSet ) const;
+ sal_Bool operator !=( const MouseSettings& rSet ) const
{ return !(*this == rSet); }
};
@@ -284,16 +284,16 @@ class ImplKeyboardData
ImplKeyboardData( const ImplKeyboardData& rData );
private:
- ULONG mnRefCount;
+ sal_uLong mnRefCount;
Accelerator maStandardAccel;
- ULONG mnOptions;
+ sal_uLong mnOptions;
};
// --------------------
// - KeyboardSettings -
// --------------------
-#define KEYBOARD_OPTION_QUICKCURSOR ((ULONG)0x00000001)
+#define KEYBOARD_OPTION_QUICKCURSOR ((sal_uLong)0x00000001)
class VCL_DLLPUBLIC KeyboardSettings
{
@@ -312,15 +312,15 @@ public:
const Accelerator& GetStandardAccel() const
{ return mpData->maStandardAccel; }
- void SetOptions( ULONG nOptions )
+ void SetOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnOptions = nOptions; }
- ULONG GetOptions() const
+ sal_uLong GetOptions() const
{ return mpData->mnOptions; }
const KeyboardSettings& operator =( const KeyboardSettings& rSet );
- BOOL operator ==( const KeyboardSettings& rSet ) const;
- BOOL operator !=( const KeyboardSettings& rSet ) const
+ sal_Bool operator ==( const KeyboardSettings& rSet ) const;
+ sal_Bool operator !=( const KeyboardSettings& rSet ) const
{ return !(*this == rSet); }
};
@@ -337,7 +337,7 @@ class ImplStyleData
void SetStandardStyles();
private:
- ULONG mnRefCount;
+ sal_uLong mnRefCount;
void* mpStyleData_NotUsedYet;
@@ -413,31 +413,27 @@ private:
long mnIconHorzSpace;
long mnIconVertSpace;
long mnAntialiasedMin;
- ULONG mnCursorBlinkTime;
- ULONG mnDragFullOptions;
- ULONG mnAnimationOptions;
- ULONG mnSelectionOptions;
- ULONG mnLogoDisplayTime;
- ULONG mnDisplayOptions;
- ULONG mnToolbarIconSize;
- ULONG mnUseFlatMenues;
- ULONG mnOptions;
- USHORT mnScreenZoom;
- USHORT mnScreenFontZoom;
- USHORT mnRadioButtonStyle;
- USHORT mnCheckBoxStyle;
- USHORT mnPushButtonStyle;
- USHORT mnTabControlStyle;
- USHORT mnHighContrast;
- USHORT mnUseSystemUIFonts;
- USHORT mnAutoMnemonic;
- USHORT mnUseImagesInMenus;
- BOOL mbPreferredUseImagesInMenus;
- ULONG mnUseFlatBorders;
+ sal_uLong mnCursorBlinkTime;
+ sal_uLong mnDragFullOptions;
+ sal_uLong mnAnimationOptions;
+ sal_uLong mnSelectionOptions;
+ sal_uLong mnLogoDisplayTime;
+ sal_uLong mnDisplayOptions;
+ sal_uLong mnToolbarIconSize;
+ sal_uLong mnUseFlatMenues;
+ sal_uLong mnOptions;
+ sal_uInt16 mnScreenZoom;
+ sal_uInt16 mnScreenFontZoom;
+ sal_uInt16 mnHighContrast;
+ sal_uInt16 mnUseSystemUIFonts;
+ sal_uInt16 mnAutoMnemonic;
+ sal_uInt16 mnUseImagesInMenus;
+ sal_uLong mnUseFlatBorders;
+ sal_Bool mbPreferredUseImagesInMenus;
long mnMinThumbSize;
- ULONG mnSymbolsStyle;
- ULONG mnPreferredSymbolsStyle;
- USHORT mnSkipDisabledInMenus;
+ sal_uLong mnSymbolsStyle;
+ sal_uLong mnPreferredSymbolsStyle;
+ sal_uInt16 mnSkipDisabledInMenus;
Wallpaper maWorkspaceGradient;
const void* mpFontOptions;
};
@@ -449,90 +445,65 @@ private:
// - StyleSettings -
// -----------------
-#define STYLE_OPTION_MONO ((ULONG)0x00000001)
-#define STYLE_OPTION_COLOR ((ULONG)0x00000002)
-#define STYLE_OPTION_FLAT ((ULONG)0x00000004)
-#define STYLE_OPTION_GREAT ((ULONG)0x00000008)
-#define STYLE_OPTION_HIGHLIGHT ((ULONG)0x00000010)
-#define STYLE_OPTION_ADVANCEDUSER ((ULONG)0x00000020)
-#define STYLE_OPTION_SCROLLARROW ((ULONG)0x00000040)
-#define STYLE_OPTION_SPINARROW ((ULONG)0x00000080)
-#define STYLE_OPTION_SPINUPDOWN ((ULONG)0x00000100)
-#define STYLE_OPTION_NOMNEMONICS ((ULONG)0x00000200)
-#define STYLE_OPTION_WINSTYLE ((ULONG)0x00010000)
-#define STYLE_OPTION_OS2STYLE ((ULONG)0x00020000)
-#define STYLE_OPTION_MACSTYLE ((ULONG)0x00040000)
-#define STYLE_OPTION_UNIXSTYLE ((ULONG)0x00080000)
-#define STYLE_OPTION_SYSTEMSTYLE ((ULONG)0x000F0000)
-#define STYLE_OPTION_HIDEDISABLED ((ULONG)0x00100000)
-
-#define DRAGFULL_OPTION_WINDOWMOVE ((ULONG)0x00000001)
-#define DRAGFULL_OPTION_WINDOWSIZE ((ULONG)0x00000002)
-#define DRAGFULL_OPTION_OBJECTMOVE ((ULONG)0x00000004)
-#define DRAGFULL_OPTION_OBJECTSIZE ((ULONG)0x00000008)
-#define DRAGFULL_OPTION_DOCKING ((ULONG)0x00000010)
-#define DRAGFULL_OPTION_SPLIT ((ULONG)0x00000020)
-#define DRAGFULL_OPTION_SCROLL ((ULONG)0x00000040)
-
-#define LOGO_DISPLAYTIME_NOLOGO ((ULONG)0)
-#define LOGO_DISPLAYTIME_STARTTIME ((ULONG)0xFFFFFFFF)
-
-#define ANIMATION_OPTION_MINIMIZE ((ULONG)0x00000001)
-#define ANIMATION_OPTION_POPUP ((ULONG)0x00000002)
-#define ANIMATION_OPTION_DIALOG ((ULONG)0x00000004)
-#define ANIMATION_OPTION_TREE ((ULONG)0x00000008)
-#define ANIMATION_OPTION_SCROLL ((ULONG)0x00000010)
-
-#define SELECTION_OPTION_WORD ((ULONG)0x00000001)
-#define SELECTION_OPTION_FOCUS ((ULONG)0x00000002)
-#define SELECTION_OPTION_INVERT ((ULONG)0x00000004)
-#define SELECTION_OPTION_SHOWFIRST ((ULONG)0x00000008)
-
-#define DISPLAY_OPTION_AA_DISABLE ((ULONG)0x00000001)
-
-#define STYLE_RADIOBUTTON_WIN ((USHORT)0x0001)
-#define STYLE_RADIOBUTTON_OS2 ((USHORT)0x0002)
-#define STYLE_RADIOBUTTON_MAC ((USHORT)0x0003)
-#define STYLE_RADIOBUTTON_UNIX ((USHORT)0x0004)
-#define STYLE_RADIOBUTTON_MONO ((USHORT)0x0005)
-#define STYLE_RADIOBUTTON_STYLE ((USHORT)0x000F)
-
-#define STYLE_CHECKBOX_WIN ((USHORT)0x0001)
-#define STYLE_CHECKBOX_OS2 ((USHORT)0x0002)
-#define STYLE_CHECKBOX_MAC ((USHORT)0x0003)
-#define STYLE_CHECKBOX_UNIX ((USHORT)0x0004)
-#define STYLE_CHECKBOX_MONO ((USHORT)0x0005)
-#define STYLE_CHECKBOX_STYLE ((USHORT)0x000F)
-
-#define STYLE_PUSHBUTTON_WIN ((USHORT)0x0001)
-#define STYLE_PUSHBUTTON_OS2 ((USHORT)0x0002)
-#define STYLE_PUSHBUTTON_MAC ((USHORT)0x0003)
-#define STYLE_PUSHBUTTON_UNIX ((USHORT)0x0004)
-#define STYLE_PUSHBUTTON_STYLE ((USHORT)0x000F)
-
-#define STYLE_TABCONTROL_SINGLELINE ((USHORT)0x0001)
-#define STYLE_TABCONTROL_COLOR ((USHORT)0x0002)
-
-#define STYLE_TOOLBAR_ICONSIZE_UNKNOWN ((ULONG)0)
-#define STYLE_TOOLBAR_ICONSIZE_SMALL ((ULONG)1)
-#define STYLE_TOOLBAR_ICONSIZE_LARGE ((ULONG)2)
-
-#define STYLE_SYMBOLS_AUTO ((ULONG)0)
-#define STYLE_SYMBOLS_DEFAULT ((ULONG)1)
-#define STYLE_SYMBOLS_HICONTRAST ((ULONG)2)
-#define STYLE_SYMBOLS_INDUSTRIAL ((ULONG)3)
-#define STYLE_SYMBOLS_CRYSTAL ((ULONG)4)
-#define STYLE_SYMBOLS_TANGO ((ULONG)5)
-#define STYLE_SYMBOLS_OXYGEN ((ULONG)6)
-#define STYLE_SYMBOLS_CLASSIC ((ULONG)7)
-#define STYLE_SYMBOLS_HUMAN ((ULONG)8)
-#define STYLE_SYMBOLS_THEMES_MAX ((ULONG)9)
-
-#define STYLE_MENUIMAGES_OFF ((USHORT)0)
-#define STYLE_MENUIMAGES_ON ((USHORT)1)
-#define STYLE_MENUIMAGES_AUTO ((USHORT)2)
-
-#define STYLE_CURSOR_NOBLINKTIME ((ULONG)0xFFFFFFFF)
+#define STYLE_OPTION_MONO ((sal_uLong)0x00000001)
+#define STYLE_OPTION_COLOR ((sal_uLong)0x00000002)
+#define STYLE_OPTION_FLAT ((sal_uLong)0x00000004)
+#define STYLE_OPTION_GREAT ((sal_uLong)0x00000008)
+#define STYLE_OPTION_HIGHLIGHT ((sal_uLong)0x00000010)
+#define STYLE_OPTION_ADVANCEDUSER ((sal_uLong)0x00000020)
+#define STYLE_OPTION_SCROLLARROW ((sal_uLong)0x00000040)
+#define STYLE_OPTION_SPINARROW ((sal_uLong)0x00000080)
+#define STYLE_OPTION_SPINUPDOWN ((sal_uLong)0x00000100)
+#define STYLE_OPTION_NOMNEMONICS ((sal_uLong)0x00000200)
+#define STYLE_OPTION_HIDEDISABLED ((sal_uLong)0x00100000)
+
+#define DRAGFULL_OPTION_WINDOWMOVE ((sal_uLong)0x00000001)
+#define DRAGFULL_OPTION_WINDOWSIZE ((sal_uLong)0x00000002)
+#define DRAGFULL_OPTION_OBJECTMOVE ((sal_uLong)0x00000004)
+#define DRAGFULL_OPTION_OBJECTSIZE ((sal_uLong)0x00000008)
+#define DRAGFULL_OPTION_DOCKING ((sal_uLong)0x00000010)
+#define DRAGFULL_OPTION_SPLIT ((sal_uLong)0x00000020)
+#define DRAGFULL_OPTION_SCROLL ((sal_uLong)0x00000040)
+
+#define LOGO_DISPLAYTIME_NOLOGO ((sal_uLong)0)
+#define LOGO_DISPLAYTIME_STARTTIME ((sal_uLong)0xFFFFFFFF)
+
+#define ANIMATION_OPTION_MINIMIZE ((sal_uLong)0x00000001)
+#define ANIMATION_OPTION_POPUP ((sal_uLong)0x00000002)
+#define ANIMATION_OPTION_DIALOG ((sal_uLong)0x00000004)
+#define ANIMATION_OPTION_TREE ((sal_uLong)0x00000008)
+#define ANIMATION_OPTION_SCROLL ((sal_uLong)0x00000010)
+
+#define SELECTION_OPTION_WORD ((sal_uLong)0x00000001)
+#define SELECTION_OPTION_FOCUS ((sal_uLong)0x00000002)
+#define SELECTION_OPTION_INVERT ((sal_uLong)0x00000004)
+#define SELECTION_OPTION_SHOWFIRST ((sal_uLong)0x00000008)
+
+#define DISPLAY_OPTION_AA_DISABLE ((sal_uLong)0x00000001)
+
+#define STYLE_RADIOBUTTON_MONO ((sal_uInt16)0x0001) // legacy
+#define STYLE_CHECKBOX_MONO ((sal_uInt16)0x0001) // legacy
+
+#define STYLE_TOOLBAR_ICONSIZE_UNKNOWN ((sal_uLong)0)
+#define STYLE_TOOLBAR_ICONSIZE_SMALL ((sal_uLong)1)
+#define STYLE_TOOLBAR_ICONSIZE_LARGE ((sal_uLong)2)
+
+#define STYLE_SYMBOLS_AUTO ((sal_uLong)0)
+#define STYLE_SYMBOLS_DEFAULT ((sal_uLong)1)
+#define STYLE_SYMBOLS_HICONTRAST ((sal_uLong)2)
+#define STYLE_SYMBOLS_INDUSTRIAL ((sal_uLong)3)
+#define STYLE_SYMBOLS_CRYSTAL ((sal_uLong)4)
+#define STYLE_SYMBOLS_TANGO ((sal_uLong)5)
+#define STYLE_SYMBOLS_OXYGEN ((sal_uLong)6)
+#define STYLE_SYMBOLS_CLASSIC ((sal_uLong)7)
+#define STYLE_SYMBOLS_HUMAN ((sal_uLong)8)
+#define STYLE_SYMBOLS_THEMES_MAX ((sal_uLong)9)
+
+#define STYLE_MENUIMAGES_OFF ((sal_uInt16)0)
+#define STYLE_MENUIMAGES_ON ((sal_uInt16)1)
+#define STYLE_MENUIMAGES_AUTO ((sal_uInt16)2)
+
+#define STYLE_CURSOR_NOBLINKTIME ((sal_uLong)0xFFFFFFFF)
class VCL_DLLPUBLIC StyleSettings
{
@@ -736,34 +707,34 @@ public:
const Color& GetInactiveTabColor() const
{ return mpData->maInactiveTabColor; }
- void SetHighContrastMode( BOOL bHighContrast )
+ void SetHighContrastMode( sal_Bool bHighContrast )
{ CopyData(); mpData->mnHighContrast = bHighContrast; }
- BOOL GetHighContrastMode() const
- { return (BOOL) mpData->mnHighContrast; }
- BOOL IsHighContrastBlackAndWhite() const;
- void SetUseSystemUIFonts( BOOL bUseSystemUIFonts )
+ sal_Bool GetHighContrastMode() const
+ { return (sal_Bool) mpData->mnHighContrast; }
+ sal_Bool IsHighContrastBlackAndWhite() const;
+ void SetUseSystemUIFonts( sal_Bool bUseSystemUIFonts )
{ CopyData(); mpData->mnUseSystemUIFonts = bUseSystemUIFonts; }
- BOOL GetUseSystemUIFonts() const
- { return (BOOL) mpData->mnUseSystemUIFonts; }
- void SetUseFlatBorders( BOOL bUseFlatBorders )
+ sal_Bool GetUseSystemUIFonts() const
+ { return (sal_Bool) mpData->mnUseSystemUIFonts; }
+ void SetUseFlatBorders( sal_Bool bUseFlatBorders )
{ CopyData(); mpData->mnUseFlatBorders = bUseFlatBorders; }
- BOOL GetUseFlatBorders() const
- { return (BOOL) mpData->mnUseFlatBorders; }
- void SetUseFlatMenues( BOOL bUseFlatMenues )
+ sal_Bool GetUseFlatBorders() const
+ { return (sal_Bool) mpData->mnUseFlatBorders; }
+ void SetUseFlatMenues( sal_Bool bUseFlatMenues )
{ CopyData(); mpData->mnUseFlatMenues = bUseFlatMenues; }
- BOOL GetUseFlatMenues() const
- { return (BOOL) mpData->mnUseFlatMenues; }
- void SetUseImagesInMenus( BOOL bUseImagesInMenus )
+ sal_Bool GetUseFlatMenues() const
+ { return (sal_Bool) mpData->mnUseFlatMenues; }
+ void SetUseImagesInMenus( sal_Bool bUseImagesInMenus )
{ CopyData(); mpData->mnUseImagesInMenus = bUseImagesInMenus; }
- BOOL GetUseImagesInMenus() const;
- void SetPreferredUseImagesInMenus( BOOL bPreferredUseImagesInMenus )
+ sal_Bool GetUseImagesInMenus() const;
+ void SetPreferredUseImagesInMenus( sal_Bool bPreferredUseImagesInMenus )
{ CopyData(); mpData->mbPreferredUseImagesInMenus = bPreferredUseImagesInMenus; }
- BOOL GetPreferredUseImagesInMenus() const
+ sal_Bool GetPreferredUseImagesInMenus() const
{ return mpData->mbPreferredUseImagesInMenus; }
- void SetSkipDisabledInMenus( BOOL bSkipDisabledInMenus )
+ void SetSkipDisabledInMenus( sal_Bool bSkipDisabledInMenus )
{ CopyData(); mpData->mnSkipDisabledInMenus = bSkipDisabledInMenus; }
- BOOL GetSkipDisabledInMenus() const
- { return (BOOL) mpData->mnSkipDisabledInMenus; }
+ sal_Bool GetSkipDisabledInMenus() const
+ { return (sal_Bool) mpData->mnSkipDisabledInMenus; }
void SetCairoFontOptions( const void *pOptions )
{ CopyData(); mpData->mpFontOptions = pOptions; }
@@ -823,23 +794,6 @@ public:
const Font& GetIconFont() const
{ return mpData->maIconFont; }
- void SetRadioButtonStyle( USHORT nStyle )
- { CopyData(); mpData->mnRadioButtonStyle = nStyle; }
- USHORT GetRadioButtonStyle() const
- { return mpData->mnRadioButtonStyle; }
- void SetCheckBoxStyle( USHORT nStyle )
- { CopyData(); mpData->mnCheckBoxStyle = nStyle; }
- USHORT GetCheckBoxStyle() const
- { return mpData->mnCheckBoxStyle; }
- void SetPushButtonStyle( USHORT nStyle )
- { CopyData(); mpData->mnPushButtonStyle = nStyle; }
- USHORT GetPushButtonStyle() const
- { return mpData->mnPushButtonStyle; }
- void SetTabControlStyle( USHORT nStyle )
- { CopyData(); mpData->mnTabControlStyle = nStyle; }
- USHORT GetTabControlStyle() const
- { return mpData->mnTabControlStyle; }
-
void SetBorderSize( long nSize )
{ CopyData(); mpData->mnBorderSize = nSize; }
long GetBorderSize() const
@@ -895,78 +849,78 @@ public:
long GetCursorBlinkTime() const
{ return (long) mpData->mnCursorBlinkTime; }
- void SetScreenZoom( USHORT nPercent )
+ void SetScreenZoom( sal_uInt16 nPercent )
{ CopyData(); mpData->mnScreenZoom = nPercent; }
- USHORT GetScreenZoom() const
+ sal_uInt16 GetScreenZoom() const
{ return mpData->mnScreenZoom; }
- void SetScreenFontZoom( USHORT nPercent )
+ void SetScreenFontZoom( sal_uInt16 nPercent )
{ CopyData(); mpData->mnScreenFontZoom = nPercent; }
- USHORT GetScreenFontZoom() const
+ sal_uInt16 GetScreenFontZoom() const
{ return mpData->mnScreenFontZoom; }
- void SetLogoDisplayTime( ULONG nDisplayTime )
+ void SetLogoDisplayTime( sal_uLong nDisplayTime )
{ CopyData(); mpData->mnLogoDisplayTime = nDisplayTime; }
- ULONG GetLogoDisplayTime() const
+ sal_uLong GetLogoDisplayTime() const
{ return mpData->mnLogoDisplayTime; }
- void SetDragFullOptions( ULONG nOptions )
+ void SetDragFullOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnDragFullOptions = nOptions; }
- ULONG GetDragFullOptions() const
+ sal_uLong GetDragFullOptions() const
{ return mpData->mnDragFullOptions; }
- void SetAnimationOptions( ULONG nOptions )
+ void SetAnimationOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnAnimationOptions = nOptions; }
- ULONG GetAnimationOptions() const
+ sal_uLong GetAnimationOptions() const
{ return mpData->mnAnimationOptions; }
- void SetSelectionOptions( ULONG nOptions )
+ void SetSelectionOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnSelectionOptions = nOptions; }
- ULONG GetSelectionOptions() const
+ sal_uLong GetSelectionOptions() const
{ return mpData->mnSelectionOptions; }
- void SetDisplayOptions( ULONG nOptions )
+ void SetDisplayOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnDisplayOptions = nOptions; }
- ULONG GetDisplayOptions() const
+ sal_uLong GetDisplayOptions() const
{ return mpData->mnDisplayOptions; }
void SetAntialiasingMinPixelHeight( long nMinPixel )
{ CopyData(); mpData->mnAntialiasedMin = nMinPixel; }
- ULONG GetAntialiasingMinPixelHeight() const
+ sal_uLong GetAntialiasingMinPixelHeight() const
{ return mpData->mnAntialiasedMin; }
- void SetOptions( ULONG nOptions )
+ void SetOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnOptions = nOptions; }
- ULONG GetOptions() const
+ sal_uLong GetOptions() const
{ return mpData->mnOptions; }
- void SetAutoMnemonic( BOOL bAutoMnemonic )
- { CopyData(); mpData->mnAutoMnemonic = (USHORT)bAutoMnemonic; }
- BOOL GetAutoMnemonic() const
- { return mpData->mnAutoMnemonic ? TRUE : FALSE; }
+ void SetAutoMnemonic( sal_Bool bAutoMnemonic )
+ { CopyData(); mpData->mnAutoMnemonic = (sal_uInt16)bAutoMnemonic; }
+ sal_Bool GetAutoMnemonic() const
+ { return mpData->mnAutoMnemonic ? sal_True : sal_False; }
void SetFontColor( const Color& rColor )
{ CopyData(); mpData->maFontColor = rColor; }
const Color& GetFontColor() const
{ return mpData->maFontColor; }
- void SetToolbarIconSize( ULONG nSize )
+ void SetToolbarIconSize( sal_uLong nSize )
{ CopyData(); mpData->mnToolbarIconSize = nSize; }
- ULONG GetToolbarIconSize() const
+ sal_uLong GetToolbarIconSize() const
{ return mpData->mnToolbarIconSize; }
- void SetSymbolsStyle( ULONG nStyle )
+ void SetSymbolsStyle( sal_uLong nStyle )
{ CopyData(); mpData->mnSymbolsStyle = nStyle; }
- ULONG GetSymbolsStyle() const
+ sal_uLong GetSymbolsStyle() const
{ return mpData->mnSymbolsStyle; }
- void SetPreferredSymbolsStyle( ULONG nStyle )
+ void SetPreferredSymbolsStyle( sal_uLong nStyle )
{ CopyData(); mpData->mnPreferredSymbolsStyle = nStyle; }
void SetPreferredSymbolsStyleName( const ::rtl::OUString &rName );
- ULONG GetPreferredSymbolsStyle() const
+ sal_uLong GetPreferredSymbolsStyle() const
{ return mpData->mnPreferredSymbolsStyle; }
// check whether the symbols style is supported (icons are installed)
- bool CheckSymbolStyle( ULONG nStyle ) const;
- ULONG GetAutoSymbolsStyle() const;
+ bool CheckSymbolStyle( sal_uLong nStyle ) const;
+ sal_uLong GetAutoSymbolsStyle() const;
- ULONG GetCurrentSymbolsStyle() const;
+ sal_uLong GetCurrentSymbolsStyle() const;
void SetSymbolsStyleName( const ::rtl::OUString &rName )
{ return SetSymbolsStyle( ImplNameToSymbolsStyle( rName ) ); }
@@ -981,20 +935,16 @@ public:
{ CopyData(); mpData->maWorkspaceGradient = rWall; }
void SetStandardStyles();
- void SetStandardWinStyles();
- void SetStandardOS2Styles();
- void SetStandardMacStyles();
- void SetStandardUnixStyles();
const StyleSettings& operator =( const StyleSettings& rSet );
- BOOL operator ==( const StyleSettings& rSet ) const;
- BOOL operator !=( const StyleSettings& rSet ) const
+ sal_Bool operator ==( const StyleSettings& rSet ) const;
+ sal_Bool operator !=( const StyleSettings& rSet ) const
{ return !(*this == rSet); }
protected:
- ::rtl::OUString ImplSymbolsStyleToName( ULONG nStyle ) const;
- ULONG ImplNameToSymbolsStyle( const ::rtl::OUString &rName ) const;
+ ::rtl::OUString ImplSymbolsStyleToName( sal_uLong nStyle ) const;
+ sal_uLong ImplNameToSymbolsStyle( const ::rtl::OUString &rName ) const;
};
// ----------------
@@ -1009,10 +959,10 @@ class ImplMiscData
ImplMiscData( const ImplMiscData& rData );
private:
- ULONG mnRefCount;
- USHORT mnEnableATT;
- BOOL mbEnableLocalizedDecimalSep;
- USHORT mnDisablePrinting;
+ sal_uLong mnRefCount;
+ sal_uInt16 mnEnableATT;
+ sal_Bool mbEnableLocalizedDecimalSep;
+ sal_uInt16 mnDisablePrinting;
};
// ----------------
@@ -1031,16 +981,16 @@ public:
MiscSettings( const MiscSettings& rSet );
~MiscSettings();
- void SetEnableATToolSupport( BOOL bEnable );
- BOOL GetEnableATToolSupport() const;
- void SetDisablePrinting( BOOL bEnable );
- BOOL GetDisablePrinting() const;
- void SetEnableLocalizedDecimalSep( BOOL bEnable );
- BOOL GetEnableLocalizedDecimalSep() const;
+ void SetEnableATToolSupport( sal_Bool bEnable );
+ sal_Bool GetEnableATToolSupport() const;
+ void SetDisablePrinting( sal_Bool bEnable );
+ sal_Bool GetDisablePrinting() const;
+ void SetEnableLocalizedDecimalSep( sal_Bool bEnable );
+ sal_Bool GetEnableLocalizedDecimalSep() const;
const MiscSettings& operator =( const MiscSettings& rSet );
- BOOL operator ==( const MiscSettings& rSet ) const;
- BOOL operator !=( const MiscSettings& rSet ) const
+ sal_Bool operator ==( const MiscSettings& rSet ) const;
+ sal_Bool operator !=( const MiscSettings& rSet ) const
{ return !(*this == rSet); }
};
@@ -1056,8 +1006,8 @@ class ImplNotificationData
ImplNotificationData( const ImplNotificationData& rData );
private:
- ULONG mnRefCount;
- ULONG mnOptions;
+ sal_uLong mnRefCount;
+ sal_uLong mnOptions;
};
// ------------------------
@@ -1076,15 +1026,15 @@ public:
NotificationSettings( const NotificationSettings& rSet );
~NotificationSettings();
- void SetOptions( ULONG nOptions )
+ void SetOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnOptions = nOptions; }
- ULONG GetOptions() const
+ sal_uLong GetOptions() const
{ return mpData->mnOptions; }
const NotificationSettings& operator =( const NotificationSettings& rSet );
- BOOL operator ==( const NotificationSettings& rSet ) const;
- BOOL operator !=( const NotificationSettings& rSet ) const
+ sal_Bool operator ==( const NotificationSettings& rSet ) const;
+ sal_Bool operator !=( const NotificationSettings& rSet ) const
{ return !(*this == rSet); }
};
@@ -1100,19 +1050,19 @@ class ImplHelpData
ImplHelpData( const ImplHelpData& rData );
private:
- ULONG mnRefCount;
- ULONG mnOptions;
- ULONG mnTipDelay;
- ULONG mnTipTimeout;
- ULONG mnBalloonDelay;
+ sal_uLong mnRefCount;
+ sal_uLong mnOptions;
+ sal_uLong mnTipDelay;
+ sal_uLong mnTipTimeout;
+ sal_uLong mnBalloonDelay;
};
// ----------------
// - HelpSettings -
// ----------------
-#define HELP_OPTION_QUICK ((ULONG)0x00000001)
-#define HELP_OPTION_ACTIVE ((ULONG)0x00000002)
+#define HELP_OPTION_QUICK ((sal_uLong)0x00000001)
+#define HELP_OPTION_ACTIVE ((sal_uLong)0x00000002)
class VCL_DLLPUBLIC HelpSettings
{
@@ -1126,27 +1076,27 @@ public:
HelpSettings( const HelpSettings& rSet );
~HelpSettings();
- void SetOptions( ULONG nOptions )
+ void SetOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnOptions = nOptions; }
- ULONG GetOptions() const
+ sal_uLong GetOptions() const
{ return mpData->mnOptions; }
- void SetTipDelay( ULONG nTipDelay )
+ void SetTipDelay( sal_uLong nTipDelay )
{ CopyData(); mpData->mnTipDelay = nTipDelay; }
- ULONG GetTipDelay() const
+ sal_uLong GetTipDelay() const
{ return mpData->mnTipDelay; }
- void SetTipTimeout( ULONG nTipTimeout )
+ void SetTipTimeout( sal_uLong nTipTimeout )
{ CopyData(); mpData->mnTipTimeout = nTipTimeout; }
- ULONG GetTipTimeout() const
+ sal_uLong GetTipTimeout() const
{ return mpData->mnTipTimeout; }
- void SetBalloonDelay( ULONG nBalloonDelay )
+ void SetBalloonDelay( sal_uLong nBalloonDelay )
{ CopyData(); mpData->mnBalloonDelay = nBalloonDelay; }
- ULONG GetBalloonDelay() const
+ sal_uLong GetBalloonDelay() const
{ return mpData->mnBalloonDelay; }
const HelpSettings& operator =( const HelpSettings& rSet );
- BOOL operator ==( const HelpSettings& rSet ) const;
- BOOL operator !=( const HelpSettings& rSet ) const
+ sal_Bool operator ==( const HelpSettings& rSet ) const;
+ sal_Bool operator !=( const HelpSettings& rSet ) const
{ return !(*this == rSet); }
};
@@ -1163,7 +1113,7 @@ class ImplAllSettingsData
~ImplAllSettingsData();
private:
- ULONG mnRefCount;
+ sal_uLong mnRefCount;
MachineSettings maMachineSettings;
MouseSettings maMouseSettings;
KeyboardSettings maKeyboardSettings;
@@ -1172,8 +1122,8 @@ private:
NotificationSettings maNotificationSettings;
HelpSettings maHelpSettings;
::com::sun::star::lang::Locale maLocale;
- ULONG mnSystemUpdate;
- ULONG mnWindowUpdate;
+ sal_uLong mnSystemUpdate;
+ sal_uLong mnWindowUpdate;
::com::sun::star::lang::Locale maUILocale;
LanguageType meLanguage;
LanguageType meUILanguage;
@@ -1189,24 +1139,24 @@ private:
// - AllSettings -
// ---------------
-#define SETTINGS_MACHINE ((ULONG)0x00000001)
-#define SETTINGS_MOUSE ((ULONG)0x00000002)
-#define SETTINGS_KEYBOARD ((ULONG)0x00000004)
-#define SETTINGS_STYLE ((ULONG)0x00000008)
-#define SETTINGS_MISC ((ULONG)0x00000010)
-#define SETTINGS_SOUND ((ULONG)0x00000020)
-#define SETTINGS_NOTIFICATION ((ULONG)0x00000040)
-#define SETTINGS_HELP ((ULONG)0x00000080)
-#define SETTINGS_INTERNATIONAL ((ULONG)0x00000100) /* was for class International, has no effect anymore */
-#define SETTINGS_LOCALE ((ULONG)0x00000200)
-#define SETTINGS_UILOCALE ((ULONG)0x00000400)
+#define SETTINGS_MACHINE ((sal_uLong)0x00000001)
+#define SETTINGS_MOUSE ((sal_uLong)0x00000002)
+#define SETTINGS_KEYBOARD ((sal_uLong)0x00000004)
+#define SETTINGS_STYLE ((sal_uLong)0x00000008)
+#define SETTINGS_MISC ((sal_uLong)0x00000010)
+#define SETTINGS_SOUND ((sal_uLong)0x00000020)
+#define SETTINGS_NOTIFICATION ((sal_uLong)0x00000040)
+#define SETTINGS_HELP ((sal_uLong)0x00000080)
+#define SETTINGS_INTERNATIONAL ((sal_uLong)0x00000100) /* was for class International, has no effect anymore */
+#define SETTINGS_LOCALE ((sal_uLong)0x00000200)
+#define SETTINGS_UILOCALE ((sal_uLong)0x00000400)
#define SETTINGS_ALLSETTINGS (SETTINGS_MACHINE |\
SETTINGS_MOUSE | SETTINGS_KEYBOARD |\
SETTINGS_STYLE | SETTINGS_MISC |\
SETTINGS_SOUND | SETTINGS_NOTIFICATION |\
SETTINGS_HELP |\
SETTINGS_LOCALE | SETTINGS_UILOCALE )
-#define SETTINGS_IN_UPDATE_SETTINGS ((ULONG)0x00000800) // this flag indicates that the data changed event was created
+#define SETTINGS_IN_UPDATE_SETTINGS ((sal_uLong)0x00000800) // this flag indicates that the data changed event was created
// in Windows::UpdateSettings probably because of a global
// settings changed
@@ -1265,7 +1215,7 @@ public:
LanguageType GetLanguage() const;
void SetUILanguage( LanguageType eLang );
LanguageType GetUILanguage() const;
- BOOL GetLayoutRTL() const; // returns TRUE if UI language requires right-to-left UI
+ sal_Bool GetLayoutRTL() const; // returns sal_True if UI language requires right-to-left UI
const LocaleDataWrapper& GetLocaleDataWrapper() const;
const LocaleDataWrapper& GetUILocaleDataWrapper() const;
const vcl::I18nHelper& GetLocaleI18nHelper() const;
@@ -1282,22 +1232,22 @@ public:
const String& rStr2, xub_StrLen nPos2, xub_StrLen nCount2 ) const;
*/
- void SetSystemUpdate( ULONG nUpdate )
+ void SetSystemUpdate( sal_uLong nUpdate )
{ CopyData(); mpData->mnSystemUpdate = nUpdate; }
- ULONG GetSystemUpdate() const
+ sal_uLong GetSystemUpdate() const
{ return mpData->mnSystemUpdate; }
- void SetWindowUpdate( ULONG nUpdate )
+ void SetWindowUpdate( sal_uLong nUpdate )
{ CopyData(); mpData->mnWindowUpdate = nUpdate; }
- ULONG GetWindowUpdate() const
+ sal_uLong GetWindowUpdate() const
{ return mpData->mnWindowUpdate; }
- ULONG Update( ULONG nFlags, const AllSettings& rSettings );
- ULONG GetChangeFlags( const AllSettings& rSettings ) const;
+ sal_uLong Update( sal_uLong nFlags, const AllSettings& rSettings );
+ sal_uLong GetChangeFlags( const AllSettings& rSettings ) const;
const AllSettings& operator =( const AllSettings& rSet );
- BOOL operator ==( const AllSettings& rSet ) const;
- BOOL operator !=( const AllSettings& rSet ) const
+ sal_Bool operator ==( const AllSettings& rSet ) const;
+ sal_Bool operator !=( const AllSettings& rSet ) const
{ return !(*this == rSet); }
static void LocaleSettingsChanged( sal_uInt32 nHint );
SvtSysLocale& GetSysLocale() { return mpData->maSysLocale; }
diff --git a/vcl/inc/vcl/slider.hxx b/vcl/inc/vcl/slider.hxx
index 5208fffcfb54..15f049555386 100644
--- a/vcl/inc/vcl/slider.hxx
+++ b/vcl/inc/vcl/slider.hxx
@@ -60,11 +60,11 @@ private:
long mnLineSize;
long mnPageSize;
long mnDelta;
- USHORT mnDragDraw;
- USHORT mnStateFlags;
+ sal_uInt16 mnDragDraw;
+ sal_uInt16 mnStateFlags;
ScrollType meScrollType;
- BOOL mbCalcSize;
- BOOL mbFullDrag;
+ sal_Bool mbCalcSize;
+ sal_Bool mbFullDrag;
Link maSlideHdl;
Link maEndSlideHdl;
@@ -73,16 +73,16 @@ private:
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
SAL_DLLPRIVATE void ImplInitSettings();
- SAL_DLLPRIVATE void ImplUpdateRects( BOOL bUpdate = TRUE );
+ SAL_DLLPRIVATE void ImplUpdateRects( sal_Bool bUpdate = sal_True );
SAL_DLLPRIVATE long ImplCalcThumbPos( long nPixPos );
SAL_DLLPRIVATE long ImplCalcThumbPosPix( long nPos );
- SAL_DLLPRIVATE void ImplCalc( BOOL bUpdate = TRUE );
- SAL_DLLPRIVATE void ImplDraw( USHORT nDrawFlags );
- SAL_DLLPRIVATE BOOL ImplIsPageUp( const Point& rPos );
- SAL_DLLPRIVATE BOOL ImplIsPageDown( const Point& rPos );
- SAL_DLLPRIVATE long ImplSlide( long nNewPos, BOOL bCallEndSlide );
- SAL_DLLPRIVATE long ImplDoAction( BOOL bCallEndSlide );
- SAL_DLLPRIVATE void ImplDoMouseAction( const Point& rPos, BOOL bCallAction = TRUE );
+ SAL_DLLPRIVATE void ImplCalc( sal_Bool bUpdate = sal_True );
+ SAL_DLLPRIVATE void ImplDraw( sal_uInt16 nDrawFlags );
+ SAL_DLLPRIVATE sal_Bool ImplIsPageUp( const Point& rPos );
+ SAL_DLLPRIVATE sal_Bool ImplIsPageDown( const Point& rPos );
+ SAL_DLLPRIVATE long ImplSlide( long nNewPos, sal_Bool bCallEndSlide );
+ SAL_DLLPRIVATE long ImplDoAction( sal_Bool bCallEndSlide );
+ SAL_DLLPRIVATE void ImplDoMouseAction( const Point& rPos, sal_Bool bCallAction = sal_True );
SAL_DLLPRIVATE long ImplDoSlide( long nNewPos );
SAL_DLLPRIVATE long ImplDoSlideAction( ScrollType eScrollType );
@@ -103,9 +103,9 @@ public:
virtual void Slide();
virtual void EndSlide();
- void EnableDrag( BOOL bEnable = TRUE )
+ void EnableDrag( sal_Bool bEnable = sal_True )
{ mbFullDrag = bEnable; }
- BOOL IsDragEnabled() const { return mbFullDrag; }
+ sal_Bool IsDragEnabled() const { return mbFullDrag; }
void SetRangeMin( long nNewRange );
long GetRangeMin() const { return mnMinRange; }
diff --git a/vcl/inc/vcl/smartid.hxx b/vcl/inc/vcl/smartid.hxx
deleted file mode 100644
index fa005db25c80..000000000000
--- a/vcl/inc/vcl/smartid.hxx
+++ /dev/null
@@ -1,90 +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 _SMARTID_HXX_
-#define _SMARTID_HXX_
-
-#include <tools/string.hxx>
-#include <vcl/dllapi.h>
-
-/// SMART_SET_SMART only sets the Ids that are defined in the SmartId
-/// the other types set whatever is given. This can also be used to reset an Id
-enum SmartIdUpdateMode { SMART_SET_SMART, SMART_SET_NUM, SMART_SET_STR, SMART_SET_ALL };
-
-struct ImplSmartIdData;
-
-/*
-
-SmartId is a substitute for Numeric HelpIds. They can handle Numeric and String HelpIds and offer commonly needed operators.
-
-Matching Ids:
-if part of an Id is not set (HasNumeric HasString is False) then this part will never match to anything. Not even unset values
-
-*/
-class VCL_DLLPUBLIC SmartId
-{
-private:
- ImplSmartIdData* mpData;
- SAL_DLLPRIVATE ImplSmartIdData* GetSmartIdData();
-
-public:
- explicit SmartId( const String& rId );
- explicit SmartId( ULONG nId );
- SmartId( const String& rId, ULONG nId );
-
- SmartId();
-
- SmartId( const SmartId& rId );
- SmartId& operator = ( const SmartId& rId );
-
- ~SmartId();
-
- void UpdateId( const SmartId& rId, SmartIdUpdateMode aMode = SMART_SET_SMART );
-
- BOOL HasNumeric() const;
- BOOL HasString() const;
- BOOL HasAny() const;
- ULONG GetNum() const;
- String GetStr() const;
-
- String GetText() const; /// return String for UI usage
-
- BOOL Matches( const String &rId )const;
- BOOL Matches( const ULONG nId ) const;
-/// In case both Ids have both values set only the StringId is used for Matching
- BOOL Matches( const SmartId &rId ) const;
-
- BOOL Equals( const SmartId &rId ) const;
-
- BOOL operator == ( const SmartId& rRight ) const;
- BOOL operator < ( const SmartId& rRight ) const;
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/sndstyle.hxx b/vcl/inc/vcl/sndstyle.hxx
index 62268d34a6ba..170a51173726 100644
--- a/vcl/inc/vcl/sndstyle.hxx
+++ b/vcl/inc/vcl/sndstyle.hxx
@@ -35,7 +35,7 @@
// - Sound-Types -
// ---------------
-typedef USHORT SoundType;
+typedef sal_uInt16 SoundType;
#define SOUND_DEFAULT ((SoundType)0)
#define SOUND_INFO ((SoundType)1)
#define SOUND_WARNING ((SoundType)2)
diff --git a/vcl/inc/vcl/spin.h b/vcl/inc/vcl/spin.h
index e20cb9aaa86a..f7b69cbf2a16 100644
--- a/vcl/inc/vcl/spin.h
+++ b/vcl/inc/vcl/spin.h
@@ -44,10 +44,10 @@ class OutputDevice;
void ImplDrawSpinButton( OutputDevice* pOutDev,
const Rectangle& rUpperRect,
const Rectangle& rLowerRect,
- BOOL bUpperIn, BOOL bLowerIn,
- BOOL bUpperEnabled = TRUE,
- BOOL bLowerEnabled = TRUE,
- BOOL bHorz = FALSE, BOOL bMirrorHorz = FALSE );
+ sal_Bool bUpperIn, sal_Bool bLowerIn,
+ sal_Bool bUpperEnabled = sal_True,
+ sal_Bool bLowerEnabled = sal_True,
+ sal_Bool bHorz = sal_False, sal_Bool bMirrorHorz = sal_False );
#endif // _SV_SPIN_H
diff --git a/vcl/inc/vcl/spin.hxx b/vcl/inc/vcl/spin.hxx
index 6250c5020717..02141bccd448 100644
--- a/vcl/inc/vcl/spin.hxx
+++ b/vcl/inc/vcl/spin.hxx
@@ -45,13 +45,13 @@ private:
Rectangle maUpperRect;
Rectangle maLowerRect;
Rectangle maFocusRect;
- BOOL mbRepeat : 1;
- BOOL mbUpperIn : 1;
- BOOL mbLowerIn : 1;
- BOOL mbInitialUp : 1;
- BOOL mbInitialDown : 1;
- BOOL mbHorz : 1;
- BOOL mbUpperIsFocused : 1;
+ sal_Bool mbRepeat : 1;
+ sal_Bool mbUpperIn : 1;
+ sal_Bool mbLowerIn : 1;
+ sal_Bool mbInitialUp : 1;
+ sal_Bool mbInitialDown : 1;
+ sal_Bool mbHorz : 1;
+ sal_Bool mbUpperIsFocused : 1;
Link maUpHdlLink;
Link maDownHdlLink;
long mnMinRange;
@@ -74,7 +74,7 @@ public:
virtual void Resize();
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void MouseButtonDown( const MouseEvent& rMEvt );
virtual void MouseButtonUp( const MouseEvent& rMEvt );
virtual void MouseMove( const MouseEvent& rMEvt );
@@ -101,15 +101,15 @@ public:
const Link& GetDownHdl() const { return maDownHdlLink; }
private:
- // moves the focus to the upper or lower rect. Return TRUE if the focus rect actually changed.
- SAL_DLLPRIVATE BOOL ImplMoveFocus( BOOL _bUpper );
- SAL_DLLPRIVATE void ImplCalcFocusRect( BOOL _bUpper );
+ // moves the focus to the upper or lower rect. Return sal_True if the focus rect actually changed.
+ SAL_DLLPRIVATE sal_Bool ImplMoveFocus( sal_Bool _bUpper );
+ SAL_DLLPRIVATE void ImplCalcFocusRect( sal_Bool _bUpper );
- SAL_DLLPRIVATE inline BOOL ImplIsUpperEnabled( ) const
+ SAL_DLLPRIVATE inline sal_Bool ImplIsUpperEnabled( ) const
{
return mnValue + mnValueStep <= mnMaxRange;
}
- SAL_DLLPRIVATE inline BOOL ImplIsLowerEnabled( ) const
+ SAL_DLLPRIVATE inline sal_Bool ImplIsLowerEnabled( ) const
{
return mnValue >= mnMinRange + mnValueStep;
}
diff --git a/vcl/inc/vcl/spinfld.hxx b/vcl/inc/vcl/spinfld.hxx
index db46c16d331b..becfe4be426f 100644
--- a/vcl/inc/vcl/spinfld.hxx
+++ b/vcl/inc/vcl/spinfld.hxx
@@ -50,7 +50,7 @@ protected:
Link maDownHdlLink;
Link maFirstHdlLink;
Link maLastHdlLink;
- BOOL mbRepeat:1,
+ sal_Bool mbRepeat:1,
mbSpin:1,
mbInitialUp:1,
mbInitialDown:1,
@@ -82,7 +82,7 @@ public:
SpinField( Window* pParent, const ResId& rResId );
~SpinField();
- virtual BOOL ShowDropDown( BOOL bShow );
+ virtual sal_Bool ShowDropDown( sal_Bool bShow );
virtual void Up();
virtual void Down();
@@ -93,7 +93,7 @@ public:
virtual void MouseButtonUp( const MouseEvent& rMEvt );
virtual void MouseMove( const MouseEvent& rMEvt );
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
@@ -110,7 +110,7 @@ public:
virtual Size CalcMinimumSize() const;
virtual Size GetOptimalSize(WindowSizeType eType) const;
- virtual Size CalcSize( USHORT nChars ) const;
+ virtual Size CalcSize( sal_uInt16 nChars ) const;
};
#endif // _SV_SPINFLD_HXX
diff --git a/vcl/inc/vcl/split.hxx b/vcl/inc/vcl/split.hxx
index 9cd77275820a..66371c6da1a2 100644
--- a/vcl/inc/vcl/split.hxx
+++ b/vcl/inc/vcl/split.hxx
@@ -48,9 +48,9 @@ private:
long mnStartSplitPos;
Point maDragPos;
Rectangle maDragRect;
- BOOL mbHorzSplit;
- BOOL mbDragFull;
- BOOL mbKbdSplitting;
+ sal_Bool mbHorzSplit;
+ sal_Bool mbDragFull;
+ sal_Bool mbKbdSplitting;
long mbInKeyEvent;
long mnKeyboardStepSize;
Link maStartSplitHdl;
@@ -62,7 +62,7 @@ private:
SAL_DLLPRIVATE void ImplSplitMousePos( Point& rPos );
SAL_DLLPRIVATE void ImplStartKbdSplitting();
SAL_DLLPRIVATE void ImplKbdTracking( KeyCode aKeyCode );
- SAL_DLLPRIVATE BOOL ImplSplitterActive();
+ SAL_DLLPRIVATE sal_Bool ImplSplitterActive();
SAL_DLLPRIVATE Splitter* ImplFindSibling();
SAL_DLLPRIVATE void ImplRestoreSplitter();
@@ -109,7 +109,7 @@ public:
void SetLastSplitPosPixel( long nNewPos );
long GetLastSplitPosPixel() const { return mnLastSplitPos; }
- BOOL IsHorizontal() const { return mbHorzSplit; }
+ sal_Bool IsHorizontal() const { return mbHorzSplit; }
// set the stepsize of the splitter for cursor movement
// the default is 10% of the reference window's width/height
diff --git a/vcl/inc/vcl/splitwin.hxx b/vcl/inc/vcl/splitwin.hxx
index c6671f2799c0..ce1e74958f48 100644
--- a/vcl/inc/vcl/splitwin.hxx
+++ b/vcl/inc/vcl/splitwin.hxx
@@ -40,7 +40,7 @@ struct ImplSplitSet;
// - SplitWindowItemBits -
// -----------------------
-typedef USHORT SplitWindowItemBits;
+typedef sal_uInt16 SplitWindowItemBits;
// -------------------------------
// - Bits fuer SplitWindow-Items -
@@ -56,8 +56,8 @@ typedef USHORT SplitWindowItemBits;
// - SplitWindow-Types -
// ---------------------
-#define SPLITWINDOW_APPEND ((USHORT)0xFFFF)
-#define SPLITWINDOW_ITEM_NOTFOUND ((USHORT)0xFFFF)
+#define SPLITWINDOW_APPEND ((sal_uInt16)0xFFFF)
+#define SPLITWINDOW_ITEM_NOTFOUND ((sal_uInt16)0xFFFF)
// ---------------
// - SplitWindow -
@@ -83,10 +83,10 @@ private:
long mnMSplitPos;
WinBits mnWinStyle;
WindowAlign meAlign;
- USHORT mnSplitTest;
- USHORT mnSplitPos;
- USHORT mnMouseModifier;
- BOOL mbDragFull:1,
+ sal_uInt16 mnSplitTest;
+ sal_uInt16 mnSplitPos;
+ sal_uInt16 mnMouseModifier;
+ sal_Bool mbDragFull:1,
mbHorz:1,
mbBottomRight:1,
mbCalc:1,
@@ -121,31 +121,31 @@ private:
SAL_DLLPRIVATE void ImplUpdateSet( ImplSplitSet* pSet );
SAL_DLLPRIVATE void ImplSetWindowSize( long nDelta );
SAL_DLLPRIVATE void ImplSplitMousePos( Point& rMousePos );
- SAL_DLLPRIVATE void ImplGetButtonRect( Rectangle& rRect, long nEx, BOOL bTest ) const;
- SAL_DLLPRIVATE void ImplGetAutoHideRect( Rectangle& rRect, BOOL bTest = FALSE ) const;
- SAL_DLLPRIVATE void ImplGetFadeInRect( Rectangle& rRect, BOOL bTest = FALSE ) const;
- SAL_DLLPRIVATE void ImplGetFadeOutRect( Rectangle& rRect, BOOL bTest = FALSE ) const;
+ SAL_DLLPRIVATE void ImplGetButtonRect( Rectangle& rRect, long nEx, sal_Bool bTest ) const;
+ SAL_DLLPRIVATE void ImplGetAutoHideRect( Rectangle& rRect, sal_Bool bTest = sal_False ) const;
+ SAL_DLLPRIVATE void ImplGetFadeInRect( Rectangle& rRect, sal_Bool bTest = sal_False ) const;
+ SAL_DLLPRIVATE void ImplGetFadeOutRect( Rectangle& rRect, sal_Bool bTest = sal_False ) const;
SAL_DLLPRIVATE void ImplDrawButtonRect( const Rectangle& rRect, long nSize );
- SAL_DLLPRIVATE void ImplDrawAutoHide( BOOL bInPaint );
- SAL_DLLPRIVATE void ImplDrawFadeIn( BOOL bInPaint );
- SAL_DLLPRIVATE void ImplDrawFadeOut( BOOL bInPaint );
+ SAL_DLLPRIVATE void ImplDrawAutoHide( sal_Bool bInPaint );
+ SAL_DLLPRIVATE void ImplDrawFadeIn( sal_Bool bInPaint );
+ SAL_DLLPRIVATE void ImplDrawFadeOut( sal_Bool bInPaint );
SAL_DLLPRIVATE void ImplNewAlign();
- SAL_DLLPRIVATE void ImplDrawGrip( const Rectangle& rRect, BOOL bHorz, BOOL bLeft );
- SAL_DLLPRIVATE void ImplDrawFadeArrow( const Point& rPt, BOOL bHorz, BOOL bLeft );
+ SAL_DLLPRIVATE void ImplDrawGrip( const Rectangle& rRect, sal_Bool bHorz, sal_Bool bLeft );
+ SAL_DLLPRIVATE void ImplDrawFadeArrow( const Point& rPt, sal_Bool bHorz, sal_Bool bLeft );
SAL_DLLPRIVATE void ImplStartSplit( const MouseEvent& rMEvt );
static SAL_DLLPRIVATE void ImplDrawBorder( SplitWindow* pWin );
static SAL_DLLPRIVATE void ImplDrawBorderLine( SplitWindow* pWin );
- static SAL_DLLPRIVATE void ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, BOOL bHide,
- BOOL bRows, BOOL bDown = TRUE );
+ static SAL_DLLPRIVATE void ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, sal_Bool bHide,
+ sal_Bool bRows, sal_Bool bDown = sal_True );
static SAL_DLLPRIVATE void ImplDrawBack( SplitWindow* pWindow, ImplSplitSet* pSet );
static SAL_DLLPRIVATE void ImplDrawBack( SplitWindow* pWindow, const Rectangle& rRect,
const Wallpaper* pWall, const Bitmap* pBitmap );
- static SAL_DLLPRIVATE USHORT ImplTestSplit( ImplSplitSet* pSet, const Point& rPos,
- long& rMouseOff, ImplSplitSet** ppFoundSet, USHORT& rFoundPos,
- BOOL bRows, BOOL bDown = TRUE );
- static SAL_DLLPRIVATE USHORT ImplTestSplit( SplitWindow* pWindow, const Point& rPos,
- long& rMouseOff, ImplSplitSet** ppFoundSet, USHORT& rFoundPos );
+ static SAL_DLLPRIVATE sal_uInt16 ImplTestSplit( ImplSplitSet* pSet, const Point& rPos,
+ long& rMouseOff, ImplSplitSet** ppFoundSet, sal_uInt16& rFoundPos,
+ sal_Bool bRows, sal_Bool bDown = sal_True );
+ static SAL_DLLPRIVATE sal_uInt16 ImplTestSplit( SplitWindow* pWindow, const Point& rPos,
+ long& rMouseOff, ImplSplitSet** ppFoundSet, sal_uInt16& rFoundPos );
static SAL_DLLPRIVATE void ImplDrawSplitTracking( SplitWindow* pThis, const Point& rPos );
// Copy assignment is forbidden and not implemented.
@@ -174,54 +174,66 @@ public:
virtual void DataChanged( const DataChangedEvent& rDCEvt );
virtual long PreNotify( NotifyEvent& rNEvt );
- void InsertItem( USHORT nId, Window* pWindow, long nSize,
- USHORT nPos = SPLITWINDOW_APPEND, USHORT nSetId = 0,
+ void InsertItem( sal_uInt16 nId, Window* pWindow, long nSize,
+ sal_uInt16 nPos = SPLITWINDOW_APPEND, sal_uInt16 nSetId = 0,
SplitWindowItemBits nBits = 0 );
- void InsertItem( USHORT nId, long nSize,
- USHORT nPos = SPLITWINDOW_APPEND, USHORT nSetId = 0,
+ void InsertItem( sal_uInt16 nId, long nSize,
+ sal_uInt16 nPos = SPLITWINDOW_APPEND, sal_uInt16 nSetId = 0,
SplitWindowItemBits nBits = 0 );
- void MoveItem( USHORT nId, USHORT nNewPos, USHORT nNewSetId = 0 );
- void RemoveItem( USHORT nId, BOOL bHide = TRUE );
+ void MoveItem( sal_uInt16 nId, sal_uInt16 nNewPos, sal_uInt16 nNewSetId = 0 );
+ void RemoveItem( sal_uInt16 nId, sal_Bool bHide = sal_True );
void Clear();
- void SetBaseSet( USHORT nSetId = 0 );
- USHORT GetBaseSet() const;
+ void SetBaseSet( sal_uInt16 nSetId = 0 );
+ sal_uInt16 GetBaseSet() const;
- void SetSplitSize( USHORT nSetId, long nSplitSize,
- BOOL bWithChilds = FALSE );
- long GetSplitSize( USHORT nSetId ) const;
- void SetItemBackground( USHORT nSetId );
- void SetItemBackground( USHORT nSetId, const Wallpaper& rWallpaper );
- Wallpaper GetItemBackground( USHORT nSetId ) const;
- BOOL IsItemBackground( USHORT nSetId ) const;
- void SetItemBitmap( USHORT nSetId, const Bitmap& rBitmap );
- Bitmap GetItemBitmap( USHORT nSetId ) const;
+ void SetSplitSize( sal_uInt16 nSetId, long nSplitSize,
+ sal_Bool bWithChilds = sal_False );
+ long GetSplitSize( sal_uInt16 nSetId ) const;
+ void SetItemBackground( sal_uInt16 nSetId );
+ void SetItemBackground( sal_uInt16 nSetId, const Wallpaper& rWallpaper );
+ Wallpaper GetItemBackground( sal_uInt16 nSetId ) const;
+ sal_Bool IsItemBackground( sal_uInt16 nSetId ) const;
+ void SetItemBitmap( sal_uInt16 nSetId, const Bitmap& rBitmap );
+ Bitmap GetItemBitmap( sal_uInt16 nSetId ) const;
- void SplitItem( USHORT nId, long nNewSize,
- BOOL bPropSmall = FALSE,
- BOOL bPropGreat = FALSE );
- void SetItemSize( USHORT nId, long nNewSize );
- long GetItemSize( USHORT nId ) const;
- long GetItemSize( USHORT nId, SplitWindowItemBits nBits ) const;
- void SetItemBits( USHORT nId, SplitWindowItemBits nNewBits );
- SplitWindowItemBits GetItemBits( USHORT nId ) const;
- Window* GetItemWindow( USHORT nId ) const;
- USHORT GetSet( USHORT nId ) const;
- BOOL GetSet( USHORT nId, USHORT& rSetId, USHORT& rPos ) const;
- USHORT GetItemId( Window* pWindow ) const;
- USHORT GetItemId( const Point& rPos ) const;
- USHORT GetItemPos( USHORT nId, USHORT nSetId = 0 ) const;
- USHORT GetItemId( USHORT nPos, USHORT nSetId = 0 ) const;
- USHORT GetItemCount( USHORT nSetId = 0 ) const;
- BOOL IsItemValid( USHORT nId ) const;
+ void SplitItem( sal_uInt16 nId, long nNewSize,
+ sal_Bool bPropSmall = sal_False,
+ sal_Bool bPropGreat = sal_False );
+ void SetItemSize( sal_uInt16 nId, long nNewSize );
+ long GetItemSize( sal_uInt16 nId ) const;
+ /** Set a range that limits the (variable part of the) size with an
+ upper and a lower bound (both are valid values themselves.)
+ @param nId
+ Id of the item for which the size limits are set.
+ @param aRange
+ Values of -1 define missing bounds, thus setting a range (-1,-1)
+ (the default) removes the size limitiation.
+ */
+ void SetItemSizeRange (sal_uInt16 nId, const Range aRange);
+ /** Return the current size limits for the specified item.
+ */
+ Range GetItemSizeRange (sal_uInt16 nId) const;
+ long GetItemSize( sal_uInt16 nId, SplitWindowItemBits nBits ) const;
+ void SetItemBits( sal_uInt16 nId, SplitWindowItemBits nNewBits );
+ SplitWindowItemBits GetItemBits( sal_uInt16 nId ) const;
+ Window* GetItemWindow( sal_uInt16 nId ) const;
+ sal_uInt16 GetSet( sal_uInt16 nId ) const;
+ sal_Bool GetSet( sal_uInt16 nId, sal_uInt16& rSetId, sal_uInt16& rPos ) const;
+ sal_uInt16 GetItemId( Window* pWindow ) const;
+ sal_uInt16 GetItemId( const Point& rPos ) const;
+ sal_uInt16 GetItemPos( sal_uInt16 nId, sal_uInt16 nSetId = 0 ) const;
+ sal_uInt16 GetItemId( sal_uInt16 nPos, sal_uInt16 nSetId = 0 ) const;
+ sal_uInt16 GetItemCount( sal_uInt16 nSetId = 0 ) const;
+ sal_Bool IsItemValid( sal_uInt16 nId ) const;
- void SetNoAlign( BOOL bNoAlign );
- BOOL IsNoAlign() const { return mbNoAlign; }
+ void SetNoAlign( sal_Bool bNoAlign );
+ sal_Bool IsNoAlign() const { return mbNoAlign; }
void SetAlign( WindowAlign eNewAlign = WINDOWALIGN_TOP );
WindowAlign GetAlign() const { return meAlign; }
- BOOL IsHorizontal() const { return mbHorz; }
+ sal_Bool IsHorizontal() const { return mbHorz; }
- BOOL IsSplitting() const { return IsTracking(); }
+ sal_Bool IsSplitting() const { return IsTracking(); }
void SetMaxSizePixel( long nNewMaxSize ) { mnMaxSize = nNewMaxSize; }
long GetMaxSizePixel() const { return mnMaxSize; }
@@ -229,24 +241,24 @@ public:
static Size CalcWindowSizePixel( const Size& rSize,
WindowAlign eAlign,
WinBits nWinStyle,
- BOOL bExtra = FALSE );
+ sal_Bool bExtra = sal_False );
Size CalcWindowSizePixel( const Size& rSize )
{ return CalcWindowSizePixel( rSize, meAlign, mnWinStyle, (mbAutoHide || mbFadeOut) ); }
Size CalcLayoutSizePixel( const Size& aNewSize );
- void ShowAutoHideButton( BOOL bShow = TRUE );
- BOOL IsAutoHideButtonVisible() const { return mbAutoHide; }
- void ShowFadeInHideButton( BOOL bShow = TRUE );
- void ShowFadeInButton( BOOL bShow = TRUE ) { ShowFadeInHideButton( bShow ); }
- BOOL IsFadeInButtonVisible() const { return mbFadeIn; }
- void ShowFadeOutButton( BOOL bShow = TRUE );
- BOOL IsFadeOutButtonVisible() const { return mbFadeOut; }
+ void ShowAutoHideButton( sal_Bool bShow = sal_True );
+ sal_Bool IsAutoHideButtonVisible() const { return mbAutoHide; }
+ void ShowFadeInHideButton( sal_Bool bShow = sal_True );
+ void ShowFadeInButton( sal_Bool bShow = sal_True ) { ShowFadeInHideButton( bShow ); }
+ sal_Bool IsFadeInButtonVisible() const { return mbFadeIn; }
+ void ShowFadeOutButton( sal_Bool bShow = sal_True );
+ sal_Bool IsFadeOutButtonVisible() const { return mbFadeOut; }
long GetFadeInSize() const;
- BOOL IsFadeNoButtonMode() const { return mbFadeNoButtonMode; }
+ sal_Bool IsFadeNoButtonMode() const { return mbFadeNoButtonMode; }
- void SetAutoHideState( BOOL bAutoHide );
- BOOL GetAutoHideState() const { return mbAutoHideIn; }
+ void SetAutoHideState( sal_Bool bAutoHide );
+ sal_Bool GetAutoHideState() const { return mbAutoHideIn; }
Rectangle GetAutoHideRect() const;
Rectangle GetFadeInRect() const;
diff --git a/vcl/inc/vcl/status.hxx b/vcl/inc/vcl/status.hxx
index 9df46e99d14b..d039ddf8f203 100644
--- a/vcl/inc/vcl/status.hxx
+++ b/vcl/inc/vcl/status.hxx
@@ -43,7 +43,7 @@ typedef ::std::vector< ImplStatusItem* > ImplStatusItemList;
void VCL_DLLPUBLIC DrawProgress( Window* pWindow, const Point& rPos,
long nOffset, long nPrgsWidth, long nPrgsHeight,
- USHORT nPercent1, USHORT nPercent2, USHORT nPercentCount,
+ sal_uInt16 nPercent1, sal_uInt16 nPercent2, sal_uInt16 nPercentCount,
const Rectangle& rFramePosSize
);
@@ -51,7 +51,7 @@ void VCL_DLLPUBLIC DrawProgress( Window* pWindow, const Point& rPos,
// - StatusBarItemBits -
// ---------------------
-typedef USHORT StatusBarItemBits;
+typedef sal_uInt16 StatusBarItemBits;
// ----------------------------
// - Bits fuer StatusBarItems -
@@ -70,8 +70,8 @@ typedef USHORT StatusBarItemBits;
// - StatusBar-Types -
// -------------------
-#define STATUSBAR_APPEND ((USHORT)0xFFFF)
-#define STATUSBAR_ITEM_NOTFOUND ((USHORT)0xFFFF)
+#define STATUSBAR_APPEND ((sal_uInt16)0xFFFF)
+#define STATUSBAR_ITEM_NOTFOUND ((sal_uInt16)0xFFFF)
#define STATUSBAR_OFFSET ((long)5)
// -------------
@@ -94,30 +94,30 @@ private:
long mnCalcHeight;
long mnTextY;
long mnItemY;
- USHORT mnCurItemId;
- USHORT mnPercent;
- USHORT mnPercentCount;
- BOOL mbVisibleItems;
- BOOL mbFormat;
- BOOL mbProgressMode;
- BOOL mbInUserDraw;
- BOOL mbBottomBorder;
+ sal_uInt16 mnCurItemId;
+ sal_uInt16 mnPercent;
+ sal_uInt16 mnPercentCount;
+ sal_Bool mbVisibleItems;
+ sal_Bool mbFormat;
+ sal_Bool mbProgressMode;
+ sal_Bool mbInUserDraw;
+ sal_Bool mbBottomBorder;
Link maClickHdl;
Link maDoubleClickHdl;
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
SAL_DLLPRIVATE void ImplFormat();
- SAL_DLLPRIVATE BOOL ImplIsItemUpdate();
+ SAL_DLLPRIVATE sal_Bool ImplIsItemUpdate();
using OutputDevice::ImplDrawText;
- SAL_DLLPRIVATE void ImplDrawText( BOOL bOffScreen, long nOldTextWidth );
- SAL_DLLPRIVATE void ImplDrawItem( BOOL bOffScreen, USHORT nPos, BOOL bDrawText, BOOL bDrawFrame );
- SAL_DLLPRIVATE void ImplDrawProgress( BOOL bPaint,
- USHORT nOldPerc, USHORT nNewPerc );
+ SAL_DLLPRIVATE void ImplDrawText( sal_Bool bOffScreen, long nOldTextWidth );
+ SAL_DLLPRIVATE void ImplDrawItem( sal_Bool bOffScreen, sal_uInt16 nPos, sal_Bool bDrawText, sal_Bool bDrawFrame );
+ SAL_DLLPRIVATE void ImplDrawProgress( sal_Bool bPaint,
+ sal_uInt16 nOldPerc, sal_uInt16 nNewPerc );
SAL_DLLPRIVATE void ImplCalcProgressRect();
- SAL_DLLPRIVATE Rectangle ImplGetItemRectPos( USHORT nPos ) const;
- SAL_DLLPRIVATE USHORT ImplGetFirstVisiblePos() const;
+ SAL_DLLPRIVATE Rectangle ImplGetItemRectPos( sal_uInt16 nPos ) const;
+ SAL_DLLPRIVATE sal_uInt16 ImplGetFirstVisiblePos() const;
SAL_DLLPRIVATE void ImplCalcBorder();
public:
@@ -138,65 +138,65 @@ public:
virtual void DoubleClick();
virtual void UserDraw( const UserDrawEvent& rUDEvt );
- void InsertItem( USHORT nItemId, ULONG nWidth,
+ void InsertItem( sal_uInt16 nItemId, sal_uLong nWidth,
StatusBarItemBits nBits = SIB_CENTER | SIB_IN,
long nOffset = STATUSBAR_OFFSET,
- USHORT nPos = STATUSBAR_APPEND );
- void RemoveItem( USHORT nItemId );
+ sal_uInt16 nPos = STATUSBAR_APPEND );
+ void RemoveItem( sal_uInt16 nItemId );
- void ShowItem( USHORT nItemId );
- void HideItem( USHORT nItemId );
- BOOL IsItemVisible( USHORT nItemId ) const;
+ void ShowItem( sal_uInt16 nItemId );
+ void HideItem( sal_uInt16 nItemId );
+ sal_Bool IsItemVisible( sal_uInt16 nItemId ) const;
void ShowItems();
void HideItems();
- BOOL AreItemsVisible() const { return mbVisibleItems; }
+ sal_Bool AreItemsVisible() const { return mbVisibleItems; }
void CopyItems( const StatusBar& rStatusBar );
void Clear();
- USHORT GetItemCount() const;
- USHORT GetItemId( USHORT nPos ) const;
- USHORT GetItemId( const Point& rPos ) const;
- USHORT GetItemPos( USHORT nItemId ) const;
- Rectangle GetItemRect( USHORT nItemId ) const;
- Point GetItemTextPos( USHORT nItemId ) const;
- USHORT GetCurItemId() const { return mnCurItemId; }
+ sal_uInt16 GetItemCount() const;
+ sal_uInt16 GetItemId( sal_uInt16 nPos ) const;
+ sal_uInt16 GetItemId( const Point& rPos ) const;
+ sal_uInt16 GetItemPos( sal_uInt16 nItemId ) const;
+ Rectangle GetItemRect( sal_uInt16 nItemId ) const;
+ Point GetItemTextPos( sal_uInt16 nItemId ) const;
+ sal_uInt16 GetCurItemId() const { return mnCurItemId; }
- ULONG GetItemWidth( USHORT nItemId ) const;
- StatusBarItemBits GetItemBits( USHORT nItemId ) const;
- long GetItemOffset( USHORT nItemId ) const;
+ sal_uLong GetItemWidth( sal_uInt16 nItemId ) const;
+ StatusBarItemBits GetItemBits( sal_uInt16 nItemId ) const;
+ long GetItemOffset( sal_uInt16 nItemId ) const;
- void SetItemText( USHORT nItemId, const XubString& rText );
- const XubString& GetItemText( USHORT nItemId ) const;
+ void SetItemText( sal_uInt16 nItemId, const XubString& rText );
+ const XubString& GetItemText( sal_uInt16 nItemId ) const;
- void SetItemData( USHORT nItemId, void* pNewData );
- void* GetItemData( USHORT nItemId ) const;
+ void SetItemData( sal_uInt16 nItemId, void* pNewData );
+ void* GetItemData( sal_uInt16 nItemId ) const;
- void SetItemCommand( USHORT nItemId, const XubString& rCommand );
- const XubString& GetItemCommand( USHORT nItemId );
+ void SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand );
+ const XubString& GetItemCommand( sal_uInt16 nItemId );
- void SetHelpText( USHORT nItemId, const XubString& rText );
- const XubString& GetHelpText( USHORT nItemId ) const;
+ void SetHelpText( sal_uInt16 nItemId, const XubString& rText );
+ const XubString& GetHelpText( sal_uInt16 nItemId ) const;
using Window::SetQuickHelpText;
- void SetQuickHelpText( USHORT nItemId, const XubString& rText );
+ void SetQuickHelpText( sal_uInt16 nItemId, const XubString& rText );
using Window::GetQuickHelpText;
- const XubString& GetQuickHelpText( USHORT nItemId ) const;
+ const XubString& GetQuickHelpText( sal_uInt16 nItemId ) const;
- void SetHelpId( USHORT nItemId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nItemId ) const;
+ void SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId );
+ rtl::OString GetHelpId( sal_uInt16 nItemId ) const;
- void SetBottomBorder( BOOL bBottomBorder = TRUE );
- BOOL IsBottomBorder() const { return mbBottomBorder; }
+ void SetBottomBorder( sal_Bool bBottomBorder = sal_True );
+ sal_Bool IsBottomBorder() const { return mbBottomBorder; }
- void SetTopBorder( BOOL bTopBorder = TRUE );
- BOOL IsTopBorder() const;
+ void SetTopBorder( sal_Bool bTopBorder = sal_True );
+ sal_Bool IsTopBorder() const;
void StartProgressMode( const XubString& rText );
- void SetProgressValue( USHORT nPercent );
+ void SetProgressValue( sal_uInt16 nPercent );
void EndProgressMode();
- BOOL IsProgressMode() const { return mbProgressMode; }
+ sal_Bool IsProgressMode() const { return mbProgressMode; }
void ResetProgressMode();
void SetText( const XubString& rText );
@@ -206,9 +206,9 @@ public:
const XubString& GetHelpText() const
{ return Window::GetHelpText(); }
- void SetHelpId( ULONG nId )
- { Window::SetHelpId( nId ); }
- ULONG GetHelpId() const
+ void SetHelpId( const rtl::OString& rId )
+ { Window::SetHelpId( rId ); }
+ const rtl::OString& GetHelpId() const
{ return Window::GetHelpId(); }
Size CalcWindowSizePixel() const;
@@ -219,9 +219,9 @@ public:
const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
using Window::SetAccessibleName;
- void SetAccessibleName( USHORT nItemId, const XubString& rName );
+ void SetAccessibleName( sal_uInt16 nItemId, const XubString& rName );
using Window::GetAccessibleName;
- const XubString& GetAccessibleName( USHORT nItemId ) const;
+ const XubString& GetAccessibleName( sal_uInt16 nItemId ) const;
};
#endif // _SV_STATUS_HXX
diff --git a/vcl/inc/vcl/stdtext.hxx b/vcl/inc/vcl/stdtext.hxx
index 96bd7ec14a1f..693a2692b010 100644
--- a/vcl/inc/vcl/stdtext.hxx
+++ b/vcl/inc/vcl/stdtext.hxx
@@ -40,16 +40,16 @@ class Window;
// ------------------
#define STANDARD_TEXT_FIRST STANDARD_TEXT_SERVICE_NOT_AVAILABLE
-#define STANDARD_TEXT_SERVICE_NOT_AVAILABLE ((USHORT)0)
+#define STANDARD_TEXT_SERVICE_NOT_AVAILABLE ((sal_uInt16)0)
#define STANDARD_TEXT_LAST STANDARD_TEXT_SERVICE_NOT_AVAILABLE
-XubString VCL_DLLPUBLIC GetStandardText( USHORT nStdText );
+XubString VCL_DLLPUBLIC GetStandardText( sal_uInt16 nStdText );
// -------------------------------------
// - Hilfsmethoden fuer Standard-Texte -
// -------------------------------------
-void VCL_DLLPUBLIC ShowServiceNotAvailableError( Window* pParent, const XubString& rServiceName, BOOL bError );
+void VCL_DLLPUBLIC ShowServiceNotAvailableError( Window* pParent, const XubString& rServiceName, sal_Bool bError );
#endif // _VCL_STDTEXT_HXX
diff --git a/vcl/inc/vcl/strhelper.hxx b/vcl/inc/vcl/strhelper.hxx
index cf433beadea6..450139b0ba14 100644
--- a/vcl/inc/vcl/strhelper.hxx
+++ b/vcl/inc/vcl/strhelper.hxx
@@ -47,10 +47,10 @@ int VCL_DLLPUBLIC GetCommandLineTokenCount( const String& );
int VCL_DLLPUBLIC GetCommandLineTokenCount( const ByteString& );
// returns number of tokens (zero if empty or whitespace only)
-String VCL_DLLPUBLIC WhitespaceToSpace( const String&, BOOL bProtect = TRUE );
-ByteString VCL_DLLPUBLIC WhitespaceToSpace( const ByteString&, BOOL bProtect = TRUE );
+String VCL_DLLPUBLIC WhitespaceToSpace( const String&, sal_Bool bProtect = sal_True );
+ByteString VCL_DLLPUBLIC WhitespaceToSpace( const ByteString&, sal_Bool bProtect = sal_True );
// returns a string with multiple adjacent occurrences of whitespace
-// converted to a single space. if bProtect is TRUE (nonzero), then
+// converted to a single space. if bProtect is sal_True (nonzero), then
// doublequote, singlequote and singleleftquote protect their respective
// contents
diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx
index df6229e62e6c..85e902161a48 100644
--- a/vcl/inc/vcl/svapp.hxx
+++ b/vcl/inc/vcl/svapp.hxx
@@ -78,8 +78,8 @@ VCL_DLLPUBLIC sal_UCS4 GetMirroredChar( sal_UCS4 );
// - SystemWindowMode -
// --------------------
-#define SYSTEMWINDOW_MODE_NOAUTOMODE ((USHORT)0x0001)
-#define SYSTEMWINDOW_MODE_DIALOG ((USHORT)0x0002)
+#define SYSTEMWINDOW_MODE_NOAUTOMODE ((sal_uInt16)0x0001)
+#define SYSTEMWINDOW_MODE_DIALOG ((sal_uInt16)0x0002)
// -------------
// - EventHook -
@@ -119,7 +119,7 @@ public:
const UniString& GetDomain() const { return aDomainName; }
int GetPID() const { return nPID; }
- BOOL IsConnectToSame( const ApplicationAddress& rAdr ) const;
+ sal_Bool IsConnectToSame( const ApplicationAddress& rAdr ) const;
};
inline ApplicationAddress::ApplicationAddress()
@@ -149,12 +149,12 @@ inline ApplicationAddress::ApplicationAddress( const UniString& rHost, int nPIDP
nPID = nPIDPar;
}
-inline BOOL ApplicationAddress::IsConnectToSame( const ApplicationAddress& rAdr ) const
+inline sal_Bool ApplicationAddress::IsConnectToSame( const ApplicationAddress& rAdr ) const
{
if ( nPID && ((nPID == rAdr.nPID) && (aHostName.Equals( rAdr.aHostName))) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
#define APPEVENT_PARAM_DELIMITER '\n'
@@ -184,12 +184,12 @@ public:
const UniString& GetData() const { return aData; }
const ApplicationAddress& GetAppAddress() const { return aAppAddr; }
- BOOL IsOpenEvent() const;
- BOOL IsPrintEvent() const;
- BOOL IsDiskInsertEvent() const;
+ sal_Bool IsOpenEvent() const;
+ sal_Bool IsPrintEvent() const;
+ sal_Bool IsDiskInsertEvent() const;
- USHORT GetParamCount() const { return aData.GetTokenCount( APPEVENT_PARAM_DELIMITER ); }
- UniString GetParam( USHORT nParam ) const { return aData.GetToken( nParam, APPEVENT_PARAM_DELIMITER ); }
+ sal_uInt16 GetParamCount() const { return aData.GetTokenCount( APPEVENT_PARAM_DELIMITER ); }
+ UniString GetParam( sal_uInt16 nParam ) const { return aData.GetToken( nParam, APPEVENT_PARAM_DELIMITER ); }
};
inline ApplicationEvent::ApplicationEvent( const UniString& rSenderAppName,
@@ -203,28 +203,28 @@ inline ApplicationEvent::ApplicationEvent( const UniString& rSenderAppName,
{
}
-inline BOOL ApplicationEvent::IsOpenEvent() const
+inline sal_Bool ApplicationEvent::IsOpenEvent() const
{
if ( aEvent.Equals( APPEVENT_OPEN_STRING ))
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
-inline BOOL ApplicationEvent::IsPrintEvent() const
+inline sal_Bool ApplicationEvent::IsPrintEvent() const
{
if ( aEvent.Equals( APPEVENT_PRINT_STRING ))
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
-inline BOOL ApplicationEvent::IsDiskInsertEvent() const
+inline sal_Bool ApplicationEvent::IsDiskInsertEvent() const
{
if ( aEvent.Equals( APPEVENT_DISKINSERT_STRING ))
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
class VCL_DLLPUBLIC PropertyHandler
@@ -245,9 +245,9 @@ public:
virtual int Main() = 0;
- virtual BOOL QueryExit();
+ virtual sal_Bool QueryExit();
- virtual void UserEvent( ULONG nEvent, void* pEventData );
+ virtual void UserEvent( sal_uLong nEvent, void* pEventData );
virtual void ActivateExtHelp();
virtual void DeactivateExtHelp();
@@ -264,11 +264,11 @@ public:
static void InitAppRes( const ResId& rResId );
- static USHORT GetCommandLineParamCount();
- static XubString GetCommandLineParam( USHORT nParam );
+ static sal_uInt16 GetCommandLineParamCount();
+ static XubString GetCommandLineParam( sal_uInt16 nParam );
static const XubString& GetAppFileName();
- virtual USHORT Exception( USHORT nError );
+ virtual sal_uInt16 Exception( sal_uInt16 nError );
static void Abort( const XubString& rErrorText );
static void Execute();
@@ -278,23 +278,23 @@ public:
static void EndYield();
static osl::SolarMutex& GetSolarMutex();
static oslThreadIdentifier GetMainThreadIdentifier();
- static ULONG ReleaseSolarMutex();
- static void AcquireSolarMutex( ULONG nCount );
+ static sal_uLong ReleaseSolarMutex();
+ static void AcquireSolarMutex( sal_uLong nCount );
static void EnableNoYieldMode( bool i_bNoYield );
static void AddPostYieldListener( const Link& i_rListener );
static void RemovePostYieldListener( const Link& i_rListener );
- static BOOL IsInMain();
- static BOOL IsInExecute();
- static BOOL IsShutDown();
- static BOOL IsInModalMode();
- static USHORT GetModalModeCount();
+ static sal_Bool IsInMain();
+ static sal_Bool IsInExecute();
+ static sal_Bool IsShutDown();
+ static sal_Bool IsInModalMode();
+ static sal_uInt16 GetModalModeCount();
- static USHORT GetDispatchLevel();
- static BOOL AnyInput( USHORT nType = INPUT_ANY );
- static ULONG GetLastInputInterval();
- static BOOL IsUICaptured();
- static BOOL IsUserActive( USHORT nTest = USERACTIVE_ALL );
+ static sal_uInt16 GetDispatchLevel();
+ static sal_Bool AnyInput( sal_uInt16 nType = INPUT_ANY );
+ static sal_uLong GetLastInputInterval();
+ static sal_Bool IsUICaptured();
+ static sal_Bool IsUserActive( sal_uInt16 nTest = USERACTIVE_ALL );
virtual void SystemSettingsChanging( AllSettings& rSettings,
Window* pFrame );
@@ -321,22 +321,22 @@ public:
static void RemoveEventListener( const Link& rEventListener );
static void AddKeyListener( const Link& rKeyListener );
static void RemoveKeyListener( const Link& rKeyListener );
- static void ImplCallEventListeners( ULONG nEvent, Window* pWin, void* pData );
+ static void ImplCallEventListeners( sal_uLong nEvent, Window* pWin, void* pData );
static void ImplCallEventListeners( VclSimpleEvent* pEvent );
- static BOOL HandleKey( ULONG nEvent, Window *pWin, KeyEvent* pKeyEvent );
+ static sal_Bool HandleKey( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent );
- static ULONG PostKeyEvent( ULONG nEvent, Window *pWin, KeyEvent* pKeyEvent );
- static ULONG PostMouseEvent( ULONG nEvent, Window *pWin, MouseEvent* pMouseEvent );
+ static sal_uLong PostKeyEvent( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent );
+ static sal_uLong PostMouseEvent( sal_uLong nEvent, Window *pWin, MouseEvent* pMouseEvent );
static void RemoveMouseAndKeyEvents( Window *pWin );
- static BOOL IsProcessedMouseOrKeyEvent( ULONG nEventId );
+ static sal_Bool IsProcessedMouseOrKeyEvent( sal_uLong nEventId );
- static ULONG PostUserEvent( ULONG nEvent, void* pEventData = NULL );
- static ULONG PostUserEvent( const Link& rLink, void* pCaller = NULL );
- static BOOL PostUserEvent( ULONG& rEventId, ULONG nEvent, void* pEventData = NULL );
- static BOOL PostUserEvent( ULONG& rEventId, const Link& rLink, void* pCaller = NULL );
- static void RemoveUserEvent( ULONG nUserEvent );
+ static sal_uLong PostUserEvent( sal_uLong nEvent, void* pEventData = NULL );
+ static sal_uLong PostUserEvent( const Link& rLink, void* pCaller = NULL );
+ static sal_Bool PostUserEvent( sal_uLong& rEventId, sal_uLong nEvent, void* pEventData = NULL );
+ static sal_Bool PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller = NULL );
+ static void RemoveUserEvent( sal_uLong nUserEvent );
- static BOOL InsertIdleHdl( const Link& rLink, USHORT nPriority );
+ static sal_Bool InsertIdleHdl( const Link& rLink, sal_uInt16 nPriority );
static void RemoveIdleHdl( const Link& rLink );
virtual void AppEvent( const ApplicationEvent& rAppEvent );
@@ -385,15 +385,15 @@ public:
static const LocaleDataWrapper& GetAppLocaleDataWrapper();
- static BOOL InsertAccel( Accelerator* pAccel );
+ static sal_Bool InsertAccel( Accelerator* pAccel );
static void RemoveAccel( Accelerator* pAccel );
static void FlushAccel();
- static BOOL CallAccel( const KeyCode& rKeyCode, USHORT nRepeat = 0 );
+ static sal_Bool CallAccel( const KeyCode& rKeyCode, sal_uInt16 nRepeat = 0 );
- static ULONG AddHotKey( const KeyCode& rKeyCode, const Link& rLink, void* pData = NULL );
- static void RemoveHotKey( ULONG nId );
- static ULONG AddEventHook( VCLEventHookProc pProc, void* pData = NULL );
- static void RemoveEventHook( ULONG nId );
+ static sal_uLong AddHotKey( const KeyCode& rKeyCode, const Link& rLink, void* pData = NULL );
+ static void RemoveHotKey( sal_uLong nId );
+ static sal_uLong AddEventHook( VCLEventHookProc pProc, void* pData = NULL );
+ static void RemoveEventHook( sal_uLong nId );
static long CallEventHooks( NotifyEvent& rEvt );
static long CallPreNotify( NotifyEvent& rEvt );
static long CallEvent( NotifyEvent& rEvt );
@@ -401,24 +401,24 @@ public:
static void SetHelp( Help* pHelp = NULL );
static Help* GetHelp();
- static void EnableAutoHelpId( BOOL bEnabled = TRUE );
- static BOOL IsAutoHelpIdEnabled();
+ static void EnableAutoHelpId( sal_Bool bEnabled = sal_True );
+ static sal_Bool IsAutoHelpIdEnabled();
- static void EnableAutoMnemonic( BOOL bEnabled = TRUE );
- static BOOL IsAutoMnemonicEnabled();
+ static void EnableAutoMnemonic( sal_Bool bEnabled = sal_True );
+ static sal_Bool IsAutoMnemonicEnabled();
- static ULONG GetReservedKeyCodeCount();
- static const KeyCode* GetReservedKeyCode( ULONG i );
- static String GetReservedKeyCodeDescription( ULONG i );
+ static sal_uLong GetReservedKeyCodeCount();
+ static const KeyCode* GetReservedKeyCode( sal_uLong i );
+ static String GetReservedKeyCodeDescription( sal_uLong i );
static void SetDefDialogParent( Window* pWindow );
static Window* GetDefDialogParent();
- static void EnableDialogCancel( BOOL bDialogCancel = TRUE );
- static BOOL IsDialogCancelEnabled();
+ static void EnableDialogCancel( sal_Bool bDialogCancel = sal_True );
+ static sal_Bool IsDialogCancelEnabled();
- static void SetSystemWindowMode( USHORT nMode );
- static USHORT GetSystemWindowMode();
+ static void SetSystemWindowMode( sal_uInt16 nMode );
+ static sal_uInt16 GetSystemWindowMode();
static void SetDialogScaleX( short nScale );
static short GetDialogScaleX();
@@ -432,16 +432,16 @@ public:
// The global service manager has to be created before!
static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit > GetVCLToolkit();
- static UnoWrapperBase* GetUnoWrapper( BOOL bCreateIfNotExists = TRUE );
+ static UnoWrapperBase* GetUnoWrapper( sal_Bool bCreateIfNotExists = sal_True );
static void SetUnoWrapper( UnoWrapperBase* pWrapper );
static void SetFilterHdl( const Link& rLink );
static const Link& GetFilterHdl();
- static BOOL IsAccessibilityEnabled();
+ static sal_Bool IsAccessibilityEnabled();
- static void EnableHeadlessMode( BOOL bEnable = TRUE );
- static BOOL IsHeadlessModeEnabled();
+ static void EnableHeadlessMode( sal_Bool bEnable = sal_True );
+ static sal_Bool IsHeadlessModeEnabled();
static void ShowNativeErrorBox(const String& sTitle ,
const String& sMessage);
@@ -557,6 +557,52 @@ protected:
osl::SolarMutex& m_solarMutex;
};
+class VCL_DLLPUBLIC SolarMutexResettableGuard
+{
+ SolarMutexResettableGuard( const SolarMutexResettableGuard& );
+ const SolarMutexResettableGuard& operator = ( const SolarMutexResettableGuard& );
+ bool m_bCleared;
+public:
+ /** Acquires mutex
+ @param pMutex pointer to mutex which is to be acquired */
+ SolarMutexResettableGuard()
+ : m_bCleared(false)
+ , m_solarMutex( Application::GetSolarMutex() )
+ {
+ m_solarMutex.acquire();
+ }
+
+ /** Releases mutex. */
+ virtual ~SolarMutexResettableGuard()
+ {
+ if( !m_bCleared )
+ {
+ m_solarMutex.release();
+ }
+ }
+
+ /** Releases mutex. */
+ void SAL_CALL clear()
+ {
+ if( !m_bCleared)
+ {
+ m_solarMutex.release();
+ m_bCleared = true;
+ }
+ }
+ /** Releases mutex. */
+ void SAL_CALL reset()
+ {
+ if( m_bCleared)
+ {
+ m_solarMutex.acquire();
+ m_bCleared = false;
+ }
+ }
+protected:
+ osl::SolarMutex& m_solarMutex;
+};
+
/**
A helper class that calls Application::ReleaseSolarMutex() in its constructor
@@ -564,7 +610,7 @@ protected:
*/
class SolarMutexReleaser
{
- ULONG mnReleased;
+ sal_uLong mnReleased;
const bool mbRescheduleDuringAcquire;
public:
enum
@@ -596,10 +642,10 @@ public:
VCL_DLLPUBLIC Application* GetpApp();
-VCL_DLLPUBLIC BOOL InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & );
+VCL_DLLPUBLIC sal_Bool InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & );
VCL_DLLPUBLIC void DeInitVCL();
-VCL_DLLPUBLIC BOOL InitAccessBridge( BOOL bAllowCancel, BOOL &rCancelled );
+VCL_DLLPUBLIC sal_Bool InitAccessBridge( sal_Bool bAllowCancel, sal_Bool &rCancelled );
// only allowed to call, if no thread is running. You must call JoinMainLoopThread to free all memory.
VCL_DLLPUBLIC void CreateMainLoopThread( oslWorkerFunction pWorker, void * pThreadData );
diff --git a/vcl/inc/vcl/svcompat.hxx b/vcl/inc/vcl/svcompat.hxx
index 2aa0c82ad284..70d31381287f 100644
--- a/vcl/inc/vcl/svcompat.hxx
+++ b/vcl/inc/vcl/svcompat.hxx
@@ -36,10 +36,10 @@
// -----------
#define COMPAT_FORMAT( char1, char2, char3, char4 ) \
- ((ULONG)((((ULONG)(char)(char1)))| \
- (((ULONG)(char)(char2))<<8UL)| \
- (((ULONG)(char)(char3))<<16UL)| \
- ((ULONG)(char)(char4))<<24UL))
+ ((sal_uLong)((((sal_uLong)(char)(char1)))| \
+ (((sal_uLong)(char)(char2))<<8UL)| \
+ (((sal_uLong)(char)(char3))<<16UL)| \
+ ((sal_uLong)(char)(char4))<<24UL))
class SvStream;
@@ -51,21 +51,21 @@ class SvStream;
class ImplCompat
{
SvStream* mpRWStm;
- UINT32 mnCompatPos;
- UINT32 mnTotalSize;
- UINT16 mnStmMode;
- UINT16 mnVersion;
+ sal_uInt32 mnCompatPos;
+ sal_uInt32 mnTotalSize;
+ sal_uInt16 mnStmMode;
+ sal_uInt16 mnVersion;
ImplCompat() {}
ImplCompat( const ImplCompat& rCompat ) {}
ImplCompat& operator=( const ImplCompat& rCompat ) { return *this; }
- BOOL operator==( const ImplCompat& rCompat ) { return FALSE; }
+ sal_Bool operator==( const ImplCompat& rCompat ) { return sal_False; }
public:
- ImplCompat( SvStream& rStm, USHORT nStreamMode, UINT16 nVersion = 1 );
+ ImplCompat( SvStream& rStm, sal_uInt16 nStreamMode, sal_uInt16 nVersion = 1 );
~ImplCompat();
- UINT16 GetVersion() const { return mnVersion; }
+ sal_uInt16 GetVersion() const { return mnVersion; }
};
#endif // _SV_SVCOMPAT_HXX
diff --git a/vcl/inc/vcl/svdata.hxx b/vcl/inc/vcl/svdata.hxx
index 69ac3f540b65..b28283f1a405 100644
--- a/vcl/inc/vcl/svdata.hxx
+++ b/vcl/inc/vcl/svdata.hxx
@@ -30,17 +30,21 @@
#define _SV_SVDATA_HXX
#include <osl/thread.hxx>
-#include <tools/string.hxx>
-#include <tools/gen.hxx>
-#include <tools/shl.hxx>
-#include <tools/link.hxx>
-#include <vcl/vclevent.hxx>
-#include <vcl/sv.h>
-#include <tools/color.hxx>
-#include <tools/debug.hxx>
-#include <vcl/dllapi.h>
-#include <com/sun/star/uno/Reference.hxx>
-#include <unotools/options.hxx>
+#include <rtl/ref.hxx>
+#include "tools/gen.hxx"
+#include "tools/shl.hxx"
+#include "tools/link.hxx"
+#include "tools/fldunit.hxx"
+#include "tools/string.hxx"
+#include "vcl/vclevent.hxx"
+#include "vcl/sv.h"
+#include "tools/color.hxx"
+#include "tools/debug.hxx"
+#include "vcl/dllapi.h"
+#include "com/sun/star/uno/Reference.hxx"
+#include "unotools/options.hxx"
+
+#include <boost/unordered_map.hpp>
namespace com {
namespace sun {
@@ -51,9 +55,6 @@ namespace lang {
namespace frame {
class XSessionManagerClient;
}
-namespace awt {
- class XDisplayConnection;
-}
}}}
struct ImplTimerData;
@@ -150,21 +151,23 @@ struct ImplSVAppData
ImplHotKey* mpFirstHotKey; // HotKey-Verwaltung
ImplEventHook* mpFirstEventHook; // Event-Hooks
VclEventListeners2* mpPostYieldListeners; // post yield listeners
- ULONG mnLastInputTime; // GetLastInputTime()
- USHORT mnDispatchLevel; // DispatchLevel
- USHORT mnModalMode; // ModalMode Count
- USHORT mnModalDialog; // ModalDialog Count
- USHORT mnAccessCount; // AccessHdl Count
- USHORT mnSysWinMode; // Modus, wann SystemWindows erzeugt werden sollen
- USHORT mnLayout; // --- RTL-Flags --- currently not used, only for testing
+ sal_uLong mnLastInputTime; // GetLastInputTime()
+ sal_uInt16 mnDispatchLevel; // DispatchLevel
+ sal_uInt16 mnModalMode; // ModalMode Count
+ sal_uInt16 mnModalDialog; // ModalDialog Count
+ sal_uInt16 mnAccessCount; // AccessHdl Count
+ sal_uInt16 mnSysWinMode; // Modus, wann SystemWindows erzeugt werden sollen
+ sal_uInt16 mnLayout; // --- RTL-Flags --- currently not used, only for testing
short mnDialogScaleX; // Scale X-Positions and sizes in Dialogs
- BOOL mbInAppMain; // is Application::Main() on stack
- BOOL mbInAppExecute; // is Application::Execute() on stack
- BOOL mbAppQuit; // is Application::Quit() called
- BOOL mbSettingsInit; // TRUE: Settings are initialized
- BOOL mbDialogCancel; // TRUE: Alle Dialog::Execute()-Aufrufe werden mit return FALSE sofort beendet
- BOOL mbNoYield; // Application::Yield will not wait for events if the queue is empty
+ sal_Bool mbInAppMain; // is Application::Main() on stack
+ sal_Bool mbInAppExecute; // is Application::Execute() on stack
+ sal_Bool mbAppQuit; // is Application::Quit() called
+ sal_Bool mbSettingsInit; // sal_True: Settings are initialized
+ sal_Bool mbDialogCancel; // sal_True: Alle Dialog::Execute()-Aufrufe werden mit return sal_False sofort beendet
+ sal_Bool mbNoYield; // Application::Yield will not wait for events if the queue is empty
// essentially that makes it the same as Application::Reschedule
+ long mnDefaultLayoutBorder; // default value in pixel for layout distances used
+ // in window arrangers
/** Controls whether showing any IME status window is toggled on or off.
@@ -202,10 +205,9 @@ struct ImplSVGDIData
long mnRealAppFontX; // AppFont X-Numenator for 40/tel Width
long mnAppFontX; // AppFont X-Numenator for 40/tel Width + DialogScaleX
long mnAppFontY; // AppFont Y-Numenator for 80/tel Height
- BOOL mbFontSubChanged; // TRUE: FontSubstitution wurde zwischen Begin/End geaendert
+ sal_Bool mbFontSubChanged; // sal_True: FontSubstitution wurde zwischen Begin/End geaendert
utl::DefaultFontConfiguration* mpDefaultFontConfiguration;
utl::FontSubstConfiguration* mpFontSubstConfiguration;
- bool mbPrinterPullModel; // true: use pull model instead of normal push model when printing
bool mbNativeFontConfig; // true: do not override UI font
bool mbNoXORClipping; // true: do not use XOR to achieve clipping effects
};
@@ -232,11 +234,11 @@ struct ImplSVWinData
AutoTimer* mpTrackTimer; // tracking timer
ImageList* mpMsgBoxImgList; // ImageList for MessageBox
Window* mpAutoScrollWin; // window, that is in AutoScrollMode mode
- USHORT mnTrackFlags; // tracking flags
- USHORT mnAutoScrollFlags; // auto scroll flags
- BOOL mbNoDeactivate; // TRUE: keine Deactivate durchfuehren
- BOOL mbNoSaveFocus; // TRUE: menues must not save/restore focus
- BOOL mbNoSaveBackground; // TRUE: save background is unnecessary or even less performant
+ sal_uInt16 mnTrackFlags; // tracking flags
+ sal_uInt16 mnAutoScrollFlags; // auto scroll flags
+ sal_Bool mbNoDeactivate; // sal_True: keine Deactivate durchfuehren
+ sal_Bool mbNoSaveFocus; // sal_True: menues must not save/restore focus
+ sal_Bool mbNoSaveBackground; // sal_True: save background is unnecessary or even less performant
};
@@ -244,6 +246,8 @@ struct ImplSVWinData
// - ImplSVCtrlData -
// ------------------
+typedef std::vector< std::pair< String, FieldUnit > > FieldUnitStringList;
+
struct ImplSVCtrlData
{
ImageList* mpCheckImgList; // ImageList for CheckBoxes
@@ -256,15 +260,17 @@ struct ImplSVCtrlData
Image* mpDisclosurePlus;
Image* mpDisclosureMinus;
ImplTBDragMgr* mpTBDragMgr; // DragMgr for ToolBox
- USHORT mnCheckStyle; // CheckBox-Style for ImageList-Update
- USHORT mnRadioStyle; // Radio-Style for ImageList-Update
- ULONG mnLastCheckFColor; // Letzte FaceColor fuer CheckImage
- ULONG mnLastCheckWColor; // Letzte WindowColor fuer CheckImage
- ULONG mnLastCheckWTextColor; // Letzte WindowTextColor fuer CheckImage
- ULONG mnLastCheckLColor; // Letzte LightColor fuer CheckImage
- ULONG mnLastRadioFColor; // Letzte FaceColor fuer RadioImage
- ULONG mnLastRadioWColor; // Letzte WindowColor fuer RadioImage
- ULONG mnLastRadioLColor; // Letzte LightColor fuer RadioImage
+ sal_uInt16 mnCheckStyle; // CheckBox-Style for ImageList-Update
+ sal_uInt16 mnRadioStyle; // Radio-Style for ImageList-Update
+ sal_uLong mnLastCheckFColor; // Letzte FaceColor fuer CheckImage
+ sal_uLong mnLastCheckWColor; // Letzte WindowColor fuer CheckImage
+ sal_uLong mnLastCheckWTextColor; // Letzte WindowTextColor fuer CheckImage
+ sal_uLong mnLastCheckLColor; // Letzte LightColor fuer CheckImage
+ sal_uLong mnLastRadioFColor; // Letzte FaceColor fuer RadioImage
+ sal_uLong mnLastRadioWColor; // Letzte WindowColor fuer RadioImage
+ sal_uLong mnLastRadioLColor; // Letzte LightColor fuer RadioImage
+ FieldUnitStringList* mpFieldUnitStrings; // list with field units
+ FieldUnitStringList* mpCleanUnitStrings; // same list but with some "fluff" like spaces removed
};
@@ -274,18 +280,18 @@ struct ImplSVCtrlData
struct ImplSVHelpData
{
- BOOL mbContextHelp : 1; // is ContextHelp enabled
- BOOL mbExtHelp : 1; // is ExtendedHelp enabled
- BOOL mbExtHelpMode : 1; // is in ExtendedHelp Mode
- BOOL mbOldBalloonMode : 1; // BallonMode, befor ExtHelpMode started
- BOOL mbBalloonHelp : 1; // is BalloonHelp enabled
- BOOL mbQuickHelp : 1; // is QuickHelp enabled
- BOOL mbSetKeyboardHelp : 1; // tiphelp was activated by keyboard
- BOOL mbKeyboardHelp : 1; // tiphelp was activated by keyboard
- BOOL mbAutoHelpId : 1; // generate HelpIds
- BOOL mbRequestingHelp : 1; // In Window::RequestHelp
+ sal_Bool mbContextHelp : 1; // is ContextHelp enabled
+ sal_Bool mbExtHelp : 1; // is ExtendedHelp enabled
+ sal_Bool mbExtHelpMode : 1; // is in ExtendedHelp Mode
+ sal_Bool mbOldBalloonMode : 1; // BallonMode, befor ExtHelpMode started
+ sal_Bool mbBalloonHelp : 1; // is BalloonHelp enabled
+ sal_Bool mbQuickHelp : 1; // is QuickHelp enabled
+ sal_Bool mbSetKeyboardHelp : 1; // tiphelp was activated by keyboard
+ sal_Bool mbKeyboardHelp : 1; // tiphelp was activated by keyboard
+ sal_Bool mbAutoHelpId : 1; // generate HelpIds
+ sal_Bool mbRequestingHelp : 1; // In Window::RequestHelp
HelpTextWindow* mpHelpWin; // HelpWindow
- ULONG mnLastHelpHideTime; // ticks of last show
+ sal_uLong mnLastHelpHideTime; // ticks of last show
};
struct ImplSVNWFData
@@ -312,10 +318,8 @@ struct ImplSVNWFData
// window background before drawing the native
// checkbox
bool mbScrollbarJumpPage; // true for "jump to here" behavior
+ int mnStatusBarLowerRightOffset; // amount in pixel to avoid in the lower righthand corner
bool mbCanDrawWidgetAnySize; // set to true currently on gtk
- // signals that widgets can be drawn in any size and
- // brdwin.cxx ImplSmallBorderWindowView::DrawWindow
- // should not do GetNativeControlRegion
};
@@ -329,18 +333,18 @@ struct ImplSVData
SalInstance* mpDefInst; // Default SalInstance
Application* mpApp; // pApp
WorkWindow* mpDefaultWin; // Default-Window
- BOOL mbDeInit; // Is VCL deinitializing
- ULONG mnThreadCount; // is VCL MultiThread enabled
+ sal_Bool mbDeInit; // Is VCL deinitializing
+ sal_uLong mnThreadCount; // is VCL MultiThread enabled
ImplConfigData* mpFirstConfigData; // Zeiger auf ersten Config-Block
ImplTimerData* mpFirstTimerData; // list of all running timers
SalTimer* mpSalTimer; // interface to sal event loop/timers
SalI18NImeStatus* mpImeStatus; // interface to ime status window
SalSystem* mpSalSystem; // SalSystem interface
ResMgr* mpResMgr; // SV-Resource-Manager
- ULONG mnTimerPeriod; // current timer period
- ULONG mnTimerUpdate; // TimerCallbackProcs on stack
- BOOL mbNotAllTimerCalled;// TRUE: Es muessen noch Timer abgearbeitet werden
- BOOL mbNoCallTimer; // TRUE: No Timeout calls
+ sal_uLong mnTimerPeriod; // current timer period
+ sal_uLong mnTimerUpdate; // TimerCallbackProcs on stack
+ sal_Bool mbNotAllTimerCalled;// sal_True: Es muessen noch Timer abgearbeitet werden
+ sal_Bool mbNoCallTimer; // sal_True: No Timeout calls
ImplSVAppData maAppData; // indepen data for class Application
ImplSVGDIData maGDIData; // indepen data for Output classes
ImplSVWinData maWinData; // indepen data for Windows classes
@@ -350,24 +354,24 @@ struct ImplSVData
UnoWrapperBase* mpUnoWrapper;
Window* mpIntroWindow; // the splash screen
DockingManager* mpDockingManager;
- BOOL mbIsTestTool;
+ sal_Bool mbIsTestTool;
oslThreadIdentifier mnMainThreadId;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::awt::XDisplayConnection > mxDisplayConnection;
+ rtl::Reference< vcl::DisplayConnection > mxDisplayConnection;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxAccessBridge;
com::sun::star::uno::Reference< com::sun::star::frame::XSessionManagerClient > xSMClient;
::vcl::SettingsConfigItem* mpSettingsConfigItem;
std::list< vcl::DeleteOnDeinitBase* >* mpDeinitDeleteList;
+ boost::unordered_map< int, rtl::OUString >* mpPaperNames;
};
void ImplInitSVData();
void ImplDeInitSVData();
void ImplDestroySVData();
Window* ImplGetDefaultWindow();
-VCL_DLLPUBLIC ResMgr* ImplGetResMgr();
-VCL_DLLPUBLIC ResId VclResId( sal_Int32 nId ); // throws std::bad_alloc if no res mgr
+VCL_PLUGIN_PUBLIC ResMgr* ImplGetResMgr();
+VCL_PLUGIN_PUBLIC ResId VclResId( sal_Int32 nId ); // throws std::bad_alloc if no res mgr
DockingManager* ImplGetDockingManager();
void ImplWindowAutoMnemonic( Window* pWindow );
@@ -375,7 +379,7 @@ void ImplUpdateSystemProcessWindow();
Window* ImplFindWindow( const SalFrame* pFrame, Point& rSalFramePos );
// SVAPP.CXX
-BOOL ImplCallHotKey( const KeyCode& rKeyCode );
+sal_Bool ImplCallHotKey( const KeyCode& rKeyCode );
void ImplFreeHotKeyData();
void ImplFreeEventHookData();
@@ -383,11 +387,15 @@ void ImplFreeEventHookData();
long ImplCallPreNotify( NotifyEvent& rEvt );
long ImplCallEvent( NotifyEvent& rEvt );
-extern VCL_DLLPUBLIC ImplSVData* pImplSVData;
-inline VCL_DLLPUBLIC ImplSVData* ImplGetSVData() { return pImplSVData; }
+extern VCL_PLUGIN_PUBLIC ImplSVData* pImplSVData;
+inline VCL_PLUGIN_PUBLIC ImplSVData* ImplGetSVData() { return pImplSVData; }
inline ImplSVData* ImplGetAppSVData() { return ImplGetSVData(); }
-bool ImplInitAccessBridge( BOOL bAllowCancel, BOOL &rCancelled );
+bool ImplInitAccessBridge( sal_Bool bAllowCancel, sal_Bool &rCancelled );
+
+FieldUnitStringList* ImplGetFieldUnits();
+FieldUnitStringList* ImplGetCleanedFieldUnits();
+
// -----------------------------------------------------------------------
@@ -415,20 +423,20 @@ struct ImplDelData
{
ImplDelData* mpNext;
const Window* mpWindow;
- BOOL mbDel;
+ sal_Bool mbDel;
ImplDelData( const Window* pWindow = NULL )
- : mpNext( NULL ), mpWindow( NULL ), mbDel( FALSE )
+ : mpNext( NULL ), mpWindow( NULL ), mbDel( sal_False )
{ if( pWindow ) AttachToWindow( pWindow ); }
virtual ~ImplDelData();
bool IsDead() const
{
- DBG_ASSERT( mbDel == FALSE, "object deleted while in use !" );
- return (mbDel!=FALSE);
+ DBG_ASSERT( mbDel == sal_False, "object deleted while in use !" );
+ return (mbDel!=sal_False);
}
- BOOL /*deprecated */IsDelete() const { return (BOOL)IsDead(); }
+ sal_Bool /*deprecated */IsDelete() const { return (sal_Bool)IsDead(); }
private:
void AttachToWindow( const Window* );
@@ -440,12 +448,12 @@ private:
struct ImplSVEvent
{
- ULONG mnEvent;
+ sal_uLong mnEvent;
void* mpData;
Link* mpLink;
Window* mpWindow;
ImplDelData maDelData;
- BOOL mbCall;
+ sal_Bool mbCall;
};
#endif // _SV_SVDATA_HXX
diff --git a/vcl/inc/vcl/svids.hrc b/vcl/inc/vcl/svids.hrc
index 50e334deaa3b..bc76c70e1ebe 100644
--- a/vcl/inc/vcl/svids.hrc
+++ b/vcl/inc/vcl/svids.hrc
@@ -31,11 +31,7 @@
#include "svl/solar.hrc"
#define SV_RESID_STDOFFSET 0
-#define SV_RESID_WINOFFSET 1
-#define SV_RESID_OS2OFFSET 2
-#define SV_RESID_MACOFFSET 3
-#define SV_RESID_UNIXOFFSET 4
-#define SV_RESID_MONOOFFSET 5
+#define SV_RESID_MONOOFFSET 1
// Achtung: Diese Id's muessen min. 10 Werte auseinanderliegen, da
// je nach Style noch ein Offset aufgerechnet wird
@@ -58,6 +54,8 @@
#define SV_DISCLOSURE_PLUS 1060
#define SV_DISCLOSURE_MINUS 1061
+#define RID_STR_PAPERNAMES 1070
+
#define SV_RESID_MENU_EDIT 2000
#define SV_MENU_EDIT_UNDO 1
#define SV_MENU_EDIT_CUT 2
@@ -118,8 +116,10 @@
#define SV_PRINT_PRT_NUP_ORIENTATION_PORTRAIT 1
#define SV_PRINT_PRT_NUP_ORIENTATION_LANDSCAPE 2
-#define SV_PRINT_PRT_NUP_ORDER_LRTD 0
-#define SV_PRINT_PRT_NUP_ORDER_TDLR 1
+#define SV_PRINT_PRT_NUP_ORDER_LRTB 0
+#define SV_PRINT_PRT_NUP_ORDER_TBLR 1
+#define SV_PRINT_PRT_NUP_ORDER_TBRL 2
+#define SV_PRINT_PRT_NUP_ORDER_RLTB 3
#define SV_PRINT_TAB_JOB 2
#define SV_PRINT_PRINTERS_FL 1
@@ -143,12 +143,12 @@
#define SV_PRINT_LOCATION_TXT 21
#define SV_PRINT_COMMENT_TXT 22
#define SV_PRINT_DETAILS_BTN 23
+#define SV_PRINT_OPT_REVERSE 24
#define SV_PRINT_TAB_OPT 3
#define SV_PRINT_OPT_PRINT_FL 1
#define SV_PRINT_OPT_TOFILE 2
#define SV_PRINT_OPT_SINGLEJOBS 3
-#define SV_PRINT_OPT_REVERSE 4
#define SV_DLG_PRINT_PROGRESS 2049
#define SV_PRINT_PROGRESS_CANCEL 1
@@ -206,7 +206,8 @@
#define SV_ACCESSERROR_JAVA_NOT_CONFIGURED 10507
#define SV_ACCESSERROR_JAVA_DISABLED 10508
#define SV_ACCESSERROR_TURNAROUND_MSG 10509
-#define SV_ACCESSERROR_LAST SV_ACCESSERROR_TURNAROUND_MSG
+#define SV_ACCESSERROR_NO_FONTS 10510
+#define SV_ACCESSERROR_LAST SV_ACCESSERROR_NO_FONTS
#define SV_SHORTCUT_HELP 10600
#define SV_SHORTCUT_CONTEXTHELP 10601
diff --git a/vcl/inc/vcl/symbol.hxx b/vcl/inc/vcl/symbol.hxx
index cb7074986911..c03bf9a6af58 100644
--- a/vcl/inc/vcl/symbol.hxx
+++ b/vcl/inc/vcl/symbol.hxx
@@ -36,7 +36,7 @@
// ----------------
// By changes you must also change: rsc/vclrsc.hxx
-typedef USHORT SymbolType;
+typedef sal_uInt16 SymbolType;
#define SYMBOL_DONTKNOW ((SymbolType)0)
#define SYMBOL_IMAGE ((SymbolType)1)
#define SYMBOL_ARROW_UP ((SymbolType)2)
@@ -72,9 +72,6 @@ typedef USHORT SymbolType;
#define SYMBOL_DOCK ((SymbolType)32)
#define SYMBOL_HIDE ((SymbolType)33)
#define SYMBOL_HELP ((SymbolType)34)
-#define SYMBOL_OS2CLOSE ((SymbolType)35)
-#define SYMBOL_OS2FLOAT ((SymbolType)36)
-#define SYMBOL_OS2HIDE ((SymbolType)37)
#define SYMBOL_MENU SYMBOL_SPIN_DOWN
#define SYMBOL_NOSYMBOL (SYMBOL_DONTKNOW)
diff --git a/vcl/inc/vcl/syschild.hxx b/vcl/inc/vcl/syschild.hxx
index 459f97e68abd..275e41312f17 100644
--- a/vcl/inc/vcl/syschild.hxx
+++ b/vcl/inc/vcl/syschild.hxx
@@ -44,7 +44,8 @@ class VCL_DLLPUBLIC SystemChildWindow : public Window
{
private:
using Window::ImplInit;
- SAL_DLLPRIVATE void ImplInitSysChild( Window* pParent, WinBits nStyle, SystemWindowData *pData, BOOL bShow = FALSE );
+ SAL_DLLPRIVATE void ImplInitSysChild( Window* pParent, WinBits nStyle, SystemWindowData *pData, sal_Bool bShow = sal_False );
+ SAL_DLLPRIVATE void ImplTestJavaException( void* pEnv );
// Copy assignment is forbidden and not implemented.
SAL_DLLPRIVATE SystemChildWindow (const SystemChildWindow &);
@@ -53,7 +54,7 @@ private:
public:
SystemChildWindow( Window* pParent, WinBits nStyle = 0 );
// create a SystemChildWindow using the given SystemWindowData
- SystemChildWindow( Window* pParent, WinBits nStyle, SystemWindowData *pData, BOOL bShow = TRUE );
+ SystemChildWindow( Window* pParent, WinBits nStyle, SystemWindowData *pData, sal_Bool bShow = sal_True );
SystemChildWindow( Window* pParent, const ResId& rResId );
~SystemChildWindow();
@@ -61,9 +62,13 @@ public:
// per default systemchildwindows erase their background for better plugin support
// however, this might not always be required
- void EnableEraseBackground( BOOL bEnable = TRUE );
- BOOL IsEraseBackgroundEnabled();
- void SetForwardKey( BOOL bEnable );
+ void EnableEraseBackground( sal_Bool bEnable = sal_True );
+ sal_Bool IsEraseBackgroundEnabled();
+ void SetForwardKey( sal_Bool bEnable );
+ // return the platform specific handle/id of this window;
+ // in case the flag bUseJava is set, a java compatible overlay window
+ // is created on which other java windows can be created (plugin interface)
+ sal_IntPtr GetParentWindowHandle( sal_Bool bUseJava = sal_False );
};
#endif // _SV_SYSCHILD_HXX
diff --git a/vcl/inc/vcl/sysdata.hxx b/vcl/inc/vcl/sysdata.hxx
index b25a1275673e..120ba30f4dff 100644
--- a/vcl/inc/vcl/sysdata.hxx
+++ b/vcl/inc/vcl/sysdata.hxx
@@ -181,6 +181,7 @@ struct SystemFontData
// --------------------
typedef std::vector<SystemGlyphData> SystemGlyphDataVector;
+
struct SystemTextLayoutData
{
unsigned long nSize; // size in bytes of this structure
diff --git a/vcl/inc/vcl/syswin.hxx b/vcl/inc/vcl/syswin.hxx
index dcc287a4e2cc..0fd2fd8d1512 100644
--- a/vcl/inc/vcl/syswin.hxx
+++ b/vcl/inc/vcl/syswin.hxx
@@ -66,27 +66,27 @@ class TaskPaneList;
// - WindowStateData -
// -------------------
-#define WINDOWSTATE_MASK_X ((ULONG)0x00000001)
-#define WINDOWSTATE_MASK_Y ((ULONG)0x00000002)
-#define WINDOWSTATE_MASK_WIDTH ((ULONG)0x00000004)
-#define WINDOWSTATE_MASK_HEIGHT ((ULONG)0x00000008)
-#define WINDOWSTATE_MASK_STATE ((ULONG)0x00000010)
-#define WINDOWSTATE_MASK_MINIMIZED ((ULONG)0x00000020)
-#define WINDOWSTATE_MASK_MAXIMIZED_X ((ULONG)0x00000100)
-#define WINDOWSTATE_MASK_MAXIMIZED_Y ((ULONG)0x00000200)
-#define WINDOWSTATE_MASK_MAXIMIZED_WIDTH ((ULONG)0x00000400)
-#define WINDOWSTATE_MASK_MAXIMIZED_HEIGHT ((ULONG)0x00000800)
+#define WINDOWSTATE_MASK_X ((sal_uLong)0x00000001)
+#define WINDOWSTATE_MASK_Y ((sal_uLong)0x00000002)
+#define WINDOWSTATE_MASK_WIDTH ((sal_uLong)0x00000004)
+#define WINDOWSTATE_MASK_HEIGHT ((sal_uLong)0x00000008)
+#define WINDOWSTATE_MASK_STATE ((sal_uLong)0x00000010)
+#define WINDOWSTATE_MASK_MINIMIZED ((sal_uLong)0x00000020)
+#define WINDOWSTATE_MASK_MAXIMIZED_X ((sal_uLong)0x00000100)
+#define WINDOWSTATE_MASK_MAXIMIZED_Y ((sal_uLong)0x00000200)
+#define WINDOWSTATE_MASK_MAXIMIZED_WIDTH ((sal_uLong)0x00000400)
+#define WINDOWSTATE_MASK_MAXIMIZED_HEIGHT ((sal_uLong)0x00000800)
#define WINDOWSTATE_MASK_POS (WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y)
#define WINDOWSTATE_MASK_ALL (WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y | WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT | WINDOWSTATE_MASK_MAXIMIZED_X | WINDOWSTATE_MASK_MAXIMIZED_Y | WINDOWSTATE_MASK_MAXIMIZED_WIDTH | WINDOWSTATE_MASK_MAXIMIZED_HEIGHT | WINDOWSTATE_MASK_STATE | WINDOWSTATE_MASK_MINIMIZED)
-#define WINDOWSTATE_STATE_NORMAL ((ULONG)0x00000001)
-#define WINDOWSTATE_STATE_MINIMIZED ((ULONG)0x00000002)
-#define WINDOWSTATE_STATE_MAXIMIZED ((ULONG)0x00000004)
-#define WINDOWSTATE_STATE_ROLLUP ((ULONG)0x00000008)
-#define WINDOWSTATE_STATE_MAXIMIZED_HORZ ((ULONG)0x00000010)
-#define WINDOWSTATE_STATE_MAXIMIZED_VERT ((ULONG)0x00000020)
+#define WINDOWSTATE_STATE_NORMAL ((sal_uLong)0x00000001)
+#define WINDOWSTATE_STATE_MINIMIZED ((sal_uLong)0x00000002)
+#define WINDOWSTATE_STATE_MAXIMIZED ((sal_uLong)0x00000004)
+#define WINDOWSTATE_STATE_ROLLUP ((sal_uLong)0x00000008)
+#define WINDOWSTATE_STATE_MAXIMIZED_HORZ ((sal_uLong)0x00000010)
+#define WINDOWSTATE_STATE_MAXIMIZED_VERT ((sal_uLong)0x00000020)
-class VCL_DLLPUBLIC WindowStateData
+class VCL_PLUGIN_PUBLIC WindowStateData
{
private:
sal_uInt32 mnValidMask;
@@ -107,7 +107,7 @@ public:
mnMaximizedX = mnMaximizedY = mnMaximizedWidth = mnMaximizedHeight = 0;
}
- void SetMask( ULONG nValidMask ) { mnValidMask = nValidMask; }
+ void SetMask( sal_uLong nValidMask ) { mnValidMask = nValidMask; }
sal_uInt32 GetMask() const { return mnValidMask; }
void SetX( int nX ) { mnX = nX; }
@@ -134,12 +134,12 @@ public:
// - SystemWindow-Types -
// ----------------------
-#define MENUBAR_MODE_NORMAL ((USHORT)0)
-#define MENUBAR_MODE_HIDE ((USHORT)1)
+#define MENUBAR_MODE_NORMAL ((sal_uInt16)0)
+#define MENUBAR_MODE_HIDE ((sal_uInt16)1)
-#define TITLE_BUTTON_DOCKING ((USHORT)1)
-#define TITLE_BUTTON_HIDE ((USHORT)2)
-#define TITLE_BUTTON_MENU ((USHORT)4)
+#define TITLE_BUTTON_DOCKING ((sal_uInt16)1)
+#define TITLE_BUTTON_HIDE ((sal_uInt16)2)
+#define TITLE_BUTTON_MENU ((sal_uInt16)4)
// ----------------
// - SystemWindow -
@@ -156,20 +156,20 @@ private:
Size maOrgSize;
Size maRollUpOutSize;
Size maMinOutSize;
- BOOL mbPined;
- BOOL mbRollUp;
- BOOL mbRollFunc;
- BOOL mbDockBtn;
- BOOL mbHideBtn;
- BOOL mbSysChild;
- USHORT mnMenuBarMode;
- USHORT mnIcon;
+ sal_Bool mbPined;
+ sal_Bool mbRollUp;
+ sal_Bool mbRollFunc;
+ sal_Bool mbDockBtn;
+ sal_Bool mbHideBtn;
+ sal_Bool mbSysChild;
+ sal_uInt16 mnMenuBarMode;
+ sal_uInt16 mnIcon;
ImplData* mpImplData;
#if _SOLAR__PRIVATE
public:
using Window::ImplIsInTaskPaneList;
- SAL_DLLPRIVATE BOOL ImplIsInTaskPaneList( Window* pWin );
+ SAL_DLLPRIVATE sal_Bool ImplIsInTaskPaneList( Window* pWin );
#endif
private:
@@ -193,34 +193,34 @@ public:
virtual long Notify( NotifyEvent& rNEvt );
virtual long PreNotify( NotifyEvent& rNEvt );
- virtual BOOL Close();
- virtual void TitleButtonClick( USHORT nButton );
+ virtual sal_Bool Close();
+ virtual void TitleButtonClick( sal_uInt16 nButton );
virtual void Pin();
virtual void Roll();
virtual void Resizing( Size& rSize );
- void SetIcon( USHORT nIcon );
- USHORT GetIcon() const { return mnIcon; }
+ void SetIcon( sal_uInt16 nIcon );
+ sal_uInt16 GetIcon() const { return mnIcon; }
// for systems like MacOSX which can display the URL a document is loaded from
// separately from the window title
void SetRepresentedURL( const rtl::OUString& );
const rtl::OUString& GetRepresentedURL() const;
- void SetZLevel( BYTE nLevel );
- BYTE GetZLevel() const;
+ void SetZLevel( sal_uInt8 nLevel );
+ sal_uInt8 GetZLevel() const;
- void EnableSaveBackground( BOOL bSave = TRUE );
- BOOL IsSaveBackgroundEnabled() const;
+ void EnableSaveBackground( sal_Bool bSave = sal_True );
+ sal_Bool IsSaveBackgroundEnabled() const;
- void ShowTitleButton( USHORT nButton, BOOL bVisible = TRUE );
- BOOL IsTitleButtonVisible( USHORT nButton ) const;
+ void ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible = sal_True );
+ sal_Bool IsTitleButtonVisible( sal_uInt16 nButton ) const;
- void SetPin( BOOL bPin );
- BOOL IsPined() const { return mbPined; }
+ void SetPin( sal_Bool bPin );
+ sal_Bool IsPined() const { return mbPined; }
void RollUp();
void RollDown();
- BOOL IsRollUp() const { return mbRollUp; }
+ sal_Bool IsRollUp() const { return mbRollUp; }
void SetRollUpOutputSizePixel( const Size& rSize ) { maRollUpOutSize = rSize; }
Size GetRollUpOutputSizePixel() const { return maRollUpOutSize; }
@@ -232,12 +232,12 @@ public:
Size GetResizeOutputSizePixel() const;
void SetWindowState( const ByteString& rStr );
- ByteString GetWindowState( ULONG nMask = WINDOWSTATE_MASK_ALL ) const;
+ ByteString GetWindowState( sal_uLong nMask = WINDOWSTATE_MASK_ALL ) const;
void SetMenuBar( MenuBar* pMenuBar );
MenuBar* GetMenuBar() const { return mpMenuBar; }
- void SetMenuBarMode( USHORT nMode );
- USHORT GetMenuBarMode() const { return mnMenuBarMode; }
+ void SetMenuBarMode( sal_uInt16 nMode );
+ sal_uInt16 GetMenuBarMode() const { return mnMenuBarMode; }
TaskPaneList* GetTaskPaneList();
void GetWindowStateData( WindowStateData& rData ) const;
diff --git a/vcl/inc/vcl/tabctrl.hxx b/vcl/inc/vcl/tabctrl.hxx
index 5463246ec8a0..c6525138f73b 100644
--- a/vcl/inc/vcl/tabctrl.hxx
+++ b/vcl/inc/vcl/tabctrl.hxx
@@ -45,8 +45,8 @@ class ListBox;
// --------------------
#ifndef TAB_APPEND
-#define TAB_APPEND ((USHORT)0xFFFF)
-#define TAB_PAGE_NOTFOUND ((USHORT)0xFFFF)
+#define TAB_APPEND ((sal_uInt16)0xFFFF)
+#define TAB_PAGE_NOTFOUND ((sal_uInt16)0xFFFF)
#endif /* !TAB_APPEND */
// --------------
@@ -62,40 +62,30 @@ private:
long mnLastHeight;
long mnBtnSize;
long mnMaxPageWidth;
- USHORT mnActPageId;
- USHORT mnCurPageId;
- USHORT mnFirstPagePos;
- USHORT mnLastFirstPagePos;
- BOOL mbFormat;
- BOOL mbRestoreHelpId;
- BOOL mbRestoreUnqId;
- BOOL mbSingleLine;
- BOOL mbScroll;
- BOOL mbRestoreSmartId;
- BOOL mbSmallInvalidate;
- BOOL mbExtraSpace;
+ sal_uInt16 mnActPageId;
+ sal_uInt16 mnCurPageId;
+ sal_Bool mbFormat;
+ sal_Bool mbRestoreHelpId;
+ sal_Bool mbRestoreUnqId;
+ sal_Bool mbSmallInvalidate;
+ sal_Bool mbExtraSpace;
Link maActivateHdl;
Link maDeactivateHdl;
using Control::ImplInitSettings;
- SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
- SAL_DLLPRIVATE ImplTabItem* ImplGetItem( USHORT nId ) const;
- SAL_DLLPRIVATE void ImplScrollBtnsColor();
- SAL_DLLPRIVATE void ImplSetScrollBtnsState();
- SAL_DLLPRIVATE void ImplPosScrollBtns();
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE ImplTabItem* ImplGetItem( sal_uInt16 nId ) const;
SAL_DLLPRIVATE Size ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth );
- SAL_DLLPRIVATE Rectangle ImplGetTabRect( USHORT nPos, long nWidth = -1, long nHeight = -1 );
- SAL_DLLPRIVATE void ImplChangeTabPage( USHORT nId, USHORT nOldId );
- SAL_DLLPRIVATE BOOL ImplPosCurTabPage();
- SAL_DLLPRIVATE void ImplActivateTabPage( BOOL bNext );
- SAL_DLLPRIVATE void ImplSetFirstPagePos( USHORT nPagePos );
+ SAL_DLLPRIVATE Rectangle ImplGetTabRect( sal_uInt16 nPos, long nWidth = -1, long nHeight = -1 );
+ SAL_DLLPRIVATE void ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId );
+ SAL_DLLPRIVATE sal_Bool ImplPosCurTabPage();
+ SAL_DLLPRIVATE void ImplActivateTabPage( sal_Bool bNext );
SAL_DLLPRIVATE void ImplShowFocus();
SAL_DLLPRIVATE void ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bool bLayout = false, bool bFirstInGroup = false, bool bLastInGroup = false, bool bIsCurrentItem = false );
SAL_DLLPRIVATE void ImplPaint( const Rectangle& rRect, bool bLayout = false );
SAL_DLLPRIVATE void ImplFreeLayoutData();
SAL_DLLPRIVATE long ImplHandleKeyEvent( const KeyEvent& rKeyEvent );
- DECL_DLLPRIVATE_LINK( ImplScrollBtnHdl, PushButton* pBtn );
DECL_DLLPRIVATE_LINK( ImplListBoxSelectHdl, ListBox* );
DECL_DLLPRIVATE_LINK( ImplWindowEventListener, VclSimpleEvent* );
@@ -144,55 +134,52 @@ public:
Point GetItemsOffset() const;
void InsertPage( const ResId& rResId,
- USHORT nPos = TAB_APPEND );
- void InsertPage( USHORT nPageId, const XubString& rText,
- USHORT nPos = TAB_APPEND );
- void RemovePage( USHORT nPageId );
+ sal_uInt16 nPos = TAB_APPEND );
+ void InsertPage( sal_uInt16 nPageId, const XubString& rText,
+ sal_uInt16 nPos = TAB_APPEND );
+ void RemovePage( sal_uInt16 nPageId );
void Clear();
- void EnablePage( USHORT nPageId, bool bEnable = true );
+ void EnablePage( sal_uInt16 nPageId, bool bEnable = true );
- USHORT GetPageCount() const;
- USHORT GetPageId( USHORT nPos ) const;
- USHORT GetPagePos( USHORT nPageId ) const;
- USHORT GetPageId( const Point& rPos ) const;
+ sal_uInt16 GetPageCount() const;
+ sal_uInt16 GetPageId( sal_uInt16 nPos ) const;
+ sal_uInt16 GetPagePos( sal_uInt16 nPageId ) const;
+ sal_uInt16 GetPageId( const Point& rPos ) const;
- void SetCurPageId( USHORT nPageId );
- USHORT GetCurPageId() const;
+ void SetCurPageId( sal_uInt16 nPageId );
+ sal_uInt16 GetCurPageId() const;
- void SetFirstPageId( USHORT nPageId );
- USHORT GetFirstPageId() const { return GetPageId( mnFirstPagePos ); }
-
- void SelectTabPage( USHORT nPageId );
+ void SelectTabPage( sal_uInt16 nPageId );
void SetMaxPageWidth( long nMaxWidth ) { mnMaxPageWidth = nMaxWidth; }
long GetMaxPageWidth() const { return mnMaxPageWidth; }
void ResetMaxPageWidth() { SetMaxPageWidth( 0 ); }
- BOOL IsMaxPageWidth() const { return mnMaxPageWidth != 0; }
+ sal_Bool IsMaxPageWidth() const { return mnMaxPageWidth != 0; }
- void SetTabPage( USHORT nPageId, TabPage* pPage );
- TabPage* GetTabPage( USHORT nPageId ) const;
- USHORT GetTabPageResId( USHORT nPageId ) const;
+ void SetTabPage( sal_uInt16 nPageId, TabPage* pPage );
+ TabPage* GetTabPage( sal_uInt16 nPageId ) const;
+ sal_uInt16 GetTabPageResId( sal_uInt16 nPageId ) const;
- void SetPageText( USHORT nPageId, const XubString& rText );
- XubString GetPageText( USHORT nPageId ) const;
+ void SetPageText( sal_uInt16 nPageId, const XubString& rText );
+ XubString GetPageText( sal_uInt16 nPageId ) const;
- void SetHelpText( USHORT nPageId, const XubString& rText );
- const XubString& GetHelpText( USHORT nPageId ) const;
+ void SetHelpText( sal_uInt16 nPageId, const XubString& rText );
+ const XubString& GetHelpText( sal_uInt16 nPageId ) const;
- void SetHelpId( USHORT nPageId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nPageId ) const;
+ void SetHelpId( sal_uInt16 nPageId, const rtl::OString& rHelpId );
+ rtl::OString GetHelpId( sal_uInt16 nPageId ) const;
- void SetPageImage( USHORT nPageId, const Image& rImage );
- const Image* GetPageImage( USHORT nPageId ) const;
+ void SetPageImage( sal_uInt16 nPageId, const Image& rImage );
+ const Image* GetPageImage( sal_uInt16 nPageId ) const;
void SetHelpText( const XubString& rText )
{ Control::SetHelpText( rText ); }
const XubString& GetHelpText() const
{ return Control::GetHelpText(); }
- void SetHelpId( ULONG nId )
- { Control::SetHelpId( nId ); }
- ULONG GetHelpId() const
+ void SetHelpId( const rtl::OString& rId )
+ { Control::SetHelpId( rId ); }
+ const rtl::OString& GetHelpId() const
{ return Control::GetHelpId(); }
void SetActivatePageHdl( const Link& rLink ) { maActivateHdl = rLink; }
@@ -203,19 +190,19 @@ public:
// returns (control relative) bounding rectangle for the
// character at index nIndex relative to the text of page nPageId
using Control::GetCharacterBounds;
- Rectangle GetCharacterBounds( USHORT nPageId, long nIndex ) const;
+ Rectangle GetCharacterBounds( sal_uInt16 nPageId, long nIndex ) const;
// returns the index relative to the text of page nPageId (also returned)
// at position rPoint (control relative)
using Control::GetIndexForPoint;
- long GetIndexForPoint( const Point& rPoint, USHORT& rPageId ) const;
+ long GetIndexForPoint( const Point& rPoint, sal_uInt16& rPageId ) const;
// returns the bounding rectangle of the union of tab page area and the
// corresponding tab
- Rectangle GetTabPageBounds( USHORT nPageId ) const;
+ Rectangle GetTabPageBounds( sal_uInt16 nPageId ) const;
// returns the rectangle of the tab for page nPageId
- Rectangle GetTabBounds( USHORT nPageId ) const;
+ Rectangle GetTabBounds( sal_uInt16 nPageId ) const;
};
#endif // _SV_TABCTRL_HXX
diff --git a/vcl/inc/vcl/tabdlg.hxx b/vcl/inc/vcl/tabdlg.hxx
index 51591522d8e5..0b654b409f33 100644
--- a/vcl/inc/vcl/tabdlg.hxx
+++ b/vcl/inc/vcl/tabdlg.hxx
@@ -46,7 +46,7 @@ private:
FixedLine* mpFixedLine;
Window* mpViewWindow;
WindowAlign meViewAlign;
- BOOL mbPosControls;
+ sal_Bool mbPosControls;
SAL_DLLPRIVATE void ImplInitTabDialogData();
SAL_DLLPRIVATE void ImplPosControls();
diff --git a/vcl/inc/vcl/tabpage.hxx b/vcl/inc/vcl/tabpage.hxx
index c385583e6ad7..92a00f892845 100644
--- a/vcl/inc/vcl/tabpage.hxx
+++ b/vcl/inc/vcl/tabpage.hxx
@@ -49,7 +49,7 @@ public:
TabPage( Window* pParent, const ResId& rResId );
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void StateChanged( StateChangedType nStateChange );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
diff --git a/vcl/inc/vcl/taskpanelist.hxx b/vcl/inc/vcl/taskpanelist.hxx
index 0eb4f20cd97d..102f755554f2 100644
--- a/vcl/inc/vcl/taskpanelist.hxx
+++ b/vcl/inc/vcl/taskpanelist.hxx
@@ -37,12 +37,12 @@
class VCL_DLLPUBLIC TaskPaneList
{
::std::vector<Window *> mTaskPanes;
- Window *FindNextPane( Window *pWindow, BOOL bForward = TRUE );
- Window *FindNextFloat( Window *pWindow, BOOL bForward = TRUE );
- Window *FindNextSplitter( Window *pWindow, BOOL bForward = TRUE );
+ Window *FindNextPane( Window *pWindow, sal_Bool bForward = sal_True );
+ Window *FindNextFloat( Window *pWindow, sal_Bool bForward = sal_True );
+ Window *FindNextSplitter( Window *pWindow, sal_Bool bForward = sal_True );
public:
- BOOL IsInList( Window *pWindow );
+ sal_Bool IsInList( Window *pWindow );
public:
TaskPaneList();
@@ -50,7 +50,7 @@ public:
void AddWindow( Window *pWindow );
void RemoveWindow( Window *pWindow );
- BOOL HandleKeyEvent( KeyEvent aKeyEvent );
+ sal_Bool HandleKeyEvent( KeyEvent aKeyEvent );
};
#endif
diff --git a/vcl/inc/vcl/textlayout.hxx b/vcl/inc/vcl/textlayout.hxx
index 0f593ed00e21..5902573f8746 100644..100755
--- a/vcl/inc/vcl/textlayout.hxx
+++ b/vcl/inc/vcl/textlayout.hxx
@@ -118,7 +118,7 @@ namespace vcl
virtual ~ControlTextRenderer();
Rectangle DrawText( const Rectangle& _rRect,
- const XubString& _rText, USHORT _nStyle = 0,
+ const XubString& _rText, sal_uInt16 _nStyle = 0,
MetricVector* _pVector = NULL, String* _pDisplayText = NULL );
private:
diff --git a/vcl/inc/vcl/throbber.hxx b/vcl/inc/vcl/throbber.hxx
new file mode 100644
index 000000000000..ce45631d2fda
--- /dev/null
+++ b/vcl/inc/vcl/throbber.hxx
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ * 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 VCL_THROBBER_HXX
+#define VCL_THROBBER_HXX
+
+#include "vcl/dllapi.h"
+#include "vcl/imgctrl.hxx"
+#include "vcl/timer.hxx"
+
+#include <com/sun/star/graphic/XGraphic.hpp>
+
+#include <vector>
+
+class VCL_DLLPUBLIC Throbber : public ImageControl
+{
+public:
+ enum ImageSet
+ {
+ /// no (default) images at all
+ IMAGES_NONE,
+ /// automatically decide between different image sets, depending on what fits best the actual size
+ IMAGES_AUTO,
+ /// default images, 16x16 pixels
+ IMAGES_16_PX,
+ /// default images, 32x32 pixels
+ IMAGES_32_PX,
+ /// default images, 64x64 pixels
+ IMAGES_64_PX,
+ };
+
+public:
+ Throbber( Window* i_parentWindow, WinBits i_style, const ImageSet i_imageSet = IMAGES_AUTO );
+ Throbber( Window* i_parentWindow, const ResId& i_resId, const ImageSet i_imageSet = IMAGES_AUTO );
+ ~Throbber();
+
+ // Properties
+ void setStepTime( sal_Int32 nStepTime ) { mnStepTime = nStepTime; }
+ sal_Int32 getStepTime() const { return mnStepTime; }
+
+ void setRepeat( sal_Bool bRepeat ) { mbRepeat = bRepeat; }
+ sal_Bool getRepeat() const { return mbRepeat; }
+
+ // animation control
+ void start();
+ void stop();
+ bool isRunning() const;
+
+ void setImageList( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > >& ImageList );
+ void setImageList( ::std::vector< Image > const& i_images );
+
+ // default images
+ static ::std::vector< ::rtl::OUString >
+ getDefaultImageURLs( const ImageSet i_imageSet );
+
+protected:
+ // Window overridables
+ virtual void Resize();
+
+private:
+ SAL_DLLPRIVATE void initImages();
+
+private:
+ ::std::vector< Image > maImageList;
+
+ sal_Bool mbRepeat;
+ sal_Int32 mnStepTime;
+ sal_Int32 mnCurStep;
+ sal_Int32 mnStepCount;
+ AutoTimer maWaitTimer;
+ ImageSet meImageSet;
+
+ DECL_LINK( TimeOutHdl, void* );
+};
+
+#endif // VCL_THROBBER_HXX
+
diff --git a/vcl/inc/vcl/timer.hxx b/vcl/inc/vcl/timer.hxx
index ae2ca9a3ba99..efc4b00924a7 100644
--- a/vcl/inc/vcl/timer.hxx
+++ b/vcl/inc/vcl/timer.hxx
@@ -44,9 +44,9 @@ class VCL_DLLPUBLIC Timer
{
protected:
ImplTimerData* mpTimerData;
- ULONG mnTimeout;
- BOOL mbActive;
- BOOL mbAuto;
+ sal_uLong mnTimeout;
+ sal_Bool mbActive;
+ sal_Bool mbAuto;
Link maTimeoutHdl;
public:
@@ -59,9 +59,9 @@ public:
void Start();
void Stop();
- void SetTimeout( ULONG nTimeout );
- ULONG GetTimeout() const { return mnTimeout; }
- BOOL IsActive() const { return mbActive; }
+ void SetTimeout( sal_uLong nTimeout );
+ sal_uLong GetTimeout() const { return mnTimeout; }
+ sal_Bool IsActive() const { return mbActive; }
void SetTimeoutHdl( const Link& rLink ) { maTimeoutHdl = rLink; }
const Link& GetTimeoutHdl() const { return maTimeoutHdl; }
diff --git a/vcl/inc/vcl/toolbox.h b/vcl/inc/vcl/toolbox.h
index bc169c18e160..aec0c11cf790 100644
--- a/vcl/inc/vcl/toolbox.h
+++ b/vcl/inc/vcl/toolbox.h
@@ -69,7 +69,7 @@ struct ImplToolItem
XubString maQuickHelpText;
XubString maHelpText;
String maCommandStr;
- ULONG mnHelpId;
+ rtl::OString maHelpId;
Rectangle maRect;
Rectangle maCalcRect;
// the overall horizontal item size, including one or more of [image size + textlength + dropdown arrow]
@@ -79,8 +79,8 @@ struct ImplToolItem
ToolBoxItemType meType;
ToolBoxItemBits mnBits;
TriState meState;
- USHORT mnId;
- BOOL mbEnabled:1,
+ sal_uInt16 mnId;
+ sal_Bool mbEnabled:1,
mbVisible:1,
mbEmptyBtn:1,
mbShowWindow:1,
@@ -88,11 +88,11 @@ struct ImplToolItem
mbVisibleText:1; // indicates if text will definitely be drawn, influences dropdown pos
ImplToolItem();
- ImplToolItem( USHORT nItemId, const Image& rImage,
+ ImplToolItem( sal_uInt16 nItemId, const Image& rImage,
ToolBoxItemBits nItemBits );
- ImplToolItem( USHORT nItemId, const XubString& rTxt,
+ ImplToolItem( sal_uInt16 nItemId, const XubString& rTxt,
ToolBoxItemBits nItemBits );
- ImplToolItem( USHORT nItemId, const Image& rImage,
+ ImplToolItem( sal_uInt16 nItemId, const Image& rImage,
const XubString& rTxt,
ToolBoxItemBits nItemBits );
~ImplToolItem();
@@ -104,18 +104,18 @@ struct ImplToolItem
// the default size is the precomputed size for standard items
// ie those that are just ordinary buttons (no windows or text etc.)
// bCheckMaxWidth indicates that item windows must not exceed maxWidth in which case they will be painted as buttons
- Size GetSize( BOOL bHorz, BOOL bCheckMaxWidth, long maxWidth, const Size& rDefaultSize );
+ Size GetSize( sal_Bool bHorz, sal_Bool bCheckMaxWidth, long maxWidth, const Size& rDefaultSize );
// only useful for buttons: returns if the text or image part or both can be drawn according to current button drawing style
- void DetermineButtonDrawStyle( ButtonType eButtonType, BOOL& rbImage, BOOL& rbText ) const;
+ void DetermineButtonDrawStyle( ButtonType eButtonType, sal_Bool& rbImage, sal_Bool& rbText ) const;
// returns the rectangle which contains the drop down arrow
// or an empty rect if there is none
// bHorz denotes the toolbox alignment
- Rectangle GetDropDownRect( BOOL bHorz ) const;
+ Rectangle GetDropDownRect( sal_Bool bHorz ) const;
- // returns TRUE if the toolbar item is currently clipped, which can happen for docked toolbars
- BOOL IsClipped() const;
+ // returns sal_True if the toolbar item is currently clipped, which can happen for docked toolbars
+ sal_Bool IsClipped() const;
};
namespace vcl
@@ -123,8 +123,8 @@ namespace vcl
struct ToolBoxLayoutData : public ControlLayoutData
{
- std::vector< USHORT > m_aLineItemIds;
- std::vector< USHORT > m_aLineItemPositions;
+ std::vector< sal_uInt16 > m_aLineItemIds;
+ std::vector< sal_uInt16 > m_aLineItemPositions;
};
@@ -150,8 +150,8 @@ struct ImplToolBoxPrivateData
// the optional custom menu
PopupMenu* mpMenu;
- USHORT maMenuType;
- ULONG mnEventId;
+ sal_uInt16 maMenuType;
+ sal_uIntPtr mnEventId;
// called when menu button is clicked and before the popup menu is executed
Link maMenuButtonHdl;
@@ -166,7 +166,7 @@ struct ImplToolBoxPrivateData
vcl::IImageListProvider* mpImageListProvider;
vcl::ImageListType meImageListType;
- BOOL mbIsLocked:1, // keeps last lock state from ImplDockingWindowWrapper
+ sal_Bool mbIsLocked:1, // keeps last lock state from ImplDockingWindowWrapper
mbAssumeDocked:1, // only used during calculations to override current floating/popup mode
mbAssumeFloating:1,
mbAssumePopupMode:1,
diff --git a/vcl/inc/vcl/toolbox.hxx b/vcl/inc/vcl/toolbox.hxx
index 66a13e975b1f..ccd7c229346b 100644
--- a/vcl/inc/vcl/toolbox.hxx
+++ b/vcl/inc/vcl/toolbox.hxx
@@ -54,27 +54,27 @@ namespace vcl
// - ToolBoxCustomizeEvent -
// -------------------------
-#define TOOLBOX_CUSTOMIZE_RESIZE ((USHORT)0xFFFE)
+#define TOOLBOX_CUSTOMIZE_RESIZE ((sal_uInt16)0xFFFE)
class VCL_DLLPUBLIC ToolBoxCustomizeEvent
{
private:
ToolBox* mpTargetBox;
void* mpData;
- USHORT mnIdFrom;
- USHORT mnPosTo;
+ sal_uInt16 mnIdFrom;
+ sal_uInt16 mnPosTo;
public:
ToolBoxCustomizeEvent();
ToolBoxCustomizeEvent( ToolBox* pDropBox,
- USHORT nId, USHORT nPos = 0,
+ sal_uInt16 nId, sal_uInt16 nPos = 0,
void* pUserData = NULL );
ToolBox* GetTargetBox() const { return mpTargetBox; }
- USHORT GetTargetPos() const { return mnPosTo; }
- USHORT GetSourceId() const { return mnIdFrom; }
+ sal_uInt16 GetTargetPos() const { return mnPosTo; }
+ sal_uInt16 GetSourceId() const { return mnIdFrom; }
void* GetData() const { return mpData; }
- BOOL IsResized() const;
+ sal_Bool IsResized() const;
};
inline ToolBoxCustomizeEvent::ToolBoxCustomizeEvent()
@@ -86,7 +86,7 @@ inline ToolBoxCustomizeEvent::ToolBoxCustomizeEvent()
}
inline ToolBoxCustomizeEvent::ToolBoxCustomizeEvent( ToolBox* pDropBox,
- USHORT nId, USHORT nPos,
+ sal_uInt16 nId, sal_uInt16 nPos,
void* pUserData )
{
mpTargetBox = pDropBox;
@@ -95,19 +95,19 @@ inline ToolBoxCustomizeEvent::ToolBoxCustomizeEvent( ToolBox* pDropBox,
mpData = pUserData;
}
-inline BOOL ToolBoxCustomizeEvent::IsResized() const
+inline sal_Bool ToolBoxCustomizeEvent::IsResized() const
{
if ( mnPosTo == TOOLBOX_CUSTOMIZE_RESIZE )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -------------------
// - ToolBoxItemBits -
// -------------------
-typedef USHORT ToolBoxItemBits;
+typedef sal_uInt16 ToolBoxItemBits;
// --------------------------
// - Bits fuer ToolBoxItems -
@@ -130,20 +130,20 @@ typedef USHORT ToolBoxItemBits;
// - ToolBox-Types -
// -----------------
-#define TOOLBOX_STYLE_OUTBUTTON ((USHORT)0x0001)
-#define TOOLBOX_STYLE_HANDPOINTER ((USHORT)0x0002)
-#define TOOLBOX_STYLE_FLAT ((USHORT)0x0004)
+#define TOOLBOX_STYLE_OUTBUTTON ((sal_uInt16)0x0001)
+#define TOOLBOX_STYLE_HANDPOINTER ((sal_uInt16)0x0002)
+#define TOOLBOX_STYLE_FLAT ((sal_uInt16)0x0004)
-#define TOOLBOX_APPEND ((USHORT)0xFFFF)
-#define TOOLBOX_ITEM_NOTFOUND ((USHORT)0xFFFF)
+#define TOOLBOX_APPEND ((sal_uInt16)0xFFFF)
+#define TOOLBOX_ITEM_NOTFOUND ((sal_uInt16)0xFFFF)
// item ids in the custom menu may not exceed this constant
-#define TOOLBOX_MENUITEM_START ((USHORT)0xE000)
+#define TOOLBOX_MENUITEM_START ((sal_uInt16)0xE000)
// defines for the menubutton
-#define TOOLBOX_MENUTYPE_NONE ((USHORT)0x0000) // no menu at all, scrolling by spin buttons
-#define TOOLBOX_MENUTYPE_CLIPPEDITEMS ((USHORT)0x0001) // menu will contain "more" indicator
-#define TOOLBOX_MENUTYPE_CUSTOMIZE ((USHORT)0x0002) // menu will contain "customization" and "more" indicator
+#define TOOLBOX_MENUTYPE_NONE ((sal_uInt16)0x0000) // no menu at all, scrolling by spin buttons
+#define TOOLBOX_MENUTYPE_CLIPPEDITEMS ((sal_uInt16)0x0001) // menu will contain "more" indicator
+#define TOOLBOX_MENUTYPE_CUSTOMIZE ((sal_uInt16)0x0002) // menu will contain "customization" and "more" indicator
// By changes you must also change: rsc/vclrsc.hxx
enum ButtonType { BUTTON_SYMBOL, BUTTON_TEXT, BUTTON_SYMBOLTEXT };
@@ -184,7 +184,7 @@ private:
Rectangle maInDockRect;
Rectangle maPaintRect;
FloatingWindow* mpFloatWin;
- USHORT mnKeyModifier;
+ sal_uInt16 mnKeyModifier;
long mnDX;
long mnDY;
long mnMaxItemWidth; // max item width
@@ -198,22 +198,22 @@ private:
long mnBottomBorder;
long mnLastResizeDY;
long mnActivateCount;
- USHORT mnLastFocusItemId;
- USHORT mnFocusPos;
- USHORT mnOutStyle;
- USHORT mnHighItemId;
- USHORT mnCurItemId;
- USHORT mnDownItemId;
- USHORT mnCurPos;
- USHORT mnLines; // total number of toolbox lines
- USHORT mnCurLine; // the currently visible line
- USHORT mnCurLines; // number of lines due to line breaking
- USHORT mnVisLines; // number of visible lines (for scrolling)
- USHORT mnFloatLines; // number of lines during floating mode
- USHORT mnDockLines;
- USHORT mnConfigItem;
- USHORT mnMouseClicks;
- USHORT mnMouseModifier;
+ sal_uInt16 mnLastFocusItemId;
+ sal_uInt16 mnFocusPos;
+ sal_uInt16 mnOutStyle;
+ sal_uInt16 mnHighItemId;
+ sal_uInt16 mnCurItemId;
+ sal_uInt16 mnDownItemId;
+ sal_uInt16 mnCurPos;
+ sal_uInt16 mnLines; // total number of toolbox lines
+ sal_uInt16 mnCurLine; // the currently visible line
+ sal_uInt16 mnCurLines; // number of lines due to line breaking
+ sal_uInt16 mnVisLines; // number of visible lines (for scrolling)
+ sal_uInt16 mnFloatLines; // number of lines during floating mode
+ sal_uInt16 mnDockLines;
+ sal_uInt16 mnConfigItem;
+ sal_uInt16 mnMouseClicks;
+ sal_uInt16 mnMouseModifier;
unsigned int mbDrag:1,
mbSelection:1,
mbCommandDrag:1,
@@ -252,44 +252,44 @@ private:
private:
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
using DockingWindow::ImplInitSettings;
- SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- SAL_DLLPRIVATE ImplToolItem* ImplGetItem( USHORT nId ) const;
- SAL_DLLPRIVATE BOOL ImplCalcItem();
- SAL_DLLPRIVATE USHORT ImplCalcBreaks( long nWidth, long* pMaxLineWidth, BOOL bCalcHorz );
- SAL_DLLPRIVATE void ImplFormat( BOOL bResize = FALSE );
- SAL_DLLPRIVATE void ImplDrawSpin( BOOL bUpperIn, BOOL bLowerIn );
- SAL_DLLPRIVATE void ImplDrawNext( BOOL bIn );
- SAL_DLLPRIVATE void ImplDrawSeparator( USHORT nPos, Rectangle rRect );
- SAL_DLLPRIVATE void ImplDrawItem( USHORT nPos, BOOL bHighlight = FALSE, BOOL bPaint = FALSE, BOOL bLayout = FALSE );
+ SAL_DLLPRIVATE ImplToolItem* ImplGetItem( sal_uInt16 nId ) const;
+ SAL_DLLPRIVATE sal_Bool ImplCalcItem();
+ SAL_DLLPRIVATE sal_uInt16 ImplCalcBreaks( long nWidth, long* pMaxLineWidth, sal_Bool bCalcHorz );
+ SAL_DLLPRIVATE void ImplFormat( sal_Bool bResize = sal_False );
+ SAL_DLLPRIVATE void ImplDrawSpin( sal_Bool bUpperIn, sal_Bool bLowerIn );
+ SAL_DLLPRIVATE void ImplDrawNext( sal_Bool bIn );
+ SAL_DLLPRIVATE void ImplDrawSeparator( sal_uInt16 nPos, Rectangle rRect );
+ SAL_DLLPRIVATE void ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight = sal_False, sal_Bool bPaint = sal_False, sal_Bool bLayout = sal_False );
using Window::ImplInvalidate;
- SAL_DLLPRIVATE void ImplInvalidate( BOOL bNewCalc = FALSE, BOOL bFullPaint = FALSE );
- SAL_DLLPRIVATE void ImplUpdateItem( USHORT nIndex = 0xFFFF );
+ SAL_DLLPRIVATE void ImplInvalidate( sal_Bool bNewCalc = sal_False, sal_Bool bFullPaint = sal_False );
+ SAL_DLLPRIVATE void ImplUpdateItem( sal_uInt16 nIndex = 0xFFFF );
SAL_DLLPRIVATE void ImplStartCustomizeMode();
SAL_DLLPRIVATE void ImplEndCustomizeMode();
SAL_DLLPRIVATE const XubString& ImplConvertMenuString( const XubString& rStr );
- SAL_DLLPRIVATE BOOL ImplHandleMouseMove( const MouseEvent& rMEvt, BOOL bRepeat = FALSE );
- SAL_DLLPRIVATE BOOL ImplHandleMouseButtonUp( const MouseEvent& rMEvt, BOOL bCancel = FALSE );
- SAL_DLLPRIVATE void ImplChangeHighlight( ImplToolItem* pItem, BOOL bNoGrabFocus = FALSE );
- SAL_DLLPRIVATE BOOL ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle = FALSE );
- SAL_DLLPRIVATE USHORT ImplGetItemLine( ImplToolItem* pCurrentItem );
- SAL_DLLPRIVATE ImplToolItem* ImplGetFirstValidItem( USHORT nLine );
- SAL_DLLPRIVATE ImplToolItem* ImplGetLastValidItem( USHORT nLine );
- SAL_DLLPRIVATE BOOL ImplOpenItem( KeyCode aKeyCode );
- SAL_DLLPRIVATE BOOL ImplActivateItem( KeyCode aKeyCode );
+ SAL_DLLPRIVATE sal_Bool ImplHandleMouseMove( const MouseEvent& rMEvt, sal_Bool bRepeat = sal_False );
+ SAL_DLLPRIVATE sal_Bool ImplHandleMouseButtonUp( const MouseEvent& rMEvt, sal_Bool bCancel = sal_False );
+ SAL_DLLPRIVATE void ImplChangeHighlight( ImplToolItem* pItem, sal_Bool bNoGrabFocus = sal_False );
+ SAL_DLLPRIVATE sal_Bool ImplChangeHighlightUpDn( sal_Bool bUp, sal_Bool bNoCycle = sal_False );
+ SAL_DLLPRIVATE sal_uInt16 ImplGetItemLine( ImplToolItem* pCurrentItem );
+ SAL_DLLPRIVATE ImplToolItem* ImplGetFirstValidItem( sal_uInt16 nLine );
+ SAL_DLLPRIVATE ImplToolItem* ImplGetLastValidItem( sal_uInt16 nLine );
+ SAL_DLLPRIVATE sal_Bool ImplOpenItem( KeyCode aKeyCode );
+ SAL_DLLPRIVATE sal_Bool ImplActivateItem( KeyCode aKeyCode );
SAL_DLLPRIVATE void ImplShowFocus();
SAL_DLLPRIVATE void ImplHideFocus();
SAL_DLLPRIVATE void ImplUpdateInputEnable();
SAL_DLLPRIVATE void ImplFillLayoutData() const;
SAL_DLLPRIVATE void ImplUpdateCustomMenu();
- SAL_DLLPRIVATE BOOL ImplHasClippedItems();
+ SAL_DLLPRIVATE sal_Bool ImplHasClippedItems();
SAL_DLLPRIVATE Point ImplGetPopupPosition( const Rectangle& rRect, const Size& rSize ) const;
SAL_DLLPRIVATE void ImplExecuteCustomMenu();
- SAL_DLLPRIVATE BOOL ImplIsFloatingMode() const;
- SAL_DLLPRIVATE BOOL ImplIsInPopupMode() const;
- SAL_DLLPRIVATE const XubString& ImplGetHelpText( USHORT nItemId ) const;
+ SAL_DLLPRIVATE sal_Bool ImplIsFloatingMode() const;
+ SAL_DLLPRIVATE sal_Bool ImplIsInPopupMode() const;
+ SAL_DLLPRIVATE const XubString& ImplGetHelpText( sal_uInt16 nItemId ) const;
SAL_DLLPRIVATE Size ImplGetOptimalFloatingSize( FloatingSizeMode eMode );
- SAL_DLLPRIVATE BOOL ImplHasExternalMenubutton();
+ SAL_DLLPRIVATE sal_Bool ImplHasExternalMenubutton();
SAL_DLLPRIVATE void ImplDrawFloatwinBorder( ImplToolItem* pItem );
DECL_DLLPRIVATE_LINK( ImplCallExecuteCustomMenu, void* );
@@ -304,7 +304,7 @@ private:
SAL_DLLPRIVATE void ImplUpdateImageList(); // called if StateChanged
public:
- SAL_DLLPRIVATE void ImplFloatControl( BOOL bStart, FloatingWindow* pWindow = NULL );
+ SAL_DLLPRIVATE void ImplFloatControl( sal_Bool bStart, FloatingWindow* pWindow = NULL );
SAL_DLLPRIVATE void ImplDisableFlatButtons();
static SAL_DLLPRIVATE int ImplGetDragWidth( ToolBox* pThis );
@@ -313,35 +313,35 @@ public:
long& rRight, long& rBottom, const ToolBox *pThis );
static SAL_DLLPRIVATE void ImplDrawGrip( ToolBox* pThis );
static SAL_DLLPRIVATE void ImplDrawGradientBackground( ToolBox* pThis, ImplDockingWindowWrapper *pWrapper );
- static SAL_DLLPRIVATE BOOL ImplDrawNativeBackground( ToolBox* pThis, const Region &rRegion );
+ static SAL_DLLPRIVATE sal_Bool ImplDrawNativeBackground( ToolBox* pThis, const Region &rRegion );
static SAL_DLLPRIVATE void ImplDrawTransparentBackground( ToolBox* pThis, const Region &rRegion );
- static SAL_DLLPRIVATE void ImplDrawConstantBackground( ToolBox* pThis, const Region &rRegion, BOOL bIsInPopupMode );
+ static SAL_DLLPRIVATE void ImplDrawConstantBackground( ToolBox* pThis, const Region &rRegion, sal_Bool bIsInPopupMode );
static SAL_DLLPRIVATE void ImplDrawBackground( ToolBox* pThis, const Rectangle &rRect );
- static SAL_DLLPRIVATE void ImplErase( ToolBox* pThis, const Rectangle &rRect, BOOL bHighlight = FALSE, BOOL bHasOpenPopup = FALSE );
+ static SAL_DLLPRIVATE void ImplErase( ToolBox* pThis, const Rectangle &rRect, sal_Bool bHighlight = sal_False, sal_Bool bHasOpenPopup = sal_False );
static SAL_DLLPRIVATE void ImplDrawBorder( ToolBox* pWin );
static SAL_DLLPRIVATE const ImplToolItem *ImplGetFirstClippedItem( const ToolBox* pThis );
- static SAL_DLLPRIVATE Size ImplCalcSize( const ToolBox* pThis, USHORT nCalcLines, USHORT nCalcMode = 0 );
+ static SAL_DLLPRIVATE Size ImplCalcSize( const ToolBox* pThis, sal_uInt16 nCalcLines, sal_uInt16 nCalcMode = 0 );
static SAL_DLLPRIVATE void ImplCalcFloatSizes( ToolBox* pThis );
- static SAL_DLLPRIVATE Size ImplCalcFloatSize( ToolBox* pThis, USHORT& rLines );
+ static SAL_DLLPRIVATE Size ImplCalcFloatSize( ToolBox* pThis, sal_uInt16& rLines );
static SAL_DLLPRIVATE void ImplCalcMinMaxFloatSize( ToolBox* pThis, Size& rMinSize, Size& rMaxSize );
static SAL_DLLPRIVATE void ImplSetMinMaxFloatSize( ToolBox *pThis );
- static SAL_DLLPRIVATE USHORT ImplCalcLines( ToolBox* pThis, long nToolSize );
- static SAL_DLLPRIVATE USHORT ImplTestLineSize( ToolBox* pThis, const Point& rPos );
- static SAL_DLLPRIVATE void ImplLineSizing( ToolBox* pThis, const Point& rPos, Rectangle& rRect, USHORT nLineMode );
- static SAL_DLLPRIVATE USHORT ImplFindItemPos( ToolBox* pBox, const Point& rPos );
- static SAL_DLLPRIVATE USHORT ImplFindItemPos( const ImplToolItem* pItem, const std::vector< ImplToolItem >& rList );
- static SAL_DLLPRIVATE void ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, BOOL bBlack, BOOL bColTransform,
- BOOL bLeft = FALSE, BOOL bTop = FALSE,
+ static SAL_DLLPRIVATE sal_uInt16 ImplCalcLines( ToolBox* pThis, long nToolSize );
+ static SAL_DLLPRIVATE sal_uInt16 ImplTestLineSize( ToolBox* pThis, const Point& rPos );
+ static SAL_DLLPRIVATE void ImplLineSizing( ToolBox* pThis, const Point& rPos, Rectangle& rRect, sal_uInt16 nLineMode );
+ static SAL_DLLPRIVATE sal_uInt16 ImplFindItemPos( ToolBox* pBox, const Point& rPos );
+ static SAL_DLLPRIVATE sal_uInt16 ImplFindItemPos( const ImplToolItem* pItem, const std::vector< ImplToolItem >& rList );
+ static SAL_DLLPRIVATE void ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, sal_Bool bBlack, sal_Bool bColTransform,
+ sal_Bool bLeft = sal_False, sal_Bool bTop = sal_False,
long nSize = 6 );
static SAL_DLLPRIVATE void SetToolArrowClipregion( ToolBox* pBox, long nX, long nY,
- BOOL bLeft = FALSE, BOOL bTop = FALSE,
+ sal_Bool bLeft = sal_False, sal_Bool bTop = sal_False,
long nSize = 6 );
- static SAL_DLLPRIVATE void ImplDrawMenubutton( ToolBox *pThis, BOOL bHighlight );
- static SAL_DLLPRIVATE USHORT ImplCountLineBreaks( const ToolBox *pThis );
+ static SAL_DLLPRIVATE void ImplDrawMenubutton( ToolBox *pThis, sal_Bool bHighlight );
+ static SAL_DLLPRIVATE sal_uInt16 ImplCountLineBreaks( const ToolBox *pThis );
SAL_DLLPRIVATE ImplToolBoxPrivateData* ImplGetToolBoxPrivateData() const { return mpData; }
protected:
- void SetCurItemId(USHORT nSet) { mnCurItemId = nSet; }
+ void SetCurItemId(sal_uInt16 nSet) { mnCurItemId = nSet; }
public:
ToolBox( Window* pParent, WinBits nStyle = 0 );
@@ -375,36 +375,36 @@ public:
virtual void LoseFocus();
virtual void KeyInput( const KeyEvent& rKEvt );
- virtual BOOL PrepareToggleFloatingMode();
+ virtual sal_Bool PrepareToggleFloatingMode();
virtual void ToggleFloatingMode();
virtual void StartDocking();
- virtual BOOL Docking( const Point& rPos, Rectangle& rRect );
- virtual void EndDocking( const Rectangle& rRect, BOOL bFloatMode );
+ virtual sal_Bool Docking( const Point& rPos, Rectangle& rRect );
+ virtual void EndDocking( const Rectangle& rRect, sal_Bool bFloatMode );
virtual void Resizing( Size& rSize );
void InsertItem( const ResId& rResId,
- USHORT nPos = TOOLBOX_APPEND );
- void InsertItem( USHORT nItemId, const Image& rImage,
+ sal_uInt16 nPos = TOOLBOX_APPEND );
+ void InsertItem( sal_uInt16 nItemId, const Image& rImage,
ToolBoxItemBits nBits = 0,
- USHORT nPos = TOOLBOX_APPEND );
- void InsertItem( USHORT nItemId, const Image& rImage,
+ sal_uInt16 nPos = TOOLBOX_APPEND );
+ void InsertItem( sal_uInt16 nItemId, const Image& rImage,
const XubString& rText,
ToolBoxItemBits nBits = 0,
- USHORT nPos = TOOLBOX_APPEND );
- void InsertItem( USHORT nItemId, const XubString& rText,
+ sal_uInt16 nPos = TOOLBOX_APPEND );
+ void InsertItem( sal_uInt16 nItemId, const XubString& rText,
ToolBoxItemBits nBits = 0,
- USHORT nPos = TOOLBOX_APPEND );
- void InsertWindow( USHORT nItemId, Window* pWindow,
+ sal_uInt16 nPos = TOOLBOX_APPEND );
+ void InsertWindow( sal_uInt16 nItemId, Window* pWindow,
ToolBoxItemBits nBits = 0,
- USHORT nPos = TOOLBOX_APPEND );
- void InsertSpace( USHORT nPos = TOOLBOX_APPEND );
- void InsertSeparator( USHORT nPos = TOOLBOX_APPEND,
- USHORT nPixSize = 0 );
- void InsertBreak( USHORT nPos = TOOLBOX_APPEND );
- void RemoveItem( USHORT nPos );
- void MoveItem( USHORT nItemId, USHORT nNewPos = TOOLBOX_APPEND );
- void CopyItem( const ToolBox& rToolBox, USHORT nItemId,
- USHORT nNewPos = TOOLBOX_APPEND );
+ sal_uInt16 nPos = TOOLBOX_APPEND );
+ void InsertSpace( sal_uInt16 nPos = TOOLBOX_APPEND );
+ void InsertSeparator( sal_uInt16 nPos = TOOLBOX_APPEND,
+ sal_uInt16 nPixSize = 0 );
+ void InsertBreak( sal_uInt16 nPos = TOOLBOX_APPEND );
+ void RemoveItem( sal_uInt16 nPos );
+ void MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos = TOOLBOX_APPEND );
+ void CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId,
+ sal_uInt16 nNewPos = TOOLBOX_APPEND );
void CopyItems( const ToolBox& rToolBox );
void Clear();
void RecalcItems();
@@ -421,106 +421,106 @@ public:
void SetAlign( WindowAlign eNewAlign = WINDOWALIGN_TOP );
WindowAlign GetAlign() const { return meAlign; }
- BOOL IsHorizontal() const { return mbHorz; }
+ sal_Bool IsHorizontal() const { return mbHorz; }
- void SetLineCount( USHORT nNewLines );
- USHORT GetLineCount() const { return mnLines; }
- USHORT GetCurLine() const { return mnCurLine; }
- void ShowLine( BOOL bNext );
+ void SetLineCount( sal_uInt16 nNewLines );
+ sal_uInt16 GetLineCount() const { return mnLines; }
+ sal_uInt16 GetCurLine() const { return mnCurLine; }
+ void ShowLine( sal_Bool bNext );
// Used to enable/disable scrolling one page at a time for toolbar
- void SetPageScroll( BOOL b );
- BOOL GetPageScroll();
+ void SetPageScroll( sal_Bool b );
+ sal_Bool GetPageScroll();
void SetNextToolBox( const XubString& rStr );
const XubString& GetNextToolBox() const { return maNextToolBoxStr; }
- USHORT GetItemCount() const;
- ToolBoxItemType GetItemType( USHORT nPos ) const;
- USHORT GetItemPos( USHORT nItemId ) const;
- USHORT GetItemPos( const Point& rPos ) const;
- USHORT GetItemId( USHORT nPos ) const;
- USHORT GetItemId( const Point& rPos ) const;
- Rectangle GetItemRect( USHORT nItemId ) const;
- Rectangle GetItemPosRect( USHORT nPos ) const;
- Rectangle GetItemDropDownRect( USHORT nItemId ) const;
- Rectangle GetItemPosDropDownRect( USHORT nPos ) const;
+ sal_uInt16 GetItemCount() const;
+ ToolBoxItemType GetItemType( sal_uInt16 nPos ) const;
+ sal_uInt16 GetItemPos( sal_uInt16 nItemId ) const;
+ sal_uInt16 GetItemPos( const Point& rPos ) const;
+ sal_uInt16 GetItemId( sal_uInt16 nPos ) const;
+ sal_uInt16 GetItemId( const Point& rPos ) const;
+ Rectangle GetItemRect( sal_uInt16 nItemId ) const;
+ Rectangle GetItemPosRect( sal_uInt16 nPos ) const;
+ Rectangle GetItemDropDownRect( sal_uInt16 nItemId ) const;
+ Rectangle GetItemPosDropDownRect( sal_uInt16 nPos ) const;
// retrieves the optimal position to place a popup window for this item (subtoolbar or dropdown)
- Point GetItemPopupPosition( USHORT nItemId, const Size& rSize ) const;
+ Point GetItemPopupPosition( sal_uInt16 nItemId, const Size& rSize ) const;
Rectangle GetScrollRect() const;
Rectangle GetMenubuttonRect() const;
- USHORT GetCurItemId() const { return mnCurItemId; }
- USHORT GetDownItemId() const { return mnDownItemId; }
- USHORT GetClicks() const { return mnMouseClicks; }
- USHORT GetModifier() const { return mnMouseModifier; }
- USHORT GetKeyModifier() const { return mnKeyModifier; }
-
- void SetItemBits( USHORT nItemId, ToolBoxItemBits nBits );
- ToolBoxItemBits GetItemBits( USHORT nItemId ) const;
-
- void SetItemData( USHORT nItemId, void* pNewData );
- void* GetItemData( USHORT nItemId ) const;
- void SetItemImage( USHORT nItemId, const Image& rImage );
- Image GetItemImage( USHORT nItemId ) const;
- void SetItemImageAngle( USHORT nItemId, long nAngle10 );
- long GetItemImageAngle( USHORT nItemId ) const;
- void SetItemImageMirrorMode( USHORT nItemId, BOOL bMirror );
- BOOL GetItemImageMirrorMode( USHORT ) const;
- void SetItemHighImage( USHORT nItemId, const Image& rImage );
- Image GetItemHighImage( USHORT nItemId ) const;
- void SetItemText( USHORT nItemId, const XubString& rText );
- const XubString& GetItemText( USHORT nItemId ) const;
- void SetItemWindow( USHORT nItemId, Window* pNewWindow );
- Window* GetItemWindow( USHORT nItemId ) const;
- USHORT GetHighlightItemId() const { return mnHighItemId; }
+ sal_uInt16 GetCurItemId() const { return mnCurItemId; }
+ sal_uInt16 GetDownItemId() const { return mnDownItemId; }
+ sal_uInt16 GetClicks() const { return mnMouseClicks; }
+ sal_uInt16 GetModifier() const { return mnMouseModifier; }
+ sal_uInt16 GetKeyModifier() const { return mnKeyModifier; }
+
+ void SetItemBits( sal_uInt16 nItemId, ToolBoxItemBits nBits );
+ ToolBoxItemBits GetItemBits( sal_uInt16 nItemId ) const;
+
+ void SetItemData( sal_uInt16 nItemId, void* pNewData );
+ void* GetItemData( sal_uInt16 nItemId ) const;
+ void SetItemImage( sal_uInt16 nItemId, const Image& rImage );
+ Image GetItemImage( sal_uInt16 nItemId ) const;
+ void SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 );
+ long GetItemImageAngle( sal_uInt16 nItemId ) const;
+ void SetItemImageMirrorMode( sal_uInt16 nItemId, sal_Bool bMirror );
+ sal_Bool GetItemImageMirrorMode( sal_uInt16 ) const;
+ void SetItemHighImage( sal_uInt16 nItemId, const Image& rImage );
+ Image GetItemHighImage( sal_uInt16 nItemId ) const;
+ void SetItemText( sal_uInt16 nItemId, const XubString& rText );
+ const XubString& GetItemText( sal_uInt16 nItemId ) const;
+ void SetItemWindow( sal_uInt16 nItemId, Window* pNewWindow );
+ Window* GetItemWindow( sal_uInt16 nItemId ) const;
+ sal_uInt16 GetHighlightItemId() const { return mnHighItemId; }
void StartSelection();
void EndSelection();
- void SetItemDown( USHORT nItemId, BOOL bDown, BOOL bRelease = TRUE );
- BOOL IsItemDown( USHORT nItemId ) const;
+ void SetItemDown( sal_uInt16 nItemId, sal_Bool bDown, sal_Bool bRelease = sal_True );
+ sal_Bool IsItemDown( sal_uInt16 nItemId ) const;
- void SetItemState( USHORT nItemId, TriState eState );
- TriState GetItemState( USHORT nItemId ) const;
+ void SetItemState( sal_uInt16 nItemId, TriState eState );
+ TriState GetItemState( sal_uInt16 nItemId ) const;
- void CheckItem( USHORT nItemId, BOOL bCheck = TRUE );
- BOOL IsItemChecked( USHORT nItemId ) const;
+ void CheckItem( sal_uInt16 nItemId, sal_Bool bCheck = sal_True );
+ sal_Bool IsItemChecked( sal_uInt16 nItemId ) const;
- void EnableItem( USHORT nItemId, BOOL bEnable = TRUE );
- BOOL IsItemEnabled( USHORT nItemId ) const;
+ void EnableItem( sal_uInt16 nItemId, sal_Bool bEnable = sal_True );
+ sal_Bool IsItemEnabled( sal_uInt16 nItemId ) const;
- void TriggerItem( USHORT nItemId, BOOL bShift = FALSE, BOOL bCtrl = FALSE );
- void ShowItem( USHORT nItemId, BOOL bVisible = TRUE );
- void HideItem( USHORT nItemId ) { ShowItem( nItemId, FALSE ); }
- BOOL IsItemVisible( USHORT nItemId ) const;
- BOOL IsItemReallyVisible( USHORT nItemId ) const;
+ void TriggerItem( sal_uInt16 nItemId, sal_Bool bShift = sal_False, sal_Bool bCtrl = sal_False );
+ void ShowItem( sal_uInt16 nItemId, sal_Bool bVisible = sal_True );
+ void HideItem( sal_uInt16 nItemId ) { ShowItem( nItemId, sal_False ); }
+ sal_Bool IsItemVisible( sal_uInt16 nItemId ) const;
+ sal_Bool IsItemReallyVisible( sal_uInt16 nItemId ) const;
- void SetItemCommand( USHORT nItemId, const XubString& rCommand );
- const XubString& GetItemCommand( USHORT nItemId ) const;
+ void SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand );
+ const XubString& GetItemCommand( sal_uInt16 nItemId ) const;
using Window::SetQuickHelpText;
- void SetQuickHelpText( USHORT nItemId, const XubString& rText );
+ void SetQuickHelpText( sal_uInt16 nItemId, const XubString& rText );
using Window::GetQuickHelpText;
- const XubString& GetQuickHelpText( USHORT nItemId ) const;
+ const XubString& GetQuickHelpText( sal_uInt16 nItemId ) const;
- void SetHelpText( USHORT nItemId, const XubString& rText );
- const XubString& GetHelpText( USHORT nItemId ) const;
+ void SetHelpText( sal_uInt16 nItemId, const XubString& rText );
+ const XubString& GetHelpText( sal_uInt16 nItemId ) const;
- void SetHelpId( USHORT nItemId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nItemId ) const;
+ void SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId );
+ rtl::OString GetHelpId( sal_uInt16 nItemId ) const;
// window size according to current alignment, floating state and number of lines
Size CalcWindowSizePixel() const;
// window size according to current alignment, floating state and a given number of lines
- Size CalcWindowSizePixel( USHORT nCalcLines ) const;
+ Size CalcWindowSizePixel( sal_uInt16 nCalcLines ) const;
// window size according to current floating state and a given number of lines and a given alignment
- Size CalcWindowSizePixel( USHORT nCalcLines, WindowAlign eAlign ) const;
+ Size CalcWindowSizePixel( sal_uInt16 nCalcLines, WindowAlign eAlign ) const;
// floating window size according to number of lines (uses the number of line breaks)
Size CalcFloatingWindowSizePixel() const;
// floating window size with a given number of lines
- Size CalcFloatingWindowSizePixel( USHORT nCalcLines ) const;
+ Size CalcFloatingWindowSizePixel( sal_uInt16 nCalcLines ) const;
// automatic window size for popoup mode
Size CalcPopupWindowSizePixel() const;
@@ -529,8 +529,8 @@ public:
void SetDockingRects( const Rectangle& rOutRect,
const Rectangle& rInRect );
- void SetFloatingLines( USHORT nFloatLines );
- USHORT GetFloatingLines() const;
+ void SetFloatingLines( sal_uInt16 nFloatLines );
+ sal_uInt16 GetFloatingLines() const;
void SetBorder( long nX, long nY );
long GetBorderX() const { return mnBorderX; }
@@ -540,35 +540,35 @@ public:
WinBits GetStyle() const { return mnWinStyle; }
// enable/disable undocking
- void Lock( BOOL bLock = TRUE );
+ void Lock( sal_Bool bLock = sal_True );
// read configuration to determine locking behaviour
- static BOOL AlwaysLocked();
+ static sal_Bool AlwaysLocked();
- void EnableMenuStrings( BOOL bEnable = TRUE ) { mbMenuStrings = (bEnable != 0); }
- BOOL IsMenuStringsEnabled() const { return mbMenuStrings; }
+ void EnableMenuStrings( sal_Bool bEnable = sal_True ) { mbMenuStrings = (bEnable != 0); }
+ sal_Bool IsMenuStringsEnabled() const { return mbMenuStrings; }
- void SetOutStyle( USHORT nNewStyle );
- USHORT GetOutStyle() const { return mnOutStyle; }
+ void SetOutStyle( sal_uInt16 nNewStyle );
+ sal_uInt16 GetOutStyle() const { return mnOutStyle; }
- void EnableCustomize( BOOL bEnable = TRUE );
- BOOL IsCustomize() { return mbCustomize; }
+ void EnableCustomize( sal_Bool bEnable = sal_True );
+ sal_Bool IsCustomize() { return mbCustomize; }
void StartCustomize( const Rectangle& rRect, void* pData = NULL );
- void SetCustomizeMode( BOOL );
- BOOL IsInCustomizeMode() const { return mbCustomizeMode; }
+ void SetCustomizeMode( sal_Bool );
+ sal_Bool IsInCustomizeMode() const { return mbCustomizeMode; }
static void StartCustomizeMode();
static void EndCustomizeMode();
- static BOOL IsCustomizeMode();
+ static sal_Bool IsCustomizeMode();
void SetHelpText( const XubString& rText )
{ DockingWindow::SetHelpText( rText ); }
const XubString& GetHelpText() const
{ return DockingWindow::GetHelpText(); }
- void SetHelpId( ULONG nId )
- { DockingWindow::SetHelpId( nId ); }
- ULONG GetHelpId() const
+ void SetHelpId( const rtl::OString& rId )
+ { DockingWindow::SetHelpId( rId ); }
+ const rtl::OString& GetHelpId() const
{ return DockingWindow::GetHelpId(); }
void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
@@ -595,9 +595,9 @@ public:
// the private toolbox items will only use item ids starting from TOOLBOX_MENUITEM_START
// to allow for customization of the menu the coresponding handler is called
// when the menu button was clicked and before the menu is executed
- void SetMenuType( USHORT aType = TOOLBOX_MENUTYPE_CUSTOMIZE );
- USHORT GetMenuType() const;
- BOOL IsMenuEnabled() const;
+ void SetMenuType( sal_uInt16 aType = TOOLBOX_MENUTYPE_CUSTOMIZE );
+ sal_uInt16 GetMenuType() const;
+ sal_Bool IsMenuEnabled() const;
PopupMenu* GetMenu() const;
void SetMenuButtonHdl( const Link& rLink );
const Link& GetMenuButtonHdl() const;
@@ -608,11 +608,11 @@ public:
// allow Click Handler to detect special key
bool IsShift() const { return mbIsShift; }
// allow Click Handler to distinguish between mouse and key input
- BOOL IsKeyEvent() const { return mbIsKeyEvent; }
+ sal_Bool IsKeyEvent() const { return mbIsKeyEvent; }
// allows framework to set/query the planned popupmode
- BOOL WillUsePopupMode() const;
- void WillUsePopupMode( BOOL b);
+ sal_Bool WillUsePopupMode() const;
+ void WillUsePopupMode( sal_Bool b);
// accessibility helpers
@@ -621,30 +621,30 @@ public:
// returns the bounding box for the character at index nIndex
// where nIndex is relative to the starting index of the item
// with id nItemId (in coordinates of the displaying window)
- Rectangle GetCharacterBounds( USHORT nItemId, long nIndex ) const;
+ Rectangle GetCharacterBounds( sal_uInt16 nItemId, long nIndex ) const;
// -1 is returned if no character is at that point
// if an index is found the corresponding item id is filled in (else 0)
- long GetIndexForPoint( const Point& rPoint, USHORT& rItemID ) const;
+ long GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const;
// returns the number of portions in the result of GetDisplayText()
long GetTextCount() const;
// returns the interval [start,end] of text portion nText
// returns [-1,-1] for an invalid text number
Pair GetTextStartEnd( long nText ) const;
// returns the item id for text portion nText or 0 if nText is invalid
- USHORT GetDisplayItemId( long nText ) const;
+ sal_uInt16 GetDisplayItemId( long nText ) const;
const Size& GetDefaultImageSize() const;
- void ChangeHighlight( USHORT nPos );
+ void ChangeHighlight( sal_uInt16 nPos );
void SetImageListProvider(vcl::IImageListProvider* _pProvider);
};
-inline void ToolBox::CheckItem( USHORT nItemId, BOOL bCheck )
+inline void ToolBox::CheckItem( sal_uInt16 nItemId, sal_Bool bCheck )
{
SetItemState( nItemId, (bCheck) ? STATE_CHECK : STATE_NOCHECK );
}
-inline BOOL ToolBox::IsItemChecked( USHORT nItemId ) const
+inline sal_Bool ToolBox::IsItemChecked( sal_uInt16 nItemId ) const
{
return (GetItemState( nItemId ) == STATE_CHECK);
}
@@ -666,12 +666,12 @@ inline void ToolBox::SetDockingRects( const Rectangle& rOutRect,
maInDockRect = rInRect;
}
-inline void ToolBox::SetFloatingLines( USHORT nNewLines )
+inline void ToolBox::SetFloatingLines( sal_uInt16 nNewLines )
{
mnFloatLines = nNewLines;
}
-inline USHORT ToolBox::GetFloatingLines() const
+inline sal_uInt16 ToolBox::GetFloatingLines() const
{
return mnFloatLines;
}
diff --git a/vcl/inc/vcl/vclenum.hxx b/vcl/inc/vcl/vclenum.hxx
index 492f2293afaf..80b84b2fb0f2 100644
--- a/vcl/inc/vcl/vclenum.hxx
+++ b/vcl/inc/vcl/vclenum.hxx
@@ -240,7 +240,7 @@ enum FontStrikeout { STRIKEOUT_NONE, STRIKEOUT_SINGLE, STRIKEOUT_DOUBLE,
#ifndef ENUM_FONTEMPHASISMARK_DECLARED
#define ENUM_FONTEMPHASISMARK_DECLARED
-typedef USHORT FontEmphasisMark;
+typedef sal_uInt16 FontEmphasisMark;
#define EMPHASISMARK_NONE ((FontEmphasisMark)0x0000)
#define EMPHASISMARK_DOT ((FontEmphasisMark)0x0001)
#define EMPHASISMARK_CIRCLE ((FontEmphasisMark)0x0002)
diff --git a/vcl/inc/vcl/vclevent.hxx b/vcl/inc/vcl/vclevent.hxx
index d4801fa9ed0a..c7347f7cd978 100644
--- a/vcl/inc/vcl/vclevent.hxx
+++ b/vcl/inc/vcl/vclevent.hxx
@@ -187,7 +187,7 @@ namespace com { namespace sun { namespace star {
#define VCLEVENT_WINDOW_STARTDOCKING 1217 // pData = DockingData
#define VCLEVENT_WINDOW_DOCKING 1218
#define VCLEVENT_WINDOW_ENDDOCKING 1219 // pData = EndDockingData
-#define VCLEVENT_WINDOW_PREPARETOGGLEFLOATING 1220 // pData = BOOL
+#define VCLEVENT_WINDOW_PREPARETOGGLEFLOATING 1220 // pData = sal_Bool
#define VCLEVENT_WINDOW_TOGGLEFLOATING 1221
#define VCLEVENT_WINDOW_ENDPOPUPMODE 1222 // pData = EndPopupModeData
@@ -198,13 +198,13 @@ namespace com { namespace sun { namespace star {
class VCL_DLLPUBLIC VclSimpleEvent
{
private:
- ULONG nId;
+ sal_uLong nId;
public:
- VclSimpleEvent( ULONG n ) { nId = n; }
+ VclSimpleEvent( sal_uLong n ) { nId = n; }
TYPEINFO();
- ULONG GetId() const { return nId; }
+ sal_uLong GetId() const { return nId; }
};
class VCL_DLLPUBLIC VclWindowEvent : public VclSimpleEvent
@@ -214,7 +214,7 @@ private:
void* pData;
public:
- VclWindowEvent( Window* pWin, ULONG n, void* pDat = NULL ) : VclSimpleEvent(n) { pWindow = pWin; pData = pDat; }
+ VclWindowEvent( Window* pWin, sal_uLong n, void* pDat = NULL ) : VclSimpleEvent(n) { pWindow = pWin; pData = pDat; }
TYPEINFO();
Window* GetWindow() const { return pWindow; }
@@ -228,7 +228,7 @@ private:
MouseEvent aEvent;
public:
- VclMouseEvent( Window* pWin, ULONG n, const MouseEvent& rEvent ) : VclWindowEvent( pWin, n ), aEvent(rEvent) { ; }
+ VclMouseEvent( Window* pWin, sal_uLong n, const MouseEvent& rEvent ) : VclWindowEvent( pWin, n ), aEvent(rEvent) { ; }
TYPEINFO();
const MouseEvent& GetEvent() const { return aEvent; }
@@ -239,20 +239,20 @@ class VCL_DLLPUBLIC VclMenuEvent : public VclSimpleEvent
{
private:
Menu* pMenu;
- USHORT mnPos;
+ sal_uInt16 mnPos;
public:
- VclMenuEvent( Menu* pM, ULONG n, USHORT nPos ) : VclSimpleEvent(n) { pMenu = pM; mnPos = nPos; }
+ VclMenuEvent( Menu* pM, sal_uLong n, sal_uInt16 nPos ) : VclSimpleEvent(n) { pMenu = pM; mnPos = nPos; }
TYPEINFO();
Menu* GetMenu() const { return pMenu; }
- USHORT GetItemPos() const { return mnPos; }
+ sal_uInt16 GetItemPos() const { return mnPos; }
};
class VCL_DLLPUBLIC VclAccessibleEvent: public VclSimpleEvent
{
public:
- VclAccessibleEvent( ULONG n, const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible );
+ VclAccessibleEvent( sal_uLong n, const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible );
virtual ~VclAccessibleEvent();
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetAccessible() const;
@@ -266,9 +266,9 @@ public:
void Call( VclSimpleEvent* pEvent ) const;
// stops notifying when any handler has processed the event
- // and returns TRUE in that case
- // a handler must return TRUE to signal that it has processed the event
- BOOL Process( VclSimpleEvent* pEvent ) const;
+ // and returns sal_True in that case
+ // a handler must return sal_True to signal that it has processed the event
+ sal_Bool Process( VclSimpleEvent* pEvent ) const;
void addListener( const Link& rListener );
void removeListener( const Link& rListener );
private:
diff --git a/vcl/inc/vcl/virdev.hxx b/vcl/inc/vcl/virdev.hxx
index f3e52813c486..79b8233cf964 100644
--- a/vcl/inc/vcl/virdev.hxx
+++ b/vcl/inc/vcl/virdev.hxx
@@ -50,13 +50,13 @@ private:
SalVirtualDevice* mpVirDev;
VirtualDevice* mpPrev;
VirtualDevice* mpNext;
- USHORT mnBitCount;
- BOOL mbScreenComp;
+ sal_uInt16 mnBitCount;
+ sal_Bool mbScreenComp;
sal_Int8 mnAlphaDepth;
- BYTE meRefDevMode;
+ sal_uInt8 meRefDevMode;
- SAL_DLLPRIVATE void ImplInitVirDev( const OutputDevice* pOutDev, long nDX, long nDY, USHORT nBitCount, const SystemGraphicsData *pData = NULL );
- SAL_DLLPRIVATE BOOL ImplSetOutputSizePixel( const Size& rNewSize, BOOL bErase );
+ SAL_DLLPRIVATE void ImplInitVirDev( const OutputDevice* pOutDev, long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL );
+ SAL_DLLPRIVATE sal_Bool ImplSetOutputSizePixel( const Size& rNewSize, sal_Bool bErase );
// Copy assignment is forbidden and not implemented.
VirtualDevice (const VirtualDevice &);
@@ -73,9 +73,9 @@ private:
SAL_DLLPRIVATE bool ForceZeroExtleadBug() const
{ return ((meRefDevMode & REFDEV_FORCE_ZERO_EXTLEAD) != 0); }
public:
- VirtualDevice( USHORT nBitCount = 0 );
+ VirtualDevice( sal_uInt16 nBitCount = 0 );
VirtualDevice( const OutputDevice& rCompDev,
- USHORT nBitCount = 0 );
+ sal_uInt16 nBitCount = 0 );
/** Create a virtual device with alpha channel
@param rCompDev
@@ -93,18 +93,18 @@ public:
are allowed here, with 1 denoting binary mask.
*/
VirtualDevice( const OutputDevice& rCompDev,
- USHORT nBitCount, USHORT nAlphaBitCount );
+ sal_uInt16 nBitCount, sal_uInt16 nAlphaBitCount );
/** Create a virtual device using an existing system dependent device or graphics context
Any rendering will happen directly on the context and not on any intermediate bitmap.
Note: This might not be suported on all platforms !
*/
- VirtualDevice( const SystemGraphicsData *pData, USHORT nBitCount );
+ VirtualDevice( const SystemGraphicsData *pData, sal_uInt16 nBitCount );
virtual ~VirtualDevice();
- BOOL SetOutputSizePixel( const Size& rNewSize, BOOL bErase = TRUE );
- BOOL SetOutputSize( const Size& rNewSize, BOOL bErase = TRUE )
+ sal_Bool SetOutputSizePixel( const Size& rNewSize, sal_Bool bErase = sal_True );
+ sal_Bool SetOutputSize( const Size& rNewSize, sal_Bool bErase = sal_True )
{ return SetOutputSizePixel( LogicToPixel( rNewSize ), bErase ); }
// reference device modes for different compatibility levels
diff --git a/vcl/inc/vcl/wall.hxx b/vcl/inc/vcl/wall.hxx
index 0011501392be..66a2a11038ed 100644
--- a/vcl/inc/vcl/wall.hxx
+++ b/vcl/inc/vcl/wall.hxx
@@ -90,7 +90,7 @@ class VCL_DLLPUBLIC Wallpaper
private:
ImplWallpaper* mpImplWallpaper;
- SAL_DLLPRIVATE void ImplMakeUnique( BOOL bReleaseCache = TRUE );
+ SAL_DLLPRIVATE void ImplMakeUnique( sal_Bool bReleaseCache = sal_True );
SAL_DLLPRIVATE Gradient ImplGetApplicationGradient() const;
public:
@@ -114,26 +114,26 @@ public:
void SetBitmap( const BitmapEx& rBitmap );
void SetBitmap();
BitmapEx GetBitmap() const;
- BOOL IsBitmap() const;
+ sal_Bool IsBitmap() const;
void SetGradient( const Gradient& rGradient );
void SetGradient();
Gradient GetGradient() const;
- BOOL IsGradient() const;
+ sal_Bool IsGradient() const;
void SetRect( const Rectangle& rRect );
void SetRect();
Rectangle GetRect() const;
- BOOL IsRect() const;
+ sal_Bool IsRect() const;
- BOOL IsFixed() const;
- BOOL IsScrollable() const;
+ sal_Bool IsFixed() const;
+ sal_Bool IsScrollable() const;
Wallpaper& operator=( const Wallpaper& rWallpaper );
- BOOL operator==( const Wallpaper& rWallpaper ) const;
- BOOL operator!=( const Wallpaper& rWallpaper ) const
+ sal_Bool operator==( const Wallpaper& rWallpaper ) const;
+ sal_Bool operator!=( const Wallpaper& rWallpaper ) const
{ return !(Wallpaper::operator==( rWallpaper )); }
- BOOL IsSameInstance( const Wallpaper& rWallpaper ) const
+ sal_Bool IsSameInstance( const Wallpaper& rWallpaper ) const
{ return (mpImplWallpaper == rWallpaper.mpImplWallpaper); }
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Wallpaper& rWallpaper );
diff --git a/vcl/inc/vcl/wall2.hxx b/vcl/inc/vcl/wall2.hxx
index 311ad3b9cf1c..162614262095 100644
--- a/vcl/inc/vcl/wall2.hxx
+++ b/vcl/inc/vcl/wall2.hxx
@@ -41,7 +41,7 @@ private:
Gradient* mpGradient;
Rectangle* mpRect;
WallpaperStyle meStyle;
- ULONG mnRefCount;
+ sal_uLong mnRefCount;
BitmapEx* mpCache;
friend SvStream& operator>>( SvStream& rIStm, ImplWallpaper& rImplWallpaper );
diff --git a/vcl/inc/vcl/windata.hxx b/vcl/inc/vcl/windata.hxx
deleted file mode 100644
index bd8815b83f77..000000000000
--- a/vcl/inc/vcl/windata.hxx
+++ /dev/null
@@ -1,52 +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 _SV_WINDATA_HXX
-#define _SV_WINDATA_HXX
-
-#include <vcl/sv.h>
-
-class SalFrame;
-class Window;
-
-// --------------
-// - Prototypes -
-// --------------
-
-long ImplWindowFrameProc( Window* pInst, SalFrame* pFrame, USHORT nEvent, const void* pEvent );
-
-// -----------
-// - HitTest -
-// -----------
-
-#define WINDOW_HITTEST_INSIDE ((USHORT)0x0001)
-#define WINDOW_HITTEST_TRANSPARENT ((USHORT)0x0002)
-
-#endif // _SV_WINDATA_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/window.h b/vcl/inc/vcl/window.h
index d52616a1c183..12f6eedc2906 100644
--- a/vcl/inc/vcl/window.h
+++ b/vcl/inc/vcl/window.h
@@ -39,7 +39,7 @@
#ifndef _SV_POINTR_HXX
#include <vcl/pointr.hxx>
#endif
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <vcl/vclevent.hxx>
#include <com/sun/star/uno/Reference.hxx>
#include <cppuhelper/weakref.hxx>
@@ -57,7 +57,6 @@ class VirtualDevice;
class Cursor;
class ImplDevFontList;
class ImplFontCache;
-class SmartId;
class VCLXWindow;
class SalFrame;
class SalObject;
@@ -100,10 +99,24 @@ namespace dnd {
class XDropTarget;
} } } } }
-namespace vcl { struct ControlLayoutData; }
+namespace vcl {
+ struct ControlLayoutData;
+ struct ExtWindowImpl;
+}
+
+// --------------
+// - Prototypes -
+// --------------
+long ImplWindowFrameProc( Window* pInst, SalFrame* pFrame, sal_uInt16 nEvent, const void* pEvent );
+// -----------
+// - HitTest -
+// -----------
+
+#define WINDOW_HITTEST_INSIDE ((sal_uInt16)0x0001)
+#define WINDOW_HITTEST_TRANSPARENT ((sal_uInt16)0x0002)
// ---------------
// - ImplWinData -
@@ -112,17 +125,15 @@ namespace vcl { struct ControlLayoutData; }
struct ImplWinData
{
UniString* mpExtOldText;
- USHORT* mpExtOldAttrAry;
+ sal_uInt16* mpExtOldAttrAry;
Rectangle* mpCursorRect;
long mnCursorExtWidth;
Rectangle* mpFocusRect;
Rectangle* mpTrackRect;
- USHORT mnTrackFlags;
- USHORT mnIsTopWindow;
- BOOL mbMouseOver; // tracks mouse over for native widget paint effect
- BOOL mbEnableNativeWidget; // toggle native widget rendering
- SmartId* mpSmartHelpId;
- SmartId* mpSmartUniqueId;
+ sal_uInt16 mnTrackFlags;
+ sal_uInt16 mnIsTopWindow;
+ sal_Bool mbMouseOver; // tracks mouse over for native widget paint effect
+ sal_Bool mbEnableNativeWidget; // toggle native widget rendering
::std::list< Window* >
maTopWindowChildren;
};
@@ -136,9 +147,9 @@ struct ImplOverlapData
VirtualDevice* mpSaveBackDev; // Gesicherte Hintergrund-Bitmap
Region* mpSaveBackRgn; // Gesicherte Region, was invalidiert werden muss
Window* mpNextBackWin; // Naechstes Fenster mit Hintergrund-Sicherung
- ULONG mnSaveBackSize; // Groesse Bitmap fuer Hintergrund-Sicherung
- BOOL mbSaveBack; // TRUE: Background sichern
- BYTE mnTopLevel; // Level for Overlap-Window
+ sal_uIntPtr mnSaveBackSize; // Groesse Bitmap fuer Hintergrund-Sicherung
+ sal_Bool mbSaveBack; // sal_True: Background sichern
+ sal_uInt8 mnTopLevel; // Level for Overlap-Window
};
// -----------------
@@ -162,9 +173,9 @@ struct ImplFrameData
sal_Int32 mnDPIX; // Original Screen Resolution
sal_Int32 mnDPIY; // Original Screen Resolution
ImplMapRes maMapUnitRes; // for LogicUnitToPixel
- ULONG mnAllSaveBackSize; // Groesse aller Bitmaps fuer Hintergrund-Sicherung
- ULONG mnFocusId; // FocusId for PostUserLink
- ULONG mnMouseMoveId; // MoveId for PostUserLink
+ sal_uIntPtr mnAllSaveBackSize; // Groesse aller Bitmaps fuer Hintergrund-Sicherung
+ sal_uIntPtr mnFocusId; // FocusId for PostUserLink
+ sal_uIntPtr mnMouseMoveId; // MoveId for PostUserLink
long mnLastMouseX; // last x mouse position
long mnLastMouseY; // last y mouse position
long mnBeforeLastMouseX; // last but one x mouse position
@@ -173,23 +184,23 @@ struct ImplFrameData
long mnFirstMouseY; // first y mouse position by mousebuttondown
long mnLastMouseWinX; // last x mouse position, rel. to pMouseMoveWin
long mnLastMouseWinY; // last y mouse position, rel. to pMouseMoveWin
- USHORT mnModalMode; // frame based modal count (app based makes no sense anymore)
- ULONG mnMouseDownTime; // mouse button down time for double click
- USHORT mnClickCount; // mouse click count
- USHORT mnFirstMouseCode; // mouse code by mousebuttondown
- USHORT mnMouseCode; // mouse code
- USHORT mnMouseMode; // mouse mode
+ sal_uInt16 mnModalMode; // frame based modal count (app based makes no sense anymore)
+ sal_uIntPtr mnMouseDownTime; // mouse button down time for double click
+ sal_uInt16 mnClickCount; // mouse click count
+ sal_uInt16 mnFirstMouseCode; // mouse code by mousebuttondown
+ sal_uInt16 mnMouseCode; // mouse code
+ sal_uInt16 mnMouseMode; // mouse mode
MapUnit meMapUnit; // last MapUnit for LogicUnitToPixel
- BOOL mbHasFocus; // focus
- BOOL mbInMouseMove; // is MouseMove on stack
- BOOL mbMouseIn; // is Mouse inside the frame
- BOOL mbStartDragCalled; // is command startdrag called
- BOOL mbNeedSysWindow; // set, when FrameSize <= IMPL_MIN_NEEDSYSWIN
- BOOL mbMinimized; // set, when FrameSize <= 0
- BOOL mbStartFocusState; // FocusState, beim abschicken des Events
- BOOL mbInSysObjFocusHdl; // Innerhalb vom GetFocus-Handler eines SysChilds
- BOOL mbInSysObjToTopHdl; // Innerhalb vom ToTop-Handler eines SysChilds
- BOOL mbSysObjFocus; // Hat ein SysChild den Focus
+ sal_Bool mbHasFocus; // focus
+ sal_Bool mbInMouseMove; // is MouseMove on stack
+ sal_Bool mbMouseIn; // is Mouse inside the frame
+ sal_Bool mbStartDragCalled; // is command startdrag called
+ sal_Bool mbNeedSysWindow; // set, when FrameSize <= IMPL_MIN_NEEDSYSWIN
+ sal_Bool mbMinimized; // set, when FrameSize <= 0
+ sal_Bool mbStartFocusState; // FocusState, beim abschicken des Events
+ sal_Bool mbInSysObjFocusHdl; // Innerhalb vom GetFocus-Handler eines SysChilds
+ sal_Bool mbInSysObjToTopHdl; // Innerhalb vom ToTop-Handler eines SysChilds
+ sal_Bool mbSysObjFocus; // Hat ein SysChild den Focus
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource > mxDragSource;
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTarget > mxDropTarget;
@@ -197,9 +208,27 @@ struct ImplFrameData
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxClipboard;
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxSelection;
- BOOL mbInternalDragGestureRecognizer;
+ sal_Bool mbInternalDragGestureRecognizer;
+};
+
+// -----------------------
+// - ImplAccessibleInfos -
+// -----------------------
+
+struct ImplAccessibleInfos
+{
+ sal_uInt16 nAccessibleRole;
+ String* pAccessibleName;
+ String* pAccessibleDescription;
+ Window* pLabeledByWindow;
+ Window* pLabelForWindow;
+ Window* pMemberOfWindow;
+
+ ImplAccessibleInfos();
+ ~ImplAccessibleInfos();
};
+
// ---------------
// - WindowImpl -
// ---------------
@@ -240,6 +269,7 @@ public:
ImplDelData* mpFirstDel;
void* mpUserData;
+ vcl::ExtWindowImpl* mpExtImpl;
Cursor* mpCursor;
Pointer maPointer;
Fraction maZoom;
@@ -255,8 +285,8 @@ public:
long mnY;
long mnAbsScreenX;
Point maPos;
- ULONG mnHelpId;
- ULONG mnUniqId;
+ rtl::OString maHelpId;
+ rtl::OString maUniqId;
XubString maHelpText;
XubString maQuickHelpText;
InputContext maInputContext;
@@ -275,15 +305,15 @@ public:
WinBits mnPrevExtendedStyle;
WindowType mnType;
ControlPart mnNativeBackground;
- USHORT mnWaitCount;
- USHORT mnPaintFlags;
- USHORT mnGetFocusFlags;
- USHORT mnParentClipMode;
- USHORT mnActivateMode;
- USHORT mnDlgCtrlFlags;
- USHORT mnLockCount;
+ sal_uInt16 mnWaitCount;
+ sal_uInt16 mnPaintFlags;
+ sal_uInt16 mnGetFocusFlags;
+ sal_uInt16 mnParentClipMode;
+ sal_uInt16 mnActivateMode;
+ sal_uInt16 mnDlgCtrlFlags;
+ sal_uInt16 mnLockCount;
AlwaysInputMode meAlwaysInputMode;
- BOOL mbFrame:1,
+ sal_Bool mbFrame:1,
mbBorderWin:1,
mbOverlapWin:1,
mbSysWin:1,
@@ -356,7 +386,8 @@ public:
mbDisableAccessibleLabelForRelation:1,
mbDisableAccessibleLabeledByRelation:1,
mbHelpTextDynamic:1,
- mbFakeFocusSet:1;
+ mbFakeFocusSet:1,
+ mbInterceptChildWindowKeyDown:1;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxDNDListenerContainer;
};
@@ -365,9 +396,9 @@ public:
// - Hilfsmethoden -
// -----------------
-long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
- long nX, long nY, ULONG nMsgTime,
- USHORT nCode, USHORT nMode );
+long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouseLeave,
+ long nX, long nY, sal_uIntPtr nMsgTime,
+ sal_uInt16 nCode, sal_uInt16 nMode );
void ImplHandleResize( Window* pWindow, long nNewWidth, long nNewHeight );
#endif // _SV_WINDOW_H
diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx
index 172e099a236d..df82b7870854 100644..100755
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -34,7 +34,7 @@
#include <vcl/outdev.hxx>
#include <tools/resid.hxx>
#include <vcl/pointr.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <vcl/apptypes.hxx>
#include <vcl/inputctx.hxx>
#include <vcl/vclevent.hxx>
@@ -45,7 +45,7 @@
#include <rtl/ustring.hxx>
#include <cppuhelper/weakref.hxx>
#include <com/sun/star/uno/Reference.hxx>
-#include <vcl/smartid.hxx>
+#include <boost/shared_ptr.hpp>
class VirtualDevice;
struct ImplDelData;
@@ -90,6 +90,13 @@ namespace accessibility {
namespace com {
namespace sun {
namespace star {
+namespace beans {
+ struct PropertyValue;
+}}}}
+
+namespace com {
+namespace sun {
+namespace star {
namespace rendering {
class XCanvas;
class XSpriteCanvas;
@@ -117,7 +124,11 @@ namespace dnd {
class XDropTarget;
} } } } }
-namespace vcl { struct ControlLayoutData; }
+namespace vcl {
+ struct ControlLayoutData;
+ class WindowArranger;
+ struct ExtWindowImpl;
+}
namespace svt { class PopupWindowControllerImpl; }
@@ -126,113 +137,113 @@ namespace svt { class PopupWindowControllerImpl; }
// ---------------
// Type fuer GetWindow()
-#define WINDOW_PARENT ((USHORT)0)
-#define WINDOW_FIRSTCHILD ((USHORT)1)
-#define WINDOW_LASTCHILD ((USHORT)2)
-#define WINDOW_PREV ((USHORT)3)
-#define WINDOW_NEXT ((USHORT)4)
-#define WINDOW_FIRSTOVERLAP ((USHORT)5)
-#define WINDOW_LASTOVERLAP ((USHORT)6)
-#define WINDOW_OVERLAP ((USHORT)7)
-#define WINDOW_PARENTOVERLAP ((USHORT)8)
-#define WINDOW_CLIENT ((USHORT)9)
-#define WINDOW_REALPARENT ((USHORT)10)
-#define WINDOW_FRAME ((USHORT)11)
-#define WINDOW_BORDER ((USHORT)12)
-#define WINDOW_FIRSTTOPWINDOWCHILD ((USHORT)13)
-#define WINDOW_LASTTOPWINDOWCHILD ((USHORT)14)
-#define WINDOW_PREVTOPWINDOWSIBLING ((USHORT)15)
-#define WINDOW_NEXTTOPWINDOWSIBLING ((USHORT)16)
+#define WINDOW_PARENT ((sal_uInt16)0)
+#define WINDOW_FIRSTCHILD ((sal_uInt16)1)
+#define WINDOW_LASTCHILD ((sal_uInt16)2)
+#define WINDOW_PREV ((sal_uInt16)3)
+#define WINDOW_NEXT ((sal_uInt16)4)
+#define WINDOW_FIRSTOVERLAP ((sal_uInt16)5)
+#define WINDOW_LASTOVERLAP ((sal_uInt16)6)
+#define WINDOW_OVERLAP ((sal_uInt16)7)
+#define WINDOW_PARENTOVERLAP ((sal_uInt16)8)
+#define WINDOW_CLIENT ((sal_uInt16)9)
+#define WINDOW_REALPARENT ((sal_uInt16)10)
+#define WINDOW_FRAME ((sal_uInt16)11)
+#define WINDOW_BORDER ((sal_uInt16)12)
+#define WINDOW_FIRSTTOPWINDOWCHILD ((sal_uInt16)13)
+#define WINDOW_LASTTOPWINDOWCHILD ((sal_uInt16)14)
+#define WINDOW_PREVTOPWINDOWSIBLING ((sal_uInt16)15)
+#define WINDOW_NEXTTOPWINDOWSIBLING ((sal_uInt16)16)
// Flags for SetPosSizePixel()
-#define WINDOW_POSSIZE_X ((USHORT)0x0001)
-#define WINDOW_POSSIZE_Y ((USHORT)0x0002)
-#define WINDOW_POSSIZE_WIDTH ((USHORT)0x0004)
-#define WINDOW_POSSIZE_HEIGHT ((USHORT)0x0008)
+#define WINDOW_POSSIZE_X ((sal_uInt16)0x0001)
+#define WINDOW_POSSIZE_Y ((sal_uInt16)0x0002)
+#define WINDOW_POSSIZE_WIDTH ((sal_uInt16)0x0004)
+#define WINDOW_POSSIZE_HEIGHT ((sal_uInt16)0x0008)
#define WINDOW_POSSIZE_POS (WINDOW_POSSIZE_X | WINDOW_POSSIZE_Y)
#define WINDOW_POSSIZE_SIZE (WINDOW_POSSIZE_WIDTH | WINDOW_POSSIZE_HEIGHT)
#define WINDOW_POSSIZE_POSSIZE (WINDOW_POSSIZE_POS | WINDOW_POSSIZE_SIZE)
#define WINDOW_POSSIZE_ALL (WINDOW_POSSIZE_POSSIZE)
-#define WINDOW_POSSIZE_DROPDOWN ((USHORT)0x0010)
+#define WINDOW_POSSIZE_DROPDOWN ((sal_uInt16)0x0010)
// Flags for Show()
-#define SHOW_NOPARENTUPDATE ((USHORT)0x0001)
-#define SHOW_NOFOCUSCHANGE ((USHORT)0x0002)
-#define SHOW_NOACTIVATE ((USHORT)0x0004)
-#define SHOW_FOREGROUNDTASK ((USHORT)0x0008)
+#define SHOW_NOPARENTUPDATE ((sal_uInt16)0x0001)
+#define SHOW_NOFOCUSCHANGE ((sal_uInt16)0x0002)
+#define SHOW_NOACTIVATE ((sal_uInt16)0x0004)
+#define SHOW_FOREGROUNDTASK ((sal_uInt16)0x0008)
// Flags for SetZOrder()
-#define WINDOW_ZORDER_BEFOR ((USHORT)0x0001)
-#define WINDOW_ZORDER_BEHIND ((USHORT)0x0002)
-#define WINDOW_ZORDER_FIRST ((USHORT)0x0004)
-#define WINDOW_ZORDER_LAST ((USHORT)0x0008)
+#define WINDOW_ZORDER_BEFOR ((sal_uInt16)0x0001)
+#define WINDOW_ZORDER_BEHIND ((sal_uInt16)0x0002)
+#define WINDOW_ZORDER_FIRST ((sal_uInt16)0x0004)
+#define WINDOW_ZORDER_LAST ((sal_uInt16)0x0008)
// Activate-Flags
-#define ACTIVATE_MODE_GRABFOCUS ((USHORT)0x0001)
+#define ACTIVATE_MODE_GRABFOCUS ((sal_uInt16)0x0001)
// ToTop-Flags
-#define TOTOP_RESTOREWHENMIN ((USHORT)0x0001)
-#define TOTOP_FOREGROUNDTASK ((USHORT)0x0002)
-#define TOTOP_NOGRABFOCUS ((USHORT)0x0004)
-#define TOTOP_GRABFOCUSONLY ((USHORT)0x0008)
+#define TOTOP_RESTOREWHENMIN ((sal_uInt16)0x0001)
+#define TOTOP_FOREGROUNDTASK ((sal_uInt16)0x0002)
+#define TOTOP_NOGRABFOCUS ((sal_uInt16)0x0004)
+#define TOTOP_GRABFOCUSONLY ((sal_uInt16)0x0008)
// Flags for Invalidate
-#define INVALIDATE_CHILDREN ((USHORT)0x0001)
-#define INVALIDATE_NOCHILDREN ((USHORT)0x0002)
-#define INVALIDATE_NOERASE ((USHORT)0x0004)
-#define INVALIDATE_UPDATE ((USHORT)0x0008)
-#define INVALIDATE_TRANSPARENT ((USHORT)0x0010)
-#define INVALIDATE_NOTRANSPARENT ((USHORT)0x0020)
-#define INVALIDATE_NOCLIPCHILDREN ((USHORT)0x4000)
+#define INVALIDATE_CHILDREN ((sal_uInt16)0x0001)
+#define INVALIDATE_NOCHILDREN ((sal_uInt16)0x0002)
+#define INVALIDATE_NOERASE ((sal_uInt16)0x0004)
+#define INVALIDATE_UPDATE ((sal_uInt16)0x0008)
+#define INVALIDATE_TRANSPARENT ((sal_uInt16)0x0010)
+#define INVALIDATE_NOTRANSPARENT ((sal_uInt16)0x0020)
+#define INVALIDATE_NOCLIPCHILDREN ((sal_uInt16)0x4000)
// Temporaer fuer Kompatibilitaet
#define INVALIDATE_BACKGROUND INVALIDATE_TRANSPARENT
// Flags for Validate
-#define VALIDATE_CHILDREN ((USHORT)0x0001)
-#define VALIDATE_NOCHILDREN ((USHORT)0x0002)
+#define VALIDATE_CHILDREN ((sal_uInt16)0x0001)
+#define VALIDATE_NOCHILDREN ((sal_uInt16)0x0002)
// Flags for Scroll
-#define SCROLL_CLIP ((USHORT)0x0001)
-#define SCROLL_CHILDREN ((USHORT)0x0002)
-#define SCROLL_NOCHILDREN ((USHORT)0x0004)
-#define SCROLL_NOERASE ((USHORT)0x0008)
-#define SCROLL_NOINVALIDATE ((USHORT)0x0010)
-#define SCROLL_NOWINDOWINVALIDATE ((USHORT)0x0020)
-#define SCROLL_USECLIPREGION ((USHORT)0x0040)
-#define SCROLL_UPDATE ((USHORT)0x0080)
+#define SCROLL_CLIP ((sal_uInt16)0x0001)
+#define SCROLL_CHILDREN ((sal_uInt16)0x0002)
+#define SCROLL_NOCHILDREN ((sal_uInt16)0x0004)
+#define SCROLL_NOERASE ((sal_uInt16)0x0008)
+#define SCROLL_NOINVALIDATE ((sal_uInt16)0x0010)
+#define SCROLL_NOWINDOWINVALIDATE ((sal_uInt16)0x0020)
+#define SCROLL_USECLIPREGION ((sal_uInt16)0x0040)
+#define SCROLL_UPDATE ((sal_uInt16)0x0080)
// Flags for ParentClipMode
-#define PARENTCLIPMODE_CLIP ((USHORT)0x0001)
-#define PARENTCLIPMODE_NOCLIP ((USHORT)0x0002)
+#define PARENTCLIPMODE_CLIP ((sal_uInt16)0x0001)
+#define PARENTCLIPMODE_NOCLIP ((sal_uInt16)0x0002)
// Flags for Invert()
-#define INVERT_HIGHLIGHT ((USHORT)0x0001)
-#define INVERT_50 ((USHORT)0x0002)
+#define INVERT_HIGHLIGHT ((sal_uInt16)0x0001)
+#define INVERT_50 ((sal_uInt16)0x0002)
// Flags for ShowTracking()
-#define SHOWTRACK_SMALL ((USHORT)0x0001)
-#define SHOWTRACK_BIG ((USHORT)0x0002)
-#define SHOWTRACK_SPLIT ((USHORT)0x0003)
-#define SHOWTRACK_OBJECT ((USHORT)0x0004)
-#define SHOWTRACK_WINDOW ((USHORT)0x1000)
-#define SHOWTRACK_CLIP ((USHORT)0x2000)
-#define SHOWTRACK_STYLE ((USHORT)0x000F)
+#define SHOWTRACK_SMALL ((sal_uInt16)0x0001)
+#define SHOWTRACK_BIG ((sal_uInt16)0x0002)
+#define SHOWTRACK_SPLIT ((sal_uInt16)0x0003)
+#define SHOWTRACK_OBJECT ((sal_uInt16)0x0004)
+#define SHOWTRACK_WINDOW ((sal_uInt16)0x1000)
+#define SHOWTRACK_CLIP ((sal_uInt16)0x2000)
+#define SHOWTRACK_STYLE ((sal_uInt16)0x000F)
// Flags for StartTracking()
-#define STARTTRACK_KEYINPUT ((USHORT)0x0001)
-#define STARTTRACK_KEYMOD ((USHORT)0x0002)
-#define STARTTRACK_NOKEYCANCEL ((USHORT)0x0004)
-#define STARTTRACK_SCROLLREPEAT ((USHORT)0x0008)
-#define STARTTRACK_BUTTONREPEAT ((USHORT)0x0010)
-#define STARTTRACK_MOUSEBUTTONDOWN ((USHORT)0x0020)
-#define STARTTRACK_FOCUSCANCEL ((USHORT)0x0040)
+#define STARTTRACK_KEYINPUT ((sal_uInt16)0x0001)
+#define STARTTRACK_KEYMOD ((sal_uInt16)0x0002)
+#define STARTTRACK_NOKEYCANCEL ((sal_uInt16)0x0004)
+#define STARTTRACK_SCROLLREPEAT ((sal_uInt16)0x0008)
+#define STARTTRACK_BUTTONREPEAT ((sal_uInt16)0x0010)
+#define STARTTRACK_MOUSEBUTTONDOWN ((sal_uInt16)0x0020)
+#define STARTTRACK_FOCUSCANCEL ((sal_uInt16)0x0040)
// Flags for StartAutoScroll()
-#define AUTOSCROLL_VERT ((USHORT)0x0001)
-#define AUTOSCROLL_HORZ ((USHORT)0x0002)
+#define AUTOSCROLL_VERT ((sal_uInt16)0x0001)
+#define AUTOSCROLL_HORZ ((sal_uInt16)0x0002)
// Flags for StateChanged()
-typedef USHORT StateChangedType;
+typedef sal_uInt16 StateChangedType;
#define STATE_CHANGE_INITSHOW ((StateChangedType)1)
#define STATE_CHANGE_VISIBLE ((StateChangedType)2)
#define STATE_CHANGE_UPDATEMODE ((StateChangedType)3)
@@ -255,49 +266,49 @@ typedef USHORT StateChangedType;
#define STATE_CHANGE_USER ((StateChangedType)10000)
// GetFocusFlags
-#define GETFOCUS_TAB ((USHORT)0x0001)
-#define GETFOCUS_CURSOR ((USHORT)0x0002)
-#define GETFOCUS_MNEMONIC ((USHORT)0x0004)
-#define GETFOCUS_FORWARD ((USHORT)0x0010)
-#define GETFOCUS_BACKWARD ((USHORT)0x0020)
-#define GETFOCUS_AROUND ((USHORT)0x0040)
-#define GETFOCUS_UNIQUEMNEMONIC ((USHORT)0x0100)
-#define GETFOCUS_INIT ((USHORT)0x0200)
-#define GETFOCUS_FLOATWIN_POPUPMODEEND_CANCEL ((USHORT)0x0400)
+#define GETFOCUS_TAB ((sal_uInt16)0x0001)
+#define GETFOCUS_CURSOR ((sal_uInt16)0x0002)
+#define GETFOCUS_MNEMONIC ((sal_uInt16)0x0004)
+#define GETFOCUS_FORWARD ((sal_uInt16)0x0010)
+#define GETFOCUS_BACKWARD ((sal_uInt16)0x0020)
+#define GETFOCUS_AROUND ((sal_uInt16)0x0040)
+#define GETFOCUS_UNIQUEMNEMONIC ((sal_uInt16)0x0100)
+#define GETFOCUS_INIT ((sal_uInt16)0x0200)
+#define GETFOCUS_FLOATWIN_POPUPMODEEND_CANCEL ((sal_uInt16)0x0400)
// Draw-Flags fuer Draw()
-#define WINDOW_DRAW_MONO ((ULONG)0x00000001)
-#define WINDOW_DRAW_NOBORDER ((ULONG)0x00000002)
-#define WINDOW_DRAW_NOCONTROLS ((ULONG)0x00000004)
-#define WINDOW_DRAW_NODISABLE ((ULONG)0x00000008)
-#define WINDOW_DRAW_NOMNEMONIC ((ULONG)0x00000010)
-#define WINDOW_DRAW_NOSELECTION ((ULONG)0x00000020)
-#define WINDOW_DRAW_NOFOCUS ((ULONG)0x00000040)
-#define WINDOW_DRAW_NOBACKGROUND ((ULONG)0x00000080)
-#define WINDOW_DRAW_ROLLOVER ((ULONG)0x00000100)
+#define WINDOW_DRAW_MONO ((sal_uLong)0x00000001)
+#define WINDOW_DRAW_NOBORDER ((sal_uLong)0x00000002)
+#define WINDOW_DRAW_NOCONTROLS ((sal_uLong)0x00000004)
+#define WINDOW_DRAW_NODISABLE ((sal_uLong)0x00000008)
+#define WINDOW_DRAW_NOMNEMONIC ((sal_uLong)0x00000010)
+#define WINDOW_DRAW_NOSELECTION ((sal_uLong)0x00000020)
+#define WINDOW_DRAW_NOFOCUS ((sal_uLong)0x00000040)
+#define WINDOW_DRAW_NOBACKGROUND ((sal_uLong)0x00000080)
+#define WINDOW_DRAW_ROLLOVER ((sal_uLong)0x00000100)
// Border-Styles fuer SetBorder()
-#define WINDOW_BORDER_NORMAL ((USHORT)0x0001)
-#define WINDOW_BORDER_MONO ((USHORT)0x0002)
-#define WINDOW_BORDER_ACTIVE ((USHORT)0x0004)
-#define WINDOW_BORDER_DOUBLEOUT ((USHORT)0x0008)
-#define WINDOW_BORDER_MENU ((USHORT)0x0010)
-#define WINDOW_BORDER_NOBORDER ((USHORT)0x1000)
-#define WINDOW_BORDER_REMOVEBORDER ((USHORT)0x2000)
+#define WINDOW_BORDER_NORMAL ((sal_uInt16)0x0001)
+#define WINDOW_BORDER_MONO ((sal_uInt16)0x0002)
+#define WINDOW_BORDER_ACTIVE ((sal_uInt16)0x0004)
+#define WINDOW_BORDER_DOUBLEOUT ((sal_uInt16)0x0008)
+#define WINDOW_BORDER_MENU ((sal_uInt16)0x0010)
+#define WINDOW_BORDER_NOBORDER ((sal_uInt16)0x1000)
+#define WINDOW_BORDER_REMOVEBORDER ((sal_uInt16)0x2000)
// DialogControl-Flags
-#define WINDOW_DLGCTRL_RETURN ((USHORT)0x0001)
-#define WINDOW_DLGCTRL_WANTFOCUS ((USHORT)0x0002)
-#define WINDOW_DLGCTRL_MOD1TAB ((USHORT)0x0004)
-#define WINDOW_DLGCTRL_FLOATWIN_POPUPMODEEND_CANCEL ((USHORT)0x0008)
+#define WINDOW_DLGCTRL_RETURN ((sal_uInt16)0x0001)
+#define WINDOW_DLGCTRL_WANTFOCUS ((sal_uInt16)0x0002)
+#define WINDOW_DLGCTRL_MOD1TAB ((sal_uInt16)0x0004)
+#define WINDOW_DLGCTRL_FLOATWIN_POPUPMODEEND_CANCEL ((sal_uInt16)0x0008)
// GetWindowClipRegionPixel-Flags
-#define WINDOW_GETCLIPREGION_NULL ((USHORT)0x0001)
-#define WINDOW_GETCLIPREGION_NOCHILDREN ((USHORT)0x0002)
+#define WINDOW_GETCLIPREGION_NULL ((sal_uInt16)0x0001)
+#define WINDOW_GETCLIPREGION_NOCHILDREN ((sal_uInt16)0x0002)
// EndExtTextInput-Flags
-#define EXTTEXTINPUT_END_COMPLETE ((USHORT)0x0001)
-#define EXTTEXTINPUT_END_CANCEL ((USHORT)0x0002)
+#define EXTTEXTINPUT_END_COMPLETE ((sal_uInt16)0x0001)
+#define EXTTEXTINPUT_END_CANCEL ((sal_uInt16)0x0002)
#define IMPL_MINSIZE_BUTTON_WIDTH 70
#define IMPL_MINSIZE_BUTTON_HEIGHT 22
@@ -382,7 +393,7 @@ public:
SAL_DLLPRIVATE void ImplWindowRes( const ResId& rResId );
SAL_DLLPRIVATE void ImplSetFrameParent( const Window* pParent );
SAL_DLLPRIVATE void ImplInsertWindow( Window* pParent );
- SAL_DLLPRIVATE void ImplRemoveWindow( BOOL bRemoveFrameData );
+ SAL_DLLPRIVATE void ImplRemoveWindow( sal_Bool bRemoveFrameData );
SAL_DLLPRIVATE Window* ImplGetWindow();
SAL_DLLPRIVATE ImplFrameData* ImplGetFrameData();
SAL_DLLPRIVATE SalFrame* ImplGetFrame() const;
@@ -390,26 +401,26 @@ public:
SAL_DLLPRIVATE SalGraphics* ImplGetFrameGraphics() const;
SAL_DLLPRIVATE void ImplCallFocusChangeActivate( Window* pNewOverlapWindow, Window* pOldOverlapWindow );
SAL_DLLPRIVATE Window* ImplFindWindow( const Point& rFramePos );
- SAL_DLLPRIVATE USHORT ImplHitTest( const Point& rFramePos );
+ SAL_DLLPRIVATE sal_uInt16 ImplHitTest( const Point& rFramePos );
SAL_DLLPRIVATE Window* ImplGetParent() const;
SAL_DLLPRIVATE Window* ImplGetClientWindow() const;
SAL_DLLPRIVATE Window* ImplGetBorderWindow() const;
SAL_DLLPRIVATE Window* ImplGetFirstOverlapWindow();
SAL_DLLPRIVATE const Window* ImplGetFirstOverlapWindow() const;
SAL_DLLPRIVATE Window* ImplGetFrameWindow() const;
- SAL_DLLPRIVATE BOOL ImplIsRealParentPath( const Window* pWindow ) const;
- SAL_DLLPRIVATE BOOL ImplIsChild( const Window* pWindow, BOOL bSystemWindow = FALSE ) const;
- SAL_DLLPRIVATE BOOL ImplIsWindowOrChild( const Window* pWindow, BOOL bSystemWindow = FALSE ) const;
+ SAL_DLLPRIVATE sal_Bool ImplIsRealParentPath( const Window* pWindow ) const;
+ SAL_DLLPRIVATE sal_Bool ImplIsChild( const Window* pWindow, sal_Bool bSystemWindow = sal_False ) const;
+ SAL_DLLPRIVATE sal_Bool ImplIsWindowOrChild( const Window* pWindow, sal_Bool bSystemWindow = sal_False ) const;
SAL_DLLPRIVATE Window* ImplGetSameParent( const Window* pWindow ) const;
- SAL_DLLPRIVATE BOOL ImplIsDockingWindow() const;
- SAL_DLLPRIVATE BOOL ImplIsFloatingWindow() const;
- SAL_DLLPRIVATE BOOL ImplIsToolbox() const;
- SAL_DLLPRIVATE BOOL ImplIsSplitter() const;
- SAL_DLLPRIVATE BOOL ImplIsPushButton() const;
- SAL_DLLPRIVATE BOOL ImplIsOverlapWindow() const;
- SAL_DLLPRIVATE void ImplSetActive( BOOL bActive );
- SAL_DLLPRIVATE BOOL ImplIsMouseTransparent() const;
- SAL_DLLPRIVATE void ImplSetMouseTransparent( BOOL bTransparent );
+ SAL_DLLPRIVATE sal_Bool ImplIsDockingWindow() const;
+ SAL_DLLPRIVATE sal_Bool ImplIsFloatingWindow() const;
+ SAL_DLLPRIVATE sal_Bool ImplIsToolbox() const;
+ SAL_DLLPRIVATE sal_Bool ImplIsSplitter() const;
+ SAL_DLLPRIVATE sal_Bool ImplIsPushButton() const;
+ SAL_DLLPRIVATE sal_Bool ImplIsOverlapWindow() const;
+ SAL_DLLPRIVATE void ImplSetActive( sal_Bool bActive );
+ SAL_DLLPRIVATE sal_Bool ImplIsMouseTransparent() const;
+ SAL_DLLPRIVATE void ImplSetMouseTransparent( sal_Bool bTransparent );
SAL_DLLPRIVATE int ImplTestMousePointerSet();
SAL_DLLPRIVATE PointerStyle ImplGetMousePointer() const;
SAL_DLLPRIVATE void ImplResetReallyVisible();
@@ -424,20 +435,20 @@ public:
SAL_DLLPRIVATE Point ImplFrameToOutput( const Point& rPos );
SAL_DLLPRIVATE void ImplOutputToFrame( Rectangle& rRect );
SAL_DLLPRIVATE void ImplFrameToOutput( Rectangle& rRect );
- SAL_DLLPRIVATE BOOL ImplSysObjClip( const Region* pOldRegion );
+ SAL_DLLPRIVATE sal_Bool ImplSysObjClip( const Region* pOldRegion );
SAL_DLLPRIVATE void ImplUpdateSysObjChildsClip();
SAL_DLLPRIVATE void ImplUpdateSysObjOverlapsClip();
SAL_DLLPRIVATE void ImplUpdateSysObjClip();
- SAL_DLLPRIVATE BOOL ImplSetClipFlagChilds( BOOL bSysObjOnlySmaller = FALSE );
- SAL_DLLPRIVATE BOOL ImplSetClipFlagOverlapWindows( BOOL bSysObjOnlySmaller = FALSE );
- SAL_DLLPRIVATE BOOL ImplSetClipFlag( BOOL bSysObjOnlySmaller = FALSE );
+ SAL_DLLPRIVATE sal_Bool ImplSetClipFlagChilds( sal_Bool bSysObjOnlySmaller = sal_False );
+ SAL_DLLPRIVATE sal_Bool ImplSetClipFlagOverlapWindows( sal_Bool bSysObjOnlySmaller = sal_False );
+ SAL_DLLPRIVATE sal_Bool ImplSetClipFlag( sal_Bool bSysObjOnlySmaller = sal_False );
SAL_DLLPRIVATE void ImplIntersectWindowClipRegion( Region& rRegion );
SAL_DLLPRIVATE void ImplIntersectWindowRegion( Region& rRegion );
SAL_DLLPRIVATE void ImplExcludeWindowRegion( Region& rRegion );
SAL_DLLPRIVATE void ImplExcludeOverlapWindows( Region& rRegion );
SAL_DLLPRIVATE void ImplExcludeOverlapWindows2( Region& rRegion );
- SAL_DLLPRIVATE void ImplClipBoundaries( Region& rRegion, BOOL bThis, BOOL bOverlaps );
- SAL_DLLPRIVATE BOOL ImplClipChilds( Region& rRegion );
+ SAL_DLLPRIVATE void ImplClipBoundaries( Region& rRegion, sal_Bool bThis, sal_Bool bOverlaps );
+ SAL_DLLPRIVATE sal_Bool ImplClipChilds( Region& rRegion );
SAL_DLLPRIVATE void ImplClipAllChilds( Region& rRegion );
SAL_DLLPRIVATE void ImplClipSiblings( Region& rRegion );
SAL_DLLPRIVATE void ImplInitWinClipRegion();
@@ -447,26 +458,30 @@ public:
SAL_DLLPRIVATE void ImplIntersectAndUnionOverlapWindows2( const Region& rInterRegion, Region& rRegion );
SAL_DLLPRIVATE void ImplCalcOverlapRegionOverlaps( const Region& rInterRegion, Region& rRegion );
SAL_DLLPRIVATE void ImplCalcOverlapRegion( const Rectangle& rSourceRect, Region& rRegion,
- BOOL bChilds, BOOL bParent, BOOL bSiblings );
- SAL_DLLPRIVATE void ImplCallPaint( const Region* pRegion, USHORT nPaintFlags );
+ sal_Bool bChilds, sal_Bool bParent, sal_Bool bSiblings );
+ SAL_DLLPRIVATE void ImplCallPaint( const Region* pRegion, sal_uInt16 nPaintFlags );
SAL_DLLPRIVATE void ImplCallOverlapPaint();
SAL_DLLPRIVATE void ImplPostPaint();
- SAL_DLLPRIVATE void ImplInvalidateFrameRegion( const Region* pRegion, USHORT nFlags );
+ SAL_DLLPRIVATE void ImplInvalidateFrameRegion( const Region* pRegion, sal_uInt16 nFlags );
SAL_DLLPRIVATE void ImplInvalidateOverlapFrameRegion( const Region& rRegion );
SAL_DLLPRIVATE void ImplInvalidateParentFrameRegion( Region& rRegion );
- SAL_DLLPRIVATE void ImplInvalidate( const Region* rRegion, USHORT nFlags );
- SAL_DLLPRIVATE void ImplValidateFrameRegion( const Region* rRegion, USHORT nFlags );
- SAL_DLLPRIVATE void ImplValidate( const Region* rRegion, USHORT nFlags );
- SAL_DLLPRIVATE void ImplMoveInvalidateRegion( const Rectangle& rRect, long nHorzScroll, long nVertScroll, BOOL bChilds );
- SAL_DLLPRIVATE void ImplMoveAllInvalidateRegions( const Rectangle& rRect, long nHorzScroll, long nVertScroll, BOOL bChilds );
- SAL_DLLPRIVATE void ImplScroll( const Rectangle& rRect, long nHorzScroll, long nVertScroll, USHORT nFlags );
- SAL_DLLPRIVATE void ImplUpdateAll( BOOL bOverlapWindows = TRUE );
+ SAL_DLLPRIVATE void ImplInvalidate( const Region* rRegion, sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplValidateFrameRegion( const Region* rRegion, sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplValidate( const Region* rRegion, sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplMoveInvalidateRegion( const Rectangle& rRect, long nHorzScroll, long nVertScroll, sal_Bool bChilds );
+ SAL_DLLPRIVATE void ImplMoveAllInvalidateRegions( const Rectangle& rRect, long nHorzScroll, long nVertScroll, sal_Bool bChilds );
+ SAL_DLLPRIVATE void ImplScroll( const Rectangle& rRect, long nHorzScroll, long nVertScroll, sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplUpdateAll( sal_Bool bOverlapWindows = sal_True );
SAL_DLLPRIVATE void ImplUpdateWindowPtr( Window* pWindow );
SAL_DLLPRIVATE void ImplUpdateWindowPtr();
- SAL_DLLPRIVATE void ImplUpdateOverlapWindowPtr( BOOL bNewFrame );
- SAL_DLLPRIVATE BOOL ImplUpdatePos();
+ SAL_DLLPRIVATE void ImplUpdateOverlapWindowPtr( sal_Bool bNewFrame );
+ SAL_DLLPRIVATE sal_Bool ImplUpdatePos();
SAL_DLLPRIVATE void ImplUpdateSysObjPos();
SAL_DLLPRIVATE WindowImpl* ImplGetWindowImpl() const { return mpWindowImpl; }
+ SAL_DLLPRIVATE void ImplFreeExtWindowImpl();
+ // creates ExtWindowImpl on demand, but may return NULL (e.g. if mbInDtor)
+ SAL_DLLPRIVATE vcl::ExtWindowImpl* ImplGetExtWindowImpl() const;
+ SAL_DLLPRIVATE void ImplDeleteOwnedChildren();
/** check whether a font is suitable for UI
The font to be tested will be checked whether it could display a
@@ -481,34 +496,34 @@ public:
<FALSE/> if the font is unsuitable as UI font
*/
SAL_DLLPRIVATE bool ImplCheckUIFont( const Font& rFont );
- SAL_DLLPRIVATE void ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl = TRUE );
+ SAL_DLLPRIVATE void ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl = sal_True );
SAL_DLLPRIVATE void ImplAlignChilds();
- SAL_DLLPRIVATE void ImplPosSizeWindow( long nX, long nY, long nWidth, long nHeight, USHORT nFlags );
+ SAL_DLLPRIVATE void ImplPosSizeWindow( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags );
SAL_DLLPRIVATE void ImplToBottomChild();
SAL_DLLPRIVATE void ImplCalcToTop( ImplCalcToTopData* pPrevData );
SAL_DLLPRIVATE void ImplCalcChildOverlapToTop( ImplCalcToTopData* pPrevData );
- SAL_DLLPRIVATE void ImplToTop( USHORT nFlags );
- SAL_DLLPRIVATE void ImplStartToTop( USHORT nFlags );
- SAL_DLLPRIVATE void ImplFocusToTop( USHORT nFlags, BOOL bReallyVisible );
+ SAL_DLLPRIVATE void ImplToTop( sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplStartToTop( sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplFocusToTop( sal_uInt16 nFlags, sal_Bool bReallyVisible );
SAL_DLLPRIVATE void ImplShowAllOverlaps();
SAL_DLLPRIVATE void ImplHideAllOverlaps();
SAL_DLLPRIVATE void ImplNotifyKeyMouseCommandEventListeners( NotifyEvent& rNEvt );
- SAL_DLLPRIVATE void ImplCallMouseMove( USHORT nMouseCode, BOOL bModChanged = FALSE );
+ SAL_DLLPRIVATE void ImplCallMouseMove( sal_uInt16 nMouseCode, sal_Bool bModChanged = sal_False );
SAL_DLLPRIVATE void ImplGenerateMouseMove();
- SAL_DLLPRIVATE void ImplGrabFocus( USHORT nFlags );
+ SAL_DLLPRIVATE void ImplGrabFocus( sal_uInt16 nFlags );
SAL_DLLPRIVATE void ImplInvertFocus( const Rectangle& rRect );
- SAL_DLLPRIVATE void ImplControlFocus( USHORT nFlags = 0 );
- SAL_DLLPRIVATE Window* ImplGetDlgWindow( USHORT n, USHORT nType, USHORT nStart = 0, USHORT nEnd = 0xFFFF, USHORT* pIndex = NULL );
- SAL_DLLPRIVATE BOOL ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput );
- SAL_DLLPRIVATE BOOL ImplHasDlgCtrl();
+ SAL_DLLPRIVATE void ImplControlFocus( sal_uInt16 nFlags = 0 );
+ SAL_DLLPRIVATE Window* ImplGetDlgWindow( sal_uInt16 n, sal_uInt16 nType, sal_uInt16 nStart = 0, sal_uInt16 nEnd = 0xFFFF, sal_uInt16* pIndex = NULL );
+ SAL_DLLPRIVATE sal_Bool ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput );
+ SAL_DLLPRIVATE sal_Bool ImplHasDlgCtrl();
SAL_DLLPRIVATE void ImplDlgCtrlNextWindow();
- SAL_DLLPRIVATE void ImplDlgCtrlFocusChanged( Window* pWindow, BOOL bGetFocus );
+ SAL_DLLPRIVATE void ImplDlgCtrlFocusChanged( Window* pWindow, sal_Bool bGetFocus );
SAL_DLLPRIVATE Window* ImplFindDlgCtrlWindow( Window* pWindow );
SAL_DLLPRIVATE long ImplLogicUnitToPixelX( long nX, MapUnit eUnit );
SAL_DLLPRIVATE long ImplLogicUnitToPixelY( long nY, MapUnit eUnit );
- SAL_DLLPRIVATE BOOL ImplIsWindowInFront( const Window* pTestWindow ) const;
+ SAL_DLLPRIVATE sal_Bool ImplIsWindowInFront( const Window* pTestWindow ) const;
SAL_DLLPRIVATE void ImplSaveOverlapBackground();
- SAL_DLLPRIVATE BOOL ImplRestoreOverlapBackground( Region& rInvRegion );
+ SAL_DLLPRIVATE sal_Bool ImplRestoreOverlapBackground( Region& rInvRegion );
SAL_DLLPRIVATE void ImplDeleteOverlapBackground();
SAL_DLLPRIVATE void ImplInvalidateAllOverlapBackgrounds();
SAL_DLLPRIVATE static void ImplNewInputContext();
@@ -524,14 +539,15 @@ public:
SAL_DLLPRIVATE static void ImplCalcSymbolRect( Rectangle& rRect );
SAL_DLLPRIVATE void ImplHandleScroll( ScrollBar* pHScrl, long nX, ScrollBar* pVScrl, long nY );
- SAL_DLLPRIVATE BOOL ImplGetCurrentBackgroundColor( Color& rCol );
- SAL_DLLPRIVATE BOOL ImplIsAccessibleCandidate() const;
- SAL_DLLPRIVATE BOOL ImplIsAccessibleNativeFrame() const;
- SAL_DLLPRIVATE USHORT ImplGetAccessibleCandidateChildWindowCount( USHORT nFirstWindowType ) const;
- SAL_DLLPRIVATE Window* ImplGetAccessibleCandidateChild( USHORT nChild, USHORT& rChildCount, USHORT nFirstWindowType, BOOL bTopLevel = TRUE ) const;
- SAL_DLLPRIVATE BOOL ImplRegisterAccessibleNativeFrame();
+ SAL_DLLPRIVATE sal_Bool ImplGetCurrentBackgroundColor( Color& rCol );
+ SAL_DLLPRIVATE sal_Bool ImplIsAccessibleCandidate() const;
+ SAL_DLLPRIVATE sal_Bool ImplIsAccessibleNativeFrame() const;
+ SAL_DLLPRIVATE sal_uInt16 ImplGetAccessibleCandidateChildWindowCount( sal_uInt16 nFirstWindowType ) const;
+ SAL_DLLPRIVATE Window* ImplGetAccessibleCandidateChild( sal_uInt16 nChild, sal_uInt16& rChildCount, sal_uInt16 nFirstWindowType, sal_Bool bTopLevel = sal_True ) const;
+ SAL_DLLPRIVATE sal_Bool ImplRegisterAccessibleNativeFrame();
SAL_DLLPRIVATE void ImplRevokeAccessibleNativeFrame();
SAL_DLLPRIVATE void ImplCallResize();
+ SAL_DLLPRIVATE void ImplExtResize();
SAL_DLLPRIVATE void ImplCallMove();
SAL_DLLPRIVATE Rectangle ImplOutputToUnmirroredAbsoluteScreenPixel( const Rectangle& rRect ) const;
SAL_DLLPRIVATE void ImplMirrorFramePos( Point &pt ) const;
@@ -543,16 +559,16 @@ public:
SAL_DLLPRIVATE ::std::vector<Window *>& ImplGetOwnerDrawList();
SAL_DLLPRIVATE Window* ImplGetTopmostFrameWindow();
- SAL_DLLPRIVATE Rectangle ImplGetWindowExtentsRelative( Window *pRelativeWindow, BOOL bClientOnly ) const;
- SAL_DLLPRIVATE void ImplNotifyIconifiedState( BOOL bIconified );
+ SAL_DLLPRIVATE Rectangle ImplGetWindowExtentsRelative( Window *pRelativeWindow, sal_Bool bClientOnly ) const;
+ SAL_DLLPRIVATE void ImplNotifyIconifiedState( sal_Bool bIconified );
SAL_DLLPRIVATE bool ImplStopDnd();
SAL_DLLPRIVATE void ImplStartDnd();
SAL_DLLPRIVATE static void ImplInitAppFontData( Window* pWindow );
SAL_DLLPRIVATE void ImplPaintToDevice( OutputDevice* pTargetOutDev, const Point& rPos );
- SAL_DLLPRIVATE BOOL ImplIsInTaskPaneList();
- SAL_DLLPRIVATE void ImplIsInTaskPaneList( BOOL mbIsInTaskList );
+ SAL_DLLPRIVATE sal_Bool ImplIsInTaskPaneList();
+ SAL_DLLPRIVATE void ImplIsInTaskPaneList( sal_Bool mbIsInTaskList );
SAL_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvas >
ImplGetCanvas( const Size& rFullscreenSize, bool bFullscreen, bool bSpriteCanvas ) const;
@@ -568,10 +584,10 @@ protected:
// Single argument ctors shall be explicit.
explicit Window( WindowType nType );
- void SetCompoundControl( BOOL bCompound );
+ void SetCompoundControl( sal_Bool bCompound );
- void ImplCallEventListeners( ULONG nEvent, void* pData = NULL );
- void CallEventListeners( ULONG nEvent, void* pData = NULL );
+ void ImplCallEventListeners( sal_uLong nEvent, void* pData = NULL );
+ void CallEventListeners( sal_uLong nEvent, void* pData = NULL );
void FireVclEvent( VclSimpleEvent* pEvent );
// FIXME: this is a hack to workaround missing layout functionality
@@ -590,7 +606,9 @@ public:
virtual void KeyUp( const KeyEvent& rKEvt );
virtual void PrePaint();
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+
+ virtual void PostPaint();
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Move();
virtual void Resize();
virtual void Activate();
@@ -600,7 +618,7 @@ public:
virtual void RequestHelp( const HelpEvent& rHEvt );
virtual void Command( const CommandEvent& rCEvt );
virtual void Tracking( const TrackingEvent& rTEvt );
- virtual void UserEvent( ULONG nEvent, void* pEventData );
+ virtual void UserEvent( sal_uLong nEvent, void* pEventData );
virtual void StateChanged( StateChangedType nStateChange );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
virtual long PreNotify( NotifyEvent& rNEvt );
@@ -612,16 +630,16 @@ public:
/*virtual*/ void AddChildEventListener( const Link& rEventListener );
/*virtual*/ void RemoveChildEventListener( const Link& rEventListener );
- ULONG PostUserEvent( ULONG nEvent, void* pEventData = NULL );
- ULONG PostUserEvent( const Link& rLink, void* pCaller = NULL );
- BOOL PostUserEvent( ULONG& rEventId, ULONG nEvent, void* pEventData = NULL );
- BOOL PostUserEvent( ULONG& rEventId, const Link& rLink, void* pCaller = NULL );
- void RemoveUserEvent( ULONG nUserEvent );
+ sal_uLong PostUserEvent( sal_uLong nEvent, void* pEventData = NULL );
+ sal_uLong PostUserEvent( const Link& rLink, void* pCaller = NULL );
+ sal_Bool PostUserEvent( sal_uLong& rEventId, sal_uLong nEvent, void* pEventData = NULL );
+ sal_Bool PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller = NULL );
+ void RemoveUserEvent( sal_uLong nUserEvent );
void PostStateChanged( StateChangedType nState );
void IncrementLockCount();
void DecrementLockCount();
- BOOL IsLocked( BOOL bChilds = FALSE ) const;
+ sal_Bool IsLocked( sal_Bool bChilds = sal_False ) const;
// returns the input language used for the last key stroke
// may be LANGUAGE_DONTKNOW if not supported by the OS
@@ -635,64 +653,64 @@ public:
WinBits GetPrevExtendedStyle() const;
void SetType( WindowType nType );
WindowType GetType() const;
- BOOL IsSystemWindow() const;
- BOOL IsDialog() const;
- BOOL IsMenuFloatingWindow() const;
- BOOL IsToolbarFloatingWindow() const;
- BOOL IsTopWindow() const;
+ sal_Bool IsSystemWindow() const;
+ sal_Bool IsDialog() const;
+ sal_Bool IsMenuFloatingWindow() const;
+ sal_Bool IsToolbarFloatingWindow() const;
+ sal_Bool IsTopWindow() const;
SystemWindow* GetSystemWindow() const;
- void EnableAllResize( BOOL bEnable = TRUE );
- BOOL IsAllResizeEnabled() const;
+ void EnableAllResize( sal_Bool bEnable = sal_True );
+ sal_Bool IsAllResizeEnabled() const;
- void SetBorderStyle( USHORT nBorderStyle );
- USHORT GetBorderStyle() const;
+ void SetBorderStyle( sal_uInt16 nBorderStyle );
+ sal_uInt16 GetBorderStyle() const;
void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
Size CalcWindowSize( const Size& rOutSz ) const;
Size CalcOutputSize( const Size& rWinSz ) const;
long CalcTitleWidth() const;
- void EnableClipSiblings( BOOL bClipSiblings = TRUE );
- BOOL IsClipSiblingsEnabled() const;
+ void EnableClipSiblings( sal_Bool bClipSiblings = sal_True );
+ sal_Bool IsClipSiblingsEnabled() const;
- void EnableChildTransparentMode( BOOL bEnable = TRUE );
- BOOL IsChildTransparentModeEnabled() const;
+ void EnableChildTransparentMode( sal_Bool bEnable = sal_True );
+ sal_Bool IsChildTransparentModeEnabled() const;
- void SetMouseTransparent( BOOL bTransparent );
- BOOL IsMouseTransparent() const;
- void SetPaintTransparent( BOOL bTransparent );
- BOOL IsPaintTransparent() const;
- void SetDialogControlStart( BOOL bStart );
- BOOL IsDialogControlStart() const;
- void SetDialogControlFlags( USHORT nFlags );
- USHORT GetDialogControlFlags() const;
+ void SetMouseTransparent( sal_Bool bTransparent );
+ sal_Bool IsMouseTransparent() const;
+ void SetPaintTransparent( sal_Bool bTransparent );
+ sal_Bool IsPaintTransparent() const;
+ void SetDialogControlStart( sal_Bool bStart );
+ sal_Bool IsDialogControlStart() const;
+ void SetDialogControlFlags( sal_uInt16 nFlags );
+ sal_uInt16 GetDialogControlFlags() const;
struct PointerState
{
- ULONG mnState; // the button state
+ sal_uLong mnState; // the button state
Point maPos; // mouse position in output coordinates
};
PointerState GetPointerState();
- BOOL IsMouseOver();
+ sal_Bool IsMouseOver();
- ULONG GetCurrentModButtons();
+ sal_uLong GetCurrentModButtons();
void SetInputContext( const InputContext& rInputContext );
const InputContext& GetInputContext() const;
- void EndExtTextInput( USHORT nFlags );
- BOOL IsExtTextInput() const;
+ void EndExtTextInput( sal_uInt16 nFlags );
+ sal_Bool IsExtTextInput() const;
void SetCursorRect( const Rectangle* pRect = NULL, long nExtTextInputWidth = 0 );
const Rectangle* GetCursorRect() const;
long GetCursorExtTextInputWidth() const;
- void EnableChildNotify( BOOL bEnable );
- BOOL IsChildNotify() const;
+ void EnableChildNotify( sal_Bool bEnable );
+ sal_Bool IsChildNotify() const;
using OutputDevice::SetSettings;
virtual void SetSettings( const AllSettings& rSettings );
- virtual void SetSettings( const AllSettings& rSettings, BOOL bChild );
- void UpdateSettings( const AllSettings& rSettings, BOOL bChild = FALSE );
+ virtual void SetSettings( const AllSettings& rSettings, sal_Bool bChild );
+ void UpdateSettings( const AllSettings& rSettings, sal_Bool bChild = sal_False );
void NotifyAllChilds( DataChangedEvent& rDCEvt );
void SetPointFont( const Font& rFont );
@@ -704,26 +722,26 @@ public:
void SetControlFont();
void SetControlFont( const Font& rFont );
Font GetControlFont() const;
- BOOL IsControlFont() const;
+ sal_Bool IsControlFont() const;
void SetControlForeground();
void SetControlForeground( const Color& rColor );
Color GetControlForeground() const;
- BOOL IsControlForeground() const;
+ sal_Bool IsControlForeground() const;
void SetControlBackground();
void SetControlBackground( const Color& rColor );
Color GetControlBackground() const;
- BOOL IsControlBackground() const;
+ sal_Bool IsControlBackground() const;
- void SetParentClipMode( USHORT nMode = 0 );
- USHORT GetParentClipMode() const;
+ void SetParentClipMode( sal_uInt16 nMode = 0 );
+ sal_uInt16 GetParentClipMode() const;
void SetWindowRegionPixel();
void SetWindowRegionPixel( const Region& rRegion );
const Region& GetWindowRegionPixel() const;
- BOOL IsWindowRegionPixel() const;
- Region GetWindowClipRegionPixel( USHORT nFlags = 0 ) const;
+ sal_Bool IsWindowRegionPixel() const;
+ Region GetWindowClipRegionPixel( sal_uInt16 nFlags = 0 ) const;
Region GetPaintRegion() const;
- BOOL IsInPaint() const;
+ sal_Bool IsInPaint() const;
// while IsInPaint returns true ExpandPaintClipRegion adds the
// submitted region to the paint clip region so you can
// paint additional parts of your window if necessary
@@ -732,23 +750,23 @@ public:
void SetParent( Window* pNewParent );
Window* GetParent() const;
- void Show( BOOL bVisible = TRUE, USHORT nFlags = 0 );
- void Hide( USHORT nFlags = 0 ) { Show( FALSE, nFlags ); }
- BOOL IsVisible() const;
- BOOL IsReallyVisible() const;
+ void Show( sal_Bool bVisible = sal_True, sal_uInt16 nFlags = 0 );
+ void Hide( sal_uInt16 nFlags = 0 ) { Show( sal_False, nFlags ); }
+ sal_Bool IsVisible() const;
+ sal_Bool IsReallyVisible() const;
// Do not use this function, use IsReallyVisible()
- BOOL IsParentPathVisible() const;
- BOOL IsReallyShown() const;
- BOOL IsInInitShow() const;
+ sal_Bool IsParentPathVisible() const;
+ sal_Bool IsReallyShown() const;
+ sal_Bool IsInInitShow() const;
void Enable( bool bEnable = true, bool bChild = true );
void Disable( bool bChild = true ) { Enable( false, bChild ); }
- BOOL IsEnabled() const;
+ sal_Bool IsEnabled() const;
- void EnableInput( BOOL bEnable = TRUE, BOOL bChild = TRUE );
- void EnableInput( BOOL bEnable, BOOL bChild, BOOL bSysWin,
+ void EnableInput( sal_Bool bEnable = sal_True, sal_Bool bChild = sal_True );
+ void EnableInput( sal_Bool bEnable, sal_Bool bChild, sal_Bool bSysWin,
const Window* pExcludeWindow = NULL );
- BOOL IsInputEnabled() const;
+ sal_Bool IsInputEnabled() const;
/** Override <code>EnableInput</code>. This can be necessary due to other people
using EnableInput for whole window hierarchies.
@@ -762,12 +780,12 @@ public:
@param bChild
if true children are recursively set to AlwaysEnableInput
*/
- void AlwaysEnableInput( BOOL bAlways, BOOL bChild = TRUE );
+ void AlwaysEnableInput( sal_Bool bAlways, sal_Bool bChild = sal_True );
/** returns the current AlwaysEnableInput state
@return
true if window is in AlwaysEnableInput state
*/
- BOOL IsAlwaysEnableInput() const;
+ sal_Bool IsAlwaysEnableInput() const;
/** Override <code>EnableInput</code>, counterpart to AlwaysEnableInput.
Windows with AlwaysDisableInput will not get key events even if enabled
and input enabled.This can be necessary due to other people using EnableInput
@@ -782,12 +800,12 @@ public:
@param bChild
if true children are recursively set to AlwaysDisableInput
*/
- void AlwaysDisableInput( BOOL bAlways, BOOL bChild = TRUE );
+ void AlwaysDisableInput( sal_Bool bAlways, sal_Bool bChild = sal_True );
/** returns the current AlwaysDisableInput state
@return
true if window is in AlwaysEnableInput state
*/
- BOOL IsAlwaysDisableInput() const;
+ sal_Bool IsAlwaysDisableInput() const;
/** usually event handlers (see AddEventListener and AddChildEventListener)
are not called on disabled, modal or input disabled windows. There are however rare cases
in which one wants a Window or rather one of its Control subclasses to
@@ -813,21 +831,21 @@ public:
/** A window is in modal mode if one of its children or subchildren
is a running modal window (a modal dialog)
- @returns TRUE if a child or subchild is a running modal window
+ @returns sal_True if a child or subchild is a running modal window
*/
- BOOL IsInModalMode() const;
+ sal_Bool IsInModalMode() const;
- void SetActivateMode( USHORT nMode );
- USHORT GetActivateMode() const;
+ void SetActivateMode( sal_uInt16 nMode );
+ sal_uInt16 GetActivateMode() const;
- void ToTop( USHORT nFlags = 0 );
- void SetZOrder( Window* pRefWindow, USHORT nFlags );
- void EnableAlwaysOnTop( BOOL bEnable = TRUE );
- BOOL IsAlwaysOnTopEnabled() const;
+ void ToTop( sal_uInt16 nFlags = 0 );
+ void SetZOrder( Window* pRefWindow, sal_uInt16 nFlags );
+ void EnableAlwaysOnTop( sal_Bool bEnable = sal_True );
+ sal_Bool IsAlwaysOnTopEnabled() const;
virtual void SetPosSizePixel( long nX, long nY,
long nWidth, long nHeight,
- USHORT nFlags = WINDOW_POSSIZE_ALL );
+ sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
virtual void SetPosPixel( const Point& rNewPos );
virtual Point GetPosPixel() const;
virtual void SetSizePixel( const Size& rNewSize );
@@ -835,8 +853,8 @@ public:
virtual void SetPosSizePixel( const Point& rNewPos,
const Size& rNewSize );
virtual void SetOutputSizePixel( const Size& rNewSize );
- BOOL IsDefaultPos() const;
- BOOL IsDefaultSize() const;
+ sal_Bool IsDefaultPos() const;
+ sal_Bool IsDefaultSize() const;
// those conversion routines might deliver different results during UI mirroring
Point OutputToScreenPixel( const Point& rPos ) const;
@@ -852,40 +870,40 @@ public:
// window extents of the client window, coordinates to be used in SetPosPixel
Rectangle GetClientWindowExtentsRelative( Window *pRelativeWindow ) const;
- virtual BOOL IsScrollable() const;
+ virtual sal_Bool IsScrollable() const;
virtual void Scroll( long nHorzScroll, long nVertScroll,
- USHORT nFlags = 0 );
+ sal_uInt16 nFlags = 0 );
virtual void Scroll( long nHorzScroll, long nVertScroll,
- const Rectangle& rRect, USHORT nFlags = 0 );
- virtual void Invalidate( USHORT nFlags = 0 );
- virtual void Invalidate( const Rectangle& rRect, USHORT nFlags = 0 );
- virtual void Invalidate( const Region& rRegion, USHORT nFlags = 0 );
- void Validate( USHORT nFlags = 0 );
- void Validate( const Rectangle& rRect, USHORT nFlags = 0 );
- void Validate( const Region& rRegion, USHORT nFlags = 0 );
- BOOL HasPaintEvent() const;
+ const Rectangle& rRect, sal_uInt16 nFlags = 0 );
+ virtual void Invalidate( sal_uInt16 nFlags = 0 );
+ virtual void Invalidate( const Rectangle& rRect, sal_uInt16 nFlags = 0 );
+ virtual void Invalidate( const Region& rRegion, sal_uInt16 nFlags = 0 );
+ void Validate( sal_uInt16 nFlags = 0 );
+ void Validate( const Rectangle& rRect, sal_uInt16 nFlags = 0 );
+ void Validate( const Region& rRegion, sal_uInt16 nFlags = 0 );
+ sal_Bool HasPaintEvent() const;
void Update();
void Flush();
void Sync();
// toggles new docking support, enabled via toolkit
- void EnableDocking( BOOL bEnable = TRUE );
+ void EnableDocking( sal_Bool bEnable = sal_True );
// retrieves the single dockingmanager instance
static DockingManager* GetDockingManager();
- void EnablePaint( BOOL bEnable );
- BOOL IsPaintEnabled() const;
- void SetUpdateMode( BOOL bUpdate );
- BOOL IsUpdateMode() const;
- void SetParentUpdateMode( BOOL bUpdate );
- BOOL IsParentUpdateMode() const;
+ void EnablePaint( sal_Bool bEnable );
+ sal_Bool IsPaintEnabled() const;
+ void SetUpdateMode( sal_Bool bUpdate );
+ sal_Bool IsUpdateMode() const;
+ void SetParentUpdateMode( sal_Bool bUpdate );
+ sal_Bool IsParentUpdateMode() const;
void GrabFocus();
- BOOL HasFocus() const;
- BOOL HasChildPathFocus( BOOL bSystemWindow = FALSE ) const;
- BOOL IsActive() const;
- BOOL HasActiveChildFrame();
- USHORT GetGetFocusFlags() const;
+ sal_Bool HasFocus() const;
+ sal_Bool HasChildPathFocus( sal_Bool bSystemWindow = sal_False ) const;
+ sal_Bool IsActive() const;
+ sal_Bool HasActiveChildFrame();
+ sal_uInt16 GetGetFocusFlags() const;
void GrabFocusToDocument();
/**
@@ -895,35 +913,35 @@ public:
*/
void SetFakeFocus( bool bFocus );
- BOOL IsCompoundControl() const;
- BOOL HasCompoundControlFocus() const;
+ sal_Bool IsCompoundControl() const;
+ sal_Bool HasCompoundControlFocus() const;
static sal_uIntPtr SaveFocus();
- static BOOL EndSaveFocus( sal_uIntPtr nSaveId, BOOL bRestore = TRUE );
+ static sal_Bool EndSaveFocus( sal_uIntPtr nSaveId, sal_Bool bRestore = sal_True );
void CaptureMouse();
void ReleaseMouse();
- BOOL IsMouseCaptured() const;
+ sal_Bool IsMouseCaptured() const;
void SetPointer( const Pointer& rPointer );
const Pointer& GetPointer() const;
- void EnableChildPointerOverwrite( BOOL bOverwrite = TRUE );
- BOOL IsChildPointerOverwrite() const;
+ void EnableChildPointerOverwrite( sal_Bool bOverwrite = sal_True );
+ sal_Bool IsChildPointerOverwrite() const;
void SetPointerPosPixel( const Point& rPos );
Point GetPointerPosPixel();
Point GetLastPointerPosPixel();
- void ShowPointer( BOOL bVisible );
- BOOL IsPointerVisible() const;
+ void ShowPointer( sal_Bool bVisible );
+ sal_Bool IsPointerVisible() const;
void EnterWait();
void LeaveWait();
- BOOL IsWait() const;
+ sal_Bool IsWait() const;
void SetCursor( Cursor* pCursor );
Cursor* GetCursor() const;
void SetZoom( const Fraction& rZoom );
const Fraction& GetZoom() const;
- BOOL IsZoom() const;
+ sal_Bool IsZoom() const;
long CalcZoom( long n ) const;
virtual void SetText( const XubString& rStr );
@@ -943,59 +961,55 @@ public:
void SetQuickHelpText( const XubString& rHelpText );
const XubString& GetQuickHelpText() const;
- void SetHelpId( ULONG nHelpId ); /// deprecated
- ULONG GetHelpId() const; /// deprecated
- void SetSmartHelpId( const SmartId& aId, SmartIdUpdateMode aMode = SMART_SET_SMART );
- SmartId GetSmartHelpId() const;
+ void SetHelpId( const rtl::OString& );
+ const rtl::OString& GetHelpId() const;
- void SetUniqueId( ULONG nUniqueId ); /// deprecated
- ULONG GetUniqueId() const; /// deprecated
- void SetSmartUniqueId( const SmartId& aId, SmartIdUpdateMode aMode = SMART_SET_SMART );
- SmartId GetSmartUniqueId() const;
- SmartId GetSmartUniqueOrHelpId() const;
+ void SetUniqueId( const rtl::OString& );
+ const rtl::OString& GetUniqueId() const;
+ const rtl::OString& GetUniqueOrHelpId() const;
Window* FindWindow( const Point& rPos ) const;
- USHORT GetChildCount() const;
- Window* GetChild( USHORT nChild ) const;
- Window* GetWindow( USHORT nType ) const;
- BOOL IsChild( const Window* pWindow, BOOL bSystemWindow = FALSE ) const;
- BOOL IsWindowOrChild( const Window* pWindow, BOOL bSystemWindow = FALSE ) const;
+ sal_uInt16 GetChildCount() const;
+ Window* GetChild( sal_uInt16 nChild ) const;
+ Window* GetWindow( sal_uInt16 nType ) const;
+ sal_Bool IsChild( const Window* pWindow, sal_Bool bSystemWindow = sal_False ) const;
+ sal_Bool IsWindowOrChild( const Window* pWindow, sal_Bool bSystemWindow = sal_False ) const;
void SetData( void* pNewData );
void* GetData() const;
- Bitmap SnapShot( BOOL bBorder=TRUE ) const;
+ Bitmap SnapShot( sal_Bool bBorder = sal_True ) const;
void ShowFocus( const Rectangle& rRect );
void HideFocus();
- void Invert( const Rectangle& rRect, USHORT nFlags = 0 );
- void Invert( const Polygon& rPoly, USHORT nFlags = 0 );
+ void Invert( const Rectangle& rRect, sal_uInt16 nFlags = 0 );
+ void Invert( const Polygon& rPoly, sal_uInt16 nFlags = 0 );
// transparent background for selected or checked items in toolboxes etc.
- void DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly );
+ void DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly );
// the same, but fills a passed Color with a text color complementing the selection background
- void DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly, Color* pSelectionTextColor );
+ void DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly, Color* pSelectionTextColor );
// support rounded edges in the selection rect
- void DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly, long nCornerRadius, Color* pSelectionTextColor, Color* pPaintColor );
+ void DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly, long nCornerRadius, Color* pSelectionTextColor, Color* pPaintColor );
void ShowTracking( const Rectangle& rRect,
- USHORT nFlags = SHOWTRACK_SMALL );
+ sal_uInt16 nFlags = SHOWTRACK_SMALL );
void HideTracking();
void InvertTracking( const Rectangle& rRect,
- USHORT nFlags = SHOWTRACK_SMALL );
- void InvertTracking( const Polygon& rPoly, USHORT nFlags = 0 );
+ sal_uInt16 nFlags = SHOWTRACK_SMALL );
+ void InvertTracking( const Polygon& rPoly, sal_uInt16 nFlags = 0 );
- void StartTracking( USHORT nFlags = 0 );
- void EndTracking( USHORT nFlags = 0 );
- BOOL IsTracking() const;
+ void StartTracking( sal_uInt16 nFlags = 0 );
+ void EndTracking( sal_uInt16 nFlags = 0 );
+ sal_Bool IsTracking() const;
- void StartAutoScroll( USHORT nFlags );
+ void StartAutoScroll( sal_uInt16 nFlags );
void EndAutoScroll();
- BOOL IsAutoScroll() const;
+ sal_Bool IsAutoScroll() const;
- BOOL HandleScrollCommand( const CommandEvent& rCmd,
+ sal_Bool HandleScrollCommand( const CommandEvent& rCmd,
ScrollBar* pHScrl = NULL,
ScrollBar* pVScrl = NULL );
@@ -1006,20 +1020,20 @@ public:
::com::sun::star::uno::Any GetSystemDataAny() const;
// API zum Setzen/Abfragen des Komponenteninterfaces
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > GetComponentInterface( BOOL bCreate = TRUE );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > GetComponentInterface( sal_Bool bCreate = sal_True );
virtual void SetComponentInterface( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xIFace );
// Accessibility
- ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetAccessible( BOOL bCreate = TRUE );
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetAccessible( sal_Bool bCreate = sal_True );
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
void SetAccessible( ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > );
Window* GetAccessibleParentWindow() const;
- USHORT GetAccessibleChildWindowCount();
- Window* GetAccessibleChildWindow( USHORT n );
+ sal_uInt16 GetAccessibleChildWindowCount();
+ Window* GetAccessibleChildWindow( sal_uInt16 n );
- void SetAccessibleRole( USHORT nRole );
- USHORT GetAccessibleRole() const;
+ void SetAccessibleRole( sal_uInt16 nRole );
+ sal_uInt16 GetAccessibleRole() const;
void SetAccessibleName( const String& rName );
String GetAccessibleName() const;
@@ -1027,9 +1041,20 @@ public:
void SetAccessibleDescription( const String& rDescr );
String GetAccessibleDescription() const;
+ void SetAccessibleRelationLabeledBy( Window* pLabeledBy );
+ Window* GetAccessibleRelationLabeledBy() const;
+
+ void SetAccessibleRelationLabelFor( Window* pLabelFor );
+ Window* GetAccessibleRelationLabelFor() const;
+
+ void SetAccessibleRelationMemberOf( Window* pMemberOf );
+ Window* GetAccessibleRelationMemberOf() const;
+
+
// to avoid sending accessibility events in cases like closing dialogs
// by default checks complete parent path
- BOOL IsAccessibilityEventsSuppressed( BOOL bTraverseParentPath = TRUE );
+ sal_Bool IsAccessibilityEventsSuppressed( sal_Bool bTraverseParentPath = sal_True );
+ void SetAccessibilityEventsSuppressed(sal_Bool bSuppressed);
/// request XCanvas render interface for this window
::com::sun::star::uno::Reference<
@@ -1051,11 +1076,10 @@ public:
void SetWindowPeer( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xPeer, VCLXWindow* pVCLXWindow );
// Merken, ob vom Toolkit erzeugt
- BOOL IsCreatedWithToolkit() const;
- void SetCreatedWithToolkit( BOOL b );
+ sal_Bool IsCreatedWithToolkit() const;
+ void SetCreatedWithToolkit( sal_Bool b );
- Window* GetLabelFor() const;
- Window* GetLabeledBy() const;
+ // Deprecated - can use SetAccessibleRelationLabelFor/By nowadys
virtual Window* GetParentLabelFor( const Window* pLabel ) const;
virtual Window* GetParentLabeledBy( const Window* pLabeled ) const;
KeyEvent GetActivationKey() const;
@@ -1079,8 +1103,8 @@ public:
//-------------------------------------
// form controls must never use native widgets, this can be toggled here
- void EnableNativeWidget( BOOL bEnable = TRUE );
- BOOL IsNativeWidgetEnabled() const;
+ void EnableNativeWidget( sal_Bool bEnable = sal_True );
+ sal_Bool IsNativeWidgetEnabled() const;
// a helper method for a Control's Draw method
void PaintToDevice( OutputDevice* pDevice, const Point& rPos, const Size& rSize );
@@ -1101,12 +1125,64 @@ public:
INDICATOR_NUM_LOCK
INDICATOR_SCROLL_LOCK
*/
- USHORT GetIndicatorState() const;
+ sal_uInt16 GetIndicatorState() const;
- void SimulateKeyPress( USHORT nKeyCode ) const;
+ void SimulateKeyPress( sal_uInt16 nKeyCode ) const;
+
+ // let the window intercept the KeyDown messages of the system children
+ void InterceptChildWindowKeyDown( sal_Bool bIntercept );
virtual XubString GetSurroundingText() const;
virtual Selection GetSurroundingTextSelection() const;
+
+ // ExtImpl
+
+ // layouting
+ boost::shared_ptr< vcl::WindowArranger > getLayout();
+
+ /* add a child Window
+ addWindow will do the following things
+ - insert the passed window into the child list (equivalent to i_pWin->SetParent( this ))
+ - mark the window as "owned", meaning that the added Window will be destroyed by
+ the parent's desctructor.
+ This means: do not pass in member windows or stack objects here. Do not cause
+ the destructor of the added window to be called in any way.
+
+ to avoid ownership pass i_bTakeOwnership as "false"
+ */
+ void addWindow( Window* i_pWin, bool i_bTakeOwnership = true );
+
+ /* remove a child Window
+ the remove window functions will
+ - reparent the searched window (equivalent to i_pWin->SetParent( i_pNewParent ))
+ - return a pointer to the removed window or NULL if i_pWin was not found
+ caution: ownership passes to the new parent or the caller, if the new parent was NULL
+ */
+ Window* removeWindow( Window* i_pWin, Window* i_pNewParent = NULL );
+
+ /* return the identifier of this window
+ */
+ const rtl::OUString& getIdentifier() const;
+ /* set an identifier
+ identifiers have only loosely defined rules per se
+ in context of Window they must be unique over the window
+ hierarchy you'd like to find them again using the findWindow method
+ */
+ void setIdentifier( const rtl::OUString& );
+
+ /* returns the first found descendant that matches
+ the passed identifier or NULL
+ */
+ Window* findWindow( const rtl::OUString& ) const;
+
+ /* get/set properties
+ this will contain window properties (like visible, enabled)
+ as well as properties of derived classes (e.g. text of Edit fields)
+ */
+ virtual com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getProperties() const;
+ /*
+ */
+ virtual void setProperties( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& );
};
diff --git a/vcl/inc/vcl/wintypes.hxx b/vcl/inc/vcl/wintypes.hxx
deleted file mode 100644
index 55de8b4fb5be..000000000000
--- a/vcl/inc/vcl/wintypes.hxx
+++ /dev/null
@@ -1,35 +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 _SV_WINTYPES_HXX
-#define _SV_WINTYPES_HXX
-
-#include <tools/wintypes.hxx>
-
-#endif // _SV_WINTYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/impbmpconv.hxx b/vcl/inc/vcl/wpropset.hxx
index 0d82ed119d6d..ac0f98fd3525 100644
--- a/vcl/inc/vcl/impbmpconv.hxx
+++ b/vcl/inc/vcl/wpropset.hxx
@@ -26,15 +26,42 @@
*
************************************************************************/
-#ifndef _VCL_IMPBMPCONV_HXX_
-#define _VCL_IMPBMPCONV_HXX_
+#ifndef VCL_WPROPSET_HXX
+#define VCL_WPROPSET_HXX
-#include <com/sun/star/script/XInvocation.hpp>
-#include <com/sun/star/uno/Reference.hxx>
+#include "vcl/dllapi.h"
+
+#include "tools/link.hxx"
+#include "vcl/arrange.hxx"
+
+#include "com/sun/star/beans/XPropertySet.hpp"
+
+class VclWindowEvent;
namespace vcl
{
-com::sun::star::uno::Reference< com::sun::star::script::XInvocation > createBmpConverter();
+ class WindowPropertySetData;
+ class WindowPropertySetListener;
+
+ class VCL_DLLPUBLIC WindowPropertySet
+ {
+ WindowPropertySetData* mpImpl;
+
+ void addWindowToSet( Window* );
+ void addLayoutToSet( const boost::shared_ptr<WindowArranger>& );
+ void setupProperties();
+
+ DECL_LINK( ChildEventListener, VclWindowEvent* );
+
+ void propertyChange( const com::sun::star::beans::PropertyChangeEvent& );
+ friend class vcl::WindowPropertySetListener;
+
+ public:
+ WindowPropertySet( Window* i_pTopWindow, bool i_bTakeOwnership );
+ ~WindowPropertySet();
+
+ com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > getPropertySet() const;
+ };
}
#endif
diff --git a/vcl/inc/vcl/wrkwin.hxx b/vcl/inc/vcl/wrkwin.hxx
index 50c1cf60dbb7..c58f6971ffc0 100644
--- a/vcl/inc/vcl/wrkwin.hxx
+++ b/vcl/inc/vcl/wrkwin.hxx
@@ -41,9 +41,9 @@ struct SystemParentData;
// ----------------------
// Presentation Flags
-#define PRESENTATION_HIDEALLAPPS ((USHORT)0x0001)
-#define PRESENTATION_NOFULLSCREEN ((USHORT)0x0002)
-#define PRESENTATION_NOAUTOSHOW ((USHORT)0x0004)
+#define PRESENTATION_HIDEALLAPPS ((sal_uInt16)0x0001)
+#define PRESENTATION_NOFULLSCREEN ((sal_uInt16)0x0002)
+#define PRESENTATION_NOAUTOSHOW ((sal_uInt16)0x0004)
// --------------
// - WorkWindow -
@@ -52,8 +52,8 @@ struct SystemParentData;
class VCL_DLLPUBLIC WorkWindow : public SystemWindow
{
private:
- USHORT mnPresentationFlags;
- BOOL mbPresentationMode:1,
+ sal_uInt16 mnPresentationFlags;
+ sal_Bool mbPresentationMode:1,
mbPresentationVisible:1,
mbPresentationFull:1,
mbFullScreenMode:1;
@@ -69,7 +69,7 @@ protected:
WorkWindow( WindowType nType );
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData = NULL );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- SAL_DLLPRIVATE void ImplSetFrameState( ULONG aFrameState );
+ SAL_DLLPRIVATE void ImplSetFrameState( sal_uLong aFrameState );
public:
WorkWindow( Window* pParent, const ResId& rResId );
@@ -78,7 +78,7 @@ public:
WorkWindow( SystemParentData* pParent ); // Not in the REMOTE-Version
~WorkWindow();
- virtual BOOL Close();
+ virtual sal_Bool Close();
/** The default value of nDisplay = -1 means "don't care" and
allows to backends to use any screen [** or display? terminology!]
@@ -87,23 +87,23 @@ public:
NOTE: The default value cannot be 0, because 0 is a legitimate
screen number.
*/
- void ShowFullScreenMode( BOOL bFullScreenMode = TRUE, sal_Int32 nDisplay = -1 );
- void EndFullScreenMode() { ShowFullScreenMode( FALSE ); }
- BOOL IsFullScreenMode() const { return mbFullScreenMode; }
+ void ShowFullScreenMode( sal_Bool bFullScreenMode = sal_True, sal_Int32 nDisplay = -1 );
+ void EndFullScreenMode() { ShowFullScreenMode( sal_False ); }
+ sal_Bool IsFullScreenMode() const { return mbFullScreenMode; }
- void StartPresentationMode( BOOL bPresentation = TRUE, USHORT nFlags = 0, sal_Int32 nDisplay = 0 );
- void EndPresentationMode() { StartPresentationMode( FALSE ); }
- BOOL IsPresentationMode() const { return mbPresentationMode; }
+ void StartPresentationMode( sal_Bool bPresentation = sal_True, sal_uInt16 nFlags = 0, sal_Int32 nDisplay = 0 );
+ void EndPresentationMode() { StartPresentationMode( sal_False ); }
+ sal_Bool IsPresentationMode() const { return mbPresentationMode; }
- BOOL IsMinimized() const;
+ sal_Bool IsMinimized() const;
- BOOL SetPluginParent( SystemParentData* pParent );
+ sal_Bool SetPluginParent( SystemParentData* pParent );
void Minimize();
void Restore();
- void Maximize( BOOL bMaximize = TRUE );
- BOOL IsMaximized() const;
+ void Maximize( sal_Bool bMaximize = sal_True );
+ sal_Bool IsMaximized() const;
};
#endif // _SV_WRKWIN_HXX
diff --git a/vcl/inc/vcl/xconnection.hxx b/vcl/inc/vcl/xconnection.hxx
index 1c4c5dd45140..bd3270fa24c7 100644
--- a/vcl/inc/vcl/xconnection.hxx
+++ b/vcl/inc/vcl/xconnection.hxx
@@ -29,11 +29,12 @@
#ifndef _VCL_XCONNECTION_HXX
#define _VCL_XCONNECTION_HXX
-#include <com/sun/star/awt/XDisplayConnection.hpp>
-#include <cppuhelper/implbase1.hxx>
#include <osl/mutex.hxx>
+#include <rtl/ref.hxx>
#include <com/sun/star/uno/Reference.hxx>
+#include "vcl/displayconnectiondispatch.hxx"
+
#ifndef _STLP_LIST
#include <list>
#endif
@@ -41,7 +42,7 @@
namespace vcl {
class DisplayConnection :
- public ::cppu::WeakImplHelper1< ::com::sun::star::awt::XDisplayConnection >
+ public DisplayConnectionDispatch
{
::osl::Mutex m_aMutex;
::std::list< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XEventHandler > >
@@ -53,9 +54,11 @@ namespace vcl {
DisplayConnection();
virtual ~DisplayConnection();
- static bool dispatchEvent( void* pThis, void* pData, int nBytes );
- static bool dispatchErrorEvent( void* pThis, void* pData, int nBytes );
- void dispatchDowningEvent();
+ void start();
+ void terminate();
+
+ virtual bool dispatchEvent( void* pData, int nBytes );
+ virtual bool dispatchErrorEvent( void* pData, int nBytes );
// XDisplayConnection
virtual void SAL_CALL addEventHandler( const ::com::sun::star::uno::Any& window, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XEventHandler >& handler, sal_Int32 eventMask ) throw();
diff --git a/vcl/os2/inc/salgdi.h b/vcl/os2/inc/salgdi.h
index 0970677b0fb1..3c72695bc2f2 100644
--- a/vcl/os2/inc/salgdi.h
+++ b/vcl/os2/inc/salgdi.h
@@ -75,7 +75,7 @@ public:
bool AliasSymbolsHigh() const { return mbAliasSymbolsHigh; }
bool AliasSymbolsLow() const { return mbAliasSymbolsLow; }
- ImplFontCharMap* GetImplFontCharMap() const;
+ const ImplFontCharMap* GetImplFontCharMap() const;
private:
sal_IntPtr mnId;
@@ -83,7 +83,7 @@ private:
mutable bool mbHasKoreanRange;
mutable bool mbHasCJKSupport;
- mutable ImplFontCharMap* mpUnicodeMap;
+ mutable const ImplFontCharMap* mpUnicodeMap;
// TODO: get rid of the members below needed to work with the Win9x non-unicode API
BYTE* mpFontCharSets; // all Charsets for the current font (used on W98 for kerning)
@@ -152,8 +152,6 @@ public:
virtual ~Os2SalGraphics();
protected:
- virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
// draw --> LineColor and FillColor and RasterOp and ClipRegion
virtual void drawPixel( long nX, long nY );
virtual void drawPixel( long nX, long nY, SalColor nSalColor );
@@ -212,11 +210,7 @@ public:
// set the clip region to empty
virtual void ResetClipRegion();
- // begin setting the clip region, add rectangles to the
- // region with the UnionClipRegion call
- virtual void BeginSetClipRegion( ULONG nCount );
- // all rectangles were added and the clip region should be set now
- virtual void EndSetClipRegion();
+ virtual bool setClipRegion( const Region& );
// set the line color to transparent (= don't draw lines)
virtual void SetLineColor();
diff --git a/vcl/os2/inc/salinst.h b/vcl/os2/inc/salinst.h
index c533c0b8339c..4d98b803dfba 100644
--- a/vcl/os2/inc/salinst.h
+++ b/vcl/os2/inc/salinst.h
@@ -85,12 +85,9 @@ public:
virtual osl::SolarMutex* GetYieldMutex();
virtual ULONG ReleaseYieldMutex();
virtual void AcquireYieldMutex( ULONG nCount );
+ virtual bool CheckYieldMutex();
virtual void Yield( bool, bool );
virtual bool AnyInput( USHORT nType );
- virtual SalMenu* CreateMenu( BOOL bMenuBar );
- virtual void DestroyMenu( SalMenu* );
- virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData );
- virtual void DestroyMenuItem( SalMenuItem* );
virtual SalSession* CreateSalSession();
virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
diff --git a/vcl/os2/inc/salobj.h b/vcl/os2/inc/salobj.h
index fc4a1c027159..467c4537dc2a 100644
--- a/vcl/os2/inc/salobj.h
+++ b/vcl/os2/inc/salobj.h
@@ -65,6 +65,7 @@ public:
virtual void SetBackground();
virtual void SetBackground( SalColor nSalColor );
virtual const SystemEnvData* GetSystemData() const;
+ virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
};
#endif // _SV_SALOBJ_H
diff --git a/vcl/os2/source/app/salinst.cxx b/vcl/os2/source/app/salinst.cxx
index 44b87dc2a57b..e4fd783ccb27 100644
--- a/vcl/os2/source/app/salinst.cxx
+++ b/vcl/os2/source/app/salinst.cxx
@@ -40,7 +40,7 @@
#include <tools/debug.hxx>
#include <salids.hrc>
-#include <vcl/salatype.hxx>
+#include <vcl/apptypes.hxx>
#include <saldata.hxx>
#include <salinst.h>
#include <salframe.h>
@@ -295,10 +295,9 @@ void ImplSalAcquireYieldMutex( ULONG nCount )
// -----------------------------------------------------------------------
-#ifdef DBG_UTIL
-
-void ImplDbgTestSolarMutex()
+bool Os2SalInstance::CheckYieldMutex()
{
+ bool bRet = true;
SalData* pSalData = GetSalData();
ULONG nCurThreadId = GetCurrentThreadId();
if ( pSalData->mnAppThreadId != nCurThreadId )
@@ -308,7 +307,7 @@ void ImplDbgTestSolarMutex()
SalYieldMutex* pYieldMutex = pSalData->mpFirstInstance->mpSalYieldMutex;
if ( pYieldMutex->mnThreadId != nCurThreadId )
{
- OSL_FAIL( "SolarMutex not locked, and not thread save code in VCL is called from outside of the main thread" );
+ bRet = false;
}
}
}
@@ -319,14 +318,13 @@ void ImplDbgTestSolarMutex()
SalYieldMutex* pYieldMutex = pSalData->mpFirstInstance->mpSalYieldMutex;
if ( pYieldMutex->mnThreadId != nCurThreadId )
{
- OSL_FAIL( "SolarMutex not locked in the main thread" );
+ bRet = false;
}
}
}
+ return bRet;
}
-#endif
-
// =======================================================================
void InitSalData()
diff --git a/vcl/os2/source/gdi/salgdi.cxx b/vcl/os2/source/gdi/salgdi.cxx
index bef26eb6d02a..efd913c251b2 100644
--- a/vcl/os2/source/gdi/salgdi.cxx
+++ b/vcl/os2/source/gdi/salgdi.cxx
@@ -37,6 +37,7 @@
#include <salframe.h>
#include <tools/poly.hxx>
#include <rtl/strbuf.hxx>
+#include "vcl/region.h"
#ifndef __H_FT2LIB
#include <wingdi.h>
@@ -216,38 +217,29 @@ void Os2SalGraphics::ResetClipRegion()
// -----------------------------------------------------------------------
-void Os2SalGraphics::BeginSetClipRegion( ULONG nCount )
+bool Os2SalGraphics::setClipRegion( const Region& i_rClip )
{
+ ULONG nCount = i_rClip.GetRectCount();
+
mpClipRectlAry = new RECTL[ nCount ];
mnClipElementCount = 0;
-}
-
-// -----------------------------------------------------------------------
-
-BOOL Os2SalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeight )
-{
- RECTL* pClipRect = &mpClipRectlAry[ mnClipElementCount ];
- pClipRect->xLeft = nX;
- pClipRect->yTop = mnHeight - nY;
- pClipRect->xRight = nX + nWidth;
- pClipRect->yBottom = mnHeight - (nY + nHeight);
- mnClipElementCount++;
-
- return TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-bool Os2SalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- // TODO: implement and advertise OutDevSupport_B2DClip support
- return false;
-}
-// -----------------------------------------------------------------------
-
-void Os2SalGraphics::EndSetClipRegion()
-{
+ ImplRegionInfo aInfo;
+ long nX, nY, nW, nH;
+ bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
+ while( bRegionRect )
+ {
+ if ( nW && nH )
+ {
+ RECTL* pClipRect = &mpClipRectlAry[ mnClipElementCount ];
+ pClipRect->xLeft = nX;
+ pClipRect->yTop = mnHeight - nY;
+ pClipRect->xRight = nX + nW;
+ pClipRect->yBottom = mnHeight - (nY + nH);
+ mnClipElementCount++;
+ }
+ bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
+ }
#ifdef SAL_PRINTER_CLIPPATH
if ( mbPrinter )
{
@@ -286,6 +278,8 @@ void Os2SalGraphics::EndSetClipRegion()
}
delete [] mpClipRectlAry;
+
+ return true;
}
// -----------------------------------------------------------------------
diff --git a/vcl/os2/source/gdi/salgdi3.cxx b/vcl/os2/source/gdi/salgdi3.cxx
index 11aa9df9ce76..f1580fe77185 100644
--- a/vcl/os2/source/gdi/salgdi3.cxx
+++ b/vcl/os2/source/gdi/salgdi3.cxx
@@ -427,9 +427,8 @@ bool ImplOs2FontData::IsGSUBstituted( sal_Ucs cChar ) const
// -----------------------------------------------------------------------
-ImplFontCharMap* ImplOs2FontData::GetImplFontCharMap() const
+const ImplFontCharMap* ImplOs2FontData::GetImplFontCharMap() const
{
- mpUnicodeMap->AddReference();
return mpUnicodeMap;
}
@@ -562,6 +561,7 @@ void ImplOs2FontData::ReadCmapTable( HPS hPS ) const
aResult.mpPairCodes, aResult.mpStartGlyphs );
else
mpUnicodeMap = ImplFontCharMap::GetDefaultMap();
+ mpUnicodeMap->AddReference();
}
// =======================================================================
@@ -954,10 +954,10 @@ ULONG Os2SalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
// -----------------------------------------------------------------------
-static ImplFontCharMap* pOs2DefaultImplFontCharMap = NULL;
+static const ImplFontCharMap* pOs2DefaultImplFontCharMap = NULL;
static const sal_uInt32 pOs2DefaultRangeCodes[] = {0x0020,0x00FF};
-ImplFontCharMap* Os2SalGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* Os2SalGraphics::GetImplFontCharMap() const
{
if( !mpOs2FontData[0] )
return ImplFontCharMap::GetDefaultMap();
@@ -1636,7 +1636,7 @@ void Os2SalGraphics::GetGlyphWidths( const ImplFontData* pFont,
rUnicodeEnc.clear();
}
const ImplOs2FontData* pWinFont = static_cast<const ImplOs2FontData*>(pFont);
- ImplFontCharMap* pMap = pWinFont->GetImplFontCharMap();
+ const ImplFontCharMap* pMap = pWinFont->GetImplFontCharMap();
DBG_ASSERT( pMap && pMap->GetCharCount(), "no map" );
int nCharCount = pMap->GetCharCount();
diff --git a/vcl/os2/source/window/makefile.mk b/vcl/os2/source/window/makefile.mk
index f4a6ad0cb870..560d35880b21 100644
--- a/vcl/os2/source/window/makefile.mk
+++ b/vcl/os2/source/window/makefile.mk
@@ -40,7 +40,7 @@ CXXFILES__YD= salframe.cxx \
salobj.cxx
SLOFILES= $(SLO)$/salframe.obj \
- $(SLO)$/salobj.obj $(SLO)$/salmenu.obj
+ $(SLO)$/salobj.obj
# --- Targets ------------------------------------------------------
diff --git a/vcl/os2/source/window/salframe.cxx b/vcl/os2/source/window/salframe.cxx
index f7fa3f645549..ebc557faafb2 100644
--- a/vcl/os2/source/window/salframe.cxx
+++ b/vcl/os2/source/window/salframe.cxx
@@ -2018,8 +2018,6 @@ void Os2SalFrame::UpdateSettings( AllSettings& rSettings )
// --- Style settings ---
StyleSettings aStyleSettings = rSettings.GetStyleSettings();
- BOOL bCompBorder = (aStyleSettings.GetOptions() & (STYLE_OPTION_MACSTYLE | STYLE_OPTION_UNIXSTYLE)) == 0;
-
// General settings
LONG nDisplayTime = PrfQueryProfileInt( HINI_PROFILE, (PSZ)aControlPanel, (PSZ)"LogoDisplayTime", -1 );
ULONG nSalDisplayTime;
@@ -2041,32 +2039,26 @@ void Os2SalFrame::UpdateSettings( AllSettings& rSettings )
// Size settings
aStyleSettings.SetScrollBarSize( WinQuerySysValue( HWND_DESKTOP, SV_CYHSCROLL ) );
- if ( bCompBorder )
- {
- aStyleSettings.SetTitleHeight( WinQuerySysValue( HWND_DESKTOP, SV_CYTITLEBAR ) );
- }
+ aStyleSettings.SetTitleHeight( WinQuerySysValue( HWND_DESKTOP, SV_CYTITLEBAR ) );
// Color settings
- if ( bCompBorder )
- {
- aStyleSettings.SetFaceColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONMIDDLE, 0 ) ) );
- aStyleSettings.SetInactiveTabColor( aStyleSettings.GetFaceColor() );
- aStyleSettings.SetLightColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONLIGHT, 0 ) ) );
- aStyleSettings.SetLightBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONMIDDLE, 0 ) ) );
- aStyleSettings.SetShadowColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONDARK, 0 ) ) );
- aStyleSettings.SetDarkShadowColor( Color( COL_BLACK ) );
- aStyleSettings.SetDialogColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_DIALOGBACKGROUND, 0 ) ) );
- aStyleSettings.SetButtonTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) );
- aStyleSettings.SetActiveColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVETITLE, 0 ) ) );
- aStyleSettings.SetActiveTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVETITLETEXT, 0 ) ) );
- aStyleSettings.SetActiveBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVEBORDER, 0 ) ) );
- aStyleSettings.SetDeactiveColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVETITLE, 0 ) ) );
- aStyleSettings.SetDeactiveTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVETITLETEXT, 0 ) ) );
- aStyleSettings.SetDeactiveBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVEBORDER, 0 ) ) );
- aStyleSettings.SetMenuColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENU, 0 ) ) );
- aStyleSettings.SetMenuTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) );
- aStyleSettings.SetMenuBarTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) );
- }
+ aStyleSettings.SetFaceColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONMIDDLE, 0 ) ) );
+ aStyleSettings.SetInactiveTabColor( aStyleSettings.GetFaceColor() );
+ aStyleSettings.SetLightColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONLIGHT, 0 ) ) );
+ aStyleSettings.SetLightBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONMIDDLE, 0 ) ) );
+ aStyleSettings.SetShadowColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONDARK, 0 ) ) );
+ aStyleSettings.SetDarkShadowColor( Color( COL_BLACK ) );
+ aStyleSettings.SetDialogColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_DIALOGBACKGROUND, 0 ) ) );
+ aStyleSettings.SetButtonTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) );
+ aStyleSettings.SetActiveColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVETITLE, 0 ) ) );
+ aStyleSettings.SetActiveTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVETITLETEXT, 0 ) ) );
+ aStyleSettings.SetActiveBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVEBORDER, 0 ) ) );
+ aStyleSettings.SetDeactiveColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVETITLE, 0 ) ) );
+ aStyleSettings.SetDeactiveTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVETITLETEXT, 0 ) ) );
+ aStyleSettings.SetDeactiveBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVEBORDER, 0 ) ) );
+ aStyleSettings.SetMenuColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENU, 0 ) ) );
+ aStyleSettings.SetMenuTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) );
+ aStyleSettings.SetMenuBarTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) );
aStyleSettings.SetDialogTextColor( aStyleSettings.GetButtonTextColor() );
aStyleSettings.SetRadioCheckTextColor( aStyleSettings.GetButtonTextColor() );
aStyleSettings.SetGroupTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_WINDOWSTATICTEXT, 0 ) ) );
@@ -2083,11 +2075,8 @@ void Os2SalFrame::UpdateSettings( AllSettings& rSettings )
Color aMenuHighColor = ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUHILITEBGND, 0 ) );
if ( ImplSalIsSameColor( aMenuHighColor, aStyleSettings.GetMenuColor() ) )
{
- if ( bCompBorder )
- {
- aStyleSettings.SetMenuHighlightColor( Color( COL_BLUE ) );
- aStyleSettings.SetMenuHighlightTextColor( Color( COL_WHITE ) );
- }
+ aStyleSettings.SetMenuHighlightColor( Color( COL_BLUE ) );
+ aStyleSettings.SetMenuHighlightTextColor( Color( COL_WHITE ) );
}
else
{
diff --git a/vcl/os2/source/window/salmenu.cxx b/vcl/os2/source/window/salmenu.cxx
deleted file mode 100644
index fa8f74202b0a..000000000000
--- a/vcl/os2/source/window/salmenu.cxx
+++ /dev/null
@@ -1,134 +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.
- *
- ************************************************************************/
-
-#define INCL_DOS
-#define INCL_PM
-#define INCL_WIN
-#include <svpm.h>
-#include <saldata.hxx>
-#include <salinst.h>
-#include <salmenu.h>
-
-
-// =======================================================================
-
-// Os2SalInst factory methods
-
-SalMenu* Os2SalInstance::CreateMenu( BOOL bMenuBar )
-{
- return NULL; // no support for native menues
-}
-
-void Os2SalInstance::DestroyMenu( SalMenu* pSalMenu )
-{
- delete pSalMenu;
-}
-
-
-SalMenuItem* Os2SalInstance::CreateMenuItem( const SalItemParams* pItemData )
-{
- return NULL; // no support for native menues
-}
-
-void Os2SalInstance::DestroyMenuItem( SalMenuItem* pSalMenuItem )
-{
- delete pSalMenuItem;
-}
-
-
-// =======================================================================
-
-
-/*
- * Os2SalMenu
- */
-
-
-Os2SalMenu::~Os2SalMenu()
-{
-}
-
-BOOL Os2SalMenu::VisibleMenuBar()
-{
- return FALSE;
-}
-
-void Os2SalMenu::SetFrame( const SalFrame *pFrame )
-{
-}
-
-void Os2SalMenu::InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos )
-{
-}
-
-void Os2SalMenu::RemoveItem( unsigned nPos )
-{
-}
-
-void Os2SalMenu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos )
-{
-}
-
-void Os2SalMenu::CheckItem( unsigned nPos, BOOL bCheck )
-{
-}
-
-void Os2SalMenu::EnableItem( unsigned nPos, BOOL bEnable )
-{
-}
-
-void Os2SalMenu::SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage )
-{
-}
-
-void Os2SalMenu::SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const XubString& rText )
-{
-}
-
-void Os2SalMenu::SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const XubString& rKeyName )
-{
-}
-
-void Os2SalMenu::GetSystemMenuData( SystemMenuData* pData )
-{
-}
-
-// =======================================================================
-
-/*
- * SalMenuItem
- */
-
-
-Os2SalMenuItem::~Os2SalMenuItem()
-{
-}
-
-// -------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/os2/source/window/salobj.cxx b/vcl/os2/source/window/salobj.cxx
index 2017196cdf5f..5c1e9ed03358 100644
--- a/vcl/os2/source/window/salobj.cxx
+++ b/vcl/os2/source/window/salobj.cxx
@@ -551,3 +551,9 @@ const SystemChildData* Os2SalObject::GetSystemData() const
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+// -----------------------------------------------------------------------
+
+void Os2SalObject::InterceptChildWindowKeyDown( sal_Bool /*bIntercept*/ )
+{
+}
+
diff --git a/vcl/prj/build.lst b/vcl/prj/build.lst
index f64757f2c9e1..2cf0bd3963d5 100644
--- a/vcl/prj/build.lst
+++ b/vcl/prj/build.lst
@@ -1,4 +1,4 @@
-vc vcl : l10n apple_remote BOOST:boost rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools l10ntools icc cpputools shell svl NULL
+vc vcl : L10N:l10n apple_remote BOOST:boost rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools l10ntools icc cpputools svl LIBXSLT:libxslt NULL
vc vcl usr1 - all vc_mkout NULL
vc vcl\inc nmake - all vc_inc NULL
vc vcl\source\glyphs nmake - all vc_glyphs vc_inc NULL
@@ -48,3 +48,10 @@ vc vcl\mac\source\src nmake - m vc__srcm vc_inc NULL
vc vcl\util nmake - all vc_util vc__plug.u vc__desk.u vc__aquy.u vc__appa.u vc__dtra.u vc__appm.m vc__appu.u vc__dtru.u vc__appw.w vc__appp.p vc__gdia.u vc__gdim.m vc__gdiu.u vc__gdiw.w vc__gdip.p vc__srcm.m vc__srcw.w vc__srcp.p vc__wina.u vc__winm.m vc__winu.u vc__winw.w vc__winp.p vc__gtka.u vc__gtky.u vc__gtkw.u vc__gtkg.u vc__kde.u vc__kde4.u vc__hl.u vc__ftmu.u vc__prgu.u vc__prnu.u vc_app vc_ctrl vc_gdi vc_hlp vc_src vc_win vc_glyphs vc_fts vc_components NULL
vc vcl\util\linksvp nmake - u vc_lsvp vc_util NULL
vc vcl\workben nmake - all vc_wrkb vc_util vc_salmain NULL
+
+# memCheck works only within unix
+# memCheck is not right yet
+# vc vcl\qa\complex\memCheck nmake - u vc_qa_complex vc_util NULL
+# GPF
+# vc vcl\qa\complex\persistent_window_states nmake - all vc_qa_complex vc_util NULL
+
diff --git a/vcl/prj/d.lst b/vcl/prj/d.lst
index c184c1d2cb2b..00b703cf43b9 100644
--- a/vcl/prj/d.lst
+++ b/vcl/prj/d.lst
@@ -12,17 +12,19 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\%__SRC%\misc\vcl?????.map %_DEST%\bin%_EXT%\vcl?????.map
..\%__SRC%\obj\salmain.obj %_DEST%\lib%_EXT%\salmain.obj
..\%__SRC%\obj\salmain.o %_DEST%\lib%_EXT%\salmain.o
+..\%__SRC%\lib\libvclmain.a %_DEST%\lib%_EXT%\libvclmain.a
+..\%__SRC%\lib\vclmain.lib %_DEST%\lib%_EXT%\vclmain.lib
..\inc\vcl\accel.hxx %_DEST%\inc%_EXT%\vcl\accel.hxx
..\inc\vcl\alpha.hxx %_DEST%\inc%_EXT%\vcl\alpha.hxx
..\inc\vcl\animate.hxx %_DEST%\inc%_EXT%\vcl\animate.hxx
..\inc\vcl\apptypes.hxx %_DEST%\inc%_EXT%\vcl\apptypes.hxx
+..\inc\vcl\arrange.hxx %_DEST%\inc%_EXT%\vcl\arrange.hxx
..\inc\vcl\bitmap.hxx %_DEST%\inc%_EXT%\vcl\bitmap.hxx
..\inc\vcl\bitmapex.hxx %_DEST%\inc%_EXT%\vcl\bitmapex.hxx
..\inc\vcl\bmpacc.hxx %_DEST%\inc%_EXT%\vcl\bmpacc.hxx
..\inc\vcl\btndlg.hxx %_DEST%\inc%_EXT%\vcl\btndlg.hxx
..\inc\vcl\button.hxx %_DEST%\inc%_EXT%\vcl\button.hxx
-..\inc\vcl\button.hxx %_DEST%\inc%_EXT%\vcl\imagebtn.hxx
..\inc\vcl\cmdevt.h %_DEST%\inc%_EXT%\vcl\cmdevt.h
..\inc\vcl\cmdevt.hxx %_DEST%\inc%_EXT%\vcl\cmdevt.hxx
..\inc\vcl\combobox.h %_DEST%\inc%_EXT%\vcl\combobox.h
@@ -41,7 +43,6 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\field.hxx %_DEST%\inc%_EXT%\vcl\field.hxx
..\inc\vcl\fixbrd.hxx %_DEST%\inc%_EXT%\vcl\fixbrd.hxx
..\inc\vcl\fixed.hxx %_DEST%\inc%_EXT%\vcl\fixed.hxx
-..\inc\vcl\fldunit.hxx %_DEST%\inc%_EXT%\vcl\fldunit.hxx
..\inc\vcl\floatwin.hxx %_DEST%\inc%_EXT%\vcl\floatwin.hxx
..\inc\vcl\fntstyle.hxx %_DEST%\inc%_EXT%\vcl\fntstyle.hxx
..\inc\vcl\font.hxx %_DEST%\inc%_EXT%\vcl\font.hxx
@@ -58,6 +59,7 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\image.hxx %_DEST%\inc%_EXT%\vcl\image.hxx
..\inc\vcl\imagerepository.hxx %_DEST%\inc%_EXT%\vcl\imagerepository.hxx
..\inc\vcl\imgctrl.hxx %_DEST%\inc%_EXT%\vcl\imgctrl.hxx
+..\inc\vcl\throbber.hxx %_DEST%\inc%_EXT%\vcl\throbber.hxx
..\inc\vcl\impdel.hxx %_DEST%\inc%_EXT%\vcl\impdel.hxx
..\inc\vcl\inputctx.hxx %_DEST%\inc%_EXT%\vcl\inputctx.hxx
..\inc\vcl\javachild.hxx %_DEST%\inc%_EXT%\vcl\javachild.hxx
@@ -70,7 +72,6 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\lstbox.h %_DEST%\inc%_EXT%\vcl\lstbox.h
..\inc\vcl\lstbox.hxx %_DEST%\inc%_EXT%\vcl\lstbox.hxx
..\inc\vcl\mapmod.hxx %_DEST%\inc%_EXT%\vcl\mapmod.hxx
-..\inc\vcl\mapunit.hxx %_DEST%\inc%_EXT%\vcl\mapunit.hxx
..\inc\vcl\menu.hxx %_DEST%\inc%_EXT%\vcl\menu.hxx
..\inc\vcl\menubtn.hxx %_DEST%\inc%_EXT%\vcl\menubtn.hxx
..\inc\vcl\metaact.hxx %_DEST%\inc%_EXT%\vcl\metaact.hxx
@@ -78,6 +79,7 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\metric.hxx %_DEST%\inc%_EXT%\vcl\metric.hxx
..\inc\vcl\mnemonic.hxx %_DEST%\inc%_EXT%\vcl\mnemonic.hxx
..\inc\vcl\mnemonicengine.hxx %_DEST%\inc%_EXT%\vcl\mnemonicengine.hxx
+..\inc\vcl\quickselectionengine.hxx %_DEST%\inc%_EXT%\vcl\quickselectionengine.hxx
..\inc\vcl\morebtn.hxx %_DEST%\inc%_EXT%\vcl\morebtn.hxx
..\inc\vcl\msgbox.hxx %_DEST%\inc%_EXT%\vcl\msgbox.hxx
..\inc\vcl\octree.hxx %_DEST%\inc%_EXT%\vcl\octree.hxx
@@ -129,7 +131,6 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\waitobj.hxx %_DEST%\inc%_EXT%\vcl\waitobj.hxx
..\inc\vcl\wall.hxx %_DEST%\inc%_EXT%\vcl\wall.hxx
..\inc\vcl\window.hxx %_DEST%\inc%_EXT%\vcl\window.hxx
-..\inc\vcl\wintypes.hxx %_DEST%\inc%_EXT%\vcl\wintypes.hxx
..\inc\vcl\wrkwin.hxx %_DEST%\inc%_EXT%\vcl\wrkwin.hxx
..\inc\vcl\threadex.hxx %_DEST%\inc%_EXT%\vcl\threadex.hxx
..\inc\vcl\evntpost.hxx %_DEST%\inc%_EXT%\vcl\evntpost.hxx
@@ -145,7 +146,6 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\pdfextoutdevdata.hxx %_DEST%\inc%_EXT%\vcl\pdfextoutdevdata.hxx
..\inc\vcl\pngread.hxx %_DEST%\inc%_EXT%\vcl\pngread.hxx
..\inc\vcl\pngwrite.hxx %_DEST%\inc%_EXT%\vcl\pngwrite.hxx
-..\inc\vcl\smartid.hxx %_DEST%\inc%_EXT%\vcl\smartid.hxx
..\inc\vcl\configsettings.hxx %_DEST%\inc%_EXT%\vcl\configsettings.hxx
..\inc\vcl\ImageListProvider.hxx %_DEST%\inc%_EXT%\vcl\ImageListProvider.hxx
..\inc\vcl\fontmanager.hxx %_DEST%\inc%_EXT%\vcl\fontmanager.hxx
@@ -155,3 +155,7 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\helper.hxx %_DEST%\inc%_EXT%\vcl\helper.hxx
..\inc\vcl\strhelper.hxx %_DEST%\inc%_EXT%\vcl\strhelper.hxx
..\inc\vcl\lazydelete.hxx %_DEST%\inc%_EXT%\vcl\lazydelete.hxx
+..\inc\vcl\arrange.hxx %_DEST%\inc%_EXT%\vcl\arrange.hxx
+..\inc\vcl\wpropset.hxx %_DEST%\inc%_EXT%\vcl\wpropset.hxx
+..\%__SRC%\misc\vcl.component %_DEST%\xml%_EXT%\vcl.component
+
diff --git a/vcl/qa/complex/memCheck/CheckMemoryUsage.java b/vcl/qa/complex/memCheck/CheckMemoryUsage.java
index 9f8272240403..a089a1c99f54 100644
--- a/vcl/qa/complex/memCheck/CheckMemoryUsage.java
+++ b/vcl/qa/complex/memCheck/CheckMemoryUsage.java
@@ -32,19 +32,27 @@ import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.util.XCloseable;
-import complexlib.ComplexTestCase;
+// import complexlib.ComplexTestCase;
import helper.ProcessHandler;
import java.io.File;
-import java.io.FilePermission;
+// import java.io.FilePermission;
import java.io.FileWriter;
import java.io.FilenameFilter;
import java.io.PrintWriter;
import java.util.Enumeration;
import java.util.StringTokenizer;
import java.util.Vector;
+import lib.*;
import util.DesktopTools;
-import util.WriterTools;
-import util.utils;
+// import util.WriterTools;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
/**
* Documents are opened and exported with StarOffice. The memory usage of
@@ -66,95 +74,141 @@ import util.utils;
* All parameters are used for iteration over the test document path.
* </ul>
*/
-public class CheckMemoryUsage extends ComplexTestCase {
+class TempDir
+{
+
+ private String m_sTempDir;
+
+ public TempDir(String _sTempDir)
+ {
+ m_sTempDir = _sTempDir;
+ }
+
+ public String getOfficeTempDir()
+ {
+ return m_sTempDir;
+ }
+
+ public String getTempDir()
+ {
+ final String sTempDir = FileHelper.getJavaCompatibleFilename(m_sTempDir);
+ return sTempDir;
+ }
+}
+
+public class CheckMemoryUsage /* extends ComplexTestCase */
+
+{
+
private final String sWriterDoc = "sxw,writer_pdf_Export";
private final String sCalcDoc = "sxc,calc_pdf_Export";
private final String sImpressDoc = "sxi,impress_pdf_Export";
- private String sProcessId = "ps -ef | grep $USER | grep soffice | grep -v grep";
- private String sMemoryMonitor = "pmap <processID> | grep total";
- private String sChmod = "chmod 777 ";
- private String sProcessIdCommand = null;
- private String sOfficeMemoryCommand = null;
- private String sTempDir = null;
- private String sFS = null;
- private String sMemoryMap1 = null;
- private String sMemoryMap2 = null;
- private String bash = "#!/bin/bash";
- private String sDocumentPath = "";
+ // private String sProcessIdCommand = null;
+ TempDir m_aTempDir;
+ // private String sFS = null;
+ // private String sMemoryMap1 = null;
+ // private String sMemoryMap2 = null;
+ // private String sDocumentPath = "";
private String[][] sDocTypeExportFilter;
private String[][] sDocuments;
private int iAllowMemoryIncrease = 10;
private int iExportDocCount = 25;
+ /**
+ * The test parameters
+ */
+ private static TestParameters param = null;
/**
* Get all test methods
* @return The test methods.
- */
- public String[] getTestMethodNames() {
- return new String[] {"loadAndSaveDocuments"};
- }
-
+ // */
+// public String[] getTestMethodNames() {
+// return new String[] {"loadAndSaveDocuments"};
+// }
/**
* Collect all documnets to load and all filters used for export.
*/
- public void before() {
+ @Before
+ public void before()
+ {
+
+ final XMultiServiceFactory xMsf = getMSF();
+
+ // some Tests need the qadevOOo TestParameters, it is like a Hashmap for Properties.
+ param = new TestParameters();
+ param.put("ServiceFactory", xMsf); // some qadevOOo functions need the ServiceFactory
+
// test does definitely not run on Windows.
- if (param.get("OperatingSystem").equals("wntmsci")) {
- log.println("Test can only reasonably be executed with a tool that "
- + "displays the memory usage of StarOffice.");
- failed("Test does not run on Windows, only on Solaris or Linux.");
+ if (param.get("OperatingSystem").equals("wntmsci"))
+ {
+ System.out.println("Test can only reasonably be executed with a tool that "
+ + "displays the memory usage of StarOffice.");
+ System.out.println("Test does not run on Windows, only on Solaris or Linux.");
+ // in an automatic environment it is better to say, there is no error here.
+ // it is a limitation, but no error.
+ System.exit(0);
}
+
// how many times is every document exported.
int count = param.getInt("ExportDocCount");
if (count != 0)
+ {
iExportDocCount = count;
+ }
// get the temp dir for creating the command scripts.
- sTempDir = System.getProperty("java.io.tmpdir");
- sProcessIdCommand = sTempDir + "getPS";
- sOfficeMemoryCommand = sTempDir + "getPmap";
+ // sTempDir = System.getProperty("java.io.tmpdir");
+ m_aTempDir = new TempDir(util.utils.getOfficeTemp/*Dir*/(xMsf));
// get the file extension, export filter connection
Enumeration keys = param.keys();
- Vector v = new Vector();
- while(keys.hasMoreElements()) {
- String key = (String)keys.nextElement();
- if (key.startsWith("FileExportFilter")) {
- v.add(param.get(key));
+ Vector<String> v = new Vector<String>();
+ while (keys.hasMoreElements())
+ {
+ String key = (String) keys.nextElement();
+ if (key.startsWith("FileExportFilter"))
+ {
+ v.add((String) param.get(key));
}
}
// if no param given, set defaults.
- if (v.size() == 0){
+ if (v.size() == 0)
+ {
v.add(sWriterDoc);
v.add(sCalcDoc);
v.add(sImpressDoc);
}
// store a file extension
sDocTypeExportFilter = new String[v.size()][2];
- for (int i=0; i<v.size(); i++) {
+ for (int i = 0; i < v.size(); i++)
+ {
// 2do: error routine for wrong given params
- StringTokenizer t = new StringTokenizer((String)v.get(i), ",");
- sDocTypeExportFilter[i][0] = t.nextToken();
- sDocTypeExportFilter[i][1] = t.nextToken();
+ final String sVContent = v.get(i);
+ StringTokenizer t = new StringTokenizer(sVContent, ",");
+ final String sExt = t.nextToken();
+ final String sName = t.nextToken();
+ sDocTypeExportFilter[i][0] = sExt;
+ sDocTypeExportFilter[i][1] = sName;
}
// get files to load and export
- sDocumentPath = (String)param.get("TestDocumentPath");
- File f = new File(sDocumentPath);
- sDocumentPath = f.getAbsolutePath();
- String sFS = System.getProperty("file.separator");
+// sDocumentPath = (String) param.get("TestDocumentPath");
+ String sDocumentPath = TestDocument.getUrl();
+ File f = new File(FileHelper.getJavaCompatibleFilename(sDocumentPath));
+ // sDocumentPath = f.getAbsolutePath();
+ // String sFS = System.getProperty("file.separator");
sDocuments = new String[sDocTypeExportFilter.length][];
- for (int j=0; j<sDocTypeExportFilter.length; j++) {
+ for (int j = 0; j < sDocTypeExportFilter.length; j++)
+ {
FileFilter filter = new FileFilter(sDocTypeExportFilter[j][0]);
String[] doc = f.list(filter);
sDocuments[j] = new String[doc.length];
- for (int i=0; i<doc.length; i++) {
- if (sDocumentPath.endsWith(sFS))
- sDocuments[j][i] = sDocumentPath + doc[i];
- else
- sDocuments[j][i] = sDocumentPath + sFS + doc[i];
- sDocuments[j][i] = utils.getFullURL(sDocuments[j][i]);
+ for (int i = 0; i < doc.length; i++)
+ {
+ // final String sDocument = FileHelper.appendPath(sDocumentPath, doc[i]);
+ // sDocuments[j][i] = utils.getFullURL(sDocuments[j][i]);
+ sDocuments[j][i] = TestDocument.getUrl(doc[i]);
}
}
}
@@ -162,141 +216,323 @@ public class CheckMemoryUsage extends ComplexTestCase {
/**
* delete all created files on disk
*/
- public void after() {
+ @After
+ public void after()
+ {
// delete the constructed files.
- for (int i=0; i<iExportDocCount; i++) {
- File f = new File(sTempDir + "DocExport" + i + ".pdf");
- f.delete();
- }
- File f = new File(sProcessIdCommand);
- f.delete();
- f = new File(sOfficeMemoryCommand);
- f.delete();
+// we don't need to delete anything, all is stored in $USER_TREE
+// for (int i = 0; i < iExportDocCount; i++)
+// {
+// final String sDocumentName = "DocExport" + i + ".pdf";
+// final String sFilename = FileHelper.appendPath(m_sTempDir, sDocumentName);
+// File f = new File(FileHelper.getJavaCompatibleFilename(sFilename));
+// f.delete();
+// }
+ // File f = new File(sProcessIdCommand);
+ // f.delete();
+ // f = new File(sOfficeMemoryCommand);
+ // f.delete();
}
/**
- * Thet etst function: load documents and save them using the given filters
+ * The test function: load documents and save them using the given filters
* for each given document type.
*/
- public void loadAndSaveDocuments() {
- int storageBefore = getOfficeMemoryUsage();
+ @Test
+ public void loadAndSaveDocuments()
+ {
+ int nOk = 0;
+ int nRunThrough = 0;
- XMultiServiceFactory xMSF = (XMultiServiceFactory)param.getMSF();
+ // At first:
+ // we load the document, there will be some post work in office like late initialisations
+ // we store exact one time the document
+ // so the memory footprint should be right
// iterate over all document types
- for (int k=0; k<sDocTypeExportFilter.length; k++) {
+ for (int k = 0; k < sDocTypeExportFilter.length; k++)
+ {
// iterate over all documents of this type
- for (int i=0; i<sDocuments[k].length; i++) {
- System.out.println("Document: "+ sDocuments[k][i]);
- XComponent xComponent = DesktopTools.loadDoc(xMSF, sDocuments[k][i], null);
- XStorable xStorable = (XStorable)UnoRuntime.queryInterface(XStorable.class, xComponent);
- if (xStorable != null) {
- // export each document iExportDocCount times
- for (int j=0; j<iExportDocCount; j++) {
- String url = utils.getFullURL(sTempDir + "DocExport" + j + ".pdf");
- try {
- PropertyValue[] props = new PropertyValue[1];
- props[0] = new PropertyValue();
- props[0].Name = "FilterName";
- // use export filter for this doc type
- props[0].Value = sDocTypeExportFilter[k][1];
- xStorable.storeToURL(url, props);
- }
- catch(com.sun.star.io.IOException e) {
- failed("Could not store to '" + url + "'", true);
- }
- }
- // close the doc
- XCloseable xCloseable = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xStorable);
- try {
- xCloseable.close(true);
- }
- catch(com.sun.star.util.CloseVetoException e) {
- e.printStackTrace((java.io.PrintWriter)log);
- failed("Cannot close document: test is futile, Office will surely use more space.");
- }
- }
- else {
- log.println("Cannot query for XStorable interface on document '" + sDocuments[i] + "'");
- log.println(" -> Skipping storage.");
- }
+ for (int i = 0; i < sDocuments[k].length; i++)
+ {
+
+ final String sDocument = sDocuments[k][i];
+ final String sExtension = sDocTypeExportFilter[k][1];
+
+// OfficeMemchecker aChecker = new OfficeMemchecker();
+// aChecker.setDocumentName(FileHelper.getBasename(sDocument));
+// aChecker.setExtension(sExtension);
+// aChecker.start();
+
+ loadAndSaveNTimesDocument(sDocument, 1, sExtension);
+
+// nOk += checkMemory(aChecker);
+// nRunThrough ++;
}
+ System.out.println();
+ System.out.println();
}
- // short wait for the office to 'calm down' and free some memory
- shortWait(5000);
- // wait util memory is not freed anymore.
- int storageAfter = getOfficeMemoryUsage();
- int mem = 0;
- int count = 0;
- while (storageAfter != mem && count < 10) {
- count++;
- mem = storageAfter;
- storageAfter = getOfficeMemoryUsage();
- shortWait(1000);
- }
- assure("The Office consumes now " + (storageAfter - storageBefore)
- + "K more memory than at the start of the test; allowed were "
- + iAllowMemoryIncrease * iExportDocCount + "K.",
- storageAfter - storageBefore < iAllowMemoryIncrease * iExportDocCount);
+ shortWait(10000);
+
+ // Now the real test, load document and store 25 times
+
+ // iterate over all document types
+ for (int k = 0; k < sDocTypeExportFilter.length; k++)
+ {
+ // iterate over all documents of this type
+ for (int i = 0; i < sDocuments[k].length; i++)
+ {
+
+ final String sDocument = sDocuments[k][i];
+ final String sExtension = sDocTypeExportFilter[k][1];
+
+ OfficeMemchecker aChecker = new OfficeMemchecker();
+ aChecker.setDocumentName(FileHelper.getBasename(sDocument));
+ aChecker.setExtension(sExtension);
+ aChecker.start();
+
+ loadAndSaveNTimesDocument(sDocument, iExportDocCount, sExtension);
+
+ aChecker.stop();
+ final int nConsumMore = aChecker.getConsumMore();
+
+ nOk += checkMemory(nConsumMore);
+ nRunThrough++;
+ }
+ System.out.println();
+ System.out.println();
+ }
+ System.out.println("Find the output of used 'pmap' here: " + m_aTempDir.getTempDir() + " if test failed.");
+ assertTrue("Office consumes too many memory.", nOk == nRunThrough);
}
/**
- * Get the process ID from the Office
- * @return the Id as String
+ * Checks how much memory should consum
+ * @param storageBefore
+ * @return 1 if consum is ok, else 0
*/
- private String getOfficeProcessID() {
- writeExecutableFile(sProcessIdCommand, sProcessId);
- ProcessHandler processID = new ProcessHandler(sProcessIdCommand);
- processID.executeSynchronously();
- String text = processID.getOutputText();
- if (text == null || text.equals("") || text.indexOf(' ') == -1)
- failed("Could not determine Office process ID. Check " + sProcessIdCommand);
- StringTokenizer aToken = new StringTokenizer(text);
- // this is not nice, but ps gives the same output on every machine
- aToken.nextToken();
- String id = aToken.nextToken();
- return id;
+ private int checkMemory(int nConsumMore)
+ {
+ int nAllowed = iAllowMemoryIncrease * iExportDocCount;
+ System.out.println("The Office consumes now " + nConsumMore
+ + "K more memory than at the start of the test; allowed were "
+ + nAllowed + "K.");
+ if (nConsumMore > nAllowed)
+ {
+ System.out.println("ERROR: This is not allowed.");
+ return 0;
+ }
+ System.out.println("OK.");
+ return 1;
}
/**
- * Get the memory usage of the Office in KByte.
- * @return The memory used by the Office.
+ * load and save exact one document
*/
- private int getOfficeMemoryUsage() {
- String command = sMemoryMonitor.replaceAll("<processID>", getOfficeProcessID());
- writeExecutableFile(sOfficeMemoryCommand, command);
- ProcessHandler processID = new ProcessHandler(sOfficeMemoryCommand);
- processID.executeSynchronously();
- String text = processID.getOutputText();
- if (text == null || text.equals("") || text.indexOf(' ') == -1) {
- failed("Could not determine Office memory usage. Check " + sOfficeMemoryCommand);
+ private void loadAndSaveNTimesDocument(String _sDocument, int _nCount, String _sStoreExtension)
+ {
+ System.out.println("Document: " + _sDocument);
+ XComponent xComponent = DesktopTools.loadDoc(getMSF(), _sDocument, null);
+ XStorable xStorable = UnoRuntime.queryInterface(XStorable.class, xComponent);
+ if (xStorable != null)
+ {
+ // export each document iExportDocCount times
+ for (int j = 0; j < _nCount; j++)
+ {
+ final String sDocumentName = FileHelper.getBasename(_sDocument) + "_" + j + ".pdf";
+ final String sFilename = FileHelper.appendPath(m_aTempDir.getOfficeTempDir(), sDocumentName);
+ // String url = utils.getFullURL(sFilename);
+ String url = sFilename; // graphical.FileHelper.getFileURLFromSystemPath(sFilename);
+ try
+ {
+ PropertyValue[] props = new PropertyValue[1];
+ props[0] = new PropertyValue();
+ props[0].Name = "FilterName";
+ // use export filter for this doc type
+ props[0].Value = _sStoreExtension;
+ xStorable.storeToURL(url, props);
+ }
+ catch (com.sun.star.io.IOException e)
+ {
+ fail("Could not store to '" + url + "'");
+ }
+ }
+ // close the doc
+ XCloseable xCloseable = UnoRuntime.queryInterface(XCloseable.class, xStorable);
+ try
+ {
+ xCloseable.close(true);
+ }
+ catch (com.sun.star.util.CloseVetoException e)
+ {
+ e.printStackTrace();
+ fail("Cannot close document: test is futile, Office will surely use more space.");
+ }
+ }
+ else
+ {
+ System.out.println("Cannot query for XStorable interface on document '" + _sDocument + "'");
+ System.out.println(" -> Skipping storage.");
}
- StringTokenizer aToken = new StringTokenizer(text);
- // this works, because the output of pmap is quite standardized.
- aToken.nextToken();
- String mem = aToken.nextToken();
- mem = mem.substring(0, mem.indexOf('K'));
- Integer memory = new Integer(mem);
- return memory.intValue();
+
}
- /**
- * Write a script file and set its rights to rwxrwxrwx.
- * @param fileName The name of the created file
- * @param line The commandline that has to be written inside of the file.
- */
- private void writeExecutableFile(String fileName, String line) {
- try {
- PrintWriter fWriter = new PrintWriter(new FileWriter(fileName));
- fWriter.println(bash);
- fWriter.println(line);
- fWriter.close();
- // change rights to rwxrwxrwx
- ProcessHandler processID = new ProcessHandler(sChmod + fileName);
+// -----------------------------------------------------------------------------
+ private class OfficeMemchecker
+ {
+
+ /**
+ * After called start() it contains the memory need at startup
+ */
+ private int m_nMemoryStart;
+ /**
+ * After called stop() it contains the memory usage
+ */
+ private int m_nMemoryUsage;
+ private String m_sDocumentName;
+ private String m_sExtension;
+
+ public OfficeMemchecker()
+ {
+ m_nMemoryStart = 0;
+ }
+
+ public void setDocumentName(String _sDocName)
+ {
+ m_sDocumentName = _sDocName;
+ }
+
+ public void setExtension(String _sExt)
+ {
+ m_sExtension = _sExt;
+ }
+
+ public void start()
+ {
+ m_nMemoryStart = getOfficeMemoryUsage(createModeName("start", 0));
+ }
+
+ private String createModeName(String _sSub, int _nCount)
+ {
+ StringBuffer aBuf = new StringBuffer();
+ aBuf.append(_sSub);
+ aBuf.append('_').append(m_sDocumentName).append('_').append(m_sExtension);
+ aBuf.append('_').append(_nCount);
+ return aBuf.toString();
+ }
+
+ public void stop()
+ {
+ // short wait for the office to 'calm down' and free some memory
+ shortWait(20000);
+ // wait util memory is not freed anymore.
+ int storageAfter = getOfficeMemoryUsage(createModeName("stop", 0));
+ int mem = 0;
+ int count = 0;
+ while (storageAfter != mem && count < 10)
+ {
+ count++;
+ mem = storageAfter;
+ storageAfter = getOfficeMemoryUsage(createModeName("stop", count));
+ shortWait(1000);
+ }
+ m_nMemoryUsage = (storageAfter - m_nMemoryStart);
+ }
+
+ public int getConsumMore()
+ {
+ return m_nMemoryUsage;
+ }
+
+ /**
+ * Get the process ID from the Office
+ * @return the Id as String
+ */
+ private String getOfficeProcessID()
+ {
+ String sProcessIdCommand = FileHelper.appendPath(m_aTempDir.getTempDir(), "getPS");
+ final String sofficeArg = org.openoffice.test.Argument.get("soffice");
+ final String sPSGrep = "ps -ef | grep $USER | grep <soffice>.bin | grep -v grep";
+ final String sProcessId = sPSGrep.replaceAll("<soffice>", FileHelper.getJavaCompatibleFilename(sofficeArg));
+
+ createExecutableFile(sProcessIdCommand, sProcessId);
+ ProcessHandler processID = new ProcessHandler(sProcessIdCommand);
+ processID.noOutput();
+ processID.executeSynchronously();
+ String text = processID.getOutputText();
+ if (text == null || text.equals("") || text.indexOf(' ') == -1)
+ {
+ fail("Could not determine Office process ID. Check " + sProcessIdCommand);
+ }
+ StringTokenizer aToken = new StringTokenizer(text);
+ // this is not nice, but ps gives the same output on every machine
+ aToken.nextToken();
+ String id = aToken.nextToken();
+ return id;
+ }
+
+ /**
+ * Get the memory usage of the Office in KByte.
+ * @return The memory used by the Office.
+ */
+ private int getOfficeMemoryUsage(String _sMode)
+ {
+ final String sMemoryMonitor = "pmap <processID> |tee <pmapoutputfile> | grep total";
+ String sOfficeMemoryCommand = null;
+ sOfficeMemoryCommand = FileHelper.appendPath(m_aTempDir.getTempDir(), "getPmap");
+ // sOfficeMemoryCommand = FileHelper.getJavaCompatibleFilename(sOfficeMemoryCommand);
+ String command = sMemoryMonitor.replaceAll("<processID>", getOfficeProcessID());
+ String sPmapOutputFile = FileHelper.appendPath(m_aTempDir.getTempDir(), "pmap_" + _sMode + ".txt");
+ command = command.replaceAll("<pmapoutputfile>", sPmapOutputFile);
+ createExecutableFile(sOfficeMemoryCommand, command);
+
+ ProcessHandler processID = new ProcessHandler(sOfficeMemoryCommand);
+ processID.noOutput();
processID.executeSynchronously();
+ int nError = processID.getExitCode();
+ assertTrue("Execute of " + sOfficeMemoryCommand + " failed", nError == 0);
+ String text = processID.getOutputText();
+ if (text == null || text.equals("") || text.indexOf(' ') == -1)
+ {
+ fail("Could not determine Office memory usage. Check " + sOfficeMemoryCommand);
+ }
+ StringTokenizer aToken = new StringTokenizer(text);
+ // this works, because the output of pmap is quite standardized.
+ aToken.nextToken();
+ String mem = aToken.nextToken();
+ mem = mem.substring(0, mem.indexOf('K'));
+ Integer memory = new Integer(mem);
+ return memory.intValue();
}
- catch(java.io.IOException e) {
+
+ /**
+ * Write a script file and set its rights to rwxrwxrwx.
+ * @param fileName The name of the created file
+ * @param line The commandline that has to be written inside of the file.
+ */
+ private void createExecutableFile(String fileName, String line)
+ {
+ final String sChmod = "chmod a+x ";
+ final String bash = "#!/bin/bash";
+
+ try
+ {
+ String sFilename = FileHelper.getJavaCompatibleFilename(fileName);
+ PrintWriter fWriter = new PrintWriter(new FileWriter(sFilename));
+ fWriter.println(bash);
+ fWriter.println(line);
+ fWriter.close();
+ // change rights to rwxrwxrwx
+ ProcessHandler processID = new ProcessHandler(sChmod + sFilename);
+ processID.noOutput();
+ processID.executeSynchronously();
+ int nError = processID.getExitCode();
+ assertTrue("chmod failed. ", nError == 0);
+ }
+ catch (java.io.IOException e)
+ {
+ }
}
}
@@ -304,11 +540,15 @@ public class CheckMemoryUsage extends ComplexTestCase {
* Let this thread sleep for some time
* @param milliSeconds time to wait in milliseconds.
*/
- private void shortWait(int milliSeconds) {
- try {
+ public static void shortWait(int milliSeconds)
+ {
+ System.out.println("Wait for: " + milliSeconds + "ms");
+ try
+ {
Thread.sleep(milliSeconds);
}
- catch(java.lang.InterruptedException e) { // ignore
+ catch (java.lang.InterruptedException e)
+ { // ignore
}
}
@@ -316,15 +556,20 @@ public class CheckMemoryUsage extends ComplexTestCase {
* Own file filter, will just return ok for all files that end with a given
* suffix
*/
- private class FileFilter implements FilenameFilter {
+ private class FileFilter implements FilenameFilter
+ {
+
private String suffix = null;
+
/**
* C'tor.
* @param suffix The suffix each filename should end with.
*/
- public FileFilter(String suffix) {
+ public FileFilter(String suffix)
+ {
this.suffix = suffix;
}
+
/**
* Returns true, if the name of the file has the suffix given to the
* c'tor.
@@ -332,9 +577,32 @@ public class CheckMemoryUsage extends ComplexTestCase {
* @param file Not used.
* @return True, if name ends with suffix.
*/
- public boolean accept(File file, String name) {
+ public boolean accept(File file, String name)
+ {
return name.endsWith(suffix);
}
- };
+ }
+
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
+ }
+ // setup and close connections
+ @BeforeClass
+ public static void setUpConnection() throws Exception
+ {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass
+ public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+ private static final OfficeConnection connection = new OfficeConnection();
}
diff --git a/vcl/qa/complex/memCheck/FileHelper.java b/vcl/qa/complex/memCheck/FileHelper.java
new file mode 100644
index 000000000000..21ce46185b4a
--- /dev/null
+++ b/vcl/qa/complex/memCheck/FileHelper.java
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+package complex.memCheck;
+
+import java.io.File;
+
+/**
+ *
+ * @author ll93751
+ */
+public class FileHelper
+{
+ public static String appendPath(String _sPath, String _sRelativePathToAdd)
+ {
+ String sNewPath = _sPath;
+ String fs = System.getProperty("file.separator");
+ if (_sPath.startsWith("file:"))
+ {
+ fs = "/"; // we use a file URL so only '/' is allowed.
+ }
+ if (! (sNewPath.endsWith("/") || sNewPath.endsWith("\\") ) )
+ {
+ sNewPath += fs;
+ }
+ sNewPath += _sRelativePathToAdd;
+ return sNewPath;
+ }
+ public static String getJavaCompatibleFilename(String _sFilename)
+ {
+ // It is a little bit stupid that office urls not compatible to java file urls
+ // System.out.println("java.io.File can't access Office file urls.");
+ if(_sFilename.startsWith("path:"))
+ {
+ final String sPath = _sFilename.substring(5);
+ return sPath;
+ }
+
+ String sSystemPath = graphical.FileHelper.getSystemPathFromFileURL(_sFilename);
+ if (sSystemPath == null)
+ {
+ sSystemPath = _sFilename;
+ }
+ return sSystemPath;
+ }
+
+public static String getBasename(String _sFilename)
+ {
+ if (_sFilename == null)
+ {
+ return "";
+ }
+ // String fs = System.getProperty("file.separator");
+
+ int nIdx = _sFilename.lastIndexOf("\\");
+ if (nIdx == -1)
+ {
+ nIdx = _sFilename.lastIndexOf("/");
+ }
+ if (nIdx > 0)
+ {
+ return _sFilename.substring(nIdx + 1);
+ }
+ return _sFilename;
+ }
+}
diff --git a/vcl/qa/complex/memCheck/TestDocument.java b/vcl/qa/complex/memCheck/TestDocument.java
new file mode 100644
index 000000000000..8ca9f7b71192
--- /dev/null
+++ b/vcl/qa/complex/memCheck/TestDocument.java
@@ -0,0 +1,45 @@
+/*************************************************************************
+*
+* 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.
+*
+************************************************************************/
+
+package complex.memCheck;
+
+import java.io.File;
+import org.openoffice.test.OfficeFileUrl;
+
+final class TestDocument
+{
+ final static String sPathname = "testdocuments";
+ public static String getUrl(String name)
+ {
+ return OfficeFileUrl.getAbsolute(new File(sPathname, name));
+ }
+ public static String getUrl()
+ {
+ return OfficeFileUrl.getAbsolute(new File(sPathname));
+ }
+ private TestDocument() {}
+}
diff --git a/vcl/qa/complex/memCheck/makefile.mk b/vcl/qa/complex/memCheck/makefile.mk
index d1d4b5c08c98..4a809e71e50e 100755
--- a/vcl/qa/complex/memCheck/makefile.mk
+++ b/vcl/qa/complex/memCheck/makefile.mk
@@ -25,65 +25,107 @@
#
#*************************************************************************
-PRJ = ..$/..$/..
-TARGET = MemoryCheck
-PRJNAME = $(TARGET)
-PACKAGE = complex$/memCheck
-
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
-
-
-#----- compile .java files -----------------------------------------
-
-JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-JAVAFILES = CheckMemoryUsage.java
-
-#----- make a jar from compiled files ------------------------------
-
-MAXLINELENGTH = 100000
-
-JARCLASSDIRS = $(PACKAGE)
-JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-# --- Parameters for the test --------------------------------------
+PRJ = ../../..
+PRJNAME = vcl
+TARGET = qa_complex_memCheck
-# start an office if the parameter is set for the makefile
-.IF "$(OFFICE)" == ""
-CT_APPEXECCOMMAND =
-.ELSE
-CT_APPEXECCOMMAND = -AppExecutionCommand \
- "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;"
-.ENDIF
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/memCheck
-# test base is java complex
-CT_TESTBASE = -TestBase java_complex
+# here store only Files which contain a @Test
+JAVATESTFILES = \
+ CheckMemoryUsage.java
-# replace $/ with . in package name
-CT_PACKAGE = -o $(PACKAGE:s\$/\.\)
+# put here all other files
+JAVAFILES = $(JAVATESTFILES) \
+ FileHelper.java \
+ TestDocument.java
-# start the runner application
-CT_APP = org.openoffice.Runner
-# --- Targets ------------------------------------------------------
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
-.IF "$(depend)" == ""
-$(CLASSDIR)$/$(PACKAGE)$/CheckMemoryUsage.props : ALLTAR
-.ELSE
-$(CLASSDIR)$/$(PACKAGE)$/CheckMemoryUsage.props : ALLTAR
-.ENDIF
+# Sample how to debug
+# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
-.INCLUDE : target.mk
+.END
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
+ALLTAR : javatest
-$(CLASSDIR)$/$(PACKAGE)$/CheckMemoryUsage.props : CheckMemoryUsage.props
- cp $(@:f) $@
- jar uf $(CLASSDIR)$/$(JARTARGET) -C $(CLASSDIR) $(PACKAGE)$/$(@:f)
+.END
-RUN: run
-run:
- java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_PACKAGE).CheckMemoryUsage
+#
+#
+#
+# PRJ = ..$/..$/..
+# TARGET = MemoryCheck
+# PRJNAME = $(TARGET)
+# PACKAGE = complex$/memCheck
+#
+# # --- Settings -----------------------------------------------------
+# .INCLUDE: settings.mk
+#
+#
+# #----- compile .java files -----------------------------------------
+#
+# JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
+# JAVAFILES = CheckMemoryUsage.java
+#
+# #----- make a jar from compiled files ------------------------------
+#
+# MAXLINELENGTH = 100000
+#
+# JARCLASSDIRS = $(PACKAGE)
+# JARTARGET = $(TARGET).jar
+# JARCOMPRESS = TRUE
+#
+# # --- Parameters for the test --------------------------------------
+#
+# # start an office if the parameter is set for the makefile
+# .IF "$(OFFICE)" == ""
+# CT_APPEXECCOMMAND =
+# .ELSE
+# CT_APPEXECCOMMAND = -AppExecutionCommand \
+# "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;"
+# .ENDIF
+#
+# # test base is java complex
+# CT_TESTBASE = -TestBase java_complex
+#
+# # replace $/ with . in package name
+# CT_PACKAGE = -o $(PACKAGE:s\$/\.\)
+#
+# # start the runner application
+# CT_APP = org.openoffice.Runner
+#
+# # --- Targets ------------------------------------------------------
+#
+# .IF "$(depend)" == ""
+# $(CLASSDIR)$/$(PACKAGE)$/CheckMemoryUsage.props : ALLTAR
+# .ELSE
+# $(CLASSDIR)$/$(PACKAGE)$/CheckMemoryUsage.props : ALLTAR
+# .ENDIF
+#
+# .INCLUDE : target.mk
+#
+#
+#
+# $(CLASSDIR)$/$(PACKAGE)$/CheckMemoryUsage.props : CheckMemoryUsage.props
+# cp $(@:f) $@
+# jar uf $(CLASSDIR)$/$(JARTARGET) -C $(CLASSDIR) $(PACKAGE)$/$(@:f)
+#
+#
+# RUN: run
+#
+# run:
+# java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_PACKAGE).CheckMemoryUsage
diff --git a/vcl/qa/testdocuments/CalcDoc.sxc b/vcl/qa/complex/memCheck/testdocuments/CalcDoc.sxc
index 4b2b572085dc..4b2b572085dc 100755
--- a/vcl/qa/testdocuments/CalcDoc.sxc
+++ b/vcl/qa/complex/memCheck/testdocuments/CalcDoc.sxc
Binary files differ
diff --git a/vcl/qa/testdocuments/ImpressDoc.sxi b/vcl/qa/complex/memCheck/testdocuments/ImpressDoc.sxi
index efcdf9b6a25e..efcdf9b6a25e 100755
--- a/vcl/qa/testdocuments/ImpressDoc.sxi
+++ b/vcl/qa/complex/memCheck/testdocuments/ImpressDoc.sxi
Binary files differ
diff --git a/vcl/qa/testdocuments/WriterDoc.sxw b/vcl/qa/complex/memCheck/testdocuments/WriterDoc.sxw
index 1b2c2cb2dab6..1b2c2cb2dab6 100755
--- a/vcl/qa/testdocuments/WriterDoc.sxw
+++ b/vcl/qa/complex/memCheck/testdocuments/WriterDoc.sxw
Binary files differ
diff --git a/vcl/qa/complex/persistent_window_states/DocumentHandle.java b/vcl/qa/complex/persistent_window_states/DocumentHandle.java
index 0b32eaaeff51..ea28c41f65f7 100644
--- a/vcl/qa/complex/persistent_window_states/DocumentHandle.java
+++ b/vcl/qa/complex/persistent_window_states/DocumentHandle.java
@@ -34,13 +34,9 @@ import com.sun.star.lang.XComponent;
import com.sun.star.awt.XWindow;
import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.PropertyState;
-import com.sun.star.frame.XController;
-import com.sun.star.frame.FrameSearchFlag;
-import com.sun.star.text.XTextDocument;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.frame.XFrame;
import com.sun.star.frame.FrameSearchFlag;
-import com.sun.star.frame.XFramesSupplier;
import helper.WindowListener;
/**
@@ -59,7 +55,7 @@ public class DocumentHandle {
/**
* Constructor
- * @param xComponentLoader A loader to load a document
+ * @param xCompLoader A loader to load a document
*/
public DocumentHandle(XComponentLoader xCompLoader) {
this.xCompLoader = xCompLoader;
@@ -71,6 +67,7 @@ public class DocumentHandle {
* @param docName The name of a document as file URL
* @param hidden If true, the document is loaded hidden.
* @return The size of the opened/created document.
+ * @throws Exception
*/
public Rectangle loadDocument(String docName, boolean hidden)
throws Exception{
@@ -91,13 +88,13 @@ public class DocumentHandle {
}
// get the current active window
- XFrame xCurFrame = (XFrame)UnoRuntime.queryInterface(XFrame.class, xCompLoader);
+ XFrame xCurFrame = UnoRuntime.queryInterface(XFrame.class, xCompLoader);
// create a new frame
XFrame xFrame = xCurFrame.findFrame("_blank", FrameSearchFlag.CREATE);
// load document in this frame
- XComponentLoader xFrameLoader = (XComponentLoader)UnoRuntime.queryInterface(XComponentLoader.class, xFrame);
+ XComponentLoader xFrameLoader = UnoRuntime.queryInterface(XComponentLoader.class, xFrame);
xComp = xFrameLoader.loadComponentFromURL(
docName, "_self", 0, szArgs);
// wait for the document to load.
diff --git a/vcl/qa/complex/persistent_window_states/PersistentWindowTest.java b/vcl/qa/complex/persistent_window_states/PersistentWindowTest.java
index edceeeafd883..898324504b4e 100644
--- a/vcl/qa/complex/persistent_window_states/PersistentWindowTest.java
+++ b/vcl/qa/complex/persistent_window_states/PersistentWindowTest.java
@@ -26,31 +26,27 @@
************************************************************************/
package complex.persistent_window_states;
-
-import com.sun.star.lang.XServiceInfo;
-import com.sun.star.lang.XInitialization;
-import com.sun.star.uno.Type;
import com.sun.star.uno.Any;
-import com.sun.star.lang.XTypeProvider;
-import com.sun.star.lang.XSingleServiceFactory;
import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.lang.XComponent;
-import com.sun.star.frame.XDesktop;
import com.sun.star.frame.XFramesSupplier;
import com.sun.star.frame.XFrames;
-import com.sun.star.registry.XRegistryKey;
-import com.sun.star.comp.loader.FactoryHelper;
import com.sun.star.container.XIndexAccess;
-import com.sun.star.beans.XPropertySet;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.AnyConverter;
import com.sun.star.frame.XComponentLoader;
import com.sun.star.awt.Rectangle;
import com.sun.star.util.XCloseable;
import helper.ConfigurationRead;
-import complexlib.ComplexTestCase;
-import helper.OfficeProvider;
-import complex.persistent_window_states.DocumentHandle;
+
+
+
+// import org.junit.After;
+import org.junit.AfterClass;
+// import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
/**
* Parameters:
@@ -58,10 +54,11 @@ import complex.persistent_window_states.DocumentHandle;
* <li>NoOffice=yes - StarOffice is not started initially.</li>
* </ul>
*/
-public class PersistentWindowTest extends ComplexTestCase {
+public class PersistentWindowTest
+{
- private XMultiServiceFactory xMSF;
- private OfficeProvider oProvider;
+ // private XMultiServiceFactory xMSF;
+// private OfficeProvider oProvider;
private int iOfficeCloseTime = 0;
/**
@@ -69,9 +66,18 @@ public class PersistentWindowTest extends ComplexTestCase {
* Right now, it's only 'checkPersistentWindowState'.
* @return All test methods.
*/
- public String[] getTestMethodNames() {
- return new String[]{"checkPersistentWindowState"};
- }
+// public String[] getTestMethodNames()
+// {
+// return new String[]
+// {
+// "checkPersistentWindowState"
+// };
+// }
+
+ /**
+ * The test parameters
+ */
+ // private static TestParameters param = null;
/**
* Test if all available document types change the
@@ -94,42 +100,32 @@ public class PersistentWindowTest extends ComplexTestCase {
* - close office
* - Test finished
*/
- public void checkPersistentWindowState()
+ @Test public void checkPersistentWindowState()
{
- try {
-
- log.println("Connect the first time.");
- log.println("AppExecCommand: " + (String)param.get("AppExecutionCommand"));
- log.println("ConnString: " + (String)param.get("ConnectionString"));
- oProvider = new OfficeProvider();
- iOfficeCloseTime = param.getInt("OfficeCloseTime");
- if ( iOfficeCloseTime == 0 ) {
- iOfficeCloseTime = 1000;
- }
+ // final XMultiServiceFactory xMsf = getMSF();
- if (!connect()) return;
+ // some Tests need the qadevOOo TestParameters, it is like a Hashmap for Properties.
+// param = new TestParameters();
+// param.put("ServiceFactory", xMsf); // some qadevOOo functions need the ServiceFactory
- // create the configuration provider
- Object o = null;
- try {
- o = xMSF.createInstance(
- "com.sun.star.configuration.ConfigurationProvider");
- }
- catch(com.sun.star.uno.Exception e) {
- failed("Cannot create \"com.sun.star.configuration."+
- "ConfigurationProvider\"");
- return;
- }
+ try
+ {
- // fetch the multi service factory for setup
- XMultiServiceFactory xCP = (XMultiServiceFactory)
- UnoRuntime.queryInterface(XMultiServiceFactory.class, o);
+ // At first we are already connected
+ // if (!connect())
+ // {
+ // return;
+ // }
- // create the configuration reader
- ConfigurationRead cfgRead = new ConfigurationRead(xCP);
+ // fetch the multi service factory for setup
+ // XMultiServiceFactory xCP = getMSF();
+
+ // create the configuration reader
+ // ConfigurationRead cfgRead = new ConfigurationRead(xCP);
- // just test the wrong ones, not all.
- String [] els = new String[]{
+ // just test the wrong ones, not all.
+ String[] els = new String[]
+ {
"Office/Factories/com.sun.star.drawing.DrawingDocument",
"Office/Factories/com.sun.star.formula.FormulaProperties",
//"Office/Factories/com.sun.star.presentation.PresentationDocument",
@@ -138,92 +134,98 @@ public class PersistentWindowTest extends ComplexTestCase {
"Office/Factories/com.sun.star.text.TextDocument",
"Office/Factories/com.sun.star.text.WebDocument",
};
- // uncomment the following line for all doc types
-// String [] els = cfgRead.getSubNodeNames("Office/Factories");
-
- log.println("Found "+ els.length + " document types to test.\n");
- if (!disconnect()) return;
-
- // for all types
- for(int i=0; i<els.length; i++) {
- log.println("\tStart test for document type " + i + ": " + els[i]);
- // exclude chart documents: cannot be created this way.
- if ( els[i].indexOf("ChartDocument") != -1) {
- log.println("Skipping chart document: cannot be create like this.");
- continue;
- }
+ // uncomment the following line for all doc types
+ // String [] els = cfgRead.getSubNodeNames("Office/Factories");
+
+ System.out.println("Found " + els.length + " document types to test.\n");
+ disconnect();
+
+ // for all types
+ for (int i = 0; i < els.length; i++)
+ {
+ System.out.println("\tStart test for document type " + i + ": " + els[i]);
+ // exclude chart documents: cannot be created this way.
+ if (els[i].indexOf("ChartDocument") != -1)
+ {
+ System.out.println("Skipping chart document: cannot be create like this.");
+ continue;
+ }
- // start an office
- if (!connect()) return;
+ // start an office
+ connect();
- // get configuration
- String[] settings = getConfigurationAndLoader(xMSF, els[i]);
- if (settings == null) {
- log.println("Skipping document type " + els[i]);
- disconnect();
- continue;
- }
- String cfg = settings[1];
+ // get configuration
+ String[] settings = getConfigurationAndLoader(getMSF(), els[i]);
+ if (settings == null)
+ {
+ System.out.println("Skipping document type " + els[i]);
+ disconnect();
+ continue;
+ }
+ String cfg = settings[1];
- // load a document
- DocumentHandle handle = loadDocument(xMSF, settings[0]);
+ // load a document
+ DocumentHandle handle = loadDocument(getMSF(), settings[0]);
- // first size
- Rectangle rect1 = handle.getDocumentPosSize();
+ // first size
+ Rectangle rect1 = handle.getDocumentPosSize();
- // resize
- handle.resizeDocument();
- // after resize
- Rectangle rect2 = handle.getDocumentPosSize();
+ // resize
+ handle.resizeDocument();
+ // after resize
+ Rectangle rect2 = handle.getDocumentPosSize();
- // disposeManager and start a new office
- if (!disconnect()) return;
+ // disposeManager and start a new office
+ disconnect();
- if (!connect()) return;
+ connect();
- // get configuration
- settings = getConfigurationAndLoader(xMSF, els[i]);
+ // get configuration
+ settings = getConfigurationAndLoader(getMSF(), els[i]);
- String newCfg = settings[1];
+ String newCfg = settings[1];
- // load a document
- handle = loadDocument(xMSF, settings[0]);
+ // load a document
+ handle = loadDocument(getMSF(), settings[0]);
- Rectangle newRect = handle.getDocumentPosSize();
+ Rectangle newRect = handle.getDocumentPosSize();
- // print the settings and window sizes
- log.println("----------------------------");
- log.println("Initial Config String : " + cfg);
- log.println("Config String after restart: " + newCfg);
+ // print the settings and window sizes
+ System.out.println("----------------------------");
+ System.out.println("Initial Config String : " + cfg);
+ System.out.println("Config String after restart: " + newCfg);
- log.println("----------------------------");
- log.println("Initial window (X,Y,Width,Height): "
- +rect1.X+";"+rect1.Y+";"+ rect1.Width+";"+rect1.Height);
- log.println("Window after resize (X,Y,Width,Height): "
- +rect2.X+";"+rect2.Y+";"+ rect2.Width+";"+rect2.Height);
- log.println("Window after restart (X,Y,Width,Height): "
- +newRect.X+";"+newRect.Y+";"+newRect.Width+";"
- +newRect.Height);
+ System.out.println("----------------------------");
+ System.out.println("Initial window (X,Y,Width,Height): "
+ + rect1.X + ";" + rect1.Y + ";" + rect1.Width + ";" + rect1.Height);
+ System.out.println("Window after resize (X,Y,Width,Height): "
+ + rect2.X + ";" + rect2.Y + ";" + rect2.Width + ";" + rect2.Height);
+ System.out.println("Window after restart (X,Y,Width,Height): "
+ + newRect.X + ";" + newRect.Y + ";" + newRect.Width + ";"
+ + newRect.Height);
- // compare to see if resize worked
- log.println("----------------------------");
- assure("Resize values for "+ els[i] +
- " are equal.", !compareRectangles(rect1, rect2), true);
- // compare settings and sizes
- assure("Config settings for "+ els[i] +
- " were not changed.", !cfg.equals(newCfg), true);
- assure("Resized and restarted window for "+ els[i] +
- " are not equal.", compareRectangles(rect2, newRect), true);
- log.println("----------------------------");
+ // compare to see if resize worked
+ System.out.println("----------------------------");
+ if (els[i].indexOf("SpreadsheetDocument") == -1 &&
+ els[i].indexOf("DrawingDocument") == -1)
+ {
+ // leave out Spreadsheet- and DrawingDocumnt
+ assertTrue("Resize values for " + els[i] + " are equal.", !compareRectangles(rect1, rect2));
+ }
+ // compare settings and sizes
+ assertTrue("Config settings for " + els[i] + " were not changed.", !cfg.equals(newCfg));
+ assertTrue("Resized and restarted window for " + els[i] + " are not equal.", compareRectangles(rect2, newRect));
+ System.out.println("----------------------------");
- // disposeManager
- if (!disconnect()) return;
+ // disposeManager
+ disconnect();
- log.println("\tFinish test for document type " + i + ": " + els[i]);
+ System.out.println("\tFinish test for document type " + i + ": " + els[i]);
+ }
}
- }
- catch(Exception e) {
+ catch (Exception e)
+ {
e.printStackTrace();
}
}
@@ -235,16 +237,17 @@ public class PersistentWindowTest extends ComplexTestCase {
* @return Settings and Loader
*/
private static String[] getConfigurationAndLoader(XMultiServiceFactory xMSF,
- String cfgString) {
+ String cfgString)
+ {
String[] conf = new String[2];
- try {
+ try
+ {
Object o = xMSF.createInstance(
- "com.sun.star.configuration.ConfigurationProvider");
+ "com.sun.star.configuration.ConfigurationProvider");
// fetch the multi service factory for setup
- XMultiServiceFactory xCP = (XMultiServiceFactory)
- UnoRuntime.queryInterface(XMultiServiceFactory.class, o);
+ XMultiServiceFactory xCP = UnoRuntime.queryInterface(XMultiServiceFactory.class, o);
// create the configuration reader
ConfigurationRead cfgRead = new ConfigurationRead(xCP);
@@ -253,22 +256,28 @@ public class PersistentWindowTest extends ComplexTestCase {
String loader = getStringFromObject(
cfgRead.getByHierarchicalName(cfgString + "/ooSetupFactoryEmptyDocumentURL"));
- if (loader == null) return null;
- log.println("\tLoader: " + loader);
+ if (loader == null)
+ {
+ return null;
+ }
+ System.out.println("\tLoader: " + loader);
// read attributes
String hierchName = cfgString + "/ooSetupFactoryWindowAttributes";
String setupSettings = getStringFromObject(cfgRead.getByHierarchicalName(hierchName));
// remove slots: just plain document types have to start
- if ( loader.indexOf("?slot") != -1 ) {
+ if (loader.indexOf("?slot") != -1)
+ {
loader = loader.substring(0, loader.indexOf("?slot"));
- System.out.println("Loader: "+loader);
+ System.out.println("Loader: " + loader);
}
conf[0] = loader;
conf[1] = setupSettings;
}
- catch(com.sun.star.uno.Exception e) {}
+ catch (com.sun.star.uno.Exception e)
+ {
+ }
return conf;
}
@@ -279,97 +288,105 @@ public class PersistentWindowTest extends ComplexTestCase {
* @return A handle to the document
*/
private DocumentHandle loadDocument(XMultiServiceFactory xMSF,
- String docLoader) {
+ String docLoader)
+ {
DocumentHandle docHandle = null;
- try {
+ try
+ {
// create component loaader
- XComponentLoader xCompLoader = (XComponentLoader)
- UnoRuntime.queryInterface(
- XComponentLoader.class, xMSF.createInstance(
- "com.sun.star.frame.Desktop"));
- XFramesSupplier xFrameSupp = (XFramesSupplier)UnoRuntime.queryInterface(XFramesSupplier.class, xCompLoader);
+ XComponentLoader xCompLoader = UnoRuntime.queryInterface(XComponentLoader.class, xMSF.createInstance("com.sun.star.frame.Desktop"));
+ XFramesSupplier xFrameSupp = UnoRuntime.queryInterface(XFramesSupplier.class, xCompLoader);
// close all existing frames
XFrames xFrames = xFrameSupp.getFrames();
- XIndexAccess xAcc = (XIndexAccess)UnoRuntime.queryInterface(XIndexAccess.class, xFrames);
- for ( int i=0; i<xAcc.getCount(); i++ ) {
- XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xAcc.getByIndex(i));
- try {
- if ( xClose != null ) {
+ XIndexAccess xAcc = UnoRuntime.queryInterface(XIndexAccess.class, xFrames);
+ for (int i = 0; i < xAcc.getCount(); i++)
+ {
+ XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xAcc.getByIndex(i));
+ try
+ {
+ if (xClose != null)
+ {
xClose.close(false);
}
- else {
- failed("Could not query frame for XCloseable!");
+ else
+ {
+ fail("Could not query frame for XCloseable!");
}
}
- catch( com.sun.star.uno.Exception e ) {
- e.printStackTrace((java.io.PrintWriter)log);
- failed("Could not query frame for XCloseable!");
+ catch (com.sun.star.uno.Exception e)
+ {
+ e.printStackTrace();
+ fail("Could not query frame for XCloseable!");
}
}
docHandle = new DocumentHandle(xCompLoader);
docHandle.loadDocument(docLoader, false);
}
- catch(com.sun.star.uno.Exception e) {
+ catch (com.sun.star.uno.Exception e)
+ {
e.printStackTrace();
}
- catch(java.lang.Exception e) {
+ catch (java.lang.Exception e)
+ {
e.printStackTrace();
}
return docHandle;
}
- private boolean connect() {
- try {
- xMSF = (XMultiServiceFactory)oProvider.getManager(param);
- try {
- Thread.sleep(10000);
- }
- catch(java.lang.InterruptedException e) {}
+ private boolean connect()
+ {
+ try
+ {
+ connection.setUp();
+ }
+ catch (java.lang.InterruptedException e)
+ {
+ fail("can't connect.");
}
- catch (java.lang.Exception e) {
- log.println(e.getClass().getName());
- log.println("Message: " + e.getMessage());
- failed("Cannot connect the Office.");
- return false;
+ catch (Exception e)
+ {
+ fail("can't connect.");
}
return true;
}
- private boolean disconnect() {
- try {
- XDesktop desk = null;
- desk = (XDesktop) UnoRuntime.queryInterface(
- XDesktop.class, xMSF.createInstance(
- "com.sun.star.frame.Desktop"));
- xMSF = null;
- desk.terminate();
- log.println("Waiting " + iOfficeCloseTime + " milliseconds for the Office to close down");
- try {
- Thread.sleep(iOfficeCloseTime);
- }
- catch(java.lang.InterruptedException e) {}
+ private boolean disconnect()
+ {
+ try
+ {
+ connection.tearDown();
}
- catch (java.lang.Exception e) {
- e.printStackTrace();
- failed("Cannot dispose the Office.");
- return false;
+ catch (java.lang.InterruptedException e)
+ {
+ fail("can't disconnect.");
+ }
+ catch (Exception e)
+ {
+ fail("can't disconnect.");
}
return true;
}
- private static String getStringFromObject(Object oName) {
+ private static String getStringFromObject(Object oName)
+ {
if (oName instanceof String)
- return (String)oName;
+ {
+ return (String) oName;
+ }
String value = null;
- if (oName instanceof Any) {
- try {
+ if (oName instanceof Any)
+ {
+ try
+ {
value = AnyConverter.toString(oName);
- if (value == null) {
- log.println("Got a void css.uno.Any as loading string.");
+ if (value == null)
+ {
+ System.out.println("Got a void css.uno.Any as loading string.");
}
}
- catch(Exception e) {
- log.println("This document type cannot be opened directly.");
+ catch (Exception e)
+ {
+ System.out.println("This document type cannot be opened directly.");
}
}
return value;
@@ -382,12 +399,37 @@ public class PersistentWindowTest extends ComplexTestCase {
* @param rect2 Second Rectangle.
* @return True, if the rectangles are equal.
*/
- private boolean compareRectangles(Rectangle rect1, Rectangle rect2) {
+ private boolean compareRectangles(Rectangle rect1, Rectangle rect2)
+ {
boolean result = true;
- result &= (rect1.X==rect2.X);
- result &= (rect1.Y==rect2.Y);
- result &= (rect1.Width==rect2.Width);
- result &= (rect1.Height==rect2.Height);
+ result &= (rect1.X == rect2.X);
+ result &= (rect1.Y == rect2.Y);
+ result &= (rect1.Width == rect2.Width);
+ result &= (rect1.Height == rect2.Height);
return result;
}
+
+
+
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
+ }
+
+ // setup and close connections
+ @BeforeClass public static void setUpConnection() throws Exception {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+
+ private static final OfficeConnection connection = new OfficeConnection();
+
}
diff --git a/vcl/qa/complex/persistent_window_states/makefile.mk b/vcl/qa/complex/persistent_window_states/makefile.mk
index 4c61d8969b8d..e4d9f6b514a0 100644
--- a/vcl/qa/complex/persistent_window_states/makefile.mk
+++ b/vcl/qa/complex/persistent_window_states/makefile.mk
@@ -24,58 +24,44 @@
# for a copy of the LGPLv3 License.
#
#*************************************************************************
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-PRJ = ..$/..$/..
-TARGET = PersistentWindowTest
-PRJNAME = $(TARGET)
-PACKAGE = complex$/persistent_window_states
-
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
+PRJ = ../../..
+PRJNAME = vcl
+TARGET = qa_complex_persistent_window_states
-#----- compile .java files -----------------------------------------
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/persistent_window_states
-JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-JAVAFILES = PersistentWindowTest.java DocumentHandle.java
+# here store only Files which contain a @Test
+JAVATESTFILES = \
+ PersistentWindowTest.java
-#----- make a jar from compiled files ------------------------------
+# put here all other files
+JAVAFILES = $(JAVATESTFILES) \
+DocumentHandle.java
-MAXLINELENGTH = 100000
-JARCLASSDIRS = $(PACKAGE)
-JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
-# --- Parameters for the test --------------------------------------
+# Sample how to debug
+# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
-# test base is java complex
-CT_TESTBASE = -TestBase java_complex
+.END
-# test looks something like the.full.package.TestName
-CT_TEST = -o $(PACKAGE:s\$/\.\).$(TARGET)
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-# start the runner application
-CT_APP = org.openoffice.Runner
+ALLTAR : javatest
-# --- Targets ------------------------------------------------------
+.END
-$(CLASSDIR)$/$(PACKAGE)$/$(TARGET).props : ALLTAR
-.INCLUDE : target.mk
-$(CLASSDIR)$/$(PACKAGE)$/$(TARGET).props : $(TARGET).props
- cp $(TARGET).props $@
- jar uf $(CLASSDIR)$/$(JARTARGET) -C $(CLASSDIR) $(PACKAGE)$/$(TARGET).props
-RUN: run
-# start an office if the parameter is set for the makefile
-.IF "$(OFFICE)" == ""
-run:
- @echo "Execute this test with 'dmake run OFFICE=/system/path/to/office/program'."
- @echo "The office will be started by the test with a socket connection on port 8100"
-.ELSE
-run: $(CLASSDIR)$/$(PACKAGE)$/$(TARGET).props
- java -cp $(CLASSPATH) $(CT_APP) -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" $(CT_TESTBASE) $(CT_TEST)
-.ENDIF
diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx
index cee78645b9f2..727911db36bd 100644
--- a/vcl/source/app/dbggui.cxx
+++ b/vcl/source/app/dbggui.cxx
@@ -38,32 +38,33 @@
#include <cmath>
#include <limits.h>
-#include <vcl/svdata.hxx>
-#include <svsys.h>
+#include "vcl/svdata.hxx"
+#include "svsys.h"
#ifdef WNT
#undef min
#endif
-#include <tools/debug.hxx>
-#include <vcl/svdata.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/event.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/button.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/group.hxx>
-#include <vcl/field.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/wrkwin.hxx>
-#include <vcl/sound.hxx>
-#include <vcl/threadex.hxx>
-#include <vcl/dbggui.hxx>
-#include <com/sun/star/i18n/XCharacterClassification.hpp>
-
-#include <vcl/unohelp.hxx>
-#include <vcl/unohelp2.hxx>
+#include "tools/debug.hxx"
+#include "vcl/svdata.hxx"
+#include "vcl/svapp.hxx"
+#include "vcl/event.hxx"
+#include "vcl/lstbox.hxx"
+#include "vcl/button.hxx"
+#include "vcl/edit.hxx"
+#include "vcl/fixed.hxx"
+#include "vcl/group.hxx"
+#include "vcl/field.hxx"
+#include "vcl/msgbox.hxx"
+#include "vcl/wrkwin.hxx"
+#include "vcl/sound.hxx"
+#include "vcl/threadex.hxx"
+#include "vcl/dbggui.hxx"
+#include "com/sun/star/i18n/XCharacterClassification.hpp"
+
+#include "vcl/unohelp.hxx"
+#include "vcl/unohelp2.hxx"
#include <osl/mutex.hxx>
+#include "vcl/salinst.hxx"
#include <map>
#include <algorithm>
@@ -411,7 +412,7 @@ static const sal_Char* pDbgHelpText[] =
" //...\n",
"}\n",
"\n",
-"char& String::operator [] ( USHORT nIndex )\n",
+"char& String::operator [] ( sal_uInt16 nIndex )\n",
"{\n",
" DBG_CHKTHIS( String, DbgCheckString );\n",
" DBG_ASSERT( nIndex <= pData->nLen, \"String::[] : nIndex > Len\" );\n",
@@ -419,7 +420,7 @@ static const sal_Char* pDbgHelpText[] =
" //...\n",
"}\n",
"\n",
-"USHORT String::Search( const String& rStr, USHORT nIndex ) const\n",
+"sal_uInt16 String::Search( const String& rStr, sal_uInt16 nIndex ) const\n",
"{\n",
" DBG_CHKTHIS( String, DbgCheckString );\n",
" DBG_CHKOBJ( &rStr, String, DbgCheckString );\n",
@@ -451,19 +452,19 @@ namespace
++channel
)
{
- USHORT nEntryPos = rList.InsertEntry( channel->first );
+ sal_uInt16 nEntryPos = rList.InsertEntry( channel->first );
rList.SetEntryData( nEntryPos, reinterpret_cast< void* >( channel->second ) );
}
}
// -------------------------------------------------------------------
- void ImplSelectChannel( ListBox& rList, ULONG nChannelToSelect, USHORT nPositionOffset )
+ void ImplSelectChannel( ListBox& rList, sal_uLong nChannelToSelect, sal_uInt16 nPositionOffset )
{
if ( nChannelToSelect < DBG_OUT_USER_CHANNEL_0 )
- rList.SelectEntryPos( (USHORT)( nChannelToSelect - nPositionOffset ) );
+ rList.SelectEntryPos( (sal_uInt16)( nChannelToSelect - nPositionOffset ) );
else
{
- for ( USHORT pos = 0; pos < rList.GetEntryCount(); ++pos )
+ for ( sal_uInt16 pos = 0; pos < rList.GetEntryCount(); ++pos )
{
DbgChannelId nChannelId = static_cast< DbgChannelId >( reinterpret_cast<sal_IntPtr>(rList.GetEntryData( pos )) );
if ( nChannelId == nChannelToSelect )
@@ -475,9 +476,9 @@ namespace
}
}
// -------------------------------------------------------------------
- DbgChannelId ImplGetChannelId( const ListBox& rList, USHORT nPositionOffset )
+ DbgChannelId ImplGetChannelId( const ListBox& rList, sal_uInt16 nPositionOffset )
{
- USHORT nSelectedChannelPos = rList.GetSelectEntryPos();
+ sal_uInt16 nSelectedChannelPos = rList.GetSelectEntryPos();
DbgChannelId nSelectedChannel = static_cast< DbgChannelId >( reinterpret_cast<sal_IntPtr>(rList.GetEntryData( nSelectedChannelPos )) );
if ( nSelectedChannel == 0)
return (DbgChannelId)( nSelectedChannelPos + nPositionOffset );
@@ -501,14 +502,14 @@ private:
public:
DbgWindow();
- virtual BOOL Close();
+ virtual sal_Bool Close();
virtual void Resize();
virtual long PreNotify( NotifyEvent& rNEvt );
void InsertLine( const XubString& rLine );
void Update() { WorkWindow::Update(); maLstBox.Update(); }
private:
- void GetAssertionEntryRange( USHORT nInbetweenEntry, USHORT& nFirst, USHORT& nLast );
+ void GetAssertionEntryRange( sal_uInt16 nInbetweenEntry, sal_uInt16& nFirst, sal_uInt16& nLast );
};
// -----------------
@@ -520,10 +521,10 @@ class DbgInfoDialog : public ModalDialog
private:
ListBox maListBox;
OKButton maOKButton;
- BOOL mbHelpText;
+ sal_Bool mbHelpText;
public:
- DbgInfoDialog( Window* pParent, BOOL bHelpText = FALSE );
+ DbgInfoDialog( Window* pParent, sal_Bool bHelpText = sal_False );
void SetInfoText( const XubString& rStr );
};
@@ -582,7 +583,7 @@ private:
CancelButton maCancelButton;
PushButton maInfoButton;
HelpButton maHelpButton;
- USHORT mnErrorOff;
+ sal_uInt16 mnErrorOff;
public:
DbgDialog();
@@ -621,7 +622,7 @@ DbgWindow::DbgWindow() :
// -----------------------------------------------------------------------
-BOOL DbgWindow::Close()
+sal_Bool DbgWindow::Close()
{
// remember window position
ByteString aState( GetWindowState() );
@@ -636,7 +637,7 @@ BOOL DbgWindow::Close()
delete this;
ImplGetSVData()->maWinData.mpDbgWin = NULL;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -648,7 +649,7 @@ void DbgWindow::Resize()
// -----------------------------------------------------------------------
-void DbgWindow::GetAssertionEntryRange( USHORT nInbetweenEntry, USHORT& nFirst, USHORT& nLast )
+void DbgWindow::GetAssertionEntryRange( sal_uInt16 nInbetweenEntry, sal_uInt16& nFirst, sal_uInt16& nLast )
{
nFirst = nInbetweenEntry;
while ( nFirst > 0 )
@@ -657,7 +658,7 @@ void DbgWindow::GetAssertionEntryRange( USHORT nInbetweenEntry, USHORT& nFirst,
break;
--nFirst;
}
- USHORT nEntryCount = maLstBox.GetEntryCount();
+ sal_uInt16 nEntryCount = maLstBox.GetEntryCount();
nLast = nInbetweenEntry + 1;
while ( nLast < nEntryCount )
{
@@ -689,12 +690,12 @@ long DbgWindow::PreNotify( NotifyEvent& rNEvt )
Rectangle aEntryRect( maLstBox.GetBoundingRectangle( maLstBox.GetSelectEntryPos() ) );
aPos = aEntryRect.Center();
}
- USHORT nSelected = aMenu.Execute( rNEvt.GetWindow(), aPos );
+ sal_uInt16 nSelected = aMenu.Execute( rNEvt.GetWindow(), aPos );
if ( nSelected == 1 )
{
// search all entries which belong to this assertion
- USHORT nAssertionFirst = 0;
- USHORT nAssertionLast = 0;
+ sal_uInt16 nAssertionFirst = 0;
+ sal_uInt16 nAssertionLast = 0;
GetAssertionEntryRange( maLstBox.GetSelectEntryPos(), nAssertionFirst, nAssertionLast );
// build the string to copy to the clipboard
@@ -723,23 +724,23 @@ void DbgWindow::InsertLine( const XubString& rLine )
XubString aStr = rLine;
aStr.ConvertLineEnd( LINEEND_LF );
xub_StrLen nPos = aStr.Search( _LF );
- BOOL bFirstEntry = TRUE;
+ sal_Bool bFirstEntry = sal_True;
while ( nPos != STRING_NOTFOUND )
{
if ( maLstBox.GetEntryCount() >= DBGWIN_MAXLINES )
maLstBox.RemoveEntry( 0 );
- USHORT nInsertionPos = maLstBox.InsertEntry( aStr.Copy( 0, nPos ) );
+ sal_uInt16 nInsertionPos = maLstBox.InsertEntry( aStr.Copy( 0, nPos ) );
if ( bFirstEntry )
maLstBox.SetEntryData( nInsertionPos, reinterpret_cast< void* >( 0x00000001 ) );
- bFirstEntry = FALSE;
+ bFirstEntry = sal_False;
aStr.Erase( 0, nPos+1 );
nPos = aStr.Search( _LF );
}
if ( maLstBox.GetEntryCount() >= DBGWIN_MAXLINES )
maLstBox.RemoveEntry( 0 );
- USHORT nInsertionPos = maLstBox.InsertEntry( aStr );
+ sal_uInt16 nInsertionPos = maLstBox.InsertEntry( aStr );
if ( bFirstEntry )
maLstBox.SetEntryData( nInsertionPos, reinterpret_cast< void* >( 0x00000001 ) );
maLstBox.SetTopEntry( DBGWIN_MAXLINES-1 );
@@ -802,7 +803,7 @@ DbgDialog::DbgDialog() :
maXtorThis.Show();
maXtorThis.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "T~his" ) ) );
if ( pData->nTestFlags & DBG_TEST_XTOR_THIS )
- maXtorThis.Check( TRUE );
+ maXtorThis.Check( sal_True );
maXtorThis.SetPosSizePixel( LogicToPixel( Point( 10, 15 ), aAppMap ),
aButtonSize );
}
@@ -811,7 +812,7 @@ DbgDialog::DbgDialog() :
maXtorFunc.Show();
maXtorFunc.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Function" ) ) );
if ( pData->nTestFlags & DBG_TEST_XTOR_FUNC )
- maXtorFunc.Check( TRUE );
+ maXtorFunc.Check( sal_True );
maXtorFunc.SetPosSizePixel( LogicToPixel( Point( 75, 15 ), aAppMap ),
aButtonSize );
}
@@ -820,7 +821,7 @@ DbgDialog::DbgDialog() :
maXtorExit.Show();
maXtorExit.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "E~xit" ) ) );
if ( pData->nTestFlags & DBG_TEST_XTOR_EXIT )
- maXtorExit.Check( TRUE );
+ maXtorExit.Check( sal_True );
maXtorExit.SetPosSizePixel( LogicToPixel( Point( 140, 15 ), aAppMap ),
aButtonSize );
}
@@ -829,7 +830,7 @@ DbgDialog::DbgDialog() :
maXtorReport.Show();
maXtorReport.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Report" ) ) );
if ( pData->nTestFlags & DBG_TEST_XTOR_REPORT )
- maXtorReport.Check( TRUE );
+ maXtorReport.Check( sal_True );
maXtorReport.SetPosSizePixel( LogicToPixel( Point( 205, 15 ), aAppMap ),
aButtonSize );
}
@@ -838,7 +839,7 @@ DbgDialog::DbgDialog() :
maXtorTrace.Show();
maXtorTrace.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Trace" ) ) );
if ( pData->nTestFlags & DBG_TEST_XTOR_TRACE )
- maXtorTrace.Check( TRUE );
+ maXtorTrace.Check( sal_True );
maXtorTrace.SetPosSizePixel( LogicToPixel( Point( 270, 15 ), aAppMap ),
aButtonSize );
}
@@ -854,7 +855,7 @@ DbgDialog::DbgDialog() :
maMemInit.Show();
maMemInit.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Initialize" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_INIT )
- maMemInit.Check( TRUE );
+ maMemInit.Check( sal_True );
maMemInit.SetPosSizePixel( LogicToPixel( Point( 10, 50 ), aAppMap ),
aButtonSize );
}
@@ -863,7 +864,7 @@ DbgDialog::DbgDialog() :
maMemOverwrite.Show();
maMemOverwrite.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Overwrite" )) );
if ( pData->nTestFlags & DBG_TEST_MEM_OVERWRITE )
- maMemOverwrite.Check( TRUE );
+ maMemOverwrite.Check( sal_True );
maMemOverwrite.SetPosSizePixel( LogicToPixel( Point( 75, 50 ), aAppMap ),
aButtonSize );
}
@@ -872,7 +873,7 @@ DbgDialog::DbgDialog() :
maMemOverwriteFree.Show();
maMemOverwriteFree.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Free" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_OVERWRITEFREE )
- maMemOverwriteFree.Check( TRUE );
+ maMemOverwriteFree.Check( sal_True );
maMemOverwriteFree.SetPosSizePixel( LogicToPixel( Point( 140, 50 ), aAppMap ),
aButtonSize );
}
@@ -881,7 +882,7 @@ DbgDialog::DbgDialog() :
maMemPtr.Show();
maMemPtr.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Pointer" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_POINTER )
- maMemPtr.Check( TRUE );
+ maMemPtr.Check( sal_True );
maMemPtr.SetPosSizePixel( LogicToPixel( Point( 205, 50 ), aAppMap ),
aButtonSize );
}
@@ -890,7 +891,7 @@ DbgDialog::DbgDialog() :
maMemReport.Show();
maMemReport.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Report" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_REPORT )
- maMemReport.Check( TRUE );
+ maMemReport.Check( sal_True );
maMemReport.SetPosSizePixel( LogicToPixel( Point( 270, 50 ), aAppMap ),
aButtonSize );
}
@@ -899,7 +900,7 @@ DbgDialog::DbgDialog() :
maMemTrace.Show();
maMemTrace.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Trace" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_TRACE )
- maMemTrace.Check( TRUE );
+ maMemTrace.Check( sal_True );
maMemTrace.SetPosSizePixel( LogicToPixel( Point( 10, 65 ), aAppMap ),
aButtonSize );
}
@@ -908,7 +909,7 @@ DbgDialog::DbgDialog() :
maMemLeakReport.Show();
maMemLeakReport.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Leak-Report" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_LEAKREPORT )
- maMemLeakReport.Check( TRUE );
+ maMemLeakReport.Check( sal_True );
maMemLeakReport.SetPosSizePixel( LogicToPixel( Point( 75, 65 ), aAppMap ),
aButtonSize );
}
@@ -917,7 +918,7 @@ DbgDialog::DbgDialog() :
maMemNewDel.Show();
maMemNewDel.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~New/Delete" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_NEWDEL )
- maMemNewDel.Check( TRUE );
+ maMemNewDel.Check( sal_True );
maMemNewDel.SetPosSizePixel( LogicToPixel( Point( 140, 65 ), aAppMap ),
aButtonSize );
}
@@ -926,7 +927,7 @@ DbgDialog::DbgDialog() :
maMemXtor.Show();
maMemXtor.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Ob~ject Test" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_XTOR )
- maMemXtor.Check( TRUE );
+ maMemXtor.Check( sal_True );
maMemXtor.SetPosSizePixel( LogicToPixel( Point( 205, 65 ), aAppMap ),
aButtonSize );
}
@@ -942,7 +943,7 @@ DbgDialog::DbgDialog() :
maProf.Show();
maProf.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Profiling" ) ) );
if ( pData->nTestFlags & DBG_TEST_PROFILING )
- maProf.Check( TRUE );
+ maProf.Check( sal_True );
maProf.SetPosSizePixel( LogicToPixel( Point( 10, 95 ), aAppMap ),
aButtonSize );
}
@@ -951,7 +952,7 @@ DbgDialog::DbgDialog() :
maRes.Show();
maRes.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Resourcen" ) ) );
if ( pData->nTestFlags & DBG_TEST_RESOURCE )
- maRes.Check( TRUE );
+ maRes.Check( sal_True );
maRes.SetPosSizePixel( LogicToPixel( Point( 75, 95 ), aAppMap ),
aButtonSize );
}
@@ -960,7 +961,7 @@ DbgDialog::DbgDialog() :
maDialog.Show();
maDialog.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Dialog" ) ) );
if ( pData->nTestFlags & DBG_TEST_DIALOG )
- maDialog.Check( TRUE );
+ maDialog.Check( sal_True );
maDialog.SetPosSizePixel( LogicToPixel( Point( 140, 95 ), aAppMap ),
aButtonSize );
}
@@ -969,7 +970,7 @@ DbgDialog::DbgDialog() :
maBoldAppFont.Show();
maBoldAppFont.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Bold AppFont" ) ) );
if ( pData->nTestFlags & DBG_TEST_BOLDAPPFONT )
- maBoldAppFont.Check( TRUE );
+ maBoldAppFont.Check( sal_True );
maBoldAppFont.SetPosSizePixel( LogicToPixel( Point( 205, 95 ), aAppMap ),
aButtonSize );
maBoldAppFont.SaveValue();
@@ -994,7 +995,7 @@ DbgDialog::DbgDialog() :
maOverwrite.Show();
maOverwrite.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Overwrite ~File" ) ) );
if ( pData->bOverwrite )
- maOverwrite.Check( TRUE );
+ maOverwrite.Check( sal_True );
maOverwrite.SetPosSizePixel( LogicToPixel( Point( 205, 130 ), aAppMap ),
aButtonSize );
}
@@ -1003,7 +1004,7 @@ DbgDialog::DbgDialog() :
maHookOSLBox.Show();
maHookOSLBox.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Reroute osl debug ~messages" ) ) );
if ( pData->bHookOSLAssert )
- maHookOSLBox.Check( TRUE );
+ maHookOSLBox.Check( sal_True );
maHookOSLBox.SetPosSizePixel( LogicToPixel( Point( 10, 240 ), aAppMap ),
LogicToPixel( Size( 100, 12 ), aAppMap ) );
}
@@ -1206,8 +1207,8 @@ IMPL_LINK( DbgDialog, ClickHdl, Button*, pButton )
aData.aInclFilter[sizeof( aData.aInclFilter )-1] = '\0';
aData.aExclFilter[sizeof( aData.aExclFilter )-1] = '\0';
- aData.bOverwrite = maOverwrite.IsChecked() ? TRUE : FALSE;
- aData.bHookOSLAssert = maHookOSLBox.IsChecked() ? TRUE : FALSE;
+ aData.bOverwrite = maOverwrite.IsChecked() ? sal_True : sal_False;
+ aData.bHookOSLAssert = maHookOSLBox.IsChecked() ? sal_True : sal_False;
if ( maXtorThis.IsChecked() )
aData.nTestFlags |= DBG_TEST_XTOR_THIS;
@@ -1301,7 +1302,7 @@ IMPL_LINK( DbgDialog, ClickHdl, Button*, pButton )
) ) );
aBox.Execute();
}
- EndDialog( TRUE );
+ EndDialog( sal_True );
}
else if ( pButton == &maInfoButton )
{
@@ -1324,7 +1325,7 @@ void DbgDialog::RequestHelp( const HelpEvent& rHEvt )
{
if ( rHEvt.GetMode() & HELPMODE_CONTEXT )
{
- DbgInfoDialog aInfoDialog( this, TRUE );
+ DbgInfoDialog aInfoDialog( this, sal_True );
XubString aHelpText;
const sal_Char** pHelpStrs = pDbgHelpText;
while ( *pHelpStrs )
@@ -1340,7 +1341,7 @@ void DbgDialog::RequestHelp( const HelpEvent& rHEvt )
// =======================================================================
-DbgInfoDialog::DbgInfoDialog( Window* pParent, BOOL bHelpText ) :
+DbgInfoDialog::DbgInfoDialog( Window* pParent, sal_Bool bHelpText ) :
ModalDialog( pParent, WB_STDMODAL ),
maListBox( this, WB_BORDER | WB_AUTOHSCROLL ),
maOKButton( this, WB_DEFBUTTON )
@@ -1367,12 +1368,12 @@ DbgInfoDialog::DbgInfoDialog( Window* pParent, BOOL bHelpText ) :
void DbgInfoDialog::SetInfoText( const XubString& rStr )
{
- maListBox.SetUpdateMode( FALSE );
+ maListBox.SetUpdateMode( sal_False );
maListBox.Clear();
XubString aStr = rStr;
aStr.ConvertLineEnd( LINEEND_LF );
- USHORT nStrIndex = 0;
- USHORT nFoundIndex;
+ sal_uInt16 nStrIndex = 0;
+ sal_uInt16 nFoundIndex;
do
{
nFoundIndex = aStr.Search( _LF, nStrIndex );
@@ -1380,8 +1381,8 @@ void DbgInfoDialog::SetInfoText( const XubString& rStr )
if ( mbHelpText )
{
long nMaxWidth = maListBox.GetOutputSizePixel().Width()-30;
- USHORT nLastIndex = 0;
- USHORT nIndex = aTextParagraph.Search( ' ' );
+ sal_uInt16 nLastIndex = 0;
+ sal_uInt16 nIndex = aTextParagraph.Search( ' ' );
while ( nIndex != STRING_NOTFOUND )
{
if ( maListBox.GetTextWidth( aTextParagraph, 0, nIndex ) > nMaxWidth )
@@ -1411,15 +1412,15 @@ void DbgInfoDialog::SetInfoText( const XubString& rStr )
nStrIndex = nFoundIndex+1;
}
while ( nFoundIndex != STRING_NOTFOUND );
- maListBox.SetUpdateMode( TRUE );
+ maListBox.SetUpdateMode( sal_True );
}
// =======================================================================
void DbgDialogTest( Window* pWindow )
{
- BOOL aAccelBuf[65536];
- USHORT nChildCount = pWindow->GetChildCount();
+ sal_Bool aAccelBuf[65536];
+ sal_uInt16 nChildCount = pWindow->GetChildCount();
Window* pGetChild = pWindow->GetWindow( WINDOW_FIRSTCHILD );
Window* pChild;
Point aTabPos;
@@ -1433,9 +1434,9 @@ void DbgDialogTest( Window* pWindow )
if ( pWindow->IsDialog() )
{
- BOOL bOKCancelButton = FALSE;
- BOOL bDefPushButton = FALSE;
- BOOL bButton = FALSE;
+ sal_Bool bOKCancelButton = sal_False;
+ sal_Bool bDefPushButton = sal_False;
+ sal_Bool bButton = sal_False;
pGetChild = pWindow->GetWindow( WINDOW_FIRSTCHILD );
while ( pGetChild )
{
@@ -1443,11 +1444,11 @@ void DbgDialogTest( Window* pWindow )
if ( pChild->ImplIsPushButton() )
{
- bButton = TRUE;
+ bButton = sal_True;
if ( (pChild->GetType() == WINDOW_OKBUTTON) || (pChild->GetType() == WINDOW_CANCELBUTTON) )
- bOKCancelButton = TRUE;
+ bOKCancelButton = sal_True;
if ( pChild->GetStyle() & WB_DEFBUTTON )
- bDefPushButton = TRUE;
+ bDefPushButton = sal_True;
}
pGetChild = pGetChild->GetWindow( WINDOW_NEXT );
@@ -1462,7 +1463,7 @@ void DbgDialogTest( Window* pWindow )
}
}
- USHORT i = 0;
+ sal_uInt16 i = 0;
pGetChild = pWindow->GetWindow( WINDOW_FIRSTCHILD );
while ( pGetChild )
{
@@ -1474,7 +1475,7 @@ void DbgDialogTest( Window* pWindow )
{
XubString aText = pChild->GetText();
XubString aErrorText = aText;
- USHORT nAccelPos = STRING_NOTFOUND;
+ sal_uInt16 nAccelPos = STRING_NOTFOUND;
xub_Unicode cAccel = 0;
if ( aErrorText.Len() > 128 )
{
@@ -1495,7 +1496,7 @@ void DbgDialogTest( Window* pWindow )
if ( aAccelBuf[cAccel] )
DbgOutTypef( DBG_OUT_ERROR, "Double mnemonic char: %c", cAccel );
else
- aAccelBuf[cAccel] = TRUE;
+ aAccelBuf[cAccel] = sal_True;
}
}
}
@@ -1648,66 +1649,66 @@ void DbgDialogTest( Window* pWindow )
if ( pChild->IsVisible() )
{
- BOOL bMaxWarning = FALSE;
+ sal_Bool bMaxWarning = sal_False;
if ( pChild->GetType() == WINDOW_NUMERICFIELD )
{
NumericField* pField = (NumericField*)pChild;
if ( pField->GetMax() == LONG_MAX )
- bMaxWarning = TRUE;
+ bMaxWarning = sal_True;
}
else if ( pChild->GetType() == WINDOW_METRICFIELD )
{
MetricField* pField = (MetricField*)pChild;
if ( pField->GetMax() == LONG_MAX )
- bMaxWarning = TRUE;
+ bMaxWarning = sal_True;
}
else if ( pChild->GetType() == WINDOW_CURRENCYFIELD )
{
CurrencyField* pField = (CurrencyField*)pChild;
if ( pField->GetMax() == LONG_MAX )
- bMaxWarning = TRUE;
+ bMaxWarning = sal_True;
}
else if ( pChild->GetType() == WINDOW_TIMEFIELD )
{
TimeField* pField = (TimeField*)pChild;
if ( pField->GetMax() == Time( 23, 59, 59, 99 ) )
- bMaxWarning = TRUE;
+ bMaxWarning = sal_True;
}
else if ( pChild->GetType() == WINDOW_DATEFIELD )
{
DateField* pField = (DateField*)pChild;
if ( pField->GetMax() == Date( 31, 12, 9999 ) )
- bMaxWarning = TRUE;
+ bMaxWarning = sal_True;
}
else if ( pChild->GetType() == WINDOW_NUMERICBOX )
{
NumericBox* pBox = (NumericBox*)pChild;
if ( pBox->GetMax() == LONG_MAX )
- bMaxWarning = TRUE;
+ bMaxWarning = sal_True;
}
else if ( pChild->GetType() == WINDOW_METRICBOX )
{
MetricBox* pBox = (MetricBox*)pChild;
if ( pBox->GetMax() == LONG_MAX )
- bMaxWarning = TRUE;
+ bMaxWarning = sal_True;
}
else if ( pChild->GetType() == WINDOW_CURRENCYBOX )
{
CurrencyBox* pBox = (CurrencyBox*)pChild;
if ( pBox->GetMax() == LONG_MAX )
- bMaxWarning = TRUE;
+ bMaxWarning = sal_True;
}
else if ( pChild->GetType() == WINDOW_TIMEBOX )
{
TimeBox* pBox = (TimeBox*)pChild;
if ( pBox->GetMax() == Time( 23, 59, 59, 99 ) )
- bMaxWarning = TRUE;
+ bMaxWarning = sal_True;
}
else if ( pChild->GetType() == WINDOW_DATEBOX )
{
DateBox* pBox = (DateBox*)pChild;
if ( pBox->GetMax() == Date( 31, 12, 9999 ) )
- bMaxWarning = TRUE;
+ bMaxWarning = sal_True;
}
if ( bMaxWarning )
{
@@ -1761,7 +1762,7 @@ void DbgDialogTest( Window* pWindow )
aTabPos = aNewPos;
}
- for ( USHORT j = 0; j < i; j++ )
+ for ( sal_uInt16 j = 0; j < i; j++ )
{
if ( ((pRectAry[j].Right() != 0) || (pRectAry[j].Bottom() != 0)) &&
aChildRect.IsOver( pRectAry[j] ) )
@@ -1839,8 +1840,8 @@ long SolarMessageBoxExecutor::doIt()
#if ! defined USE_VCL_MSGBOX
#ifdef WNT
- BOOL bOldCallTimer = pSVData->mbNoCallTimer;
- pSVData->mbNoCallTimer = TRUE;
+ sal_Bool bOldCallTimer = pSVData->mbNoCallTimer;
+ pSVData->mbNoCallTimer = sal_True;
MessageBeep( MB_ICONHAND );
nResult = MessageBoxW( 0, (LPWSTR)m_sDebugMessage.GetBuffer(), L"Debug Output",
MB_TASKMODAL | MB_YESNOCANCEL | MB_DEFBUTTON2 | MB_ICONSTOP );
@@ -1859,7 +1860,7 @@ long SolarMessageBoxExecutor::doIt()
}
#endif // WNT
#else
- USHORT nOldMode = Application::GetSystemWindowMode();
+ sal_uInt16 nOldMode = Application::GetSystemWindowMode();
Application::SetSystemWindowMode( nOldMode & ~SYSTEMWINDOW_MODE_NOAUTOMODE );
DbgMessageBox aBox( m_sDebugMessage );
Application::SetSystemWindowMode( nOldMode );
@@ -1945,12 +1946,12 @@ long SolarWindowPrinter::doIt()
void DbgPrintWindow( const char* pLine )
{
- static BOOL bIn = FALSE;
+ static sal_Bool bIn = sal_False;
// keine rekursiven Traces
if ( bIn )
return;
- bIn = TRUE;
+ bIn = sal_True;
SolarWindowPrinter aPrinter( String( pLine, RTL_TEXTENCODING_UTF8 ) );
TimeValue aTimeout; aTimeout.Seconds = 2; aTimeout.Nanosec = 0;
@@ -1959,14 +1960,16 @@ void DbgPrintWindow( const char* pLine )
if ( aPrinter.didTimeout() )
DbgPrintShell( pLine );
- bIn = FALSE;
+ bIn = sal_False;
}
// =======================================================================
-#ifdef WNT
-void ImplDbgTestSolarMutex();
-#endif
+void ImplDbgTestSolarMutex()
+{
+ bool bCheck = ImplGetSVData()->mpDefInst->CheckYieldMutex();
+ OSL_ENSURE( bCheck, "SolarMutex not locked" );
+}
// =======================================================================
@@ -1974,9 +1977,7 @@ void DbgGUIInit()
{
DbgSetPrintMsgBox( DbgPrintMsgBox );
DbgSetPrintWindow( DbgPrintWindow );
-#ifdef WNT
DbgSetTestSolarMutex( ImplDbgTestSolarMutex );
-#endif
}
// -----------------------------------------------------------------------
@@ -1985,9 +1986,7 @@ void DbgGUIDeInit()
{
DbgSetPrintMsgBox( NULL );
DbgSetPrintWindow( NULL );
-#ifdef WNT
DbgSetTestSolarMutex( NULL );
-#endif
DbgWindow* pDbgWindow = ImplGetSVData()->maWinData.mpDbgWin;
if ( pDbgWindow )
@@ -2004,7 +2003,7 @@ void DbgGUIStart()
{
DbgDialog* pDialog = new DbgDialog;
// Fuer den Debug-Dialog schalten wir Dialogtests aus
- ULONG nOldFlags = pData->nTestFlags;
+ sal_uLong nOldFlags = pData->nTestFlags;
pData->nTestFlags &= ~DBG_TEST_DIALOG;
if ( !pDialog->Execute() )
pData->nTestFlags |= (nOldFlags & DBG_TEST_DIALOG);
@@ -2019,7 +2018,7 @@ void DbgGUIStart()
// -----------------------------------------------------------------------
-USHORT DbgRegisterNamedUserChannel( const XubString& _rChannelUIName, DbgPrintLine pProc )
+sal_uInt16 DbgRegisterNamedUserChannel( const XubString& _rChannelUIName, DbgPrintLine pProc )
{
DbgChannelId nChannelId = DbgRegisterUserChannel( pProc );
UserDefinedChannels& rChannels = ImplDbgGetUserDefinedChannels();
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index f26b5d3cb400..41263675840f 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -37,6 +37,7 @@
#include "vcl/help.hxx"
#include "vcl/helpwin.hxx"
#include "tools/debug.hxx"
+#include "tools/diagnose_ex.h"
#include "tools/time.hxx"
// =======================================================================
@@ -63,27 +64,20 @@ Help::~Help()
// -----------------------------------------------------------------------
-BOOL Help::Start( ULONG, const Window* )
-{
- return FALSE;
-}
-
-void Help::OpenHelpAgent( ULONG )
+void Help::OpenHelpAgent( const rtl::OString& )
{
}
// -----------------------------------------------------------------------
-BOOL Help::Start( const XubString&, const Window* )
+sal_Bool Help::Start( const XubString&, const Window* )
{
- return FALSE;
+ return sal_False;
}
-// -----------------------------------------------------------------------
-
-XubString Help::GetHelpText( ULONG, const Window* )
+sal_Bool Help::SearchKeyword( const XubString& )
{
- return ImplGetSVEmptyStr();
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -97,26 +91,26 @@ XubString Help::GetHelpText( const String&, const Window* )
void Help::EnableContextHelp()
{
- ImplGetSVData()->maHelpData.mbContextHelp = TRUE;
+ ImplGetSVData()->maHelpData.mbContextHelp = sal_True;
}
// -----------------------------------------------------------------------
void Help::DisableContextHelp()
{
- ImplGetSVData()->maHelpData.mbContextHelp = FALSE;
+ ImplGetSVData()->maHelpData.mbContextHelp = sal_False;
}
// -----------------------------------------------------------------------
-BOOL Help::IsContextHelpEnabled()
+sal_Bool Help::IsContextHelpEnabled()
{
return ImplGetSVData()->maHelpData.mbContextHelp;
}
// -----------------------------------------------------------------------
-BOOL Help::StartContextHelp()
+sal_Bool Help::StartContextHelp()
{
ImplSVData* pSVData = ImplGetSVData();
@@ -128,74 +122,74 @@ BOOL Help::StartContextHelp()
Point aMousePos = pWindow->OutputToScreenPixel( pWindow->GetPointerPosPixel() );
HelpEvent aHelpEvent( aMousePos, HELPMODE_CONTEXT );
pWindow->RequestHelp( aHelpEvent );
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
void Help::EnableExtHelp()
{
- ImplGetSVData()->maHelpData.mbExtHelp = TRUE;
+ ImplGetSVData()->maHelpData.mbExtHelp = sal_True;
}
// -----------------------------------------------------------------------
void Help::DisableExtHelp()
{
- ImplGetSVData()->maHelpData.mbExtHelp = FALSE;
+ ImplGetSVData()->maHelpData.mbExtHelp = sal_False;
}
// -----------------------------------------------------------------------
-BOOL Help::IsExtHelpEnabled()
+sal_Bool Help::IsExtHelpEnabled()
{
return ImplGetSVData()->maHelpData.mbExtHelp;
}
// -----------------------------------------------------------------------
-BOOL Help::StartExtHelp()
+sal_Bool Help::StartExtHelp()
{
ImplSVData* pSVData = ImplGetSVData();
if ( pSVData->maHelpData.mbExtHelp && !pSVData->maHelpData.mbExtHelpMode )
{
- pSVData->maHelpData.mbExtHelpMode = TRUE;
+ pSVData->maHelpData.mbExtHelpMode = sal_True;
pSVData->maHelpData.mbOldBalloonMode = pSVData->maHelpData.mbBalloonHelp;
- pSVData->maHelpData.mbBalloonHelp = TRUE;
+ pSVData->maHelpData.mbBalloonHelp = sal_True;
if ( pSVData->maWinData.mpAppWin )
pSVData->maWinData.mpAppWin->ImplGenerateMouseMove();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Help::EndExtHelp()
+sal_Bool Help::EndExtHelp()
{
ImplSVData* pSVData = ImplGetSVData();
if ( pSVData->maHelpData.mbExtHelp && pSVData->maHelpData.mbExtHelpMode )
{
- pSVData->maHelpData.mbExtHelpMode = FALSE;
+ pSVData->maHelpData.mbExtHelpMode = sal_False;
pSVData->maHelpData.mbBalloonHelp = pSVData->maHelpData.mbOldBalloonMode;
if ( pSVData->maWinData.mpAppWin )
pSVData->maWinData.mpAppWin->ImplGenerateMouseMove();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Help::IsExtHelpActive()
+sal_Bool Help::IsExtHelpActive()
{
return ImplGetSVData()->maHelpData.mbExtHelpMode;
}
@@ -204,101 +198,115 @@ BOOL Help::IsExtHelpActive()
void Help::EnableBalloonHelp()
{
- ImplGetSVData()->maHelpData.mbBalloonHelp = TRUE;
+ ImplGetSVData()->maHelpData.mbBalloonHelp = sal_True;
}
// -----------------------------------------------------------------------
void Help::DisableBalloonHelp()
{
- ImplGetSVData()->maHelpData.mbBalloonHelp = FALSE;
+ ImplGetSVData()->maHelpData.mbBalloonHelp = sal_False;
}
// -----------------------------------------------------------------------
-BOOL Help::IsBalloonHelpEnabled()
+sal_Bool Help::IsBalloonHelpEnabled()
{
return ImplGetSVData()->maHelpData.mbBalloonHelp;
}
// -----------------------------------------------------------------------
-BOOL Help::ShowBalloon( Window* pParent,
+sal_Bool Help::ShowBalloon( Window* pParent,
const Point& rScreenPos,
const XubString& rHelpText )
{
ImplShowHelpWindow( pParent, HELPWINSTYLE_BALLOON, 0,
rHelpText, ImplGetSVEmptyStr(), rScreenPos );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL Help::ShowBalloon( Window* pParent,
+sal_Bool Help::ShowBalloon( Window* pParent,
const Point& rScreenPos, const Rectangle& rRect,
const XubString& rHelpText )
{
ImplShowHelpWindow( pParent, HELPWINSTYLE_BALLOON, 0,
rHelpText, ImplGetSVEmptyStr(), rScreenPos, &rRect );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
void Help::EnableQuickHelp()
{
- ImplGetSVData()->maHelpData.mbQuickHelp = TRUE;
+ ImplGetSVData()->maHelpData.mbQuickHelp = sal_True;
}
// -----------------------------------------------------------------------
void Help::DisableQuickHelp()
{
- ImplGetSVData()->maHelpData.mbQuickHelp = FALSE;
+ ImplGetSVData()->maHelpData.mbQuickHelp = sal_False;
}
// -----------------------------------------------------------------------
-BOOL Help::IsQuickHelpEnabled()
+sal_Bool Help::IsQuickHelpEnabled()
{
return ImplGetSVData()->maHelpData.mbQuickHelp;
}
// -----------------------------------------------------------------------
-BOOL Help::ShowQuickHelp( Window* pParent,
+sal_Bool Help::ShowQuickHelp( Window* pParent,
const Rectangle& rScreenRect,
const XubString& rHelpText,
const XubString& rLongHelpText,
- USHORT nStyle )
+ sal_uInt16 nStyle )
{
ImplShowHelpWindow( pParent, HELPWINSTYLE_QUICK, nStyle,
rHelpText, rLongHelpText,
pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), &rScreenRect );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-ULONG Help::ShowTip( Window* pParent, const Rectangle& rRect,
- const XubString& rText, USHORT nStyle )
+sal_uIntPtr Help::ShowTip( Window* pParent, const Rectangle& rScreenRect,
+ const XubString& rText, sal_uInt16 nStyle )
{
- USHORT nHelpWinStyle = HELPWINSTYLE_QUICK;
+ sal_uInt16 nHelpWinStyle = ( ( nStyle & QUICKHELP_TIP_STYLE_BALLOON ) != 0 ) ? HELPWINSTYLE_BALLOON : HELPWINSTYLE_QUICK;
HelpTextWindow* pHelpWin = new HelpTextWindow( pParent, rText, nHelpWinStyle, nStyle );
+ sal_uIntPtr nId = reinterpret_cast< sal_uIntPtr >( pHelpWin );
+ UpdateTip( nId, pParent, rScreenRect, rText );
+
+ pHelpWin->ShowHelp( HELPDELAY_NONE );
+ return nId;
+}
+
+// -----------------------------------------------------------------------
+
+void Help::UpdateTip( sal_uIntPtr nId, Window* pParent, const Rectangle& rScreenRect, const XubString& rText )
+{
+ HelpTextWindow* pHelpWin = reinterpret_cast< HelpTextWindow* >( nId );
+ ENSURE_OR_RETURN_VOID( pHelpWin != NULL, "Help::UpdateTip: invalid ID!" );
+
Size aSz = pHelpWin->CalcOutSize();
pHelpWin->SetOutputSizePixel( aSz );
- ImplSetHelpWindowPos( pHelpWin, nHelpWinStyle, nStyle,
- pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), &rRect );
- pHelpWin->ShowHelp( HELPDELAY_NONE );
- return (ULONG)pHelpWin;
+ ImplSetHelpWindowPos( pHelpWin, pHelpWin->GetWinStyle(), pHelpWin->GetStyle(),
+ pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), &rScreenRect );
+
+ pHelpWin->SetHelpText( rText );
}
// -----------------------------------------------------------------------
-void Help::HideTip( ULONG nId )
+void Help::HideTip( sal_uLong nId )
{
HelpTextWindow* pHelpWin = (HelpTextWindow*)nId;
Window* pFrameWindow = pHelpWin->ImplGetFrameWindow();
@@ -312,13 +320,13 @@ void Help::HideTip( ULONG nId )
// =======================================================================
-HelpTextWindow::HelpTextWindow( Window* pParent, const XubString& rText, USHORT nHelpWinStyle, USHORT nStyle ) :
+HelpTextWindow::HelpTextWindow( Window* pParent, const XubString& rText, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle ) :
//FloatingWindow( pParent->ImplGetFrameWindow(), WB_SYSTEMWINDOW ),
FloatingWindow( pParent, WB_SYSTEMWINDOW|WB_TOOLTIPWIN ), // #105827# if we change the parent, mirroring will not work correctly when positioning this window
maHelpText( rText )
{
SetType( WINDOW_HELPTEXTWINDOW );
- ImplSetMouseTransparent( TRUE );
+ ImplSetMouseTransparent( sal_True );
mnHelpWinStyle = nHelpWinStyle;
mnStyle = nStyle;
// on windows this will raise the application window, because help windows are system windows now
@@ -331,9 +339,9 @@ HelpTextWindow::HelpTextWindow( Window* pParent, const XubString& rText, USHORT
SetTextAlign( ALIGN_TOP );
if ( IsNativeControlSupported( CTRL_TOOLTIP, PART_ENTIRE_CONTROL ) )
{
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
}
else
@@ -346,7 +354,7 @@ HelpTextWindow::HelpTextWindow( Window* pParent, const XubString& rText, USHORT
if( mnStyle & QUICKHELP_BIDI_RTL )
{
- ULONG nLayoutMode = GetLayoutMode();
+ sal_uLong nLayoutMode = GetLayoutMode();
nLayoutMode |= TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_TEXTORIGIN_LEFT;
SetLayoutMode( nLayoutMode );
}
@@ -355,7 +363,7 @@ HelpTextWindow::HelpTextWindow( Window* pParent, const XubString& rText, USHORT
ImplSVData* pSVData = ImplGetSVData();
if ( pSVData->maHelpData.mbSetKeyboardHelp )
- pSVData->maHelpData.mbKeyboardHelp = TRUE;
+ pSVData->maHelpData.mbKeyboardHelp = sal_True;
const HelpSettings& rHelpSettings = pParent->GetSettings().GetHelpSettings();
maShowTimer.SetTimeoutHdl( LINK( this, HelpTextWindow, TimerHdl ) );
@@ -392,13 +400,13 @@ void HelpTextWindow::SetHelpText( const String& rHelpText )
else // HELPWINSTYLE_BALLOON
{
Point aTmpPoint;
- USHORT nCharsInLine = 35 + ((maHelpText.Len()/100)*5);
+ sal_uInt16 nCharsInLine = 35 + ((maHelpText.Len()/100)*5);
XubString aXXX;
aXXX.Fill( nCharsInLine, 'x' ); // Durchschnittliche Breite, damit nicht jedes Fenster anders.
long nWidth = GetTextWidth( aXXX );
Size aTmpSize( nWidth, 0x7FFFFFFF );
Rectangle aTry1( aTmpPoint, aTmpSize );
- USHORT nDrawFlags = TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK |
+ sal_uInt16 nDrawFlags = TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK |
TEXT_DRAW_LEFT | TEXT_DRAW_TOP;
if ( mnStyle & QUICKHELP_CTRLTEXT )
nDrawFlags |= TEXT_DRAW_MNEMONIC;
@@ -420,7 +428,7 @@ void HelpTextWindow::SetHelpText( const String& rHelpText )
void HelpTextWindow::ImplShow()
{
ImplDelData aDogTag( this );
- Show( TRUE, SHOW_NOACTIVATE );
+ Show( sal_True, SHOW_NOACTIVATE );
if( !aDogTag.IsDelete() )
Update();
}
@@ -450,7 +458,7 @@ void HelpTextWindow::Paint( const Rectangle& )
}
else // HELPWINSTYLE_BALLOON
{
- USHORT nDrawFlags = TEXT_DRAW_MULTILINE|TEXT_DRAW_WORDBREAK|
+ sal_uInt16 nDrawFlags = TEXT_DRAW_MULTILINE|TEXT_DRAW_WORDBREAK|
TEXT_DRAW_LEFT|TEXT_DRAW_TOP;
if ( mnStyle & QUICKHELP_CTRLTEXT )
nDrawFlags |= TEXT_DRAW_MNEMONIC;
@@ -476,9 +484,9 @@ void HelpTextWindow::Paint( const Rectangle& )
// -----------------------------------------------------------------------
-void HelpTextWindow::ShowHelp( USHORT nDelayMode )
+void HelpTextWindow::ShowHelp( sal_uInt16 nDelayMode )
{
- ULONG nTimeout = 0;
+ sal_uLong nTimeout = 0;
if ( nDelayMode != HELPDELAY_NONE )
{
// Im ExtendedHelp-Fall die Hilfe schneller anzeigen
@@ -559,9 +567,9 @@ String HelpTextWindow::GetText() const
// -----------------------------------------------------------------------
-BOOL HelpTextWindow::RegisterAccessibleParent()
+sal_Bool HelpTextWindow::RegisterAccessibleParent()
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -572,7 +580,7 @@ void HelpTextWindow::RevokeAccessibleParent()
// =======================================================================
-void ImplShowHelpWindow( Window* pParent, USHORT nHelpWinStyle, USHORT nStyle,
+void ImplShowHelpWindow( Window* pParent, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle,
const XubString& rHelpText, const XubString& rStatusText,
const Point& rScreenPos, const Rectangle* pHelpArea )
{
@@ -582,15 +590,19 @@ void ImplShowHelpWindow( Window* pParent, USHORT nHelpWinStyle, USHORT nStyle,
return;
HelpTextWindow* pHelpWin = pSVData->maHelpData.mpHelpWin;
- USHORT nDelayMode = HELPDELAY_NORMAL;
+ sal_uInt16 nDelayMode = HELPDELAY_NORMAL;
if ( pHelpWin )
{
DBG_ASSERT( pHelpWin != pParent, "HelpInHelp ?!" );
- if ( (( pHelpWin->GetHelpText() != rHelpText ) ||
- ( pHelpWin->GetWinStyle() != nHelpWinStyle ) ||
- ( pHelpArea && ( pHelpWin->GetHelpArea() != *pHelpArea ) ) )
- && pSVData->maHelpData.mbRequestingHelp )
+ if ( ( ( pHelpWin->GetHelpText() != rHelpText )
+ || ( pHelpWin->GetWinStyle() != nHelpWinStyle )
+ || ( pHelpArea
+ && ( pHelpWin->GetHelpArea() != *pHelpArea )
+ )
+ )
+ && pSVData->maHelpData.mbRequestingHelp
+ )
{
// remove help window if no HelpText or other HelpText or
// other help mode. but keep it if we are scrolling, ie not requesting help
@@ -602,8 +614,8 @@ void ImplShowHelpWindow( Window* pParent, USHORT nHelpWinStyle, USHORT nStyle,
}
else
{
- bool bTextChanged = rHelpText != pHelpWin->GetHelpText();
- if( bTextChanged )
+ bool const bTextChanged = rHelpText != pHelpWin->GetHelpText();
+ if ( bTextChanged || ( ( nStyle & QUICKHELP_FORCE_REPOSITION ) != 0 ) )
{
Window * pWindow = pHelpWin->GetParent()->ImplGetFrameWindow();
Rectangle aInvRect( pHelpWin->GetWindowExtentsRelative( pWindow ) );
@@ -621,8 +633,10 @@ void ImplShowHelpWindow( Window* pParent, USHORT nHelpWinStyle, USHORT nStyle,
if ( !pHelpWin && rHelpText.Len() )
{
- ULONG nCurTime = Time::GetSystemTicks();
- if( (nCurTime - pSVData->maHelpData.mnLastHelpHideTime) < pParent->GetSettings().GetHelpSettings().GetTipDelay() )
+ sal_uLong nCurTime = Time::GetSystemTicks();
+ if ( ( ( nCurTime - pSVData->maHelpData.mnLastHelpHideTime ) < pParent->GetSettings().GetHelpSettings().GetTipDelay() )
+ || ( ( nStyle & QUICKHELP_NO_DELAY ) != 0 )
+ )
nDelayMode = HELPDELAY_NONE;
DBG_ASSERT( !pHelpWin, "Noch ein HelpWin ?!" );
@@ -657,7 +671,7 @@ void ImplDestroyHelpWindow( bool bUpdateHideTime )
if( pHelpWin->IsVisible() )
pWindow->Invalidate( aInvRect );
pSVData->maHelpData.mpHelpWin = NULL;
- pSVData->maHelpData.mbKeyboardHelp = FALSE;
+ pSVData->maHelpData.mbKeyboardHelp = sal_False;
pHelpWin->Hide();
delete pHelpWin;
if( bUpdateHideTime )
@@ -667,7 +681,7 @@ void ImplDestroyHelpWindow( bool bUpdateHideTime )
// -----------------------------------------------------------------------
-void ImplSetHelpWindowPos( Window* pHelpWin, USHORT nHelpWinStyle, USHORT nStyle,
+void ImplSetHelpWindowPos( Window* pHelpWin, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle,
const Point& rPos, const Rectangle* pHelpArea )
{
Point aPos = rPos;
diff --git a/vcl/source/app/i18nhelp.cxx b/vcl/source/app/i18nhelp.cxx
index 6841d84b424b..0f9a8df94255 100644
--- a/vcl/source/app/i18nhelp.cxx
+++ b/vcl/source/app/i18nhelp.cxx
@@ -131,7 +131,7 @@ sal_Int32 vcl::I18nHelper::CompareString( const String& rStr1, const String& rSt
{
// Change mbTransliterateIgnoreCase and destroy the warpper, next call to
// ImplGetTransliterationWrapper() will create a wrapper with the correct bIgnoreCase
- ((vcl::I18nHelper*)this)->mbTransliterateIgnoreCase = FALSE;
+ ((vcl::I18nHelper*)this)->mbTransliterateIgnoreCase = sal_False;
delete ((vcl::I18nHelper*)this)->mpTransliterationWrapper;
((vcl::I18nHelper*)this)->mpTransliterationWrapper = NULL;
}
@@ -150,7 +150,7 @@ sal_Bool vcl::I18nHelper::MatchString( const String& rStr1, const String& rStr2
{
// Change mbTransliterateIgnoreCase and destroy the warpper, next call to
// ImplGetTransliterationWrapper() will create a wrapper with the correct bIgnoreCase
- ((vcl::I18nHelper*)this)->mbTransliterateIgnoreCase = TRUE;
+ ((vcl::I18nHelper*)this)->mbTransliterateIgnoreCase = sal_True;
delete ((vcl::I18nHelper*)this)->mpTransliterationWrapper;
((vcl::I18nHelper*)this)->mpTransliterationWrapper = NULL;
}
@@ -164,8 +164,8 @@ sal_Bool vcl::I18nHelper::MatchMnemonic( const String& rString, sal_Unicode cMne
{
::osl::Guard< ::osl::Mutex > aGuard( ((vcl::I18nHelper*)this)->maMutex );
- BOOL bEqual = FALSE;
- USHORT n = rString.Search( '~' );
+ sal_Bool bEqual = sal_False;
+ sal_uInt16 n = rString.Search( '~' );
if ( n != STRING_NOTFOUND )
{
String aMatchStr( rString, n+1, STRING_LEN ); // not only one char, because of transliteration...
@@ -182,7 +182,7 @@ String vcl::I18nHelper::GetDate( const Date& rDate ) const
return ImplGetLocaleDataWrapper().getDate( rDate );
}
-String vcl::I18nHelper::GetNum( long nNumber, USHORT nDecimals, BOOL bUseThousandSep, BOOL bTrailingZeros ) const
+String vcl::I18nHelper::GetNum( long nNumber, sal_uInt16 nDecimals, sal_Bool bUseThousandSep, sal_Bool bTrailingZeros ) const
{
return ImplGetLocaleDataWrapper().getNum( nNumber, nDecimals, bUseThousandSep, bTrailingZeros );
}
diff --git a/vcl/source/app/idlemgr.cxx b/vcl/source/app/idlemgr.cxx
index 1ed8785bc8c8..cc6502a74896 100644
--- a/vcl/source/app/idlemgr.cxx
+++ b/vcl/source/app/idlemgr.cxx
@@ -36,8 +36,8 @@
struct ImplIdleData
{
Link maIdleHdl;
- USHORT mnPriority;
- BOOL mbTimeout;
+ sal_uInt16 mnPriority;
+ sal_Bool mbTimeout;
};
#define IMPL_IDLETIMEOUT 350
@@ -66,14 +66,14 @@ ImplIdleMgr::~ImplIdleMgr()
// -----------------------------------------------------------------------
-BOOL ImplIdleMgr::InsertIdleHdl( const Link& rLink, USHORT nPriority )
+sal_Bool ImplIdleMgr::InsertIdleHdl( const Link& rLink, sal_uInt16 nPriority )
{
size_t nPos = (size_t)-1;
size_t n = mpIdleList->size();
for ( size_t i = 0; i < n; ++i ) {
// we need to check each element to verify that rLink isn't in the array
if ( (*mpIdleList)[ i ]->maIdleHdl == rLink ) {
- return FALSE;
+ return sal_False;
}
if ( nPriority <= (*mpIdleList)[ i ]->mnPriority ) {
nPos = i;
@@ -83,7 +83,7 @@ BOOL ImplIdleMgr::InsertIdleHdl( const Link& rLink, USHORT nPriority )
ImplIdleData* pIdleData = new ImplIdleData;
pIdleData->maIdleHdl = rLink;
pIdleData->mnPriority = nPriority;
- pIdleData->mbTimeout = FALSE;
+ pIdleData->mbTimeout = sal_False;
if ( nPos < mpIdleList->size() ) {
ImplIdleList::iterator it = mpIdleList->begin();
@@ -97,7 +97,7 @@ BOOL ImplIdleMgr::InsertIdleHdl( const Link& rLink, USHORT nPriority )
if ( !maTimer.IsActive() )
maTimer.Start();
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -124,12 +124,12 @@ IMPL_LINK( ImplIdleMgr, TimeoutHdl, Timer*, EMPTYARG )
for ( size_t i = 0; i < mpIdleList->size(); ++i ) {
ImplIdleData* pIdleData = (*mpIdleList)[ i ];
if ( !pIdleData->mbTimeout ) {
- pIdleData->mbTimeout = TRUE;
+ pIdleData->mbTimeout = sal_True;
pIdleData->maIdleHdl.Call( GetpApp() );
// May have been removed in the handler
for ( size_t j = 0; j < mpIdleList->size(); ++j ) {
if ( (*mpIdleList)[ j ] == pIdleData ) {
- pIdleData->mbTimeout = FALSE;
+ pIdleData->mbTimeout = sal_False;
break;
}
}
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 08f199d5281c..8cbd1d816f8c 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -39,7 +39,6 @@
#include <vcl/salbmp.hxx>
#include <vcl/salobj.hxx>
#include <vcl/salmenu.hxx>
-#include <vcl/salctrlhandle.hxx>
// this file contains the virtual destructors of the sal interface
// compilers ususally put their vtables where the destructor is
@@ -75,6 +74,29 @@ void SalInstance::FillFontPathList( std::list< rtl::OString >& )
// do nothing
}
+SalMenu* SalInstance::CreateMenu( sal_Bool, Menu* )
+{
+ // default: no native menus
+ return NULL;
+}
+
+void SalInstance::DestroyMenu( SalMenu* pMenu )
+{
+ (void)pMenu;
+ OSL_ENSURE( pMenu == 0, "DestroyMenu called with non-native menus" );
+}
+
+SalMenuItem* SalInstance::CreateMenuItem( const SalItemParams* )
+{
+ return NULL;
+}
+
+void SalInstance::DestroyMenuItem( SalMenuItem* pItem )
+{
+ (void)pItem;
+ OSL_ENSURE( pItem == 0, "DestroyMenu called with non-native menus" );
+}
+
SalTimer::~SalTimer()
{
}
@@ -95,10 +117,10 @@ SalPrinter::~SalPrinter()
{
}
-BOOL SalPrinter::StartJob( const String*, const String&, const String&,
+sal_Bool SalPrinter::StartJob( const String*, const String&, const String&,
ImplJobSetup*, vcl::PrinterController& )
{
- return FALSE;
+ return sal_False;
}
SalInfoPrinter::~SalInfoPrinter()
@@ -117,7 +139,7 @@ SalMenu::~SalMenu()
{
}
-bool SalMenu::ShowNativePopupMenu(FloatingWindow *, const Rectangle&, ULONG )
+bool SalMenu::ShowNativePopupMenu(FloatingWindow *, const Rectangle&, sal_uLong )
{
return false;
}
@@ -127,11 +149,11 @@ bool SalMenu::AddMenuBarButton( const SalMenuButtonItem& )
return false;
}
-void SalMenu::RemoveMenuBarButton( USHORT )
+void SalMenu::RemoveMenuBarButton( sal_uInt16 )
{
}
-Rectangle SalMenu::GetMenuBarButtonRectPixel( USHORT, SalFrame* )
+Rectangle SalMenu::GetMenuBarButtonRectPixel( sal_uInt16, SalFrame* )
{
return Rectangle();
}
@@ -139,8 +161,5 @@ Rectangle SalMenu::GetMenuBarButtonRectPixel( USHORT, SalFrame* )
SalMenuItem::~SalMenuItem()
{
}
-SalControlHandle::~SalControlHandle()
-{
-}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/session.cxx b/vcl/source/app/session.cxx
index d75b669b51f4..89aaf9026312 100644
--- a/vcl/source/app/session.cxx
+++ b/vcl/source/app/session.cxx
@@ -40,6 +40,12 @@
#include <list>
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::frame;
@@ -54,12 +60,12 @@ class VCLSession : public cppu::WeakComponentImplHelper1 < XSessionManagerClient
{
struct Listener
{
- Reference< XSessionManagerListener > m_xListener;
+ css::uno::Reference< XSessionManagerListener > m_xListener;
bool m_bInteractionRequested;
bool m_bInteractionDone;
bool m_bSaveDone;
- Listener( const Reference< XSessionManagerListener >& xListener )
+ Listener( const css::uno::Reference< XSessionManagerListener >& xListener )
: m_xListener( xListener ),
m_bInteractionRequested( false ),
m_bInteractionDone( false ),
@@ -86,11 +92,11 @@ public:
VCLSession();
virtual ~VCLSession();
- virtual void SAL_CALL addSessionManagerListener( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
- virtual void SAL_CALL removeSessionManagerListener( const Reference< XSessionManagerListener>& xListener ) throw( RuntimeException );
- virtual void SAL_CALL queryInteraction( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
- virtual void SAL_CALL interactionDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
- virtual void SAL_CALL saveDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
+ virtual void SAL_CALL addSessionManagerListener( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
+ virtual void SAL_CALL removeSessionManagerListener( const css::uno::Reference< XSessionManagerListener>& xListener ) throw( RuntimeException );
+ virtual void SAL_CALL queryInteraction( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
+ virtual void SAL_CALL interactionDone( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
+ virtual void SAL_CALL saveDone( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
virtual sal_Bool SAL_CALL cancelShutdown() throw( RuntimeException );
};
@@ -148,7 +154,7 @@ void VCLSession::callSaveRequested( bool bShutdown, bool bCancelable )
}
}
- ULONG nAcquireCount = Application::ReleaseSolarMutex();
+ sal_uLong nAcquireCount = Application::ReleaseSolarMutex();
for( std::list< Listener >::const_iterator it = aListeners.begin(); it != aListeners.end(); ++it )
it->m_xListener->doSave( bShutdown, bCancelable );
Application::AcquireSolarMutex( nAcquireCount );
@@ -176,7 +182,7 @@ void VCLSession::callInteractionGranted( bool bInteractionGranted )
}
}
- ULONG nAcquireCount = Application::ReleaseSolarMutex();
+ sal_uLong nAcquireCount = Application::ReleaseSolarMutex();
for( std::list< Listener >::const_iterator it = aListeners.begin(); it != aListeners.end(); ++it )
it->m_xListener->approveInteraction( bInteractionGranted );
@@ -194,7 +200,7 @@ void VCLSession::callShutdownCancelled()
m_bInteractionRequested = m_bInteractionDone = m_bInteractionGranted = false;
}
- ULONG nAcquireCount = Application::ReleaseSolarMutex();
+ sal_uLong nAcquireCount = Application::ReleaseSolarMutex();
for( std::list< Listener >::const_iterator it = aListeners.begin(); it != aListeners.end(); ++it )
it->m_xListener->shutdownCanceled();
Application::AcquireSolarMutex( nAcquireCount );
@@ -211,10 +217,10 @@ void VCLSession::callQuit()
m_bInteractionRequested = m_bInteractionDone = m_bInteractionGranted = false;
}
- ULONG nAcquireCount = Application::ReleaseSolarMutex();
+ sal_uLong nAcquireCount = Application::ReleaseSolarMutex();
for( std::list< Listener >::const_iterator it = aListeners.begin(); it != aListeners.end(); ++it )
{
- Reference< XSessionManagerListener2 > xListener2( it->m_xListener, UNO_QUERY );
+ css::uno::Reference< XSessionManagerListener2 > xListener2( it->m_xListener, UNO_QUERY );
if( xListener2.is() )
xListener2->doQuit();
}
@@ -246,14 +252,14 @@ void VCLSession::SalSessionEventProc( SalSessionEvent* pEvent )
}
}
-void SAL_CALL VCLSession::addSessionManagerListener( const Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
+void SAL_CALL VCLSession::addSessionManagerListener( const css::uno::Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
{
osl::MutexGuard aGuard( m_aMutex );
m_aListeners.push_back( Listener( xListener ) );
}
-void SAL_CALL VCLSession::removeSessionManagerListener( const Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
+void SAL_CALL VCLSession::removeSessionManagerListener( const css::uno::Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
{
osl::MutexGuard aGuard( m_aMutex );
@@ -270,7 +276,7 @@ void SAL_CALL VCLSession::removeSessionManagerListener( const Reference<XSession
}
}
-void SAL_CALL VCLSession::queryInteraction( const Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
+void SAL_CALL VCLSession::queryInteraction( const css::uno::Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
{
if( m_bInteractionGranted )
{
@@ -297,7 +303,7 @@ void SAL_CALL VCLSession::queryInteraction( const Reference<XSessionManagerListe
}
}
-void SAL_CALL VCLSession::interactionDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException )
+void SAL_CALL VCLSession::interactionDone( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException )
{
osl::MutexGuard aGuard( m_aMutex );
int nRequested = 0, nDone = 0;
@@ -320,7 +326,7 @@ void SAL_CALL VCLSession::interactionDone( const Reference< XSessionManagerListe
}
}
-void SAL_CALL VCLSession::saveDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException )
+void SAL_CALL VCLSession::saveDone( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException )
{
osl::MutexGuard aGuard( m_aMutex );
@@ -361,13 +367,13 @@ Sequence< rtl::OUString > SAL_CALL vcl_session_getSupportedServiceNames()
return aRet;
}
-Reference< XInterface > SAL_CALL vcl_session_createInstance( const Reference< XMultiServiceFactory > & /*xMultiServiceFactory*/ )
+css::uno::Reference< XInterface > SAL_CALL vcl_session_createInstance( const css::uno::Reference< XMultiServiceFactory > & /*xMultiServiceFactory*/ )
{
ImplSVData* pSVData = ImplGetSVData();
if( ! pSVData->xSMClient.is() )
pSVData->xSMClient = new VCLSession();
- return Reference< XInterface >(pSVData->xSMClient, UNO_QUERY );
+ return css::uno::Reference< XInterface >(pSVData->xSMClient, UNO_QUERY );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 253c9f8d2ff2..84b8d7cc9154 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -148,18 +148,18 @@ void MachineSettings::CopyData()
// -----------------------------------------------------------------------
-BOOL MachineSettings::operator ==( const MachineSettings& rSet ) const
+sal_Bool MachineSettings::operator ==( const MachineSettings& rSet ) const
{
if ( mpData == rSet.mpData )
- return TRUE;
+ return sal_True;
if ( (mpData->mnOptions == rSet.mpData->mnOptions) &&
(mpData->mnScreenOptions == rSet.mpData->mnScreenOptions) &&
(mpData->mnPrintOptions == rSet.mpData->mnPrintOptions) &&
(mpData->mnScreenRasterFontDeviation == rSet.mpData->mnScreenRasterFontDeviation) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// =======================================================================
@@ -179,7 +179,7 @@ ImplMouseData::ImplMouseData()
mnDragLinkCode = KEY_SHIFT | KEY_MOD1;
mnContextMenuCode = MOUSE_RIGHT;
mnContextMenuClicks = 1;
- mbContextMenuDown = TRUE;
+ mbContextMenuDown = sal_True;
mnMiddleButtonAction = MOUSE_MIDDLE_AUTOSCROLL;
mnScrollRepeat = 100;
mnButtonStartRepeat = 370;
@@ -281,10 +281,10 @@ void MouseSettings::CopyData()
// -----------------------------------------------------------------------
-BOOL MouseSettings::operator ==( const MouseSettings& rSet ) const
+sal_Bool MouseSettings::operator ==( const MouseSettings& rSet ) const
{
if ( mpData == rSet.mpData )
- return TRUE;
+ return sal_True;
if ( (mpData->mnOptions == rSet.mpData->mnOptions) &&
(mpData->mnDoubleClkTime == rSet.mpData->mnDoubleClkTime) &&
@@ -307,9 +307,9 @@ BOOL MouseSettings::operator ==( const MouseSettings& rSet ) const
(mpData->mnMenuDelay == rSet.mpData->mnMenuDelay) &&
(mpData->mnFollow == rSet.mpData->mnFollow) &&
(mpData->mnWheelBehavior == rSet.mpData->mnWheelBehavior ) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// =======================================================================
@@ -391,15 +391,15 @@ void KeyboardSettings::CopyData()
// -----------------------------------------------------------------------
-BOOL KeyboardSettings::operator ==( const KeyboardSettings& rSet ) const
+sal_Bool KeyboardSettings::operator ==( const KeyboardSettings& rSet ) const
{
if ( mpData == rSet.mpData )
- return TRUE;
+ return sal_True;
if ( (mpData->mnOptions == rSet.mpData->mnOptions) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// =======================================================================
@@ -418,12 +418,11 @@ ImplStyleData::ImplStyleData()
mnCursorBlinkTime = STYLE_CURSOR_NOBLINKTIME;
mnScreenZoom = 100;
mnScreenFontZoom = 100;
- mnRadioButtonStyle = 0;
- mnCheckBoxStyle = 0;
- mnPushButtonStyle = 0;
- mnTabControlStyle = 0;
mnLogoDisplayTime = LOGO_DISPLAYTIME_STARTTIME;
- mnDragFullOptions = 0;
+ mnDragFullOptions = DRAGFULL_OPTION_WINDOWMOVE | DRAGFULL_OPTION_WINDOWSIZE |
+ DRAGFULL_OPTION_OBJECTMOVE | DRAGFULL_OPTION_OBJECTSIZE |
+ DRAGFULL_OPTION_DOCKING | DRAGFULL_OPTION_SPLIT |
+ DRAGFULL_OPTION_SCROLL;
mnAnimationOptions = 0;
mnSelectionOptions = 0;
mnDisplayOptions = 0;
@@ -520,10 +519,6 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) :
mnCursorBlinkTime = rData.mnCursorBlinkTime;
mnScreenZoom = rData.mnScreenZoom;
mnScreenFontZoom = rData.mnScreenFontZoom;
- mnRadioButtonStyle = rData.mnRadioButtonStyle;
- mnCheckBoxStyle = rData.mnCheckBoxStyle;
- mnPushButtonStyle = rData.mnPushButtonStyle;
- mnTabControlStyle = rData.mnTabControlStyle;
mnLogoDisplayTime = rData.mnLogoDisplayTime;
mnDragFullOptions = rData.mnDragFullOptions;
mnAnimationOptions = rData.mnAnimationOptions;
@@ -615,12 +610,6 @@ void ImplStyleData::SetStandardStyles()
maHighlightLinkColor = Color( COL_LIGHTBLUE );
maFontColor = Color( COL_BLACK );
- mnRadioButtonStyle &= ~STYLE_RADIOBUTTON_STYLE;
- mnCheckBoxStyle &= ~STYLE_CHECKBOX_STYLE;
- mnPushButtonStyle &= ~STYLE_PUSHBUTTON_STYLE;
- mnTabControlStyle = 0;
-
- mnOptions &= ~(STYLE_OPTION_SYSTEMSTYLE | STDSYS_STYLE);
mnBorderSize = 1;
mnTitleHeight = 18;
mnFloatTitleHeight = 13;
@@ -630,8 +619,8 @@ void ImplStyleData::SetStandardStyles()
mnUseSystemUIFonts = 1;
mnUseFlatBorders = 0;
mnUseFlatMenues = 0;
- mbPreferredUseImagesInMenus = TRUE;
- mnSkipDisabledInMenus = (USHORT)FALSE;
+ mbPreferredUseImagesInMenus = sal_True;
+ mnSkipDisabledInMenus = (sal_uInt16)sal_False;
Gradient aGrad( GRADIENT_LINEAR, DEFAULT_WORKSPACE_GRADIENT_START_COLOR, DEFAULT_WORKSPACE_GRADIENT_END_COLOR );
maWorkspaceGradient = Wallpaper( aGrad );
@@ -681,13 +670,13 @@ void StyleSettings::Set3DColors( const Color& rColor )
mpData->maShadowColor = rColor;
mpData->maLightColor.IncreaseLuminance( 64 );
mpData->maShadowColor.DecreaseLuminance( 64 );
- ULONG nRed = mpData->maLightColor.GetRed();
- ULONG nGreen = mpData->maLightColor.GetGreen();
- ULONG nBlue = mpData->maLightColor.GetBlue();
- nRed += (ULONG)(mpData->maShadowColor.GetRed());
- nGreen += (ULONG)(mpData->maShadowColor.GetGreen());
- nBlue += (ULONG)(mpData->maShadowColor.GetBlue());
- mpData->maCheckedColor = Color( (BYTE)(nRed/2), (BYTE)(nGreen/2), (BYTE)(nBlue/2) );
+ sal_uLong nRed = mpData->maLightColor.GetRed();
+ sal_uLong nGreen = mpData->maLightColor.GetGreen();
+ sal_uLong nBlue = mpData->maLightColor.GetBlue();
+ nRed += (sal_uLong)(mpData->maShadowColor.GetRed());
+ nGreen += (sal_uLong)(mpData->maShadowColor.GetGreen());
+ nBlue += (sal_uLong)(mpData->maShadowColor.GetBlue());
+ mpData->maCheckedColor = Color( (sal_uInt8)(nRed/2), (sal_uInt8)(nGreen/2), (sal_uInt8)(nBlue/2) );
}
else
{
@@ -699,7 +688,7 @@ void StyleSettings::Set3DColors( const Color& rColor )
// -----------------------------------------------------------------------
-::rtl::OUString StyleSettings::ImplSymbolsStyleToName( ULONG nStyle ) const
+::rtl::OUString StyleSettings::ImplSymbolsStyleToName( sal_uLong nStyle ) const
{
switch ( nStyle )
{
@@ -718,7 +707,7 @@ void StyleSettings::Set3DColors( const Color& rColor )
// -----------------------------------------------------------------------
-ULONG StyleSettings::ImplNameToSymbolsStyle( const ::rtl::OUString &rName ) const
+sal_uLong StyleSettings::ImplNameToSymbolsStyle( const ::rtl::OUString &rName ) const
{
if ( rName == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("default")) )
return STYLE_SYMBOLS_DEFAULT;
@@ -762,22 +751,22 @@ void StyleSettings::SetPreferredSymbolsStyleName( const ::rtl::OUString &rName )
// -----------------------------------------------------------------------
-ULONG StyleSettings::GetCurrentSymbolsStyle() const
+sal_uLong StyleSettings::GetCurrentSymbolsStyle() const
{
// style selected in Tools -> Options... -> OpenOffice.org -> View
- ULONG nStyle = GetSymbolsStyle();
+ sal_uLong nStyle = GetSymbolsStyle();
if ( nStyle == STYLE_SYMBOLS_AUTO || ( !CheckSymbolStyle (nStyle) ) )
{
// the preferred style can be read from the desktop setting by the desktop native widgets modules
- ULONG nPreferredStyle = GetPreferredSymbolsStyle();
+ sal_uLong nPreferredStyle = GetPreferredSymbolsStyle();
if ( nPreferredStyle == STYLE_SYMBOLS_AUTO || ( !CheckSymbolStyle (nPreferredStyle) ) )
{
// use a hardcoded desktop-specific fallback if no preferred style has been detected
static bool sbFallbackDesktopChecked = false;
- static ULONG snFallbackDesktopStyle = STYLE_SYMBOLS_DEFAULT;
+ static sal_uLong snFallbackDesktopStyle = STYLE_SYMBOLS_DEFAULT;
if ( !sbFallbackDesktopChecked )
{
@@ -799,10 +788,10 @@ ULONG StyleSettings::GetCurrentSymbolsStyle() const
// -----------------------------------------------------------------------
-ULONG StyleSettings::GetAutoSymbolsStyle() const
+sal_uLong StyleSettings::GetAutoSymbolsStyle() const
{
const ::rtl::OUString& rDesktopEnvironment = Application::GetDesktopEnvironment();
- ULONG nRet = STYLE_SYMBOLS_DEFAULT;
+ sal_uLong nRet = STYLE_SYMBOLS_DEFAULT;
bool bCont = true;
try
@@ -833,9 +822,9 @@ ULONG StyleSettings::GetAutoSymbolsStyle() const
// falback to any existing style
if ( ! CheckSymbolStyle (nRet) )
{
- for ( ULONG n = 0 ; n <= STYLE_SYMBOLS_THEMES_MAX ; n++ )
+ for ( sal_uLong n = 0 ; n <= STYLE_SYMBOLS_THEMES_MAX ; n++ )
{
- ULONG nStyleToCheck = n;
+ sal_uLong nStyleToCheck = n;
// auto is not a real theme => can't be fallback
if ( nStyleToCheck == STYLE_SYMBOLS_AUTO )
@@ -860,7 +849,7 @@ ULONG StyleSettings::GetAutoSymbolsStyle() const
// -----------------------------------------------------------------------
-bool StyleSettings::CheckSymbolStyle( ULONG nStyle ) const
+bool StyleSettings::CheckSymbolStyle( sal_uLong nStyle ) const
{
if ( nStyle == STYLE_SYMBOLS_INDUSTRIAL )
return false; // industrial is dead
@@ -871,15 +860,15 @@ bool StyleSettings::CheckSymbolStyle( ULONG nStyle ) const
// -----------------------------------------------------------------------
-BOOL StyleSettings::GetUseImagesInMenus() const
+sal_Bool StyleSettings::GetUseImagesInMenus() const
{
// icon mode selected in Tools -> Options... -> OpenOffice.org -> View
- USHORT nStyle = mpData->mnUseImagesInMenus;
+ sal_uInt16 nStyle = mpData->mnUseImagesInMenus;
if ( nStyle == STYLE_MENUIMAGES_AUTO )
return GetPreferredUseImagesInMenus();
- return (BOOL)nStyle;
+ return (sal_Bool)nStyle;
}
// -----------------------------------------------------------------------
@@ -892,40 +881,12 @@ void StyleSettings::SetStandardStyles()
// -----------------------------------------------------------------------
-void StyleSettings::SetStandardWinStyles()
-{
- return; // no more style changes since NWF
-}
-
-// -----------------------------------------------------------------------
-
-void StyleSettings::SetStandardOS2Styles()
-{
- return; // no more style changes since NWF
-}
-
-// -----------------------------------------------------------------------
-
-void StyleSettings::SetStandardMacStyles()
-{
- return; // no more style changes since NWF
-}
-
-// -----------------------------------------------------------------------
-
-void StyleSettings::SetStandardUnixStyles()
-{
- return; // no more style changes since NWF
-}
-
-// -----------------------------------------------------------------------
-
Color StyleSettings::GetFaceGradientColor() const
{
// compute a brighter face color that can be used in gradients
// for a convex look (eg toolbars)
- USHORT h, s, b;
+ sal_uInt16 h, s, b;
GetFaceColor().RGBtoHSB( h, s, b );
if( s > 1) s=1;
if( b < 98) b=98;
@@ -937,7 +898,7 @@ Color StyleSettings::GetFaceGradientColor() const
Color StyleSettings::GetSeparatorColor() const
{
// compute a brighter shadow color for separators (used in toolbars or between menubar and toolbars on Windows XP)
- USHORT h, s, b;
+ sal_uInt16 h, s, b;
GetShadowColor().RGBtoHSB( h, s, b );
b += b/4;
s -= s/4;
@@ -978,15 +939,15 @@ void StyleSettings::CopyData()
// -----------------------------------------------------------------------
-inline BOOL ImplIsBackOrWhite( const Color& rColor )
+inline sal_Bool ImplIsBackOrWhite( const Color& rColor )
{
- UINT8 nLuminance = rColor.GetLuminance();
+ sal_uInt8 nLuminance = rColor.GetLuminance();
return ( nLuminance < 8 ) || ( nLuminance > 250 );
}
-BOOL StyleSettings::IsHighContrastBlackAndWhite() const
+sal_Bool StyleSettings::IsHighContrastBlackAndWhite() const
{
- BOOL bBWOnly = TRUE;
+ sal_Bool bBWOnly = sal_True;
// Only use B&W if fully B&W, like on GNOME.
// Some colors like CheckedColor and HighlightColor are not B&W in Windows Standard HC Black,
@@ -995,41 +956,41 @@ BOOL StyleSettings::IsHighContrastBlackAndWhite() const
// Unfortunately, GNOME uses a very very dark color (0x000033) instead of BLACK (0x000000)
if ( !ImplIsBackOrWhite( GetFaceColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetHighlightTextColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetWindowColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetWindowTextColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetButtonTextColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetButtonTextColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetGroupTextColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetLabelTextColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetDialogColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetFieldColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetMenuColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetMenuBarColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetMenuHighlightColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
return bBWOnly;
}
// -----------------------------------------------------------------------
-BOOL StyleSettings::operator ==( const StyleSettings& rSet ) const
+sal_Bool StyleSettings::operator ==( const StyleSettings& rSet ) const
{
if ( mpData == rSet.mpData )
- return TRUE;
+ return sal_True;
if ( (mpData->mnOptions == rSet.mpData->mnOptions) &&
(mpData->mnAutoMnemonic == rSet.mpData->mnAutoMnemonic) &&
@@ -1054,14 +1015,12 @@ BOOL StyleSettings::operator ==( const StyleSettings& rSet ) const
(mpData->mnAntialiasedMin == rSet.mpData->mnAntialiasedMin) &&
(mpData->mnScreenZoom == rSet.mpData->mnScreenZoom) &&
(mpData->mnScreenFontZoom == rSet.mpData->mnScreenFontZoom) &&
- (mpData->mnRadioButtonStyle == rSet.mpData->mnRadioButtonStyle) &&
- (mpData->mnCheckBoxStyle == rSet.mpData->mnCheckBoxStyle) &&
- (mpData->mnPushButtonStyle == rSet.mpData->mnPushButtonStyle) &&
- (mpData->mnTabControlStyle == rSet.mpData->mnTabControlStyle) &&
(mpData->mnHighContrast == rSet.mpData->mnHighContrast) &&
(mpData->mnUseSystemUIFonts == rSet.mpData->mnUseSystemUIFonts) &&
(mpData->mnUseFlatBorders == rSet.mpData->mnUseFlatBorders) &&
(mpData->mnUseFlatMenues == rSet.mpData->mnUseFlatMenues) &&
+ (mpData->mnSymbolsStyle == rSet.mpData->mnSymbolsStyle) &&
+ (mpData->mnPreferredSymbolsStyle == rSet.mpData->mnPreferredSymbolsStyle) &&
(mpData->maFaceColor == rSet.mpData->maFaceColor) &&
(mpData->maCheckedColor == rSet.mpData->maCheckedColor) &&
(mpData->maLightColor == rSet.mpData->maLightColor) &&
@@ -1123,9 +1082,9 @@ BOOL StyleSettings::operator ==( const StyleSettings& rSet ) const
(mpData->mbPreferredUseImagesInMenus == rSet.mpData->mbPreferredUseImagesInMenus) &&
(mpData->mnSkipDisabledInMenus == rSet.mpData->mnSkipDisabledInMenus) &&
(mpData->maFontColor == rSet.mpData->maFontColor ))
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// =======================================================================
@@ -1133,10 +1092,10 @@ BOOL StyleSettings::operator ==( const StyleSettings& rSet ) const
ImplMiscData::ImplMiscData()
{
mnRefCount = 1;
- mnEnableATT = sal::static_int_cast<USHORT>(~0U);
- mnDisablePrinting = sal::static_int_cast<USHORT>(~0U);
+ mnEnableATT = sal::static_int_cast<sal_uInt16>(~0U);
+ mnDisablePrinting = sal::static_int_cast<sal_uInt16>(~0U);
static const char* pEnv = getenv("SAL_DECIMALSEP_ENABLED" ); // set default without UI
- mbEnableLocalizedDecimalSep = (pEnv != NULL) ? TRUE : FALSE;
+ mbEnableLocalizedDecimalSep = (pEnv != NULL) ? sal_True : sal_False;
}
// -----------------------------------------------------------------------
@@ -1212,24 +1171,24 @@ void MiscSettings::CopyData()
// -----------------------------------------------------------------------
-BOOL MiscSettings::operator ==( const MiscSettings& rSet ) const
+sal_Bool MiscSettings::operator ==( const MiscSettings& rSet ) const
{
if ( mpData == rSet.mpData )
- return TRUE;
+ return sal_True;
if ( (mpData->mnEnableATT == rSet.mpData->mnEnableATT ) &&
(mpData->mnDisablePrinting == rSet.mpData->mnDisablePrinting ) &&
(mpData->mbEnableLocalizedDecimalSep == rSet.mpData->mbEnableLocalizedDecimalSep ) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL MiscSettings::GetDisablePrinting() const
+sal_Bool MiscSettings::GetDisablePrinting() const
{
- if( mpData->mnDisablePrinting == (USHORT)~0 )
+ if( mpData->mnDisablePrinting == (sal_uInt16)~0 )
{
rtl::OUString aEnable =
vcl::SettingsConfigItem::get()->
@@ -1238,15 +1197,15 @@ BOOL MiscSettings::GetDisablePrinting() const
mpData->mnDisablePrinting = aEnable.equalsIgnoreAsciiCaseAscii( "true" ) ? 1 : 0;
}
- return (BOOL)mpData->mnDisablePrinting;
+ return (sal_Bool)mpData->mnDisablePrinting;
}
// -----------------------------------------------------------------------
-BOOL MiscSettings::GetEnableATToolSupport() const
+sal_Bool MiscSettings::GetEnableATToolSupport() const
{
#ifdef WNT
- if( mpData->mnEnableATT == (USHORT)~0 )
+ if( mpData->mnEnableATT == (sal_uInt16)~0 )
{
// Check in the Windows registry if an AT tool wants Accessibility support to
// be activated ..
@@ -1257,7 +1216,7 @@ BOOL MiscSettings::GetEnableATToolSupport() const
&hkey) )
{
DWORD dwType;
- WIN_BYTE Data[6]; // possible values: "true", "false", "1", "0", DWORD
+ sal_uInt8 Data[6]; // possible values: "true", "false", "1", "0", DWORD
DWORD cbData = sizeof(Data);
if( ERROR_SUCCESS == RegQueryValueEx(hkey, "SupportAssistiveTechnology",
@@ -1269,7 +1228,7 @@ BOOL MiscSettings::GetEnableATToolSupport() const
mpData->mnEnableATT = ((0 == stricmp((const char *) Data, "1")) || (0 == stricmp((const char *) Data, "true")));
break;
case REG_DWORD:
- mpData->mnEnableATT = (USHORT) (((DWORD *) Data)[0]);
+ mpData->mnEnableATT = (sal_uInt16) (((DWORD *) Data)[0]);
break;
default:
// Unsupported registry type
@@ -1282,7 +1241,7 @@ BOOL MiscSettings::GetEnableATToolSupport() const
}
#endif
- if( mpData->mnEnableATT == (USHORT)~0 )
+ if( mpData->mnEnableATT == (sal_uInt16)~0 )
{
static const char* pEnv = getenv("SAL_ACCESSIBILITY_ENABLED" );
if( !pEnv || !*pEnv )
@@ -1299,12 +1258,12 @@ BOOL MiscSettings::GetEnableATToolSupport() const
}
}
- return (BOOL)mpData->mnEnableATT;
+ return (sal_Bool)mpData->mnEnableATT;
}
// -----------------------------------------------------------------------
-void MiscSettings::SetDisablePrinting( BOOL bEnable )
+void MiscSettings::SetDisablePrinting( sal_Bool bEnable )
{
if ( bEnable != mpData->mnDisablePrinting )
{
@@ -1318,11 +1277,11 @@ void MiscSettings::SetDisablePrinting( BOOL bEnable )
// -----------------------------------------------------------------------
-void MiscSettings::SetEnableATToolSupport( BOOL bEnable )
+void MiscSettings::SetEnableATToolSupport( sal_Bool bEnable )
{
if ( bEnable != mpData->mnEnableATT )
{
- BOOL bDummy;
+ sal_Bool bDummy;
if( bEnable && !ImplInitAccessBridge(false, bDummy) )
return;
@@ -1335,7 +1294,7 @@ void MiscSettings::SetEnableATToolSupport( BOOL bEnable )
&hkey) )
{
DWORD dwType;
- WIN_BYTE Data[6]; // possible values: "true", "false", 1, 0
+ sal_uInt8 Data[6]; // possible values: "true", "false", 1, 0
DWORD cbData = sizeof(Data);
if( ERROR_SUCCESS == RegQueryValueEx(hkey, "SupportAssistiveTechnology",
@@ -1346,7 +1305,7 @@ void MiscSettings::SetEnableATToolSupport( BOOL bEnable )
case REG_SZ:
RegSetValueEx(hkey, "SupportAssistiveTechnology",
NULL, dwType,
- bEnable ? (WIN_BYTE *) "true" : (WIN_BYTE *) "false",
+ bEnable ? (sal_uInt8 *) "true" : (sal_uInt8 *) "false",
bEnable ? sizeof("true") : sizeof("false"));
break;
case REG_DWORD:
@@ -1372,13 +1331,13 @@ void MiscSettings::SetEnableATToolSupport( BOOL bEnable )
}
}
-void MiscSettings::SetEnableLocalizedDecimalSep( BOOL bEnable )
+void MiscSettings::SetEnableLocalizedDecimalSep( sal_Bool bEnable )
{
CopyData();
mpData->mbEnableLocalizedDecimalSep = bEnable;
}
-BOOL MiscSettings::GetEnableLocalizedDecimalSep() const
+sal_Bool MiscSettings::GetEnableLocalizedDecimalSep() const
{
return mpData->mbEnableLocalizedDecimalSep;
}
@@ -1462,15 +1421,15 @@ void NotificationSettings::CopyData()
// -----------------------------------------------------------------------
-BOOL NotificationSettings::operator ==( const NotificationSettings& rSet ) const
+sal_Bool NotificationSettings::operator ==( const NotificationSettings& rSet ) const
{
if ( mpData == rSet.mpData )
- return TRUE;
+ return sal_True;
if ( (mpData->mnOptions == rSet.mpData->mnOptions) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// =======================================================================
@@ -1558,18 +1517,18 @@ void HelpSettings::CopyData()
// -----------------------------------------------------------------------
-BOOL HelpSettings::operator ==( const HelpSettings& rSet ) const
+sal_Bool HelpSettings::operator ==( const HelpSettings& rSet ) const
{
if ( mpData == rSet.mpData )
- return TRUE;
+ return sal_True;
if ( (mpData->mnOptions == rSet.mpData->mnOptions ) &&
(mpData->mnTipDelay == rSet.mpData->mnTipDelay ) &&
(mpData->mnTipTimeout == rSet.mpData->mnTipTimeout ) &&
(mpData->mnBalloonDelay == rSet.mpData->mnBalloonDelay ) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// =======================================================================
@@ -1698,12 +1657,12 @@ void AllSettings::CopyData()
// -----------------------------------------------------------------------
-ULONG AllSettings::Update( ULONG nFlags, const AllSettings& rSet )
+sal_uLong AllSettings::Update( sal_uLong nFlags, const AllSettings& rSet )
{
DBG_CHKTHIS( AllSettings, NULL );
DBG_CHKOBJ( &rSet, AllSettings, NULL );
- ULONG nChangeFlags = 0;
+ sal_uLong nChangeFlags = 0;
if ( nFlags & SETTINGS_MACHINE )
{
@@ -1800,12 +1759,12 @@ ULONG AllSettings::Update( ULONG nFlags, const AllSettings& rSet )
// -----------------------------------------------------------------------
-ULONG AllSettings::GetChangeFlags( const AllSettings& rSet ) const
+sal_uLong AllSettings::GetChangeFlags( const AllSettings& rSet ) const
{
DBG_CHKTHIS( AllSettings, NULL );
DBG_CHKOBJ( &rSet, AllSettings, NULL );
- ULONG nChangeFlags = 0;
+ sal_uLong nChangeFlags = 0;
if ( mpData->maMachineSettings != rSet.mpData->maMachineSettings )
nChangeFlags |= SETTINGS_MACHINE;
@@ -1836,13 +1795,13 @@ ULONG AllSettings::GetChangeFlags( const AllSettings& rSet ) const
// -----------------------------------------------------------------------
-BOOL AllSettings::operator ==( const AllSettings& rSet ) const
+sal_Bool AllSettings::operator ==( const AllSettings& rSet ) const
{
DBG_CHKTHIS( AllSettings, NULL );
DBG_CHKOBJ( &rSet, AllSettings, NULL );
if ( mpData == rSet.mpData )
- return TRUE;
+ return sal_True;
if ( (mpData->maMachineSettings == rSet.mpData->maMachineSettings) &&
(mpData->maMouseSettings == rSet.mpData->maMouseSettings) &&
@@ -1855,10 +1814,10 @@ BOOL AllSettings::operator ==( const AllSettings& rSet ) const
(mpData->maLocale == rSet.mpData->maLocale) &&
(mpData->mnWindowUpdate == rSet.mpData->mnWindowUpdate) )
{
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -1924,7 +1883,7 @@ void AllSettings::SetUILanguage( LanguageType )
// -----------------------------------------------------------------------
-BOOL AllSettings::GetLayoutRTL() const
+sal_Bool AllSettings::GetLayoutRTL() const
{
static const char* pEnv = getenv("SAL_RTL_ENABLED" );
static int nUIMirroring = -1; // -1: undef, 0: auto, 1: on 2: off
@@ -1933,7 +1892,7 @@ BOOL AllSettings::GetLayoutRTL() const
if( pEnv )
return true;
- BOOL bRTL = FALSE;
+ sal_Bool bRTL = sal_False;
if( nUIMirroring == -1 )
{
@@ -1943,7 +1902,7 @@ BOOL AllSettings::GetLayoutRTL() const
OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common/I18N/CTL")) ); // note: case sensisitive !
if ( aNode.isValid() )
{
- BOOL bTmp = BOOL();
+ sal_Bool bTmp = sal_Bool();
::com::sun::star::uno::Any aValue = aNode.getNodeValue( OUString(RTL_CONSTASCII_USTRINGPARAM("UIMirroring")) );
if( aValue >>= bTmp )
{
@@ -2053,7 +2012,7 @@ void AllSettings::LocaleSettingsChanged( sal_uInt32 nHint )
if ( nHint & SYSLOCALEOPTIONS_HINT_DECSEP )
{
MiscSettings aMiscSettings = aAllSettings.GetMiscSettings();
- BOOL bIsDecSepAsLocale = aAllSettings.mpData->maSysLocale.GetOptions().IsDecimalSeparatorAsLocale();
+ sal_Bool bIsDecSepAsLocale = aAllSettings.mpData->maSysLocale.GetOptions().IsDecimalSeparatorAsLocale();
if ( aMiscSettings.GetEnableLocalizedDecimalSep() != bIsDecSepAsLocale )
{
aMiscSettings.SetEnableLocalizedDecimalSep( bIsDecSepAsLocale );
diff --git a/vcl/source/app/sound.cxx b/vcl/source/app/sound.cxx
index cae4991b3f18..13f832339977 100644
--- a/vcl/source/app/sound.cxx
+++ b/vcl/source/app/sound.cxx
@@ -35,6 +35,7 @@
#include <vcl/salframe.hxx>
#include <tools/debug.hxx>
#include <vcl/svdata.hxx>
+#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
#include <vcl/salbtype.hxx>
#include <vcl/sound.hxx>
@@ -42,6 +43,10 @@
void Sound::Beep( SoundType eType, Window* pWindow )
{
+ // #i91990#
+ if ( Application::IsHeadlessModeEnabled() )
+ return;
+
if( !pWindow )
{
Window* pDefWindow = ImplGetDefaultWindow();
diff --git a/vcl/source/app/stdtext.cxx b/vcl/source/app/stdtext.cxx
index 22b51d8afef5..3fc2e67cc488 100644
--- a/vcl/source/app/stdtext.cxx
+++ b/vcl/source/app/stdtext.cxx
@@ -38,7 +38,7 @@
// =======================================================================
-XubString GetStandardText( USHORT nStdText )
+XubString GetStandardText( sal_uInt16 nStdText )
{
ResMgr* pResMgr = ImplGetResMgr();
XubString aText;
@@ -50,7 +50,7 @@ XubString GetStandardText( USHORT nStdText )
// =======================================================================
void ShowServiceNotAvailableError( Window* pParent,
- const XubString& rServiceName, BOOL bError )
+ const XubString& rServiceName, sal_Bool bError )
{
XubString aText( GetStandardText( STANDARD_TEXT_SERVICE_NOT_AVAILABLE ) );
aText.SearchAndReplaceAscii( "%s", rServiceName );
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 46a32b699650..e4cf7bf32330 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -44,7 +44,6 @@
#include "vcl/event.hxx"
#include "vcl/vclevent.hxx"
#include "vcl/virdev.hxx"
-#include "vcl/windata.hxx"
#include "vcl/window.h"
#include "vcl/wrkwin.hxx"
#include "vcl/idlemgr.hxx"
@@ -82,12 +81,12 @@ using namespace ::com::sun::star::uno;
class ImplReservedKey
{
public:
- ImplReservedKey( KeyCode aKeyCode, USHORT nResId ) :
+ ImplReservedKey( KeyCode aKeyCode, sal_uInt16 nResId ) :
mKeyCode(aKeyCode), mnResId( nResId)
{}
KeyCode mKeyCode;
- USHORT mnResId;
+ sal_uInt16 mnResId;
};
typedef std::pair<ImplReservedKey*, size_t> ReservedKeys;
@@ -183,16 +182,16 @@ struct ImplEventHook
struct ImplPostEventData
{
- ULONG mnEvent;
+ sal_uLong mnEvent;
const Window* mpWin;
- ULONG mnEventId;
+ sal_uLong mnEventId;
KeyEvent maKeyEvent;
MouseEvent maMouseEvent;
- ImplPostEventData( ULONG nEvent, const Window* pWin, const KeyEvent& rKeyEvent ) :
+ ImplPostEventData( sal_uLong nEvent, const Window* pWin, const KeyEvent& rKeyEvent ) :
mnEvent( nEvent ), mpWin( pWin ), mnEventId( 0 ), maKeyEvent( rKeyEvent ) {}
- ImplPostEventData( ULONG nEvent, const Window* pWin, const MouseEvent& rMouseEvent ) :
+ ImplPostEventData( sal_uLong nEvent, const Window* pWin, const MouseEvent& rMouseEvent ) :
mnEvent( nEvent ), mpWin( pWin ), mnEventId( 0 ), maMouseEvent( rMouseEvent ) {}
~ImplPostEventData() {}
@@ -241,7 +240,7 @@ void Application::InitAppRes( const ResId& )
// -----------------------------------------------------------------------
-BOOL Application::QueryExit()
+sal_Bool Application::QueryExit()
{
WorkWindow* pAppWin = ImplGetSVData()->maWinData.mpAppWin;
@@ -249,12 +248,12 @@ BOOL Application::QueryExit()
if ( pAppWin )
return pAppWin->Close();
else
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-void Application::UserEvent( ULONG, void* )
+void Application::UserEvent( sal_uLong, void* )
{
}
@@ -319,7 +318,7 @@ sal_uInt16 Application::GetCommandLineParamCount()
// -----------------------------------------------------------------------
-XubString Application::GetCommandLineParam( USHORT nParam )
+XubString Application::GetCommandLineParam( sal_uInt16 nParam )
{
rtl::OUString aParam;
osl_getCommandArg( nParam, &aParam.pData );
@@ -356,7 +355,7 @@ const XubString& Application::GetAppFileName()
// -----------------------------------------------------------------------
-USHORT Application::Exception( USHORT nError )
+sal_uInt16 Application::Exception( sal_uInt16 nError )
{
switch ( nError & EXC_MAJORTYPE )
{
@@ -398,12 +397,12 @@ void Application::Abort( const XubString& rErrorText )
// -----------------------------------------------------------------------
-ULONG Application::GetReservedKeyCodeCount()
+sal_uLong Application::GetReservedKeyCodeCount()
{
return ImplReservedKeys::get()->second;
}
-const KeyCode* Application::GetReservedKeyCode( ULONG i )
+const KeyCode* Application::GetReservedKeyCode( sal_uLong i )
{
if( i >= GetReservedKeyCodeCount() )
return NULL;
@@ -411,7 +410,7 @@ const KeyCode* Application::GetReservedKeyCode( ULONG i )
return &ImplReservedKeys::get()->first[i].mKeyCode;
}
-String Application::GetReservedKeyCodeDescription( ULONG i )
+String Application::GetReservedKeyCodeDescription( sal_uLong i )
{
ResMgr* pResMgr = ImplGetResMgr();
if( ! pResMgr )
@@ -430,12 +429,12 @@ void Application::Execute()
DBG_STARTAPPEXECUTE();
ImplSVData* pSVData = ImplGetSVData();
- pSVData->maAppData.mbInAppExecute = TRUE;
+ pSVData->maAppData.mbInAppExecute = sal_True;
while ( !pSVData->maAppData.mbAppQuit )
Application::Yield();
- pSVData->maAppData.mbInAppExecute = FALSE;
+ pSVData->maAppData.mbInAppExecute = sal_False;
DBG_ENDAPPEXECUTE();
}
@@ -497,7 +496,7 @@ void Application::Yield( bool i_bAllEvents )
IMPL_STATIC_LINK_NOINSTANCE( ImplSVAppData, ImplQuitMsg, void*, EMPTYARG )
{
- ImplGetSVData()->maAppData.mbAppQuit = TRUE;
+ ImplGetSVData()->maAppData.mbAppQuit = sal_True;
return 0;
}
@@ -525,7 +524,7 @@ oslThreadIdentifier Application::GetMainThreadIdentifier()
// -----------------------------------------------------------------------
-ULONG Application::ReleaseSolarMutex()
+sal_uLong Application::ReleaseSolarMutex()
{
ImplSVData* pSVData = ImplGetSVData();
return pSVData->mpDefInst->ReleaseYieldMutex();
@@ -533,7 +532,7 @@ ULONG Application::ReleaseSolarMutex()
// -----------------------------------------------------------------------
-void Application::AcquireSolarMutex( ULONG nCount )
+void Application::AcquireSolarMutex( sal_uLong nCount )
{
ImplSVData* pSVData = ImplGetSVData();
pSVData->mpDefInst->AcquireYieldMutex( nCount );
@@ -541,56 +540,56 @@ void Application::AcquireSolarMutex( ULONG nCount )
// -----------------------------------------------------------------------
-BOOL Application::IsInMain()
+sal_Bool Application::IsInMain()
{
return ImplGetSVData()->maAppData.mbInAppMain;
}
// -----------------------------------------------------------------------
-BOOL Application::IsInExecute()
+sal_Bool Application::IsInExecute()
{
return ImplGetSVData()->maAppData.mbInAppExecute;
}
// -----------------------------------------------------------------------
-BOOL Application::IsShutDown()
+sal_Bool Application::IsShutDown()
{
return ImplGetSVData()->maAppData.mbAppQuit;
}
// -----------------------------------------------------------------------
-BOOL Application::IsInModalMode()
+sal_Bool Application::IsInModalMode()
{
return (ImplGetSVData()->maAppData.mnModalMode != 0);
}
// -----------------------------------------------------------------------
-USHORT Application::GetModalModeCount()
+sal_uInt16 Application::GetModalModeCount()
{
return ImplGetSVData()->maAppData.mnModalMode;
}
// -----------------------------------------------------------------------
-USHORT Application::GetDispatchLevel()
+sal_uInt16 Application::GetDispatchLevel()
{
return ImplGetSVData()->maAppData.mnDispatchLevel;
}
// -----------------------------------------------------------------------
-BOOL Application::AnyInput( USHORT nType )
+sal_Bool Application::AnyInput( sal_uInt16 nType )
{
- return (BOOL)ImplGetSVData()->mpDefInst->AnyInput( nType );
+ return (sal_Bool)ImplGetSVData()->mpDefInst->AnyInput( nType );
}
// -----------------------------------------------------------------------
-ULONG Application::GetLastInputInterval()
+sal_uLong Application::GetLastInputInterval()
{
return (Time::GetSystemTicks()-ImplGetSVData()->maAppData.mnLastInputTime);
}
@@ -599,7 +598,7 @@ ULONG Application::GetLastInputInterval()
extern int nImplSysDialog;
-BOOL Application::IsUICaptured()
+sal_Bool Application::IsUICaptured()
{
ImplSVData* pSVData = ImplGetSVData();
// Wenn Mouse gecaptured, oder im TrackingModus oder im Auswahlmodus
@@ -608,37 +607,37 @@ BOOL Application::IsUICaptured()
// D&D aktive !!!
if ( pSVData->maWinData.mpCaptureWin || pSVData->maWinData.mpTrackWin ||
pSVData->maWinData.mpFirstFloat || nImplSysDialog )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Application::IsUserActive( USHORT nTest )
+sal_Bool Application::IsUserActive( sal_uInt16 nTest )
{
if ( nTest & (USERACTIVE_MOUSEDRAG | USERACTIVE_INPUT) )
{
if ( IsUICaptured() )
- return TRUE;
+ return sal_True;
}
if ( nTest & USERACTIVE_INPUT )
{
if ( GetLastInputInterval() < 500 )
- return TRUE;
+ return sal_True;
if ( AnyInput( INPUT_KEYBOARD ) )
- return TRUE;
+ return sal_True;
}
if ( nTest & USERACTIVE_MODALDIALOG )
{
if ( ImplGetSVData()->maAppData.mnModalDialog )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -662,10 +661,10 @@ void Application::MergeSystemSettings( AllSettings& rSettings )
{
// side effect: ImplUpdateGlobalSettings does an ImplGetFrame()->UpdateSettings
pWindow->ImplUpdateGlobalSettings( *pSVData->maAppData.mpSettings );
- pSVData->maAppData.mbSettingsInit = TRUE;
+ pSVData->maAppData.mbSettingsInit = sal_True;
}
// side effect: ImplUpdateGlobalSettings does an ImplGetFrame()->UpdateSettings
- pWindow->ImplUpdateGlobalSettings( rSettings, FALSE );
+ pWindow->ImplUpdateGlobalSettings( rSettings, sal_False );
}
}
@@ -707,7 +706,7 @@ void Application::SetSettings( const AllSettings& rSettings )
}
ResMgr::SetDefaultLocale( rSettings.GetUILocale() );
*pSVData->maAppData.mpSettings = rSettings;
- ULONG nChangeFlags = aOldSettings.GetChangeFlags( *pSVData->maAppData.mpSettings );
+ sal_uLong nChangeFlags = aOldSettings.GetChangeFlags( *pSVData->maAppData.mpSettings );
if ( nChangeFlags )
{
DataChangedEvent aDCEvt( DATACHANGED_SETTINGS, &aOldSettings, nChangeFlags );
@@ -738,7 +737,7 @@ void Application::SetSettings( const AllSettings& rSettings )
Window* pClientWin = pFrame;
while ( pClientWin->ImplGetClientWindow() )
pClientWin = pClientWin->ImplGetClientWindow();
- pClientWin->UpdateSettings( rSettings, TRUE );
+ pClientWin->UpdateSettings( rSettings, sal_True );
Window* pTempWin = pFrame->mpWindowImpl->mpFrameData->mpFirstOverlap;
while ( pTempWin )
@@ -748,7 +747,7 @@ void Application::SetSettings( const AllSettings& rSettings )
pClientWin = pTempWin;
while ( pClientWin->ImplGetClientWindow() )
pClientWin = pClientWin->ImplGetClientWindow();
- pClientWin->UpdateSettings( rSettings, TRUE );
+ pClientWin->UpdateSettings( rSettings, sal_True );
pTempWin = pTempWin->mpWindowImpl->mpNextOverlap;
}
@@ -827,7 +826,7 @@ void Application::NotifyAllWindows( DataChangedEvent& rDCEvt )
// -----------------------------------------------------------------------
-void Application::ImplCallEventListeners( ULONG nEvent, Window *pWin, void* pData )
+void Application::ImplCallEventListeners( sal_uLong nEvent, Window *pWin, void* pData )
{
ImplSVData* pSVData = ImplGetSVData();
VclWindowEvent aEvent( pWin, nEvent, pData );
@@ -885,13 +884,13 @@ void Application::RemoveKeyListener( const Link& rKeyListener )
// -----------------------------------------------------------------------
-BOOL Application::HandleKey( ULONG nEvent, Window *pWin, KeyEvent* pKeyEvent )
+sal_Bool Application::HandleKey( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent )
{
// let listeners process the key event
VclWindowEvent aEvent( pWin, nEvent, (void *) pKeyEvent );
ImplSVData* pSVData = ImplGetSVData();
- BOOL bProcessed = FALSE;
+ sal_Bool bProcessed = sal_False;
if ( pSVData->maAppData.mpKeyListeners )
bProcessed = pSVData->maAppData.mpKeyListeners->Process( &aEvent );
@@ -901,10 +900,10 @@ BOOL Application::HandleKey( ULONG nEvent, Window *pWin, KeyEvent* pKeyEvent )
// -----------------------------------------------------------------------------
-ULONG Application::PostKeyEvent( ULONG nEvent, Window *pWin, KeyEvent* pKeyEvent )
+sal_uLong Application::PostKeyEvent( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent )
{
const SolarMutexGuard aGuard;
- ULONG nEventId = 0;
+ sal_uLong nEventId = 0;
if( pWin && pKeyEvent )
{
@@ -928,10 +927,10 @@ ULONG Application::PostKeyEvent( ULONG nEvent, Window *pWin, KeyEvent* pKeyEvent
// -----------------------------------------------------------------------------
-ULONG Application::PostMouseEvent( ULONG nEvent, Window *pWin, MouseEvent* pMouseEvent )
+sal_uLong Application::PostMouseEvent( sal_uLong nEvent, Window *pWin, MouseEvent* pMouseEvent )
{
const SolarMutexGuard aGuard;
- ULONG nEventId = 0;
+ sal_uLong nEventId = 0;
if( pWin && pMouseEvent )
{
@@ -968,8 +967,8 @@ IMPL_STATIC_LINK_NOINSTANCE( Application, PostEventHandler, void*, pCallData )
const SolarMutexGuard aGuard;
ImplPostEventData* pData = static_cast< ImplPostEventData * >( pCallData );
const void* pEventData;
- ULONG nEvent;
- const ULONG nEventId = pData->mnEventId;
+ sal_uLong nEvent;
+ const sal_uLong nEventId = pData->mnEventId;
switch( pData->mnEvent )
{
@@ -1005,7 +1004,7 @@ IMPL_STATIC_LINK_NOINSTANCE( Application, PostEventHandler, void*, pCallData )
};
if( pData->mpWin && pData->mpWin->mpWindowImpl->mpFrameWindow && pEventData )
- ImplWindowFrameProc( pData->mpWin->mpWindowImpl->mpFrameWindow, NULL, (USHORT) nEvent, pEventData );
+ ImplWindowFrameProc( pData->mpWin->mpWindowImpl->mpFrameWindow, NULL, (sal_uInt16) nEvent, pEventData );
// remove this event from list of posted events, watch for destruction of internal data
::std::list< ImplPostEventPair >::iterator aIter( aPostedEventList.begin() );
@@ -1050,7 +1049,7 @@ void Application::RemoveMouseAndKeyEvents( Window* pWin )
// -----------------------------------------------------------------------
-BOOL Application::IsProcessedMouseOrKeyEvent( ULONG nEventId )
+sal_Bool Application::IsProcessedMouseOrKeyEvent( sal_uLong nEventId )
{
const SolarMutexGuard aGuard;
@@ -1060,79 +1059,79 @@ BOOL Application::IsProcessedMouseOrKeyEvent( ULONG nEventId )
while( aIter != aPostedEventList.end() )
{
if( (*aIter).second->mnEventId == nEventId )
- return FALSE;
+ return sal_False;
else
++aIter;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-ULONG Application::PostUserEvent( ULONG nEvent, void* pEventData )
+sal_uLong Application::PostUserEvent( sal_uLong nEvent, void* pEventData )
{
- ULONG nEventId;
+ sal_uLong nEventId;
PostUserEvent( nEventId, nEvent, pEventData );
return nEventId;
}
// -----------------------------------------------------------------------
-ULONG Application::PostUserEvent( const Link& rLink, void* pCaller )
+sal_uLong Application::PostUserEvent( const Link& rLink, void* pCaller )
{
- ULONG nEventId;
+ sal_uLong nEventId;
PostUserEvent( nEventId, rLink, pCaller );
return nEventId;
}
// -----------------------------------------------------------------------
-BOOL Application::PostUserEvent( ULONG& rEventId, ULONG nEvent, void* pEventData )
+sal_Bool Application::PostUserEvent( sal_uLong& rEventId, sal_uLong nEvent, void* pEventData )
{
ImplSVEvent* pSVEvent = new ImplSVEvent;
pSVEvent->mnEvent = nEvent;
pSVEvent->mpData = pEventData;
pSVEvent->mpLink = NULL;
pSVEvent->mpWindow = NULL;
- pSVEvent->mbCall = TRUE;
- rEventId = (ULONG)pSVEvent;
+ pSVEvent->mbCall = sal_True;
+ rEventId = (sal_uLong)pSVEvent;
Window* pDefWindow = ImplGetDefaultWindow();
if ( pDefWindow && pDefWindow->ImplGetFrame()->PostEvent( pSVEvent ) )
- return TRUE;
+ return sal_True;
else
{
rEventId = 0;
delete pSVEvent;
- return FALSE;
+ return sal_False;
}
}
// -----------------------------------------------------------------------
-BOOL Application::PostUserEvent( ULONG& rEventId, const Link& rLink, void* pCaller )
+sal_Bool Application::PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller )
{
ImplSVEvent* pSVEvent = new ImplSVEvent;
pSVEvent->mnEvent = 0;
pSVEvent->mpData = pCaller;
pSVEvent->mpLink = new Link( rLink );
pSVEvent->mpWindow = NULL;
- pSVEvent->mbCall = TRUE;
- rEventId = (ULONG)pSVEvent;
+ pSVEvent->mbCall = sal_True;
+ rEventId = (sal_uLong)pSVEvent;
Window* pDefWindow = ImplGetDefaultWindow();
if ( pDefWindow && pDefWindow->ImplGetFrame()->PostEvent( pSVEvent ) )
- return TRUE;
+ return sal_True;
else
{
rEventId = 0;
delete pSVEvent;
- return FALSE;
+ return sal_False;
}
}
// -----------------------------------------------------------------------
-void Application::RemoveUserEvent( ULONG nUserEvent )
+void Application::RemoveUserEvent( sal_uLong nUserEvent )
{
if(nUserEvent)
{
@@ -1150,13 +1149,13 @@ void Application::RemoveUserEvent( ULONG nUserEvent )
pSVEvent->mpWindow = NULL;
}
- pSVEvent->mbCall = FALSE;
+ pSVEvent->mbCall = sal_False;
}
}
// -----------------------------------------------------------------------
-BOOL Application::InsertIdleHdl( const Link& rLink, USHORT nPrio )
+sal_Bool Application::InsertIdleHdl( const Link& rLink, sal_uInt16 nPrio )
{
ImplSVData* pSVData = ImplGetSVData();
@@ -1438,7 +1437,7 @@ unsigned int Application::GetBestScreen( const Rectangle& i_rRect )
// -----------------------------------------------------------------------
-BOOL Application::InsertAccel( Accelerator* pAccel )
+sal_Bool Application::InsertAccel( Accelerator* pAccel )
{
ImplSVData* pSVData = ImplGetSVData();
@@ -1469,17 +1468,17 @@ void Application::FlushAccel()
// -----------------------------------------------------------------------
-BOOL Application::CallAccel( const KeyCode& rKeyCode, USHORT nRepeat )
+sal_Bool Application::CallAccel( const KeyCode& rKeyCode, sal_uInt16 nRepeat )
{
ImplSVData* pSVData = ImplGetSVData();
if ( pSVData->maAppData.mpAccelMgr )
{
if ( pSVData->maAppData.mpAccelMgr->IsAccelKey( rKeyCode, nRepeat ) )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -1498,21 +1497,21 @@ Help* Application::GetHelp()
// -----------------------------------------------------------------------
-void Application::EnableAutoHelpId( BOOL bEnabled )
+void Application::EnableAutoHelpId( sal_Bool bEnabled )
{
ImplGetSVData()->maHelpData.mbAutoHelpId = bEnabled;
}
// -----------------------------------------------------------------------
-BOOL Application::IsAutoHelpIdEnabled()
+sal_Bool Application::IsAutoHelpIdEnabled()
{
return ImplGetSVData()->maHelpData.mbAutoHelpId;
}
// -----------------------------------------------------------------------
-void Application::EnableAutoMnemonic( BOOL bEnabled )
+void Application::EnableAutoMnemonic( sal_Bool bEnabled )
{
AllSettings aSettings = GetSettings();
StyleSettings aStyle = aSettings.GetStyleSettings();
@@ -1523,7 +1522,7 @@ void Application::EnableAutoMnemonic( BOOL bEnabled )
// -----------------------------------------------------------------------
-BOOL Application::IsAutoMnemonicEnabled()
+sal_Bool Application::IsAutoMnemonicEnabled()
{
return GetSettings().GetStyleSettings().GetAutoMnemonic();
}
@@ -1561,7 +1560,7 @@ Window* Application::GetDefDialogParent()
// #103442# find some useful dialog parent if there
// was no default set
// NOTE: currently even the default is not used
- if( FALSE && pSVData->maWinData.mpDefDialogParent != NULL )
+ if( sal_False && pSVData->maWinData.mpDefDialogParent != NULL )
return pSVData->maWinData.mpDefDialogParent;
else
{
@@ -1625,28 +1624,28 @@ Window* Application::GetDefDialogParent()
// -----------------------------------------------------------------------
-void Application::EnableDialogCancel( BOOL bDialogCancel )
+void Application::EnableDialogCancel( sal_Bool bDialogCancel )
{
ImplGetSVData()->maAppData.mbDialogCancel = bDialogCancel;
}
// -----------------------------------------------------------------------
-BOOL Application::IsDialogCancelEnabled()
+sal_Bool Application::IsDialogCancelEnabled()
{
return ImplGetSVData()->maAppData.mbDialogCancel;
}
// -----------------------------------------------------------------------
-void Application::SetSystemWindowMode( USHORT nMode )
+void Application::SetSystemWindowMode( sal_uInt16 nMode )
{
ImplGetSVData()->maAppData.mnSysWinMode = nMode;
}
// -----------------------------------------------------------------------
-USHORT Application::GetSystemWindowMode()
+sal_uInt16 Application::GetSystemWindowMode()
{
return ImplGetSVData()->maAppData.mnSysWinMode;
}
@@ -1696,7 +1695,7 @@ UniqueItemId Application::CreateUniqueId()
::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit > Application::GetVCLToolkit()
{
::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit > xT;
- UnoWrapperBase* pWrapper = Application::GetUnoWrapper( TRUE );
+ UnoWrapperBase* pWrapper = Application::GetUnoWrapper( sal_True );
if ( pWrapper )
xT = pWrapper->GetVCLToolkit();
return xT;
@@ -1706,13 +1705,13 @@ UniqueItemId Application::CreateUniqueId()
extern "C" { static void SAL_CALL thisModule() {} }
-UnoWrapperBase* Application::GetUnoWrapper( BOOL bCreateIfNotExist )
+UnoWrapperBase* Application::GetUnoWrapper( sal_Bool bCreateIfNotExist )
{
ImplSVData* pSVData = ImplGetSVData();
- static BOOL bAlreadyTriedToCreate = FALSE;
+ static sal_Bool bAlreadyTriedToCreate = sal_False;
if ( !pSVData->mpUnoWrapper && bCreateIfNotExist && !bAlreadyTriedToCreate )
{
- ::rtl::OUString aLibName = ::vcl::unohelper::CreateLibraryName( "tk", TRUE );
+ ::rtl::OUString aLibName = ::vcl::unohelper::CreateLibraryName( "tk", sal_True );
oslModule hTkLib = osl_loadModuleRelative(
&thisModule, aLibName.pData, SAL_LOADMODULE_DEFAULT );
if ( hTkLib )
@@ -1725,7 +1724,7 @@ UnoWrapperBase* Application::GetUnoWrapper( BOOL bCreateIfNotExist )
}
}
DBG_ASSERT( pSVData->mpUnoWrapper, "UnoWrapper could not be created!" );
- bAlreadyTriedToCreate = TRUE;
+ bAlreadyTriedToCreate = sal_True;
}
return pSVData->mpUnoWrapper;
}
@@ -1746,9 +1745,12 @@ void Application::SetUnoWrapper( UnoWrapperBase* pWrapper )
ImplSVData* pSVData = ImplGetSVData();
if( !pSVData->mxDisplayConnection.is() )
+ {
pSVData->mxDisplayConnection.set( new ::vcl::DisplayConnection );
+ pSVData->mxDisplayConnection->start();
+ }
- return pSVData->mxDisplayConnection;
+ return pSVData->mxDisplayConnection.get();
}
// -----------------------------------------------------------------------
@@ -1767,7 +1769,7 @@ const Link& Application::GetFilterHdl()
// -----------------------------------------------------------------------
-BOOL ImplCallHotKey( const KeyCode& rKeyCode )
+sal_Bool ImplCallHotKey( const KeyCode& rKeyCode )
{
ImplSVData* pSVData = ImplGetSVData();
ImplHotKey* pHotKeyData = pSVData->maAppData.mpFirstHotKey;
@@ -1776,13 +1778,13 @@ BOOL ImplCallHotKey( const KeyCode& rKeyCode )
if ( pHotKeyData->maKeyCode.IsDefinedKeyCodeEqual( rKeyCode ) )
{
pHotKeyData->maLink.Call( pHotKeyData->mpUserData );
- return TRUE;
+ return sal_True;
}
pHotKeyData = pHotKeyData->mpNext;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -1804,7 +1806,7 @@ void ImplFreeHotKeyData()
// -----------------------------------------------------------------------
-ULONG Application::AddHotKey( const KeyCode& rKeyCode, const Link& rLink, void* pData )
+sal_uIntPtr Application::AddHotKey( const KeyCode& rKeyCode, const Link& rLink, void* pData )
{
ImplSVData* pSVData = ImplGetSVData();
ImplHotKey* pHotKeyData = new ImplHotKey;
@@ -1813,12 +1815,12 @@ ULONG Application::AddHotKey( const KeyCode& rKeyCode, const Link& rLink, void*
pHotKeyData->maLink = rLink;
pHotKeyData->mpNext = pSVData->maAppData.mpFirstHotKey;
pSVData->maAppData.mpFirstHotKey = pHotKeyData;
- return (ULONG)pHotKeyData;
+ return (sal_uIntPtr)pHotKeyData;
}
// -----------------------------------------------------------------------
-void Application::RemoveHotKey( ULONG nId )
+void Application::RemoveHotKey( sal_uIntPtr nId )
{
ImplSVData* pSVData = ImplGetSVData();
ImplHotKey* pFindHotKeyData = (ImplHotKey*)nId;
@@ -1862,7 +1864,7 @@ void ImplFreeEventHookData()
// -----------------------------------------------------------------------
-ULONG Application::AddEventHook( VCLEventHookProc pProc, void* pData )
+sal_uIntPtr Application::AddEventHook( VCLEventHookProc pProc, void* pData )
{
ImplSVData* pSVData = ImplGetSVData();
ImplEventHook* pEventHookData = new ImplEventHook;
@@ -1870,12 +1872,12 @@ ULONG Application::AddEventHook( VCLEventHookProc pProc, void* pData )
pEventHookData->mpProc = pProc;
pEventHookData->mpNext = pSVData->maAppData.mpFirstEventHook;
pSVData->maAppData.mpFirstEventHook = pEventHookData;
- return (ULONG)pEventHookData;
+ return (sal_uIntPtr)pEventHookData;
}
// -----------------------------------------------------------------------
-void Application::RemoveEventHook( ULONG nId )
+void Application::RemoveEventHook( sal_uIntPtr nId )
{
ImplSVData* pSVData = ImplGetSVData();
ImplEventHook* pFindEventHookData = (ImplEventHook*)nId;
@@ -1943,14 +1945,14 @@ const LocaleDataWrapper& Application::GetAppLocaleDataWrapper()
// -----------------------------------------------------------------------
-void Application::EnableHeadlessMode( BOOL bEnable )
+void Application::EnableHeadlessMode( sal_Bool bEnable )
{
EnableDialogCancel( bEnable );
}
// -----------------------------------------------------------------------
-BOOL Application::IsHeadlessModeEnabled()
+sal_Bool Application::IsHeadlessModeEnabled()
{
return IsDialogCancelEnabled();
}
@@ -2011,14 +2013,14 @@ void Application::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const r
pSVData->mpDefInst->AddToRecentDocumentList(rFileUrl, rMimeType);
}
-BOOL Application::IsAccessibilityEnabled()
+sal_Bool Application::IsAccessibilityEnabled()
{
- return FALSE;
+ return sal_False;
}
-BOOL InitAccessBridge( BOOL bShowCancel, BOOL &rCancelled )
+sal_Bool InitAccessBridge( sal_Bool bShowCancel, sal_Bool &rCancelled )
{
- BOOL bRet = true;
+ sal_Bool bRet = true;
// Disable Java bridge on UNIX
#if defined UNX
@@ -2032,7 +2034,7 @@ BOOL InitAccessBridge( BOOL bShowCancel, BOOL &rCancelled )
// disable accessibility if the user chooses to continue
AllSettings aSettings = Application::GetSettings();
MiscSettings aMisc = aSettings.GetMiscSettings();
- aMisc.SetEnableATToolSupport( FALSE );
+ aMisc.SetEnableATToolSupport( sal_False );
aSettings.SetMiscSettings( aMisc );
Application::SetSettings( aSettings );
}
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index b21ee99b777e..ee46f14acae0 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -28,45 +28,54 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
+
#include <string.h>
#include <boost/ptr_container/ptr_vector.hpp>
-#include <svsys.h>
-#include <vcl/salinst.hxx>
-#include <vcl/salframe.hxx>
-
-#include <osl/mutex.hxx>
-
-#include <osl/process.h>
#include <osl/file.hxx>
-#include <uno/current_context.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include <tools/debug.hxx>
-#include <unotools/fontcfg.hxx>
-#include <vcl/configsettings.hxx>
-#include <vcl/svdata.hxx>
-#include <vcl/window.h>
-#include <vcl/svapp.hxx>
-#include <vcl/wrkwin.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/unohelp.hxx>
-#include <vcl/button.hxx> // for Button::GetStandardText
-#include <vcl/dockwin.hxx> // for DockingManager
-#include <vcl/salimestatus.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/awt/XExtendedToolkit.hpp>
-#include <com/sun/star/java/JavaNotConfiguredException.hpp>
-#include <com/sun/star/java/JavaVMCreationFailureException.hpp>
-#include <com/sun/star/java/MissingJavaRuntimeException.hpp>
-#include <com/sun/star/java/JavaDisabledException.hpp>
-
-#include <com/sun/star/lang/XComponent.hpp>
+#include <osl/mutex.hxx>
+#include <rtl/process.h>
+
+#include "tools/debug.hxx"
+#include "tools/resary.hxx"
+
+#include "vcl/salinst.hxx"
+#include "vcl/salframe.hxx"
+#include "vcl/configsettings.hxx"
+#include "vcl/svdata.hxx"
+#include "vcl/window.h"
+#include "vcl/svapp.hxx"
+#include "vcl/wrkwin.hxx"
+#include "vcl/msgbox.hxx"
+#include "vcl/unohelp.hxx"
+#include "vcl/button.hxx" // for Button::GetStandardText
+#include "vcl/dockwin.hxx" // for DockingManager
+#include "vcl/salimestatus.hxx"
+#include "vcl/salsys.hxx"
+#include "vcl/svids.hrc"
+#include "vcl/xconnection.hxx"
+
+#include "unotools/fontcfg.hxx"
+
+#include "cppuhelper/implbase1.hxx"
+#include "uno/current_context.hxx"
+
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/lang/XComponent.hpp"
+#include "com/sun/star/awt/XExtendedToolkit.hpp"
+#include "com/sun/star/java/JavaNotConfiguredException.hpp"
+#include "com/sun/star/java/JavaVMCreationFailureException.hpp"
+#include "com/sun/star/java/MissingJavaRuntimeException.hpp"
+#include "com/sun/star/java/JavaDisabledException.hpp"
#include <stdio.h>
-#include <vcl/salsys.hxx>
-#include <vcl/svids.hrc>
-#include <rtl/instance.hxx>
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
@@ -126,6 +135,9 @@ void ImplInitSVData()
break;
}
}
+
+ // mark default layout border as unitialized
+ pImplSVData->maAppData.mnDefaultLayoutBorder = -1;
}
// -----------------------------------------------------------------------
@@ -161,6 +173,13 @@ void ImplDeInitSVData()
delete pSVData->maAppData.mpMSFTempFileName;
pSVData->maAppData.mpMSFTempFileName = NULL;
}
+
+ if( pSVData->maCtrlData.mpFieldUnitStrings )
+ delete pSVData->maCtrlData.mpFieldUnitStrings, pSVData->maCtrlData.mpFieldUnitStrings = NULL;
+ if( pSVData->maCtrlData.mpCleanUnitStrings )
+ delete pSVData->maCtrlData.mpCleanUnitStrings, pSVData->maCtrlData.mpCleanUnitStrings = NULL;
+ if( pSVData->mpPaperNames )
+ delete pSVData->mpPaperNames, pSVData->mpPaperNames = NULL;
}
// -----------------------------------------------------------------------
@@ -238,6 +257,52 @@ ResId VclResId( sal_Int32 nId )
return ResId( nId, *pMgr );
}
+FieldUnitStringList* ImplGetFieldUnits()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ if( ! pSVData->maCtrlData.mpFieldUnitStrings )
+ {
+ ResMgr* pResMgr = ImplGetResMgr();
+ if( pResMgr )
+ {
+ ResStringArray aUnits( ResId (SV_FUNIT_STRINGS, *pResMgr) );
+ sal_uInt32 nUnits = aUnits.Count();
+ pSVData->maCtrlData.mpFieldUnitStrings = new FieldUnitStringList();
+ pSVData->maCtrlData.mpFieldUnitStrings->reserve( nUnits );
+ for( sal_uInt32 i = 0; i < nUnits; i++ )
+ {
+ std::pair< String, FieldUnit > aElement( aUnits.GetString(i), static_cast<FieldUnit>(aUnits.GetValue(i)) );
+ pSVData->maCtrlData.mpFieldUnitStrings->push_back( aElement );
+ }
+ }
+ }
+ return pSVData->maCtrlData.mpFieldUnitStrings;
+}
+
+FieldUnitStringList* ImplGetCleanedFieldUnits()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ if( ! pSVData->maCtrlData.mpCleanUnitStrings )
+ {
+ FieldUnitStringList* pUnits = ImplGetFieldUnits();
+ if( pUnits )
+ {
+ size_t nUnits = pUnits->size();
+ pSVData->maCtrlData.mpCleanUnitStrings = new FieldUnitStringList();
+ pSVData->maCtrlData.mpCleanUnitStrings->reserve( nUnits );
+ for( size_t i = 0; i < nUnits; i++ )
+ {
+ String aUnit( (*pUnits)[i].first );
+ aUnit.EraseAllChars( sal_Unicode( ' ' ) );
+ aUnit.ToLowerAscii();
+ std::pair< String, FieldUnit > aElement( aUnit, (*pUnits)[i].second );
+ pSVData->maCtrlData.mpCleanUnitStrings->push_back( aElement );
+ }
+ }
+ }
+ return pSVData->maCtrlData.mpCleanUnitStrings;
+}
+
DockingManager* ImplGetDockingManager()
{
ImplSVData* pSVData = ImplGetSVData();
@@ -279,16 +344,16 @@ com::sun::star::uno::Any AccessBridgeCurrentContext::getValueByName( const rtl::
}
-bool ImplInitAccessBridge(BOOL bAllowCancel, BOOL &rCancelled)
+bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled)
{
- rCancelled = FALSE;
+ rCancelled = sal_False;
bool bErrorMessage = true;
// Note:
- // if bAllowCancel is TRUE we were called from application startup
+ // if bAllowCancel is sal_True we were called from application startup
// where we will disable any Java errorboxes and show our own accessibility dialog if Java throws an exception
- // if bAllowCancel is FALSE we were called from Tools->Options
+ // if bAllowCancel is sal_False we were called from Tools->Options
// where we will see Java errorboxes, se we do not show our dialogs in addition to Java's
try
@@ -305,12 +370,12 @@ bool ImplInitAccessBridge(BOOL bAllowCancel, BOOL &rCancelled)
ImplSVData* pSVData = ImplGetSVData();
if( ! pSVData->mxAccessBridge.is() )
{
- Reference< XMultiServiceFactory > xFactory(vcl::unohelper::GetMultiServiceFactory());
+ css::uno::Reference< XMultiServiceFactory > xFactory(vcl::unohelper::GetMultiServiceFactory());
if( xFactory.is() )
{
- Reference< XExtendedToolkit > xToolkit =
- Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY);
+ css::uno::Reference< XExtendedToolkit > xToolkit =
+ css::uno::Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY);
Sequence< Any > arguments(1);
arguments[0] = makeAny(xToolkit);
@@ -365,7 +430,7 @@ bool ImplInitAccessBridge(BOOL bAllowCancel, BOOL &rCancelled)
// Do not change the setting in case the user chooses to cancel
if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
- rCancelled = TRUE;
+ rCancelled = sal_True;
}
return false;
@@ -390,7 +455,7 @@ bool ImplInitAccessBridge(BOOL bAllowCancel, BOOL &rCancelled)
// Do not change the setting in case the user chooses to cancel
if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
- rCancelled = TRUE;
+ rCancelled = sal_True;
}
return false;
@@ -415,7 +480,7 @@ bool ImplInitAccessBridge(BOOL bAllowCancel, BOOL &rCancelled)
// Do not change the setting in case the user chooses to cancel
if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
- rCancelled = TRUE;
+ rCancelled = sal_True;
}
return false;
@@ -440,7 +505,7 @@ bool ImplInitAccessBridge(BOOL bAllowCancel, BOOL &rCancelled)
// Do not change the setting in case the user chooses to cancel
if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
- rCancelled = TRUE;
+ rCancelled = sal_True;
}
return false;
@@ -482,7 +547,7 @@ bool ImplInitAccessBridge(BOOL bAllowCancel, BOOL &rCancelled)
// Do not change the setting in case the user chooses to cancel
if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
- rCancelled = TRUE;
+ rCancelled = sal_True;
}
else
{
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 37091c86e62a..cc1ccc45facf 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -90,11 +90,8 @@
#include "rtl/strbuf.hxx"
#endif
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-
-
+using ::rtl::OUString;
+using namespace ::com::sun::star;
// =======================================================================
@@ -165,27 +162,23 @@ int ImplSVMain()
DBG_ASSERT( pSVData->mpApp, "no instance of class Application" );
- Reference<XMultiServiceFactory> xMS;
+ uno::Reference<lang::XMultiServiceFactory> xMS;
int nReturn = EXIT_FAILURE;
- BOOL bInit = InitVCL( xMS );
+ sal_Bool bInit = InitVCL( xMS );
if( bInit )
{
// Application-Main rufen
- pSVData->maAppData.mbInAppMain = TRUE;
+ pSVData->maAppData.mbInAppMain = sal_True;
nReturn = pSVData->mpApp->Main();
- pSVData->maAppData.mbInAppMain = FALSE;
+ pSVData->maAppData.mbInAppMain = sal_False;
}
if( pSVData->mxDisplayConnection.is() )
{
- vcl::DisplayConnection* pConnection =
- dynamic_cast<vcl::DisplayConnection*>(pSVData->mxDisplayConnection.get());
-
- if( pConnection )
- pConnection->dispatchDowningEvent();
+ pSVData->mxDisplayConnection->terminate();
pSVData->mxDisplayConnection.clear();
}
@@ -194,10 +187,10 @@ int ImplSVMain()
// be some events in the AWT EventQueue, which need the SolarMutex which
// - on the other hand - is destroyed in DeInitVCL(). So empty the queue
// here ..
- Reference< XComponent > xComponent(pSVData->mxAccessBridge, UNO_QUERY);
+ uno::Reference< lang::XComponent > xComponent(pSVData->mxAccessBridge, uno::UNO_QUERY);
if( xComponent.is() )
{
- ULONG nCount = Application::ReleaseSolarMutex();
+ sal_uLong nCount = Application::ReleaseSolarMutex();
xComponent->dispose();
Application::AcquireSolarMutex(nCount);
pSVData->mxAccessBridge.clear();
@@ -210,7 +203,7 @@ int ImplSVMain()
int SVMain()
{
// #i47888# allow for alternative initialization as required for e.g. MacOSX
- extern BOOL ImplSVMainHook( int* );
+ extern sal_Bool ImplSVMainHook( int* );
int nRet;
if( ImplSVMainHook( &nRet ) )
@@ -244,13 +237,13 @@ private:
com::sun::star::uno::Reference< com::sun::star::uno::XCurrentContext > m_xNextContext;
};
-Any SAL_CALL DesktopEnvironmentContext::getValueByName( const rtl::OUString& Name) throw (RuntimeException)
+uno::Any SAL_CALL DesktopEnvironmentContext::getValueByName( const rtl::OUString& Name) throw (uno::RuntimeException)
{
- Any retVal;
+ uno::Any retVal;
if (Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("system.desktop-environment")))
{
- retVal = makeAny( Application::GetDesktopEnvironment() );
+ retVal = uno::makeAny( Application::GetDesktopEnvironment() );
}
else if( m_xNextContext.is() )
{
@@ -260,12 +253,12 @@ Any SAL_CALL DesktopEnvironmentContext::getValueByName( const rtl::OUString& Nam
return retVal;
}
-BOOL InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr )
+sal_Bool InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr )
{
RTL_LOGFILE_CONTEXT( aLog, "vcl (ss112471) ::InitVCL" );
if( pExceptionHandler != NULL )
- return FALSE;
+ return sal_False;
if( ! ImplGetSVData() )
ImplInitSVData();
@@ -294,7 +287,7 @@ BOOL InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XM
RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ ::CreateSalInstance" );
pSVData->mpDefInst = CreateSalInstance();
if ( !pSVData->mpDefInst )
- return FALSE;
+ return sal_False;
RTL_LOGFILE_CONTEXT_TRACE( aLog, "} ::CreateSalInstance" );
// Desktop Environment context (to be able to get value of "system.desktop-environment" as soon as possible)
@@ -319,7 +312,7 @@ BOOL InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XM
// Initialize global data
pSVData->maGDIData.mpScreenFontList = new ImplDevFontList;
- pSVData->maGDIData.mpScreenFontCache = new ImplFontCache( FALSE );
+ pSVData->maGDIData.mpScreenFontCache = new ImplFontCache( sal_False );
pSVData->maGDIData.mpGrfConverter = new GraphicConverter;
// Exception-Handler setzen
@@ -328,7 +321,7 @@ BOOL InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XM
// Debug-Daten initialisieren
DBGGUI_INIT();
- return TRUE;
+ return sal_True;
}
namespace
@@ -341,12 +334,12 @@ namespace
*/
class VCLUnoWrapperDeleter : public cppu::WeakImplHelper1<com::sun::star::lang::XEventListener>
{
- virtual void SAL_CALL disposing(EventObject const& rSource) throw(RuntimeException);
+ virtual void SAL_CALL disposing(lang::EventObject const& rSource) throw(uno::RuntimeException);
};
void
-VCLUnoWrapperDeleter::disposing(EventObject const& /* rSource */)
- throw(RuntimeException)
+VCLUnoWrapperDeleter::disposing(lang::EventObject const& /* rSource */)
+ throw(uno::RuntimeException)
{
ImplSVData* const pSVData = ImplGetSVData();
if (pSVData && pSVData->mpUnoWrapper)
@@ -361,7 +354,7 @@ VCLUnoWrapperDeleter::disposing(EventObject const& /* rSource */)
void DeInitVCL()
{
ImplSVData* pSVData = ImplGetSVData();
- pSVData->mbDeInit = TRUE;
+ pSVData->mbDeInit = sal_True;
vcl::DeleteOnDeinitBase::ImplDeleteOnDeInit();
@@ -475,14 +468,14 @@ void DeInitVCL()
{
try
{
- Reference<XComponent> const xDesktop(
+ uno::Reference<lang::XComponent> const xDesktop(
comphelper::createProcessComponent(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))),
- UNO_QUERY_THROW)
+ uno::UNO_QUERY_THROW)
;
xDesktop->addEventListener(new VCLUnoWrapperDeleter());
}
- catch (Exception const&)
+ catch (uno::Exception const&)
{
// ignore
}
diff --git a/vcl/source/app/svmainhook.cxx b/vcl/source/app/svmainhook.cxx
index 725f90f05dc1..dd446125a7aa 100644
--- a/vcl/source/app/svmainhook.cxx
+++ b/vcl/source/app/svmainhook.cxx
@@ -32,9 +32,9 @@
#ifndef MACOSX
-BOOL ImplSVMainHook( int * )
+sal_Bool ImplSVMainHook( int * )
{
- return FALSE; // indicate that ImplSVMainHook is not implemented
+ return sal_False; // indicate that ImplSVMainHook is not implemented
}
#else
@@ -46,7 +46,7 @@ BOOL ImplSVMainHook( int * )
#include <postmac.h>
#include <unistd.h>
-extern BOOL ImplSVMain();
+extern sal_Bool ImplSVMain();
// ============================================================================
@@ -76,7 +76,7 @@ static void RunSVMain(void *pData)
_exit( 0 );
}
-BOOL ImplSVMainHook( int *pnInit )
+sal_Bool ImplSVMainHook( int *pnInit )
{
// Mac OS X requires that any Cocoa code have a CFRunLoop started in the
// primordial thread. Since all of the AWT classes in Java 1.4 and higher
@@ -110,7 +110,7 @@ BOOL ImplSVMainHook( int *pnInit )
osl_joinWithThread( hThreadID );
osl_destroyThread( hThreadID );
- return TRUE; // indicate that ImplSVMainHook is implemented
+ return sal_True; // indicate that ImplSVMainHook is implemented
}
#endif // MACOSX
diff --git a/vcl/source/app/timer.cxx b/vcl/source/app/timer.cxx
index d83c11e4f270..6c2d08b18659 100644
--- a/vcl/source/app/timer.cxx
+++ b/vcl/source/app/timer.cxx
@@ -42,7 +42,7 @@
// =======================================================================
-#define MAX_TIMER_PERIOD ((ULONG)0xFFFFFFFF)
+#define MAX_TIMER_PERIOD ((sal_uLong)0xFFFFFFFF)
// ---------------------
// - TimeManager-Types -
@@ -52,10 +52,10 @@ struct ImplTimerData
{
ImplTimerData* mpNext; // Pointer to the next Instance
Timer* mpSVTimer; // Pointer to SV Timer instance
- ULONG mnUpdateTime; // Last Update Time
- ULONG mnTimerUpdate; // TimerCallbackProcs on stack
- BOOL mbDelete; // Wurde Timer waehren Update() geloescht
- BOOL mbInTimeout; // Befinden wir uns im Timeout-Handler
+ sal_uLong mnUpdateTime; // Last Update Time
+ sal_uLong mnTimerUpdate; // TimerCallbackProcs on stack
+ sal_Bool mbDelete; // Wurde Timer waehren Update() geloescht
+ sal_Bool mbInTimeout; // Befinden wir uns im Timeout-Handler
};
// =======================================================================
@@ -72,7 +72,7 @@ void Timer::ImplDeInitTimer()
ImplTimerData* pTempTimerData = pTimerData;
if ( pTimerData->mpSVTimer )
{
- pTimerData->mpSVTimer->mbActive = FALSE;
+ pTimerData->mpSVTimer->mbActive = sal_False;
pTimerData->mpSVTimer->mpTimerData = NULL;
}
pTimerData = pTimerData->mpNext;
@@ -89,7 +89,7 @@ void Timer::ImplDeInitTimer()
// -----------------------------------------------------------------------
-static void ImplStartTimer( ImplSVData* pSVData, ULONG nMS )
+static void ImplStartTimer( ImplSVData* pSVData, sal_uLong nMS )
{
if ( !nMS )
nMS = 1;
@@ -108,15 +108,15 @@ void Timer::ImplTimerCallbackProc()
ImplSVData* pSVData = ImplGetSVData();
ImplTimerData* pTimerData;
ImplTimerData* pPrevTimerData;
- ULONG nMinPeriod = MAX_TIMER_PERIOD;
- ULONG nDeltaTime;
- ULONG nTime = Time::GetSystemTicks();
+ sal_uLong nMinPeriod = MAX_TIMER_PERIOD;
+ sal_uLong nDeltaTime;
+ sal_uLong nTime = Time::GetSystemTicks();
if ( pSVData->mbNoCallTimer )
return;
pSVData->mnTimerUpdate++;
- pSVData->mbNotAllTimerCalled = TRUE;
+ pSVData->mbNotAllTimerCalled = sal_True;
// Suche Timer raus, wo der Timeout-Handler gerufen werden muss
pTimerData = pSVData->mpFirstTimerData;
@@ -137,14 +137,14 @@ void Timer::ImplTimerCallbackProc()
// kein AutoTimer, dann anhalten
if ( !pTimerData->mpSVTimer->mbAuto )
{
- pTimerData->mpSVTimer->mbActive = FALSE;
- pTimerData->mbDelete = TRUE;
+ pTimerData->mpSVTimer->mbActive = sal_False;
+ pTimerData->mbDelete = sal_True;
}
// call Timeout
- pTimerData->mbInTimeout = TRUE;
+ pTimerData->mbInTimeout = sal_True;
pTimerData->mpSVTimer->Timeout();
- pTimerData->mbInTimeout = FALSE;
+ pTimerData->mbInTimeout = sal_False;
}
}
@@ -152,7 +152,7 @@ void Timer::ImplTimerCallbackProc()
}
// Neue Zeit ermitteln
- ULONG nNewTime = Time::GetSystemTicks();
+ sal_uLong nNewTime = Time::GetSystemTicks();
pPrevTimerData = NULL;
pTimerData = pSVData->mpFirstTimerData;
while ( pTimerData )
@@ -213,7 +213,7 @@ void Timer::ImplTimerCallbackProc()
ImplStartTimer( pSVData, nMinPeriod );
pSVData->mnTimerUpdate--;
- pSVData->mbNotAllTimerCalled = FALSE;
+ pSVData->mbNotAllTimerCalled = sal_False;
}
// =======================================================================
@@ -222,8 +222,8 @@ Timer::Timer()
{
mpTimerData = NULL;
mnTimeout = 1;
- mbAuto = FALSE;
- mbActive = FALSE;
+ mbAuto = sal_False;
+ mbActive = sal_False;
}
// -----------------------------------------------------------------------
@@ -232,8 +232,8 @@ Timer::Timer( const Timer& rTimer )
{
mpTimerData = NULL;
mnTimeout = rTimer.mnTimeout;
- mbAuto = FALSE;
- mbActive = FALSE;
+ mbAuto = sal_False;
+ mbActive = sal_False;
maTimeoutHdl = rTimer.maTimeoutHdl;
if ( rTimer.IsActive() )
@@ -246,7 +246,7 @@ Timer::~Timer()
{
if ( mpTimerData )
{
- mpTimerData->mbDelete = TRUE;
+ mpTimerData->mbDelete = sal_True;
mpTimerData->mpSVTimer = NULL;
}
}
@@ -260,7 +260,7 @@ void Timer::Timeout()
// -----------------------------------------------------------------------
-void Timer::SetTimeout( ULONG nNewTimeout )
+void Timer::SetTimeout( sal_uLong nNewTimeout )
{
mnTimeout = nNewTimeout;
@@ -277,7 +277,7 @@ void Timer::SetTimeout( ULONG nNewTimeout )
void Timer::Start()
{
- mbActive = TRUE;
+ mbActive = sal_True;
ImplSVData* pSVData = ImplGetSVData();
if ( !mpTimerData )
@@ -297,8 +297,8 @@ void Timer::Start()
mpTimerData->mpSVTimer = this;
mpTimerData->mnUpdateTime = Time::GetSystemTicks();
mpTimerData->mnTimerUpdate = pSVData->mnTimerUpdate;
- mpTimerData->mbDelete = FALSE;
- mpTimerData->mbInTimeout = FALSE;
+ mpTimerData->mbDelete = sal_False;
+ mpTimerData->mbInTimeout = sal_False;
// !!!!! Wegen SFX hinten einordnen !!!!!
ImplTimerData* pPrev = NULL;
@@ -325,7 +325,7 @@ void Timer::Start()
{
mpTimerData->mnUpdateTime = Time::GetSystemTicks();
mpTimerData->mnTimerUpdate = pSVData->mnTimerUpdate;
- mpTimerData->mbDelete = FALSE;
+ mpTimerData->mbDelete = sal_False;
}
}
@@ -333,10 +333,10 @@ void Timer::Start()
void Timer::Stop()
{
- mbActive = FALSE;
+ mbActive = sal_False;
if ( mpTimerData )
- mpTimerData->mbDelete = TRUE;
+ mpTimerData->mbDelete = sal_True;
}
// -----------------------------------------------------------------------
@@ -346,7 +346,7 @@ Timer& Timer::operator=( const Timer& rTimer )
if ( IsActive() )
Stop();
- mbActive = FALSE;
+ mbActive = sal_False;
mnTimeout = rTimer.mnTimeout;
maTimeoutHdl = rTimer.maTimeoutHdl;
@@ -360,14 +360,14 @@ Timer& Timer::operator=( const Timer& rTimer )
AutoTimer::AutoTimer()
{
- mbAuto = TRUE;
+ mbAuto = sal_True;
}
// -----------------------------------------------------------------------
AutoTimer::AutoTimer( const AutoTimer& rTimer ) : Timer( rTimer )
{
- mbAuto = TRUE;
+ mbAuto = sal_True;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/app/unohelp2.cxx b/vcl/source/app/unohelp2.cxx
index 0640d9cfbc49..1fe4158433a0 100644
--- a/vcl/source/app/unohelp2.cxx
+++ b/vcl/source/app/unohelp2.cxx
@@ -85,7 +85,7 @@ namespace vcl { namespace unohelper {
{
uno::Any aAny;
- ULONG nT = SotExchange::GetFormat( rFlavor );
+ sal_uLong nT = SotExchange::GetFormat( rFlavor );
if ( nT == SOT_FORMAT_STRING )
{
aAny <<= (::rtl::OUString)GetString();
@@ -106,7 +106,7 @@ namespace vcl { namespace unohelper {
sal_Bool TextDataObject::isDataFlavorSupported( const datatransfer::DataFlavor& rFlavor ) throw(uno::RuntimeException)
{
- ULONG nT = SotExchange::GetFormat( rFlavor );
+ sal_uLong nT = SotExchange::GetFormat( rFlavor );
return ( nT == SOT_FORMAT_STRING );
}
diff --git a/vcl/source/app/vclevent.cxx b/vcl/source/app/vclevent.cxx
index 705eebf93aee..f7614c99046b 100644
--- a/vcl/source/app/vclevent.cxx
+++ b/vcl/source/app/vclevent.cxx
@@ -41,7 +41,7 @@ TYPEINIT0(VclSimpleEvent);
TYPEINIT1(VclWindowEvent, VclSimpleEvent);
TYPEINIT1(VclMenuEvent, VclSimpleEvent);
-VclAccessibleEvent::VclAccessibleEvent( ULONG n, const Reference<XAccessible>& rxAccessible ) :
+VclAccessibleEvent::VclAccessibleEvent( sal_uLong n, const Reference<XAccessible>& rxAccessible ) :
VclSimpleEvent(n),
mxAccessible(rxAccessible)
{
@@ -84,12 +84,12 @@ void VclEventListeners::Call( VclSimpleEvent* pEvent ) const
}
}
-BOOL VclEventListeners::Process( VclSimpleEvent* pEvent ) const
+sal_Bool VclEventListeners::Process( VclSimpleEvent* pEvent ) const
{
if ( m_aListeners.empty() )
- return FALSE;
+ return sal_False;
- BOOL bProcessed = FALSE;
+ sal_Bool bProcessed = sal_False;
// Copy the list, because this can be destroyed when calling a Link...
std::list<Link> aCopy( m_aListeners );
std::list<Link>::iterator aIter( aCopy.begin() );
@@ -97,7 +97,7 @@ BOOL VclEventListeners::Process( VclSimpleEvent* pEvent ) const
{
if( (*aIter).Call( pEvent ) != 0 )
{
- bProcessed = TRUE;
+ bProcessed = sal_True;
break;
}
aIter++;
diff --git a/vcl/source/components/factory.cxx b/vcl/source/components/factory.cxx
index 69be4002928f..9325c047b5d7 100644
--- a/vcl/source/components/factory.cxx
+++ b/vcl/source/components/factory.cxx
@@ -59,6 +59,10 @@ extern Sequence< OUString > SAL_CALL FontIdentificator_getSupportedServiceNames(
extern OUString SAL_CALL FontIdentificator_getImplementationName();
extern Reference< XInterface > SAL_CALL FontIdentificator_createInstance( const Reference< XMultiServiceFactory > & );
+extern Sequence< OUString > SAL_CALL StringMirror_getSupportedServiceNames();
+extern OUString SAL_CALL StringMirror_getImplementationName();
+extern Reference< XInterface > SAL_CALL StringMirror_createInstance( const Reference< XMultiServiceFactory > & );
+
extern Sequence< OUString > SAL_CALL Clipboard_getSupportedServiceNames();
extern OUString SAL_CALL Clipboard_getImplementationName();
extern Reference< XSingleServiceFactory > SAL_CALL Clipboard_createFactory( const Reference< XMultiServiceFactory > & );
@@ -81,62 +85,6 @@ extern "C" {
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
- VCL_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pXUnoKey )
- {
- if( pXUnoKey )
- {
- try
- {
- Reference< ::com::sun::star::registry::XRegistryKey > xKey( reinterpret_cast< ::com::sun::star::registry::XRegistryKey* >( pXUnoKey ) );
-
- OUStringBuffer aImplName(64);
- aImplName.appendAscii( "/" );
- aImplName.append( vcl_session_getImplementationName() );
- aImplName.appendAscii( "/UNO/SERVICES/" );
- aImplName.append( vcl_session_getSupportedServiceNames()[0] );
- xKey->createKey( aImplName.makeStringAndClear() );
-
- aImplName.appendAscii( "/" );
- aImplName.append( vcl::DisplayAccess_getImplementationName() );
- aImplName.appendAscii( "/UNO/SERVICES/" );
- aImplName.append( vcl::DisplayAccess_getSupportedServiceNames()[0] );
- xKey->createKey( aImplName.makeStringAndClear() );
-
- aImplName.appendAscii( "/" );
- aImplName.append( vcl::FontIdentificator_getImplementationName() );
- aImplName.appendAscii( "/UNO/SERVICES/" );
- aImplName.append( vcl::FontIdentificator_getSupportedServiceNames()[0] );
- xKey->createKey( aImplName.makeStringAndClear() );
-
- #if defined UNX
- aImplName.appendAscii( "/" );
- aImplName.append( vcl::Clipboard_getImplementationName() );
- aImplName.appendAscii( "/UNO/SERVICES/" );
- aImplName.append( vcl::Clipboard_getSupportedServiceNames()[0] );
- xKey->createKey( aImplName.makeStringAndClear() );
-
- aImplName.appendAscii( "/" );
- aImplName.append( vcl::DragSource_getImplementationName() );
- aImplName.appendAscii( "/UNO/SERVICES/" );
- aImplName.append( vcl::DragSource_getSupportedServiceNames()[0] );
- xKey->createKey( aImplName.makeStringAndClear() );
-
- aImplName.appendAscii( "/" );
- aImplName.append( vcl::DropTarget_getImplementationName() );
- aImplName.appendAscii( "/UNO/SERVICES/" );
- aImplName.append( vcl::DropTarget_getSupportedServiceNames()[0] );
- xKey->createKey( aImplName.makeStringAndClear() );
- #endif
-
- return sal_True;
- }
- catch( ::com::sun::star::registry::InvalidRegistryException& )
- {
- }
- }
- return sal_False;
- }
-
VCL_DLLPUBLIC void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName,
void* pXUnoSMgr,
@@ -169,6 +117,12 @@ extern "C" {
xMgr, vcl::FontIdentificator_getImplementationName(), vcl::FontIdentificator_createInstance,
vcl::FontIdentificator_getSupportedServiceNames() );
}
+ else if( vcl::StringMirror_getImplementationName().equalsAscii( pImplementationName ) )
+ {
+ xFactory = ::cppu::createSingleFactory(
+ xMgr, vcl::StringMirror_getImplementationName(), vcl::StringMirror_createInstance,
+ vcl::StringMirror_getSupportedServiceNames() );
+ }
else if( vcl::Clipboard_getImplementationName().equalsAscii( pImplementationName ) )
{
xFactory = vcl::Clipboard_createFactory( xMgr );
diff --git a/vcl/source/components/makefile.mk b/vcl/source/components/makefile.mk
index e30975dbc099..982687104c01 100644
--- a/vcl/source/components/makefile.mk
+++ b/vcl/source/components/makefile.mk
@@ -39,9 +39,10 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
-SLOFILES= $(SLO)$/display.obj \
- $(SLO)$/dtranscomp.obj \
- $(SLO)$/fontident.obj \
+SLOFILES= $(SLO)$/display.obj \
+ $(SLO)$/dtranscomp.obj \
+ $(SLO)$/fontident.obj \
+ $(SLO)$/stringmirror.obj \
$(SLO)$/factory.obj
# --- Targets ------------------------------------------------------
diff --git a/vcl/source/components/stringmirror.cxx b/vcl/source/components/stringmirror.cxx
new file mode 100644
index 000000000000..78806914a7c4
--- /dev/null
+++ b/vcl/source/components/stringmirror.cxx
@@ -0,0 +1,123 @@
+/*************************************************************************
+ *
+ * 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_vcl.hxx"
+
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/util/XStringMapping.hpp"
+
+#include "cppuhelper/implbase2.hxx"
+#include "rtl/ustrbuf.hxx"
+#include "vcl/svapp.hxx"
+
+using ::rtl::OUString;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::util;
+
+// -----------------------------------------------------------------------
+
+namespace vcl
+{
+
+class StringMirror : public ::cppu::WeakAggImplHelper2< XStringMapping, XServiceInfo >
+{
+public:
+ StringMirror()
+ {}
+
+ virtual ~StringMirror()
+ {}
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName( ) throw (RuntimeException);
+ virtual ::sal_Bool SAL_CALL supportsService( const OUString& ) throw (RuntimeException);
+ virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (RuntimeException);
+
+ // XStringMapping
+ virtual sal_Bool SAL_CALL mapStrings( Sequence< OUString >& io_rStrings ) throw (RuntimeException)
+ {
+ sal_Int32 nItems = io_rStrings.getLength();
+ for( sal_Int32 n = 0; n < nItems; n++ )
+ {
+ rtl::OUString& rStr( io_rStrings.getArray()[n] );
+
+ sal_Int32 nLen = rStr.getLength();
+ rtl::OUStringBuffer aMirror( nLen );
+ for(sal_Int32 i = nLen - 1; i >= 0; i--)
+ {
+ sal_Unicode cChar = rStr[ i ];
+ aMirror.append(sal_Unicode(GetMirroredChar(cChar)));
+ }
+ rStr = aMirror.makeStringAndClear();
+ }
+ return sal_True;
+ }
+};
+
+Sequence< OUString > StringMirror_getSupportedServiceNames()
+{
+ static OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.StringMirror" ) );
+ static Sequence< OUString > aServiceNames( &aServiceName, 1 );
+ return aServiceNames;
+}
+
+OUString StringMirror_getImplementationName()
+{
+ return OUString( RTL_CONSTASCII_USTRINGPARAM( "vcl::StringMirror" ) );
+}
+
+Reference< XInterface > SAL_CALL StringMirror_createInstance( const Reference< XMultiServiceFactory >& )
+{
+ return static_cast< ::cppu::OWeakObject * >( new StringMirror );
+}
+
+
+// XServiceInfo
+OUString SAL_CALL StringMirror::getImplementationName() throw (RuntimeException)
+{
+ return StringMirror_getImplementationName();
+}
+
+sal_Bool SAL_CALL StringMirror::supportsService( const OUString& i_rServiceName ) throw (RuntimeException)
+{
+ Sequence< OUString > aSN( StringMirror_getSupportedServiceNames() );
+ for( sal_Int32 nService = 0; nService < aSN.getLength(); nService++ )
+ {
+ if( aSN[nService] == i_rServiceName )
+ return sal_True;
+ }
+ return sal_False;
+}
+
+Sequence< OUString > SAL_CALL StringMirror::getSupportedServiceNames() throw (RuntimeException)
+{
+ return StringMirror_getSupportedServiceNames();
+}
+
+} // namespace vcl
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 962ad4553a29..7efaf732da34 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -77,8 +77,8 @@ class ImplCommonButtonData
public:
Rectangle maFocusRect;
Rectangle maSymbolRect;
- USHORT mnButtonState;
- BOOL mbSmallSymbol;
+ sal_uInt16 mnButtonState;
+ sal_Bool mbSmallSymbol;
Image maImage;
BitmapEx* mpBitmapEx;
@@ -94,7 +94,7 @@ public:
ImplCommonButtonData::ImplCommonButtonData()
{
mnButtonState = 0;
- mbSmallSymbol = FALSE;
+ mbSmallSymbol = sal_False;
mpBitmapEx = NULL;
meImageAlign = IMAGEALIGN_TOP;
@@ -180,12 +180,12 @@ XubString Button::GetStandardText( StandardButtonType eButton )
ResMgr* pResMgr = ImplGetResMgr();
if( pResMgr )
{
- ResId aResId( aResIdAry[(USHORT)eButton].nResId, *pResMgr );
+ ResId aResId( aResIdAry[(sal_uInt16)eButton].nResId, *pResMgr );
aText = String( aResId );
}
else
{
- ByteString aT( aResIdAry[(USHORT)eButton].pDefText );
+ ByteString aT( aResIdAry[(sal_uInt16)eButton].pDefText );
aText = String( aT, RTL_TEXTENCODING_ASCII_US );
}
return aText;
@@ -199,7 +199,7 @@ XubString Button::GetStandardHelpText( StandardButtonType /* eButton */ )
return aHelpText;
}
// -----------------------------------------------------------------------
-BOOL Button::SetModeImage( const Image& rImage )
+sal_Bool Button::SetModeImage( const Image& rImage )
{
if ( rImage != mpButtonData->maImage )
{
@@ -210,7 +210,7 @@ BOOL Button::SetModeImage( const Image& rImage )
StateChanged( STATE_CHANGE_DATA );
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -220,7 +220,7 @@ const Image Button::GetModeImage( ) const
}
// -----------------------------------------------------------------------
-BOOL Button::HasImage() const
+sal_Bool Button::HasImage() const
{
return !!(mpButtonData->maImage);
}
@@ -242,15 +242,15 @@ ImageAlign Button::GetImageAlign() const
}
// -----------------------------------------------------------------------
-BOOL Button::SetModeBitmap( const BitmapEx& rBitmap )
+sal_Bool Button::SetModeBitmap( const BitmapEx& rBitmap )
{
if ( SetModeImage( rBitmap ) )
{
if ( !mpButtonData->mpBitmapEx )
mpButtonData->mpBitmapEx = new BitmapEx( rBitmap );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -290,11 +290,11 @@ void Button::ImplSetSymbolRect( const Rectangle& i_rRect )
// -----------------------------------------------------------------------
-USHORT Button::ImplGetTextStyle( XubString& rText, WinBits nWinStyle,
- ULONG nDrawFlags )
+sal_uInt16 Button::ImplGetTextStyle( XubString& rText, WinBits nWinStyle,
+ sal_uLong nDrawFlags )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- USHORT nTextStyle = FixedText::ImplGetTextStyle( nWinStyle & ~WB_DEFBUTTON );
+ sal_uInt16 nTextStyle = FixedText::ImplGetTextStyle( nWinStyle & ~WB_DEFBUTTON );
if ( nDrawFlags & WINDOW_DRAW_NOMNEMONIC )
{
@@ -321,15 +321,15 @@ USHORT Button::ImplGetTextStyle( XubString& rText, WinBits nWinStyle,
// -----------------------------------------------------------------------
void Button::ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos,
- Size& rSize, BOOL bLayout,
- ULONG nImageSep, ULONG nDrawFlags,
- USHORT nTextStyle, Rectangle *pSymbolRect,
+ Size& rSize, sal_Bool bLayout,
+ sal_uLong nImageSep, sal_uLong nDrawFlags,
+ sal_uInt16 nTextStyle, Rectangle *pSymbolRect,
bool bAddImageSep )
{
XubString aText( GetText() );
- BOOL bDrawImage = HasImage() && ! ( ImplGetButtonState() & BUTTON_DRAW_NOIMAGE );
- BOOL bDrawText = aText.Len() && ! ( ImplGetButtonState() & BUTTON_DRAW_NOTEXT );
- BOOL bHasSymbol = pSymbolRect ? TRUE : FALSE;
+ sal_Bool bDrawImage = HasImage() && ! ( ImplGetButtonState() & BUTTON_DRAW_NOIMAGE );
+ sal_Bool bDrawText = aText.Len() && ! ( ImplGetButtonState() & BUTTON_DRAW_NOTEXT );
+ sal_Bool bHasSymbol = pSymbolRect ? sal_True : sal_False;
// No text and no image => nothing to do => return
if ( !bDrawImage && !bDrawText && !bHasSymbol )
@@ -580,7 +580,7 @@ void Button::ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos,
}
}
- USHORT nStyle = 0;
+ sal_uInt16 nStyle = 0;
if ( ! ( nDrawFlags & WINDOW_DRAW_NODISABLE ) &&
! IsEnabled() )
@@ -640,13 +640,13 @@ const Rectangle& Button::ImplGetFocusRect() const
}
// -----------------------------------------------------------------------
-USHORT& Button::ImplGetButtonState()
+sal_uInt16& Button::ImplGetButtonState()
{
return mpButtonData->mnButtonState;
}
// -----------------------------------------------------------------------
-USHORT Button::ImplGetButtonState() const
+sal_uInt16 Button::ImplGetButtonState() const
{
return mpButtonData->mnButtonState;
}
@@ -668,13 +668,13 @@ SymbolAlign Button::ImplGetSymbolAlign() const
}
// -----------------------------------------------------------------------
-void Button::ImplSetSmallSymbol( BOOL bSmall )
+void Button::ImplSetSmallSymbol( sal_Bool bSmall )
{
mpButtonData->mbSmallSymbol = bSmall;
}
// -----------------------------------------------------------------------
-void Button::EnableImageDisplay( BOOL bEnable )
+void Button::EnableImageDisplay( sal_Bool bEnable )
{
if( bEnable )
mpButtonData->mnButtonState &= ~BUTTON_DRAW_NOIMAGE;
@@ -683,13 +683,13 @@ void Button::EnableImageDisplay( BOOL bEnable )
}
// -----------------------------------------------------------------------
-BOOL Button::IsImageDisplayEnabled()
+sal_Bool Button::IsImageDisplayEnabled()
{
return (mpButtonData->mnButtonState & BUTTON_DRAW_NOIMAGE) == 0;
}
// -----------------------------------------------------------------------
-void Button::EnableTextDisplay( BOOL bEnable )
+void Button::EnableTextDisplay( sal_Bool bEnable )
{
if( bEnable )
mpButtonData->mnButtonState &= ~BUTTON_DRAW_NOTEXT;
@@ -698,53 +698,12 @@ void Button::EnableTextDisplay( BOOL bEnable )
}
// -----------------------------------------------------------------------
-BOOL Button::IsTextDisplayEnabled()
+sal_Bool Button::IsTextDisplayEnabled()
{
return (mpButtonData->mnButtonState & BUTTON_DRAW_NOTEXT) == 0;
}
// -----------------------------------------------------------------------
-void Button::DataChanged( const DataChangedEvent& rDCEvt )
-{
- Control::DataChanged( rDCEvt );
-
- // The flag SETTINGS_IN_UPDATE_SETTINGS is set when the settings changed due to a
- // Application::SettingsChanged event. In this scenario we want to keep the style settings
- // of our radio buttons and our check boxes.
- if ( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) &&
- ( rDCEvt.GetFlags() & SETTINGS_IN_UPDATE_SETTINGS ) )
-
- {
- const AllSettings* pOldSettings = rDCEvt.GetOldSettings();
- if ( pOldSettings )
- {
- BOOL bResetStyleSettings = FALSE;
- AllSettings aAllSettings = GetSettings();
- StyleSettings aStyleSetting = aAllSettings.GetStyleSettings();
-
- USHORT nCheckBoxStyle = aStyleSetting.GetCheckBoxStyle();
- if ( nCheckBoxStyle != pOldSettings->GetStyleSettings().GetCheckBoxStyle() )
- {
- aStyleSetting.SetCheckBoxStyle( pOldSettings->GetStyleSettings().GetCheckBoxStyle() );
- bResetStyleSettings = TRUE;
- }
-
- USHORT nRadioButtonStyle = aStyleSetting.GetRadioButtonStyle();
- if ( nRadioButtonStyle != pOldSettings->GetStyleSettings().GetRadioButtonStyle() )
- {
- aStyleSetting.SetRadioButtonStyle( pOldSettings->GetStyleSettings().GetRadioButtonStyle() );
- bResetStyleSettings = TRUE;
- }
-
- if ( bResetStyleSettings )
- {
- aAllSettings.SetStyleSettings( pOldSettings->GetStyleSettings() );
- SetSettings( aAllSettings );
- }
- }
- }
-}
-
void Button::SetSmallSymbol (bool small)
{
ImplSetSmallSymbol (small);
@@ -759,14 +718,14 @@ bool Button::IsSmallSymbol () const
void PushButton::ImplInitPushButtonData()
{
- mpWindowImpl->mbPushButton = TRUE;
+ mpWindowImpl->mbPushButton = sal_True;
meSymbol = SYMBOL_NOSYMBOL;
meState = STATE_NOCHECK;
meSaveValue = STATE_NOCHECK;
mnDDStyle = 0;
- mbPressed = FALSE;
- mbInUserDraw = FALSE;
+ mbPressed = sal_False;
+ mbInUserDraw = sal_False;
}
// -----------------------------------------------------------------------
@@ -779,7 +738,7 @@ void PushButton::ImplInit( Window* pParent, WinBits nStyle )
if ( nStyle & WB_NOLIGHTBORDER )
ImplGetButtonState() |= BUTTON_DRAW_NOLIGHTBORDER;
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
}
// -----------------------------------------------------------------------
@@ -820,8 +779,8 @@ const Color& PushButton::GetCanonicalTextColor( const StyleSettings& _rStyle ) c
// -----------------------------------------------------------------------
-void PushButton::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void PushButton::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
Button::ImplInitSettings( bFont, bForeground );
@@ -831,20 +790,21 @@ void PushButton::ImplInitSettings( BOOL bFont,
// #i38498#: do not check for GetParent()->IsChildTransparentModeEnabled()
// otherwise the formcontrol button will be overdrawn due to PARENTCLIPMODE_NOCLIP
// for radio and checkbox this is ok as they shoud appear transparent in documents
- if ( IsNativeControlSupported( CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL ) )
+ if ( IsNativeControlSupported( CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL ) ||
+ (GetStyle() & WB_FLATBUTTON) != 0 )
{
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
mpWindowImpl->mbUseNativeFocus = (GetStyle() & WB_FLATBUTTON)
? false
: ImplGetSVData()->maNWFData.mbNoFocusRects;
}
else
{
- EnableChildTransparentMode( FALSE );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
}
}
}
@@ -852,132 +812,13 @@ void PushButton::ImplInitSettings( BOOL bFont,
// -----------------------------------------------------------------------
void PushButton::ImplDrawPushButtonFrame( Window* pDev,
- Rectangle& rRect, USHORT nStyle )
+ Rectangle& rRect, sal_uInt16 nStyle )
{
if ( !(pDev->GetStyle() & (WB_RECTSTYLE | WB_SMALLSTYLE)) )
{
StyleSettings aStyleSettings = pDev->GetSettings().GetStyleSettings();
if ( pDev->IsControlBackground() )
aStyleSettings.Set3DColors( pDev->GetControlBackground() );
-
- USHORT nPushButtonSysStyle = aStyleSettings.GetPushButtonStyle() & STYLE_PUSHBUTTON_STYLE;
- if ( nPushButtonSysStyle == STYLE_PUSHBUTTON_MAC )
- {
- pDev->SetLineColor();
- pDev->SetFillColor( aStyleSettings.GetFaceColor() );
- pDev->DrawRect( rRect );
-
- if ( (aStyleSettings.GetOptions() & STYLE_OPTION_MONO) ||
- (pDev->GetOutDevType() == OUTDEV_PRINTER) )
- nStyle |= BUTTON_DRAW_MONO;
-
- if ( nStyle & BUTTON_DRAW_DEFAULT )
- {
- if ( nStyle & BUTTON_DRAW_MONO )
- pDev->SetLineColor( Color( COL_BLACK ) );
- else
- pDev->SetLineColor( aStyleSettings.GetDarkShadowColor() );
-
- pDev->DrawLine( Point( rRect.Left()+3, rRect.Top() ),
- Point( rRect.Right()-3, rRect.Top() ) );
- pDev->DrawLine( Point( rRect.Left()+3, rRect.Bottom() ),
- Point( rRect.Right()-3, rRect.Bottom() ) );
- pDev->DrawLine( Point( rRect.Left(), rRect.Top()+3 ),
- Point( rRect.Left(), rRect.Bottom()-3 ) );
- pDev->DrawLine( Point( rRect.Right(), rRect.Top()+3 ),
- Point( rRect.Right(), rRect.Bottom()-3 ) );
- pDev->DrawPixel( Point( rRect.Left()+2, rRect.Top()+1 ) );
- pDev->DrawPixel( Point( rRect.Left()+1, rRect.Top()+2 ) );
- pDev->DrawPixel( Point( rRect.Right()-2, rRect.Top()+1 ) );
- pDev->DrawPixel( Point( rRect.Right()-1, rRect.Top()+2 ) );
- pDev->DrawPixel( Point( rRect.Left()+2, rRect.Bottom()-1 ) );
- pDev->DrawPixel( Point( rRect.Left()+1, rRect.Bottom()-2 ) );
- pDev->DrawPixel( Point( rRect.Right()-2, rRect.Bottom()-1 ) );
- pDev->DrawPixel( Point( rRect.Right()-1, rRect.Bottom()-2 ) );
-
- if ( nStyle & BUTTON_DRAW_MONO )
- pDev->SetLineColor( Color( COL_BLACK ) );
- else
- pDev->SetLineColor( aStyleSettings.GetShadowColor() );
- pDev->DrawLine( Point( rRect.Left()+3, rRect.Bottom()-1 ),
- Point( rRect.Right()-3, rRect.Bottom()-1 ) );
- pDev->DrawLine( Point( rRect.Right()-1, rRect.Top()+3 ),
- Point( rRect.Right()-1, rRect.Bottom()-3 ) );
- pDev->DrawPixel( Point( rRect.Right()-3, rRect.Bottom()-2 ) );
- pDev->DrawPixel( Point( rRect.Right()-2, rRect.Bottom()-2 ) );
- pDev->DrawPixel( Point( rRect.Right()-2, rRect.Bottom()-3 ) );
- }
-
- rRect.Left() += 2;
- rRect.Top() += 2;
- rRect.Right() -= 2;
- rRect.Bottom() -= 2;
-
- if ( nStyle & BUTTON_DRAW_MONO )
- pDev->SetLineColor( Color( COL_BLACK ) );
- else
- pDev->SetLineColor( aStyleSettings.GetDarkShadowColor() );
-
- pDev->DrawLine( Point( rRect.Left()+2, rRect.Top() ),
- Point( rRect.Right()-2, rRect.Top() ) );
- pDev->DrawLine( Point( rRect.Left()+2, rRect.Bottom() ),
- Point( rRect.Right()-2, rRect.Bottom() ) );
- pDev->DrawLine( Point( rRect.Left(), rRect.Top()+2 ),
- Point( rRect.Left(), rRect.Bottom()-2 ) );
- pDev->DrawLine( Point( rRect.Right(), rRect.Top()+2 ),
- Point( rRect.Right(), rRect.Bottom()-2 ) );
- pDev->DrawPixel( Point( rRect.Left()+1, rRect.Top()+1 ) );
- pDev->DrawPixel( Point( rRect.Right()-1, rRect.Top()+1 ) );
- pDev->DrawPixel( Point( rRect.Left()+1, rRect.Bottom()-1 ) );
- pDev->DrawPixel( Point( rRect.Right()-1, rRect.Bottom()-1 ) );
-
- pDev->SetLineColor();
- if ( nStyle & BUTTON_DRAW_CHECKED )
- pDev->SetFillColor( aStyleSettings.GetCheckedColor() );
- else
- pDev->SetFillColor( aStyleSettings.GetFaceColor() );
- pDev->DrawRect( Rectangle( rRect.Left()+2, rRect.Top()+2, rRect.Right()-2, rRect.Bottom()-2 ) );
-
- if ( !(nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED)) )
- {
- if ( nStyle & BUTTON_DRAW_MONO )
- pDev->SetLineColor( Color( COL_BLACK ) );
- else
- pDev->SetLineColor( aStyleSettings.GetShadowColor() );
- pDev->DrawLine( Point( rRect.Left()+2, rRect.Bottom()-1 ),
- Point( rRect.Right()-2, rRect.Bottom()-1 ) );
- pDev->DrawLine( Point( rRect.Right()-1, rRect.Top()+2 ),
- Point( rRect.Right()-1, rRect.Bottom()-2 ) );
- pDev->DrawPixel( Point( rRect.Right()-2, rRect.Bottom()-2 ) );
- pDev->SetLineColor( aStyleSettings.GetLightColor() );
- }
- else
- pDev->SetLineColor( aStyleSettings.GetShadowColor() );
-
- if ( !(nStyle & BUTTON_DRAW_MONO) )
- {
- pDev->DrawLine( Point( rRect.Left()+2, rRect.Top()+1 ),
- Point( rRect.Right()-2, rRect.Top()+1 ) );
- pDev->DrawLine( Point( rRect.Left()+1, rRect.Top()+2 ),
- Point( rRect.Left()+1, rRect.Bottom()-2 ) );
- pDev->DrawPixel( Point( rRect.Top()+2, rRect.Right()+2 ) );
- }
-
- rRect.Left() += 2;
- rRect.Top() += 2;
- rRect.Right() -= 2;
- rRect.Bottom() -= 2;
-
- if ( nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED) )
- {
- rRect.Left()++;
- rRect.Top()++;
- rRect.Right()++;
- rRect.Bottom()++;
- }
-
- return;
- }
}
DecorationView aDecoView( pDev );
@@ -998,36 +839,22 @@ void PushButton::ImplDrawPushButtonFrame( Window* pDev,
// -----------------------------------------------------------------------
-BOOL PushButton::ImplHitTestPushButton( Window* pDev,
+sal_Bool PushButton::ImplHitTestPushButton( Window* pDev,
const Point& rPos )
{
Point aTempPoint;
Rectangle aTestRect( aTempPoint, pDev->GetOutputSizePixel() );
- if ( !(pDev->GetStyle() & (WB_RECTSTYLE | WB_SMALLSTYLE)) )
- {
- const StyleSettings& rStyleSettings = pDev->GetSettings().GetStyleSettings();
-
- USHORT nPushButtonSysStyle = rStyleSettings.GetPushButtonStyle() & STYLE_PUSHBUTTON_STYLE;
- if ( nPushButtonSysStyle == STYLE_PUSHBUTTON_MAC )
- {
- aTestRect.Left() += 2;
- aTestRect.Top() += 2;
- aTestRect.Right() -= 2;
- aTestRect.Bottom() -= 2;
- }
- }
-
return aTestRect.IsInside( rPos );
}
// -----------------------------------------------------------------------
-USHORT PushButton::ImplGetTextStyle( ULONG nDrawFlags ) const
+sal_uInt16 PushButton::ImplGetTextStyle( sal_uLong nDrawFlags ) const
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- USHORT nTextStyle = TEXT_DRAW_MNEMONIC | TEXT_DRAW_MULTILINE | TEXT_DRAW_ENDELLIPSIS;
+ sal_uInt16 nTextStyle = TEXT_DRAW_MNEMONIC | TEXT_DRAW_MULTILINE | TEXT_DRAW_ENDELLIPSIS;
if ( ( rStyleSettings.GetOptions() & STYLE_OPTION_MONO ) ||
( nDrawFlags & WINDOW_DRAW_MONO ) )
@@ -1062,7 +889,7 @@ USHORT PushButton::ImplGetTextStyle( ULONG nDrawFlags ) const
static void ImplDrawBtnDropDownArrow( OutputDevice* pDev,
long nX, long nY,
- Color& rColor, BOOL bBlack )
+ Color& rColor, sal_Bool bBlack )
{
Color aOldLineColor = pDev->GetLineColor();
Color aOldFillColor = pDev->GetFillColor();
@@ -1088,16 +915,18 @@ static void ImplDrawBtnDropDownArrow( OutputDevice* pDev,
// -----------------------------------------------------------------------
-void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags,
+void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, sal_uLong nDrawFlags,
const Rectangle& rRect,
- bool bLayout )
+ bool bLayout,
+ bool bMenuBtnSep
+ )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
Rectangle aInRect = rRect;
Color aColor;
XubString aText = PushButton::GetText(); // PushButton:: wegen MoreButton
- USHORT nTextStyle = ImplGetTextStyle( nDrawFlags );
- USHORT nStyle;
+ sal_uInt16 nTextStyle = ImplGetTextStyle( nDrawFlags );
+ sal_uInt16 nStyle;
if( aInRect.nRight < aInRect.nLeft || aInRect.nBottom < aInRect.nTop )
aInRect.SetEmpty();
@@ -1124,7 +953,7 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags
Size aSize = rRect.GetSize();
Point aPos = rRect.TopLeft();
- ULONG nImageSep = 1 + (pDev->GetTextHeight()-10)/2;
+ sal_uLong nImageSep = 1 + (pDev->GetTextHeight()-10)/2;
if( nImageSep < 1 )
nImageSep = 1;
if ( mnDDStyle == PUSHBUTTON_DROPDOWN_MENUBUTTON )
@@ -1138,19 +967,22 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags
aSize.Width() -= ( 5 + nSymbolSize );
ImplDrawAlignedImage( pDev, aPos, aSize, bLayout, nImageSep,
- nDrawFlags, nTextStyle, NULL, (GetStyle() & WB_FLATBUTTON) != 0 );
+ nDrawFlags, nTextStyle, NULL, true );
}
else
ImplCalcSymbolRect( aInRect );
if( ! bLayout )
{
- DecorationView aDecoView( pDev );
long nDistance = (aInRect.GetHeight() > 10) ? 2 : 1;
- long nX = aInRect.Left() - 2*nDistance;;
- Point aStartPt( nX, aInRect.Top()+nDistance );
- Point aEndPt( nX, aInRect.Bottom()-nDistance );
- aDecoView.DrawSeparator( aStartPt, aEndPt );
+ DecorationView aDecoView( pDev );
+ if( bMenuBtnSep )
+ {
+ long nX = aInRect.Left() - 2*nDistance;;
+ Point aStartPt( nX, aInRect.Top()+nDistance );
+ Point aEndPt( nX, aInRect.Bottom()-nDistance );
+ aDecoView.DrawSeparator( aStartPt, aEndPt );
+ }
aDecoView.DrawSymbol( aInRect, SYMBOL_SPIN_DOWN, aColor, nStyle );
aInRect.Left() -= 2*nDistance;
ImplSetSymbolRect( aInRect );
@@ -1162,7 +994,7 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags
// FIXME: (GetStyle() & WB_FLATBUTTON) != 0 is preliminary
// in the next major this should be replaced by "true"
ImplDrawAlignedImage( pDev, aPos, aSize, bLayout, nImageSep, nDrawFlags,
- nTextStyle, IsSymbol() ? &aSymbolRect : NULL, (GetStyle() & WB_FLATBUTTON) != 0 );
+ nTextStyle, IsSymbol() ? &aSymbolRect : NULL, true );
if ( IsSymbol() && ! bLayout )
{
@@ -1173,7 +1005,7 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags
if ( mnDDStyle == PUSHBUTTON_DROPDOWN_TOOLBOX && !bLayout )
{
- BOOL bBlack = FALSE;
+ sal_Bool bBlack = sal_False;
Color aArrowColor( COL_BLACK );
if ( !(nDrawFlags & WINDOW_DRAW_MONO) )
@@ -1183,7 +1015,7 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags
else
{
aArrowColor = Color( COL_LIGHTGREEN );
- bBlack = TRUE;
+ bBlack = sal_True;
}
}
@@ -1211,13 +1043,13 @@ void PushButton::ImplDrawPushButton( bool bLayout )
if( !bLayout )
HideFocus();
- USHORT nButtonStyle = ImplGetButtonState();
+ sal_uInt16 nButtonStyle = ImplGetButtonState();
Point aPoint;
Size aOutSz( GetOutputSizePixel() );
Rectangle aRect( aPoint, aOutSz );
Rectangle aInRect = aRect;
Rectangle aTextRect;
- BOOL bNativeOK = FALSE;
+ sal_Bool bNativeOK = sal_False;
// adjust style if button should be rendered 'pressed'
if ( mbPressed )
@@ -1247,7 +1079,7 @@ void PushButton::ImplDrawPushButton( bool bLayout )
break;
}
- BOOL bDropDown = ( IsSymbol() && (GetSymbol()==SYMBOL_SPIN_DOWN) && !GetText().Len() );
+ sal_Bool bDropDown = ( IsSymbol() && (GetSymbol()==SYMBOL_SPIN_DOWN) && !GetText().Len() );
if( bDropDown && (aCtrlType == CTRL_COMBOBOX || aCtrlType == CTRL_LISTBOX ) )
{
@@ -1258,11 +1090,11 @@ void PushButton::ImplDrawPushButton( bool bLayout )
{
Edit* pEdit = static_cast<Edit*>(GetParent());
if( pEdit->ImplUseNativeBorder( pEdit->GetStyle() ) )
- bNativeOK = TRUE;
+ bNativeOK = sal_True;
}
else if( GetParent()->IsNativeControlSupported( aCtrlType, HAS_BACKGROUND_TEXTURE) )
{
- bNativeOK = TRUE;
+ bNativeOK = sal_True;
}
if( !bNativeOK && GetParent()->IsNativeControlSupported( aCtrlType, PART_BUTTON_DOWN ) )
{
@@ -1291,7 +1123,13 @@ void PushButton::ImplDrawPushButton( bool bLayout )
return;
bool bRollOver = (IsMouseOver() && aInRect.IsInside( GetPointerPosPixel() ));
- if ( (bNativeOK=IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL)) == TRUE )
+ bool bDrawMenuSep = true;
+ if( (GetStyle() & WB_FLATBUTTON) )
+ {
+ if( ! bRollOver && ! HasFocus() )
+ bDrawMenuSep = false;
+ }
+ if ( (bNativeOK=IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL)) == sal_True )
{
PushButtonValue aControlValue;
Rectangle aCtrlRegion( aInRect );
@@ -1341,13 +1179,13 @@ void PushButton::ImplDrawPushButton( bool bLayout )
// draw content using the same aInRect as non-native VCL would do
ImplDrawPushButtonContent( this,
(nState&CTRL_STATE_ROLLOVER) ? WINDOW_DRAW_ROLLOVER : 0,
- aInRect, bLayout );
+ aInRect, bLayout, bDrawMenuSep );
if ( HasFocus() )
ShowFocus( ImplGetFocusRect() );
}
- if ( bNativeOK == FALSE )
+ if ( bNativeOK == sal_False )
{
// draw PushButtonFrame, aInRect has content size afterwards
if( (GetStyle() & WB_FLATBUTTON) )
@@ -1367,7 +1205,7 @@ void PushButton::ImplDrawPushButton( bool bLayout )
}
// draw content
- ImplDrawPushButtonContent( this, 0, aInRect, bLayout );
+ ImplDrawPushButtonContent( this, 0, aInRect, bLayout, bDrawMenuSep );
if( ! bLayout && HasFocus() )
{
@@ -1378,14 +1216,14 @@ void PushButton::ImplDrawPushButton( bool bLayout )
// -----------------------------------------------------------------------
-void PushButton::ImplSetDefButton( BOOL bSet )
+void PushButton::ImplSetDefButton( sal_Bool bSet )
{
Size aSize( GetSizePixel() );
Point aPos( GetPosPixel() );
int dLeft(0), dRight(0), dTop(0), dBottom(0);
- BOOL bSetPos = FALSE;
+ sal_Bool bSetPos = sal_False;
- if ( (IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL)) == TRUE )
+ if ( (IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL)) == sal_True )
{
Rectangle aBound, aCont;
Rectangle aCtrlRect( 0, 0, 80, 20 ); // use a constant size to avoid accumulating
@@ -1438,7 +1276,7 @@ void PushButton::ImplSetDefButton( BOOL bSet )
// -----------------------------------------------------------------------
-BOOL PushButton::ImplIsDefButton() const
+sal_Bool PushButton::ImplIsDefButton() const
{
return (ImplGetButtonState() & BUTTON_DRAW_DEFAULT) != 0;
}
@@ -1488,7 +1326,7 @@ void PushButton::MouseButtonDown( const MouseEvent& rMEvt )
if ( rMEvt.IsLeft() &&
ImplHitTestPushButton( this, rMEvt.GetPosPixel() ) )
{
- USHORT nTrackFlags = 0;
+ sal_uInt16 nTrackFlags = 0;
if ( ( GetStyle() & WB_REPEAT ) &&
! ( GetStyle() & WB_TOGGLE ) )
@@ -1521,11 +1359,11 @@ void PushButton::Tracking( const TrackingEvent& rTEvt )
{
if ( IsChecked() )
{
- Check( FALSE );
+ Check( sal_False );
ImplGetButtonState() &= ~BUTTON_DRAW_PRESSED;
}
else
- Check( TRUE );
+ Check( sal_True );
}
}
else
@@ -1610,11 +1448,11 @@ void PushButton::KeyUp( const KeyEvent& rKEvt )
{
if ( IsChecked() )
{
- Check( FALSE );
+ Check( sal_False );
ImplGetButtonState() &= ~BUTTON_DRAW_PRESSED;
}
else
- Check( TRUE );
+ Check( sal_True );
Toggle();
}
@@ -1649,7 +1487,7 @@ void PushButton::Paint( const Rectangle& )
// -----------------------------------------------------------------------
void PushButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- ULONG nFlags )
+ sal_uLong nFlags )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -1681,14 +1519,14 @@ void PushButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
pDev->SetTextFillColor();
DecorationView aDecoView( pDev );
- USHORT nButtonStyle = 0;
+ sal_uInt16 nButtonStyle = 0;
if ( nFlags & WINDOW_DRAW_MONO )
nButtonStyle |= BUTTON_DRAW_MONO;
if ( IsChecked() )
nButtonStyle |= BUTTON_DRAW_CHECKED;
aRect = aDecoView.DrawButton( aRect, nButtonStyle );
- ImplDrawPushButtonContent( pDev, nFlags, aRect, false );
+ ImplDrawPushButtonContent( pDev, nFlags, aRect, false, true );
pDev->Pop();
}
@@ -1753,17 +1591,17 @@ void PushButton::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();
}
}
@@ -1779,7 +1617,7 @@ void PushButton::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
}
@@ -1821,7 +1659,7 @@ long PushButton::PreNotify( NotifyEvent& rNEvt )
break;
}
- BOOL bDropDown = ( IsSymbol() && (GetSymbol()==SYMBOL_SPIN_DOWN) && !GetText().Len() );
+ sal_Bool bDropDown = ( IsSymbol() && (GetSymbol()==SYMBOL_SPIN_DOWN) && !GetText().Len() );
if( bDropDown && GetParent()->IsNativeControlSupported( aCtrlType, PART_ENTIRE_CONTROL) &&
!GetParent()->IsNativeControlSupported( aCtrlType, PART_BUTTON_DOWN) )
@@ -1884,7 +1722,7 @@ SymbolAlign PushButton::GetSymbolAlign() const
// -----------------------------------------------------------------------
-void PushButton::SetDropDown( USHORT nStyle )
+void PushButton::SetDropDown( sal_uInt16 nStyle )
{
if ( mnDDStyle != nStyle )
{
@@ -1920,7 +1758,7 @@ void PushButton::SetState( TriState eState )
// -----------------------------------------------------------------------
-void PushButton::SetPressed( BOOL bPressed )
+void PushButton::SetPressed( sal_Bool bPressed )
{
if ( mbPressed != bPressed )
{
@@ -1961,7 +1799,7 @@ Size PushButton::CalcMinimumSize( long nMaxWidth ) const
aSize = GetModeImage().GetSizePixel();
if ( PushButton::GetText().Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) )
{
- ULONG nDrawFlags = 0;
+ sal_uLong nDrawFlags = 0;
Size textSize = GetTextRect( Rectangle( Point(), Size( nMaxWidth ? nMaxWidth : 0x7fffffff, 0x7fffffff ) ),
PushButton::GetText(), ImplGetTextStyle( nDrawFlags ) ).GetSize();
aSize.Width() += int( textSize.Width () * 1.15 );
@@ -2034,7 +1872,7 @@ void OKButton::Click()
if ( pParent->IsDialog() )
{
if ( ((Dialog*)pParent)->IsInExecute() )
- ((Dialog*)pParent)->EndDialog( TRUE );
+ ((Dialog*)pParent)->EndDialog( sal_True );
// gegen rekursive Aufrufe schuetzen
else if ( !((Dialog*)pParent)->IsInClose() )
{
@@ -2100,7 +1938,7 @@ void CancelButton::Click()
if ( pParent->IsDialog() )
{
if ( ((Dialog*)pParent)->IsInExecute() )
- ((Dialog*)pParent)->EndDialog( FALSE );
+ ((Dialog*)pParent)->EndDialog( sal_False );
// gegen rekursive Aufrufe schuetzen
else if ( !((Dialog*)pParent)->IsInClose() )
{
@@ -2174,10 +2012,10 @@ void HelpButton::Click()
void RadioButton::ImplInitRadioButtonData()
{
- mbChecked = FALSE;
- mbSaveValue = FALSE;
- mbRadioCheck = TRUE;
- mbStateChanged = FALSE;
+ mbChecked = sal_False;
+ mbSaveValue = sal_False;
+ mbRadioCheck = sal_True;
+ mbStateChanged = sal_False;
}
// -----------------------------------------------------------------------
@@ -2187,7 +2025,7 @@ void RadioButton::ImplInit( Window* pParent, WinBits nStyle )
nStyle = ImplInitStyle( pParent->GetWindow( WINDOW_LASTCHILD ), nStyle );
Button::ImplInit( pParent, nStyle, NULL );
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
}
// -----------------------------------------------------------------------
@@ -2222,8 +2060,8 @@ const Color& RadioButton::GetCanonicalTextColor( const StyleSettings& _rStyle )
// -----------------------------------------------------------------------
-void RadioButton::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void RadioButton::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
Button::ImplInitSettings( bFont, bForeground );
@@ -2233,18 +2071,18 @@ void RadioButton::ImplInitSettings( BOOL bFont,
if ( !IsControlBackground() &&
(pParent->IsChildTransparentModeEnabled() || IsNativeControlSupported( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL ) ) )
{
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
if( IsNativeControlSupported( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL ) )
mpWindowImpl->mbUseNativeFocus = ImplGetSVData()->maNWFData.mbNoFocusRects;
}
else
{
- EnableChildTransparentMode( FALSE );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -2277,10 +2115,10 @@ void RadioButton::ImplInvalidateOrDrawRadioButtonState()
void RadioButton::ImplDrawRadioButtonState()
{
- BOOL bNativeOK = FALSE;
+ sal_Bool bNativeOK = sal_False;
// no native drawing for image radio buttons
- if ( !maImage && (bNativeOK=IsNativeControlSupported(CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL)) == TRUE )
+ if ( !maImage && (bNativeOK=IsNativeControlSupported(CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL)) == sal_True )
{
ImplControlValue aControlValue( mbChecked ? BUTTONVALUE_ON : BUTTONVALUE_OFF );
Rectangle aCtrlRect( maStateRect.TopLeft(), maStateRect.GetSize() );
@@ -2299,12 +2137,12 @@ void RadioButton::ImplDrawRadioButtonState()
}
-if ( bNativeOK == FALSE )
+if ( bNativeOK == sal_False )
{
// kein Image-RadioButton
if ( !maImage )
{
- USHORT nStyle = ImplGetButtonState();
+ sal_uInt16 nStyle = ImplGetButtonState();
if ( !IsEnabled() )
nStyle |= BUTTON_DRAW_DISABLED;
if ( mbChecked )
@@ -2323,8 +2161,8 @@ if ( bNativeOK == FALSE )
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
Rectangle aImageRect = maStateRect;
Size aImageSize = maImage.GetSizePixel();
- BOOL bEnabled = IsEnabled();
- USHORT nButtonStyle = FRAME_DRAW_DOUBLEIN;
+ sal_Bool bEnabled = IsEnabled();
+ sal_uInt16 nButtonStyle = FRAME_DRAW_DOUBLEIN;
aImageSize.Width() = CalcZoom( aImageSize.Width() );
aImageSize.Height() = CalcZoom( aImageSize.Height() );
@@ -2387,7 +2225,7 @@ if ( bNativeOK == FALSE )
// -----------------------------------------------------------------------
-void RadioButton::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+void RadioButton::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize,
const Size& rImageSize, Rectangle& rStateRect,
Rectangle& rMouseRect, bool bLayout )
@@ -2407,7 +2245,7 @@ void RadioButton::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
if ( ( aText.Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) ) ||
( HasImage() && ! (ImplGetButtonState() & BUTTON_DRAW_NOIMAGE) ) )
{
- USHORT nTextStyle = Button::ImplGetTextStyle( aText, nWinStyle, nDrawFlags );
+ sal_uInt16 nTextStyle = Button::ImplGetTextStyle( aText, nWinStyle, nDrawFlags );
const long nImageSep = GetDrawPixel( pDev, ImplGetImageToTextDistance() );
Size aSize( rSize );
@@ -2481,7 +2319,7 @@ da im Writer ansonsten die Images noch weiter oben haengen
}
else
{
- BOOL bTopImage = (nWinStyle & WB_TOP) != 0;
+ sal_Bool bTopImage = (nWinStyle & WB_TOP) != 0;
Size aImageSize = maImage.GetSizePixel();
Rectangle aImageRect( rPos, rSize );
long nTextHeight = pDev->GetTextHeight();
@@ -2543,7 +2381,7 @@ void RadioButton::ImplDrawRadioButton( bool bLayout )
ImplDraw( this, 0, Point(), GetOutputSizePixel(),
aImageSize, maStateRect, maMouseRect, bLayout );
- if( !bLayout || (IsNativeControlSupported(CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL)==TRUE) )
+ if( !bLayout || (IsNativeControlSupported(CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL)==sal_True) )
{
if ( !maImage && HasFocus() )
ShowFocus( ImplGetFocusRect() );
@@ -2603,7 +2441,7 @@ void RadioButton::ImplUncheckAllOther()
{
ImplDelData aDelData;
pWindow->ImplAddDel( &aDelData );
- ((RadioButton*)pWindow)->SetState( FALSE );
+ ((RadioButton*)pWindow)->SetState( sal_False );
if ( aDelData.IsDelete() )
return;
pWindow->ImplRemoveDel( &aDelData );
@@ -2634,7 +2472,7 @@ void RadioButton::ImplUncheckAllOther()
{
ImplDelData aDelData;
pWindow->ImplAddDel( &aDelData );
- ((RadioButton*)pWindow)->SetState( FALSE );
+ ((RadioButton*)pWindow)->SetState( sal_False );
if ( aDelData.IsDelete() )
return;
pWindow->ImplRemoveDel( &aDelData );
@@ -2650,10 +2488,10 @@ void RadioButton::ImplUncheckAllOther()
// -----------------------------------------------------------------------
-void RadioButton::ImplCallClick( BOOL bGrabFocus, USHORT nFocusFlags )
+void RadioButton::ImplCallClick( sal_Bool bGrabFocus, sal_uInt16 nFocusFlags )
{
mbStateChanged = !mbChecked;
- mbChecked = TRUE;
+ mbChecked = sal_True;
mpWindowImpl->mnStyle |= WB_TABSTOP;
ImplInvalidateOrDrawRadioButtonState();
ImplDelData aDelData;
@@ -2674,7 +2512,7 @@ void RadioButton::ImplCallClick( BOOL bGrabFocus, USHORT nFocusFlags )
if ( aDelData.IsDelete() )
return;
ImplRemoveDel( &aDelData );
- mbStateChanged = FALSE;
+ mbStateChanged = sal_False;
}
// -----------------------------------------------------------------------
@@ -2708,9 +2546,9 @@ void RadioButton::ImplLoadRes( const ResId& rResId )
Button::ImplLoadRes( rResId );
//anderer Wert als Default ?
- USHORT nChecked = ReadShortRes();
+ sal_uInt16 nChecked = ReadShortRes();
if ( nChecked )
- SetState( TRUE );
+ SetState( sal_True );
}
// -----------------------------------------------------------------------
@@ -2831,7 +2669,7 @@ void RadioButton::Paint( const Rectangle& )
// -----------------------------------------------------------------------
void RadioButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- ULONG nFlags )
+ sal_uLong nFlags )
{
if ( !maImage )
{
@@ -2970,17 +2808,17 @@ void RadioButton::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();
}
}
@@ -2996,7 +2834,7 @@ void RadioButton::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
}
@@ -3039,14 +2877,14 @@ void RadioButton::Toggle()
// -----------------------------------------------------------------------
-BOOL RadioButton::SetModeRadioImage( const Image& rImage )
+sal_Bool RadioButton::SetModeRadioImage( const Image& rImage )
{
if ( rImage != maImage )
{
maImage = rImage;
StateChanged( STATE_CHANGE_DATA );
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -3058,7 +2896,7 @@ const Image& RadioButton::GetModeRadioImage( ) const
// -----------------------------------------------------------------------
-void RadioButton::SetState( BOOL bCheck )
+void RadioButton::SetState( sal_Bool bCheck )
{
// TabStop-Flag richtig mitfuehren
if ( bCheck )
@@ -3076,7 +2914,7 @@ void RadioButton::SetState( BOOL bCheck )
// -----------------------------------------------------------------------
-void RadioButton::Check( BOOL bCheck )
+void RadioButton::Check( sal_Bool bCheck )
{
// TabStop-Flag richtig mitfuehren
if ( bCheck )
@@ -3142,7 +2980,7 @@ Size RadioButton::ImplGetRadioImageSize() const
static void LoadThemedImageList (const StyleSettings &rStyleSettings,
ImageList *pList, const ResId &rResId,
- USHORT nImages)
+ sal_uInt16 nImages)
{
Color aColorAry1[6];
Color aColorAry2[6];
@@ -3166,11 +3004,11 @@ static void LoadThemedImageList (const StyleSettings &rStyleSettings,
aColorAry1, aColorAry2, sizeof(aColorAry1) / sizeof(Color));
}
-Image RadioButton::GetRadioImage( const AllSettings& rSettings, USHORT nFlags )
+Image RadioButton::GetRadioImage( const AllSettings& rSettings, sal_uInt16 nFlags )
{
ImplSVData* pSVData = ImplGetSVData();
const StyleSettings& rStyleSettings = rSettings.GetStyleSettings();
- USHORT nStyle = rStyleSettings.GetRadioButtonStyle() & STYLE_RADIOBUTTON_STYLE;
+ sal_uInt16 nStyle = 0;
if ( rStyleSettings.GetOptions() & STYLE_OPTION_MONO )
nStyle = STYLE_RADIOBUTTON_MONO;
@@ -3213,7 +3051,7 @@ Image RadioButton::GetRadioImage( const AllSettings& rSettings, USHORT nFlags )
pSVData->maCtrlData.mnRadioStyle = nStyle;
}
- USHORT nId;
+ sal_uInt16 nId;
if ( nFlags & BUTTON_DRAW_DISABLED )
{
if ( nFlags & BUTTON_DRAW_CHECKED )
@@ -3323,7 +3161,7 @@ void CheckBox::ImplInitCheckBoxData()
{
meState = STATE_NOCHECK;
meSaveValue = STATE_NOCHECK;
- mbTriState = FALSE;
+ mbTriState = sal_False;
}
// -----------------------------------------------------------------------
@@ -3333,7 +3171,7 @@ void CheckBox::ImplInit( Window* pParent, WinBits nStyle )
nStyle = ImplInitStyle( pParent->GetWindow( WINDOW_LASTCHILD ), nStyle );
Button::ImplInit( pParent, nStyle, NULL );
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
}
// -----------------------------------------------------------------------
@@ -3363,8 +3201,8 @@ const Color& CheckBox::GetCanonicalTextColor( const StyleSettings& _rStyle ) con
// -----------------------------------------------------------------------
-void CheckBox::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void CheckBox::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
Button::ImplInitSettings( bFont, bForeground );
@@ -3374,18 +3212,18 @@ void CheckBox::ImplInitSettings( BOOL bFont,
if ( !IsControlBackground() &&
(pParent->IsChildTransparentModeEnabled() || IsNativeControlSupported( CTRL_CHECKBOX, PART_ENTIRE_CONTROL ) ) )
{
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
if( IsNativeControlSupported( CTRL_CHECKBOX, PART_ENTIRE_CONTROL ) )
ImplGetWindowImpl()->mbUseNativeFocus = ImplGetSVData()->maNWFData.mbNoFocusRects;
}
else
{
- EnableChildTransparentMode( FALSE );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -3403,10 +3241,10 @@ void CheckBox::ImplLoadRes( const ResId& rResId )
if ( rResId.GetRT() != RSC_TRISTATEBOX )
{
- USHORT nChecked = ReadShortRes();
+ sal_uInt16 nChecked = ReadShortRes();
//anderer Wert als Default ?
if( nChecked )
- Check( TRUE );
+ Check( sal_True );
}
}
@@ -3428,9 +3266,9 @@ void CheckBox::ImplInvalidateOrDrawCheckBoxState()
void CheckBox::ImplDrawCheckBoxState()
{
- bool bNativeOK = TRUE;
+ bool bNativeOK = sal_True;
- if ( (bNativeOK=IsNativeControlSupported(CTRL_CHECKBOX, PART_ENTIRE_CONTROL)) == TRUE )
+ if ( (bNativeOK=IsNativeControlSupported(CTRL_CHECKBOX, PART_ENTIRE_CONTROL)) == sal_True )
{
ImplControlValue aControlValue( meState == STATE_CHECK ? BUTTONVALUE_ON : BUTTONVALUE_OFF );
Rectangle aCtrlRegion( maStateRect );
@@ -3453,9 +3291,9 @@ void CheckBox::ImplDrawCheckBoxState()
aControlValue, rtl::OUString() );
}
- if ( bNativeOK == FALSE )
+ if ( bNativeOK == sal_False )
{
- USHORT nStyle = ImplGetButtonState();
+ sal_uInt16 nStyle = ImplGetButtonState();
if ( !IsEnabled() )
nStyle |= BUTTON_DRAW_DISABLED;
if ( meState == STATE_DONTKNOW )
@@ -3472,7 +3310,7 @@ void CheckBox::ImplDrawCheckBoxState()
// -----------------------------------------------------------------------
-void CheckBox::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+void CheckBox::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize,
const Size& rImageSize, Rectangle& rStateRect,
Rectangle& rMouseRect, bool bLayout )
@@ -3487,7 +3325,7 @@ void CheckBox::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
if ( ( aText.Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) ) ||
( HasImage() && ! (ImplGetButtonState() & BUTTON_DRAW_NOIMAGE) ) )
{
- USHORT nTextStyle = Button::ImplGetTextStyle( aText, nWinStyle, nDrawFlags );
+ sal_uInt16 nTextStyle = Button::ImplGetTextStyle( aText, nWinStyle, nDrawFlags );
const long nImageSep = GetDrawPixel( pDev, ImplGetImageToTextDistance() );
Size aSize( rSize );
@@ -3761,7 +3599,7 @@ void CheckBox::Paint( const Rectangle& )
// -----------------------------------------------------------------------
void CheckBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- ULONG nFlags )
+ sal_uLong nFlags )
{
MapMode aResMapMode( MAP_100TH_MM );
Point aPos = pDev->LogicToPixel( rPos );
@@ -3951,17 +3789,17 @@ void CheckBox::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();
}
}
@@ -3977,7 +3815,7 @@ void CheckBox::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
}
@@ -4035,7 +3873,7 @@ void CheckBox::SetState( TriState eState )
// -----------------------------------------------------------------------
-void CheckBox::EnableTriState( BOOL bTriState )
+void CheckBox::EnableTriState( sal_Bool bTriState )
{
if ( mbTriState != bTriState )
{
@@ -4085,11 +3923,11 @@ Size CheckBox::ImplGetCheckImageSize() const
return aSize;
}
-Image CheckBox::GetCheckImage( const AllSettings& rSettings, USHORT nFlags )
+Image CheckBox::GetCheckImage( const AllSettings& rSettings, sal_uInt16 nFlags )
{
ImplSVData* pSVData = ImplGetSVData();
const StyleSettings& rStyleSettings = rSettings.GetStyleSettings();
- USHORT nStyle = rStyleSettings.GetCheckBoxStyle() & STYLE_CHECKBOX_STYLE;
+ sal_uInt16 nStyle = 0;
if ( rStyleSettings.GetOptions() & STYLE_OPTION_MONO )
nStyle = STYLE_CHECKBOX_MONO;
@@ -4116,7 +3954,7 @@ Image CheckBox::GetCheckImage( const AllSettings& rSettings, USHORT nFlags )
pSVData->maCtrlData.mnCheckStyle = nStyle;
}
- USHORT nId;
+ sal_uInt16 nId;
if ( nFlags & BUTTON_DRAW_DISABLED )
{
if ( nFlags & BUTTON_DRAW_DONTKNOW )
@@ -4244,7 +4082,7 @@ ImageButton::ImageButton( Window* pParent, WinBits nStyle ) :
ImageButton::ImageButton( Window* pParent, const ResId& rResId ) :
PushButton( pParent, rResId.SetRT( RSC_IMAGEBUTTON ) )
{
- ULONG nObjMask = ReadLongRes();
+ sal_uLong nObjMask = ReadLongRes();
if ( RSC_IMAGEBUTTON_IMAGE & nObjMask )
{
@@ -4293,7 +4131,7 @@ ImageRadioButton::ImageRadioButton( Window* pParent, WinBits nStyle ) :
ImageRadioButton::ImageRadioButton( Window* pParent, const ResId& rResId ) :
RadioButton( pParent, rResId.SetRT( RSC_IMAGERADIOBUTTON ) )
{
- ULONG nObjMask = ReadLongRes();
+ sal_uLong nObjMask = ReadLongRes();
if ( RSC_IMAGERADIOBUTTON_IMAGE & nObjMask )
{
@@ -4313,7 +4151,7 @@ ImageRadioButton::~ImageRadioButton()
TriStateBox::TriStateBox( Window* pParent, WinBits nStyle ) :
CheckBox( pParent, nStyle )
{
- EnableTriState( TRUE );
+ EnableTriState( sal_True );
}
// -----------------------------------------------------------------------
@@ -4321,15 +4159,15 @@ TriStateBox::TriStateBox( Window* pParent, WinBits nStyle ) :
TriStateBox::TriStateBox( Window* pParent, const ResId& rResId ) :
CheckBox( pParent, rResId.SetRT( RSC_TRISTATEBOX ) )
{
- EnableTriState( TRUE );
+ EnableTriState( sal_True );
- ULONG nTriState = ReadLongRes();
- USHORT bDisableTriState = ReadShortRes();
+ sal_uLong nTriState = ReadLongRes();
+ sal_uInt16 bDisableTriState = ReadShortRes();
//anderer Wert als Default ?
if ( (TriState)nTriState != STATE_NOCHECK )
SetState( (TriState)nTriState );
if ( bDisableTriState )
- EnableTriState( FALSE );
+ EnableTriState( sal_False );
}
// -----------------------------------------------------------------------
@@ -4391,7 +4229,7 @@ void DisclosureButton::ImplDrawCheckBoxState()
if( ! pImg )
return;
- USHORT nStyle = 0;
+ sal_uInt16 nStyle = 0;
if( ! IsEnabled() )
nStyle |= IMAGE_DRAW_DISABLE;
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index e65925db282c..9881edd62ca3 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -46,7 +46,7 @@
// =======================================================================
-inline ULONG ImplCreateKey( USHORT nPos )
+inline sal_uLong ImplCreateKey( sal_uInt16 nPos )
{
// Key = Pos+1, wegen Pos 0
return nPos+1;
@@ -60,7 +60,7 @@ static void lcl_GetSelectedEntries( Table& rSelectedPos, const XubString& rText,
{
XubString aToken = rText.GetToken( --n, cTokenSep );
aToken.EraseLeadingAndTrailingChars( ' ' );
- USHORT nPos = pEntryList->FindEntry( aToken );
+ sal_uInt16 nPos = pEntryList->FindEntry( aToken );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
rSelectedPos.Insert( ImplCreateKey( nPos ), (void*)sal_IntPtr(1L) );
}
@@ -122,9 +122,9 @@ void ComboBox::ImplInitComboBoxData()
mpFloatWin = NULL;
mnDDHeight = 0;
- mbDDAutoSize = TRUE;
- mbSyntheticModify = FALSE;
- mbMatchCase = FALSE;
+ mbDDAutoSize = sal_True;
+ mbSyntheticModify = sal_False;
+ mbMatchCase = sal_False;
mcMultiSep = ';';
}
@@ -134,7 +134,7 @@ void ComboBox::ImplCalcEditHeight()
{
sal_Int32 nLeft, nTop, nRight, nBottom;
GetBorder( nLeft, nTop, nRight, nBottom );
- mnDDHeight = (USHORT)(mpSubEdit->GetTextHeight() + nTop + nBottom + 4);
+ mnDDHeight = (sal_uInt16)(mpSubEdit->GetTextHeight() + nTop + nBottom + 4);
if ( !IsDropDownBox() )
mnDDHeight += 4;
@@ -150,7 +150,7 @@ void ComboBox::ImplCalcEditHeight()
{
const long nNCHeight = aBoundRegion.GetHeight();
if( mnDDHeight < nNCHeight )
- mnDDHeight = sal::static_int_cast<USHORT>( nNCHeight );
+ mnDDHeight = sal::static_int_cast<sal_uInt16>( nNCHeight );
}
}
@@ -160,7 +160,7 @@ void ComboBox::ImplInit( Window* pParent, WinBits nStyle )
{
ImplInitStyle( nStyle );
- BOOL bNoBorder = ( nStyle & WB_NOBORDER ) ? TRUE : FALSE;
+ sal_Bool bNoBorder = ( nStyle & WB_NOBORDER ) ? sal_True : sal_False;
if ( !(nStyle & WB_DROPDOWN) )
{
nStyle &= ~WB_BORDER;
@@ -181,7 +181,7 @@ void ComboBox::ImplInit( Window* pParent, WinBits nStyle )
if( nStyle & WB_DROPDOWN )
{
mpFloatWin = new ImplListBoxFloatingWindow( this );
- mpFloatWin->SetAutoWidth( TRUE );
+ mpFloatWin->SetAutoWidth( sal_True );
mpFloatWin->SetPopupModeEndHdl( LINK( this, ComboBox, ImplPopupModeEndHdl ) );
mpBtn = new ImplBtn( this, WB_NOLIGHTBORDER | WB_RECTSTYLE );
@@ -204,10 +204,10 @@ void ComboBox::ImplInit( Window* pParent, WinBits nStyle )
}
mpSubEdit = new Edit( this, nEditStyle );
- mpSubEdit->EnableRTL( FALSE );
+ mpSubEdit->EnableRTL( sal_False );
SetSubEdit( mpSubEdit );
mpSubEdit->SetPosPixel( Point() );
- EnableAutocomplete( TRUE );
+ EnableAutocomplete( sal_True );
mpSubEdit->Show();
Window* pLBParent = this;
@@ -225,11 +225,11 @@ void ComboBox::ImplInit( Window* pParent, WinBits nStyle )
if ( mpFloatWin )
mpFloatWin->SetImplListBox( mpImplLB );
else
- mpImplLB->GetMainWindow()->AllowGrabFocus( TRUE );
+ mpImplLB->GetMainWindow()->AllowGrabFocus( sal_True );
ImplCalcEditHeight();
- SetCompoundControl( TRUE );
+ SetCompoundControl( sal_True );
}
// -----------------------------------------------------------------------
@@ -249,11 +249,11 @@ void ComboBox::ImplLoadRes( const ResId& rResId )
{
Edit::ImplLoadRes( rResId );
- ULONG nNumber = ReadLongRes();
+ sal_uLong nNumber = ReadLongRes();
if( nNumber )
{
- for( USHORT i = 0; i < nNumber; i++ )
+ for( sal_uInt16 i = 0; i < nNumber; i++ )
{
InsertEntry( ReadStringRes(), LISTBOX_APPEND );
}
@@ -262,7 +262,7 @@ void ComboBox::ImplLoadRes( const ResId& rResId )
// -----------------------------------------------------------------------
-void ComboBox::EnableAutocomplete( BOOL bEnable, BOOL bMatchCase )
+void ComboBox::EnableAutocomplete( sal_Bool bEnable, sal_Bool bMatchCase )
{
mbMatchCase = bMatchCase;
@@ -274,7 +274,7 @@ void ComboBox::EnableAutocomplete( BOOL bEnable, BOOL bMatchCase )
// -----------------------------------------------------------------------
-BOOL ComboBox::IsAutocompleteEnabled() const
+sal_Bool ComboBox::IsAutocompleteEnabled() const
{
return mpSubEdit->GetAutocompleteHdl().IsSet();
}
@@ -288,10 +288,10 @@ IMPL_LINK( ComboBox, ImplClickBtnHdl, void*, EMPTYARG )
if ( !mpImplLB->GetEntryList()->GetMRUCount() )
ImplUpdateFloatSelection();
else
- mpImplLB->SelectEntry( 0 , TRUE );
- mpBtn->SetPressed( TRUE );
+ mpImplLB->SelectEntry( 0 , sal_True );
+ mpBtn->SetPressed( sal_True );
SetSelection( Selection( 0, SELECTION_MAX ) );
- mpFloatWin->StartFloat( TRUE );
+ mpFloatWin->StartFloat( sal_True );
ImplCallEventListeners( VCLEVENT_DROPDOWN_OPEN );
ImplClearLayoutData();
@@ -309,9 +309,9 @@ IMPL_LINK( ComboBox, ImplPopupModeEndHdl, void*, EMPTYARG )
{
if ( !mpImplLB->GetEntryList()->IsEntryPosSelected( mpFloatWin->GetPopupModeStartSaveSelection() ) )
{
- mpImplLB->SelectEntry( mpFloatWin->GetPopupModeStartSaveSelection(), TRUE );
- BOOL bTravelSelect = mpImplLB->IsTravelSelect();
- mpImplLB->SetTravelSelect( TRUE );
+ mpImplLB->SelectEntry( mpFloatWin->GetPopupModeStartSaveSelection(), sal_True );
+ sal_Bool bTravelSelect = mpImplLB->IsTravelSelect();
+ mpImplLB->SetTravelSelect( sal_True );
Select();
mpImplLB->SetTravelSelect( bTravelSelect );
}
@@ -321,7 +321,7 @@ IMPL_LINK( ComboBox, ImplPopupModeEndHdl, void*, EMPTYARG )
if( mpImplLB )
mpImplLB->GetMainWindow()->ImplClearLayoutData();
- mpBtn->SetPressed( FALSE );
+ mpBtn->SetPressed( sal_False );
ImplCallEventListeners( VCLEVENT_DROPDOWN_CLOSE );
return 0;
}
@@ -341,36 +341,36 @@ IMPL_LINK( ComboBox, ImplAutocompleteHdl, Edit*, pEdit )
{
XubString aFullText = pEdit->GetText();
XubString aStartText = aFullText.Copy( 0, (xub_StrLen)aSel.Max() );
- USHORT nStart = mpImplLB->GetCurrentPos();
+ sal_uInt16 nStart = mpImplLB->GetCurrentPos();
if ( nStart == LISTBOX_ENTRY_NOTFOUND )
nStart = 0;
- BOOL bForward = TRUE;
+ sal_Bool bForward = sal_True;
if ( eAction == AUTOCOMPLETE_TABFORWARD )
nStart++;
else if ( eAction == AUTOCOMPLETE_TABBACKWARD )
{
- bForward = FALSE;
+ bForward = sal_False;
nStart = nStart ? nStart - 1 : mpImplLB->GetEntryList()->GetEntryCount()-1;
}
- USHORT nPos = LISTBOX_ENTRY_NOTFOUND;
+ sal_uInt16 nPos = LISTBOX_ENTRY_NOTFOUND;
if( ! mbMatchCase )
{
// Try match case insensitive from current position
- nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, nStart, bForward, TRUE );
+ nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, nStart, bForward, sal_True );
if ( nPos == LISTBOX_ENTRY_NOTFOUND )
// Try match case insensitive, but from start
- nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, bForward ? 0 : (mpImplLB->GetEntryList()->GetEntryCount()-1), bForward, TRUE );
+ nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, bForward ? 0 : (mpImplLB->GetEntryList()->GetEntryCount()-1), bForward, sal_True );
}
if ( nPos == LISTBOX_ENTRY_NOTFOUND )
// Try match full from current position
- nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, nStart, bForward, FALSE );
+ nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, nStart, bForward, sal_False );
if ( nPos == LISTBOX_ENTRY_NOTFOUND )
// Match full, but from start
- nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, bForward ? 0 : (mpImplLB->GetEntryList()->GetEntryCount()-1), bForward, FALSE );
+ nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, bForward ? 0 : (mpImplLB->GetEntryList()->GetEntryCount()-1), bForward, sal_False );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
{
@@ -387,8 +387,8 @@ IMPL_LINK( ComboBox, ImplAutocompleteHdl, Edit*, pEdit )
IMPL_LINK( ComboBox, ImplSelectHdl, void*, EMPTYARG )
{
- BOOL bPopup = IsInDropDown();
- BOOL bCallSelect = FALSE;
+ sal_Bool bPopup = IsInDropDown();
+ sal_Bool bCallSelect = sal_False;
if ( mpImplLB->IsSelectionChanged() || bPopup )
{
XubString aText;
@@ -404,7 +404,7 @@ IMPL_LINK( ComboBox, ImplSelectHdl, void*, EMPTYARG )
XubString aToken = aText.GetToken( 0, mcMultiSep, nIndex );
xub_StrLen nTokenLen = aToken.Len();
aToken.EraseLeadingAndTrailingChars( ' ' );
- USHORT nP = mpImplLB->GetEntryList()->FindEntry( aToken );
+ sal_uInt16 nP = mpImplLB->GetEntryList()->FindEntry( aToken );
if ( (nP != LISTBOX_ENTRY_NOTFOUND) && (!mpImplLB->GetEntryList()->IsEntryPosSelected( nP )) )
{
aText.Erase( nPrevIndex, nTokenLen );
@@ -421,10 +421,10 @@ IMPL_LINK( ComboBox, ImplSelectHdl, void*, EMPTYARG )
// Fehlende Eintraege anhaengen...
Table aSelInText;
lcl_GetSelectedEntries( aSelInText, aText, mcMultiSep, mpImplLB->GetEntryList() );
- USHORT nSelectedEntries = mpImplLB->GetEntryList()->GetSelectEntryCount();
- for ( USHORT n = 0; n < nSelectedEntries; n++ )
+ sal_uInt16 nSelectedEntries = mpImplLB->GetEntryList()->GetSelectEntryCount();
+ for ( sal_uInt16 n = 0; n < nSelectedEntries; n++ )
{
- USHORT nP = mpImplLB->GetEntryList()->GetSelectEntryPos( n );
+ sal_uInt16 nP = mpImplLB->GetEntryList()->GetSelectEntryPos( n );
if ( !aSelInText.IsKeyValid( ImplCreateKey( nP ) ) )
{
if ( aText.Len() && (aText.GetChar( aText.Len()-1 ) != mcMultiSep) )
@@ -450,7 +450,7 @@ IMPL_LINK( ComboBox, ImplSelectHdl, void*, EMPTYARG )
aNewSelection.Min() = aText.Len();
mpSubEdit->SetSelection( aNewSelection );
- bCallSelect = TRUE;
+ bCallSelect = sal_True;
}
// #84652# Call GrabFocus and EndPopupMode before calling Select/Modify, but after changing the text
@@ -465,9 +465,9 @@ IMPL_LINK( ComboBox, ImplSelectHdl, void*, EMPTYARG )
if ( bCallSelect )
{
mpSubEdit->SetModifyFlag();
- mbSyntheticModify = TRUE;
+ mbSyntheticModify = sal_True;
Modify();
- mbSyntheticModify = FALSE;
+ mbSyntheticModify = sal_False;
if (ImplGetWindowImpl() != NULL) //liuchen 2009-7-28, resolve the problem that soffice get crashed if in ComboBox_Change event a Worksheets("SheetX").Activate sentence needs to be executed
{
Select();
@@ -493,7 +493,7 @@ IMPL_LINK( ComboBox, ImplSelectionChangedHdl, void*, n )
{
if ( !mpImplLB->IsTrackingSelect() )
{
- USHORT nChanged = (USHORT)(ULONG)n;
+ sal_uInt16 nChanged = (sal_uInt16)(sal_uLong)n;
if ( !mpSubEdit->IsReadOnly() && mpImplLB->GetEntryList()->IsEntryPosSelected( nChanged ) )
mpSubEdit->SetText( mpImplLB->GetEntryList()->GetEntryText( nChanged ) );
}
@@ -522,11 +522,11 @@ void ComboBox::ToggleDropDown()
if ( !mpImplLB->GetEntryList()->GetMRUCount() )
ImplUpdateFloatSelection();
else
- mpImplLB->SelectEntry( 0 , TRUE );
+ mpImplLB->SelectEntry( 0 , sal_True );
ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN );
- mpBtn->SetPressed( TRUE );
+ mpBtn->SetPressed( sal_True );
SetSelection( Selection( 0, SELECTION_MAX ) );
- mpFloatWin->StartFloat( TRUE );
+ mpFloatWin->StartFloat( sal_True );
ImplCallEventListeners( VCLEVENT_DROPDOWN_OPEN );
}
}
@@ -548,7 +548,7 @@ void ComboBox::DoubleClick()
// -----------------------------------------------------------------------
-void ComboBox::EnableAutoSize( BOOL bAuto )
+void ComboBox::EnableAutoSize( sal_Bool bAuto )
{
mbDDAutoSize = bAuto;
if ( mpFloatWin )
@@ -562,7 +562,7 @@ void ComboBox::EnableAutoSize( BOOL bAuto )
// -----------------------------------------------------------------------
-void ComboBox::EnableDDAutoWidth( BOOL b )
+void ComboBox::EnableDDAutoWidth( sal_Bool b )
{
if ( mpFloatWin )
mpFloatWin->SetAutoWidth( b );
@@ -570,15 +570,15 @@ void ComboBox::EnableDDAutoWidth( BOOL b )
// -----------------------------------------------------------------------
-BOOL ComboBox::IsDDAutoWidthEnabled() const
+sal_Bool ComboBox::IsDDAutoWidthEnabled() const
{
- return mpFloatWin ? mpFloatWin->IsAutoWidth() : FALSE;
+ return mpFloatWin ? mpFloatWin->IsAutoWidth() : sal_False;
}
// -----------------------------------------------------------------------
-void ComboBox::SetDropDownLineCount( USHORT nLines )
+void ComboBox::SetDropDownLineCount( sal_uInt16 nLines )
{
if ( mpFloatWin )
mpFloatWin->SetDropDownLineCount( nLines );
@@ -586,9 +586,9 @@ void ComboBox::SetDropDownLineCount( USHORT nLines )
// -----------------------------------------------------------------------
-USHORT ComboBox::GetDropDownLineCount() const
+sal_uInt16 ComboBox::GetDropDownLineCount() const
{
- USHORT nLines = 0;
+ sal_uInt16 nLines = 0;
if ( mpFloatWin )
nLines = mpFloatWin->GetDropDownLineCount();
return nLines;
@@ -597,7 +597,7 @@ USHORT ComboBox::GetDropDownLineCount() const
// -----------------------------------------------------------------------
void ComboBox::SetPosSizePixel( long nX, long nY, long nWidth, long nHeight,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
if( IsDropDownBox() && ( nFlags & WINDOW_POSSIZE_SIZE ) )
{
@@ -758,7 +758,7 @@ void ComboBox::StateChanged( StateChangedType nType )
else if ( nType == STATE_CHANGE_STYLE )
{
SetStyle( ImplInitStyle( GetStyle() ) );
- mpImplLB->GetMainWindow()->EnableSort( ( GetStyle() & WB_SORT ) ? TRUE : FALSE );
+ mpImplLB->GetMainWindow()->EnableSort( ( GetStyle() & WB_SORT ) ? sal_True : sal_False );
}
else if( nType == STATE_CHANGE_MIRRORING )
{
@@ -813,7 +813,7 @@ long ComboBox::Notify( NotifyEvent& rNEvt )
&& !IsReadOnly() )
{
KeyEvent aKeyEvt = *rNEvt.GetKeyEvent();
- USHORT nKeyCode = aKeyEvt.GetKeyCode().GetCode();
+ sal_uInt16 nKeyCode = aKeyEvt.GetKeyCode().GetCode();
switch( nKeyCode )
{
case KEY_UP:
@@ -825,11 +825,11 @@ long ComboBox::Notify( NotifyEvent& rNEvt )
if( ( nKeyCode == KEY_DOWN ) && mpFloatWin && !mpFloatWin->IsInPopupMode() && aKeyEvt.GetKeyCode().IsMod2() )
{
ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN );
- mpBtn->SetPressed( TRUE );
+ mpBtn->SetPressed( sal_True );
if ( mpImplLB->GetEntryList()->GetMRUCount() )
- mpImplLB->SelectEntry( 0 , TRUE );
+ mpImplLB->SelectEntry( 0 , sal_True );
SetSelection( Selection( 0, SELECTION_MAX ) );
- mpFloatWin->StartFloat( FALSE );
+ mpFloatWin->StartFloat( sal_False );
ImplCallEventListeners( VCLEVENT_DROPDOWN_OPEN );
nDone = 1;
}
@@ -860,14 +860,14 @@ long ComboBox::Notify( NotifyEvent& rNEvt )
{
if( mpFloatWin->HasChildPathFocus() )
mpSubEdit->GrabFocus();
- else if ( mpFloatWin->IsInPopupMode() && !HasChildPathFocus( TRUE ) )
+ else if ( mpFloatWin->IsInPopupMode() && !HasChildPathFocus( sal_True ) )
mpFloatWin->EndPopupMode();
}
else if( (rNEvt.GetType() == EVENT_COMMAND) &&
(rNEvt.GetCommandEvent()->GetCommand() == COMMAND_WHEEL) &&
(rNEvt.GetWindow() == mpSubEdit) )
{
- USHORT nWheelBehavior( GetSettings().GetMouseSettings().GetWheelBehavior() );
+ sal_uInt16 nWheelBehavior( GetSettings().GetMouseSettings().GetWheelBehavior() );
if ( ( nWheelBehavior == MOUSE_WHEEL_ALWAYS )
|| ( ( nWheelBehavior == MOUSE_WHEEL_FOCUS_ONLY )
&& HasChildPathFocus()
@@ -924,12 +924,12 @@ void ComboBox::Modify()
void ComboBox::ImplUpdateFloatSelection()
{
// Text in der ListBox in den sichtbaren Bereich bringen
- mpImplLB->SetCallSelectionChangedHdl( FALSE );
+ mpImplLB->SetCallSelectionChangedHdl( sal_False );
if ( !IsMultiSelectionEnabled() )
{
XubString aSearchStr( mpSubEdit->GetText() );
- USHORT nSelect = LISTBOX_ENTRY_NOTFOUND;
- BOOL bSelect = TRUE;
+ sal_uInt16 nSelect = LISTBOX_ENTRY_NOTFOUND;
+ sal_Bool bSelect = sal_True;
if ( mpImplLB->GetCurrentPos() != LISTBOX_ENTRY_NOTFOUND )
{
@@ -943,7 +943,7 @@ void ComboBox::ImplUpdateFloatSelection()
if ( nSelect == LISTBOX_ENTRY_NOTFOUND )
{
nSelect = mpImplLB->GetEntryList()->FindMatchingEntry( aSearchStr );
- bSelect = FALSE;
+ bSelect = sal_False;
}
if( nSelect != LISTBOX_ENTRY_NOTFOUND )
@@ -956,7 +956,7 @@ void ComboBox::ImplUpdateFloatSelection()
{
nSelect = mpImplLB->GetEntryList()->GetSelectEntryPos( 0 );
if( nSelect != LISTBOX_ENTRY_NOTFOUND )
- mpImplLB->SelectEntry( nSelect, FALSE );
+ mpImplLB->SelectEntry( nSelect, sal_False );
mpImplLB->ResetCurrentPos();
}
}
@@ -964,28 +964,28 @@ void ComboBox::ImplUpdateFloatSelection()
{
Table aSelInText;
lcl_GetSelectedEntries( aSelInText, mpSubEdit->GetText(), mcMultiSep, mpImplLB->GetEntryList() );
- for ( USHORT n = 0; n < mpImplLB->GetEntryList()->GetEntryCount(); n++ )
+ for ( sal_uInt16 n = 0; n < mpImplLB->GetEntryList()->GetEntryCount(); n++ )
mpImplLB->SelectEntry( n, aSelInText.IsKeyValid( ImplCreateKey( n ) ) );
}
- mpImplLB->SetCallSelectionChangedHdl( TRUE );
+ mpImplLB->SetCallSelectionChangedHdl( sal_True );
}
// -----------------------------------------------------------------------
-USHORT ComboBox::InsertEntry( const XubString& rStr, USHORT nPos )
+sal_uInt16 ComboBox::InsertEntry( const XubString& rStr, sal_uInt16 nPos )
{
- USHORT nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr );
- nRealPos = sal::static_int_cast<USHORT>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
+ sal_uInt16 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr );
+ nRealPos = sal::static_int_cast<sal_uInt16>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
CallEventListeners( VCLEVENT_COMBOBOX_ITEMADDED, (void*) sal_IntPtr(nRealPos) );
return nRealPos;
}
// -----------------------------------------------------------------------
-USHORT ComboBox::InsertEntry( const XubString& rStr, const Image& rImage, USHORT nPos )
+sal_uInt16 ComboBox::InsertEntry( const XubString& rStr, const Image& rImage, sal_uInt16 nPos )
{
- USHORT nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr, rImage );
- nRealPos = sal::static_int_cast<USHORT>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
+ sal_uInt16 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr, rImage );
+ nRealPos = sal::static_int_cast<sal_uInt16>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
CallEventListeners( VCLEVENT_COMBOBOX_ITEMADDED, (void*) sal_IntPtr(nRealPos) );
return nRealPos;
}
@@ -999,7 +999,7 @@ void ComboBox::RemoveEntry( const XubString& rStr )
// -----------------------------------------------------------------------
-void ComboBox::RemoveEntry( USHORT nPos )
+void ComboBox::RemoveEntry( sal_uInt16 nPos )
{
mpImplLB->RemoveEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
CallEventListeners( VCLEVENT_COMBOBOX_ITEMREMOVED, (void*) sal_IntPtr(nPos) );
@@ -1014,7 +1014,7 @@ void ComboBox::Clear()
}
// -----------------------------------------------------------------------
-Image ComboBox::GetEntryImage( USHORT nPos ) const
+Image ComboBox::GetEntryImage( sal_uInt16 nPos ) const
{
if ( mpImplLB->GetEntryList()->HasEntryImage( nPos ) )
return mpImplLB->GetEntryList()->GetEntryImage( nPos );
@@ -1023,70 +1023,70 @@ Image ComboBox::GetEntryImage( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT ComboBox::GetEntryPos( const XubString& rStr ) const
+sal_uInt16 ComboBox::GetEntryPos( const XubString& rStr ) const
{
- USHORT nPos = mpImplLB->GetEntryList()->FindEntry( rStr );
+ sal_uInt16 nPos = mpImplLB->GetEntryList()->FindEntry( rStr );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- nPos = sal::static_int_cast<USHORT>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
+ nPos = sal::static_int_cast<sal_uInt16>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
return nPos;
}
// -----------------------------------------------------------------------
-USHORT ComboBox::GetEntryPos( const void* pData ) const
+sal_uInt16 ComboBox::GetEntryPos( const void* pData ) const
{
- USHORT nPos = mpImplLB->GetEntryList()->FindEntry( pData );
+ sal_uInt16 nPos = mpImplLB->GetEntryList()->FindEntry( pData );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- nPos = sal::static_int_cast<USHORT>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
+ nPos = sal::static_int_cast<sal_uInt16>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
return nPos;
}
// -----------------------------------------------------------------------
-XubString ComboBox::GetEntry( USHORT nPos ) const
+XubString ComboBox::GetEntry( sal_uInt16 nPos ) const
{
return mpImplLB->GetEntryList()->GetEntryText( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-USHORT ComboBox::GetEntryCount() const
+sal_uInt16 ComboBox::GetEntryCount() const
{
return mpImplLB->GetEntryList()->GetEntryCount() - mpImplLB->GetEntryList()->GetMRUCount();
}
// -----------------------------------------------------------------------
-BOOL ComboBox::IsTravelSelect() const
+sal_Bool ComboBox::IsTravelSelect() const
{
return mpImplLB->IsTravelSelect();
}
// -----------------------------------------------------------------------
-BOOL ComboBox::IsInDropDown() const
+sal_Bool ComboBox::IsInDropDown() const
{
return mpFloatWin && mpFloatWin->IsInPopupMode();
}
// -----------------------------------------------------------------------
-void ComboBox::EnableMultiSelection( BOOL bMulti )
+void ComboBox::EnableMultiSelection( sal_Bool bMulti )
{
- mpImplLB->EnableMultiSelection( bMulti, FALSE );
- mpImplLB->SetMultiSelectionSimpleMode( TRUE );
+ mpImplLB->EnableMultiSelection( bMulti, sal_False );
+ mpImplLB->SetMultiSelectionSimpleMode( sal_True );
}
// -----------------------------------------------------------------------
-BOOL ComboBox::IsMultiSelectionEnabled() const
+sal_Bool ComboBox::IsMultiSelectionEnabled() const
{
return mpImplLB->IsMultiSelectionEnabled();
}
// -----------------------------------------------------------------------
-long ComboBox::CalcWindowSizePixel( USHORT nLines ) const
+long ComboBox::CalcWindowSizePixel( sal_uInt16 nLines ) const
{
return mpImplLB->GetEntryHeight() * nLines;
}
@@ -1153,7 +1153,7 @@ Size ComboBox::CalcAdjustedSize( const Size& rPrefSize ) const
// -----------------------------------------------------------------------
-Size ComboBox::CalcSize( USHORT nColumns, USHORT nLines ) const
+Size ComboBox::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const
{
// ggf. werden ScrollBars eingeblendet
Size aMinSz = CalcMinimumSize();
@@ -1193,28 +1193,28 @@ Size ComboBox::CalcSize( USHORT nColumns, USHORT nLines ) const
// -----------------------------------------------------------------------
-void ComboBox::GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const
+void ComboBox::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const
{
long nCharWidth = GetTextWidth( UniString( 'x' ) );
if ( !IsDropDownBox() )
{
Size aOutSz = mpImplLB->GetMainWindow()->GetOutputSizePixel();
- rnCols = (USHORT)(aOutSz.Width()/nCharWidth);
- rnLines = (USHORT)(aOutSz.Height()/mpImplLB->GetEntryHeight());
+ rnCols = (sal_uInt16)(aOutSz.Width()/nCharWidth);
+ rnLines = (sal_uInt16)(aOutSz.Height()/mpImplLB->GetEntryHeight());
}
else
{
Size aOutSz = mpSubEdit->GetOutputSizePixel();
- rnCols = (USHORT)(aOutSz.Width()/nCharWidth);
+ rnCols = (sal_uInt16)(aOutSz.Width()/nCharWidth);
rnLines = 1;
}
}
// -----------------------------------------------------------------------
-void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
- mpImplLB->GetMainWindow()->ImplInitSettings( TRUE, TRUE, TRUE );
+ mpImplLB->GetMainWindow()->ImplInitSettings( sal_True, sal_True, sal_True );
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -1229,8 +1229,8 @@ void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, U
// 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 );
@@ -1252,7 +1252,7 @@ void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, U
long nOnePixel = GetDrawPixel( pDev, 1 );
long nTextHeight = pDev->GetTextHeight();
long nEditHeight = nTextHeight + 6*nOnePixel;
- USHORT nTextStyle = TEXT_DRAW_VCENTER;
+ sal_uInt16 nTextStyle = TEXT_DRAW_VCENTER;
// First, draw the edit part
mpSubEdit->Draw( pDev, aPos, Size( aSize.Width(), nEditHeight ), nFlags );
@@ -1284,10 +1284,10 @@ void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, U
Rectangle aClip( aPos, aSize );
pDev->IntersectClipRegion( aClip );
- USHORT nLines = (USHORT) ( (aSize.Height()-nEditHeight) / nTextHeight );
+ sal_uInt16 nLines = (sal_uInt16) ( (aSize.Height()-nEditHeight) / nTextHeight );
if ( !nLines )
nLines = 1;
- USHORT nTEntry = IsReallyVisible() ? mpImplLB->GetTopEntry() : 0;
+ sal_uInt16 nTEntry = IsReallyVisible() ? mpImplLB->GetTopEntry() : 0;
Rectangle aTextRect( aPos, aSize );
@@ -1297,7 +1297,7 @@ void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, U
aTextRect.Bottom() = aTextRect.Top() + nTextHeight;
// the drawing starts here
- for ( USHORT n = 0; n < nLines; n++ )
+ for ( sal_uInt16 n = 0; n < nLines; n++ )
{
pDev->DrawText( aTextRect, mpImplLB->GetEntryList()->GetEntryText( n+nTEntry ), nTextStyle );
aTextRect.Top() += nTextHeight;
@@ -1346,21 +1346,21 @@ const Size& ComboBox::GetUserItemSize() const
// -----------------------------------------------------------------------
-void ComboBox::EnableUserDraw( BOOL bUserDraw )
+void ComboBox::EnableUserDraw( sal_Bool bUserDraw )
{
mpImplLB->GetMainWindow()->EnableUserDraw( bUserDraw );
}
// -----------------------------------------------------------------------
-BOOL ComboBox::IsUserDrawEnabled() const
+sal_Bool ComboBox::IsUserDrawEnabled() const
{
return mpImplLB->GetMainWindow()->IsUserDrawEnabled();
}
// -----------------------------------------------------------------------
-void ComboBox::DrawEntry( const UserDrawEvent& rEvt, BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos )
+void ComboBox::DrawEntry( const UserDrawEvent& rEvt, sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos )
{
DBG_ASSERT( rEvt.GetDevice() == mpImplLB->GetMainWindow(), "DrawEntry?!" );
mpImplLB->GetMainWindow()->DrawEntry( rEvt.GetItemId(), bDrawImage, bDrawText, bDrawTextAtImagePos );
@@ -1368,7 +1368,7 @@ void ComboBox::DrawEntry( const UserDrawEvent& rEvt, BOOL bDrawImage, BOOL bDraw
// -----------------------------------------------------------------------
-void ComboBox::SetSeparatorPos( USHORT n )
+void ComboBox::SetSeparatorPos( sal_uInt16 n )
{
mpImplLB->SetSeparatorPos( n );
}
@@ -1382,7 +1382,7 @@ void ComboBox::SetSeparatorPos()
// -----------------------------------------------------------------------
-USHORT ComboBox::GetSeparatorPos() const
+sal_uInt16 ComboBox::GetSeparatorPos() const
{
return mpImplLB->GetSeparatorPos();
}
@@ -1403,58 +1403,58 @@ XubString ComboBox::GetMRUEntries( xub_Unicode cSep ) const
// -----------------------------------------------------------------------
-void ComboBox::SetMaxMRUCount( USHORT n )
+void ComboBox::SetMaxMRUCount( sal_uInt16 n )
{
mpImplLB->SetMaxMRUCount( n );
}
// -----------------------------------------------------------------------
-USHORT ComboBox::GetMaxMRUCount() const
+sal_uInt16 ComboBox::GetMaxMRUCount() const
{
return mpImplLB->GetMaxMRUCount();
}
// -----------------------------------------------------------------------
-USHORT ComboBox::GetDisplayLineCount() const
+sal_uInt16 ComboBox::GetDisplayLineCount() const
{
return mpImplLB->GetDisplayLineCount();
}
// -----------------------------------------------------------------------
-void ComboBox::SetEntryData( USHORT nPos, void* pNewData )
+void ComboBox::SetEntryData( sal_uInt16 nPos, void* pNewData )
{
mpImplLB->SetEntryData( nPos + mpImplLB->GetEntryList()->GetMRUCount(), pNewData );
}
// -----------------------------------------------------------------------
-void* ComboBox::GetEntryData( USHORT nPos ) const
+void* ComboBox::GetEntryData( sal_uInt16 nPos ) const
{
return mpImplLB->GetEntryList()->GetEntryData( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-void ComboBox::SetTopEntry( USHORT nPos )
+void ComboBox::SetTopEntry( sal_uInt16 nPos )
{
mpImplLB->SetTopEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-void ComboBox::ShowProminentEntry( USHORT nPos )
+void ComboBox::ShowProminentEntry( sal_uInt16 nPos )
{
mpImplLB->ShowProminentEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-USHORT ComboBox::GetTopEntry() const
+sal_uInt16 ComboBox::GetTopEntry() const
{
- USHORT nPos = GetEntryCount() ? mpImplLB->GetTopEntry() : LISTBOX_ENTRY_NOTFOUND;
+ sal_uInt16 nPos = GetEntryCount() ? mpImplLB->GetTopEntry() : LISTBOX_ENTRY_NOTFOUND;
if ( nPos < mpImplLB->GetEntryList()->GetMRUCount() )
nPos = 0;
return nPos;
@@ -1504,29 +1504,29 @@ const Wallpaper& ComboBox::GetDisplayBackground() const
return rBack;
}
// -----------------------------------------------------------------------------
-USHORT ComboBox::GetSelectEntryCount() const
+sal_uInt16 ComboBox::GetSelectEntryCount() const
{
return mpImplLB->GetEntryList()->GetSelectEntryCount();
}
// -----------------------------------------------------------------------------
-USHORT ComboBox::GetSelectEntryPos( USHORT nIndex ) const
+sal_uInt16 ComboBox::GetSelectEntryPos( sal_uInt16 nIndex ) const
{
- USHORT nPos = mpImplLB->GetEntryList()->GetSelectEntryPos( nIndex );
+ sal_uInt16 nPos = mpImplLB->GetEntryList()->GetSelectEntryPos( nIndex );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
{
if ( nPos < mpImplLB->GetEntryList()->GetMRUCount() )
nPos = mpImplLB->GetEntryList()->FindEntry( mpImplLB->GetEntryList()->GetEntryText( nPos ) );
- nPos = sal::static_int_cast<USHORT>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
+ nPos = sal::static_int_cast<sal_uInt16>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
}
return nPos;
}
// -----------------------------------------------------------------------------
-BOOL ComboBox::IsEntryPosSelected( USHORT nPos ) const
+sal_Bool ComboBox::IsEntryPosSelected( sal_uInt16 nPos ) const
{
return mpImplLB->GetEntryList()->IsEntryPosSelected( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------------
-void ComboBox::SelectEntryPos( USHORT nPos, BOOL bSelect)
+void ComboBox::SelectEntryPos( sal_uInt16 nPos, sal_Bool bSelect)
{
if ( nPos < mpImplLB->GetEntryList()->GetEntryCount() )
mpImplLB->SelectEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), bSelect );
@@ -1538,7 +1538,7 @@ void ComboBox::SetNoSelection()
mpSubEdit->SetText( String() );
}
// -----------------------------------------------------------------------------
-Rectangle ComboBox::GetBoundingRectangle( USHORT nItem ) const
+Rectangle ComboBox::GetBoundingRectangle( sal_uInt16 nItem ) const
{
Rectangle aRect = mpImplLB->GetMainWindow()->GetBoundingRectangle( nItem );
Rectangle aOffset = mpImplLB->GetMainWindow()->GetWindowExtentsRelative( (Window*)this );
@@ -1547,7 +1547,7 @@ Rectangle ComboBox::GetBoundingRectangle( USHORT nItem ) const
}
// -----------------------------------------------------------------------------
-void ComboBox::SetBorderStyle( USHORT nBorderStyle )
+void ComboBox::SetBorderStyle( sal_uInt16 nBorderStyle )
{
Window::SetBorderStyle( nBorderStyle );
if ( !IsDropDownBox() )
@@ -1558,7 +1558,7 @@ void ComboBox::SetBorderStyle( USHORT nBorderStyle )
}
// -----------------------------------------------------------------------------
-long ComboBox::GetIndexForPoint( const Point& rPoint, USHORT& rPos ) const
+long ComboBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rPos ) const
{
if( !HasLayoutData() )
FillLayoutData();
@@ -1578,7 +1578,7 @@ long ComboBox::GetIndexForPoint( const Point& rPoint, USHORT& rPos ) const
aConvPoint = pMain->PixelToLogic( aConvPoint );
// try to find entry
- USHORT nEntry = pMain->GetEntryPosForPoint( aConvPoint );
+ sal_uInt16 nEntry = pMain->GetEntryPosForPoint( aConvPoint );
if( nEntry == LISTBOX_ENTRY_NOTFOUND )
nIndex = -1;
else
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index ad45da3b706e..99cd6b3cba60 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -48,7 +48,7 @@ using namespace vcl;
void Control::ImplInitControlData()
{
- mbHasFocus = FALSE;
+ mbHasFocus = sal_False;
mpControlData = new ImplControlData;
}
@@ -304,10 +304,10 @@ long Control::Notify( NotifyEvent& rNEvt )
{
if ( !mbHasFocus )
{
- mbHasFocus = TRUE;
+ mbHasFocus = sal_True;
if ( ImplCallEventListenersAndHandler( VCLEVENT_CONTROL_GETFOCUS, maGetFocusHdl, this ) )
// been destroyed within the handler
- return TRUE;
+ return sal_True;
}
}
else
@@ -317,10 +317,10 @@ long Control::Notify( NotifyEvent& rNEvt )
Window* pFocusWin = Application::GetFocusWindow();
if ( !pFocusWin || !ImplIsWindowOrChild( pFocusWin ) )
{
- mbHasFocus = FALSE;
+ mbHasFocus = sal_False;
if ( ImplCallEventListenersAndHandler( VCLEVENT_CONTROL_LOSEFOCUS, maLoseFocusHdl, this ) )
// been destroyed within the handler
- return TRUE;
+ return sal_True;
}
}
}
@@ -373,7 +373,7 @@ void Control::AppendLayoutData( const Control& rSubControl ) const
// -----------------------------------------------------------------
-BOOL Control::ImplCallEventListenersAndHandler( ULONG nEvent, const Link& rHandler, void* pCaller )
+sal_Bool Control::ImplCallEventListenersAndHandler( sal_uLong nEvent, const Link& rHandler, void* pCaller )
{
ImplDelData aCheckDelete;
ImplAddDel( &aCheckDelete );
@@ -386,10 +386,10 @@ BOOL Control::ImplCallEventListenersAndHandler( ULONG nEvent, const Link& rHand
if ( !aCheckDelete.IsDelete() )
{
ImplRemoveDel( &aCheckDelete );
- return FALSE;
+ return sal_False;
}
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------
@@ -448,8 +448,8 @@ void Control::DataChanged( const DataChangedEvent& rDCEvt)
{
AllSettings aSettings = GetSettings();
StyleSettings aStyleSettings = aSettings.GetStyleSettings();
- ULONG nOldOptions = rDCEvt.GetOldSettings()->GetStyleSettings().GetOptions();
- ULONG nNewOptions = aStyleSettings.GetOptions();
+ sal_uLong nOldOptions = rDCEvt.GetOldSettings()->GetStyleSettings().GetOptions();
+ sal_uLong nNewOptions = aStyleSettings.GetOptions();
if ( !(nNewOptions & STYLE_OPTION_MONO) && ( nOldOptions & STYLE_OPTION_MONO ) )
{
@@ -518,7 +518,7 @@ const Color& Control::GetCanonicalTextColor( const StyleSettings& _rStyle ) cons
}
// -----------------------------------------------------------------
-void Control::ImplInitSettings( const BOOL _bFont, const BOOL _bForeground )
+void Control::ImplInitSettings( const sal_Bool _bFont, const sal_Bool _bForeground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -545,7 +545,7 @@ void Control::ImplInitSettings( const BOOL _bFont, const BOOL _bForeground )
// -----------------------------------------------------------------
void Control::DrawControlText( OutputDevice& _rTargetDevice, Rectangle& _io_rRect, const XubString& _rStr,
- USHORT _nStyle, MetricVector* _pVector, String* _pDisplayText ) const
+ sal_uInt16 _nStyle, MetricVector* _pVector, String* _pDisplayText ) const
{
#ifdef FS_DEBUG
if ( !_pVector )
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 15ce9476cdd1..41d5ca198cf2 100644..100755
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -113,17 +113,19 @@ struct DDInfo
Cursor aCursor;
Selection aDndStartSel;
xub_StrLen nDropPos;
- BOOL bStarterOfDD;
- BOOL bDroppedInMe;
- BOOL bVisCursor;
+ sal_Bool bStarterOfDD;
+ sal_Bool bDroppedInMe;
+ sal_Bool bVisCursor;
+ sal_Bool bIsStringSupported;
DDInfo()
{
aCursor.SetStyle( CURSOR_SHADOW );
nDropPos = 0;
- bStarterOfDD = FALSE;
- bDroppedInMe = FALSE;
- bVisCursor = FALSE;
+ bStarterOfDD = sal_False;
+ bDroppedInMe = sal_False;
+ bVisCursor = sal_False;
+ bIsStringSupported = sal_False;
}
};
@@ -132,11 +134,11 @@ struct DDInfo
struct Impl_IMEInfos
{
String aOldTextAfterStartPos;
- USHORT* pAttribs;
+ sal_uInt16* pAttribs;
xub_StrLen nPos;
xub_StrLen nLen;
- BOOL bCursor;
- BOOL bWasCursorOverwrite;
+ sal_Bool bCursor;
+ sal_Bool bWasCursorOverwrite;
Impl_IMEInfos( xub_StrLen nPos, const String& rOldTextAfterStartPos );
~Impl_IMEInfos();
@@ -152,9 +154,9 @@ Impl_IMEInfos::Impl_IMEInfos( xub_StrLen nP, const String& rOldTextAfterStartPos
{
nPos = nP;
nLen = 0;
- bCursor = TRUE;
+ bCursor = sal_True;
pAttribs = NULL;
- bWasCursorOverwrite = FALSE;
+ bWasCursorOverwrite = sal_False;
}
// -----------------------------------------------------------------------
@@ -170,8 +172,8 @@ void Impl_IMEInfos::CopyAttribs( const xub_StrLen* pA, xub_StrLen nL )
{
nLen = nL;
delete[] pAttribs;
- pAttribs = new USHORT[ nL ];
- rtl_copyMemory( pAttribs, pA, nL*sizeof(USHORT) );
+ pAttribs = new sal_uInt16[ nL ];
+ rtl_copyMemory( pAttribs, pA, nL*sizeof(sal_uInt16) );
}
// -----------------------------------------------------------------------
@@ -228,7 +230,7 @@ Edit::Edit( Window* pParent, const ResId& rResId, bool bDisableAccessibleLabeled
ImplInit( pParent, nStyle );
ImplLoadRes( rResId );
if ( bDisableAccessibleLabeledByRelation )
- ImplGetWindowImpl()->mbDisableAccessibleLabeledByRelation = TRUE;
+ ImplGetWindowImpl()->mbDisableAccessibleLabeledByRelation = sal_True;
// Derived MultiLineEdit takes care to call Show only after MultiLineEdit
// ctor has already started:
@@ -281,21 +283,21 @@ void Edit::ImplInitEditData()
mnAlign = EDIT_ALIGN_LEFT;
mnMaxTextLen = EDIT_NOLIMIT;
meAutocompleteAction = AUTOCOMPLETE_KEYINPUT;
- mbModified = FALSE;
- mbInternModified = FALSE;
- mbReadOnly = FALSE;
- mbInsertMode = TRUE;
- mbClickedInSelection = FALSE;
- mbActivePopup = FALSE;
- mbIsSubEdit = FALSE;
- mbInMBDown = FALSE;
+ mbModified = sal_False;
+ mbInternModified = sal_False;
+ mbReadOnly = sal_False;
+ mbInsertMode = sal_True;
+ mbClickedInSelection = sal_False;
+ mbActivePopup = sal_False;
+ mbIsSubEdit = sal_False;
+ mbInMBDown = sal_False;
mpDDInfo = NULL;
mpIMEInfos = NULL;
mcEchoChar = 0;
// --- RTL --- no default mirroring for Edit controls
// note: controls that use a subedit will revert this (SpinField, ComboBox)
- EnableRTL( FALSE );
+ EnableRTL( sal_False );
vcl::unohelper::DragAndDropWrapper* pDnDWrapper = new vcl::unohelper::DragAndDropWrapper( this );
mxDnDListener = pDnDWrapper;
@@ -342,7 +344,7 @@ void Edit::ImplInit( Window* pParent, WinBits nStyle )
SetCursor( new Cursor );
SetPointer( Pointer( POINTER_TEXT ) );
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
uno::Reference< datatransfer::dnd::XDragGestureListener> xDGL( mxDnDListener, uno::UNO_QUERY );
uno::Reference< datatransfer::dnd::XDragGestureRecognizer > xDGR = GetDragGestureRecognizer();
@@ -370,7 +372,7 @@ WinBits Edit::ImplInitStyle( WinBits nStyle )
// -----------------------------------------------------------------------
-BOOL Edit::IsCharInput( const KeyEvent& rKeyEvent )
+sal_Bool Edit::IsCharInput( const KeyEvent& rKeyEvent )
{
// In the future we must use new Unicode functions for this
xub_Unicode cCharCode = rKeyEvent.GetCharCode();
@@ -384,13 +386,13 @@ BOOL Edit::IsCharInput( const KeyEvent& rKeyEvent )
void Edit::ImplModified()
{
- mbModified = TRUE;
+ mbModified = sal_True;
Modify();
}
// -----------------------------------------------------------------------
-void Edit::ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground )
+void Edit::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -537,7 +539,7 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout )
}
Cursor* pCursor = GetCursor();
- BOOL bVisCursor = pCursor ? pCursor->IsVisible() : FALSE;
+ sal_Bool bVisCursor = pCursor ? pCursor->IsVisible() : sal_False;
if ( pCursor )
pCursor->Hide();
@@ -545,7 +547,7 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout )
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
if ( IsEnabled() )
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
else
SetTextColor( rStyleSettings.GetDisableColor() );
@@ -566,7 +568,7 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout )
else
SetTextFillColor( IsControlBackground() ? GetControlBackground() : rStyleSettings.GetFieldColor() );
- BOOL bDrawSelection = maSelection.Len() && ( HasFocus() || ( GetStyle() & WB_NOHIDESELECTION ) || mbActivePopup );
+ sal_Bool bDrawSelection = maSelection.Len() && ( HasFocus() || ( GetStyle() & WB_NOHIDESELECTION ) || mbActivePopup );
long nPos = nStart ? pDX[2*nStart] : 0;
aPos.X() = nPos + mnXOffset + ImplGetExtraOffset();
@@ -656,7 +658,7 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout )
for( i = 0; i < mpIMEInfos->nLen; )
{
- USHORT nAttr = mpIMEInfos->pAttribs[i];
+ sal_uInt16 nAttr = mpIMEInfos->pAttribs[i];
Region aClip;
int nIndex = i;
while( nIndex < mpIMEInfos->nLen && mpIMEInfos->pAttribs[nIndex] == nAttr) // #112631# check nIndex before using it
@@ -712,7 +714,7 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout )
// -----------------------------------------------------------------------
-void Edit::ImplDelete( const Selection& rSelection, BYTE nDirection, BYTE nMode )
+void Edit::ImplDelete( const Selection& rSelection, sal_uInt8 nDirection, sal_uInt8 nMode )
{
XubString aText = ImplGetText();
@@ -772,7 +774,7 @@ void Edit::ImplDelete( const Selection& rSelection, BYTE nDirection, BYTE nMode
maSelection.Min() = aSelection.Min();
maSelection.Max() = aSelection.Min();
ImplAlignAndPaint();
- mbInternModified = TRUE;
+ mbInternModified = sal_True;
}
// -----------------------------------------------------------------------
@@ -787,19 +789,19 @@ String Edit::ImplGetValidString( const String& rString ) const
}
// -----------------------------------------------------------------------
-Reference < i18n::XBreakIterator > Edit::ImplGetBreakIterator() const
+uno::Reference < i18n::XBreakIterator > Edit::ImplGetBreakIterator() const
{
//!! since we don't want to become incompatible in the next minor update
//!! where this code will get integrated into, xISC will be a local
//!! variable instead of a class member!
- Reference < i18n::XBreakIterator > xBI;
+ uno::Reference < i18n::XBreakIterator > xBI;
// if ( !xBI.is() )
{
- Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- Reference < XInterface > xI = xMSF->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator")) );
+ uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
+ uno::Reference < XInterface > xI = xMSF->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator")) );
if ( xI.is() )
{
- Any x = xI->queryInterface( ::getCppuType((const Reference< i18n::XBreakIterator >*)0) );
+ Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XBreakIterator >*)0) );
x >>= xBI;
}
}
@@ -807,19 +809,19 @@ Reference < i18n::XBreakIterator > Edit::ImplGetBreakIterator() const
}
// -----------------------------------------------------------------------
-Reference < i18n::XExtendedInputSequenceChecker > Edit::ImplGetInputSequenceChecker() const
+uno::Reference < i18n::XExtendedInputSequenceChecker > Edit::ImplGetInputSequenceChecker() const
{
//!! since we don't want to become incompatible in the next minor update
//!! where this code will get integrated into, xISC will be a local
//!! variable instead of a class member!
- Reference < i18n::XExtendedInputSequenceChecker > xISC;
+ uno::Reference < i18n::XExtendedInputSequenceChecker > xISC;
// if ( !xISC.is() )
{
- Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- Reference < XInterface > xI = xMSF->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.InputSequenceChecker")) );
+ uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
+ uno::Reference < XInterface > xI = xMSF->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.InputSequenceChecker")) );
if ( xI.is() )
{
- Any x = xI->queryInterface( ::getCppuType((const Reference< i18n::XExtendedInputSequenceChecker >*)0) );
+ Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XExtendedInputSequenceChecker >*)0) );
x >>= xISC;
}
}
@@ -894,8 +896,8 @@ void Edit::ImplInsertText( const XubString& rStr, const Selection* pNewSel, sal_
// get access to the configuration of this office module
try
{
- Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- Reference< container::XNameAccess > xModuleCfg( ::comphelper::ConfigurationHelper::openConfig(
+ uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
+ uno::Reference< container::XNameAccess > xModuleCfg( ::comphelper::ConfigurationHelper::openConfig(
xMSF,
sModule,
::comphelper::ConfigurationHelper::E_READONLY ),
@@ -995,7 +997,7 @@ void Edit::ImplInsertText( const XubString& rStr, const Selection* pNewSel, sal_
}
ImplAlignAndPaint();
- mbInternModified = TRUE;
+ mbInternModified = sal_True;
}
// -----------------------------------------------------------------------
@@ -1019,7 +1021,7 @@ void Edit::ImplSetText( const XubString& rText, const Selection* pNewSelection )
ImplAlign();
if ( pNewSelection )
- ImplSetSelection( *pNewSelection, FALSE );
+ ImplSetSelection( *pNewSelection, sal_False );
if ( mnXOffset && !pNewSelection )
maSelection.Max() = 0;
@@ -1157,7 +1159,7 @@ void Edit::ImplClearBackground( long nXStart, long nXEnd )
// -----------------------------------------------------------------------
-void Edit::ImplShowCursor( BOOL bOnlyIfVisible )
+void Edit::ImplShowCursor( sal_Bool bOnlyIfVisible )
{
if ( !IsUpdateMode() || ( bOnlyIfVisible && !IsReallyVisible() ) )
return;
@@ -1350,7 +1352,7 @@ xub_StrLen Edit::ImplGetCharPos( const Point& rWindowPos ) const
// -----------------------------------------------------------------------
-void Edit::ImplSetCursorPos( xub_StrLen nChar, BOOL bSelect )
+void Edit::ImplSetCursorPos( xub_StrLen nChar, sal_Bool bSelect )
{
Selection aSelection( maSelection );
aSelection.Max() = nChar;
@@ -1442,7 +1444,7 @@ void Edit::MouseButtonDown( const MouseEvent& rMEvt )
if ( rMEvt.GetClicks() < 4 )
{
- mbClickedInSelection = FALSE;
+ mbClickedInSelection = sal_False;
if ( rMEvt.GetClicks() == 3 )
{
ImplSetSelection( Selection( 0, 0xFFFF ) );
@@ -1457,7 +1459,7 @@ void Edit::MouseButtonDown( const MouseEvent& rMEvt )
ImplCopyToSelectionClipboard();
}
else if ( !rMEvt.IsShift() && HasFocus() && aSelection.IsInside( nChar ) )
- mbClickedInSelection = TRUE;
+ mbClickedInSelection = sal_True;
else if ( rMEvt.IsLeft() )
ImplSetCursorPos( nChar, rMEvt.IsShift() );
@@ -1465,9 +1467,9 @@ void Edit::MouseButtonDown( const MouseEvent& rMEvt )
StartTracking( STARTTRACK_SCROLLREPEAT );
}
- mbInMBDown = TRUE; // Dann im GetFocus nicht alles selektieren
+ mbInMBDown = sal_True; // Dann im GetFocus nicht alles selektieren
GrabFocus();
- mbInMBDown = FALSE;
+ mbInMBDown = sal_False;
}
// -----------------------------------------------------------------------
@@ -1477,8 +1479,8 @@ void Edit::MouseButtonUp( const MouseEvent& rMEvt )
if ( mbClickedInSelection && rMEvt.IsLeft() )
{
xub_StrLen nChar = ImplGetCharPos( rMEvt.GetPosPixel() );
- ImplSetCursorPos( nChar, FALSE );
- mbClickedInSelection = FALSE;
+ ImplSetCursorPos( nChar, sal_False );
+ mbClickedInSelection = sal_False;
}
else if ( rMEvt.IsMiddle() && !mbReadOnly &&
( GetSettings().GetMouseSettings().GetMiddleButtonAction() == MOUSE_MIDDLE_PASTESELECTION ) )
@@ -1498,8 +1500,8 @@ void Edit::Tracking( const TrackingEvent& rTEvt )
if ( mbClickedInSelection )
{
xub_StrLen nChar = ImplGetCharPos( rTEvt.GetMouseEvent().GetPosPixel() );
- ImplSetCursorPos( nChar, FALSE );
- mbClickedInSelection = FALSE;
+ ImplSetCursorPos( nChar, sal_False );
+ mbClickedInSelection = sal_False;
}
else if ( rTEvt.GetMouseEvent().IsLeft() )
{
@@ -1511,7 +1513,7 @@ void Edit::Tracking( const TrackingEvent& rTEvt )
if( !mbClickedInSelection )
{
xub_StrLen nChar = ImplGetCharPos( rTEvt.GetMouseEvent().GetPosPixel() );
- ImplSetCursorPos( nChar, TRUE );
+ ImplSetCursorPos( nChar, sal_True );
}
}
@@ -1521,13 +1523,13 @@ void Edit::Tracking( const TrackingEvent& rTEvt )
// -----------------------------------------------------------------------
-BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
+sal_Bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
{
- BOOL bDone = FALSE;
- USHORT nCode = rKEvt.GetKeyCode().GetCode();
+ sal_Bool bDone = sal_False;
+ sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
KeyFuncType eFunc = rKEvt.GetKeyCode().GetFunction();
- mbInternModified = FALSE;
+ mbInternModified = sal_False;
if ( eFunc != KEYFUNC_DONTKNOW )
{
@@ -1539,7 +1541,7 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
{
Cut();
ImplModified();
- bDone = TRUE;
+ bDone = sal_True;
}
}
break;
@@ -1549,7 +1551,7 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
if ( !(GetStyle() & WB_PASSWORD) )
{
Copy();
- bDone = TRUE;
+ bDone = sal_True;
}
}
break;
@@ -1559,7 +1561,7 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
if ( !mbReadOnly )
{
Paste();
- bDone = TRUE;
+ bDone = sal_True;
}
}
break;
@@ -1569,7 +1571,7 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
if ( !mbReadOnly )
{
Undo();
- bDone = TRUE;
+ bDone = sal_True;
}
}
break;
@@ -1584,7 +1586,7 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
if ( nCode == KEY_A )
{
ImplSetSelection( Selection( 0, maText.Len() ) );
- bDone = TRUE;
+ bDone = sal_True;
}
else if ( rKEvt.GetKeyCode().IsShift() && (nCode == KEY_S) )
{
@@ -1598,7 +1600,7 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
ImplInsertText( aChars );
ImplModified();
}
- bDone = TRUE;
+ bDone = sal_True;
}
}
}
@@ -1610,7 +1612,7 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
case com::sun::star::awt::Key::SELECT_ALL:
{
ImplSetSelection( Selection( 0, maText.Len() ) );
- bDone = TRUE;
+ bDone = sal_True;
}
break;
@@ -1736,7 +1738,7 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
}
}
- bDone = TRUE;
+ bDone = sal_True;
}
}
break;
@@ -1750,8 +1752,8 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
{
if ( !mbReadOnly && !rKEvt.GetKeyCode().IsMod2() )
{
- BYTE nDel = (nCode == KEY_DELETE) ? EDIT_DEL_RIGHT : EDIT_DEL_LEFT;
- BYTE nMode = rKEvt.GetKeyCode().IsMod1() ? EDIT_DELMODE_RESTOFWORD : EDIT_DELMODE_SIMPLE;
+ sal_uInt8 nDel = (nCode == KEY_DELETE) ? EDIT_DEL_RIGHT : EDIT_DEL_LEFT;
+ sal_uInt8 nMode = rKEvt.GetKeyCode().IsMod1() ? EDIT_DELMODE_RESTOFWORD : EDIT_DELMODE_SIMPLE;
if ( (nMode == EDIT_DELMODE_RESTOFWORD) && rKEvt.GetKeyCode().IsShift() )
nMode = EDIT_DELMODE_RESTOFCONTENT;
switch( nCode )
@@ -1778,7 +1780,7 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
ImplDelete( maSelection, nDel, nMode );
if ( maText.Len() != nOldLen )
ImplModified();
- bDone = TRUE;
+ bDone = sal_True;
}
}
break;
@@ -1788,11 +1790,14 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
if ( !mpIMEInfos && !mbReadOnly && !rKEvt.GetKeyCode().IsMod2() )
{
SetInsertMode( !mbInsertMode );
- bDone = TRUE;
+ bDone = sal_True;
}
}
break;
+ /* #i101255# disable autocomplete tab forward/backward
+ users expect tab/shif-tab to move the focus to other controls
+ not suddenly to cycle the autocompletion
case KEY_TAB:
{
if ( !mbReadOnly && maAutocompleteHdl.IsSet() &&
@@ -1810,16 +1815,17 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
// Wurde nichts veraendert, dann TAB fuer DialogControl
if ( GetSelection().Len() )
- bDone = TRUE;
+ bDone = sal_True;
}
}
break;
+ */
default:
{
if ( IsCharInput( rKEvt ) )
{
- bDone = TRUE; // Auch bei ReadOnly die Zeichen schlucken.
+ bDone = sal_True; // Auch bei ReadOnly die Zeichen schlucken.
if ( !mbReadOnly )
{
ImplInsertText( rKEvt.GetCharCode(), 0, sal_True );
@@ -1887,9 +1893,9 @@ void Edit::Resize()
// -----------------------------------------------------------------------
-void Edit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+void Edit::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 );
@@ -1904,8 +1910,8 @@ void Edit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG
// 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 );
@@ -1997,7 +2003,7 @@ void Edit::GetFocus()
{
maUndoText = maText;
- ULONG nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions();
+ sal_uLong nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions();
if ( !( GetStyle() & (WB_NOHIDESELECTION|WB_READONLY) )
&& ( GetGetFocusFlags() & (GETFOCUS_INIT|GETFOCUS_TAB|GETFOCUS_CURSOR|GETFOCUS_MNEMONIC) ) )
{
@@ -2094,22 +2100,22 @@ void Edit::Command( const CommandEvent& rCEvt )
if ( !maSelection.Len() )
{
- 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 ( 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 );
}
else
{
// Paste nur, wenn Text im Clipboard
- BOOL bData = FALSE;
+ sal_Bool bData = sal_False;
uno::Reference< datatransfer::clipboard::XClipboard > xClipboard = GetClipboard();
if ( xClipboard.is() )
{
@@ -2127,17 +2133,17 @@ void Edit::Command( const CommandEvent& rCEvt )
}
if ( maUndoText == maText )
- 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 ( !pImplFncGetSpecialChars )
{
- 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;
Selection aSaveSel = GetSelection(); // Falls jemand in Get/LoseFocus die Selektion verbiegt, z.B. URL-Zeile...
Point aPos = rCEvt.GetMousePosPixel();
if ( !rCEvt.IsMouseEvent() )
@@ -2146,7 +2152,7 @@ void Edit::Command( const CommandEvent& rCEvt )
Size aSize = GetOutputSizePixel();
aPos = Point( aSize.Width()/2, aSize.Height()/2 );
}
- USHORT n = pPopup->Execute( this, aPos );
+ sal_uInt16 n = pPopup->Execute( this, aPos );
Edit::DeletePopupMenu( pPopup );
SetSelection( aSaveSel );
switch ( n )
@@ -2185,7 +2191,7 @@ void Edit::Command( const CommandEvent& rCEvt )
}
break;
}
- mbActivePopup = FALSE;
+ mbActivePopup = sal_False;
}
else if ( rCEvt.GetCommand() == COMMAND_VOICE )
{
@@ -2233,12 +2239,12 @@ void Edit::Command( const CommandEvent& rCEvt )
}
else if ( rCEvt.GetCommand() == COMMAND_ENDEXTTEXTINPUT )
{
- BOOL bInsertMode = !mpIMEInfos->bWasCursorOverwrite;
+ sal_Bool bInsertMode = !mpIMEInfos->bWasCursorOverwrite;
delete mpIMEInfos;
mpIMEInfos = NULL;
// Font wieder ohne Attribute einstellen, wird jetzt im Repaint nicht
// mehr neu initialisiert
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
SetInsertMode( bInsertMode );
@@ -2262,20 +2268,20 @@ void Edit::Command( const CommandEvent& rCEvt )
maText.Insert( pData->GetText(), mpIMEInfos->nPos );
if ( mpIMEInfos->bWasCursorOverwrite )
{
- USHORT nOldIMETextLen = mpIMEInfos->nLen;
- USHORT nNewIMETextLen = pData->GetText().Len();
+ sal_uInt16 nOldIMETextLen = mpIMEInfos->nLen;
+ sal_uInt16 nNewIMETextLen = pData->GetText().Len();
if ( ( nOldIMETextLen > nNewIMETextLen ) &&
( nNewIMETextLen < mpIMEInfos->aOldTextAfterStartPos.Len() ) )
{
// restore old characters
- USHORT nRestore = nOldIMETextLen - nNewIMETextLen;
+ sal_uInt16 nRestore = nOldIMETextLen - nNewIMETextLen;
maText.Insert( mpIMEInfos->aOldTextAfterStartPos.Copy( nNewIMETextLen, nRestore ), mpIMEInfos->nPos + nNewIMETextLen );
}
else if ( ( nOldIMETextLen < nNewIMETextLen ) &&
( nOldIMETextLen < mpIMEInfos->aOldTextAfterStartPos.Len() ) )
{
// overwrite
- USHORT nOverwrite = nNewIMETextLen - nOldIMETextLen;
+ sal_uInt16 nOverwrite = nNewIMETextLen - nOldIMETextLen;
if ( ( nOldIMETextLen + nOverwrite ) > mpIMEInfos->aOldTextAfterStartPos.Len() )
nOverwrite = mpIMEInfos->aOldTextAfterStartPos.Len() - nOldIMETextLen;
maText.Erase( mpIMEInfos->nPos + nNewIMETextLen, nOverwrite );
@@ -2307,7 +2313,7 @@ void Edit::Command( const CommandEvent& rCEvt )
{
if ( mpIMEInfos )
{
- xub_StrLen nCursorPos = (USHORT)GetSelection().Max();
+ xub_StrLen nCursorPos = (sal_uInt16)GetSelection().Max();
SetCursorRect( NULL, GetTextWidth(
maText, nCursorPos, mpIMEInfos->nPos+mpIMEInfos->nLen-nCursorPos ) );
}
@@ -2337,10 +2343,10 @@ void Edit::StateChanged( StateChangedType nType )
mnXOffset = 0; // Falls vorher GrabFocus, als Groesse noch falsch.
ImplAlign();
if ( !mpSubEdit )
- ImplShowCursor( FALSE );
+ ImplShowCursor( sal_False );
}
// update background (eventual SetPaintTransparent)
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
}
else if ( nType == STATE_CHANGE_ENABLE )
{
@@ -2359,7 +2365,7 @@ void Edit::StateChanged( StateChangedType nType )
SetStyle( nStyle );
}
- USHORT nOldAlign = mnAlign;
+ sal_uInt16 nOldAlign = mnAlign;
mnAlign = EDIT_ALIGN_LEFT;
// --- RTL --- hack: right align until keyinput and cursor travelling works
@@ -2393,8 +2399,8 @@ void Edit::StateChanged( StateChangedType nType )
{
if ( !mpSubEdit )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
- ImplShowCursor( TRUE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
+ ImplShowCursor( sal_True );
Invalidate();
}
}
@@ -2402,7 +2408,7 @@ void Edit::StateChanged( StateChangedType nType )
{
if ( !mpSubEdit )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
ImplShowCursor();
Invalidate();
}
@@ -2411,7 +2417,7 @@ void Edit::StateChanged( StateChangedType nType )
{
if ( !mpSubEdit )
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
}
@@ -2419,7 +2425,7 @@ void Edit::StateChanged( StateChangedType nType )
{
if ( !mpSubEdit )
{
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
}
@@ -2438,8 +2444,8 @@ void Edit::DataChanged( const DataChangedEvent& rDCEvt )
{
if ( !mpSubEdit )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
- ImplShowCursor( TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
+ ImplShowCursor( sal_True );
Invalidate();
}
}
@@ -2460,7 +2466,7 @@ void Edit::ImplShowDDCursor()
mpDDInfo->aCursor.SetPos( aCursorRect.TopLeft() );
mpDDInfo->aCursor.SetSize( aCursorRect.GetSize() );
mpDDInfo->aCursor.Show();
- mpDDInfo->bVisCursor = TRUE;
+ mpDDInfo->bVisCursor = sal_True;
}
}
@@ -2471,7 +2477,7 @@ void Edit::ImplHideDDCursor()
if ( mpDDInfo && mpDDInfo->bVisCursor )
{
mpDDInfo->aCursor.Hide();
- mpDDInfo->bVisCursor = FALSE;
+ mpDDInfo->bVisCursor = sal_False;
}
}
@@ -2523,7 +2529,7 @@ IMPL_LINK( Edit, ImplUpdateDataHdl, Timer*, EMPTYARG )
// -----------------------------------------------------------------------
-void Edit::EnableUpdateData( ULONG nTimeout )
+void Edit::EnableUpdateData( sal_uLong nTimeout )
{
if ( !nTimeout )
DisableUpdateData();
@@ -2550,7 +2556,7 @@ void Edit::SetEchoChar( xub_Unicode c )
// -----------------------------------------------------------------------
-void Edit::SetReadOnly( BOOL bReadOnly )
+void Edit::SetReadOnly( sal_Bool bReadOnly )
{
if ( mbReadOnly != bReadOnly )
{
@@ -2573,7 +2579,7 @@ void Edit::SetAutocompleteHdl( const Link& rHdl )
// -----------------------------------------------------------------------
-void Edit::SetInsertMode( BOOL bInsert )
+void Edit::SetInsertMode( sal_Bool bInsert )
{
if ( bInsert != mbInsertMode )
{
@@ -2587,7 +2593,7 @@ void Edit::SetInsertMode( BOOL bInsert )
// -----------------------------------------------------------------------
-BOOL Edit::IsInsertMode() const
+sal_Bool Edit::IsInsertMode() const
{
if ( mpSubEdit )
return mpSubEdit->IsInsertMode();
@@ -2626,7 +2632,7 @@ void Edit::SetSelection( const Selection& rSelection )
// -----------------------------------------------------------------------
-void Edit::ImplSetSelection( const Selection& rSelection, BOOL bPaint )
+void Edit::ImplSetSelection( const Selection& rSelection, sal_Bool bPaint )
{
if ( mpSubEdit )
mpSubEdit->ImplSetSelection( rSelection );
@@ -2797,9 +2803,9 @@ XubString Edit::GetText() const
void Edit::SetModifyFlag()
{
if ( mpSubEdit )
- mpSubEdit->mbModified = TRUE;
+ mpSubEdit->mbModified = sal_True;
else
- mbModified = TRUE;
+ mbModified = sal_True;
}
// -----------------------------------------------------------------------
@@ -2807,9 +2813,9 @@ void Edit::SetModifyFlag()
void Edit::ClearModifyFlag()
{
if ( mpSubEdit )
- mpSubEdit->mbModified = FALSE;
+ mpSubEdit->mbModified = sal_False;
else
- mbModified = FALSE;
+ mbModified = sal_False;
}
// -----------------------------------------------------------------------
@@ -2820,7 +2826,7 @@ void Edit::SetSubEdit( Edit* pEdit )
if ( mpSubEdit )
{
SetPointer( POINTER_ARROW ); // Nur das SubEdit hat den BEAM...
- mpSubEdit->mbIsSubEdit = TRUE;
+ mpSubEdit->mbIsSubEdit = sal_True;
mpSubEdit->SetReadOnly( mbReadOnly );
}
@@ -2855,6 +2861,14 @@ Size Edit::CalcMinimumSize() const
return aSize;
}
+Size Edit::GetMinimumEditSize()
+{
+ Window* pDefWin = ImplGetDefaultWindow();
+ Edit aEdit( pDefWin, WB_BORDER );
+ Size aSize( aEdit.CalcMinimumSize() );
+ return aSize;
+}
+
// -----------------------------------------------------------------------
Size Edit::GetOptimalSize(WindowSizeType eType) const
@@ -2924,8 +2938,8 @@ PopupMenu* Edit::CreatePopupMenu()
pPopup->SetAccelKey( SV_MENU_EDIT_COPY, KeyCode( KEYFUNC_COPY ) );
pPopup->SetAccelKey( SV_MENU_EDIT_PASTE, KeyCode( KEYFUNC_PASTE ) );
pPopup->SetAccelKey( SV_MENU_EDIT_DELETE, KeyCode( KEYFUNC_DELETE ) );
- pPopup->SetAccelKey( SV_MENU_EDIT_SELECTALL, KeyCode( KEY_A, FALSE, TRUE, FALSE, FALSE ) );
- pPopup->SetAccelKey( SV_MENU_EDIT_INSERTSYMBOL, KeyCode( KEY_S, TRUE, TRUE, FALSE, FALSE ) );
+ pPopup->SetAccelKey( SV_MENU_EDIT_SELECTALL, KeyCode( KEY_A, sal_False, sal_True, sal_False, sal_False ) );
+ pPopup->SetAccelKey( SV_MENU_EDIT_INSERTSYMBOL, KeyCode( KEY_S, sal_True, sal_True, sal_False, sal_False ) );
return pPopup;
}
@@ -2942,7 +2956,7 @@ void Edit::dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::Dra
SolarMutexGuard aVclGuard;
if ( !IsTracking() && maSelection.Len() &&
- !(GetStyle() & WB_PASSWORD) && (!mpDDInfo || mpDDInfo->bStarterOfDD == FALSE) ) // Kein Mehrfach D&D
+ !(GetStyle() & WB_PASSWORD) && (!mpDDInfo || mpDDInfo->bStarterOfDD == sal_False) ) // Kein Mehrfach D&D
{
Selection aSel( maSelection );
aSel.Justify();
@@ -2955,7 +2969,7 @@ void Edit::dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::Dra
if ( !mpDDInfo )
mpDDInfo = new DDInfo;
- mpDDInfo->bStarterOfDD = TRUE;
+ mpDDInfo->bStarterOfDD = sal_True;
mpDDInfo->aDndStartSel = aSel;
@@ -3005,7 +3019,7 @@ void Edit::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent&
{
SolarMutexGuard aVclGuard;
- BOOL bChanges = FALSE;
+ sal_Bool bChanges = sal_False;
if ( !mbReadOnly && mpDDInfo )
{
ImplHideDDCursor();
@@ -3016,7 +3030,7 @@ void Edit::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent&
if ( aSel.Len() && !mpDDInfo->bStarterOfDD )
ImplDelete( aSel, EDIT_DEL_RIGHT, EDIT_DELMODE_SIMPLE );
- mpDDInfo->bDroppedInMe = TRUE;
+ mpDDInfo->bDroppedInMe = sal_True;
aSel.Min() = mpDDInfo->nDropPos;
aSel.Max() = mpDDInfo->nDropPos;
@@ -3033,7 +3047,7 @@ void Edit::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent&
::rtl::OUString aText;
aData >>= aText;
ImplInsertText( aText );
- bChanges = TRUE;
+ bChanges = sal_True;
ImplModified();
}
}
@@ -3048,17 +3062,26 @@ void Edit::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent&
rDTDE.Context->dropComplete( bChanges );
}
-void Edit::dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& ) throw (::com::sun::star::uno::RuntimeException)
+void Edit::dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& rDTDE ) throw (::com::sun::star::uno::RuntimeException)
{
if ( !mpDDInfo )
{
mpDDInfo = new DDInfo;
}
-// sal_Bool bTextContent = mbReadOnly ? sal_False : sal_True; // quiery from rDTDEE.SupportedDataFlavors()
-// if ( bTextContent )
-// rDTDEE.Context->acceptDrop(datatransfer::dnd::DNDConstants::ACTION_COPY_OR_MOVE);
-// else
-// rDTDEE.Context->rejectDrop();
+ // search for string data type
+ const Sequence< com::sun::star::datatransfer::DataFlavor >& rFlavors( rDTDE.SupportedDataFlavors );
+ sal_Int32 nEle = rFlavors.getLength();
+ mpDDInfo->bIsStringSupported = sal_False;
+ for( sal_Int32 i = 0; i < nEle; i++ )
+ {
+ sal_Int32 nIndex = 0;
+ rtl::OUString aMimetype = rFlavors[i].MimeType.getToken( 0, ';', nIndex );
+ if( aMimetype.equalsAscii( "text/plain" ) )
+ {
+ mpDDInfo->bIsStringSupported = sal_True;
+ break;
+ }
+ }
}
void Edit::dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& ) throw (::com::sun::star::uno::RuntimeException)
@@ -3090,7 +3113,7 @@ void Edit::dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEv
aSel.Justify();
// Don't accept drop in selection or read-only field...
- if ( IsReadOnly() || aSel.IsInside( mpDDInfo->nDropPos ) )
+ if ( IsReadOnly() || aSel.IsInside( mpDDInfo->nDropPos ) || ! mpDDInfo->bIsStringSupported )
{
ImplHideDDCursor();
rDTDE.Context->rejectDrag();
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 4fffe2f277ca..1d5b0c66b400 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -52,8 +52,6 @@
using namespace ::com::sun::star;
-static ResStringArray *strAllUnits = NULL;
-
// -----------------------------------------------------------------------
#define FORMAT_NUMERIC 1
@@ -62,9 +60,9 @@ static ResStringArray *strAllUnits = NULL;
// -----------------------------------------------------------------------
-static sal_Int64 ImplPower10( USHORT n )
+static sal_Int64 ImplPower10( sal_uInt16 n )
{
- USHORT i;
+ sal_uInt16 i;
sal_Int64 nValue = 1;
for ( i=0; i < n; i++ )
@@ -75,16 +73,16 @@ static sal_Int64 ImplPower10( USHORT n )
// -----------------------------------------------------------------------
-static BOOL ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt,
- BOOL bStrictFormat, BOOL bThousandSep,
+static sal_Bool ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt,
+ sal_Bool bStrictFormat, sal_Bool bThousandSep,
const LocaleDataWrapper& rLocaleDataWrappper )
{
if ( !bStrictFormat )
- return FALSE;
+ return sal_False;
else
{
xub_Unicode cChar = rKEvt.GetCharCode();
- USHORT nGroup = rKEvt.GetKeyCode().GetGroup();
+ sal_uInt16 nGroup = rKEvt.GetKeyCode().GetGroup();
if ( (nGroup == KEYGROUP_FKEYS) || (nGroup == KEYGROUP_CURSOR) ||
(nGroup == KEYGROUP_MISC) ||
@@ -92,28 +90,28 @@ static BOOL ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt,
(cChar == rLocaleDataWrappper.getNumDecimalSep() ) ||
(bThousandSep && (cChar == rLocaleDataWrappper.getNumThousandSep())) ||
(cChar == '-') )
- return FALSE;
+ return sal_False;
else
- return TRUE;
+ return sal_True;
}
}
// -----------------------------------------------------------------------
-static BOOL ImplNumericGetValue( const XubString& rStr, double& rValue,
- USHORT nDecDigits, const LocaleDataWrapper& rLocaleDataWrappper,
- BOOL bCurrency = FALSE )
+static sal_Bool ImplNumericGetValue( const XubString& rStr, double& rValue,
+ sal_uInt16 nDecDigits, const LocaleDataWrapper& rLocaleDataWrappper,
+ sal_Bool bCurrency = sal_False )
{
XubString aStr = rStr;
XubString aStr1;
XubString aStr2;
- BOOL bNegative = FALSE;
+ sal_Bool bNegative = sal_False;
xub_StrLen nDecPos;
xub_StrLen i;
// Reaktion auf leeren String
if ( !rStr.Len() )
- return FALSE;
+ return sal_False;
// Fuehrende und nachfolgende Leerzeichen entfernen
aStr.EraseLeadingAndTrailingChars( ' ' );
@@ -132,7 +130,7 @@ static BOOL ImplNumericGetValue( const XubString& rStr, double& rValue,
if ( bCurrency )
{
if ( (aStr.GetChar( 0 ) == '(') && (aStr.GetChar( aStr.Len()-1 ) == ')') )
- bNegative = TRUE;
+ bNegative = sal_True;
if ( !bNegative )
{
for ( i=0; i < aStr.Len(); i++ )
@@ -141,14 +139,14 @@ static BOOL ImplNumericGetValue( const XubString& rStr, double& rValue,
break;
else if ( aStr.GetChar( i ) == '-' )
{
- bNegative = TRUE;
+ bNegative = sal_True;
break;
}
}
}
if ( !bNegative && bCurrency && aStr.Len() )
{
- USHORT nFormat = rLocaleDataWrappper.getCurrNegativeFormat();
+ sal_uInt16 nFormat = rLocaleDataWrappper.getCurrNegativeFormat();
if ( (nFormat == 3) || (nFormat == 6) ||
(nFormat == 7) || (nFormat == 10) )
{
@@ -158,7 +156,7 @@ static BOOL ImplNumericGetValue( const XubString& rStr, double& rValue,
break;
else if ( aStr.GetChar( i ) == '-' )
{
- bNegative = TRUE;
+ bNegative = sal_True;
break;
}
}
@@ -168,7 +166,7 @@ static BOOL ImplNumericGetValue( const XubString& rStr, double& rValue,
else
{
if ( aStr1.GetChar( 0 ) == '-' )
- bNegative = TRUE;
+ bNegative = sal_True;
}
// Alle unerwuenschten Zeichen rauswerfen
@@ -188,7 +186,7 @@ static BOOL ImplNumericGetValue( const XubString& rStr, double& rValue,
}
if ( !aStr1.Len() && !aStr2.Len() )
- return FALSE;
+ return sal_False;
if ( !aStr1.Len() )
aStr1.Insert( '0' );
@@ -196,11 +194,11 @@ static BOOL ImplNumericGetValue( const XubString& rStr, double& rValue,
aStr1.Insert( '-', 0 );
// Nachkommateil zurechtstutzen und dabei runden
- BOOL bRound = FALSE;
+ sal_Bool bRound = sal_False;
if ( aStr2.Len() > nDecDigits )
{
if ( aStr2.GetChar( nDecDigits ) >= '5' )
- bRound = TRUE;
+ bRound = sal_True;
aStr2.Erase( nDecDigits );
}
if ( aStr2.Len() < nDecDigits )
@@ -221,7 +219,43 @@ static BOOL ImplNumericGetValue( const XubString& rStr, double& rValue,
rValue = nValue;
- return TRUE;
+ return sal_True;
+}
+
+static void ImplUpdateSeparatorString( String& io_rText,
+ const String& rOldDecSep, const String& rNewDecSep,
+ const String& rOldThSep, const String& rNewThSep )
+{
+ rtl::OUStringBuffer aBuf( io_rText.Len() );
+ xub_StrLen nIndexDec = 0, nIndexTh = 0, nIndex = 0;
+
+ const sal_Unicode* pBuffer = io_rText.GetBuffer();
+ while( nIndex != STRING_NOTFOUND )
+ {
+ nIndexDec = io_rText.Search( rOldDecSep, nIndex );
+ nIndexTh = io_rText.Search( rOldThSep, nIndex );
+ if( (nIndexTh != STRING_NOTFOUND && nIndexDec != STRING_NOTFOUND && nIndexTh < nIndexDec )
+ || (nIndexTh != STRING_NOTFOUND && nIndexDec == STRING_NOTFOUND)
+ )
+ {
+ aBuf.append( pBuffer + nIndex, nIndexTh - nIndex );
+ aBuf.append( rNewThSep );
+ nIndex = nIndexTh + rOldThSep.Len();
+ }
+ else if( nIndexDec != STRING_NOTFOUND )
+ {
+ aBuf.append( pBuffer + nIndex, nIndexDec - nIndex );
+ aBuf.append( rNewDecSep );
+ nIndex = nIndexDec + rOldDecSep.Len();
+ }
+ else
+ {
+ aBuf.append( pBuffer + nIndex );
+ nIndex = STRING_NOTFOUND;
+ }
+ }
+
+ io_rText = aBuf.makeStringAndClear();
}
static void ImplUpdateSeparators( const String& rOldDecSep, const String& rNewDecSep,
@@ -233,29 +267,25 @@ static void ImplUpdateSeparators( const String& rOldDecSep, const String& rNewDe
if( bChangeDec || bChangeTh )
{
- BOOL bUpdateMode = pEdit->IsUpdateMode();
- pEdit->SetUpdateMode( FALSE );
+ sal_Bool bUpdateMode = pEdit->IsUpdateMode();
+ pEdit->SetUpdateMode( sal_False );
String aText = pEdit->GetText();
- if( bChangeDec )
- aText.SearchAndReplaceAll( rNewDecSep, rOldDecSep );
- if( bChangeTh )
- aText.SearchAndReplaceAll( rNewThSep, rOldThSep );
+ ImplUpdateSeparatorString( aText, rOldDecSep, rNewDecSep, rOldThSep, rNewThSep );
pEdit->SetText( aText );
ComboBox* pCombo = dynamic_cast<ComboBox*>(pEdit);
if( pCombo )
{
// update box entries
- USHORT nEntryCount = pCombo->GetEntryCount();
- for ( USHORT i=0; i < nEntryCount; i++ )
+ sal_uInt16 nEntryCount = pCombo->GetEntryCount();
+ for ( sal_uInt16 i=0; i < nEntryCount; i++ )
{
aText = pCombo->GetEntry( i );
- if( bChangeDec )
- aText.SearchAndReplaceAll( rNewDecSep, rOldDecSep );
- if( bChangeTh )
- aText.SearchAndReplaceAll( rNewThSep, rOldThSep );
+ void* pEntryData = pCombo->GetEntryData( i );
+ ImplUpdateSeparatorString( aText, rOldDecSep, rNewDecSep, rOldThSep, rNewThSep );
pCombo->RemoveEntry( i );
pCombo->InsertEntry( aText, i );
+ pCombo->SetEntryData( i, pEntryData );
}
}
if( bUpdateMode )
@@ -269,11 +299,11 @@ FormatterBase::FormatterBase( Edit* pField )
{
mpField = pField;
mpLocaleDataWrapper = NULL;
- mbReformat = FALSE;
- mbStrictFormat = FALSE;
- mbEmptyFieldValue = FALSE;
- mbEmptyFieldValueEnabled = FALSE;
- mbDefaultLocale = TRUE;
+ mbReformat = sal_False;
+ mbStrictFormat = sal_False;
+ mbEmptyFieldValue = sal_False;
+ mbEmptyFieldValueEnabled = sal_False;
+ mbDefaultLocale = sal_True;
}
// -----------------------------------------------------------------------
@@ -314,7 +344,7 @@ void FormatterBase::ReformatAll()
// -----------------------------------------------------------------------
-void FormatterBase::SetStrictFormat( BOOL bStrict )
+void FormatterBase::SetStrictFormat( sal_Bool bStrict )
{
if ( bStrict != mbStrictFormat )
{
@@ -329,7 +359,7 @@ void FormatterBase::SetStrictFormat( BOOL bStrict )
void FormatterBase::SetLocale( const lang::Locale& rLocale )
{
ImplGetLocaleDataWrapper().setLocale( rLocale );
- mbDefaultLocale = FALSE;
+ mbDefaultLocale = sal_False;
ReformatAll();
}
@@ -360,7 +390,7 @@ const AllSettings& FormatterBase::GetFieldSettings() const
// -----------------------------------------------------------------------
-void FormatterBase::SetFieldText( const XubString& rText, BOOL bKeepSelection )
+void FormatterBase::SetFieldText( const XubString& rText, sal_Bool bKeepSelection )
{
if ( mpField )
{
@@ -387,7 +417,7 @@ void FormatterBase::ImplSetText( const XubString& rText, Selection* pNewSelectio
mpField->SetText( rText, aSel );
}
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
}
}
@@ -397,23 +427,23 @@ void FormatterBase::SetEmptyFieldValue()
{
if ( mpField )
mpField->SetText( ImplGetSVEmptyStr() );
- mbEmptyFieldValue = TRUE;
+ mbEmptyFieldValue = sal_True;
}
// -----------------------------------------------------------------------
-BOOL FormatterBase::IsEmptyFieldValue() const
+sal_Bool FormatterBase::IsEmptyFieldValue() const
{
return (!mpField || !mpField->GetText().Len());
}
// -----------------------------------------------------------------------
-BOOL NumericFormatter::ImplNumericReformat( const XubString& rStr, double& rValue,
+sal_Bool NumericFormatter::ImplNumericReformat( const XubString& rStr, double& rValue,
XubString& rOutStr )
{
if ( !ImplNumericGetValue( rStr, rValue, GetDecimalDigits(), ImplGetLocaleDataWrapper() ) )
- return TRUE;
+ return sal_True;
else
{
double nTempVal = rValue;
@@ -429,14 +459,14 @@ BOOL NumericFormatter::ImplNumericReformat( const XubString& rStr, double& rValu
if ( !GetErrorHdl().Call( this ) )
{
mnCorrectedValue = 0;
- return FALSE;
+ return sal_False;
}
else
mnCorrectedValue = 0;
}
rOutStr = CreateFieldText( (sal_Int64)nTempVal );
- return TRUE;
+ return sal_True;
}
}
@@ -451,8 +481,8 @@ void NumericFormatter::ImplInit()
mnCorrectedValue = 0;
mnDecimalDigits = 2;
mnType = FORMAT_NUMERIC;
- mbThousandSep = TRUE;
- mbShowTrailingZeros = TRUE;
+ mbThousandSep = sal_True;
+ mbShowTrailingZeros = sal_True;
// for fields
mnSpinSize = 1;
@@ -477,7 +507,7 @@ void NumericFormatter::ImplLoadRes( const ResId& rResId )
if( pMgr )
{
- ULONG nMask = pMgr->ReadLong();
+ sal_uLong nMask = pMgr->ReadLong();
if ( NUMERICFORMATTER_MIN & nMask )
mnMin = pMgr->ReadLong();
@@ -486,7 +516,7 @@ void NumericFormatter::ImplLoadRes( const ResId& rResId )
mnMax = pMgr->ReadLong();
if ( NUMERICFORMATTER_STRICTFORMAT & nMask )
- SetStrictFormat( (BOOL)pMgr->ReadShort() );
+ SetStrictFormat( (sal_Bool)pMgr->ReadShort() );
if ( NUMERICFORMATTER_DECIMALDIGITS & nMask )
SetDecimalDigits( pMgr->ReadShort() );
@@ -502,7 +532,7 @@ void NumericFormatter::ImplLoadRes( const ResId& rResId )
}
if ( NUMERICFORMATTER_NOTHOUSANDSEP & nMask )
- SetUseThousandSep( !(BOOL)pMgr->ReadShort() );
+ SetUseThousandSep( !(sal_Bool)pMgr->ReadShort() );
}
}
@@ -532,7 +562,7 @@ void NumericFormatter::SetMax( sal_Int64 nNewMax )
// -----------------------------------------------------------------------
-void NumericFormatter::SetUseThousandSep( BOOL b )
+void NumericFormatter::SetUseThousandSep( sal_Bool b )
{
mbThousandSep = b;
ReformatAll();
@@ -540,7 +570,7 @@ void NumericFormatter::SetUseThousandSep( BOOL b )
// -----------------------------------------------------------------------
-void NumericFormatter::SetDecimalDigits( USHORT nDigits )
+void NumericFormatter::SetDecimalDigits( sal_uInt16 nDigits )
{
mnDecimalDigits = nDigits;
ReformatAll();
@@ -548,7 +578,7 @@ void NumericFormatter::SetDecimalDigits( USHORT nDigits )
// -----------------------------------------------------------------------
-void NumericFormatter::SetShowTrailingZeros( BOOL bShowTrailingZeros )
+void NumericFormatter::SetShowTrailingZeros( sal_Bool bShowTrailingZeros )
{
if ( mbShowTrailingZeros != bShowTrailingZeros )
{
@@ -559,7 +589,7 @@ void NumericFormatter::SetShowTrailingZeros( BOOL bShowTrailingZeros )
// -----------------------------------------------------------------------
-USHORT NumericFormatter::GetDecimalDigits() const
+sal_uInt16 NumericFormatter::GetDecimalDigits() const
{
return mnDecimalDigits;
}
@@ -570,7 +600,7 @@ void NumericFormatter::SetValue( sal_Int64 nNewValue )
{
SetUserValue( nNewValue );
mnFieldValue = mnLastValue;
- SetEmptyFieldValueData( FALSE );
+ SetEmptyFieldValueData( sal_False );
}
// -----------------------------------------------------------------------
@@ -626,14 +656,14 @@ sal_Int64 NumericFormatter::GetValue() const
// -----------------------------------------------------------------------
-BOOL NumericFormatter::IsValueModified() const
+sal_Bool NumericFormatter::IsValueModified() const
{
if ( ImplGetEmptyFieldValue() )
return !IsEmptyFieldValue();
else if ( GetValue() != mnFieldValue )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -690,7 +720,7 @@ void NumericFormatter::Reformat()
XubString aStr;
// caution: precision loss in double cast
double nTemp = (double)mnLastValue;
- BOOL bOK = ImplNumericReformat( GetField()->GetText(), nTemp, aStr );
+ sal_Bool bOK = ImplNumericReformat( GetField()->GetText(), nTemp, aStr );
mnLastValue = (sal_Int64)nTemp;
if ( !bOK )
return;
@@ -810,7 +840,7 @@ void NumericField::ImplLoadRes( const ResId& rResId )
SpinField::ImplLoadRes( rResId );
NumericFormatter::ImplLoadRes( ResId( (RSHEADER_TYPE *)GetClassRes(), *rResId.GetResMgr() ) );
- ULONG nMask = ReadLongRes();
+ sal_uLong nMask = ReadLongRes();
if ( NUMERICFIELD_FIRST & nMask )
mnFirst = ReadLongRes();
@@ -846,7 +876,7 @@ long NumericField::PreNotify( NotifyEvent& rNEvt )
long NumericField::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -879,7 +909,7 @@ void NumericField::DataChanged( const DataChangedEvent& rDCEvt )
void NumericField::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
SpinField::Modify();
}
@@ -965,7 +995,7 @@ long NumericBox::PreNotify( NotifyEvent& rNEvt )
long NumericBox::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -998,7 +1028,7 @@ void NumericBox::DataChanged( const DataChangedEvent& rDCEvt )
void NumericBox::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
ComboBox::Modify();
}
@@ -1008,21 +1038,21 @@ void NumericBox::ReformatAll()
{
double nValue;
XubString aStr;
- SetUpdateMode( FALSE );
- USHORT nEntryCount = GetEntryCount();
- for ( USHORT i=0; i < nEntryCount; i++ )
+ SetUpdateMode( sal_False );
+ sal_uInt16 nEntryCount = GetEntryCount();
+ for ( sal_uInt16 i=0; i < nEntryCount; i++ )
{
ImplNumericReformat( GetEntry( i ), nValue, aStr );
RemoveEntry( i );
InsertEntry( aStr, i );
}
NumericFormatter::Reformat();
- SetUpdateMode( TRUE );
+ SetUpdateMode( sal_True );
}
// -----------------------------------------------------------------------
-void NumericBox::InsertValue( sal_Int64 nValue, USHORT nPos )
+void NumericBox::InsertValue( sal_Int64 nValue, sal_uInt16 nPos )
{
ComboBox::InsertEntry( CreateFieldText( nValue ), nPos );
}
@@ -1036,7 +1066,7 @@ void NumericBox::RemoveValue( sal_Int64 nValue )
// -----------------------------------------------------------------------
-sal_Int64 NumericBox::GetValue( USHORT nPos ) const
+sal_Int64 NumericBox::GetValue( sal_uInt16 nPos ) const
{
double nValue = 0;
ImplNumericGetValue( ComboBox::GetEntry( nPos ), nValue, GetDecimalDigits(), ImplGetLocaleDataWrapper() );
@@ -1045,19 +1075,19 @@ sal_Int64 NumericBox::GetValue( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT NumericBox::GetValuePos( sal_Int64 nValue ) const
+sal_uInt16 NumericBox::GetValuePos( sal_Int64 nValue ) const
{
return ComboBox::GetEntryPos( CreateFieldText( nValue ) );
}
// -----------------------------------------------------------------------
-static BOOL ImplMetricProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
- BOOL, BOOL bUseThousandSep, const LocaleDataWrapper& rWrapper )
+static sal_Bool ImplMetricProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
+ sal_Bool, sal_Bool bUseThousandSep, const LocaleDataWrapper& rWrapper )
{
// Es gibt hier kein sinnvolles StrictFormat, also alle
// Zeichen erlauben
- return ImplNumericProcessKeyInput( pEdit, rKEvt, FALSE, bUseThousandSep, rWrapper );
+ return ImplNumericProcessKeyInput( pEdit, rKEvt, sal_False, bUseThousandSep, rWrapper );
}
// -----------------------------------------------------------------------
@@ -1083,7 +1113,7 @@ static XubString ImplMetricGetUnitText( const XubString& rStr )
/*
// MT: #90545# Preparation for translated strings...
String aMetricText;
- for ( USHORT n = rStr.Len(); n; )
+ for ( sal_uInt16 n = rStr.Len(); n; )
{
sal_Unicode c = rStr.GetChar( --n );
sal_Int32 nType = xCharClass->getStringType( rStr, n, 1, rLocale );
@@ -1105,38 +1135,37 @@ static XubString ImplMetricGetUnitText( const XubString& rStr )
// #104355# support localized mesaurements
-static String ImplMetricToString( FieldUnit rUnit )
+static const String& ImplMetricToString( FieldUnit rUnit )
{
- if( !strAllUnits )
+ FieldUnitStringList* pList = ImplGetFieldUnits();
+ if( pList )
{
- ResMgr* pResMgr = ImplGetResMgr();
- strAllUnits = new ResStringArray( ResId (SV_FUNIT_STRINGS, *pResMgr) );
+ // return unit's default string (ie, the first one )
+ for( FieldUnitStringList::const_iterator it = pList->begin(); it != pList->end(); ++it )
+ {
+ if ( it->second == rUnit )
+ return it->first;
+ }
}
- // return unit's default string (ie, the first one )
- for( USHORT i=0; i < strAllUnits->Count(); i++ )
- if( (FieldUnit) strAllUnits->GetValue( i ) == rUnit )
- return strAllUnits->GetString( i );
- return String();
+ return String::EmptyString();
}
static FieldUnit ImplStringToMetric( const String &rMetricString )
{
- if( !strAllUnits )
+ FieldUnitStringList* pList = ImplGetCleanedFieldUnits();
+ if( pList )
{
- ResMgr* pResMgr = ImplGetResMgr();
- strAllUnits = new ResStringArray( ResId (SV_FUNIT_STRINGS, *pResMgr) );
+ // return FieldUnit
+ String aStr( rMetricString );
+ aStr.ToLowerAscii();
+ aStr.EraseAllChars( sal_Unicode( ' ' ) );
+ for( FieldUnitStringList::const_iterator it = pList->begin(); it != pList->end(); ++it )
+ {
+ if ( it->first.Equals( aStr ) )
+ return it->second;
+ }
}
- // return FieldUnit
- String aStr( rMetricString );
- aStr.ToLowerAscii();
- for( USHORT i=0; i < strAllUnits->Count(); i++ )
- if ( strAllUnits->GetString( i ).Equals( aStr ) )
- return (FieldUnit) strAllUnits->GetValue( i );
-
- // Amelia : about character unit
- if (aStr.EqualsIgnoreCaseAscii("cm"))
- return FUNIT_CM;
return FUNIT_NONE;
}
@@ -1225,7 +1254,7 @@ static double nonValueDoubleToValueDouble( double nValue )
return rtl::math::isFinite( nValue ) ? nValue : 0.0;
}
-sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_Int64 mnBaseValue, USHORT nDecDigits,
+sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits,
FieldUnit eInUnit, FieldUnit eOutUnit )
{
double nDouble = nonValueDoubleToValueDouble( ConvertDoubleValue(
@@ -1244,7 +1273,7 @@ sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_Int64 mnBaseValue, US
// -----------------------------------------------------------------------
-sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, USHORT nDigits,
+sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_uInt16 nDigits,
MapUnit eInUnit, FieldUnit eOutUnit )
{
return static_cast<sal_Int64>(
@@ -1254,7 +1283,7 @@ sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, USHORT nDigits,
// -----------------------------------------------------------------------
-sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, USHORT nDigits,
+sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_uInt16 nDigits,
FieldUnit eInUnit, MapUnit eOutUnit )
{
return static_cast<sal_Int64>(
@@ -1264,7 +1293,7 @@ sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, USHORT nDigits,
// -----------------------------------------------------------------------
-double MetricField::ConvertDoubleValue( double nValue, sal_Int64 mnBaseValue, USHORT nDecDigits,
+double MetricField::ConvertDoubleValue( double nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits,
FieldUnit eInUnit, FieldUnit eOutUnit )
{
if ( eInUnit != eOutUnit )
@@ -1276,7 +1305,7 @@ double MetricField::ConvertDoubleValue( double nValue, sal_Int64 mnBaseValue, US
if ( (mnBaseValue <= 0) || (nValue <= 0) )
return nValue;
nDiv = 100;
- for ( USHORT i=0; i < nDecDigits; i++ )
+ for ( sal_uInt16 i=0; i < nDecDigits; i++ )
nDiv *= 10;
nMult = mnBaseValue;
@@ -1315,7 +1344,7 @@ double MetricField::ConvertDoubleValue( double nValue, sal_Int64 mnBaseValue, US
// -----------------------------------------------------------------------
-double MetricField::ConvertDoubleValue( double nValue, USHORT nDigits,
+double MetricField::ConvertDoubleValue( double nValue, sal_uInt16 nDigits,
MapUnit eInUnit, FieldUnit eOutUnit )
{
if ( eOutUnit == FUNIT_PERCENT ||
@@ -1372,7 +1401,7 @@ double MetricField::ConvertDoubleValue( double nValue, USHORT nDigits,
// -----------------------------------------------------------------------
-double MetricField::ConvertDoubleValue( double nValue, USHORT nDigits,
+double MetricField::ConvertDoubleValue( double nValue, sal_uInt16 nDigits,
FieldUnit eInUnit, MapUnit eOutUnit )
{
if ( eInUnit == FUNIT_PERCENT ||
@@ -1429,12 +1458,12 @@ double MetricField::ConvertDoubleValue( double nValue, USHORT nDigits,
// -----------------------------------------------------------------------
-static BOOL ImplMetricGetValue( const XubString& rStr, double& rValue, sal_Int64 nBaseValue,
- USHORT nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper, FieldUnit eUnit )
+static sal_Bool ImplMetricGetValue( const XubString& rStr, double& rValue, sal_Int64 nBaseValue,
+ sal_uInt16 nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper, FieldUnit eUnit )
{
// Zahlenwert holen
if ( !ImplNumericGetValue( rStr, rValue, nDecDigits, rLocaleDataWrapper ) )
- return FALSE;
+ return sal_False;
// Einheit rausfinden
FieldUnit eEntryUnit = ImplMetricGetUnit( rStr );
@@ -1442,15 +1471,15 @@ static BOOL ImplMetricGetValue( const XubString& rStr, double& rValue, sal_Int64
// Einheiten umrechnen
rValue = MetricField::ConvertDoubleValue( rValue, nBaseValue, nDecDigits, eEntryUnit, eUnit );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL MetricFormatter::ImplMetricReformat( const XubString& rStr, double& rValue, XubString& rOutStr )
+sal_Bool MetricFormatter::ImplMetricReformat( const XubString& rStr, double& rValue, XubString& rOutStr )
{
if ( !ImplMetricGetValue( rStr, rValue, mnBaseValue, GetDecimalDigits(), ImplGetLocaleDataWrapper(), meUnit ) )
- return TRUE;
+ return sal_True;
else
{
double nTempVal = rValue;
@@ -1466,14 +1495,14 @@ BOOL MetricFormatter::ImplMetricReformat( const XubString& rStr, double& rValue,
if ( !GetErrorHdl().Call( this ) )
{
mnCorrectedValue = 0;
- return FALSE;
+ return sal_False;
}
else
mnCorrectedValue = 0;
}
rOutStr = CreateFieldText( (sal_Int64)nTempVal );
- return TRUE;
+ return sal_True;
}
}
@@ -1502,7 +1531,7 @@ void MetricFormatter::ImplLoadRes( const ResId& rResId )
ResMgr* pMgr = rResId.GetResMgr();
if( pMgr )
{
- ULONG nMask = pMgr->ReadLong();
+ sal_uLong nMask = pMgr->ReadLong();
if ( METRICFORMATTER_UNIT & nMask )
meUnit = (FieldUnit)pMgr->ReadLong();
@@ -1676,7 +1705,7 @@ void MetricFormatter::Reformat()
XubString aStr;
// caution: precision loss in double cast
double nTemp = (double)mnLastValue;
- BOOL bOK = ImplMetricReformat( aText, nTemp, aStr );
+ sal_Bool bOK = ImplMetricReformat( aText, nTemp, aStr );
mnLastValue = (sal_Int64)nTemp;
if ( !bOK )
@@ -1733,7 +1762,7 @@ void MetricField::ImplLoadRes( const ResId& rResId )
SpinField::ImplLoadRes( rResId );
MetricFormatter::ImplLoadRes( ResId( (RSHEADER_TYPE *)GetClassRes(), *rResId.GetResMgr() ) );
- ULONG nMask = ReadLongRes();
+ sal_uLong nMask = ReadLongRes();
if ( METRICFIELD_FIRST & nMask )
mnFirst = ReadLongRes();
@@ -1825,7 +1854,7 @@ long MetricField::PreNotify( NotifyEvent& rNEvt )
long MetricField::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -1858,7 +1887,7 @@ void MetricField::DataChanged( const DataChangedEvent& rDCEvt )
void MetricField::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
SpinField::Modify();
}
@@ -1951,7 +1980,7 @@ long MetricBox::PreNotify( NotifyEvent& rNEvt )
long MetricBox::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -1984,7 +2013,7 @@ void MetricBox::DataChanged( const DataChangedEvent& rDCEvt )
void MetricBox::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
ComboBox::Modify();
}
@@ -1994,16 +2023,16 @@ void MetricBox::ReformatAll()
{
double nValue;
XubString aStr;
- SetUpdateMode( FALSE );
- USHORT nEntryCount = GetEntryCount();
- for ( USHORT i=0; i < nEntryCount; i++ )
+ SetUpdateMode( sal_False );
+ sal_uInt16 nEntryCount = GetEntryCount();
+ for ( sal_uInt16 i=0; i < nEntryCount; i++ )
{
ImplMetricReformat( GetEntry( i ), nValue, aStr );
RemoveEntry( i );
InsertEntry( aStr, i );
}
MetricFormatter::Reformat();
- SetUpdateMode( TRUE );
+ SetUpdateMode( sal_True );
}
// -----------------------------------------------------------------------
@@ -2015,7 +2044,7 @@ void MetricBox::CustomConvert()
// -----------------------------------------------------------------------
-void MetricBox::InsertValue( sal_Int64 nValue, FieldUnit eInUnit, USHORT nPos )
+void MetricBox::InsertValue( sal_Int64 nValue, FieldUnit eInUnit, sal_uInt16 nPos )
{
// Umrechnen auf eingestellte Einheiten
nValue = MetricField::ConvertValue( nValue, mnBaseValue, GetDecimalDigits(),
@@ -2035,7 +2064,7 @@ void MetricBox::RemoveValue( sal_Int64 nValue, FieldUnit eInUnit )
// -----------------------------------------------------------------------
-sal_Int64 MetricBox::GetValue( USHORT nPos, FieldUnit eOutUnit ) const
+sal_Int64 MetricBox::GetValue( sal_uInt16 nPos, FieldUnit eOutUnit ) const
{
double nValue = 0;
ImplMetricGetValue( ComboBox::GetEntry( nPos ), nValue, mnBaseValue,
@@ -2050,7 +2079,7 @@ sal_Int64 MetricBox::GetValue( USHORT nPos, FieldUnit eOutUnit ) const
// -----------------------------------------------------------------------
-USHORT MetricBox::GetValuePos( sal_Int64 nValue, FieldUnit eInUnit ) const
+sal_uInt16 MetricBox::GetValuePos( sal_Int64 nValue, FieldUnit eInUnit ) const
{
// Umrechnen auf eingestellte Einheiten
nValue = MetricField::ConvertValue( nValue, mnBaseValue, GetDecimalDigits(),
@@ -2076,31 +2105,31 @@ sal_Int64 MetricBox::GetValue() const
// -----------------------------------------------------------------------
-static BOOL ImplCurrencyProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
- BOOL, BOOL bUseThousandSep, const LocaleDataWrapper& rWrapper )
+static sal_Bool ImplCurrencyProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
+ sal_Bool, sal_Bool bUseThousandSep, const LocaleDataWrapper& rWrapper )
{
// Es gibt hier kein sinnvolles StrictFormat, also alle
// Zeichen erlauben
- return ImplNumericProcessKeyInput( pEdit, rKEvt, FALSE, bUseThousandSep, rWrapper );
+ return ImplNumericProcessKeyInput( pEdit, rKEvt, sal_False, bUseThousandSep, rWrapper );
}
// -----------------------------------------------------------------------
-inline BOOL ImplCurrencyGetValue( const XubString& rStr, double& rValue,
- USHORT nDecDigits, const LocaleDataWrapper& rWrapper )
+inline sal_Bool ImplCurrencyGetValue( const XubString& rStr, double& rValue,
+ sal_uInt16 nDecDigits, const LocaleDataWrapper& rWrapper )
{
// Zahlenwert holen
- return ImplNumericGetValue( rStr, rValue, nDecDigits, rWrapper, TRUE );
+ return ImplNumericGetValue( rStr, rValue, nDecDigits, rWrapper, sal_True );
}
// -----------------------------------------------------------------------
-BOOL CurrencyFormatter::ImplCurrencyReformat( const XubString& rStr,
+sal_Bool CurrencyFormatter::ImplCurrencyReformat( const XubString& rStr,
XubString& rOutStr )
{
double nValue;
- if ( !ImplNumericGetValue( rStr, nValue, GetDecimalDigits(), ImplGetLocaleDataWrapper(), TRUE ) )
- return TRUE;
+ if ( !ImplNumericGetValue( rStr, nValue, GetDecimalDigits(), ImplGetLocaleDataWrapper(), sal_True ) )
+ return sal_True;
else
{
double nTempVal = nValue;
@@ -2116,14 +2145,14 @@ BOOL CurrencyFormatter::ImplCurrencyReformat( const XubString& rStr,
if ( !GetErrorHdl().Call( this ) )
{
mnCorrectedValue = 0;
- return FALSE;
+ return sal_False;
}
else
mnCorrectedValue = 0;
}
rOutStr = CreateFieldText( (long)nTempVal );
- return TRUE;
+ return sal_True;
}
}
@@ -2168,7 +2197,7 @@ void CurrencyFormatter::SetValue( sal_Int64 nNewValue )
{
SetUserValue( nNewValue );
mnFieldValue = mnLastValue;
- SetEmptyFieldValueData( FALSE );
+ SetEmptyFieldValueData( sal_False );
}
// -----------------------------------------------------------------------
@@ -2207,7 +2236,7 @@ void CurrencyFormatter::Reformat()
return;
XubString aStr;
- BOOL bOK = ImplCurrencyReformat( GetField()->GetText(), aStr );
+ sal_Bool bOK = ImplCurrencyReformat( GetField()->GetText(), aStr );
if ( !bOK )
return;
@@ -2254,7 +2283,7 @@ void CurrencyField::ImplLoadRes( const ResId& rResId )
SpinField::ImplLoadRes( rResId );
CurrencyFormatter::ImplLoadRes( ResId( (RSHEADER_TYPE *)GetClassRes(), *rResId.GetResMgr() ) );
- ULONG nMask = ReadLongRes();
+ sal_uLong nMask = ReadLongRes();
if ( CURRENCYFIELD_FIRST & nMask )
mnFirst = ReadLongRes();
@@ -2292,7 +2321,7 @@ long CurrencyField::PreNotify( NotifyEvent& rNEvt )
long CurrencyField::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -2325,7 +2354,7 @@ void CurrencyField::DataChanged( const DataChangedEvent& rDCEvt )
void CurrencyField::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
SpinField::Modify();
}
@@ -2411,7 +2440,7 @@ long CurrencyBox::PreNotify( NotifyEvent& rNEvt )
long CurrencyBox::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -2444,7 +2473,7 @@ void CurrencyBox::DataChanged( const DataChangedEvent& rDCEvt )
void CurrencyBox::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
ComboBox::Modify();
}
@@ -2453,21 +2482,21 @@ void CurrencyBox::Modify()
void CurrencyBox::ReformatAll()
{
XubString aStr;
- SetUpdateMode( FALSE );
- USHORT nEntryCount = GetEntryCount();
- for ( USHORT i=0; i < nEntryCount; i++ )
+ SetUpdateMode( sal_False );
+ sal_uInt16 nEntryCount = GetEntryCount();
+ for ( sal_uInt16 i=0; i < nEntryCount; i++ )
{
ImplCurrencyReformat( GetEntry( i ), aStr );
RemoveEntry( i );
InsertEntry( aStr, i );
}
CurrencyFormatter::Reformat();
- SetUpdateMode( TRUE );
+ SetUpdateMode( sal_True );
}
// -----------------------------------------------------------------------
-void CurrencyBox::InsertValue( sal_Int64 nValue, USHORT nPos )
+void CurrencyBox::InsertValue( sal_Int64 nValue, sal_uInt16 nPos )
{
ComboBox::InsertEntry( CreateFieldText( nValue ), nPos );
}
@@ -2481,7 +2510,7 @@ void CurrencyBox::RemoveValue( sal_Int64 nValue )
// -----------------------------------------------------------------------
-sal_Int64 CurrencyBox::GetValue( USHORT nPos ) const
+sal_Int64 CurrencyBox::GetValue( sal_uInt16 nPos ) const
{
double nValue = 0;
ImplCurrencyGetValue( ComboBox::GetEntry( nPos ), nValue, GetDecimalDigits(), ImplGetLocaleDataWrapper() );
@@ -2490,7 +2519,7 @@ sal_Int64 CurrencyBox::GetValue( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT CurrencyBox::GetValuePos( sal_Int64 nValue ) const
+sal_uInt16 CurrencyBox::GetValuePos( sal_Int64 nValue ) const
{
return ComboBox::GetEntryPos( CreateFieldText( nValue ) );
}
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index bd6eec0029e8..65e8c8d91f82 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -92,7 +92,7 @@ static sal_Unicode* ImplAddString( sal_Unicode* pBuf, const String& rStr )
// -----------------------------------------------------------------------
-static sal_Unicode* ImplAddNum( sal_Unicode* pBuf, ULONG nNumber, int nMinLen )
+static sal_Unicode* ImplAddNum( sal_Unicode* pBuf, sal_uLong nNumber, int nMinLen )
{
// fill temp buffer with digits
sal_Unicode aTempBuf[30];
@@ -129,15 +129,15 @@ static sal_Unicode* ImplAddNum( sal_Unicode* pBuf, ULONG nNumber, int nMinLen )
// -----------------------------------------------------------------------
-static USHORT ImplGetNum( const sal_Unicode*& rpBuf, BOOL& rbError )
+static sal_uInt16 ImplGetNum( const sal_Unicode*& rpBuf, sal_Bool& rbError )
{
if ( !*rpBuf )
{
- rbError = TRUE;
+ rbError = sal_True;
return 0;
}
- USHORT nNumber = 0;
+ sal_uInt16 nNumber = 0;
while( ( *rpBuf >= '0' ) && ( *rpBuf <= '9' ) )
{
nNumber *= 10;
@@ -173,38 +173,38 @@ static int ImplIsPatternChar( xub_Unicode cChar, sal_Char cEditMask )
catch ( ::com::sun::star::uno::Exception& )
{
DBG_ERRORFILE( "ImplIsPatternChar: Exception caught!" );
- return FALSE;
+ return sal_False;
}
if ( (cEditMask == EDITMASK_ALPHA) || (cEditMask == EDITMASK_UPPERALPHA) )
{
if( !CharClass::isLetterType( nType ) )
- return FALSE;
+ return sal_False;
}
else if ( cEditMask == EDITMASK_NUM )
{
if( !CharClass::isNumericType( nType ) )
- return FALSE;
+ return sal_False;
}
else if ( (cEditMask == EDITMASK_ALPHANUM) || (cEditMask == EDITMASK_UPPERALPHANUM) )
{
if( !CharClass::isLetterNumericType( nType ) )
- return FALSE;
+ return sal_False;
}
else if ( (cEditMask == EDITMASK_ALLCHAR) || (cEditMask == EDITMASK_UPPERALLCHAR) )
{
if ( cChar < 32 )
- return FALSE;
+ return sal_False;
}
else if ( cEditMask == EDITMASK_NUMSPACE )
{
if ( !CharClass::isNumericType( nType ) && ( cChar != ' ' ) )
- return FALSE;
+ return sal_False;
}
else
- return FALSE;
+ return sal_False;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -230,12 +230,12 @@ static xub_Unicode ImplPatternChar( xub_Unicode cChar, sal_Char cEditMask )
static int ImplKommaPointCharEqual( xub_Unicode c1, xub_Unicode c2 )
{
if ( c1 == c2 )
- return TRUE;
+ return sal_True;
else if ( ((c1 == '.') || (c1 == ',')) &&
((c2 == '.') || (c2 == ',')) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -243,7 +243,7 @@ static int ImplKommaPointCharEqual( xub_Unicode c1, xub_Unicode c2 )
static XubString ImplPatternReformat( const XubString& rStr,
const ByteString& rEditMask,
const XubString& rLiteralMask,
- USHORT nFormatFlags )
+ sal_uInt16 nFormatFlags )
{
if ( !rEditMask.Len() )
return rStr;
@@ -347,8 +347,8 @@ static XubString ImplPatternReformat( const XubString& rStr,
// -----------------------------------------------------------------------
static void ImplPatternMaxPos( const XubString rStr, const ByteString& rEditMask,
- USHORT nFormatFlags, BOOL bSameMask,
- USHORT nCursorPos, USHORT& rPos )
+ sal_uInt16 nFormatFlags, sal_Bool bSameMask,
+ sal_uInt16 nCursorPos, sal_uInt16& rPos )
{
// Letzte Position darf nicht groesser als der enthaltene String sein
@@ -392,7 +392,7 @@ static void ImplPatternMaxPos( const XubString rStr, const ByteString& rEditMask
static void ImplPatternProcessStrictModify( Edit* pEdit,
const ByteString& rEditMask,
const XubString& rLiteralMask,
- USHORT nFormatFlags, BOOL bSameMask )
+ sal_uInt16 nFormatFlags, sal_Bool bSameMask )
{
XubString aText = pEdit->GetText();
@@ -421,7 +421,7 @@ static void ImplPatternProcessStrictModify( Edit* pEdit,
// Selection so anpassen, das diese wenn sie vorher am Ende
// stand, immer noch am Ende steht
Selection aSel = pEdit->GetSelection();
- ULONG nMaxSel = Max( aSel.Min(), aSel.Max() );
+ sal_uLong nMaxSel = Max( aSel.Min(), aSel.Max() );
if ( nMaxSel >= aText.Len() )
{
xub_StrLen nMaxPos = aNewText.Len();
@@ -462,7 +462,7 @@ static xub_StrLen ImplPatternLeftPos( const ByteString& rEditMask, xub_StrLen nC
// -----------------------------------------------------------------------
static xub_StrLen ImplPatternRightPos( const XubString& rStr, const ByteString& rEditMask,
- USHORT nFormatFlags, BOOL bSameMask,
+ sal_uInt16 nFormatFlags, sal_Bool bSameMask,
xub_StrLen nCursorPos )
{
// Naechstes Zeichen suchen, was kein Literal ist
@@ -483,22 +483,22 @@ static xub_StrLen ImplPatternRightPos( const XubString& rStr, const ByteString&
// -----------------------------------------------------------------------
-static BOOL ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
+static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
const ByteString& rEditMask,
const XubString& rLiteralMask,
- BOOL bStrictFormat,
- USHORT nFormatFlags,
- BOOL bSameMask,
- BOOL& rbInKeyInput )
+ sal_Bool bStrictFormat,
+ sal_uInt16 nFormatFlags,
+ sal_Bool bSameMask,
+ sal_Bool& rbInKeyInput )
{
if ( !rEditMask.Len() || !bStrictFormat )
- return FALSE;
+ return sal_False;
Selection aOldSel = pEdit->GetSelection();
KeyCode aCode = rKEvt.GetKeyCode();
xub_Unicode cChar = rKEvt.GetCharCode();
- USHORT nKeyCode = aCode.GetCode();
- BOOL bShift = aCode.IsShift();
+ sal_uInt16 nKeyCode = aCode.GetCode();
+ sal_Bool bShift = aCode.IsShift();
xub_StrLen nCursorPos = (xub_StrLen)aOldSel.Max();
xub_StrLen nNewPos;
xub_StrLen nTempPos;
@@ -511,7 +511,7 @@ static BOOL ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
if ( bShift )
aSel.Min() = aOldSel.Min();
pEdit->SetSelection( aSel );
- return TRUE;
+ return sal_True;
}
else if ( nKeyCode == KEY_RIGHT )
{
@@ -527,7 +527,7 @@ static BOOL ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
else
aSel.Min() = aSel.Max();
pEdit->SetSelection( aSel );
- return TRUE;
+ return sal_True;
}
else if ( nKeyCode == KEY_HOME )
{
@@ -543,7 +543,7 @@ static BOOL ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
if ( bShift )
aSel.Min() = aOldSel.Min();
pEdit->SetSelection( aSel );
- return TRUE;
+ return sal_True;
}
else if ( nKeyCode == KEY_END )
{
@@ -565,7 +565,7 @@ static BOOL ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
else
aSel.Min() = aSel.Max();
pEdit->SetSelection( aSel );
- return TRUE;
+ return sal_True;
}
else if ( (nKeyCode == KEY_BACKSPACE) || (nKeyCode == KEY_DELETE) )
{
@@ -616,16 +616,16 @@ static BOOL ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
{
if ( bSameMask )
aStr = ImplPatternReformat( aStr, rEditMask, rLiteralMask, nFormatFlags );
- rbInKeyInput = TRUE;
+ rbInKeyInput = sal_True;
pEdit->SetText( aStr, Selection( nNewPos ) );
pEdit->SetModifyFlag();
pEdit->Modify();
- rbInKeyInput = FALSE;
+ rbInKeyInput = sal_False;
}
else
pEdit->SetSelection( Selection( nNewPos ) );
- return TRUE;
+ return sal_True;
}
else if ( nKeyCode == KEY_INSERT )
{
@@ -635,13 +635,13 @@ static BOOL ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
if ( !bSameMask )
{
Sound::Beep();
- return TRUE;
+ return sal_True;
}
}
}
if ( rKEvt.GetKeyCode().IsMod2() || (cChar < 32) || (cChar == 127) )
- return FALSE;
+ return sal_False;
Selection aSel = aOldSel;
aSel.Justify();
@@ -679,7 +679,7 @@ static BOOL ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
if ( nTempPos > nNewPos )
{
pEdit->SetSelection( Selection( nTempPos ) );
- return TRUE;
+ return sal_True;
}
}
break;
@@ -696,7 +696,7 @@ static BOOL ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
if ( cChar )
{
XubString aStr = pEdit->GetText();
- BOOL bError = FALSE;
+ sal_Bool bError = sal_False;
if ( bSameMask && pEdit->IsInsertMode() )
{
// Text um Spacezeichen und Literale am Ende kuerzen, bis zur
@@ -727,7 +727,7 @@ static BOOL ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
aStr = ImplPatternReformat( aStr, rEditMask, rLiteralMask, nFormatFlags );
}
else
- bError = TRUE;
+ bError = sal_True;
}
else
{
@@ -748,18 +748,18 @@ static BOOL ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
Sound::Beep();
else
{
- rbInKeyInput = TRUE;
+ rbInKeyInput = sal_True;
Selection aNewSel( ImplPatternRightPos( aStr, rEditMask, nFormatFlags, bSameMask, nNewPos ) );
pEdit->SetText( aStr, aNewSel );
pEdit->SetModifyFlag();
pEdit->Modify();
- rbInKeyInput = FALSE;
+ rbInKeyInput = sal_False;
}
}
else
Sound::Beep();
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -769,7 +769,7 @@ void PatternFormatter::ImplSetMask( const ByteString& rEditMask,
{
maEditMask = rEditMask;
maLiteralMask = rLiteralMask;
- mbSameMask = TRUE;
+ mbSameMask = sal_True;
if ( maEditMask.Len() != maLiteralMask.Len() )
{
@@ -794,14 +794,14 @@ void PatternFormatter::ImplSetMask( const ByteString& rEditMask,
(cTemp == EDITMASK_UPPERALLCHAR) ||
(cTemp == EDITMASK_NUMSPACE) )
{
- mbSameMask = FALSE;
+ mbSameMask = sal_False;
break;
}
if ( i < rLiteralMask.Len() )
{
if ( rLiteralMask.GetChar( i ) != ' ' )
{
- mbSameMask = FALSE;
+ mbSameMask = sal_False;
break;
}
}
@@ -809,7 +809,7 @@ void PatternFormatter::ImplSetMask( const ByteString& rEditMask,
c = cTemp;
if ( cTemp != c )
{
- mbSameMask = FALSE;
+ mbSameMask = sal_False;
break;
}
}
@@ -822,8 +822,8 @@ void PatternFormatter::ImplSetMask( const ByteString& rEditMask,
PatternFormatter::PatternFormatter()
{
mnFormatFlags = 0;
- mbSameMask = TRUE;
- mbInPattKeyInput = FALSE;
+ mbSameMask = sal_True;
+ mbInPattKeyInput = sal_False;
}
// -----------------------------------------------------------------------
@@ -835,10 +835,10 @@ void PatternFormatter::ImplLoadRes( const ResId& rResId )
ResMgr* pMgr = rResId.GetResMgr();
if( pMgr )
{
- ULONG nMask = pMgr->ReadLong();
+ sal_uLong nMask = pMgr->ReadLong();
if ( PATTERNFORMATTER_STRICTFORMAT & nMask )
- SetStrictFormat( (BOOL)pMgr->ReadShort() );
+ SetStrictFormat( (sal_Bool)pMgr->ReadShort() );
if ( PATTERNFORMATTER_EDITMASK & nMask )
aEditMask = ByteString( pMgr->ReadString(), RTL_TEXTENCODING_ASCII_US );
@@ -874,7 +874,7 @@ void PatternFormatter::SetString( const XubString& rStr )
if ( GetField() )
{
GetField()->SetText( rStr );
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
}
}
@@ -896,7 +896,7 @@ void PatternFormatter::Reformat()
{
ImplSetText( ImplPatternReformat( GetField()->GetText(), maEditMask, maLiteralMask, mnFormatFlags ) );
if ( !mbSameMask && IsStrictFormat() && !GetField()->IsReadOnly() )
- GetField()->SetInsertMode( FALSE );
+ GetField()->SetInsertMode( sal_False );
}
}
@@ -967,7 +967,7 @@ long PatternField::PreNotify( NotifyEvent& rNEvt )
long PatternField::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -986,7 +986,7 @@ void PatternField::Modify()
if ( IsStrictFormat() )
ImplPatternProcessStrictModify( GetField(), GetEditMask(), GetLiteralMask(), GetFormatFlags(), ImplIsSameMask() );
else
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
}
SpinField::Modify();
@@ -1045,7 +1045,7 @@ long PatternBox::PreNotify( NotifyEvent& rNEvt )
long PatternBox::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -1064,7 +1064,7 @@ void PatternBox::Modify()
if ( IsStrictFormat() )
ImplPatternProcessStrictModify( GetField(), GetEditMask(), GetLiteralMask(), GetFormatFlags(), ImplIsSameMask() );
else
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
}
ComboBox::Modify();
@@ -1075,21 +1075,21 @@ void PatternBox::Modify()
void PatternBox::ReformatAll()
{
XubString aStr;
- SetUpdateMode( FALSE );
- USHORT nEntryCount = GetEntryCount();
- for ( USHORT i=0; i < nEntryCount; i++ )
+ SetUpdateMode( sal_False );
+ sal_uInt16 nEntryCount = GetEntryCount();
+ for ( sal_uInt16 i=0; i < nEntryCount; i++ )
{
aStr = ImplPatternReformat( GetEntry( i ), GetEditMask(), GetLiteralMask(), GetFormatFlags() );
RemoveEntry( i );
InsertEntry( aStr, i );
}
PatternFormatter::Reformat();
- SetUpdateMode( TRUE );
+ SetUpdateMode( sal_True );
}
// -----------------------------------------------------------------------
-void PatternBox::InsertString( const XubString& rStr, USHORT nPos )
+void PatternBox::InsertString( const XubString& rStr, sal_uInt16 nPos )
{
ComboBox::InsertEntry( ImplPatternReformat( rStr, GetEditMask(), GetLiteralMask(), GetFormatFlags() ), nPos );
}
@@ -1103,14 +1103,14 @@ void PatternBox::RemoveString( const XubString& rStr )
// -----------------------------------------------------------------------
-XubString PatternBox::GetString( USHORT nPos ) const
+XubString PatternBox::GetString( sal_uInt16 nPos ) const
{
return ImplPatternReformat( ComboBox::GetEntry( nPos ), GetEditMask(), GetLiteralMask(), GetFormatFlags() );
}
// -----------------------------------------------------------------------
-USHORT PatternBox::GetStringPos( const XubString& rStr ) const
+sal_uInt16 PatternBox::GetStringPos( const XubString& rStr ) const
{
return ComboBox::GetEntryPos( ImplPatternReformat( rStr, GetEditMask(), GetLiteralMask(), GetFormatFlags() ) );
}
@@ -1129,7 +1129,7 @@ static ExtDateFieldFormat ImplGetExtFormat( DateFormat eOld )
// -----------------------------------------------------------------------
-static USHORT ImplCutNumberFromString( XubString& rStr )
+static sal_uInt16 ImplCutNumberFromString( XubString& rStr )
{
// Nach Zahl suchen
while ( rStr.Len() && !(rStr.GetChar( 0 ) >= '0' && rStr.GetChar( 0 ) <= '9') )
@@ -1142,28 +1142,28 @@ static USHORT ImplCutNumberFromString( XubString& rStr )
aNumStr.Insert( rStr.GetChar( 0 ) );
rStr.Erase( 0, 1 );
}
- return (USHORT)aNumStr.ToInt32();
+ return (sal_uInt16)aNumStr.ToInt32();
}
// -----------------------------------------------------------------------
-static BOOL ImplCutMonthName( XubString& rStr, const XubString& _rLookupMonthName )
+static sal_Bool ImplCutMonthName( XubString& rStr, const XubString& _rLookupMonthName )
{
- USHORT nPos = rStr.Search( _rLookupMonthName );
+ sal_uInt16 nPos = rStr.Search( _rLookupMonthName );
if ( nPos != STRING_NOTFOUND )
{
rStr.Erase( 0, nPos + _rLookupMonthName.Len() );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-static USHORT ImplCutMonthFromString( XubString& rStr, const CalendarWrapper& rCalendarWrapper )
+static sal_uInt16 ImplCutMonthFromString( XubString& rStr, const CalendarWrapper& rCalendarWrapper )
{
// search for a month' name
- for ( USHORT i=1; i <= 12; i++ )
+ for ( sal_uInt16 i=1; i <= 12; i++ )
{
String aMonthName = rCalendarWrapper.getMonths()[i-1].FullName;
// long month name?
@@ -1191,31 +1191,31 @@ static String ImplGetDateSep( const LocaleDataWrapper& rLocaleDataWrapper, ExtDa
return aDateSep;
}
-static BOOL ImplDateProcessKeyInput( Edit*, const KeyEvent& rKEvt, ExtDateFieldFormat eFormat,
+static sal_Bool ImplDateProcessKeyInput( Edit*, const KeyEvent& rKEvt, ExtDateFieldFormat eFormat,
const LocaleDataWrapper& rLocaleDataWrapper )
{
xub_Unicode cChar = rKEvt.GetCharCode();
- USHORT nGroup = rKEvt.GetKeyCode().GetGroup();
+ sal_uInt16 nGroup = rKEvt.GetKeyCode().GetGroup();
if ( (nGroup == KEYGROUP_FKEYS) || (nGroup == KEYGROUP_CURSOR) ||
(nGroup == KEYGROUP_MISC)||
((cChar >= '0') && (cChar <= '9')) ||
(cChar == ImplGetDateSep( rLocaleDataWrapper, eFormat ).GetChar(0) ) )
- return FALSE;
+ return sal_False;
else
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-static BOOL ImplDateGetValue( const XubString& rStr, Date& rDate, ExtDateFieldFormat eDateFormat,
+static sal_Bool ImplDateGetValue( const XubString& rStr, Date& rDate, ExtDateFieldFormat eDateFormat,
const LocaleDataWrapper& rLocaleDataWrapper, const CalendarWrapper& rCalendarWrapper,
const AllSettings& )
{
- USHORT nDay = 0;
- USHORT nMonth = 0;
- USHORT nYear = 0;
- BOOL bYear = TRUE;
- BOOL bError = FALSE;
+ sal_uInt16 nDay = 0;
+ sal_uInt16 nMonth = 0;
+ sal_uInt16 nYear = 0;
+ sal_Bool bYear = sal_True;
+ sal_Bool bError = sal_False;
String aStr( rStr );
if ( eDateFormat == XTDATEF_SYSTEM_LONG )
@@ -1245,13 +1245,13 @@ static BOOL ImplDateGetValue( const XubString& rStr, Date& rDate, ExtDateFieldFo
{
// Check if year is present:
String aDateSep = ImplGetDateSep( rLocaleDataWrapper, eDateFormat );
- USHORT nSepPos = aStr.Search( aDateSep );
+ sal_uInt16 nSepPos = aStr.Search( aDateSep );
if ( nSepPos == STRING_NOTFOUND )
- return FALSE;
+ return sal_False;
nSepPos = aStr.Search( aDateSep, nSepPos+1 );
if ( ( nSepPos == STRING_NOTFOUND ) || ( nSepPos == (aStr.Len()-1) ) )
{
- bYear = FALSE;
+ bYear = sal_False;
nYear = Date().GetYear();
}
@@ -1304,25 +1304,25 @@ static BOOL ImplDateGetValue( const XubString& rStr, Date& rDate, ExtDateFieldFo
}
if ( bError || !nDay || !nMonth )
- return FALSE;
+ return sal_False;
Date aNewDate( nDay, nMonth, nYear );
DateFormatter::ExpandCentury( aNewDate, utl::MiscCfg().GetYear2000() );
if ( aNewDate.IsValid() )
{
rDate = aNewDate;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL DateFormatter::ImplDateReformat( const XubString& rStr, XubString& rOutStr, const AllSettings& rSettings )
+sal_Bool DateFormatter::ImplDateReformat( const XubString& rStr, XubString& rOutStr, const AllSettings& rSettings )
{
Date aDate( 0, 0, 0 );
- if ( !ImplDateGetValue( rStr, aDate, GetExtDateFormat(TRUE), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() ) )
- return TRUE;
+ if ( !ImplDateGetValue( rStr, aDate, GetExtDateFormat(sal_True), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() ) )
+ return sal_True;
Date aTempDate = aDate;
if ( aTempDate > GetMax() )
@@ -1336,7 +1336,7 @@ BOOL DateFormatter::ImplDateReformat( const XubString& rStr, XubString& rOutStr,
if( !GetErrorHdl().Call( this ) )
{
maCorrectedDate = Date();
- return FALSE;
+ return sal_False;
}
else
maCorrectedDate = Date();
@@ -1344,7 +1344,7 @@ BOOL DateFormatter::ImplDateReformat( const XubString& rStr, XubString& rOutStr,
rOutStr = ImplGetDateAsText( aTempDate, rSettings );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -1352,7 +1352,7 @@ BOOL DateFormatter::ImplDateReformat( const XubString& rStr, XubString& rOutStr,
XubString DateFormatter::ImplGetDateAsText( const Date& rDate,
const AllSettings& ) const
{
- BOOL bShowCentury = FALSE;
+ sal_Bool bShowCentury = sal_False;
switch ( GetExtDateFormat() )
{
case XTDATEF_SYSTEM_SHORT_YYYY:
@@ -1362,43 +1362,43 @@ XubString DateFormatter::ImplGetDateAsText( const Date& rDate,
case XTDATEF_SHORT_YYYYMMDD:
case XTDATEF_SHORT_YYYYMMDD_DIN5008:
{
- bShowCentury = TRUE;
+ bShowCentury = sal_True;
}
break;
default:
{
- bShowCentury = FALSE;
+ bShowCentury = sal_False;
}
}
if ( !bShowCentury )
{
// Check if I have to use force showing the century
- USHORT nTwoDigitYearStart = utl::MiscCfg().GetYear2000();
- USHORT nYear = rDate.GetYear();
+ sal_uInt16 nTwoDigitYearStart = utl::MiscCfg().GetYear2000();
+ sal_uInt16 nYear = rDate.GetYear();
// Wenn Jahr nicht im 2stelligen Grenzbereich liegt,
if ( (nYear < nTwoDigitYearStart) || (nYear >= nTwoDigitYearStart+100) )
- bShowCentury = TRUE;
+ bShowCentury = sal_True;
}
sal_Unicode aBuf[128];
sal_Unicode* pBuf = aBuf;
- String aDateSep = ImplGetDateSep( ImplGetLocaleDataWrapper(), GetExtDateFormat( TRUE ) );
- USHORT nDay = rDate.GetDay();
- USHORT nMonth = rDate.GetMonth();
- USHORT nYear = rDate.GetYear();
- USHORT nYearLen = bShowCentury ? 4 : 2;
+ String aDateSep = ImplGetDateSep( ImplGetLocaleDataWrapper(), GetExtDateFormat( sal_True ) );
+ sal_uInt16 nDay = rDate.GetDay();
+ sal_uInt16 nMonth = rDate.GetMonth();
+ sal_uInt16 nYear = rDate.GetYear();
+ sal_uInt16 nYearLen = bShowCentury ? 4 : 2;
if ( !bShowCentury )
nYear %= 100;
- switch ( GetExtDateFormat( TRUE ) )
+ switch ( GetExtDateFormat( sal_True ) )
{
case XTDATEF_SYSTEM_LONG:
{
- return ImplGetLocaleDataWrapper().getLongDate( rDate, GetCalendarWrapper(), 1, FALSE, 1, !bShowCentury );
+ return ImplGetLocaleDataWrapper().getLongDate( rDate, GetCalendarWrapper(), 1, sal_False, 1, !bShowCentury );
}
case XTDATEF_SHORT_DDMMYY:
case XTDATEF_SHORT_DDMMYYYY:
@@ -1438,12 +1438,12 @@ XubString DateFormatter::ImplGetDateAsText( const Date& rDate,
}
}
- return String( aBuf, (xub_StrLen)(ULONG)(pBuf-aBuf) );
+ return String( aBuf, (xub_StrLen)(sal_uLong)(pBuf-aBuf) );
}
// -----------------------------------------------------------------------
-static void ImplDateIncrementDay( Date& rDate, BOOL bUp )
+static void ImplDateIncrementDay( Date& rDate, sal_Bool bUp )
{
DateFormatter::ExpandCentury( rDate );
@@ -1461,12 +1461,12 @@ static void ImplDateIncrementDay( Date& rDate, BOOL bUp )
// -----------------------------------------------------------------------
-static void ImplDateIncrementMonth( Date& rDate, BOOL bUp )
+static void ImplDateIncrementMonth( Date& rDate, sal_Bool bUp )
{
DateFormatter::ExpandCentury( rDate );
- USHORT nMonth = rDate.GetMonth();
- USHORT nYear = rDate.GetYear();
+ sal_uInt16 nMonth = rDate.GetMonth();
+ sal_uInt16 nYear = rDate.GetYear();
if ( bUp )
{
if ( (nMonth == 12) && (nYear < 9999) )
@@ -1494,18 +1494,18 @@ static void ImplDateIncrementMonth( Date& rDate, BOOL bUp )
}
}
- USHORT nDaysInMonth = rDate.GetDaysInMonth();
+ sal_uInt16 nDaysInMonth = rDate.GetDaysInMonth();
if ( rDate.GetDay() > nDaysInMonth )
rDate.SetDay( nDaysInMonth );
}
// -----------------------------------------------------------------------
-static void ImplDateIncrementYear( Date& rDate, BOOL bUp )
+static void ImplDateIncrementYear( Date& rDate, sal_Bool bUp )
{
DateFormatter::ExpandCentury( rDate );
- USHORT nYear = rDate.GetYear();
+ sal_uInt16 nYear = rDate.GetYear();
if ( bUp )
{
if ( nYear < 9999 )
@@ -1519,14 +1519,14 @@ static void ImplDateIncrementYear( Date& rDate, BOOL bUp )
}
// -----------------------------------------------------------------------
-BOOL DateFormatter::ImplAllowMalformedInput() const
+sal_Bool DateFormatter::ImplAllowMalformedInput() const
{
return !IsEnforceValidValue();
}
// -----------------------------------------------------------------------
-void DateField::ImplDateSpinArea( BOOL bUp )
+void DateField::ImplDateSpinArea( sal_Bool bUp )
{
// Wenn alles selektiert ist, Tage hochzaehlen
if ( GetField() )
@@ -1541,7 +1541,7 @@ void DateField::ImplDateSpinArea( BOOL bUp )
{
xub_StrLen nDateArea = 0;
- ExtDateFieldFormat eFormat = GetExtDateFormat( TRUE );
+ ExtDateFieldFormat eFormat = GetExtDateFormat( sal_True );
if ( eFormat == XTDATEF_SYSTEM_LONG )
{
eFormat = ImplGetExtFormat( ImplGetLocaleDataWrapper().getLongDateFormat() );
@@ -1555,7 +1555,7 @@ void DateField::ImplDateSpinArea( BOOL bUp )
for ( xub_StrLen i = 1; i <= 3; i++ )
{
nPos = aText.Search( aDateSep, nPos );
- if ( nPos >= (USHORT)aSelection.Max() )
+ if ( nPos >= (sal_uInt16)aSelection.Max() )
{
nDateArea = i;
break;
@@ -1620,8 +1620,8 @@ void DateField::ImplDateSpinArea( BOOL bUp )
void DateFormatter::ImplInit()
{
- mbLongFormat = FALSE;
- mbShowDateCentury = TRUE;
+ mbLongFormat = sal_False;
+ mbShowDateCentury = sal_True;
mpCalendarWrapper = NULL;
mnDateFormat = 0xFFFF;
mnExtDateFormat = XTDATEF_SYSTEM_SHORT;
@@ -1634,7 +1634,7 @@ DateFormatter::DateFormatter() :
maLastDate( 0 ),
maMin( 1, 1, 1900 ),
maMax( 31, 12, 2200 ),
- mbEnforceValidValue( TRUE )
+ mbEnforceValidValue( sal_True )
{
ImplInit();
}
@@ -1646,7 +1646,7 @@ void DateFormatter::ImplLoadRes( const ResId& rResId )
ResMgr* pMgr = rResId.GetResMgr();
if( pMgr )
{
- ULONG nMask = pMgr->ReadLong();
+ sal_uLong nMask = pMgr->ReadLong();
if ( DATEFORMATTER_MIN & nMask )
{
@@ -1659,10 +1659,10 @@ void DateFormatter::ImplLoadRes( const ResId& rResId )
pMgr->Increment( pMgr->GetObjSize( (RSHEADER_TYPE*)pMgr->GetClass() ) );
}
if ( DATEFORMATTER_LONGFORMAT & nMask )
- mbLongFormat = (BOOL)pMgr->ReadShort();
+ mbLongFormat = (sal_Bool)pMgr->ReadShort();
if ( DATEFORMATTER_STRICTFORMAT & nMask )
- SetStrictFormat( (BOOL)pMgr->ReadShort() );
+ SetStrictFormat( (sal_Bool)pMgr->ReadShort() );
if ( DATEFORMATTER_VALUE & nMask )
{
@@ -1718,13 +1718,13 @@ void DateFormatter::SetExtDateFormat( ExtDateFieldFormat eFormat )
// -----------------------------------------------------------------------
-ExtDateFieldFormat DateFormatter::GetExtDateFormat( BOOL bResolveSystemFormat ) const
+ExtDateFieldFormat DateFormatter::GetExtDateFormat( sal_Bool bResolveSystemFormat ) const
{
ExtDateFieldFormat eDateFormat = (ExtDateFieldFormat)mnExtDateFormat;
if ( bResolveSystemFormat && ( eDateFormat <= XTDATEF_SYSTEM_SHORT_YYYY ) )
{
- BOOL bShowCentury = (eDateFormat == XTDATEF_SYSTEM_SHORT_YYYY);
+ sal_Bool bShowCentury = (eDateFormat == XTDATEF_SYSTEM_SHORT_YYYY);
switch ( ImplGetLocaleDataWrapper().getDateFormat() )
{
case DMY: eDateFormat = bShowCentury ? XTDATEF_SHORT_DDMMYYYY : XTDATEF_SHORT_DDMMYY;
@@ -1766,7 +1766,7 @@ void DateFormatter::SetMax( const Date& rNewMax )
// -----------------------------------------------------------------------
-void DateFormatter::SetLongFormat( BOOL bLong )
+void DateFormatter::SetLongFormat( sal_Bool bLong )
{
mbLongFormat = bLong;
@@ -1786,7 +1786,7 @@ void DateFormatter::SetLongFormat( BOOL bLong )
// -----------------------------------------------------------------------
-void DateFormatter::SetShowDateCentury( BOOL bShowDateCentury )
+void DateFormatter::SetShowDateCentury( sal_Bool bShowDateCentury )
{
mbShowDateCentury = bShowDateCentury;
@@ -1902,7 +1902,7 @@ Date DateFormatter::GetDate() const
if ( GetField() )
{
- if ( ImplDateGetValue( GetField()->GetText(), aDate, GetExtDateFormat(TRUE), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() ) )
+ if ( ImplDateGetValue( GetField()->GetText(), aDate, GetExtDateFormat(sal_True), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() ) )
{
if ( aDate > maMax )
aDate = maMax;
@@ -1942,7 +1942,7 @@ Date DateFormatter::GetRealDate() const
if ( GetField() )
{
- if ( !ImplDateGetValue( GetField()->GetText(), aDate, GetExtDateFormat(TRUE), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() ) )
+ if ( !ImplDateGetValue( GetField()->GetText(), aDate, GetExtDateFormat(sal_True), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() ) )
if ( ImplAllowMalformedInput() )
aDate = GetInvalidDate();
}
@@ -1959,20 +1959,20 @@ void DateFormatter::SetEmptyDate()
// -----------------------------------------------------------------------
-BOOL DateFormatter::IsEmptyDate() const
+sal_Bool DateFormatter::IsEmptyDate() const
{
- BOOL bEmpty = FormatterBase::IsEmptyFieldValue();
+ sal_Bool bEmpty = FormatterBase::IsEmptyFieldValue();
if ( GetField() && MustBeReformatted() && IsEmptyFieldValueEnabled() )
{
if ( !GetField()->GetText().Len() )
{
- bEmpty = TRUE;
+ bEmpty = sal_True;
}
else if ( !maLastDate.GetDate() )
{
Date aDate;
- bEmpty = !ImplDateGetValue( GetField()->GetText(), aDate, GetExtDateFormat(TRUE), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() );
+ bEmpty = !ImplDateGetValue( GetField()->GetText(), aDate, GetExtDateFormat(sal_True), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() );
}
}
return bEmpty;
@@ -1980,14 +1980,14 @@ BOOL DateFormatter::IsEmptyDate() const
// -----------------------------------------------------------------------
-BOOL DateFormatter::IsDateModified() const
+sal_Bool DateFormatter::IsDateModified() const
{
if ( ImplGetEmptyFieldValue() )
return !IsEmptyDate();
else if ( GetDate() != maFieldDate )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -2001,14 +2001,14 @@ void DateFormatter::Reformat()
return;
XubString aStr;
- BOOL bOK = ImplDateReformat( GetField()->GetText(), aStr, GetFieldSettings() );
+ sal_Bool bOK = ImplDateReformat( GetField()->GetText(), aStr, GetFieldSettings() );
if( !bOK )
return;
if ( aStr.Len() )
{
ImplSetText( aStr );
- ImplDateGetValue( aStr, maLastDate, GetExtDateFormat(TRUE), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() );
+ ImplDateGetValue( aStr, maLastDate, GetExtDateFormat(sal_True), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() );
}
else
{
@@ -2019,7 +2019,7 @@ void DateFormatter::Reformat()
else
{
ImplSetText( ImplGetSVEmptyStr() );
- SetEmptyFieldValueData( TRUE );
+ SetEmptyFieldValueData( sal_True );
}
}
}
@@ -2033,12 +2033,12 @@ void DateFormatter::ExpandCentury( Date& rDate )
// -----------------------------------------------------------------------
-void DateFormatter::ExpandCentury( Date& rDate, USHORT nTwoDigitYearStart )
+void DateFormatter::ExpandCentury( Date& rDate, sal_uInt16 nTwoDigitYearStart )
{
- USHORT nDateYear = rDate.GetYear();
+ sal_uInt16 nDateYear = rDate.GetYear();
if ( nDateYear < 100 )
{
- USHORT nCentury = nTwoDigitYearStart / 100;
+ sal_uInt16 nCentury = nTwoDigitYearStart / 100;
if ( nDateYear < (nTwoDigitYearStart % 100) )
nCentury++;
rDate.SetYear( nDateYear + (nCentury*100) );
@@ -2089,7 +2089,7 @@ void DateField::ImplLoadRes( const ResId& rResId )
{
DateFormatter::ImplLoadRes( ResId( (RSHEADER_TYPE *)GetClassRes(), *pMgr ) );
- ULONG nMask = ReadLongRes();
+ sal_uLong nMask = ReadLongRes();
if ( DATEFIELD_FIRST & nMask )
{
maFirst = Date( ResId( (RSHEADER_TYPE *)GetClassRes(), *pMgr ) );
@@ -2119,7 +2119,7 @@ long DateField::PreNotify( NotifyEvent& rNEvt )
( GetExtDateFormat() != XTDATEF_SYSTEM_LONG ) &&
!rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() )
{
- if ( ImplDateProcessKeyInput( GetField(), *rNEvt.GetKeyEvent(), GetExtDateFormat( TRUE ), ImplGetLocaleDataWrapper() ) )
+ if ( ImplDateProcessKeyInput( GetField(), *rNEvt.GetKeyEvent(), GetExtDateFormat( sal_True ), ImplGetLocaleDataWrapper() ) )
return 1;
}
@@ -2131,7 +2131,7 @@ long DateField::PreNotify( NotifyEvent& rNEvt )
long DateField::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() )
@@ -2141,7 +2141,7 @@ long DateField::Notify( NotifyEvent& rNEvt )
// !!! allen anderen Feldern anders behandelt wird.
// !!! Siehe dazu Bug: 52304
- BOOL bTextLen = GetText().Len() != 0;
+ sal_Bool bTextLen = GetText().Len() != 0;
if ( bTextLen || !IsEmptyFieldValueEnabled() )
{
if ( !ImplAllowMalformedInput() )
@@ -2149,7 +2149,7 @@ long DateField::Notify( NotifyEvent& rNEvt )
else
{
Date aDate( 0, 0, 0 );
- if ( ImplDateGetValue( GetText(), aDate, GetExtDateFormat(TRUE), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() ) )
+ if ( ImplDateGetValue( GetText(), aDate, GetExtDateFormat(sal_True), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() ) )
// even with strict text analysis, our text is a valid date -> do a complete
// reformat
Reformat();
@@ -2158,7 +2158,7 @@ long DateField::Notify( NotifyEvent& rNEvt )
else if ( !bTextLen && IsEmptyFieldValueEnabled() )
{
ResetLastDate();
- SetEmptyFieldValueData( TRUE );
+ SetEmptyFieldValueData( sal_True );
}
}
}
@@ -2184,7 +2184,7 @@ void DateField::DataChanged( const DataChangedEvent& rDCEvt )
void DateField::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
SpinField::Modify();
}
@@ -2192,7 +2192,7 @@ void DateField::Modify()
void DateField::Up()
{
- ImplDateSpinArea( TRUE );
+ ImplDateSpinArea( sal_True );
SpinField::Up();
}
@@ -2200,7 +2200,7 @@ void DateField::Up()
void DateField::Down()
{
- ImplDateSpinArea( FALSE );
+ ImplDateSpinArea( sal_False );
SpinField::Down();
}
@@ -2264,7 +2264,7 @@ long DateBox::PreNotify( NotifyEvent& rNEvt )
( GetExtDateFormat() != XTDATEF_SYSTEM_LONG ) &&
!rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() )
{
- if ( ImplDateProcessKeyInput( GetField(), *rNEvt.GetKeyEvent(), GetExtDateFormat( TRUE ), ImplGetLocaleDataWrapper() ) )
+ if ( ImplDateProcessKeyInput( GetField(), *rNEvt.GetKeyEvent(), GetExtDateFormat( sal_True ), ImplGetLocaleDataWrapper() ) )
return 1;
}
@@ -2290,18 +2290,18 @@ void DateBox::DataChanged( const DataChangedEvent& rDCEvt )
long DateBox::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() )
{
- BOOL bTextLen = GetText().Len() != 0;
+ sal_Bool bTextLen = GetText().Len() != 0;
if ( bTextLen || !IsEmptyFieldValueEnabled() )
Reformat();
else if ( !bTextLen && IsEmptyFieldValueEnabled() )
{
ResetLastDate();
- SetEmptyFieldValueData( TRUE );
+ SetEmptyFieldValueData( sal_True );
}
}
}
@@ -2313,7 +2313,7 @@ long DateBox::Notify( NotifyEvent& rNEvt )
void DateBox::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
ComboBox::Modify();
}
@@ -2322,21 +2322,21 @@ void DateBox::Modify()
void DateBox::ReformatAll()
{
XubString aStr;
- SetUpdateMode( FALSE );
- USHORT nEntryCount = GetEntryCount();
- for ( USHORT i=0; i < nEntryCount; i++ )
+ SetUpdateMode( sal_False );
+ sal_uInt16 nEntryCount = GetEntryCount();
+ for ( sal_uInt16 i=0; i < nEntryCount; i++ )
{
ImplDateReformat( GetEntry( i ), aStr, GetFieldSettings() );
RemoveEntry( i );
InsertEntry( aStr, i );
}
DateFormatter::Reformat();
- SetUpdateMode( TRUE );
+ SetUpdateMode( sal_True );
}
// -----------------------------------------------------------------------
-void DateBox::InsertDate( const Date& rDate, USHORT nPos )
+void DateBox::InsertDate( const Date& rDate, sal_uInt16 nPos )
{
Date aDate = rDate;
if ( aDate > GetMax() )
@@ -2356,20 +2356,20 @@ void DateBox::RemoveDate( const Date& rDate )
// -----------------------------------------------------------------------
-Date DateBox::GetDate( USHORT nPos ) const
+Date DateBox::GetDate( sal_uInt16 nPos ) const
{
Date aDate( 0, 0, 0 );
- ImplDateGetValue( ComboBox::GetEntry( nPos ), aDate, GetExtDateFormat(TRUE), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetSettings() );
+ ImplDateGetValue( ComboBox::GetEntry( nPos ), aDate, GetExtDateFormat(sal_True), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetSettings() );
return aDate;
}
// -----------------------------------------------------------------------
-USHORT DateBox::GetDatePos( const Date& rDate ) const
+sal_uInt16 DateBox::GetDatePos( const Date& rDate ) const
{
XubString aStr;
if ( IsLongFormat() )
- aStr = ImplGetLocaleDataWrapper().getLongDate( rDate, GetCalendarWrapper(), 1, FALSE, 1, !IsShowDateCentury() );
+ aStr = ImplGetLocaleDataWrapper().getLongDate( rDate, GetCalendarWrapper(), 1, sal_False, 1, !IsShowDateCentury() );
else
aStr = ImplGetLocaleDataWrapper().getDate( rDate );
return ComboBox::GetEntryPos( aStr );
@@ -2377,18 +2377,18 @@ USHORT DateBox::GetDatePos( const Date& rDate ) const
// -----------------------------------------------------------------------
-static BOOL ImplTimeProcessKeyInput( Edit*, const KeyEvent& rKEvt,
- BOOL bStrictFormat, BOOL bDuration,
+static sal_Bool ImplTimeProcessKeyInput( Edit*, const KeyEvent& rKEvt,
+ sal_Bool bStrictFormat, sal_Bool bDuration,
TimeFieldFormat eFormat,
const LocaleDataWrapper& rLocaleDataWrapper )
{
xub_Unicode cChar = rKEvt.GetCharCode();
if ( !bStrictFormat )
- return FALSE;
+ return sal_False;
else
{
- USHORT nGroup = rKEvt.GetKeyCode().GetGroup();
+ sal_uInt16 nGroup = rKEvt.GetKeyCode().GetGroup();
if ( (nGroup == KEYGROUP_FKEYS) || (nGroup == KEYGROUP_CURSOR) ||
(nGroup == KEYGROUP_MISC) ||
((cChar >= '0') && (cChar <= '9')) ||
@@ -2400,55 +2400,55 @@ static BOOL ImplTimeProcessKeyInput( Edit*, const KeyEvent& rKEvt,
((eFormat == TIMEF_100TH_SEC) && (cChar == rLocaleDataWrapper.getTime100SecSep())) ||
((eFormat == TIMEF_SEC_CS) && (cChar == rLocaleDataWrapper.getTime100SecSep())) ||
(bDuration && (cChar == '-')) )
- return FALSE;
+ return sal_False;
else
- return TRUE;
+ return sal_True;
}
}
// -----------------------------------------------------------------------
-static BOOL ImplIsOnlyDigits( const String& _rStr )
+static sal_Bool ImplIsOnlyDigits( const String& _rStr )
{
const sal_Unicode* _pChr = _rStr.GetBuffer();
for ( xub_StrLen i = 0; i < _rStr.Len(); ++i, ++_pChr )
{
if ( *_pChr < '0' || *_pChr > '9' )
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-static BOOL ImplIsValidTimePortion( BOOL _bSkipInvalidCharacters, const String& _rStr )
+static sal_Bool ImplIsValidTimePortion( sal_Bool _bSkipInvalidCharacters, const String& _rStr )
{
if ( !_bSkipInvalidCharacters )
{
if ( ( _rStr.Len() > 2 ) || ( _rStr.Len() < 1 ) || !ImplIsOnlyDigits( _rStr ) )
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-static BOOL ImplCutTimePortion( String& _rStr, xub_StrLen _nSepPos, BOOL _bSkipInvalidCharacters, short* _pPortion )
+static sal_Bool ImplCutTimePortion( String& _rStr, xub_StrLen _nSepPos, sal_Bool _bSkipInvalidCharacters, short* _pPortion )
{
String sPortion = _rStr.Copy( 0, _nSepPos );
_rStr.Erase( 0, _nSepPos + 1 );
if ( !ImplIsValidTimePortion( _bSkipInvalidCharacters, sPortion ) )
- return FALSE;
+ return sal_False;
*_pPortion = (short)sPortion.ToInt32();
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-static BOOL ImplTimeGetValue( const XubString& rStr, Time& rTime,
- TimeFieldFormat eFormat, BOOL bDuration,
- const LocaleDataWrapper& rLocaleDataWrapper, BOOL _bSkipInvalidCharacters = TRUE )
+static sal_Bool ImplTimeGetValue( const XubString& rStr, Time& rTime,
+ TimeFieldFormat eFormat, sal_Bool bDuration,
+ const LocaleDataWrapper& rLocaleDataWrapper, sal_Bool _bSkipInvalidCharacters = sal_True )
{
XubString aStr = rStr;
short nHour = 0;
@@ -2458,7 +2458,7 @@ static BOOL ImplTimeGetValue( const XubString& rStr, Time& rTime,
Time aTime( 0, 0, 0 );
if ( !rStr.Len() )
- return FALSE;
+ return sal_False;
// Nach Separatoren suchen
if ( rLocaleDataWrapper.getTimeSep().Len() )
@@ -2480,34 +2480,34 @@ static BOOL ImplTimeGetValue( const XubString& rStr, Time& rTime,
}
}
- BOOL bNegative = FALSE;
+ sal_Bool bNegative = sal_False;
xub_StrLen nSepPos = aStr.Search( rLocaleDataWrapper.getTimeSep() );
if ( aStr.GetChar( 0 ) == '-' )
- bNegative = TRUE;
+ bNegative = sal_True;
if ( eFormat != TIMEF_SEC_CS )
{
if ( nSepPos == STRING_NOTFOUND )
nSepPos = aStr.Len();
if ( !ImplCutTimePortion( aStr, nSepPos, _bSkipInvalidCharacters, &nHour ) )
- return FALSE;
+ return sal_False;
nSepPos = aStr.Search( rLocaleDataWrapper.getTimeSep() );
if ( aStr.GetChar( 0 ) == '-' )
- bNegative = TRUE;
+ bNegative = sal_True;
if ( nSepPos != STRING_NOTFOUND )
{
if ( !ImplCutTimePortion( aStr, nSepPos, _bSkipInvalidCharacters, &nMinute ) )
- return FALSE;
+ return sal_False;
nSepPos = aStr.Search( rLocaleDataWrapper.getTimeSep() );
if ( aStr.GetChar( 0 ) == '-' )
- bNegative = TRUE;
+ bNegative = sal_True;
if ( nSepPos != STRING_NOTFOUND )
{
if ( !ImplCutTimePortion( aStr, nSepPos, _bSkipInvalidCharacters, &nSecond ) )
- return FALSE;
+ return sal_False;
if ( aStr.GetChar( 0 ) == '-' )
- bNegative = TRUE;
+ bNegative = sal_True;
n100Sec = (short)aStr.ToInt32();
}
else
@@ -2531,7 +2531,7 @@ static BOOL ImplTimeGetValue( const XubString& rStr, Time& rTime,
nSepPos = aStr.Search( rLocaleDataWrapper.getTimeSep() );
if ( aStr.GetChar( 0 ) == '-' )
- bNegative = TRUE;
+ bNegative = sal_True;
if ( nSepPos != STRING_NOTFOUND )
{
nMinute = nSecond;
@@ -2540,7 +2540,7 @@ static BOOL ImplTimeGetValue( const XubString& rStr, Time& rTime,
nSepPos = aStr.Search( rLocaleDataWrapper.getTimeSep() );
if ( aStr.GetChar( 0 ) == '-' )
- bNegative = TRUE;
+ bNegative = sal_True;
if ( nSepPos != STRING_NOTFOUND )
{
nHour = nMinute;
@@ -2592,7 +2592,7 @@ static BOOL ImplTimeGetValue( const XubString& rStr, Time& rTime,
}
if ( (nMinute > 59) || (nSecond > 59) || (n100Sec > 100) )
- return FALSE;
+ return sal_False;
if ( eFormat == TIMEF_NONE )
nSecond = n100Sec = 0;
@@ -2603,7 +2603,7 @@ static BOOL ImplTimeGetValue( const XubString& rStr, Time& rTime,
{
if ( bNegative || (nHour < 0) || (nMinute < 0) ||
(nSecond < 0) || (n100Sec < 0) )
- return FALSE;
+ return sal_False;
aStr.ToUpperAscii();
XubString aAM( rLocaleDataWrapper.getTimeAM() );
@@ -2619,39 +2619,39 @@ static BOOL ImplTimeGetValue( const XubString& rStr, Time& rTime,
if ( (nHour == 12) && ( ( aStr.Search( aAM ) != STRING_NOTFOUND ) || ( aStr.Search( aAM2 ) != STRING_NOTFOUND ) ) )
nHour = 0;
- aTime = Time( (USHORT)nHour, (USHORT)nMinute, (USHORT)nSecond,
- (USHORT)n100Sec );
+ aTime = Time( (sal_uInt16)nHour, (sal_uInt16)nMinute, (sal_uInt16)nSecond,
+ (sal_uInt16)n100Sec );
}
else
{
if ( bNegative || (nHour < 0) || (nMinute < 0) ||
(nSecond < 0) || (n100Sec < 0) )
{
- bNegative = TRUE;
+ bNegative = sal_True;
nHour = nHour < 0 ? -nHour : nHour;
nMinute = nMinute < 0 ? -nMinute : nMinute;
nSecond = nSecond < 0 ? -nSecond : nSecond;
n100Sec = n100Sec < 0 ? -n100Sec : n100Sec;
}
- aTime = Time( (USHORT)nHour, (USHORT)nMinute, (USHORT)nSecond,
- (USHORT)n100Sec );
+ aTime = Time( (sal_uInt16)nHour, (sal_uInt16)nMinute, (sal_uInt16)nSecond,
+ (sal_uInt16)n100Sec );
if ( bNegative )
aTime = -aTime;
}
rTime = aTime;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL TimeFormatter::ImplTimeReformat( const XubString& rStr, XubString& rOutStr )
+sal_Bool TimeFormatter::ImplTimeReformat( const XubString& rStr, XubString& rOutStr )
{
Time aTime( 0, 0, 0 );
if ( !ImplTimeGetValue( rStr, aTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper() ) )
- return TRUE;
+ return sal_True;
Time aTempTime = aTime;
if ( aTempTime > GetMax() )
@@ -2665,22 +2665,22 @@ BOOL TimeFormatter::ImplTimeReformat( const XubString& rStr, XubString& rOutStr
if ( !GetErrorHdl().Call( this ) )
{
maCorrectedTime = Time();
- return FALSE;
+ return sal_False;
}
else
maCorrectedTime = Time();
}
- BOOL bSecond = FALSE;
- BOOL b100Sec = FALSE;
+ sal_Bool bSecond = sal_False;
+ sal_Bool b100Sec = sal_False;
if ( meFormat != TIMEF_NONE )
- bSecond = TRUE;
+ bSecond = sal_True;
if ( meFormat == TIMEF_100TH_SEC )
- b100Sec = TRUE;
+ b100Sec = sal_True;
if ( meFormat == TIMEF_SEC_CS )
{
- ULONG n = aTempTime.GetHour() * 3600L;
+ sal_uLong n = aTempTime.GetHour() * 3600L;
n += aTempTime.GetMin() * 60L;
n += aTempTime.GetSec();
rOutStr = String::CreateFromInt32( n );
@@ -2710,18 +2710,18 @@ BOOL TimeFormatter::ImplTimeReformat( const XubString& rStr, XubString& rOutStr
}
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL TimeFormatter::ImplAllowMalformedInput() const
+sal_Bool TimeFormatter::ImplAllowMalformedInput() const
{
return !IsEnforceValidValue();
}
// -----------------------------------------------------------------------
-void TimeField::ImplTimeSpinArea( BOOL bUp )
+void TimeField::ImplTimeSpinArea( sal_Bool bUp )
{
if ( GetField() )
{
@@ -2792,7 +2792,7 @@ void TimeField::ImplTimeSpinArea( BOOL bUp )
void TimeFormatter::ImplInit()
{
meFormat = TIMEF_NONE;
- mbDuration = FALSE;
+ mbDuration = sal_False;
mnTimeFormat = HOUR_24; // Should become a ExtTimeFieldFormat in next implementation, merge with mbDuration and meFormat
}
@@ -2802,7 +2802,7 @@ TimeFormatter::TimeFormatter() :
maLastTime( 0, 0 ),
maMin( 0, 0 ),
maMax( 23, 59, 59, 99 ),
- mbEnforceValidValue( TRUE ),
+ mbEnforceValidValue( sal_True ),
maFieldTime( 0, 0 )
{
ImplInit();
@@ -2815,7 +2815,7 @@ void TimeFormatter::ImplLoadRes( const ResId& rResId )
ResMgr* pMgr = rResId.GetResMgr();
if( pMgr )
{
- ULONG nMask = pMgr->ReadLong();
+ sal_uLong nMask = pMgr->ReadLong();
if ( TIMEFORMATTER_MIN & nMask )
{
@@ -2833,10 +2833,10 @@ void TimeFormatter::ImplLoadRes( const ResId& rResId )
meFormat = (TimeFieldFormat)pMgr->ReadLong();
if ( TIMEFORMATTER_DURATION & nMask )
- mbDuration = (BOOL)pMgr->ReadShort();
+ mbDuration = (sal_Bool)pMgr->ReadShort();
if ( TIMEFORMATTER_STRICTFORMAT & nMask )
- SetStrictFormat( (BOOL)pMgr->ReadShort() );
+ SetStrictFormat( (sal_Bool)pMgr->ReadShort() );
if ( TIMEFORMATTER_VALUE & nMask )
{
@@ -2887,7 +2887,7 @@ void TimeFormatter::SetMax( const Time& rNewMax )
void TimeFormatter::SetTimeFormat( TimeFormatter::TimeFormat eNewFormat )
{
- mnTimeFormat = sal::static_int_cast<USHORT>(eNewFormat);
+ mnTimeFormat = sal::static_int_cast<sal_uInt16>(eNewFormat);
}
// -----------------------------------------------------------------------
@@ -2907,7 +2907,7 @@ void TimeFormatter::SetFormat( TimeFieldFormat eNewFormat )
// -----------------------------------------------------------------------
-void TimeFormatter::SetDuration( BOOL bNewDuration )
+void TimeFormatter::SetDuration( sal_Bool bNewDuration )
{
mbDuration = bNewDuration;
ReformatAll();
@@ -2919,7 +2919,7 @@ void TimeFormatter::SetTime( const Time& rNewTime )
{
SetUserTime( rNewTime );
maFieldTime = maLastTime;
- SetEmptyFieldValueData( FALSE );
+ SetEmptyFieldValueData( sal_False );
}
// -----------------------------------------------------------------------
@@ -2966,15 +2966,15 @@ void TimeFormatter::ImplSetUserTime( const Time& rNewTime, Selection* pNewSelect
if ( GetField() )
{
XubString aStr;
- BOOL bSec = FALSE;
- BOOL b100Sec = FALSE;
+ sal_Bool bSec = sal_False;
+ sal_Bool b100Sec = sal_False;
if ( meFormat != TIMEF_NONE )
- bSec = TRUE;
+ bSec = sal_True;
if ( meFormat == TIMEF_100TH_SEC || meFormat == TIMEF_SEC_CS )
- b100Sec = TRUE;
+ b100Sec = sal_True;
if ( meFormat == TIMEF_SEC_CS )
{
- ULONG n = aNewTime.GetHour() * 3600L;
+ sal_uLong n = aNewTime.GetHour() * 3600L;
n += aNewTime.GetMin() * 60L;
n += aNewTime.GetSec();
aStr = String::CreateFromInt32( n );
@@ -3025,7 +3025,7 @@ Time TimeFormatter::GetTime() const
if ( GetField() )
{
- BOOL bAllowMailformed = ImplAllowMalformedInput();
+ sal_Bool bAllowMailformed = ImplAllowMalformedInput();
if ( ImplTimeGetValue( GetField()->GetText(), aTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper(), !bAllowMailformed ) )
{
if ( aTime > GetMax() )
@@ -3053,7 +3053,7 @@ Time TimeFormatter::GetRealTime() const
if ( GetField() )
{
- BOOL bAllowMailformed = ImplAllowMalformedInput();
+ sal_Bool bAllowMailformed = ImplAllowMalformedInput();
if ( !ImplTimeGetValue( GetField()->GetText(), aTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper(), !bAllowMailformed ) )
if ( bAllowMailformed )
aTime = GetInvalidTime();
@@ -3064,14 +3064,14 @@ Time TimeFormatter::GetRealTime() const
// -----------------------------------------------------------------------
-BOOL TimeFormatter::IsTimeModified() const
+sal_Bool TimeFormatter::IsTimeModified() const
{
if ( ImplGetEmptyFieldValue() )
return !IsEmptyTime();
else if ( GetTime() != maFieldTime )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -3085,7 +3085,7 @@ void TimeFormatter::Reformat()
return;
XubString aStr;
- BOOL bOK = ImplTimeReformat( GetField()->GetText(), aStr );
+ sal_Bool bOK = ImplTimeReformat( GetField()->GetText(), aStr );
if ( !bOK )
return;
@@ -3106,7 +3106,7 @@ TimeField::TimeField( Window* pParent, WinBits nWinStyle ) :
maLast( GetMax() )
{
SetField( this );
- SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, FALSE, FALSE ) );
+ SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, sal_False, sal_False ) );
Reformat();
}
@@ -3121,7 +3121,7 @@ TimeField::TimeField( Window* pParent, const ResId& rResId ) :
WinBits nStyle = ImplInitRes( rResId );
SpinField::ImplInit( pParent, nStyle );
SetField( this );
- SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, FALSE, FALSE ) );
+ SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, sal_False, sal_False ) );
ImplLoadRes( rResId );
if ( !(nStyle & WB_HIDE ) )
@@ -3138,7 +3138,7 @@ void TimeField::ImplLoadRes( const ResId& rResId )
{
TimeFormatter::ImplLoadRes( ResId( (RSHEADER_TYPE *)GetClassRes(), *pMgr ) );
- ULONG nMask = ReadLongRes();
+ sal_uLong nMask = ReadLongRes();
if ( TIMEFIELD_FIRST & nMask )
{
@@ -3179,7 +3179,7 @@ long TimeField::PreNotify( NotifyEvent& rNEvt )
long TimeField::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -3189,7 +3189,7 @@ long TimeField::Notify( NotifyEvent& rNEvt )
else
{
Time aTime( 0, 0, 0 );
- if ( ImplTimeGetValue( GetText(), aTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper(), FALSE ) )
+ if ( ImplTimeGetValue( GetText(), aTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper(), sal_False ) )
// even with strict text analysis, our text is a valid time -> do a complete
// reformat
Reformat();
@@ -3218,7 +3218,7 @@ void TimeField::DataChanged( const DataChangedEvent& rDCEvt )
void TimeField::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
SpinField::Modify();
}
@@ -3226,7 +3226,7 @@ void TimeField::Modify()
void TimeField::Up()
{
- ImplTimeSpinArea( TRUE );
+ ImplTimeSpinArea( sal_True );
SpinField::Up();
}
@@ -3234,7 +3234,7 @@ void TimeField::Up()
void TimeField::Down()
{
- ImplTimeSpinArea( FALSE );
+ ImplTimeSpinArea( sal_False );
SpinField::Down();
}
@@ -3263,40 +3263,40 @@ void TimeField::SetExtFormat( ExtTimeFieldFormat eFormat )
case EXTTIMEF_24H_SHORT:
{
SetTimeFormat( HOUR_24 );
- SetDuration( FALSE );
+ SetDuration( sal_False );
SetFormat( TIMEF_NONE );
}
break;
case EXTTIMEF_24H_LONG:
{
SetTimeFormat( HOUR_24 );
- SetDuration( FALSE );
+ SetDuration( sal_False );
SetFormat( TIMEF_SEC );
}
break;
case EXTTIMEF_12H_SHORT:
{
SetTimeFormat( HOUR_12 );
- SetDuration( FALSE );
+ SetDuration( sal_False );
SetFormat( TIMEF_NONE );
}
break;
case EXTTIMEF_12H_LONG:
{
SetTimeFormat( HOUR_12 );
- SetDuration( FALSE );
+ SetDuration( sal_False );
SetFormat( TIMEF_SEC );
}
break;
case EXTTIMEF_DURATION_SHORT:
{
- SetDuration( TRUE );
+ SetDuration( sal_True );
SetFormat( TIMEF_NONE );
}
break;
case EXTTIMEF_DURATION_LONG:
{
- SetDuration( TRUE );
+ SetDuration( sal_True );
SetFormat( TIMEF_SEC );
}
break;
@@ -3314,7 +3314,7 @@ TimeBox::TimeBox( Window* pParent, WinBits nWinStyle ) :
ComboBox( pParent, nWinStyle )
{
SetField( this );
- SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, FALSE, FALSE ) );
+ SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, sal_False, sal_False ) );
Reformat();
}
@@ -3327,7 +3327,7 @@ TimeBox::TimeBox( Window* pParent, const ResId& rResId ) :
WinBits nStyle = ImplInitRes( rResId );
ComboBox::ImplInit( pParent, nStyle );
SetField( this );
- SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, FALSE, FALSE ) );
+ SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, sal_False, sal_False ) );
ComboBox::ImplLoadRes( rResId );
ResMgr* pMgr = rResId.GetResMgr();
if( pMgr )
@@ -3362,7 +3362,7 @@ long TimeBox::PreNotify( NotifyEvent& rNEvt )
long TimeBox::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -3390,7 +3390,7 @@ void TimeBox::DataChanged( const DataChangedEvent& rDCEvt )
void TimeBox::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
ComboBox::Modify();
}
@@ -3399,21 +3399,21 @@ void TimeBox::Modify()
void TimeBox::ReformatAll()
{
XubString aStr;
- SetUpdateMode( FALSE );
- USHORT nEntryCount = GetEntryCount();
- for ( USHORT i=0; i < nEntryCount; i++ )
+ SetUpdateMode( sal_False );
+ sal_uInt16 nEntryCount = GetEntryCount();
+ for ( sal_uInt16 i=0; i < nEntryCount; i++ )
{
ImplTimeReformat( GetEntry( i ), aStr );
RemoveEntry( i );
InsertEntry( aStr, i );
}
TimeFormatter::Reformat();
- SetUpdateMode( TRUE );
+ SetUpdateMode( sal_True );
}
// -----------------------------------------------------------------------
-void TimeBox::InsertTime( const Time& rTime, USHORT nPos )
+void TimeBox::InsertTime( const Time& rTime, sal_uInt16 nPos )
{
Time aTime = rTime;
if ( aTime > GetMax() )
@@ -3421,12 +3421,12 @@ void TimeBox::InsertTime( const Time& rTime, USHORT nPos )
else if ( aTime < GetMin() )
aTime = GetMin();
- BOOL bSec = FALSE;
- BOOL b100Sec = FALSE;
+ sal_Bool bSec = sal_False;
+ sal_Bool b100Sec = sal_False;
if ( GetFormat() == TIMEF_SEC )
- bSec = TRUE;
+ bSec = sal_True;
if ( GetFormat() == TIMEF_100TH_SEC || GetFormat() == TIMEF_SEC_CS )
- bSec = b100Sec = TRUE;
+ bSec = b100Sec = sal_True;
ComboBox::InsertEntry( ImplGetLocaleDataWrapper().getTime( aTime, bSec, b100Sec ), nPos );
}
@@ -3434,18 +3434,18 @@ void TimeBox::InsertTime( const Time& rTime, USHORT nPos )
void TimeBox::RemoveTime( const Time& rTime )
{
- BOOL bSec = FALSE;
- BOOL b100Sec = FALSE;
+ sal_Bool bSec = sal_False;
+ sal_Bool b100Sec = sal_False;
if ( GetFormat() == TIMEF_SEC )
- bSec = TRUE;
+ bSec = sal_True;
if ( GetFormat() == TIMEF_100TH_SEC || TIMEF_SEC_CS )
- bSec = b100Sec = TRUE;
+ bSec = b100Sec = sal_True;
ComboBox::RemoveEntry( ImplGetLocaleDataWrapper().getTime( rTime, bSec, b100Sec ) );
}
// -----------------------------------------------------------------------
-Time TimeBox::GetTime( USHORT nPos ) const
+Time TimeBox::GetTime( sal_uInt16 nPos ) const
{
Time aTime( 0, 0, 0 );
ImplTimeGetValue( ComboBox::GetEntry( nPos ), aTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper() );
@@ -3454,14 +3454,14 @@ Time TimeBox::GetTime( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT TimeBox::GetTimePos( const Time& rTime ) const
+sal_uInt16 TimeBox::GetTimePos( const Time& rTime ) const
{
- BOOL bSec = FALSE;
- BOOL b100Sec = FALSE;
+ sal_Bool bSec = sal_False;
+ sal_Bool b100Sec = sal_False;
if ( GetFormat() == TIMEF_SEC )
- bSec = TRUE;
+ bSec = sal_True;
if ( GetFormat() == TIMEF_100TH_SEC || TIMEF_SEC_CS )
- bSec = b100Sec = TRUE;
+ bSec = b100Sec = sal_True;
return ComboBox::GetEntryPos( ImplGetLocaleDataWrapper().getTime( rTime, bSec, b100Sec ) );
}
diff --git a/vcl/source/control/fixbrd.cxx b/vcl/source/control/fixbrd.cxx
index 374d15f599f8..4efbbe2deee1 100644
--- a/vcl/source/control/fixbrd.cxx
+++ b/vcl/source/control/fixbrd.cxx
@@ -40,7 +40,7 @@
void FixedBorder::ImplInit( Window* pParent, WinBits nStyle )
{
mnType = FIXEDBORDER_TYPE_DOUBLEOUT;
- mbTransparent = TRUE;
+ mbTransparent = sal_True;
nStyle = ImplInitStyle( nStyle );
Control::ImplInit( pParent, nStyle, NULL );
@@ -65,18 +65,18 @@ void FixedBorder::ImplInitSettings()
!(pParent->GetStyle() & WB_CLIPCHILDREN) ) &&
!IsControlBackground() && mbTransparent )
{
- SetMouseTransparent( TRUE );
- EnableChildTransparentMode( TRUE );
+ SetMouseTransparent( sal_True );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
}
else
{
- SetMouseTransparent( FALSE );
- EnableChildTransparentMode( FALSE );
+ SetMouseTransparent( sal_False );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -115,12 +115,12 @@ FixedBorder::~FixedBorder()
// -----------------------------------------------------------------------
-void FixedBorder::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+void FixedBorder::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
Rectangle aRect( rPos, rSize );
- USHORT nBorderStyle = mnType;
+ sal_uInt16 nBorderStyle = mnType;
if ( (nDrawFlags & WINDOW_DRAW_MONO) ||
(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
@@ -158,7 +158,7 @@ void FixedBorder::Paint( const Rectangle& )
// -----------------------------------------------------------------------
void FixedBorder::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- ULONG nFlags )
+ sal_uLong nFlags )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -213,7 +213,7 @@ void FixedBorder::DataChanged( const DataChangedEvent& rDCEvt )
// -----------------------------------------------------------------------
-void FixedBorder::SetTransparent( BOOL bTransparent )
+void FixedBorder::SetTransparent( sal_Bool bTransparent )
{
if ( mbTransparent != bTransparent )
{
@@ -225,7 +225,7 @@ void FixedBorder::SetTransparent( BOOL bTransparent )
// -----------------------------------------------------------------------
-void FixedBorder::SetBorderType( USHORT nType )
+void FixedBorder::SetBorderType( sal_uInt16 nType )
{
if ( mnType != nType )
{
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index eed47fb59741..1828ded64a14 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -28,13 +28,13 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <vcl/decoview.hxx>
-#include <vcl/event.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/controldata.hxx>
-#include <vcl/window.h>
+#include "vcl/decoview.hxx"
+#include "vcl/event.hxx"
+#include "vcl/fixed.hxx"
+#include "vcl/controldata.hxx"
+#include "vcl/window.h"
-#include <tools/rc.h>
+#include "tools/rc.h"
// =======================================================================
@@ -95,7 +95,7 @@ void FixedText::ImplInit( Window* pParent, WinBits nStyle )
{
nStyle = ImplInitStyle( nStyle );
Control::ImplInit( pParent, nStyle, NULL );
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
}
// -----------------------------------------------------------------------
@@ -122,8 +122,8 @@ const Color& FixedText::GetCanonicalTextColor( const StyleSettings& _rStyle ) co
// -----------------------------------------------------------------------
-void FixedText::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void FixedText::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
Control::ImplInitSettings( bFont, bForeground );
@@ -132,16 +132,16 @@ void FixedText::ImplInitSettings( BOOL bFont,
Window* pParent = GetParent();
if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() )
{
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
}
else
{
- EnableChildTransparentMode( FALSE );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -183,7 +183,7 @@ FixedText::FixedText( Window* pParent, const ResId& rResId, bool bDisableAccessi
ImplInit( pParent, nStyle );
ImplLoadRes( rResId );
if ( bDisableAccessibleLabelForRelation )
- ImplGetWindowImpl()->mbDisableAccessibleLabelForRelation = TRUE;
+ ImplGetWindowImpl()->mbDisableAccessibleLabelForRelation = sal_True;
if ( !(nStyle & WB_HIDE) )
Show();
@@ -191,9 +191,9 @@ FixedText::FixedText( Window* pParent, const ResId& rResId, bool bDisableAccessi
// -----------------------------------------------------------------------
-USHORT FixedText::ImplGetTextStyle( WinBits nWinStyle )
+sal_uInt16 FixedText::ImplGetTextStyle( WinBits nWinStyle )
{
- USHORT nTextStyle = TEXT_DRAW_MNEMONIC | TEXT_DRAW_ENDELLIPSIS;
+ sal_uInt16 nTextStyle = TEXT_DRAW_MNEMONIC | TEXT_DRAW_ENDELLIPSIS;
if( ! (nWinStyle & WB_NOMULTILINE) )
nTextStyle |= TEXT_DRAW_MULTILINE;
@@ -224,7 +224,7 @@ USHORT FixedText::ImplGetTextStyle( WinBits nWinStyle )
// -----------------------------------------------------------------------
-void FixedText::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+void FixedText::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize,
bool bFillLayout
) const
@@ -232,7 +232,7 @@ void FixedText::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
WinBits nWinStyle = GetStyle();
XubString aText( GetText() );
- USHORT nTextStyle = FixedText::ImplGetTextStyle( nWinStyle );
+ sal_uInt16 nTextStyle = FixedText::ImplGetTextStyle( nWinStyle );
Point aPos = rPos;
if ( nWinStyle & WB_EXTRAOFFSET )
@@ -280,9 +280,9 @@ void FixedText::Paint( const Rectangle& )
// -----------------------------------------------------------------------
void FixedText::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- ULONG nFlags )
+ sal_uLong nFlags )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -297,8 +297,8 @@ void FixedText::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
pDev->SetTextColor( GetTextColor() );
pDev->SetTextFillColor();
- 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 );
@@ -344,24 +344,24 @@ void FixedText::StateChanged( StateChangedType nType )
if ( (GetPrevStyle() & FIXEDTEXT_VIEW_STYLE) !=
(GetStyle() & FIXEDTEXT_VIEW_STYLE) )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Invalidate();
}
}
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();
}
}
@@ -377,7 +377,7 @@ void FixedText::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
}
@@ -386,7 +386,7 @@ void FixedText::DataChanged( const DataChangedEvent& rDCEvt )
Size FixedText::CalcMinimumTextSize( Control const *pControl, long nMaxWidth )
{
- USHORT nStyle = ImplGetTextStyle( pControl->GetStyle() );
+ sal_uInt16 nStyle = ImplGetTextStyle( pControl->GetStyle() );
if ( !( pControl->GetStyle() & WB_NOLABEL ) )
nStyle |= TEXT_DRAW_MNEMONIC;
@@ -435,7 +435,7 @@ void FixedLine::ImplInit( Window* pParent, WinBits nStyle )
{
nStyle = ImplInitStyle( nStyle );
Control::ImplInit( pParent, nStyle, NULL );
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
}
// -----------------------------------------------------------------------
@@ -462,8 +462,8 @@ const Color& FixedLine::GetCanonicalTextColor( const StyleSettings& _rStyle ) co
// -----------------------------------------------------------------------
-void FixedLine::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void FixedLine::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
Control::ImplInitSettings( bFont, bForeground );
@@ -472,16 +472,16 @@ void FixedLine::ImplInitSettings( BOOL bFont,
Window* pParent = GetParent();
if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() )
{
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
}
else
{
- EnableChildTransparentMode( FALSE );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -502,7 +502,7 @@ void FixedLine::ImplDraw( bool bLayout )
String* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
DecorationView aDecoView( this );
- if ( !aText.Len() || (nWinStyle & WB_VERT) )
+ if ( !aText.Len() )
{
if( !pVector )
{
@@ -518,11 +518,34 @@ void FixedLine::ImplDraw( bool bLayout )
}
}
}
+ else if( (nWinStyle & WB_VERT) )
+ {
+ long nWidth = GetTextWidth( aText );
+ Push( PUSH_FONT );
+ Font aFont( GetFont() );
+ aFont.SetOrientation( 900 );
+ SetFont( aFont );
+ Point aStartPt( aOutSize.Width()/2, aOutSize.Height()-1 );
+ if( (nWinStyle & WB_VCENTER) )
+ aStartPt.Y() -= (aOutSize.Height() - nWidth)/2;
+ Point aTextPt( aStartPt );
+ aTextPt.X() -= GetTextHeight()/2;
+ DrawText( aTextPt, aText, 0, STRING_LEN, pVector, pDisplayText );
+ Pop();
+ if( aOutSize.Height() - aStartPt.Y() > FIXEDLINE_TEXT_BORDER )
+ aDecoView.DrawSeparator( Point( aStartPt.X(), aOutSize.Height()-1 ),
+ Point( aStartPt.X(), aStartPt.Y() + FIXEDLINE_TEXT_BORDER ) );
+ if( aStartPt.Y() - nWidth - FIXEDLINE_TEXT_BORDER > 0 )
+ aDecoView.DrawSeparator( Point( aStartPt.X(), aStartPt.Y() - nWidth - FIXEDLINE_TEXT_BORDER ),
+ Point( aStartPt.X(), 0 ) );
+ }
else
{
- USHORT nStyle = TEXT_DRAW_MNEMONIC | TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER | TEXT_DRAW_ENDELLIPSIS;
+ sal_uInt16 nStyle = TEXT_DRAW_MNEMONIC | TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER | TEXT_DRAW_ENDELLIPSIS;
Rectangle aRect( 0, 0, aOutSize.Width(), aOutSize.Height() );
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ if( (nWinStyle & WB_CENTER) )
+ nStyle |= TEXT_DRAW_CENTER;
if ( !IsEnabled() )
nStyle |= TEXT_DRAW_DISABLE;
@@ -537,6 +560,8 @@ void FixedLine::ImplDraw( bool bLayout )
{
long nTop = aRect.Top() + ((aRect.GetHeight()-1)/2);
aDecoView.DrawSeparator( Point( aRect.Right()+FIXEDLINE_TEXT_BORDER, nTop ), Point( aOutSize.Width()-1, nTop ), false );
+ if( aRect.Left() > FIXEDLINE_TEXT_BORDER )
+ aDecoView.DrawSeparator( Point( 0, nTop ), Point( aRect.Left()-FIXEDLINE_TEXT_BORDER, nTop ), false );
}
}
}
@@ -582,7 +607,7 @@ void FixedLine::Paint( const Rectangle& )
// -----------------------------------------------------------------------
-void FixedLine::Draw( OutputDevice*, const Point&, const Size&, ULONG )
+void FixedLine::Draw( OutputDevice*, const Point&, const Size&, sal_uLong )
{
}
@@ -618,17 +643,17 @@ void FixedLine::StateChanged( StateChangedType nType )
(nType == STATE_CHANGE_STYLE) ||
(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();
}
}
@@ -644,7 +669,7 @@ void FixedLine::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
}
@@ -686,16 +711,16 @@ void FixedBitmap::ImplInitSettings()
Window* pParent = GetParent();
if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() )
{
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
}
else
{
- EnableChildTransparentMode( FALSE );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -710,7 +735,7 @@ void FixedBitmap::ImplLoadRes( const ResId& rResId )
{
Control::ImplLoadRes( rResId );
- ULONG nObjMask = ReadLongRes();
+ sal_uLong nObjMask = ReadLongRes();
if ( RSC_FIXEDBITMAP_BITMAP & nObjMask )
{
@@ -749,10 +774,10 @@ FixedBitmap::~FixedBitmap()
// -----------------------------------------------------------------------
-void FixedBitmap::ImplDraw( OutputDevice* pDev, ULONG /* nDrawFlags */,
+void FixedBitmap::ImplDraw( OutputDevice* pDev, sal_uLong /* nDrawFlags */,
const Point& rPos, const Size& rSize )
{
- USHORT nStyle = 0;
+ sal_uInt16 nStyle = 0;
Bitmap* pBitmap = &maBitmap;
Color aCol;
@@ -797,7 +822,7 @@ void FixedBitmap::Paint( const Rectangle& )
// -----------------------------------------------------------------------
void FixedBitmap::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- ULONG nFlags )
+ sal_uLong nFlags )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -876,10 +901,10 @@ void FixedBitmap::SetBitmap( const Bitmap& rBitmap )
// -----------------------------------------------------------------------
-BOOL FixedBitmap::SetModeBitmap( const Bitmap& rBitmap )
+sal_Bool FixedBitmap::SetModeBitmap( const Bitmap& rBitmap )
{
SetBitmap( rBitmap );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -894,7 +919,7 @@ const Bitmap& FixedBitmap::GetModeBitmap( ) const
void FixedImage::ImplInit( Window* pParent, WinBits nStyle )
{
nStyle = ImplInitStyle( nStyle );
- mbInUserDraw = FALSE;
+ mbInUserDraw = sal_False;
Control::ImplInit( pParent, nStyle, NULL );
ImplInitSettings();
}
@@ -915,16 +940,16 @@ void FixedImage::ImplInitSettings()
Window* pParent = GetParent();
if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() )
{
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
}
else
{
- EnableChildTransparentMode( FALSE );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -939,7 +964,7 @@ void FixedImage::ImplLoadRes( const ResId& rResId )
{
Control::ImplLoadRes( rResId );
- ULONG nObjMask = ReadLongRes();
+ sal_uLong nObjMask = ReadLongRes();
if ( RSC_FIXEDIMAGE_IMAGE & nObjMask )
{
@@ -978,10 +1003,10 @@ FixedImage::~FixedImage()
// -----------------------------------------------------------------------
-void FixedImage::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+void FixedImage::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize )
{
- USHORT nStyle = 0;
+ sal_uInt16 nStyle = 0;
if ( !(nDrawFlags & WINDOW_DRAW_NODISABLE) )
{
if ( !IsEnabled() )
@@ -1003,10 +1028,10 @@ void FixedImage::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
}
}
- mbInUserDraw = TRUE;
+ mbInUserDraw = sal_True;
UserDrawEvent aUDEvt( pDev, Rectangle( rPos, rSize ), 0, nStyle );
UserDraw( aUDEvt );
- mbInUserDraw = FALSE;
+ mbInUserDraw = sal_False;
}
// -----------------------------------------------------------------------
@@ -1033,7 +1058,7 @@ void FixedImage::UserDraw( const UserDrawEvent& )
// -----------------------------------------------------------------------
void FixedImage::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- ULONG nFlags )
+ sal_uLong nFlags )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -1115,10 +1140,10 @@ void FixedImage::SetImage( const Image& rImage )
// -----------------------------------------------------------------------
-BOOL FixedImage::SetModeImage( const Image& rImage )
+sal_Bool FixedImage::SetModeImage( const Image& rImage )
{
SetImage( rImage );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/control/group.cxx b/vcl/source/control/group.cxx
index 5b062d6ea8ef..52dd061e317e 100644
--- a/vcl/source/control/group.cxx
+++ b/vcl/source/control/group.cxx
@@ -49,8 +49,8 @@ void GroupBox::ImplInit( Window* pParent, WinBits nStyle )
{
nStyle = ImplInitStyle( nStyle );
Control::ImplInit( pParent, nStyle, NULL );
- SetMouseTransparent( TRUE );
- ImplInitSettings( TRUE, TRUE, TRUE );
+ SetMouseTransparent( sal_True );
+ ImplInitSettings( sal_True, sal_True, sal_True );
}
// -----------------------------------------------------------------------
@@ -77,8 +77,8 @@ const Color& GroupBox::GetCanonicalTextColor( const StyleSettings& _rStyle ) con
// -----------------------------------------------------------------------
-void GroupBox::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void GroupBox::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
Control::ImplInitSettings( bFont, bForeground );
@@ -89,16 +89,16 @@ void GroupBox::ImplInitSettings( BOOL bFont,
!(pParent->GetStyle() & WB_CLIPCHILDREN) ) &&
!IsControlBackground() )
{
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
}
else
{
- EnableChildTransparentMode( FALSE );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -132,7 +132,7 @@ GroupBox::GroupBox( Window* pParent, const ResId& rResId ) :
// -----------------------------------------------------------------------
-void GroupBox::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+void GroupBox::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize, bool bLayout )
{
OSL_TRACE("GroupBox::ImplDraw Y %d, X %d", rPos.Y(), rPos.X() );
@@ -141,7 +141,7 @@ void GroupBox::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
XubString aText( GetText() );
Rectangle aRect( rPos, rSize );
- USHORT nTextStyle = TEXT_DRAW_LEFT | TEXT_DRAW_TOP | TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_MNEMONIC;
+ sal_uInt16 nTextStyle = TEXT_DRAW_LEFT | TEXT_DRAW_TOP | TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_MNEMONIC;
if ( GetStyle() & WB_NOLABEL )
nTextStyle &= ~TEXT_DRAW_MNEMONIC;
@@ -241,7 +241,7 @@ void GroupBox::Paint( const Rectangle& )
// -----------------------------------------------------------------------
void GroupBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- ULONG nFlags )
+ sal_uLong nFlags )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -291,17 +291,17 @@ void GroupBox::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();
}
}
@@ -317,7 +317,7 @@ void GroupBox::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
}
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index 0a0d4b8829c2..a288c3656317 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -55,7 +55,7 @@ using namespace ::com::sun::star;
// =======================================================================
-void ImplInitFieldSettings( Window* pWin, BOOL bFont, BOOL bForeground, BOOL bBackground )
+void ImplInitFieldSettings( Window* pWin, sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = pWin->GetSettings().GetStyleSettings();
@@ -106,7 +106,7 @@ ImplEntryList::ImplEntryList( Window* pWindow )
mnLastSelected = LISTBOX_ENTRY_NOTFOUND;
mnSelectionAnchor = LISTBOX_ENTRY_NOTFOUND;
mnImages = 0;
- mbCallSelectionChangedHdl = TRUE;
+ mbCallSelectionChangedHdl = sal_True;
mnMRUCount = 0;
mnMaxMRUCount = 0;
@@ -124,7 +124,7 @@ ImplEntryList::~ImplEntryList()
void ImplEntryList::Clear()
{
mnImages = 0;
- for ( USHORT n = GetEntryCount(); n; )
+ for ( sal_uInt16 n = GetEntryCount(); n; )
{
ImplEntryType* pImplEntry = GetEntry( --n );
delete pImplEntry;
@@ -134,7 +134,7 @@ void ImplEntryList::Clear()
// -----------------------------------------------------------------------
-void ImplEntryList::SelectEntry( USHORT nPos, BOOL bSelect )
+void ImplEntryList::SelectEntry( sal_uInt16 nPos, sal_Bool bSelect )
{
ImplEntryType* pImplEntry = GetEntry( nPos );
if ( pImplEntry &&
@@ -172,7 +172,7 @@ namespace vcl
}
}
-USHORT ImplEntryList::InsertEntry( USHORT nPos, ImplEntryType* pNewEntry, BOOL bSort )
+sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry, sal_Bool bSort )
{
if ( !!pNewEntry->maImage )
mnImages++;
@@ -186,11 +186,11 @@ USHORT ImplEntryList::InsertEntry( USHORT nPos, ImplEntryType* pNewEntry, BOOL b
const comphelper::string::NaturalStringSorter &rSorter = theSorter::get();
const XubString& rStr = pNewEntry->maStr;
- ULONG nLow, nHigh, nMid;
+ sal_uLong nLow, nHigh, nMid;
nHigh = Count();
- ImplEntryType* pTemp = GetEntry( (USHORT)(nHigh-1) );
+ ImplEntryType* pTemp = GetEntry( (sal_uInt16)(nHigh-1) );
try
{
@@ -206,12 +206,12 @@ USHORT ImplEntryList::InsertEntry( USHORT nPos, ImplEntryType* pNewEntry, BOOL b
else
{
nLow = mnMRUCount;
- pTemp = (ImplEntryType*)GetEntry( (USHORT)nLow );
+ pTemp = (ImplEntryType*)GetEntry( (sal_uInt16)nLow );
eComp = (StringCompare)rSorter.compare(rStr, pTemp->maStr);
if ( eComp != COMPARE_GREATER )
{
- Insert( pNewEntry, (ULONG)0 );
+ Insert( pNewEntry, (sal_uLong)0 );
}
else
{
@@ -249,17 +249,17 @@ USHORT ImplEntryList::InsertEntry( USHORT nPos, ImplEntryType* pNewEntry, BOOL b
// garbage you wouldn't insert it. If the exception occurred because the
// Collator implementation is garbage then give the user a chance to see
// his stuff
- Insert( pNewEntry, (ULONG)0 );
+ Insert( pNewEntry, (sal_uLong)0 );
}
}
- return (USHORT)GetPos( pNewEntry );
+ return (sal_uInt16)GetPos( pNewEntry );
}
// -----------------------------------------------------------------------
-void ImplEntryList::RemoveEntry( USHORT nPos )
+void ImplEntryList::RemoveEntry( sal_uInt16 nPos )
{
ImplEntryType* pImplEntry = (ImplEntryType*)List::Remove( nPos );
if ( pImplEntry )
@@ -273,10 +273,10 @@ void ImplEntryList::RemoveEntry( USHORT nPos )
// -----------------------------------------------------------------------
-USHORT ImplEntryList::FindEntry( const XubString& rString, BOOL bSearchMRUArea ) const
+sal_uInt16 ImplEntryList::FindEntry( const XubString& rString, sal_Bool bSearchMRUArea ) const
{
- USHORT nEntries = GetEntryCount();
- for ( USHORT n = bSearchMRUArea ? 0 : GetMRUCount(); n < nEntries; n++ )
+ sal_uInt16 nEntries = GetEntryCount();
+ for ( sal_uInt16 n = bSearchMRUArea ? 0 : GetMRUCount(); n < nEntries; n++ )
{
ImplEntryType* pImplEntry = GetEntry( n );
String aComp( vcl::I18nHelper::filterFormattingChars( pImplEntry->maStr ) );
@@ -288,21 +288,21 @@ USHORT ImplEntryList::FindEntry( const XubString& rString, BOOL bSearchMRUArea )
// -----------------------------------------------------------------------
-USHORT ImplEntryList::FindMatchingEntry( const XubString& rStr, USHORT nStart, BOOL bForward, BOOL bLazy ) const
+sal_uInt16 ImplEntryList::FindMatchingEntry( const XubString& rStr, sal_uInt16 nStart, sal_Bool bForward, sal_Bool bLazy ) const
{
- USHORT nPos = LISTBOX_ENTRY_NOTFOUND;
- USHORT nEntryCount = GetEntryCount();
+ sal_uInt16 nPos = LISTBOX_ENTRY_NOTFOUND;
+ sal_uInt16 nEntryCount = GetEntryCount();
if ( !bForward )
nStart++; // wird sofort dekrementiert
const vcl::I18nHelper& rI18nHelper = mpWindow->GetSettings().GetLocaleI18nHelper();
- for ( USHORT n = nStart; bForward ? ( n < nEntryCount ) : n; )
+ for ( sal_uInt16 n = nStart; bForward ? ( n < nEntryCount ) : n; )
{
if ( !bForward )
n--;
ImplEntryType* pImplEntry = GetEntry( n );
- BOOL bMatch = bLazy ? rI18nHelper.MatchString( rStr, pImplEntry->maStr ) != 0 : ( rStr.Match( pImplEntry->maStr ) == STRING_MATCH );
+ sal_Bool bMatch = bLazy ? rI18nHelper.MatchString( rStr, pImplEntry->maStr ) != 0 : ( rStr.Match( pImplEntry->maStr ) == STRING_MATCH );
if ( bMatch )
{
nPos = n;
@@ -318,10 +318,10 @@ USHORT ImplEntryList::FindMatchingEntry( const XubString& rStr, USHORT nStart, B
// -----------------------------------------------------------------------
-USHORT ImplEntryList::FindEntry( const void* pData ) const
+sal_uInt16 ImplEntryList::FindEntry( const void* pData ) const
{
- USHORT nPos = LISTBOX_ENTRY_NOTFOUND;
- for ( USHORT n = GetEntryCount(); n; )
+ sal_uInt16 nPos = LISTBOX_ENTRY_NOTFOUND;
+ for ( sal_uInt16 n = GetEntryCount(); n; )
{
ImplEntryType* pImplEntry = GetEntry( --n );
if ( pImplEntry->mpUserData == pData )
@@ -335,12 +335,12 @@ USHORT ImplEntryList::FindEntry( const void* pData ) const
// -----------------------------------------------------------------------
-long ImplEntryList::GetAddedHeight( USHORT i_nEndIndex, USHORT i_nBeginIndex, long i_nBeginHeight ) const
+long ImplEntryList::GetAddedHeight( sal_uInt16 i_nEndIndex, sal_uInt16 i_nBeginIndex, long i_nBeginHeight ) const
{
long nHeight = i_nBeginHeight;
- USHORT nStart = i_nEndIndex > i_nBeginIndex ? i_nBeginIndex : i_nEndIndex;
- USHORT nStop = i_nEndIndex > i_nBeginIndex ? i_nEndIndex : i_nBeginIndex;
- USHORT nEntryCount = GetEntryCount();
+ sal_uInt16 nStart = i_nEndIndex > i_nBeginIndex ? i_nBeginIndex : i_nEndIndex;
+ sal_uInt16 nStop = i_nEndIndex > i_nBeginIndex ? i_nEndIndex : i_nBeginIndex;
+ sal_uInt16 nEntryCount = GetEntryCount();
if( nStop != LISTBOX_ENTRY_NOTFOUND && nEntryCount != 0 )
{
// sanity check
@@ -349,7 +349,7 @@ long ImplEntryList::GetAddedHeight( USHORT i_nEndIndex, USHORT i_nBeginIndex, lo
if( nStart > nEntryCount-1 )
nStart = nEntryCount-1;
- USHORT nIndex = nStart;
+ sal_uInt16 nIndex = nStart;
while( nIndex != LISTBOX_ENTRY_NOTFOUND && nIndex < nStop )
{
nHeight += GetEntryPtr( nIndex )-> mnHeight;
@@ -363,7 +363,7 @@ long ImplEntryList::GetAddedHeight( USHORT i_nEndIndex, USHORT i_nBeginIndex, lo
// -----------------------------------------------------------------------
-long ImplEntryList::GetEntryHeight( USHORT nPos ) const
+long ImplEntryList::GetEntryHeight( sal_uInt16 nPos ) const
{
ImplEntryType* pImplEntry = GetEntry( nPos );
return pImplEntry ? pImplEntry->mnHeight : 0;
@@ -371,7 +371,7 @@ long ImplEntryList::GetEntryHeight( USHORT nPos ) const
// -----------------------------------------------------------------------
-XubString ImplEntryList::GetEntryText( USHORT nPos ) const
+XubString ImplEntryList::GetEntryText( sal_uInt16 nPos ) const
{
XubString aEntryText;
ImplEntryType* pImplEntry = GetEntry( nPos );
@@ -382,9 +382,9 @@ XubString ImplEntryList::GetEntryText( USHORT nPos ) const
// -----------------------------------------------------------------------
-BOOL ImplEntryList::HasEntryImage( USHORT nPos ) const
+sal_Bool ImplEntryList::HasEntryImage( sal_uInt16 nPos ) const
{
- BOOL bImage = FALSE;
+ sal_Bool bImage = sal_False;
ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
if ( pImplEntry )
bImage = !!pImplEntry->maImage;
@@ -393,7 +393,7 @@ BOOL ImplEntryList::HasEntryImage( USHORT nPos ) const
// -----------------------------------------------------------------------
-Image ImplEntryList::GetEntryImage( USHORT nPos ) const
+Image ImplEntryList::GetEntryImage( sal_uInt16 nPos ) const
{
Image aImage;
ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
@@ -404,7 +404,7 @@ Image ImplEntryList::GetEntryImage( USHORT nPos ) const
// -----------------------------------------------------------------------
-void ImplEntryList::SetEntryData( USHORT nPos, void* pNewData )
+void ImplEntryList::SetEntryData( sal_uInt16 nPos, void* pNewData )
{
ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
if ( pImplEntry )
@@ -413,7 +413,7 @@ void ImplEntryList::SetEntryData( USHORT nPos, void* pNewData )
// -----------------------------------------------------------------------
-void* ImplEntryList::GetEntryData( USHORT nPos ) const
+void* ImplEntryList::GetEntryData( sal_uInt16 nPos ) const
{
ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
return pImplEntry ? pImplEntry->mpUserData : NULL;
@@ -421,7 +421,7 @@ void* ImplEntryList::GetEntryData( USHORT nPos ) const
// -----------------------------------------------------------------------
-void ImplEntryList::SetEntryFlags( USHORT nPos, long nFlags )
+void ImplEntryList::SetEntryFlags( sal_uInt16 nPos, long nFlags )
{
ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
if ( pImplEntry )
@@ -430,7 +430,7 @@ void ImplEntryList::SetEntryFlags( USHORT nPos, long nFlags )
// -----------------------------------------------------------------------
-long ImplEntryList::GetEntryFlags( USHORT nPos ) const
+long ImplEntryList::GetEntryFlags( sal_uInt16 nPos ) const
{
ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
return pImplEntry ? pImplEntry->mnFlags : 0;
@@ -438,10 +438,10 @@ long ImplEntryList::GetEntryFlags( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT ImplEntryList::GetSelectEntryCount() const
+sal_uInt16 ImplEntryList::GetSelectEntryCount() const
{
- USHORT nSelCount = 0;
- for ( USHORT n = GetEntryCount(); n; )
+ sal_uInt16 nSelCount = 0;
+ for ( sal_uInt16 n = GetEntryCount(); n; )
{
ImplEntryType* pImplEntry = GetEntry( --n );
if ( pImplEntry->mbIsSelected )
@@ -452,20 +452,20 @@ USHORT ImplEntryList::GetSelectEntryCount() const
// -----------------------------------------------------------------------
-XubString ImplEntryList::GetSelectEntry( USHORT nIndex ) const
+XubString ImplEntryList::GetSelectEntry( sal_uInt16 nIndex ) const
{
return GetEntryText( GetSelectEntryPos( nIndex ) );
}
// -----------------------------------------------------------------------
-USHORT ImplEntryList::GetSelectEntryPos( USHORT nIndex ) const
+sal_uInt16 ImplEntryList::GetSelectEntryPos( sal_uInt16 nIndex ) const
{
- USHORT nSelEntryPos = LISTBOX_ENTRY_NOTFOUND;
- USHORT nSel = 0;
- USHORT nEntryCount = GetEntryCount();
+ sal_uInt16 nSelEntryPos = LISTBOX_ENTRY_NOTFOUND;
+ sal_uInt16 nSel = 0;
+ sal_uInt16 nEntryCount = GetEntryCount();
- for ( USHORT n = 0; n < nEntryCount; n++ )
+ for ( sal_uInt16 n = 0; n < nEntryCount; n++ )
{
ImplEntryType* pImplEntry = GetEntry( n );
if ( pImplEntry->mbIsSelected )
@@ -484,22 +484,22 @@ USHORT ImplEntryList::GetSelectEntryPos( USHORT nIndex ) const
// -----------------------------------------------------------------------
-BOOL ImplEntryList::IsEntrySelected( const XubString& rStr ) const
+sal_Bool ImplEntryList::IsEntrySelected( const XubString& rStr ) const
{
return IsEntryPosSelected( FindEntry( rStr ) );
}
// -----------------------------------------------------------------------
-BOOL ImplEntryList::IsEntryPosSelected( USHORT nIndex ) const
+sal_Bool ImplEntryList::IsEntryPosSelected( sal_uInt16 nIndex ) const
{
ImplEntryType* pImplEntry = GetEntry( nIndex );
- return pImplEntry ? pImplEntry->mbIsSelected : FALSE;
+ return pImplEntry ? pImplEntry->mbIsSelected : sal_False;
}
// -----------------------------------------------------------------------
-bool ImplEntryList::IsEntrySelectable( USHORT nPos ) const
+bool ImplEntryList::IsEntrySelectable( sal_uInt16 nPos ) const
{
ImplEntryType* pImplEntry = GetEntry( nPos );
return pImplEntry ? ((pImplEntry->mnFlags & LISTBOX_ENTRY_FLAG_DISABLE_SELECTION) == 0) : true;
@@ -507,7 +507,7 @@ bool ImplEntryList::IsEntrySelectable( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT ImplEntryList::FindFirstSelectable( USHORT nPos, bool bForward /* = true */ )
+sal_uInt16 ImplEntryList::FindFirstSelectable( sal_uInt16 nPos, bool bForward /* = true */ )
{
if( IsEntrySelectable( nPos ) )
return nPos;
@@ -536,7 +536,8 @@ USHORT ImplEntryList::FindFirstSelectable( USHORT nPos, bool bForward /* = true
// =======================================================================
ImplListBoxWindow::ImplListBoxWindow( Window* pParent, WinBits nWinStyle ) :
- Control( pParent, 0 )
+ Control( pParent, 0 ),
+ maQuickSelectionEngine( *this )
{
mpEntryList = new ImplEntryList( this );
@@ -545,26 +546,26 @@ ImplListBoxWindow::ImplListBoxWindow( Window* pParent, WinBits nWinStyle ) :
mnBorder = 1;
mnSelectModifier = 0;
mnUserDrawEntry = LISTBOX_ENTRY_NOTFOUND;
- mbTrack = FALSE;
- mbImgsDiffSz = FALSE;
- mbTravelSelect = FALSE;
- mbTrackingSelect = FALSE;
- mbSelectionChanged = FALSE;
- mbMouseMoveSelect = FALSE;
- mbMulti = FALSE;
- mbStackMode = FALSE;
- mbGrabFocus = FALSE;
- mbUserDrawEnabled = FALSE;
- mbInUserDraw = FALSE;
- mbReadOnly = FALSE;
- mbHasFocusRect = FALSE;
- mbRight = ( nWinStyle & WB_RIGHT ) ? TRUE : FALSE;
- mbCenter = ( nWinStyle & WB_CENTER ) ? TRUE : FALSE;
- mbSimpleMode = ( nWinStyle & WB_SIMPLEMODE ) ? TRUE : FALSE;
- mbSort = ( nWinStyle & WB_SORT ) ? TRUE : FALSE;
+ mbTrack = sal_False;
+ mbImgsDiffSz = sal_False;
+ mbTravelSelect = sal_False;
+ mbTrackingSelect = sal_False;
+ mbSelectionChanged = sal_False;
+ mbMouseMoveSelect = sal_False;
+ mbMulti = sal_False;
+ mbStackMode = sal_False;
+ mbGrabFocus = sal_False;
+ mbUserDrawEnabled = sal_False;
+ mbInUserDraw = sal_False;
+ mbReadOnly = sal_False;
+ mbHasFocusRect = sal_False;
+ mbRight = ( nWinStyle & WB_RIGHT ) ? sal_True : sal_False;
+ mbCenter = ( nWinStyle & WB_CENTER ) ? sal_True : sal_False;
+ mbSimpleMode = ( nWinStyle & WB_SIMPLEMODE ) ? sal_True : sal_False;
+ mbSort = ( nWinStyle & WB_SORT ) ? sal_True : sal_False;
// pb: #106948# explicit mirroring for calc
- mbMirroring = FALSE;
+ mbMirroring = sal_False;
mnCurrentPos = LISTBOX_ENTRY_NOTFOUND;
mnTrackingSaveSelection = LISTBOX_ENTRY_NOTFOUND;
@@ -575,10 +576,7 @@ ImplListBoxWindow::ImplListBoxWindow( Window* pParent, WinBits nWinStyle ) :
SetTextFillColor();
SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetFieldColor() ) );
- maSearchTimeout.SetTimeout( 2500 );
- maSearchTimeout.SetTimeoutHdl( LINK( this, ImplListBoxWindow, SearchStringTimeout ) );
-
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
ImplCalcMetrics();
}
@@ -586,13 +584,12 @@ ImplListBoxWindow::ImplListBoxWindow( Window* pParent, WinBits nWinStyle ) :
ImplListBoxWindow::~ImplListBoxWindow()
{
- maSearchTimeout.Stop();
delete mpEntryList;
}
// -----------------------------------------------------------------------
-void ImplListBoxWindow::ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground )
+void ImplListBoxWindow::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground )
{
ImplInitFieldSettings( this, bFont, bForeground, bBackground );
}
@@ -607,16 +604,16 @@ void ImplListBoxWindow::ImplCalcMetrics()
mnMaxImgTxtWidth= 0;
mnMaxImgHeight = 0;
- mnTextHeight = (USHORT)GetTextHeight();
+ mnTextHeight = (sal_uInt16)GetTextHeight();
mnMaxTxtHeight = mnTextHeight + mnBorder;
mnMaxHeight = mnMaxTxtHeight;
if ( maUserItemSize.Height() > mnMaxHeight )
- mnMaxHeight = (USHORT) maUserItemSize.Height();
+ mnMaxHeight = (sal_uInt16) maUserItemSize.Height();
if ( maUserItemSize.Width() > mnMaxWidth )
- mnMaxWidth= (USHORT) maUserItemSize.Width();
+ mnMaxWidth= (sal_uInt16) maUserItemSize.Width();
- for ( USHORT n = mpEntryList->GetEntryCount(); n; )
+ for ( sal_uInt16 n = mpEntryList->GetEntryCount(); n; )
{
ImplEntryType* pEntry = mpEntryList->GetMutableEntryPtr( --n );
ImplUpdateEntryMetrics( *pEntry );
@@ -631,14 +628,6 @@ void ImplListBoxWindow::ImplCalcMetrics()
// -----------------------------------------------------------------------
-IMPL_LINK( ImplListBoxWindow, SearchStringTimeout, Timer*, EMPTYARG )
-{
- maSearchStr.Erase();
- return 1;
-}
-
-// -----------------------------------------------------------------------
-
void ImplListBoxWindow::Clear()
{
mpEntryList->Clear();
@@ -651,10 +640,11 @@ void ImplListBoxWindow::Clear()
mnMaxImgHeight = 0;
mnTop = 0;
mnLeft = 0;
- mbImgsDiffSz = FALSE;
+ mbImgsDiffSz = sal_False;
ImplClearLayoutData();
mnCurrentPos = LISTBOX_ENTRY_NOTFOUND;
+ maQuickSelectionEngine.Reset();
Invalidate();
}
@@ -670,8 +660,8 @@ void ImplListBoxWindow::SetUserItemSize( const Size& rSz )
struct ImplEntryMetrics
{
- BOOL bText;
- BOOL bImage;
+ sal_Bool bText;
+ sal_Bool bImage;
long nEntryWidth;
long nEntryHeight;
long nTextWidth;
@@ -684,7 +674,7 @@ struct ImplEntryMetrics
void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry )
{
ImplEntryMetrics aMetrics;
- aMetrics.bText = rEntry.maStr.Len() ? TRUE : FALSE;
+ aMetrics.bText = rEntry.maStr.Len() ? sal_True : sal_False;
aMetrics.bImage = !!rEntry.maImage;
aMetrics.nEntryWidth = 0;
aMetrics.nEntryHeight = 0;
@@ -712,7 +702,7 @@ void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry )
else
{
// normal single line case
- aMetrics.nTextWidth = (USHORT)GetTextWidth( rEntry.maStr );
+ aMetrics.nTextWidth = (sal_uInt16)GetTextWidth( rEntry.maStr );
if( aMetrics.nTextWidth > mnMaxTxtWidth )
mnMaxTxtWidth = aMetrics.nTextWidth;
aMetrics.nEntryWidth = mnMaxTxtWidth;
@@ -722,13 +712,13 @@ void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry )
if ( aMetrics.bImage )
{
Size aImgSz = rEntry.maImage.GetSizePixel();
- aMetrics.nImgWidth = (USHORT) CalcZoom( aImgSz.Width() );
- aMetrics.nImgHeight = (USHORT) CalcZoom( aImgSz.Height() );
+ aMetrics.nImgWidth = (sal_uInt16) CalcZoom( aImgSz.Width() );
+ aMetrics.nImgHeight = (sal_uInt16) CalcZoom( aImgSz.Height() );
if( mnMaxImgWidth && ( aMetrics.nImgWidth != mnMaxImgWidth ) )
- mbImgsDiffSz = TRUE;
+ mbImgsDiffSz = sal_True;
else if ( mnMaxImgHeight && ( aMetrics.nImgHeight != mnMaxImgHeight ) )
- mbImgsDiffSz = TRUE;
+ mbImgsDiffSz = sal_True;
if( aMetrics.nImgWidth > mnMaxImgWidth )
mnMaxImgWidth = aMetrics.nImgWidth;
@@ -770,19 +760,19 @@ void ImplListBoxWindow::ImplCallSelect()
if ( !IsTravelSelect() && GetEntryList()->GetMaxMRUCount() )
{
// Insert the selected entry as MRU, if not allready first MRU
- USHORT nSelected = GetEntryList()->GetSelectEntryPos( 0 );
- USHORT nMRUCount = GetEntryList()->GetMRUCount();
+ sal_uInt16 nSelected = GetEntryList()->GetSelectEntryPos( 0 );
+ sal_uInt16 nMRUCount = GetEntryList()->GetMRUCount();
String aSelected = GetEntryList()->GetEntryText( nSelected );
- USHORT nFirstMatchingEntryPos = GetEntryList()->FindEntry( aSelected, TRUE );
+ sal_uInt16 nFirstMatchingEntryPos = GetEntryList()->FindEntry( aSelected, sal_True );
if ( nFirstMatchingEntryPos || !nMRUCount )
{
- BOOL bSelectNewEntry = FALSE;
+ sal_Bool bSelectNewEntry = sal_False;
if ( nFirstMatchingEntryPos < nMRUCount )
{
RemoveEntry( nFirstMatchingEntryPos );
nMRUCount--;
if ( nFirstMatchingEntryPos == nSelected )
- bSelectNewEntry = TRUE;
+ bSelectNewEntry = sal_True;
}
else if ( nMRUCount == GetEntryList()->GetMaxMRUCount() )
{
@@ -794,7 +784,7 @@ void ImplListBoxWindow::ImplCallSelect()
ImplEntryType* pNewEntry = new ImplEntryType( aSelected );
pNewEntry->mbIsSelected = bSelectNewEntry;
- GetEntryList()->InsertEntry( 0, pNewEntry, FALSE );
+ GetEntryList()->InsertEntry( 0, pNewEntry, sal_False );
ImplUpdateEntryMetrics( *pNewEntry );
GetEntryList()->SetMRUCount( ++nMRUCount );
SetSeparatorPos( nMRUCount ? nMRUCount-1 : 0 );
@@ -803,15 +793,15 @@ void ImplListBoxWindow::ImplCallSelect()
}
maSelectHdl.Call( NULL );
- mbSelectionChanged = FALSE;
+ mbSelectionChanged = sal_False;
}
// -----------------------------------------------------------------------
-USHORT ImplListBoxWindow::InsertEntry( USHORT nPos, ImplEntryType* pNewEntry )
+sal_uInt16 ImplListBoxWindow::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry )
{
ImplClearLayoutData();
- USHORT nNewPos = mpEntryList->InsertEntry( nPos, pNewEntry, mbSort );
+ sal_uInt16 nNewPos = mpEntryList->InsertEntry( nPos, pNewEntry, mbSort );
if( (GetStyle() & WB_WORDBREAK) )
pNewEntry->mnFlags |= LISTBOX_ENTRY_FLAG_MULTILINE;
@@ -822,7 +812,7 @@ USHORT ImplListBoxWindow::InsertEntry( USHORT nPos, ImplEntryType* pNewEntry )
// -----------------------------------------------------------------------
-void ImplListBoxWindow::RemoveEntry( USHORT nPos )
+void ImplListBoxWindow::RemoveEntry( sal_uInt16 nPos )
{
ImplClearLayoutData();
mpEntryList->RemoveEntry( nPos );
@@ -833,7 +823,7 @@ void ImplListBoxWindow::RemoveEntry( USHORT nPos )
// -----------------------------------------------------------------------
-void ImplListBoxWindow::SetEntryFlags( USHORT nPos, long nFlags )
+void ImplListBoxWindow::SetEntryFlags( sal_uInt16 nPos, long nFlags )
{
mpEntryList->SetEntryFlags( nPos, nFlags );
ImplEntryType* pEntry = mpEntryList->GetMutableEntryPtr( nPos );
@@ -848,7 +838,7 @@ void ImplListBoxWindow::ImplShowFocusRect()
if ( mbHasFocusRect )
HideFocus();
ShowFocus( maFocusRect );
- mbHasFocusRect = TRUE;
+ mbHasFocusRect = sal_True;
}
// -----------------------------------------------------------------------
@@ -858,18 +848,18 @@ void ImplListBoxWindow::ImplHideFocusRect()
if ( mbHasFocusRect )
{
HideFocus();
- mbHasFocusRect = FALSE;
+ mbHasFocusRect = sal_False;
}
}
// -----------------------------------------------------------------------
-USHORT ImplListBoxWindow::GetEntryPosForPoint( const Point& rPoint ) const
+sal_uInt16 ImplListBoxWindow::GetEntryPosForPoint( const Point& rPoint ) const
{
long nY = mnBorder;
- USHORT nSelect = mnTop;
+ sal_uInt16 nSelect = mnTop;
const ImplEntryType* pEntry = mpEntryList->GetEntryPtr( nSelect );
while( pEntry && rPoint.Y() > pEntry->mnHeight + nY )
{
@@ -884,16 +874,16 @@ USHORT ImplListBoxWindow::GetEntryPosForPoint( const Point& rPoint ) const
// -----------------------------------------------------------------------
-BOOL ImplListBoxWindow::IsVisible( USHORT i_nEntry ) const
+sal_Bool ImplListBoxWindow::IsVisible( sal_uInt16 i_nEntry ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( i_nEntry >= mnTop )
{
if( mpEntryList->GetAddedHeight( i_nEntry, mnTop ) <
PixelToLogic( GetSizePixel() ).Height() )
{
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -902,11 +892,11 @@ BOOL ImplListBoxWindow::IsVisible( USHORT i_nEntry ) const
// -----------------------------------------------------------------------
-USHORT ImplListBoxWindow::GetLastVisibleEntry() const
+sal_uInt16 ImplListBoxWindow::GetLastVisibleEntry() const
{
- USHORT nPos = mnTop;
+ sal_uInt16 nPos = mnTop;
long nWindowHeight = GetSizePixel().Height();
- USHORT nCount = mpEntryList->GetEntryCount();
+ sal_uInt16 nCount = mpEntryList->GetEntryCount();
long nDiff;
for( nDiff = 0; nDiff < nWindowHeight && nPos < nCount; nDiff = mpEntryList->GetAddedHeight( nPos, mnTop ) )
nPos++;
@@ -924,14 +914,14 @@ USHORT ImplListBoxWindow::GetLastVisibleEntry() const
void ImplListBoxWindow::MouseButtonDown( const MouseEvent& rMEvt )
{
- mbMouseMoveSelect = FALSE; // Nur bis zum ersten MouseButtonDown
- maSearchStr.Erase();
+ mbMouseMoveSelect = sal_False; // Nur bis zum ersten MouseButtonDown
+ maQuickSelectionEngine.Reset();
if ( !IsReadOnly() )
{
if( rMEvt.GetClicks() == 1 )
{
- USHORT nSelect = GetEntryPosForPoint( rMEvt.GetPosPixel() );
+ sal_uInt16 nSelect = GetEntryPosForPoint( rMEvt.GetPosPixel() );
if( nSelect != LISTBOX_ENTRY_NOTFOUND )
{
if ( !mbMulti && GetEntryList()->GetSelectEntryCount() )
@@ -940,9 +930,9 @@ void ImplListBoxWindow::MouseButtonDown( const MouseEvent& rMEvt )
mnTrackingSaveSelection = LISTBOX_ENTRY_NOTFOUND;
mnCurrentPos = nSelect;
- mbTrackingSelect = TRUE;
+ mbTrackingSelect = sal_True;
SelectEntries( nSelect, LET_MBDOWN, rMEvt.IsShift(), rMEvt.IsMod1() );
- mbTrackingSelect = FALSE;
+ mbTrackingSelect = sal_False;
if ( mbGrabFocus )
GrabFocus();
@@ -975,10 +965,10 @@ void ImplListBoxWindow::MouseMove( const MouseEvent& rMEvt )
SetTopEntry( 0 );
if ( mbStackMode ) // #87072#, #92323#
{
- mbTravelSelect = TRUE;
+ mbTravelSelect = sal_True;
mnSelectModifier = rMEvt.GetModifier();
ImplCallSelect();
- mbTravelSelect = FALSE;
+ mbTravelSelect = sal_False;
}
}
@@ -992,28 +982,28 @@ void ImplListBoxWindow::MouseMove( const MouseEvent& rMEvt )
{
if ( IsMouseMoveSelect() )
{
- USHORT nSelect = GetEntryPosForPoint( rMEvt.GetPosPixel() );
+ sal_uInt16 nSelect = GetEntryPosForPoint( rMEvt.GetPosPixel() );
if( nSelect == LISTBOX_ENTRY_NOTFOUND )
nSelect = mpEntryList->GetEntryCount() - 1;
nSelect = Min( nSelect, GetLastVisibleEntry() );
- nSelect = Min( nSelect, (USHORT) ( mpEntryList->GetEntryCount() - 1 ) );
+ nSelect = Min( nSelect, (sal_uInt16) ( mpEntryList->GetEntryCount() - 1 ) );
// Select only visible Entries with MouseMove, otherwise Tracking...
if ( IsVisible( nSelect ) &&
mpEntryList->IsEntrySelectable( nSelect ) &&
( ( nSelect != mnCurrentPos ) || !GetEntryList()->GetSelectEntryCount() || ( nSelect != GetEntryList()->GetSelectEntryPos( 0 ) ) ) )
{
- mbTrackingSelect = TRUE;
- if ( SelectEntries( nSelect, LET_TRACKING, FALSE, FALSE ) )
+ mbTrackingSelect = sal_True;
+ if ( SelectEntries( nSelect, LET_TRACKING, sal_False, sal_False ) )
{
if ( mbStackMode ) // #87072#
{
- mbTravelSelect = TRUE;
+ mbTravelSelect = sal_True;
mnSelectModifier = rMEvt.GetModifier();
ImplCallSelect();
- mbTravelSelect = FALSE;
+ mbTravelSelect = sal_False;
}
}
- mbTrackingSelect = FALSE;
+ mbTrackingSelect = sal_False;
}
}
@@ -1041,14 +1031,14 @@ void ImplListBoxWindow::DeselectAll()
{
while ( GetEntryList()->GetSelectEntryCount() )
{
- USHORT nS = GetEntryList()->GetSelectEntryPos( 0 );
- SelectEntry( nS, FALSE );
+ sal_uInt16 nS = GetEntryList()->GetSelectEntryPos( 0 );
+ SelectEntry( nS, sal_False );
}
}
// -----------------------------------------------------------------------
-void ImplListBoxWindow::SelectEntry( USHORT nPos, BOOL bSelect )
+void ImplListBoxWindow::SelectEntry( sal_uInt16 nPos, sal_Bool bSelect )
{
if( (mpEntryList->IsEntryPosSelected( nPos ) != bSelect) && mpEntryList->IsEntrySelectable( nPos ) )
{
@@ -1058,16 +1048,16 @@ void ImplListBoxWindow::SelectEntry( USHORT nPos, BOOL bSelect )
if( !mbMulti )
{
// Selektierten Eintrag deselektieren
- USHORT nDeselect = GetEntryList()->GetSelectEntryPos( 0 );
+ sal_uInt16 nDeselect = GetEntryList()->GetSelectEntryPos( 0 );
if( nDeselect != LISTBOX_ENTRY_NOTFOUND )
{
- //SelectEntryPos( nDeselect, FALSE );
- GetEntryList()->SelectEntry( nDeselect, FALSE );
+ //SelectEntryPos( nDeselect, sal_False );
+ GetEntryList()->SelectEntry( nDeselect, sal_False );
if ( IsUpdateMode() && IsReallyVisible() )
- ImplPaint( nDeselect, TRUE );
+ ImplPaint( nDeselect, sal_True );
}
}
- mpEntryList->SelectEntry( nPos, TRUE );
+ mpEntryList->SelectEntry( nPos, sal_True );
mnCurrentPos = nPos;
if ( ( nPos != LISTBOX_ENTRY_NOTFOUND ) && IsUpdateMode() )
{
@@ -1075,7 +1065,7 @@ void ImplListBoxWindow::SelectEntry( USHORT nPos, BOOL bSelect )
if ( !IsVisible( nPos ) )
{
ImplClearLayoutData();
- USHORT nVisibleEntries = GetLastVisibleEntry()-mnTop;
+ sal_uInt16 nVisibleEntries = GetLastVisibleEntry()-mnTop;
if ( !nVisibleEntries || !IsReallyVisible() || ( nPos < GetTopEntry() ) )
{
Resize();
@@ -1090,46 +1080,46 @@ void ImplListBoxWindow::SelectEntry( USHORT nPos, BOOL bSelect )
}
else
{
- mpEntryList->SelectEntry( nPos, FALSE );
- ImplPaint( nPos, TRUE );
+ mpEntryList->SelectEntry( nPos, sal_False );
+ ImplPaint( nPos, sal_True );
}
- mbSelectionChanged = TRUE;
+ mbSelectionChanged = sal_True;
}
}
// -----------------------------------------------------------------------
-BOOL ImplListBoxWindow::SelectEntries( USHORT nSelect, LB_EVENT_TYPE eLET, BOOL bShift, BOOL bCtrl )
+sal_Bool ImplListBoxWindow::SelectEntries( sal_uInt16 nSelect, LB_EVENT_TYPE eLET, sal_Bool bShift, sal_Bool bCtrl )
{
- BOOL bFocusChanged = FALSE;
- BOOL bSelectionChanged = FALSE;
+ sal_Bool bFocusChanged = sal_False;
+ sal_Bool bSelectionChanged = sal_False;
if( IsEnabled() && mpEntryList->IsEntrySelectable( nSelect ) )
{
// Hier (Single-ListBox) kann nur ein Eintrag deselektiert werden
if( !mbMulti )
{
- USHORT nDeselect = mpEntryList->GetSelectEntryPos( 0 );
+ sal_uInt16 nDeselect = mpEntryList->GetSelectEntryPos( 0 );
if( nSelect != nDeselect )
{
- SelectEntry( nSelect, TRUE );
+ SelectEntry( nSelect, sal_True );
mpEntryList->SetLastSelected( nSelect );
- bFocusChanged = TRUE;
- bSelectionChanged = TRUE;
+ bFocusChanged = sal_True;
+ bSelectionChanged = sal_True;
}
}
// MultiListBox ohne Modifier
else if( mbSimpleMode && !bCtrl && !bShift )
{
- USHORT nEntryCount = mpEntryList->GetEntryCount();
- for ( USHORT nPos = 0; nPos < nEntryCount; nPos++ )
+ sal_uInt16 nEntryCount = mpEntryList->GetEntryCount();
+ for ( sal_uInt16 nPos = 0; nPos < nEntryCount; nPos++ )
{
- BOOL bSelect = nPos == nSelect;
+ sal_Bool bSelect = nPos == nSelect;
if ( mpEntryList->IsEntryPosSelected( nPos ) != bSelect )
{
SelectEntry( nPos, bSelect );
- bFocusChanged = TRUE;
- bSelectionChanged = TRUE;
+ bFocusChanged = sal_True;
+ bSelectionChanged = sal_True;
}
}
mpEntryList->SetLastSelected( nSelect );
@@ -1141,20 +1131,20 @@ BOOL ImplListBoxWindow::SelectEntries( USHORT nSelect, LB_EVENT_TYPE eLET, BOOL
// Space fuer Selektionswechsel
if( !bShift && ( ( eLET == LET_KEYSPACE ) || ( eLET == LET_MBDOWN ) ) )
{
- BOOL bSelect = ( mbStackMode && IsMouseMoveSelect() ) ? TRUE : !mpEntryList->IsEntryPosSelected( nSelect );
+ sal_Bool bSelect = ( mbStackMode && IsMouseMoveSelect() ) ? sal_True : !mpEntryList->IsEntryPosSelected( nSelect );
if ( mbStackMode )
{
- USHORT n;
+ sal_uInt16 n;
if ( bSelect )
{
// All entries before nSelect must be selected...
for ( n = 0; n < nSelect; n++ )
- SelectEntry( n, TRUE );
+ SelectEntry( n, sal_True );
}
if ( !bSelect )
{
for ( n = nSelect+1; n < mpEntryList->GetEntryCount(); n++ )
- SelectEntry( n, FALSE );
+ SelectEntry( n, sal_False );
}
}
SelectEntry( nSelect, bSelect );
@@ -1162,16 +1152,16 @@ BOOL ImplListBoxWindow::SelectEntries( USHORT nSelect, LB_EVENT_TYPE eLET, BOOL
mpEntryList->SetSelectionAnchor( mbStackMode ? 0 : nSelect );
if ( !mpEntryList->IsEntryPosSelected( nSelect ) )
mpEntryList->SetSelectionAnchor( LISTBOX_ENTRY_NOTFOUND );
- bFocusChanged = TRUE;
- bSelectionChanged = TRUE;
+ bFocusChanged = sal_True;
+ bSelectionChanged = sal_True;
}
else if( ( ( eLET == LET_TRACKING ) && ( nSelect != mnCurrentPos ) ) ||
( (bShift||mbStackMode) && ( ( eLET == LET_KEYMOVE ) || ( eLET == LET_MBDOWN ) ) ) )
{
mnCurrentPos = nSelect;
- bFocusChanged = TRUE;
+ bFocusChanged = sal_True;
- USHORT nAnchor = mpEntryList->GetSelectionAnchor();
+ sal_uInt16 nAnchor = mpEntryList->GetSelectionAnchor();
if( ( nAnchor == LISTBOX_ENTRY_NOTFOUND ) && ( mpEntryList->GetSelectEntryCount() || mbStackMode ) )
{
nAnchor = mbStackMode ? 0 : mpEntryList->GetSelectEntryPos( mpEntryList->GetSelectEntryCount() - 1 );
@@ -1179,40 +1169,40 @@ BOOL ImplListBoxWindow::SelectEntries( USHORT nSelect, LB_EVENT_TYPE eLET, BOOL
if( nAnchor != LISTBOX_ENTRY_NOTFOUND )
{
// Alle Eintraege vom Anchor bis nSelect muessen selektiert sein
- USHORT nStart = Min( nSelect, nAnchor );
- USHORT nEnd = Max( nSelect, nAnchor );
- for ( USHORT n = nStart; n <= nEnd; n++ )
+ sal_uInt16 nStart = Min( nSelect, nAnchor );
+ sal_uInt16 nEnd = Max( nSelect, nAnchor );
+ for ( sal_uInt16 n = nStart; n <= nEnd; n++ )
{
if ( !mpEntryList->IsEntryPosSelected( n ) )
{
- SelectEntry( n, TRUE );
- bSelectionChanged = TRUE;
+ SelectEntry( n, sal_True );
+ bSelectionChanged = sal_True;
}
}
// Ggf. muss noch was deselektiert werden...
- USHORT nLast = mpEntryList->GetLastSelected();
+ sal_uInt16 nLast = mpEntryList->GetLastSelected();
if ( nLast != LISTBOX_ENTRY_NOTFOUND )
{
if ( ( nLast > nSelect ) && ( nLast > nAnchor ) )
{
- for ( USHORT n = nSelect+1; n <= nLast; n++ )
+ for ( sal_uInt16 n = nSelect+1; n <= nLast; n++ )
{
if ( mpEntryList->IsEntryPosSelected( n ) )
{
- SelectEntry( n, FALSE );
- bSelectionChanged = TRUE;
+ SelectEntry( n, sal_False );
+ bSelectionChanged = sal_True;
}
}
}
else if ( ( nLast < nSelect ) && ( nLast < nAnchor ) )
{
- for ( USHORT n = nLast; n < nSelect; n++ )
+ for ( sal_uInt16 n = nLast; n < nSelect; n++ )
{
if ( mpEntryList->IsEntryPosSelected( n ) )
{
- SelectEntry( n, FALSE );
- bSelectionChanged = TRUE;
+ SelectEntry( n, sal_False );
+ bSelectionChanged = sal_True;
}
}
}
@@ -1223,17 +1213,17 @@ BOOL ImplListBoxWindow::SelectEntries( USHORT nSelect, LB_EVENT_TYPE eLET, BOOL
else if( eLET != LET_TRACKING )
{
ImplHideFocusRect();
- ImplPaint( nSelect, TRUE );
- bFocusChanged = TRUE;
+ ImplPaint( nSelect, sal_True );
+ bFocusChanged = sal_True;
}
}
else if( bShift )
{
- bFocusChanged = TRUE;
+ bFocusChanged = sal_True;
}
if( bSelectionChanged )
- mbSelectionChanged = TRUE;
+ mbSelectionChanged = sal_True;
if( bFocusChanged )
{
@@ -1256,7 +1246,7 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt )
{
Point aPoint;
Rectangle aRect( aPoint, GetOutputSizePixel() );
- BOOL bInside = aRect.IsInside( rTEvt.GetMouseEvent().GetPosPixel() );
+ sal_Bool bInside = aRect.IsInside( rTEvt.GetMouseEvent().GetPosPixel() );
if( rTEvt.IsTrackingCanceled() || rTEvt.IsTrackingEnded() ) // MouseButtonUp
{
@@ -1270,9 +1260,9 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt )
maCancelHdl.Call( NULL );
if ( !mbMulti )
{
- mbTrackingSelect = TRUE;
- SelectEntry( mnTrackingSaveSelection, TRUE );
- mbTrackingSelect = FALSE;
+ mbTrackingSelect = sal_True;
+ SelectEntry( mnTrackingSaveSelection, sal_True );
+ mbTrackingSelect = sal_False;
if ( mnTrackingSaveSelection != LISTBOX_ENTRY_NOTFOUND )
{
long nHeightDiff = mpEntryList->GetAddedHeight( mnCurrentPos, mnTop, 0 );
@@ -1285,23 +1275,23 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt )
}
}
- mbTrack = FALSE;
+ mbTrack = sal_False;
}
else
{
- BOOL bTrackOrQuickClick = mbTrack;
+ sal_Bool bTrackOrQuickClick = mbTrack;
if( !mbTrack )
{
if ( bInside )
{
- mbTrack = TRUE;
+ mbTrack = sal_True;
}
// Folgender Fall tritt nur auf, wenn man ganz kurz die Maustaste drueckt
if( rTEvt.IsTrackingEnded() && mbTrack )
{
- bTrackOrQuickClick = TRUE;
- mbTrack = FALSE;
+ bTrackOrQuickClick = sal_True;
+ mbTrack = sal_False;
}
}
@@ -1309,10 +1299,10 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt )
{
MouseEvent aMEvt = rTEvt.GetMouseEvent();
Point aPt( aMEvt.GetPosPixel() );
- BOOL bShift = aMEvt.IsShift();
- BOOL bCtrl = aMEvt.IsMod1();
+ sal_Bool bShift = aMEvt.IsShift();
+ sal_Bool bCtrl = aMEvt.IsMod1();
- USHORT nSelect = LISTBOX_ENTRY_NOTFOUND;
+ sal_uInt16 nSelect = LISTBOX_ENTRY_NOTFOUND;
if( aPt.Y() < 0 )
{
if ( mnCurrentPos != LISTBOX_ENTRY_NOTFOUND )
@@ -1326,43 +1316,43 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt )
{
if ( mnCurrentPos != LISTBOX_ENTRY_NOTFOUND )
{
- nSelect = Min( (USHORT)(mnCurrentPos+1), (USHORT)(mpEntryList->GetEntryCount()-1) );
+ nSelect = Min( (sal_uInt16)(mnCurrentPos+1), (sal_uInt16)(mpEntryList->GetEntryCount()-1) );
if( nSelect >= GetLastVisibleEntry() )
SetTopEntry( mnTop+1 );
}
}
else
{
- nSelect = (USHORT) ( ( aPt.Y() + mnBorder ) / mnMaxHeight ) + (USHORT) mnTop;
+ nSelect = (sal_uInt16) ( ( aPt.Y() + mnBorder ) / mnMaxHeight ) + (sal_uInt16) mnTop;
nSelect = Min( nSelect, GetLastVisibleEntry() );
- nSelect = Min( nSelect, (USHORT) ( mpEntryList->GetEntryCount() - 1 ) );
+ nSelect = Min( nSelect, (sal_uInt16) ( mpEntryList->GetEntryCount() - 1 ) );
}
if ( bInside )
{
if ( ( nSelect != mnCurrentPos ) || !GetEntryList()->GetSelectEntryCount() )
{
- mbTrackingSelect = TRUE;
+ mbTrackingSelect = sal_True;
if ( SelectEntries( nSelect, LET_TRACKING, bShift, bCtrl ) )
{
if ( mbStackMode ) // #87734# (#87072#)
{
- mbTravelSelect = TRUE;
+ mbTravelSelect = sal_True;
mnSelectModifier = rTEvt.GetMouseEvent().GetModifier();
ImplCallSelect();
- mbTravelSelect = FALSE;
+ mbTravelSelect = sal_False;
}
}
- mbTrackingSelect = FALSE;
+ mbTrackingSelect = sal_False;
}
}
else
{
if ( !mbMulti && GetEntryList()->GetSelectEntryCount() )
{
- mbTrackingSelect = TRUE;
- SelectEntry( GetEntryList()->GetSelectEntryPos( 0 ), FALSE );
- mbTrackingSelect = FALSE;
+ mbTrackingSelect = sal_True;
+ SelectEntry( GetEntryList()->GetSelectEntryPos( 0 ), sal_False );
+ mbTrackingSelect = sal_False;
}
else if ( mbStackMode )
{
@@ -1370,32 +1360,32 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt )
{
if ( ( rTEvt.GetMouseEvent().GetPosPixel().Y() < 0 ) || ( rTEvt.GetMouseEvent().GetPosPixel().Y() > GetOutputSizePixel().Height() ) )
{
- BOOL bSelectionChanged = FALSE;
+ sal_Bool bSelectionChanged = sal_False;
if ( ( rTEvt.GetMouseEvent().GetPosPixel().Y() < 0 )
&& !mnCurrentPos )
{
if ( mpEntryList->IsEntryPosSelected( 0 ) )
{
- SelectEntry( 0, FALSE );
- bSelectionChanged = TRUE;
+ SelectEntry( 0, sal_False );
+ bSelectionChanged = sal_True;
nSelect = LISTBOX_ENTRY_NOTFOUND;
}
}
else
{
- mbTrackingSelect = TRUE;
+ mbTrackingSelect = sal_True;
bSelectionChanged = SelectEntries( nSelect, LET_TRACKING, bShift, bCtrl );
- mbTrackingSelect = FALSE;
+ mbTrackingSelect = sal_False;
}
if ( bSelectionChanged )
{
- mbSelectionChanged = TRUE;
- mbTravelSelect = TRUE;
+ mbSelectionChanged = sal_True;
+ mbTravelSelect = sal_True;
mnSelectModifier = rTEvt.GetMouseEvent().GetModifier();
ImplCallSelect();
- mbTravelSelect = FALSE;
+ mbTravelSelect = sal_False;
}
}
}
@@ -1433,18 +1423,18 @@ void ImplListBoxWindow::KeyInput( const KeyEvent& rKEvt )
#define IMPL_SELECT_UP 1
#define IMPL_SELECT_DOWN 2
-BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
+sal_Bool ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
{
// zu selektierender Eintrag
- USHORT nSelect = LISTBOX_ENTRY_NOTFOUND;
+ sal_uInt16 nSelect = LISTBOX_ENTRY_NOTFOUND;
LB_EVENT_TYPE eLET = LET_KEYMOVE;
KeyCode aKeyCode = rKEvt.GetKeyCode();
- BOOL bShift = aKeyCode.IsShift();
- BOOL bCtrl = aKeyCode.IsMod1() || aKeyCode.IsMod3();
- BOOL bMod2 = aKeyCode.IsMod2();
- BOOL bDone = FALSE;
+ sal_Bool bShift = aKeyCode.IsShift();
+ sal_Bool bCtrl = aKeyCode.IsMod1() || aKeyCode.IsMod3();
+ sal_Bool bMod2 = aKeyCode.IsMod2();
+ sal_Bool bDone = sal_False;
switch( aKeyCode.GetCode() )
{
@@ -1470,9 +1460,9 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
if( ( nSelect != LISTBOX_ENTRY_NOTFOUND ) && ( nSelect < mnTop ) )
SetTopEntry( mnTop-1 );
- bDone = TRUE;
+ bDone = sal_True;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1497,9 +1487,9 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
if( ( nSelect != LISTBOX_ENTRY_NOTFOUND ) && ( nSelect >= GetLastVisibleEntry() ) )
SetTopEntry( mnTop+1 );
- bDone = TRUE;
+ bDone = sal_True;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1507,7 +1497,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
{
if ( IsReadOnly() )
{
- USHORT nCurVis = GetLastVisibleEntry() - mnTop +1;
+ sal_uInt16 nCurVis = GetLastVisibleEntry() - mnTop +1;
SetTopEntry( ( mnTop > nCurVis ) ?
(mnTop-nCurVis) : 0 );
}
@@ -1521,16 +1511,16 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
{
if( mnCurrentPos == mnTop )
{
- USHORT nCurVis = GetLastVisibleEntry() - mnTop +1;
+ sal_uInt16 nCurVis = GetLastVisibleEntry() - mnTop +1;
SetTopEntry( ( mnTop > nCurVis ) ? ( mnTop-nCurVis+1 ) : 0 );
}
// find first selectable starting from mnTop looking foreward
nSelect = mpEntryList->FindFirstSelectable( mnTop, true );
}
- bDone = TRUE;
+ bDone = sal_True;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1548,23 +1538,23 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
}
else if ( (mnCurrentPos+1) < mpEntryList->GetEntryCount() )
{
- USHORT nCount = mpEntryList->GetEntryCount();
- USHORT nCurVis = GetLastVisibleEntry() - mnTop;
- USHORT nTmp = Min( nCurVis, nCount );
+ sal_uInt16 nCount = mpEntryList->GetEntryCount();
+ sal_uInt16 nCurVis = GetLastVisibleEntry() - mnTop;
+ sal_uInt16 nTmp = Min( nCurVis, nCount );
nTmp += mnTop - 1;
if( mnCurrentPos == nTmp && mnCurrentPos != nCount - 1 )
{
long nTmp2 = Min( (long)(nCount-nCurVis), (long)((long)mnTop+(long)nCurVis-1) );
nTmp2 = Max( (long)0 , nTmp2 );
- nTmp = (USHORT)(nTmp2+(nCurVis-1) );
- SetTopEntry( (USHORT)nTmp2 );
+ nTmp = (sal_uInt16)(nTmp2+(nCurVis-1) );
+ SetTopEntry( (sal_uInt16)nTmp2 );
}
// find first selectable starting from nTmp looking backwards
nSelect = mpEntryList->FindFirstSelectable( nTmp, false );
}
- bDone = TRUE;
+ bDone = sal_True;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1582,10 +1572,10 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
if( mnTop != 0 )
SetTopEntry( 0 );
- bDone = TRUE;
+ bDone = sal_True;
}
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1603,15 +1593,15 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
}
else if ( (mnCurrentPos+1) < mpEntryList->GetEntryCount() )
{
- USHORT nCount = mpEntryList->GetEntryCount();
+ sal_uInt16 nCount = mpEntryList->GetEntryCount();
nSelect = mpEntryList->FindFirstSelectable( nCount - 1, false );
- USHORT nCurVis = GetLastVisibleEntry() - mnTop + 1;
+ sal_uInt16 nCurVis = GetLastVisibleEntry() - mnTop + 1;
if( nCount > nCurVis )
SetTopEntry( nCount - nCurVis );
}
- bDone = TRUE;
+ bDone = sal_True;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1620,9 +1610,9 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
if ( !bCtrl && !bMod2 )
{
ScrollHorz( -HORZ_SCROLL );
- bDone = TRUE;
+ bDone = sal_True;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1631,9 +1621,9 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
if ( !bCtrl && !bMod2 )
{
ScrollHorz( HORZ_SCROLL );
- bDone = TRUE;
+ bDone = sal_True;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1643,9 +1633,9 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
{
mnSelectModifier = rKEvt.GetKeyCode().GetModifier();
ImplCallSelect();
- bDone = FALSE; // RETURN nicht abfangen.
+ bDone = sal_False; // RETURN nicht abfangen.
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1658,9 +1648,9 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
nSelect = mnCurrentPos;
eLET = LET_KEYSPACE;
}
- bDone = TRUE;
+ bDone = sal_True;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1669,63 +1659,32 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
if( bCtrl && mbMulti )
{
// paint only once
- BOOL bUpdates = IsUpdateMode();
- SetUpdateMode( FALSE );
+ sal_Bool bUpdates = IsUpdateMode();
+ SetUpdateMode( sal_False );
- USHORT nEntryCount = mpEntryList->GetEntryCount();
- for( USHORT i = 0; i < nEntryCount; i++ )
- SelectEntry( i, TRUE );
+ sal_uInt16 nEntryCount = mpEntryList->GetEntryCount();
+ for( sal_uInt16 i = 0; i < nEntryCount; i++ )
+ SelectEntry( i, sal_True );
// restore update mode
SetUpdateMode( bUpdates );
Invalidate();
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
- bDone = TRUE;
+ bDone = sal_True;
break;
}
}
// fall through intentional
default:
{
- xub_Unicode c = rKEvt.GetCharCode();
-
- if ( !IsReadOnly() && (c >= 32) && (c != 127) && !rKEvt.GetKeyCode().IsMod2() )
+ if ( !IsReadOnly() )
{
- maSearchStr += c;
- XubString aTmpSearch( maSearchStr );
-
- nSelect = mpEntryList->FindMatchingEntry( aTmpSearch, mnCurrentPos );
- if ( (nSelect == LISTBOX_ENTRY_NOTFOUND) && (aTmpSearch.Len() > 1) )
- {
- // Wenn alles die gleichen Buchstaben, dann anderer Such-Modus
- BOOL bAllEqual = TRUE;
- for ( USHORT n = aTmpSearch.Len(); n && bAllEqual; )
- bAllEqual = aTmpSearch.GetChar( --n ) == c;
- if ( bAllEqual )
- {
- aTmpSearch = c;
- nSelect = mpEntryList->FindMatchingEntry( aTmpSearch, mnCurrentPos+1 );
- }
- }
- if ( nSelect == LISTBOX_ENTRY_NOTFOUND )
- nSelect = mpEntryList->FindMatchingEntry( aTmpSearch, 0 );
-
- if ( nSelect != LISTBOX_ENTRY_NOTFOUND )
- {
- ShowProminentEntry( nSelect );
-
- if ( mpEntryList->IsEntryPosSelected( nSelect ) )
- nSelect = LISTBOX_ENTRY_NOTFOUND;
-
- maSearchTimeout.Start();
- }
- else
- maSearchStr.Erase();
- bDone = TRUE;
+ bDone = maQuickSelectionEngine.HandleKeyEvent( rKEvt );
}
- }
+ }
+ break;
}
if ( ( nSelect != LISTBOX_ENTRY_NOTFOUND )
@@ -1740,10 +1699,10 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
mnCurrentPos = nSelect;
if ( SelectEntries( nSelect, eLET, bShift, bCtrl ) )
{
- mbTravelSelect = TRUE;
+ mbTravelSelect = sal_True;
mnSelectModifier = rKEvt.GetKeyCode().GetModifier();
ImplCallSelect();
- mbTravelSelect = FALSE;
+ mbTravelSelect = sal_False;
}
}
@@ -1751,8 +1710,74 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
}
// -----------------------------------------------------------------------
+namespace
+{
+ static ::vcl::StringEntryIdentifier lcl_getEntry( const ImplEntryList& _rList, sal_uInt16 _nPos, String& _out_entryText )
+ {
+ OSL_PRECOND( ( _nPos != LISTBOX_ENTRY_NOTFOUND ), "lcl_getEntry: invalid position!" );
+ sal_uInt16 nEntryCount( _rList.GetEntryCount() );
+ if ( _nPos >= nEntryCount )
+ _nPos = 0;
+ _out_entryText = _rList.GetEntryText( _nPos );
-void ImplListBoxWindow::ImplPaint( USHORT nPos, BOOL bErase, bool bLayout )
+ // ::vcl::StringEntryIdentifier does not allow for 0 values, but our position is 0-based
+ // => normalize
+ return reinterpret_cast< ::vcl::StringEntryIdentifier >( _nPos + 1 );
+ }
+
+ static sal_uInt16 lcl_getEntryPos( ::vcl::StringEntryIdentifier _entry )
+ {
+ // our pos is 0-based, but StringEntryIdentifier does not allow for a NULL
+ return static_cast< sal_uInt16 >( reinterpret_cast< sal_Int64 >( _entry ) ) - 1;
+ }
+}
+
+// -----------------------------------------------------------------------
+::vcl::StringEntryIdentifier ImplListBoxWindow::CurrentEntry( String& _out_entryText ) const
+{
+ return lcl_getEntry( *GetEntryList(), ( mnCurrentPos == LISTBOX_ENTRY_NOTFOUND ) ? 0 : mnCurrentPos + 1, _out_entryText );
+}
+
+// -----------------------------------------------------------------------
+::vcl::StringEntryIdentifier ImplListBoxWindow::NextEntry( ::vcl::StringEntryIdentifier _currentEntry, String& _out_entryText ) const
+{
+ sal_uInt16 nNextPos = lcl_getEntryPos( _currentEntry ) + 1;
+ return lcl_getEntry( *GetEntryList(), nNextPos, _out_entryText );
+}
+
+// -----------------------------------------------------------------------
+void ImplListBoxWindow::SelectEntry( ::vcl::StringEntryIdentifier _entry )
+{
+ sal_uInt16 nSelect = lcl_getEntryPos( _entry );
+ if ( mpEntryList->IsEntryPosSelected( nSelect ) )
+ {
+ // ignore that. This method is a callback from the QuickSelectionEngine, which means the user attempted
+ // to select the given entry by typing its starting letters. No need to act.
+ return;
+ }
+
+ // normalize
+ OSL_ENSURE( nSelect < mpEntryList->GetEntryCount(), "ImplListBoxWindow::SelectEntry: how that?" );
+ if( nSelect >= mpEntryList->GetEntryCount() )
+ nSelect = mpEntryList->GetEntryCount()-1;
+
+ // make visible
+ ShowProminentEntry( nSelect );
+
+ // actually select
+ mnCurrentPos = nSelect;
+ if ( SelectEntries( nSelect, LET_KEYMOVE, sal_False, sal_False ) )
+ {
+ mbTravelSelect = sal_True;
+ mnSelectModifier = 0;
+ ImplCallSelect();
+ mbTravelSelect = sal_False;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ImplListBoxWindow::ImplPaint( sal_uInt16 nPos, sal_Bool bErase, bool bLayout )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -1775,7 +1800,7 @@ void ImplListBoxWindow::ImplPaint( USHORT nPos, BOOL bErase, bool bLayout )
}
else
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
if( !IsEnabled() )
SetTextColor( rStyleSettings.GetDisableColor() );
SetTextFillColor();
@@ -1786,25 +1811,25 @@ void ImplListBoxWindow::ImplPaint( USHORT nPos, BOOL bErase, bool bLayout )
if ( IsUserDrawEnabled() )
{
- mbInUserDraw = TRUE;
+ mbInUserDraw = sal_True;
mnUserDrawEntry = nPos;
aRect.Left() -= mnLeft;
if ( nPos < GetEntryList()->GetMRUCount() )
nPos = GetEntryList()->FindEntry( GetEntryList()->GetEntryText( nPos ) );
- nPos = sal::static_int_cast<USHORT>(nPos - GetEntryList()->GetMRUCount());
+ nPos = sal::static_int_cast<sal_uInt16>(nPos - GetEntryList()->GetMRUCount());
UserDrawEvent aUDEvt( this, aRect, nPos, 0 );
maUserDrawHdl.Call( &aUDEvt );
- mbInUserDraw = FALSE;
+ mbInUserDraw = sal_False;
}
else
{
- DrawEntry( nPos, TRUE, TRUE, FALSE, bLayout );
+ DrawEntry( nPos, sal_True, sal_True, sal_False, bLayout );
}
}
// -----------------------------------------------------------------------
-void ImplListBoxWindow::DrawEntry( USHORT nPos, BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos, bool bLayout )
+void ImplListBoxWindow::DrawEntry( sal_uInt16 nPos, sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos, bool bLayout )
{
const ImplEntryType* pEntry = mpEntryList->GetEntryPtr( nPos );
if( ! pEntry )
@@ -1878,7 +1903,7 @@ void ImplListBoxWindow::DrawEntry( USHORT nPos, BOOL bDrawImage, BOOL bDrawText,
aTextRect.Left() -= ( aImgSz.Width() + IMG_TXT_DISTANCE );
}
- USHORT nDrawStyle = ImplGetTextStyle();
+ sal_uInt16 nDrawStyle = ImplGetTextStyle();
if( (pEntry->mnFlags & LISTBOX_ENTRY_FLAG_MULTILINE) )
nDrawStyle |= MULTILINE_ENTRY_DRAW_FLAGS;
if( (pEntry->mnFlags & LISTBOX_ENTRY_FLAG_DRAW_DISABLED) )
@@ -1919,22 +1944,22 @@ void ImplListBoxWindow::FillLayoutData() const
void ImplListBoxWindow::ImplDoPaint( const Rectangle& rRect, bool bLayout )
{
- USHORT nCount = mpEntryList->GetEntryCount();
+ sal_uInt16 nCount = mpEntryList->GetEntryCount();
- BOOL bShowFocusRect = mbHasFocusRect;
+ sal_Bool bShowFocusRect = mbHasFocusRect;
if ( mbHasFocusRect && ! bLayout )
ImplHideFocusRect();
long nY = 0; // + mnBorder;
long nHeight = GetOutputSizePixel().Height();// - mnMaxHeight + mnBorder;
- for( USHORT i = (USHORT)mnTop; i < nCount && nY < nHeight + mnMaxHeight; i++ )
+ for( sal_uInt16 i = (sal_uInt16)mnTop; i < nCount && nY < nHeight + mnMaxHeight; i++ )
{
const ImplEntryType* pEntry = mpEntryList->GetEntryPtr( i );
if( nY + pEntry->mnHeight >= rRect.Top() &&
nY <= rRect.Bottom() + mnMaxHeight )
{
- ImplPaint( i, FALSE, bLayout );
+ ImplPaint( i, sal_False, bLayout );
}
nY += pEntry->mnHeight;
}
@@ -1956,13 +1981,13 @@ void ImplListBoxWindow::Paint( const Rectangle& rRect )
// -----------------------------------------------------------------------
-USHORT ImplListBoxWindow::GetDisplayLineCount() const
+sal_uInt16 ImplListBoxWindow::GetDisplayLineCount() const
{
// FIXME: LISTBOX_ENTRY_FLAG_MULTILINE
- USHORT nCount = mpEntryList->GetEntryCount();
+ sal_uInt16 nCount = mpEntryList->GetEntryCount();
long nHeight = GetOutputSizePixel().Height();// - mnMaxHeight + mnBorder;
- USHORT nEntries = static_cast< USHORT >( ( nHeight + mnMaxHeight - 1 ) / mnMaxHeight );
+ sal_uInt16 nEntries = static_cast< sal_uInt16 >( ( nHeight + mnMaxHeight - 1 ) / mnMaxHeight );
if( nEntries > nCount-mnTop )
nEntries = nCount-mnTop;
@@ -1975,7 +2000,7 @@ void ImplListBoxWindow::Resize()
{
Control::Resize();
- BOOL bShowFocusRect = mbHasFocusRect;
+ sal_Bool bShowFocusRect = mbHasFocusRect;
if ( bShowFocusRect )
ImplHideFocusRect();
@@ -1995,7 +2020,7 @@ void ImplListBoxWindow::Resize()
void ImplListBoxWindow::GetFocus()
{
- USHORT nPos = mnCurrentPos;
+ sal_uInt16 nPos = mnCurrentPos;
if ( nPos == LISTBOX_ENTRY_NOTFOUND )
nPos = 0;
long nHeightDiff = mpEntryList->GetAddedHeight( nPos, mnTop, 0 );
@@ -2028,14 +2053,14 @@ void ImplListBoxWindow::RequestHelp( const HelpEvent& rHEvt )
// -----------------------------------------------------------------------
-void ImplListBoxWindow::SetTopEntry( USHORT nTop )
+void ImplListBoxWindow::SetTopEntry( sal_uInt16 nTop )
{
if( mpEntryList->GetEntryCount() == 0 )
return;
long nWHeight = PixelToLogic( GetSizePixel() ).Height();
- USHORT nLastEntry = mpEntryList->GetEntryCount()-1;
+ sal_uInt16 nLastEntry = mpEntryList->GetEntryCount()-1;
if( nTop > nLastEntry )
nTop = nLastEntry;
const ImplEntryType* pLast = mpEntryList->GetEntryPtr( nLastEntry );
@@ -2061,11 +2086,11 @@ void ImplListBoxWindow::SetTopEntry( USHORT nTop )
// -----------------------------------------------------------------------
-void ImplListBoxWindow::ShowProminentEntry( USHORT nEntryPos )
+void ImplListBoxWindow::ShowProminentEntry( sal_uInt16 nEntryPos )
{
if( meProminentType == PROMINENT_MIDDLE )
{
- USHORT nPos = nEntryPos;
+ sal_uInt16 nPos = nEntryPos;
long nWHeight = PixelToLogic( GetSizePixel() ).Height();
while( nEntryPos > 0 && mpEntryList->GetAddedHeight( nPos+1, nEntryPos ) < nWHeight/2 )
nEntryPos--;
@@ -2103,7 +2128,7 @@ void ImplListBoxWindow::ScrollHorz( long n )
if ( nDiff )
{
ImplClearLayoutData();
- mnLeft = sal::static_int_cast<USHORT>(mnLeft + nDiff);
+ mnLeft = sal::static_int_cast<sal_uInt16>(mnLeft + nDiff);
Update();
ImplHideFocusRect();
Scroll( -nDiff, 0 );
@@ -2116,12 +2141,12 @@ void ImplListBoxWindow::ScrollHorz( long n )
// -----------------------------------------------------------------------
-Size ImplListBoxWindow::CalcSize( USHORT nMaxLines ) const
+Size ImplListBoxWindow::CalcSize( sal_uInt16 nMaxLines ) const
{
// FIXME: LISTBOX_ENTRY_FLAG_MULTILINE
Size aSz;
-// USHORT nL = Min( nMaxLines, mpEntryList->GetEntryCount() );
+// sal_uInt16 nL = Min( nMaxLines, mpEntryList->GetEntryCount() );
aSz.Height() = nMaxLines * mnMaxHeight;
aSz.Width() = mnMaxWidth + 2*mnBorder;
return aSz;
@@ -2129,7 +2154,7 @@ Size ImplListBoxWindow::CalcSize( USHORT nMaxLines ) const
// -----------------------------------------------------------------------
-Rectangle ImplListBoxWindow::GetBoundingRectangle( USHORT nItem ) const
+Rectangle ImplListBoxWindow::GetBoundingRectangle( sal_uInt16 nItem ) const
{
const ImplEntryType* pEntry = mpEntryList->GetEntryPtr( nItem );
Size aSz( GetSizePixel().Width(), pEntry ? pEntry->mnHeight : GetEntryHeight() );
@@ -2147,7 +2172,7 @@ void ImplListBoxWindow::StateChanged( StateChangedType nType )
if ( nType == STATE_CHANGE_ZOOM )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
ImplCalcMetrics();
Invalidate();
}
@@ -2158,18 +2183,18 @@ void ImplListBoxWindow::StateChanged( StateChangedType nType )
}
else if ( nType == STATE_CHANGE_CONTROLFONT )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
ImplCalcMetrics();
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();
}
ImplClearLayoutData();
@@ -2187,7 +2212,7 @@ void ImplListBoxWindow::DataChanged( const DataChangedEvent& rDCEvt )
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
ImplClearLayoutData();
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
ImplCalcMetrics();
Invalidate();
}
@@ -2195,9 +2220,9 @@ void ImplListBoxWindow::DataChanged( const DataChangedEvent& rDCEvt )
// -----------------------------------------------------------------------
-USHORT ImplListBoxWindow::ImplGetTextStyle() const
+sal_uInt16 ImplListBoxWindow::ImplGetTextStyle() const
{
- USHORT nTextStyle = TEXT_DRAW_VCENTER;
+ sal_uInt16 nTextStyle = TEXT_DRAW_VCENTER;
if ( mpEntryList->HasImages() )
nTextStyle |= TEXT_DRAW_LEFT;
@@ -2228,9 +2253,9 @@ ImplListBox::ImplListBox( Window* pParent, WinBits nWinStyle ) :
mpVScrollBar->SetScrollHdl( aLink );
mpHScrollBar->SetScrollHdl( aLink );
- mbVScroll = FALSE;
- mbHScroll = FALSE;
- mbAutoHScroll = ( nWinStyle & WB_AUTOHSCROLL ) ? TRUE : FALSE;
+ mbVScroll = sal_False;
+ mbHScroll = sal_False;
+ mbAutoHScroll = ( nWinStyle & WB_AUTOHSCROLL ) ? sal_True : sal_False;
maLBWindow.SetScrollHdl( LINK( this, ImplListBox, LBWindowScrolled ) );
maLBWindow.SetMRUChangedHdl( LINK( this, ImplListBox, MRUChanged ) );
@@ -2263,37 +2288,37 @@ void ImplListBox::Clear()
// -----------------------------------------------------------------------
-USHORT ImplListBox::InsertEntry( USHORT nPos, const XubString& rStr )
+sal_uInt16 ImplListBox::InsertEntry( sal_uInt16 nPos, const XubString& rStr )
{
ImplEntryType* pNewEntry = new ImplEntryType( rStr );
- USHORT nNewPos = maLBWindow.InsertEntry( nPos, pNewEntry );
+ sal_uInt16 nNewPos = maLBWindow.InsertEntry( nPos, pNewEntry );
StateChanged( STATE_CHANGE_DATA );
return nNewPos;
}
// -----------------------------------------------------------------------
-USHORT ImplListBox::InsertEntry( USHORT nPos, const Image& rImage )
+sal_uInt16 ImplListBox::InsertEntry( sal_uInt16 nPos, const Image& rImage )
{
ImplEntryType* pNewEntry = new ImplEntryType( rImage );
- USHORT nNewPos = maLBWindow.InsertEntry( nPos, pNewEntry );
+ sal_uInt16 nNewPos = maLBWindow.InsertEntry( nPos, pNewEntry );
StateChanged( STATE_CHANGE_DATA );
return nNewPos;
}
// -----------------------------------------------------------------------
-USHORT ImplListBox::InsertEntry( USHORT nPos, const XubString& rStr, const Image& rImage )
+sal_uInt16 ImplListBox::InsertEntry( sal_uInt16 nPos, const XubString& rStr, const Image& rImage )
{
ImplEntryType* pNewEntry = new ImplEntryType( rStr, rImage );
- USHORT nNewPos = maLBWindow.InsertEntry( nPos, pNewEntry );
+ sal_uInt16 nNewPos = maLBWindow.InsertEntry( nPos, pNewEntry );
StateChanged( STATE_CHANGE_DATA );
return nNewPos;
}
// -----------------------------------------------------------------------
-void ImplListBox::RemoveEntry( USHORT nPos )
+void ImplListBox::RemoveEntry( sal_uInt16 nPos )
{
maLBWindow.RemoveEntry( nPos );
StateChanged( STATE_CHANGE_DATA );
@@ -2301,21 +2326,21 @@ void ImplListBox::RemoveEntry( USHORT nPos )
// -----------------------------------------------------------------------
-void ImplListBox::SetEntryFlags( USHORT nPos, long nFlags )
+void ImplListBox::SetEntryFlags( sal_uInt16 nPos, long nFlags )
{
maLBWindow.SetEntryFlags( nPos, nFlags );
}
// -----------------------------------------------------------------------
-long ImplListBox::GetEntryFlags( USHORT nPos ) const
+long ImplListBox::GetEntryFlags( sal_uInt16 nPos ) const
{
return maLBWindow.GetEntryList()->GetEntryFlags( nPos );
}
// -----------------------------------------------------------------------
-void ImplListBox::SelectEntry( USHORT nPos, BOOL bSelect )
+void ImplListBox::SelectEntry( sal_uInt16 nPos, sal_Bool bSelect )
{
maLBWindow.SelectEntry( nPos, bSelect );
}
@@ -2363,7 +2388,11 @@ IMPL_LINK( ImplListBox, MRUChanged, void*, EMPTYARG )
IMPL_LINK( ImplListBox, LBWindowScrolled, void*, EMPTYARG )
{
+ long nSet = GetTopEntry();
+ if( nSet > mpVScrollBar->GetRangeMax() )
+ mpVScrollBar->SetRangeMax( GetEntryList()->GetEntryCount() );
mpVScrollBar->SetThumbPos( GetTopEntry() );
+
mpHScrollBar->SetThumbPos( GetLeftIndent() );
maScrollHdl.Call( this );
@@ -2375,7 +2404,7 @@ IMPL_LINK( ImplListBox, LBWindowScrolled, void*, EMPTYARG )
IMPL_LINK( ImplListBox, ScrollBarHdl, ScrollBar*, pSB )
{
- USHORT nPos = (USHORT) pSB->GetThumbPos();
+ sal_uInt16 nPos = (sal_uInt16) pSB->GetThumbPos();
if( pSB == mpVScrollBar )
SetTopEntry( nPos );
else if( pSB == mpHScrollBar )
@@ -2388,34 +2417,38 @@ IMPL_LINK( ImplListBox, ScrollBarHdl, ScrollBar*, pSB )
void ImplListBox::ImplCheckScrollBars()
{
- BOOL bArrange = FALSE;
+ sal_Bool bArrange = sal_False;
Size aOutSz = GetOutputSizePixel();
- USHORT nEntries = GetEntryList()->GetEntryCount();
- USHORT nMaxVisEntries = (USHORT) (aOutSz.Height() / GetEntryHeight());
+ sal_uInt16 nEntries = GetEntryList()->GetEntryCount();
+ sal_uInt16 nMaxVisEntries = (sal_uInt16) (aOutSz.Height() / GetEntryHeight());
// vert. ScrollBar
if( nEntries > nMaxVisEntries )
{
if( !mbVScroll )
- bArrange = TRUE;
- mbVScroll = TRUE;
+ bArrange = sal_True;
+ mbVScroll = sal_True;
// Ueberpruefung des rausgescrollten Bereichs
- SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft...
+ if( GetEntryList()->GetSelectEntryCount() == 1 &&
+ GetEntryList()->GetSelectEntryPos( 0 ) != LISTBOX_ENTRY_NOTFOUND )
+ ShowProminentEntry( GetEntryList()->GetSelectEntryPos( 0 ) );
+ else
+ SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft...
}
else
{
if( mbVScroll )
- bArrange = TRUE;
- mbVScroll = FALSE;
+ bArrange = sal_True;
+ mbVScroll = sal_False;
SetTopEntry( 0 );
}
// horz. ScrollBar
if( mbAutoHScroll )
{
- long nWidth = (USHORT) aOutSz.Width();
+ long nWidth = (sal_uInt16) aOutSz.Width();
if ( mbVScroll )
nWidth -= mpVScrollBar->GetSizePixel().Width();
@@ -2423,32 +2456,36 @@ void ImplListBox::ImplCheckScrollBars()
if( nWidth < nMaxWidth )
{
if( !mbHScroll )
- bArrange = TRUE;
- mbHScroll = TRUE;
+ bArrange = sal_True;
+ mbHScroll = sal_True;
if ( !mbVScroll ) // ggf. brauchen wir jetzt doch einen
{
- nMaxVisEntries = (USHORT) ( ( aOutSz.Height() - mpHScrollBar->GetSizePixel().Height() ) / GetEntryHeight() );
+ nMaxVisEntries = (sal_uInt16) ( ( aOutSz.Height() - mpHScrollBar->GetSizePixel().Height() ) / GetEntryHeight() );
if( nEntries > nMaxVisEntries )
{
- bArrange = TRUE;
- mbVScroll = TRUE;
+ bArrange = sal_True;
+ mbVScroll = sal_True;
// Ueberpruefung des rausgescrollten Bereichs
- SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft...
+ if( GetEntryList()->GetSelectEntryCount() == 1 &&
+ GetEntryList()->GetSelectEntryPos( 0 ) != LISTBOX_ENTRY_NOTFOUND )
+ ShowProminentEntry( GetEntryList()->GetSelectEntryPos( 0 ) );
+ else
+ SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft...
}
}
// Ueberpruefung des rausgescrollten Bereichs
- USHORT nMaxLI = (USHORT) (nMaxWidth - nWidth);
+ sal_uInt16 nMaxLI = (sal_uInt16) (nMaxWidth - nWidth);
if ( nMaxLI < GetLeftIndent() )
SetLeftIndent( nMaxLI );
}
else
{
if( mbHScroll )
- bArrange = TRUE;
- mbHScroll = FALSE;
+ bArrange = sal_True;
+ mbHScroll = sal_False;
SetLeftIndent( 0 );
}
}
@@ -2467,8 +2504,8 @@ void ImplListBox::ImplInitScrollBars()
if ( mbVScroll )
{
- USHORT nEntries = GetEntryList()->GetEntryCount();
- USHORT nVisEntries = (USHORT) (aOutSz.Height() / GetEntryHeight());
+ sal_uInt16 nEntries = GetEntryList()->GetEntryCount();
+ sal_uInt16 nVisEntries = (sal_uInt16) (aOutSz.Height() / GetEntryHeight());
mpVScrollBar->SetRangeMax( nEntries );
mpVScrollBar->SetVisibleSize( nVisEntries );
mpVScrollBar->SetPageSize( nVisEntries - 1 );
@@ -2477,7 +2514,7 @@ void ImplListBox::ImplInitScrollBars()
if ( mbHScroll )
{
mpHScrollBar->SetRangeMax( GetMaxEntryWidth() + HORZ_SCROLL );
- mpHScrollBar->SetVisibleSize( (USHORT)aOutSz.Width() );
+ mpHScrollBar->SetVisibleSize( (sal_uInt16)aOutSz.Width() );
mpHScrollBar->SetLineSize( HORZ_SCROLL );
mpHScrollBar->SetPageSize( aOutSz.Width() - HORZ_SCROLL );
}
@@ -2502,7 +2539,7 @@ void ImplListBox::ImplResizeControls()
// pb: #106948# explicit mirroring for calc
// Scrollbar on left or right side?
- BOOL bMirroring = maLBWindow.IsMirroring();
+ sal_Bool bMirroring = maLBWindow.IsMirroring();
Point aWinPos( bMirroring && mbVScroll ? nSBWidth : 0, 0 );
maLBWindow.SetPosSizePixel( aWinPos, aInnerSz );
@@ -2557,7 +2594,7 @@ void ImplListBox::StateChanged( StateChangedType nType )
}
else if ( ( nType == STATE_CHANGE_UPDATEMODE ) || ( nType == STATE_CHANGE_DATA ) )
{
- BOOL bUpdate = IsUpdateMode();
+ sal_Bool bUpdate = IsUpdateMode();
maLBWindow.SetUpdateMode( bUpdate );
// mpHScrollBar->SetUpdateMode( bUpdate );
// mpVScrollBar->SetUpdateMode( bUpdate );
@@ -2643,15 +2680,15 @@ const Wallpaper& ImplListBox::GetDisplayBackground() const
// -----------------------------------------------------------------------
-BOOL ImplListBox::HandleWheelAsCursorTravel( const CommandEvent& rCEvt )
+sal_Bool ImplListBox::HandleWheelAsCursorTravel( const CommandEvent& rCEvt )
{
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
if ( rCEvt.GetCommand() == COMMAND_WHEEL )
{
const CommandWheelData* pData = rCEvt.GetWheelData();
if( !pData->GetModifier() && ( pData->GetMode() == COMMAND_WHEEL_SCROLL ) )
{
- USHORT nKey = ( pData->GetDelta() < 0 ) ? KEY_DOWN : KEY_UP;
+ sal_uInt16 nKey = ( pData->GetDelta() < 0 ) ? KEY_DOWN : KEY_UP;
KeyEvent aKeyEvent( 0, KeyCode( nKey ) );
bDone = ProcessKeyInput( aKeyEvent );
}
@@ -2663,23 +2700,23 @@ BOOL ImplListBox::HandleWheelAsCursorTravel( const CommandEvent& rCEvt )
void ImplListBox::SetMRUEntries( const XubString& rEntries, xub_Unicode cSep )
{
- BOOL bChanges = GetEntryList()->GetMRUCount() ? TRUE : FALSE;
+ sal_Bool bChanges = GetEntryList()->GetMRUCount() ? sal_True : sal_False;
// Remove old MRU entries
- for ( USHORT n = GetEntryList()->GetMRUCount();n; )
+ for ( sal_uInt16 n = GetEntryList()->GetMRUCount();n; )
maLBWindow.RemoveEntry( --n );
- USHORT nMRUCount = 0;
- USHORT nEntries = rEntries.GetTokenCount( cSep );
- for ( USHORT nEntry = 0; nEntry < nEntries; nEntry++ )
+ sal_uInt16 nMRUCount = 0;
+ sal_uInt16 nEntries = rEntries.GetTokenCount( cSep );
+ for ( sal_uInt16 nEntry = 0; nEntry < nEntries; nEntry++ )
{
XubString aEntry = rEntries.GetToken( nEntry, cSep );
// Accept only existing entries
if ( GetEntryList()->FindEntry( aEntry ) != LISTBOX_ENTRY_NOTFOUND )
{
ImplEntryType* pNewEntry = new ImplEntryType( aEntry );
- maLBWindow.GetEntryList()->InsertEntry( nMRUCount++, pNewEntry, FALSE );
- bChanges = TRUE;
+ maLBWindow.GetEntryList()->InsertEntry( nMRUCount++, pNewEntry, sal_False );
+ bChanges = sal_True;
}
}
@@ -2696,7 +2733,7 @@ void ImplListBox::SetMRUEntries( const XubString& rEntries, xub_Unicode cSep )
XubString ImplListBox::GetMRUEntries( xub_Unicode cSep ) const
{
String aEntries;
- for ( USHORT n = 0; n < GetEntryList()->GetMRUCount(); n++ )
+ for ( sal_uInt16 n = 0; n < GetEntryList()->GetMRUCount(); n++ )
{
aEntries += GetEntryList()->GetEntryText( n );
if( n < ( GetEntryList()->GetMRUCount() - 1 ) )
@@ -2716,17 +2753,17 @@ ImplWin::ImplWin( Window* pParent, WinBits nWinStyle ) :
else
SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetFieldColor() ) );
- mbInUserDraw = FALSE;
- mbUserDrawEnabled = FALSE;
+ mbInUserDraw = sal_False;
+ mbUserDrawEnabled = sal_False;
mnItemPos = LISTBOX_ENTRY_NOTFOUND;
}
// -----------------------------------------------------------------------
-BOOL ImplWin::SetModeImage( const Image& rImage )
+sal_Bool ImplWin::SetModeImage( const Image& rImage )
{
SetImage( rImage );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -2792,7 +2829,7 @@ void ImplWin::ImplDraw( bool bLayout )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- BOOL bNativeOK = FALSE;
+ sal_Bool bNativeOK = sal_False;
if( ! bLayout )
{
@@ -2819,11 +2856,11 @@ void ImplWin::ImplDraw( bool bLayout )
Point aPoint( -nLeft, -nTop );
Rectangle aCtrlRegion( aPoint - GetPosPixel(), pWin->GetSizePixel() );
- BOOL bMouseOver = FALSE;
+ sal_Bool bMouseOver = sal_False;
if( GetParent() )
{
Window *pChild = GetParent()->GetWindow( WINDOW_FIRSTCHILD );
- while( pChild && (bMouseOver = pChild->IsMouseOver()) == FALSE )
+ while( pChild && (bMouseOver = pChild->IsMouseOver()) == sal_False )
pChild = pChild->GetWindow( WINDOW_NEXT );
}
@@ -2876,14 +2913,14 @@ void ImplWin::ImplDraw( bool bLayout )
if ( IsUserDrawEnabled() )
{
- mbInUserDraw = TRUE;
+ mbInUserDraw = sal_True;
UserDrawEvent aUDEvt( this, maFocusRect, mnItemPos, 0 );
maUserDrawHdl.Call( &aUDEvt );
- mbInUserDraw = FALSE;
+ mbInUserDraw = sal_False;
}
else
{
- DrawEntry( TRUE, TRUE, FALSE, bLayout );
+ DrawEntry( sal_True, sal_True, sal_False, bLayout );
}
}
@@ -2896,15 +2933,15 @@ void ImplWin::Paint( const Rectangle& )
// -----------------------------------------------------------------------
-void ImplWin::DrawEntry( BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos, bool bLayout )
+void ImplWin::DrawEntry( sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos, bool bLayout )
{
long nBorder = 1;
Size aOutSz = GetOutputSizePixel();
- BOOL bImage = !!maImage;
+ sal_Bool bImage = !!maImage;
if( bDrawImage && bImage && !bLayout )
{
- USHORT nStyle = 0;
+ sal_uInt16 nStyle = 0;
Size aImgSz = maImage.GetSizePixel();
Point aPtImg( nBorder, ( ( aOutSz.Height() - aImgSz.Height() ) / 2 ) );
@@ -2925,7 +2962,7 @@ void ImplWin::DrawEntry( BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImageP
if( bDrawText && maString.Len() )
{
- USHORT nTextStyle = TEXT_DRAW_VCENTER;
+ sal_uInt16 nTextStyle = TEXT_DRAW_VCENTER;
if ( bDrawImage && bImage && !bLayout )
nTextStyle |= TEXT_DRAW_LEFT;
@@ -3004,7 +3041,7 @@ void ImplWin::LoseFocus()
ImplBtn::ImplBtn( Window* pParent, WinBits nWinStyle ) :
PushButton( pParent, nWinStyle ),
- mbDown ( FALSE )
+ mbDown ( sal_False )
{
}
@@ -3024,7 +3061,7 @@ void ImplBtn::MouseButtonDown( const MouseEvent& )
if( IsEnabled() )
{
MBDown();
- mbDown = TRUE;
+ mbDown = sal_True;
}
}
@@ -3035,7 +3072,7 @@ ImplListBoxFloatingWindow::ImplListBoxFloatingWindow( Window* pParent ) :
{
mpImplLB = NULL;
mnDDLineCount = 0;
- mbAutoWidth = FALSE;
+ mbAutoWidth = sal_False;
mnPopupModeStartSaveSelection = LISTBOX_ENTRY_NOTFOUND;
@@ -3060,7 +3097,7 @@ long ImplListBoxFloatingWindow::PreNotify( NotifyEvent& rNEvt )
{
if( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
- if( !GetParent()->HasChildPathFocus( TRUE ) )
+ if( !GetParent()->HasChildPathFocus( sal_True ) )
EndPopupMode();
}
@@ -3069,7 +3106,7 @@ long ImplListBoxFloatingWindow::PreNotify( NotifyEvent& rNEvt )
// -----------------------------------------------------------------------
-void ImplListBoxFloatingWindow::SetPosSizePixel( long nX, long nY, long nWidth, long nHeight, USHORT nFlags )
+void ImplListBoxFloatingWindow::SetPosSizePixel( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags )
{
FloatingWindow::SetPosSizePixel( nX, nY, nWidth, nHeight, nFlags );
@@ -3086,7 +3123,7 @@ void ImplListBoxFloatingWindow::SetPosSizePixel( long nX, long nY, long nWidth,
if ( nFlags & WINDOW_POSSIZE_Y )
aPos.Y() = nY;
- USHORT nIndex;
+ sal_uInt16 nIndex;
SetPosPixel( ImplCalcPos( this, Rectangle( aPos, GetParent()->GetSizePixel() ), FLOATWIN_POPUPMODE_DOWN, nIndex ) );
}
@@ -3121,7 +3158,7 @@ Size ImplListBoxFloatingWindow::CalcFloatSize()
sal_Int32 nLeft, nTop, nRight, nBottom;
GetBorder( nLeft, nTop, nRight, nBottom );
- USHORT nLines = mpImplLB->GetEntryList()->GetEntryCount();
+ sal_uInt16 nLines = mpImplLB->GetEntryList()->GetEntryCount();
if ( mnDDLineCount && ( nLines > mnDDLineCount ) )
nLines = mnDDLineCount;
@@ -3187,7 +3224,7 @@ Size ImplListBoxFloatingWindow::CalcFloatSize()
// -----------------------------------------------------------------------
-void ImplListBoxFloatingWindow::StartFloat( BOOL bStartTracking )
+void ImplListBoxFloatingWindow::StartFloat( sal_Bool bStartTracking )
{
if( !IsInPopupMode() )
{
@@ -3196,7 +3233,7 @@ void ImplListBoxFloatingWindow::StartFloat( BOOL bStartTracking )
SetSizePixel( aFloatSz );
mpImplLB->SetSizePixel( GetOutputSizePixel() );
- USHORT nPos = mpImplLB->GetEntryList()->GetSelectEntryPos( 0 );
+ sal_uInt16 nPos = mpImplLB->GetEntryList()->GetSelectEntryPos( 0 );
mnPopupModeStartSaveSelection = nPos;
Size aSz = GetParent()->GetSizePixel();
@@ -3227,7 +3264,7 @@ void ImplListBoxFloatingWindow::StartFloat( BOOL bStartTracking )
mpImplLB->ShowProminentEntry( nPos );
if( bStartTracking )
- mpImplLB->GetMainWindow()->EnableMouseMoveSelect( TRUE );
+ mpImplLB->GetMainWindow()->EnableMouseMoveSelect( sal_True );
if ( mpImplLB->GetMainWindow()->IsGrabFocusAllowed() )
mpImplLB->GetMainWindow()->GrabFocus();
diff --git a/vcl/source/control/imgctrl.cxx b/vcl/source/control/imgctrl.cxx
index b59766228e43..7f304e335f54 100644
--- a/vcl/source/control/imgctrl.cxx
+++ b/vcl/source/control/imgctrl.cxx
@@ -31,6 +31,7 @@
#include <vcl/event.hxx>
#include <vcl/imgctrl.hxx>
+#include <tools/rcid.h>
#include <com/sun/star/awt/ImageScaleMode.hdl>
@@ -38,10 +39,18 @@ namespace ImageScaleMode = ::com::sun::star::awt::ImageScaleMode;
// -----------------------------------------------------------------------
-ImageControl::ImageControl( Window* pParent, WinBits nStyle ) :
- FixedImage( pParent, nStyle )
+ImageControl::ImageControl( Window* pParent, WinBits nStyle )
+ :FixedImage( pParent, nStyle )
+ ,mnScaleMode( ImageScaleMode::Anisotropic )
+{
+}
+
+// -----------------------------------------------------------------------
+
+ImageControl::ImageControl( Window* pParent, const ResId& rResId )
+ :FixedImage( pParent, rResId )
+ ,mnScaleMode( ImageScaleMode::Anisotropic )
{
- mnScaleMode = ImageScaleMode::Anisotropic;
}
// -----------------------------------------------------------------------
@@ -87,137 +96,81 @@ namespace
// -----------------------------------------------------------------------
-void ImageControl::UserDraw( const UserDrawEvent& rUDEvt )
+void ImageControl::ImplDraw( OutputDevice& rDev, sal_uLong nDrawFlags, const Point& rPos, const Size& rSize ) const
{
- USHORT nStyle = 0;
- BitmapEx* pBitmap = &maBmp;
- if ( !*pBitmap )
+ sal_uInt16 nStyle = 0;
+ if ( !(nDrawFlags & WINDOW_DRAW_NODISABLE) )
+ {
+ if ( !IsEnabled() )
+ nStyle |= IMAGE_DRAW_DISABLE;
+ }
+
+ const Image& rImage( GetModeImage() );
+ const Image* pImage = &rImage;
+ const Rectangle aDrawRect( rPos, rSize );
+ if ( !*pImage )
{
String sText( GetText() );
if ( !sText.Len() )
return;
WinBits nWinStyle = GetStyle();
- USHORT nTextStyle = FixedText::ImplGetTextStyle( nWinStyle );
- if ( !IsEnabled() )
- nTextStyle |= TEXT_DRAW_DISABLE;
+ sal_uInt16 nTextStyle = FixedText::ImplGetTextStyle( nWinStyle );
+ if ( !(nDrawFlags & WINDOW_DRAW_NODISABLE) )
+ if ( !IsEnabled() )
+ nTextStyle |= TEXT_DRAW_DISABLE;
- DrawText( rUDEvt.GetRect(), sText, nTextStyle );
+ rDev.DrawText( aDrawRect, sText, nTextStyle );
return;
}
- const Rectangle& rPaintRect = rUDEvt.GetRect();
- const Size& rBitmapSize = maBmp.GetSizePixel();
+ const Size& rBitmapSize = pImage->GetSizePixel();
- if( nStyle & IMAGE_DRAW_COLORTRANSFORM )
+ switch ( mnScaleMode )
{
- // only images support IMAGE_DRAW_COLORTRANSFORM
- Image aImage( *pBitmap );
- if ( !!aImage )
- {
- switch ( mnScaleMode )
- {
- case ImageScaleMode::None:
- {
- rUDEvt.GetDevice()->DrawImage(
- lcl_centerWithin( rPaintRect, rBitmapSize ), aImage, nStyle );
- }
- break;
-
- case ImageScaleMode::Isotropic:
- {
- const Size aPaintSize = lcl_calcPaintSize( rPaintRect, rBitmapSize );
- rUDEvt.GetDevice()->DrawImage(
- lcl_centerWithin( rPaintRect, aPaintSize ),
- aPaintSize,
- aImage, nStyle );
- }
- break;
-
- case ImageScaleMode::Anisotropic:
- {
- rUDEvt.GetDevice()->DrawImage(
- rPaintRect.TopLeft(),
- rPaintRect.GetSize(),
- aImage, nStyle );
- }
- break;
-
- default:
- OSL_FAIL( "ImageControl::UserDraw: unhandled scale mode!" );
- break;
-
- } // switch ( mnScaleMode )
- }
- }
- else
+ case ImageScaleMode::None:
{
- switch ( mnScaleMode )
- {
- case ImageScaleMode::None:
- {
- pBitmap->Draw( rUDEvt.GetDevice(), lcl_centerWithin( rPaintRect, rBitmapSize ) );
- }
- break;
-
- case ImageScaleMode::Isotropic:
- {
- const Size aPaintSize = lcl_calcPaintSize( rPaintRect, rBitmapSize );
- pBitmap->Draw( rUDEvt.GetDevice(),
- lcl_centerWithin( rPaintRect, aPaintSize ),
- aPaintSize );
- }
- break;
-
- case ImageScaleMode::Anisotropic:
- {
- pBitmap->Draw( rUDEvt.GetDevice(),
- rPaintRect.TopLeft(),
- rPaintRect.GetSize() );
- }
- break;
-
- default:
- OSL_FAIL( "ImageControl::UserDraw: unhandled scale mode!" );
- break;
-
- } // switch ( mnScaleMode )
+ rDev.DrawImage( lcl_centerWithin( aDrawRect, rBitmapSize ), *pImage, nStyle );
}
-}
+ break;
-// -----------------------------------------------------------------------
+ case ImageScaleMode::Isotropic:
+ {
+ const Size aPaintSize = lcl_calcPaintSize( aDrawRect, rBitmapSize );
+ rDev.DrawImage(
+ lcl_centerWithin( aDrawRect, aPaintSize ),
+ aPaintSize,
+ *pImage, nStyle );
+ }
+ break;
-void ImageControl::SetBitmap( const BitmapEx& rBmp )
-{
- maBmp = rBmp;
- StateChanged( STATE_CHANGE_DATA );
-}
+ case ImageScaleMode::Anisotropic:
+ {
+ rDev.DrawImage(
+ aDrawRect.TopLeft(),
+ aDrawRect.GetSize(),
+ *pImage, nStyle );
+ }
+ break;
-// -----------------------------------------------------------------------
+ default:
+ OSL_ENSURE( false, "ImageControl::ImplDraw: unhandled scale mode!" );
+ break;
-BOOL ImageControl::SetModeBitmap( const BitmapEx& rBitmap )
-{
- SetBitmap( rBitmap );
- return TRUE;
+ } // switch ( mnScaleMode )
}
// -----------------------------------------------------------------------
-const BitmapEx& ImageControl::GetModeBitmap( ) const
+void ImageControl::Paint( const Rectangle& /*rRect*/ )
{
- return maBmp;
-}
-
-// -----------------------------------------------------------------------
+ ImplDraw( *this, 0, Point(), GetOutputSizePixel() );
-void ImageControl::Paint( const Rectangle& rRect )
-{
- FixedImage::Paint( rRect );
if( HasFocus() )
{
Window *pWin = GetWindow( WINDOW_BORDER );
- BOOL bFlat = (GetBorderStyle() == 2);
+ sal_Bool bFlat = (GetBorderStyle() == 2);
Rectangle aRect( Point(0,0), pWin->GetOutputSizePixel() );
Color oldLineCol = pWin->GetLineColor();
Color oldFillCol = pWin->GetFillColor();
@@ -236,6 +189,27 @@ void ImageControl::Paint( const Rectangle& rRect )
}
// -----------------------------------------------------------------------
+void ImageControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
+{
+ const Point aPos = pDev->LogicToPixel( rPos );
+ const Size aSize = pDev->LogicToPixel( rSize );
+ Rectangle aRect( aPos, aSize );
+
+ pDev->Push();
+ pDev->SetMapMode();
+
+ // Border
+ if ( !(nFlags & WINDOW_DRAW_NOBORDER) && (GetStyle() & WB_BORDER) )
+ {
+ ImplDrawFrame( pDev, aRect );
+ }
+ pDev->IntersectClipRegion( aRect );
+ ImplDraw( *pDev, nFlags, aRect.TopLeft(), aRect.GetSize() );
+
+ pDev->Pop();
+}
+
+// -----------------------------------------------------------------------
void ImageControl::GetFocus()
{
diff --git a/vcl/source/control/longcurr.cxx b/vcl/source/control/longcurr.cxx
index e072b406faae..e2d502026203 100644
--- a/vcl/source/control/longcurr.cxx
+++ b/vcl/source/control/longcurr.cxx
@@ -52,9 +52,9 @@
// =======================================================================
-static BigInt ImplPower10( USHORT n )
+static BigInt ImplPower10( sal_uInt16 n )
{
- USHORT i;
+ sal_uInt16 i;
BigInt nValue = 1;
for ( i=0; i < n; i++ )
@@ -65,7 +65,7 @@ static BigInt ImplPower10( USHORT n )
// -----------------------------------------------------------------------
-static XubString ImplGetCurr( const LocaleDataWrapper& rLocaleDataWrapper, const BigInt &rNumber, USHORT nDigits, const String& rCurrSymbol, BOOL bShowThousandSep )
+static XubString ImplGetCurr( const LocaleDataWrapper& rLocaleDataWrapper, const BigInt &rNumber, sal_uInt16 nDigits, const String& rCurrSymbol, sal_Bool bShowThousandSep )
{
DBG_ASSERT( nDigits < 10, "LongCurrency duerfen nur maximal 9 Nachkommastellen haben" );
@@ -113,16 +113,16 @@ static XubString ImplGetCurr( const LocaleDataWrapper& rLocaleDataWrapper, const
// -----------------------------------------------------------------------
-static BOOL ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt,
- BOOL bStrictFormat, BOOL bThousandSep,
+static sal_Bool ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt,
+ sal_Bool bStrictFormat, sal_Bool bThousandSep,
const LocaleDataWrapper& rLocaleDataWrapper )
{
if ( !bStrictFormat )
- return FALSE;
+ return sal_False;
else
{
sal_Unicode cChar = rKEvt.GetCharCode();
- USHORT nGroup = rKEvt.GetKeyCode().GetGroup();
+ sal_uInt16 nGroup = rKEvt.GetKeyCode().GetGroup();
if ( (nGroup == KEYGROUP_FKEYS) || (nGroup == KEYGROUP_CURSOR) ||
(nGroup == KEYGROUP_MISC) ||
@@ -130,28 +130,28 @@ static BOOL ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt,
(bThousandSep && (cChar == rLocaleDataWrapper.getNumThousandSep())) ||
(cChar == rLocaleDataWrapper.getNumDecimalSep() ) ||
(cChar == '-') )
- return FALSE;
+ return sal_False;
else
- return TRUE;
+ return sal_True;
}
}
// -----------------------------------------------------------------------
-static BOOL ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
- USHORT nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper,
- BOOL bCurrency = FALSE )
+static sal_Bool ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
+ sal_uInt16 nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper,
+ sal_Bool bCurrency = sal_False )
{
XubString aStr = rStr;
XubString aStr1;
XubString aStr2;
- USHORT nDecPos;
- BOOL bNegative = FALSE;
+ sal_uInt16 nDecPos;
+ sal_Bool bNegative = sal_False;
xub_StrLen i;
// Reaktion auf leeren String
if ( !rStr.Len() )
- return FALSE;
+ return sal_False;
// Fuehrende und nachfolgende Leerzeichen entfernen
aStr.EraseLeadingAndTrailingChars( ' ' );
@@ -171,7 +171,7 @@ static BOOL ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
if ( bCurrency )
{
if ( (aStr.GetChar( 0 ) == '(') && (aStr.GetChar( aStr.Len()-1 ) == ')') )
- bNegative = TRUE;
+ bNegative = sal_True;
if ( !bNegative )
{
for ( i=0; i < aStr.Len(); i++ )
@@ -180,24 +180,24 @@ static BOOL ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
break;
else if ( aStr.GetChar( i ) == '-' )
{
- bNegative = TRUE;
+ bNegative = sal_True;
break;
}
}
}
if ( !bNegative && bCurrency && aStr.Len() )
{
- USHORT nFormat = rLocaleDataWrapper.getCurrNegativeFormat();
+ sal_uInt16 nFormat = rLocaleDataWrapper.getCurrNegativeFormat();
if ( (nFormat == 3) || (nFormat == 6) ||
(nFormat == 7) || (nFormat == 10) )
{
- for ( i = (USHORT)(aStr.Len()-1); i > 0; i++ )
+ for ( i = (sal_uInt16)(aStr.Len()-1); i > 0; i++ )
{
if ( (aStr.GetChar( i ) >= '0') && (aStr.GetChar( i ) <= '9') )
break;
else if ( aStr.GetChar( i ) == '-' )
{
- bNegative = TRUE;
+ bNegative = sal_True;
break;
}
}
@@ -207,7 +207,7 @@ static BOOL ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
else
{
if ( aStr1.GetChar( 0 ) == '-' )
- bNegative = TRUE;
+ bNegative = sal_True;
}
// Alle unerwuenschten Zeichen rauswerfen
@@ -227,7 +227,7 @@ static BOOL ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
}
if ( !aStr1.Len() && !aStr2.Len() )
- return FALSE;
+ return sal_False;
if ( !aStr1.Len() )
aStr1.Insert( '0' );
@@ -235,11 +235,11 @@ static BOOL ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
aStr1.Insert( '-', 0 );
// Nachkommateil zurechtstutzen und dabei runden
- BOOL bRound = FALSE;
+ sal_Bool bRound = sal_False;
if ( aStr2.Len() > nDecDigits )
{
if ( aStr2.GetChar( nDecDigits ) >= '5' )
- bRound = TRUE;
+ bRound = sal_True;
aStr2.Erase( nDecDigits );
}
if ( aStr2.Len() < nDecDigits )
@@ -260,38 +260,38 @@ static BOOL ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
rValue = nValue;
- return TRUE;
+ return sal_True;
}
// =======================================================================
-static BOOL ImplLongCurrencyProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
- BOOL, BOOL bUseThousandSep, const LocaleDataWrapper& rLocaleDataWrapper )
+static sal_Bool ImplLongCurrencyProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
+ sal_Bool, sal_Bool bUseThousandSep, const LocaleDataWrapper& rLocaleDataWrapper )
{
// Es gibt hier kein sinnvolles StrictFormat, also alle
// Zeichen erlauben
- return ImplNumericProcessKeyInput( pEdit, rKEvt, FALSE, bUseThousandSep, rLocaleDataWrapper );
+ return ImplNumericProcessKeyInput( pEdit, rKEvt, sal_False, bUseThousandSep, rLocaleDataWrapper );
}
// -----------------------------------------------------------------------
-inline BOOL ImplLongCurrencyGetValue( const XubString& rStr, BigInt& rValue,
- USHORT nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper )
+inline sal_Bool ImplLongCurrencyGetValue( const XubString& rStr, BigInt& rValue,
+ sal_uInt16 nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper )
{
// Zahlenwert holen
- return ImplNumericGetValue( rStr, rValue, nDecDigits, rLocaleDataWrapper, TRUE );
+ return ImplNumericGetValue( rStr, rValue, nDecDigits, rLocaleDataWrapper, sal_True );
}
// -----------------------------------------------------------------------
-BOOL ImplLongCurrencyReformat( const XubString& rStr, BigInt nMin, BigInt nMax,
- USHORT nDecDigits,
+sal_Bool ImplLongCurrencyReformat( const XubString& rStr, BigInt nMin, BigInt nMax,
+ sal_uInt16 nDecDigits,
const LocaleDataWrapper& rLocaleDataWrapper, String& rOutStr,
LongCurrencyFormatter& rFormatter )
{
BigInt nValue;
- if ( !ImplNumericGetValue( rStr, nValue, nDecDigits, rLocaleDataWrapper, TRUE ) )
- return TRUE;
+ if ( !ImplNumericGetValue( rStr, nValue, nDecDigits, rLocaleDataWrapper, sal_True ) )
+ return sal_True;
else
{
BigInt nTempVal = nValue;
@@ -306,7 +306,7 @@ BOOL ImplLongCurrencyReformat( const XubString& rStr, BigInt nMin, BigInt nMax,
if ( !rFormatter.GetErrorHdl().Call( &rFormatter ) )
{
rFormatter.mnCorrectedValue = 0;
- return FALSE;
+ return sal_False;
}
else
{
@@ -315,7 +315,7 @@ BOOL ImplLongCurrencyReformat( const XubString& rStr, BigInt nMin, BigInt nMax,
}
rOutStr = ImplGetCurr( rLocaleDataWrapper, nTempVal, nDecDigits, rFormatter.GetCurrencySymbol(), rFormatter.IsUseThousandSep() );
- return TRUE;
+ return sal_True;
}
}
@@ -332,7 +332,7 @@ void LongCurrencyFormatter::ImpInit()
mnCorrectedValue = 0;
mnDecimalDigits = 0;
mnType = FORMAT_LONGCURRENCY;
- mbThousandSep = TRUE;
+ mbThousandSep = sal_True;
SetDecimalDigits( 0 );
}
@@ -352,7 +352,7 @@ void LongCurrencyFormatter::ImplLoadRes( const ResId& rResId )
ResMgr* pMgr = rResId.GetResMgr();
if( pMgr )
{
- ULONG nMask = pMgr->ReadLong();
+ sal_uLong nMask = pMgr->ReadLong();
if ( NUMERICFORMATTER_MIN & nMask )
mnMin = pMgr->ReadLong();
@@ -361,7 +361,7 @@ void LongCurrencyFormatter::ImplLoadRes( const ResId& rResId )
mnMax = pMgr->ReadLong();
if ( NUMERICFORMATTER_STRICTFORMAT & nMask )
- SetStrictFormat( (BOOL)pMgr->ReadShort() );
+ SetStrictFormat( (sal_Bool)pMgr->ReadShort() );
if ( NUMERICFORMATTER_DECIMALDIGITS & nMask )
SetDecimalDigits( pMgr->ReadShort() );
@@ -405,7 +405,7 @@ void LongCurrencyFormatter::SetValue( BigInt nNewValue )
{
SetUserValue( nNewValue );
mnFieldValue = mnLastValue;
- SetEmptyFieldValueData( FALSE );
+ SetEmptyFieldValueData( sal_False );
}
// -----------------------------------------------------------------------
@@ -430,7 +430,7 @@ void LongCurrencyFormatter::SetUserValue( BigInt nNewValue )
}
else
GetField()->SetText( aStr );
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
}
// -----------------------------------------------------------------------
@@ -464,7 +464,7 @@ void LongCurrencyFormatter::Reformat()
return;
XubString aStr;
- BOOL bOK = ImplLongCurrencyReformat( GetField()->GetText(), mnMin, mnMax,
+ sal_Bool bOK = ImplLongCurrencyReformat( GetField()->GetText(), mnMin, mnMax,
GetDecimalDigits(), GetLocaleDataWrapper(), aStr, *this );
if ( !bOK )
return;
@@ -472,7 +472,7 @@ void LongCurrencyFormatter::Reformat()
if ( aStr.Len() )
{
GetField()->SetText( aStr );
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
ImplLongCurrencyGetValue( aStr, mnLastValue, GetDecimalDigits(), GetLocaleDataWrapper() );
}
else
@@ -504,7 +504,7 @@ void LongCurrencyFormatter::SetMax( BigInt nNewMax )
// -----------------------------------------------------------------------
-void LongCurrencyFormatter::SetUseThousandSep( BOOL b )
+void LongCurrencyFormatter::SetUseThousandSep( sal_Bool b )
{
mbThousandSep = b;
ReformatAll();
@@ -513,7 +513,7 @@ void LongCurrencyFormatter::SetUseThousandSep( BOOL b )
// -----------------------------------------------------------------------
-void LongCurrencyFormatter::SetDecimalDigits( USHORT nDigits )
+void LongCurrencyFormatter::SetDecimalDigits( sal_uInt16 nDigits )
{
// DBG_ASSERT( nDigits < 10, "LongCurrency duerfen nur maximal 9 Nachkommastellen haben" );
@@ -526,21 +526,21 @@ void LongCurrencyFormatter::SetDecimalDigits( USHORT nDigits )
// -----------------------------------------------------------------------
-USHORT LongCurrencyFormatter::GetDecimalDigits() const
+sal_uInt16 LongCurrencyFormatter::GetDecimalDigits() const
{
return mnDecimalDigits;
}
// -----------------------------------------------------------------------
-BOOL LongCurrencyFormatter::IsValueModified() const
+sal_Bool LongCurrencyFormatter::IsValueModified() const
{
if ( ImplGetEmptyFieldValue() )
return !IsEmptyValue();
else if ( GetValue() != mnFieldValue )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -548,7 +548,7 @@ BOOL LongCurrencyFormatter::IsValueModified() const
void LongCurrencyFormatter::SetEmptyValue()
{
GetField()->SetText( ImplGetSVEmptyStr() );
- SetEmptyFieldValueData( TRUE );
+ SetEmptyFieldValueData( sal_True );
}
// -----------------------------------------------------------------------
@@ -577,7 +577,7 @@ void ImplNewLongCurrencyFieldValue( LongCurrencyField* pField, BigInt nNewValue
Selection aSelect = pField->GetSelection();
aSelect.Justify();
XubString aText = pField->GetText();
- BOOL bLastSelected = ((xub_StrLen)aSelect.Max() == aText.Len()) ? TRUE : FALSE;
+ sal_Bool bLastSelected = ((xub_StrLen)aSelect.Max() == aText.Len()) ? sal_True : sal_False;
BigInt nOldLastValue = pField->mnLastValue;
pField->SetUserValue( nNewValue );
@@ -634,7 +634,7 @@ void LongCurrencyField::ImplLoadRes( const ResId& rResId )
SpinField::ImplLoadRes( rResId );
LongCurrencyFormatter::ImplLoadRes( ResId( (RSHEADER_TYPE *)GetClassRes(), *rResId.GetResMgr() ) );
- ULONG nMask = ReadLongRes();
+ sal_uLong nMask = ReadLongRes();
if ( CURRENCYFIELD_FIRST & nMask )
mnFirst = ReadLongRes();
@@ -669,7 +669,7 @@ long LongCurrencyField::Notify( NotifyEvent& rNEvt )
{
if( rNEvt.GetType() == EVENT_GETFOCUS )
{
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
}
else if( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
@@ -686,7 +686,7 @@ long LongCurrencyField::Notify( NotifyEvent& rNEvt )
void LongCurrencyField::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
SpinField::Modify();
}
@@ -781,7 +781,7 @@ long LongCurrencyBox::Notify( NotifyEvent& rNEvt )
{
if( rNEvt.GetType() == EVENT_GETFOCUS )
{
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
}
else if( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
@@ -798,7 +798,7 @@ long LongCurrencyBox::Notify( NotifyEvent& rNEvt )
void LongCurrencyBox::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
ComboBox::Modify();
}
@@ -807,9 +807,9 @@ void LongCurrencyBox::Modify()
void LongCurrencyBox::ReformatAll()
{
XubString aStr;
- SetUpdateMode( FALSE );
- USHORT nEntryCount = GetEntryCount();
- for ( USHORT i=0; i < nEntryCount; i++ )
+ SetUpdateMode( sal_False );
+ sal_uInt16 nEntryCount = GetEntryCount();
+ for ( sal_uInt16 i=0; i < nEntryCount; i++ )
{
ImplLongCurrencyReformat( GetEntry( i ), mnMin, mnMax,
GetDecimalDigits(), GetLocaleDataWrapper(),
@@ -818,12 +818,12 @@ void LongCurrencyBox::ReformatAll()
InsertEntry( aStr, i );
}
LongCurrencyFormatter::Reformat();
- SetUpdateMode( TRUE );
+ SetUpdateMode( sal_True );
}
// -----------------------------------------------------------------------
-void LongCurrencyBox::InsertValue( BigInt nValue, USHORT nPos )
+void LongCurrencyBox::InsertValue( BigInt nValue, sal_uInt16 nPos )
{
XubString aStr = ImplGetCurr( GetLocaleDataWrapper(), nValue, GetDecimalDigits(), GetCurrencySymbol(), IsUseThousandSep() );
ComboBox::InsertEntry( aStr, nPos );
@@ -839,7 +839,7 @@ void LongCurrencyBox::RemoveValue( BigInt nValue )
// -----------------------------------------------------------------------
-BigInt LongCurrencyBox::GetValue( USHORT nPos ) const
+BigInt LongCurrencyBox::GetValue( sal_uInt16 nPos ) const
{
BigInt nValue = 0;
ImplLongCurrencyGetValue( ComboBox::GetEntry( nPos ), nValue,
@@ -849,7 +849,7 @@ BigInt LongCurrencyBox::GetValue( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT LongCurrencyBox::GetValuePos( BigInt nValue ) const
+sal_uInt16 LongCurrencyBox::GetValuePos( BigInt nValue ) const
{
XubString aStr = ImplGetCurr( GetLocaleDataWrapper(), nValue, GetDecimalDigits(), GetCurrencySymbol(), IsUseThousandSep() );
return ComboBox::GetEntryPos( aStr );
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index 3ae3c47c0428..88b583a3240d 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -105,7 +105,7 @@ void ListBox::ImplInitListBoxData()
mpBtn = NULL;
mnDDHeight = 0;
- mbDDAutoSize = TRUE;
+ mbDDAutoSize = sal_True;
mnSaveValue = LISTBOX_ENTRY_NOTFOUND;
mnLineCount = 0;
}
@@ -127,7 +127,7 @@ void ListBox::ImplInit( Window* pParent, WinBits nStyle )
{
sal_Int32 nLeft, nTop, nRight, nBottom;
GetBorder( nLeft, nTop, nRight, nBottom );
- mnDDHeight = (USHORT)(GetTextHeight() + nTop + nBottom + 4);
+ mnDDHeight = (sal_uInt16)(GetTextHeight() + nTop + nBottom + 4);
if( IsNativeWidgetEnabled() &&
IsNativeControlSupported( CTRL_LISTBOX, PART_ENTIRE_CONTROL ) )
@@ -142,12 +142,12 @@ void ListBox::ImplInit( Window* pParent, WinBits nStyle )
{
sal_Int32 nHeight = aBoundingRgn.GetHeight();
if( nHeight > mnDDHeight )
- mnDDHeight = static_cast<USHORT>(nHeight);
+ mnDDHeight = static_cast<sal_uInt16>(nHeight);
}
}
mpFloatWin = new ImplListBoxFloatingWindow( this );
- mpFloatWin->SetAutoWidth( TRUE );
+ mpFloatWin->SetAutoWidth( sal_True );
mpFloatWin->SetPopupModeEndHdl( LINK( this, ListBox, ImplPopupModeEndHdl ) );
mpFloatWin->GetDropTarget()->addDropTargetListener(xDrop);
@@ -186,9 +186,9 @@ void ListBox::ImplInit( Window* pParent, WinBits nStyle )
mpImplLB->SetSelectionChangedHdl( LINK( this, ListBox, ImplSelectionChangedHdl ) );
}
else
- mpImplLB->GetMainWindow()->AllowGrabFocus( TRUE );
+ mpImplLB->GetMainWindow()->AllowGrabFocus( sal_True );
- SetCompoundControl( TRUE );
+ SetCompoundControl( sal_True );
}
// -----------------------------------------------------------------------
@@ -208,12 +208,12 @@ void ListBox::ImplLoadRes( const ResId& rResId )
{
Control::ImplLoadRes( rResId );
- USHORT nSelPos = ReadShortRes();
- USHORT nNumber = sal::static_int_cast<USHORT>(ReadLongRes());
+ sal_uInt16 nSelPos = ReadShortRes();
+ sal_uInt16 nNumber = sal::static_int_cast<sal_uInt16>(ReadLongRes());
- for( USHORT i = 0; i < nNumber; i++ )
+ for( sal_uInt16 i = 0; i < nNumber; i++ )
{
- USHORT nPos = InsertEntry( ReadStringRes(), LISTBOX_APPEND );
+ sal_uInt16 nPos = InsertEntry( ReadStringRes(), LISTBOX_APPEND );
long nId = ReadLongRes();
if( nId )
@@ -228,7 +228,7 @@ void ListBox::ImplLoadRes( const ResId& rResId )
IMPL_LINK( ListBox, ImplSelectHdl, void*, EMPTYARG )
{
- BOOL bPopup = IsInDropDown();
+ sal_Bool bPopup = IsInDropDown();
if( IsDropDownBox() )
{
if( !mpImplLB->IsTravelSelect() )
@@ -277,7 +277,7 @@ IMPL_LINK( ListBox, ImplSelectionChangedHdl, void*, n )
{
if ( !mpImplLB->IsTrackingSelect() )
{
- USHORT nChanged = (USHORT)(ULONG)n;
+ sal_uInt16 nChanged = (sal_uInt16)(sal_uLong)n;
const ImplEntryList* pEntryList = mpImplLB->GetEntryList();
if ( pEntryList->IsEntryPosSelected( nChanged ) )
{
@@ -313,8 +313,8 @@ IMPL_LINK( ListBox, ImplClickBtnHdl, void*, EMPTYARG )
{
ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN );
mpImplWin->GrabFocus();
- mpBtn->SetPressed( TRUE );
- mpFloatWin->StartFloat( TRUE );
+ mpBtn->SetPressed( sal_True );
+ mpFloatWin->StartFloat( sal_True );
ImplCallEventListeners( VCLEVENT_DROPDOWN_OPEN );
ImplClearLayoutData();
@@ -336,9 +336,9 @@ IMPL_LINK( ListBox, ImplPopupModeEndHdl, void*, EMPTYARG )
if ( ( mpFloatWin->GetPopupModeStartSaveSelection() != LISTBOX_ENTRY_NOTFOUND )
&& !IsEntryPosSelected( mpFloatWin->GetPopupModeStartSaveSelection() ) )
{
- mpImplLB->SelectEntry( mpFloatWin->GetPopupModeStartSaveSelection(), TRUE );
- BOOL bTravelSelect = mpImplLB->IsTravelSelect();
- mpImplLB->SetTravelSelect( TRUE );
+ mpImplLB->SelectEntry( mpFloatWin->GetPopupModeStartSaveSelection(), sal_True );
+ sal_Bool bTravelSelect = mpImplLB->IsTravelSelect();
+ mpImplLB->SetTravelSelect( sal_True );
ImplDelData aCheckDelete;
ImplAddDel( &aCheckDelete );
@@ -357,7 +357,7 @@ IMPL_LINK( ListBox, ImplPopupModeEndHdl, void*, EMPTYARG )
if( mpImplWin )
mpImplWin->ImplClearLayoutData();
- mpBtn->SetPressed( FALSE );
+ mpBtn->SetPressed( sal_False );
ImplCallEventListeners( VCLEVENT_DROPDOWN_CLOSE );
return 0;
}
@@ -374,8 +374,8 @@ void ListBox::ToggleDropDown()
{
ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN );
mpImplWin->GrabFocus();
- mpBtn->SetPressed( TRUE );
- mpFloatWin->StartFloat( TRUE );
+ mpBtn->SetPressed( sal_True );
+ mpFloatWin->StartFloat( sal_True );
ImplCallEventListeners( VCLEVENT_DROPDOWN_OPEN );
}
}
@@ -383,9 +383,9 @@ void ListBox::ToggleDropDown()
// -----------------------------------------------------------------------
-void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
- mpImplLB->GetMainWindow()->ImplInitSettings( TRUE, TRUE, TRUE );
+ mpImplLB->GetMainWindow()->ImplInitSettings( sal_True, sal_True, sal_True );
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -400,8 +400,8 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, UL
// 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 );
@@ -435,7 +435,7 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, UL
}
long nOnePixel = GetDrawPixel( pDev, 1 );
- USHORT nTextStyle = TEXT_DRAW_VCENTER;
+ sal_uInt16 nTextStyle = TEXT_DRAW_VCENTER;
Rectangle aTextRect( aPos, aSize );
if ( GetStyle() & WB_CENTER )
@@ -472,7 +472,7 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, UL
else
{
long nTextHeight = pDev->GetTextHeight();
- USHORT nLines = (USHORT)(aSize.Height() / nTextHeight);
+ sal_uInt16 nLines = (sal_uInt16)(aSize.Height() / nTextHeight);
Rectangle aClip( aPos, aSize );
pDev->IntersectClipRegion( aClip );
@@ -480,10 +480,10 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, UL
if ( !nLines )
nLines = 1;
- for ( USHORT n = 0; n < nLines; n++ )
+ for ( sal_uInt16 n = 0; n < nLines; n++ )
{
- USHORT nEntry = n+mpImplLB->GetTopEntry();
- BOOL bSelected = mpImplLB->GetEntryList()->IsEntryPosSelected( nEntry );
+ sal_uInt16 nEntry = n+mpImplLB->GetTopEntry();
+ sal_Bool bSelected = mpImplLB->GetEntryList()->IsEntryPosSelected( nEntry );
if ( bSelected )
{
pDev->SetFillColor( COL_BLACK );
@@ -567,7 +567,7 @@ void ListBox::DataChanged( const DataChangedEvent& rDCEvt )
if ( mpImplWin )
{
mpImplWin->SetSettings( GetSettings() ); // Falls noch nicht eingestellt...
- ImplInitFieldSettings( mpImplWin, TRUE, TRUE, TRUE );
+ ImplInitFieldSettings( mpImplWin, sal_True, sal_True, sal_True );
mpBtn->SetSettings( GetSettings() );
ImplInitDropDownButton( mpBtn );
@@ -581,7 +581,7 @@ void ListBox::DataChanged( const DataChangedEvent& rDCEvt )
// -----------------------------------------------------------------------
-void ListBox::EnableAutoSize( BOOL bAuto )
+void ListBox::EnableAutoSize( sal_Bool bAuto )
{
mbDDAutoSize = bAuto;
if ( mpFloatWin )
@@ -595,7 +595,7 @@ void ListBox::EnableAutoSize( BOOL bAuto )
// -----------------------------------------------------------------------
-void ListBox::EnableDDAutoWidth( BOOL b )
+void ListBox::EnableDDAutoWidth( sal_Bool b )
{
if ( mpFloatWin )
mpFloatWin->SetAutoWidth( b );
@@ -603,14 +603,14 @@ void ListBox::EnableDDAutoWidth( BOOL b )
// -----------------------------------------------------------------------
-BOOL ListBox::IsDDAutoWidthEnabled() const
+sal_Bool ListBox::IsDDAutoWidthEnabled() const
{
- return mpFloatWin ? mpFloatWin->IsAutoWidth() : FALSE;
+ return mpFloatWin ? mpFloatWin->IsAutoWidth() : sal_False;
}
// -----------------------------------------------------------------------
-void ListBox::SetDropDownLineCount( USHORT nLines )
+void ListBox::SetDropDownLineCount( sal_uInt16 nLines )
{
mnLineCount = nLines;
if ( mpFloatWin )
@@ -619,7 +619,7 @@ void ListBox::SetDropDownLineCount( USHORT nLines )
// -----------------------------------------------------------------------
-USHORT ListBox::GetDropDownLineCount() const
+sal_uInt16 ListBox::GetDropDownLineCount() const
{
if ( mpFloatWin )
return mpFloatWin->GetDropDownLineCount();
@@ -628,7 +628,7 @@ USHORT ListBox::GetDropDownLineCount() const
// -----------------------------------------------------------------------
-void ListBox::SetPosSizePixel( long nX, long nY, long nWidth, long nHeight, USHORT nFlags )
+void ListBox::SetPosSizePixel( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags )
{
if( IsDropDownBox() && ( nFlags & WINDOW_POSSIZE_SIZE ) )
{
@@ -748,7 +748,7 @@ void ListBox::FillLayoutData() const
// -----------------------------------------------------------------------
-long ListBox::GetIndexForPoint( const Point& rPoint, USHORT& rPos ) const
+long ListBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rPos ) const
{
if( !HasLayoutData() )
FillLayoutData();
@@ -768,7 +768,7 @@ long ListBox::GetIndexForPoint( const Point& rPoint, USHORT& rPos ) const
aConvPoint = pMain->PixelToLogic( aConvPoint );
// try to find entry
- USHORT nEntry = pMain->GetEntryPosForPoint( aConvPoint );
+ sal_uInt16 nEntry = pMain->GetEntryPosForPoint( aConvPoint );
if( nEntry == LISTBOX_ENTRY_NOTFOUND )
{
// not found, maybe dropdown case
@@ -893,8 +893,8 @@ void ListBox::StateChanged( StateChangedType nType )
else if ( nType == STATE_CHANGE_STYLE )
{
SetStyle( ImplInitStyle( GetStyle() ) );
- mpImplLB->GetMainWindow()->EnableSort( ( GetStyle() & WB_SORT ) ? TRUE : FALSE );
- BOOL bSimpleMode = ( GetStyle() & WB_SIMPLEMODE ) ? TRUE : FALSE;
+ mpImplLB->GetMainWindow()->EnableSort( ( GetStyle() & WB_SORT ) ? sal_True : sal_False );
+ sal_Bool bSimpleMode = ( GetStyle() & WB_SIMPLEMODE ) ? sal_True : sal_False;
mpImplLB->SetMultiSelectionSimpleMode( bSimpleMode );
}
else if( nType == STATE_CHANGE_MIRRORING )
@@ -931,8 +931,8 @@ long ListBox::PreNotify( NotifyEvent& rNEvt )
aKeyEvt.GetKeyCode().IsMod2() )
{
ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN );
- mpBtn->SetPressed( TRUE );
- mpFloatWin->StartFloat( FALSE );
+ mpBtn->SetPressed( sal_True );
+ mpFloatWin->StartFloat( sal_False );
ImplCallEventListeners( VCLEVENT_DROPDOWN_OPEN );
nDone = 1;
}
@@ -974,14 +974,14 @@ long ListBox::PreNotify( NotifyEvent& rNEvt )
}
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
- if ( IsInDropDown() && !HasChildPathFocus( TRUE ) )
+ if ( IsInDropDown() && !HasChildPathFocus( sal_True ) )
mpFloatWin->EndPopupMode();
}
else if ( (rNEvt.GetType() == EVENT_COMMAND) &&
(rNEvt.GetCommandEvent()->GetCommand() == COMMAND_WHEEL) &&
(rNEvt.GetWindow() == mpImplWin) )
{
- USHORT nWheelBehavior( GetSettings().GetMouseSettings().GetWheelBehavior() );
+ sal_uInt16 nWheelBehavior( GetSettings().GetMouseSettings().GetWheelBehavior() );
if ( ( nWheelBehavior == MOUSE_WHEEL_ALWAYS )
|| ( ( nWheelBehavior == MOUSE_WHEEL_FOCUS_ONLY )
&& HasChildPathFocus()
@@ -1047,30 +1047,30 @@ void ListBox::SetNoSelection()
// -----------------------------------------------------------------------
-USHORT ListBox::InsertEntry( const XubString& rStr, USHORT nPos )
+sal_uInt16 ListBox::InsertEntry( const XubString& rStr, sal_uInt16 nPos )
{
- USHORT nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr );
- nRealPos = sal::static_int_cast<USHORT>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
+ sal_uInt16 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr );
+ nRealPos = sal::static_int_cast<sal_uInt16>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
CallEventListeners( VCLEVENT_LISTBOX_ITEMADDED, (void*) sal_IntPtr(nRealPos) );
return nRealPos;
}
// -----------------------------------------------------------------------
-USHORT ListBox::InsertEntry( const Image& rImage, USHORT nPos )
+sal_uInt16 ListBox::InsertEntry( const Image& rImage, sal_uInt16 nPos )
{
- USHORT nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rImage );
- nRealPos = sal::static_int_cast<USHORT>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
+ sal_uInt16 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rImage );
+ nRealPos = sal::static_int_cast<sal_uInt16>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
CallEventListeners( VCLEVENT_LISTBOX_ITEMADDED, (void*) sal_IntPtr(nRealPos) );
return nRealPos;
}
// -----------------------------------------------------------------------
-USHORT ListBox::InsertEntry( const XubString& rStr, const Image& rImage, USHORT nPos )
+sal_uInt16 ListBox::InsertEntry( const XubString& rStr, const Image& rImage, sal_uInt16 nPos )
{
- USHORT nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr, rImage );
- nRealPos = sal::static_int_cast<USHORT>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
+ sal_uInt16 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr, rImage );
+ nRealPos = sal::static_int_cast<sal_uInt16>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
CallEventListeners( VCLEVENT_LISTBOX_ITEMADDED, (void*) sal_IntPtr(nRealPos) );
return nRealPos;
}
@@ -1084,7 +1084,7 @@ void ListBox::RemoveEntry( const XubString& rStr )
// -----------------------------------------------------------------------
-void ListBox::RemoveEntry( USHORT nPos )
+void ListBox::RemoveEntry( sal_uInt16 nPos )
{
mpImplLB->RemoveEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
CallEventListeners( VCLEVENT_LISTBOX_ITEMREMOVED, (void*) sal_IntPtr(nPos) );
@@ -1092,7 +1092,7 @@ void ListBox::RemoveEntry( USHORT nPos )
// -----------------------------------------------------------------------
-Image ListBox::GetEntryImage( USHORT nPos ) const
+Image ListBox::GetEntryImage( sal_uInt16 nPos ) const
{
if ( mpImplLB->GetEntryList()->HasEntryImage( nPos ) )
return mpImplLB->GetEntryList()->GetEntryImage( nPos );
@@ -1101,90 +1101,90 @@ Image ListBox::GetEntryImage( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT ListBox::GetEntryPos( const XubString& rStr ) const
+sal_uInt16 ListBox::GetEntryPos( const XubString& rStr ) const
{
- USHORT nPos = mpImplLB->GetEntryList()->FindEntry( rStr );
+ sal_uInt16 nPos = mpImplLB->GetEntryList()->FindEntry( rStr );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- nPos = sal::static_int_cast<USHORT>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
+ nPos = sal::static_int_cast<sal_uInt16>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
return nPos;
}
// -----------------------------------------------------------------------
-USHORT ListBox::GetEntryPos( const void* pData ) const
+sal_uInt16 ListBox::GetEntryPos( const void* pData ) const
{
- USHORT nPos = mpImplLB->GetEntryList()->FindEntry( pData );
+ sal_uInt16 nPos = mpImplLB->GetEntryList()->FindEntry( pData );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- nPos = sal::static_int_cast<USHORT>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
+ nPos = sal::static_int_cast<sal_uInt16>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
return nPos;
}
// -----------------------------------------------------------------------
-XubString ListBox::GetEntry( USHORT nPos ) const
+XubString ListBox::GetEntry( sal_uInt16 nPos ) const
{
return mpImplLB->GetEntryList()->GetEntryText( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-USHORT ListBox::GetEntryCount() const
+sal_uInt16 ListBox::GetEntryCount() const
{
return mpImplLB->GetEntryList()->GetEntryCount() - mpImplLB->GetEntryList()->GetMRUCount();
}
// -----------------------------------------------------------------------
-XubString ListBox::GetSelectEntry( USHORT nIndex ) const
+XubString ListBox::GetSelectEntry( sal_uInt16 nIndex ) const
{
return GetEntry( GetSelectEntryPos( nIndex ) );
}
// -----------------------------------------------------------------------
-USHORT ListBox::GetSelectEntryCount() const
+sal_uInt16 ListBox::GetSelectEntryCount() const
{
return mpImplLB->GetEntryList()->GetSelectEntryCount();
}
// -----------------------------------------------------------------------
-USHORT ListBox::GetSelectEntryPos( USHORT nIndex ) const
+sal_uInt16 ListBox::GetSelectEntryPos( sal_uInt16 nIndex ) const
{
- USHORT nPos = mpImplLB->GetEntryList()->GetSelectEntryPos( nIndex );
+ sal_uInt16 nPos = mpImplLB->GetEntryList()->GetSelectEntryPos( nIndex );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
{
if ( nPos < mpImplLB->GetEntryList()->GetMRUCount() )
nPos = mpImplLB->GetEntryList()->FindEntry( mpImplLB->GetEntryList()->GetEntryText( nPos ) );
- nPos = sal::static_int_cast<USHORT>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
+ nPos = sal::static_int_cast<sal_uInt16>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
}
return nPos;
}
// -----------------------------------------------------------------------
-BOOL ListBox::IsEntrySelected( const XubString& rStr ) const
+sal_Bool ListBox::IsEntrySelected( const XubString& rStr ) const
{
return IsEntryPosSelected( GetEntryPos( rStr ) );
}
// -----------------------------------------------------------------------
-BOOL ListBox::IsEntryPosSelected( USHORT nPos ) const
+sal_Bool ListBox::IsEntryPosSelected( sal_uInt16 nPos ) const
{
return mpImplLB->GetEntryList()->IsEntryPosSelected( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-void ListBox::SelectEntry( const XubString& rStr, BOOL bSelect )
+void ListBox::SelectEntry( const XubString& rStr, sal_Bool bSelect )
{
SelectEntryPos( GetEntryPos( rStr ), bSelect );
}
// -----------------------------------------------------------------------
-void ListBox::SelectEntryPos( USHORT nPos, BOOL bSelect )
+void ListBox::SelectEntryPos( sal_uInt16 nPos, sal_Bool bSelect )
{
if ( nPos < mpImplLB->GetEntryList()->GetEntryCount() )
mpImplLB->SelectEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), bSelect );
@@ -1192,51 +1192,51 @@ void ListBox::SelectEntryPos( USHORT nPos, BOOL bSelect )
// -----------------------------------------------------------------------
-void ListBox::SetEntryData( USHORT nPos, void* pNewData )
+void ListBox::SetEntryData( sal_uInt16 nPos, void* pNewData )
{
mpImplLB->SetEntryData( nPos + mpImplLB->GetEntryList()->GetMRUCount(), pNewData );
}
// -----------------------------------------------------------------------
-void* ListBox::GetEntryData( USHORT nPos ) const
+void* ListBox::GetEntryData( sal_uInt16 nPos ) const
{
return mpImplLB->GetEntryList()->GetEntryData( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-void ListBox::SetEntryFlags( USHORT nPos, long nFlags )
+void ListBox::SetEntryFlags( sal_uInt16 nPos, long nFlags )
{
mpImplLB->SetEntryFlags( nPos + mpImplLB->GetEntryList()->GetMRUCount(), nFlags );
}
// -----------------------------------------------------------------------
-long ListBox::GetEntryFlags( USHORT nPos ) const
+long ListBox::GetEntryFlags( sal_uInt16 nPos ) const
{
return mpImplLB->GetEntryList()->GetEntryFlags( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-void ListBox::SetTopEntry( USHORT nPos )
+void ListBox::SetTopEntry( sal_uInt16 nPos )
{
mpImplLB->SetTopEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-void ListBox::ShowProminentEntry( USHORT nPos )
+void ListBox::ShowProminentEntry( sal_uInt16 nPos )
{
mpImplLB->ShowProminentEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-USHORT ListBox::GetTopEntry() const
+sal_uInt16 ListBox::GetTopEntry() const
{
- USHORT nPos = GetEntryCount() ? mpImplLB->GetTopEntry() : LISTBOX_ENTRY_NOTFOUND;
+ sal_uInt16 nPos = GetEntryCount() ? mpImplLB->GetTopEntry() : LISTBOX_ENTRY_NOTFOUND;
if ( nPos < mpImplLB->GetEntryList()->GetMRUCount() )
nPos = 0;
return nPos;
@@ -1258,26 +1258,26 @@ ProminentEntry ListBox::GetProminentEntryType() const
// -----------------------------------------------------------------------
-BOOL ListBox::IsTravelSelect() const
+sal_Bool ListBox::IsTravelSelect() const
{
return mpImplLB->IsTravelSelect();
}
// -----------------------------------------------------------------------
-BOOL ListBox::IsInDropDown() const
+sal_Bool ListBox::IsInDropDown() const
{
return mpFloatWin && mpFloatWin->IsInPopupMode();
}
// -----------------------------------------------------------------------
-long ListBox::CalcWindowSizePixel( USHORT nLines ) const
+long ListBox::CalcWindowSizePixel( sal_uInt16 nLines ) const
{
return mpImplLB->GetEntryHeight() * nLines;
}
-Rectangle ListBox::GetBoundingRectangle( USHORT nItem ) const
+Rectangle ListBox::GetBoundingRectangle( sal_uInt16 nItem ) const
{
Rectangle aRect = mpImplLB->GetMainWindow()->GetBoundingRectangle( nItem );
Rectangle aOffset = mpImplLB->GetMainWindow()->GetWindowExtentsRelative( (Window*)this );
@@ -1287,12 +1287,12 @@ Rectangle ListBox::GetBoundingRectangle( USHORT nItem ) const
// -----------------------------------------------------------------------
-void ListBox::EnableMultiSelection( BOOL bMulti )
+void ListBox::EnableMultiSelection( sal_Bool bMulti )
{
- EnableMultiSelection( bMulti, FALSE );
+ EnableMultiSelection( bMulti, sal_False );
}
-void ListBox::EnableMultiSelection( BOOL bMulti, BOOL bStackSelection )
+void ListBox::EnableMultiSelection( sal_Bool bMulti, sal_Bool bStackSelection )
{
mpImplLB->EnableMultiSelection( bMulti, bStackSelection );
@@ -1300,7 +1300,7 @@ void ListBox::EnableMultiSelection( BOOL bMulti, BOOL bStackSelection )
// Die MultiListBox verh�lt sich wie eine normale ListBox.
// Die Mehrfachselektion kann nur �ber entsprechende Zusatztasten erfolgen.
- BOOL bSimpleMode = ( GetStyle() & WB_SIMPLEMODE ) ? TRUE : FALSE;
+ sal_Bool bSimpleMode = ( GetStyle() & WB_SIMPLEMODE ) ? sal_True : sal_False;
mpImplLB->SetMultiSelectionSimpleMode( bSimpleMode );
// ohne Focus ist das Traveln in einer MultiSelection nicht zu sehen:
@@ -1310,7 +1310,7 @@ void ListBox::EnableMultiSelection( BOOL bMulti, BOOL bStackSelection )
// -----------------------------------------------------------------------
-BOOL ListBox::IsMultiSelectionEnabled() const
+sal_Bool ListBox::IsMultiSelectionEnabled() const
{
return mpImplLB->IsMultiSelectionEnabled();
}
@@ -1407,7 +1407,7 @@ Size ListBox::CalcAdjustedSize( const Size& rPrefSize ) const
// -----------------------------------------------------------------------
-Size ListBox::CalcSize( USHORT nColumns, USHORT nLines ) const
+Size ListBox::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const
{
// ggf. werden ScrollBars eingeblendet
Size aMinSz = CalcMinimumSize();
@@ -1449,19 +1449,19 @@ Size ListBox::CalcSize( USHORT nColumns, USHORT nLines ) const
// -----------------------------------------------------------------------
-void ListBox::GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const
+void ListBox::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const
{
long nCharWidth = GetTextWidth( UniString( 'x' ) );
if ( !IsDropDownBox() )
{
Size aOutSz = mpImplLB->GetMainWindow()->GetOutputSizePixel();
- rnCols = (USHORT) (aOutSz.Width()/nCharWidth);
- rnLines = (USHORT) (aOutSz.Height()/mpImplLB->GetEntryHeight());
+ rnCols = (sal_uInt16) (aOutSz.Width()/nCharWidth);
+ rnLines = (sal_uInt16) (aOutSz.Height()/mpImplLB->GetEntryHeight());
}
else
{
Size aOutSz = mpImplWin->GetOutputSizePixel();
- rnCols = (USHORT) (aOutSz.Width()/nCharWidth);
+ rnCols = (sal_uInt16) (aOutSz.Width()/nCharWidth);
rnLines = 1;
}
}
@@ -1482,7 +1482,7 @@ void ListBox::UserDraw( const UserDrawEvent& )
// -----------------------------------------------------------------------
-void ListBox::DrawEntry( const UserDrawEvent& rEvt, BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos )
+void ListBox::DrawEntry( const UserDrawEvent& rEvt, sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos )
{
if ( rEvt.GetDevice() == mpImplLB->GetMainWindow() )
mpImplLB->GetMainWindow()->DrawEntry( rEvt.GetItemId(), bDrawImage, bDrawText, bDrawTextAtImagePos );
@@ -1508,7 +1508,7 @@ const Size& ListBox::GetUserItemSize() const
// -----------------------------------------------------------------------
-void ListBox::EnableUserDraw( BOOL bUserDraw )
+void ListBox::EnableUserDraw( sal_Bool bUserDraw )
{
mpImplLB->GetMainWindow()->EnableUserDraw( bUserDraw );
if ( mpImplWin )
@@ -1517,14 +1517,14 @@ void ListBox::EnableUserDraw( BOOL bUserDraw )
// -----------------------------------------------------------------------
-BOOL ListBox::IsUserDrawEnabled() const
+sal_Bool ListBox::IsUserDrawEnabled() const
{
return mpImplLB->GetMainWindow()->IsUserDrawEnabled();
}
// -----------------------------------------------------------------------
-void ListBox::SetReadOnly( BOOL bReadOnly )
+void ListBox::SetReadOnly( sal_Bool bReadOnly )
{
if ( mpImplLB->IsReadOnly() != bReadOnly )
{
@@ -1535,14 +1535,14 @@ void ListBox::SetReadOnly( BOOL bReadOnly )
// -----------------------------------------------------------------------
-BOOL ListBox::IsReadOnly() const
+sal_Bool ListBox::IsReadOnly() const
{
return mpImplLB->IsReadOnly();
}
// -----------------------------------------------------------------------
-void ListBox::SetSeparatorPos( USHORT n )
+void ListBox::SetSeparatorPos( sal_uInt16 n )
{
mpImplLB->SetSeparatorPos( n );
}
@@ -1556,7 +1556,7 @@ void ListBox::SetSeparatorPos()
// -----------------------------------------------------------------------
-USHORT ListBox::GetSeparatorPos() const
+sal_uInt16 ListBox::GetSeparatorPos() const
{
return mpImplLB->GetSeparatorPos();
}
@@ -1577,21 +1577,21 @@ XubString ListBox::GetMRUEntries( xub_Unicode cSep ) const
// -----------------------------------------------------------------------
-void ListBox::SetMaxMRUCount( USHORT n )
+void ListBox::SetMaxMRUCount( sal_uInt16 n )
{
mpImplLB->SetMaxMRUCount( n );
}
// -----------------------------------------------------------------------
-USHORT ListBox::GetMaxMRUCount() const
+sal_uInt16 ListBox::GetMaxMRUCount() const
{
return mpImplLB->GetMaxMRUCount();
}
// -----------------------------------------------------------------------
-USHORT ListBox::GetDisplayLineCount() const
+sal_uInt16 ListBox::GetDisplayLineCount() const
{
return mpImplLB->GetDisplayLineCount();
}
@@ -1626,7 +1626,7 @@ MultiListBox::MultiListBox( Window* pParent, WinBits nStyle ) :
ListBox( WINDOW_MULTILISTBOX )
{
ImplInit( pParent, nStyle );
- EnableMultiSelection( TRUE );
+ EnableMultiSelection( sal_True );
}
// -----------------------------------------------------------------------
@@ -1641,7 +1641,7 @@ MultiListBox::MultiListBox( Window* pParent, const ResId& rResId ) :
if ( !(nStyle & WB_HIDE ) )
Show();
- EnableMultiSelection( TRUE );
+ EnableMultiSelection( sal_True );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/makefile.mk b/vcl/source/control/makefile.mk
index f9e994e0a66c..de2613b1084f 100644
--- a/vcl/source/control/makefile.mk
+++ b/vcl/source/control/makefile.mk
@@ -43,51 +43,36 @@ CDEFS+=-D_STD_NO_NAMESPACE -D_VOS_NO_NAMESPACE -D_UNO_NO_NAMESPACE
# --- Files --------------------------------------------------------
-SLOFILES= $(SLO)$/button.obj \
- $(SLO)$/combobox.obj \
+EXCEPTIONSFILES= \
+ $(SLO)$/button.obj \
$(SLO)$/ctrl.obj \
$(SLO)$/edit.obj \
- $(SLO)$/field.obj \
$(SLO)$/field2.obj \
- $(SLO)$/fixbrd.obj \
- $(SLO)$/fixed.obj \
- $(SLO)$/group.obj \
- $(SLO)$/ilstbox.obj \
- $(SLO)$/imgctrl.obj \
- $(SLO)$/longcurr.obj \
- $(SLO)$/lstbox.obj \
- $(SLO)$/menubtn.obj \
- $(SLO)$/morebtn.obj \
- $(SLO)$/scrbar.obj \
- $(SLO)$/slider.obj \
- $(SLO)$/spinbtn.obj \
- $(SLO)$/spinfld.obj \
- $(SLO)$/tabctrl.obj
+ $(SLO)$/ilstbox.obj \
+ $(SLO)$/tabctrl.obj \
+ $(SLO)$/throbber.obj
-EXCEPTIONSFILES= \
- $(SLO)$/button.obj \
+SLOFILES= $(EXCEPTIONSFILES) \
$(SLO)$/combobox.obj \
- $(SLO)$/ctrl.obj \
- $(SLO)$/edit.obj \
$(SLO)$/field.obj \
- $(SLO)$/field2.obj \
$(SLO)$/fixbrd.obj \
$(SLO)$/fixed.obj \
$(SLO)$/group.obj \
- $(SLO)$/ilstbox.obj \
$(SLO)$/imgctrl.obj \
$(SLO)$/longcurr.obj \
$(SLO)$/lstbox.obj \
- $(SLO)$/menubtn.obj \
$(SLO)$/morebtn.obj \
+ $(SLO)$/menubtn.obj \
$(SLO)$/scrbar.obj \
$(SLO)$/slider.obj \
- $(SLO)$/spinbtn.obj \
$(SLO)$/spinfld.obj \
- $(SLO)$/tabctrl.obj
+ $(SLO)$/spinbtn.obj \
+ $(SLO)$/quickselectionengine.obj
+
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
.INCLUDE : $(PRJ)$/util$/target.pmk
+
diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx
index 74780c805cac..13513f62b719 100644
--- a/vcl/source/control/menubtn.cxx
+++ b/vcl/source/control/menubtn.cxx
@@ -77,19 +77,10 @@ void MenuButton::ImplExecuteMenu()
Point aPos( 0, 1 );
Size aSize = GetSizePixel();
Rectangle aRect( aPos, aSize );
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- if ( !((GetStyle() & (WB_RECTSTYLE | WB_SMALLSTYLE)) ||
- !(rStyleSettings.GetOptions() & STYLE_OPTION_MACSTYLE)) )
- {
- aRect.Left() += 2;
- aRect.Top() += 2;
- aRect.Right() -= 2;
- aRect.Bottom() -= 2;
- }
- SetPressed( TRUE );
+ SetPressed( sal_True );
EndSelection();
mnCurItemId = mpMenu->Execute( this, aRect, POPUPMENU_EXECUTE_DOWN );
- SetPressed( FALSE );
+ SetPressed( sal_False );
if ( mnCurItemId )
{
Select();
@@ -128,7 +119,7 @@ void MenuButton::ImplLoadRes( const ResId& rResId )
{
Control::ImplLoadRes( rResId );
- ULONG nObjMask = ReadLongRes();
+ sal_uLong nObjMask = ReadLongRes();
if ( RSCMENUBUTTON_MENU & nObjMask )
{
@@ -204,7 +195,7 @@ void MenuButton::MouseButtonDown( const MouseEvent& rMEvt )
void MenuButton::KeyInput( const KeyEvent& rKEvt )
{
KeyCode aKeyCode = rKEvt.GetKeyCode();
- USHORT nCode = aKeyCode.GetCode();
+ sal_uInt16 nCode = aKeyCode.GetCode();
if ( (nCode == KEY_DOWN) && aKeyCode.IsMod2() )
ImplExecuteMenu();
else if ( !(mnMenuMode & MENUBUTTON_MENUMODE_TIMED) &&
@@ -231,7 +222,7 @@ void MenuButton::Select()
// -----------------------------------------------------------------------
-void MenuButton::SetMenuMode( USHORT nMode )
+void MenuButton::SetMenuMode( sal_uInt16 nMode )
{
// Fuer die 5.1-Auslieferung besser noch nicht inline, ansonsten kann
// diese Funktion zur 6.0 inline werden
diff --git a/vcl/source/control/morebtn.cxx b/vcl/source/control/morebtn.cxx
index 5d1fbc9c466b..f40bc376d5e0 100644
--- a/vcl/source/control/morebtn.cxx
+++ b/vcl/source/control/morebtn.cxx
@@ -51,7 +51,7 @@ void MoreButton::ImplInit( Window* pParent, WinBits nStyle )
mpMBData = new ImplMoreButtonData;
mnDelta = 0;
meUnit = MAP_PIXEL;
- mbState = FALSE;
+ mbState = sal_False;
mpMBData->mpItemList = NULL;
@@ -65,7 +65,7 @@ void MoreButton::ImplInit( Window* pParent, WinBits nStyle )
ShowState();
SetSymbolAlign( SYMBOLALIGN_RIGHT );
- ImplSetSmallSymbol( TRUE );
+ ImplSetSmallSymbol( sal_True );
if ( ! ( nStyle & ( WB_RIGHT | WB_LEFT ) ) )
{
@@ -117,12 +117,12 @@ void MoreButton::ImplLoadRes( const ResId& rResId )
{
PushButton::ImplLoadRes( rResId );
- ULONG nObjMask = ReadLongRes();
+ sal_uLong nObjMask = ReadLongRes();
if ( nObjMask & RSC_MOREBUTTON_STATE )
{
// Nicht Methode rufen, da Dialog nicht umgeschaltet werden soll
- mbState = (BOOL)ReadShortRes();
+ mbState = (sal_Bool)ReadShortRes();
// SetText( GetText() );
ShowState();
}
diff --git a/vcl/source/control/quickselectionengine.cxx b/vcl/source/control/quickselectionengine.cxx
new file mode 100644
index 000000000000..2d32393bf79a
--- /dev/null
+++ b/vcl/source/control/quickselectionengine.cxx
@@ -0,0 +1,183 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 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.
+************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_vcl.hxx"
+
+#include "vcl/quickselectionengine.hxx"
+#include "vcl/event.hxx"
+#include "vcl/timer.hxx"
+#include "vcl/i18nhelp.hxx"
+#include "vcl/svapp.hxx"
+
+#include <boost/optional.hpp>
+
+//........................................................................
+namespace vcl
+{
+//........................................................................
+
+ //====================================================================
+ //= QuickSelectionEngine_Data
+ //====================================================================
+ struct QuickSelectionEngine_Data
+ {
+ ISearchableStringList& rEntryList;
+ String sCurrentSearchString;
+ ::boost::optional< sal_Unicode > aSingleSearchChar;
+ Timer aSearchTimeout;
+
+ QuickSelectionEngine_Data( ISearchableStringList& _entryList )
+ :rEntryList( _entryList )
+ ,sCurrentSearchString()
+ ,aSingleSearchChar()
+ ,aSearchTimeout()
+ {
+ aSearchTimeout.SetTimeout( 2500 );
+ aSearchTimeout.SetTimeoutHdl( LINK( this, QuickSelectionEngine_Data, SearchStringTimeout ) );
+ }
+
+ ~QuickSelectionEngine_Data()
+ {
+ aSearchTimeout.Stop();
+ }
+
+ DECL_LINK( SearchStringTimeout, Timer* );
+ };
+
+ //--------------------------------------------------------------------
+ namespace
+ {
+ static void lcl_reset( QuickSelectionEngine_Data& _data )
+ {
+ _data.sCurrentSearchString.Erase();
+ _data.aSingleSearchChar.reset();
+ _data.aSearchTimeout.Stop();
+ }
+ }
+
+ //--------------------------------------------------------------------
+ IMPL_LINK( QuickSelectionEngine_Data, SearchStringTimeout, Timer*, /*EMPTYARG*/ )
+ {
+ lcl_reset( *this );
+ return 1;
+ }
+
+ //--------------------------------------------------------------------
+ static StringEntryIdentifier findMatchingEntry( const String& _searchString, QuickSelectionEngine_Data& _engineData )
+ {
+ const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetLocaleI18nHelper();
+ // TODO: do we really need the Window's settings here? The original code used it ...
+
+ String sEntryText;
+ // get the "current + 1" entry
+ StringEntryIdentifier pSearchEntry = _engineData.rEntryList.CurrentEntry( sEntryText );
+ if ( pSearchEntry )
+ pSearchEntry = _engineData.rEntryList.NextEntry( pSearchEntry, sEntryText );
+ // loop 'til we find another matching entry
+ StringEntryIdentifier pStartedWith = pSearchEntry;
+ while ( pSearchEntry )
+ {
+ if ( rI18nHelper.MatchString( _searchString, sEntryText ) != 0 )
+ break;
+
+ pSearchEntry = _engineData.rEntryList.NextEntry( pSearchEntry, sEntryText );
+ if ( pSearchEntry == pStartedWith )
+ pSearchEntry = NULL;
+ }
+
+ return pSearchEntry;
+ }
+
+ //====================================================================
+ //= QuickSelectionEngine
+ //====================================================================
+ //--------------------------------------------------------------------
+ QuickSelectionEngine::QuickSelectionEngine( ISearchableStringList& _entryList )
+ :m_pData( new QuickSelectionEngine_Data( _entryList ) )
+ {
+ }
+
+ //--------------------------------------------------------------------
+ QuickSelectionEngine::~QuickSelectionEngine()
+ {
+ }
+
+ //--------------------------------------------------------------------
+ bool QuickSelectionEngine::HandleKeyEvent( const KeyEvent& _keyEvent )
+ {
+ xub_Unicode c = _keyEvent.GetCharCode();
+
+ if ( ( c >= 32 ) && ( c != 127 ) && !_keyEvent.GetKeyCode().IsMod2() )
+ {
+ m_pData->sCurrentSearchString += c;
+ OSL_TRACE( "QuickSelectionEngine::HandleKeyEvent: searching for %s", ByteString( m_pData->sCurrentSearchString, RTL_TEXTENCODING_UTF8 ).GetBuffer() );
+
+ if ( m_pData->sCurrentSearchString.Len() == 1 )
+ { // first character in the search -> remmeber
+ m_pData->aSingleSearchChar.reset( c );
+ }
+ else if ( m_pData->sCurrentSearchString.Len() > 1 )
+ {
+ if ( !!m_pData->aSingleSearchChar && ( *m_pData->aSingleSearchChar != c ) )
+ // we already have a "single char", but the current one is different -> reset
+ m_pData->aSingleSearchChar.reset();
+ }
+
+ XubString aSearchTemp( m_pData->sCurrentSearchString );
+
+ StringEntryIdentifier pMatchingEntry = findMatchingEntry( aSearchTemp, *m_pData );
+ OSL_TRACE( "QuickSelectionEngine::HandleKeyEvent: found %p", pMatchingEntry );
+ if ( !pMatchingEntry && ( aSearchTemp.Len() > 1 ) && !!m_pData->aSingleSearchChar )
+ {
+ // if there's only one letter in the search string, use a different search mode
+ aSearchTemp = *m_pData->aSingleSearchChar;
+ pMatchingEntry = findMatchingEntry( aSearchTemp, *m_pData );
+ }
+
+ if ( pMatchingEntry )
+ {
+ m_pData->rEntryList.SelectEntry( pMatchingEntry );
+ m_pData->aSearchTimeout.Start();
+ }
+ else
+ {
+ lcl_reset( *m_pData );
+ }
+
+ return true;
+ }
+ return false;
+ }
+
+ //--------------------------------------------------------------------
+ void QuickSelectionEngine::Reset()
+ {
+ lcl_reset( *m_pData );
+ }
+
+//........................................................................
+} // namespace vcl
+//........................................................................
diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
index 6ce752d35c4b..938b7831985c 100644
--- a/vcl/source/control/scrbar.cxx
+++ b/vcl/source/control/scrbar.cxx
@@ -70,30 +70,30 @@ static long ImplMulDiv( long nNumber, long nNumerator, long nDenominator )
// =======================================================================
-#define SCRBAR_DRAW_BTN1 ((USHORT)0x0001)
-#define SCRBAR_DRAW_BTN2 ((USHORT)0x0002)
-#define SCRBAR_DRAW_PAGE1 ((USHORT)0x0004)
-#define SCRBAR_DRAW_PAGE2 ((USHORT)0x0008)
-#define SCRBAR_DRAW_THUMB ((USHORT)0x0010)
-#define SCRBAR_DRAW_BACKGROUND ((USHORT)0x0020)
+#define SCRBAR_DRAW_BTN1 ((sal_uInt16)0x0001)
+#define SCRBAR_DRAW_BTN2 ((sal_uInt16)0x0002)
+#define SCRBAR_DRAW_PAGE1 ((sal_uInt16)0x0004)
+#define SCRBAR_DRAW_PAGE2 ((sal_uInt16)0x0008)
+#define SCRBAR_DRAW_THUMB ((sal_uInt16)0x0010)
+#define SCRBAR_DRAW_BACKGROUND ((sal_uInt16)0x0020)
#define SCRBAR_DRAW_ALL (SCRBAR_DRAW_BTN1 | SCRBAR_DRAW_BTN2 | \
SCRBAR_DRAW_PAGE1 | SCRBAR_DRAW_PAGE2 |\
SCRBAR_DRAW_THUMB | SCRBAR_DRAW_BACKGROUND )
-#define SCRBAR_STATE_BTN1_DOWN ((USHORT)0x0001)
-#define SCRBAR_STATE_BTN1_DISABLE ((USHORT)0x0002)
-#define SCRBAR_STATE_BTN2_DOWN ((USHORT)0x0004)
-#define SCRBAR_STATE_BTN2_DISABLE ((USHORT)0x0008)
-#define SCRBAR_STATE_PAGE1_DOWN ((USHORT)0x0010)
-#define SCRBAR_STATE_PAGE2_DOWN ((USHORT)0x0020)
-#define SCRBAR_STATE_THUMB_DOWN ((USHORT)0x0040)
+#define SCRBAR_STATE_BTN1_DOWN ((sal_uInt16)0x0001)
+#define SCRBAR_STATE_BTN1_DISABLE ((sal_uInt16)0x0002)
+#define SCRBAR_STATE_BTN2_DOWN ((sal_uInt16)0x0004)
+#define SCRBAR_STATE_BTN2_DISABLE ((sal_uInt16)0x0008)
+#define SCRBAR_STATE_PAGE1_DOWN ((sal_uInt16)0x0010)
+#define SCRBAR_STATE_PAGE2_DOWN ((sal_uInt16)0x0020)
+#define SCRBAR_STATE_THUMB_DOWN ((sal_uInt16)0x0040)
#define SCRBAR_VIEW_STYLE (WB_3DLOOK | WB_HORZ | WB_VERT)
struct ImplScrollBarData
{
AutoTimer maTimer; // Timer
- BOOL mbHide;
+ sal_Bool mbHide;
Rectangle maTrackRect; // TODO: move to ScrollBar class when binary incompatibility of ScrollBar class is no longer problematic
};
@@ -116,14 +116,14 @@ void ScrollBar::ImplInit( Window* pParent, WinBits nStyle )
mnStateFlags = 0;
meScrollType = SCROLL_DONTKNOW;
meDDScrollType = SCROLL_DONTKNOW;
- mbCalcSize = TRUE;
+ mbCalcSize = sal_True;
mbFullDrag = 0;
if( !mpData ) // TODO: remove when maTrackRect is no longer in mpData
{
mpData = new ImplScrollBarData;
mpData->maTimer.SetTimeoutHdl( LINK( this, ScrollBar, ImplAutoTimerHdl ) );
- mpData->mbHide = FALSE;
+ mpData->mbHide = sal_False;
}
ImplInitStyle( nStyle );
@@ -139,7 +139,7 @@ void ScrollBar::ImplInit( Window* pParent, WinBits nStyle )
void ScrollBar::ImplInitStyle( WinBits nStyle )
{
if ( nStyle & WB_DRAG )
- mbFullDrag = TRUE;
+ mbFullDrag = sal_True;
else
mbFullDrag = (GetSettings().GetStyleSettings().GetDragFullOptions() & DRAGFULL_OPTION_SCROLL) != 0;
}
@@ -180,12 +180,12 @@ void ScrollBar::ImplLoadRes( const ResId& rResId )
{
Control::ImplLoadRes( rResId );
- INT16 nMin = ReadShortRes();
- INT16 nMax = ReadShortRes();
- INT16 nThumbPos = ReadShortRes();
- INT16 nPage = ReadShortRes();
- INT16 nStep = ReadShortRes();
- INT16 nVisibleSize = ReadShortRes();
+ sal_Int16 nMin = ReadShortRes();
+ sal_Int16 nMax = ReadShortRes();
+ sal_Int16 nThumbPos = ReadShortRes();
+ sal_Int16 nPage = ReadShortRes();
+ sal_Int16 nStep = ReadShortRes();
+ sal_Int16 nVisibleSize = ReadShortRes();
SetRange( Range( nMin, nMax ) );
SetLineSize( nStep );
@@ -196,9 +196,9 @@ void ScrollBar::ImplLoadRes( const ResId& rResId )
// -----------------------------------------------------------------------
-void ScrollBar::ImplUpdateRects( BOOL bUpdate )
+void ScrollBar::ImplUpdateRects( sal_Bool bUpdate )
{
- USHORT nOldStateFlags = mnStateFlags;
+ sal_uInt16 nOldStateFlags = mnStateFlags;
Rectangle aOldPage1Rect = maPage1Rect;
Rectangle aOldPage2Rect = maPage2Rect;
Rectangle aOldThumbRect = maThumbRect;
@@ -280,7 +280,7 @@ void ScrollBar::ImplUpdateRects( BOOL bUpdate )
if ( bUpdate )
{
- USHORT nDraw = 0;
+ sal_uInt16 nDraw = 0;
if ( (nOldStateFlags & SCRBAR_STATE_BTN1_DISABLE) !=
(mnStateFlags & SCRBAR_STATE_BTN1_DISABLE) )
nDraw |= SCRBAR_DRAW_BTN1;
@@ -333,7 +333,7 @@ long ScrollBar::ImplCalcThumbPosPix( long nPos )
// -----------------------------------------------------------------------
-void ScrollBar::ImplCalc( BOOL bUpdate )
+void ScrollBar::ImplCalc( sal_Bool bUpdate )
{
const Size aSize = GetOutputSizePixel();
const long nMinThumbSize = GetSettings().GetStyleSettings().GetMinThumbSize();;
@@ -430,7 +430,7 @@ void ScrollBar::ImplCalc( BOOL bUpdate )
if ( !mnThumbPixRange )
maThumbRect.SetEmpty();
- mbCalcSize = FALSE;
+ mbCalcSize = sal_False;
}
if ( mnThumbPixRange )
@@ -468,14 +468,14 @@ void ScrollBar::ImplCalc( BOOL bUpdate )
if ( bUpdate && HasPaintEvent() )
{
Invalidate();
- bUpdate = FALSE;
+ bUpdate = sal_False;
}
ImplUpdateRects( bUpdate );
}
// -----------------------------------------------------------------------
-void ScrollBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+void ScrollBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -504,7 +504,7 @@ void ScrollBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
// -force recalculate
if ( mbCalcSize )
- ImplCalc( FALSE );
+ ImplCalc( sal_False );
maBtn1Rect+=aPos;
maBtn2Rect+=aPos;
@@ -516,19 +516,19 @@ void ScrollBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
ImplDraw( SCRBAR_DRAW_ALL, pDev );
pDev->Pop();
- mbCalcSize = TRUE;
+ mbCalcSize = sal_True;
}
// -----------------------------------------------------------------------
-BOOL ScrollBar::ImplDrawNative( USHORT nDrawFlags )
+sal_Bool ScrollBar::ImplDrawNative( sal_uInt16 nDrawFlags )
{
ScrollbarValue scrValue;
- BOOL bNativeOK = IsNativeControlSupported(CTRL_SCROLLBAR, PART_ENTIRE_CONTROL);
+ sal_Bool bNativeOK = IsNativeControlSupported(CTRL_SCROLLBAR, PART_ENTIRE_CONTROL);
if( bNativeOK )
{
- BOOL bHorz = (GetStyle() & WB_HORZ ? true : false);
+ sal_Bool bHorz = (GetStyle() & WB_HORZ ? true : false);
// Draw the entire background if the control supports it
if( IsNativeControlSupported(CTRL_SCROLLBAR, bHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT) )
@@ -682,18 +682,18 @@ BOOL ScrollBar::ImplDrawNative( USHORT nDrawFlags )
return bNativeOK;
}
-void ScrollBar::ImplDraw( USHORT nDrawFlags, OutputDevice* pOutDev )
+void ScrollBar::ImplDraw( sal_uInt16 nDrawFlags, OutputDevice* pOutDev )
{
DecorationView aDecoView( pOutDev );
Rectangle aTempRect;
- USHORT nStyle;
+ sal_uInt16 nStyle;
const StyleSettings& rStyleSettings = pOutDev->GetSettings().GetStyleSettings();
SymbolType eSymbolType;
- BOOL bEnabled = IsEnabled();
+ sal_Bool bEnabled = IsEnabled();
// Evt. noch offene Berechnungen nachholen
if ( mbCalcSize )
- ImplCalc( FALSE );
+ ImplCalc( sal_False );
Window *pWin = NULL;
if( pOutDev->GetOutDevType() == OUTDEV_WINDOW )
@@ -769,64 +769,7 @@ void ScrollBar::ImplDraw( USHORT nDrawFlags, OutputDevice* pOutDev )
if ( bEnabled )
{
nStyle = BUTTON_DRAW_NOLIGHTBORDER;
- // pressed thumbs only in OS2 style
- if ( rStyleSettings.GetOptions() & STYLE_OPTION_OS2STYLE )
- if ( mnStateFlags & SCRBAR_STATE_THUMB_DOWN )
- nStyle |= BUTTON_DRAW_PRESSED;
aTempRect = aDecoView.DrawButton( maThumbRect, nStyle );
- // OS2 style requires pattern on the thumb
- if ( rStyleSettings.GetOptions() & STYLE_OPTION_OS2STYLE )
- {
- if ( GetStyle() & WB_HORZ )
- {
- if ( aTempRect.GetWidth() > 6 )
- {
- long nX = aTempRect.Center().X();
- nX -= 6;
- if ( nX < aTempRect.Left() )
- nX = aTempRect.Left();
- for ( int i = 0; i < 6; i++ )
- {
- if ( nX > aTempRect.Right()-1 )
- break;
-
- pOutDev->SetLineColor( rStyleSettings.GetButtonTextColor() );
- pOutDev->DrawLine( Point( nX, aTempRect.Top()+1 ),
- Point( nX, aTempRect.Bottom()-1 ) );
- nX++;
- pOutDev->SetLineColor( rStyleSettings.GetLightColor() );
- pOutDev->DrawLine( Point( nX, aTempRect.Top()+1 ),
- Point( nX, aTempRect.Bottom()-1 ) );
- nX++;
- }
- }
- }
- else
- {
- if ( aTempRect.GetHeight() > 6 )
- {
- long nY = aTempRect.Center().Y();
- nY -= 6;
- if ( nY < aTempRect.Top() )
- nY = aTempRect.Top();
- for ( int i = 0; i < 6; i++ )
- {
- if ( nY > aTempRect.Bottom()-1 )
- break;
-
- pOutDev->SetLineColor( rStyleSettings.GetButtonTextColor() );
- pOutDev->DrawLine( Point( aTempRect.Left()+1, nY ),
- Point( aTempRect.Right()-1, nY ) );
- nY++;
- pOutDev->SetLineColor( rStyleSettings.GetLightColor() );
- pOutDev->DrawLine( Point( aTempRect.Left()+1, nY ),
- Point( aTempRect.Right()-1, nY ) );
- nY++;
- }
- }
- }
- pOutDev->SetLineColor();
- }
}
else
{
@@ -856,7 +799,7 @@ void ScrollBar::ImplDraw( USHORT nDrawFlags, OutputDevice* pOutDev )
// -----------------------------------------------------------------------
-long ScrollBar::ImplScroll( long nNewPos, BOOL bCallEndScroll )
+long ScrollBar::ImplScroll( long nNewPos, sal_Bool bCallEndScroll )
{
long nOldPos = mnThumbPos;
SetThumbPos( nNewPos );
@@ -874,7 +817,7 @@ long ScrollBar::ImplScroll( long nNewPos, BOOL bCallEndScroll )
// -----------------------------------------------------------------------
-long ScrollBar::ImplDoAction( BOOL bCallEndScroll )
+long ScrollBar::ImplDoAction( sal_Bool bCallEndScroll )
{
long nDelta = 0;
@@ -904,12 +847,12 @@ long ScrollBar::ImplDoAction( BOOL bCallEndScroll )
// -----------------------------------------------------------------------
-void ScrollBar::ImplDoMouseAction( const Point& rMousePos, BOOL bCallAction )
+void ScrollBar::ImplDoMouseAction( const Point& rMousePos, sal_Bool bCallAction )
{
- USHORT nOldStateFlags = mnStateFlags;
- BOOL bAction = FALSE;
- BOOL bHorizontal = ( GetStyle() & WB_HORZ )? TRUE: FALSE;
- BOOL bIsInside = FALSE;
+ sal_uInt16 nOldStateFlags = mnStateFlags;
+ sal_Bool bAction = sal_False;
+ sal_Bool bHorizontal = ( GetStyle() & WB_HORZ )? sal_True: sal_False;
+ sal_Bool bIsInside = sal_False;
Point aPoint( 0, 0 );
Rectangle aControlRegion( aPoint, GetOutputSizePixel() );
@@ -976,7 +919,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, BOOL bCallAction )
if ( nOldStateFlags != mnStateFlags )
ImplDraw( mnDragDraw, this );
if ( bAction )
- ImplDoAction( FALSE );
+ ImplDoAction( sal_False );
}
// -----------------------------------------------------------------------
@@ -1016,10 +959,10 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
if ( rMEvt.IsLeft() || rMEvt.IsMiddle() )
{
const Point& rMousePos = rMEvt.GetPosPixel();
- USHORT nTrackFlags = 0;
- BOOL bHorizontal = ( GetStyle() & WB_HORZ )? TRUE: FALSE;
- BOOL bIsInside = FALSE;
- BOOL bDragToMouse = FALSE;
+ sal_uInt16 nTrackFlags = 0;
+ sal_Bool bHorizontal = ( GetStyle() & WB_HORZ )? sal_True: sal_False;
+ sal_Bool bIsInside = sal_False;
+ sal_Bool bDragToMouse = sal_False;
Point aPoint( 0, 0 );
Rectangle aControlRegion( aPoint, GetOutputSizePixel() );
@@ -1062,7 +1005,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
{
if( mpData )
{
- mpData->mbHide = TRUE; // disable focus blinking
+ mpData->mbHide = sal_True; // disable focus blinking
if( HasFocus() )
ImplDraw( SCRBAR_DRAW_THUMB, this ); // paint without focus
}
@@ -1076,7 +1019,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
// calculate mouse offset
if( rMEvt.IsMiddle() || (ImplGetSVData()->maNWFData.mbScrollbarJumpPage && !bThumbHit) )
{
- bDragToMouse = TRUE;
+ bDragToMouse = sal_True;
if ( GetStyle() & WB_HORZ )
mnMouseOff = maThumbRect.GetWidth()/2;
else
@@ -1098,7 +1041,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
}
else if( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_TRACK_HORZ_AREA : PART_TRACK_VERT_AREA,
aControlRegion, rMousePos, bIsInside )?
- bIsInside : TRUE )
+ bIsInside : sal_True )
{
nTrackFlags = STARTTRACK_BUTTONREPEAT;
@@ -1143,7 +1086,7 @@ void ScrollBar::Tracking( const TrackingEvent& rTEvt )
if ( rTEvt.IsTrackingEnded() )
{
// Button und PageRect-Status wieder herstellen
- USHORT nOldStateFlags = mnStateFlags;
+ sal_uInt16 nOldStateFlags = mnStateFlags;
mnStateFlags &= ~(SCRBAR_STATE_BTN1_DOWN | SCRBAR_STATE_BTN2_DOWN |
SCRBAR_STATE_PAGE1_DOWN | SCRBAR_STATE_PAGE2_DOWN |
SCRBAR_STATE_THUMB_DOWN);
@@ -1180,7 +1123,7 @@ void ScrollBar::Tracking( const TrackingEvent& rTEvt )
meScrollType = SCROLL_DONTKNOW;
if( mpData )
- mpData->mbHide = FALSE; // re-enable focus blinking
+ mpData->mbHide = sal_False; // re-enable focus blinking
}
else
{
@@ -1254,9 +1197,9 @@ void ScrollBar::Paint( const Rectangle& )
void ScrollBar::Resize()
{
Control::Resize();
- mbCalcSize = TRUE;
+ mbCalcSize = sal_True;
if ( IsReallyVisible() )
- ImplCalc( FALSE );
+ ImplCalc( sal_False );
Invalidate();
}
@@ -1295,7 +1238,7 @@ void ScrollBar::GetFocus()
{
mpData = new ImplScrollBarData;
mpData->maTimer.SetTimeoutHdl( LINK( this, ScrollBar, ImplAutoTimerHdl ) );
- mpData->mbHide = FALSE;
+ mpData->mbHide = sal_False;
}
ImplInvert(); // react immediately
mpData->maTimer.SetTimeout( GetSettings().GetStyleSettings().GetCursorBlinkTime() );
@@ -1321,17 +1264,17 @@ void ScrollBar::StateChanged( StateChangedType nType )
Control::StateChanged( nType );
if ( nType == STATE_CHANGE_INITSHOW )
- ImplCalc( FALSE );
+ ImplCalc( sal_False );
else if ( nType == STATE_CHANGE_DATA )
{
if ( IsReallyVisible() && IsUpdateMode() )
- ImplCalc( TRUE );
+ ImplCalc( sal_True );
}
else if ( nType == STATE_CHANGE_UPDATEMODE )
{
if ( IsReallyVisible() && IsUpdateMode() )
{
- ImplCalc( FALSE );
+ ImplCalc( sal_False );
Invalidate();
}
}
@@ -1348,8 +1291,8 @@ void ScrollBar::StateChanged( StateChangedType nType )
if ( (GetPrevStyle() & SCRBAR_VIEW_STYLE) !=
(GetStyle() & SCRBAR_VIEW_STYLE) )
{
- mbCalcSize = TRUE;
- ImplCalc( FALSE );
+ mbCalcSize = sal_True;
+ ImplCalc( sal_False );
Invalidate();
}
}
@@ -1365,8 +1308,8 @@ void ScrollBar::DataChanged( const DataChangedEvent& rDCEvt )
if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE) )
{
- mbCalcSize = TRUE;
- ImplCalc( FALSE );
+ mbCalcSize = sal_True;
+ ImplCalc( sal_False );
Invalidate();
}
}
@@ -1375,8 +1318,8 @@ void ScrollBar::DataChanged( const DataChangedEvent& rDCEvt )
Rectangle* ScrollBar::ImplFindPartRect( const Point& rPt )
{
- BOOL bHorizontal = ( GetStyle() & WB_HORZ )? TRUE: FALSE;
- BOOL bIsInside = FALSE;
+ sal_Bool bHorizontal = ( GetStyle() & WB_HORZ )? sal_True: sal_False;
+ sal_Bool bIsInside = sal_False;
Point aPoint( 0, 0 );
Rectangle aControlRegion( aPoint, GetOutputSizePixel() );
@@ -1438,7 +1381,7 @@ long ScrollBar::PreNotify( NotifyEvent& rNEvt )
aClipRegion.Union( *pLastRect );
// Support for 3-button scroll bars
- BOOL bHas3Buttons = IsNativeControlSupported( CTRL_SCROLLBAR, HAS_THREE_BUTTONS );
+ sal_Bool bHas3Buttons = IsNativeControlSupported( CTRL_SCROLLBAR, HAS_THREE_BUTTONS );
if ( bHas3Buttons && ( pRect == &maBtn1Rect || pLastRect == &maBtn1Rect ) )
{
aClipRegion.Union( maBtn2Rect );
@@ -1478,7 +1421,7 @@ long ScrollBar::DoScroll( long nNewPos )
return 0;
meScrollType = SCROLL_DRAG;
- long nDelta = ImplScroll( nNewPos, TRUE );
+ long nDelta = ImplScroll( nNewPos, sal_True );
meScrollType = SCROLL_DONTKNOW;
return nDelta;
}
@@ -1493,7 +1436,7 @@ long ScrollBar::DoScrollAction( ScrollType eScrollType )
return 0;
meScrollType = eScrollType;
- long nDelta = ImplDoAction( TRUE );
+ long nDelta = ImplDoAction( sal_True );
meScrollType = SCROLL_DONTKNOW;
return nDelta;
}
diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx
index 6d3c813dbe59..71eeeae665d4 100644
--- a/vcl/source/control/slider.cxx
+++ b/vcl/source/control/slider.cxx
@@ -46,15 +46,15 @@ static long ImplMulDiv( long nNumber, long nNumerator, long nDenominator )
// =======================================================================
-#define SLIDER_DRAW_THUMB ((USHORT)0x0001)
-#define SLIDER_DRAW_CHANNEL1 ((USHORT)0x0002)
-#define SLIDER_DRAW_CHANNEL2 ((USHORT)0x0004)
+#define SLIDER_DRAW_THUMB ((sal_uInt16)0x0001)
+#define SLIDER_DRAW_CHANNEL1 ((sal_uInt16)0x0002)
+#define SLIDER_DRAW_CHANNEL2 ((sal_uInt16)0x0004)
#define SLIDER_DRAW_CHANNEL (SLIDER_DRAW_CHANNEL1 | SLIDER_DRAW_CHANNEL2)
#define SLIDER_DRAW_ALL (SLIDER_DRAW_THUMB | SLIDER_DRAW_CHANNEL)
-#define SLIDER_STATE_CHANNEL1_DOWN ((USHORT)0x0001)
-#define SLIDER_STATE_CHANNEL2_DOWN ((USHORT)0x0002)
-#define SLIDER_STATE_THUMB_DOWN ((USHORT)0x0004)
+#define SLIDER_STATE_CHANNEL1_DOWN ((sal_uInt16)0x0001)
+#define SLIDER_STATE_CHANNEL2_DOWN ((sal_uInt16)0x0002)
+#define SLIDER_STATE_THUMB_DOWN ((sal_uInt16)0x0004)
#define SLIDER_THUMB_SIZE 9
#define SLIDER_THUMB_HALFSIZE 4
@@ -87,8 +87,8 @@ void Slider::ImplInit( Window* pParent, WinBits nStyle )
mnDragDraw = 0;
mnStateFlags = 0;
meScrollType = SCROLL_DONTKNOW;
- mbCalcSize = TRUE;
- mbFullDrag = TRUE;
+ mbCalcSize = sal_True;
+ mbFullDrag = sal_True;
Control::ImplInit( pParent, nStyle, NULL );
@@ -124,12 +124,12 @@ void Slider::ImplLoadRes( const ResId& rResId )
{
Control::ImplLoadRes( rResId );
- INT16 nMin = ReadShortRes();
- INT16 nMax = ReadShortRes();
- INT16 nThumbPos = ReadShortRes();
- INT16 nPage = ReadShortRes();
- INT16 nStep = ReadShortRes();
- /* INT16 nVisibleSize = */ ReadShortRes();
+ sal_Int16 nMin = ReadShortRes();
+ sal_Int16 nMax = ReadShortRes();
+ sal_Int16 nThumbPos = ReadShortRes();
+ sal_Int16 nPage = ReadShortRes();
+ sal_Int16 nStep = ReadShortRes();
+ /* sal_Int16 nVisibleSize = */ ReadShortRes();
SetRange( Range( nMin, nMax ) );
SetLineSize( nStep );
@@ -144,16 +144,16 @@ void Slider::ImplInitSettings()
Window* pParent = GetParent();
if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() )
{
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
}
else
{
- EnableChildTransparentMode( FALSE );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -164,7 +164,7 @@ void Slider::ImplInitSettings()
// -----------------------------------------------------------------------
-void Slider::ImplUpdateRects( BOOL bUpdate )
+void Slider::ImplUpdateRects( sal_Bool bUpdate )
{
Rectangle aOldThumbRect = maThumbRect;
bool bInvalidateAll = false;
@@ -302,9 +302,9 @@ long Slider::ImplCalcThumbPosPix( long nPos )
// -----------------------------------------------------------------------
-void Slider::ImplCalc( BOOL bUpdate )
+void Slider::ImplCalc( sal_Bool bUpdate )
{
- BOOL bInvalidateAll = FALSE;
+ sal_Bool bInvalidateAll = sal_False;
if ( mbCalcSize )
{
@@ -355,9 +355,9 @@ void Slider::ImplCalc( BOOL bUpdate )
(nOldChannelPixRange != mnChannelPixRange) ||
(nOldChannelPixTop != mnChannelPixTop) ||
(nOldChannelPixBottom != mnChannelPixBottom) )
- bInvalidateAll = TRUE;
+ bInvalidateAll = sal_True;
- mbCalcSize = FALSE;
+ mbCalcSize = sal_False;
}
if ( mnThumbPixRange )
@@ -366,23 +366,23 @@ void Slider::ImplCalc( BOOL bUpdate )
if ( bUpdate && bInvalidateAll )
{
Invalidate();
- bUpdate = FALSE;
+ bUpdate = sal_False;
}
ImplUpdateRects( bUpdate );
}
// -----------------------------------------------------------------------
-void Slider::ImplDraw( USHORT nDrawFlags )
+void Slider::ImplDraw( sal_uInt16 nDrawFlags )
{
DecorationView aDecoView( this );
- USHORT nStyle;
+ sal_uInt16 nStyle;
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- BOOL bEnabled = IsEnabled();
+ sal_Bool bEnabled = IsEnabled();
// Evt. noch offene Berechnungen nachholen
if ( mbCalcSize )
- ImplCalc( FALSE );
+ ImplCalc( sal_False );
ControlPart nPart = (GetStyle() & WB_HORZ) ? PART_TRACK_HORZ_AREA : PART_TRACK_VERT_AREA;
ControlState nState = ( IsEnabled() ? CTRL_STATE_ENABLED : 0 ) | ( HasFocus() ? CTRL_STATE_FOCUSED : 0 );
@@ -513,7 +513,7 @@ void Slider::ImplDraw( USHORT nDrawFlags )
// -----------------------------------------------------------------------
-BOOL Slider::ImplIsPageUp( const Point& rPos )
+sal_Bool Slider::ImplIsPageUp( const Point& rPos )
{
Size aSize = GetOutputSizePixel();
Rectangle aRect = maChannel1Rect;
@@ -532,7 +532,7 @@ BOOL Slider::ImplIsPageUp( const Point& rPos )
// -----------------------------------------------------------------------
-BOOL Slider::ImplIsPageDown( const Point& rPos )
+sal_Bool Slider::ImplIsPageDown( const Point& rPos )
{
Size aSize = GetOutputSizePixel();
Rectangle aRect = maChannel2Rect;
@@ -551,7 +551,7 @@ BOOL Slider::ImplIsPageDown( const Point& rPos )
// -----------------------------------------------------------------------
-long Slider::ImplSlide( long nNewPos, BOOL bCallEndSlide )
+long Slider::ImplSlide( long nNewPos, sal_Bool bCallEndSlide )
{
long nOldPos = mnThumbPos;
SetThumbPos( nNewPos );
@@ -569,7 +569,7 @@ long Slider::ImplSlide( long nNewPos, BOOL bCallEndSlide )
// -----------------------------------------------------------------------
-long Slider::ImplDoAction( BOOL bCallEndSlide )
+long Slider::ImplDoAction( sal_Bool bCallEndSlide )
{
long nDelta = 0;
@@ -603,10 +603,10 @@ long Slider::ImplDoAction( BOOL bCallEndSlide )
// -----------------------------------------------------------------------
-void Slider::ImplDoMouseAction( const Point& rMousePos, BOOL bCallAction )
+void Slider::ImplDoMouseAction( const Point& rMousePos, sal_Bool bCallAction )
{
- USHORT nOldStateFlags = mnStateFlags;
- BOOL bAction = FALSE;
+ sal_uInt16 nOldStateFlags = mnStateFlags;
+ sal_Bool bAction = sal_False;
switch ( meScrollType )
{
@@ -649,7 +649,7 @@ void Slider::ImplDoMouseAction( const Point& rMousePos, BOOL bCallAction )
if ( bAction )
{
- if ( ImplDoAction( FALSE ) )
+ if ( ImplDoAction( sal_False ) )
{
// Update the channel complete
if ( mnDragDraw & SLIDER_DRAW_CHANNEL )
@@ -671,7 +671,7 @@ long Slider::ImplDoSlide( long nNewPos )
return 0;
meScrollType = SCROLL_DRAG;
- long nDelta = ImplSlide( nNewPos, TRUE );
+ long nDelta = ImplSlide( nNewPos, sal_True );
meScrollType = SCROLL_DONTKNOW;
return nDelta;
}
@@ -686,7 +686,7 @@ long Slider::ImplDoSlideAction( ScrollType eScrollType )
return 0;
meScrollType = eScrollType;
- long nDelta = ImplDoAction( TRUE );
+ long nDelta = ImplDoAction( sal_True );
meScrollType = SCROLL_DONTKNOW;
return nDelta;
}
@@ -698,7 +698,7 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt )
if ( rMEvt.IsLeft() )
{
const Point& rMousePos = rMEvt.GetPosPixel();
- USHORT nTrackFlags = 0;
+ sal_uInt16 nTrackFlags = 0;
if ( maThumbRect.IsInside( rMousePos ) )
{
@@ -712,13 +712,6 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt )
mnMouseOff = rMousePos.X()-aCenterPos.X();
else
mnMouseOff = rMousePos.Y()-aCenterPos.Y();
-
- // Im OS2-Look geben wir den Thumb gedrueckt aus
- if ( GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_OS2STYLE )
- {
- mnStateFlags |= SLIDER_STATE_THUMB_DOWN;
- ImplDraw( SLIDER_DRAW_THUMB );
- }
}
else if ( ImplIsPageUp( rMousePos ) )
{
@@ -766,7 +759,7 @@ void Slider::MouseButtonUp( const MouseEvent& )
if( SCROLL_SET == meScrollType )
{
// Button und PageRect-Status wieder herstellen
- const USHORT nOldStateFlags = mnStateFlags;
+ const sal_uInt16 nOldStateFlags = mnStateFlags;
mnStateFlags &= ~( SLIDER_STATE_CHANNEL1_DOWN | SLIDER_STATE_CHANNEL2_DOWN | SLIDER_STATE_THUMB_DOWN );
@@ -774,7 +767,7 @@ void Slider::MouseButtonUp( const MouseEvent& )
ImplDraw( mnDragDraw );
mnDragDraw = 0;
- ImplDoAction( TRUE );
+ ImplDoAction( sal_True );
meScrollType = SCROLL_DONTKNOW;
}
}
@@ -786,7 +779,7 @@ void Slider::Tracking( const TrackingEvent& rTEvt )
if ( rTEvt.IsTrackingEnded() )
{
// Button und PageRect-Status wieder herstellen
- USHORT nOldStateFlags = mnStateFlags;
+ sal_uInt16 nOldStateFlags = mnStateFlags;
mnStateFlags &= ~(SLIDER_STATE_CHANNEL1_DOWN | SLIDER_STATE_CHANNEL2_DOWN |
SLIDER_STATE_THUMB_DOWN);
if ( nOldStateFlags != mnStateFlags )
@@ -923,9 +916,9 @@ void Slider::Paint( const Rectangle& )
void Slider::Resize()
{
Control::Resize();
- mbCalcSize = TRUE;
+ mbCalcSize = sal_True;
if ( IsReallyVisible() )
- ImplCalc( FALSE );
+ ImplCalc( sal_False );
Invalidate();
}
@@ -943,17 +936,17 @@ void Slider::StateChanged( StateChangedType nType )
Control::StateChanged( nType );
if ( nType == STATE_CHANGE_INITSHOW )
- ImplCalc( FALSE );
+ ImplCalc( sal_False );
else if ( nType == STATE_CHANGE_DATA )
{
if ( IsReallyVisible() && IsUpdateMode() )
- ImplCalc( TRUE );
+ ImplCalc( sal_True );
}
else if ( nType == STATE_CHANGE_UPDATEMODE )
{
if ( IsReallyVisible() && IsUpdateMode() )
{
- ImplCalc( FALSE );
+ ImplCalc( sal_False );
Invalidate();
}
}
@@ -969,8 +962,8 @@ void Slider::StateChanged( StateChangedType nType )
if ( (GetPrevStyle() & SLIDER_VIEW_STYLE) !=
(GetStyle() & SLIDER_VIEW_STYLE) )
{
- mbCalcSize = TRUE;
- ImplCalc( FALSE );
+ mbCalcSize = sal_True;
+ ImplCalc( sal_False );
Invalidate();
}
}
diff --git a/vcl/source/control/spinbtn.cxx b/vcl/source/control/spinbtn.cxx
index 21938dfad0e5..50265e911f80 100644
--- a/vcl/source/control/spinbtn.cxx
+++ b/vcl/source/control/spinbtn.cxx
@@ -37,10 +37,10 @@
void SpinButton::ImplInit( Window* pParent, WinBits nStyle )
{
- mbUpperIn = FALSE;
- mbLowerIn = FALSE;
- mbInitialUp = FALSE;
- mbInitialDown = FALSE;
+ mbUpperIn = sal_False;
+ mbLowerIn = sal_False;
+ mbInitialUp = sal_False;
+ mbInitialDown = sal_False;
mnMinRange = 0;
mnMaxRange = 100;
@@ -53,9 +53,9 @@ void SpinButton::ImplInit( Window* pParent, WinBits nStyle )
mbRepeat = 0 != ( nStyle & WB_REPEAT );
if ( nStyle & WB_HSCROLL )
- mbHorz = TRUE;
+ mbHorz = sal_True;
else
- mbHorz = FALSE;
+ mbHorz = sal_False;
Control::ImplInit( pParent, nStyle, NULL );
}
@@ -64,7 +64,7 @@ void SpinButton::ImplInit( Window* pParent, WinBits nStyle )
SpinButton::SpinButton( Window* pParent, WinBits nStyle )
:Control( WINDOW_SPINBUTTON )
- ,mbUpperIsFocused( FALSE )
+ ,mbUpperIsFocused( sal_False )
{
ImplInit( pParent, nStyle );
}
@@ -73,7 +73,7 @@ SpinButton::SpinButton( Window* pParent, WinBits nStyle )
SpinButton::SpinButton( Window* pParent, const ResId& rResId )
:Control( WINDOW_SPINBUTTON )
- ,mbUpperIsFocused( FALSE )
+ ,mbUpperIsFocused( sal_False )
{
rResId.SetRT( RSC_SPINBUTTON );
ImplInit( pParent, ImplInitRes( rResId ) );
@@ -116,7 +116,7 @@ void SpinButton::Up()
mnValue += mnValueStep;
StateChanged( STATE_CHANGE_DATA );
- ImplMoveFocus( TRUE );
+ ImplMoveFocus( sal_True );
}
ImplCallEventListenersAndHandler( VCLEVENT_SPINBUTTON_UP, maUpHdlLink, this );
@@ -131,7 +131,7 @@ void SpinButton::Down()
mnValue -= mnValueStep;
StateChanged( STATE_CHANGE_DATA );
- ImplMoveFocus( FALSE );
+ ImplMoveFocus( sal_False );
}
ImplCallEventListenersAndHandler( VCLEVENT_SPINBUTTON_DOWN, maDownHdlLink, this );
@@ -164,7 +164,7 @@ void SpinButton::Resize()
// -----------------------------------------------------------------------
-void SpinButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+void SpinButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -201,9 +201,9 @@ void SpinButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
aUpperRect += aPos;
aLowerRect += aPos;
- ImplDrawSpinButton( pDev, aUpperRect, aLowerRect, FALSE, FALSE,
+ ImplDrawSpinButton( pDev, aUpperRect, aLowerRect, sal_False, sal_False,
IsEnabled() && ImplIsUpperEnabled(),
- IsEnabled() && ImplIsLowerEnabled(), mbHorz, TRUE );
+ IsEnabled() && ImplIsLowerEnabled(), mbHorz, sal_True );
pDev->Pop();
}
@@ -212,10 +212,10 @@ void SpinButton::Paint( const Rectangle& )
{
HideFocus();
- BOOL bEnable = IsEnabled();
+ sal_Bool bEnable = IsEnabled();
ImplDrawSpinButton( this, maUpperRect, maLowerRect, mbUpperIn, mbLowerIn,
bEnable && ImplIsUpperEnabled(),
- bEnable && ImplIsLowerEnabled(), mbHorz, TRUE );
+ bEnable && ImplIsLowerEnabled(), mbHorz, sal_True );
if ( HasFocus() )
ShowFocus( maFocusRect );
@@ -227,14 +227,14 @@ void SpinButton::MouseButtonDown( const MouseEvent& rMEvt )
{
if ( maUpperRect.IsInside( rMEvt.GetPosPixel() ) && ( ImplIsUpperEnabled() ) )
{
- mbUpperIn = TRUE;
- mbInitialUp = TRUE;
+ mbUpperIn = sal_True;
+ mbInitialUp = sal_True;
Invalidate( maUpperRect );
}
else if ( maLowerRect.IsInside( rMEvt.GetPosPixel() ) && ( ImplIsLowerEnabled() ) )
{
- mbLowerIn = TRUE;
- mbInitialDown = TRUE;
+ mbLowerIn = sal_True;
+ mbInitialDown = sal_True;
Invalidate( maLowerRect );
}
@@ -260,20 +260,20 @@ void SpinButton::MouseButtonUp( const MouseEvent& )
if ( mbUpperIn )
{
- mbUpperIn = FALSE;
+ mbUpperIn = sal_False;
Invalidate( maUpperRect );
Update();
Up();
}
else if ( mbLowerIn )
{
- mbLowerIn = FALSE;
+ mbLowerIn = sal_False;
Invalidate( maLowerRect );
Update();
Down();
}
- mbInitialUp = mbInitialDown = FALSE;
+ mbInitialUp = mbInitialDown = sal_False;
}
// -----------------------------------------------------------------------
@@ -286,7 +286,7 @@ void SpinButton::MouseMove( const MouseEvent& rMEvt )
if ( !maUpperRect.IsInside( rMEvt.GetPosPixel() ) &&
mbUpperIn && mbInitialUp )
{
- mbUpperIn = FALSE;
+ mbUpperIn = sal_False;
maRepeatTimer.Stop();
Invalidate( maUpperRect );
Update();
@@ -294,7 +294,7 @@ void SpinButton::MouseMove( const MouseEvent& rMEvt )
else if ( !maLowerRect.IsInside( rMEvt.GetPosPixel() ) &&
mbLowerIn & mbInitialDown )
{
- mbLowerIn = FALSE;
+ mbLowerIn = sal_False;
maRepeatTimer.Stop();
Invalidate( maLowerRect );
Update();
@@ -302,7 +302,7 @@ void SpinButton::MouseMove( const MouseEvent& rMEvt )
else if ( maUpperRect.IsInside( rMEvt.GetPosPixel() ) &&
!mbUpperIn && mbInitialUp )
{
- mbUpperIn = TRUE;
+ mbUpperIn = sal_True;
if ( mbRepeat )
maRepeatTimer.Start();
Invalidate( maUpperRect );
@@ -311,7 +311,7 @@ void SpinButton::MouseMove( const MouseEvent& rMEvt )
else if ( maLowerRect.IsInside( rMEvt.GetPosPixel() ) &&
!mbLowerIn && mbInitialDown )
{
- mbLowerIn = TRUE;
+ mbLowerIn = sal_True;
if ( mbRepeat )
maRepeatTimer.Start();
Invalidate( maLowerRect );
@@ -330,7 +330,7 @@ void SpinButton::KeyInput( const KeyEvent& rKEvt )
case KEY_LEFT:
case KEY_RIGHT:
{
- BOOL bUp = KEY_RIGHT == rKEvt.GetKeyCode().GetCode();
+ sal_Bool bUp = KEY_RIGHT == rKEvt.GetKeyCode().GetCode();
if ( mbHorz && !ImplMoveFocus( bUp ) )
bUp ? Up() : Down();
}
@@ -339,7 +339,7 @@ void SpinButton::KeyInput( const KeyEvent& rKEvt )
case KEY_UP:
case KEY_DOWN:
{
- BOOL bUp = KEY_UP == rKEvt.GetKeyCode().GetCode();
+ sal_Bool bUp = KEY_UP == rKEvt.GetKeyCode().GetCode();
if ( !mbHorz && !ImplMoveFocus( KEY_UP == rKEvt.GetKeyCode().GetCode() ) )
bUp ? Up() : Down();
}
@@ -371,7 +371,7 @@ void SpinButton::StateChanged( StateChangedType nType )
case STATE_CHANGE_STYLE:
{
- BOOL bNewRepeat = 0 != ( GetStyle() & WB_REPEAT );
+ sal_Bool bNewRepeat = 0 != ( GetStyle() & WB_REPEAT );
if ( bNewRepeat != mbRepeat )
{
if ( maRepeatTimer.IsActive() )
@@ -382,7 +382,7 @@ void SpinButton::StateChanged( StateChangedType nType )
mbRepeat = bNewRepeat;
}
- BOOL bNewHorz = 0 != ( GetStyle() & WB_HSCROLL );
+ sal_Bool bNewHorz = 0 != ( GetStyle() & WB_HSCROLL );
if ( bNewHorz != mbHorz )
{
mbHorz = bNewHorz;
@@ -471,21 +471,21 @@ void SpinButton::LoseFocus()
// -----------------------------------------------------------------------
-BOOL SpinButton::ImplMoveFocus( BOOL _bUpper )
+sal_Bool SpinButton::ImplMoveFocus( sal_Bool _bUpper )
{
if ( _bUpper == mbUpperIsFocused )
- return FALSE;
+ return sal_False;
HideFocus();
ImplCalcFocusRect( _bUpper );
if ( HasFocus() )
ShowFocus( maFocusRect );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-void SpinButton::ImplCalcFocusRect( BOOL _bUpper )
+void SpinButton::ImplCalcFocusRect( sal_Bool _bUpper )
{
maFocusRect = _bUpper ? maUpperRect : maLowerRect;
// inflate by some pixels
diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index 1124819af8ab..f9215ab90835 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -41,8 +41,8 @@
void ImplGetSpinbuttonValue( Window *pWin, const Rectangle& rUpperRect,
const Rectangle& rLowerRect,
- BOOL bUpperIn, BOOL bLowerIn,
- BOOL bUpperEnabled, BOOL bLowerEnabled, BOOL bHorz,
+ sal_Bool bUpperIn, sal_Bool bLowerIn,
+ sal_Bool bUpperEnabled, sal_Bool bLowerEnabled, sal_Bool bHorz,
SpinbuttonValue& rValue )
{
// convert spinbutton data to a SpinbuttonValue structure for native painting
@@ -81,9 +81,9 @@ void ImplGetSpinbuttonValue( Window *pWin, const Rectangle& rUpperRect,
}
-BOOL ImplDrawNativeSpinfield( Window *pWin, const SpinbuttonValue& rSpinbuttonValue )
+sal_Bool ImplDrawNativeSpinfield( Window *pWin, const SpinbuttonValue& rSpinbuttonValue )
{
- BOOL bNativeOK = FALSE;
+ sal_Bool bNativeOK = sal_False;
if( pWin->IsNativeControlSupported(CTRL_SPINBOX, PART_ENTIRE_CONTROL) &&
// there is just no useful native support for spinfields with dropdown
@@ -132,9 +132,9 @@ BOOL ImplDrawNativeSpinfield( Window *pWin, const SpinbuttonValue& rSpinbuttonVa
return bNativeOK;
}
-BOOL ImplDrawNativeSpinbuttons( Window *pWin, const SpinbuttonValue& rSpinbuttonValue )
+sal_Bool ImplDrawNativeSpinbuttons( Window *pWin, const SpinbuttonValue& rSpinbuttonValue )
{
- BOOL bNativeOK = FALSE;
+ sal_Bool bNativeOK = sal_False;
if( pWin->IsNativeControlSupported(CTRL_SPINBUTTONS, PART_ENTIRE_CONTROL) )
{
@@ -148,13 +148,13 @@ BOOL ImplDrawNativeSpinbuttons( Window *pWin, const SpinbuttonValue& rSpinbutton
void ImplDrawSpinButton( OutputDevice* pOutDev,
const Rectangle& rUpperRect,
const Rectangle& rLowerRect,
- BOOL bUpperIn, BOOL bLowerIn,
- BOOL bUpperEnabled, BOOL bLowerEnabled, BOOL bHorz, BOOL bMirrorHorz )
+ sal_Bool bUpperIn, sal_Bool bLowerIn,
+ sal_Bool bUpperEnabled, sal_Bool bLowerEnabled, sal_Bool bHorz, sal_Bool bMirrorHorz )
{
DecorationView aDecoView( pOutDev );
- USHORT nStyle = BUTTON_DRAW_NOLEFTLIGHTBORDER;
- USHORT nSymStyle = 0;
+ sal_uInt16 nStyle = BUTTON_DRAW_NOLEFTLIGHTBORDER;
+ sal_uInt16 nSymStyle = 0;
SymbolType eType1, eType2;
@@ -188,11 +188,11 @@ void ImplDrawSpinButton( OutputDevice* pOutDev,
}
// Oberen/linken Button malen
- USHORT nTempStyle = nStyle;
+ sal_uInt16 nTempStyle = nStyle;
if ( bUpperIn )
nTempStyle |= BUTTON_DRAW_PRESSED;
- BOOL bNativeOK = FALSE;
+ sal_Bool bNativeOK = sal_False;
Rectangle aUpRect;
if( pOutDev->GetOutDevType() == OUTDEV_WINDOW )
@@ -298,14 +298,14 @@ void ImplDrawSpinButton( OutputDevice* pOutDev,
void SpinField::ImplInitSpinFieldData()
{
mpEdit = NULL;
- mbSpin = FALSE;
- mbRepeat = FALSE;
- mbUpperIn = FALSE;
- mbLowerIn = FALSE;
- mbInitialUp = FALSE;
- mbInitialDown = FALSE;
- mbNoSelect = FALSE;
- mbInDropDown = FALSE;
+ mbSpin = sal_False;
+ mbRepeat = sal_False;
+ mbUpperIn = sal_False;
+ mbLowerIn = sal_False;
+ mbInitialUp = sal_False;
+ mbInitialDown = sal_False;
+ mbNoSelect = sal_False;
+ mbInDropDown = sal_False;
}
// --------------------------------------------------------------------
@@ -316,7 +316,7 @@ void SpinField::ImplInit( Window* pParent, WinBits nWinStyle )
if ( nWinStyle & (WB_SPIN|WB_DROPDOWN) )
{
- mbSpin = TRUE;
+ mbSpin = sal_True;
// Some themes want external spin buttons, therefore the main
// spinfield should not overdraw the border between its encapsulated
@@ -330,7 +330,7 @@ void SpinField::ImplInit( Window* pParent, WinBits nWinStyle )
else
mpEdit = new Edit( this, WB_NOBORDER );
- mpEdit->EnableRTL( FALSE );
+ mpEdit->EnableRTL( sal_False );
mpEdit->SetPosPixel( Point() );
mpEdit->Show();
SetSubEdit( mpEdit );
@@ -338,9 +338,9 @@ void SpinField::ImplInit( Window* pParent, WinBits nWinStyle )
maRepeatTimer.SetTimeoutHdl( LINK( this, SpinField, ImplTimeout ) );
maRepeatTimer.SetTimeout( GetSettings().GetMouseSettings().GetButtonStartRepeat() );
if ( nWinStyle & WB_REPEAT )
- mbRepeat = TRUE;
+ mbRepeat = sal_True;
- SetCompoundControl( TRUE );
+ SetCompoundControl( sal_True );
}
}
@@ -417,7 +417,7 @@ void SpinField::MouseButtonDown( const MouseEvent& rMEvt )
{
if ( !HasFocus() && ( !mpEdit || !mpEdit->HasFocus() ) )
{
- mbNoSelect = TRUE;
+ mbNoSelect = sal_True;
GrabFocus();
}
@@ -425,20 +425,20 @@ void SpinField::MouseButtonDown( const MouseEvent& rMEvt )
{
if ( maUpperRect.IsInside( rMEvt.GetPosPixel() ) )
{
- mbUpperIn = TRUE;
- mbInitialUp = TRUE;
+ mbUpperIn = sal_True;
+ mbInitialUp = sal_True;
Invalidate( maUpperRect );
}
else if ( maLowerRect.IsInside( rMEvt.GetPosPixel() ) )
{
- mbLowerIn = TRUE;
- mbInitialDown = TRUE;
+ mbLowerIn = sal_True;
+ mbInitialDown = sal_True;
Invalidate( maLowerRect );
}
else if ( maDropDownRect.IsInside( rMEvt.GetPosPixel() ) )
{
// Rechts daneben liegt der DropDownButton:
- mbInDropDown = ShowDropDown( mbInDropDown ? FALSE : TRUE );
+ mbInDropDown = ShowDropDown( mbInDropDown ? sal_False : sal_True );
Paint( Rectangle( Point(), GetOutputSizePixel() ) );
}
@@ -460,20 +460,20 @@ void SpinField::MouseButtonDown( const MouseEvent& rMEvt )
void SpinField::MouseButtonUp( const MouseEvent& rMEvt )
{
ReleaseMouse();
- mbInitialUp = mbInitialDown = FALSE;
+ mbInitialUp = mbInitialDown = sal_False;
maRepeatTimer.Stop();
maRepeatTimer.SetTimeout( GetSettings().GetMouseSettings().GetButtonStartRepeat() );
if ( mbUpperIn )
{
- mbUpperIn = FALSE;
+ mbUpperIn = sal_False;
Invalidate( maUpperRect );
Update();
Up();
}
else if ( mbLowerIn )
{
- mbLowerIn = FALSE;
+ mbLowerIn = sal_False;
Invalidate( maLowerRect );
Update();
Down();
@@ -490,7 +490,7 @@ void SpinField::MouseMove( const MouseEvent& rMEvt )
{
if ( mbInitialUp )
{
- BOOL bNewUpperIn = maUpperRect.IsInside( rMEvt.GetPosPixel() );
+ sal_Bool bNewUpperIn = maUpperRect.IsInside( rMEvt.GetPosPixel() );
if ( bNewUpperIn != mbUpperIn )
{
if ( bNewUpperIn )
@@ -508,7 +508,7 @@ void SpinField::MouseMove( const MouseEvent& rMEvt )
}
else if ( mbInitialDown )
{
- BOOL bNewLowerIn = maLowerRect.IsInside( rMEvt.GetPosPixel() );
+ sal_Bool bNewLowerIn = maLowerRect.IsInside( rMEvt.GetPosPixel() );
if ( bNewLowerIn != mbLowerIn )
{
if ( bNewLowerIn )
@@ -539,7 +539,7 @@ long SpinField::Notify( NotifyEvent& rNEvt )
const KeyEvent& rKEvt = *rNEvt.GetKeyEvent();
if ( !IsReadOnly() )
{
- USHORT nMod = rKEvt.GetKeyCode().GetModifier();
+ sal_uInt16 nMod = rKEvt.GetKeyCode().GetModifier();
switch ( rKEvt.GetKeyCode().GetCode() )
{
case KEY_UP:
@@ -560,7 +560,7 @@ long SpinField::Notify( NotifyEvent& rNEvt )
}
else if ( ( nMod == KEY_MOD2 ) && !mbInDropDown && ( GetStyle() & WB_DROPDOWN ) )
{
- mbInDropDown = ShowDropDown( TRUE );
+ mbInDropDown = ShowDropDown( sal_True );
Paint( Rectangle( Point(), GetOutputSizePixel() ) );
nDone = 1;
}
@@ -592,7 +592,7 @@ long SpinField::Notify( NotifyEvent& rNEvt )
{
if ( ( rNEvt.GetCommandEvent()->GetCommand() == COMMAND_WHEEL ) && !IsReadOnly() )
{
- USHORT nWheelBehavior( GetSettings().GetMouseSettings().GetWheelBehavior() );
+ sal_uInt16 nWheelBehavior( GetSettings().GetMouseSettings().GetWheelBehavior() );
if ( ( nWheelBehavior == MOUSE_WHEEL_ALWAYS )
|| ( ( nWheelBehavior == MOUSE_WHEEL_FOCUS_ONLY )
&& HasChildPathFocus()
@@ -644,7 +644,7 @@ void SpinField::Paint( const Rectangle& rRect )
{
if ( mbSpin )
{
- BOOL bEnable = IsEnabled();
+ sal_Bool bEnable = IsEnabled();
ImplDrawSpinButton( this, maUpperRect, maLowerRect,
mbUpperIn, mbLowerIn, bEnable, bEnable );
}
@@ -653,7 +653,7 @@ void SpinField::Paint( const Rectangle& rRect )
{
DecorationView aView( this );
- USHORT nStyle = BUTTON_DRAW_NOLIGHTBORDER;
+ sal_uInt16 nStyle = BUTTON_DRAW_NOLIGHTBORDER;
if ( mbInDropDown )
nStyle |= BUTTON_DRAW_PRESSED;
Rectangle aInnerRect = aView.DrawButton( maDropDownRect, nStyle );
@@ -700,7 +700,7 @@ void SpinField::ImplCalcButtonAreas( OutputDevice* pDev, const Size& rOutSz, Rec
if ( !(aSize.Height() & 0x01) )
nBottom1--;
- BOOL bNativeRegionOK = FALSE;
+ sal_Bool bNativeRegionOK = sal_False;
Rectangle aContentUp, aContentDown;
if ( (pDev->GetOutDevType() == OUTDEV_WINDOW) &&
@@ -839,9 +839,9 @@ void SpinField::StateChanged( StateChangedType nType )
else if ( nType == STATE_CHANGE_STYLE )
{
if ( GetStyle() & WB_REPEAT )
- mbRepeat = TRUE;
+ mbRepeat = sal_True;
else
- mbRepeat = FALSE;
+ mbRepeat = sal_False;
}
else if ( nType == STATE_CHANGE_ZOOM )
{
@@ -854,21 +854,21 @@ void SpinField::StateChanged( StateChangedType nType )
{
if ( mpEdit )
mpEdit->SetControlFont( GetControlFont() );
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
if ( mpEdit )
mpEdit->SetControlForeground( GetControlForeground() );
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
if ( mpEdit )
mpEdit->SetControlBackground( GetControlBackground() );
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
else if( nType == STATE_CHANGE_MIRRORING )
@@ -959,15 +959,15 @@ long SpinField::PreNotify( NotifyEvent& rNEvt )
void SpinField::EndDropDown()
{
- mbInDropDown = FALSE;
+ mbInDropDown = sal_False;
Paint( Rectangle( Point(), GetOutputSizePixel() ) );
}
// -----------------------------------------------------------------------
-BOOL SpinField::ShowDropDown( BOOL )
+sal_Bool SpinField::ShowDropDown( sal_Bool )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -998,7 +998,7 @@ Size SpinField::GetOptimalSize(WindowSizeType eType) const
// -----------------------------------------------------------------------
-Size SpinField::CalcSize( USHORT nChars ) const
+Size SpinField::CalcSize( sal_uInt16 nChars ) const
{
Size aSz = Edit::CalcSize( nChars );
@@ -1031,7 +1031,7 @@ IMPL_LINK( SpinField, ImplTimeout, Timer*, pTimer )
// -----------------------------------------------------------------------
-void SpinField::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+void SpinField::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
Edit::Draw( pDev, rPos, rSize, nFlags );
@@ -1072,7 +1072,7 @@ void SpinField::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
if ( GetStyle() & WB_DROPDOWN )
{
DecorationView aView( pDev );
- USHORT nStyle = BUTTON_DRAW_NOLIGHTBORDER;
+ sal_uInt16 nStyle = BUTTON_DRAW_NOLIGHTBORDER;
Rectangle aInnerRect = aView.DrawButton( aDD, nStyle );
SymbolType eSymbol = SYMBOL_SPIN_DOWN;
if ( GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_SPINUPDOWN )
@@ -1084,7 +1084,7 @@ void SpinField::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
if ( GetStyle() & WB_SPIN )
{
- ImplDrawSpinButton( pDev, aUp, aDown, FALSE, FALSE, TRUE, TRUE );
+ ImplDrawSpinButton( pDev, aUp, aDown, sal_False, sal_False, sal_True, sal_True );
}
pDev->Pop();
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 5658d39cd3eb..bb60e7e5eea9 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -43,7 +43,6 @@
#include "vcl/controldata.hxx"
#include "vcl/sound.hxx"
#include "vcl/lstbox.hxx"
-#include "vcl/smartid.hxx"
#include "vcl/window.h"
@@ -54,22 +53,22 @@
struct ImplTabItem
{
- USHORT mnId;
- USHORT mnTabPageResId;
+ sal_uInt16 mnId;
+ sal_uInt16 mnTabPageResId;
TabPage* mpTabPage;
String maText;
String maFormatText;
String maHelpText;
- ULONG mnHelpId;
+ rtl::OString maHelpId;
Rectangle maRect;
- USHORT mnLine;
+ sal_uInt16 mnLine;
bool mbFullVisible;
bool mbEnabled;
Image maTabImage;
ImplTabItem()
- : mnId( 0 ), mnTabPageResId( 0 ), mpTabPage( NULL ), mnHelpId( 0 ),
- mnLine( 0 ), mbFullVisible( FALSE ), mbEnabled( true )
+ : mnId( 0 ), mnTabPageResId( 0 ), mpTabPage( NULL ),
+ mnLine( 0 ), mbFullVisible( sal_False ), mbEnabled( true )
{}
};
@@ -77,8 +76,6 @@ struct ImplTabItem
struct ImplTabCtrlData
{
- PushButton* mpLeftBtn;
- PushButton* mpRightBtn;
boost::unordered_map< int, int > maLayoutPageIdToLine;
boost::unordered_map< int, int > maLayoutLineToPageId;
std::vector< Rectangle > maTabRectangles;
@@ -113,9 +110,6 @@ void TabControl::ImplInit( Window* pParent, WinBits nStyle )
if ( !(nStyle & WB_NODIALOGCONTROL) )
nStyle |= WB_DIALOGCONTROL;
- // no single line tabs since NWF
- nStyle &= ~WB_SINGLELINE;
-
Control::ImplInit( pParent, nStyle, NULL );
mnLastWidth = 0;
@@ -124,23 +118,16 @@ void TabControl::ImplInit( Window* pParent, WinBits nStyle )
mnMaxPageWidth = 0;
mnActPageId = 0;
mnCurPageId = 0;
- mnFirstPagePos = 0;
- mnLastFirstPagePos = 0;
- mbFormat = TRUE;
- mbRestoreHelpId = FALSE;
- mbRestoreUnqId = FALSE;
- mbSingleLine = FALSE;
- mbScroll = FALSE;
- mbRestoreSmartId = FALSE;
- mbSmallInvalidate = FALSE;
- mbExtraSpace = FALSE;
+ mbFormat = sal_True;
+ mbRestoreHelpId = sal_False;
+ mbRestoreUnqId = sal_False;
+ mbSmallInvalidate = sal_False;
+ mbExtraSpace = sal_False;
mpTabCtrlData = new ImplTabCtrlData;
- mpTabCtrlData->mpLeftBtn = NULL;
- mpTabCtrlData->mpRightBtn = NULL;
mpTabCtrlData->mpListBox = NULL;
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
if( (nStyle & WB_DROPDOWN) )
{
@@ -153,7 +140,7 @@ void TabControl::ImplInit( Window* pParent, WinBits nStyle )
// if the tabcontrol is drawn (ie filled) by a native widget, make sure all contols will have transparent background
// otherwise they will paint with a wrong background
if( IsNativeControlSupported(CTRL_TAB_PANE, PART_ENTIRE_CONTROL) )
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
if ( pParent->IsDialog() )
pParent->AddChildEventListener( LINK( this, TabControl, ImplWindowEventListener ) );
@@ -186,8 +173,8 @@ WinBits TabControl::ImplInitStyle( WinBits nStyle )
// -----------------------------------------------------------------------
-void TabControl::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void TabControl::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
Control::ImplInitSettings( bFont, bForeground );
@@ -202,17 +189,17 @@ void TabControl::ImplInitSettings( BOOL bFont,
{
// set transparent mode for NWF tabcontrols to have
// the background always cleared properly
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
ImplGetWindowImpl()->mbUseNativeFocus = ImplGetSVData()->maNWFData.mbNoFocusRects;
}
else
{
- EnableChildTransparentMode( FALSE );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -220,8 +207,6 @@ void TabControl::ImplInitSettings( BOOL bFont,
SetBackground( pParent->GetBackground() );
}
}
-
- ImplScrollBtnsColor();
}
// -----------------------------------------------------------------------
@@ -265,14 +250,14 @@ void TabControl::ImplLoadRes( const ResId& rResId )
{
Control::ImplLoadRes( rResId );
- ULONG nObjMask = ReadLongRes();
+ sal_uLong nObjMask = ReadLongRes();
if ( nObjMask & RSC_TABCONTROL_ITEMLIST )
{
- ULONG nEle = ReadLongRes();
+ sal_uLong nEle = ReadLongRes();
// Item hinzufuegen
- for( ULONG i = 0; i < nEle; i++ )
+ for( sal_uLong i = 0; i < nEle; i++ )
{
InsertPage( ResId( (RSHEADER_TYPE *)GetClassRes(), *rResId.GetResMgr() ) );
IncrementRes( GetObjSizeRes( (RSHEADER_TYPE *)GetClassRes() ) );
@@ -294,17 +279,13 @@ TabControl::~TabControl()
{
if( mpTabCtrlData->mpListBox )
delete mpTabCtrlData->mpListBox;
- if ( mpTabCtrlData->mpLeftBtn )
- delete mpTabCtrlData->mpLeftBtn;
- if ( mpTabCtrlData->mpRightBtn )
- delete mpTabCtrlData->mpRightBtn;
delete mpTabCtrlData;
}
}
// -----------------------------------------------------------------------
-ImplTabItem* TabControl::ImplGetItem( USHORT nId ) const
+ImplTabItem* TabControl::ImplGetItem( sal_uInt16 nId ) const
{
for( std::vector< ImplTabItem >::iterator it = mpTabCtrlData->maItemList.begin();
it != mpTabCtrlData->maItemList.end(); ++it )
@@ -318,74 +299,6 @@ ImplTabItem* TabControl::ImplGetItem( USHORT nId ) const
// -----------------------------------------------------------------------
-void TabControl::ImplScrollBtnsColor()
-{
- if ( mpTabCtrlData && mpTabCtrlData->mpLeftBtn )
- {
- mpTabCtrlData->mpLeftBtn->SetControlForeground();
- mpTabCtrlData->mpRightBtn->SetControlForeground();
- }
-}
-
-// -----------------------------------------------------------------------
-
-void TabControl::ImplSetScrollBtnsState()
-{
- if ( mbScroll )
- {
- mpTabCtrlData->mpLeftBtn->Enable( mnFirstPagePos != 0 );
- mpTabCtrlData->mpRightBtn->Enable( mnFirstPagePos < mnLastFirstPagePos );
- }
-}
-
-// -----------------------------------------------------------------------
-
-void TabControl::ImplPosScrollBtns()
-{
- if ( mbScroll )
- {
- if ( !mpTabCtrlData->mpLeftBtn )
- {
- mpTabCtrlData->mpLeftBtn = new PushButton( this, WB_RECTSTYLE | WB_SMALLSTYLE | WB_NOPOINTERFOCUS | WB_REPEAT );
- mpTabCtrlData->mpLeftBtn->SetSymbol( SYMBOL_PREV );
- mpTabCtrlData->mpLeftBtn->SetClickHdl( LINK( this, TabControl, ImplScrollBtnHdl ) );
- }
- if ( !mpTabCtrlData->mpRightBtn )
- {
- mpTabCtrlData->mpRightBtn = new PushButton( this, WB_RECTSTYLE | WB_SMALLSTYLE | WB_NOPOINTERFOCUS | WB_REPEAT );
- mpTabCtrlData->mpRightBtn->SetSymbol( SYMBOL_NEXT );
- mpTabCtrlData->mpRightBtn->SetClickHdl( LINK( this, TabControl, ImplScrollBtnHdl ) );
- }
-
- Rectangle aRect = ImplGetTabRect( TAB_PAGERECT );
- aRect.Left() -= TAB_OFFSET;
- aRect.Top() -= TAB_OFFSET;
- aRect.Right() += TAB_OFFSET;
- aRect.Bottom() += TAB_OFFSET;
- long nX = aRect.Right()-mnBtnSize+1;
- long nY = aRect.Top()-mnBtnSize;
- mpTabCtrlData->mpRightBtn->SetPosSizePixel( nX, nY, mnBtnSize, mnBtnSize );
- nX -= mnBtnSize;
- mpTabCtrlData->mpLeftBtn->SetPosSizePixel( nX, nY, mnBtnSize, mnBtnSize );
- ImplScrollBtnsColor();
- ImplSetScrollBtnsState();
- mpTabCtrlData->mpLeftBtn->Show();
- mpTabCtrlData->mpRightBtn->Show();
- }
- else
- {
- if ( mpTabCtrlData )
- {
- if ( mpTabCtrlData->mpLeftBtn )
- mpTabCtrlData->mpLeftBtn->Hide();
- if ( mpTabCtrlData->mpRightBtn )
- mpTabCtrlData->mpRightBtn->Hide();
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth )
{
pItem->maFormatText = pItem->maText;
@@ -453,7 +366,7 @@ Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth )
// -----------------------------------------------------------------------
-Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight )
+Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, long nHeight )
{
Size aWinSize = Control::GetOutputSizePixel();
if ( nWidth < 0 )
@@ -472,7 +385,7 @@ Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight
if ( nItemPos == TAB_PAGERECT )
{
- USHORT nLastPos;
+ sal_uInt16 nLastPos;
if ( mnCurPageId )
nLastPos = GetPagePos( mnCurPageId );
else
@@ -496,9 +409,9 @@ Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight
{
Font aFont( GetFont() );
Font aLightFont = aFont;
- aFont.SetTransparent( TRUE );
+ aFont.SetTransparent( sal_True );
aFont.SetWeight( (!ImplGetSVData()->maNWFData.mbNoBoldTabFocus) ? WEIGHT_BOLD : WEIGHT_LIGHT );
- aLightFont.SetTransparent( TRUE );
+ aLightFont.SetTransparent( sal_True );
aLightFont.SetWeight( WEIGHT_LIGHT );
// If Bold and none Bold strings have the same width, we
@@ -518,18 +431,16 @@ Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight
long nX = nOffsetX;
long nY = nOffsetY;
long nMaxWidth = nWidth;
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
if ( (mnMaxPageWidth > 0) && (mnMaxPageWidth < nMaxWidth) )
nMaxWidth = mnMaxPageWidth;
nMaxWidth -= GetItemsOffset().X();
- mbScroll = FALSE;
-
- USHORT nLines = 0;
- USHORT nCurLine = 0;
+ sal_uInt16 nLines = 0;
+ sal_uInt16 nCurLine = 0;
long nLineWidthAry[100];
- USHORT nLinePosAry[101];
+ sal_uInt16 nLinePosAry[101];
nLineWidthAry[0] = 0;
nLinePosAry[0] = 0;
@@ -552,10 +463,10 @@ Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight
Rectangle aNewRect( Point( nX, nY ), aSize );
if ( mbSmallInvalidate && (it->maRect != aNewRect) )
- mbSmallInvalidate = FALSE;
+ mbSmallInvalidate = sal_False;
it->maRect = aNewRect;
it->mnLine = nLines;
- it->mbFullVisible = TRUE;
+ it->mbFullVisible = sal_True;
nLineWidthAry[nLines] += aSize.Width();
nX += aSize.Width();
@@ -571,8 +482,8 @@ Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight
long nDX = 0;
long nModDX = 0;
long nIDX = 0;
- USHORT i;
- USHORT n;
+ sal_uInt16 i;
+ sal_uInt16 n;
long nLineHeightAry[100];
long nIH = mpTabCtrlData->maItemList[0].maRect.Bottom()-2;
@@ -588,7 +499,7 @@ Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight
i = 0;
n = 0;
- nLinePosAry[nLines+1] = (USHORT)mpTabCtrlData->maItemList.size();
+ nLinePosAry[nLines+1] = (sal_uInt16)mpTabCtrlData->maItemList.size();
for( std::vector< ImplTabItem >::iterator it = mpTabCtrlData->maItemList.begin();
it != mpTabCtrlData->maItemList.end(); ++it )
{
@@ -649,9 +560,7 @@ Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight
mnLastWidth = nWidth;
mnLastHeight = nHeight;
- mbFormat = FALSE;
-
- ImplPosScrollBtns();
+ mbFormat = sal_False;
}
return size_t(nItemPos) < mpTabCtrlData->maItemList.size() ? mpTabCtrlData->maItemList[nItemPos].maRect : Rectangle();
@@ -659,7 +568,7 @@ Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight
// -----------------------------------------------------------------------
-void TabControl::ImplChangeTabPage( USHORT nId, USHORT nOldId )
+void TabControl::ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId )
{
ImplFreeLayoutData();
@@ -671,7 +580,7 @@ void TabControl::ImplChangeTabPage( USHORT nId, USHORT nOldId )
if ( IsReallyVisible() && IsUpdateMode() )
{
- USHORT nPos = GetPagePos( nId );
+ sal_uInt16 nPos = GetPagePos( nId );
Rectangle aRect = ImplGetTabRect( nPos );
if ( !pOldItem || (pOldItem->mnLine != pItem->mnLine) )
@@ -703,11 +612,9 @@ void TabControl::ImplChangeTabPage( USHORT nId, USHORT nOldId )
if ( pOldPage )
{
if ( mbRestoreHelpId )
- pCtrlParent->SetHelpId( 0 );
+ pCtrlParent->SetHelpId( rtl::OString() );
if ( mbRestoreUnqId )
- pCtrlParent->SetUniqueId( 0 );
- if( mbRestoreSmartId )
- pCtrlParent->SetSmartHelpId( SmartId() );
+ pCtrlParent->SetUniqueId( rtl::OString() );
pOldPage->DeactivatePage();
}
@@ -723,27 +630,22 @@ void TabControl::ImplChangeTabPage( USHORT nId, USHORT nOldId )
// activate page here so the conbtrols can be switched
// also set the help id of the parent window to that of the tab page
- if ( !GetHelpId() )
+ if ( !GetHelpId().getLength() )
{
- mbRestoreHelpId = TRUE;
+ mbRestoreHelpId = sal_True;
pCtrlParent->SetHelpId( pPage->GetHelpId() );
}
- if ( !pCtrlParent->GetUniqueId() )
+ if ( !pCtrlParent->GetUniqueId().getLength() )
{
- mbRestoreUnqId = TRUE;
+ mbRestoreUnqId = sal_True;
pCtrlParent->SetUniqueId( pPage->GetUniqueId() );
}
- if( ! GetSmartHelpId().HasAny() )
- {
- mbRestoreSmartId = TRUE;
- pCtrlParent->SetSmartHelpId( pPage->GetSmartHelpId() );
- }
pPage->ActivatePage();
if ( pOldPage && pOldPage->HasChildPathFocus() )
{
- USHORT n = 0;
+ sal_uInt16 n = 0;
Window* pFirstChild = pPage->ImplGetDlgWindow( n, DLGWINDOW_FIRST );
if ( pFirstChild )
pFirstChild->ImplControlFocus( GETFOCUS_INIT );
@@ -773,7 +675,7 @@ void TabControl::ImplChangeTabPage( USHORT nId, USHORT nOldId )
// -----------------------------------------------------------------------
-BOOL TabControl::ImplPosCurTabPage()
+sal_Bool TabControl::ImplPosCurTabPage()
{
// Aktuelle TabPage resizen/positionieren
ImplTabItem* pItem = ImplGetItem( GetCurPageId() );
@@ -783,21 +685,21 @@ BOOL TabControl::ImplPosCurTabPage()
{
Rectangle aRectNoTab( (const Point&)Point( 0, 0 ), GetSizePixel() );
pItem->mpTabPage->SetPosSizePixel( aRectNoTab.TopLeft(), aRectNoTab.GetSize() );
- return TRUE;
+ return sal_True;
}
Rectangle aRect = ImplGetTabRect( TAB_PAGERECT );
pItem->mpTabPage->SetPosSizePixel( aRect.TopLeft(), aRect.GetSize() );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void TabControl::ImplActivateTabPage( BOOL bNext )
+void TabControl::ImplActivateTabPage( sal_Bool bNext )
{
- USHORT nCurPos = GetPagePos( GetCurPageId() );
+ sal_uInt16 nCurPos = GetPagePos( GetCurPageId() );
if ( bNext )
nCurPos = (nCurPos + 1) % GetPageCount();
@@ -814,13 +716,6 @@ void TabControl::ImplActivateTabPage( BOOL bNext )
// -----------------------------------------------------------------------
-void TabControl::ImplSetFirstPagePos( USHORT )
-{
- return; // was only required for single line
-}
-
-// -----------------------------------------------------------------------
-
void TabControl::ImplShowFocus()
{
if ( !GetPageCount() || mpTabCtrlData->mpListBox )
@@ -834,14 +729,14 @@ void TabControl::ImplShowFocus()
aFont.SetWeight( (!ImplGetSVData()->maNWFData.mbNoBoldTabFocus) ? WEIGHT_BOLD : WEIGHT_LIGHT );
SetFont( aFont );
- USHORT nCurPos = GetPagePos( mnCurPageId );
+ sal_uInt16 nCurPos = GetPagePos( mnCurPageId );
Rectangle aRect = ImplGetTabRect( nCurPos );
const ImplTabItem& rItem = mpTabCtrlData->maItemList[ nCurPos ];
Size aTabSize = aRect.GetSize();
Size aImageSize( 0, 0 );
long nTextHeight = GetTextHeight();
long nTextWidth = GetCtrlTextWidth( rItem.maFormatText );
- USHORT nOff;
+ sal_uInt16 nOff;
if ( !(GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_MONO) )
nOff = 1;
@@ -903,13 +798,13 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo
Rectangle aRect = pItem->maRect;
long nLeftBottom = aRect.Bottom();
long nRightBottom = aRect.Bottom();
- BOOL bLeftBorder = TRUE;
- BOOL bRightBorder = TRUE;
- USHORT nOff;
- BOOL bNativeOK = FALSE;
+ sal_Bool bLeftBorder = sal_True;
+ sal_Bool bRightBorder = sal_True;
+ sal_uInt16 nOff;
+ sal_Bool bNativeOK = sal_False;
- USHORT nOff2 = 0;
- USHORT nOff3 = 0;
+ sal_uInt16 nOff2 = 0;
+ sal_uInt16 nOff3 = 0;
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
nOff = 1;
@@ -931,10 +826,10 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo
{
aLeftTestPos.X() -= 2;
if ( rCurRect.IsInside( aLeftTestPos ) )
- bLeftBorder = FALSE;
+ bLeftBorder = sal_False;
aRightTestPos.X() += 2;
if ( rCurRect.IsInside( aRightTestPos ) )
- bRightBorder = FALSE;
+ bRightBorder = sal_False;
}
else
{
@@ -945,7 +840,7 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo
}
}
- if( !bLayout && (bNativeOK = IsNativeControlSupported(CTRL_TAB_ITEM, PART_ENTIRE_CONTROL)) == TRUE )
+ if( !bLayout && (bNativeOK = IsNativeControlSupported(CTRL_TAB_ITEM, PART_ENTIRE_CONTROL)) == sal_True )
{
Rectangle aCtrlRegion( pItem->maRect );
ControlState nState = 0;
@@ -1044,7 +939,7 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo
// set font accordingly, current item is painted bold
// we set the font attributes always before drawing to be re-entrant (DrawNativeControl may trigger additional paints)
Font aFont( GetFont() );
- aFont.SetTransparent( TRUE );
+ aFont.SetTransparent( sal_True );
aFont.SetWeight( ((bIsCurrentItem) && (!ImplGetSVData()->maNWFData.mbNoBoldTabFocus)) ? WEIGHT_BOLD : WEIGHT_LIGHT );
SetFont( aFont );
@@ -1062,7 +957,7 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo
long nYPos = aRect.Top()+((aTabSize.Height()-nTextHeight)/2)-nOff3;
if( pItem->maFormatText.Len() )
{
- USHORT nStyle = TEXT_DRAW_MNEMONIC;
+ sal_uInt16 nStyle = TEXT_DRAW_MNEMONIC;
if( ! pItem->mbEnabled )
nStyle |= TEXT_DRAW_DISABLE;
DrawCtrlText( Point( nXPos + aImageSize.Width(), nYPos ),
@@ -1091,7 +986,7 @@ long TabControl::ImplHandleKeyEvent( const KeyEvent& rKeyEvent )
if ( GetPageCount() > 1 )
{
KeyCode aKeyCode = rKeyEvent.GetKeyCode();
- USHORT nKeyCode = aKeyCode.GetCode();
+ sal_uInt16 nKeyCode = aKeyCode.GetCode();
if ( aKeyCode.IsMod1() )
{
@@ -1099,7 +994,7 @@ long TabControl::ImplHandleKeyEvent( const KeyEvent& rKeyEvent )
{
if ( (nKeyCode == KEY_TAB) || (nKeyCode == KEY_PAGEUP) )
{
- ImplActivateTabPage( FALSE );
+ ImplActivateTabPage( sal_False );
nRet = 1;
}
}
@@ -1107,7 +1002,7 @@ long TabControl::ImplHandleKeyEvent( const KeyEvent& rKeyEvent )
{
if ( (nKeyCode == KEY_TAB) || (nKeyCode == KEY_PAGEDOWN) )
{
- ImplActivateTabPage( TRUE );
+ ImplActivateTabPage( sal_True );
nRet = 1;
}
}
@@ -1120,14 +1015,6 @@ long TabControl::ImplHandleKeyEvent( const KeyEvent& rKeyEvent )
// -----------------------------------------------------------------------
-IMPL_LINK( TabControl, ImplScrollBtnHdl, PushButton*, EMPTYARG )
-{
- ImplSetScrollBtnsState();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
IMPL_LINK( TabControl, ImplListBoxSelectHdl, ListBox*, EMPTYARG )
{
SelectTabPage( GetPageId( mpTabCtrlData->mpListBox->GetSelectEntryPos() ) );
@@ -1160,7 +1047,7 @@ void TabControl::MouseButtonDown( const MouseEvent& rMEvt )
{
if( rMEvt.IsLeft() )
{
- USHORT nPageId = GetPageId( rMEvt.GetPosPixel() );
+ sal_uInt16 nPageId = GetPageId( rMEvt.GetPosPixel() );
ImplTabItem* pItem = ImplGetItem( nPageId );
if( pItem && pItem->mbEnabled )
SelectTabPage( nPageId );
@@ -1177,11 +1064,11 @@ void TabControl::KeyInput( const KeyEvent& rKEvt )
else if ( GetPageCount() > 1 )
{
KeyCode aKeyCode = rKEvt.GetKeyCode();
- USHORT nKeyCode = aKeyCode.GetCode();
+ sal_uInt16 nKeyCode = aKeyCode.GetCode();
if ( (nKeyCode == KEY_LEFT) || (nKeyCode == KEY_RIGHT) )
{
- BOOL bNext = (nKeyCode == KEY_RIGHT);
+ sal_Bool bNext = (nKeyCode == KEY_RIGHT);
ImplActivateTabPage( bNext );
}
}
@@ -1231,17 +1118,17 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout )
// increased to avoid round corners that might be drawn by a theme
// in this case we're only interested in the top border of the tabpage because the tabitems are used
// standalone (eg impress)
- BOOL bNoTabPage = FALSE;
+ sal_Bool bNoTabPage = sal_False;
TabPage* pCurPage = (pCurItem) ? pCurItem->mpTabPage : NULL;
if( !pCurPage || !pCurPage->IsVisible() )
{
- bNoTabPage = TRUE;
+ bNoTabPage = sal_True;
aRect.Left()-=10;
aRect.Right()+=10;
}
- BOOL bNativeOK = FALSE;
- if( ! bLayout && (bNativeOK = IsNativeControlSupported( CTRL_TAB_PANE, PART_ENTIRE_CONTROL) ) == TRUE )
+ sal_Bool bNativeOK = sal_False;
+ if( ! bLayout && (bNativeOK = IsNativeControlSupported( CTRL_TAB_PANE, PART_ENTIRE_CONTROL) ) == sal_True )
{
const ImplControlValue aControlValue;
@@ -1352,7 +1239,7 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout )
if( !rRect.IsEmpty() )
aClipRgn.Intersect( rRect );
if( bLayout || !aClipRgn.IsEmpty() )
- ImplDrawItem( pItem, aCurRect, bLayout, (pItem==pFirstTab), (pItem==pLastTab), FALSE );
+ ImplDrawItem( pItem, aCurRect, bLayout, (pItem==pFirstTab), (pItem==pLastTab), sal_False );
}
if ( bDrawTabsRTL )
@@ -1368,7 +1255,7 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout )
if( !rRect.IsEmpty() )
aClipRgn.Intersect( rRect );
if( bLayout || !aClipRgn.IsEmpty() )
- ImplDrawItem( pCurItem, aCurRect, bLayout, (pCurItem==pFirstTab), (pCurItem==pLastTab), TRUE );
+ ImplDrawItem( pCurItem, aCurRect, bLayout, (pCurItem==pFirstTab), (pCurItem==pLastTab), sal_True );
}
}
@@ -1376,7 +1263,7 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout )
ImplShowFocus();
if( ! bLayout )
- mbSmallInvalidate = TRUE;
+ mbSmallInvalidate = sal_True;
}
// -----------------------------------------------------------------------
@@ -1400,26 +1287,21 @@ void TabControl::Resize()
mpTabCtrlData->mpListBox->SetPosSizePixel( aNewPos, aNewSize );
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
// Aktuelle TabPage resizen/positionieren
- BOOL bTabPage = ImplPosCurTabPage();
+ sal_Bool bTabPage = ImplPosCurTabPage();
// Feststellen, was invalidiert werden muss
Size aNewSize = Control::GetOutputSizePixel();
long nNewWidth = aNewSize.Width();
- if ( mbScroll )
- mbSmallInvalidate = FALSE;
- else
+ for( std::vector< ImplTabItem >::iterator it = mpTabCtrlData->maItemList.begin();
+ it != mpTabCtrlData->maItemList.end(); ++it )
{
- for( std::vector< ImplTabItem >::iterator it = mpTabCtrlData->maItemList.begin();
- it != mpTabCtrlData->maItemList.end(); ++it )
+ if ( !it->mbFullVisible ||
+ (it->maRect.Right()-2 >= nNewWidth) )
{
- if ( !it->mbFullVisible ||
- (it->maRect.Right()-2 >= nNewWidth) )
- {
- mbSmallInvalidate = FALSE;
- break;
- }
+ mbSmallInvalidate = sal_False;
+ break;
}
}
@@ -1475,7 +1357,7 @@ void TabControl::LoseFocus()
void TabControl::RequestHelp( const HelpEvent& rHEvt )
{
- USHORT nItemId = rHEvt.KeyboardActivated() ? mnCurPageId : GetPageId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
+ sal_uInt16 nItemId = rHEvt.KeyboardActivated() ? mnCurPageId : GetPageId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
if ( nItemId )
{
@@ -1497,13 +1379,13 @@ void TabControl::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;
}
}
@@ -1564,7 +1446,7 @@ void TabControl::Command( const CommandEvent& rCEvt )
if( (mpTabCtrlData->mpListBox == NULL) && (rCEvt.GetCommand() == COMMAND_CONTEXTMENU) && (GetPageCount() > 1) )
{
Point aMenuPos;
- BOOL bMenu;
+ sal_Bool bMenu;
if ( rCEvt.IsMouseEvent() )
{
aMenuPos = rCEvt.GetMousePosPixel();
@@ -1573,7 +1455,7 @@ void TabControl::Command( const CommandEvent& rCEvt )
else
{
aMenuPos = ImplGetTabRect( GetPagePos( mnCurPageId ) ).Center();
- bMenu = TRUE;
+ bMenu = sal_True;
}
if ( bMenu )
@@ -1585,10 +1467,10 @@ void TabControl::Command( const CommandEvent& rCEvt )
aMenu.InsertItem( it->mnId, it->maText, MIB_CHECKABLE | MIB_RADIOCHECK );
if ( it->mnId == mnCurPageId )
aMenu.CheckItem( it->mnId );
- aMenu.SetHelpId( it->mnId, it->mnHelpId );
+ aMenu.SetHelpId( it->mnId, it->maHelpId );
}
- USHORT nId = aMenu.Execute( this, aMenuPos );
+ sal_uInt16 nId = aMenu.Execute( this, aMenuPos );
if ( nId && (nId != mnCurPageId) )
SelectTabPage( nId );
return;
@@ -1618,17 +1500,17 @@ void TabControl::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 )
@@ -1648,7 +1530,7 @@ void TabControl::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
}
@@ -1748,7 +1630,7 @@ long TabControl::DeactivatePage()
if ( maDeactivateHdl.IsSet() )
return maDeactivateHdl.Call( this );
else
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -1775,16 +1657,16 @@ Size TabControl::GetTabPageSizePixel() const
// -----------------------------------------------------------------------
-void TabControl::InsertPage( const ResId& rResId, USHORT nPos )
+void TabControl::InsertPage( const ResId& rResId, sal_uInt16 nPos )
{
GetRes( rResId.SetRT( RSC_TABCONTROLITEM ) );
- ULONG nObjMask = ReadLongRes();
- USHORT nItemId = 1;
+ sal_uLong nObjMask = ReadLongRes();
+ sal_uInt16 nItemId = 1;
// ID
if ( nObjMask & RSC_TABCONTROLITEM_ID )
- nItemId = sal::static_int_cast<USHORT>(ReadLongRes());
+ nItemId = sal::static_int_cast<sal_uInt16>(ReadLongRes());
// Text
XubString aTmpStr;
@@ -1796,14 +1678,14 @@ void TabControl::InsertPage( const ResId& rResId, USHORT nPos )
if ( nObjMask & RSC_TABCONTROLITEM_PAGERESID )
{
ImplTabItem& rItem = mpTabCtrlData->maItemList[ GetPagePos( nItemId ) ];
- rItem.mnTabPageResId = sal::static_int_cast<USHORT>(ReadLongRes());
+ rItem.mnTabPageResId = sal::static_int_cast<sal_uInt16>(ReadLongRes());
}
}
// -----------------------------------------------------------------------
-void TabControl::InsertPage( USHORT nPageId, const XubString& rText,
- USHORT nPos )
+void TabControl::InsertPage( sal_uInt16 nPageId, const XubString& rText,
+ sal_uInt16 nPos )
{
DBG_ASSERT( nPageId, "TabControl::InsertPage(): PageId == 0" );
DBG_ASSERT( GetPagePos( nPageId ) == TAB_PAGE_NOTFOUND,
@@ -1841,11 +1723,10 @@ void TabControl::InsertPage( USHORT nPageId, const XubString& rText,
pItem->mnId = nPageId;
pItem->mpTabPage = NULL;
pItem->mnTabPageResId = 0;
- pItem->mnHelpId = 0;
pItem->maText = rText;
- pItem->mbFullVisible = FALSE;
+ pItem->mbFullVisible = sal_False;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsUpdateMode() )
Invalidate();
@@ -1853,14 +1734,14 @@ void TabControl::InsertPage( USHORT nPageId, const XubString& rText,
if( mpTabCtrlData->mpListBox ) // reposition/resize listbox
Resize();
- ImplCallEventListeners( VCLEVENT_TABPAGE_INSERTED, (void*) (ULONG)nPageId );
+ ImplCallEventListeners( VCLEVENT_TABPAGE_INSERTED, (void*) (sal_uLong)nPageId );
}
// -----------------------------------------------------------------------
-void TabControl::RemovePage( USHORT nPageId )
+void TabControl::RemovePage( sal_uInt16 nPageId )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
// does the item exist ?
if ( nPos != TAB_PAGE_NOTFOUND )
@@ -1894,13 +1775,13 @@ void TabControl::RemovePage( USHORT nPageId )
}
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsUpdateMode() )
Invalidate();
ImplFreeLayoutData();
- ImplCallEventListeners( VCLEVENT_TABPAGE_REMOVED, (void*) (ULONG) nPageId );
+ ImplCallEventListeners( VCLEVENT_TABPAGE_REMOVED, (void*) (sal_uLong) nPageId );
}
}
@@ -1916,7 +1797,7 @@ void TabControl::Clear()
ImplFreeLayoutData();
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsUpdateMode() )
Invalidate();
@@ -1925,14 +1806,14 @@ void TabControl::Clear()
// -----------------------------------------------------------------------
-void TabControl::EnablePage( USHORT i_nPageId, bool i_bEnable )
+void TabControl::EnablePage( sal_uInt16 i_nPageId, bool i_bEnable )
{
ImplTabItem* pItem = ImplGetItem( i_nPageId );
if ( pItem && pItem->mbEnabled != i_bEnable )
{
pItem->mbEnabled = i_bEnable;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if( mpTabCtrlData->mpListBox )
mpTabCtrlData->mpListBox->SetEntryFlags( GetPagePos( i_nPageId ),
i_bEnable ? 0 : (LISTBOX_ENTRY_FLAG_DISABLE_SELECTION | LISTBOX_ENTRY_FLAG_DRAW_DISABLED) );
@@ -1948,14 +1829,14 @@ void TabControl::EnablePage( USHORT i_nPageId, bool i_bEnable )
// -----------------------------------------------------------------------
-USHORT TabControl::GetPageCount() const
+sal_uInt16 TabControl::GetPageCount() const
{
- return (USHORT)mpTabCtrlData->maItemList.size();
+ return (sal_uInt16)mpTabCtrlData->maItemList.size();
}
// -----------------------------------------------------------------------
-USHORT TabControl::GetPageId( USHORT nPos ) const
+sal_uInt16 TabControl::GetPageId( sal_uInt16 nPos ) const
{
if( size_t(nPos) < mpTabCtrlData->maItemList.size() )
return mpTabCtrlData->maItemList[ nPos ].mnId;
@@ -1964,13 +1845,13 @@ USHORT TabControl::GetPageId( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT TabControl::GetPagePos( USHORT nPageId ) const
+sal_uInt16 TabControl::GetPagePos( sal_uInt16 nPageId ) const
{
for( std::vector< ImplTabItem >::const_iterator it = mpTabCtrlData->maItemList.begin();
it != mpTabCtrlData->maItemList.end(); ++it )
{
if ( it->mnId == nPageId )
- return (USHORT)(it - mpTabCtrlData->maItemList.begin());
+ return (sal_uInt16)(it - mpTabCtrlData->maItemList.begin());
}
return TAB_PAGE_NOTFOUND;
@@ -1978,11 +1859,11 @@ USHORT TabControl::GetPagePos( USHORT nPageId ) const
// -----------------------------------------------------------------------
-USHORT TabControl::GetPageId( const Point& rPos ) const
+sal_uInt16 TabControl::GetPageId( const Point& rPos ) const
{
for( size_t i = 0; i < mpTabCtrlData->maItemList.size(); ++i )
{
- if ( ((TabControl*)this)->ImplGetTabRect( static_cast<USHORT>(i) ).IsInside( rPos ) )
+ if ( ((TabControl*)this)->ImplGetTabRect( static_cast<sal_uInt16>(i) ).IsInside( rPos ) )
return mpTabCtrlData->maItemList[ i ].mnId;
}
@@ -1991,9 +1872,9 @@ USHORT TabControl::GetPageId( const Point& rPos ) const
// -----------------------------------------------------------------------
-void TabControl::SetCurPageId( USHORT nPageId )
+void TabControl::SetCurPageId( sal_uInt16 nPageId )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
while( nPos != TAB_PAGE_NOTFOUND &&
! mpTabCtrlData->maItemList[nPos].mbEnabled )
{
@@ -2018,8 +1899,8 @@ void TabControl::SetCurPageId( USHORT nPageId )
mnActPageId = nPageId;
else
{
- mbFormat = TRUE;
- USHORT nOldId = mnCurPageId;
+ mbFormat = sal_True;
+ sal_uInt16 nOldId = mnCurPageId;
mnCurPageId = nPageId;
ImplChangeTabPage( nPageId, nOldId );
}
@@ -2028,7 +1909,7 @@ void TabControl::SetCurPageId( USHORT nPageId )
// -----------------------------------------------------------------------
-USHORT TabControl::GetCurPageId() const
+sal_uInt16 TabControl::GetCurPageId() const
{
if ( mnActPageId )
return mnActPageId;
@@ -2038,20 +1919,13 @@ USHORT TabControl::GetCurPageId() const
// -----------------------------------------------------------------------
-void TabControl::SetFirstPageId( USHORT )
-{
- return; // was only required for single line
-}
-
-// -----------------------------------------------------------------------
-
-void TabControl::SelectTabPage( USHORT nPageId )
+void TabControl::SelectTabPage( sal_uInt16 nPageId )
{
if ( nPageId && (nPageId != mnCurPageId) )
{
ImplFreeLayoutData();
- ImplCallEventListeners( VCLEVENT_TABPAGE_DEACTIVATE, (void*) (ULONG) mnCurPageId );
+ ImplCallEventListeners( VCLEVENT_TABPAGE_DEACTIVATE, (void*) (sal_uLong) mnCurPageId );
if ( DeactivatePage() )
{
mnActPageId = nPageId;
@@ -2062,14 +1936,14 @@ void TabControl::SelectTabPage( USHORT nPageId )
SetCurPageId( nPageId );
if( mpTabCtrlData->mpListBox )
mpTabCtrlData->mpListBox->SelectEntryPos( GetPagePos( nPageId ) );
- ImplCallEventListeners( VCLEVENT_TABPAGE_ACTIVATE, (void*) (ULONG) nPageId );
+ ImplCallEventListeners( VCLEVENT_TABPAGE_ACTIVATE, (void*) (sal_uLong) nPageId );
}
}
}
// -----------------------------------------------------------------------
-void TabControl::SetTabPage( USHORT nPageId, TabPage* pTabPage )
+void TabControl::SetTabPage( sal_uInt16 nPageId, TabPage* pTabPage )
{
ImplTabItem* pItem = ImplGetItem( nPageId );
@@ -2094,7 +1968,7 @@ void TabControl::SetTabPage( USHORT nPageId, TabPage* pTabPage )
// -----------------------------------------------------------------------
-TabPage* TabControl::GetTabPage( USHORT nPageId ) const
+TabPage* TabControl::GetTabPage( sal_uInt16 nPageId ) const
{
ImplTabItem* pItem = ImplGetItem( nPageId );
@@ -2106,7 +1980,7 @@ TabPage* TabControl::GetTabPage( USHORT nPageId ) const
// -----------------------------------------------------------------------
-USHORT TabControl::GetTabPageResId( USHORT nPageId ) const
+sal_uInt16 TabControl::GetTabPageResId( sal_uInt16 nPageId ) const
{
ImplTabItem* pItem = ImplGetItem( nPageId );
@@ -2118,30 +1992,30 @@ USHORT TabControl::GetTabPageResId( USHORT nPageId ) const
// -----------------------------------------------------------------------
-void TabControl::SetPageText( USHORT nPageId, const XubString& rText )
+void TabControl::SetPageText( sal_uInt16 nPageId, const XubString& rText )
{
ImplTabItem* pItem = ImplGetItem( nPageId );
if ( pItem && pItem->maText != rText )
{
pItem->maText = rText;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if( mpTabCtrlData->mpListBox )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
mpTabCtrlData->mpListBox->RemoveEntry( nPos );
mpTabCtrlData->mpListBox->InsertEntry( rText, nPos );
}
if ( IsUpdateMode() )
Invalidate();
ImplFreeLayoutData();
- ImplCallEventListeners( VCLEVENT_TABPAGE_PAGETEXTCHANGED, (void*) (ULONG) nPageId );
+ ImplCallEventListeners( VCLEVENT_TABPAGE_PAGETEXTCHANGED, (void*) (sal_uLong) nPageId );
}
}
// -----------------------------------------------------------------------
-XubString TabControl::GetPageText( USHORT nPageId ) const
+XubString TabControl::GetPageText( sal_uInt16 nPageId ) const
{
ImplTabItem* pItem = ImplGetItem( nPageId );
@@ -2153,7 +2027,7 @@ XubString TabControl::GetPageText( USHORT nPageId ) const
// -----------------------------------------------------------------------
-void TabControl::SetHelpText( USHORT nPageId, const XubString& rText )
+void TabControl::SetHelpText( sal_uInt16 nPageId, const XubString& rText )
{
ImplTabItem* pItem = ImplGetItem( nPageId );
@@ -2163,17 +2037,17 @@ void TabControl::SetHelpText( USHORT nPageId, const XubString& rText )
// -----------------------------------------------------------------------
-const XubString& TabControl::GetHelpText( USHORT nPageId ) const
+const XubString& TabControl::GetHelpText( sal_uInt16 nPageId ) const
{
ImplTabItem* pItem = ImplGetItem( nPageId );
if ( pItem )
{
- 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;
@@ -2184,36 +2058,37 @@ const XubString& TabControl::GetHelpText( USHORT nPageId ) const
// -----------------------------------------------------------------------
-void TabControl::SetHelpId( USHORT nPageId, ULONG nHelpId )
+void TabControl::SetHelpId( sal_uInt16 nPageId, const rtl::OString& rHelpId )
{
ImplTabItem* pItem = ImplGetItem( nPageId );
if ( pItem )
- pItem->mnHelpId = nHelpId;
+ pItem->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
-ULONG TabControl::GetHelpId( USHORT nPageId ) const
+rtl::OString TabControl::GetHelpId( sal_uInt16 nPageId ) const
{
+ rtl::OString aRet;
ImplTabItem* pItem = ImplGetItem( nPageId );
if ( pItem )
- return pItem->mnHelpId;
- else
- return 0;
+ aRet = pItem->maHelpId;
+
+ return aRet;
}
// -----------------------------------------------------------------------
-void TabControl::SetPageImage( USHORT i_nPageId, const Image& i_rImage )
+void TabControl::SetPageImage( sal_uInt16 i_nPageId, const Image& i_rImage )
{
ImplTabItem* pItem = ImplGetItem( i_nPageId );
if ( pItem )
{
pItem->maTabImage = i_rImage;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsUpdateMode() )
Invalidate();
}
@@ -2221,7 +2096,7 @@ void TabControl::SetPageImage( USHORT i_nPageId, const Image& i_rImage )
// -----------------------------------------------------------------------
-const Image* TabControl::GetPageImage( USHORT i_nPageId ) const
+const Image* TabControl::GetPageImage( sal_uInt16 i_nPageId ) const
{
const ImplTabItem* pItem = ImplGetItem( i_nPageId );
return pItem ? &pItem->maTabImage : NULL;
@@ -2229,7 +2104,7 @@ const Image* TabControl::GetPageImage( USHORT i_nPageId ) const
// -----------------------------------------------------------------------
-Rectangle TabControl::GetCharacterBounds( USHORT nPageId, long nIndex ) const
+Rectangle TabControl::GetCharacterBounds( sal_uInt16 nPageId, long nIndex ) const
{
Rectangle aRet;
@@ -2252,7 +2127,7 @@ Rectangle TabControl::GetCharacterBounds( USHORT nPageId, long nIndex ) const
// -----------------------------------------------------------------------
-long TabControl::GetIndexForPoint( const Point& rPoint, USHORT& rPageId ) const
+long TabControl::GetIndexForPoint( const Point& rPoint, sal_uInt16& rPageId ) const
{
long nRet = -1;
@@ -2273,7 +2148,7 @@ long TabControl::GetIndexForPoint( const Point& rPoint, USHORT& rPageId ) const
if( aPair.A() <= nIndex && aPair.B() >= nIndex )
{
nRet = nIndex - aPair.A();
- rPageId = (USHORT)mpTabCtrlData->maLayoutLineToPageId[ nLine ];
+ rPageId = (sal_uInt16)mpTabCtrlData->maLayoutLineToPageId[ nLine ];
break;
}
}
@@ -2294,7 +2169,7 @@ void TabControl::FillLayoutData() const
// -----------------------------------------------------------------------
-Rectangle TabControl::GetTabPageBounds( USHORT nPage ) const
+Rectangle TabControl::GetTabPageBounds( sal_uInt16 nPage ) const
{
Rectangle aRet;
@@ -2319,7 +2194,7 @@ Rectangle TabControl::GetTabPageBounds( USHORT nPage ) const
// -----------------------------------------------------------------------
-Rectangle TabControl::GetTabBounds( USHORT nPageId ) const
+Rectangle TabControl::GetTabBounds( sal_uInt16 nPageId ) const
{
Rectangle aRet;
diff --git a/vcl/source/control/throbber.cxx b/vcl/source/control/throbber.cxx
new file mode 100644
index 000000000000..a55fdb3eb379
--- /dev/null
+++ b/vcl/source/control/throbber.cxx
@@ -0,0 +1,325 @@
+/*************************************************************************
+ *
+ * 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_vcl.hxx"
+
+#include "vcl/throbber.hxx"
+#include "vcl/svapp.hxx"
+
+#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include <com/sun/star/awt/ImageScaleMode.hpp>
+
+#include <comphelper/componentcontext.hxx>
+#include <comphelper/namedvaluecollection.hxx>
+#include <comphelper/processfactory.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <tools/diagnose_ex.h>
+#include <tools/urlobj.hxx>
+
+#include <limits>
+
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::graphic::XGraphic;
+using ::com::sun::star::graphic::XGraphicProvider;
+using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::com::sun::star::uno::UNO_QUERY;
+using ::com::sun::star::uno::Exception;
+namespace ImageScaleMode = ::com::sun::star::awt::ImageScaleMode;
+
+//----------------------------------------------------------------------------------------------------------------------
+Throbber::Throbber( Window* i_parentWindow, WinBits i_style, const ImageSet i_imageSet )
+ :ImageControl( i_parentWindow, i_style )
+ ,mbRepeat( sal_True )
+ ,mnStepTime( 100 )
+ ,mnCurStep( 0 )
+ ,mnStepCount( 0 )
+ ,meImageSet( i_imageSet )
+{
+ maWaitTimer.SetTimeout( mnStepTime );
+ maWaitTimer.SetTimeoutHdl( LINK( this, Throbber, TimeOutHdl ) );
+
+ SetScaleMode( ImageScaleMode::None );
+ initImages();
+}
+
+//--------------------------------------------------------------------
+Throbber::Throbber( Window* i_parentWindow, const ResId& i_resId, const ImageSet i_imageSet )
+ :ImageControl( i_parentWindow, i_resId )
+ ,mbRepeat( sal_True )
+ ,mnStepTime( 100 )
+ ,mnCurStep( 0 )
+ ,mnStepCount( 0 )
+ ,meImageSet( i_imageSet )
+{
+ maWaitTimer.SetTimeout( mnStepTime );
+ maWaitTimer.SetTimeoutHdl( LINK( this, Throbber, TimeOutHdl ) );
+
+ SetScaleMode( ImageScaleMode::None );
+ initImages();
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+Throbber::~Throbber()
+{
+ maWaitTimer.Stop();
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+namespace
+{
+ //..................................................................................................................
+ ::rtl::OUString lcl_getHighContrastURL( ::rtl::OUString const& i_imageURL )
+ {
+ INetURLObject aURL( i_imageURL );
+ if ( aURL.GetProtocol() != INET_PROT_PRIV_SOFFICE )
+ {
+ OSL_VERIFY( aURL.insertName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "hicontrast" ) ), false, 0 ) );
+ return aURL.GetMainURL( INetURLObject::NO_DECODE );
+ }
+ // the private: scheme is not considered to be hierarchical by INetURLObject, so manually insert the
+ // segment
+ const sal_Int32 separatorPos = i_imageURL.indexOf( '/' );
+ ENSURE_OR_RETURN( separatorPos != -1, "lcl_getHighContrastURL: unsipported URL scheme - cannot automatically determine HC version!", i_imageURL );
+
+ ::rtl::OUStringBuffer composer;
+ composer.append( i_imageURL.copy( 0, separatorPos ) );
+ composer.appendAscii( "/hicontrast" );
+ composer.append( i_imageURL.copy( separatorPos ) );
+ return composer.makeStringAndClear();
+ }
+
+ //..................................................................................................................
+ ::std::vector< Image > lcl_loadImageSet( const Throbber::ImageSet i_imageSet, const bool i_isHiContrast )
+ {
+ ::std::vector< Image > aImages;
+ ENSURE_OR_RETURN( i_imageSet != Throbber::IMAGES_NONE, "lcl_loadImageSet: illegal image set", aImages );
+
+ const ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ const Reference< XGraphicProvider > xGraphicProvider( aContext.createComponent( "com.sun.star.graphic.GraphicProvider" ), UNO_QUERY_THROW );
+
+ ::std::vector< ::rtl::OUString > aImageURLs( Throbber::getDefaultImageURLs( i_imageSet ) );
+ aImages.reserve( aImageURLs.size() );
+
+ ::comphelper::NamedValueCollection aMediaProperties;
+ for ( ::std::vector< ::rtl::OUString >::const_iterator imageURL = aImageURLs.begin();
+ imageURL != aImageURLs.end();
+ ++imageURL
+ )
+ {
+ Reference< XGraphic > xGraphic;
+ if ( i_isHiContrast )
+ {
+ aMediaProperties.put( "URL", lcl_getHighContrastURL( *imageURL ) );
+ xGraphic.set( xGraphicProvider->queryGraphic( aMediaProperties.getPropertyValues() ), UNO_QUERY );
+ }
+ if ( !xGraphic.is() )
+ {
+ aMediaProperties.put( "URL", *imageURL );
+ xGraphic.set( xGraphicProvider->queryGraphic( aMediaProperties.getPropertyValues() ), UNO_QUERY );
+ }
+ aImages.push_back( Image( xGraphic ) );
+ }
+
+ return aImages;
+ }
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+void Throbber::Resize()
+{
+ ImageControl::Resize();
+
+ if ( meImageSet == IMAGES_AUTO )
+ initImages();
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+void Throbber::initImages()
+{
+ if ( meImageSet == IMAGES_NONE )
+ return;
+
+ try
+ {
+ ::std::vector< ::std::vector< Image > > aImageSets;
+ const bool isHiContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
+ if ( meImageSet == IMAGES_AUTO )
+ {
+ aImageSets.push_back( lcl_loadImageSet( IMAGES_16_PX, isHiContrast ) );
+ aImageSets.push_back( lcl_loadImageSet( IMAGES_32_PX, isHiContrast ) );
+ aImageSets.push_back( lcl_loadImageSet( IMAGES_64_PX, isHiContrast ) );
+ }
+ else
+ {
+ aImageSets.push_back( lcl_loadImageSet( meImageSet, isHiContrast ) );
+ }
+
+ // find the best matching image set (size-wise)
+ const ::Size aWindowSizePixel = GetSizePixel();
+ size_t nPreferredSet = 0;
+ if ( aImageSets.size() > 1 )
+ {
+ long nMinimalDistance = ::std::numeric_limits< long >::max();
+ for ( ::std::vector< ::std::vector< Image > >::const_iterator check = aImageSets.begin();
+ check != aImageSets.end();
+ ++check
+ )
+ {
+ ENSURE_OR_CONTINUE( !check->empty(), "Throbber::initImages: illegal image!" );
+ const Size aImageSize = (*check)[0].GetSizePixel();
+
+ if ( ( aImageSize.Width() > aWindowSizePixel.Width() )
+ || ( aImageSize.Height() > aWindowSizePixel.Height() )
+ )
+ // do not use an image set which doesn't fit into the window
+ continue;
+
+ const sal_Int64 distance =
+ ( aWindowSizePixel.Width() - aImageSize.Width() ) * ( aWindowSizePixel.Width() - aImageSize.Width() )
+ + ( aWindowSizePixel.Height() - aImageSize.Height() ) * ( aWindowSizePixel.Height() - aImageSize.Height() );
+ if ( distance < nMinimalDistance )
+ {
+ nMinimalDistance = distance;
+ nPreferredSet = check - aImageSets.begin();
+ }
+ }
+ }
+
+ if ( nPreferredSet < aImageSets.size() )
+ setImageList( aImageSets[nPreferredSet] );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+void Throbber::start()
+{
+ maWaitTimer.Start();
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+void Throbber::stop()
+{
+ maWaitTimer.Stop();
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+bool Throbber::isRunning() const
+{
+ return maWaitTimer.IsActive();
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+void Throbber::setImageList( ::std::vector< Image > const& i_images )
+{
+ maImageList = i_images;
+
+ mnStepCount = maImageList.size();
+ const Image aInitialImage( mnStepCount ? maImageList[ 0 ] : Image() );
+ SetImage( aInitialImage );
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+void Throbber::setImageList( const Sequence< Reference< XGraphic > >& rImageList )
+{
+ ::std::vector< Image > aImages( rImageList.getLength() );
+ ::std::copy(
+ rImageList.getConstArray(),
+ rImageList.getConstArray() + rImageList.getLength(),
+ aImages.begin()
+ );
+ setImageList( aImages );
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+::std::vector< ::rtl::OUString > Throbber::getDefaultImageURLs( const ImageSet i_imageSet )
+{
+ ::std::vector< ::rtl::OUString > aImageURLs;
+
+ sal_Char const* const pResolutions[] = { "16", "32", "64" };
+ size_t const nImageCounts[] = { 6, 12, 12 };
+
+ size_t index = 0;
+ switch ( i_imageSet )
+ {
+ case IMAGES_16_PX: index = 0; break;
+ case IMAGES_32_PX: index = 1; break;
+ case IMAGES_64_PX: index = 2; break;
+ case IMAGES_NONE:
+ case IMAGES_AUTO:
+ OSL_ENSURE( false, "Throbber::getDefaultImageURLs: illegal image set!" );
+ return aImageURLs;
+ }
+
+ aImageURLs.reserve( nImageCounts[index] );
+ for ( size_t i=0; i<nImageCounts[index]; ++i )
+ {
+ ::rtl::OUStringBuffer aURL;
+ aURL.appendAscii( "private:graphicrepository/shared/spinner-" );
+ aURL.appendAscii( pResolutions[index] );
+ aURL.appendAscii( "-" );
+ if ( i < 9 )
+ aURL.appendAscii( "0" );
+ aURL.append ( sal_Int32( i + 1 ) );
+ aURL.appendAscii( ".png" );
+
+ aImageURLs.push_back( aURL.makeStringAndClear() );
+ }
+
+ return aImageURLs;
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+IMPL_LINK( Throbber, TimeOutHdl, void*, EMPTYARG )
+{
+ SolarMutexGuard aGuard;
+ if ( maImageList.empty() )
+ return 0;
+
+ if ( mnCurStep < mnStepCount - 1 )
+ mnCurStep += 1;
+ else
+ {
+ if ( mbRepeat )
+ {
+ // start over
+ mnCurStep = 0;
+ }
+ else
+ {
+ stop();
+ }
+ }
+
+ SetImage( maImageList[ mnCurStep ] );
+
+ return 0;
+}
diff --git a/vcl/source/fontsubset/gsub.cxx b/vcl/source/fontsubset/gsub.cxx
index c2b0310c7ca9..da0d84cec089 100644
--- a/vcl/source/fontsubset/gsub.cxx
+++ b/vcl/source/fontsubset/gsub.cxx
@@ -42,12 +42,10 @@
namespace vcl
{
-typedef sal_uInt32 ULONG;
-typedef sal_uInt32 UINT32;
-typedef sal_uInt16 USHORT;
+typedef sal_uIntPtr sal_uLong;
typedef sal_uInt8 FT_Byte;
-typedef std::map<USHORT,USHORT> GlyphSubstitution;
+typedef std::map<sal_uInt16,sal_uInt16> GlyphSubstitution;
inline sal_uInt32 NEXT_Long( const unsigned char* &p )
@@ -57,9 +55,9 @@ inline sal_uInt32 NEXT_Long( const unsigned char* &p )
return nVal;
}
-inline USHORT NEXT_UShort( const unsigned char* &p )
+inline sal_uInt16 NEXT_UShort( const unsigned char* &p )
{
- USHORT nVal = (p[0]<<8) + p[1];
+ sal_uInt16 nVal = (p[0]<<8) + p[1];
p += 2;
return nVal;
}
@@ -78,50 +76,50 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
// parse GSUB header
const FT_Byte* pGsubHeader = pGsubBase;
- const ULONG nVersion = NEXT_Long( pGsubHeader );
- const USHORT nOfsScriptList = NEXT_UShort( pGsubHeader );
- const USHORT nOfsFeatureTable = NEXT_UShort( pGsubHeader );
- const USHORT nOfsLookupList = NEXT_UShort( pGsubHeader );
+ const sal_uLong nVersion = NEXT_Long( pGsubHeader );
+ const sal_uInt16 nOfsScriptList = NEXT_UShort( pGsubHeader );
+ const sal_uInt16 nOfsFeatureTable = NEXT_UShort( pGsubHeader );
+ const sal_uInt16 nOfsLookupList = NEXT_UShort( pGsubHeader );
// sanity check the GSUB header
if( nVersion != 0x00010000 )
if( nVersion != 0x00001000 ) // workaround for SunBatang etc.
return -1; // unknown format or broken
- typedef std::vector<ULONG> ReqFeatureTagList;
+ typedef std::vector<sal_uLong> ReqFeatureTagList;
ReqFeatureTagList aReqFeatureTagList;
aReqFeatureTagList.push_back( MKTAG("vert") );
- typedef std::vector<USHORT> UshortList;
+ typedef std::vector<sal_uInt16> UshortList;
UshortList aFeatureIndexList;
UshortList aFeatureOffsetList;
// parse Script Table
const FT_Byte* pScriptHeader = pGsubBase + nOfsScriptList;
- const USHORT nCntScript = NEXT_UShort( pScriptHeader );
+ const sal_uInt16 nCntScript = NEXT_UShort( pScriptHeader );
if( pGsubLimit < pScriptHeader + 6 * nCntScript )
return false;
- for( USHORT nScriptIndex = 0; nScriptIndex < nCntScript; ++nScriptIndex )
+ for( sal_uInt16 nScriptIndex = 0; nScriptIndex < nCntScript; ++nScriptIndex )
{
- const ULONG nTag = NEXT_Long( pScriptHeader ); // e.g. hani/arab/kana/hang
- const USHORT nOfsScriptTable= NEXT_UShort( pScriptHeader );
- if( (nTag != (USHORT)nRequestedScript) && (nRequestedScript != 0) )
+ const sal_uLong nTag = NEXT_Long( pScriptHeader ); // e.g. hani/arab/kana/hang
+ const sal_uInt16 nOfsScriptTable= NEXT_UShort( pScriptHeader );
+ if( (nTag != (sal_uInt16)nRequestedScript) && (nRequestedScript != 0) )
continue;
const FT_Byte* pScriptTable = pGsubBase + nOfsScriptList + nOfsScriptTable;
if( pGsubLimit < pScriptTable + 4 )
return false;
- const USHORT nDefaultLangsysOfs = NEXT_UShort( pScriptTable );
- const USHORT nCntLangSystem = NEXT_UShort( pScriptTable );
- USHORT nLangsysOffset = 0;
+ const sal_uInt16 nDefaultLangsysOfs = NEXT_UShort( pScriptTable );
+ const sal_uInt16 nCntLangSystem = NEXT_UShort( pScriptTable );
+ sal_uInt16 nLangsysOffset = 0;
if( pGsubLimit < pScriptTable + 6 * nCntLangSystem )
return false;
- for( USHORT nLangsysIndex = 0; nLangsysIndex < nCntLangSystem; ++nLangsysIndex )
+ for( sal_uInt16 nLangsysIndex = 0; nLangsysIndex < nCntLangSystem; ++nLangsysIndex )
{
- const ULONG nInnerTag = NEXT_Long( pScriptTable ); // e.g. KOR/ZHS/ZHT/JAN
- const USHORT nOffset= NEXT_UShort( pScriptTable );
- if( (nInnerTag != (USHORT)nRequestedLangsys) && (nRequestedLangsys != 0) )
+ const sal_uLong nInnerTag = NEXT_Long( pScriptTable ); // e.g. KOR/ZHS/ZHT/JAN
+ const sal_uInt16 nOffset= NEXT_UShort( pScriptTable );
+ if( (nInnerTag != (sal_uInt16)nRequestedLangsys) && (nRequestedLangsys != 0) )
continue;
nLangsysOffset = nOffset;
break;
@@ -132,15 +130,15 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
const FT_Byte* pLangSys = pGsubBase + nOfsScriptList + nOfsScriptTable + nDefaultLangsysOfs;
if( pGsubLimit < pLangSys + 6 )
return false;
- /*const USHORT nLookupOrder =*/ NEXT_UShort( pLangSys );
- const USHORT nReqFeatureIdx = NEXT_UShort( pLangSys );
- const USHORT nCntFeature = NEXT_UShort( pLangSys );
+ /*const sal_uInt16 nLookupOrder =*/ NEXT_UShort( pLangSys );
+ const sal_uInt16 nReqFeatureIdx = NEXT_UShort( pLangSys );
+ const sal_uInt16 nCntFeature = NEXT_UShort( pLangSys );
if( pGsubLimit < pLangSys + 2 * nCntFeature )
return false;
aFeatureIndexList.push_back( nReqFeatureIdx );
- for( USHORT i = 0; i < nCntFeature; ++i )
+ for( sal_uInt16 i = 0; i < nCntFeature; ++i )
{
- const USHORT nFeatureIndex = NEXT_UShort( pLangSys );
+ const sal_uInt16 nFeatureIndex = NEXT_UShort( pLangSys );
aFeatureIndexList.push_back( nFeatureIndex );
}
}
@@ -150,15 +148,15 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
const FT_Byte* pLangSys = pGsubBase + nOfsScriptList + nOfsScriptTable + nLangsysOffset;
if( pGsubLimit < pLangSys + 6 )
return false;
- /*const USHORT nLookupOrder =*/ NEXT_UShort( pLangSys );
- const USHORT nReqFeatureIdx = NEXT_UShort( pLangSys );
- const USHORT nCntFeature = NEXT_UShort( pLangSys );
+ /*const sal_uInt16 nLookupOrder =*/ NEXT_UShort( pLangSys );
+ const sal_uInt16 nReqFeatureIdx = NEXT_UShort( pLangSys );
+ const sal_uInt16 nCntFeature = NEXT_UShort( pLangSys );
if( pGsubLimit < pLangSys + 2 * nCntFeature )
return false;
aFeatureIndexList.push_back( nReqFeatureIdx );
- for( USHORT i = 0; i < nCntFeature; ++i )
+ for( sal_uInt16 i = 0; i < nCntFeature; ++i )
{
- const USHORT nFeatureIndex = NEXT_UShort( pLangSys );
+ const sal_uInt16 nFeatureIndex = NEXT_UShort( pLangSys );
aFeatureIndexList.push_back( nFeatureIndex );
}
}
@@ -174,13 +172,13 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
const FT_Byte* pFeatureHeader = pGsubBase + nOfsFeatureTable;
if( pGsubLimit < pFeatureHeader + 2 )
return false;
- const USHORT nCntFeature = NEXT_UShort( pFeatureHeader );
+ const sal_uInt16 nCntFeature = NEXT_UShort( pFeatureHeader );
if( pGsubLimit < pFeatureHeader + 6 * nCntFeature )
return false;
- for( USHORT nFeatureIndex = 0; nFeatureIndex < nCntFeature; ++nFeatureIndex )
+ for( sal_uInt16 nFeatureIndex = 0; nFeatureIndex < nCntFeature; ++nFeatureIndex )
{
- const ULONG nTag = NEXT_Long( pFeatureHeader ); // e.g. locl/vert/trad/smpl/liga/fina/...
- const USHORT nOffset= NEXT_UShort( pFeatureHeader );
+ const sal_uLong nTag = NEXT_Long( pFeatureHeader ); // e.g. locl/vert/trad/smpl/liga/fina/...
+ const sal_uInt16 nOffset= NEXT_UShort( pFeatureHeader );
// ignore unneeded feature lookups
if( aFeatureIndexList[0] != nFeatureIndex ) // do not ignore the required feature
@@ -196,12 +194,12 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
const FT_Byte* pFeatureTable = pGsubBase + nOfsFeatureTable + nOffset;
if( pGsubLimit < pFeatureTable + 2 )
return false;
- const USHORT nCntLookups = NEXT_UShort( pFeatureTable );
+ const sal_uInt16 nCntLookups = NEXT_UShort( pFeatureTable );
if( pGsubLimit < pFeatureTable + 2 * nCntLookups )
return false;
- for( USHORT i = 0; i < nCntLookups; ++i )
+ for( sal_uInt16 i = 0; i < nCntLookups; ++i )
{
- const USHORT nLookupIndex = NEXT_UShort( pFeatureTable );
+ const sal_uInt16 nLookupIndex = NEXT_UShort( pFeatureTable );
aLookupIndexList.push_back( nLookupIndex );
}
if( nCntLookups == 0 ) //### hack needed by Mincho/Gothic/Mingliu/Simsun/...
@@ -212,12 +210,12 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
const FT_Byte* pLookupHeader = pGsubBase + nOfsLookupList;
if( pGsubLimit < pLookupHeader + 2 )
return false;
- const USHORT nCntLookupTable = NEXT_UShort( pLookupHeader );
+ const sal_uInt16 nCntLookupTable = NEXT_UShort( pLookupHeader );
if( pGsubLimit < pLookupHeader + 2 * nCntLookupTable )
return false;
- for( USHORT nLookupIdx = 0; nLookupIdx < nCntLookupTable; ++nLookupIdx )
+ for( sal_uInt16 nLookupIdx = 0; nLookupIdx < nCntLookupTable; ++nLookupIdx )
{
- const USHORT nOffset = NEXT_UShort( pLookupHeader );
+ const sal_uInt16 nOffset = NEXT_UShort( pLookupHeader );
if( std::count( aLookupIndexList.begin(), aLookupIndexList.end(), nLookupIdx ) )
aLookupOffsetList.push_back( nOffset );
}
@@ -225,13 +223,13 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
UshortList::const_iterator it = aLookupOffsetList.begin();
for(; it != aLookupOffsetList.end(); ++it )
{
- const USHORT nOfsLookupTable = *it;
+ const sal_uInt16 nOfsLookupTable = *it;
const FT_Byte* pLookupTable = pGsubBase + nOfsLookupList + nOfsLookupTable;
if( pGsubLimit < pLookupTable + 6 )
return false;
- const USHORT eLookupType = NEXT_UShort( pLookupTable );
- /*const USHORT eLookupFlag =*/ NEXT_UShort( pLookupTable );
- const USHORT nCntLookupSubtable = NEXT_UShort( pLookupTable );
+ const sal_uInt16 eLookupType = NEXT_UShort( pLookupTable );
+ /*const sal_uInt16 eLookupFlag =*/ NEXT_UShort( pLookupTable );
+ const sal_uInt16 nCntLookupSubtable = NEXT_UShort( pLookupTable );
// TODO: switch( eLookupType )
if( eLookupType != 1 ) // TODO: once we go beyond SingleSubst
@@ -239,16 +237,16 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
if( pGsubLimit < pLookupTable + 2 * nCntLookupSubtable )
return false;
- for( USHORT nSubTableIdx = 0; nSubTableIdx < nCntLookupSubtable; ++nSubTableIdx )
+ for( sal_uInt16 nSubTableIdx = 0; nSubTableIdx < nCntLookupSubtable; ++nSubTableIdx )
{
- const USHORT nOfsSubLookupTable = NEXT_UShort( pLookupTable );
+ const sal_uInt16 nOfsSubLookupTable = NEXT_UShort( pLookupTable );
const FT_Byte* pSubLookup = pGsubBase + nOfsLookupList + nOfsLookupTable + nOfsSubLookupTable;
if( pGsubLimit < pSubLookup + 6 )
return false;
- const USHORT nFmtSubstitution = NEXT_UShort( pSubLookup );
- const USHORT nOfsCoverage = NEXT_UShort( pSubLookup );
+ const sal_uInt16 nFmtSubstitution = NEXT_UShort( pSubLookup );
+ const sal_uInt16 nOfsCoverage = NEXT_UShort( pSubLookup );
- typedef std::pair<USHORT,USHORT> GlyphSubst;
+ typedef std::pair<sal_uInt16,sal_uInt16> GlyphSubst;
typedef std::vector<GlyphSubst> SubstVector;
SubstVector aSubstVector;
@@ -256,19 +254,19 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
+ nOfsLookupList + nOfsLookupTable + nOfsSubLookupTable + nOfsCoverage;
if( pGsubLimit < pCoverage + 4 )
return false;
- const USHORT nFmtCoverage = NEXT_UShort( pCoverage );
+ const sal_uInt16 nFmtCoverage = NEXT_UShort( pCoverage );
switch( nFmtCoverage )
{
case 1: // Coverage Format 1
{
- const USHORT nCntGlyph = NEXT_UShort( pCoverage );
+ const sal_uInt16 nCntGlyph = NEXT_UShort( pCoverage );
if( pGsubLimit < pCoverage + 2 * nCntGlyph )
// TODO? nCntGlyph = (pGsubLimit - pCoverage) / 2;
return false;
aSubstVector.reserve( nCntGlyph );
- for( USHORT i = 0; i < nCntGlyph; ++i )
+ for( sal_uInt16 i = 0; i < nCntGlyph; ++i )
{
- const USHORT nGlyphId = NEXT_UShort( pCoverage );
+ const sal_uInt16 nGlyphId = NEXT_UShort( pCoverage );
aSubstVector.push_back( GlyphSubst( nGlyphId, 0 ) );
}
}
@@ -276,17 +274,17 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
case 2: // Coverage Format 2
{
- const USHORT nCntRange = NEXT_UShort( pCoverage );
+ const sal_uInt16 nCntRange = NEXT_UShort( pCoverage );
if( pGsubLimit < pCoverage + 6 * nCntRange )
// TODO? nCntGlyph = (pGsubLimit - pCoverage) / 6;
return false;
for( int i = nCntRange; --i >= 0; )
{
- const UINT32 nGlyph0 = NEXT_UShort( pCoverage );
- const UINT32 nGlyph1 = NEXT_UShort( pCoverage );
- const USHORT nCovIdx = NEXT_UShort( pCoverage );
- for( UINT32 j = nGlyph0; j <= nGlyph1; ++j )
- aSubstVector.push_back( GlyphSubst( static_cast<USHORT>(j + nCovIdx), 0 ) );
+ const sal_uInt32 nGlyph0 = NEXT_UShort( pCoverage );
+ const sal_uInt32 nGlyph1 = NEXT_UShort( pCoverage );
+ const sal_uInt16 nCovIdx = NEXT_UShort( pCoverage );
+ for( sal_uInt32 j = nGlyph0; j <= nGlyph1; ++j )
+ aSubstVector.push_back( GlyphSubst( static_cast<sal_uInt16>(j + nCovIdx), 0 ) );
}
}
break;
@@ -298,7 +296,7 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
{
case 1: // Single Substitution Format 1
{
- const USHORT nDeltaGlyphId = NEXT_UShort( pSubLookup );
+ const sal_uInt16 nDeltaGlyphId = NEXT_UShort( pSubLookup );
for(; subst_it != aSubstVector.end(); ++subst_it )
(*subst_it).second = (*subst_it).first + nDeltaGlyphId;
@@ -307,12 +305,12 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
case 2: // Single Substitution Format 2
{
- const USHORT nCntGlyph = NEXT_UShort( pSubLookup );
+ const sal_uInt16 nCntGlyph = NEXT_UShort( pSubLookup );
for( int i = nCntGlyph; (subst_it != aSubstVector.end()) && (--i>=0); ++subst_it )
{
if( pGsubLimit < pSubLookup + 2 )
return false;
- const USHORT nGlyphId = NEXT_UShort( pSubLookup );
+ const sal_uInt16 nGlyphId = NEXT_UShort( pSubLookup );
(*subst_it).second = nGlyphId;
}
}
@@ -344,7 +342,7 @@ int UseGSUB( struct _TrueTypeFont* pTTFile, int nGlyph, int /*wmode*/ )
GlyphSubstitution* pGlyphSubstitution = (GlyphSubstitution*)pTTFile->pGSubstitution;
if( pGlyphSubstitution != 0 )
{
- GlyphSubstitution::const_iterator it( pGlyphSubstitution->find( sal::static_int_cast<USHORT>(nGlyph) ) );
+ GlyphSubstitution::const_iterator it( pGlyphSubstitution->find( sal::static_int_cast<sal_uInt16>(nGlyph) ) );
if( it != pGlyphSubstitution->end() )
nGlyph = (*it).second;
}
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index b9745147bb5a..4e3f8ceb0cf2 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -1434,7 +1434,7 @@ static void GetKern(TrueTypeFont *ttf)
if( !table )
goto badtable;
- if (GetUInt16(table, 0, 1) == 0) { /* Traditional Microsoft style table with USHORT version and nTables fields */
+ if (GetUInt16(table, 0, 1) == 0) { /* Traditional Microsoft style table with sal_uInt16 version and nTables fields */
ttf->nkern = GetUInt16(table, 2, 1);
ttf->kerntables = (const sal_uInt8**)calloc(ttf->nkern, sizeof(sal_uInt8 *));
assert(ttf->kerntables != 0);
diff --git a/vcl/source/gdi/alpha.cxx b/vcl/source/gdi/alpha.cxx
index d144fe550882..6107affaf4e9 100644
--- a/vcl/source/gdi/alpha.cxx
+++ b/vcl/source/gdi/alpha.cxx
@@ -59,7 +59,7 @@ AlphaMask::AlphaMask( const AlphaMask& rAlphaMask ) :
// -----------------------------------------------------------------------------
-AlphaMask::AlphaMask( const Size& rSizePixel, BYTE* pEraseTransparency ) :
+AlphaMask::AlphaMask( const Size& rSizePixel, sal_uInt8* pEraseTransparency ) :
Bitmap( rSizePixel, 8, &Bitmap::GetGreyPalette( 256 ) )
{
if( pEraseTransparency )
@@ -108,14 +108,14 @@ Bitmap AlphaMask::GetBitmap() const
// -----------------------------------------------------------------------------
-BOOL AlphaMask::Crop( const Rectangle& rRectPixel )
+sal_Bool AlphaMask::Crop( const Rectangle& rRectPixel )
{
return Bitmap::Crop( rRectPixel );
}
// -----------------------------------------------------------------------------
-BOOL AlphaMask::Expand( ULONG nDX, ULONG nDY, BYTE* pInitTransparency )
+sal_Bool AlphaMask::Expand( sal_uLong nDX, sal_uLong nDY, sal_uInt8* pInitTransparency )
{
Color aColor;
@@ -127,7 +127,7 @@ BOOL AlphaMask::Expand( ULONG nDX, ULONG nDY, BYTE* pInitTransparency )
// -----------------------------------------------------------------------------
-BOOL AlphaMask::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
+sal_Bool AlphaMask::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
const AlphaMask* pAlphaSrc )
{
// Note: this code is copied from Bitmap::CopyPixel but avoids any palette lookups
@@ -135,7 +135,7 @@ BOOL AlphaMask::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
const Size aSizePix( GetSizePixel() );
Rectangle aRectDst( rRectDst );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
aRectDst.Intersection( Rectangle( Point(), aSizePix ) );
@@ -226,7 +226,7 @@ BOOL AlphaMask::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
}
ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
}
}
@@ -238,26 +238,26 @@ BOOL AlphaMask::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
// -----------------------------------------------------------------------------
-BOOL AlphaMask::Erase( BYTE cTransparency )
+sal_Bool AlphaMask::Erase( sal_uInt8 cTransparency )
{
return Bitmap::Erase( Color( cTransparency, cTransparency, cTransparency ) );
}
// -----------------------------------------------------------------------------
-BOOL AlphaMask::Invert()
+sal_Bool AlphaMask::Invert()
{
BitmapWriteAccess* pAcc = AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pAcc && pAcc->GetBitCount() == 8 )
{
BitmapColor aCol( 0 );
const long nWidth = pAcc->Width(), nHeight = pAcc->Height();
- BYTE* pMap = new BYTE[ 256 ];
+ sal_uInt8* pMap = new sal_uInt8[ 256 ];
for( long i = 0; i < 256; i++ )
- pMap[ i ] = ~(BYTE) i;
+ pMap[ i ] = ~(sal_uInt8) i;
for( long nY = 0L; nY < nHeight; nY++ )
{
@@ -269,7 +269,7 @@ BOOL AlphaMask::Invert()
}
delete[] pMap;
- bRet = TRUE;
+ bRet = sal_True;
}
if( pAcc )
@@ -280,16 +280,16 @@ BOOL AlphaMask::Invert()
// -----------------------------------------------------------------------------
-BOOL AlphaMask::Mirror( ULONG nMirrorFlags )
+sal_Bool AlphaMask::Mirror( sal_uLong nMirrorFlags )
{
return Bitmap::Mirror( nMirrorFlags );
}
// -----------------------------------------------------------------------------
-BOOL AlphaMask::Scale( const Size& rNewSize, ULONG nScaleFlag )
+sal_Bool AlphaMask::Scale( const Size& rNewSize, sal_uLong nScaleFlag )
{
- BOOL bRet = Bitmap::Scale( rNewSize, nScaleFlag );
+ sal_Bool bRet = Bitmap::Scale( rNewSize, nScaleFlag );
if( bRet && ( nScaleFlag == BMP_SCALE_INTERPOLATE ) )
Bitmap::Convert( BMP_CONVERSION_8BIT_GREYS );
@@ -299,9 +299,9 @@ BOOL AlphaMask::Scale( const Size& rNewSize, ULONG nScaleFlag )
// -----------------------------------------------------------------------------
-BOOL AlphaMask::Scale( const double& rScaleX, const double& rScaleY, ULONG nScaleFlag )
+sal_Bool AlphaMask::Scale( const double& rScaleX, const double& rScaleY, sal_uLong nScaleFlag )
{
- BOOL bRet = Bitmap::Scale( rScaleX, rScaleY, nScaleFlag );
+ sal_Bool bRet = Bitmap::Scale( rScaleX, rScaleY, nScaleFlag );
if( bRet && ( nScaleFlag == BMP_SCALE_INTERPOLATE ) )
Bitmap::Convert( BMP_CONVERSION_8BIT_GREYS );
@@ -311,18 +311,18 @@ BOOL AlphaMask::Scale( const double& rScaleX, const double& rScaleY, ULONG nScal
// -----------------------------------------------------------------------------
-BOOL AlphaMask::Rotate( long nAngle10, BYTE cFillTransparency )
+sal_Bool AlphaMask::Rotate( long nAngle10, sal_uInt8 cFillTransparency )
{
return Bitmap::Rotate( nAngle10, Color( cFillTransparency, cFillTransparency, cFillTransparency ) );
}
// -----------------------------------------------------------------------------
-BOOL AlphaMask::Replace( const Bitmap& rMask, BYTE cReplaceTransparency )
+sal_Bool AlphaMask::Replace( const Bitmap& rMask, sal_uInt8 cReplaceTransparency )
{
BitmapReadAccess* pMaskAcc = ( (Bitmap&) rMask ).AcquireReadAccess();
BitmapWriteAccess* pAcc = AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pMaskAcc && pAcc )
{
@@ -345,14 +345,14 @@ BOOL AlphaMask::Replace( const Bitmap& rMask, BYTE cReplaceTransparency )
// -----------------------------------------------------------------------------
-BOOL AlphaMask::Replace( BYTE cSearchTransparency, BYTE cReplaceTransparency, ULONG
+sal_Bool AlphaMask::Replace( sal_uInt8 cSearchTransparency, sal_uInt8 cReplaceTransparency, sal_uLong
#ifdef DBG_UTIL
nTol
#endif
)
{
BitmapWriteAccess* pAcc = AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
DBG_ASSERT( !nTol, "AlphaMask::Replace: nTol not used yet" );
@@ -387,7 +387,7 @@ nTol
}
}
- bRet = TRUE;
+ bRet = sal_True;
}
if( pAcc )
@@ -398,17 +398,17 @@ nTol
// -----------------------------------------------------------------------------
-BOOL AlphaMask::Replace( BYTE* pSearchTransparencies, BYTE* pReplaceTransparencies,
- ULONG nColorCount, ULONG* pTols )
+sal_Bool AlphaMask::Replace( sal_uInt8* pSearchTransparencies, sal_uInt8* pReplaceTransparencies,
+ sal_uLong nColorCount, sal_uLong* pTols )
{
Color* pSearchColors = new Color[ nColorCount ];
Color* pReplaceColors = new Color[ nColorCount ];
- BOOL bRet;
+ sal_Bool bRet;
- for( ULONG i = 0; i < nColorCount; i++ )
+ for( sal_uLong i = 0; i < nColorCount; i++ )
{
- const BYTE cSearchTransparency = pSearchTransparencies[ i ];
- const BYTE cReplaceTransparency = pReplaceTransparencies[ i ];
+ const sal_uInt8 cSearchTransparency = pSearchTransparencies[ i ];
+ const sal_uInt8 cReplaceTransparency = pReplaceTransparencies[ i ];
pSearchColors[ i ] = Color( cSearchTransparency, cSearchTransparency, cSearchTransparency );
pReplaceColors[ i ] = Color( cReplaceTransparency, cReplaceTransparency, cReplaceTransparency );
diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx
index 0da492c1fecb..63d0010bd5d2 100644
--- a/vcl/source/gdi/animate.cxx
+++ b/vcl/source/gdi/animate.cxx
@@ -50,13 +50,13 @@ DBG_NAME( Animation )
// - statics -
// -----------
-ULONG Animation::mnAnimCount = 0UL;
+sal_uLong Animation::mnAnimCount = 0UL;
// -------------------
// - AnimationBitmap -
// -------------------
-ULONG AnimationBitmap::GetChecksum() const
+sal_uLong AnimationBitmap::GetChecksum() const
{
sal_uInt32 nCrc = aBmpEx.GetChecksum();
SVBT32 aBT32;
@@ -94,9 +94,9 @@ Animation::Animation() :
mnLoops ( 0 ),
mnPos ( 0 ),
meCycleMode ( CYCLE_NORMAL ),
- mbIsInAnimation ( FALSE ),
- mbLoopTerminated ( FALSE ),
- mbIsWaiting ( FALSE )
+ mbIsInAnimation ( sal_False ),
+ mbLoopTerminated ( sal_False ),
+ mbIsWaiting ( sal_False )
{
DBG_CTOR( Animation, NULL );
maTimer.SetTimeoutHdl( LINK( this, Animation, ImplTimeoutHdl ) );
@@ -111,7 +111,7 @@ Animation::Animation( const Animation& rAnimation ) :
mnLoopCount ( rAnimation.mnLoopCount ),
mnPos ( rAnimation.mnPos ),
meCycleMode ( rAnimation.meCycleMode ),
- mbIsInAnimation ( FALSE ),
+ mbIsInAnimation ( sal_False ),
mbLoopTerminated ( rAnimation.mbLoopTerminated ),
mbIsWaiting ( rAnimation.mbIsWaiting )
{
@@ -166,24 +166,24 @@ Animation& Animation::operator=( const Animation& rAnimation )
// -----------------------------------------------------------------------
-BOOL Animation::operator==( const Animation& rAnimation ) const
+sal_Bool Animation::operator==( const Animation& rAnimation ) const
{
- const ULONG nCount = maList.Count();
- BOOL bRet = FALSE;
+ const sal_uLong nCount = maList.Count();
+ sal_Bool bRet = sal_False;
if( rAnimation.maList.Count() == nCount &&
rAnimation.maBitmapEx == maBitmapEx &&
rAnimation.maGlobalSize == maGlobalSize &&
rAnimation.meCycleMode == meCycleMode )
{
- bRet = TRUE;
+ bRet = sal_True;
- for( ULONG n = 0; n < nCount; n++ )
+ for( sal_uLong n = 0; n < nCount; n++ )
{
if( ( *(AnimationBitmap*) maList.GetObject( n ) ) !=
( *(AnimationBitmap*) rAnimation.maList.GetObject( n ) ) )
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
@@ -194,19 +194,19 @@ BOOL Animation::operator==( const Animation& rAnimation ) const
// ------------------------------------------------------------------
-BOOL Animation::IsEqual( const Animation& rAnimation ) const
+sal_Bool Animation::IsEqual( const Animation& rAnimation ) const
{
- const ULONG nCount = maList.Count();
- BOOL bRet = FALSE;
+ const sal_uLong nCount = maList.Count();
+ sal_Bool bRet = sal_False;
if( rAnimation.maList.Count() == nCount &&
rAnimation.maBitmapEx.IsEqual( maBitmapEx ) &&
rAnimation.maGlobalSize == maGlobalSize &&
rAnimation.meCycleMode == meCycleMode )
{
- for( ULONG n = 0; ( n < nCount ) && !bRet; n++ )
+ for( sal_uLong n = 0; ( n < nCount ) && !bRet; n++ )
if( ( (AnimationBitmap*) maList.GetObject( n ) )->IsEqual( *(AnimationBitmap*) rAnimation.maList.GetObject( n ) ) )
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -214,7 +214,7 @@ BOOL Animation::IsEqual( const Animation& rAnimation ) const
// ------------------------------------------------------------------
-BOOL Animation::IsEmpty() const
+sal_Bool Animation::IsEmpty() const
{
return( maBitmapEx.IsEmpty() && !maList.Count() );
}
@@ -224,7 +224,7 @@ BOOL Animation::IsEmpty() const
void Animation::SetEmpty()
{
maTimer.Stop();
- mbIsInAnimation = FALSE;
+ mbIsInAnimation = sal_False;
maGlobalSize = Size();
maBitmapEx.SetEmpty();
@@ -246,11 +246,11 @@ void Animation::Clear()
// -----------------------------------------------------------------------
-BOOL Animation::IsTransparent() const
+sal_Bool Animation::IsTransparent() const
{
Point aPoint;
Rectangle aRect( aPoint, maGlobalSize );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
// Falls irgendein 'kleines' Bildchen durch den Hintergrund
// ersetzt werden soll, muessen wir 'transparent' sein, um
@@ -262,7 +262,7 @@ BOOL Animation::IsTransparent() const
if( DISPOSE_BACK == pAnimBmp->eDisposal && Rectangle( pAnimBmp->aPosPix, pAnimBmp->aSizePix ) != aRect )
{
- bRet = TRUE;
+ bRet = sal_True;
break;
}
}
@@ -275,9 +275,9 @@ BOOL Animation::IsTransparent() const
// -----------------------------------------------------------------------
-ULONG Animation::GetSizeBytes() const
+sal_uLong Animation::GetSizeBytes() const
{
- ULONG nSizeBytes = GetBitmapEx().GetSizeBytes();
+ sal_uLong nSizeBytes = GetBitmapEx().GetSizeBytes();
for( long i = 0, nCount = maList.Count(); i < nCount; i++ )
{
@@ -290,7 +290,7 @@ ULONG Animation::GetSizeBytes() const
// -----------------------------------------------------------------------
-ULONG Animation::GetChecksum() const
+sal_uLong Animation::GetChecksum() const
{
SVBT32 aBT32;
sal_uInt32 nCrc = GetBitmapEx().GetChecksum();
@@ -318,7 +318,7 @@ ULONG Animation::GetChecksum() const
// -----------------------------------------------------------------------
-BOOL Animation::Start( OutputDevice* pOut, const Point& rDestPt, long nExtraData,
+sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, long nExtraData,
OutputDevice* pFirstFrameOutDev )
{
return Start( pOut, rDestPt, pOut->PixelToLogic( maGlobalSize ), nExtraData, pFirstFrameOutDev );
@@ -326,10 +326,10 @@ BOOL Animation::Start( OutputDevice* pOut, const Point& rDestPt, long nExtraData
// -----------------------------------------------------------------------
-BOOL Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& rDestSz, long nExtraData,
+sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& rDestSz, long nExtraData,
OutputDevice* pFirstFrameOutDev )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( maList.Count() )
{
@@ -362,7 +362,7 @@ BOOL Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& rDe
if( !mpViewList->Count() )
{
maTimer.Stop();
- mbIsInAnimation = FALSE;
+ mbIsInAnimation = sal_False;
mnPos = 0UL;
}
@@ -372,13 +372,13 @@ BOOL Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& rDe
if( !mbIsInAnimation )
{
ImplRestartTimer( ( (AnimationBitmap*) maList.GetObject( mnPos ) )->nWait );
- mbIsInAnimation = TRUE;
+ mbIsInAnimation = sal_True;
}
}
else
Draw( pOut, rDestPt, rDestSz );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -404,7 +404,7 @@ void Animation::Stop( OutputDevice* pOut, long nExtraData )
if( !mpViewList->Count() )
{
maTimer.Stop();
- mbIsInAnimation = FALSE;
+ mbIsInAnimation = sal_False;
}
}
@@ -419,7 +419,7 @@ void Animation::Draw( OutputDevice* pOut, const Point& rDestPt ) const
void Animation::Draw( OutputDevice* pOut, const Point& rDestPt, const Size& rDestSz ) const
{
- const ULONG nCount = maList.Count();
+ const sal_uLong nCount = maList.Count();
if( nCount )
{
@@ -431,7 +431,7 @@ void Animation::Draw( OutputDevice* pOut, const Point& rDestPt, const Size& rDes
pObj->aBmpEx.Draw( pOut, rDestPt, rDestSz );
else
{
- const ULONG nOldPos = mnPos;
+ const sal_uLong nOldPos = mnPos;
( (Animation*) this )->mnPos = mbLoopTerminated ? ( nCount - 1UL ) : mnPos;
delete new ImplAnimView( (Animation*) this, pOut, rDestPt, rDestSz, 0 );
( (Animation*) this )->mnPos = nOldPos;
@@ -441,9 +441,9 @@ void Animation::Draw( OutputDevice* pOut, const Point& rDestPt, const Size& rDes
// -----------------------------------------------------------------------
-void Animation::ImplRestartTimer( ULONG nTimeout )
+void Animation::ImplRestartTimer( sal_uLong nTimeout )
{
- maTimer.SetTimeout( Max( nTimeout, (ULONG)(MIN_TIMEOUT + ( mnAnimCount - 1 ) * INC_TIMEOUT) ) * 10L );
+ maTimer.SetTimeout( Max( nTimeout, (sal_uLong)(MIN_TIMEOUT + ( mnAnimCount - 1 ) * INC_TIMEOUT) ) * 10L );
maTimer.Start();
}
@@ -451,12 +451,12 @@ void Animation::ImplRestartTimer( ULONG nTimeout )
IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
{
- const ULONG nAnimCount = maList.Count();
+ const sal_uLong nAnimCount = maList.Count();
if( nAnimCount )
{
ImplAnimView* pView;
- BOOL bGlobalPause = TRUE;
+ sal_Bool bGlobalPause = sal_True;
if( maNotifyLink.IsSet() )
{
@@ -482,7 +482,7 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
pView = (ImplAnimView*) pAInfo->pViewData;
pView->ImplPause( pAInfo->bPause );
- pView->ImplSetMarked( TRUE );
+ pView->ImplSetMarked( sal_True );
}
// delete AInfo structures
@@ -502,15 +502,15 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
else
{
if( !pView->ImplIsPause() )
- bGlobalPause = FALSE;
+ bGlobalPause = sal_False;
- pView->ImplSetMarked( FALSE );
+ pView->ImplSetMarked( sal_False );
pView = (ImplAnimView*) mpViewList->Next();
}
}
}
else
- bGlobalPause = FALSE;
+ bGlobalPause = sal_False;
if( !mpViewList->Count() )
Stop();
@@ -525,7 +525,7 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
if( mnLoops == 1 )
{
Stop();
- mbLoopTerminated = TRUE;
+ mbLoopTerminated = sal_True;
mnPos = nAnimCount - 1UL;
maBitmapEx = ( (AnimationBitmap*) maList.GetObject( mnPos ) )->aBmpEx;
return 0L;
@@ -573,9 +573,9 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
// -----------------------------------------------------------------------
-BOOL Animation::Insert( const AnimationBitmap& rStepBmp )
+sal_Bool Animation::Insert( const AnimationBitmap& rStepBmp )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !IsInAnimation() )
{
@@ -589,7 +589,7 @@ BOOL Animation::Insert( const AnimationBitmap& rStepBmp )
if( maList.Count() == 1 )
maBitmapEx = rStepBmp.aBmpEx;
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -597,7 +597,7 @@ BOOL Animation::Insert( const AnimationBitmap& rStepBmp )
// -----------------------------------------------------------------------
-const AnimationBitmap& Animation::Get( USHORT nAnimation ) const
+const AnimationBitmap& Animation::Get( sal_uInt16 nAnimation ) const
{
DBG_ASSERT( ( nAnimation < maList.Count() ), "No object at this position" );
return *(AnimationBitmap*) maList.GetObject( nAnimation );
@@ -605,7 +605,7 @@ const AnimationBitmap& Animation::Get( USHORT nAnimation ) const
// -----------------------------------------------------------------------
-void Animation::Replace( const AnimationBitmap& rNewAnimationBitmap, USHORT nAnimation )
+void Animation::Replace( const AnimationBitmap& rNewAnimationBitmap, sal_uInt16 nAnimation )
{
DBG_ASSERT( ( nAnimation < maList.Count() ), "No object at this position" );
@@ -624,7 +624,7 @@ void Animation::Replace( const AnimationBitmap& rNewAnimationBitmap, USHORT nAni
// -----------------------------------------------------------------------
-void Animation::SetLoopCount( const ULONG nLoopCount )
+void Animation::SetLoopCount( const sal_uLong nLoopCount )
{
mnLoopCount = nLoopCount;
ResetLoopCount();
@@ -635,20 +635,20 @@ void Animation::SetLoopCount( const ULONG nLoopCount )
void Animation::ResetLoopCount()
{
mnLoops = mnLoopCount;
- mbLoopTerminated = FALSE;
+ mbLoopTerminated = sal_False;
}
// -----------------------------------------------------------------------
-BOOL Animation::Convert( BmpConversion eConversion )
+sal_Bool Animation::Convert( BmpConversion eConversion )
{
DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
- BOOL bRet;
+ sal_Bool bRet;
if( !IsInAnimation() && maList.Count() )
{
- bRet = TRUE;
+ bRet = sal_True;
for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Convert( eConversion );
@@ -656,22 +656,22 @@ BOOL Animation::Convert( BmpConversion eConversion )
maBitmapEx.Convert( eConversion );
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
// -----------------------------------------------------------------------
-BOOL Animation::ReduceColors( USHORT nNewColorCount, BmpReduce eReduce )
+sal_Bool Animation::ReduceColors( sal_uInt16 nNewColorCount, BmpReduce eReduce )
{
DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
- BOOL bRet;
+ sal_Bool bRet;
if( !IsInAnimation() && maList.Count() )
{
- bRet = TRUE;
+ bRet = sal_True;
for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.ReduceColors( nNewColorCount, eReduce );
@@ -679,22 +679,22 @@ BOOL Animation::ReduceColors( USHORT nNewColorCount, BmpReduce eReduce )
maBitmapEx.ReduceColors( nNewColorCount, eReduce );
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
// -----------------------------------------------------------------------
-BOOL Animation::Invert()
+sal_Bool Animation::Invert()
{
DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
- BOOL bRet;
+ sal_Bool bRet;
if( !IsInAnimation() && maList.Count() )
{
- bRet = TRUE;
+ bRet = sal_True;
for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Invert();
@@ -702,22 +702,22 @@ BOOL Animation::Invert()
maBitmapEx.Invert();
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
// -----------------------------------------------------------------------
-BOOL Animation::Mirror( ULONG nMirrorFlags )
+sal_Bool Animation::Mirror( sal_uLong nMirrorFlags )
{
DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
- BOOL bRet;
+ sal_Bool bRet;
if( !IsInAnimation() && maList.Count() )
{
- bRet = TRUE;
+ bRet = sal_True;
if( nMirrorFlags )
{
@@ -725,7 +725,7 @@ BOOL Animation::Mirror( ULONG nMirrorFlags )
pStepBmp && bRet;
pStepBmp = (AnimationBitmap*) maList.Next() )
{
- if( ( bRet = pStepBmp->aBmpEx.Mirror( nMirrorFlags ) ) == TRUE )
+ if( ( bRet = pStepBmp->aBmpEx.Mirror( nMirrorFlags ) ) == sal_True )
{
if( nMirrorFlags & BMP_MIRROR_HORZ )
pStepBmp->aPosPix.X() = maGlobalSize.Width() - pStepBmp->aPosPix.X() - pStepBmp->aSizePix.Width();
@@ -739,22 +739,22 @@ BOOL Animation::Mirror( ULONG nMirrorFlags )
}
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
// -----------------------------------------------------------------------
-BOOL Animation::Dither( ULONG nDitherFlags )
+sal_Bool Animation::Dither( sal_uLong nDitherFlags )
{
DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
- BOOL bRet;
+ sal_Bool bRet;
if( !IsInAnimation() && maList.Count() )
{
- bRet = TRUE;
+ bRet = sal_True;
for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Dither( nDitherFlags );
@@ -762,24 +762,24 @@ BOOL Animation::Dither( ULONG nDitherFlags )
maBitmapEx.Dither( nDitherFlags );
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
// -----------------------------------------------------------------------
-BOOL Animation::Adjust( short nLuminancePercent, short nContrastPercent,
+sal_Bool Animation::Adjust( short nLuminancePercent, short nContrastPercent,
short nChannelRPercent, short nChannelGPercent, short nChannelBPercent,
- double fGamma, BOOL bInvert )
+ double fGamma, sal_Bool bInvert )
{
DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
- BOOL bRet;
+ sal_Bool bRet;
if( !IsInAnimation() && maList.Count() )
{
- bRet = TRUE;
+ bRet = sal_True;
for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
{
@@ -793,22 +793,22 @@ BOOL Animation::Adjust( short nLuminancePercent, short nContrastPercent,
fGamma, bInvert );
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
// -----------------------------------------------------------------------
-BOOL Animation::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link* pProgress )
+sal_Bool Animation::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link* pProgress )
{
DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
- BOOL bRet;
+ sal_Bool bRet;
if( !IsInAnimation() && maList.Count() )
{
- bRet = TRUE;
+ bRet = sal_True;
for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Filter( eFilter, pFilterParam, pProgress );
@@ -816,7 +816,7 @@ BOOL Animation::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, c
maBitmapEx.Filter( eFilter, pFilterParam, pProgress );
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
@@ -825,12 +825,12 @@ BOOL Animation::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, c
SvStream& operator<<( SvStream& rOStm, const Animation& rAnimation )
{
- const USHORT nCount = rAnimation.Count();
+ const sal_uInt16 nCount = rAnimation.Count();
if( nCount )
{
const ByteString aDummyStr;
- const UINT32 nDummy32 = 0UL;
+ const sal_uInt32 nDummy32 = 0UL;
// Falls keine BitmapEx gesetzt wurde, schreiben wir
// einfach die erste Bitmap der Animation
@@ -840,22 +840,22 @@ SvStream& operator<<( SvStream& rOStm, const Animation& rAnimation )
rOStm << rAnimation.GetBitmapEx();
// Kennung schreiben ( SDANIMA1 )
- rOStm << (UINT32) 0x5344414e << (UINT32) 0x494d4931;
+ rOStm << (sal_uInt32) 0x5344414e << (sal_uInt32) 0x494d4931;
- for( USHORT i = 0; i < nCount; i++ )
+ for( sal_uInt16 i = 0; i < nCount; i++ )
{
const AnimationBitmap& rAnimBmp = rAnimation.Get( i );
- const UINT16 nRest = nCount - i - 1;
+ const sal_uInt16 nRest = nCount - i - 1;
// AnimationBitmap schreiben
rOStm << rAnimBmp.aBmpEx;
rOStm << rAnimBmp.aPosPix;
rOStm << rAnimBmp.aSizePix;
rOStm << rAnimation.maGlobalSize;
- rOStm << (UINT16) ( ( ANIMATION_TIMEOUT_ON_CLICK == rAnimBmp.nWait ) ? 65535 : rAnimBmp.nWait );
- rOStm << (UINT16) rAnimBmp.eDisposal;
- rOStm << (BYTE) rAnimBmp.bUserInput;
- rOStm << (UINT32) rAnimation.mnLoopCount;
+ rOStm << (sal_uInt16) ( ( ANIMATION_TIMEOUT_ON_CLICK == rAnimBmp.nWait ) ? 65535 : rAnimBmp.nWait );
+ rOStm << (sal_uInt16) rAnimBmp.eDisposal;
+ rOStm << (sal_uInt8) rAnimBmp.bUserInput;
+ rOStm << (sal_uInt32) rAnimation.mnLoopCount;
rOStm << nDummy32; // unbenutzt
rOStm << nDummy32; // unbenutzt
rOStm << nDummy32; // unbenutzt
@@ -872,10 +872,10 @@ SvStream& operator<<( SvStream& rOStm, const Animation& rAnimation )
SvStream& operator>>( SvStream& rIStm, Animation& rAnimation )
{
Bitmap aBmp;
- ULONG nStmPos = rIStm.Tell();
- UINT32 nAnimMagic1, nAnimMagic2;
- USHORT nOldFormat = rIStm.GetNumberFormatInt();
- BOOL bReadAnimations = FALSE;
+ sal_uLong nStmPos = rIStm.Tell();
+ sal_uInt32 nAnimMagic1, nAnimMagic2;
+ sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
+ sal_Bool bReadAnimations = sal_False;
rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
nStmPos = rIStm.Tell();
@@ -886,7 +886,7 @@ SvStream& operator>>( SvStream& rIStm, Animation& rAnimation )
// Wenn die BitmapEx am Anfang schon gelesen
// wurde ( von Graphic ), koennen wir direkt die Animationsbitmaps einlesen
if( ( nAnimMagic1 == 0x5344414e ) && ( nAnimMagic2 == 0x494d4931 ) && !rIStm.GetError() )
- bReadAnimations = TRUE;
+ bReadAnimations = sal_True;
// ansonsten versuchen wir erstmal die Bitmap(-Ex) zu lesen
else
{
@@ -896,7 +896,7 @@ SvStream& operator>>( SvStream& rIStm, Animation& rAnimation )
rIStm >> nAnimMagic1 >> nAnimMagic2;
if( ( nAnimMagic1 == 0x5344414e ) && ( nAnimMagic2 == 0x494d4931 ) && !rIStm.GetError() )
- bReadAnimations = TRUE;
+ bReadAnimations = sal_True;
else
rIStm.Seek( nStmPos );
}
@@ -907,9 +907,9 @@ SvStream& operator>>( SvStream& rIStm, Animation& rAnimation )
AnimationBitmap aAnimBmp;
BitmapEx aBmpEx;
ByteString aDummyStr;
- UINT32 nTmp32;
- UINT16 nTmp16;
- BYTE cTmp;
+ sal_uInt32 nTmp32;
+ sal_uInt16 nTmp16;
+ sal_uInt8 cTmp;
do
{
@@ -919,8 +919,8 @@ SvStream& operator>>( SvStream& rIStm, Animation& rAnimation )
rIStm >> rAnimation.maGlobalSize;
rIStm >> nTmp16; aAnimBmp.nWait = ( ( 65535 == nTmp16 ) ? ANIMATION_TIMEOUT_ON_CLICK : nTmp16 );
rIStm >> nTmp16; aAnimBmp.eDisposal = ( Disposal) nTmp16;
- rIStm >> cTmp; aAnimBmp.bUserInput = (BOOL) cTmp;
- rIStm >> nTmp32; rAnimation.mnLoopCount = (USHORT) nTmp32;
+ rIStm >> cTmp; aAnimBmp.bUserInput = (sal_Bool) cTmp;
+ rIStm >> nTmp32; rAnimation.mnLoopCount = (sal_uInt16) nTmp32;
rIStm >> nTmp32; // unbenutzt
rIStm >> nTmp32; // unbenutzt
rIStm >> nTmp32; // unbenutzt
diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx
index 8d13cdb41a0f..a0b48f4ee124 100644
--- a/vcl/source/gdi/bitmap.cxx
+++ b/vcl/source/gdi/bitmap.cxx
@@ -86,7 +86,7 @@ Bitmap::Bitmap( SalBitmap* pSalBitmap )
// ------------------------------------------------------------------
-Bitmap::Bitmap( const Size& rSizePixel, USHORT nBitCount, const BitmapPalette* pPal )
+Bitmap::Bitmap( const Size& rSizePixel, sal_uInt16 nBitCount, const BitmapPalette* pPal )
{
if( rSizePixel.Width() && rSizePixel.Height() )
{
@@ -126,12 +126,12 @@ Bitmap::Bitmap( const Size& rSizePixel, USHORT nBitCount, const BitmapPalette* p
// Dither-Palette erzeugen
if( 8 == nBitCount )
{
- USHORT nActCol = 16;
+ sal_uInt16 nActCol = 16;
- for( USHORT nB = 0; nB < 256; nB += 51 )
- for( USHORT nG = 0; nG < 256; nG += 51 )
- for( USHORT nR = 0; nR < 256; nR += 51 )
- aPal[ nActCol++ ] = BitmapColor( (BYTE) nR, (BYTE) nG, (BYTE) nB );
+ for( sal_uInt16 nB = 0; nB < 256; nB += 51 )
+ for( sal_uInt16 nG = 0; nG < 256; nG += 51 )
+ for( sal_uInt16 nR = 0; nR < 256; nR += 51 )
+ aPal[ nActCol++ ] = BitmapColor( (sal_uInt8) nR, (sal_uInt8) nG, (sal_uInt8) nB );
// Standard-Office-Farbe setzen
aPal[ nActCol++ ] = BitmapColor( 0, 184, 255 );
@@ -196,11 +196,11 @@ const BitmapPalette& Bitmap::GetGreyPalette( int nEntries )
{
if( !aGreyPalette16.GetEntryCount() )
{
- BYTE cGrey = 0, cGreyInc = 17;
+ sal_uInt8 cGrey = 0, cGreyInc = 17;
aGreyPalette16.SetEntryCount( 16 );
- for( USHORT i = 0; i < 16; i++, cGrey = sal::static_int_cast<BYTE>(cGrey + cGreyInc) )
+ for( sal_uInt16 i = 0; i < 16; i++, cGrey = sal::static_int_cast<sal_uInt8>(cGrey + cGreyInc) )
aGreyPalette16[ i ] = BitmapColor( cGrey, cGrey, cGrey );
}
@@ -212,8 +212,8 @@ const BitmapPalette& Bitmap::GetGreyPalette( int nEntries )
{
aGreyPalette256.SetEntryCount( 256 );
- for( USHORT i = 0; i < 256; i++ )
- aGreyPalette256[ i ] = BitmapColor( (BYTE) i, (BYTE) i, (BYTE) i );
+ for( sal_uInt16 i = 0; i < 256; i++ )
+ aGreyPalette256[ i ] = BitmapColor( (sal_uInt8) i, (sal_uInt8) i, (sal_uInt8) i );
}
return aGreyPalette256;
@@ -235,9 +235,13 @@ bool BitmapPalette::IsGreyPalette() const
const int nEntryCount = GetEntryCount();
if( !nEntryCount ) // NOTE: an empty palette means 1:1 mapping
return true;
- const BitmapPalette& rGreyPalette = Bitmap::GetGreyPalette( nEntryCount );
- if( rGreyPalette == *this )
- return true;
+ // see above: only certain entry values will result in a valid call to GetGreyPalette
+ if( nEntryCount == 2 || nEntryCount == 4 || nEntryCount == 16 || nEntryCount == 256 )
+ {
+ const BitmapPalette& rGreyPalette = Bitmap::GetGreyPalette( nEntryCount );
+ if( rGreyPalette == *this )
+ return true;
+ }
// TODO: is it worth to compare the entries?
return false;
}
@@ -260,7 +264,7 @@ Bitmap& Bitmap::operator=( const Bitmap& rBitmap )
// ------------------------------------------------------------------
-BOOL Bitmap::IsEqual( const Bitmap& rBmp ) const
+sal_Bool Bitmap::IsEqual( const Bitmap& rBmp ) const
{
return( IsSameInstance( rBmp ) ||
( rBmp.GetSizePixel() == GetSizePixel() &&
@@ -309,17 +313,17 @@ void Bitmap::SetSourceSizePixel( const Size& rSize)
// ------------------------------------------------------------------
-USHORT Bitmap::GetBitCount() const
+sal_uInt16 Bitmap::GetBitCount() const
{
return( mpImpBmp ? mpImpBmp->ImplGetBitCount() : 0 );
}
// ------------------------------------------------------------------
-BOOL Bitmap::HasGreyPalette() const
+sal_Bool Bitmap::HasGreyPalette() const
{
- const USHORT nBitCount = GetBitCount();
- BOOL bRet = FALSE;
+ const sal_uInt16 nBitCount = GetBitCount();
+ sal_Bool bRet = sal_False;
if( 1 == nBitCount )
{
@@ -332,12 +336,12 @@ BOOL Bitmap::HasGreyPalette() const
if( rCol0.GetRed() == rCol0.GetGreen() && rCol0.GetRed() == rCol0.GetBlue() &&
rCol1.GetRed() == rCol1.GetGreen() && rCol1.GetRed() == rCol1.GetBlue() )
{
- bRet = TRUE;
+ bRet = sal_True;
}
( (Bitmap*) this )->ReleaseAccess( pRAcc );
}
else
- bRet = TRUE;
+ bRet = sal_True;
}
else if( 4 == nBitCount || 8 == nBitCount )
{
@@ -346,7 +350,7 @@ BOOL Bitmap::HasGreyPalette() const
if( pRAcc )
{
if( pRAcc->HasPalette() && ( (BitmapPalette&) pRAcc->GetPalette() == GetGreyPalette( 1 << nBitCount ) ) )
- bRet = TRUE;
+ bRet = sal_True;
( (Bitmap*) this )->ReleaseAccess( pRAcc );
}
@@ -357,9 +361,9 @@ BOOL Bitmap::HasGreyPalette() const
// ------------------------------------------------------------------
-ULONG Bitmap::GetChecksum() const
+sal_uLong Bitmap::GetChecksum() const
{
- ULONG nRet = 0UL;
+ sal_uLong nRet = 0UL;
if( mpImpBmp )
{
@@ -523,44 +527,44 @@ void Bitmap::ReleaseAccess( BitmapReadAccess* pBitmapAccess )
// ------------------------------------------------------------------
-BOOL Bitmap::Erase( const Color& rFillColor )
+sal_Bool Bitmap::Erase( const Color& rFillColor )
{
if( !(*this) )
- return TRUE;
+ return sal_True;
BitmapWriteAccess* pWriteAcc = AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pWriteAcc )
{
- const ULONG nFormat = pWriteAcc->GetScanlineFormat();
- BYTE cIndex = 0;
- BOOL bFast = FALSE;
+ const sal_uLong nFormat = pWriteAcc->GetScanlineFormat();
+ sal_uInt8 cIndex = 0;
+ sal_Bool bFast = sal_False;
switch( nFormat )
{
case( BMP_FORMAT_1BIT_MSB_PAL ):
case( BMP_FORMAT_1BIT_LSB_PAL ):
{
- cIndex = (BYTE) pWriteAcc->GetBestPaletteIndex( rFillColor );
+ cIndex = (sal_uInt8) pWriteAcc->GetBestPaletteIndex( rFillColor );
cIndex = ( cIndex ? 255 : 0 );
- bFast = TRUE;
+ bFast = sal_True;
}
break;
case( BMP_FORMAT_4BIT_MSN_PAL ):
case( BMP_FORMAT_4BIT_LSN_PAL ):
{
- cIndex = (BYTE) pWriteAcc->GetBestPaletteIndex( rFillColor );
+ cIndex = (sal_uInt8) pWriteAcc->GetBestPaletteIndex( rFillColor );
cIndex = cIndex | ( cIndex << 4 );
- bFast = TRUE;
+ bFast = sal_True;
}
break;
case( BMP_FORMAT_8BIT_PAL ):
{
- cIndex = (BYTE) pWriteAcc->GetBestPaletteIndex( rFillColor );
- bFast = TRUE;
+ cIndex = (sal_uInt8) pWriteAcc->GetBestPaletteIndex( rFillColor );
+ bFast = sal_True;
}
break;
@@ -571,21 +575,21 @@ BOOL Bitmap::Erase( const Color& rFillColor )
( rFillColor.GetRed() == rFillColor.GetBlue() ) )
{
cIndex = rFillColor.GetRed();
- bFast = TRUE;
+ bFast = sal_True;
}
else
- bFast = FALSE;
+ bFast = sal_False;
}
break;
default:
- bFast = FALSE;
+ bFast = sal_False;
break;
}
if( bFast )
{
- const ULONG nBufSize = pWriteAcc->GetScanlineSize() * pWriteAcc->Height();
+ const sal_uLong nBufSize = pWriteAcc->GetScanlineSize() * pWriteAcc->Height();
memset( pWriteAcc->GetBuffer(), cIndex, nBufSize );
}
else
@@ -597,7 +601,7 @@ BOOL Bitmap::Erase( const Color& rFillColor )
}
ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -605,19 +609,19 @@ BOOL Bitmap::Erase( const Color& rFillColor )
// ------------------------------------------------------------------
-BOOL Bitmap::Invert()
+sal_Bool Bitmap::Invert()
{
BitmapWriteAccess* pAcc = AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pAcc )
{
if( pAcc->HasPalette() )
{
BitmapPalette aBmpPal( pAcc->GetPalette() );
- const USHORT nCount = aBmpPal.GetEntryCount();
+ const sal_uInt16 nCount = aBmpPal.GetEntryCount();
- for( USHORT i = 0; i < nCount; i++ )
+ for( sal_uInt16 i = 0; i < nCount; i++ )
aBmpPal[ i ].Invert();
pAcc->SetPalette( aBmpPal );
@@ -633,7 +637,7 @@ BOOL Bitmap::Invert()
}
ReleaseAccess( pAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -641,11 +645,11 @@ BOOL Bitmap::Invert()
// ------------------------------------------------------------------
-BOOL Bitmap::Mirror( ULONG nMirrorFlags )
+sal_Bool Bitmap::Mirror( sal_uLong nMirrorFlags )
{
- BOOL bHorz = ( ( nMirrorFlags & BMP_MIRROR_HORZ ) == BMP_MIRROR_HORZ );
- BOOL bVert = ( ( nMirrorFlags & BMP_MIRROR_VERT ) == BMP_MIRROR_VERT );
- BOOL bRet = FALSE;
+ sal_Bool bHorz = ( ( nMirrorFlags & BMP_MIRROR_HORZ ) == BMP_MIRROR_HORZ );
+ sal_Bool bVert = ( ( nMirrorFlags & BMP_MIRROR_VERT ) == BMP_MIRROR_VERT );
+ sal_Bool bRet = sal_False;
if( bHorz && !bVert )
{
@@ -670,7 +674,7 @@ BOOL Bitmap::Mirror( ULONG nMirrorFlags )
}
ReleaseAccess( pAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
}
else if( bVert && !bHorz )
@@ -680,7 +684,7 @@ BOOL Bitmap::Mirror( ULONG nMirrorFlags )
if( pAcc )
{
const long nScanSize = pAcc->GetScanlineSize();
- BYTE* pBuffer = new BYTE[ nScanSize ];
+ sal_uInt8* pBuffer = new sal_uInt8[ nScanSize ];
const long nHeight = pAcc->Height();
const long nHeight1 = nHeight - 1L;
const long nHeight_2 = nHeight >> 1L;
@@ -694,7 +698,7 @@ BOOL Bitmap::Mirror( ULONG nMirrorFlags )
delete[] pBuffer;
ReleaseAccess( pAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
}
else if( bHorz && bVert )
@@ -731,26 +735,26 @@ BOOL Bitmap::Mirror( ULONG nMirrorFlags )
}
ReleaseAccess( pAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
}
else
- bRet = TRUE;
+ bRet = sal_True;
return bRet;
}
// ------------------------------------------------------------------
-BOOL Bitmap::Rotate( long nAngle10, const Color& rFillColor )
+sal_Bool Bitmap::Rotate( long nAngle10, const Color& rFillColor )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
nAngle10 %= 3600L;
nAngle10 = ( nAngle10 < 0L ) ? ( 3599L + nAngle10 ) : nAngle10;
if( !nAngle10 )
- bRet = TRUE;
+ bRet = sal_True;
else if( 1800L == nAngle10 )
bRet = Mirror( BMP_MIRROR_HORZ | BMP_MIRROR_VERT );
else
@@ -800,7 +804,7 @@ BOOL Bitmap::Rotate( long nAngle10, const Color& rFillColor )
Point aTmpPoint;
Rectangle aTmpRectangle( aTmpPoint, aSizePix );
Polygon aPoly( aTmpRectangle );
- aPoly.Rotate( aTmpPoint, (USHORT) nAngle10 );
+ aPoly.Rotate( aTmpPoint, (sal_uInt16) nAngle10 );
Rectangle aNewBound( aPoly.GetBoundRect() );
const Size aNewSizePix( aNewBound.GetSize() );
@@ -876,7 +880,7 @@ BOOL Bitmap::Rotate( long nAngle10, const Color& rFillColor )
ReleaseAccess( pReadAcc );
}
- if( ( bRet = !!aRotatedBmp ) == TRUE )
+ if( ( bRet = !!aRotatedBmp ) == sal_True )
ImplAssignWithSize( aRotatedBmp );
}
@@ -885,11 +889,11 @@ BOOL Bitmap::Rotate( long nAngle10, const Color& rFillColor )
// ------------------------------------------------------------------
-BOOL Bitmap::Crop( const Rectangle& rRectPixel )
+sal_Bool Bitmap::Crop( const Rectangle& rRectPixel )
{
const Size aSizePix( GetSizePixel() );
Rectangle aRect( rRectPixel );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
aRect.Intersection( Rectangle( Point(), aSizePix ) );
@@ -916,7 +920,7 @@ BOOL Bitmap::Crop( const Rectangle& rRectPixel )
pWriteAcc->SetPixel( nY, nX, pReadAcc->GetPixel( nY2, nX2 ) );
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -931,12 +935,12 @@ BOOL Bitmap::Crop( const Rectangle& rRectPixel )
// ------------------------------------------------------------------
-BOOL Bitmap::CopyPixel( const Rectangle& rRectDst,
+sal_Bool Bitmap::CopyPixel( const Rectangle& rRectDst,
const Rectangle& rRectSrc, const Bitmap* pBmpSrc )
{
const Size aSizePix( GetSizePixel() );
Rectangle aRectDst( rRectDst );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
aRectDst.Intersection( Rectangle( Point(), aSizePix ) );
@@ -947,8 +951,8 @@ BOOL Bitmap::CopyPixel( const Rectangle& rRectDst,
Bitmap* pSrc = (Bitmap*) pBmpSrc;
const Size aCopySizePix( pSrc->GetSizePixel() );
Rectangle aRectSrc( rRectSrc );
- const USHORT nSrcBitCount = pBmpSrc->GetBitCount();
- const USHORT nDstBitCount = GetBitCount();
+ const sal_uInt16 nSrcBitCount = pBmpSrc->GetBitCount();
+ const sal_uInt16 nDstBitCount = GetBitCount();
if( nSrcBitCount > nDstBitCount )
{
@@ -976,25 +980,25 @@ BOOL Bitmap::CopyPixel( const Rectangle& rRectDst,
{
const long nSrcCount = pDstAcc->GetPaletteEntryCount();
const long nDstCount = 1 << nDstBitCount;
- BOOL bFound;
+ sal_Bool bFound;
for( long i = 0L; ( i < nSrcCount ) && ( nNextIndex < nSrcCount ); i++ )
{
- const BitmapColor& rSrcCol = pSrcAcc->GetPaletteColor( (USHORT) i );
+ const BitmapColor& rSrcCol = pSrcAcc->GetPaletteColor( (sal_uInt16) i );
- bFound = FALSE;
+ bFound = sal_False;
for( long j = 0L; j < nDstCount; j++ )
{
- if( rSrcCol == pDstAcc->GetPaletteColor( (USHORT) j ) )
+ if( rSrcCol == pDstAcc->GetPaletteColor( (sal_uInt16) j ) )
{
- bFound = TRUE;
+ bFound = sal_True;
break;
}
}
if( !bFound )
- pDstAcc->SetPaletteColor( (USHORT) nNextIndex++, rSrcCol );
+ pDstAcc->SetPaletteColor( (sal_uInt16) nNextIndex++, rSrcCol );
}
}
@@ -1026,14 +1030,14 @@ BOOL Bitmap::CopyPixel( const Rectangle& rRectDst,
if( pReadAcc->HasPalette() && pWriteAcc->HasPalette() )
{
- const USHORT nCount = pReadAcc->GetPaletteEntryCount();
- BYTE* pMap = new BYTE[ nCount ];
+ const sal_uInt16 nCount = pReadAcc->GetPaletteEntryCount();
+ sal_uInt8* pMap = new sal_uInt8[ nCount ];
// Index-Map fuer Farbtabelle
// aufbauen, da das Bild ja (relativ) farbgenau
// kopiert werden soll
- for( USHORT i = 0; i < nCount; i++ )
- pMap[ i ] = (BYTE) pWriteAcc->GetBestPaletteIndex( pReadAcc->GetPaletteColor( i ) );
+ for( sal_uInt16 i = 0; i < nCount; i++ )
+ pMap[ i ] = (sal_uInt8) pWriteAcc->GetBestPaletteIndex( pReadAcc->GetPaletteColor( i ) );
for( long nSrcY = aRectSrc.Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++ )
for( long nSrcX = aRectSrc.Left(), nDstX = aRectDst.Left(); nSrcX < nSrcEndX; nSrcX++, nDstX++ )
@@ -1109,7 +1113,7 @@ BOOL Bitmap::CopyPixel( const Rectangle& rRectDst,
}
ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
}
}
@@ -1120,9 +1124,9 @@ BOOL Bitmap::CopyPixel( const Rectangle& rRectDst,
// ------------------------------------------------------------------
-BOOL Bitmap::Expand( ULONG nDX, ULONG nDY, const Color* pInitColor )
+sal_Bool Bitmap::Expand( sal_uLong nDX, sal_uLong nDY, const Color* pInitColor )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( nDX || nDY )
{
@@ -1166,7 +1170,7 @@ BOOL Bitmap::Expand( ULONG nDX, ULONG nDY, const Color* pInitColor )
pWriteAcc->SetPixel( nY, nX, aColor );
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -1181,11 +1185,11 @@ BOOL Bitmap::Expand( ULONG nDX, ULONG nDY, const Color* pInitColor )
// ------------------------------------------------------------------
-Bitmap Bitmap::CreateMask( const Color& rTransColor, ULONG nTol ) const
+Bitmap Bitmap::CreateMask( const Color& rTransColor, sal_uLong nTol ) const
{
Bitmap aNewBmp( GetSizePixel(), 1 );
BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pWriteAcc )
{
@@ -1207,7 +1211,7 @@ Bitmap Bitmap::CreateMask( const Color& rTransColor, ULONG nTol ) const
pReadAcc->GetScanlineFormat() == BMP_FORMAT_4BIT_LSN_PAL )
{
// optimized for 4Bit-MSN/LSN source palette
- const BYTE cTest = aTest.GetIndex();
+ const sal_uInt8 cTest = aTest.GetIndex();
const long nShiftInit = ( ( pReadAcc->GetScanlineFormat() == BMP_FORMAT_4BIT_MSN_PAL ) ? 4 : 0 );
if( pWriteAcc->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL &&
@@ -1245,7 +1249,7 @@ Bitmap Bitmap::CreateMask( const Color& rTransColor, ULONG nTol ) const
else if( pReadAcc->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL )
{
// optimized for 8Bit source palette
- const BYTE cTest = aTest.GetIndex();
+ const sal_uInt8 cTest = aTest.GetIndex();
if( pWriteAcc->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL &&
aWhite.GetIndex() == 1 )
@@ -1352,7 +1356,7 @@ Bitmap Bitmap::CreateMask( const Color& rTransColor, ULONG nTol ) const
}
( (Bitmap*) this )->ReleaseAccess( pReadAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
aNewBmp.ReleaseAccess( pWriteAcc );
@@ -1424,11 +1428,11 @@ Region Bitmap::CreateRegion( const Color& rColor, const Rectangle& rRect ) const
// ------------------------------------------------------------------
-BOOL Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor )
+sal_Bool Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor )
{
BitmapReadAccess* pMaskAcc = ( (Bitmap&) rMask ).AcquireReadAccess();
BitmapWriteAccess* pAcc = AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pMaskAcc && pAcc )
{
@@ -1439,15 +1443,15 @@ BOOL Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor )
if( pAcc->HasPalette() )
{
- const USHORT nActColors = pAcc->GetPaletteEntryCount();
- const USHORT nMaxColors = 1 << pAcc->GetBitCount();
+ const sal_uInt16 nActColors = pAcc->GetPaletteEntryCount();
+ const sal_uInt16 nMaxColors = 1 << pAcc->GetBitCount();
// erst einmal naechste Farbe nehmen
aReplace = pAcc->GetBestMatchingColor( rReplaceColor );
// falls Palettenbild, und die zu setzende Farbe ist nicht
// in der Palette, suchen wir nach freien Eintraegen (teuer)
- if( pAcc->GetPaletteColor( (BYTE) aReplace ) != BitmapColor( rReplaceColor ) )
+ if( pAcc->GetPaletteColor( (sal_uInt8) aReplace ) != BitmapColor( rReplaceColor ) )
{
// erst einmal nachsehen, ob wir unsere ReplaceColor
// nicht auf einen freien Platz am Ende der Palette
@@ -1456,26 +1460,26 @@ BOOL Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor )
{
pAcc->SetPaletteEntryCount( nActColors + 1 );
pAcc->SetPaletteColor( nActColors, rReplaceColor );
- aReplace = BitmapColor( (BYTE) nActColors );
+ aReplace = BitmapColor( (sal_uInt8) nActColors );
}
else
{
- BOOL* pFlags = new BOOL[ nMaxColors ];
+ sal_Bool* pFlags = new sal_Bool[ nMaxColors ];
// alle Eintraege auf 0 setzen
memset( pFlags, 0, nMaxColors );
for( long nY = 0L; nY < nHeight; nY++ )
for( long nX = 0L; nX < nWidth; nX++ )
- pFlags[ (BYTE) pAcc->GetPixel( nY, nX ) ] = TRUE;
+ pFlags[ (sal_uInt8) pAcc->GetPixel( nY, nX ) ] = sal_True;
- for( USHORT i = 0UL; i < nMaxColors; i++ )
+ for( sal_uInt16 i = 0UL; i < nMaxColors; i++ )
{
// Hurra, wir haben einen unbenutzten Eintrag
if( !pFlags[ i ] )
{
- pAcc->SetPaletteColor( (USHORT) i, rReplaceColor );
- aReplace = BitmapColor( (BYTE) i );
+ pAcc->SetPaletteColor( (sal_uInt16) i, rReplaceColor );
+ aReplace = BitmapColor( (sal_uInt8) i );
}
}
@@ -1491,7 +1495,7 @@ BOOL Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor )
if( pMaskAcc->GetPixel( nY, nX ) == aMaskWhite )
pAcc->SetPixel( nY, nX, aReplace );
- bRet = TRUE;
+ bRet = sal_True;
}
( (Bitmap&) rMask ).ReleaseAccess( pMaskAcc );
@@ -1502,13 +1506,13 @@ BOOL Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor )
// ------------------------------------------------------------------
-BOOL Bitmap::Replace( const AlphaMask& rAlpha, const Color& rMergeColor )
+sal_Bool Bitmap::Replace( const AlphaMask& rAlpha, const Color& rMergeColor )
{
Bitmap aNewBmp( GetSizePixel(), 24 );
BitmapReadAccess* pAcc = AcquireReadAccess();
BitmapReadAccess* pAlphaAcc = ( (AlphaMask&) rAlpha ).AcquireReadAccess();
BitmapWriteAccess* pNewAcc = aNewBmp.AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pAcc && pAlphaAcc && pNewAcc )
{
@@ -1521,11 +1525,11 @@ BOOL Bitmap::Replace( const AlphaMask& rAlpha, const Color& rMergeColor )
for( long nX = 0L; nX < nWidth; nX++ )
{
aCol = pAcc->GetColor( nY, nX );
- pNewAcc->SetPixel( nY, nX, aCol.Merge( rMergeColor, 255 - (BYTE) pAlphaAcc->GetPixel( nY, nX ) ) );
+ pNewAcc->SetPixel( nY, nX, aCol.Merge( rMergeColor, 255 - (sal_uInt8) pAlphaAcc->GetPixel( nY, nX ) ) );
}
}
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pAcc );
@@ -1548,7 +1552,7 @@ BOOL Bitmap::Replace( const AlphaMask& rAlpha, const Color& rMergeColor )
// ------------------------------------------------------------------
-BOOL Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, ULONG nTol )
+sal_Bool Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol )
{
// Bitmaps with 1 bit color depth can cause problems
// if they have other entries than black/white in their palette
@@ -1556,7 +1560,7 @@ BOOL Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, ULO
Convert( BMP_CONVERSION_4BIT_COLORS );
BitmapWriteAccess* pAcc = AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pAcc )
{
@@ -1569,7 +1573,7 @@ BOOL Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, ULO
if( pAcc->HasPalette() )
{
- for( USHORT i = 0, nPalCount = pAcc->GetPaletteEntryCount(); i < nPalCount; i++ )
+ for( sal_uInt16 i = 0, nPalCount = pAcc->GetPaletteEntryCount(); i < nPalCount; i++ )
{
const BitmapColor& rCol = pAcc->GetPaletteColor( i );
@@ -1603,7 +1607,7 @@ BOOL Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, ULO
}
ReleaseAccess( pAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -1611,8 +1615,8 @@ BOOL Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, ULO
// ------------------------------------------------------------------
-BOOL Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColors,
- ULONG nColorCount, ULONG* _pTols )
+sal_Bool Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColors,
+ sal_uLong nColorCount, sal_uLong* _pTols )
{
// Bitmaps with 1 bit color depth can cause problems
// if they have other entries than black/white in their palette
@@ -1620,7 +1624,7 @@ BOOL Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColors,
Convert( BMP_CONVERSION_4BIT_COLORS );
BitmapWriteAccess* pAcc = AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pAcc )
{
@@ -1631,7 +1635,7 @@ BOOL Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColors,
long* pMinB = new long[ nColorCount ];
long* pMaxB = new long[ nColorCount ];
long* pTols;
- ULONG i;
+ sal_uLong i;
if( !_pTols )
{
@@ -1656,7 +1660,7 @@ BOOL Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColors,
if( pAcc->HasPalette() )
{
- for( USHORT nEntry = 0, nPalCount = pAcc->GetPaletteEntryCount(); nEntry < nPalCount; nEntry++ )
+ for( sal_uInt16 nEntry = 0, nPalCount = pAcc->GetPaletteEntryCount(); nEntry < nPalCount; nEntry++ )
{
const BitmapColor& rCol = pAcc->GetPaletteColor( nEntry );
@@ -1666,7 +1670,7 @@ BOOL Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColors,
pMinG[ i ] <= rCol.GetGreen() && pMaxG[ i ] >= rCol.GetGreen() &&
pMinB[ i ] <= rCol.GetBlue() && pMaxB[ i ] >= rCol.GetBlue() )
{
- pAcc->SetPaletteColor( (USHORT)nEntry, pReplaceColors[ i ] );
+ pAcc->SetPaletteColor( (sal_uInt16)nEntry, pReplaceColors[ i ] );
break;
}
}
@@ -1712,7 +1716,7 @@ BOOL Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColors,
delete[] pMinB;
delete[] pMaxB;
ReleaseAccess( pAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -1739,11 +1743,11 @@ Bitmap Bitmap::CreateDisplayBitmap( OutputDevice* pDisplay )
// ------------------------------------------------------------------
-BOOL Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine )
+sal_Bool Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine )
{
BitmapReadAccess* pMaskAcc = ( (Bitmap&) rMask ).AcquireReadAccess();
BitmapWriteAccess* pAcc = AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pMaskAcc && pAcc )
{
@@ -1867,7 +1871,7 @@ BOOL Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine )
break;
}
- bRet = TRUE;
+ bRet = sal_True;
}
( (Bitmap&) rMask ).ReleaseAccess( pMaskAcc );
@@ -1878,7 +1882,7 @@ BOOL Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine )
// ------------------------------------------------------------------
-BOOL Bitmap::Blend( const AlphaMask& rAlpha, const Color& rBackgroundColor )
+sal_Bool Bitmap::Blend( const AlphaMask& rAlpha, const Color& rBackgroundColor )
{
// TODO: Have a look at OutputDevice::ImplDrawAlpha() for some
// optimizations. Might even consolidate the code here and there.
@@ -1890,7 +1894,7 @@ BOOL Bitmap::Blend( const AlphaMask& rAlpha, const Color& rBackgroundColor )
BitmapReadAccess* pAlphaAcc = const_cast<AlphaMask&>(rAlpha).AcquireReadAccess();
BitmapWriteAccess* pAcc = AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pAlphaAcc && pAcc )
{
@@ -1903,7 +1907,7 @@ BOOL Bitmap::Blend( const AlphaMask& rAlpha, const Color& rBackgroundColor )
pAcc->GetPixel( nY, nX ).Merge( rBackgroundColor,
255 - pAlphaAcc->GetPixel( nY, nX ) ) );
- bRet = TRUE;
+ bRet = sal_True;
}
const_cast<AlphaMask&>(rAlpha).ReleaseAccess( pAlphaAcc );
@@ -1914,7 +1918,7 @@ BOOL Bitmap::Blend( const AlphaMask& rAlpha, const Color& rBackgroundColor )
// ------------------------------------------------------------------
-BOOL Bitmap::MakeMono( BYTE cThreshold )
+sal_Bool Bitmap::MakeMono( sal_uInt8 cThreshold )
{
return ImplMakeMono( cThreshold );
}
diff --git a/vcl/source/gdi/bitmap2.cxx b/vcl/source/gdi/bitmap2.cxx
index 7c0d565445c5..9db334395e23 100644
--- a/vcl/source/gdi/bitmap2.cxx
+++ b/vcl/source/gdi/bitmap2.cxx
@@ -96,14 +96,14 @@ struct DIBInfoHeader
namespace
{
- inline USHORT discretizeBitcount( UINT16 nInputCount )
+ inline sal_uInt16 discretizeBitcount( sal_uInt16 nInputCount )
{
return ( nInputCount <= 1 ) ? 1 :
( nInputCount <= 4 ) ? 4 :
( nInputCount <= 8 ) ? 8 : 24;
}
- inline bool isBitfieldCompression( ULONG nScanlineFormat )
+ inline bool isBitfieldCompression( sal_uLong nScanlineFormat )
{
return nScanlineFormat == BMP_FORMAT_16BIT_TC_LSB_MASK ||
nScanlineFormat == BMP_FORMAT_32BIT_TC_MASK;
@@ -116,7 +116,7 @@ namespace
SvStream& operator>>( SvStream& rIStm, Bitmap& rBitmap )
{
- rBitmap.Read( rIStm, TRUE );
+ rBitmap.Read( rIStm, sal_True );
return rIStm;
}
@@ -124,18 +124,18 @@ SvStream& operator>>( SvStream& rIStm, Bitmap& rBitmap )
SvStream& operator<<( SvStream& rOStm, const Bitmap& rBitmap )
{
- rBitmap.Write( rOStm, FALSE, TRUE );
+ rBitmap.Write( rOStm, sal_False, sal_True );
return rOStm;
}
// ------------------------------------------------------------------
-BOOL Bitmap::Read( SvStream& rIStm, BOOL bFileHeader, BOOL bIsMSOFormat )
+sal_Bool Bitmap::Read( SvStream& rIStm, sal_Bool bFileHeader, sal_Bool bIsMSOFormat )
{
- const USHORT nOldFormat = rIStm.GetNumberFormatInt();
- const ULONG nOldPos = rIStm.Tell();
- ULONG nOffset = 0UL;
- BOOL bRet = FALSE;
+ const sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
+ const sal_uLong nOldPos = rIStm.Tell();
+ sal_uLong nOffset = 0UL;
+ sal_Bool bRet = sal_False;
rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -162,16 +162,16 @@ BOOL Bitmap::Read( SvStream& rIStm, BOOL bFileHeader, BOOL bIsMSOFormat )
// ------------------------------------------------------------------
-BOOL Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, ULONG nOffset, BOOL bIsMSOFormat )
+sal_Bool Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, sal_uLong nOffset, sal_Bool bIsMSOFormat )
{
DIBInfoHeader aHeader;
- const ULONG nStmPos = rIStm.Tell();
- BOOL bRet = FALSE;
+ const sal_uLong nStmPos = rIStm.Tell();
+ sal_Bool bRet = sal_False;
sal_Bool bTopDown = sal_False;
if( ImplReadDIBInfoHeader( rIStm, aHeader, bTopDown, bIsMSOFormat ) && aHeader.nWidth && aHeader.nHeight && aHeader.nBitCount )
{
- const USHORT nBitCount( discretizeBitcount(aHeader.nBitCount) );
+ const sal_uInt16 nBitCount( discretizeBitcount(aHeader.nBitCount) );
const Size aSizePixel( aHeader.nWidth, abs(aHeader.nHeight) );
BitmapPalette aDummyPal;
@@ -180,15 +180,15 @@ BOOL Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, ULONG nOffset, BOOL bIs
if( pAcc )
{
- USHORT nColors;
+ sal_uInt16 nColors;
SvStream* pIStm;
SvMemoryStream* pMemStm = NULL;
- BYTE* pData = NULL;
+ sal_uInt8* pData = NULL;
if( nBitCount <= 8 )
{
if( aHeader.nColsUsed )
- nColors = (USHORT) aHeader.nColsUsed;
+ nColors = (sal_uInt16) aHeader.nColsUsed;
else
nColors = ( 1 << aHeader.nBitCount );
}
@@ -199,11 +199,11 @@ BOOL Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, ULONG nOffset, BOOL bIs
{
ZCodec aCodec;
sal_uInt32 nCodedSize, nUncodedSize;
- ULONG nCodedPos;
+ sal_uLong nCodedPos;
// read coding information
rIStm >> nCodedSize >> nUncodedSize >> aHeader.nCompression;
- pData = (BYTE*) rtl_allocateMemory( nUncodedSize );
+ pData = (sal_uInt8*) rtl_allocateMemory( nUncodedSize );
// decode buffer
nCodedPos = rIStm.Tell();
@@ -218,7 +218,7 @@ BOOL Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, ULONG nOffset, BOOL bIs
// from which we will read the bitmap data
pMemStm = new SvMemoryStream;
pIStm = pMemStm;
- pMemStm->SetBuffer( (char*) pData, nUncodedSize, FALSE, nUncodedSize );
+ pMemStm->SetBuffer( (char*) pData, nUncodedSize, sal_False, nUncodedSize );
nOffset = 0;
}
else
@@ -266,11 +266,11 @@ BOOL Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, ULONG nOffset, BOOL bIs
// ------------------------------------------------------------------
-BOOL Bitmap::ImplReadDIBFileHeader( SvStream& rIStm, ULONG& rOffset )
+sal_Bool Bitmap::ImplReadDIBFileHeader( SvStream& rIStm, sal_uLong& rOffset )
{
- UINT32 nTmp32;
- UINT16 nTmp16 = 0;
- BOOL bRet = FALSE;
+ sal_uInt32 nTmp32;
+ sal_uInt16 nTmp16 = 0;
+ sal_Bool bRet = sal_False;
rIStm >> nTmp16;
@@ -301,7 +301,7 @@ BOOL Bitmap::ImplReadDIBFileHeader( SvStream& rIStm, ULONG& rOffset )
// ------------------------------------------------------------------
-BOOL Bitmap::ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal_Bool& bTopDown, sal_Bool bIsMSOFormat )
+sal_Bool Bitmap::ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal_Bool& bTopDown, sal_Bool bIsMSOFormat )
{
// BITMAPINFOHEADER or BITMAPCOREHEADER
rIStm >> rHeader.nSize;
@@ -337,7 +337,7 @@ BOOL Bitmap::ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal
// unknown Header
if( rHeader.nSize < DIBINFOHEADERSIZE )
{
- ULONG nUnknownSize = sizeof( rHeader.nSize );
+ sal_uLong nUnknownSize = sizeof( rHeader.nSize );
rIStm >> rHeader.nWidth; nUnknownSize += sizeof( rHeader.nWidth );
rIStm >> rHeader.nHeight; nUnknownSize += sizeof( rHeader.nHeight );
@@ -418,17 +418,17 @@ BOOL Bitmap::ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal
// ------------------------------------------------------------------
-BOOL Bitmap::ImplReadDIBPalette( SvStream& rIStm, BitmapWriteAccess& rAcc, BOOL bQuad )
+sal_Bool Bitmap::ImplReadDIBPalette( SvStream& rIStm, BitmapWriteAccess& rAcc, sal_Bool bQuad )
{
- const USHORT nColors = rAcc.GetPaletteEntryCount();
- const ULONG nPalSize = nColors * ( bQuad ? 4UL : 3UL );
+ const sal_uInt16 nColors = rAcc.GetPaletteEntryCount();
+ const sal_uLong nPalSize = nColors * ( bQuad ? 4UL : 3UL );
BitmapColor aPalColor;
- BYTE* pEntries = new BYTE[ nPalSize ];
+ sal_uInt8* pEntries = new sal_uInt8[ nPalSize ];
rIStm.Read( pEntries, nPalSize );
- BYTE* pTmpEntry = pEntries;
- for( USHORT i = 0; i < nColors; i++ )
+ sal_uInt8* pTmpEntry = pEntries;
+ for( sal_uInt16 i = 0; i < nColors; i++ )
{
aPalColor.SetBlue( *pTmpEntry++ );
aPalColor.SetGreen( *pTmpEntry++ );
@@ -447,15 +447,15 @@ BOOL Bitmap::ImplReadDIBPalette( SvStream& rIStm, BitmapWriteAccess& rAcc, BOOL
// ------------------------------------------------------------------
-BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWriteAccess& rAcc, sal_Bool bTopDown )
+sal_Bool Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWriteAccess& rAcc, sal_Bool bTopDown )
{
- const ULONG nAlignedWidth = AlignedWidth4Bytes( rHeader.nWidth * rHeader.nBitCount );
- UINT32 nRMask = 0;
- UINT32 nGMask = 0;
- UINT32 nBMask = 0;
- BOOL bNative;
- BOOL bTCMask = ( rHeader.nBitCount == 16 ) || ( rHeader.nBitCount == 32 );
- BOOL bRLE = ( RLE_8 == rHeader.nCompression && rHeader.nBitCount == 8 ) ||
+ const sal_uLong nAlignedWidth = AlignedWidth4Bytes( rHeader.nWidth * rHeader.nBitCount );
+ sal_uInt32 nRMask = 0;
+ sal_uInt32 nGMask = 0;
+ sal_uInt32 nBMask = 0;
+ sal_Bool bNative;
+ sal_Bool bTCMask = ( rHeader.nBitCount == 16 ) || ( rHeader.nBitCount == 32 );
+ sal_Bool bRLE = ( RLE_8 == rHeader.nCompression && rHeader.nBitCount == 8 ) ||
( RLE_4 == rHeader.nCompression && rHeader.nBitCount == 4 );
// Is native format?
@@ -469,7 +469,7 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
break;
default:
- bNative = FALSE;
+ bNative = sal_False;
break;
}
// Read data
@@ -511,14 +511,14 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
{
if ( !rHeader.nSizeImage )
{
- const ULONG nOldPos = rIStm.Tell();
+ const sal_uLong nOldPos = rIStm.Tell();
rIStm.Seek( STREAM_SEEK_TO_END );
rHeader.nSizeImage = rIStm.Tell() - nOldPos;
rIStm.Seek( nOldPos );
}
- BYTE* pBuffer = (BYTE*) rtl_allocateMemory( rHeader.nSizeImage );
+ sal_uInt8* pBuffer = (sal_uInt8*) rtl_allocateMemory( rHeader.nSizeImage );
rIStm.Read( (char*) pBuffer, rHeader.nSizeImage );
ImplDecodeRLE( pBuffer, rHeader, rAcc, RLE_4 == rHeader.nCompression );
@@ -529,7 +529,7 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
{
const long nWidth = rHeader.nWidth;
const long nHeight = abs(rHeader.nHeight);
- BYTE* pBuf = new BYTE[ nAlignedWidth ];
+ sal_uInt8* pBuf = new sal_uInt8[ nAlignedWidth ];
// true color DIB's can have a (optimization) palette
if( rHeader.nColsUsed && rHeader.nBitCount > 8 )
@@ -543,8 +543,8 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
{
case( 1 ):
{
- BYTE* pTmp;
- BYTE cTmp;
+ sal_uInt8* pTmp;
+ sal_uInt8 cTmp;
for( ; nCount--; nY += nI )
{
@@ -559,7 +559,7 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
cTmp = *pTmp++;
}
- rAcc.SetPixel( nY, nX, sal::static_int_cast<BYTE>(( cTmp >> --nShift ) & 1) );
+ rAcc.SetPixel( nY, nX, sal::static_int_cast<sal_uInt8>(( cTmp >> --nShift ) & 1) );
}
}
}
@@ -567,8 +567,8 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
case( 4 ):
{
- BYTE* pTmp;
- BYTE cTmp;
+ sal_uInt8* pTmp;
+ sal_uInt8 cTmp;
for( ; nCount--; nY += nI )
{
@@ -583,7 +583,7 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
cTmp = *pTmp++;
}
- rAcc.SetPixel( nY, nX, sal::static_int_cast<BYTE>(( cTmp >> ( --nShift << 2UL ) ) & 0x0f) );
+ rAcc.SetPixel( nY, nX, sal::static_int_cast<sal_uInt8>(( cTmp >> ( --nShift << 2UL ) ) & 0x0f) );
}
}
}
@@ -591,7 +591,7 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
case( 8 ):
{
- BYTE* pTmp;
+ sal_uInt8* pTmp;
for( ; nCount--; nY += nI )
{
@@ -607,15 +607,15 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
{
ColorMask aMask( nRMask, nGMask, nBMask );
BitmapColor aColor;
- UINT16* pTmp16;
+ sal_uInt16* pTmp16;
for( ; nCount--; nY += nI )
{
- rIStm.Read( (char*)( pTmp16 = (UINT16*) pBuf ), nAlignedWidth );
+ rIStm.Read( (char*)( pTmp16 = (sal_uInt16*) pBuf ), nAlignedWidth );
for( long nX = 0L; nX < nWidth; nX++ )
{
- aMask.GetColorFor16BitLSB( aColor, (BYTE*) pTmp16++ );
+ aMask.GetColorFor16BitLSB( aColor, (sal_uInt8*) pTmp16++ );
rAcc.SetPixel( nY, nX, aColor );
}
}
@@ -625,7 +625,7 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
case( 24 ):
{
BitmapColor aPixelColor;
- BYTE* pTmp;
+ sal_uInt8* pTmp;
for( ; nCount--; nY += nI )
{
@@ -646,15 +646,15 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
{
ColorMask aMask( nRMask, nGMask, nBMask );
BitmapColor aColor;
- UINT32* pTmp32;
+ sal_uInt32* pTmp32;
for( ; nCount--; nY += nI )
{
- rIStm.Read( (char*)( pTmp32 = (UINT32*) pBuf ), nAlignedWidth );
+ rIStm.Read( (char*)( pTmp32 = (sal_uInt32*) pBuf ), nAlignedWidth );
for( long nX = 0L; nX < nWidth; nX++ )
{
- aMask.GetColorFor32Bit( aColor, (BYTE*) pTmp32++ );
+ aMask.GetColorFor32Bit( aColor, (sal_uInt8*) pTmp32++ );
rAcc.SetPixel( nY, nX, aColor );
}
}
@@ -670,18 +670,18 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
// ------------------------------------------------------------------
-BOOL Bitmap::Write( SvStream& rOStm, BOOL bCompressed, BOOL bFileHeader ) const
+sal_Bool Bitmap::Write( SvStream& rOStm, sal_Bool bCompressed, sal_Bool bFileHeader ) const
{
DBG_ASSERT( mpImpBmp, "Empty Bitmaps can't be saved" );
const Size aSizePix( GetSizePixel() );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( mpImpBmp && aSizePix.Width() && aSizePix.Height() )
{
BitmapReadAccess* pAcc = ( (Bitmap*) this)->AcquireReadAccess();
- const USHORT nOldFormat = rOStm.GetNumberFormatInt();
- const ULONG nOldPos = rOStm.Tell();
+ const sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt();
+ const sal_uLong nOldPos = rOStm.Tell();
rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -712,14 +712,14 @@ BOOL Bitmap::Write( SvStream& rOStm, BOOL bCompressed, BOOL bFileHeader ) const
// ------------------------------------------------------------------
-BOOL Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bCompressed ) const
+sal_Bool Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool bCompressed ) const
{
const MapMode aMapPixel( MAP_PIXEL );
DIBInfoHeader aHeader;
- ULONG nImageSizePos;
- ULONG nEndPos;
+ sal_uLong nImageSizePos;
+ sal_uLong nEndPos;
sal_uInt32 nCompression = 0;
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
aHeader.nSize = DIBINFOHEADERSIZE;
aHeader.nWidth = rAcc.Width();
@@ -744,7 +744,7 @@ BOOL Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bCompre
// recent.
// #i59239# discretize bitcount to 1,4,8,24 (other cases
// are not written below)
- const UINT16 nBitCount( sal::static_int_cast<UINT16>(rAcc.GetBitCount()) );
+ const sal_uInt16 nBitCount( sal::static_int_cast<sal_uInt16>(rAcc.GetBitCount()) );
aHeader.nBitCount = discretizeBitcount( nBitCount );
aHeader.nSizeImage = rAcc.Height() *
@@ -787,8 +787,8 @@ BOOL Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bCompre
if( fabs(fBmpWidthM) > 0.000000001 &&
fabs(fBmpHeightM) > 0.000000001 )
{
- aHeader.nXPelsPerMeter = (UINT32)(rAcc.Width() / fBmpWidthM + .5);
- aHeader.nYPelsPerMeter = (UINT32)(rAcc.Height() / fBmpHeightM + .5);
+ aHeader.nXPelsPerMeter = (sal_uInt32)(rAcc.Width() / fBmpWidthM + .5);
+ aHeader.nYPelsPerMeter = (sal_uInt32)(rAcc.Height() / fBmpHeightM + .5);
}
}
@@ -814,7 +814,7 @@ BOOL Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bCompre
{
ZCodec aCodec;
SvMemoryStream aMemStm( aHeader.nSizeImage + 4096, 65535 );
- ULONG nCodedPos = rOStm.Tell(), nLastPos;
+ sal_uLong nCodedPos = rOStm.Tell(), nLastPos;
sal_uInt32 nCodedSize, nUncodedSize;
// write uncoded data palette
@@ -832,7 +832,7 @@ BOOL Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bCompre
// write compressed data
aCodec.BeginCompression( 3 );
- aCodec.Write( rOStm, (BYTE*) aMemStm.GetData(), nUncodedSize );
+ aCodec.Write( rOStm, (sal_uInt8*) aMemStm.GetData(), nUncodedSize );
aCodec.EndCompression();
// update compress info ( coded size, uncoded size, uncoded compression )
@@ -862,16 +862,16 @@ BOOL Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bCompre
// ------------------------------------------------------------------
-BOOL Bitmap::ImplWriteDIBFileHeader( SvStream& rOStm, BitmapReadAccess& rAcc )
+sal_Bool Bitmap::ImplWriteDIBFileHeader( SvStream& rOStm, BitmapReadAccess& rAcc )
{
- UINT32 nPalCount = ( rAcc.HasPalette() ? rAcc.GetPaletteEntryCount() :
+ sal_uInt32 nPalCount = ( rAcc.HasPalette() ? rAcc.GetPaletteEntryCount() :
isBitfieldCompression( rAcc.GetScanlineFormat() ) ? 3UL : 0UL );
- UINT32 nOffset = 14 + DIBINFOHEADERSIZE + nPalCount * 4UL;
+ sal_uInt32 nOffset = 14 + DIBINFOHEADERSIZE + nPalCount * 4UL;
- rOStm << (UINT16) 0x4D42;
- rOStm << (UINT32) ( nOffset + ( rAcc.Height() * rAcc.GetScanlineSize() ) );
- rOStm << (UINT16) 0;
- rOStm << (UINT16) 0;
+ rOStm << (sal_uInt16) 0x4D42;
+ rOStm << (sal_uInt32) ( nOffset + ( rAcc.Height() * rAcc.GetScanlineSize() ) );
+ rOStm << (sal_uInt16) 0;
+ rOStm << (sal_uInt16) 0;
rOStm << nOffset;
return( rOStm.GetError() == 0UL );
@@ -879,15 +879,15 @@ BOOL Bitmap::ImplWriteDIBFileHeader( SvStream& rOStm, BitmapReadAccess& rAcc )
// ------------------------------------------------------------------
-BOOL Bitmap::ImplWriteDIBPalette( SvStream& rOStm, BitmapReadAccess& rAcc )
+sal_Bool Bitmap::ImplWriteDIBPalette( SvStream& rOStm, BitmapReadAccess& rAcc )
{
- const USHORT nColors = rAcc.GetPaletteEntryCount();
- const ULONG nPalSize = nColors * 4UL;
- BYTE* pEntries = new BYTE[ nPalSize ];
- BYTE* pTmpEntry = pEntries;
+ const sal_uInt16 nColors = rAcc.GetPaletteEntryCount();
+ const sal_uLong nPalSize = nColors * 4UL;
+ sal_uInt8* pEntries = new sal_uInt8[ nPalSize ];
+ sal_uInt8* pTmpEntry = pEntries;
BitmapColor aPalColor;
- for( USHORT i = 0; i < nColors; i++ )
+ for( sal_uInt16 i = 0; i < nColors; i++ )
{
const BitmapColor& rPalColor = rAcc.GetPaletteColor( i );
@@ -905,8 +905,8 @@ BOOL Bitmap::ImplWriteDIBPalette( SvStream& rOStm, BitmapReadAccess& rAcc )
// ------------------------------------------------------------------
-BOOL Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
- ULONG nCompression, sal_uInt32& rImageSize )
+sal_Bool Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
+ sal_uLong nCompression, sal_uInt32& rImageSize )
{
if( BITFIELDS == nCompression )
{
@@ -914,13 +914,13 @@ BOOL Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
SVBT32 aVal32;
UInt32ToSVBT32( rMask.GetRedMask(), aVal32 );
- rOStm.Write( (BYTE*) aVal32, 4UL );
+ rOStm.Write( (sal_uInt8*) aVal32, 4UL );
UInt32ToSVBT32( rMask.GetGreenMask(), aVal32 );
- rOStm.Write( (BYTE*) aVal32, 4UL );
+ rOStm.Write( (sal_uInt8*) aVal32, 4UL );
UInt32ToSVBT32( rMask.GetBlueMask(), aVal32 );
- rOStm.Write( (BYTE*) aVal32, 4UL );
+ rOStm.Write( (sal_uInt8*) aVal32, 4UL );
rImageSize = rOStm.Tell();
@@ -947,10 +947,10 @@ BOOL Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
// bitmaps is relatively recent.
// #i59239# discretize bitcount for aligned width to 1,4,8,24
// (other cases are not written below)
- const USHORT nBitCount( sal::static_int_cast<USHORT>(rAcc.GetBitCount()) );
- const ULONG nAlignedWidth = AlignedWidth4Bytes( rAcc.Width() *
+ const sal_uInt16 nBitCount( sal::static_int_cast<sal_uInt16>(rAcc.GetBitCount()) );
+ const sal_uLong nAlignedWidth = AlignedWidth4Bytes( rAcc.Width() *
discretizeBitcount(nBitCount));
- BOOL bNative = FALSE;
+ sal_Bool bNative = sal_False;
switch( rAcc.GetScanlineFormat() )
{
@@ -960,7 +960,7 @@ BOOL Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
case( BMP_FORMAT_24BIT_TC_BGR ):
{
if( rAcc.IsBottomUp() && ( rAcc.GetScanlineSize() == nAlignedWidth ) )
- bNative = TRUE;
+ bNative = sal_True;
}
break;
@@ -976,9 +976,9 @@ BOOL Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
{
const long nWidth = rAcc.Width();
const long nHeight = rAcc.Height();
- BYTE* pBuf = new BYTE[ nAlignedWidth ];
- BYTE* pTmp;
- BYTE cTmp;
+ sal_uInt8* pBuf = new sal_uInt8[ nAlignedWidth ];
+ sal_uInt8* pTmp;
+ sal_uInt8 cTmp;
switch( nBitCount )
{
@@ -998,7 +998,7 @@ BOOL Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
cTmp = 0;
}
- cTmp |= ( (BYTE) rAcc.GetPixel( nY, nX ) << --nShift );
+ cTmp |= ( (sal_uInt8) rAcc.GetPixel( nY, nX ) << --nShift );
}
*pTmp = cTmp;
@@ -1023,7 +1023,7 @@ BOOL Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
cTmp = 0;
}
- cTmp |= ( (BYTE) rAcc.GetPixel( nY, nX ) << ( --nShift << 2L ) );
+ cTmp |= ( (sal_uInt8) rAcc.GetPixel( nY, nX ) << ( --nShift << 2L ) );
}
*pTmp = cTmp;
rOStm.Write( pBuf, nAlignedWidth );
@@ -1081,17 +1081,17 @@ BOOL Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
// ------------------------------------------------------------------
-void Bitmap::ImplDecodeRLE( BYTE* pBuffer, DIBInfoHeader& rHeader,
- BitmapWriteAccess& rAcc, BOOL bRLE4 )
+void Bitmap::ImplDecodeRLE( sal_uInt8* pBuffer, DIBInfoHeader& rHeader,
+ BitmapWriteAccess& rAcc, sal_Bool bRLE4 )
{
Scanline pRLE = pBuffer;
long nY = abs(rHeader.nHeight) - 1L;
- const ULONG nWidth = rAcc.Width();
- ULONG nCountByte;
- ULONG nRunByte;
- ULONG nX = 0UL;
- BYTE cTmp;
- BOOL bEndDecoding = FALSE;
+ const sal_uLong nWidth = rAcc.Width();
+ sal_uLong nCountByte;
+ sal_uLong nRunByte;
+ sal_uLong nX = 0UL;
+ sal_uInt8 cTmp;
+ sal_Bool bEndDecoding = sal_False;
do
{
@@ -1105,7 +1105,7 @@ void Bitmap::ImplDecodeRLE( BYTE* pBuffer, DIBInfoHeader& rHeader,
{
nCountByte = nRunByte >> 1;
- for( ULONG i = 0UL; i < nCountByte; i++ )
+ for( sal_uLong i = 0UL; i < nCountByte; i++ )
{
cTmp = *pRLE++;
@@ -1129,7 +1129,7 @@ void Bitmap::ImplDecodeRLE( BYTE* pBuffer, DIBInfoHeader& rHeader,
}
else
{
- for( ULONG i = 0UL; i < nRunByte; i++ )
+ for( sal_uLong i = 0UL; i < nRunByte; i++ )
{
if( nX < nWidth )
rAcc.SetPixel( nY, nX++, *pRLE );
@@ -1147,7 +1147,7 @@ void Bitmap::ImplDecodeRLE( BYTE* pBuffer, DIBInfoHeader& rHeader,
nX = 0UL;
}
else if( nRunByte == 1 )
- bEndDecoding = TRUE;
+ bEndDecoding = sal_True;
else
{
nX += *pRLE++;
@@ -1162,7 +1162,7 @@ void Bitmap::ImplDecodeRLE( BYTE* pBuffer, DIBInfoHeader& rHeader,
{
nRunByte = nCountByte >> 1;
- for( ULONG i = 0UL; i < nRunByte; i++ )
+ for( sal_uLong i = 0UL; i < nRunByte; i++ )
{
if( nX < nWidth )
rAcc.SetPixel( nY, nX++, cTmp >> 4 );
@@ -1176,7 +1176,7 @@ void Bitmap::ImplDecodeRLE( BYTE* pBuffer, DIBInfoHeader& rHeader,
}
else
{
- for( ULONG i = 0UL; ( i < nCountByte ) && ( nX < nWidth ); i++ )
+ for( sal_uLong i = 0UL; ( i < nCountByte ) && ( nX < nWidth ); i++ )
rAcc.SetPixel( nY, nX++, cTmp );
}
}
@@ -1186,19 +1186,19 @@ void Bitmap::ImplDecodeRLE( BYTE* pBuffer, DIBInfoHeader& rHeader,
// ------------------------------------------------------------------
-BOOL Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bRLE4 )
+sal_Bool Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool bRLE4 )
{
- const ULONG nWidth = rAcc.Width();
- const ULONG nHeight = rAcc.Height();
- ULONG nX;
- ULONG nSaveIndex;
- ULONG nCount;
- ULONG nBufCount;
- BYTE* pBuf = new BYTE[ ( nWidth << 1 ) + 2 ];
- BYTE* pTmp;
- BYTE cPix;
- BYTE cLast;
- BOOL bFound;
+ const sal_uLong nWidth = rAcc.Width();
+ const sal_uLong nHeight = rAcc.Height();
+ sal_uLong nX;
+ sal_uLong nSaveIndex;
+ sal_uLong nCount;
+ sal_uLong nBufCount;
+ sal_uInt8* pBuf = new sal_uInt8[ ( nWidth << 1 ) + 2 ];
+ sal_uInt8* pTmp;
+ sal_uInt8 cPix;
+ sal_uInt8 cLast;
+ sal_Bool bFound;
for ( long nY = nHeight - 1L; nY >= 0L; nY-- )
{
@@ -1218,7 +1218,7 @@ BOOL Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bRLE4 )
if ( nCount > 1 )
{
- *pTmp++ = (BYTE) nCount;
+ *pTmp++ = (sal_uInt8) nCount;
*pTmp++ = ( bRLE4 ? ( ( cPix << 4 ) | cPix ) : cPix );
nBufCount += 2;
}
@@ -1226,13 +1226,13 @@ BOOL Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bRLE4 )
{
cLast = cPix;
nSaveIndex = nX - 1UL;
- bFound = FALSE;
+ bFound = sal_False;
while( ( nX < nWidth ) && ( nCount < 256L ) && ( cPix = rAcc.GetPixel( nY, nX ) ) != cLast )
{
nX++; nCount++;
cLast = cPix;
- bFound = TRUE;
+ bFound = sal_True;
}
if ( bFound )
@@ -1241,13 +1241,13 @@ BOOL Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bRLE4 )
if ( nCount > 3 )
{
*pTmp++ = 0;
- *pTmp++ = (BYTE) --nCount;
+ *pTmp++ = (sal_uInt8) --nCount;
if( bRLE4 )
{
- for ( ULONG i = 0; i < nCount; i++, pTmp++ )
+ for ( sal_uLong i = 0; i < nCount; i++, pTmp++ )
{
- *pTmp = (BYTE) rAcc.GetPixel( nY, nSaveIndex++ ) << 4;
+ *pTmp = (sal_uInt8) rAcc.GetPixel( nY, nSaveIndex++ ) << 4;
if ( ++i < nCount )
*pTmp |= rAcc.GetPixel( nY, nSaveIndex++ );
@@ -1257,7 +1257,7 @@ BOOL Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bRLE4 )
}
else
{
- for( ULONG i = 0UL; i < nCount; i++ )
+ for( sal_uLong i = 0UL; i < nCount; i++ )
*pTmp++ = rAcc.GetPixel( nY, nSaveIndex++ );
}
@@ -1272,12 +1272,12 @@ BOOL Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bRLE4 )
else
{
*pTmp++ = 1;
- *pTmp++ = (BYTE) rAcc.GetPixel( nY, nSaveIndex ) << ( bRLE4 ? 4 : 0 );
+ *pTmp++ = (sal_uInt8) rAcc.GetPixel( nY, nSaveIndex ) << ( bRLE4 ? 4 : 0 );
if ( nCount == 3 )
{
*pTmp++ = 1;
- *pTmp++ = (BYTE) rAcc.GetPixel( nY, ++nSaveIndex ) << ( bRLE4 ? 4 : 0 );
+ *pTmp++ = (sal_uInt8) rAcc.GetPixel( nY, ++nSaveIndex ) << ( bRLE4 ? 4 : 0 );
nBufCount += 4;
}
else
@@ -1292,8 +1292,8 @@ BOOL Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bRLE4 )
rOStm.Write( pBuf, nBufCount );
}
- rOStm << (BYTE) 0;
- rOStm << (BYTE) 1;
+ rOStm << (sal_uInt8) 0;
+ rOStm << (sal_uInt8) 1;
delete[] pBuf;
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index f246ecd31058..c2d929ea4fa0 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -41,8 +41,8 @@
// - Defines -
// -----------
-#define RGB15( _def_cR, _def_cG, _def_cB ) (((ULONG)(_def_cR)<<10UL)|((ULONG)(_def_cG)<<5UL)|(ULONG)(_def_cB))
-#define GAMMA( _def_cVal, _def_InvGamma ) ((BYTE)MinMax(FRound(pow( _def_cVal/255.0,_def_InvGamma)*255.0),0L,255L))
+#define RGB15( _def_cR, _def_cG, _def_cB ) (((sal_uLong)(_def_cR)<<10UL)|((sal_uLong)(_def_cG)<<5UL)|(sal_uLong)(_def_cB))
+#define GAMMA( _def_cVal, _def_InvGamma ) ((sal_uInt8)MinMax(FRound(pow( _def_cVal/255.0,_def_InvGamma)*255.0),0L,255L))
#define CALC_ERRORS \
nTemp = p1T[nX++] >> 12; \
@@ -77,13 +77,13 @@
// - Statics -
// -----------
-ULONG nVCLRLut[ 6 ] = { 16, 17, 18, 19, 20, 21 };
-ULONG nVCLGLut[ 6 ] = { 0, 6, 12, 18, 24, 30 };
-ULONG nVCLBLut[ 6 ] = { 0, 36, 72, 108, 144, 180 };
+sal_uLong nVCLRLut[ 6 ] = { 16, 17, 18, 19, 20, 21 };
+sal_uLong nVCLGLut[ 6 ] = { 0, 6, 12, 18, 24, 30 };
+sal_uLong nVCLBLut[ 6 ] = { 0, 36, 72, 108, 144, 180 };
// ------------------------------------------------------------------------
-ULONG nVCLDitherLut[ 256 ] =
+sal_uLong nVCLDitherLut[ 256 ] =
{
0, 49152, 12288, 61440, 3072, 52224, 15360, 64512, 768, 49920, 13056,
62208, 3840, 52992, 16128, 65280, 32768, 16384, 45056, 28672, 35840, 19456,
@@ -113,7 +113,7 @@ ULONG nVCLDitherLut[ 256 ] =
// ------------------------------------------------------------------------
-ULONG nVCLLut[ 256 ] =
+sal_uLong nVCLLut[ 256 ] =
{
0, 1286, 2572, 3858, 5144, 6430, 7716, 9002,
10288, 11574, 12860, 14146, 15432, 16718, 18004, 19290,
@@ -243,14 +243,14 @@ long FloydIndexMap[6] =
// - ImplCreateDitherMatrix -
// --------------------------
-void ImplCreateDitherMatrix( BYTE (*pDitherMatrix)[16][16] )
+void ImplCreateDitherMatrix( sal_uInt8 (*pDitherMatrix)[16][16] )
{
double fVal = 3.125;
const double fVal16 = fVal / 16.;
long i, j, k, l;
- USHORT pMtx[ 16 ][ 16 ];
- USHORT nMax = 0;
- static BYTE pMagic[4][4] = { { 0, 14, 3, 13, },
+ sal_uInt16 pMtx[ 16 ][ 16 ];
+ sal_uInt16 nMax = 0;
+ static sal_uInt8 pMagic[4][4] = { { 0, 14, 3, 13, },
{11, 5, 8, 6, },
{12, 2, 15, 1, },
{7, 9, 4, 10 } };
@@ -261,22 +261,22 @@ void ImplCreateDitherMatrix( BYTE (*pDitherMatrix)[16][16] )
for ( k = 0; k < 4; k++ )
for ( l = 0; l < 4; l++ )
nMax = Max ( pMtx[ (k<<2) + i][(l<<2 ) + j] =
- (USHORT) ( 0.5 + pMagic[i][j]*fVal + pMagic[k][l]*fVal16 ), nMax );
+ (sal_uInt16) ( 0.5 + pMagic[i][j]*fVal + pMagic[k][l]*fVal16 ), nMax );
// auf Intervall [0;254] skalieren
for ( i = 0, fVal = 254. / nMax; i < 16; i++ )
for( j = 0; j < 16; j++ )
- (*pDitherMatrix)[i][j] = (BYTE) ( fVal * pMtx[i][j] );
+ (*pDitherMatrix)[i][j] = (sal_uInt8) ( fVal * pMtx[i][j] );
}
// ----------
// - Bitmap -
// ----------
-BOOL Bitmap::Convert( BmpConversion eConversion )
+sal_Bool Bitmap::Convert( BmpConversion eConversion )
{
- const USHORT nBitCount = GetBitCount();
- BOOL bRet = FALSE;
+ const sal_uInt16 nBitCount = GetBitCount();
+ sal_Bool bRet = sal_False;
switch( eConversion )
{
@@ -299,7 +299,7 @@ BOOL Bitmap::Convert( BmpConversion eConversion )
else if( nBitCount > 4 )
bRet = ImplConvertDown( 4, NULL );
else
- bRet = TRUE;
+ bRet = sal_True;
}
break;
@@ -325,7 +325,7 @@ BOOL Bitmap::Convert( BmpConversion eConversion )
else if( nBitCount > 8 )
bRet = ImplConvertDown( 8 );
else
- bRet = TRUE;
+ bRet = sal_True;
}
break;
@@ -343,9 +343,9 @@ BOOL Bitmap::Convert( BmpConversion eConversion )
case( BMP_CONVERSION_24BIT ):
{
if( nBitCount < 24 )
- bRet = ImplConvertUp( 24, FALSE );
+ bRet = ImplConvertUp( 24, sal_False );
else
- bRet = TRUE;
+ bRet = sal_True;
}
break;
@@ -363,10 +363,10 @@ BOOL Bitmap::Convert( BmpConversion eConversion )
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplMakeMono( BYTE cThreshold )
+sal_Bool Bitmap::ImplMakeMono( sal_uInt8 cThreshold )
{
BitmapReadAccess* pReadAcc = AcquireReadAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pReadAcc )
{
@@ -414,7 +414,7 @@ BOOL Bitmap::ImplMakeMono( BYTE cThreshold )
}
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -436,10 +436,10 @@ BOOL Bitmap::ImplMakeMono( BYTE cThreshold )
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplMakeMonoDither()
+sal_Bool Bitmap::ImplMakeMonoDither()
{
BitmapReadAccess* pReadAcc = AcquireReadAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pReadAcc )
{
@@ -452,7 +452,7 @@ BOOL Bitmap::ImplMakeMonoDither()
const BitmapColor aWhite( pWriteAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
const long nWidth = pWriteAcc->Width();
const long nHeight = pWriteAcc->Height();
- BYTE pDitherMatrix[ 16 ][ 16 ];
+ sal_uInt8 pDitherMatrix[ 16 ][ 16 ];
ImplCreateDitherMatrix( &pDitherMatrix );
@@ -490,7 +490,7 @@ BOOL Bitmap::ImplMakeMonoDither()
}
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -512,18 +512,18 @@ BOOL Bitmap::ImplMakeMonoDither()
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplMakeGreyscales( USHORT nGreys )
+sal_Bool Bitmap::ImplMakeGreyscales( sal_uInt16 nGreys )
{
DBG_ASSERT( nGreys == 16 || nGreys == 256, "Only 16 or 256 greyscales are supported!" );
BitmapReadAccess* pReadAcc = AcquireReadAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pReadAcc )
{
const BitmapPalette& rPal = GetGreyPalette( nGreys );
- ULONG nShift = ( ( nGreys == 16 ) ? 4UL : 0UL );
- BOOL bPalDiffers = !pReadAcc->HasPalette() || ( rPal.GetEntryCount() != pReadAcc->GetPaletteEntryCount() );
+ sal_uLong nShift = ( ( nGreys == 16 ) ? 4UL : 0UL );
+ sal_Bool bPalDiffers = !pReadAcc->HasPalette() || ( rPal.GetEntryCount() != pReadAcc->GetPaletteEntryCount() );
if( !bPalDiffers )
bPalDiffers = ( (BitmapPalette&) rPal != pReadAcc->GetPalette() );
@@ -545,7 +545,7 @@ BOOL Bitmap::ImplMakeGreyscales( USHORT nGreys )
for( long nX = 0L; nX < nWidth; nX++ )
{
pWriteAcc->SetPixel( nY, nX,
- (BYTE) ( pReadAcc->GetPaletteColor(
+ (sal_uInt8) ( pReadAcc->GetPaletteColor(
pReadAcc->GetPixel( nY, nX ) ).GetLuminance() >> nShift ) );
}
}
@@ -562,11 +562,11 @@ BOOL Bitmap::ImplMakeGreyscales( USHORT nGreys )
for( long nX = 0L; nX < nWidth; nX++ )
{
- const ULONG nB = *pReadScan++;
- const ULONG nG = *pReadScan++;
- const ULONG nR = *pReadScan++;
+ const sal_uLong nB = *pReadScan++;
+ const sal_uLong nG = *pReadScan++;
+ const sal_uLong nR = *pReadScan++;
- *pWriteScan++ = (BYTE) ( ( nB * 28UL + nG * 151UL + nR * 77UL ) >> nShift );
+ *pWriteScan++ = (sal_uInt8) ( ( nB * 28UL + nG * 151UL + nR * 77UL ) >> nShift );
}
}
}
@@ -582,11 +582,11 @@ BOOL Bitmap::ImplMakeGreyscales( USHORT nGreys )
for( long nX = 0L; nX < nWidth; nX++ )
{
- const ULONG nR = *pReadScan++;
- const ULONG nG = *pReadScan++;
- const ULONG nB = *pReadScan++;
+ const sal_uLong nR = *pReadScan++;
+ const sal_uLong nG = *pReadScan++;
+ const sal_uLong nB = *pReadScan++;
- *pWriteScan++ = (BYTE) ( ( nB * 28UL + nG * 151UL + nR * 77UL ) >> nShift );
+ *pWriteScan++ = (sal_uInt8) ( ( nB * 28UL + nG * 151UL + nR * 77UL ) >> nShift );
}
}
}
@@ -594,11 +594,11 @@ BOOL Bitmap::ImplMakeGreyscales( USHORT nGreys )
{
for( long nY = 0L; nY < nHeight; nY++ )
for( long nX = 0L; nX < nWidth; nX++ )
- pWriteAcc->SetPixel( nY, nX, sal::static_int_cast<BYTE>(( pReadAcc->GetPixel( nY, nX ) ).GetLuminance() >> nShift) );
+ pWriteAcc->SetPixel( nY, nX, sal::static_int_cast<sal_uInt8>(( pReadAcc->GetPixel( nY, nX ) ).GetLuminance() >> nShift) );
}
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -617,7 +617,7 @@ BOOL Bitmap::ImplMakeGreyscales( USHORT nGreys )
else
{
ReleaseAccess( pReadAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -626,12 +626,12 @@ BOOL Bitmap::ImplMakeGreyscales( USHORT nGreys )
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplConvertUp( USHORT nBitCount, Color* pExtColor )
+sal_Bool Bitmap::ImplConvertUp( sal_uInt16 nBitCount, Color* pExtColor )
{
DBG_ASSERT( nBitCount > GetBitCount(), "New BitCount must be greater!" );
BitmapReadAccess* pReadAcc = AcquireReadAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pReadAcc )
{
@@ -646,12 +646,12 @@ BOOL Bitmap::ImplConvertUp( USHORT nBitCount, Color* pExtColor )
if( pWriteAcc->HasPalette() )
{
- const USHORT nOldCount = 1 << GetBitCount();
+ const sal_uInt16 nOldCount = 1 << GetBitCount();
const BitmapPalette& rOldPal = pReadAcc->GetPalette();
aPal.SetEntryCount( 1 << nBitCount );
- for( USHORT i = 0; i < nOldCount; i++ )
+ for( sal_uInt16 i = 0; i < nOldCount; i++ )
aPal[ i ] = rOldPal[ i ];
if( pExtColor )
@@ -680,7 +680,7 @@ BOOL Bitmap::ImplConvertUp( USHORT nBitCount, Color* pExtColor )
}
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -702,12 +702,12 @@ BOOL Bitmap::ImplConvertUp( USHORT nBitCount, Color* pExtColor )
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplConvertDown( USHORT nBitCount, Color* pExtColor )
+sal_Bool Bitmap::ImplConvertDown( sal_uInt16 nBitCount, Color* pExtColor )
{
DBG_ASSERT( nBitCount <= GetBitCount(), "New BitCount must be lower ( or equal when pExtColor is set )!" );
BitmapReadAccess* pReadAcc = AcquireReadAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pReadAcc )
{
@@ -717,7 +717,7 @@ BOOL Bitmap::ImplConvertDown( USHORT nBitCount, Color* pExtColor )
if( pWriteAcc )
{
- const USHORT nCount = 1 << nBitCount;
+ const sal_uInt16 nCount = 1 << nBitCount;
const long nWidth = pWriteAcc->Width();
const long nWidth1 = nWidth - 1L;
const long nHeight = pWriteAcc->Height();
@@ -731,8 +731,8 @@ BOOL Bitmap::ImplConvertDown( USHORT nBitCount, Color* pExtColor )
ImpErrorQuad* pQLine2 = 0;
long nX, nY;
long nYTmp = 0L;
- BYTE cIndex;
- BOOL bQ1 = TRUE;
+ sal_uInt8 cIndex;
+ sal_Bool bQ1 = sal_True;
if( pExtColor )
{
@@ -764,12 +764,12 @@ BOOL Bitmap::ImplConvertDown( USHORT nBitCount, Color* pExtColor )
for( nY = 0L; nY < nHeight; nY++, nYTmp++ )
{
// erstes ZeilenPixel
- cIndex = (BYTE) aColorMap.GetBestPaletteIndex( pQLine1[ 0 ].ImplGetColor() );
+ cIndex = (sal_uInt8) aColorMap.GetBestPaletteIndex( pQLine1[ 0 ].ImplGetColor() );
pWriteAcc->SetPixel( nY, 0, cIndex );
for( nX = 1L; nX < nWidth1; nX++ )
{
- cIndex = (BYTE) aColorMap.GetBestPaletteIndex( aColor = pQLine1[ nX ].ImplGetColor() );
+ cIndex = (sal_uInt8) aColorMap.GetBestPaletteIndex( aColor = pQLine1[ nX ].ImplGetColor() );
aErrQuad = ( ImpErrorQuad( aColor ) -= pWriteAcc->GetPaletteColor( cIndex ) );
pQLine1[ ++nX ].ImplAddColorError7( aErrQuad );
pQLine2[ nX-- ].ImplAddColorError1( aErrQuad );
@@ -781,13 +781,13 @@ BOOL Bitmap::ImplConvertDown( USHORT nBitCount, Color* pExtColor )
// letztes ZeilenPixel
if( nX < nWidth )
{
- cIndex = (BYTE) aColorMap.GetBestPaletteIndex( pQLine1[ nWidth1 ].ImplGetColor() );
+ cIndex = (sal_uInt8) aColorMap.GetBestPaletteIndex( pQLine1[ nWidth1 ].ImplGetColor() );
pWriteAcc->SetPixel( nY, nX, cIndex );
}
// Zeilenpuffer neu fuellen/kopieren
pQLine1 = pQLine2;
- pQLine2 = ( bQ1 = !bQ1 ) != FALSE ? pErrQuad2 : pErrQuad1;
+ pQLine2 = ( bQ1 = !bQ1 ) != sal_False ? pErrQuad2 : pErrQuad1;
if( nYTmp < nHeight )
{
@@ -806,7 +806,7 @@ BOOL Bitmap::ImplConvertDown( USHORT nBitCount, Color* pExtColor )
delete[] pErrQuad2;
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -828,11 +828,11 @@ BOOL Bitmap::ImplConvertDown( USHORT nBitCount, Color* pExtColor )
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplConvertGhosted()
+sal_Bool Bitmap::ImplConvertGhosted()
{
Bitmap aNewBmp;
BitmapReadAccess* pR = AcquireReadAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pR )
{
@@ -842,8 +842,8 @@ BOOL Bitmap::ImplConvertGhosted()
for( long i = 0, nCount = aNewPal.GetEntryCount(); i < nCount; i++ )
{
- const BitmapColor& rOld = pR->GetPaletteColor( (USHORT) i );
- aNewPal[ (USHORT) i ] = BitmapColor( ( rOld.GetRed() >> 1 ) | 0x80,
+ const BitmapColor& rOld = pR->GetPaletteColor( (sal_uInt16) i );
+ aNewPal[ (sal_uInt16) i ] = BitmapColor( ( rOld.GetRed() >> 1 ) | 0x80,
( rOld.GetGreen() >> 1 ) | 0x80,
( rOld.GetBlue() >> 1 ) | 0x80 );
}
@@ -855,7 +855,7 @@ BOOL Bitmap::ImplConvertGhosted()
{
pW->CopyBuffer( *pR );
aNewBmp.ReleaseAccess( pW );
- bRet = TRUE;
+ bRet = sal_True;
}
}
else
@@ -881,7 +881,7 @@ BOOL Bitmap::ImplConvertGhosted()
}
aNewBmp.ReleaseAccess( pW );
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -904,9 +904,9 @@ BOOL Bitmap::ImplConvertGhosted()
// ------------------------------------------------------------------------
-BOOL Bitmap::Scale( const double& rScaleX, const double& rScaleY, ULONG nScaleFlag )
+sal_Bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uLong nScaleFlag )
{
- BOOL bRet;
+ sal_Bool bRet;
if( ( rScaleX != 1.0 ) || ( rScaleY != 1.0 ) )
{
@@ -915,20 +915,20 @@ BOOL Bitmap::Scale( const double& rScaleX, const double& rScaleY, ULONG nScaleFl
else if( BMP_SCALE_INTERPOLATE == nScaleFlag )
bRet = ImplScaleInterpolate( rScaleX, rScaleY );
else
- bRet = FALSE;
+ bRet = sal_False;
}
else
- bRet = TRUE;
+ bRet = sal_True;
return bRet;
}
// ------------------------------------------------------------------------
-BOOL Bitmap::Scale( const Size& rNewSize, ULONG nScaleFlag )
+sal_Bool Bitmap::Scale( const Size& rNewSize, sal_uLong nScaleFlag )
{
const Size aSize( GetSizePixel() );
- BOOL bRet;
+ sal_Bool bRet;
if( aSize.Width() && aSize.Height() )
{
@@ -937,19 +937,19 @@ BOOL Bitmap::Scale( const Size& rNewSize, ULONG nScaleFlag )
nScaleFlag );
}
else
- bRet = TRUE;
+ bRet = sal_True;
return bRet;
}
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY )
+sal_Bool Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY )
{
const Size aSizePix( GetSizePixel() );
const long nNewWidth = FRound( aSizePix.Width() * rScaleX );
const long nNewHeight = FRound( aSizePix.Height() * rScaleY );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( nNewWidth && nNewHeight )
{
@@ -962,8 +962,8 @@ BOOL Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY )
const long nScanlineSize = pWriteAcc->GetScanlineSize();
const long nNewWidth1 = nNewWidth - 1L;
const long nNewHeight1 = nNewHeight - 1L;
- const long nWidth1 = pReadAcc->Width() - 1L;
- const long nHeight1 = pReadAcc->Height() - 1L;
+ const long nWidth = pReadAcc->Width();
+ const long nHeight = pReadAcc->Height();
long* pLutX = new long[ nNewWidth ];
long* pLutY = new long[ nNewHeight ];
@@ -972,10 +972,10 @@ BOOL Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY )
long nX, nY, nMapY, nActY = 0L;
for( nX = 0L; nX < nNewWidth; nX++ )
- pLutX[ nX ] = nX * nWidth1 / nNewWidth1;
+ pLutX[ nX ] = nX * nWidth / nNewWidth;
for( nY = 0L; nY < nNewHeight; nY++ )
- pLutY[ nY ] = nY * nHeight1 / nNewHeight1;
+ pLutY[ nY ] = nY * nHeight / nNewHeight;
while( nActY < nNewHeight )
{
@@ -994,7 +994,7 @@ BOOL Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY )
nActY++;
}
- bRet = TRUE;
+ bRet = sal_True;
}
delete[] pLutX;
@@ -1013,12 +1013,12 @@ BOOL Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY )
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rScaleY )
+sal_Bool Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rScaleY )
{
const Size aSizePix( GetSizePixel() );
const long nNewWidth = FRound( aSizePix.Width() * rScaleX );
const long nNewHeight = FRound( aSizePix.Height() * rScaleY );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( ( nNewWidth > 1L ) && ( nNewHeight > 1L ) )
{
@@ -1079,9 +1079,9 @@ BOOL Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rScaleY
lXG1 = aCol1.GetGreen() - ( lXG0 = aCol0.GetGreen() );
lXB1 = aCol1.GetBlue() - ( lXB0 = aCol0.GetBlue() );
- aCol0.SetRed( (BYTE) ( ( lXR1 * nTemp + ( lXR0 << 10 ) ) >> 10 ) );
- aCol0.SetGreen( (BYTE) ( ( lXG1 * nTemp + ( lXG0 << 10 ) ) >> 10 ) );
- aCol0.SetBlue( (BYTE) ( ( lXB1 * nTemp + ( lXB0 << 10 ) ) >> 10 ) );
+ aCol0.SetRed( (sal_uInt8) ( ( lXR1 * nTemp + ( lXR0 << 10 ) ) >> 10 ) );
+ aCol0.SetGreen( (sal_uInt8) ( ( lXG1 * nTemp + ( lXG0 << 10 ) ) >> 10 ) );
+ aCol0.SetBlue( (sal_uInt8) ( ( lXB1 * nTemp + ( lXB0 << 10 ) ) >> 10 ) );
pWriteAcc->SetPixel( nY, nX, aCol0 );
}
@@ -1114,9 +1114,9 @@ BOOL Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rScaleY
lXG1 = aCol1.GetGreen() - ( lXG0 = aCol0.GetGreen() );
lXB1 = aCol1.GetBlue() - ( lXB0 = aCol0.GetBlue() );
- aCol0.SetRed( (BYTE) ( ( lXR1 * nTemp + ( lXR0 << 10 ) ) >> 10 ) );
- aCol0.SetGreen( (BYTE) ( ( lXG1 * nTemp + ( lXG0 << 10 ) ) >> 10 ) );
- aCol0.SetBlue( (BYTE) ( ( lXB1 * nTemp + ( lXB0 << 10 ) ) >> 10 ) );
+ aCol0.SetRed( (sal_uInt8) ( ( lXR1 * nTemp + ( lXR0 << 10 ) ) >> 10 ) );
+ aCol0.SetGreen( (sal_uInt8) ( ( lXG1 * nTemp + ( lXG0 << 10 ) ) >> 10 ) );
+ aCol0.SetBlue( (sal_uInt8) ( ( lXB1 * nTemp + ( lXB0 << 10 ) ) >> 10 ) );
pWriteAcc->SetPixel( nY, nX, aCol0 );
}
@@ -1126,7 +1126,7 @@ BOOL Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rScaleY
delete[] pLutInt;
delete[] pLutFrac;
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -1134,7 +1134,7 @@ BOOL Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rScaleY
if( bRet )
{
- bRet = FALSE;
+ bRet = sal_False;
ImplAssignWithSize( aNewBmp );
pReadAcc = AcquireReadAccess();
aNewBmp = Bitmap( Size( nNewWidth, nNewHeight ), 24 );
@@ -1183,9 +1183,9 @@ BOOL Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rScaleY
lXG1 = aCol1.GetGreen() - ( lXG0 = aCol0.GetGreen() );
lXB1 = aCol1.GetBlue() - ( lXB0 = aCol0.GetBlue() );
- aCol0.SetRed( (BYTE) ( ( lXR1 * nTemp + ( lXR0 << 10 ) ) >> 10 ) );
- aCol0.SetGreen( (BYTE) ( ( lXG1 * nTemp + ( lXG0 << 10 ) ) >> 10 ) );
- aCol0.SetBlue( (BYTE) ( ( lXB1 * nTemp + ( lXB0 << 10 ) ) >> 10 ) );
+ aCol0.SetRed( (sal_uInt8) ( ( lXR1 * nTemp + ( lXR0 << 10 ) ) >> 10 ) );
+ aCol0.SetGreen( (sal_uInt8) ( ( lXG1 * nTemp + ( lXG0 << 10 ) ) >> 10 ) );
+ aCol0.SetBlue( (sal_uInt8) ( ( lXB1 * nTemp + ( lXB0 << 10 ) ) >> 10 ) );
pWriteAcc->SetPixel( nY, nX, aCol0 );
}
@@ -1218,9 +1218,9 @@ BOOL Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rScaleY
lXG1 = aCol1.GetGreen() - ( lXG0 = aCol0.GetGreen() );
lXB1 = aCol1.GetBlue() - ( lXB0 = aCol0.GetBlue() );
- aCol0.SetRed( (BYTE) ( ( lXR1 * nTemp + ( lXR0 << 10 ) ) >> 10 ) );
- aCol0.SetGreen( (BYTE) ( ( lXG1 * nTemp + ( lXG0 << 10 ) ) >> 10 ) );
- aCol0.SetBlue( (BYTE) ( ( lXB1 * nTemp + ( lXB0 << 10 ) ) >> 10 ) );
+ aCol0.SetRed( (sal_uInt8) ( ( lXR1 * nTemp + ( lXR0 << 10 ) ) >> 10 ) );
+ aCol0.SetGreen( (sal_uInt8) ( ( lXG1 * nTemp + ( lXG0 << 10 ) ) >> 10 ) );
+ aCol0.SetBlue( (sal_uInt8) ( ( lXB1 * nTemp + ( lXB0 << 10 ) ) >> 10 ) );
pWriteAcc->SetPixel( nY, nX, aCol0 );
}
@@ -1230,7 +1230,7 @@ BOOL Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rScaleY
delete[] pLutInt;
delete[] pLutFrac;
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -1249,14 +1249,14 @@ BOOL Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rScaleY
// ------------------------------------------------------------------------
-BOOL Bitmap::Dither( ULONG nDitherFlags )
+sal_Bool Bitmap::Dither( sal_uLong nDitherFlags )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const Size aSizePix( GetSizePixel() );
if( aSizePix.Width() == 1 || aSizePix.Height() == 1 )
- bRet = TRUE;
+ bRet = sal_True;
else if( nDitherFlags & BMP_DITHER_MATRIX )
bRet = ImplDitherMatrix();
else if( nDitherFlags & BMP_DITHER_FLOYD )
@@ -1269,55 +1269,55 @@ BOOL Bitmap::Dither( ULONG nDitherFlags )
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplDitherMatrix()
+sal_Bool Bitmap::ImplDitherMatrix()
{
BitmapReadAccess* pReadAcc = AcquireReadAccess();
Bitmap aNewBmp( GetSizePixel(), 8 );
BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pReadAcc && pWriteAcc )
{
- const ULONG nWidth = pReadAcc->Width();
- const ULONG nHeight = pReadAcc->Height();
- BitmapColor aIndex( (BYTE) 0 );
+ const sal_uLong nWidth = pReadAcc->Width();
+ const sal_uLong nHeight = pReadAcc->Height();
+ BitmapColor aIndex( (sal_uInt8) 0 );
if( pReadAcc->HasPalette() )
{
- for( ULONG nY = 0UL; nY < nHeight; nY++ )
+ for( sal_uLong nY = 0UL; nY < nHeight; nY++ )
{
- for( ULONG nX = 0UL, nModY = ( nY & 0x0FUL ) << 4UL; nX < nWidth; nX++ )
+ for( sal_uLong nX = 0UL, nModY = ( nY & 0x0FUL ) << 4UL; nX < nWidth; nX++ )
{
const BitmapColor aCol( pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nY, nX ) ) );
- const ULONG nD = nVCLDitherLut[ nModY + ( nX & 0x0FUL ) ];
- const ULONG nR = ( nVCLLut[ aCol.GetRed() ] + nD ) >> 16UL;
- const ULONG nG = ( nVCLLut[ aCol.GetGreen() ] + nD ) >> 16UL;
- const ULONG nB = ( nVCLLut[ aCol.GetBlue() ] + nD ) >> 16UL;
+ const sal_uLong nD = nVCLDitherLut[ nModY + ( nX & 0x0FUL ) ];
+ const sal_uLong nR = ( nVCLLut[ aCol.GetRed() ] + nD ) >> 16UL;
+ const sal_uLong nG = ( nVCLLut[ aCol.GetGreen() ] + nD ) >> 16UL;
+ const sal_uLong nB = ( nVCLLut[ aCol.GetBlue() ] + nD ) >> 16UL;
- aIndex.SetIndex( (BYTE) ( nVCLRLut[ nR ] + nVCLGLut[ nG ] + nVCLBLut[ nB ] ) );
+ aIndex.SetIndex( (sal_uInt8) ( nVCLRLut[ nR ] + nVCLGLut[ nG ] + nVCLBLut[ nB ] ) );
pWriteAcc->SetPixel( nY, nX, aIndex );
}
}
}
else
{
- for( ULONG nY = 0UL; nY < nHeight; nY++ )
+ for( sal_uLong nY = 0UL; nY < nHeight; nY++ )
{
- for( ULONG nX = 0UL, nModY = ( nY & 0x0FUL ) << 4UL; nX < nWidth; nX++ )
+ for( sal_uLong nX = 0UL, nModY = ( nY & 0x0FUL ) << 4UL; nX < nWidth; nX++ )
{
const BitmapColor aCol( pReadAcc->GetPixel( nY, nX ) );
- const ULONG nD = nVCLDitherLut[ nModY + ( nX & 0x0FUL ) ];
- const ULONG nR = ( nVCLLut[ aCol.GetRed() ] + nD ) >> 16UL;
- const ULONG nG = ( nVCLLut[ aCol.GetGreen() ] + nD ) >> 16UL;
- const ULONG nB = ( nVCLLut[ aCol.GetBlue() ] + nD ) >> 16UL;
+ const sal_uLong nD = nVCLDitherLut[ nModY + ( nX & 0x0FUL ) ];
+ const sal_uLong nR = ( nVCLLut[ aCol.GetRed() ] + nD ) >> 16UL;
+ const sal_uLong nG = ( nVCLLut[ aCol.GetGreen() ] + nD ) >> 16UL;
+ const sal_uLong nB = ( nVCLLut[ aCol.GetBlue() ] + nD ) >> 16UL;
- aIndex.SetIndex( (BYTE) ( nVCLRLut[ nR ] + nVCLGLut[ nG ] + nVCLBLut[ nB ] ) );
+ aIndex.SetIndex( (sal_uInt8) ( nVCLRLut[ nR ] + nVCLGLut[ nG ] + nVCLBLut[ nB ] ) );
pWriteAcc->SetPixel( nY, nX, aIndex );
}
}
}
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -1339,10 +1339,10 @@ BOOL Bitmap::ImplDitherMatrix()
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplDitherFloyd()
+sal_Bool Bitmap::ImplDitherFloyd()
{
const Size aSize( GetSizePixel() );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( ( aSize.Width() > 3 ) && ( aSize.Height() > 2 ) )
{
@@ -1368,7 +1368,7 @@ BOOL Bitmap::ImplDitherFloyd()
long* p1T = p1;
long* p2T = p2;
long* pTmp;
- BOOL bPal = pReadAcc->HasPalette();
+ sal_Bool bPal = pReadAcc->HasPalette();
pTmp = p2T;
@@ -1433,7 +1433,7 @@ BOOL Bitmap::ImplDitherFloyd()
CALC_TABLES7;
nX -= 5;
CALC_TABLES5;
- pWriteAcc->SetPixel( nYAcc, 0, BitmapColor( (BYTE) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) );
+ pWriteAcc->SetPixel( nYAcc, 0, BitmapColor( (sal_uInt8) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) );
// mittlere Pixel ueber Schleife
long nXAcc;
@@ -1444,7 +1444,7 @@ BOOL Bitmap::ImplDitherFloyd()
nX -= 8;
CALC_TABLES3;
CALC_TABLES5;
- pWriteAcc->SetPixel( nYAcc, nXAcc, BitmapColor( (BYTE) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) );
+ pWriteAcc->SetPixel( nYAcc, nXAcc, BitmapColor( (sal_uInt8) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) );
}
// letztes Pixel gesondert betrachten
@@ -1452,12 +1452,12 @@ BOOL Bitmap::ImplDitherFloyd()
nX -= 5;
CALC_TABLES3;
CALC_TABLES5;
- pWriteAcc->SetPixel( nYAcc, nWidth1, BitmapColor( (BYTE) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) );
+ pWriteAcc->SetPixel( nYAcc, nWidth1, BitmapColor( (sal_uInt8) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) );
}
delete[] p1;
delete[] p2;
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -1480,12 +1480,12 @@ BOOL Bitmap::ImplDitherFloyd()
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplDitherFloyd16()
+sal_Bool Bitmap::ImplDitherFloyd16()
{
BitmapReadAccess* pReadAcc = AcquireReadAccess();
Bitmap aNewBmp( GetSizePixel(), 24 );
BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pReadAcc && pWriteAcc )
{
@@ -1501,7 +1501,7 @@ BOOL Bitmap::ImplDitherFloyd16()
ImpErrorQuad* pQLine2 = 0;
long nX, nY;
long nYTmp = 0L;
- BOOL bQ1 = TRUE;
+ sal_Bool bQ1 = sal_True;
for( nY = 0L; nY < Min( nHeight, 2L ); nY++, nYTmp++ )
for( nX = 0L, pQLine2 = !nY ? pErrQuad1 : pErrQuad2; nX < nWidth; nX++ )
@@ -1539,7 +1539,7 @@ BOOL Bitmap::ImplDitherFloyd16()
// Zeilenpuffer neu fuellen/kopieren
pQLine1 = pQLine2;
- pQLine2 = ( bQ1 = !bQ1 ) != FALSE ? pErrQuad2 : pErrQuad1;
+ pQLine2 = ( bQ1 = !bQ1 ) != sal_False ? pErrQuad2 : pErrQuad1;
if( nYTmp < nHeight )
for( nX = 0L; nX < nWidth; nX++ )
@@ -1549,7 +1549,7 @@ BOOL Bitmap::ImplDitherFloyd16()
// Zeilenpuffer zerstoeren
delete[] pErrQuad1;
delete[] pErrQuad2;
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -1571,12 +1571,12 @@ BOOL Bitmap::ImplDitherFloyd16()
// ------------------------------------------------------------------------
-BOOL Bitmap::ReduceColors( USHORT nColorCount, BmpReduce eReduce )
+sal_Bool Bitmap::ReduceColors( sal_uInt16 nColorCount, BmpReduce eReduce )
{
- BOOL bRet;
+ sal_Bool bRet;
- if( GetColorCount() <= (ULONG) nColorCount )
- bRet = TRUE;
+ if( GetColorCount() <= (sal_uLong) nColorCount )
+ bRet = sal_True;
else if( nColorCount )
{
if( BMP_REDUCE_SIMPLE == eReduce )
@@ -1587,20 +1587,20 @@ BOOL Bitmap::ReduceColors( USHORT nColorCount, BmpReduce eReduce )
bRet = ImplReduceMedian( nColorCount );
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplReduceSimple( USHORT nColorCount )
+sal_Bool Bitmap::ImplReduceSimple( sal_uInt16 nColorCount )
{
Bitmap aNewBmp;
BitmapReadAccess* pRAcc = AcquireReadAccess();
- const USHORT nColCount = Min( nColorCount, (USHORT) 256 );
- USHORT nBitCount;
- BOOL bRet = FALSE;
+ const sal_uInt16 nColCount = Min( nColorCount, (sal_uInt16) 256 );
+ sal_uInt16 nBitCount;
+ sal_Bool bRet = sal_False;
if( nColCount <= 2 )
nBitCount = 1;
@@ -1627,17 +1627,17 @@ BOOL Bitmap::ImplReduceSimple( USHORT nColorCount )
{
for( long nY = 0L; nY < nHeight; nY++ )
for( long nX =0L; nX < nWidth; nX++ )
- pWAcc->SetPixel( nY, nX, (BYTE) aOct.GetBestPaletteIndex( pRAcc->GetPaletteColor( pRAcc->GetPixel( nY, nX ) ) ) );
+ pWAcc->SetPixel( nY, nX, (sal_uInt8) aOct.GetBestPaletteIndex( pRAcc->GetPaletteColor( pRAcc->GetPixel( nY, nX ) ) ) );
}
else
{
for( long nY = 0L; nY < nHeight; nY++ )
for( long nX =0L; nX < nWidth; nX++ )
- pWAcc->SetPixel( nY, nX, (BYTE) aOct.GetBestPaletteIndex( pRAcc->GetPixel( nY, nX ) ) );
+ pWAcc->SetPixel( nY, nX, (sal_uInt8) aOct.GetBestPaletteIndex( pRAcc->GetPixel( nY, nX ) ) );
}
aNewBmp.ReleaseAccess( pWAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pRAcc );
@@ -1682,11 +1682,11 @@ extern "C" int __LOADONCALLAPI ImplPopularCmpFnc( const void* p1, const void* p2
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplReducePopular( USHORT nColCount )
+sal_Bool Bitmap::ImplReducePopular( sal_uInt16 nColCount )
{
BitmapReadAccess* pRAcc = AcquireReadAccess();
- USHORT nBitCount;
- BOOL bRet = FALSE;
+ sal_uInt16 nBitCount;
+ sal_Bool bRet = sal_False;
if( nColCount > 256 )
nColCount = 256;
@@ -1755,12 +1755,12 @@ BOOL Bitmap::ImplReducePopular( USHORT nColCount )
qsort( pCountTable, nTotalColors, sizeof( PopularColorCount ), ImplPopularCmpFnc );
- for( USHORT n = 0; n < nColCount; n++ )
+ for( sal_uInt16 n = 0; n < nColCount; n++ )
{
const PopularColorCount& rPop = pCountTable[ n ];
- aNewPal[ n ] = BitmapColor( (BYTE) ( ( rPop.mnIndex >> nLeftShiftBits2 ) << nRightShiftBits ),
- (BYTE) ( ( ( rPop.mnIndex >> nLeftShiftBits1 ) & ( nColorsPerComponent - 1 ) ) << nRightShiftBits ),
- (BYTE) ( ( rPop.mnIndex & ( nColorsPerComponent - 1 ) ) << nRightShiftBits ) );
+ aNewPal[ n ] = BitmapColor( (sal_uInt8) ( ( rPop.mnIndex >> nLeftShiftBits2 ) << nRightShiftBits ),
+ (sal_uInt8) ( ( ( rPop.mnIndex >> nLeftShiftBits1 ) & ( nColorsPerComponent - 1 ) ) << nRightShiftBits ),
+ (sal_uInt8) ( ( rPop.mnIndex & ( nColorsPerComponent - 1 ) ) << nRightShiftBits ) );
}
Bitmap aNewBmp( GetSizePixel(), nBitCount, &aNewPal );
@@ -1768,13 +1768,13 @@ BOOL Bitmap::ImplReducePopular( USHORT nColCount )
if( pWAcc )
{
- BitmapColor aDstCol( (BYTE) 0 );
- BYTE* pIndexMap = new BYTE[ nTotalColors ];
+ BitmapColor aDstCol( (sal_uInt8) 0 );
+ sal_uInt8* pIndexMap = new sal_uInt8[ nTotalColors ];
for( nR = 0, nIndex = 0; nR < 256; nR += nColorOffset )
for( nG = 0; nG < 256; nG += nColorOffset )
for( nB = 0; nB < 256; nB += nColorOffset )
- pIndexMap[ nIndex++ ] = (BYTE) aNewPal.GetBestIndex( BitmapColor( (BYTE) nR, (BYTE) nG, (BYTE) nB ) );
+ pIndexMap[ nIndex++ ] = (sal_uInt8) aNewPal.GetBestIndex( BitmapColor( (sal_uInt8) nR, (sal_uInt8) nG, (sal_uInt8) nB ) );
if( pRAcc->HasPalette() )
{
@@ -1807,7 +1807,7 @@ BOOL Bitmap::ImplReducePopular( USHORT nColCount )
delete[] pIndexMap;
aNewBmp.ReleaseAccess( pWAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
delete[] pCountTable;
@@ -1829,11 +1829,11 @@ BOOL Bitmap::ImplReducePopular( USHORT nColCount )
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplReduceMedian( USHORT nColCount )
+sal_Bool Bitmap::ImplReduceMedian( sal_uInt16 nColCount )
{
BitmapReadAccess* pRAcc = AcquireReadAccess();
- USHORT nBitCount;
- BOOL bRet = FALSE;
+ sal_uInt16 nBitCount;
+ sal_Bool bRet = sal_False;
if( nColCount < 17 )
nBitCount = 4;
@@ -1853,8 +1853,8 @@ BOOL Bitmap::ImplReduceMedian( USHORT nColCount )
if( pWAcc )
{
- const ULONG nSize = 32768UL * sizeof( ULONG );
- ULONG* pColBuf = (ULONG*) rtl_allocateMemory( nSize );
+ const sal_uLong nSize = 32768UL * sizeof( sal_uLong );
+ sal_uLong* pColBuf = (sal_uLong*) rtl_allocateMemory( nSize );
const long nWidth = pWAcc->Width();
const long nHeight = pWAcc->Height();
long nIndex = 0L;
@@ -1895,11 +1895,11 @@ BOOL Bitmap::ImplReduceMedian( USHORT nColCount )
pWAcc->SetPalette( aPal );
for( long nY = 0L; nY < nHeight; nY++ )
for( long nX = 0L; nX < nWidth; nX++ )
- pWAcc->SetPixel( nY, nX, (BYTE) aMap.GetBestPaletteIndex( pRAcc->GetColor( nY, nX ) ) );
+ pWAcc->SetPixel( nY, nX, (sal_uInt8) aMap.GetBestPaletteIndex( pRAcc->GetColor( nY, nX ) ) );
rtl_freeMemory( pColBuf );
aNewBmp.ReleaseAccess( pWAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pRAcc );
@@ -1920,7 +1920,7 @@ BOOL Bitmap::ImplReduceMedian( USHORT nColCount )
// ------------------------------------------------------------------------
-void Bitmap::ImplMedianCut( ULONG* pColBuf, BitmapPalette& rPal,
+void Bitmap::ImplMedianCut( sal_uLong* pColBuf, BitmapPalette& rPal,
long nR1, long nR2, long nG1, long nG2, long nB1, long nB2,
long nColors, long nPixels, long& rIndex )
{
@@ -1932,16 +1932,16 @@ void Bitmap::ImplMedianCut( ULONG* pColBuf, BitmapPalette& rPal,
const long nGLen = nG2 - nG1;
const long nBLen = nB2 - nB1;
long nR, nG, nB;
- ULONG* pBuf = pColBuf;
+ sal_uLong* pBuf = pColBuf;
if( !nRLen && !nGLen && !nBLen )
{
if( pBuf[ RGB15( nR1, nG1, nB1 ) ] )
{
- aCol.SetRed( (BYTE) ( nR1 << 3 ) );
- aCol.SetGreen( (BYTE) ( nG1 << 3 ) );
- aCol.SetBlue( (BYTE) ( nB1 << 3 ) );
- rPal[ (USHORT) rIndex++ ] = aCol;
+ aCol.SetRed( (sal_uInt8) ( nR1 << 3 ) );
+ aCol.SetGreen( (sal_uInt8) ( nG1 << 3 ) );
+ aCol.SetBlue( (sal_uInt8) ( nB1 << 3 ) );
+ rPal[ (sal_uInt16) rIndex++ ] = aCol;
}
}
else
@@ -1968,10 +1968,10 @@ void Bitmap::ImplMedianCut( ULONG* pColBuf, BitmapPalette& rPal,
}
}
- aCol.SetRed( (BYTE) ( ( nRSum / nPixels ) << 3 ) );
- aCol.SetGreen( (BYTE) ( ( nGSum / nPixels ) << 3 ) );
- aCol.SetBlue( (BYTE) ( ( nBSum / nPixels ) << 3 ) );
- rPal[ (USHORT) rIndex++ ] = aCol;
+ aCol.SetRed( (sal_uInt8) ( ( nRSum / nPixels ) << 3 ) );
+ aCol.SetGreen( (sal_uInt8) ( ( nGSum / nPixels ) << 3 ) );
+ aCol.SetBlue( (sal_uInt8) ( ( nBSum / nPixels ) << 3 ) );
+ rPal[ (sal_uInt16) rIndex++ ] = aCol;
}
else
{
@@ -2054,32 +2054,32 @@ void Bitmap::ImplMedianCut( ULONG* pColBuf, BitmapPalette& rPal,
// ------------------------------------------------------------------------
-BOOL Bitmap::Vectorize( PolyPolygon& rPolyPoly, ULONG nFlags, const Link* pProgress )
+sal_Bool Bitmap::Vectorize( PolyPolygon& rPolyPoly, sal_uLong nFlags, const Link* pProgress )
{
return ImplVectorizer().ImplVectorize( *this, rPolyPoly, nFlags, pProgress );
}
// ------------------------------------------------------------------------
-BOOL Bitmap::Vectorize( GDIMetaFile& rMtf, BYTE cReduce, ULONG nFlags, const Link* pProgress )
+sal_Bool Bitmap::Vectorize( GDIMetaFile& rMtf, sal_uInt8 cReduce, sal_uLong nFlags, const Link* pProgress )
{
return ImplVectorizer().ImplVectorize( *this, rMtf, cReduce, nFlags, pProgress );
}
// ------------------------------------------------------------------------
-BOOL Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
+sal_Bool Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
short nChannelRPercent, short nChannelGPercent, short nChannelBPercent,
- double fGamma, BOOL bInvert )
+ double fGamma, sal_Bool bInvert )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
// nothing to do => return quickly
if( !nLuminancePercent && !nContrastPercent &&
!nChannelRPercent && !nChannelGPercent && !nChannelBPercent &&
( fGamma == 1.0 ) && !bInvert )
{
- bRet = TRUE;
+ bRet = sal_True;
}
else
{
@@ -2090,9 +2090,9 @@ BOOL Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
BitmapColor aCol;
const long nW = pAcc->Width();
const long nH = pAcc->Height();
- BYTE* cMapR = new BYTE[ 256 ];
- BYTE* cMapG = new BYTE[ 256 ];
- BYTE* cMapB = new BYTE[ 256 ];
+ sal_uInt8* cMapR = new sal_uInt8[ 256 ];
+ sal_uInt8* cMapG = new sal_uInt8[ 256 ];
+ sal_uInt8* cMapB = new sal_uInt8[ 256 ];
long nX, nY;
double fM, fROff, fGOff, fBOff, fOff;
@@ -2112,14 +2112,14 @@ BOOL Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
// calculate gamma value
fGamma = ( fGamma <= 0.0 || fGamma > 10.0 ) ? 1.0 : ( 1.0 / fGamma );
- const BOOL bGamma = ( fGamma != 1.0 );
+ const sal_Bool bGamma = ( fGamma != 1.0 );
// create mapping table
for( nX = 0L; nX < 256L; nX++ )
{
- cMapR[ nX ] = (BYTE) MinMax( FRound( nX * fM + fROff ), 0L, 255L );
- cMapG[ nX ] = (BYTE) MinMax( FRound( nX * fM + fGOff ), 0L, 255L );
- cMapB[ nX ] = (BYTE) MinMax( FRound( nX * fM + fBOff ), 0L, 255L );
+ cMapR[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fROff ), 0L, 255L );
+ cMapG[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fGOff ), 0L, 255L );
+ cMapB[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fBOff ), 0L, 255L );
if( bGamma )
{
@@ -2141,7 +2141,7 @@ BOOL Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
{
BitmapColor aNewCol;
- for( USHORT i = 0, nCount = pAcc->GetPaletteEntryCount(); i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = pAcc->GetPaletteEntryCount(); i < nCount; i++ )
{
const BitmapColor& rCol = pAcc->GetPaletteColor( i );
aNewCol.SetRed( cMapR[ rCol.GetRed() ] );
@@ -2197,7 +2197,7 @@ BOOL Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
delete[] cMapG;
delete[] cMapB;
ReleaseAccess( pAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
}
diff --git a/vcl/source/gdi/bitmap4.cxx b/vcl/source/gdi/bitmap4.cxx
index 4411b5def4ce..1166f6cc0931 100644
--- a/vcl/source/gdi/bitmap4.cxx
+++ b/vcl/source/gdi/bitmap4.cxx
@@ -49,9 +49,9 @@
// - Bitmap -
// ----------
-BOOL Bitmap::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link* pProgress )
+sal_Bool Bitmap::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link* pProgress )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
switch( eFilter )
{
@@ -107,11 +107,11 @@ BOOL Bitmap::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, cons
// -----------------------------------------------------------------------------
-BOOL Bitmap::ImplConvolute3( const long* pMatrix, long nDivisor,
+sal_Bool Bitmap::ImplConvolute3( const long* pMatrix, long nDivisor,
const BmpFilterParam* /*pFilterParam*/, const Link* /*pProgress*/ )
{
BitmapReadAccess* pReadAcc = AcquireReadAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pReadAcc )
{
@@ -124,9 +124,9 @@ BOOL Bitmap::ImplConvolute3( const long* pMatrix, long nDivisor,
const long nHeight = pWriteAcc->Height(), nHeight2 = nHeight + 2;
long* pColm = new long[ nWidth2 ];
long* pRows = new long[ nHeight2 ];
- BitmapColor* pColRow1 = (BitmapColor*) new BYTE[ sizeof( BitmapColor ) * nWidth2 ];
- BitmapColor* pColRow2 = (BitmapColor*) new BYTE[ sizeof( BitmapColor ) * nWidth2 ];
- BitmapColor* pColRow3 = (BitmapColor*) new BYTE[ sizeof( BitmapColor ) * nWidth2 ];
+ BitmapColor* pColRow1 = (BitmapColor*) new sal_uInt8[ sizeof( BitmapColor ) * nWidth2 ];
+ BitmapColor* pColRow2 = (BitmapColor*) new sal_uInt8[ sizeof( BitmapColor ) * nWidth2 ];
+ BitmapColor* pColRow3 = (BitmapColor*) new sal_uInt8[ sizeof( BitmapColor ) * nWidth2 ];
BitmapColor* pRowTmp1 = pColRow1;
BitmapColor* pRowTmp2 = pColRow2;
BitmapColor* pRowTmp3 = pColRow3;
@@ -205,9 +205,9 @@ BOOL Bitmap::ImplConvolute3( const long* pMatrix, long nDivisor,
nSumB += pTmp[ pColor->GetBlue() ];
// calculate destination color
- pWriteAcc->SetPixel( nY, nX, BitmapColor( (BYTE) MinMax( nSumR / nDivisor, 0, 255 ),
- (BYTE) MinMax( nSumG / nDivisor, 0, 255 ),
- (BYTE) MinMax( nSumB / nDivisor, 0, 255 ) ) );
+ pWriteAcc->SetPixel( nY, nX, BitmapColor( (sal_uInt8) MinMax( nSumR / nDivisor, 0, 255 ),
+ (sal_uInt8) MinMax( nSumG / nDivisor, 0, 255 ),
+ (sal_uInt8) MinMax( nSumB / nDivisor, 0, 255 ) ) );
}
if( ++nY < nHeight )
@@ -225,15 +225,15 @@ BOOL Bitmap::ImplConvolute3( const long* pMatrix, long nDivisor,
}
delete[] pKoeff;
- delete[] (BYTE*) pColRow1;
- delete[] (BYTE*) pColRow2;
- delete[] (BYTE*) pColRow3;
+ delete[] (sal_uInt8*) pColRow1;
+ delete[] (sal_uInt8*) pColRow2;
+ delete[] (sal_uInt8*) pColRow3;
delete[] pColm;
delete[] pRows;
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -255,10 +255,10 @@ BOOL Bitmap::ImplConvolute3( const long* pMatrix, long nDivisor,
// -----------------------------------------------------------------------------
-BOOL Bitmap::ImplMedianFilter( const BmpFilterParam* /*pFilterParam*/, const Link* /*pProgress*/ )
+sal_Bool Bitmap::ImplMedianFilter( const BmpFilterParam* /*pFilterParam*/, const Link* /*pProgress*/ )
{
BitmapReadAccess* pReadAcc = AcquireReadAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pReadAcc )
{
@@ -271,9 +271,9 @@ BOOL Bitmap::ImplMedianFilter( const BmpFilterParam* /*pFilterParam*/, const Lin
const long nHeight = pWriteAcc->Height(), nHeight2 = nHeight + 2;
long* pColm = new long[ nWidth2 ];
long* pRows = new long[ nHeight2 ];
- BitmapColor* pColRow1 = (BitmapColor*) new BYTE[ sizeof( BitmapColor ) * nWidth2 ];
- BitmapColor* pColRow2 = (BitmapColor*) new BYTE[ sizeof( BitmapColor ) * nWidth2 ];
- BitmapColor* pColRow3 = (BitmapColor*) new BYTE[ sizeof( BitmapColor ) * nWidth2 ];
+ BitmapColor* pColRow1 = (BitmapColor*) new sal_uInt8[ sizeof( BitmapColor ) * nWidth2 ];
+ BitmapColor* pColRow2 = (BitmapColor*) new sal_uInt8[ sizeof( BitmapColor ) * nWidth2 ];
+ BitmapColor* pColRow3 = (BitmapColor*) new sal_uInt8[ sizeof( BitmapColor ) * nWidth2 ];
BitmapColor* pRowTmp1 = pColRow1;
BitmapColor* pRowTmp2 = pColRow2;
BitmapColor* pRowTmp3 = pColRow3;
@@ -339,7 +339,7 @@ BOOL Bitmap::ImplMedianFilter( const BmpFilterParam* /*pFilterParam*/, const Lin
MNMX3( nB9, nB2, nB3 );
// set destination color
- pWriteAcc->SetPixel( nY, nX, BitmapColor( (BYTE) nR2, (BYTE) nG2, (BYTE) nB2 ) );
+ pWriteAcc->SetPixel( nY, nX, BitmapColor( (sal_uInt8) nR2, (sal_uInt8) nG2, (sal_uInt8) nB2 ) );
}
if( ++nY < nHeight )
@@ -356,15 +356,15 @@ BOOL Bitmap::ImplMedianFilter( const BmpFilterParam* /*pFilterParam*/, const Lin
}
}
- delete[] (BYTE*) pColRow1;
- delete[] (BYTE*) pColRow2;
- delete[] (BYTE*) pColRow3;
+ delete[] (sal_uInt8*) pColRow1;
+ delete[] (sal_uInt8*) pColRow2;
+ delete[] (sal_uInt8*) pColRow3;
delete[] pColm;
delete[] pRows;
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -386,13 +386,13 @@ BOOL Bitmap::ImplMedianFilter( const BmpFilterParam* /*pFilterParam*/, const Lin
// -----------------------------------------------------------------------------
-BOOL Bitmap::ImplSobelGrey( const BmpFilterParam* /*pFilterParam*/, const Link* /*pProgress*/ )
+sal_Bool Bitmap::ImplSobelGrey( const BmpFilterParam* /*pFilterParam*/, const Link* /*pProgress*/ )
{
- BOOL bRet = ImplMakeGreyscales( 256 );
+ sal_Bool bRet = ImplMakeGreyscales( 256 );
if( bRet )
{
- bRet = FALSE;
+ bRet = sal_False;
BitmapReadAccess* pReadAcc = AcquireReadAccess();
@@ -403,7 +403,7 @@ BOOL Bitmap::ImplSobelGrey( const BmpFilterParam* /*pFilterParam*/, const Link*
if( pWriteAcc )
{
- BitmapColor aGrey( (BYTE) 0 );
+ BitmapColor aGrey( (sal_uInt8) 0 );
const long nWidth = pWriteAcc->Width();
const long nHeight = pWriteAcc->Height();
const long nMask111 = -1, nMask121 = 0, nMask131 = 1;
@@ -474,7 +474,7 @@ BOOL Bitmap::ImplSobelGrey( const BmpFilterParam* /*pFilterParam*/, const Link*
nSum2 += nMask332 * nGrey33;
nSum1 = (long) sqrt( (double)( nSum1 * nSum1 + nSum2 * nSum2 ) );
- aGrey.SetIndex( ~(BYTE) SAL_BOUND( nSum1, 0, 255 ) );
+ aGrey.SetIndex( ~(sal_uInt8) SAL_BOUND( nSum1, 0, 255 ) );
pWriteAcc->SetPixel( nY, nX, aGrey );
if( nX < ( nWidth - 1 ) )
@@ -491,7 +491,7 @@ BOOL Bitmap::ImplSobelGrey( const BmpFilterParam* /*pFilterParam*/, const Link*
delete[] pHMap;
delete[] pVMap;
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -514,13 +514,13 @@ BOOL Bitmap::ImplSobelGrey( const BmpFilterParam* /*pFilterParam*/, const Link*
// -----------------------------------------------------------------------------
-BOOL Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
+sal_Bool Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
{
- BOOL bRet = ImplMakeGreyscales( 256 );
+ sal_Bool bRet = ImplMakeGreyscales( 256 );
if( bRet )
{
- bRet = FALSE;
+ bRet = sal_False;
BitmapReadAccess* pReadAcc = AcquireReadAccess();
@@ -531,7 +531,7 @@ BOOL Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link* /*p
if( pWriteAcc )
{
- BitmapColor aGrey( (BYTE) 0 );
+ BitmapColor aGrey( (sal_uInt8) 0 );
const long nWidth = pWriteAcc->Width();
const long nHeight = pWriteAcc->Height();
long nGrey11, nGrey12, nGrey13;
@@ -549,7 +549,7 @@ BOOL Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link* /*p
const long nLz = FRound( sin( fElev ) * 255.0 );
const long nZ2 = ( ( 6 * 255 ) / 4 ) * ( ( 6 * 255 ) / 4 );
const long nNzLz = ( ( 6 * 255 ) / 4 ) * nLz;
- const BYTE cLz = (BYTE) SAL_BOUND( nLz, 0, 255 );
+ const sal_uInt8 cLz = (sal_uInt8) SAL_BOUND( nLz, 0, 255 );
// fill mapping tables
pHMap[ 0 ] = 0;
@@ -586,7 +586,7 @@ BOOL Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link* /*p
else
{
const double fGrey = nDotL / sqrt( (double)(nNx * nNx + nNy * nNy + nZ2) );
- aGrey.SetIndex( (BYTE) SAL_BOUND( fGrey, 0, 255 ) );
+ aGrey.SetIndex( (sal_uInt8) SAL_BOUND( fGrey, 0, 255 ) );
}
pWriteAcc->SetPixel( nY, nX, aGrey );
@@ -605,7 +605,7 @@ BOOL Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link* /*p
delete[] pHMap;
delete[] pVMap;
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -628,21 +628,21 @@ BOOL Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link* /*p
// -----------------------------------------------------------------------------
-BOOL Bitmap::ImplSolarize( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
+sal_Bool Bitmap::ImplSolarize( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
BitmapWriteAccess* pWriteAcc = AcquireWriteAccess();
if( pWriteAcc )
{
- const BYTE cThreshold = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_SOLARIZE ) ?
+ const sal_uInt8 cThreshold = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_SOLARIZE ) ?
pFilterParam->mcSolarGreyThreshold : 128;
if( pWriteAcc->HasPalette() )
{
const BitmapPalette& rPal = pWriteAcc->GetPalette();
- for( USHORT i = 0, nCount = rPal.GetEntryCount(); i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = rPal.GetEntryCount(); i < nCount; i++ )
{
if( rPal[ i ].GetLuminance() >= cThreshold )
{
@@ -670,7 +670,7 @@ BOOL Bitmap::ImplSolarize( const BmpFilterParam* pFilterParam, const Link* /*pPr
}
ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -678,10 +678,10 @@ BOOL Bitmap::ImplSolarize( const BmpFilterParam* pFilterParam, const Link* /*pPr
// -----------------------------------------------------------------------------
-BOOL Bitmap::ImplSepia( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
+sal_Bool Bitmap::ImplSepia( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
{
BitmapReadAccess* pReadAcc = AcquireReadAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pReadAcc )
{
@@ -692,12 +692,12 @@ BOOL Bitmap::ImplSepia( const BmpFilterParam* pFilterParam, const Link* /*pProgr
DBG_ASSERT( nSepiaPercent <= 100, "Bitmap::ImplSepia(): sepia value out of range; defaulting to 100%" );
- for( USHORT i = 0; i < 256; i++ )
+ for( sal_uInt16 i = 0; i < 256; i++ )
{
BitmapColor& rCol = aSepiaPal[ i ];
- const BYTE cSepiaValue = (BYTE) ( ( nSepia * i ) / 10000 );
+ const sal_uInt8 cSepiaValue = (sal_uInt8) ( ( nSepia * i ) / 10000 );
- rCol.SetRed( (BYTE) i );
+ rCol.SetRed( (sal_uInt8) i );
rCol.SetGreen( cSepiaValue );
rCol.SetBlue( cSepiaValue );
}
@@ -707,7 +707,7 @@ BOOL Bitmap::ImplSepia( const BmpFilterParam* pFilterParam, const Link* /*pProgr
if( pWriteAcc )
{
- BitmapColor aCol( (BYTE) 0 );
+ BitmapColor aCol( (sal_uInt8) 0 );
const long nWidth = pWriteAcc->Width();
const long nHeight = pWriteAcc->Height();
@@ -715,10 +715,10 @@ BOOL Bitmap::ImplSepia( const BmpFilterParam* pFilterParam, const Link* /*pProgr
{
for( long nY = 0; nY < nHeight ; nY++ )
{
- const USHORT nPalCount = pReadAcc->GetPaletteEntryCount();
- BYTE* pIndexMap = new BYTE[ nPalCount ];
+ const sal_uInt16 nPalCount = pReadAcc->GetPaletteEntryCount();
+ sal_uInt8* pIndexMap = new sal_uInt8[ nPalCount ];
- for( USHORT i = 0; i < nPalCount; i++ )
+ for( sal_uInt16 i = 0; i < nPalCount; i++ )
pIndexMap[ i ] = pReadAcc->GetPaletteColor( i ).GetLuminance();
for( long nX = 0; nX < nWidth; nX++ )
@@ -743,7 +743,7 @@ BOOL Bitmap::ImplSepia( const BmpFilterParam* pFilterParam, const Link* /*pProgr
}
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -765,13 +765,13 @@ BOOL Bitmap::ImplSepia( const BmpFilterParam* pFilterParam, const Link* /*pProgr
// -----------------------------------------------------------------------------
-BOOL Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
+sal_Bool Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
{
- ULONG nTileWidth = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_MOSAIC ) ?
+ sal_uLong nTileWidth = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_MOSAIC ) ?
pFilterParam->maMosaicTileSize.mnTileWidth : 4;
- ULONG nTileHeight = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_MOSAIC ) ?
+ sal_uLong nTileHeight = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_MOSAIC ) ?
pFilterParam->maMosaicTileSize.mnTileHeight : 4;
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !nTileWidth )
nTileWidth = 1;
@@ -834,9 +834,9 @@ BOOL Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*pProg
}
}
- aCol.SetRed( (BYTE) ( nSumR * fArea_1 ) );
- aCol.SetGreen( (BYTE) ( nSumG * fArea_1 ) );
- aCol.SetBlue( (BYTE) ( nSumB * fArea_1 ) );
+ aCol.SetRed( (sal_uInt8) ( nSumR * fArea_1 ) );
+ aCol.SetGreen( (sal_uInt8) ( nSumG * fArea_1 ) );
+ aCol.SetBlue( (sal_uInt8) ( nSumB * fArea_1 ) );
for( nY = nY1; nY <= nY2; nY++ )
for( nX = nX1; nX <= nX2; nX++ )
@@ -860,16 +860,16 @@ BOOL Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*pProg
{
for( nX = nX1; nX <= nX2; nX++ )
{
- const BitmapColor& rCol = pReadAcc->GetPaletteColor( (BYTE) pReadAcc->GetPixel( nY, nX ) );
+ const BitmapColor& rCol = pReadAcc->GetPaletteColor( (sal_uInt8) pReadAcc->GetPixel( nY, nX ) );
nSumR += rCol.GetRed();
nSumG += rCol.GetGreen();
nSumB += rCol.GetBlue();
}
}
- aCol.SetRed( (BYTE) ( nSumR * fArea_1 ) );
- aCol.SetGreen( (BYTE) ( nSumG * fArea_1 ) );
- aCol.SetBlue( (BYTE) ( nSumB * fArea_1 ) );
+ aCol.SetRed( (sal_uInt8) ( nSumR * fArea_1 ) );
+ aCol.SetGreen( (sal_uInt8) ( nSumG * fArea_1 ) );
+ aCol.SetBlue( (sal_uInt8) ( nSumB * fArea_1 ) );
for( nY = nY1; nY <= nY2; nY++ )
for( nX = nX1; nX <= nX2; nX++ )
@@ -893,7 +893,7 @@ BOOL Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*pProg
}
while( nY1 < nHeight );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -917,7 +917,7 @@ BOOL Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*pProg
}
}
else
- bRet = TRUE;
+ bRet = sal_True;
return bRet;
}
@@ -948,13 +948,13 @@ extern "C" int __LOADONCALLAPI ImplPopArtCmpFnc( const void* p1, const void* p2
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplPopArt( const BmpFilterParam* /*pFilterParam*/, const Link* /*pProgress*/ )
+sal_Bool Bitmap::ImplPopArt( const BmpFilterParam* /*pFilterParam*/, const Link* /*pProgress*/ )
{
- BOOL bRet = ( GetBitCount() > 8 ) ? Convert( BMP_CONVERSION_8BIT_COLORS ) : TRUE;
+ sal_Bool bRet = ( GetBitCount() > 8 ) ? Convert( BMP_CONVERSION_8BIT_COLORS ) : sal_True;
if( bRet )
{
- bRet = FALSE;
+ bRet = sal_False;
BitmapWriteAccess* pWriteAcc = AcquireWriteAccess();
@@ -962,8 +962,8 @@ BOOL Bitmap::ImplPopArt( const BmpFilterParam* /*pFilterParam*/, const Link* /*p
{
const long nWidth = pWriteAcc->Width();
const long nHeight = pWriteAcc->Height();
- const ULONG nEntryCount = 1 << pWriteAcc->GetBitCount();
- ULONG n;
+ const sal_uLong nEntryCount = 1 << pWriteAcc->GetBitCount();
+ sal_uLong n;
PopArtEntry* pPopArtTable = new PopArtEntry[ nEntryCount ];
for( n = 0; n < nEntryCount; n++ )
@@ -982,26 +982,26 @@ BOOL Bitmap::ImplPopArt( const BmpFilterParam* /*pFilterParam*/, const Link* /*p
qsort( pPopArtTable, nEntryCount, sizeof( PopArtEntry ), ImplPopArtCmpFnc );
// get last used entry
- ULONG nFirstEntry;
- ULONG nLastEntry = 0;
+ sal_uLong nFirstEntry;
+ sal_uLong nLastEntry = 0;
for( n = 0; n < nEntryCount; n++ )
if( pPopArtTable[ n ].mnCount )
nLastEntry = n;
// rotate palette (one entry)
- const BitmapColor aFirstCol( pWriteAcc->GetPaletteColor( sal::static_int_cast<USHORT>(pPopArtTable[ 0 ].mnIndex) ) );
+ const BitmapColor aFirstCol( pWriteAcc->GetPaletteColor( sal::static_int_cast<sal_uInt16>(pPopArtTable[ 0 ].mnIndex) ) );
for( nFirstEntry = 0; nFirstEntry < nLastEntry; nFirstEntry++ )
{
- pWriteAcc->SetPaletteColor( sal::static_int_cast<USHORT>(pPopArtTable[ nFirstEntry ].mnIndex),
- pWriteAcc->GetPaletteColor( sal::static_int_cast<USHORT>(pPopArtTable[ nFirstEntry + 1 ].mnIndex) ) );
+ pWriteAcc->SetPaletteColor( sal::static_int_cast<sal_uInt16>(pPopArtTable[ nFirstEntry ].mnIndex),
+ pWriteAcc->GetPaletteColor( sal::static_int_cast<sal_uInt16>(pPopArtTable[ nFirstEntry + 1 ].mnIndex) ) );
}
- pWriteAcc->SetPaletteColor( sal::static_int_cast<USHORT>(pPopArtTable[ nLastEntry ].mnIndex), aFirstCol );
+ pWriteAcc->SetPaletteColor( sal::static_int_cast<sal_uInt16>(pPopArtTable[ nLastEntry ].mnIndex), aFirstCol );
// cleanup
delete[] pPopArtTable;
ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
}
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 777f169053da..d1f130d9d1cc 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -50,7 +50,7 @@
BitmapEx::BitmapEx() :
eTransparent( TRANSPARENT_NONE ),
- bAlpha ( FALSE )
+ bAlpha ( sal_False )
{
}
@@ -68,7 +68,7 @@ BitmapEx::BitmapEx( const BitmapEx& rBitmapEx ) :
BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize ) :
eTransparent( TRANSPARENT_NONE ),
- bAlpha ( FALSE )
+ bAlpha ( sal_False )
{
if( rBitmapEx.IsEmpty() )
return;
@@ -77,7 +77,7 @@ BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize ) :
aBitmapSize = aSize;
if( rBitmapEx.IsAlpha() )
{
- bAlpha = TRUE;
+ bAlpha = sal_True;
aMask = AlphaMask( aSize ).ImplGetBitmap();
}
else if( rBitmapEx.IsTransparent() )
@@ -92,7 +92,7 @@ BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize ) :
BitmapEx::BitmapEx( const ResId& rResId ) :
eTransparent( TRANSPARENT_NONE ),
- bAlpha ( FALSE )
+ bAlpha ( sal_False )
{
static ImplImageTreeSingletonRef aImageTree;
ResMgr* pResMgr = NULL;
@@ -119,7 +119,7 @@ BitmapEx::BitmapEx( const Bitmap& rBmp ) :
aBitmap ( rBmp ),
aBitmapSize ( aBitmap.GetSizePixel() ),
eTransparent( TRANSPARENT_NONE ),
- bAlpha ( FALSE )
+ bAlpha ( sal_False )
{
}
@@ -130,7 +130,7 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const Bitmap& rMask ) :
aMask ( rMask ),
aBitmapSize ( aBitmap.GetSizePixel() ),
eTransparent ( !rMask ? TRANSPARENT_NONE : TRANSPARENT_BITMAP ),
- bAlpha ( FALSE )
+ bAlpha ( sal_False )
{
DBG_ASSERT( !rMask || rBmp.GetSizePixel() == rMask.GetSizePixel(),
"BitmapEx::BitmapEx(): size mismatch for bitmap and mask." );
@@ -150,7 +150,7 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const AlphaMask& rAlphaMask ) :
aMask ( rAlphaMask.ImplGetBitmap() ),
aBitmapSize ( aBitmap.GetSizePixel() ),
eTransparent ( !rAlphaMask ? TRANSPARENT_NONE : TRANSPARENT_BITMAP ),
- bAlpha ( !rAlphaMask ? FALSE : TRUE )
+ bAlpha ( !rAlphaMask ? sal_False : sal_True )
{
DBG_ASSERT( !rAlphaMask || rBmp.GetSizePixel() == rAlphaMask.GetSizePixel(),
"BitmapEx::BitmapEx(): size mismatch for bitmap and alpha mask." );
@@ -169,7 +169,7 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const Color& rTransparentColor ) :
aBitmapSize ( aBitmap.GetSizePixel() ),
aTransparentColor ( rTransparentColor ),
eTransparent ( TRANSPARENT_BITMAP ),
- bAlpha ( FALSE )
+ bAlpha ( sal_False )
{
aMask = aBitmap.CreateMask( aTransparentColor );
@@ -204,19 +204,19 @@ BitmapEx& BitmapEx::operator=( const BitmapEx& rBitmapEx )
// ------------------------------------------------------------------
-BOOL BitmapEx::operator==( const BitmapEx& rBitmapEx ) const
+sal_Bool BitmapEx::operator==( const BitmapEx& rBitmapEx ) const
{
if( eTransparent != rBitmapEx.eTransparent )
- return FALSE;
+ return sal_False;
if( aBitmap != rBitmapEx.aBitmap )
- return FALSE;
+ return sal_False;
if( aBitmapSize != rBitmapEx.aBitmapSize )
- return FALSE;
+ return sal_False;
if( eTransparent == TRANSPARENT_NONE )
- return TRUE;
+ return sal_True;
if( eTransparent == TRANSPARENT_COLOR )
return aTransparentColor == rBitmapEx.aTransparentColor;
@@ -226,7 +226,7 @@ BOOL BitmapEx::operator==( const BitmapEx& rBitmapEx ) const
// ------------------------------------------------------------------
-BOOL BitmapEx::IsEqual( const BitmapEx& rBmpEx ) const
+sal_Bool BitmapEx::IsEqual( const BitmapEx& rBmpEx ) const
{
return( rBmpEx.eTransparent == eTransparent &&
rBmpEx.bAlpha == bAlpha &&
@@ -236,7 +236,7 @@ BOOL BitmapEx::IsEqual( const BitmapEx& rBmpEx ) const
// ------------------------------------------------------------------
-BOOL BitmapEx::IsEmpty() const
+sal_Bool BitmapEx::IsEmpty() const
{
return( aBitmap.IsEmpty() && aMask.IsEmpty() );
}
@@ -248,7 +248,7 @@ void BitmapEx::SetEmpty()
aBitmap.SetEmpty();
aMask.SetEmpty();
eTransparent = TRANSPARENT_NONE;
- bAlpha = FALSE;
+ bAlpha = sal_False;
}
// ------------------------------------------------------------------
@@ -260,14 +260,14 @@ void BitmapEx::Clear()
// ------------------------------------------------------------------
-BOOL BitmapEx::IsTransparent() const
+sal_Bool BitmapEx::IsTransparent() const
{
return( eTransparent != TRANSPARENT_NONE );
}
// ------------------------------------------------------------------
-BOOL BitmapEx::IsAlpha() const
+sal_Bool BitmapEx::IsAlpha() const
{
return( IsTransparent() && bAlpha );
}
@@ -324,9 +324,9 @@ AlphaMask BitmapEx::GetAlpha() const
// ------------------------------------------------------------------
-ULONG BitmapEx::GetSizeBytes() const
+sal_uLong BitmapEx::GetSizeBytes() const
{
- ULONG nSizeBytes = aBitmap.GetSizeBytes();
+ sal_uLong nSizeBytes = aBitmap.GetSizeBytes();
if( eTransparent == TRANSPARENT_BITMAP )
nSizeBytes += aMask.GetSizeBytes();
@@ -336,7 +336,7 @@ ULONG BitmapEx::GetSizeBytes() const
// ------------------------------------------------------------------
-ULONG BitmapEx::GetChecksum() const
+sal_uLong BitmapEx::GetChecksum() const
{
sal_uInt32 nCrc = aBitmap.GetChecksum();
SVBT32 aBT32;
@@ -365,9 +365,9 @@ void BitmapEx::SetSizePixel( const Size& rNewSize )
// ------------------------------------------------------------------
-BOOL BitmapEx::Invert()
+sal_Bool BitmapEx::Invert()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !!aBitmap )
{
@@ -382,9 +382,9 @@ BOOL BitmapEx::Invert()
// ------------------------------------------------------------------
-BOOL BitmapEx::Mirror( ULONG nMirrorFlags )
+sal_Bool BitmapEx::Mirror( sal_uLong nMirrorFlags )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !!aBitmap )
{
@@ -399,9 +399,9 @@ BOOL BitmapEx::Mirror( ULONG nMirrorFlags )
// ------------------------------------------------------------------
-BOOL BitmapEx::Scale( const double& rScaleX, const double& rScaleY, ULONG nScaleFlag )
+sal_Bool BitmapEx::Scale( const double& rScaleX, const double& rScaleY, sal_uLong nScaleFlag )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !!aBitmap )
{
@@ -421,9 +421,9 @@ BOOL BitmapEx::Scale( const double& rScaleX, const double& rScaleY, ULONG nScale
// ------------------------------------------------------------------------
-BOOL BitmapEx::Scale( const Size& rNewSize, ULONG nScaleFlag )
+sal_Bool BitmapEx::Scale( const Size& rNewSize, sal_uLong nScaleFlag )
{
- BOOL bRet;
+ sal_Bool bRet;
if( aBitmapSize.Width() && aBitmapSize.Height() )
{
@@ -432,20 +432,20 @@ BOOL BitmapEx::Scale( const Size& rNewSize, ULONG nScaleFlag )
nScaleFlag );
}
else
- bRet = TRUE;
+ bRet = sal_True;
return bRet;
}
// ------------------------------------------------------------------
-BOOL BitmapEx::Rotate( long nAngle10, const Color& rFillColor )
+sal_Bool BitmapEx::Rotate( long nAngle10, const Color& rFillColor )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !!aBitmap )
{
- const BOOL bTransRotate = ( Color( COL_TRANSPARENT ) == rFillColor );
+ const sal_Bool bTransRotate = ( Color( COL_TRANSPARENT ) == rFillColor );
if( bTransRotate )
{
@@ -485,9 +485,9 @@ BOOL BitmapEx::Rotate( long nAngle10, const Color& rFillColor )
// ------------------------------------------------------------------
-BOOL BitmapEx::Crop( const Rectangle& rRectPixel )
+sal_Bool BitmapEx::Crop( const Rectangle& rRectPixel )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !!aBitmap )
{
@@ -507,23 +507,23 @@ BOOL BitmapEx::Crop( const Rectangle& rRectPixel )
// ------------------------------------------------------------------
-BOOL BitmapEx::Convert( BmpConversion eConversion )
+sal_Bool BitmapEx::Convert( BmpConversion eConversion )
{
- return( !!aBitmap ? aBitmap.Convert( eConversion ) : FALSE );
+ return( !!aBitmap ? aBitmap.Convert( eConversion ) : sal_False );
}
// ------------------------------------------------------------------
-BOOL BitmapEx::ReduceColors( USHORT nNewColorCount, BmpReduce eReduce )
+sal_Bool BitmapEx::ReduceColors( sal_uInt16 nNewColorCount, BmpReduce eReduce )
{
- return( !!aBitmap ? aBitmap.ReduceColors( nNewColorCount, eReduce ) : FALSE );
+ return( !!aBitmap ? aBitmap.ReduceColors( nNewColorCount, eReduce ) : sal_False );
}
// ------------------------------------------------------------------
-BOOL BitmapEx::Expand( ULONG nDX, ULONG nDY, const Color* pInitColor, BOOL bExpandTransparent )
+sal_Bool BitmapEx::Expand( sal_uLong nDX, sal_uLong nDY, const Color* pInitColor, sal_Bool bExpandTransparent )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !!aBitmap )
{
@@ -546,10 +546,10 @@ BOOL BitmapEx::Expand( ULONG nDX, ULONG nDY, const Color* pInitColor, BOOL bExpa
// ------------------------------------------------------------------
-BOOL BitmapEx::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
+sal_Bool BitmapEx::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
const BitmapEx* pBmpExSrc )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !pBmpExSrc || pBmpExSrc->IsEmpty() )
{
@@ -580,7 +580,7 @@ BOOL BitmapEx::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
aMask = pAlpha->ImplGetBitmap();
delete pAlpha;
- bAlpha = TRUE;
+ bAlpha = sal_True;
aMask.CopyPixel( rRectDst, rRectSrc, &pBmpExSrc->aMask );
}
else
@@ -591,7 +591,7 @@ BOOL BitmapEx::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
aMask = pAlpha->ImplGetBitmap();
delete pAlpha;
eTransparent = TRANSPARENT_BITMAP;
- bAlpha = TRUE;
+ bAlpha = sal_True;
aMask.CopyPixel( rRectDst, rRectSrc, &pBmpExSrc->aMask );
}
}
@@ -635,9 +635,9 @@ BOOL BitmapEx::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
// ------------------------------------------------------------------
-BOOL BitmapEx::Erase( const Color& rFillColor )
+sal_Bool BitmapEx::Erase( const Color& rFillColor )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !!aBitmap )
{
@@ -664,41 +664,41 @@ BOOL BitmapEx::Erase( const Color& rFillColor )
// ------------------------------------------------------------------
-BOOL BitmapEx::Dither( ULONG nDitherFlags )
+sal_Bool BitmapEx::Dither( sal_uLong nDitherFlags )
{
- return( !!aBitmap ? aBitmap.Dither( nDitherFlags ) : FALSE );
+ return( !!aBitmap ? aBitmap.Dither( nDitherFlags ) : sal_False );
}
// ------------------------------------------------------------------
-BOOL BitmapEx::Replace( const Color& rSearchColor, const Color& rReplaceColor, ULONG nTol )
+sal_Bool BitmapEx::Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol )
{
- return( !!aBitmap ? aBitmap.Replace( rSearchColor, rReplaceColor, nTol ) : FALSE );
+ return( !!aBitmap ? aBitmap.Replace( rSearchColor, rReplaceColor, nTol ) : sal_False );
}
// ------------------------------------------------------------------
-BOOL BitmapEx::Replace( const Color* pSearchColors, const Color* pReplaceColors, ULONG nColorCount, const ULONG* pTols )
+sal_Bool BitmapEx::Replace( const Color* pSearchColors, const Color* pReplaceColors, sal_uLong nColorCount, const sal_uLong* pTols )
{
- return( !!aBitmap ? aBitmap.Replace( pSearchColors, pReplaceColors, nColorCount, (ULONG*) pTols ) : FALSE );
+ return( !!aBitmap ? aBitmap.Replace( pSearchColors, pReplaceColors, nColorCount, (sal_uLong*) pTols ) : sal_False );
}
// ------------------------------------------------------------------
-BOOL BitmapEx::Adjust( short nLuminancePercent, short nContrastPercent,
+sal_Bool BitmapEx::Adjust( short nLuminancePercent, short nContrastPercent,
short nChannelRPercent, short nChannelGPercent, short nChannelBPercent,
- double fGamma, BOOL bInvert )
+ double fGamma, sal_Bool bInvert )
{
return( !!aBitmap ? aBitmap.Adjust( nLuminancePercent, nContrastPercent,
nChannelRPercent, nChannelGPercent, nChannelBPercent,
- fGamma, bInvert ) : FALSE );
+ fGamma, bInvert ) : sal_False );
}
// ------------------------------------------------------------------
-BOOL BitmapEx::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link* pProgress )
+sal_Bool BitmapEx::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link* pProgress )
{
- return( !!aBitmap ? aBitmap.Filter( eFilter, pFilterParam, pProgress ) : FALSE );
+ return( !!aBitmap ? aBitmap.Filter( eFilter, pFilterParam, pProgress ) : sal_False );
}
// ------------------------------------------------------------------
@@ -857,9 +857,9 @@ SvStream& operator<<( SvStream& rOStm, const BitmapEx& rBitmapEx )
{
rBitmapEx.aBitmap.Write( rOStm );
- rOStm << (UINT32) 0x25091962;
- rOStm << (UINT32) 0xACB20201;
- rOStm << (BYTE) rBitmapEx.eTransparent;
+ rOStm << (sal_uInt32) 0x25091962;
+ rOStm << (sal_uInt32) 0xACB20201;
+ rOStm << (sal_uInt8) rBitmapEx.eTransparent;
if( rBitmapEx.eTransparent == TRANSPARENT_BITMAP )
rBitmapEx.aMask.Write( rOStm );
@@ -879,9 +879,9 @@ SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx )
if( !rIStm.GetError() )
{
- const ULONG nStmPos = rIStm.Tell();
- UINT32 nMagic1 = 0;
- UINT32 nMagic2 = 0;
+ const sal_uLong nStmPos = rIStm.Tell();
+ sal_uInt32 nMagic1 = 0;
+ sal_uInt32 nMagic2 = 0;
rIStm >> nMagic1 >> nMagic2;
@@ -893,11 +893,11 @@ SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx )
}
else
{
- BYTE bTransparent = false;
+ sal_uInt8 bTransparent = false;
rIStm >> bTransparent;
- if( bTransparent == (BYTE) TRANSPARENT_BITMAP )
+ if( bTransparent == (sal_uInt8) TRANSPARENT_BITMAP )
{
Bitmap aMask;
@@ -920,7 +920,7 @@ SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx )
else
rBitmapEx = aBmp;
}
- else if( bTransparent == (BYTE) TRANSPARENT_COLOR )
+ else if( bTransparent == (sal_uInt8) TRANSPARENT_COLOR )
{
Color aTransparentColor;
diff --git a/vcl/source/gdi/bmpacc.cxx b/vcl/source/gdi/bmpacc.cxx
index e3a1eb37fa98..0762821c3267 100644
--- a/vcl/source/gdi/bmpacc.cxx
+++ b/vcl/source/gdi/bmpacc.cxx
@@ -38,7 +38,7 @@
// - BitmapReadAccess -
// --------------------
-BitmapReadAccess::BitmapReadAccess( Bitmap& rBitmap, BOOL bModify ) :
+BitmapReadAccess::BitmapReadAccess( Bitmap& rBitmap, sal_Bool bModify ) :
mpBuffer ( NULL ),
mpScanBuf ( NULL ),
mFncGetPixel ( NULL ),
@@ -55,7 +55,7 @@ BitmapReadAccess::BitmapReadAccess( Bitmap& rBitmap ) :
mpScanBuf ( NULL ),
mFncGetPixel ( NULL ),
mFncSetPixel ( NULL ),
- mbModify ( FALSE )
+ mbModify ( sal_False )
{
ImplCreate( rBitmap );
}
@@ -155,9 +155,9 @@ void BitmapReadAccess::ImplDestroy()
// ------------------------------------------------------------------
-BOOL BitmapReadAccess::ImplSetAccessPointers( ULONG nFormat )
+sal_Bool BitmapReadAccess::ImplSetAccessPointers( sal_uLong nFormat )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
switch( nFormat )
{
@@ -179,7 +179,7 @@ BOOL BitmapReadAccess::ImplSetAccessPointers( ULONG nFormat )
CASE_FORMAT( _32BIT_TC_MASK )
default:
- bRet = FALSE;
+ bRet = sal_False;
break;
}
@@ -197,7 +197,7 @@ void BitmapReadAccess::ImplZeroInitUnusedBits()
sal_uInt32 nBits;
bool bMsb;
- const ULONG nScanlineFormat = GetScanlineFormat();
+ const sal_uLong nScanlineFormat = GetScanlineFormat();
switch( nScanlineFormat )
{
case( BMP_FORMAT_1BIT_MSB_PAL ):
@@ -273,7 +273,7 @@ void BitmapReadAccess::ImplZeroInitUnusedBits()
else
nMask = static_cast<sal_uInt8>(0xffU >> (nLeftOverBits & 3UL));
- BYTE* pLastBytes = (BYTE*)GetBuffer() + ( nScanSize - nBytes );
+ sal_uInt8* pLastBytes = (sal_uInt8*)GetBuffer() + ( nScanSize - nBytes );
for( sal_uInt32 i = 0; i < nHeight; i++, pLastBytes += nScanSize )
{
*pLastBytes &= nMask;
@@ -285,7 +285,7 @@ void BitmapReadAccess::ImplZeroInitUnusedBits()
else if( nBits & 0x1f )
{
sal_uInt32 nMask = 0xffffffff << ( ( nScanSize << 3 ) - nBits );
- BYTE* pLast4Bytes = (BYTE*) GetBuffer() + ( nScanSize - 4 );
+ sal_uInt8* pLast4Bytes = (sal_uInt8*) GetBuffer() + ( nScanSize - 4 );
#ifdef OSL_LITENDIAN
nMask = SWAPLONG( nMask );
@@ -305,7 +305,7 @@ void BitmapReadAccess::Flush()
// ------------------------------------------------------------------
-void BitmapReadAccess::ReAccess( BOOL bModify )
+void BitmapReadAccess::ReAccess( sal_Bool bModify )
{
const ImpBitmap* pImpBmp = maBitmap.ImplGetImpBitmap();
@@ -321,7 +321,7 @@ void BitmapReadAccess::ReAccess( BOOL bModify )
// ------------------------------------------------------------------
-USHORT BitmapReadAccess::GetBestPaletteIndex( const BitmapColor& rBitmapColor ) const
+sal_uInt16 BitmapReadAccess::GetBestPaletteIndex( const BitmapColor& rBitmapColor ) const
{
return( HasPalette() ? mpBuffer->maPalette.GetBestIndex( rBitmapColor ) : 0 );
}
@@ -331,7 +331,7 @@ USHORT BitmapReadAccess::GetBestPaletteIndex( const BitmapColor& rBitmapColor )
// ---------------------
BitmapWriteAccess::BitmapWriteAccess( Bitmap& rBitmap ) :
- BitmapReadAccess( rBitmap, TRUE ),
+ BitmapReadAccess( rBitmap, sal_True ),
mpLineColor ( NULL ),
mpFillColor ( NULL )
{
@@ -367,16 +367,16 @@ void BitmapWriteAccess::CopyScanline( long nY, const BitmapReadAccess& rReadAcc
// ------------------------------------------------------------------
void BitmapWriteAccess::CopyScanline( long nY, ConstScanline aSrcScanline,
- ULONG nSrcScanlineFormat, ULONG nSrcScanlineSize )
+ sal_uLong nSrcScanlineFormat, sal_uLong nSrcScanlineSize )
{
- const ULONG nFormat = BMP_SCANLINE_FORMAT( nSrcScanlineFormat );
+ const sal_uLong nFormat = BMP_SCANLINE_FORMAT( nSrcScanlineFormat );
DBG_ASSERT( ( nY >= 0 ) && ( nY < mpBuffer->mnHeight ), "y-coordinate in destination out of range!" );
DBG_ASSERT( ( HasPalette() && nFormat <= BMP_FORMAT_8BIT_PAL ) ||
( !HasPalette() && nFormat > BMP_FORMAT_8BIT_PAL ),
"No copying possible between palette and non palette scanlines!" );
- const ULONG nCount = Min( GetScanlineSize(), nSrcScanlineSize );
+ const sal_uLong nCount = Min( GetScanlineSize(), nSrcScanlineSize );
if( nCount )
{
@@ -438,7 +438,7 @@ void BitmapWriteAccess::CopyBuffer( const BitmapReadAccess& rReadAcc )
( GetScanlineSize() == rReadAcc.GetScanlineSize() ) )
{
const long nHeight = Min( mpBuffer->mnHeight, rReadAcc.Height() );
- const ULONG nCount = nHeight * mpBuffer->mnScanlineSize;
+ const sal_uLong nCount = nHeight * mpBuffer->mnScanlineSize;
memcpy( mpBuffer->mpBits, rReadAcc.GetBuffer(), nCount );
}
diff --git a/vcl/source/gdi/bmpacc2.cxx b/vcl/source/gdi/bmpacc2.cxx
index 6cff281556ab..718bd56cdb0c 100644
--- a/vcl/source/gdi/bmpacc2.cxx
+++ b/vcl/source/gdi/bmpacc2.cxx
@@ -44,7 +44,7 @@ IMPL_FORMAT_GETPIXEL_NOMASK( _1BIT_MSB_PAL )
IMPL_FORMAT_SETPIXEL_NOMASK( _1BIT_MSB_PAL )
{
- BYTE& rByte = pScanline[ nX >> 3 ];
+ sal_uInt8& rByte = pScanline[ nX >> 3 ];
( rBitmapColor.GetIndex() & 1 ) ? ( rByte |= 1 << ( 7 - ( nX & 7 ) ) ) :
( rByte &= ~( 1 << ( 7 - ( nX & 7 ) ) ) );
@@ -61,7 +61,7 @@ IMPL_FORMAT_GETPIXEL_NOMASK( _1BIT_LSB_PAL )
IMPL_FORMAT_SETPIXEL_NOMASK( _1BIT_LSB_PAL )
{
- BYTE& rByte = pScanline[ nX >> 3 ];
+ sal_uInt8& rByte = pScanline[ nX >> 3 ];
( rBitmapColor.GetIndex() & 1 ) ? ( rByte |= 1 << ( nX & 7 ) ) :
( rByte &= ~( 1 << ( nX & 7 ) ) );
@@ -78,7 +78,7 @@ IMPL_FORMAT_GETPIXEL_NOMASK( _4BIT_MSN_PAL )
IMPL_FORMAT_SETPIXEL_NOMASK( _4BIT_MSN_PAL )
{
- BYTE& rByte = pScanline[ nX >> 1 ];
+ sal_uInt8& rByte = pScanline[ nX >> 1 ];
( nX & 1 ) ? ( rByte &= 0xf0, rByte |= ( rBitmapColor.GetIndex() & 0x0f ) ) :
( rByte &= 0x0f, rByte |= ( rBitmapColor.GetIndex() << 4 ) );
@@ -95,7 +95,7 @@ IMPL_FORMAT_GETPIXEL_NOMASK( _4BIT_LSN_PAL )
IMPL_FORMAT_SETPIXEL_NOMASK( _4BIT_LSN_PAL )
{
- BYTE& rByte = pScanline[ nX >> 1 ];
+ sal_uInt8& rByte = pScanline[ nX >> 1 ];
( nX & 1 ) ? ( rByte &= 0x0f, rByte |= ( rBitmapColor.GetIndex() << 4 ) ) :
( rByte &= 0xf0, rByte |= ( rBitmapColor.GetIndex() & 0x0f ) );
diff --git a/vcl/source/gdi/bmpacc3.cxx b/vcl/source/gdi/bmpacc3.cxx
index 55f4a8b412a6..5e87d680e9c0 100644
--- a/vcl/source/gdi/bmpacc3.cxx
+++ b/vcl/source/gdi/bmpacc3.cxx
@@ -54,7 +54,7 @@ void BitmapWriteAccess::SetLineColor( const Color& rColor )
if( rColor.GetTransparency() == 255 )
mpLineColor = NULL;
else
- mpLineColor = ( HasPalette() ? new BitmapColor( (BYTE) GetBestPaletteIndex( rColor ) ) : new BitmapColor( rColor ) );
+ mpLineColor = ( HasPalette() ? new BitmapColor( (sal_uInt8) GetBestPaletteIndex( rColor ) ) : new BitmapColor( rColor ) );
}
// ------------------------------------------------------------------
@@ -88,7 +88,7 @@ void BitmapWriteAccess::SetFillColor( const Color& rColor )
if( rColor.GetTransparency() == 255 )
mpFillColor = NULL;
else
- mpFillColor = ( HasPalette() ? new BitmapColor( (BYTE) GetBestPaletteIndex( rColor ) ) : new BitmapColor( rColor ) );
+ mpFillColor = ( HasPalette() ? new BitmapColor( (sal_uInt8) GetBestPaletteIndex( rColor ) ) : new BitmapColor( rColor ) );
}
// ------------------------------------------------------------------
@@ -113,7 +113,7 @@ void BitmapWriteAccess::Erase( const Color& rColor )
// TODO: provide and use Erase( BitmapColor& method)
BitmapColor aColor = rColor;
if( HasPalette() )
- aColor = BitmapColor( (BYTE)GetBestPaletteIndex( rColor) );
+ aColor = BitmapColor( (sal_uInt8)GetBestPaletteIndex( rColor) );
// try fast bitmap method first
if( ImplFastEraseBitmap( *mpBuffer, aColor ) )
return;
@@ -205,7 +205,7 @@ void BitmapWriteAccess::DrawLine( const Point& rStart, const Point& rEnd )
const long nDYX = ( nDY - nDX ) << 1;
const long nDY2 = nDY << 1;
long nD = nDY2 - nDX;
- BOOL bPos = nY1 < nY2;
+ sal_Bool bPos = nY1 < nY2;
for ( nX = nX1, nY = nY1; nX <= nX2; nX++ )
{
@@ -244,7 +244,7 @@ void BitmapWriteAccess::DrawLine( const Point& rStart, const Point& rEnd )
const long nDYX = ( nDX - nDY ) << 1;
const long nDY2 = nDX << 1;
long nD = nDY2 - nDY;
- BOOL bPos = nX1 < nX2;
+ sal_Bool bPos = nX1 < nX2;
for ( nX = nX1, nY = nY1; nY <= nY2; nY++ )
{
@@ -313,7 +313,7 @@ void BitmapWriteAccess::DrawRect( const Rectangle& rRect )
void BitmapWriteAccess::FillPolygon( const Polygon& rPoly )
{
- const USHORT nSize = rPoly.GetSize();
+ const sal_uInt16 nSize = rPoly.GetSize();
if( nSize && mpFillColor )
{
@@ -346,9 +346,9 @@ void BitmapWriteAccess::DrawPolygon( const Polygon& rPoly )
if( mpLineColor && ( !mpFillColor || ( *mpFillColor != *mpLineColor ) ) )
{
- const USHORT nSize = rPoly.GetSize();
+ const sal_uInt16 nSize = rPoly.GetSize();
- for( USHORT i = 0, nSize1 = nSize - 1; i < nSize1; i++ )
+ for( sal_uInt16 i = 0, nSize1 = nSize - 1; i < nSize1; i++ )
DrawLine( rPoly[ i ], rPoly[ i + 1 ] );
if( rPoly[ nSize - 1 ] != rPoly[ 0 ] )
@@ -360,7 +360,7 @@ void BitmapWriteAccess::DrawPolygon( const Polygon& rPoly )
void BitmapWriteAccess::FillPolyPolygon( const PolyPolygon& rPolyPoly )
{
- const USHORT nCount = rPolyPoly.Count();
+ const sal_uInt16 nCount = rPolyPoly.Count();
if( nCount && mpFillColor )
{
@@ -393,14 +393,14 @@ void BitmapWriteAccess::DrawPolyPolygon( const PolyPolygon& rPolyPoly )
if( mpLineColor && ( !mpFillColor || ( *mpFillColor != *mpLineColor ) ) )
{
- for( USHORT n = 0, nCount = rPolyPoly.Count(); n < nCount; )
+ for( sal_uInt16 n = 0, nCount = rPolyPoly.Count(); n < nCount; )
{
const Polygon& rPoly = rPolyPoly[ n++ ];
- const USHORT nSize = rPoly.GetSize();
+ const sal_uInt16 nSize = rPoly.GetSize();
if( nSize )
{
- for( USHORT i = 0, nSize1 = nSize - 1; i < nSize1; i++ )
+ for( sal_uInt16 i = 0, nSize1 = nSize - 1; i < nSize1; i++ )
DrawLine( rPoly[ i ], rPoly[ i + 1 ] );
if( rPoly[ nSize - 1 ] != rPoly[ 0 ] )
diff --git a/vcl/source/gdi/bmpconv.cxx b/vcl/source/gdi/bmpconv.cxx
index f71827fc7413..886055817312 100644
--- a/vcl/source/gdi/bmpconv.cxx
+++ b/vcl/source/gdi/bmpconv.cxx
@@ -29,14 +29,14 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <vcl/bitmap.hxx>
-#include <vcl/impbmpconv.hxx>
-#include <vcl/svapp.hxx>
+#include "vcl/bitmap.hxx"
+#include "vcl/svapp.hxx"
+#include "vcl/salctype.hxx"
#include <osl/mutex.hxx>
-#include <tools/stream.hxx>
-#include <com/sun/star/script/XInvocation.hpp>
-#include <com/sun/star/awt/XBitmap.hpp>
-#include <cppuhelper/compbase1.hxx>
+#include "tools/stream.hxx"
+#include "com/sun/star/script/XInvocation.hpp"
+#include "com/sun/star/awt/XBitmap.hpp"
+#include "cppuhelper/compbase1.hxx"
using namespace com::sun::star::uno;
@@ -155,7 +155,7 @@ Any SAL_CALL BmpConverter::invoke(
SvMemoryStream aStream( aDIB.getArray(), aDIB.getLength(), STREAM_READ | STREAM_WRITE );
Bitmap aBM;
- aBM.Read( aStream, TRUE );
+ aBM.Read( aStream, sal_True );
if( nTargetDepth < 4 )
nTargetDepth = 1;
else if( nTargetDepth < 8 )
@@ -190,7 +190,7 @@ BmpTransporter::BmpTransporter( const Bitmap& rBM )
m_aSize.Width = rBM.GetSizePixel().Width();
m_aSize.Height = rBM.GetSizePixel().Height();
SvMemoryStream aStream;
- rBM.Write( aStream, FALSE, TRUE );
+ rBM.Write( aStream, sal_False, sal_True );
m_aBM = Sequence<sal_Int8>(static_cast<const sal_Int8*>(aStream.GetData()),
aStream.GetEndOfData());
}
diff --git a/vcl/source/gdi/bmpfast.cxx b/vcl/source/gdi/bmpfast.cxx
index 4c9ab03ea9c1..8fc5188c9204 100644
--- a/vcl/source/gdi/bmpfast.cxx
+++ b/vcl/source/gdi/bmpfast.cxx
@@ -56,7 +56,7 @@ protected:
PIXBYTE* mpPixel;
};
-template <ULONG PIXFMT>
+template <sal_uLong PIXFMT>
class TrueColorPixelPtr : public BasePixelPtr
{
public:
@@ -255,7 +255,7 @@ class TrueColorPixelPtr<BMP_FORMAT_8BIT_PAL>
// =======================================================================
// converting truecolor formats
-template <ULONG SRCFMT, ULONG DSTFMT>
+template <sal_uLong SRCFMT, sal_uLong DSTFMT>
inline void ImplConvertPixel( const TrueColorPixelPtr<DSTFMT>& rDst,
const TrueColorPixelPtr<SRCFMT>& rSrc )
{
@@ -279,7 +279,7 @@ inline void ImplConvertPixel<BMP_FORMAT_16BIT_TC_LSB_MASK, BMP_FORMAT_16BIT_TC_M
// -----------------------------------------------------------------------
-template <ULONG SRCFMT, ULONG DSTFMT>
+template <sal_uLong SRCFMT, sal_uLong DSTFMT>
inline void ImplConvertLine( const TrueColorPixelPtr<DSTFMT>& rDst,
const TrueColorPixelPtr<SRCFMT>& rSrc, int nPixelCount )
{
@@ -296,7 +296,7 @@ inline void ImplConvertLine( const TrueColorPixelPtr<DSTFMT>& rDst,
// =======================================================================
// alpha blending truecolor pixels
-template <unsigned ALPHABITS, ULONG SRCFMT, ULONG DSTFMT>
+template <unsigned ALPHABITS, sal_uLong SRCFMT, sal_uLong DSTFMT>
inline void ImplBlendPixels( const TrueColorPixelPtr<DSTFMT>& rDst,
const TrueColorPixelPtr<SRCFMT>& rSrc, unsigned nAlphaVal )
{
@@ -328,7 +328,7 @@ inline void ImplBlendPixels( const TrueColorPixelPtr<DSTFMT>& rDst,
// -----------------------------------------------------------------------
-template <unsigned ALPHABITS, ULONG MASKFMT, ULONG SRCFMT, ULONG DSTFMT>
+template <unsigned ALPHABITS, sal_uLong MASKFMT, sal_uLong SRCFMT, sal_uLong DSTFMT>
inline void ImplBlendLines( const TrueColorPixelPtr<DSTFMT>& rDst,
const TrueColorPixelPtr<SRCFMT>& rSrc, const TrueColorPixelPtr<MASKFMT>& rMsk,
int nPixelCount )
@@ -347,7 +347,7 @@ inline void ImplBlendLines( const TrueColorPixelPtr<DSTFMT>& rDst,
// -----------------------------------------------------------------------
-template <unsigned ALPHABITS, ULONG SRCFMT, ULONG DSTFMT>
+template <unsigned ALPHABITS, sal_uLong SRCFMT, sal_uLong DSTFMT>
inline void ImplBlendLines( const TrueColorPixelPtr<DSTFMT>& rDst,
const TrueColorPixelPtr<SRCFMT>& rSrc, unsigned nAlphaVal,
int nPixelCount )
@@ -405,7 +405,7 @@ static bool ImplCopyImage( BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuf
// -----------------------------------------------------------------------
-template <ULONG DSTFMT,ULONG SRCFMT>
+template <sal_uLong DSTFMT,sal_uLong SRCFMT>
bool ImplConvertToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine,
BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuffer )
{
@@ -438,7 +438,7 @@ bool ImplConvertToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine,
// -----------------------------------------------------------------------
-template <ULONG SRCFMT>
+template <sal_uLong SRCFMT>
inline bool ImplConvertFromBitmap( BitmapBuffer& rDst, const BitmapBuffer& rSrc )
{
TrueColorPixelPtr<SRCFMT> aSrcType; aSrcType.SetRawPtr( rSrc.mpBits );
@@ -539,8 +539,8 @@ bool ImplFastBitmapConversion( BitmapBuffer& rDst, const BitmapBuffer& rSrc,
if( rDst.mnHeight < rTR.mnDestY + rTR.mnDestHeight )
return false;
- const ULONG nSrcFormat = rSrc.mnFormat & ~BMP_FORMAT_TOP_DOWN;
- const ULONG nDstFormat = rDst.mnFormat & ~BMP_FORMAT_TOP_DOWN;
+ const sal_uLong nSrcFormat = rSrc.mnFormat & ~BMP_FORMAT_TOP_DOWN;
+ const sal_uLong nDstFormat = rDst.mnFormat & ~BMP_FORMAT_TOP_DOWN;
// TODO: also implement conversions for 16bit colormasks with non-565 format
if( nSrcFormat & (BMP_FORMAT_16BIT_TC_LSB_MASK | BMP_FORMAT_16BIT_TC_MSB_MASK) )
@@ -620,7 +620,7 @@ bool ImplFastBitmapConversion( BitmapBuffer& rDst, const BitmapBuffer& rSrc,
// =======================================================================
-template <ULONG DSTFMT,ULONG SRCFMT> //,ULONG MSKFMT>
+template <sal_uLong DSTFMT,sal_uLong SRCFMT> //,sal_uLong MSKFMT>
bool ImplBlendToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine,
BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuffer,
const BitmapBuffer& rMskBuffer )
@@ -697,7 +697,7 @@ inline bool ImplBlendToBitmap<BMP_FORMAT_32BIT_TC_BGRA,BMP_FORMAT_32BIT_TC_BGRA>
// -----------------------------------------------------------------------
-template <ULONG SRCFMT>
+template <sal_uLong SRCFMT>
bool ImplBlendFromBitmap( BitmapBuffer& rDst, const BitmapBuffer& rSrc, const BitmapBuffer& rMsk )
{
TrueColorPixelPtr<SRCFMT> aSrcType; aSrcType.SetRawPtr( rSrc.mpBits );
@@ -815,8 +815,8 @@ bool ImplFastBitmapBlending( BitmapWriteAccess& rDstWA,
const BitmapBuffer& rSrc = *rSrcRA.ImplGetBitmapBuffer();
const BitmapBuffer& rMsk = *rMskRA.ImplGetBitmapBuffer();
- const ULONG nSrcFormat = rSrc.mnFormat & ~BMP_FORMAT_TOP_DOWN;
- const ULONG nDstFormat = rDst.mnFormat & ~BMP_FORMAT_TOP_DOWN;
+ const sal_uLong nSrcFormat = rSrc.mnFormat & ~BMP_FORMAT_TOP_DOWN;
+ const sal_uLong nDstFormat = rDst.mnFormat & ~BMP_FORMAT_TOP_DOWN;
// accelerated conversions for 16bit colormasks with non-565 format are not yet implemented
if( nSrcFormat & (BMP_FORMAT_16BIT_TC_LSB_MASK | BMP_FORMAT_16BIT_TC_MSB_MASK) )
@@ -889,18 +889,18 @@ bool ImplFastEraseBitmap( BitmapBuffer& rDst, const BitmapColor& rColor )
if( bDisableFastBitops )
return false;
- const ULONG nDstFormat = rDst.mnFormat & ~BMP_FORMAT_TOP_DOWN;
+ const sal_uLong nDstFormat = rDst.mnFormat & ~BMP_FORMAT_TOP_DOWN;
// erasing a bitmap is often just a byte-wise memory fill
bool bByteFill = true;
- BYTE nFillByte;
+ sal_uInt8 nFillByte;
switch( nDstFormat )
{
case BMP_FORMAT_1BIT_MSB_PAL:
case BMP_FORMAT_1BIT_LSB_PAL:
nFillByte = rColor.GetIndex();
- nFillByte = static_cast<BYTE>( -(nFillByte & 1) ); // 0x00 or 0xFF
+ nFillByte = static_cast<sal_uInt8>( -(nFillByte & 1) ); // 0x00 or 0xFF
break;
case BMP_FORMAT_4BIT_MSN_PAL:
case BMP_FORMAT_4BIT_LSN_PAL:
diff --git a/vcl/source/gdi/cvtgrf.cxx b/vcl/source/gdi/cvtgrf.cxx
index 4b2522601c7b..261781ebcf50 100644
--- a/vcl/source/gdi/cvtgrf.cxx
+++ b/vcl/source/gdi/cvtgrf.cxx
@@ -56,10 +56,10 @@ GraphicConverter::~GraphicConverter()
// ------------------------------------------------------------------------
-ULONG GraphicConverter::ImplConvert( ULONG nInFormat, void* pInBuffer, ULONG nInBufSize,
- void** ppOutBuffer, ULONG nOutFormat )
+sal_uLong GraphicConverter::ImplConvert( sal_uLong nInFormat, void* pInBuffer, sal_uLong nInBufSize,
+ void** ppOutBuffer, sal_uLong nOutFormat )
{
- ULONG nRetBufSize = 0UL;
+ sal_uLong nRetBufSize = 0UL;
if( ( nInFormat != nOutFormat ) && pInBuffer )
{
@@ -68,7 +68,7 @@ ULONG GraphicConverter::ImplConvert( ULONG nInFormat, void* pInBuffer, ULONG nIn
SvMemoryStream aIStm;
Graphic aGraphic;
- aIStm.SetBuffer( (char*) pInBuffer, nInBufSize, FALSE, nInBufSize );
+ aIStm.SetBuffer( (char*) pInBuffer, nInBufSize, sal_False, nInBufSize );
aIStm >> aGraphic;
if( !aIStm.GetError() )
@@ -81,7 +81,7 @@ ULONG GraphicConverter::ImplConvert( ULONG nInFormat, void* pInBuffer, ULONG nIn
{
nRetBufSize = aOStm.Seek( STREAM_SEEK_TO_END );
*ppOutBuffer = (void*) aOStm.GetData();
- aOStm.ObjectOwnsMemory( FALSE );
+ aOStm.ObjectOwnsMemory( sal_False );
}
delete mpConvertData;
@@ -92,7 +92,7 @@ ULONG GraphicConverter::ImplConvert( ULONG nInFormat, void* pInBuffer, ULONG nIn
{
SvMemoryStream aIStm;
- aIStm.SetBuffer( (char*) pInBuffer, nInBufSize, FALSE, nInBufSize );
+ aIStm.SetBuffer( (char*) pInBuffer, nInBufSize, sal_False, nInBufSize );
mpConvertData = new ConvertData( Graphic(), aIStm, nInFormat );
if( maFilterHdl.IsSet() && maFilterHdl.Call( mpConvertData ) )
@@ -118,7 +118,7 @@ ULONG GraphicConverter::ImplConvert( ULONG nInFormat, void* pInBuffer, ULONG nIn
{
nRetBufSize = aOStm.Seek( STREAM_SEEK_TO_END );
*ppOutBuffer = (void*) aOStm.GetData();
- aOStm.ObjectOwnsMemory( FALSE );
+ aOStm.ObjectOwnsMemory( sal_False );
}
}
@@ -132,10 +132,10 @@ ULONG GraphicConverter::ImplConvert( ULONG nInFormat, void* pInBuffer, ULONG nIn
// ------------------------------------------------------------------------
-ULONG GraphicConverter::Import( SvStream& rIStm, Graphic& rGraphic, ULONG nFormat )
+sal_uLong GraphicConverter::Import( SvStream& rIStm, Graphic& rGraphic, sal_uLong nFormat )
{
GraphicConverter* pCvt = ImplGetSVData()->maGDIData.mpGrfConverter;
- ULONG nRet = ERRCODE_IO_GENERAL;
+ sal_uLong nRet = ERRCODE_IO_GENERAL;
if( pCvt && pCvt->GetFilterHdl().IsSet() )
{
@@ -155,10 +155,10 @@ ULONG GraphicConverter::Import( SvStream& rIStm, Graphic& rGraphic, ULONG nForma
// ------------------------------------------------------------------------
-ULONG GraphicConverter::Export( SvStream& rOStm, const Graphic& rGraphic, ULONG nFormat )
+sal_uLong GraphicConverter::Export( SvStream& rOStm, const Graphic& rGraphic, sal_uLong nFormat )
{
GraphicConverter* pCvt = ImplGetSVData()->maGDIData.mpGrfConverter;
- ULONG nRet = ERRCODE_IO_GENERAL;
+ sal_uLong nRet = ERRCODE_IO_GENERAL;
if( pCvt && pCvt->GetFilterHdl().IsSet() )
{
diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx
index 93883f8b5839..2d9fbef36e44 100644
--- a/vcl/source/gdi/cvtsvm.cxx
+++ b/vcl/source/gdi/cvtsvm.cxx
@@ -75,12 +75,12 @@ void ImplWriteRect( SvStream& rOStm, const Rectangle& rRect )
void ImplReadPoly( SvStream& rIStm, Polygon& rPoly )
{
- INT32 nSize;
+ sal_Int32 nSize;
rIStm >> nSize;
- rPoly = Polygon( (USHORT) nSize );
+ rPoly = Polygon( (sal_uInt16) nSize );
- for( USHORT i = 0; i < (USHORT) nSize; i++ )
+ for( sal_uInt16 i = 0; i < (sal_uInt16) nSize; i++ )
rIStm >> rPoly[ i ];
}
@@ -89,11 +89,11 @@ void ImplReadPoly( SvStream& rIStm, Polygon& rPoly )
void ImplReadPolyPoly( SvStream& rIStm, PolyPolygon& rPolyPoly )
{
Polygon aPoly;
- INT32 nPolyCount;
+ sal_Int32 nPolyCount;
rIStm >> nPolyCount;
- for( USHORT i = 0; i < (USHORT) nPolyCount; i++ )
+ for( sal_uInt16 i = 0; i < (sal_uInt16) nPolyCount; i++ )
{
ImplReadPoly( rIStm, aPoly );
rPolyPoly.Insert( aPoly );
@@ -104,16 +104,16 @@ void ImplReadPolyPoly( SvStream& rIStm, PolyPolygon& rPolyPoly )
void ImplWritePolyPolyAction( SvStream& rOStm, const PolyPolygon& rPolyPoly )
{
- const USHORT nPoly = rPolyPoly.Count();
- USHORT nPoints = 0;
- USHORT n;
+ const sal_uInt16 nPoly = rPolyPoly.Count();
+ sal_uInt16 nPoints = 0;
+ sal_uInt16 n;
for( n = 0; n < nPoly; n++ )
- nPoints = sal::static_int_cast<USHORT>(nPoints + rPolyPoly[ n ].GetSize());
+ nPoints = sal::static_int_cast<sal_uInt16>(nPoints + rPolyPoly[ n ].GetSize());
- rOStm << (INT16) GDI_POLYPOLYGON_ACTION;
- rOStm << (INT32) ( 8 + ( nPoly << 2 ) + ( nPoints << 3 ) );
- rOStm << (INT32) nPoly;
+ rOStm << (sal_Int16) GDI_POLYPOLYGON_ACTION;
+ rOStm << (sal_Int32) ( 8 + ( nPoly << 2 ) + ( nPoints << 3 ) );
+ rOStm << (sal_Int32) nPoly;
for( n = 0; n < nPoly; n++ )
{
@@ -122,11 +122,11 @@ void ImplWritePolyPolyAction( SvStream& rOStm, const PolyPolygon& rPolyPoly )
// a polygon representing the curve as good as possible
Polygon aSimplePoly;
rPolyPoly[n].AdaptiveSubdivide(aSimplePoly);
- const USHORT nSize(aSimplePoly.GetSize());
+ const sal_uInt16 nSize(aSimplePoly.GetSize());
- rOStm << (INT32) nSize;
+ rOStm << (sal_Int32) nSize;
- for( USHORT j = 0; j < nSize; j++ )
+ for( sal_uInt16 j = 0; j < nSize; j++ )
rOStm << aSimplePoly[ j ];
}
}
@@ -135,26 +135,26 @@ void ImplWritePolyPolyAction( SvStream& rOStm, const PolyPolygon& rPolyPoly )
void ImplReadColor( SvStream& rIStm, Color& rColor )
{
- INT16 nVal;
+ sal_Int16 nVal;
- rIStm >> nVal; rColor.SetRed( sal::static_int_cast<UINT8>((USHORT)nVal >> 8) );
- rIStm >> nVal; rColor.SetGreen( sal::static_int_cast<UINT8>((USHORT)nVal >> 8) );
- rIStm >> nVal; rColor.SetBlue( sal::static_int_cast<UINT8>((USHORT)nVal >> 8) );
+ rIStm >> nVal; rColor.SetRed( sal::static_int_cast<sal_uInt8>((sal_uInt16)nVal >> 8) );
+ rIStm >> nVal; rColor.SetGreen( sal::static_int_cast<sal_uInt8>((sal_uInt16)nVal >> 8) );
+ rIStm >> nVal; rColor.SetBlue( sal::static_int_cast<sal_uInt8>((sal_uInt16)nVal >> 8) );
}
// ------------------------------------------------------------------------
void ImplWriteColor( SvStream& rOStm, const Color& rColor )
{
- INT16 nVal;
+ sal_Int16 nVal;
- nVal = ( (INT16) rColor.GetRed() << 8 ) | rColor.GetRed();
+ nVal = ( (sal_Int16) rColor.GetRed() << 8 ) | rColor.GetRed();
rOStm << nVal;
- nVal = ( (INT16) rColor.GetGreen() << 8 ) | rColor.GetGreen();
+ nVal = ( (sal_Int16) rColor.GetGreen() << 8 ) | rColor.GetGreen();
rOStm << nVal;
- nVal = ( (INT16) rColor.GetBlue() << 8 ) | rColor.GetBlue();
+ nVal = ( (sal_Int16) rColor.GetBlue() << 8 ) | rColor.GetBlue();
rOStm << nVal;
}
@@ -163,11 +163,11 @@ void ImplWriteColor( SvStream& rOStm, const Color& rColor )
void ImplReadMapMode( SvStream& rIStm, MapMode& rMapMode )
{
Point aOrg;
- INT32 nXNum;
- INT32 nXDenom;
- INT32 nYNum;
- INT32 nYDenom;
- INT16 nUnit;
+ sal_Int32 nXNum;
+ sal_Int32 nXDenom;
+ sal_Int32 nYNum;
+ sal_Int32 nYDenom;
+ sal_Int16 nUnit;
rIStm >> nUnit >> aOrg >> nXNum >> nXDenom >> nYNum >> nYDenom;
rMapMode = MapMode( (MapUnit) nUnit, aOrg, Fraction( nXNum, nXDenom ), Fraction( nYNum, nYDenom ) );
@@ -177,39 +177,39 @@ void ImplReadMapMode( SvStream& rIStm, MapMode& rMapMode )
void ImplWriteMapMode( SvStream& rOStm, const MapMode& rMapMode )
{
- rOStm << (INT16) rMapMode.GetMapUnit();
+ rOStm << (sal_Int16) rMapMode.GetMapUnit();
rOStm << rMapMode.GetOrigin();
- rOStm << (INT32) rMapMode.GetScaleX().GetNumerator();
- rOStm << (INT32) rMapMode.GetScaleX().GetDenominator();
- rOStm << (INT32) rMapMode.GetScaleY().GetNumerator();
- rOStm << (INT32) rMapMode.GetScaleY().GetDenominator();
+ rOStm << (sal_Int32) rMapMode.GetScaleX().GetNumerator();
+ rOStm << (sal_Int32) rMapMode.GetScaleX().GetDenominator();
+ rOStm << (sal_Int32) rMapMode.GetScaleY().GetNumerator();
+ rOStm << (sal_Int32) rMapMode.GetScaleY().GetDenominator();
}
// ------------------------------------------------------------------------
void ImplWritePushAction( SvStream& rOStm )
{
- rOStm << (INT16) GDI_PUSH_ACTION;
- rOStm << (INT32) 4;
+ rOStm << (sal_Int16) GDI_PUSH_ACTION;
+ rOStm << (sal_Int32) 4;
}
// ------------------------------------------------------------------------
void ImplWritePopAction( SvStream& rOStm )
{
- rOStm << (INT16) GDI_POP_ACTION;
- rOStm << (INT32) 4;
+ rOStm << (sal_Int16) GDI_POP_ACTION;
+ rOStm << (sal_Int32) 4;
}
// ------------------------------------------------------------------------
-void ImplWriteLineColor( SvStream& rOStm, const Color& rColor, INT16 nStyle, INT32 nWidth = 0L )
+void ImplWriteLineColor( SvStream& rOStm, const Color& rColor, sal_Int16 nStyle, sal_Int32 nWidth = 0L )
{
if( rColor.GetTransparency() > 127 )
nStyle = 0;
- rOStm << (INT16) GDI_PEN_ACTION;
- rOStm << (INT32) 16;
+ rOStm << (sal_Int16) GDI_PEN_ACTION;
+ rOStm << (sal_Int32) 16;
ImplWriteColor( rOStm, rColor );
rOStm << nWidth;
rOStm << nStyle;
@@ -217,10 +217,10 @@ void ImplWriteLineColor( SvStream& rOStm, const Color& rColor, INT16 nStyle, INT
// ------------------------------------------------------------------------
-void ImplWriteFillColor( SvStream& rOStm, const Color& rColor, INT16 nStyle )
+void ImplWriteFillColor( SvStream& rOStm, const Color& rColor, sal_Int16 nStyle )
{
- rOStm << (INT16) GDI_FILLBRUSH_ACTION;
- rOStm << (INT32) 20;
+ rOStm << (sal_Int16) GDI_FILLBRUSH_ACTION;
+ rOStm << (sal_Int32) 20;
ImplWriteColor( rOStm, rColor );
if( rColor.GetTransparency() > 127 )
@@ -230,13 +230,13 @@ void ImplWriteFillColor( SvStream& rOStm, const Color& rColor, INT16 nStyle )
{
ImplWriteColor( rOStm, COL_WHITE );
rOStm << nStyle;
- rOStm << (INT16) 1;
+ rOStm << (sal_Int16) 1;
}
else
{
ImplWriteColor( rOStm, COL_BLACK );
rOStm << nStyle;
- rOStm << (INT16) 0;
+ rOStm << (sal_Int16) 0;
}
}
@@ -275,24 +275,24 @@ void ImplWriteFont( SvStream& rOStm, const Font& rFont,
break;
}
- rOStm << (INT16) GDI_FONT_ACTION;
- rOStm << (INT32) 78;
+ rOStm << (sal_Int16) GDI_FONT_ACTION;
+ rOStm << (sal_Int32) 78;
rActualCharSet = GetStoreCharSet( rFont.GetCharSet() );
ImplWriteColor( rOStm, rFont.GetColor() );
ImplWriteColor( rOStm, rFont.GetFillColor() );
rOStm.Write( aName, 32 );
rOStm << rFont.GetSize();
- rOStm << (INT16) 0; // no character orientation anymore
- rOStm << (INT16) rFont.GetOrientation();
- rOStm << (INT16) rActualCharSet;
- rOStm << (INT16) rFont.GetFamily();
- rOStm << (INT16) rFont.GetPitch();
- rOStm << (INT16) rFont.GetAlign();
- rOStm << (INT16) nWeight;
- rOStm << (INT16) rFont.GetUnderline();
- rOStm << (INT16) rFont.GetStrikeout();
- rOStm << (BOOL) ( rFont.GetItalic() != ITALIC_NONE );
+ rOStm << (sal_Int16) 0; // no character orientation anymore
+ rOStm << (sal_Int16) rFont.GetOrientation();
+ rOStm << (sal_Int16) rActualCharSet;
+ rOStm << (sal_Int16) rFont.GetFamily();
+ rOStm << (sal_Int16) rFont.GetPitch();
+ rOStm << (sal_Int16) rFont.GetAlign();
+ rOStm << (sal_Int16) nWeight;
+ rOStm << (sal_Int16) rFont.GetUnderline();
+ rOStm << (sal_Int16) rFont.GetStrikeout();
+ rOStm << (sal_Bool) ( rFont.GetItalic() != ITALIC_NONE );
rOStm << rFont.IsOutline();
rOStm << rFont.IsShadow();
rOStm << rFont.IsTransparent();
@@ -302,9 +302,9 @@ void ImplWriteFont( SvStream& rOStm, const Font& rFont,
// ------------------------------------------------------------------------
-void ImplWriteRasterOpAction( SvStream& rOStm, INT16 nRasterOp )
+void ImplWriteRasterOpAction( SvStream& rOStm, sal_Int16 nRasterOp )
{
- rOStm << (INT16) GDI_RASTEROP_ACTION << (INT32) 6 << nRasterOp;
+ rOStm << (sal_Int16) GDI_RASTEROP_ACTION << (sal_Int32) 6 << nRasterOp;
}
// ------------------------------------------------------------------------
@@ -356,12 +356,12 @@ void ImplReadUnicodeComment( sal_uInt32 nStrmPos, SvStream& rIStm, String& rStri
// ------------------------------------------------------------------------
-void ImplSkipActions( SvStream& rIStm, ULONG nSkipCount )
+void ImplSkipActions( SvStream& rIStm, sal_uLong nSkipCount )
{
- INT32 nActionSize;
- INT16 nType;
+ sal_Int32 nActionSize;
+ sal_Int16 nType;
- for( ULONG i = 0UL; i < nSkipCount; i++ )
+ for( sal_uLong i = 0UL; i < nSkipCount; i++ )
{
rIStm >> nType >> nActionSize;
rIStm.SeekRel( nActionSize - 4L );
@@ -400,7 +400,7 @@ bool ImplWriteExtendedPolyPolygonAction(SvStream& rOStm, const PolyPolygon& rPol
if((bOnlyWhenCurve && nAllFlagCount) || (!bOnlyWhenCurve && nAllPointCount))
{
- rOStm << (INT16) GDI_EXTENDEDPOLYGON_ACTION;
+ rOStm << (sal_Int16) GDI_EXTENDEDPOLYGON_ACTION;
const sal_Int32 nActionSize(
4 + // Action size
@@ -429,16 +429,16 @@ bool ImplWriteExtendedPolyPolygonAction(SvStream& rOStm, const PolyPolygon& rPol
if(rCandidate.HasFlags())
{
- rOStm << (BYTE)true;
+ rOStm << (sal_uInt8)true;
for(sal_uInt16 c(0); c < nPointCount; c++)
{
- rOStm << (BYTE)rCandidate.GetFlags(c);
+ rOStm << (sal_uInt8)rCandidate.GetFlags(c);
}
}
else
{
- rOStm << (BYTE)false;
+ rOStm << (sal_uInt8)false;
}
}
}
@@ -471,12 +471,12 @@ void ImplReadExtendedPolyPolygonAction(SvStream& rIStm, PolyPolygon& rPolyPoly)
rIStm >> aCandidate[b];
}
- BYTE bHasFlags(false);
+ sal_uInt8 bHasFlags(false);
rIStm >> bHasFlags;
if(bHasFlags)
{
- BYTE aPolyFlags(0);
+ sal_uInt8 aPolyFlags(0);
for(sal_uInt16 c(0); c < nPointCount; c++)
{
@@ -494,7 +494,7 @@ void ImplReadExtendedPolyPolygonAction(SvStream& rIStm, PolyPolygon& rPolyPoly)
// - SVMConverter -
// ----------------
-SVMConverter::SVMConverter( SvStream& rStm, GDIMetaFile& rMtf, ULONG nConvertMode )
+SVMConverter::SVMConverter( SvStream& rStm, GDIMetaFile& rMtf, sal_uLong nConvertMode )
{
if( !rStm.GetError() )
{
@@ -509,15 +509,15 @@ SVMConverter::SVMConverter( SvStream& rStm, GDIMetaFile& rMtf, ULONG nConvertMod
void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
{
- const ULONG nPos = rIStm.Tell();
- const USHORT nOldFormat = rIStm.GetNumberFormatInt();
+ const sal_uLong nPos = rIStm.Tell();
+ const sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
char aCode[ 5 ];
Size aPrefSz;
- INT16 nSize;
- INT16 nVersion;
+ sal_Int16 nSize;
+ sal_Int16 nVersion;
// read header
rIStm.Read( (char*) &aCode, sizeof( aCode ) ); // Kennung
@@ -541,7 +541,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
Stack aLIStack;
VirtualDevice aFontVDev;
rtl_TextEncoding eActualCharSet = gsl_getSystemTextEncoding();
- BOOL bFatLine = FALSE;
+ sal_Bool bFatLine = sal_False;
// TODO: fix reindentation below if you can accept being blamed by the SCM
MapMode aMapMode;
@@ -550,12 +550,12 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
Point aPt, aPt1;
Size aSz;
Color aActionColor;
- INT32 nTmp, nTmp1, nActionSize;
- INT32 nActions;
- INT16 nType;
+ sal_Int32 nTmp, nTmp1, nActionSize;
+ sal_Int32 nActions;
+ sal_Int16 nType;
sal_uInt32 nUnicodeCommentStreamPos = 0;
- INT32 nUnicodeCommentActionNumber = 0;
+ sal_Int32 nUnicodeCommentActionNumber = 0;
ImplReadMapMode( rIStm, aMapMode ); // MapMode
rIStm >> nActions; // Action count
@@ -564,7 +564,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
rMtf.SetPrefMapMode( aMapMode );
sal_uInt32 nLastPolygonAction(0);
- for( INT32 i = 0L; i < nActions; i++ )
+ for( sal_Int32 i = 0L; i < nActions; i++ )
{
rIStm >> nType;
sal_Int32 nActBegin = rIStm.Tell();
@@ -598,7 +598,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case (GDI_LINEJOIN_ACTION) :
{
- INT16 nLineJoin(0);
+ sal_Int16 nLineJoin(0);
rIStm >> nLineJoin;
aLineInfo.SetLineJoin((basegfx::B2DLineJoin)nLineJoin);
}
@@ -606,8 +606,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case (GDI_LINEDASHDOT_ACTION) :
{
- INT16 a(0);
- INT32 b(0);
+ sal_Int16 a(0);
+ sal_Int32 b(0);
rIStm >> a; aLineInfo.SetDashCount(a);
rIStm >> b; aLineInfo.SetDashLen(b);
@@ -715,7 +715,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
const Polygon aPoly( aRect.Center(), aRect.GetWidth() >> 1, aRect.GetHeight() >> 1 );
rMtf.AddAction( new MetaPushAction( PUSH_LINECOLOR ) );
- rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, FALSE ) );
+ rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, sal_False ) );
rMtf.AddAction( new MetaPolygonAction( aPoly ) );
rMtf.AddAction( new MetaPopAction() );
rMtf.AddAction( new MetaPolyLineAction( aPoly, aLineInfo ) );
@@ -735,7 +735,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
const Polygon aPoly( aRect, aPt, aPt1, POLY_ARC );
rMtf.AddAction( new MetaPushAction( PUSH_LINECOLOR ) );
- rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, FALSE ) );
+ rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, sal_False ) );
rMtf.AddAction( new MetaPolygonAction( aPoly ) );
rMtf.AddAction( new MetaPopAction() );
rMtf.AddAction( new MetaPolyLineAction( aPoly, aLineInfo ) );
@@ -755,7 +755,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
const Polygon aPoly( aRect, aPt, aPt1, POLY_PIE );
rMtf.AddAction( new MetaPushAction( PUSH_LINECOLOR ) );
- rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, FALSE ) );
+ rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, sal_False ) );
rMtf.AddAction( new MetaPolygonAction( aPoly ) );
rMtf.AddAction( new MetaPopAction() );
rMtf.AddAction( new MetaPolyLineAction( aPoly, aLineInfo ) );
@@ -795,7 +795,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
if( bFatLine )
{
rMtf.AddAction( new MetaPushAction( PUSH_LINECOLOR ) );
- rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, FALSE ) );
+ rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, sal_False ) );
rMtf.AddAction( new MetaPolygonAction( aActionPoly ) );
rMtf.AddAction( new MetaPopAction() );
rMtf.AddAction( new MetaPolyLineAction( aActionPoly, aLineInfo ) );
@@ -817,11 +817,11 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
if( bFatLine )
{
rMtf.AddAction( new MetaPushAction( PUSH_LINECOLOR ) );
- rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, FALSE ) );
+ rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, sal_False ) );
rMtf.AddAction( new MetaPolyPolygonAction( aPolyPoly ) );
rMtf.AddAction( new MetaPopAction() );
- for( USHORT nPoly = 0, nCount = aPolyPoly.Count(); nPoly < nCount; nPoly++ )
+ for( sal_uInt16 nPoly = 0, nCount = aPolyPoly.Count(); nPoly < nCount; nPoly++ )
rMtf.AddAction( new MetaPolyLineAction( aPolyPoly[ nPoly ], aLineInfo ) );
}
else
@@ -836,10 +836,10 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
{
Font aFont;
char aName[ 32 ];
- INT32 nWidth, nHeight;
- INT16 nCharSet, nFamily, nPitch, nAlign, nWeight, nUnderline, nStrikeout;
- INT16 nCharOrient, nLineOrient;
- BOOL bItalic, bOutline, bShadow, bTransparent;
+ sal_Int32 nWidth, nHeight;
+ sal_Int16 nCharSet, nFamily, nPitch, nAlign, nWeight, nUnderline, nStrikeout;
+ sal_Int16 nCharOrient, nLineOrient;
+ sal_Bool bItalic, bOutline, bShadow, bTransparent;
ImplReadColor( rIStm, aActionColor ); aFont.SetColor( aActionColor );
ImplReadColor( rIStm, aActionColor ); aFont.SetFillColor( aActionColor );
@@ -882,16 +882,16 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_TEXT_ACTION ):
{
ByteString aByteStr;
- INT32 nIndex, nLen;
+ sal_Int32 nIndex, nLen;
rIStm >> aPt >> nIndex >> nLen >> nTmp;
if ( nTmp && ( static_cast< sal_uInt32 >( nTmp ) < ( SAL_MAX_UINT16 - 1 ) ) )
{
- rIStm.Read( aByteStr.AllocBuffer( (USHORT)nTmp ), nTmp + 1 );
+ rIStm.Read( aByteStr.AllocBuffer( (sal_uInt16)nTmp ), nTmp + 1 );
UniString aStr( aByteStr, eActualCharSet );
if ( nUnicodeCommentActionNumber == i )
ImplReadUnicodeComment( nUnicodeCommentStreamPos, rIStm, aStr );
- rMtf.AddAction( new MetaTextAction( aPt, aStr, (USHORT) nIndex, (USHORT) nLen ) );
+ rMtf.AddAction( new MetaTextAction( aPt, aStr, (sal_uInt16) nIndex, (sal_uInt16) nLen ) );
}
rIStm.Seek( nActBegin + nActionSize );
}
@@ -901,17 +901,17 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
{
ByteString aByteStr;
sal_Int32* pDXAry = NULL;
- INT32 nIndex, nLen, nAryLen;
+ sal_Int32 nIndex, nLen, nAryLen;
rIStm >> aPt >> nIndex >> nLen >> nTmp >> nAryLen;
if ( nTmp && ( static_cast< sal_uInt32 >( nTmp ) < ( SAL_MAX_UINT16 - 1 ) ) )
{
- rIStm.Read( aByteStr.AllocBuffer( (USHORT)nTmp ), nTmp + 1 );
+ rIStm.Read( aByteStr.AllocBuffer( (sal_uInt16)nTmp ), nTmp + 1 );
UniString aStr( aByteStr, eActualCharSet );
if( nAryLen > 0L )
{
- INT32 nStrLen( aStr.Len() );
+ sal_Int32 nStrLen( aStr.Len() );
pDXAry = new sal_Int32[ Max( nAryLen, nStrLen ) ];
@@ -925,7 +925,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
{
sal_Int32* pTmpAry = new sal_Int32[nStrLen];
- aFontVDev.GetTextArray( aStr, pTmpAry, (USHORT) nIndex, (USHORT) nLen );
+ aFontVDev.GetTextArray( aStr, pTmpAry, (sal_uInt16) nIndex, (sal_uInt16) nLen );
// now, the difference between the
// last and the second last DX array
@@ -949,7 +949,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
}
if ( nUnicodeCommentActionNumber == i )
ImplReadUnicodeComment( nUnicodeCommentStreamPos, rIStm, aStr );
- rMtf.AddAction( new MetaTextArrayAction( aPt, aStr, pDXAry, (USHORT) nIndex, (USHORT) nLen ) );
+ rMtf.AddAction( new MetaTextArrayAction( aPt, aStr, pDXAry, (sal_uInt16) nIndex, (sal_uInt16) nLen ) );
if( pDXAry )
delete[] pDXAry;
@@ -961,16 +961,16 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_STRETCHTEXT_ACTION ):
{
ByteString aByteStr;
- INT32 nIndex, nLen, nWidth;
+ sal_Int32 nIndex, nLen, nWidth;
rIStm >> aPt >> nIndex >> nLen >> nTmp >> nWidth;
if ( nTmp && ( static_cast< sal_uInt32 >( nTmp ) < ( SAL_MAX_INT16 - 1 ) ) )
{
- rIStm.Read( aByteStr.AllocBuffer( (USHORT)nTmp ), nTmp + 1 );
+ rIStm.Read( aByteStr.AllocBuffer( (sal_uInt16)nTmp ), nTmp + 1 );
UniString aStr( aByteStr, eActualCharSet );
if ( nUnicodeCommentActionNumber == i )
ImplReadUnicodeComment( nUnicodeCommentStreamPos, rIStm, aStr );
- rMtf.AddAction( new MetaStretchTextAction( aPt, nWidth, aStr, (USHORT) nIndex, (USHORT) nLen ) );
+ rMtf.AddAction( new MetaStretchTextAction( aPt, nWidth, aStr, (sal_uInt16) nIndex, (sal_uInt16) nLen ) );
}
rIStm.Seek( nActBegin + nActionSize );
}
@@ -1006,8 +1006,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_PEN_ACTION ):
{
- INT32 nPenWidth;
- INT16 nPenStyle;
+ sal_Int32 nPenWidth;
+ sal_Int16 nPenStyle;
ImplReadColor( rIStm, aActionColor );
rIStm >> nPenWidth >> nPenStyle;
@@ -1022,7 +1022,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_FILLBRUSH_ACTION ):
{
- INT16 nBrushStyle;
+ sal_Int16 nBrushStyle;
ImplReadColor( rIStm, aActionColor );
rIStm.SeekRel( 6L );
@@ -1045,9 +1045,9 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_CLIPREGION_ACTION ):
{
Region aRegion;
- INT16 nRegType;
- INT16 bIntersect;
- BOOL bClip = FALSE;
+ sal_Int16 nRegType;
+ sal_Int16 bIntersect;
+ sal_Bool bClip = sal_False;
rIStm >> nRegType >> bIntersect;
ImplReadRect( rIStm, aRect );
@@ -1063,7 +1063,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
ImplReadRect( rIStm, aRegRect );
aRegion = Region( aRegRect );
- bClip = TRUE;
+ bClip = sal_True;
}
break;
@@ -1071,25 +1071,25 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
{
ImplReadPoly( rIStm, aActionPoly );
aRegion = Region( aActionPoly );
- bClip = TRUE;
+ bClip = sal_True;
}
break;
case( 3 ):
{
PolyPolygon aPolyPoly;
- INT32 nPolyCount;
+ sal_Int32 nPolyCount;
rIStm >> nPolyCount;
- for( USHORT j = 0; j < (USHORT) nPolyCount; j++ )
+ for( sal_uInt16 j = 0; j < (sal_uInt16) nPolyCount; j++ )
{
ImplReadPoly( rIStm, aActionPoly );
aPolyPoly.Insert( aActionPoly );
}
aRegion = Region( aPolyPoly );
- bClip = TRUE;
+ bClip = sal_True;
}
break;
}
@@ -1118,7 +1118,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_RASTEROP_ACTION ):
{
RasterOp eRasterOp;
- INT16 nRasterOp;
+ sal_Int16 nRasterOp;
rIStm >> nRasterOp;
@@ -1176,13 +1176,13 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
{
Color aStartCol;
Color aEndCol;
- INT16 nStyle;
- INT16 nAngle;
- INT16 nBorder;
- INT16 nOfsX;
- INT16 nOfsY;
- INT16 nIntensityStart;
- INT16 nIntensityEnd;
+ sal_Int16 nStyle;
+ sal_Int16 nAngle;
+ sal_Int16 nBorder;
+ sal_Int16 nOfsX;
+ sal_Int16 nOfsY;
+ sal_Int16 nIntensityStart;
+ sal_Int16 nIntensityEnd;
ImplReadRect( rIStm, aRect );
rIStm >> nStyle;
@@ -1205,8 +1205,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_TRANSPARENT_COMMENT ):
{
PolyPolygon aPolyPoly;
- INT32 nFollowingActionCount;
- INT16 nTrans;
+ sal_Int32 nFollowingActionCount;
+ sal_Int16 nTrans;
rIStm >> aPolyPoly >> nTrans >> nFollowingActionCount;
ImplSkipActions( rIStm, nFollowingActionCount );
@@ -1224,7 +1224,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
Point aPos;
Size aSize;
Gradient aGradient;
- INT32 nFollowingActionCount;
+ sal_Int32 nFollowingActionCount;
rIStm >> aMtf >> aPos >> aSize >> aGradient >> nFollowingActionCount;
ImplSkipActions( rIStm, nFollowingActionCount );
@@ -1240,7 +1240,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
{
PolyPolygon aPolyPoly;
Hatch aHatch;
- INT32 nFollowingActionCount;
+ sal_Int32 nFollowingActionCount;
rIStm >> aPolyPoly >> aHatch >> nFollowingActionCount;
ImplSkipActions( rIStm, nFollowingActionCount );
@@ -1255,8 +1255,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_REFPOINT_COMMENT ):
{
Point aRefPoint;
- BOOL bSet;
- INT32 nFollowingActionCount;
+ sal_Bool bSet;
+ sal_Int32 nFollowingActionCount;
rIStm >> aRefPoint >> bSet >> nFollowingActionCount;
ImplSkipActions( rIStm, nFollowingActionCount );
@@ -1277,8 +1277,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_TEXTLINECOLOR_COMMENT ):
{
Color aColor;
- BOOL bSet;
- INT32 nFollowingActionCount;
+ sal_Bool bSet;
+ sal_Int32 nFollowingActionCount;
rIStm >> aColor >> bSet >> nFollowingActionCount;
ImplSkipActions( rIStm, nFollowingActionCount );
@@ -1296,7 +1296,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
long nWidth;
sal_uInt32 nStrikeout;
sal_uInt32 nUnderline;
- INT32 nFollowingActionCount;
+ sal_Int32 nFollowingActionCount;
rIStm >> aStartPt >> nWidth >> nStrikeout >> nUnderline >> nFollowingActionCount;
ImplSkipActions( rIStm, nFollowingActionCount );
@@ -1315,7 +1315,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
{
PolyPolygon aPolyPoly;
Gradient aGradient;
- INT32 nFollowingActionCount;
+ sal_Int32 nFollowingActionCount;
rIStm >> aPolyPoly >> aGradient >> nFollowingActionCount;
ImplSkipActions( rIStm, nFollowingActionCount );
@@ -1332,14 +1332,14 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
ByteString aComment;
sal_Int32 nValue;
sal_uInt32 nDataSize;
- BYTE* pData;
- INT32 nFollowingActionCount;
+ sal_uInt8* pData;
+ sal_Int32 nFollowingActionCount;
rIStm >> aComment >> nValue >> nDataSize;
if( nDataSize )
{
- pData = new BYTE[ nDataSize ];
+ pData = new sal_uInt8[ nDataSize ];
rIStm.Read( pData, nDataSize );
}
else
@@ -1380,12 +1380,12 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
void SVMConverter::ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf )
{
- ULONG nCountPos;
+ sal_uLong nCountPos;
Font aSaveFont;
- const USHORT nOldFormat = rOStm.GetNumberFormatInt();
+ const sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt();
rtl_TextEncoding eActualCharSet = gsl_getSystemTextEncoding();
const Size aPrefSize( rMtf.GetPrefSize() );
- BOOL bRop_0_1 = FALSE;
+ sal_Bool bRop_0_1 = sal_False;
VirtualDevice aSaveVDev;
Color aLineCol( COL_BLACK );
Stack aLineColStack;
@@ -1394,18 +1394,18 @@ void SVMConverter::ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf )
//MagicCode schreiben
rOStm << "SVGDI"; // Kennung
- rOStm << (INT16) 42; // HeaderSize
- rOStm << (INT16) 200; // VERSION
- rOStm << (INT32) aPrefSize.Width();
- rOStm << (INT32) aPrefSize.Height();
+ rOStm << (sal_Int16) 42; // HeaderSize
+ rOStm << (sal_Int16) 200; // VERSION
+ rOStm << (sal_Int32) aPrefSize.Width();
+ rOStm << (sal_Int32) aPrefSize.Height();
ImplWriteMapMode( rOStm, rMtf.GetPrefMapMode() );
// ActionCount wird spaeter geschrieben
nCountPos = rOStm.Tell();
rOStm.SeekRel( 4L );
- const INT32 nActCount = ImplWriteActions( rOStm, rMtf, aSaveVDev, bRop_0_1, aLineCol, aLineColStack, eActualCharSet );
- const ULONG nActPos = rOStm.Tell();
+ const sal_Int32 nActCount = ImplWriteActions( rOStm, rMtf, aSaveVDev, bRop_0_1, aLineCol, aLineColStack, eActualCharSet );
+ const sal_uLong nActPos = rOStm.Tell();
rOStm.Seek( nCountPos );
rOStm << nActCount;
@@ -1419,13 +1419,13 @@ void SVMConverter::ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf )
// ------------------------------------------------------------------------
-ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
- VirtualDevice& rSaveVDev, BOOL& rRop_0_1,
+sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
+ VirtualDevice& rSaveVDev, sal_Bool& rRop_0_1,
Color& rLineCol, Stack& rLineColStack,
rtl_TextEncoding& rActualCharSet )
{
- ULONG nCount = 0;
- for( ULONG i = 0, nActionCount = rMtf.GetActionCount(); i < nActionCount; i++ )
+ sal_uLong nCount = 0;
+ for( sal_uLong i = 0, nActionCount = rMtf.GetActionCount(); i < nActionCount; i++ )
{
const MetaAction* pAction = rMtf.GetAction( i );
@@ -1435,8 +1435,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaPixelAction* pAct = (MetaPixelAction*) pAction;
- rOStm << (INT16) GDI_PIXEL_ACTION;
- rOStm << (INT32) 18;
+ rOStm << (sal_Int16) GDI_PIXEL_ACTION;
+ rOStm << (sal_Int32) 18;
rOStm << pAct->GetPoint();
ImplWriteColor( rOStm, pAct->GetColor() );
nCount++;
@@ -1447,8 +1447,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaPointAction* pAct = (MetaPointAction*) pAction;
- rOStm << (INT16) GDI_POINT_ACTION;
- rOStm << (INT32) 12;
+ rOStm << (sal_Int16) GDI_POINT_ACTION;
+ rOStm << (sal_Int32) 12;
rOStm << pAct->GetPoint();
nCount++;
}
@@ -1469,25 +1469,25 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
if(bLineJoin)
{
- rOStm << (INT16) GDI_LINEJOIN_ACTION;
- rOStm << (INT32) 6;
- rOStm << (INT16) rInfo.GetLineJoin();
+ rOStm << (sal_Int16) GDI_LINEJOIN_ACTION;
+ rOStm << (sal_Int32) 6;
+ rOStm << (sal_Int16) rInfo.GetLineJoin();
}
if(bLineDashDot)
{
- rOStm << (INT16) GDI_LINEDASHDOT_ACTION;
- rOStm << (INT32) 4 + 16;
- rOStm << (INT16)rInfo.GetDashCount();
- rOStm << (INT32)rInfo.GetDashLen();
- rOStm << (INT16)rInfo.GetDotCount();
- rOStm << (INT32)rInfo.GetDotLen();
- rOStm << (INT32)rInfo.GetDistance();
+ rOStm << (sal_Int16) GDI_LINEDASHDOT_ACTION;
+ rOStm << (sal_Int32) 4 + 16;
+ rOStm << (sal_Int16)rInfo.GetDashCount();
+ rOStm << (sal_Int32)rInfo.GetDashLen();
+ rOStm << (sal_Int16)rInfo.GetDotCount();
+ rOStm << (sal_Int32)rInfo.GetDotLen();
+ rOStm << (sal_Int32)rInfo.GetDistance();
}
}
- rOStm << (INT16) GDI_LINE_ACTION;
- rOStm << (INT32) 20;
+ rOStm << (sal_Int16) GDI_LINE_ACTION;
+ rOStm << (sal_Int32) 20;
rOStm << pAct->GetStartPoint();
rOStm << pAct->GetEndPoint();
nCount++;
@@ -1514,11 +1514,11 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaRectAction* pAct = (MetaRectAction*) pAction;
- rOStm << (INT16) GDI_RECT_ACTION;
- rOStm << (INT32) 28;
+ rOStm << (sal_Int16) GDI_RECT_ACTION;
+ rOStm << (sal_Int32) 28;
ImplWriteRect( rOStm, pAct->GetRect() );
- rOStm << (INT32) 0;
- rOStm << (INT32) 0;
+ rOStm << (sal_Int32) 0;
+ rOStm << (sal_Int32) 0;
nCount++;
}
break;
@@ -1527,11 +1527,11 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaRoundRectAction* pAct = (MetaRoundRectAction*) pAction;
- rOStm << (INT16) GDI_RECT_ACTION;
- rOStm << (INT32) 28;
+ rOStm << (sal_Int16) GDI_RECT_ACTION;
+ rOStm << (sal_Int32) 28;
ImplWriteRect( rOStm, pAct->GetRect() );
- rOStm << (INT32) pAct->GetHorzRound();
- rOStm << (INT32) pAct->GetVertRound();
+ rOStm << (sal_Int32) pAct->GetHorzRound();
+ rOStm << (sal_Int32) pAct->GetVertRound();
nCount++;
}
break;
@@ -1540,8 +1540,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaEllipseAction* pAct = (MetaEllipseAction*) pAction;
- rOStm << (INT16) GDI_ELLIPSE_ACTION;
- rOStm << (INT32) 20;
+ rOStm << (sal_Int16) GDI_ELLIPSE_ACTION;
+ rOStm << (sal_Int32) 20;
ImplWriteRect( rOStm, pAct->GetRect() );
nCount++;
}
@@ -1551,8 +1551,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaArcAction* pAct = (MetaArcAction*) pAction;
- rOStm << (INT16) GDI_ARC_ACTION;
- rOStm << (INT32) 36;
+ rOStm << (sal_Int16) GDI_ARC_ACTION;
+ rOStm << (sal_Int32) 36;
ImplWriteRect( rOStm, pAct->GetRect() );
rOStm << pAct->GetStartPoint();
rOStm << pAct->GetEndPoint();
@@ -1564,8 +1564,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaPieAction* pAct = (MetaPieAction*) pAction;
- rOStm << (INT16) GDI_PIE_ACTION;
- rOStm << (INT32) 36;
+ rOStm << (sal_Int16) GDI_PIE_ACTION;
+ rOStm << (sal_Int32) 36;
ImplWriteRect( rOStm, pAct->GetRect() );
rOStm << pAct->GetStartPoint();
rOStm << pAct->GetEndPoint();
@@ -1578,13 +1578,13 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
MetaChordAction* pAct = (MetaChordAction*) pAction;
Polygon aChordPoly( pAct->GetRect(), pAct->GetStartPoint(),
pAct->GetEndPoint(), POLY_CHORD );
- const USHORT nPoints = aChordPoly.GetSize();
+ const sal_uInt16 nPoints = aChordPoly.GetSize();
- rOStm << (INT16) GDI_POLYGON_ACTION;
- rOStm << (INT32) ( 8 + ( nPoints << 3 ) );
- rOStm << (INT32) nPoints;
+ rOStm << (sal_Int16) GDI_POLYGON_ACTION;
+ rOStm << (sal_Int32) ( 8 + ( nPoints << 3 ) );
+ rOStm << (sal_Int32) nPoints;
- for( USHORT n = 0; n < nPoints; n++ )
+ for( sal_uInt16 n = 0; n < nPoints; n++ )
rOStm << aChordPoly[ n ];
nCount++;
}
@@ -1600,7 +1600,7 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
Polygon aSimplePoly;
pAct->GetPolygon().AdaptiveSubdivide(aSimplePoly);
const LineInfo& rInfo = pAct->GetLineInfo();
- const USHORT nPoints(aSimplePoly.GetSize());
+ const sal_uInt16 nPoints(aSimplePoly.GetSize());
const bool bFatLine(!rInfo.IsDefault() && (LINE_NONE != rInfo.GetStyle()));
const bool bLineJoin(bFatLine && basegfx::B2DLINEJOIN_ROUND != rInfo.GetLineJoin());
const bool bLineDashDot(LINE_DASH == rInfo.GetStyle());
@@ -1612,28 +1612,28 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
if(bLineJoin)
{
- rOStm << (INT16) GDI_LINEJOIN_ACTION;
- rOStm << (INT32) 6;
- rOStm << (INT16) rInfo.GetLineJoin();
+ rOStm << (sal_Int16) GDI_LINEJOIN_ACTION;
+ rOStm << (sal_Int32) 6;
+ rOStm << (sal_Int16) rInfo.GetLineJoin();
}
}
if(bLineDashDot)
{
- rOStm << (INT16) GDI_LINEDASHDOT_ACTION;
- rOStm << (INT32) 4 + 16;
- rOStm << (INT16)rInfo.GetDashCount();
- rOStm << (INT32)rInfo.GetDashLen();
- rOStm << (INT16)rInfo.GetDotCount();
- rOStm << (INT32)rInfo.GetDotLen();
- rOStm << (INT32)rInfo.GetDistance();
+ rOStm << (sal_Int16) GDI_LINEDASHDOT_ACTION;
+ rOStm << (sal_Int32) 4 + 16;
+ rOStm << (sal_Int16)rInfo.GetDashCount();
+ rOStm << (sal_Int32)rInfo.GetDashLen();
+ rOStm << (sal_Int16)rInfo.GetDotCount();
+ rOStm << (sal_Int32)rInfo.GetDotLen();
+ rOStm << (sal_Int32)rInfo.GetDistance();
}
- rOStm << (INT16) GDI_POLYLINE_ACTION;
- rOStm << (INT32) ( 8 + ( nPoints << 3 ) );
- rOStm << (INT32) nPoints;
+ rOStm << (sal_Int16) GDI_POLYLINE_ACTION;
+ rOStm << (sal_Int32) ( 8 + ( nPoints << 3 ) );
+ rOStm << (sal_Int32) nPoints;
- for( USHORT n = 0; n < nPoints; n++ )
+ for( sal_uInt16 n = 0; n < nPoints; n++ )
{
rOStm << aSimplePoly[ n ];
}
@@ -1672,13 +1672,13 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
// a polygon representing the curve as good as possible
Polygon aSimplePoly;
pAct->GetPolygon().AdaptiveSubdivide(aSimplePoly);
- const USHORT nPoints(aSimplePoly.GetSize());
+ const sal_uInt16 nPoints(aSimplePoly.GetSize());
- rOStm << (INT16) GDI_POLYGON_ACTION;
- rOStm << (INT32) ( 8 + ( nPoints << 3 ) );
- rOStm << (INT32) nPoints;
+ rOStm << (sal_Int16) GDI_POLYGON_ACTION;
+ rOStm << (sal_Int32) ( 8 + ( nPoints << 3 ) );
+ rOStm << (sal_Int32) nPoints;
- for( USHORT n = 0; n < nPoints; n++ )
+ for( sal_uInt16 n = 0; n < nPoints; n++ )
rOStm << aSimplePoly[ n ];
nCount++;
@@ -1709,17 +1709,17 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
MetaTextAction* pAct = (MetaTextAction*) pAction;
String aUniText( pAct->GetText() );
ByteString aText( aUniText, rActualCharSet );
- const ULONG nStrLen = aText.Len();
+ const sal_uLong nStrLen = aText.Len();
if ( ImplWriteUnicodeComment( rOStm, aUniText ) )
nCount++;
- rOStm << (INT16) GDI_TEXT_ACTION;
- rOStm << (INT32) ( 24 + ( nStrLen + 1 ) );
+ rOStm << (sal_Int16) GDI_TEXT_ACTION;
+ rOStm << (sal_Int32) ( 24 + ( nStrLen + 1 ) );
rOStm << pAct->GetPoint();
- rOStm << (INT32) pAct->GetIndex();
- rOStm << (INT32) pAct->GetLen();
- rOStm << (INT32) nStrLen;
+ rOStm << (sal_Int32) pAct->GetIndex();
+ rOStm << (sal_Int32) pAct->GetLen();
+ rOStm << (sal_Int32) nStrLen;
rOStm.Write( aText.GetBuffer(), nStrLen + 1 );
nCount++;
}
@@ -1730,9 +1730,9 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
MetaTextArrayAction* pAct = (MetaTextArrayAction*)pAction;
ByteString aText( pAct->GetText(), rActualCharSet );
String aUniText( pAct->GetText(), pAct->GetIndex(), pAct->GetLen() );
- ULONG nAryLen;
- ULONG nLen = pAct->GetLen();
- const ULONG nTextLen = aText.Len();
+ sal_uLong nAryLen;
+ sal_uLong nLen = pAct->GetLen();
+ const sal_uLong nTextLen = aText.Len();
sal_Int32* pDXArray = pAct->GetDXArray();
if ( ImplWriteUnicodeComment( rOStm, aUniText ) )
@@ -1751,17 +1751,17 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
else
nAryLen = nLen; // #105987# Write out all of DX array
- rOStm << (INT16) GDI_TEXTARRAY_ACTION;
- rOStm << (INT32) ( 28 + ( nLen + 1 ) + ( nAryLen * 4 ) );
+ rOStm << (sal_Int16) GDI_TEXTARRAY_ACTION;
+ rOStm << (sal_Int32) ( 28 + ( nLen + 1 ) + ( nAryLen * 4 ) );
rOStm << pAct->GetPoint();
- rOStm << (INT32) 0;
- rOStm << (INT32) nLen;
- rOStm << (INT32) nLen;
- rOStm << (INT32) nAryLen;
+ rOStm << (sal_Int32) 0;
+ rOStm << (sal_Int32) nLen;
+ rOStm << (sal_Int32) nLen;
+ rOStm << (sal_Int32) nAryLen;
rOStm.Write( aText.GetBuffer()+pAct->GetIndex(), nLen + 1 );
- for( ULONG n = 0UL ; n < nAryLen; n++ )
- rOStm << (INT32) pDXArray[ n ];
+ for( sal_uLong n = 0UL ; n < nAryLen; n++ )
+ rOStm << (sal_Int32) pDXArray[ n ];
nCount++;
}
@@ -1772,18 +1772,18 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
MetaStretchTextAction* pAct = (MetaStretchTextAction*) pAction;
String aUniText( pAct->GetText() );
ByteString aText( aUniText, rActualCharSet );
- const ULONG nStrLen = aText.Len();
+ const sal_uLong nStrLen = aText.Len();
if ( ImplWriteUnicodeComment( rOStm, aUniText ) )
nCount++;
- rOStm << (INT16) GDI_STRETCHTEXT_ACTION;
- rOStm << (INT32) ( 28 + ( nStrLen + 1 ) );
+ rOStm << (sal_Int16) GDI_STRETCHTEXT_ACTION;
+ rOStm << (sal_Int32) ( 28 + ( nStrLen + 1 ) );
rOStm << pAct->GetPoint();
- rOStm << (INT32) pAct->GetIndex();
- rOStm << (INT32) pAct->GetLen();
- rOStm << (INT32) nStrLen;
- rOStm << (INT32) pAct->GetWidth();
+ rOStm << (sal_Int32) pAct->GetIndex();
+ rOStm << (sal_Int32) pAct->GetLen();
+ rOStm << (sal_Int32) nStrLen;
+ rOStm << (sal_Int32) pAct->GetWidth();
rOStm.Write( aText.GetBuffer(), nStrLen + 1 );
nCount++;
}
@@ -1793,8 +1793,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaBmpAction* pAct = (MetaBmpAction*) pAction;
- rOStm << (INT16) GDI_BITMAP_ACTION;
- rOStm << (INT32) 12;
+ rOStm << (sal_Int16) GDI_BITMAP_ACTION;
+ rOStm << (sal_Int32) 12;
rOStm << pAct->GetPoint();
rOStm << pAct->GetBitmap();
nCount++;
@@ -1805,8 +1805,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaBmpScaleAction* pAct = (MetaBmpScaleAction*) pAction;
- rOStm << (INT16) GDI_BITMAPSCALE_ACTION;
- rOStm << (INT32) 20;
+ rOStm << (sal_Int16) GDI_BITMAPSCALE_ACTION;
+ rOStm << (sal_Int32) 20;
rOStm << pAct->GetPoint();
rOStm << pAct->GetSize();
rOStm << pAct->GetBitmap();
@@ -1818,8 +1818,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaBmpScalePartAction* pAct = (MetaBmpScalePartAction*) pAction;
- rOStm << (INT16) GDI_BITMAPSCALEPART_ACTION;
- rOStm << (INT32) 36;
+ rOStm << (sal_Int16) GDI_BITMAPSCALEPART_ACTION;
+ rOStm << (sal_Int32) 36;
rOStm << pAct->GetDestPoint();
rOStm << pAct->GetDestSize();
rOStm << pAct->GetSrcPoint();
@@ -1834,8 +1834,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
MetaBmpExAction* pAct = (MetaBmpExAction*) pAction;
const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() );
- rOStm << (INT16) GDI_BITMAP_ACTION;
- rOStm << (INT32) 12;
+ rOStm << (sal_Int16) GDI_BITMAP_ACTION;
+ rOStm << (sal_Int32) 12;
rOStm << pAct->GetPoint();
rOStm << aBmp;
nCount++;
@@ -1847,8 +1847,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
MetaBmpExScaleAction* pAct = (MetaBmpExScaleAction*) pAction;
const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() );
- rOStm << (INT16) GDI_BITMAPSCALE_ACTION;
- rOStm << (INT32) 20;
+ rOStm << (sal_Int16) GDI_BITMAPSCALE_ACTION;
+ rOStm << (sal_Int32) 20;
rOStm << pAct->GetPoint();
rOStm << pAct->GetSize();
rOStm << aBmp;
@@ -1861,8 +1861,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
MetaBmpExScalePartAction* pAct = (MetaBmpExScalePartAction*) pAction;
const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() );
- rOStm << (INT16) GDI_BITMAPSCALEPART_ACTION;
- rOStm << (INT32) 36;
+ rOStm << (sal_Int16) GDI_BITMAPSCALEPART_ACTION;
+ rOStm << (sal_Int32) 36;
rOStm << pAct->GetDestPoint();
rOStm << pAct->GetDestSize();
rOStm << pAct->GetSrcPoint();
@@ -1877,18 +1877,18 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
MetaGradientAction* pAct = (MetaGradientAction*) pAction;
const Gradient& rGrad = pAct->GetGradient();
- rOStm << (INT16) GDI_GRADIENT_ACTION;
- rOStm << (INT32) 46;
+ rOStm << (sal_Int16) GDI_GRADIENT_ACTION;
+ rOStm << (sal_Int32) 46;
ImplWriteRect( rOStm, pAct->GetRect() );
- rOStm << (INT16) rGrad.GetStyle();
+ rOStm << (sal_Int16) rGrad.GetStyle();
ImplWriteColor( rOStm, rGrad.GetStartColor() );
ImplWriteColor( rOStm, rGrad.GetEndColor() );
- rOStm << (INT16) rGrad.GetAngle();
- rOStm << (INT16) rGrad.GetBorder();
- rOStm << (INT16) rGrad.GetOfsX();
- rOStm << (INT16) rGrad.GetOfsY();
- rOStm << (INT16) rGrad.GetStartIntensity();
- rOStm << (INT16) rGrad.GetEndIntensity();
+ rOStm << (sal_Int16) rGrad.GetAngle();
+ rOStm << (sal_Int16) rGrad.GetBorder();
+ rOStm << (sal_Int16) rGrad.GetOfsX();
+ rOStm << (sal_Int16) rGrad.GetOfsY();
+ rOStm << (sal_Int16) rGrad.GetStartIntensity();
+ rOStm << (sal_Int16) rGrad.GetEndIntensity();
nCount++;
}
break;
@@ -1896,10 +1896,10 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_GRADIENTEX_ACTION ):
{
const MetaGradientExAction* pA = (MetaGradientExAction*) pAction;
- ULONG nOldPos, nNewPos;
+ sal_uLong nOldPos, nNewPos;
// write RefPoint comment
- rOStm << (INT16) GDI_GRADIENTEX_COMMENT;
+ rOStm << (sal_Int16) GDI_GRADIENTEX_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
@@ -1907,12 +1907,12 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
// write data
rOStm << pA->GetPolyPolygon() << pA->GetGradient();
- rOStm << (INT32) 0; // number of actions that follow this comment
+ rOStm << (sal_Int32) 0; // number of actions that follow this comment
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (INT32) ( nNewPos - nOldPos );
+ rOStm << (sal_Int32) ( nNewPos - nOldPos );
rOStm.Seek( nNewPos );
nCount++;
@@ -1928,11 +1928,11 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
ImplWriteLineColor( rOStm, rColor, 1 );
ImplWriteFillColor( rOStm, rColor, 1 );
- rOStm << (INT16) GDI_RECT_ACTION;
- rOStm << (INT32) 28;
+ rOStm << (sal_Int16) GDI_RECT_ACTION;
+ rOStm << (sal_Int32) 28;
ImplWriteRect( rOStm, pAct->GetRect() );
- rOStm << (INT32) 0;
- rOStm << (INT32) 0;
+ rOStm << (sal_Int32) 0;
+ rOStm << (sal_Int32) 0;
ImplWritePopAction( rOStm );
nCount += 5;
@@ -1945,18 +1945,18 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
const Region& rRegion = pAct->GetRegion();
Rectangle aClipRect;
- rOStm << (INT16) GDI_CLIPREGION_ACTION;
- rOStm << (INT32) 24;
+ rOStm << (sal_Int16) GDI_CLIPREGION_ACTION;
+ rOStm << (sal_Int32) 24;
if( pAct->IsClipping() )
{
aClipRect = rRegion.GetBoundRect();
- rOStm << (INT16) 1;
+ rOStm << (sal_Int16) 1;
}
else
- rOStm << (INT16) 0;
+ rOStm << (sal_Int16) 0;
- rOStm << (INT16) 0;
+ rOStm << (sal_Int16) 0;
ImplWriteRect( rOStm, aClipRect );
if( pAct->IsClipping() )
@@ -1970,8 +1970,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaISectRectClipRegionAction* pAct = (MetaISectRectClipRegionAction*) pAction;
- rOStm << (INT16) GDI_ISECTCLIPREGION_ACTION;
- rOStm << (INT32) 20;
+ rOStm << (sal_Int16) GDI_ISECTCLIPREGION_ACTION;
+ rOStm << (sal_Int32) 20;
rOStm << pAct->GetRect();
nCount++;
}
@@ -1981,10 +1981,10 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaMoveClipRegionAction* pAct = (MetaMoveClipRegionAction*) pAction;
- rOStm << (INT16) GDI_MOVECLIPREGION_ACTION;
- rOStm << (INT32) 12;
- rOStm << (INT32) pAct->GetHorzMove();
- rOStm << (INT32) pAct->GetVertMove();
+ rOStm << (sal_Int16) GDI_MOVECLIPREGION_ACTION;
+ rOStm << (sal_Int32) 12;
+ rOStm << (sal_Int32) pAct->GetHorzMove();
+ rOStm << (sal_Int32) pAct->GetVertMove();
nCount++;
}
break;
@@ -2055,8 +2055,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaMapModeAction* pAct = (MetaMapModeAction*) pAction;
- rOStm << (INT16) GDI_MAPMODE_ACTION;
- rOStm << (INT32) 30;
+ rOStm << (sal_Int16) GDI_MAPMODE_ACTION;
+ rOStm << (sal_Int32) 30;
ImplWriteMapMode( rOStm, pAct->GetMapMode() );
nCount++;
}
@@ -2093,7 +2093,7 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
if( ( pAct->GetRasterOp() != ROP_0 ) && ( pAct->GetRasterOp() != ROP_1 ) )
{
- INT16 nRasterOp;
+ sal_Int16 nRasterOp;
// Falls vorher ROP_0/1 gesetzt war, alten
// Zustand durch Pop erst wieder herstellen
@@ -2101,7 +2101,7 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
ImplWritePopAction( rOStm );
rSaveVDev.Pop();
- rRop_0_1 = FALSE;
+ rRop_0_1 = sal_False;
nCount++;
}
@@ -2133,7 +2133,7 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
}
ImplWriteRasterOpAction( rOStm, 0 );
- rRop_0_1 = TRUE;
+ rRop_0_1 = sal_True;
nCount += 4;
}
}
@@ -2142,12 +2142,12 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_TRANSPARENT_ACTION ):
{
const PolyPolygon& rPolyPoly = ( (MetaTransparentAction*) pAction )->GetPolyPolygon();
- const INT16 nTrans = ( (MetaTransparentAction*) pAction )->GetTransparence();
- const INT16 nBrushStyle = ( nTrans < 38 ) ? 8 : ( nTrans < 63 ) ? 9 : 10;
- ULONG nOldPos, nNewPos;
+ const sal_Int16 nTrans = ( (MetaTransparentAction*) pAction )->GetTransparence();
+ const sal_Int16 nBrushStyle = ( nTrans < 38 ) ? 8 : ( nTrans < 63 ) ? 9 : 10;
+ sal_uLong nOldPos, nNewPos;
// write transparence comment
- rOStm << (INT16) GDI_TRANSPARENT_COMMENT;
+ rOStm << (sal_Int16) GDI_TRANSPARENT_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
@@ -2156,12 +2156,12 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
// write comment data
rOStm << rPolyPoly;
rOStm << nTrans;
- rOStm << (INT32) 15; // number of actions that follow this comment
+ rOStm << (sal_Int32) 15; // number of actions that follow this comment
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (INT32) ( nNewPos - nOldPos );
+ rOStm << (sal_Int32) ( nNewPos - nOldPos );
rOStm.Seek( nNewPos );
{
@@ -2207,10 +2207,10 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
const Point& rPos = pA->GetPoint();
const Size& rSize = pA->GetSize();
const Gradient& rGradient = pA->GetGradient();
- ULONG nOldPos, nNewPos;
+ sal_uLong nOldPos, nNewPos;
// write RefPoint comment
- rOStm << (INT16) GDI_FLOATTRANSPARENT_COMMENT;
+ rOStm << (sal_Int16) GDI_FLOATTRANSPARENT_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
@@ -2222,12 +2222,12 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (INT32) ( nNewPos - nOldPos + 4 );
+ rOStm << (sal_Int32) ( nNewPos - nOldPos + 4 );
rOStm.Seek( ( nOldPos = nNewPos ) + 4 );
{
// write actions for float transparence
- ULONG nAddCount;
+ sal_uLong nAddCount;
GDIMetaFile aMtf( rTransMtf );
const Size aSrcSize( rTransMtf.GetPrefSize() );
Point aSrcPt( rTransMtf.GetPrefMapMode().GetOrigin() );
@@ -2249,7 +2249,7 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
nAddCount = ImplWriteActions( rOStm, aMtf, rSaveVDev, rRop_0_1, rLineCol, rLineColStack, rActualCharSet );
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (INT32) nAddCount;
+ rOStm << (sal_Int32) nAddCount;
rOStm.Seek( nNewPos );
#ifdef CVTSVM_WRITE_SUBACTIONCOUNT
@@ -2266,10 +2266,10 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
const MetaHatchAction* pA = (MetaHatchAction*) pAction;
const PolyPolygon& rPolyPoly = pA->GetPolyPolygon();
const Hatch& rHatch = pA->GetHatch();
- ULONG nOldPos, nNewPos, nAddCount;
+ sal_uLong nOldPos, nNewPos, nAddCount;
// write hatch comment
- rOStm << (INT16) GDI_HATCH_COMMENT;
+ rOStm << (sal_Int16) GDI_HATCH_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
@@ -2282,7 +2282,7 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (INT32) ( nNewPos - nOldPos + 4 );
+ rOStm << (sal_Int32) ( nNewPos - nOldPos + 4 );
rOStm.Seek( ( nOldPos = nNewPos ) + 4 );
{
@@ -2294,7 +2294,7 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
nAddCount = ImplWriteActions( rOStm, aTmpMtf, rSaveVDev, rRop_0_1, rLineCol, rLineColStack, rActualCharSet );
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (INT32) nAddCount;
+ rOStm << (sal_Int32) nAddCount;
rOStm.Seek( nNewPos );
#ifdef CVTSVM_WRITE_SUBACTIONCOUNT
@@ -2310,11 +2310,11 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
const MetaRefPointAction* pA = (MetaRefPointAction*) pAction;
const Point& rRefPoint = pA->GetRefPoint();
- const BOOL bSet = pA->IsSetting();
- ULONG nOldPos, nNewPos;
+ const sal_Bool bSet = pA->IsSetting();
+ sal_uLong nOldPos, nNewPos;
// write RefPoint comment
- rOStm << (INT16) GDI_REFPOINT_COMMENT;
+ rOStm << (sal_Int16) GDI_REFPOINT_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
@@ -2322,12 +2322,12 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
// write data
rOStm << rRefPoint << bSet;
- rOStm << (INT32) 0; // number of actions that follow this comment
+ rOStm << (sal_Int32) 0; // number of actions that follow this comment
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (INT32) ( nNewPos - nOldPos );
+ rOStm << (sal_Int32) ( nNewPos - nOldPos );
rOStm.Seek( nNewPos );
nCount++;
@@ -2338,11 +2338,11 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
const MetaTextLineColorAction* pA = (MetaTextLineColorAction*) pAction;
const Color& rColor = pA->GetColor();
- const BOOL bSet = pA->IsSetting();
- ULONG nOldPos, nNewPos;
+ const sal_Bool bSet = pA->IsSetting();
+ sal_uLong nOldPos, nNewPos;
// write RefPoint comment
- rOStm << (INT16) GDI_TEXTLINECOLOR_COMMENT;
+ rOStm << (sal_Int16) GDI_TEXTLINECOLOR_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
@@ -2350,12 +2350,12 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
// write data
rOStm << rColor << bSet;
- rOStm << (INT32) 0; // number of actions that follow this comment
+ rOStm << (sal_Int32) 0; // number of actions that follow this comment
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (INT32) ( nNewPos - nOldPos );
+ rOStm << (sal_Int32) ( nNewPos - nOldPos );
rOStm.Seek( nNewPos );
nCount++;
@@ -2369,10 +2369,10 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
const long nWidth = pA->GetWidth();
const FontStrikeout eStrikeout = pA->GetStrikeout();
const FontUnderline eUnderline = pA->GetUnderline();
- ULONG nOldPos, nNewPos;
+ sal_uLong nOldPos, nNewPos;
// write RefPoint comment
- rOStm << (INT16) GDI_TEXTLINE_COMMENT;
+ rOStm << (sal_Int16) GDI_TEXTLINE_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
@@ -2382,12 +2382,12 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
rOStm << rStartPt << nWidth <<
static_cast<sal_uInt32>(eStrikeout) <<
static_cast<sal_uInt32>(eUnderline);
- rOStm << (INT32) 0; // number of actions that follow this comment
+ rOStm << (sal_Int32) 0; // number of actions that follow this comment
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (INT32) ( nNewPos - nOldPos );
+ rOStm << (sal_Int32) ( nNewPos - nOldPos );
rOStm.Seek( nNewPos );
nCount++;
@@ -2401,10 +2401,10 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
const MetaCommentAction* pA = (MetaCommentAction*) pAction;
const sal_uInt32 nDataSize = pA->GetDataSize();
- ULONG nOldPos, nNewPos;
+ sal_uLong nOldPos, nNewPos;
// write RefPoint comment
- rOStm << (INT16) GDI_COMMENT_COMMENT;
+ rOStm << (sal_Int16) GDI_COMMENT_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
@@ -2416,12 +2416,12 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
if( nDataSize )
rOStm.Write( pA->GetData(), nDataSize );
- rOStm << (INT32) 0; // number of actions that follow this comment
+ rOStm << (sal_Int32) 0; // number of actions that follow this comment
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (INT32) ( nNewPos - nOldPos );
+ rOStm << (sal_Int32) ( nNewPos - nOldPos );
rOStm.Seek( nNewPos );
nCount++;
diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx
index 61db9f110a9e..2a10563441fa 100644
--- a/vcl/source/gdi/font.cxx
+++ b/vcl/source/gdi/font.cxx
@@ -172,7 +172,7 @@ void Impl_Font::AskConfig()
String aShortName;
String aFamilyName;
- ULONG nType = 0;
+ sal_uLong nType = 0;
FontWeight eWeight = WEIGHT_DONTKNOW;
FontWidth eWidthType = WIDTH_DONTKNOW;
String aMapName = maFamilyName;
@@ -349,7 +349,7 @@ void Font::SetFillColor( const Color& rColor )
// -----------------------------------------------------------------------
-void Font::SetTransparent( BOOL bTransparent )
+void Font::SetTransparent( sal_Bool bTransparent )
{
DBG_CHKTHIS( Font, NULL );
@@ -486,7 +486,7 @@ void Font::SetOrientation( short nOrientation )
// -----------------------------------------------------------------------
-void Font::SetVertical( BOOL bVertical )
+void Font::SetVertical( sal_Bool bVertical )
{
DBG_CHKTHIS( Font, NULL );
@@ -512,7 +512,7 @@ void Font::SetKerning( FontKerning nKerning )
// -----------------------------------------------------------------------
-BOOL Font::IsKerning() const
+sal_Bool Font::IsKerning() const
{
return (mpImplFont->mnKerning & KERNING_FONTSPECIFIC) != 0;
}
@@ -558,7 +558,7 @@ void Font::SetItalic( FontItalic eItalic )
// -----------------------------------------------------------------------
-void Font::SetOutline( BOOL bOutline )
+void Font::SetOutline( sal_Bool bOutline )
{
DBG_CHKTHIS( Font, NULL );
@@ -571,7 +571,7 @@ void Font::SetOutline( BOOL bOutline )
// -----------------------------------------------------------------------
-void Font::SetShadow( BOOL bShadow )
+void Font::SetShadow( sal_Bool bShadow )
{
DBG_CHKTHIS( Font, NULL );
@@ -649,7 +649,7 @@ void Font::SetEmphasisMark( FontEmphasisMark eEmphasisMark )
// -----------------------------------------------------------------------
-void Font::SetWordLineMode( BOOL bWordLine )
+void Font::SetWordLineMode( sal_Bool bWordLine )
{
DBG_CHKTHIS( Font, NULL );
@@ -690,17 +690,17 @@ Font& Font::operator=( const Font& rFont )
// -----------------------------------------------------------------------
-BOOL Font::operator==( const Font& rFont ) const
+sal_Bool Font::operator==( const Font& rFont ) const
{
DBG_CHKTHIS( Font, NULL );
DBG_CHKOBJ( &rFont, Font, NULL );
if( mpImplFont == rFont.mpImplFont )
- return TRUE;
+ return sal_True;
if( *mpImplFont == *rFont.mpImplFont )
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -775,9 +775,9 @@ void Font::GetFontAttributes( ImplFontAttributes& rAttrs ) const
SvStream& operator>>( SvStream& rIStm, Impl_Font& rImpl_Font )
{
VersionCompat aCompat( rIStm, STREAM_READ );
- UINT16 nTmp16;
- BOOL bTmp;
- BYTE nTmp8;
+ sal_uInt16 nTmp16;
+ sal_Bool bTmp;
+ sal_uInt8 nTmp8;
rIStm.ReadByteString( rImpl_Font.maFamilyName, rIStm.GetStreamCharSet() );
rIStm.ReadByteString( rImpl_Font.maStyleName, rIStm.GetStreamCharSet() );
@@ -826,31 +826,31 @@ SvStream& operator<<( SvStream& rOStm, const Impl_Font& rImpl_Font )
rOStm.WriteByteString( rImpl_Font.maStyleName, rOStm.GetStreamCharSet() );
rOStm << rImpl_Font.maSize;
- rOStm << (UINT16) GetStoreCharSet( rImpl_Font.meCharSet );
- rOStm << (UINT16) rImpl_Font.meFamily;
- rOStm << (UINT16) rImpl_Font.mePitch;
- rOStm << (UINT16) rImpl_Font.meWeight;
- rOStm << (UINT16) rImpl_Font.meUnderline;
- rOStm << (UINT16) rImpl_Font.meStrikeout;
- rOStm << (UINT16) rImpl_Font.meItalic;
- rOStm << (UINT16) rImpl_Font.meLanguage;
- rOStm << (UINT16) rImpl_Font.meWidthType;
+ rOStm << (sal_uInt16) GetStoreCharSet( rImpl_Font.meCharSet );
+ rOStm << (sal_uInt16) rImpl_Font.meFamily;
+ rOStm << (sal_uInt16) rImpl_Font.mePitch;
+ rOStm << (sal_uInt16) rImpl_Font.meWeight;
+ rOStm << (sal_uInt16) rImpl_Font.meUnderline;
+ rOStm << (sal_uInt16) rImpl_Font.meStrikeout;
+ rOStm << (sal_uInt16) rImpl_Font.meItalic;
+ rOStm << (sal_uInt16) rImpl_Font.meLanguage;
+ rOStm << (sal_uInt16) rImpl_Font.meWidthType;
rOStm << rImpl_Font.mnOrientation;
- rOStm << (BOOL) rImpl_Font.mbWordLine;
- rOStm << (BOOL) rImpl_Font.mbOutline;
- rOStm << (BOOL) rImpl_Font.mbShadow;
- rOStm << (BYTE) rImpl_Font.mnKerning;
+ rOStm << (sal_Bool) rImpl_Font.mbWordLine;
+ rOStm << (sal_Bool) rImpl_Font.mbOutline;
+ rOStm << (sal_Bool) rImpl_Font.mbShadow;
+ rOStm << (sal_uInt8) rImpl_Font.mnKerning;
// new in version 2
- rOStm << (BYTE) rImpl_Font.meRelief;
- rOStm << (UINT16) rImpl_Font.meCJKLanguage;
- rOStm << (BOOL) rImpl_Font.mbVertical;
- rOStm << (UINT16) rImpl_Font.meEmphasisMark;
+ rOStm << (sal_uInt8) rImpl_Font.meRelief;
+ rOStm << (sal_uInt16) rImpl_Font.meCJKLanguage;
+ rOStm << (sal_Bool) rImpl_Font.mbVertical;
+ rOStm << (sal_uInt16) rImpl_Font.meEmphasisMark;
// new in version 3
- rOStm << (UINT16) rImpl_Font.meOverline;
+ rOStm << (sal_uInt16) rImpl_Font.meOverline;
return rOStm;
}
@@ -1087,7 +1087,7 @@ Font Font::identifyFont( const void* i_pBuffer, sal_uInt32 i_nSize )
// TODO: reformat
const Color& Font::GetColor() const { return mpImplFont->maColor; }
const Color& Font::GetFillColor() const { return mpImplFont->maFillColor; }
-BOOL Font::IsTransparent() const { return mpImplFont->mbTransparent; }
+sal_Bool Font::IsTransparent() const { return mpImplFont->mbTransparent; }
FontAlign Font::GetAlign() const { return mpImplFont->meAlign; }
const String& Font::GetName() const { return mpImplFont->maFamilyName; }
const String& Font::GetStyleName() const { return mpImplFont->maStyleName; }
@@ -1100,21 +1100,21 @@ rtl_TextEncoding Font::GetCharSet() const { return mpImplFont->meCharSet; }
LanguageType Font::GetLanguage() const { return mpImplFont->meLanguage; }
LanguageType Font::GetCJKContextLanguage() const { return mpImplFont->meCJKLanguage; }
short Font::GetOrientation() const { return mpImplFont->mnOrientation; }
-BOOL Font::IsVertical() const { return mpImplFont->mbVertical; }
+sal_Bool Font::IsVertical() const { return mpImplFont->mbVertical; }
FontKerning Font::GetKerning() const { return mpImplFont->mnKerning; }
FontPitch Font::GetPitch() const { return mpImplFont->GetPitch(); }
FontWeight Font::GetWeight() const { return mpImplFont->GetWeight(); }
FontWidth Font::GetWidthType() const { return mpImplFont->GetWidthType(); }
FontItalic Font::GetItalic() const { return mpImplFont->GetItalic(); }
FontFamily Font::GetFamily() const { return mpImplFont->GetFamily(); }
-BOOL Font::IsOutline() const { return mpImplFont->mbOutline; }
-BOOL Font::IsShadow() const { return mpImplFont->mbShadow; }
+sal_Bool Font::IsOutline() const { return mpImplFont->mbOutline; }
+sal_Bool Font::IsShadow() const { return mpImplFont->mbShadow; }
FontRelief Font::GetRelief() const { return mpImplFont->meRelief; }
FontUnderline Font::GetUnderline() const { return mpImplFont->meUnderline; }
FontUnderline Font::GetOverline() const { return mpImplFont->meOverline; }
FontStrikeout Font::GetStrikeout() const { return mpImplFont->meStrikeout; }
FontEmphasisMark Font::GetEmphasisMark() const { return mpImplFont->meEmphasisMark; }
-BOOL Font::IsWordLineMode() const { return mpImplFont->mbWordLine; }
-BOOL Font::IsSameInstance( const Font& rFont ) const { return (mpImplFont == rFont.mpImplFont); }
+sal_Bool Font::IsWordLineMode() const { return mpImplFont->mbWordLine; }
+sal_Bool Font::IsSameInstance( const Font& rFont ) const { return (mpImplFont == rFont.mpImplFont); }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index f476fa8e8452..79b8f417891b 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -62,7 +62,7 @@ using namespace com::sun::star;
// - Defines -
// -----------
-#define GAMMA( _def_cVal, _def_InvGamma ) ((BYTE)MinMax(FRound(pow( _def_cVal/255.0,_def_InvGamma)*255.0),0L,255L))
+#define GAMMA( _def_cVal, _def_InvGamma ) ((sal_uInt8)MinMax(FRound(pow( _def_cVal/255.0,_def_InvGamma)*255.0),0L,255L))
// --------------------------
// - Color exchange structs -
@@ -70,9 +70,9 @@ using namespace com::sun::star;
struct ImplColAdjustParam
{
- BYTE* pMapR;
- BYTE* pMapG;
- BYTE* pMapB;
+ sal_uInt8* pMapR;
+ sal_uInt8* pMapG;
+ sal_uInt8* pMapB;
};
struct ImplBmpAdjustParam
@@ -83,7 +83,7 @@ struct ImplBmpAdjustParam
short nChannelGPercent;
short nChannelBPercent;
double fGamma;
- BOOL bInvert;
+ sal_Bool bInvert;
};
// -----------------------------------------------------------------------------
@@ -114,22 +114,22 @@ struct ImplBmpMonoParam
struct ImplColReplaceParam
{
- ULONG* pMinR;
- ULONG* pMaxR;
- ULONG* pMinG;
- ULONG* pMaxG;
- ULONG* pMinB;
- ULONG* pMaxB;
+ sal_uLong* pMinR;
+ sal_uLong* pMaxR;
+ sal_uLong* pMinG;
+ sal_uLong* pMaxG;
+ sal_uLong* pMinB;
+ sal_uLong* pMaxB;
const Color* pDstCols;
- ULONG nCount;
+ sal_uLong nCount;
};
struct ImplBmpReplaceParam
{
const Color* pSrcCols;
const Color* pDstCols;
- ULONG nCount;
- const ULONG* pTols;
+ sal_uLong nCount;
+ const sal_uLong* pTols;
};
@@ -140,9 +140,9 @@ struct ImplBmpReplaceParam
struct ImpLabel
{
String aLabelName;
- ULONG nActionPos;
+ sal_uLong nActionPos;
- ImpLabel( const String& rLabelName, ULONG _nActionPos ) :
+ ImpLabel( const String& rLabelName, sal_uLong _nActionPos ) :
aLabelName( rLabelName ),
nActionPos( _nActionPos ) {}
};
@@ -160,13 +160,13 @@ public:
~ImpLabelList();
void ImplInsert( ImpLabel* p ) { Insert( p, LIST_APPEND ); }
- ImpLabel* ImplRemove( ULONG nPos ) { return (ImpLabel*) Remove( nPos ); }
+ ImpLabel* ImplRemove( sal_uLong nPos ) { return (ImpLabel*) Remove( nPos ); }
void ImplReplace( ImpLabel* p ) { Replace( (void*)p ); }
ImpLabel* ImplFirst() { return (ImpLabel*) First(); }
ImpLabel* ImplNext() { return (ImpLabel*) Next(); }
- ImpLabel* ImplGetLabel( ULONG nPos ) const { return (ImpLabel*) GetObject( nPos ); }
- ULONG ImplGetLabelPos( const String& rLabelName );
- ULONG ImplCount() const { return Count(); }
+ ImpLabel* ImplGetLabel( sal_uLong nPos ) const { return (ImpLabel*) GetObject( nPos ); }
+ sal_uLong ImplGetLabelPos( const String& rLabelName );
+ sal_uLong ImplCount() const { return Count(); }
};
// ------------------------------------------------------------------------
@@ -188,9 +188,9 @@ ImpLabelList::~ImpLabelList()
// ------------------------------------------------------------------------
-ULONG ImpLabelList::ImplGetLabelPos( const String& rLabelName )
+sal_uLong ImpLabelList::ImplGetLabelPos( const String& rLabelName )
{
- ULONG nLabelPos = METAFILE_LABEL_NOTFOUND;
+ sal_uLong nLabelPos = METAFILE_LABEL_NOTFOUND;
for( ImpLabel* pLabel = ImplFirst(); pLabel; pLabel = ImplNext() )
{
@@ -215,9 +215,9 @@ GDIMetaFile::GDIMetaFile() :
pNext ( NULL ),
pOutDev ( NULL ),
pLabelList ( NULL ),
- bPause ( FALSE ),
- bRecord ( FALSE ),
- bUseCanvas ( FALSE )
+ bPause ( sal_False ),
+ bRecord ( sal_False ),
+ bUseCanvas ( sal_False )
{
}
@@ -231,8 +231,8 @@ GDIMetaFile::GDIMetaFile( const GDIMetaFile& rMtf ) :
pPrev ( rMtf.pPrev ),
pNext ( rMtf.pNext ),
pOutDev ( NULL ),
- bPause ( FALSE ),
- bRecord ( FALSE ),
+ bPause ( sal_False ),
+ bRecord ( sal_False ),
bUseCanvas ( rMtf.bUseCanvas )
{
// RefCount der MetaActions erhoehen
@@ -249,7 +249,7 @@ GDIMetaFile::GDIMetaFile( const GDIMetaFile& rMtf ) :
Record( rMtf.pOutDev );
if ( rMtf.bPause )
- Pause( TRUE );
+ Pause( sal_True );
}
}
@@ -285,8 +285,8 @@ GDIMetaFile& GDIMetaFile::operator=( const GDIMetaFile& rMtf )
pPrev = rMtf.pPrev;
pNext = rMtf.pNext;
pOutDev = NULL;
- bPause = FALSE;
- bRecord = FALSE;
+ bPause = sal_False;
+ bRecord = sal_False;
bUseCanvas = rMtf.bUseCanvas;
if( rMtf.bRecord )
@@ -294,7 +294,7 @@ GDIMetaFile& GDIMetaFile::operator=( const GDIMetaFile& rMtf )
Record( rMtf.pOutDev );
if( rMtf.bPause )
- Pause( TRUE );
+ Pause( sal_True );
}
}
@@ -303,24 +303,24 @@ GDIMetaFile& GDIMetaFile::operator=( const GDIMetaFile& rMtf )
// ------------------------------------------------------------------------
-BOOL GDIMetaFile::operator==( const GDIMetaFile& rMtf ) const
+sal_Bool GDIMetaFile::operator==( const GDIMetaFile& rMtf ) const
{
- const ULONG nObjCount = Count();
- BOOL bRet = FALSE;
+ const sal_uLong nObjCount = Count();
+ sal_Bool bRet = sal_False;
if( this == &rMtf )
- bRet = TRUE;
+ bRet = sal_True;
else if( rMtf.GetActionCount() == nObjCount &&
rMtf.GetPrefSize() == aPrefSize &&
rMtf.GetPrefMapMode() == aPrefMapMode )
{
- bRet = TRUE;
+ bRet = sal_True;
- for( ULONG n = 0UL; n < nObjCount; n++ )
+ for( sal_uLong n = 0UL; n < nObjCount; n++ )
{
if( GetObject( n ) != rMtf.GetObject( n ) )
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
@@ -333,22 +333,22 @@ BOOL GDIMetaFile::operator==( const GDIMetaFile& rMtf ) const
sal_Bool GDIMetaFile::IsEqual( const GDIMetaFile& rMtf ) const
{
- const ULONG nObjCount = Count();
- BOOL bRet = FALSE;
+ const sal_uLong nObjCount = Count();
+ sal_Bool bRet = sal_False;
if( this == &rMtf )
- bRet = TRUE;
+ bRet = sal_True;
else if( rMtf.GetActionCount() == nObjCount &&
rMtf.GetPrefSize() == aPrefSize &&
rMtf.GetPrefMapMode() == aPrefMapMode )
{
- bRet = TRUE;
+ bRet = sal_True;
- for( ULONG n = 0UL; n < nObjCount; n++ )
+ for( sal_uLong n = 0UL; n < nObjCount; n++ )
{
if(!((MetaAction*)GetObject( n ))->IsEqual(*((MetaAction*)rMtf.GetObject( n ))))
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
@@ -375,7 +375,7 @@ void GDIMetaFile::Clear()
// ------------------------------------------------------------------------
-void GDIMetaFile::Linker( OutputDevice* pOut, BOOL bLink )
+void GDIMetaFile::Linker( OutputDevice* pOut, sal_Bool bLink )
{
if( bLink )
{
@@ -424,25 +424,25 @@ void GDIMetaFile::Record( OutputDevice* pOut )
Last();
pOutDev = pOut;
- bRecord = TRUE;
- Linker( pOut, TRUE );
+ bRecord = sal_True;
+ Linker( pOut, sal_True );
}
// ------------------------------------------------------------------------
-void GDIMetaFile::Play( GDIMetaFile& rMtf, ULONG nPos )
+void GDIMetaFile::Play( GDIMetaFile& rMtf, sal_uLong nPos )
{
if ( !bRecord && !rMtf.bRecord )
{
MetaAction* pAction = GetCurAction();
- const ULONG nObjCount = Count();
+ const sal_uLong nObjCount = Count();
rMtf.UseCanvas( rMtf.GetUseCanvas() || bUseCanvas );
if( nPos > nObjCount )
nPos = nObjCount;
- for( ULONG nCurPos = GetCurPos(); nCurPos < nPos; nCurPos++ )
+ for( sal_uLong nCurPos = GetCurPos(); nCurPos < nPos; nCurPos++ )
{
if( !Hook() )
{
@@ -457,13 +457,13 @@ void GDIMetaFile::Play( GDIMetaFile& rMtf, ULONG nPos )
// ------------------------------------------------------------------------
-void GDIMetaFile::Play( OutputDevice* pOut, ULONG nPos )
+void GDIMetaFile::Play( OutputDevice* pOut, sal_uLong nPos )
{
if( !bRecord )
{
MetaAction* pAction = GetCurAction();
- const ULONG nObjCount = Count();
- ULONG i = 0, nSyncCount = ( pOut->GetOutDevType() == OUTDEV_WINDOW ) ? 0x000000ff : 0xffffffff;
+ const sal_uLong nObjCount = Count();
+ sal_uLong i = 0, nSyncCount = ( pOut->GetOutDevType() == OUTDEV_WINDOW ) ? 0x000000ff : 0xffffffff;
if( nPos > nObjCount )
nPos = nObjCount;
@@ -476,7 +476,7 @@ void GDIMetaFile::Play( OutputDevice* pOut, ULONG nPos )
pOut->SetLayoutMode( 0 );
pOut->SetDigitLanguage( 0 );
- for( ULONG nCurPos = GetCurPos(); nCurPos < nPos; nCurPos++ )
+ for( sal_uLong nCurPos = GetCurPos(); nCurPos < nPos; nCurPos++ )
{
if( !Hook() )
{
@@ -587,8 +587,8 @@ void GDIMetaFile::ImplDelegate2PluggableRenderer( const MetaCommentAction* pAct,
OSL_ASSERT( pAct->GetComment().Equals("DELEGATE_PLUGGABLE_RENDERER") );
// read payload - string of service name, followed by raw render input
- const BYTE* pData = pAct->GetData();
- const BYTE* const pEndData = pData + pAct->GetDataSize();
+ const sal_uInt8* pData = pAct->GetData();
+ const sal_uInt8* const pEndData = pData + pAct->GetDataSize();
if( !pData )
return;
@@ -654,7 +654,7 @@ void GDIMetaFile::ImplDelegate2PluggableRenderer( const MetaCommentAction* pAct,
// ------------------------------------------------------------------------
void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos,
- const Size& rSize, ULONG nPos )
+ const Size& rSize, sal_uLong nPos )
{
Region aDrawClipRegion;
MapMode aDrawMap( GetPrefMapMode() );
@@ -719,19 +719,19 @@ void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos,
// ------------------------------------------------------------------------
-void GDIMetaFile::Pause( BOOL _bPause )
+void GDIMetaFile::Pause( sal_Bool _bPause )
{
if( bRecord )
{
if( _bPause )
{
if( !bPause )
- Linker( pOutDev, FALSE );
+ Linker( pOutDev, sal_False );
}
else
{
if( bPause )
- Linker( pOutDev, TRUE );
+ Linker( pOutDev, sal_True );
}
bPause = _bPause;
@@ -744,12 +744,12 @@ void GDIMetaFile::Stop()
{
if( bRecord )
{
- bRecord = FALSE;
+ bRecord = sal_False;
if( !bPause )
- Linker( pOutDev, FALSE );
+ Linker( pOutDev, sal_False );
else
- bPause = FALSE;
+ bPause = sal_False;
}
}
@@ -771,7 +771,7 @@ void GDIMetaFile::WindEnd()
// ------------------------------------------------------------------------
-void GDIMetaFile::Wind( ULONG nActionPos )
+void GDIMetaFile::Wind( sal_uLong nActionPos )
{
if( !bRecord )
Seek( nActionPos );
@@ -808,7 +808,7 @@ void GDIMetaFile::AddAction( MetaAction* pAction )
// ------------------------------------------------------------------------
-void GDIMetaFile::AddAction( MetaAction* pAction, ULONG nPos )
+void GDIMetaFile::AddAction( MetaAction* pAction, sal_uLong nPos )
{
Insert( pAction, nPos );
@@ -822,7 +822,7 @@ void GDIMetaFile::AddAction( MetaAction* pAction, ULONG nPos )
// ------------------------------------------------------------------------
// @since #110496#
-void GDIMetaFile::RemoveAction( ULONG nPos )
+void GDIMetaFile::RemoveAction( sal_uLong nPos )
{
Remove( nPos );
@@ -832,14 +832,14 @@ void GDIMetaFile::RemoveAction( ULONG nPos )
// ------------------------------------------------------------------------
-MetaAction* GDIMetaFile::CopyAction( ULONG nPos ) const
+MetaAction* GDIMetaFile::CopyAction( sal_uLong nPos ) const
{
return ( (MetaAction*) GetObject( nPos ) )->Clone();
}
// ------------------------------------------------------------------------
-ULONG GDIMetaFile::GetActionPos( const String& rLabel )
+sal_uLong GDIMetaFile::GetActionPos( const String& rLabel )
{
ImpLabel* pLabel = NULL;
@@ -853,9 +853,9 @@ ULONG GDIMetaFile::GetActionPos( const String& rLabel )
// ------------------------------------------------------------------------
-BOOL GDIMetaFile::InsertLabel( const String& rLabel, ULONG nActionPos )
+sal_Bool GDIMetaFile::InsertLabel( const String& rLabel, sal_uLong nActionPos )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !pLabelList )
pLabelList = new ImpLabelList;
@@ -863,7 +863,7 @@ BOOL GDIMetaFile::InsertLabel( const String& rLabel, ULONG nActionPos )
if( pLabelList->ImplGetLabelPos( rLabel ) == METAFILE_LABEL_NOTFOUND )
{
pLabelList->ImplInsert( new ImpLabel( rLabel, nActionPos ) );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -875,7 +875,7 @@ void GDIMetaFile::RemoveLabel( const String& rLabel )
{
if( pLabelList )
{
- const ULONG nLabelPos = pLabelList->ImplGetLabelPos( rLabel );
+ const sal_uLong nLabelPos = pLabelList->ImplGetLabelPos( rLabel );
if( nLabelPos != METAFILE_LABEL_NOTFOUND )
delete pLabelList->ImplRemove( nLabelPos );
@@ -888,7 +888,7 @@ void GDIMetaFile::RenameLabel( const String& rLabel, const String& rNewLabel )
{
if( pLabelList )
{
- const ULONG nLabelPos = pLabelList->ImplGetLabelPos( rLabel );
+ const sal_uLong nLabelPos = pLabelList->ImplGetLabelPos( rLabel );
if ( nLabelPos != METAFILE_LABEL_NOTFOUND )
pLabelList->ImplGetLabel( nLabelPos )->aLabelName = rNewLabel;
@@ -897,14 +897,14 @@ void GDIMetaFile::RenameLabel( const String& rLabel, const String& rNewLabel )
// ------------------------------------------------------------------------
-ULONG GDIMetaFile::GetLabelCount() const
+sal_uLong GDIMetaFile::GetLabelCount() const
{
return( pLabelList ? pLabelList->ImplCount() : 0UL );
}
// ------------------------------------------------------------------------
-String GDIMetaFile::GetLabel( ULONG nLabel )
+String GDIMetaFile::GetLabel( sal_uLong nLabel )
{
String aString;
@@ -921,12 +921,12 @@ String GDIMetaFile::GetLabel( ULONG nLabel )
// ------------------------------------------------------------------------
-BOOL GDIMetaFile::SaveStatus()
+sal_Bool GDIMetaFile::SaveStatus()
{
if ( bRecord )
{
if ( bPause )
- Linker( pOutDev, TRUE );
+ Linker( pOutDev, sal_True );
AddAction( new MetaLineColorAction( pOutDev->GetLineColor(),
pOutDev->IsLineColor() ) );
@@ -947,22 +947,22 @@ BOOL GDIMetaFile::SaveStatus()
pOutDev->IsClipRegion() ) );
if ( bPause )
- Linker( pOutDev, FALSE );
+ Linker( pOutDev, sal_False );
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
// ------------------------------------------------------------------------
-BOOL GDIMetaFile::Mirror( ULONG nMirrorFlags )
+sal_Bool GDIMetaFile::Mirror( sal_uLong nMirrorFlags )
{
const Size aOldPrefSize( GetPrefSize() );
long nMoveX, nMoveY;
double fScaleX, fScaleY;
- BOOL bRet;
+ sal_Bool bRet;
if( nMirrorFlags & MTF_MIRROR_HORZ )
nMoveX = SAL_ABS( aOldPrefSize.Width() ) - 1, fScaleX = -1.0;
@@ -979,10 +979,10 @@ BOOL GDIMetaFile::Mirror( ULONG nMirrorFlags )
Scale( fScaleX, fScaleY );
Move( nMoveX, nMoveY );
SetPrefSize( aOldPrefSize );
- bRet = TRUE;
+ bRet = sal_True;
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
@@ -995,7 +995,7 @@ void GDIMetaFile::Move( long nX, long nY )
Size aOffset( aBaseOffset );
VirtualDevice aMapVDev;
- aMapVDev.EnableOutput( FALSE );
+ aMapVDev.EnableOutput( sal_False );
aMapVDev.SetMapMode( GetPrefMapMode() );
for( MetaAction* pAct = (MetaAction*) First(); pAct; pAct = (MetaAction*) Next() )
@@ -1029,7 +1029,7 @@ void GDIMetaFile::Move( long nX, long nY, long nDPIX, long nDPIY )
Size aOffset( aBaseOffset );
VirtualDevice aMapVDev;
- aMapVDev.EnableOutput( FALSE );
+ aMapVDev.EnableOutput( sal_False );
aMapVDev.SetReferenceDevice( nDPIX, nDPIY );
aMapVDev.SetMapMode( GetPrefMapMode() );
@@ -1103,7 +1103,7 @@ void GDIMetaFile::Clip( const Rectangle& i_rClipRect )
Rectangle aCurRect( i_rClipRect );
VirtualDevice aMapVDev;
- aMapVDev.EnableOutput( FALSE );
+ aMapVDev.EnableOutput( sal_False );
aMapVDev.SetMapMode( GetPrefMapMode() );
for( MetaAction* pAct = (MetaAction*) First(); pAct; pAct = (MetaAction*) Next() )
@@ -1123,7 +1123,7 @@ void GDIMetaFile::Clip( const Rectangle& i_rClipRect )
Region aNewReg( aCurRect );
if( pOldAct->IsClipping() )
aNewReg.Intersect( pOldAct->GetRegion() );
- MetaClipRegionAction* pNewAct = new MetaClipRegionAction( aNewReg, TRUE );
+ MetaClipRegionAction* pNewAct = new MetaClipRegionAction( aNewReg, sal_True );
Replace( pNewAct, GetCurPos() );
pOldAct->Delete();
}
@@ -1178,7 +1178,7 @@ void GDIMetaFile::ImplAddGradientEx( GDIMetaFile& rMtf,
// #105055# Generate comment, GradientEx and Gradient actions
// (within DrawGradient)
VirtualDevice aVDev( rMapDev, 0 );
- aVDev.EnableOutput( FALSE );
+ aVDev.EnableOutput( sal_False );
GDIMetaFile aGradMtf;
aGradMtf.Record( &aVDev );
@@ -1213,7 +1213,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
aPoly.Rotate( Point(), fSin, fCos );
- aMapVDev.EnableOutput( FALSE );
+ aMapVDev.EnableOutput( sal_False );
aMapVDev.SetMapMode( GetPrefMapMode() );
const Rectangle aNewBound( aPoly.GetBoundRect() );
@@ -1226,7 +1226,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
for( MetaAction* pAction = (MetaAction*) First(); pAction; pAction = (MetaAction*) Next() )
{
- const USHORT nActionType = pAction->GetType();
+ const sal_uInt16 nActionType = pAction->GetType();
switch( nActionType )
{
@@ -1443,7 +1443,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
// skip everything, except gradientex action
while( pAction )
{
- const USHORT nType = pAction->GetType();
+ const sal_uInt16 nType = pAction->GetType();
if( META_GRADIENTEX_ACTION == nType )
{
@@ -1494,7 +1494,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
aStroke.setPath( ImplGetRotatedPolygon( aPath, aRotAnchor, aRotOffset, fSin, fCos ) );
aDest << aStroke;
aMtf.AddAction( new MetaCommentAction( "XPATHSTROKE_SEQ_BEGIN", 0,
- static_cast<const BYTE*>( aDest.GetData()), aDest.Tell() ) );
+ static_cast<const sal_uInt8*>( aDest.GetData()), aDest.Tell() ) );
}
else
{
@@ -1505,7 +1505,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
aFill.setPath( ImplGetRotatedPolyPolygon( aPath, aRotAnchor, aRotOffset, fSin, fCos ) );
aDest << aFill;
aMtf.AddAction( new MetaCommentAction( "XPATHFILL_SEQ_BEGIN", 0,
- static_cast<const BYTE*>( aDest.GetData()), aDest.Tell() ) );
+ static_cast<const sal_uInt8*>( aDest.GetData()), aDest.Tell() ) );
}
}
}
@@ -1525,7 +1525,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
MetaHatchAction* pAct = (MetaHatchAction*) pAction;
Hatch aHatch( pAct->GetHatch() );
- aHatch.SetAngle( aHatch.GetAngle() + (USHORT) nAngle10 );
+ aHatch.SetAngle( aHatch.GetAngle() + (sal_uInt16) nAngle10 );
aMtf.AddAction( new MetaHatchAction( ImplGetRotatedPolyPolygon( pAct->GetPolyPolygon(), aRotAnchor, aRotOffset, fSin, fCos ),
aHatch ) );
}
@@ -1570,7 +1570,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
MetaClipRegionAction* pAct = (MetaClipRegionAction*) pAction;
if( pAct->IsClipping() && pAct->GetRegion().HasPolyPolygon() )
- aMtf.AddAction( new MetaClipRegionAction( Region( ImplGetRotatedPolyPolygon( pAct->GetRegion().GetPolyPolygon(), aRotAnchor, aRotOffset, fSin, fCos ) ), TRUE ) );
+ aMtf.AddAction( new MetaClipRegionAction( Region( ImplGetRotatedPolyPolygon( pAct->GetRegion().GetPolyPolygon(), aRotAnchor, aRotOffset, fSin, fCos ) ), sal_True ) );
else
{
pAction->Duplicate();
@@ -1613,7 +1613,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
MetaFontAction* pAct = (MetaFontAction*) pAction;
Font aFont( pAct->GetFont() );
- aFont.SetOrientation( aFont.GetOrientation() + (USHORT) nAngle10 );
+ aFont.SetOrientation( aFont.GetOrientation() + (sal_uInt16) nAngle10 );
aMtf.AddAction( new MetaFontAction( aFont ) );
}
break;
@@ -1680,17 +1680,17 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
GDIMetaFile aMtf;
VirtualDevice aMapVDev( i_rReference );
- aMapVDev.EnableOutput( FALSE );
+ aMapVDev.EnableOutput( sal_False );
aMapVDev.SetMapMode( GetPrefMapMode() );
std::vector<Rectangle> aClipStack( 1, Rectangle() );
- std::vector<USHORT> aPushFlagStack;
+ std::vector<sal_uInt16> aPushFlagStack;
Rectangle aBound;
for( MetaAction* pAction = (MetaAction*) First(); pAction; pAction = (MetaAction*) Next() )
{
- const USHORT nActionType = pAction->GetType();
+ const sal_uInt16 nActionType = pAction->GetType();
switch( nActionType )
{
@@ -2116,7 +2116,7 @@ BitmapEx GDIMetaFile::ImplBmpAdjustFnc( const BitmapEx& rBmpEx, const void* pBmp
Color GDIMetaFile::ImplColConvertFnc( const Color& rColor, const void* pColParam )
{
- BYTE cLum = rColor.GetLuminance();
+ sal_uInt8 cLum = rColor.GetLuminance();
if( MTF_CONVERSION_1BIT_THRESHOLD == ( (const ImplColConvertParam*) pColParam )->eConversion )
cLum = ( cLum < 128 ) ? 0 : 255;
@@ -2167,9 +2167,9 @@ BitmapEx GDIMetaFile::ImplBmpMonoFnc( const BitmapEx& rBmpEx, const void* pBmpPa
Color GDIMetaFile::ImplColReplaceFnc( const Color& rColor, const void* pColParam )
{
- const ULONG nR = rColor.GetRed(), nG = rColor.GetGreen(), nB = rColor.GetBlue();
+ const sal_uLong nR = rColor.GetRed(), nG = rColor.GetGreen(), nB = rColor.GetBlue();
- for( ULONG i = 0; i < ( (const ImplColReplaceParam*) pColParam )->nCount; i++ )
+ for( sal_uLong i = 0; i < ( (const ImplColReplaceParam*) pColParam )->nCount; i++ )
{
if( ( ( (const ImplColReplaceParam*) pColParam )->pMinR[ i ] <= nR ) &&
( ( (const ImplColReplaceParam*) pColParam )->pMaxR[ i ] >= nR ) &&
@@ -2209,7 +2209,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
for( MetaAction* pAction = (MetaAction*) First(); pAction; pAction = (MetaAction*) Next() )
{
- const USHORT nType = pAction->GetType();
+ const sal_uInt16 nType = pAction->GetType();
switch( nType )
{
@@ -2227,7 +2227,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
if( !pAct->IsSetting() )
pAct->Duplicate();
else
- pAct = new MetaLineColorAction( pFncCol( pAct->GetColor(), pColParam ), TRUE );
+ pAct = new MetaLineColorAction( pFncCol( pAct->GetColor(), pColParam ), sal_True );
aMtf.Insert( pAct, LIST_APPEND );
}
@@ -2240,7 +2240,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
if( !pAct->IsSetting() )
pAct->Duplicate();
else
- pAct = new MetaFillColorAction( pFncCol( pAct->GetColor(), pColParam ), TRUE );
+ pAct = new MetaFillColorAction( pFncCol( pAct->GetColor(), pColParam ), sal_True );
aMtf.Insert( pAct, LIST_APPEND );
}
@@ -2260,7 +2260,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
if( !pAct->IsSetting() )
pAct->Duplicate();
else
- pAct = new MetaTextFillColorAction( pFncCol( pAct->GetColor(), pColParam ), TRUE );
+ pAct = new MetaTextFillColorAction( pFncCol( pAct->GetColor(), pColParam ), sal_True );
aMtf.Insert( pAct, LIST_APPEND );
}
@@ -2273,7 +2273,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
if( !pAct->IsSetting() )
pAct->Duplicate();
else
- pAct = new MetaTextLineColorAction( pFncCol( pAct->GetColor(), pColParam ), TRUE );
+ pAct = new MetaTextLineColorAction( pFncCol( pAct->GetColor(), pColParam ), sal_True );
aMtf.Insert( pAct, LIST_APPEND );
}
@@ -2286,7 +2286,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
if( !pAct->IsSetting() )
pAct->Duplicate();
else
- pAct = new MetaOverlineColorAction( pFncCol( pAct->GetColor(), pColParam ), TRUE );
+ pAct = new MetaOverlineColorAction( pFncCol( pAct->GetColor(), pColParam ), sal_True );
aMtf.Insert( pAct, LIST_APPEND );
}
@@ -2467,7 +2467,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
void GDIMetaFile::Adjust( short nLuminancePercent, short nContrastPercent,
short nChannelRPercent, short nChannelGPercent,
- short nChannelBPercent, double fGamma, BOOL bInvert )
+ short nChannelBPercent, double fGamma, sal_Bool bInvert )
{
// nothing to do? => return quickly
if( nLuminancePercent || nContrastPercent ||
@@ -2478,9 +2478,9 @@ void GDIMetaFile::Adjust( short nLuminancePercent, short nContrastPercent,
ImplColAdjustParam aColParam;
ImplBmpAdjustParam aBmpParam;
- aColParam.pMapR = new BYTE[ 256 ];
- aColParam.pMapG = new BYTE[ 256 ];
- aColParam.pMapB = new BYTE[ 256 ];
+ aColParam.pMapR = new sal_uInt8[ 256 ];
+ aColParam.pMapG = new sal_uInt8[ 256 ];
+ aColParam.pMapB = new sal_uInt8[ 256 ];
// calculate slope
if( nContrastPercent >= 0 )
@@ -2498,14 +2498,14 @@ void GDIMetaFile::Adjust( short nLuminancePercent, short nContrastPercent,
// calculate gamma value
fGamma = ( fGamma <= 0.0 || fGamma > 10.0 ) ? 1.0 : ( 1.0 / fGamma );
- const BOOL bGamma = ( fGamma != 1.0 );
+ const sal_Bool bGamma = ( fGamma != 1.0 );
// create mapping table
for( long nX = 0L; nX < 256L; nX++ )
{
- aColParam.pMapR[ nX ] = (BYTE) MinMax( FRound( nX * fM + fROff ), 0L, 255L );
- aColParam.pMapG[ nX ] = (BYTE) MinMax( FRound( nX * fM + fGOff ), 0L, 255L );
- aColParam.pMapB[ nX ] = (BYTE) MinMax( FRound( nX * fM + fBOff ), 0L, 255L );
+ aColParam.pMapR[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fROff ), 0L, 255L );
+ aColParam.pMapG[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fGOff ), 0L, 255L );
+ aColParam.pMapB[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fBOff ), 0L, 255L );
if( bGamma )
{
@@ -2558,41 +2558,41 @@ void GDIMetaFile::Convert( MtfConversion eConversion )
// ------------------------------------------------------------------------
-void GDIMetaFile::ReplaceColors( const Color& rSearchColor, const Color& rReplaceColor, ULONG nTol )
+void GDIMetaFile::ReplaceColors( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol )
{
ReplaceColors( &rSearchColor, &rReplaceColor, 1, &nTol );
}
// ------------------------------------------------------------------------
-void GDIMetaFile::ReplaceColors( const Color* pSearchColors, const Color* pReplaceColors, ULONG nColorCount, ULONG* pTols )
+void GDIMetaFile::ReplaceColors( const Color* pSearchColors, const Color* pReplaceColors, sal_uLong nColorCount, sal_uLong* pTols )
{
ImplColReplaceParam aColParam;
ImplBmpReplaceParam aBmpParam;
- aColParam.pMinR = new ULONG[ nColorCount ];
- aColParam.pMaxR = new ULONG[ nColorCount ];
- aColParam.pMinG = new ULONG[ nColorCount ];
- aColParam.pMaxG = new ULONG[ nColorCount ];
- aColParam.pMinB = new ULONG[ nColorCount ];
- aColParam.pMaxB = new ULONG[ nColorCount ];
+ aColParam.pMinR = new sal_uLong[ nColorCount ];
+ aColParam.pMaxR = new sal_uLong[ nColorCount ];
+ aColParam.pMinG = new sal_uLong[ nColorCount ];
+ aColParam.pMaxG = new sal_uLong[ nColorCount ];
+ aColParam.pMinB = new sal_uLong[ nColorCount ];
+ aColParam.pMaxB = new sal_uLong[ nColorCount ];
- for( ULONG i = 0; i < nColorCount; i++ )
+ for( sal_uLong i = 0; i < nColorCount; i++ )
{
const long nTol = pTols ? ( pTols[ i ] * 255 ) / 100 : 0;
long nVal;
nVal = pSearchColors[ i ].GetRed();
- aColParam.pMinR[ i ] = (ULONG) Max( nVal - nTol, 0L );
- aColParam.pMaxR[ i ] = (ULONG) Min( nVal + nTol, 255L );
+ aColParam.pMinR[ i ] = (sal_uLong) Max( nVal - nTol, 0L );
+ aColParam.pMaxR[ i ] = (sal_uLong) Min( nVal + nTol, 255L );
nVal = pSearchColors[ i ].GetGreen();
- aColParam.pMinG[ i ] = (ULONG) Max( nVal - nTol, 0L );
- aColParam.pMaxG[ i ] = (ULONG) Min( nVal + nTol, 255L );
+ aColParam.pMinG[ i ] = (sal_uLong) Max( nVal - nTol, 0L );
+ aColParam.pMaxG[ i ] = (sal_uLong) Min( nVal + nTol, 255L );
nVal = pSearchColors[ i ].GetBlue();
- aColParam.pMinB[ i ] = (ULONG) Max( nVal - nTol, 0L );
- aColParam.pMaxB[ i ] = (ULONG) Min( nVal + nTol, 255L );
+ aColParam.pMinB[ i ] = (sal_uLong) Max( nVal - nTol, 0L );
+ aColParam.pMaxB[ i ] = (sal_uLong) Min( nVal + nTol, 255L );
}
aColParam.pDstCols = pReplaceColors;
@@ -2632,16 +2632,16 @@ GDIMetaFile GDIMetaFile::GetMonochromeMtf( const Color& rColor ) const
// ------------------------------------------------------------------------
-ULONG GDIMetaFile::GetChecksum() const
+sal_uLong GDIMetaFile::GetChecksum() const
{
GDIMetaFile aMtf;
SvMemoryStream aMemStm( 65535, 65535 );
ImplMetaWriteData aWriteData; aWriteData.meActualCharSet = aMemStm.GetStreamCharSet();
SVBT16 aBT16;
SVBT32 aBT32;
- ULONG nCrc = 0;
+ sal_uLong nCrc = 0;
- for( ULONG i = 0, nObjCount = GetActionCount(); i < nObjCount; i++ )
+ for( sal_uLong i = 0, nObjCount = GetActionCount(); i < nObjCount; i++ )
{
MetaAction* pAction = GetAction( i );
@@ -2912,11 +2912,11 @@ ULONG GDIMetaFile::GetChecksum() const
// ------------------------------------------------------------------------
-ULONG GDIMetaFile::GetSizeBytes() const
+sal_uLong GDIMetaFile::GetSizeBytes() const
{
- ULONG nSizeBytes = 0;
+ sal_uLong nSizeBytes = 0;
- for( ULONG i = 0, nObjCount = GetActionCount(); i < nObjCount; ++i )
+ for( sal_uLong i = 0, nObjCount = GetActionCount(); i < nObjCount; ++i )
{
MetaAction* pAction = GetAction( i );
@@ -2944,7 +2944,7 @@ ULONG GDIMetaFile::GetSizeBytes() const
{
const PolyPolygon& rPolyPoly = ( (MetaPolyPolygonAction*) pAction )->GetPolyPolygon();
- for( USHORT n = 0; n < rPolyPoly.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rPolyPoly.Count(); ++n )
nSizeBytes += ( rPolyPoly[ n ].GetSize() * sizeof( Point ) );
}
break;
@@ -2978,8 +2978,8 @@ SvStream& operator>>( SvStream& rIStm, GDIMetaFile& rGDIMetaFile )
if( !rIStm.GetError() )
{
char aId[ 7 ];
- ULONG nStmPos = rIStm.Tell();
- USHORT nOldFormat = rIStm.GetNumberFormatInt();
+ sal_uLong nStmPos = rIStm.Tell();
+ sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -2992,8 +2992,8 @@ SvStream& operator>>( SvStream& rIStm, GDIMetaFile& rGDIMetaFile )
// new format
VersionCompat* pCompat;
MetaAction* pAction;
- UINT32 nStmCompressMode = 0;
- UINT32 nCount = 0;
+ sal_uInt32 nStmCompressMode = 0;
+ sal_uInt32 nCount = 0;
pCompat = new VersionCompat( rIStm, STREAM_READ );
@@ -3007,7 +3007,7 @@ SvStream& operator>>( SvStream& rIStm, GDIMetaFile& rGDIMetaFile )
ImplMetaReadData aReadData;
aReadData.meActualCharSet = rIStm.GetStreamCharSet();
- for( UINT32 nAction = 0UL; ( nAction < nCount ) && !rIStm.IsEof(); nAction++ )
+ for( sal_uInt32 nAction = 0UL; ( nAction < nCount ) && !rIStm.IsEof(); nAction++ )
{
pAction = MetaAction::ReadMetaAction( rIStm, &aReadData );
@@ -3065,8 +3065,8 @@ SvStream& GDIMetaFile::Read( SvStream& rIStm )
SvStream& GDIMetaFile::Write( SvStream& rOStm )
{
VersionCompat* pCompat;
- const UINT32 nStmCompressMode = rOStm.GetCompressMode();
- USHORT nOldFormat = rOStm.GetNumberFormatInt();
+ const sal_uInt32 nStmCompressMode = rOStm.GetCompressMode();
+ sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt();
rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
rOStm.Write( "VCLMTF", 6 );
@@ -3076,7 +3076,7 @@ SvStream& GDIMetaFile::Write( SvStream& rOStm )
rOStm << nStmCompressMode;
rOStm << aPrefMapMode;
rOStm << aPrefSize;
- rOStm << (UINT32) GetActionCount();
+ rOStm << (sal_uInt32) GetActionCount();
delete pCompat;
@@ -3097,7 +3097,7 @@ SvStream& GDIMetaFile::Write( SvStream& rOStm )
// ------------------------------------------------------------------------
-BOOL GDIMetaFile::CreateThumbnail( sal_uInt32 nMaximumExtent,
+sal_Bool GDIMetaFile::CreateThumbnail( sal_uInt32 nMaximumExtent,
BitmapEx& rBmpEx,
const BitmapEx* pOverlay,
const Rectangle* pOverlayRect ) const
@@ -3214,7 +3214,7 @@ BOOL GDIMetaFile::CreateThumbnail( sal_uInt32 nMaximumExtent,
return !rBmpEx.IsEmpty();
}
-void GDIMetaFile::UseCanvas( BOOL _bUseCanvas )
+void GDIMetaFile::UseCanvas( sal_Bool _bUseCanvas )
{
bUseCanvas = _bUseCanvas;
}
@@ -3226,7 +3226,7 @@ MetaCommentAction* makePluggableRendererAction( const rtl::OUString& rRendererSe
const void* _pData,
sal_uInt32 nDataSize )
{
- const BYTE* pData=(BYTE*)_pData;
+ const sal_uInt8* pData=(sal_uInt8*)_pData;
// data gets copied twice, unfortunately
rtl::OString aRendererServiceName(
diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx
index 3a5b48ad2a0d..29b6a62253a6 100644
--- a/vcl/source/gdi/gfxlink.cxx
+++ b/vcl/source/gdi/gfxlink.cxx
@@ -65,7 +65,7 @@ GfxLink::GfxLink( const GfxLink& rGfxLink ) :
// ------------------------------------------------------------------------
-GfxLink::GfxLink( BYTE* pBuf, sal_uInt32 nSize, GfxLinkType nType, BOOL bOwns ) :
+GfxLink::GfxLink( sal_uInt8* pBuf, sal_uInt32 nSize, GfxLinkType nType, sal_Bool bOwns ) :
mpImpData( new ImpGfxLink )
{
DBG_ASSERT( (pBuf != NULL && nSize) || (!bOwns && nSize == 0),
@@ -167,7 +167,7 @@ GfxLinkType GfxLink::GetType() const
// ------------------------------------------------------------------------
-BOOL GfxLink::IsNative() const
+sal_Bool GfxLink::IsNative() const
{
return( meType >= GFX_LINK_FIRST_NATIVE_ID && meType <= GFX_LINK_LAST_NATIVE_ID );
}
@@ -181,7 +181,7 @@ sal_uInt32 GfxLink::GetDataSize() const
// ------------------------------------------------------------------------
-const BYTE* GfxLink::GetData() const
+const sal_uInt8* GfxLink::GetData() const
{
if( IsSwappedOut() )
( (GfxLink*) this )->SwapIn();
@@ -235,20 +235,20 @@ bool GfxLink::IsPrefMapModeValid()
// ------------------------------------------------------------------------
-BOOL GfxLink::LoadNative( Graphic& rGraphic )
+sal_Bool GfxLink::LoadNative( Graphic& rGraphic )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( IsNative() && mnBufSize )
{
- const BYTE* pData = GetData();
+ const sal_uInt8* pData = GetData();
if( pData )
{
SvMemoryStream aMemStm;
- ULONG nCvtType;
+ sal_uLong nCvtType;
- aMemStm.SetBuffer( (char*) pData, mnBufSize, FALSE, mnBufSize );
+ aMemStm.SetBuffer( (char*) pData, mnBufSize, sal_False, mnBufSize );
switch( meType )
{
@@ -264,7 +264,7 @@ BOOL GfxLink::LoadNative( Graphic& rGraphic )
}
if( nCvtType && ( GraphicConverter::Import( aMemStm, rGraphic, nCvtType ) == ERRCODE_NONE ) )
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -311,7 +311,7 @@ void GfxLink::SwapIn()
// ------------------------------------------------------------------------
-BOOL GfxLink::ExportNative( SvStream& rOStream ) const
+sal_Bool GfxLink::ExportNative( SvStream& rOStream ) const
{
if( GetDataSize() )
{
@@ -331,7 +331,7 @@ SvStream& operator<<( SvStream& rOStream, const GfxLink& rGfxLink )
VersionCompat* pCompat = new VersionCompat( rOStream, STREAM_WRITE, 2 );
// Version 1
- rOStream << (UINT16) rGfxLink.GetType() << rGfxLink.GetDataSize() << rGfxLink.GetUserId();
+ rOStream << (sal_uInt16) rGfxLink.GetType() << rGfxLink.GetDataSize() << rGfxLink.GetUserId();
// Version 2
rOStream << rGfxLink.GetPrefSize() << rGfxLink.GetPrefMapMode();
@@ -357,8 +357,8 @@ SvStream& operator>>( SvStream& rIStream, GfxLink& rGfxLink)
MapMode aMapMode;
sal_uInt32 nSize;
sal_uInt32 nUserId;
- UINT16 nType;
- BYTE* pBuf;
+ sal_uInt16 nType;
+ sal_uInt8* pBuf;
bool bMapAndSizeValid( false );
VersionCompat* pCompat = new VersionCompat( rIStream, STREAM_READ );
@@ -373,10 +373,10 @@ SvStream& operator>>( SvStream& rIStream, GfxLink& rGfxLink)
delete pCompat;
- pBuf = new BYTE[ nSize ];
+ pBuf = new sal_uInt8[ nSize ];
rIStream.Read( pBuf, nSize );
- rGfxLink = GfxLink( pBuf, nSize, (GfxLinkType) nType, TRUE );
+ rGfxLink = GfxLink( pBuf, nSize, (GfxLinkType) nType, sal_True );
rGfxLink.SetUserId( nUserId );
if( bMapAndSizeValid )
@@ -392,7 +392,7 @@ SvStream& operator>>( SvStream& rIStream, GfxLink& rGfxLink)
// - ImpSwap -
// -----------
-ImpSwap::ImpSwap( BYTE* pData, ULONG nDataSize ) :
+ImpSwap::ImpSwap( sal_uInt8* pData, sal_uLong nDataSize ) :
mnDataSize( nDataSize ),
mnRefCount( 1UL )
{
@@ -430,16 +430,16 @@ ImpSwap::~ImpSwap()
// ------------------------------------------------------------------------
-BYTE* ImpSwap::GetData() const
+sal_uInt8* ImpSwap::GetData() const
{
- BYTE* pData;
+ sal_uInt8* pData;
if( IsSwapped() )
{
SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( maURL, STREAM_READWRITE );
if( pIStm )
{
- pData = new BYTE[ mnDataSize ];
+ pData = new sal_uInt8[ mnDataSize ];
pIStm->Read( pData, mnDataSize );
sal_Bool bError = ( ERRCODE_NONE != pIStm->GetError() );
delete pIStm;
@@ -460,7 +460,7 @@ BYTE* ImpSwap::GetData() const
void ImpSwap::WriteTo( SvStream& rOStm ) const
{
- BYTE* pData = GetData();
+ sal_uInt8* pData = GetData();
if( pData )
{
diff --git a/vcl/source/gdi/gradient.cxx b/vcl/source/gdi/gradient.cxx
index 9c0d8ee07043..38d8ba4567a2 100644
--- a/vcl/source/gdi/gradient.cxx
+++ b/vcl/source/gdi/gradient.cxx
@@ -175,7 +175,7 @@ void Gradient::SetEndColor( const Color& rColor )
// -----------------------------------------------------------------------
-void Gradient::SetAngle( USHORT nAngle )
+void Gradient::SetAngle( sal_uInt16 nAngle )
{
DBG_CHKTHIS( Gradient, NULL );
@@ -185,7 +185,7 @@ void Gradient::SetAngle( USHORT nAngle )
// -----------------------------------------------------------------------
-void Gradient::SetBorder( USHORT nBorder )
+void Gradient::SetBorder( sal_uInt16 nBorder )
{
DBG_CHKTHIS( Gradient, NULL );
@@ -195,7 +195,7 @@ void Gradient::SetBorder( USHORT nBorder )
// -----------------------------------------------------------------------
-void Gradient::SetOfsX( USHORT nOfsX )
+void Gradient::SetOfsX( sal_uInt16 nOfsX )
{
DBG_CHKTHIS( Gradient, NULL );
@@ -205,7 +205,7 @@ void Gradient::SetOfsX( USHORT nOfsX )
// -----------------------------------------------------------------------
-void Gradient::SetOfsY( USHORT nOfsY )
+void Gradient::SetOfsY( sal_uInt16 nOfsY )
{
DBG_CHKTHIS( Gradient, NULL );
@@ -215,7 +215,7 @@ void Gradient::SetOfsY( USHORT nOfsY )
// -----------------------------------------------------------------------
-void Gradient::SetStartIntensity( USHORT nIntens )
+void Gradient::SetStartIntensity( sal_uInt16 nIntens )
{
DBG_CHKTHIS( Gradient, NULL );
@@ -225,7 +225,7 @@ void Gradient::SetStartIntensity( USHORT nIntens )
// -----------------------------------------------------------------------
-void Gradient::SetEndIntensity( USHORT nIntens )
+void Gradient::SetEndIntensity( sal_uInt16 nIntens )
{
DBG_CHKTHIS( Gradient, NULL );
@@ -235,7 +235,7 @@ void Gradient::SetEndIntensity( USHORT nIntens )
// -----------------------------------------------------------------------
-void Gradient::SetSteps( USHORT nSteps )
+void Gradient::SetSteps( sal_uInt16 nSteps )
{
DBG_CHKTHIS( Gradient, NULL );
@@ -248,7 +248,7 @@ void Gradient::SetSteps( USHORT nSteps )
void Gradient::GetBoundRect( const Rectangle& rRect, Rectangle& rBoundRect, Point& rCenter ) const
{
Rectangle aRect( rRect );
- USHORT nAngle = GetAngle() % 3600;
+ sal_uInt16 nAngle = GetAngle() % 3600;
if( GetStyle() == GRADIENT_LINEAR || GetStyle() == GRADIENT_AXIAL )
{
@@ -359,13 +359,13 @@ Gradient& Gradient::operator=( const Gradient& rGradient )
// -----------------------------------------------------------------------
-BOOL Gradient::operator==( const Gradient& rGradient ) const
+sal_Bool Gradient::operator==( const Gradient& rGradient ) const
{
DBG_CHKTHIS( Gradient, NULL );
DBG_CHKOBJ( &rGradient, Gradient, NULL );
if ( mpImplGradient == rGradient.mpImplGradient )
- return TRUE;
+ return sal_True;
if ( (mpImplGradient->meStyle == rGradient.mpImplGradient->meStyle) ||
(mpImplGradient->mnAngle == rGradient.mpImplGradient->mnAngle) ||
@@ -377,15 +377,15 @@ BOOL Gradient::operator==( const Gradient& rGradient ) const
(mpImplGradient->mnIntensityEnd == rGradient.mpImplGradient->mnIntensityEnd) ||
(mpImplGradient->maStartColor == rGradient.mpImplGradient->maStartColor) ||
(mpImplGradient->maEndColor == rGradient.mpImplGradient->maEndColor) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
SvStream& operator>>( SvStream& rIStm, Impl_Gradient& rImpl_Gradient )
{
VersionCompat aCompat( rIStm, STREAM_READ );
- UINT16 nTmp16;
+ sal_uInt16 nTmp16;
rIStm >> nTmp16; rImpl_Gradient.meStyle = (GradientStyle) nTmp16;
@@ -408,7 +408,7 @@ SvStream& operator<<( SvStream& rOStm, const Impl_Gradient& rImpl_Gradient )
{
VersionCompat aCompat( rOStm, STREAM_WRITE, 1 );
- rOStm << (UINT16) rImpl_Gradient.meStyle <<
+ rOStm << (sal_uInt16) rImpl_Gradient.meStyle <<
rImpl_Gradient.maStartColor <<
rImpl_Gradient.maEndColor <<
rImpl_Gradient.mnAngle <<
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index e6bb0b1e3e8a..f61bbf8dc041 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -60,11 +60,11 @@ static void ImplDrawDefault( OutputDevice* pOutDev, const UniString* pText,
Font* pFont, const Bitmap* pBitmap, const BitmapEx* pBitmapEx,
const Point& rDestPt, const Size& rDestSize )
{
- USHORT nPixel = (USHORT) pOutDev->PixelToLogic( Size( 1, 1 ) ).Width();
- USHORT nPixelWidth = nPixel;
+ sal_uInt16 nPixel = (sal_uInt16) pOutDev->PixelToLogic( Size( 1, 1 ) ).Width();
+ sal_uInt16 nPixelWidth = nPixel;
Point aPoint( rDestPt.X() + nPixelWidth, rDestPt.Y() + nPixelWidth );
Size aSize( rDestSize.Width() - ( nPixelWidth << 1 ), rDestSize.Height() - ( nPixelWidth << 1 ) );
- BOOL bFilled = ( pBitmap != NULL || pBitmapEx != NULL || pFont != NULL );
+ sal_Bool bFilled = ( pBitmap != NULL || pBitmapEx != NULL || pFont != NULL );
Rectangle aBorderRect( aPoint, aSize );
pOutDev->Push();
@@ -139,8 +139,8 @@ static void ImplDrawDefault( OutputDevice* pOutDev, const UniString* pText,
if ( nTextWidth <= nWidth || aSz.Height() <= nThreshold )
{
- USHORT nStart = 0;
- USHORT nLen = 0;
+ sal_uInt16 nStart = 0;
+ sal_uInt16 nLen = 0;
while( nStart < pText->Len() && pText->GetChar( nStart ) == ' ' )
nStart++;
@@ -148,7 +148,7 @@ static void ImplDrawDefault( OutputDevice* pOutDev, const UniString* pText,
nLen++;
while( nStart < pText->Len() && nLines-- )
{
- USHORT nNext = nLen;
+ sal_uInt16 nNext = nLen;
do
{
while ( nStart+nNext < pText->Len() && pText->GetChar( nStart+nNext ) == ' ' )
@@ -162,14 +162,14 @@ static void ImplDrawDefault( OutputDevice* pOutDev, const UniString* pText,
}
while ( nStart+nNext < pText->Len() );
- USHORT n = nLen;
+ sal_uInt16 n = nLen;
nTextWidth = pOutDev->GetTextWidth( *pText, nStart, n );
while( nTextWidth > aSize.Width() )
nTextWidth = pOutDev->GetTextWidth( *pText, nStart, --n );
pOutDev->DrawText( aPoint, *pText, nStart, n );
aPoint.Y() += nTextHeight;
- nStart = sal::static_int_cast<USHORT>(nStart + nLen);
+ nStart = sal::static_int_cast<sal_uInt16>(nStart + nLen);
nLen = nNext-nLen;
while( nStart < pText->Len() && pText->GetChar( nStart ) == ' ' )
{
@@ -335,21 +335,21 @@ Graphic& Graphic::operator=( const Graphic& rGraphic )
// ------------------------------------------------------------------------
-BOOL Graphic::operator==( const Graphic& rGraphic ) const
+sal_Bool Graphic::operator==( const Graphic& rGraphic ) const
{
return( *mpImpGraphic == *rGraphic.mpImpGraphic );
}
// ------------------------------------------------------------------------
-BOOL Graphic::operator!=( const Graphic& rGraphic ) const
+sal_Bool Graphic::operator!=( const Graphic& rGraphic ) const
{
return( *mpImpGraphic != *rGraphic.mpImpGraphic );
}
// ------------------------------------------------------------------------
-BOOL Graphic::operator!() const
+sal_Bool Graphic::operator!() const
{
return( GRAPHIC_NONE == mpImpGraphic->ImplGetType() );
}
@@ -400,28 +400,28 @@ void Graphic::SetDefaultType()
// ------------------------------------------------------------------------
-BOOL Graphic::IsSupportedGraphic() const
+sal_Bool Graphic::IsSupportedGraphic() const
{
return mpImpGraphic->ImplIsSupportedGraphic();
}
// ------------------------------------------------------------------------
-BOOL Graphic::IsTransparent() const
+sal_Bool Graphic::IsTransparent() const
{
return mpImpGraphic->ImplIsTransparent();
}
// ------------------------------------------------------------------------
-BOOL Graphic::IsAlpha() const
+sal_Bool Graphic::IsAlpha() const
{
return mpImpGraphic->ImplIsAlpha();
}
// ------------------------------------------------------------------------
-BOOL Graphic::IsAnimated() const
+sal_Bool Graphic::IsAnimated() const
{
return mpImpGraphic->ImplIsAnimated();
}
@@ -532,7 +532,7 @@ Size Graphic::GetSizePixel( const OutputDevice* pRefDevice ) const
// ------------------------------------------------------------------
-ULONG Graphic::GetSizeBytes() const
+sal_uLong Graphic::GetSizeBytes() const
{
return mpImpGraphic->ImplGetSizeBytes();
}
@@ -616,7 +616,7 @@ Link Graphic::GetAnimationNotifyHdl() const
// ------------------------------------------------------------------------
-ULONG Graphic::GetAnimationLoopCount() const
+sal_uLong Graphic::GetAnimationLoopCount() const
{
return mpImpGraphic->ImplGetAnimationLoopCount();
}
@@ -651,20 +651,20 @@ void Graphic::SetContext( GraphicReader* pReader )
// ------------------------------------------------------------------------
-USHORT Graphic::GetGraphicsCompressMode( SvStream& rIStm )
+sal_uInt16 Graphic::GetGraphicsCompressMode( SvStream& rIStm )
{
- const ULONG nPos = rIStm.Tell();
- const USHORT nOldFormat = rIStm.GetNumberFormatInt();
- UINT32 nTmp32;
- UINT16 nTmp16;
- USHORT nCompressMode = COMPRESSMODE_NONE;
+ const sal_uLong nPos = rIStm.Tell();
+ const sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
+ sal_uInt32 nTmp32;
+ sal_uInt16 nTmp16;
+ sal_uInt16 nCompressMode = COMPRESSMODE_NONE;
rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
rIStm >> nTmp32;
// is it a swapped graphic with a bitmap?
- rIStm.SeekRel( (nTmp32 == (UINT32) GRAPHIC_BITMAP ) ? 40 : -4 );
+ rIStm.SeekRel( (nTmp32 == (sal_uInt32) GRAPHIC_BITMAP ) ? 40 : -4 );
// try to read bitmap id
rIStm >> nTmp16;
@@ -689,7 +689,7 @@ USHORT Graphic::GetGraphicsCompressMode( SvStream& rIStm )
// ------------------------------------------------------------------------
-void Graphic::SetDocFileName( const String& rName, ULONG nFilePos )
+void Graphic::SetDocFileName( const String& rName, sal_uLong nFilePos )
{
mpImpGraphic->ImplSetDocFileName( rName, nFilePos );
}
@@ -703,14 +703,14 @@ const String& Graphic::GetDocFileName() const
// ------------------------------------------------------------------------
-ULONG Graphic::GetDocFilePos() const
+sal_uLong Graphic::GetDocFilePos() const
{
return mpImpGraphic->ImplGetDocFilePos();
}
// ------------------------------------------------------------------------
-BOOL Graphic::ReadEmbedded( SvStream& rIStream, BOOL bSwap )
+sal_Bool Graphic::ReadEmbedded( SvStream& rIStream, sal_Bool bSwap )
{
ImplTestRefCount();
return mpImpGraphic->ImplReadEmbedded( rIStream, bSwap );
@@ -718,7 +718,7 @@ BOOL Graphic::ReadEmbedded( SvStream& rIStream, BOOL bSwap )
// ------------------------------------------------------------------------
-BOOL Graphic::WriteEmbedded( SvStream& rOStream )
+sal_Bool Graphic::WriteEmbedded( SvStream& rOStream )
{
ImplTestRefCount();
return mpImpGraphic->ImplWriteEmbedded( rOStream );
@@ -726,7 +726,7 @@ BOOL Graphic::WriteEmbedded( SvStream& rOStream )
// ------------------------------------------------------------------------
-BOOL Graphic::SwapOut()
+sal_Bool Graphic::SwapOut()
{
ImplTestRefCount();
return mpImpGraphic->ImplSwapOut();
@@ -734,7 +734,7 @@ BOOL Graphic::SwapOut()
// ------------------------------------------------------------------------
-BOOL Graphic::SwapOut( SvStream* pOStream )
+sal_Bool Graphic::SwapOut( SvStream* pOStream )
{
ImplTestRefCount();
return mpImpGraphic->ImplSwapOut( pOStream );
@@ -742,7 +742,7 @@ BOOL Graphic::SwapOut( SvStream* pOStream )
// ------------------------------------------------------------------------
-BOOL Graphic::SwapIn()
+sal_Bool Graphic::SwapIn()
{
ImplTestRefCount();
return mpImpGraphic->ImplSwapIn();
@@ -750,7 +750,7 @@ BOOL Graphic::SwapIn()
// ------------------------------------------------------------------------
-BOOL Graphic::SwapIn( SvStream* pStrm )
+sal_Bool Graphic::SwapIn( SvStream* pStrm )
{
ImplTestRefCount();
return mpImpGraphic->ImplSwapIn( pStrm );
@@ -758,7 +758,7 @@ BOOL Graphic::SwapIn( SvStream* pStrm )
// ------------------------------------------------------------------------
-BOOL Graphic::IsSwapOut() const
+sal_Bool Graphic::IsSwapOut() const
{
return mpImpGraphic->ImplIsSwapOut();
}
@@ -780,21 +780,21 @@ GfxLink Graphic::GetLink() const
// ------------------------------------------------------------------------
-BOOL Graphic::IsLink() const
+sal_Bool Graphic::IsLink() const
{
return mpImpGraphic->ImplIsLink();
}
// ------------------------------------------------------------------------
-ULONG Graphic::GetChecksum() const
+sal_uLong Graphic::GetChecksum() const
{
return mpImpGraphic->ImplGetChecksum();
}
// ------------------------------------------------------------------------
-BOOL Graphic::ExportNative( SvStream& rOStream ) const
+sal_Bool Graphic::ExportNative( SvStream& rOStream ) const
{
return mpImpGraphic->ImplExportNative( rOStream );
}
diff --git a/vcl/source/gdi/graphictools.cxx b/vcl/source/gdi/graphictools.cxx
index 08533663c562..2e20a3639790 100644
--- a/vcl/source/gdi/graphictools.cxx
+++ b/vcl/source/gdi/graphictools.cxx
@@ -35,7 +35,7 @@
static ::rtl::OString polyToString( const Polygon& rPoly )
{
::rtl::OString aStr;
- USHORT nVertex;
+ sal_uInt16 nVertex;
for(nVertex=0; nVertex<rPoly.GetSize(); ++nVertex)
{
aStr += "(";
@@ -67,7 +67,7 @@ static ::rtl::OString polyToString( const Polygon& rPoly )
static ::rtl::OString polyPolyToString( const PolyPolygon& rPolyPoly )
{
::rtl::OString aStr;
- USHORT nPoly;
+ sal_uInt16 nPoly;
for(nPoly=0; nPoly<rPolyPoly.Count(); ++nPoly)
{
const Polygon& rPoly = rPolyPoly[nPoly];
@@ -328,9 +328,9 @@ SvStream& operator<<( SvStream& rOStm, const SvtGraphicStroke& rClass )
rClass.maEndArrow.Write( rOStm );
rOStm << rClass.mfTransparency;
rOStm << rClass.mfStrokeWidth;
- UINT16 nTmp = sal::static_int_cast<UINT16>( rClass.maCapType );
+ sal_uInt16 nTmp = sal::static_int_cast<sal_uInt16>( rClass.maCapType );
rOStm << nTmp;
- nTmp = sal::static_int_cast<UINT16>( rClass.maJoinType );
+ nTmp = sal::static_int_cast<sal_uInt16>( rClass.maJoinType );
rOStm << nTmp;
rOStm << rClass.mfMiterLimit;
@@ -351,7 +351,7 @@ SvStream& operator>>( SvStream& rIStm, SvtGraphicStroke& rClass )
rClass.maEndArrow.Read( rIStm );
rIStm >> rClass.mfTransparency;
rIStm >> rClass.mfStrokeWidth;
- UINT16 nTmp;
+ sal_uInt16 nTmp;
rIStm >> nTmp;
rClass.maCapType = SvtGraphicStroke::CapType(nTmp);
rIStm >> nTmp;
@@ -707,19 +707,19 @@ SvStream& operator<<( SvStream& rOStm, const SvtGraphicFill& rClass )
rClass.maPath.Write( rOStm );
rOStm << rClass.maFillColor;
rOStm << rClass.mfTransparency;
- UINT16 nTmp = sal::static_int_cast<UINT16>( rClass.maFillRule );
+ sal_uInt16 nTmp = sal::static_int_cast<sal_uInt16>( rClass.maFillRule );
rOStm << nTmp;
- nTmp = sal::static_int_cast<UINT16>( rClass.maFillType );
+ nTmp = sal::static_int_cast<sal_uInt16>( rClass.maFillType );
rOStm << nTmp;
int i;
for(i=0; i<SvtGraphicFill::Transform::MatrixSize; ++i)
rOStm << rClass.maFillTransform.matrix[i];
nTmp = rClass.mbTiling;
rOStm << nTmp;
- nTmp = sal::static_int_cast<UINT16>( rClass.maHatchType );
+ nTmp = sal::static_int_cast<sal_uInt16>( rClass.maHatchType );
rOStm << nTmp;
rOStm << rClass.maHatchColor;
- nTmp = sal::static_int_cast<UINT16>( rClass.maGradientType );
+ nTmp = sal::static_int_cast<sal_uInt16>( rClass.maGradientType );
rOStm << nTmp;
rOStm << rClass.maGradient1stColor;
rOStm << rClass.maGradient2ndColor;
@@ -736,7 +736,7 @@ SvStream& operator>>( SvStream& rIStm, SvtGraphicFill& rClass )
rClass.maPath.Read( rIStm );
rIStm >> rClass.maFillColor;
rIStm >> rClass.mfTransparency;
- UINT16 nTmp;
+ sal_uInt16 nTmp;
rIStm >> nTmp;
rClass.maFillRule = SvtGraphicFill::FillRule( nTmp );
rIStm >> nTmp;
diff --git a/vcl/source/gdi/hatch.cxx b/vcl/source/gdi/hatch.cxx
index 00b3d13991fd..9836b2e6e4b4 100644
--- a/vcl/source/gdi/hatch.cxx
+++ b/vcl/source/gdi/hatch.cxx
@@ -82,7 +82,7 @@ Hatch::Hatch( const Hatch& rHatch )
// -----------------------------------------------------------------------
Hatch::Hatch( HatchStyle eStyle, const Color& rColor,
- long nDistance, USHORT nAngle10 )
+ long nDistance, sal_uInt16 nAngle10 )
{
DBG_CTOR( Hatch, NULL );
mpImplHatch = new ImplHatch;
@@ -119,7 +119,7 @@ Hatch& Hatch::operator=( const Hatch& rHatch )
// -----------------------------------------------------------------------
-BOOL Hatch::operator==( const Hatch& rHatch ) const
+sal_Bool Hatch::operator==( const Hatch& rHatch ) const
{
DBG_CHKTHIS( Hatch, NULL );
DBG_CHKOBJ( &rHatch, Hatch, NULL );
@@ -173,7 +173,7 @@ void Hatch::SetDistance( long nDistance )
// -----------------------------------------------------------------------
-void Hatch::SetAngle( USHORT nAngle10 )
+void Hatch::SetAngle( sal_uInt16 nAngle10 )
{
DBG_CHKTHIS( Hatch, NULL );
ImplMakeUnique();
@@ -185,7 +185,7 @@ void Hatch::SetAngle( USHORT nAngle10 )
SvStream& operator>>( SvStream& rIStm, ImplHatch& rImplHatch )
{
VersionCompat aCompat( rIStm, STREAM_READ );
- UINT16 nTmp16;
+ sal_uInt16 nTmp16;
rIStm >> nTmp16; rImplHatch.meStyle = (HatchStyle) nTmp16;
rIStm >> rImplHatch.maColor >> rImplHatch.mnDistance >> rImplHatch.mnAngle;
@@ -199,7 +199,7 @@ SvStream& operator<<( SvStream& rOStm, const ImplHatch& rImplHatch )
{
VersionCompat aCompat( rOStm, STREAM_WRITE, 1 );
- rOStm << (UINT16) rImplHatch.meStyle << rImplHatch.maColor;
+ rOStm << (sal_uInt16) rImplHatch.meStyle << rImplHatch.maColor;
rOStm << rImplHatch.mnDistance << rImplHatch.mnAngle;
return rOStm;
diff --git a/vcl/source/gdi/image.cxx b/vcl/source/gdi/image.cxx
index f5e686a71c38..24c86c326910 100644
--- a/vcl/source/gdi/image.cxx
+++ b/vcl/source/gdi/image.cxx
@@ -82,7 +82,7 @@ Image::Image( const ResId& rResId ) :
pResMgr->Increment( sizeof( RSHEADER_TYPE ) );
BitmapEx aBmpEx;
- ULONG nObjMask = pResMgr->ReadLong();
+ sal_uLong nObjMask = pResMgr->ReadLong();
if( nObjMask & RSC_IMAGE_IMAGEBITMAP )
{
@@ -285,7 +285,7 @@ void Image::Invert()
// -----------------------------------------------------------------------
void Image::GetColorTransformArrays( ImageColorTransform eColorTransform,
- Color*& rpSrcColor, Color*& rpDstColor, ULONG& rColorCount )
+ Color*& rpSrcColor, Color*& rpDstColor, sal_uLong& rColorCount )
{
if( IMAGECOLORTRANSFORM_HIGHCONTRAST == eColorTransform )
{
@@ -332,7 +332,7 @@ Image& Image::operator=( const Image& rImage )
// -----------------------------------------------------------------------
-BOOL Image::operator==( const Image& rImage ) const
+sal_Bool Image::operator==( const Image& rImage ) const
{
DBG_CHKTHIS( Image, NULL );
DBG_CHKOBJ( &rImage, Image, NULL );
@@ -370,7 +370,7 @@ BOOL Image::operator==( const Image& rImage ) const
// - ImageList -
// -------------
-ImageList::ImageList( USHORT nInit, USHORT nGrow ) :
+ImageList::ImageList( sal_uInt16 nInit, sal_uInt16 nGrow ) :
mpImplData( NULL ),
mnInitSize( nInit ),
mnGrowSize( nGrow )
@@ -397,7 +397,7 @@ ImageList::ImageList( const ResId& rResId ) :
{
pResMgr->Increment( sizeof( RSHEADER_TYPE ) );
- ULONG nObjMask = pResMgr->ReadLong();
+ sal_uLong nObjMask = pResMgr->ReadLong();
const String aPrefix( pResMgr->ReadString() );
::boost::scoped_ptr< Color > spMaskColor;
@@ -413,13 +413,13 @@ ImageList::ImageList( const ResId& rResId ) :
}
sal_Int32 nCount = pResMgr->ReadLong();
- ImplInit( static_cast< USHORT >( nCount ), Size() );
+ ImplInit( static_cast< sal_uInt16 >( nCount ), Size() );
BitmapEx aEmpty;
for( sal_Int32 i = 0; i < nCount; ++i )
{
rtl::OUString aName = pResMgr->ReadString();
- USHORT nId = static_cast< USHORT >( pResMgr->ReadLong() );
+ sal_uInt16 nId = static_cast< sal_uInt16 >( pResMgr->ReadLong() );
mpImplData->AddImage( aName, nId, aEmpty );
}
@@ -441,12 +441,12 @@ ImageList::ImageList( const ::std::vector< ::rtl::OUString >& rNameVector,
DBG_CTOR( ImageList, NULL );
- ImplInit( sal::static_int_cast< USHORT >( rNameVector.size() ), Size() );
+ ImplInit( sal::static_int_cast< sal_uInt16 >( rNameVector.size() ), Size() );
mpImplData->maPrefix = rPrefix;
for( sal_uInt32 i = 0; i < rNameVector.size(); ++i )
{
- mpImplData->AddImage( rNameVector[ i ], static_cast< USHORT >( i ) + 1, BitmapEx() );
+ mpImplData->AddImage( rNameVector[ i ], static_cast< sal_uInt16 >( i ) + 1, BitmapEx() );
}
}
@@ -473,7 +473,7 @@ ImageList::~ImageList()
delete mpImplData;
}
-void ImageList::ImplInit( USHORT nItems, const Size &rSize )
+void ImageList::ImplInit( sal_uInt16 nItems, const Size &rSize )
{
mpImplData = new ImplImageList;
mpImplData->mnRefCount = 1;
@@ -525,13 +525,13 @@ void ImageList::ImplMakeUnique()
BitmapEx ImageList::GetAsHorizontalStrip() const
{
Size aSize( mpImplData->maImageSize );
- USHORT nCount = GetImageCount();
+ sal_uInt16 nCount = GetImageCount();
if( !nCount )
return BitmapEx();
aSize.Width() *= nCount;
// Load any stragglers
- for (USHORT nIdx = 0; nIdx < nCount; nIdx++)
+ for (sal_uInt16 nIdx = 0; nIdx < nCount; nIdx++)
{
ImageAryData *pData = mpImplData->maImages[ nIdx ];
if( pData->IsLoadable() )
@@ -549,7 +549,7 @@ BitmapEx ImageList::GetAsHorizontalStrip() const
aResult = BitmapEx( aPixels );
Rectangle aSrcRect( Point( 0, 0 ), mpImplData->maImageSize );
- for (USHORT nIdx = 0; nIdx < nCount; nIdx++)
+ for (sal_uInt16 nIdx = 0; nIdx < nCount; nIdx++)
{
Rectangle aDestRect( Point( nIdx * mpImplData->maImageSize.Width(), 0 ),
mpImplData->maImageSize );
@@ -565,7 +565,7 @@ BitmapEx ImageList::GetAsHorizontalStrip() const
void ImageList::InsertFromHorizontalStrip( const BitmapEx &rBitmapEx,
const std::vector< rtl::OUString > &rNameVector )
{
- USHORT nItems = sal::static_int_cast< USHORT >( rNameVector.size() );
+ sal_uInt16 nItems = sal::static_int_cast< sal_uInt16 >( rNameVector.size() );
if (!nItems)
return;
@@ -576,7 +576,7 @@ void ImageList::InsertFromHorizontalStrip( const BitmapEx &rBitmapEx,
aSize.Width() /= nItems;
ImplInit( nItems, aSize );
- for (USHORT nIdx = 0; nIdx < nItems; nIdx++)
+ for (sal_uInt16 nIdx = 0; nIdx < nItems; nIdx++)
{
BitmapEx aBitmap( rBitmapEx, Point( nIdx * aSize.Width(), 0 ), aSize );
mpImplData->AddImage( rNameVector[ nIdx ], nIdx + 1, aBitmap );
@@ -586,11 +586,11 @@ void ImageList::InsertFromHorizontalStrip( const BitmapEx &rBitmapEx,
// -----------------------------------------------------------------------
void ImageList::InsertFromHorizontalBitmap( const ResId& rResId,
- USHORT nCount,
+ sal_uInt16 nCount,
const Color *pMaskColor,
const Color *pSearchColors,
const Color *pReplaceColors,
- ULONG nColorCount)
+ sal_uLong nColorCount)
{
BitmapEx aBmpEx( rResId );
if (!aBmpEx.IsTransparent())
@@ -609,7 +609,7 @@ void ImageList::InsertFromHorizontalBitmap( const ResId& rResId,
// -----------------------------------------------------------------------
-USHORT ImageList::ImplGetImageId( const ::rtl::OUString& rImageName ) const
+sal_uInt16 ImageList::ImplGetImageId( const ::rtl::OUString& rImageName ) const
{
DBG_CHKTHIS( ImageList, NULL );
@@ -622,7 +622,7 @@ USHORT ImageList::ImplGetImageId( const ::rtl::OUString& rImageName ) const
// -----------------------------------------------------------------------
-void ImageList::AddImage( USHORT nId, const Image& rImage )
+void ImageList::AddImage( sal_uInt16 nId, const Image& rImage )
{
DBG_CHKTHIS( ImageList, NULL );
DBG_CHKOBJ( &rImage, Image, NULL );
@@ -652,7 +652,7 @@ void ImageList::AddImage( const ::rtl::OUString& rImageName, const Image& rImage
// -----------------------------------------------------------------------
-void ImageList::ReplaceImage( USHORT nId, const Image& rImage )
+void ImageList::ReplaceImage( sal_uInt16 nId, const Image& rImage )
{
DBG_CHKTHIS( ImageList, NULL );
DBG_CHKOBJ( &rImage, Image, NULL );
@@ -666,7 +666,7 @@ void ImageList::ReplaceImage( USHORT nId, const Image& rImage )
void ImageList::ReplaceImage( const ::rtl::OUString& rImageName, const Image& rImage )
{
- const USHORT nId = ImplGetImageId( rImageName );
+ const sal_uInt16 nId = ImplGetImageId( rImageName );
if( nId )
{
@@ -680,14 +680,14 @@ void ImageList::ReplaceImage( const ::rtl::OUString& rImageName, const Image& rI
// -----------------------------------------------------------------------
-void ImageList::ReplaceImage( USHORT nId, USHORT nReplaceId )
+void ImageList::ReplaceImage( sal_uInt16 nId, sal_uInt16 nReplaceId )
{
DBG_CHKTHIS( ImageList, NULL );
DBG_ASSERT( GetImagePos( nId ) != IMAGELIST_IMAGE_NOTFOUND, "ImageList::ReplaceImage(): Unknown nId" );
DBG_ASSERT( GetImagePos( nReplaceId ) != IMAGELIST_IMAGE_NOTFOUND, "ImageList::ReplaceImage(): Unknown nReplaceId" );
- ULONG nPosDest = GetImagePos( nId );
- ULONG nPosSrc = GetImagePos( nReplaceId );
+ sal_uLong nPosDest = GetImagePos( nId );
+ sal_uLong nPosSrc = GetImagePos( nReplaceId );
if( nPosDest != IMAGELIST_IMAGE_NOTFOUND &&
nPosSrc != IMAGELIST_IMAGE_NOTFOUND )
{
@@ -700,7 +700,7 @@ void ImageList::ReplaceImage( USHORT nId, USHORT nReplaceId )
void ImageList::ReplaceImage( const ::rtl::OUString& rImageName, const ::rtl::OUString& rReplaceName )
{
- const USHORT nId1 = ImplGetImageId( rImageName ), nId2 = ImplGetImageId( rReplaceName );
+ const sal_uInt16 nId1 = ImplGetImageId( rImageName ), nId2 = ImplGetImageId( rReplaceName );
if( nId1 && nId2 )
ReplaceImage( nId1, nId2 );
@@ -708,7 +708,7 @@ void ImageList::ReplaceImage( const ::rtl::OUString& rImageName, const ::rtl::OU
// -----------------------------------------------------------------------
-void ImageList::RemoveImage( USHORT nId )
+void ImageList::RemoveImage( sal_uInt16 nId )
{
DBG_CHKTHIS( ImageList, NULL );
@@ -716,7 +716,7 @@ void ImageList::RemoveImage( USHORT nId )
{
if( mpImplData->maImages[ i ]->mnId == nId )
{
- mpImplData->RemoveImage( static_cast< USHORT >( i ) );
+ mpImplData->RemoveImage( static_cast< sal_uInt16 >( i ) );
break;
}
}
@@ -726,7 +726,7 @@ void ImageList::RemoveImage( USHORT nId )
void ImageList::RemoveImage( const ::rtl::OUString& rImageName )
{
- const USHORT nId = ImplGetImageId( rImageName );
+ const sal_uInt16 nId = ImplGetImageId( rImageName );
if( nId )
RemoveImage( nId );
@@ -734,7 +734,7 @@ void ImageList::RemoveImage( const ::rtl::OUString& rImageName )
// -----------------------------------------------------------------------
-Image ImageList::GetImage( USHORT nId ) const
+Image ImageList::GetImage( sal_uInt16 nId ) const
{
DBG_CHKTHIS( ImageList, NULL );
@@ -800,16 +800,16 @@ void ImageList::Clear()
// -----------------------------------------------------------------------
-USHORT ImageList::GetImageCount() const
+sal_uInt16 ImageList::GetImageCount() const
{
DBG_CHKTHIS( ImageList, NULL );
- return mpImplData ? static_cast< USHORT >( mpImplData->maImages.size() ) : 0;
+ return mpImplData ? static_cast< sal_uInt16 >( mpImplData->maImages.size() ) : 0;
}
// -----------------------------------------------------------------------
-USHORT ImageList::GetImagePos( USHORT nId ) const
+sal_uInt16 ImageList::GetImagePos( sal_uInt16 nId ) const
{
DBG_CHKTHIS( ImageList, NULL );
@@ -818,21 +818,21 @@ USHORT ImageList::GetImagePos( USHORT nId ) const
for( sal_uInt32 i = 0; i < mpImplData->maImages.size(); ++i )
{
if (mpImplData->maImages[ i ]->mnId == nId)
- return static_cast< USHORT >( i );
+ return static_cast< sal_uInt16 >( i );
}
}
return IMAGELIST_IMAGE_NOTFOUND;
}
-bool ImageList::HasImageAtPos( USHORT nId ) const
+bool ImageList::HasImageAtPos( sal_uInt16 nId ) const
{
return GetImagePos( nId ) != IMAGELIST_IMAGE_NOTFOUND;
}
// -----------------------------------------------------------------------
-USHORT ImageList::GetImagePos( const ::rtl::OUString& rImageName ) const
+sal_uInt16 ImageList::GetImagePos( const ::rtl::OUString& rImageName ) const
{
DBG_CHKTHIS( ImageList, NULL );
@@ -841,7 +841,7 @@ USHORT ImageList::GetImagePos( const ::rtl::OUString& rImageName ) const
for( sal_uInt32 i = 0; i < mpImplData->maImages.size(); i++ )
{
if (mpImplData->maImages[i]->maName == rImageName)
- return static_cast< USHORT >( i );
+ return static_cast< sal_uInt16 >( i );
}
}
@@ -850,7 +850,7 @@ USHORT ImageList::GetImagePos( const ::rtl::OUString& rImageName ) const
// -----------------------------------------------------------------------
-USHORT ImageList::GetImageId( USHORT nPos ) const
+sal_uInt16 ImageList::GetImageId( sal_uInt16 nPos ) const
{
DBG_CHKTHIS( ImageList, NULL );
@@ -862,13 +862,13 @@ USHORT ImageList::GetImageId( USHORT nPos ) const
// -----------------------------------------------------------------------
-void ImageList::GetImageIds( ::std::vector< USHORT >& rIds ) const
+void ImageList::GetImageIds( ::std::vector< sal_uInt16 >& rIds ) const
{
RTL_LOGFILE_CONTEXT( aLog, "vcl: ImageList::GetImageIds" );
DBG_CHKTHIS( ImageList, NULL );
- rIds = ::std::vector< USHORT >();
+ rIds = ::std::vector< sal_uInt16 >();
if( mpImplData )
{
@@ -879,7 +879,7 @@ void ImageList::GetImageIds( ::std::vector< USHORT >& rIds ) const
// -----------------------------------------------------------------------
-::rtl::OUString ImageList::GetImageName( USHORT nPos ) const
+::rtl::OUString ImageList::GetImageName( sal_uInt16 nPos ) const
{
DBG_CHKTHIS( ImageList, NULL );
@@ -953,7 +953,7 @@ ImageList& ImageList::operator=( const ImageList& rImageList )
// -----------------------------------------------------------------------
-BOOL ImageList::operator==( const ImageList& rImageList ) const
+sal_Bool ImageList::operator==( const ImageList& rImageList ) const
{
DBG_CHKTHIS( ImageList, NULL );
DBG_CHKOBJ( &rImageList, ImageList, NULL );
diff --git a/vcl/source/gdi/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx
index bafb5ea8c490..59ee15fa558a 100644
--- a/vcl/source/gdi/impanmvw.cxx
+++ b/vcl/source/gdi/impanmvw.cxx
@@ -40,7 +40,7 @@
ImplAnimView::ImplAnimView( Animation* pParent, OutputDevice* pOut,
const Point& rPt, const Size& rSz,
- ULONG nExtraData,
+ sal_uLong nExtraData,
OutputDevice* pFirstFrameOutDev ) :
mpParent ( pParent ),
mpOut ( pFirstFrameOutDev ? pFirstFrameOutDev : pOut ),
@@ -52,8 +52,8 @@ ImplAnimView::ImplAnimView( Animation* pParent, OutputDevice* pOut,
mpBackground ( new VirtualDevice ),
mpRestore ( new VirtualDevice ),
meLastDisposal ( DISPOSE_BACK ),
- mbPause ( FALSE ),
- mbMarked ( FALSE ),
+ mbPause ( sal_False ),
+ mbMarked ( sal_False ),
mbHMirr ( maSz.Width() < 0L ),
mbVMirr ( maSz.Height() < 0L )
{
@@ -119,17 +119,17 @@ ImplAnimView::~ImplAnimView()
// ------------------------------------------------------------------------
-BOOL ImplAnimView::ImplMatches( OutputDevice* pOut, long nExtraData ) const
+sal_Bool ImplAnimView::ImplMatches( OutputDevice* pOut, long nExtraData ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( nExtraData )
{
if( ( mnExtraData == nExtraData ) && ( !pOut || ( pOut == mpOut ) ) )
- bRet = TRUE;
+ bRet = sal_True;
}
else if( !pOut || ( pOut == mpOut ) )
- bRet = TRUE;
+ bRet = sal_True;
return bRet;
}
@@ -175,15 +175,15 @@ void ImplAnimView::ImplGetPosSize( const AnimationBitmap& rAnm, Point& rPosPix,
// ------------------------------------------------------------------------
-void ImplAnimView::ImplDrawToPos( ULONG nPos )
+void ImplAnimView::ImplDrawToPos( sal_uLong nPos )
{
VirtualDevice aVDev;
Region* pOldClip = !maClip.IsNull() ? new Region( mpOut->GetClipRegion() ) : NULL;
- aVDev.SetOutputSizePixel( maSzPix, FALSE );
- nPos = Min( nPos, (ULONG) mpParent->Count() - 1UL );
+ aVDev.SetOutputSizePixel( maSzPix, sal_False );
+ nPos = Min( nPos, (sal_uLong) mpParent->Count() - 1UL );
- for( ULONG i = 0UL; i <= nPos; i++ )
+ for( sal_uLong i = 0UL; i <= nPos; i++ )
ImplDraw( i, &aVDev );
if( pOldClip )
@@ -200,20 +200,20 @@ void ImplAnimView::ImplDrawToPos( ULONG nPos )
// ------------------------------------------------------------------------
-void ImplAnimView::ImplDraw( ULONG nPos )
+void ImplAnimView::ImplDraw( sal_uLong nPos )
{
ImplDraw( nPos, NULL );
}
// ------------------------------------------------------------------------
-void ImplAnimView::ImplDraw( ULONG nPos, VirtualDevice* pVDev )
+void ImplAnimView::ImplDraw( sal_uLong nPos, VirtualDevice* pVDev )
{
Rectangle aOutRect( mpOut->PixelToLogic( Point() ), mpOut->GetOutputSize() );
// check, if output lies out of display
if( aOutRect.Intersection( Rectangle( maDispPt, maDispSz ) ).IsEmpty() )
- ImplSetMarked( TRUE );
+ ImplSetMarked( sal_True );
else if( !mbPause )
{
VirtualDevice* pDev;
@@ -221,8 +221,8 @@ void ImplAnimView::ImplDraw( ULONG nPos, VirtualDevice* pVDev )
Point aBmpPosPix;
Size aSizePix;
Size aBmpSizePix;
- const ULONG nLastPos = mpParent->Count() - 1;
- const AnimationBitmap& rAnm = mpParent->Get( (USHORT) ( mnActPos = Min( nPos, nLastPos ) ) );
+ const sal_uLong nLastPos = mpParent->Count() - 1;
+ const AnimationBitmap& rAnm = mpParent->Get( (sal_uInt16) ( mnActPos = Min( nPos, nLastPos ) ) );
ImplGetPosSize( rAnm, aPosPix, aSizePix );
@@ -254,7 +254,7 @@ void ImplAnimView::ImplDraw( ULONG nPos, VirtualDevice* pVDev )
if( !pVDev )
{
pDev = new VirtualDevice;
- pDev->SetOutputSizePixel( maSzPix, FALSE );
+ pDev->SetOutputSizePixel( maSzPix, sal_False );
pDev->DrawOutDev( Point(), maSzPix, maDispPt, maDispSz, *mpOut );
}
else
@@ -285,10 +285,10 @@ void ImplAnimView::ImplDraw( ULONG nPos, VirtualDevice* pVDev )
// ==> ggf. in eine Bitmap stecken, ansonsten SaveBitmap
// aus Speichergruenden loeschen
if( ( meLastDisposal == DISPOSE_BACK ) || ( meLastDisposal == DISPOSE_NOT ) )
- mpRestore->SetOutputSizePixel( Size( 1, 1 ), FALSE );
+ mpRestore->SetOutputSizePixel( Size( 1, 1 ), sal_False );
else
{
- mpRestore->SetOutputSizePixel( maRestSz, FALSE );
+ mpRestore->SetOutputSizePixel( maRestSz, sal_False );
mpRestore->DrawOutDev( Point(), maRestSz, aPosPix, aSizePix, *pDev );
}
@@ -321,7 +321,7 @@ void ImplAnimView::ImplDraw( ULONG nPos, VirtualDevice* pVDev )
void ImplAnimView::ImplRepaint()
{
- const BOOL bOldPause = mbPause;
+ const sal_Bool bOldPause = mbPause;
if( mpOut->GetOutDevType() == OUTDEV_WINDOW )
{
@@ -334,7 +334,7 @@ void ImplAnimView::ImplRepaint()
else
mpBackground->DrawOutDev( Point(), maSzPix, maDispPt, maDispSz, *mpOut );
- mbPause = FALSE;
+ mbPause = sal_False;
ImplDrawToPos( mnActPos );
mbPause = bOldPause;
}
diff --git a/vcl/source/gdi/impanmvw.hxx b/vcl/source/gdi/impanmvw.hxx
index 84e3273fc8c5..4e96ecbd9b64 100644
--- a/vcl/source/gdi/impanmvw.hxx
+++ b/vcl/source/gdi/impanmvw.hxx
@@ -58,27 +58,27 @@ private:
Region maClip;
VirtualDevice* mpBackground;
VirtualDevice* mpRestore;
- ULONG mnActPos;
+ sal_uLong mnActPos;
Disposal meLastDisposal;
- BOOL mbPause;
- BOOL mbFirst;
- BOOL mbMarked;
- BOOL mbHMirr;
- BOOL mbVMirr;
+ sal_Bool mbPause;
+ sal_Bool mbFirst;
+ sal_Bool mbMarked;
+ sal_Bool mbHMirr;
+ sal_Bool mbVMirr;
void ImplGetPosSize( const AnimationBitmap& rAnm, Point& rPosPix, Size& rSizePix );
- void ImplDraw( ULONG nPos, VirtualDevice* pVDev );
+ void ImplDraw( sal_uLong nPos, VirtualDevice* pVDev );
public:
ImplAnimView( Animation* pParent, OutputDevice* pOut,
- const Point& rPt, const Size& rSz, ULONG nExtraData,
+ const Point& rPt, const Size& rSz, sal_uLong nExtraData,
OutputDevice* pFirstFrameOutDev = NULL );
~ImplAnimView();
- BOOL ImplMatches( OutputDevice* pOut, long nExtraData ) const;
- void ImplDrawToPos( ULONG nPos );
- void ImplDraw( ULONG nPos );
+ sal_Bool ImplMatches( OutputDevice* pOut, long nExtraData ) const;
+ void ImplDrawToPos( sal_uLong nPos );
+ void ImplDraw( sal_uLong nPos );
void ImplRepaint();
AInfo* ImplCreateAInfo() const;
@@ -87,11 +87,11 @@ public:
const Size& ImplGetOutSize() const { return maSz; }
const Size& ImplGetOutSizePix() const { return maSzPix; }
- void ImplPause( BOOL bPause ) { mbPause = bPause; }
- BOOL ImplIsPause() const { return mbPause; }
+ void ImplPause( sal_Bool bPause ) { mbPause = bPause; }
+ sal_Bool ImplIsPause() const { return mbPause; }
- void ImplSetMarked( BOOL bMarked ) { mbMarked = bMarked; }
- BOOL ImplIsMarked() const { return mbMarked; }
+ void ImplSetMarked( sal_Bool bMarked ) { mbMarked = bMarked; }
+ sal_Bool ImplIsMarked() const { return mbMarked; }
};
#endif
diff --git a/vcl/source/gdi/impbmp.cxx b/vcl/source/gdi/impbmp.cxx
index 4b4b1f4289b6..6957e32b3e25 100644
--- a/vcl/source/gdi/impbmp.cxx
+++ b/vcl/source/gdi/impbmp.cxx
@@ -64,7 +64,7 @@ void ImpBitmap::ImplSetSalBitmap( SalBitmap* pBitmap )
// -----------------------------------------------------------------------
-BOOL ImpBitmap::ImplCreate( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal )
+sal_Bool ImpBitmap::ImplCreate( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal )
{
maSourceSize = rSize;
return mpSalBitmap->Create( rSize, nBitCount, rPal );
@@ -72,7 +72,7 @@ BOOL ImpBitmap::ImplCreate( const Size& rSize, USHORT nBitCount, const BitmapPal
// -----------------------------------------------------------------------
-BOOL ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap )
+sal_Bool ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap )
{
maSourceSize = rImpBitmap.maSourceSize;
mnChecksum = rImpBitmap.mnChecksum;
@@ -81,14 +81,14 @@ BOOL ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap )
// -----------------------------------------------------------------------
-BOOL ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap, SalGraphics* pGraphics )
+sal_Bool ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap, SalGraphics* pGraphics )
{
return mpSalBitmap->Create( *rImpBitmap.mpSalBitmap, pGraphics );
}
// -----------------------------------------------------------------------
-BOOL ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap, USHORT nNewBitCount )
+sal_Bool ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap, sal_uInt16 nNewBitCount )
{
return mpSalBitmap->Create( *rImpBitmap.mpSalBitmap, nNewBitCount );
}
@@ -109,22 +109,22 @@ Size ImpBitmap::ImplGetSize() const
// -----------------------------------------------------------------------
-USHORT ImpBitmap::ImplGetBitCount() const
+sal_uInt16 ImpBitmap::ImplGetBitCount() const
{
- USHORT nBitCount = mpSalBitmap->GetBitCount();
+ sal_uInt16 nBitCount = mpSalBitmap->GetBitCount();
return( ( nBitCount <= 1 ) ? 1 : ( nBitCount <= 4 ) ? 4 : ( nBitCount <= 8 ) ? 8 : 24 );
}
// -----------------------------------------------------------------------
-BitmapBuffer* ImpBitmap::ImplAcquireBuffer( BOOL bReadOnly )
+BitmapBuffer* ImpBitmap::ImplAcquireBuffer( sal_Bool bReadOnly )
{
return mpSalBitmap->AcquireBuffer( bReadOnly );
}
// -----------------------------------------------------------------------
-void ImpBitmap::ImplReleaseBuffer( BitmapBuffer* pBuffer, BOOL bReadOnly )
+void ImpBitmap::ImplReleaseBuffer( BitmapBuffer* pBuffer, sal_Bool bReadOnly )
{
mpSalBitmap->ReleaseBuffer( pBuffer, bReadOnly );
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index cbd53dc1b201..bf99364a0f64 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -69,7 +69,7 @@
struct ImpSwapFile
{
INetURLObject aSwapURL;
- ULONG nRefCount;
+ sal_uLong nRefCount;
};
// -----------------
@@ -89,15 +89,15 @@ GraphicReader::~GraphicReader()
// ------------------------------------------------------------------------
-BOOL GraphicReader::IsPreviewModeEnabled() const
+sal_Bool GraphicReader::IsPreviewModeEnabled() const
{
if( !mpReaderData )
- return FALSE;
+ return sal_False;
if( mpReaderData->maPreviewSize.Width() )
- return TRUE;
+ return sal_True;
if( mpReaderData->maPreviewSize.Height() )
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
// ------------------------------------------------------------------------
@@ -140,8 +140,8 @@ ImpGraphic::ImpGraphic() :
mnDocFilePos ( 0UL ),
mnSizeBytes ( 0UL ),
mnRefCount ( 1UL ),
- mbSwapOut ( FALSE ),
- mbSwapUnderway ( FALSE )
+ mbSwapOut ( sal_False ),
+ mbSwapUnderway ( sal_False )
{
}
@@ -158,7 +158,7 @@ ImpGraphic::ImpGraphic( const ImpGraphic& rImpGraphic ) :
mnSizeBytes ( rImpGraphic.mnSizeBytes ),
mnRefCount ( 1UL ),
mbSwapOut ( rImpGraphic.mbSwapOut ),
- mbSwapUnderway ( FALSE )
+ mbSwapUnderway ( sal_False )
{
if( mpSwapFile )
mpSwapFile->nRefCount++;
@@ -189,8 +189,8 @@ ImpGraphic::ImpGraphic( const Bitmap& rBitmap ) :
mnDocFilePos ( 0UL ),
mnSizeBytes ( 0UL ),
mnRefCount ( 1UL ),
- mbSwapOut ( FALSE ),
- mbSwapUnderway ( FALSE )
+ mbSwapOut ( sal_False ),
+ mbSwapUnderway ( sal_False )
{
}
@@ -206,8 +206,8 @@ ImpGraphic::ImpGraphic( const BitmapEx& rBitmapEx ) :
mnDocFilePos ( 0UL ),
mnSizeBytes ( 0UL ),
mnRefCount ( 1UL ),
- mbSwapOut ( FALSE ),
- mbSwapUnderway ( FALSE )
+ mbSwapOut ( sal_False ),
+ mbSwapUnderway ( sal_False )
{
}
@@ -223,8 +223,8 @@ ImpGraphic::ImpGraphic( const Animation& rAnimation ) :
mnDocFilePos ( 0UL ),
mnSizeBytes ( 0UL ),
mnRefCount ( 1UL ),
- mbSwapOut ( FALSE ),
- mbSwapUnderway ( FALSE )
+ mbSwapOut ( sal_False ),
+ mbSwapUnderway ( sal_False )
{
}
@@ -240,8 +240,8 @@ ImpGraphic::ImpGraphic( const GDIMetaFile& rMtf ) :
mnDocFilePos ( 0UL ),
mnSizeBytes ( 0UL ),
mnRefCount ( 1UL ),
- mbSwapOut ( FALSE ),
- mbSwapUnderway ( FALSE )
+ mbSwapOut ( sal_False ),
+ mbSwapUnderway ( sal_False )
{
}
@@ -251,7 +251,7 @@ ImpGraphic::~ImpGraphic()
{
ImplClear();
- if( (ULONG) mpContext > 1UL )
+ if( (sal_uLong) mpContext > 1UL )
delete mpContext;
}
@@ -305,24 +305,24 @@ ImpGraphic& ImpGraphic::operator=( const ImpGraphic& rImpGraphic )
// ------------------------------------------------------------------------
-BOOL ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const
+sal_Bool ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( this == &rImpGraphic )
- bRet = TRUE;
+ bRet = sal_True;
else if( !ImplIsSwapOut() && ( rImpGraphic.meType == meType ) )
{
switch( meType )
{
case( GRAPHIC_NONE ):
- bRet = TRUE;
+ bRet = sal_True;
break;
case( GRAPHIC_GDIMETAFILE ):
{
if( rImpGraphic.maMetaFile == maMetaFile )
- bRet = TRUE;
+ bRet = sal_True;
}
break;
@@ -331,10 +331,10 @@ BOOL ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const
if( mpAnimation )
{
if( rImpGraphic.mpAnimation && ( *rImpGraphic.mpAnimation == *mpAnimation ) )
- bRet = TRUE;
+ bRet = sal_True;
}
else if( !rImpGraphic.mpAnimation && ( rImpGraphic.maEx == maEx ) )
- bRet = TRUE;
+ bRet = sal_True;
}
break;
@@ -348,7 +348,7 @@ BOOL ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const
// ------------------------------------------------------------------------
-void ImpGraphic::ImplClearGraphics( BOOL bCreateSwapInfo )
+void ImpGraphic::ImplClearGraphics( sal_Bool bCreateSwapInfo )
{
if( bCreateSwapInfo && !ImplIsSwapOut() )
{
@@ -410,12 +410,12 @@ void ImpGraphic::ImplClear()
mpSwapFile = NULL;
}
- mbSwapOut = FALSE;
+ mbSwapOut = sal_False;
mnDocFilePos = 0UL;
maDocFileURLStr.Erase();
// cleanup
- ImplClearGraphics( FALSE );
+ ImplClearGraphics( sal_False );
meType = GRAPHIC_NONE;
mnSizeBytes = 0;
}
@@ -437,42 +437,42 @@ void ImpGraphic::ImplSetDefaultType()
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplIsSupportedGraphic() const
+sal_Bool ImpGraphic::ImplIsSupportedGraphic() const
{
return( meType != GRAPHIC_NONE );
}
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplIsTransparent() const
+sal_Bool ImpGraphic::ImplIsTransparent() const
{
- BOOL bRet;
+ sal_Bool bRet;
if( meType == GRAPHIC_BITMAP )
bRet = ( mpAnimation ? mpAnimation->IsTransparent() : maEx.IsTransparent() );
else
- bRet = TRUE;
+ bRet = sal_True;
return bRet;
}
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplIsAlpha() const
+sal_Bool ImpGraphic::ImplIsAlpha() const
{
- BOOL bRet;
+ sal_Bool bRet;
if( meType == GRAPHIC_BITMAP )
bRet = ( NULL == mpAnimation ) && maEx.IsAlpha();
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplIsAnimated() const
+sal_Bool ImpGraphic::ImplIsAnimated() const
{
return( mpAnimation != NULL );
}
@@ -728,7 +728,7 @@ void ImpGraphic::ImplSetPrefMapMode( const MapMode& rPrefMapMode )
// ------------------------------------------------------------------------
-ULONG ImpGraphic::ImplGetSizeBytes() const
+sal_uLong ImpGraphic::ImplGetSizeBytes() const
{
if( 0 == mnSizeBytes )
{
@@ -855,7 +855,7 @@ Link ImpGraphic::ImplGetAnimationNotifyHdl() const
// ------------------------------------------------------------------------
-ULONG ImpGraphic::ImplGetAnimationLoopCount() const
+sal_uLong ImpGraphic::ImplGetAnimationLoopCount() const
{
return( mpAnimation ? mpAnimation->GetLoopCount() : 0UL );
}
@@ -891,7 +891,7 @@ void ImpGraphic::ImplSetContext( GraphicReader* pReader )
// ------------------------------------------------------------------------
-void ImpGraphic::ImplSetDocFileName( const String& rName, ULONG nFilePos )
+void ImpGraphic::ImplSetDocFileName( const String& rName, sal_uLong nFilePos )
{
const INetURLObject aURL( rName );
@@ -910,29 +910,29 @@ const String& ImpGraphic::ImplGetDocFileName() const
// ------------------------------------------------------------------------
-ULONG ImpGraphic::ImplGetDocFilePos() const
+sal_uLong ImpGraphic::ImplGetDocFilePos() const
{
return mnDocFilePos;
}
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplReadEmbedded( SvStream& rIStm, BOOL bSwap )
+sal_Bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm, sal_Bool bSwap )
{
MapMode aMapMode;
Size aSize;
- const ULONG nStartPos = rIStm.Tell();
+ const sal_uLong nStartPos = rIStm.Tell();
sal_uInt32 nId;
- ULONG nHeaderLen;
+ sal_uLong nHeaderLen;
long nType;
long nLen;
- const USHORT nOldFormat = rIStm.GetNumberFormatInt();
- BOOL bRet = FALSE;
+ const sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
+ sal_Bool bRet = sal_False;
if( !mbSwapUnderway )
{
const String aTempURLStr( maDocFileURLStr );
- const ULONG nTempPos = mnDocFilePos;
+ const sal_uLong nTempPos = mnDocFilePos;
ImplClear();
@@ -1017,7 +1017,7 @@ BOOL ImpGraphic::ImplReadEmbedded( SvStream& rIStm, BOOL bSwap )
if( maDocFileURLStr.Len() )
{
rIStm.Seek( nStartPos + nHeaderLen + nLen );
- bRet = mbSwapOut = TRUE;
+ bRet = mbSwapOut = sal_True;
}
else
{
@@ -1030,9 +1030,9 @@ BOOL ImpGraphic::ImplReadEmbedded( SvStream& rIStm, BOOL bSwap )
if( pOStm )
{
- ULONG nFullLen = nHeaderLen + nLen;
- ULONG nPartLen = Min( nFullLen, (ULONG) GRAPHIC_MAXPARTLEN );
- BYTE* pBuffer = (BYTE*) rtl_allocateMemory( nPartLen );
+ sal_uLong nFullLen = nHeaderLen + nLen;
+ sal_uLong nPartLen = Min( nFullLen, (sal_uLong) GRAPHIC_MAXPARTLEN );
+ sal_uInt8* pBuffer = (sal_uInt8*) rtl_allocateMemory( nPartLen );
pOStm->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -1052,12 +1052,12 @@ BOOL ImpGraphic::ImplReadEmbedded( SvStream& rIStm, BOOL bSwap )
}
rtl_freeMemory( pBuffer );
- ULONG nReadErr = rIStm.GetError(), nWriteErr = pOStm->GetError();
+ sal_uLong nReadErr = rIStm.GetError(), nWriteErr = pOStm->GetError();
delete pOStm, pOStm = NULL;
if( !nReadErr && !nWriteErr )
{
- bRet = mbSwapOut = TRUE;
+ bRet = mbSwapOut = sal_True;
mpSwapFile = new ImpSwapFile;
mpSwapFile->nRefCount = 1;
mpSwapFile->aSwapURL = aTmpURL;
@@ -1100,9 +1100,9 @@ BOOL ImpGraphic::ImplReadEmbedded( SvStream& rIStm, BOOL bSwap )
else if( meType >= SYS_WINMETAFILE && meType <= SYS_MACMETAFILE )
{
Graphic aSysGraphic;
- ULONG nCvtType;
+ sal_uLong nCvtType;
- switch( sal::static_int_cast<ULONG>(meType) )
+ switch( sal::static_int_cast<sal_uLong>(meType) )
{
case( SYS_WINMETAFILE ):
case( SYS_WNTMETAFILE ): nCvtType = CVT_WMF; break;
@@ -1130,7 +1130,7 @@ BOOL ImpGraphic::ImplReadEmbedded( SvStream& rIStm, BOOL bSwap )
}
}
else
- bRet = TRUE;
+ bRet = sal_True;
rIStm.SetNumberFormatInt( nOldFormat );
@@ -1139,16 +1139,16 @@ BOOL ImpGraphic::ImplReadEmbedded( SvStream& rIStm, BOOL bSwap )
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplWriteEmbedded( SvStream& rOStm )
+sal_Bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( ( meType != GRAPHIC_NONE ) && ( meType != GRAPHIC_DEFAULT ) && !ImplIsSwapOut() )
{
const MapMode aMapMode( ImplGetPrefMapMode() );
const Size aSize( ImplGetPrefSize() );
- const USHORT nOldFormat = rOStm.GetNumberFormatInt();
- ULONG nDataFieldPos;
+ const sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt();
+ sal_uLong nDataFieldPos;
rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -1195,18 +1195,18 @@ BOOL ImpGraphic::ImplWriteEmbedded( SvStream& rOStm )
// write data block
if( !rOStm.GetError() )
{
- const ULONG nDataStart = rOStm.Tell();
+ const sal_uLong nDataStart = rOStm.Tell();
if( ImplIsSupportedGraphic() )
rOStm << *this;
if( !rOStm.GetError() )
{
- const ULONG nStmPos2 = rOStm.Tell();
+ const sal_uLong nStmPos2 = rOStm.Tell();
rOStm.Seek( nDataFieldPos );
rOStm << (long) ( nStmPos2 - nDataStart );
rOStm.Seek( nStmPos2 );
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -1218,9 +1218,9 @@ BOOL ImpGraphic::ImplWriteEmbedded( SvStream& rOStm )
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplSwapOut()
+sal_Bool ImpGraphic::ImplSwapOut()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !ImplIsSwapOut() )
{
@@ -1238,7 +1238,7 @@ BOOL ImpGraphic::ImplSwapOut()
pOStm->SetVersion( SOFFICE_FILEFORMAT_50 );
pOStm->SetCompressMode( COMPRESSMODE_NATIVE );
- if( ( bRet = ImplSwapOut( pOStm ) ) == TRUE )
+ if( ( bRet = ImplSwapOut( pOStm ) ) == sal_True )
{
mpSwapFile = new ImpSwapFile;
mpSwapFile->nRefCount = 1;
@@ -1276,8 +1276,8 @@ BOOL ImpGraphic::ImplSwapOut()
}
else
{
- ImplClearGraphics( TRUE );
- bRet = mbSwapOut = TRUE;
+ ImplClearGraphics( sal_True );
+ bRet = mbSwapOut = sal_True;
}
}
@@ -1286,9 +1286,9 @@ BOOL ImpGraphic::ImplSwapOut()
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplSwapOut( SvStream* pOStm )
+sal_Bool ImpGraphic::ImplSwapOut( SvStream* pOStm )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pOStm )
{
@@ -1300,15 +1300,15 @@ BOOL ImpGraphic::ImplSwapOut( SvStream* pOStm )
if( !pOStm->GetError() )
{
- ImplClearGraphics( TRUE );
- bRet = mbSwapOut = TRUE;
+ ImplClearGraphics( sal_True );
+ bRet = mbSwapOut = sal_True;
}
}
}
else
{
- ImplClearGraphics( TRUE );
- bRet = mbSwapOut = TRUE;
+ ImplClearGraphics( sal_True );
+ bRet = mbSwapOut = sal_True;
}
return bRet;
@@ -1316,9 +1316,9 @@ BOOL ImpGraphic::ImplSwapOut( SvStream* pOStm )
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplSwapIn()
+sal_Bool ImpGraphic::ImplSwapIn()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( ImplIsSwapOut() )
{
@@ -1385,9 +1385,9 @@ BOOL ImpGraphic::ImplSwapIn()
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplSwapIn( SvStream* pIStm )
+sal_Bool ImpGraphic::ImplSwapIn( SvStream* pIStm )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pIStm )
{
@@ -1395,14 +1395,14 @@ BOOL ImpGraphic::ImplSwapIn( SvStream* pIStm )
if( !pIStm->GetError() )
{
- mbSwapUnderway = TRUE;
+ mbSwapUnderway = sal_True;
bRet = ImplReadEmbedded( *pIStm );
- mbSwapUnderway = FALSE;
+ mbSwapUnderway = sal_False;
if( !bRet )
ImplClear();
else
- mbSwapOut = FALSE;
+ mbSwapOut = sal_False;
}
}
@@ -1411,7 +1411,7 @@ BOOL ImpGraphic::ImplSwapIn( SvStream* pIStm )
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplIsSwapOut() const
+sal_Bool ImpGraphic::ImplIsSwapOut() const
{
return mbSwapOut;
}
@@ -1436,16 +1436,16 @@ GfxLink ImpGraphic::ImplGetLink()
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplIsLink() const
+sal_Bool ImpGraphic::ImplIsLink() const
{
- return ( mpGfxLink != NULL ) ? TRUE : FALSE;
+ return ( mpGfxLink != NULL ) ? sal_True : sal_False;
}
// ------------------------------------------------------------------------
-ULONG ImpGraphic::ImplGetChecksum() const
+sal_uLong ImpGraphic::ImplGetChecksum() const
{
- ULONG nRet = 0;
+ sal_uLong nRet = 0;
if( ImplIsSupportedGraphic() && !ImplIsSwapOut() )
{
@@ -1474,9 +1474,9 @@ ULONG ImpGraphic::ImplGetChecksum() const
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplExportNative( SvStream& rOStm ) const
+sal_Bool ImpGraphic::ImplExportNative( SvStream& rOStm ) const
{
- BOOL bResult = FALSE;
+ sal_Bool bResult = sal_False;
if( !rOStm.GetError() )
{
@@ -1503,7 +1503,7 @@ SvStream& operator>>( SvStream& rIStm, ImpGraphic& rImpGraphic )
{
if( !rIStm.GetError() )
{
- const ULONG nStmPos1 = rIStm.Tell();
+ const sal_uLong nStmPos1 = rIStm.Tell();
sal_uInt32 nTmp;
if ( !rImpGraphic.mbSwapUnderway )
@@ -1537,7 +1537,7 @@ SvStream& operator>>( SvStream& rIStm, ImpGraphic& rImpGraphic )
if( !rIStm.GetError() && aLink.LoadNative( aGraphic ) )
{
// set link only, if no other link was set
- const BOOL bSetLink = ( rImpGraphic.mpGfxLink == NULL );
+ const sal_Bool bSetLink = ( rImpGraphic.mpGfxLink == NULL );
// assign graphic
rImpGraphic = *aGraphic.ImplGetImpGraphic();
@@ -1560,7 +1560,7 @@ SvStream& operator>>( SvStream& rIStm, ImpGraphic& rImpGraphic )
else
{
BitmapEx aBmpEx;
- const USHORT nOldFormat = rIStm.GetNumberFormatInt();
+ const sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
rIStm.SeekRel( -4 );
rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -1568,8 +1568,8 @@ SvStream& operator>>( SvStream& rIStm, ImpGraphic& rImpGraphic )
if( !rIStm.GetError() )
{
- UINT32 nMagic1(0), nMagic2(0);
- ULONG nActPos = rIStm.Tell();
+ sal_uInt32 nMagic1(0), nMagic2(0);
+ sal_uLong nActPos = rIStm.Tell();
rIStm >> nMagic1 >> nMagic2;
rIStm.Seek( nActPos );
@@ -1639,7 +1639,7 @@ SvStream& operator<<( SvStream& rOStm, const ImpGraphic& rImpGraphic )
else
{
// own format
- const USHORT nOldFormat = rOStm.GetNumberFormatInt();
+ const sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt();
rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
switch( rImpGraphic.ImplGetType() )
diff --git a/vcl/source/gdi/impimage.cxx b/vcl/source/gdi/impimage.cxx
index 09bf08e05730..d2e479e1edb5 100644
--- a/vcl/source/gdi/impimage.cxx
+++ b/vcl/source/gdi/impimage.cxx
@@ -66,7 +66,7 @@ ImageAryData::ImageAryData( const ImageAryData& rData ) :
}
ImageAryData::ImageAryData( const rtl::OUString &aName,
- USHORT nId, const BitmapEx &aBitmap )
+ sal_uInt16 nId, const BitmapEx &aBitmap )
: maName( aName ), mnId( nId ), maBitmapEx( aBitmap )
{
}
@@ -118,7 +118,7 @@ ImplImageList::~ImplImageList()
}
void ImplImageList::AddImage( const ::rtl::OUString &aName,
- USHORT nId, const BitmapEx &aBitmapEx )
+ sal_uInt16 nId, const BitmapEx &aBitmapEx )
{
ImageAryData *pImg = new ImageAryData( aName, nId, aBitmapEx );
maImages.push_back( pImg );
@@ -126,7 +126,7 @@ void ImplImageList::AddImage( const ::rtl::OUString &aName,
maNameHash [ aName ] = pImg;
}
-void ImplImageList::RemoveImage( USHORT nPos )
+void ImplImageList::RemoveImage( sal_uInt16 nPos )
{
ImageAryData *pImg = maImages[ nPos ];
if( pImg->maName.getLength() )
@@ -134,9 +134,9 @@ void ImplImageList::RemoveImage( USHORT nPos )
maImages.erase( maImages.begin() + nPos );
}
-USHORT ImplImageList::GetImageCount() const
+sal_uInt16 ImplImageList::GetImageCount() const
{
- return sal::static_int_cast< USHORT >( maImages.size() );
+ return sal::static_int_cast< sal_uInt16 >( maImages.size() );
}
// -----------------
@@ -160,7 +160,7 @@ ImplImageData::~ImplImageData()
// - ImplImageData -
// -----------------
-BOOL ImplImageData::IsEqual( const ImplImageData& rData )
+sal_Bool ImplImageData::IsEqual( const ImplImageData& rData )
{
return( maBmpEx == rData.maBmpEx );
}
@@ -212,7 +212,7 @@ ImplImageBmp::~ImplImageBmp()
// -----------------------------------------------------------------------
-void ImplImageBmp::Create( long nItemWidth, long nItemHeight, USHORT nInitSize )
+void ImplImageBmp::Create( long nItemWidth, long nItemHeight, sal_uInt16 nInitSize )
{
const Size aTotalSize( nInitSize * nItemWidth, nItemHeight );
@@ -226,13 +226,13 @@ void ImplImageBmp::Create( long nItemWidth, long nItemHeight, USHORT nInitSize )
mnSize = nInitSize;
delete[] mpInfoAry;
- mpInfoAry = new BYTE[ mnSize ];
+ mpInfoAry = new sal_uInt8[ mnSize ];
memset( mpInfoAry, 0, mnSize );
}
// -----------------------------------------------------------------------
-void ImplImageBmp::Create( const BitmapEx& rBmpEx, long nItemWidth, long nItemHeight, USHORT nInitSize )
+void ImplImageBmp::Create( const BitmapEx& rBmpEx, long nItemWidth, long nItemHeight, sal_uInt16 nInitSize )
{
maBmpEx = rBmpEx;
maDisabledBmpEx.SetEmpty();
@@ -244,7 +244,7 @@ void ImplImageBmp::Create( const BitmapEx& rBmpEx, long nItemWidth, long nItemHe
mnSize = nInitSize;
delete[] mpInfoAry;
- mpInfoAry = new BYTE[ mnSize ];
+ mpInfoAry = new sal_uInt8[ mnSize ];
memset( mpInfoAry,
rBmpEx.IsAlpha() ? IMPSYSIMAGEITEM_ALPHA : ( rBmpEx.IsTransparent() ? IMPSYSIMAGEITEM_MASK : 0 ),
mnSize );
@@ -252,11 +252,11 @@ void ImplImageBmp::Create( const BitmapEx& rBmpEx, long nItemWidth, long nItemHe
// -----------------------------------------------------------------------
-void ImplImageBmp::Expand( USHORT nGrowSize )
+void ImplImageBmp::Expand( sal_uInt16 nGrowSize )
{
- const ULONG nDX = nGrowSize * maSize.Width();
- const USHORT nOldSize = mnSize;
- BYTE* pNewAry = new BYTE[ mnSize = sal::static_int_cast<USHORT>(mnSize+nGrowSize) ];
+ const sal_uLong nDX = nGrowSize * maSize.Width();
+ const sal_uInt16 nOldSize = mnSize;
+ sal_uInt8* pNewAry = new sal_uInt8[ mnSize = sal::static_int_cast<sal_uInt16>(mnSize+nGrowSize) ];
maBmpEx.Expand( nDX, 0UL );
@@ -284,7 +284,7 @@ void ImplImageBmp::Invert()
// -----------------------------------------------------------------------
-void ImplImageBmp::Replace( USHORT nPos, USHORT nSrcPos )
+void ImplImageBmp::Replace( sal_uInt16 nPos, sal_uInt16 nSrcPos )
{
const Point aSrcPos( nSrcPos * maSize.Width(), 0L ), aPos( nPos * maSize.Width(), 0L );
const Rectangle aSrcRect( aSrcPos, maSize );
@@ -303,7 +303,7 @@ void ImplImageBmp::Replace( USHORT nPos, USHORT nSrcPos )
// -----------------------------------------------------------------------
-void ImplImageBmp::Replace( USHORT nPos, const ImplImageBmp& rImageBmp, USHORT nSrcPos )
+void ImplImageBmp::Replace( sal_uInt16 nPos, const ImplImageBmp& rImageBmp, sal_uInt16 nSrcPos )
{
const Point aSrcPos( nSrcPos * maSize.Width(), 0L ), aPos( nPos * maSize.Width(), 0L );
const Rectangle aSrcRect( aSrcPos, maSize );
@@ -320,7 +320,7 @@ void ImplImageBmp::Replace( USHORT nPos, const ImplImageBmp& rImageBmp, USHORT n
// -----------------------------------------------------------------------
-void ImplImageBmp::Replace( USHORT nPos, const BitmapEx& rBmpEx )
+void ImplImageBmp::Replace( sal_uInt16 nPos, const BitmapEx& rBmpEx )
{
const Point aNullPos, aPos( nPos * maSize.Width(), 0L );
const Rectangle aSrcRect( aNullPos, maSize );
@@ -338,7 +338,7 @@ void ImplImageBmp::Replace( USHORT nPos, const BitmapEx& rBmpEx )
// -----------------------------------------------------------------------
-void ImplImageBmp::ReplaceColors( const Color* pSrcColors, const Color* pDstColors, ULONG nColorCount )
+void ImplImageBmp::ReplaceColors( const Color* pSrcColors, const Color* pDstColors, sal_uLong nColorCount )
{
maBmpEx.Replace( pSrcColors, pDstColors, nColorCount );
delete mpDisplayBmp;
@@ -347,7 +347,7 @@ void ImplImageBmp::ReplaceColors( const Color* pSrcColors, const Color* pDstColo
// -----------------------------------------------------------------------
-BitmapEx ImplImageBmp::GetBitmapEx( USHORT nPosCount, USHORT* pPosAry ) const
+BitmapEx ImplImageBmp::GetBitmapEx( sal_uInt16 nPosCount, sal_uInt16* pPosAry ) const
{
const Bitmap aNewBmp( Size( nPosCount * maSize.Width(), maSize.Height() ), maBmpEx.GetBitmap().GetBitCount() );
BitmapEx aRet;
@@ -362,7 +362,7 @@ BitmapEx ImplImageBmp::GetBitmapEx( USHORT nPosCount, USHORT* pPosAry ) const
else
aRet = BitmapEx( aNewBmp );
- for( USHORT i = 0; i < nPosCount; i++ )
+ for( sal_uInt16 i = 0; i < nPosCount; i++ )
{
const Point aSrcPos( pPosAry[ i ] * maSize.Width(), 0L );
const Point aPos( i * maSize.Width(), 0L );
@@ -377,8 +377,8 @@ BitmapEx ImplImageBmp::GetBitmapEx( USHORT nPosCount, USHORT* pPosAry ) const
// -----------------------------------------------------------------------
-void ImplImageBmp::Draw( USHORT nPos, OutputDevice* pOutDev,
- const Point& rPos, USHORT nStyle,
+void ImplImageBmp::Draw( sal_uInt16 nPos, OutputDevice* pOutDev,
+ const Point& rPos, sal_uInt16 nStyle,
const Size* pSize )
{
if( pOutDev->IsDeviceOutputNecessary() )
@@ -421,9 +421,9 @@ void ImplImageBmp::Draw( USHORT nPos, OutputDevice* pOutDev,
BitmapColor aCol;
const long nW = pAcc->Width();
const long nH = pAcc->Height();
- BYTE* pMapR = new BYTE[ 256 ];
- BYTE* pMapG = new BYTE[ 256 ];
- BYTE* pMapB = new BYTE[ 256 ];
+ sal_uInt8* pMapR = new sal_uInt8[ 256 ];
+ sal_uInt8* pMapG = new sal_uInt8[ 256 ];
+ sal_uInt8* pMapB = new sal_uInt8[ 256 ];
long nX, nY;
if( nStyle & IMAGE_DRAW_HIGHLIGHT )
@@ -431,20 +431,20 @@ void ImplImageBmp::Draw( USHORT nPos, OutputDevice* pOutDev,
else
aColor = rSettings.GetDeactiveColor();
- const BYTE cR = aColor.GetRed();
- const BYTE cG = aColor.GetGreen();
- const BYTE cB = aColor.GetBlue();
+ const sal_uInt8 cR = aColor.GetRed();
+ const sal_uInt8 cG = aColor.GetGreen();
+ const sal_uInt8 cB = aColor.GetBlue();
for( nX = 0L; nX < 256L; nX++ )
{
- pMapR[ nX ] = (BYTE) ( ( ( nY = ( nX + cR ) >> 1 ) > 255 ) ? 255 : nY );
- pMapG[ nX ] = (BYTE) ( ( ( nY = ( nX + cG ) >> 1 ) > 255 ) ? 255 : nY );
- pMapB[ nX ] = (BYTE) ( ( ( nY = ( nX + cB ) >> 1 ) > 255 ) ? 255 : nY );
+ pMapR[ nX ] = (sal_uInt8) ( ( ( nY = ( nX + cR ) >> 1 ) > 255 ) ? 255 : nY );
+ pMapG[ nX ] = (sal_uInt8) ( ( ( nY = ( nX + cG ) >> 1 ) > 255 ) ? 255 : nY );
+ pMapB[ nX ] = (sal_uInt8) ( ( ( nY = ( nX + cB ) >> 1 ) > 255 ) ? 255 : nY );
}
if( pAcc->HasPalette() )
{
- for( USHORT i = 0, nCount = pAcc->GetPaletteEntryCount(); i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = pAcc->GetPaletteEntryCount(); i < nCount; i++ )
{
const BitmapColor& rCol = pAcc->GetPaletteColor( i );
aCol.SetRed( pMapR[ rCol.GetRed() ] );
@@ -500,7 +500,7 @@ void ImplImageBmp::Draw( USHORT nPos, OutputDevice* pOutDev,
}
else
{
- BYTE cErase = 128;
+ sal_uInt8 cErase = 128;
aTmpBmpEx = BitmapEx( aTmpBmp, AlphaMask( aTmpBmp.GetSizePixel(), &cErase ) );
}
}
@@ -536,14 +536,14 @@ void ImplImageBmp::Draw( USHORT nPos, OutputDevice* pOutDev,
// -----------------------------------------------------------------------
void ImplImageBmp::ImplUpdateDisplayBmp( OutputDevice*
-#if defined WIN || defined WNT
+#if defined WNT
pOutDev
#endif
)
{
if( !mpDisplayBmp && !maBmpEx.IsEmpty() )
{
-#if defined WIN || defined WNT
+#if defined WNT
if( maBmpEx.IsAlpha() )
mpDisplayBmp = new BitmapEx( maBmpEx );
else
diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx
index df9270145c6b..21c0cbb0abd4 100644
--- a/vcl/source/gdi/impvect.cxx
+++ b/vcl/source/gdi/impvect.cxx
@@ -110,23 +110,23 @@ static ChainMove aImplMoveOuter[ 8 ] = {
struct ImplColorSet
{
BitmapColor maColor;
- USHORT mnIndex;
- BOOL mbSet;
+ sal_uInt16 mnIndex;
+ sal_Bool mbSet;
- BOOL operator<( const ImplColorSet& rSet ) const;
- BOOL operator>( const ImplColorSet& rSet ) const;
+ sal_Bool operator<( const ImplColorSet& rSet ) const;
+ sal_Bool operator>( const ImplColorSet& rSet ) const;
};
// ----------------------------------------------------------------------------
-inline BOOL ImplColorSet::operator<( const ImplColorSet& rSet ) const
+inline sal_Bool ImplColorSet::operator<( const ImplColorSet& rSet ) const
{
return( mbSet && ( !rSet.mbSet || ( maColor.GetLuminance() > rSet.maColor.GetLuminance() ) ) );
}
// ----------------------------------------------------------------------------
-inline BOOL ImplColorSet::operator>( const ImplColorSet& rSet ) const
+inline sal_Bool ImplColorSet::operator>( const ImplColorSet& rSet ) const
{
return( !mbSet || ( rSet.mbSet && maColor.GetLuminance() < rSet.maColor.GetLuminance() ) );
}
@@ -141,8 +141,8 @@ extern "C" int __LOADONCALLAPI ImplColorSetCmpFnc( const void* p1, const void* p
if( pSet1->mbSet && pSet2->mbSet )
{
- const BYTE cLum1 = pSet1->maColor.GetLuminance();
- const BYTE cLum2 = pSet2->maColor.GetLuminance();
+ const sal_uInt8 cLum1 = pSet1->maColor.GetLuminance();
+ const sal_uInt8 cLum2 = pSet2->maColor.GetLuminance();
nRet = ( ( cLum1 > cLum2 ) ? -1 : ( ( cLum1 == cLum2 ) ? 0 : 1 ) );
}
else if( pSet1->mbSet )
@@ -162,21 +162,21 @@ extern "C" int __LOADONCALLAPI ImplColorSetCmpFnc( const void* p1, const void* p
class ImplPointArray
{
Point* mpArray;
- ULONG mnSize;
- ULONG mnRealSize;
+ sal_uLong mnSize;
+ sal_uLong mnRealSize;
public:
ImplPointArray();
~ImplPointArray();
- void ImplSetSize( ULONG nSize );
+ void ImplSetSize( sal_uLong nSize );
- ULONG ImplGetRealSize() const { return mnRealSize; }
- void ImplSetRealSize( ULONG nRealSize ) { mnRealSize = nRealSize; }
+ sal_uLong ImplGetRealSize() const { return mnRealSize; }
+ void ImplSetRealSize( sal_uLong nRealSize ) { mnRealSize = nRealSize; }
- inline Point& operator[]( ULONG nPos );
- inline const Point& operator[]( ULONG nPos ) const;
+ inline Point& operator[]( sal_uLong nPos );
+ inline const Point& operator[]( sal_uLong nPos ) const;
void ImplCreatePoly( Polygon& rPoly ) const;
};
@@ -201,9 +201,9 @@ ImplPointArray::~ImplPointArray()
// -----------------------------------------------------------------------------
-void ImplPointArray::ImplSetSize( ULONG nSize )
+void ImplPointArray::ImplSetSize( sal_uLong nSize )
{
- const ULONG nTotal = nSize * sizeof( Point );
+ const sal_uLong nTotal = nSize * sizeof( Point );
mnSize = nSize;
mnRealSize = 0UL;
@@ -217,7 +217,7 @@ void ImplPointArray::ImplSetSize( ULONG nSize )
// -----------------------------------------------------------------------------
-inline Point& ImplPointArray::operator[]( ULONG nPos )
+inline Point& ImplPointArray::operator[]( sal_uLong nPos )
{
DBG_ASSERT( nPos < mnSize, "ImplPointArray::operator[]: nPos out of range!" );
return mpArray[ nPos ];
@@ -225,7 +225,7 @@ inline Point& ImplPointArray::operator[]( ULONG nPos )
// -----------------------------------------------------------------------------
-inline const Point& ImplPointArray::operator[]( ULONG nPos ) const
+inline const Point& ImplPointArray::operator[]( sal_uLong nPos ) const
{
DBG_ASSERT( nPos < mnSize, "ImplPointArray::operator[]: nPos out of range!" );
return mpArray[ nPos ];
@@ -235,7 +235,7 @@ inline const Point& ImplPointArray::operator[]( ULONG nPos ) const
void ImplPointArray::ImplCreatePoly( Polygon& rPoly ) const
{
- rPoly = Polygon( sal::static_int_cast<USHORT>(mnRealSize), mpArray );
+ rPoly = Polygon( sal::static_int_cast<sal_uInt16>(mnRealSize), mpArray );
}
// ---------------
@@ -261,12 +261,12 @@ public:
inline long Width() const { return mnWidth; }
inline long Height() const { return mnHeight; }
- inline void Set( long nY, long nX, BYTE cVal );
- inline BYTE Get( long nY, long nX ) const;
+ inline void Set( long nY, long nX, sal_uInt8 cVal );
+ inline sal_uInt8 Get( long nY, long nX ) const;
- inline BOOL IsFree( long nY, long nX ) const;
- inline BOOL IsCont( long nY, long nX ) const;
- inline BOOL IsDone( long nY, long nX ) const;
+ inline sal_Bool IsFree( long nY, long nX ) const;
+ inline sal_Bool IsCont( long nY, long nX ) const;
+ inline sal_Bool IsDone( long nY, long nX ) const;
};
@@ -298,36 +298,36 @@ ImplVectMap::~ImplVectMap()
// -----------------------------------------------------------------------------
-inline void ImplVectMap::Set( long nY, long nX, BYTE cVal )
+inline void ImplVectMap::Set( long nY, long nX, sal_uInt8 cVal )
{
- const BYTE cShift = sal::static_int_cast<BYTE>(6 - ( ( nX & 3 ) << 1 ));
+ const sal_uInt8 cShift = sal::static_int_cast<sal_uInt8>(6 - ( ( nX & 3 ) << 1 ));
( ( mpScan[ nY ][ nX >> 2 ] ) &= ~( 3 << cShift ) ) |= ( cVal << cShift );
}
// -----------------------------------------------------------------------------
-inline BYTE ImplVectMap::Get( long nY, long nX ) const
+inline sal_uInt8 ImplVectMap::Get( long nY, long nX ) const
{
- return sal::static_int_cast<BYTE>( ( ( mpScan[ nY ][ nX >> 2 ] ) >> ( 6 - ( ( nX & 3 ) << 1 ) ) ) & 3 );
+ return sal::static_int_cast<sal_uInt8>( ( ( mpScan[ nY ][ nX >> 2 ] ) >> ( 6 - ( ( nX & 3 ) << 1 ) ) ) & 3 );
}
// -----------------------------------------------------------------------------
-inline BOOL ImplVectMap::IsFree( long nY, long nX ) const
+inline sal_Bool ImplVectMap::IsFree( long nY, long nX ) const
{
return( VECT_FREE_INDEX == Get( nY, nX ) );
}
// -----------------------------------------------------------------------------
-inline BOOL ImplVectMap::IsCont( long nY, long nX ) const
+inline sal_Bool ImplVectMap::IsCont( long nY, long nX ) const
{
return( VECT_CONT_INDEX == Get( nY, nX ) );
}
// -----------------------------------------------------------------------------
-inline BOOL ImplVectMap::IsDone( long nY, long nX ) const
+inline sal_Bool ImplVectMap::IsDone( long nY, long nX ) const
{
return( VECT_DONE_INDEX == Get( nY, nX ) );
}
@@ -342,10 +342,10 @@ private:
Polygon maPoly;
Point maStartPt;
- ULONG mnArraySize;
- ULONG mnCount;
+ sal_uLong mnArraySize;
+ sal_uLong mnCount;
long mnResize;
- BYTE* mpCodes;
+ sal_uInt8* mpCodes;
void ImplGetSpace();
@@ -356,25 +356,25 @@ private:
public:
- ImplChain( ULONG nInitCount = 1024UL, long nResize = -1L );
+ ImplChain( sal_uLong nInitCount = 1024UL, long nResize = -1L );
~ImplChain();
void ImplBeginAdd( const Point& rStartPt );
- inline void ImplAdd( BYTE nCode );
- void ImplEndAdd( ULONG nTypeFlag );
+ inline void ImplAdd( sal_uInt8 nCode );
+ void ImplEndAdd( sal_uLong nTypeFlag );
const Polygon& ImplGetPoly() const { return maPoly; }
};
// -----------------------------------------------------------------------------
-ImplChain::ImplChain( ULONG nInitCount, long nResize ) :
+ImplChain::ImplChain( sal_uLong nInitCount, long nResize ) :
mnArraySize ( nInitCount ),
mnCount ( 0UL ),
mnResize ( nResize )
{
DBG_ASSERT( nInitCount && nResize, "ImplChain::ImplChain(): invalid parameters!" );
- mpCodes = new BYTE[ mnArraySize ];
+ mpCodes = new sal_uInt8[ mnArraySize ];
}
// -----------------------------------------------------------------------------
@@ -388,11 +388,11 @@ ImplChain::~ImplChain()
void ImplChain::ImplGetSpace()
{
- const ULONG nOldArraySize = mnArraySize;
- BYTE* pNewCodes;
+ const sal_uLong nOldArraySize = mnArraySize;
+ sal_uInt8* pNewCodes;
- mnArraySize = ( mnResize < 0L ) ? ( mnArraySize << 1UL ) : ( mnArraySize + (ULONG) mnResize );
- pNewCodes = new BYTE[ mnArraySize ];
+ mnArraySize = ( mnResize < 0L ) ? ( mnArraySize << 1UL ) : ( mnArraySize + (sal_uLong) mnResize );
+ pNewCodes = new sal_uInt8[ mnArraySize ];
memcpy( pNewCodes, mpCodes, nOldArraySize );
delete[] mpCodes;
mpCodes = pNewCodes;
@@ -409,7 +409,7 @@ void ImplChain::ImplBeginAdd( const Point& rStartPt )
// -----------------------------------------------------------------------------
-inline void ImplChain::ImplAdd( BYTE nCode )
+inline void ImplChain::ImplAdd( sal_uInt8 nCode )
{
if( mnCount == mnArraySize )
ImplGetSpace();
@@ -419,7 +419,7 @@ inline void ImplChain::ImplAdd( BYTE nCode )
// -----------------------------------------------------------------------------
-void ImplChain::ImplEndAdd( ULONG nFlag )
+void ImplChain::ImplEndAdd( sal_uLong nFlag )
{
if( mnCount )
{
@@ -434,15 +434,15 @@ void ImplChain::ImplEndAdd( ULONG nFlag )
nFirstY = nLastY = maStartPt.Y();
aArr.ImplSetSize( mnCount << 1 );
- USHORT i, nPolyPos;
+ sal_uInt16 i, nPolyPos;
for( i = 0, nPolyPos = 0; i < ( mnCount - 1 ); i++ )
{
- const BYTE cMove = mpCodes[ i ];
- const BYTE cNextMove = mpCodes[ i + 1 ];
+ const sal_uInt8 cMove = mpCodes[ i ];
+ const sal_uInt8 cNextMove = mpCodes[ i + 1 ];
const ChainMove& rMove = aImplMove[ cMove ];
const ChainMove& rMoveInner = aImplMoveInner[ cMove ];
// Point& rPt = aArr[ nPolyPos ];
- BOOL bDone = TRUE;
+ sal_Bool bDone = sal_True;
nLastX += rMove.nDX;
nLastY += rMove.nDY;
@@ -500,7 +500,7 @@ void ImplChain::ImplEndAdd( ULONG nFlag )
aArr[ nPolyPos++ ].Y() = nLastY - 1;
}
else
- bDone = FALSE;
+ bDone = sal_False;
}
else if( cMove == 7 && cNextMove == 0 )
{
@@ -519,7 +519,7 @@ void ImplChain::ImplEndAdd( ULONG nFlag )
aArr[ nPolyPos++ ].Y() = nLastY;
}
else
- bDone = FALSE;
+ bDone = sal_False;
if( !bDone )
{
@@ -541,15 +541,15 @@ void ImplChain::ImplEndAdd( ULONG nFlag )
nFirstY = nLastY = maStartPt.Y();
aArr.ImplSetSize( mnCount << 1 );
- USHORT i, nPolyPos;
+ sal_uInt16 i, nPolyPos;
for( i = 0, nPolyPos = 0; i < ( mnCount - 1 ); i++ )
{
- const BYTE cMove = mpCodes[ i ];
- const BYTE cNextMove = mpCodes[ i + 1 ];
+ const sal_uInt8 cMove = mpCodes[ i ];
+ const sal_uInt8 cNextMove = mpCodes[ i + 1 ];
const ChainMove& rMove = aImplMove[ cMove ];
const ChainMove& rMoveOuter = aImplMoveOuter[ cMove ];
// Point& rPt = aArr[ nPolyPos ];
- BOOL bDone = TRUE;
+ sal_Bool bDone = sal_True;
nLastX += rMove.nDX;
nLastY += rMove.nDY;
@@ -607,7 +607,7 @@ void ImplChain::ImplEndAdd( ULONG nFlag )
aArr[ nPolyPos++ ].Y() = nLastY - 1;
}
else
- bDone = FALSE;
+ bDone = sal_False;
}
else if( cMove == 7 && cNextMove == 3 )
{
@@ -626,7 +626,7 @@ void ImplChain::ImplEndAdd( ULONG nFlag )
aArr[ nPolyPos++ ].Y() = nLastY + 1;
}
else
- bDone = FALSE;
+ bDone = sal_False;
if( !bDone )
{
@@ -646,7 +646,7 @@ void ImplChain::ImplEndAdd( ULONG nFlag )
aArr.ImplSetSize( mnCount + 1 );
aArr[ 0 ] = Point( nLastX, nLastY );
- for( ULONG i = 0; i < mnCount; )
+ for( sal_uLong i = 0; i < mnCount; )
{
const ChainMove& rMove = aImplMove[ mpCodes[ i ] ];
aArr[ ++i ] = Point( nLastX += rMove.nDX, nLastY += rMove.nDY );
@@ -669,9 +669,9 @@ void ImplChain::ImplPostProcess( const ImplPointArray& rArr )
ImplPointArray aNewArr2;
Point* pLast;
Point* pLeast;
- ULONG nNewPos;
- ULONG nCount = rArr.ImplGetRealSize();
- ULONG n;
+ sal_uLong nNewPos;
+ sal_uLong nCount = rArr.ImplGetRealSize();
+ sal_uLong n;
// pass 1
aNewArr1.ImplSetSize( nCount );
@@ -738,10 +738,10 @@ ImplVectorizer::~ImplVectorizer()
// -----------------------------------------------------------------------------
-BOOL ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
- BYTE cReduce, ULONG nFlags, const Link* pProgress )
+sal_Bool ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
+ sal_uInt8 cReduce, sal_uLong nFlags, const Link* pProgress )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
VECT_PROGRESS( pProgress, 0 );
@@ -755,9 +755,9 @@ BOOL ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
double fPercentStep_2 = 0.0;
const long nWidth = pRAcc->Width();
const long nHeight = pRAcc->Height();
- const USHORT nColorCount = pRAcc->GetPaletteEntryCount();
- USHORT n;
- ImplColorSet* pColorSet = (ImplColorSet*) new BYTE[ 256 * sizeof( ImplColorSet ) ];
+ const sal_uInt16 nColorCount = pRAcc->GetPaletteEntryCount();
+ sal_uInt16 n;
+ ImplColorSet* pColorSet = (ImplColorSet*) new sal_uInt8[ 256 * sizeof( ImplColorSet ) ];
memset( pColorSet, 0, 256 * sizeof( ImplColorSet ) );
rMtf.Clear();
@@ -784,11 +784,11 @@ BOOL ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
VECT_PROGRESS( pProgress, FRound( fPercent += 10.0 ) );
- for( USHORT i = 0; i < n; i++ )
+ for( sal_uInt16 i = 0; i < n; i++ )
{
const BitmapColor aBmpCol( pRAcc->GetPaletteColor( pColorSet[ i ].mnIndex ) );
const Color aFindColor( aBmpCol.GetRed(), aBmpCol.GetGreen(), aBmpCol.GetBlue() );
-// const BYTE cLum = aFindColor.GetLuminance();
+// const sal_uInt8 cLum = aFindColor.GetLuminance();
ImplVectMap* pMap = ImplExpand( pRAcc, aFindColor );
VECT_PROGRESS( pProgress, FRound( fPercent += fPercentStep_2 ) );
@@ -808,8 +808,8 @@ BOOL ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
if( aPolyPoly.Count() )
{
- rMtf.AddAction( new MetaLineColorAction( aFindColor, TRUE ) );
- rMtf.AddAction( new MetaFillColorAction( aFindColor, TRUE ) );
+ rMtf.AddAction( new MetaLineColorAction( aFindColor, sal_True ) );
+ rMtf.AddAction( new MetaFillColorAction( aFindColor, sal_True ) );
rMtf.AddAction( new MetaPolyPolygonAction( aPolyPoly ) );
}
}
@@ -818,7 +818,7 @@ BOOL ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
VECT_PROGRESS( pProgress, FRound( fPercent += fPercentStep_2 ) );
}
- delete[] (BYTE*) pColorSet;
+ delete[] (sal_uInt8*) pColorSet;
if( rMtf.GetActionCount() )
{
@@ -830,7 +830,7 @@ BOOL ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
rMtf.SetPrefSize( Size( nWidth + 2, nHeight + 2 ) );
rMtf.Move( 1, 1 );
rMtf.Scale( aLogSize1.Width(), aLogSize1.Height() );
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -843,14 +843,14 @@ BOOL ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
// -----------------------------------------------------------------------------
-BOOL ImplVectorizer::ImplVectorize( const Bitmap& rMonoBmp,
+sal_Bool ImplVectorizer::ImplVectorize( const Bitmap& rMonoBmp,
PolyPolygon& rPolyPoly,
- ULONG nFlags, const Link* pProgress )
+ sal_uLong nFlags, const Link* pProgress )
{
Bitmap* pBmp = new Bitmap( rMonoBmp );
BitmapReadAccess* pRAcc;
ImplVectMap* pMap;
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
VECT_PROGRESS( pProgress, 10 );
@@ -924,13 +924,13 @@ BOOL ImplVectorizer::ImplVectorize( const Bitmap& rMonoBmp,
// put outmost polygon to the front
if( nFirstPoly > 0 )
{
- const Polygon aFirst( rPolyPoly.GetObject( static_cast< USHORT >( nFirstPoly ) ) );
+ const Polygon aFirst( rPolyPoly.GetObject( static_cast< sal_uInt16 >( nFirstPoly ) ) );
- rPolyPoly.Remove( static_cast< USHORT >( nFirstPoly ) );
+ rPolyPoly.Remove( static_cast< sal_uInt16 >( nFirstPoly ) );
rPolyPoly.Insert( aFirst, 0 );
}
- bRet = TRUE;
+ bRet = sal_True;
}
VECT_PROGRESS( pProgress, 100 );
@@ -946,14 +946,14 @@ void ImplVectorizer::ImplLimitPolyPoly( PolyPolygon& rPolyPoly )
{
PolyPolygon aNewPolyPoly;
long nReduce = 0;
- USHORT nNewCount;
+ sal_uInt16 nNewCount;
do
{
aNewPolyPoly.Clear();
nReduce++;
- for( USHORT i = 0, nCount = rPolyPoly.Count(); i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = rPolyPoly.Count(); i < nCount; i++ )
{
const Rectangle aBound( rPolyPoly[ i ].GetBoundRect() );
@@ -1067,14 +1067,14 @@ ImplVectMap* ImplVectorizer::ImplExpand( BitmapReadAccess* pRAcc, const Color& r
// -----------------------------------------------------------------------------
-void ImplVectorizer::ImplCalculate( ImplVectMap* pMap, PolyPolygon& rPolyPoly, BYTE cReduce, ULONG nFlags )
+void ImplVectorizer::ImplCalculate( ImplVectMap* pMap, PolyPolygon& rPolyPoly, sal_uInt8 cReduce, sal_uLong nFlags )
{
const long nWidth = pMap->Width(), nHeight= pMap->Height();
for( long nY = 0L; nY < nHeight; nY++ )
{
long nX = 0L;
- BOOL bInner = TRUE;
+ sal_Bool bInner = sal_True;
while( nX < nWidth )
{
@@ -1136,15 +1136,15 @@ void ImplVectorizer::ImplCalculate( ImplVectMap* pMap, PolyPolygon& rPolyPoly, B
// -----------------------------------------------------------------------------
-BOOL ImplVectorizer::ImplGetChain( ImplVectMap* pMap, const Point& rStartPt, ImplChain& rChain )
+sal_Bool ImplVectorizer::ImplGetChain( ImplVectMap* pMap, const Point& rStartPt, ImplChain& rChain )
{
long nActX = rStartPt.X();
long nActY = rStartPt.Y();
long nTryX;
long nTryY;
- ULONG nFound;
- ULONG nLastDir = 0UL;
- ULONG nDir;
+ sal_uLong nFound;
+ sal_uLong nLastDir = 0UL;
+ sal_uLong nDir;
do
{
@@ -1156,7 +1156,7 @@ BOOL ImplVectorizer::ImplGetChain( ImplVectMap* pMap, const Point& rStartPt, Im
if( pMap->IsCont( nTryY, nTryX ) )
{
- rChain.ImplAdd( (BYTE) nLastDir );
+ rChain.ImplAdd( (sal_uInt8) nLastDir );
pMap->Set( nActY = nTryY, nActX = nTryX, VECT_DONE_INDEX );
nFound = 1UL;
}
@@ -1173,7 +1173,7 @@ BOOL ImplVectorizer::ImplGetChain( ImplVectMap* pMap, const Point& rStartPt, Im
if( pMap->IsCont( nTryY, nTryX ) )
{
- rChain.ImplAdd( (BYTE) nDir );
+ rChain.ImplAdd( (sal_uInt8) nDir );
pMap->Set( nActY = nTryY, nActX = nTryX, VECT_DONE_INDEX );
nFound = 1UL;
nLastDir = nDir;
@@ -1185,21 +1185,21 @@ BOOL ImplVectorizer::ImplGetChain( ImplVectMap* pMap, const Point& rStartPt, Im
}
while( nFound );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------------
-BOOL ImplVectorizer::ImplIsUp( ImplVectMap* pMap, long nY, long nX ) const
+sal_Bool ImplVectorizer::ImplIsUp( ImplVectMap* pMap, long nY, long nX ) const
{
if( pMap->IsDone( nY - 1L, nX ) )
- return TRUE;
+ return sal_True;
else if( pMap->IsDone( nY + 1L, nX ) )
- return FALSE;
+ return sal_False;
else if( pMap->IsDone( nY - 1L, nX - 1L ) || pMap->IsDone( nY - 1L, nX + 1L ) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/impvect.hxx b/vcl/source/gdi/impvect.hxx
index cf81e1799494..56591e969b8b 100644
--- a/vcl/source/gdi/impvect.hxx
+++ b/vcl/source/gdi/impvect.hxx
@@ -45,9 +45,9 @@ class ImplVectorizer
private:
ImplVectMap* ImplExpand( BitmapReadAccess* pRAcc, const Color& rColor );
- void ImplCalculate( ImplVectMap* pMap, PolyPolygon& rPolyPoly, BYTE cReduce, ULONG nFlags );
- BOOL ImplGetChain( ImplVectMap* pMap, const Point& rStartPt, ImplChain& rChain );
- BOOL ImplIsUp( ImplVectMap* pMap, long nY, long nX ) const;
+ void ImplCalculate( ImplVectMap* pMap, PolyPolygon& rPolyPoly, sal_uInt8 cReduce, sal_uLong nFlags );
+ sal_Bool ImplGetChain( ImplVectMap* pMap, const Point& rStartPt, ImplChain& rChain );
+ sal_Bool ImplIsUp( ImplVectMap* pMap, long nY, long nX ) const;
void ImplLimitPolyPoly( PolyPolygon& rPolyPoly );
public:
@@ -55,10 +55,10 @@ public:
ImplVectorizer();
~ImplVectorizer();
- BOOL ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
- BYTE cReduce, ULONG nFlags, const Link* pProgress );
- BOOL ImplVectorize( const Bitmap& rMonoBmp, PolyPolygon& rPolyPoly,
- ULONG nFlags, const Link* pProgress );
+ sal_Bool ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
+ sal_uInt8 cReduce, sal_uLong nFlags, const Link* pProgress );
+ sal_Bool ImplVectorize( const Bitmap& rMonoBmp, PolyPolygon& rPolyPoly,
+ sal_uLong nFlags, const Link* pProgress );
};
#endif
diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx
index 56b9c27b7048..34cd27b270cd 100644
--- a/vcl/source/gdi/jobset.cxx
+++ b/vcl/source/gdi/jobset.cxx
@@ -39,8 +39,8 @@
DBG_NAME( JobSetup )
#define JOBSET_FILEFORMAT2 3780
-#define JOBSET_FILE364_SYSTEM ((USHORT)0xFFFF)
-#define JOBSET_FILE605_SYSTEM ((USHORT)0xFFFE)
+#define JOBSET_FILE364_SYSTEM ((sal_uInt16)0xFFFF)
+#define JOBSET_FILE605_SYSTEM ((sal_uInt16)0xFFFE)
struct ImplOldJobSetupData
{
@@ -95,7 +95,7 @@ ImplJobSetup::ImplJobSetup( const ImplJobSetup& rJobSetup ) :
mnDriverDataLen = rJobSetup.mnDriverDataLen;
if ( rJobSetup.mpDriverData )
{
- mpDriverData = (BYTE*)rtl_allocateMemory( mnDriverDataLen );
+ mpDriverData = (sal_uInt8*)rtl_allocateMemory( mnDriverDataLen );
memcpy( mpDriverData, rJobSetup.mpDriverData, mnDriverDataLen );
}
else
@@ -258,16 +258,16 @@ JobSetup& JobSetup::operator=( const JobSetup& rJobSetup )
// -----------------------------------------------------------------------
-BOOL JobSetup::operator==( const JobSetup& rJobSetup ) const
+sal_Bool JobSetup::operator==( const JobSetup& rJobSetup ) const
{
DBG_CHKTHIS( JobSetup, NULL );
DBG_CHKOBJ( &rJobSetup, JobSetup, NULL );
if ( mpData == rJobSetup.mpData )
- return TRUE;
+ return sal_True;
if ( !mpData || !rJobSetup.mpData )
- return FALSE;
+ return sal_False;
ImplJobSetup* pData1 = mpData;
ImplJobSetup* pData2 = rJobSetup.mpData;
@@ -284,9 +284,9 @@ BOOL JobSetup::operator==( const JobSetup& rJobSetup ) const
(memcmp( pData1->mpDriverData, pData2->mpDriverData, pData1->mnDriverDataLen ) == 0) &&
(pData1->maValueMap == pData2->maValueMap)
)
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -296,8 +296,8 @@ SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup )
DBG_ASSERTWARNING( rIStream.GetVersion(), "JobSetup::>> - Solar-Version not set on rOStream" );
{
- USHORT nLen(0);
- USHORT nSystem;
+ sal_uInt16 nLen(0);
+ sal_uInt16 nSystem;
sal_Size nFirstPos = rIStream.Tell();
rIStream >> nLen;
if ( !nLen )
@@ -330,7 +330,7 @@ SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup )
nSystem == JOBSET_FILE605_SYSTEM )
{
Impl364JobSetupData* pOldJobData = (Impl364JobSetupData*)(pTempBuf + sizeof( ImplOldJobSetupData ));
- USHORT nOldJobDataSize = SVBT16ToShort( pOldJobData->nSize );
+ sal_uInt16 nOldJobDataSize = SVBT16ToShort( pOldJobData->nSize );
pJobData->mnSystem = SVBT16ToShort( pOldJobData->nSystem );
pJobData->mnDriverDataLen = SVBT32ToUInt32( pOldJobData->nDriverDataLen );
pJobData->meOrientation = (Orientation)SVBT16ToShort( pOldJobData->nOrientation );
@@ -341,8 +341,8 @@ SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup )
pJobData->mnPaperHeight = (long)SVBT32ToUInt32( pOldJobData->nPaperHeight );
if ( pJobData->mnDriverDataLen )
{
- BYTE* pDriverData = ((BYTE*)pOldJobData) + nOldJobDataSize;
- pJobData->mpDriverData = (BYTE*)rtl_allocateMemory( pJobData->mnDriverDataLen );
+ sal_uInt8* pDriverData = ((sal_uInt8*)pOldJobData) + nOldJobDataSize;
+ pJobData->mpDriverData = (sal_uInt8*)rtl_allocateMemory( pJobData->mnDriverDataLen );
memcpy( pJobData->mpDriverData, pDriverData, pJobData->mnDriverDataLen );
}
if( nSystem == JOBSET_FILE605_SYSTEM )
@@ -388,24 +388,24 @@ SvStream& operator<<( SvStream& rOStream, const JobSetup& rJobSetup )
// Zur Zeit haben wir noch kein neues FileFormat
// if ( rOStream.GetVersion() < JOBSET_FILEFORMAT2 )
{
- USHORT nLen = 0;
+ sal_uInt16 nLen = 0;
if ( !rJobSetup.mpData )
rOStream << nLen;
else
{
- USHORT nSystem = JOBSET_FILE605_SYSTEM;
+ sal_uInt16 nSystem = JOBSET_FILE605_SYSTEM;
const ImplJobSetup* pJobData = rJobSetup.ImplGetConstData();
Impl364JobSetupData aOldJobData;
- USHORT nOldJobDataSize = sizeof( aOldJobData );
+ sal_uInt16 nOldJobDataSize = sizeof( aOldJobData );
ShortToSVBT16( nOldJobDataSize, aOldJobData.nSize );
ShortToSVBT16( pJobData->mnSystem, aOldJobData.nSystem );
UInt32ToSVBT32( pJobData->mnDriverDataLen, aOldJobData.nDriverDataLen );
- ShortToSVBT16( (USHORT)(pJobData->meOrientation), aOldJobData.nOrientation );
+ ShortToSVBT16( (sal_uInt16)(pJobData->meOrientation), aOldJobData.nOrientation );
ShortToSVBT16( pJobData->mnPaperBin, aOldJobData.nPaperBin );
- ShortToSVBT16( (USHORT)(pJobData->mePaperFormat), aOldJobData.nPaperFormat );
- UInt32ToSVBT32( (ULONG)(pJobData->mnPaperWidth), aOldJobData.nPaperWidth );
- UInt32ToSVBT32( (ULONG)(pJobData->mnPaperHeight), aOldJobData.nPaperHeight );
+ ShortToSVBT16( (sal_uInt16)(pJobData->mePaperFormat), aOldJobData.nPaperFormat );
+ UInt32ToSVBT32( (sal_uLong)(pJobData->mnPaperWidth), aOldJobData.nPaperWidth );
+ UInt32ToSVBT32( (sal_uLong)(pJobData->mnPaperHeight), aOldJobData.nPaperHeight );
ImplOldJobSetupData aOldData;
memset( &aOldData, 0, sizeof( aOldData ) );
@@ -434,7 +434,7 @@ SvStream& operator<<( SvStream& rOStream, const JobSetup& rJobSetup )
case DUPLEX_SHORTEDGE: rOStream.WriteByteString( "DUPLEX_SHORTEDGE" );break;
case DUPLEX_LONGEDGE: rOStream.WriteByteString( "DUPLEX_LONGEDGE" );break;
}
- nLen = sal::static_int_cast<USHORT>(rOStream.Tell() - nPos);
+ nLen = sal::static_int_cast<sal_uInt16>(rOStream.Tell() - nPos);
rOStream.Seek( nPos );
rOStream << nLen;
rOStream.Seek( nPos + nLen );
diff --git a/vcl/source/gdi/lineinfo.cxx b/vcl/source/gdi/lineinfo.cxx
index 8b97c2ecdbff..542c3103eb27 100644
--- a/vcl/source/gdi/lineinfo.cxx
+++ b/vcl/source/gdi/lineinfo.cxx
@@ -71,6 +71,20 @@ ImplLineInfo::ImplLineInfo( const ImplLineInfo& rImplLineInfo ) :
{
}
+// -----------------------------------------------------------------------
+
+inline bool ImplLineInfo::operator==( const ImplLineInfo& rB ) const
+{
+ return(meStyle == rB.meStyle
+ && mnWidth == rB.mnWidth
+ && mnDashCount == rB.mnDashCount
+ && mnDashLen == rB.mnDashLen
+ && mnDotCount == rB.mnDotCount
+ && mnDotLen == rB.mnDotLen
+ && mnDistance == rB.mnDistance
+ && meLineJoin == rB.meLineJoin);
+}
+
// ------------
// - LineInfo -
// ------------
@@ -120,19 +134,13 @@ LineInfo& LineInfo::operator=( const LineInfo& rLineInfo )
// -----------------------------------------------------------------------
-BOOL LineInfo::operator==( const LineInfo& rLineInfo ) const
+sal_Bool LineInfo::operator==( const LineInfo& rLineInfo ) const
{
DBG_CHKTHIS( LineInfo, NULL );
DBG_CHKOBJ( &rLineInfo, LineInfo, NULL );
return( mpImplLineInfo == rLineInfo.mpImplLineInfo ||
- ( mpImplLineInfo->meStyle == rLineInfo.mpImplLineInfo->meStyle &&
- mpImplLineInfo->mnWidth == rLineInfo.mpImplLineInfo->mnWidth &&
- mpImplLineInfo->mnDashCount == rLineInfo.mpImplLineInfo->mnDashCount &&
- mpImplLineInfo->mnDashLen == rLineInfo.mpImplLineInfo->mnDashLen &&
- mpImplLineInfo->mnDotCount == rLineInfo.mpImplLineInfo->mnDotCount &&
- mpImplLineInfo->mnDotLen == rLineInfo.mpImplLineInfo->mnDotLen &&
- mpImplLineInfo->mnDistance == rLineInfo.mpImplLineInfo->mnDistance ) );
+ *mpImplLineInfo == *rLineInfo.mpImplLineInfo );
}
// -----------------------------------------------------------------------
@@ -168,7 +176,7 @@ void LineInfo::SetWidth( long nWidth )
// -----------------------------------------------------------------------
-void LineInfo::SetDashCount( USHORT nDashCount )
+void LineInfo::SetDashCount( sal_uInt16 nDashCount )
{
DBG_CHKTHIS( LineInfo, NULL );
ImplMakeUnique();
@@ -186,7 +194,7 @@ void LineInfo::SetDashLen( long nDashLen )
// -----------------------------------------------------------------------
-void LineInfo::SetDotCount( USHORT nDotCount )
+void LineInfo::SetDotCount( sal_uInt16 nDotCount )
{
DBG_CHKTHIS( LineInfo, NULL );
ImplMakeUnique();
@@ -229,7 +237,7 @@ void LineInfo::SetLineJoin(basegfx::B2DLineJoin eLineJoin)
SvStream& operator>>( SvStream& rIStm, ImplLineInfo& rImplLineInfo )
{
VersionCompat aCompat( rIStm, STREAM_READ );
- UINT16 nTmp16;
+ sal_uInt16 nTmp16;
rIStm >> nTmp16; rImplLineInfo.meStyle = (LineStyle) nTmp16;
rIStm >> rImplLineInfo.mnWidth;
@@ -258,7 +266,7 @@ SvStream& operator<<( SvStream& rOStm, const ImplLineInfo& rImplLineInfo )
VersionCompat aCompat( rOStm, STREAM_WRITE, 3 );
// version 1
- rOStm << (UINT16) rImplLineInfo.meStyle << rImplLineInfo.mnWidth;
+ rOStm << (sal_uInt16) rImplLineInfo.meStyle << rImplLineInfo.mnWidth;
// since version2
rOStm << rImplLineInfo.mnDashCount << rImplLineInfo.mnDashLen;
@@ -266,7 +274,7 @@ SvStream& operator<<( SvStream& rOStm, const ImplLineInfo& rImplLineInfo )
rOStm << rImplLineInfo.mnDistance;
// since version3
- rOStm << (UINT16) rImplLineInfo.meLineJoin;
+ rOStm << (sal_uInt16) rImplLineInfo.meLineJoin;
return rOStm;
}
diff --git a/vcl/source/gdi/makefile.mk b/vcl/source/gdi/makefile.mk
index ee12daa8b53c..d01c46a77ca0 100644..100755
--- a/vcl/source/gdi/makefile.mk
+++ b/vcl/source/gdi/makefile.mk
@@ -88,6 +88,7 @@ EXCEPTIONSFILES= $(SLO)$/salmisc.obj \
$(SLO)$/pdffontcache.obj\
$(SLO)$/pdfwriter.obj \
$(SLO)$/pdfwriter_impl.obj \
+ $(SLO)$/pdfwriter_impl2.obj \
$(SLO)$/pngread.obj \
$(SLO)$/pngwrite.obj \
$(SLO)$/print.obj \
diff --git a/vcl/source/gdi/mapmod.cxx b/vcl/source/gdi/mapmod.cxx
index 31486c1aad05..ae7b13ca25b7 100644
--- a/vcl/source/gdi/mapmod.cxx
+++ b/vcl/source/gdi/mapmod.cxx
@@ -46,7 +46,7 @@ ImplMapMode::ImplMapMode() :
{
mnRefCount = 1;
meUnit = MAP_PIXEL;
- mbSimple = FALSE;
+ mbSimple = sal_False;
}
// -----------------------------------------------------------------------
@@ -58,7 +58,7 @@ ImplMapMode::ImplMapMode( const ImplMapMode& rImplMapMode ) :
{
mnRefCount = 1;
meUnit = rImplMapMode.meUnit;
- mbSimple = FALSE;
+ mbSimple = sal_False;
}
// -----------------------------------------------------------------------
@@ -66,7 +66,7 @@ ImplMapMode::ImplMapMode( const ImplMapMode& rImplMapMode ) :
SvStream& operator>>( SvStream& rIStm, ImplMapMode& rImplMapMode )
{
VersionCompat aCompat( rIStm, STREAM_READ );
- UINT16 nTmp16;
+ sal_uInt16 nTmp16;
rIStm >> nTmp16; rImplMapMode.meUnit = (MapUnit) nTmp16;
rIStm >> rImplMapMode.maOrigin >> rImplMapMode.maScaleX >>
@@ -81,7 +81,7 @@ SvStream& operator<<( SvStream& rOStm, const ImplMapMode& rImplMapMode )
{
VersionCompat aCompat( rOStm, STREAM_WRITE, 1 );
- rOStm << (UINT16) rImplMapMode.meUnit <<
+ rOStm << (sal_uInt16) rImplMapMode.meUnit <<
rImplMapMode.maOrigin <<
rImplMapMode.maScaleX <<
rImplMapMode.maScaleY <<
@@ -107,7 +107,7 @@ ImplMapMode* ImplMapMode::ImplGetStaticMapMode( MapUnit eUnit )
pImplMapMode->maScaleX = aDefFraction;
pImplMapMode->maScaleY = aDefFraction;
pImplMapMode->meUnit = eUnit;
- pImplMapMode->mbSimple = TRUE;
+ pImplMapMode->mbSimple = sal_True;
}
return pImplMapMode;
@@ -260,40 +260,40 @@ MapMode& MapMode::operator=( const MapMode& rMapMode )
// -----------------------------------------------------------------------
-BOOL MapMode::operator==( const MapMode& rMapMode ) const
+sal_Bool MapMode::operator==( const MapMode& rMapMode ) const
{
DBG_CHKTHIS( MapMode, NULL );
DBG_CHKOBJ( &rMapMode, MapMode, NULL );
if ( mpImplMapMode == rMapMode.mpImplMapMode )
- return TRUE;
+ return sal_True;
if ( (mpImplMapMode->meUnit == rMapMode.mpImplMapMode->meUnit) &&
(mpImplMapMode->maOrigin == rMapMode.mpImplMapMode->maOrigin) &&
(mpImplMapMode->maScaleX == rMapMode.mpImplMapMode->maScaleX) &&
(mpImplMapMode->maScaleY == rMapMode.mpImplMapMode->maScaleY) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL MapMode::IsDefault() const
+sal_Bool MapMode::IsDefault() const
{
DBG_CHKTHIS( MapMode, NULL );
ImplMapMode* pDefMapMode = ImplMapMode::ImplGetStaticMapMode( MAP_PIXEL );
if ( mpImplMapMode == pDefMapMode )
- return TRUE;
+ return sal_True;
if ( (mpImplMapMode->meUnit == pDefMapMode->meUnit) &&
(mpImplMapMode->maOrigin == pDefMapMode->maOrigin) &&
(mpImplMapMode->maScaleX == pDefMapMode->maScaleX) &&
(mpImplMapMode->maScaleY == pDefMapMode->maScaleY) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 6f9d1a85e510..feba437c7c2f 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -66,7 +66,7 @@ inline void ImplScaleRect( Rectangle& rRect, double fScaleX, double fScaleY )
inline void ImplScalePoly( Polygon& rPoly, double fScaleX, double fScaleY )
{
- for( USHORT i = 0, nCount = rPoly.GetSize(); i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = rPoly.GetSize(); i < nCount; i++ )
ImplScalePoint( rPoly[ i ], fScaleX, fScaleY );
}
@@ -103,7 +103,7 @@ MetaAction::MetaAction() :
// ------------------------------------------------------------------------
-MetaAction::MetaAction( USHORT nType ) :
+MetaAction::MetaAction( sal_uInt16 nType ) :
mnRefCount( 1 ),
mnType( nType )
{
@@ -176,7 +176,7 @@ void MetaAction::Read( SvStream& rIStm, ImplMetaReadData* )
MetaAction* MetaAction::ReadMetaAction( SvStream& rIStm, ImplMetaReadData* pData )
{
MetaAction* pAction = NULL;
- UINT16 nType;
+ sal_uInt16 nType;
rIStm >> nType;
@@ -309,7 +309,7 @@ void MetaPixelAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
rOStm << maPt;
- maColor.Write( rOStm, TRUE );
+ maColor.Write( rOStm, sal_True );
}
// ------------------------------------------------------------------------
@@ -318,7 +318,7 @@ void MetaPixelAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
rIStm >> maPt;
- maColor.Read( rIStm, TRUE );
+ maColor.Read( rIStm, sal_True );
}
// ========================================================================
@@ -1133,7 +1133,7 @@ void MetaPolyPolygonAction::Move( long nHorzMove, long nVertMove )
void MetaPolyPolygonAction::Scale( double fScaleX, double fScaleY )
{
- for( USHORT i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
ImplScalePoly( maPolyPoly[ i ], fScaleX, fScaleY );
}
@@ -1206,7 +1206,7 @@ IMPL_META_ACTION( Text, META_TEXT_ACTION )
// ------------------------------------------------------------------------
MetaTextAction::MetaTextAction( const Point& rPt, const XubString& rStr,
- USHORT nIndex, USHORT nLen ) :
+ sal_uInt16 nIndex, sal_uInt16 nLen ) :
MetaAction ( META_TEXT_ACTION ),
maPt ( rPt ),
maStr ( rStr ),
@@ -1315,7 +1315,7 @@ MetaTextArrayAction::MetaTextArrayAction( const MetaTextArrayAction& rAction ) :
{
if( rAction.mpDXAry )
{
- const ULONG nAryLen = mnLen;
+ const sal_uLong nAryLen = mnLen;
mpDXAry = new sal_Int32[ nAryLen ];
memcpy( mpDXAry, rAction.mpDXAry, nAryLen * sizeof( sal_Int32 ) );
@@ -1329,15 +1329,15 @@ MetaTextArrayAction::MetaTextArrayAction( const MetaTextArrayAction& rAction ) :
MetaTextArrayAction::MetaTextArrayAction( const Point& rStartPt,
const XubString& rStr,
const sal_Int32* pDXAry,
- USHORT nIndex,
- USHORT nLen ) :
+ sal_uInt16 nIndex,
+ sal_uInt16 nLen ) :
MetaAction ( META_TEXTARRAY_ACTION ),
maStartPt ( rStartPt ),
maStr ( rStr ),
mnIndex ( nIndex ),
mnLen ( ( nLen == STRING_LEN ) ? rStr.Len() : nLen )
{
- const ULONG nAryLen = pDXAry ? mnLen : 0;
+ const sal_uLong nAryLen = pDXAry ? mnLen : 0;
if( nAryLen )
{
@@ -1386,7 +1386,7 @@ void MetaTextArrayAction::Scale( double fScaleX, double fScaleY )
if ( mpDXAry && mnLen )
{
- for ( USHORT i = 0, nCount = mnLen; i < nCount; i++ )
+ for ( sal_uInt16 i = 0, nCount = mnLen; i < nCount; i++ )
mpDXAry[ i ] = FRound( mpDXAry[ i ] * fabs(fScaleX) );
}
}
@@ -1415,7 +1415,7 @@ void MetaTextArrayAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
rOStm << mnLen;
rOStm << nAryLen;
- for( ULONG i = 0UL; i < nAryLen; i++ )
+ for( sal_uLong i = 0UL; i < nAryLen; i++ )
rOStm << mpDXAry[ i ];
sal_uInt16 j, nLen = maStr.Len(); // version 2
@@ -1457,7 +1457,7 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
mpDXAry = new (std::nothrow)sal_Int32[ mnLen ];
if ( mpDXAry )
{
- ULONG i;
+ sal_uLong i;
for( i = 0UL; i < nAryLen; i++ )
rIStm >> mpDXAry[ i ];
@@ -1499,7 +1499,7 @@ IMPL_META_ACTION( StretchText, META_STRETCHTEXT_ACTION )
MetaStretchTextAction::MetaStretchTextAction( const Point& rPt, sal_uInt32 nWidth,
const XubString& rStr,
- USHORT nIndex, USHORT nLen ) :
+ sal_uInt16 nIndex, sal_uInt16 nLen ) :
MetaAction ( META_STRETCHTEXT_ACTION ),
maPt ( rPt ),
maStr ( rStr ),
@@ -1537,7 +1537,7 @@ void MetaStretchTextAction::Move( long nHorzMove, long nVertMove )
void MetaStretchTextAction::Scale( double fScaleX, double fScaleY )
{
ImplScalePoint( maPt, fScaleX, fScaleY );
- mnWidth = (ULONG)FRound( mnWidth * fabs(fScaleX) );
+ mnWidth = (sal_uLong)FRound( mnWidth * fabs(fScaleX) );
}
// ------------------------------------------------------------------------
@@ -1599,7 +1599,7 @@ IMPL_META_ACTION( TextRect, META_TEXTRECT_ACTION )
// ------------------------------------------------------------------------
MetaTextRectAction::MetaTextRectAction( const Rectangle& rRect,
- const XubString& rStr, USHORT nStyle ) :
+ const XubString& rStr, sal_uInt16 nStyle ) :
MetaAction ( META_TEXTRECT_ACTION ),
maRect ( rRect ),
maStr ( rStr ),
@@ -2457,7 +2457,7 @@ void MetaMaskScalePartAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
rOStm << maBmp;
- maColor.Write( rOStm, TRUE );
+ maColor.Write( rOStm, sal_True );
rOStm << maDstPt << maDstSz << maSrcPt << maSrcSz;
}
}
@@ -2468,7 +2468,7 @@ void MetaMaskScalePartAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
rIStm >> maBmp;
- maColor.Read( rIStm, TRUE );
+ maColor.Read( rIStm, sal_True );
rIStm >> maDstPt >> maDstSz >> maSrcPt >> maSrcSz;
}
@@ -2589,7 +2589,7 @@ void MetaGradientExAction::Move( long nHorzMove, long nVertMove )
void MetaGradientExAction::Scale( double fScaleX, double fScaleY )
{
- for( USHORT i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
ImplScalePoly( maPolyPoly[ i ], fScaleX, fScaleY );
}
@@ -2663,7 +2663,7 @@ void MetaHatchAction::Move( long nHorzMove, long nVertMove )
void MetaHatchAction::Scale( double fScaleX, double fScaleY )
{
- for( USHORT i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
ImplScalePoly( maPolyPoly[ i ], fScaleX, fScaleY );
}
@@ -2771,7 +2771,7 @@ IMPL_META_ACTION( ClipRegion, META_CLIPREGION_ACTION )
// ------------------------------------------------------------------------
-MetaClipRegionAction::MetaClipRegionAction( const Region& rRegion, BOOL bClip ) :
+MetaClipRegionAction::MetaClipRegionAction( const Region& rRegion, sal_Bool bClip ) :
MetaAction ( META_CLIPREGION_ACTION ),
maRegion ( rRegion ),
mbClip ( bClip )
@@ -3032,7 +3032,7 @@ IMPL_META_ACTION( LineColor, META_LINECOLOR_ACTION )
// ------------------------------------------------------------------------
-MetaLineColorAction::MetaLineColorAction( const Color& rColor, BOOL bSet ) :
+MetaLineColorAction::MetaLineColorAction( const Color& rColor, sal_Bool bSet ) :
MetaAction ( META_LINECOLOR_ACTION ),
maColor ( rColor ),
mbSet ( bSet )
@@ -3071,7 +3071,7 @@ sal_Bool MetaLineColorAction::Compare( const MetaAction& rMetaAction ) const
void MetaLineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- maColor.Write( rOStm, TRUE );
+ maColor.Write( rOStm, sal_True );
rOStm << mbSet;
}
@@ -3080,7 +3080,7 @@ void MetaLineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
void MetaLineColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- maColor.Read( rIStm, TRUE );
+ maColor.Read( rIStm, sal_True );
rIStm >> mbSet;
}
@@ -3090,7 +3090,7 @@ IMPL_META_ACTION( FillColor, META_FILLCOLOR_ACTION )
// ------------------------------------------------------------------------
-MetaFillColorAction::MetaFillColorAction( const Color& rColor, BOOL bSet ) :
+MetaFillColorAction::MetaFillColorAction( const Color& rColor, sal_Bool bSet ) :
MetaAction ( META_FILLCOLOR_ACTION ),
maColor ( rColor ),
mbSet ( bSet )
@@ -3129,7 +3129,7 @@ sal_Bool MetaFillColorAction::Compare( const MetaAction& rMetaAction ) const
void MetaFillColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- maColor.Write( rOStm, TRUE );
+ maColor.Write( rOStm, sal_True );
rOStm << mbSet;
}
@@ -3138,7 +3138,7 @@ void MetaFillColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
void MetaFillColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- maColor.Read( rIStm, TRUE );
+ maColor.Read( rIStm, sal_True );
rIStm >> mbSet;
}
@@ -3182,7 +3182,7 @@ sal_Bool MetaTextColorAction::Compare( const MetaAction& rMetaAction ) const
void MetaTextColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- maColor.Write( rOStm, TRUE );
+ maColor.Write( rOStm, sal_True );
}
// ------------------------------------------------------------------------
@@ -3190,7 +3190,7 @@ void MetaTextColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
void MetaTextColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- maColor.Read( rIStm, TRUE );
+ maColor.Read( rIStm, sal_True );
}
// ========================================================================
@@ -3199,7 +3199,7 @@ IMPL_META_ACTION( TextFillColor, META_TEXTFILLCOLOR_ACTION )
// ------------------------------------------------------------------------
-MetaTextFillColorAction::MetaTextFillColorAction( const Color& rColor, BOOL bSet ) :
+MetaTextFillColorAction::MetaTextFillColorAction( const Color& rColor, sal_Bool bSet ) :
MetaAction ( META_TEXTFILLCOLOR_ACTION ),
maColor ( rColor ),
mbSet ( bSet )
@@ -3238,7 +3238,7 @@ sal_Bool MetaTextFillColorAction::Compare( const MetaAction& rMetaAction ) const
void MetaTextFillColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- maColor.Write( rOStm, TRUE );
+ maColor.Write( rOStm, sal_True );
rOStm << mbSet;
}
@@ -3247,7 +3247,7 @@ void MetaTextFillColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
void MetaTextFillColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- maColor.Read( rIStm, TRUE );
+ maColor.Read( rIStm, sal_True );
rIStm >> mbSet;
}
@@ -3257,7 +3257,7 @@ IMPL_META_ACTION( TextLineColor, META_TEXTLINECOLOR_ACTION )
// ------------------------------------------------------------------------
-MetaTextLineColorAction::MetaTextLineColorAction( const Color& rColor, BOOL bSet ) :
+MetaTextLineColorAction::MetaTextLineColorAction( const Color& rColor, sal_Bool bSet ) :
MetaAction ( META_TEXTLINECOLOR_ACTION ),
maColor ( rColor ),
mbSet ( bSet )
@@ -3296,7 +3296,7 @@ sal_Bool MetaTextLineColorAction::Compare( const MetaAction& rMetaAction ) const
void MetaTextLineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- maColor.Write( rOStm, TRUE );
+ maColor.Write( rOStm, sal_True );
rOStm << mbSet;
}
@@ -3305,7 +3305,7 @@ void MetaTextLineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
void MetaTextLineColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- maColor.Read( rIStm, TRUE );
+ maColor.Read( rIStm, sal_True );
rIStm >> mbSet;
}
@@ -3315,7 +3315,7 @@ IMPL_META_ACTION( OverlineColor, META_OVERLINECOLOR_ACTION )
// ------------------------------------------------------------------------
-MetaOverlineColorAction::MetaOverlineColorAction( const Color& rColor, BOOL bSet ) :
+MetaOverlineColorAction::MetaOverlineColorAction( const Color& rColor, sal_Bool bSet ) :
MetaAction ( META_OVERLINECOLOR_ACTION ),
maColor ( rColor ),
mbSet ( bSet )
@@ -3354,7 +3354,7 @@ sal_Bool MetaOverlineColorAction::Compare( const MetaAction& rMetaAction ) const
void MetaOverlineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- maColor.Write( rOStm, TRUE );
+ maColor.Write( rOStm, sal_True );
rOStm << mbSet;
}
@@ -3363,7 +3363,7 @@ void MetaOverlineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
void MetaOverlineColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- maColor.Read( rIStm, TRUE );
+ maColor.Read( rIStm, sal_True );
rIStm >> mbSet;
}
@@ -3407,14 +3407,14 @@ sal_Bool MetaTextAlignAction::Compare( const MetaAction& rMetaAction ) const
void MetaTextAlignAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- rOStm << (UINT16) maAlign;
+ rOStm << (sal_uInt16) maAlign;
}
// ------------------------------------------------------------------------
void MetaTextAlignAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
- UINT16 nTmp16;
+ sal_uInt16 nTmp16;
COMPAT( rIStm );
rIStm >> nTmp16; maAlign = (TextAlign) nTmp16;
@@ -3564,7 +3564,7 @@ IMPL_META_ACTION( Push, META_PUSH_ACTION )
// ------------------------------------------------------------------------
-MetaPushAction::MetaPushAction( USHORT nFlags ) :
+MetaPushAction::MetaPushAction( sal_uInt16 nFlags ) :
MetaAction ( META_PUSH_ACTION ),
mnFlags ( nFlags )
{
@@ -3683,14 +3683,14 @@ sal_Bool MetaRasterOpAction::Compare( const MetaAction& rMetaAction ) const
void MetaRasterOpAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- rOStm << (UINT16) meRasterOp;
+ rOStm << (sal_uInt16) meRasterOp;
}
// ------------------------------------------------------------------------
void MetaRasterOpAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
- UINT16 nTmp16;
+ sal_uInt16 nTmp16;
COMPAT( rIStm );
rIStm >> nTmp16; meRasterOp = (RasterOp) nTmp16;
@@ -3702,7 +3702,7 @@ IMPL_META_ACTION( Transparent, META_TRANSPARENT_ACTION )
// ------------------------------------------------------------------------
-MetaTransparentAction::MetaTransparentAction( const PolyPolygon& rPolyPoly, USHORT nTransPercent ) :
+MetaTransparentAction::MetaTransparentAction( const PolyPolygon& rPolyPoly, sal_uInt16 nTransPercent ) :
MetaAction ( META_TRANSPARENT_ACTION ),
maPolyPoly ( rPolyPoly ),
mnTransPercent ( nTransPercent )
@@ -3736,7 +3736,7 @@ void MetaTransparentAction::Move( long nHorzMove, long nVertMove )
void MetaTransparentAction::Scale( double fScaleX, double fScaleY )
{
- for( USHORT i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
ImplScalePoly( maPolyPoly[ i ], fScaleX, fScaleY );
}
@@ -3943,7 +3943,7 @@ IMPL_META_ACTION( RefPoint, META_REFPOINT_ACTION )
// ------------------------------------------------------------------------
-MetaRefPointAction::MetaRefPointAction( const Point& rRefPoint, BOOL bSet ) :
+MetaRefPointAction::MetaRefPointAction( const Point& rRefPoint, sal_Bool bSet ) :
MetaAction ( META_REFPOINT_ACTION ),
maRefPoint ( rRefPoint ),
mbSet ( bSet )
@@ -4014,7 +4014,7 @@ MetaCommentAction::MetaCommentAction( const MetaCommentAction& rAct ) :
// ------------------------------------------------------------------------
-MetaCommentAction::MetaCommentAction( const ByteString& rComment, sal_Int32 nValue, const BYTE* pData, sal_uInt32 nDataSize ) :
+MetaCommentAction::MetaCommentAction( const ByteString& rComment, sal_Int32 nValue, const sal_uInt8* pData, sal_uInt32 nDataSize ) :
MetaAction ( META_COMMENT_ACTION ),
maComment ( rComment ),
mnValue ( nValue )
@@ -4024,7 +4024,7 @@ MetaCommentAction::MetaCommentAction( const ByteString& rComment, sal_Int32 nVal
// ------------------------------------------------------------------------
-MetaCommentAction::MetaCommentAction( const BYTE* pData, sal_uInt32 nDataSize ) :
+MetaCommentAction::MetaCommentAction( const sal_uInt8* pData, sal_uInt32 nDataSize ) :
MetaAction ( META_COMMENT_ACTION ),
mnValue ( 0L )
{
@@ -4041,11 +4041,11 @@ MetaCommentAction::~MetaCommentAction()
// ------------------------------------------------------------------------
-void MetaCommentAction::ImplInitDynamicData( const BYTE* pData, sal_uInt32 nDataSize )
+void MetaCommentAction::ImplInitDynamicData( const sal_uInt8* pData, sal_uInt32 nDataSize )
{
if ( nDataSize && pData )
{
- mnDataSize = nDataSize, mpData = new BYTE[ mnDataSize ];
+ mnDataSize = nDataSize, mpData = new sal_uInt8[ mnDataSize ];
memcpy( mpData, pData, mnDataSize );
}
else
@@ -4104,7 +4104,7 @@ void MetaCommentAction::Move( long nXMove, long nYMove )
aDest << aFill;
}
delete[] mpData;
- ImplInitDynamicData( static_cast<const BYTE*>( aDest.GetData() ), aDest.Tell() );
+ ImplInitDynamicData( static_cast<const sal_uInt8*>( aDest.GetData() ), aDest.Tell() );
}
}
}
@@ -4147,7 +4147,7 @@ void MetaCommentAction::Scale( double fXScale, double fYScale )
aDest << aFill;
}
delete[] mpData;
- ImplInitDynamicData( static_cast<const BYTE*>( aDest.GetData() ), aDest.Tell() );
+ ImplInitDynamicData( static_cast<const sal_uInt8*>( aDest.GetData() ), aDest.Tell() );
} else if( maComment.Equals( "EMF_PLUS_HEADER_INFO" ) ) {
SvMemoryStream aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
SvMemoryStream aDest;
@@ -4173,7 +4173,7 @@ void MetaCommentAction::Scale( double fXScale, double fYScale )
aDest << m11 << m12 << m21 << m22 << mdx << mdy;
// save them
- ImplInitDynamicData( static_cast<const BYTE*>( aDest.GetData() ), aDest.Tell() );
+ ImplInitDynamicData( static_cast<const sal_uInt8*>( aDest.GetData() ), aDest.Tell() );
}
}
}
@@ -4212,7 +4212,7 @@ void MetaCommentAction::Read( SvStream& rIStm, ImplMetaReadData* )
if( mnDataSize )
{
- mpData = new BYTE[ mnDataSize ];
+ mpData = new sal_uInt8[ mnDataSize ];
rIStm.Read( mpData, mnDataSize );
}
else
diff --git a/vcl/source/gdi/metric.cxx b/vcl/source/gdi/metric.cxx
index 5a65b04391f0..4814d6e3114e 100644
--- a/vcl/source/gdi/metric.cxx
+++ b/vcl/source/gdi/metric.cxx
@@ -35,6 +35,8 @@
#include <vector>
#include <set>
+#include <cstdio>
+
// =======================================================================
ImplFontMetric::ImplFontMetric()
@@ -52,6 +54,7 @@ ImplFontMetric::ImplFontMetric()
inline void ImplFontMetric::AddReference()
{
+ // TODO: disable refcounting on the default maps?
++mnRefCount;
}
@@ -59,6 +62,7 @@ inline void ImplFontMetric::AddReference()
inline void ImplFontMetric::DeReference()
{
+ // TODO: disable refcounting on the default maps?
if( --mnRefCount <= 0 )
delete this;
}
@@ -123,15 +127,15 @@ FontInfo& FontInfo::operator=( const FontInfo& rInfo )
// -----------------------------------------------------------------------
-BOOL FontInfo::operator==( const FontInfo& rInfo ) const
+sal_Bool FontInfo::operator==( const FontInfo& rInfo ) const
{
if( !Font::operator==( rInfo ) )
- return FALSE;
+ return sal_False;
if( mpImplMetric == rInfo.mpImplMetric )
- return TRUE;
+ return sal_True;
if( *mpImplMetric == *rInfo.mpImplMetric )
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -143,28 +147,28 @@ FontType FontInfo::GetType() const
// -----------------------------------------------------------------------
-BOOL FontInfo::IsDeviceFont() const
+sal_Bool FontInfo::IsDeviceFont() const
{
return mpImplMetric->IsDeviceFont();
}
// -----------------------------------------------------------------------
-BOOL FontInfo::SupportsLatin() const
+sal_Bool FontInfo::SupportsLatin() const
{
return mpImplMetric->SupportsLatin();
}
// -----------------------------------------------------------------------
-BOOL FontInfo::SupportsCJK() const
+sal_Bool FontInfo::SupportsCJK() const
{
return mpImplMetric->SupportsCJK();
}
// -----------------------------------------------------------------------
-BOOL FontInfo::SupportsCTL() const
+sal_Bool FontInfo::SupportsCTL() const
{
return mpImplMetric->SupportsCTL();
}
@@ -227,7 +231,7 @@ FontMetric& FontMetric::operator =( const FontMetric& rMetric )
// -----------------------------------------------------------------------
-BOOL FontMetric::operator==( const FontMetric& rMetric ) const
+sal_Bool FontMetric::operator==( const FontMetric& rMetric ) const
{
return FontInfo::operator==( rMetric );
}
@@ -236,7 +240,7 @@ BOOL FontMetric::operator==( const FontMetric& rMetric ) const
CmapResult::CmapResult( bool bSymbolic,
const sal_uInt32* pRangeCodes, int nRangeCount,
- const int* pStartGlyphs, const USHORT* pExtraGlyphIds )
+ const int* pStartGlyphs, const sal_uInt16* pExtraGlyphIds )
: mpRangeCodes( pRangeCodes)
, mpStartGlyphs( pStartGlyphs)
, mpGlyphIds( pExtraGlyphIds)
@@ -253,7 +257,7 @@ ImplFontCharMap::ImplFontCharMap( const CmapResult& rCR )
, mpGlyphIds( rCR.mpGlyphIds )
, mnRangeCount( rCR.mnRangeCount )
, mnCharCount( 0 )
-, mnRefCount( 1 )
+, mnRefCount( 0 )
{
const sal_uInt32* pRangePtr = mpRangeCodes;
for( int i = mnRangeCount; --i >= 0; pRangePtr += 2 )
@@ -264,7 +268,8 @@ ImplFontCharMap::ImplFontCharMap( const CmapResult& rCR )
}
}
-static ImplFontCharMap* pDefaultImplFontCharMap = NULL;
+static ImplFontCharMap* pDefaultUnicodeImplFontCharMap = NULL;
+static ImplFontCharMap* pDefaultSymbolImplFontCharMap = NULL;
static const sal_uInt32 aDefaultUnicodeRanges[] = {0x0020,0xD800, 0xE000,0xFFF0};
static const sal_uInt32 aDefaultSymbolRanges[] = {0x0020,0x0100, 0xF020,0xF100};
@@ -285,44 +290,60 @@ ImplFontCharMap::~ImplFontCharMap()
delete[] mpRangeCodes;
delete[] mpStartGlyphs;
delete[] mpGlyphIds;
-}
+ }
// -----------------------------------------------------------------------
-ImplFontCharMap* ImplFontCharMap::GetDefaultMap( bool bSymbols)
+namespace
{
- if( pDefaultImplFontCharMap )
- pDefaultImplFontCharMap->AddReference();
- else
+ ImplFontCharMap *GetDefaultUnicodeMap()
{
- const sal_uInt32* pRangeCodes = aDefaultUnicodeRanges;
- int nCodesCount = sizeof(aDefaultUnicodeRanges) / sizeof(*pRangeCodes);
- if( bSymbols )
+ if( !pDefaultUnicodeImplFontCharMap )
{
- pRangeCodes = aDefaultSymbolRanges;
- nCodesCount = sizeof(aDefaultSymbolRanges) / sizeof(*pRangeCodes);
+ const sal_uInt32* pRangeCodes = aDefaultUnicodeRanges;
+ int nCodesCount = sizeof(aDefaultUnicodeRanges) / sizeof(*pRangeCodes);
+ CmapResult aDefaultCR( false, pRangeCodes, nCodesCount/2 );
+ pDefaultUnicodeImplFontCharMap = new ImplFontCharMap( aDefaultCR );
+ pDefaultUnicodeImplFontCharMap->AddReference();
}
- CmapResult aDefaultCR( bSymbols, pRangeCodes, nCodesCount/2 );
- pDefaultImplFontCharMap = new ImplFontCharMap( aDefaultCR );
+ return pDefaultUnicodeImplFontCharMap;
}
- return pDefaultImplFontCharMap;
+ ImplFontCharMap *GetDefaultSymbolMap()
+ {
+ if( !pDefaultSymbolImplFontCharMap )
+ {
+ const sal_uInt32* pRangeCodes = aDefaultSymbolRanges;
+ int nCodesCount = sizeof(aDefaultSymbolRanges) / sizeof(*pRangeCodes);
+ CmapResult aDefaultCR( true, pRangeCodes, nCodesCount/2 );
+ pDefaultSymbolImplFontCharMap = new ImplFontCharMap( aDefaultCR );
+ pDefaultSymbolImplFontCharMap->AddReference();
+ }
+
+ return pDefaultSymbolImplFontCharMap;
+ }
+}
+
+ImplFontCharMap* ImplFontCharMap::GetDefaultMap( bool bSymbols)
+{
+ return bSymbols ? GetDefaultSymbolMap() : GetDefaultUnicodeMap();
}
// -----------------------------------------------------------------------
-void ImplFontCharMap::AddReference()
+void ImplFontCharMap::AddReference( void ) const
{
+ // TODO: disable refcounting on the default maps?
++mnRefCount;
}
// -----------------------------------------------------------------------
-void ImplFontCharMap::DeReference()
+void ImplFontCharMap::DeReference( void ) const
{
if( --mnRefCount <= 0 )
- if( this != pDefaultImplFontCharMap )
+ if( (this != pDefaultUnicodeImplFontCharMap) && (this != pDefaultSymbolImplFontCharMap) )
delete this;
}
@@ -607,7 +628,7 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
sal_uInt32* pCodePairs = NULL;
int* pStartGlyphs = NULL;
- typedef std::vector<USHORT> U16Vector;
+ typedef std::vector<sal_uInt16> U16Vector;
U16Vector aGlyphIdArray;
aGlyphIdArray.reserve( 0x1000 );
aGlyphIdArray.push_back( 0 );
@@ -645,7 +666,7 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
const unsigned char* pGlyphIdPtr = pOffsetBase + 2*i + nRangeOffset;
for( sal_uInt32 c = cMinChar; c <= cMaxChar; ++c, pGlyphIdPtr+=2 ) {
const int nGlyphIndex = GetUShort( pGlyphIdPtr ) + nGlyphDelta;
- aGlyphIdArray.push_back( static_cast<USHORT>(nGlyphIndex) );
+ aGlyphIdArray.push_back( static_cast<sal_uInt16>(nGlyphIndex) );
}
}
}
@@ -787,11 +808,11 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
// prepare the glyphid-array if needed
// TODO: merge ranges if they are close enough?
- USHORT* pGlyphIds = NULL;
+ sal_uInt16* pGlyphIds = NULL;
if( !aGlyphIdArray.empty())
{
- pGlyphIds = new USHORT[ aGlyphIdArray.size() ];
- USHORT* pOut = pGlyphIds;
+ pGlyphIds = new sal_uInt16[ aGlyphIdArray.size() ];
+ sal_uInt16* pOut = pGlyphIds;
U16Vector::const_iterator it = aGlyphIdArray.begin();
while( it != aGlyphIdArray.end() )
*(pOut++) = *(it++);
@@ -809,7 +830,9 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
FontCharMap::FontCharMap()
: mpImpl( ImplFontCharMap::GetDefaultMap() )
-{}
+{
+ mpImpl->AddReference();
+}
// -----------------------------------------------------------------------
@@ -835,31 +858,26 @@ int FontCharMap::CountCharsInRange( sal_uInt32 cMin, sal_uInt32 cMax ) const
// -----------------------------------------------------------------------
-void FontCharMap::Reset( ImplFontCharMap* pNewMap )
+void FontCharMap::Reset( const ImplFontCharMap* pNewMap )
{
+ mpImpl->DeReference();
if( pNewMap == NULL )
- {
- mpImpl->DeReference();
mpImpl = ImplFontCharMap::GetDefaultMap();
- }
else if( pNewMap != mpImpl )
- {
- mpImpl->DeReference();
mpImpl = pNewMap;
- mpImpl->AddReference();
- }
+ mpImpl->AddReference();
}
// -----------------------------------------------------------------------
-BOOL FontCharMap::IsDefaultMap() const
+sal_Bool FontCharMap::IsDefaultMap() const
{
return mpImpl->IsDefaultMap();
}
// -----------------------------------------------------------------------
-BOOL FontCharMap::HasChar( sal_uInt32 cChar ) const
+sal_Bool FontCharMap::HasChar( sal_uInt32 cChar ) const
{
return mpImpl->HasChar( cChar );
}
diff --git a/vcl/source/gdi/octree.cxx b/vcl/source/gdi/octree.cxx
index 4e5f50124277..c2f0d92f03c3 100644
--- a/vcl/source/gdi/octree.cxx
+++ b/vcl/source/gdi/octree.cxx
@@ -37,18 +37,18 @@
// - pMask -
// ---------
-static BYTE pImplMask[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
+static sal_uInt8 pImplMask[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
// -------------
// - NodeCache -
// -------------
-ImpNodeCache::ImpNodeCache( const ULONG nInitSize ) :
+ImpNodeCache::ImpNodeCache( const sal_uLong nInitSize ) :
pActNode( NULL )
{
- const ULONG nSize = nInitSize + 4;
+ const sal_uLong nSize = nInitSize + 4;
- for( ULONG i = 0; i < nSize; i++ )
+ for( sal_uLong i = 0; i < nSize; i++ )
{
OctreeNode* pNewNode = new NODE;
@@ -74,7 +74,7 @@ ImpNodeCache::~ImpNodeCache()
// - Octree -
// ----------
-Octree::Octree( ULONG nColors ) :
+Octree::Octree( sal_uLong nColors ) :
nMax ( nColors ),
nLeafCount ( 0L ),
pTree ( NULL ),
@@ -86,7 +86,7 @@ Octree::Octree( ULONG nColors ) :
// ------------------------------------------------------------------------
-Octree::Octree( const BitmapReadAccess& rReadAcc, ULONG nColors ) :
+Octree::Octree( const BitmapReadAccess& rReadAcc, sal_uLong nColors ) :
nMax ( nColors ),
nLeafCount ( 0L ),
pTree ( NULL ),
@@ -167,7 +167,7 @@ void Octree::ImplCreateOctree()
void Octree::ImplDeleteOctree( PPNODE ppNode )
{
- for ( ULONG i = 0UL; i < 8UL; i++ )
+ for ( sal_uLong i = 0UL; i < 8UL; i++ )
{
if ( (*ppNode)->pChild[ i ] )
ImplDeleteOctree( &(*ppNode)->pChild[ i ] );
@@ -205,9 +205,9 @@ void Octree::ImplAdd( PPNODE ppNode )
}
else
{
- const ULONG nShift = 7 - nLevel;
- const BYTE cMask = pImplMask[ nLevel ];
- const ULONG nIndex = ( ( ( pColor->GetRed() & cMask ) >> nShift ) << 2 ) |
+ const sal_uLong nShift = 7 - nLevel;
+ const sal_uInt8 cMask = pImplMask[ nLevel ];
+ const sal_uLong nIndex = ( ( ( pColor->GetRed() & cMask ) >> nShift ) << 2 ) |
( ( ( pColor->GetGreen() & cMask ) >> nShift ) << 1 ) |
( ( pColor->GetBlue() & cMask ) >> nShift );
@@ -220,12 +220,12 @@ void Octree::ImplAdd( PPNODE ppNode )
void Octree::ImplReduce()
{
- ULONG i;
+ sal_uLong i;
PNODE pNode;
- ULONG nRedSum = 0L;
- ULONG nGreenSum = 0L;
- ULONG nBlueSum = 0L;
- ULONG nChilds = 0L;
+ sal_uLong nRedSum = 0L;
+ sal_uLong nGreenSum = 0L;
+ sal_uLong nBlueSum = 0L;
+ sal_uLong nChilds = 0L;
for ( i = OCTREE_BITS - 1; i && !pReduce[i]; i-- ) {}
@@ -249,7 +249,7 @@ void Octree::ImplReduce()
}
}
- pNode->bLeaf = TRUE;
+ pNode->bLeaf = sal_True;
pNode->nRed = nRedSum;
pNode->nGreen = nGreenSum;
pNode->nBlue = nBlueSum;
@@ -263,11 +263,11 @@ void Octree::CreatePalette( PNODE pNode )
if( pNode->bLeaf )
{
pNode->nPalIndex = nPalIndex;
- aPal[ nPalIndex++ ] = BitmapColor( (BYTE) ( (double) pNode->nRed / pNode->nCount ),
- (BYTE) ( (double) pNode->nGreen / pNode->nCount ),
- (BYTE) ( (double) pNode->nBlue / pNode->nCount ) );
+ aPal[ nPalIndex++ ] = BitmapColor( (sal_uInt8) ( (double) pNode->nRed / pNode->nCount ),
+ (sal_uInt8) ( (double) pNode->nGreen / pNode->nCount ),
+ (sal_uInt8) ( (double) pNode->nBlue / pNode->nCount ) );
}
- else for( ULONG i = 0UL; i < 8UL; i++ )
+ else for( sal_uLong i = 0UL; i < 8UL; i++ )
if( pNode->pChild[ i ] )
CreatePalette( pNode->pChild[ i ] );
@@ -281,9 +281,9 @@ void Octree::GetPalIndex( PNODE pNode )
nPalIndex = pNode->nPalIndex;
else
{
- const ULONG nShift = 7 - nLevel;
- const BYTE cMask = pImplMask[ nLevel++ ];
- const ULONG nIndex = ( ( ( pColor->GetRed() & cMask ) >> nShift ) << 2 ) |
+ const sal_uLong nShift = 7 - nLevel;
+ const sal_uInt8 cMask = pImplMask[ nLevel++ ];
+ const sal_uLong nIndex = ( ( ( pColor->GetRed() & cMask ) >> nShift ) << 2 ) |
( ( ( pColor->GetGreen() & cMask ) >> nShift ) << 1 ) |
( ( pColor->GetBlue() & cMask ) >> nShift );
@@ -298,27 +298,27 @@ void Octree::GetPalIndex( PNODE pNode )
InverseColorMap::InverseColorMap( const BitmapPalette& rPal ) :
nBits( 8 - OCTREE_BITS )
{
- ULONG* cdp;
- BYTE* crgbp;
- const ULONG nColorMax = 1 << OCTREE_BITS;
- const ULONG xsqr = 1 << ( nBits << 1 );
- const ULONG xsqr2 = xsqr << 1;
- const ULONG nColors = rPal.GetEntryCount();
+ sal_uLong* cdp;
+ sal_uInt8* crgbp;
+ const sal_uLong nColorMax = 1 << OCTREE_BITS;
+ const sal_uLong xsqr = 1 << ( nBits << 1 );
+ const sal_uLong xsqr2 = xsqr << 1;
+ const sal_uLong nColors = rPal.GetEntryCount();
const long x = 1L << nBits;
const long x2 = x >> 1L;
- ULONG r, g, b;
+ sal_uLong r, g, b;
long rxx, gxx, bxx;
long rdist, gdist, bdist;
long crinc, cginc, cbinc;
ImplCreateBuffers( nColorMax );
- for( ULONG nIndex = 0; nIndex < nColors; nIndex++ )
+ for( sal_uLong nIndex = 0; nIndex < nColors; nIndex++ )
{
- const BitmapColor& rColor = rPal[ (USHORT) nIndex ];
- const BYTE cRed = rColor.GetRed();
- const BYTE cGreen = rColor.GetGreen();
- const BYTE cBlue = rColor.GetBlue();
+ const BitmapColor& rColor = rPal[ (sal_uInt16) nIndex ];
+ const sal_uInt8 cRed = rColor.GetRed();
+ const sal_uInt8 cGreen = rColor.GetGreen();
+ const sal_uInt8 cBlue = rColor.GetBlue();
rdist = cRed - x2;
gdist = cGreen - x2;
@@ -329,7 +329,7 @@ InverseColorMap::InverseColorMap( const BitmapPalette& rPal ) :
cginc = ( xsqr - ( cGreen << nBits ) ) << 1L;
cbinc = ( xsqr - ( cBlue << nBits ) ) << 1L;
- cdp = (ULONG*) pBuffer;
+ cdp = (sal_uLong*) pBuffer;
crgbp = pMap;
for( r = 0, rxx = crinc; r < nColorMax; rdist += rxx, r++, rxx += xsqr2 )
@@ -340,7 +340,7 @@ InverseColorMap::InverseColorMap( const BitmapPalette& rPal ) :
if ( !nIndex || ( (long) *cdp ) > bdist )
{
*cdp = bdist;
- *crgbp = (BYTE) nIndex;
+ *crgbp = (sal_uInt8) nIndex;
}
}
}
@@ -357,15 +357,15 @@ InverseColorMap::~InverseColorMap()
// ------------------------------------------------------------------------
-void InverseColorMap::ImplCreateBuffers( const ULONG nMax )
+void InverseColorMap::ImplCreateBuffers( const sal_uLong nMax )
{
- const ULONG nCount = nMax * nMax * nMax;
- const ULONG nSize = nCount * sizeof( ULONG );
+ const sal_uLong nCount = nMax * nMax * nMax;
+ const sal_uLong nSize = nCount * sizeof( sal_uLong );
- pMap = (BYTE*) rtl_allocateMemory( nCount );
+ pMap = (sal_uInt8*) rtl_allocateMemory( nCount );
memset( pMap, 0x00, nCount );
- pBuffer = (BYTE*) rtl_allocateMemory( nSize );
+ pBuffer = (sal_uInt8*) rtl_allocateMemory( nSize );
memset( pBuffer, 0xff, nSize );
}
diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx
index 018665bf6b89..efd5484dad01 100644..100755
--- a/vcl/source/gdi/outdev.cxx
+++ b/vcl/source/gdi/outdev.cxx
@@ -119,9 +119,9 @@ struct ImplObjStack
Point* mpRefPoint;
TextAlign meTextAlign;
RasterOp meRasterOp;
- ULONG mnTextLayoutMode;
+ sal_uLong mnTextLayoutMode;
LanguageType meTextLanguage;
- USHORT mnFlags;
+ sal_uInt16 mnFlags;
};
// -----------------------------------------------------------------------
@@ -199,10 +199,6 @@ bool OutputDevice::ImplSelectClipRegion( const Region& rRegion, SalGraphics* pGr
{
DBG_TESTSOLARMUTEX();
- // TODO(Q3): Change from static to plain method - everybody's
- // calling it with pOutDev=this!
- // => done, but only with minimal changes for now => TODO
- OutputDevice* const pOutDev = this;
if( !pGraphics )
{
if( !mpGraphics )
@@ -211,91 +207,8 @@ bool OutputDevice::ImplSelectClipRegion( const Region& rRegion, SalGraphics* pGr
pGraphics = mpGraphics;
}
- if( rRegion.HasPolyPolygon()
- && pGraphics->supportsOperation( OutDevSupport_B2DClip ) )
- {
- const ::basegfx::B2DPolyPolygon& rB2DPolyPolygon = rRegion.GetB2DPolyPolygon();
- pGraphics->BeginSetClipRegion( 0 );
- pGraphics->UnionClipRegion( rB2DPolyPolygon, pOutDev );
- pGraphics->EndSetClipRegion();
- return true;
- }
-
- long nX;
- long nY;
- long nWidth;
- long nHeight;
- ULONG nRectCount;
- ImplRegionInfo aInfo;
- BOOL bRegionRect;
- BOOL bClipRegion = TRUE;
- const BOOL bClipDeviceBounds( !pOutDev->GetPDFWriter()
- && pOutDev->GetOutDevType() != OUTDEV_PRINTER );
-
- nRectCount = rRegion.GetRectCount();
- pGraphics->BeginSetClipRegion( nRectCount );
- bRegionRect = rRegion.ImplGetFirstRect( aInfo, nX, nY, nWidth, nHeight );
- if( bClipDeviceBounds )
- {
- // #b6520266# Perform actual rect clip against outdev
- // dimensions, to generate empty clips whenever one of the
- // values is completely off the device.
- const long nOffX( pOutDev->mnOutOffX );
- const long nOffY( pOutDev->mnOutOffY );
- const long nDeviceWidth( pOutDev->GetOutputWidthPixel() );
- const long nDeviceHeight( pOutDev->GetOutputHeightPixel() );
- Rectangle aDeviceBounds( nOffX, nOffY,
- nOffX+nDeviceWidth-1,
- nOffY+nDeviceHeight-1 );
- while ( bRegionRect )
- {
- // #i59315# Limit coordinates passed to sal layer to actual
- // outdev dimensions - everything else bears the risk of
- // overflowing internal coordinates (e.g. the 16 bit wire
- // format of X11).
- Rectangle aTmpRect(nX,nY,nX+nWidth-1,nY+nHeight-1);
- aTmpRect.Intersection(aDeviceBounds);
-
- if( !aTmpRect.IsEmpty() )
- {
- if ( !pGraphics->UnionClipRegion( aTmpRect.Left(),
- aTmpRect.Top(),
- aTmpRect.GetWidth(),
- aTmpRect.GetHeight(),
- pOutDev ) )
- {
- bClipRegion = FALSE;
- }
- }
- else
- {
- // #i79850# Fake off-screen clip
- if ( !pGraphics->UnionClipRegion( nDeviceWidth+1,
- nDeviceHeight+1,
- 1, 1,
- pOutDev ) )
- {
- bClipRegion = FALSE;
- }
- }
- DBG_ASSERT( bClipRegion, "OutputDevice::ImplSelectClipRegion() - can't create region" );
- bRegionRect = rRegion.ImplGetNextRect( aInfo, nX, nY, nWidth, nHeight );
- }
- }
- else
- {
- // #i65720# Actually, _don't_ clip anything on printer or PDF
- // export, since output might be visible outside the specified
- // device boundaries.
- while ( bRegionRect )
- {
- if ( !pGraphics->UnionClipRegion( nX, nY, nWidth, nHeight, pOutDev ) )
- bClipRegion = FALSE;
- DBG_ASSERT( bClipRegion, "OutputDevice::ImplSelectClipRegion() - can't cerate region" );
- bRegionRect = rRegion.ImplGetNextRect( aInfo, nX, nY, nWidth, nHeight );
- }
- }
- pGraphics->EndSetClipRegion();
+ bool bClipRegion = pGraphics->SetClipRegion( rRegion, this );
+ OSL_ENSURE( bClipRegion, "OutputDevice::ImplSelectClipRegion() - can't cerate region" );
return bClipRegion;
}
@@ -316,7 +229,7 @@ Polygon ImplSubdivideBezier( const Polygon& rPoly )
PolyPolygon ImplSubdivideBezier( const PolyPolygon& rPolyPoly )
{
- USHORT i, nPolys = rPolyPoly.Count();
+ sal_uInt16 i, nPolys = rPolyPoly.Count();
PolyPolygon aPolyPoly( nPolys );
for( i=0; i<nPolys; ++i )
aPolyPoly.Insert( ImplSubdivideBezier( rPolyPoly.GetObject(i) ) );
@@ -327,7 +240,7 @@ PolyPolygon ImplSubdivideBezier( const PolyPolygon& rPolyPoly )
// =======================================================================
// #100127# Extracted from OutputDevice::DrawPolyPolygon()
-void OutputDevice::ImplDrawPolyPolygon( USHORT nPoly, const PolyPolygon& rPolyPoly )
+void OutputDevice::ImplDrawPolyPolygon( sal_uInt16 nPoly, const PolyPolygon& rPolyPoly )
{
// AW: This crashes on empty PolyPolygons, avoid that
if(!nPoly)
@@ -335,28 +248,28 @@ void OutputDevice::ImplDrawPolyPolygon( USHORT nPoly, const PolyPolygon& rPolyPo
sal_uInt32 aStackAry1[OUTDEV_POLYPOLY_STACKBUF];
PCONSTSALPOINT aStackAry2[OUTDEV_POLYPOLY_STACKBUF];
- BYTE* aStackAry3[OUTDEV_POLYPOLY_STACKBUF];
+ sal_uInt8* aStackAry3[OUTDEV_POLYPOLY_STACKBUF];
sal_uInt32* pPointAry;
PCONSTSALPOINT* pPointAryAry;
- const BYTE** pFlagAryAry;
- USHORT i = 0, j = 0, last = 0;
- BOOL bHaveBezier = sal_False;
+ const sal_uInt8** pFlagAryAry;
+ sal_uInt16 i = 0, j = 0, last = 0;
+ sal_Bool bHaveBezier = sal_False;
if ( nPoly > OUTDEV_POLYPOLY_STACKBUF )
{
pPointAry = new sal_uInt32[nPoly];
pPointAryAry = new PCONSTSALPOINT[nPoly];
- pFlagAryAry = new const BYTE*[nPoly];
+ pFlagAryAry = new const sal_uInt8*[nPoly];
}
else
{
pPointAry = aStackAry1;
pPointAryAry = aStackAry2;
- pFlagAryAry = (const BYTE**)aStackAry3;
+ pFlagAryAry = (const sal_uInt8**)aStackAry3;
}
do
{
const Polygon& rPoly = rPolyPoly.GetObject( i );
- USHORT nSize = rPoly.GetSize();
+ sal_uInt16 nSize = rPoly.GetSize();
if ( nSize )
{
pPointAry[j] = nSize;
@@ -460,33 +373,33 @@ OutputDevice::OutputDevice() :
mnTextLayoutMode = TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_TEXTORIGIN_LEFT;
meOutDevType = OUTDEV_DONTKNOW;
meOutDevViewType = OUTDEV_VIEWTYPE_DONTKNOW;
- mbMap = FALSE;
- mbMapIsDefault = TRUE;
- mbClipRegion = FALSE;
- mbBackground = FALSE;
- mbOutput = TRUE;
- mbDevOutput = FALSE;
- mbOutputClipped = FALSE;
+ mbMap = sal_False;
+ mbMapIsDefault = sal_True;
+ mbClipRegion = sal_False;
+ mbBackground = sal_False;
+ mbOutput = sal_True;
+ mbDevOutput = sal_False;
+ mbOutputClipped = sal_False;
maTextColor = Color( COL_BLACK );
maOverlineColor = Color( COL_TRANSPARENT );
meTextAlign = maFont.GetAlign();
meRasterOp = ROP_OVERPAINT;
mnAntialiasing = 0;
meTextLanguage = 0; // TODO: get default from configuration?
- mbLineColor = TRUE;
- mbFillColor = TRUE;
- mbInitLineColor = TRUE;
- mbInitFillColor = TRUE;
- mbInitFont = TRUE;
- mbInitTextColor = TRUE;
- mbInitClipRegion = TRUE;
- mbClipRegionSet = FALSE;
- mbKerning = FALSE;
- mbNewFont = TRUE;
- mbTextLines = FALSE;
- mbTextSpecial = FALSE;
- mbRefPoint = FALSE;
- mbEnableRTL = FALSE; // mirroring must be explicitly allowed (typically for windows only)
+ mbLineColor = sal_True;
+ mbFillColor = sal_True;
+ mbInitLineColor = sal_True;
+ mbInitFillColor = sal_True;
+ mbInitFont = sal_True;
+ mbInitTextColor = sal_True;
+ mbInitClipRegion = sal_True;
+ mbClipRegionSet = sal_False;
+ mbKerning = sal_False;
+ mbNewFont = sal_True;
+ mbTextLines = sal_False;
+ mbTextSpecial = sal_False;
+ mbRefPoint = sal_False;
+ mbEnableRTL = sal_False; // mirroring must be explicitly allowed (typically for windows only)
// struct ImplMapRes
maMapRes.mnMapOfsX = 0;
@@ -510,7 +423,7 @@ OutputDevice::~OutputDevice()
if ( GetUnoGraphicsList() )
{
- UnoWrapperBase* pWrapper = Application::GetUnoWrapper( FALSE );
+ UnoWrapperBase* pWrapper = Application::GetUnoWrapper( sal_False );
if ( pWrapper )
pWrapper->ReleaseAllGraphics( this );
delete mpUnoGraphicsList;
@@ -577,7 +490,7 @@ bool OutputDevice::supportsOperation( OutDevSupportType eType ) const
// -----------------------------------------------------------------------
-void OutputDevice::EnableRTL( BOOL bEnable )
+void OutputDevice::EnableRTL( sal_Bool bEnable )
{
mbEnableRTL = (bEnable != 0);
if( meOutDevType == OUTDEV_VIRDEV )
@@ -602,11 +515,11 @@ void OutputDevice::EnableRTL( BOOL bEnable )
mpAlphaVDev->EnableRTL( bEnable );
}
-BOOL OutputDevice::ImplHasMirroredGraphics()
+sal_Bool OutputDevice::ImplHasMirroredGraphics()
{
// HOTFIX for #i55719#
if( meOutDevType == OUTDEV_PRINTER )
- return FALSE;
+ return sal_False;
return ( ImplGetGraphics() && (mpGraphics->GetLayout() & SAL_LAYOUT_BIDI_RTL) );
}
@@ -635,7 +548,7 @@ void OutputDevice::ImplReMirror( Region &rRegion ) const
long nWidth;
long nHeight;
ImplRegionInfo aInfo;
- BOOL bRegionRect;
+ sal_Bool bRegionRect;
Region aMirroredRegion;
bRegionRect = rRegion.ImplGetFirstRect( aInfo, nX, nY, nWidth, nHeight );
@@ -657,13 +570,13 @@ int OutputDevice::ImplGetGraphics() const
DBG_TESTSOLARMUTEX();
if ( mpGraphics )
- return TRUE;
+ return sal_True;
- mbInitLineColor = TRUE;
- mbInitFillColor = TRUE;
- mbInitFont = TRUE;
- mbInitTextColor = TRUE;
- mbInitClipRegion = TRUE;
+ mbInitLineColor = sal_True;
+ mbInitFillColor = sal_True;
+ mbInitFont = sal_True;
+ mbInitTextColor = sal_True;
+ mbInitClipRegion = sal_True;
ImplSVData* pSVData = ImplGetSVData();
if ( meOutDevType == OUTDEV_WINDOW )
@@ -687,7 +600,7 @@ int OutputDevice::ImplGetGraphics() const
{
// steal the wingraphics from the other outdev
mpGraphics = pReleaseOutDev->mpGraphics;
- pReleaseOutDev->ImplReleaseGraphics( FALSE );
+ pReleaseOutDev->ImplReleaseGraphics( sal_False );
}
else
{
@@ -797,15 +710,15 @@ int OutputDevice::ImplGetGraphics() const
{
mpGraphics->SetXORMode( (ROP_INVERT == meRasterOp) || (ROP_XOR == meRasterOp), ROP_INVERT == meRasterOp );
mpGraphics->setAntiAliasB2DDraw(mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW);
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void OutputDevice::ImplReleaseGraphics( BOOL bRelease )
+void OutputDevice::ImplReleaseGraphics( sal_Bool bRelease )
{
DBG_TESTSOLARMUTEX();
@@ -961,7 +874,7 @@ void OutputDevice::ImplInvalidateViewTransform()
// -----------------------------------------------------------------------
-BOOL OutputDevice::ImplIsRecordLayout() const
+sal_Bool OutputDevice::ImplIsRecordLayout() const
{
return mpOutDevData && mpOutDevData->mpRecordLayout;
}
@@ -1002,7 +915,7 @@ void OutputDevice::ImplInitLineColor()
else
mpGraphics->SetLineColor();
- mbInitLineColor = FALSE;
+ mbInitLineColor = sal_False;
}
// -----------------------------------------------------------------------
@@ -1025,7 +938,7 @@ void OutputDevice::ImplInitFillColor()
else
mpGraphics->SetFillColor();
- mbInitFillColor = FALSE;
+ mbInitFillColor = sal_False;
}
// -----------------------------------------------------------------------
@@ -1055,43 +968,56 @@ void OutputDevice::ImplInitClipRegion()
if ( mbClipRegion )
aRegion.Intersect( ImplPixelToDevicePixel( maRegion ) );
if ( aRegion.IsEmpty() )
- mbOutputClipped = TRUE;
+ mbOutputClipped = sal_True;
else
{
- mbOutputClipped = FALSE;
+ mbOutputClipped = sal_False;
ImplSelectClipRegion( aRegion );
}
- mbClipRegionSet = TRUE;
+ mbClipRegionSet = sal_True;
}
else
{
if ( mbClipRegion )
{
if ( maRegion.IsEmpty() )
- mbOutputClipped = TRUE;
+ mbOutputClipped = sal_True;
else
{
- mbOutputClipped = FALSE;
- ImplSelectClipRegion(
- // #102532# Respect output offset also for clip region
- ImplPixelToDevicePixel( maRegion ) );
+ mbOutputClipped = sal_False;
+
+ // #102532# Respect output offset also for clip region
+ Region aRegion( ImplPixelToDevicePixel( maRegion ) );
+ const bool bClipDeviceBounds( ! GetPDFWriter()
+ && GetOutDevType() != OUTDEV_PRINTER );
+ if( bClipDeviceBounds )
+ {
+ // #b6520266# Perform actual rect clip against outdev
+ // dimensions, to generate empty clips whenever one of the
+ // values is completely off the device.
+ Rectangle aDeviceBounds( mnOutOffX, mnOutOffY,
+ mnOutOffX+GetOutputWidthPixel()-1,
+ mnOutOffY+GetOutputHeightPixel()-1 );
+ aRegion.Intersect( aDeviceBounds );
+ }
+ ImplSelectClipRegion( aRegion );
}
- mbClipRegionSet = TRUE;
+ mbClipRegionSet = sal_True;
}
else
{
if ( mbClipRegionSet )
{
mpGraphics->ResetClipRegion();
- mbClipRegionSet = FALSE;
+ mbClipRegionSet = sal_False;
}
- mbOutputClipped = FALSE;
+ mbOutputClipped = sal_False;
}
}
- mbInitClipRegion = FALSE;
+ mbInitClipRegion = sal_False;
}
// -----------------------------------------------------------------------
@@ -1105,710 +1031,27 @@ void OutputDevice::ImplSetClipRegion( const Region* pRegion )
if ( mbClipRegion )
{
maRegion = Region( REGION_NULL );
- mbClipRegion = FALSE;
- mbInitClipRegion = TRUE;
+ mbClipRegion = sal_False;
+ mbInitClipRegion = sal_True;
}
}
else
{
maRegion = *pRegion;
- mbClipRegion = TRUE;
- mbInitClipRegion = TRUE;
+ mbClipRegion = sal_True;
+ mbInitClipRegion = sal_True;
}
}
// -----------------------------------------------------------------------
-namespace
-{
- inline int iround( float x )
- {
- union
- {
- float f;
- sal_Int32 i;
- };
- f = x;
- sal_Int32 exponent = (127 + 31) - ((i >> 23) & 0xFF);
- sal_Int32 r = ((sal_Int32(i) << 8) | (1U << 31)) >> exponent;
- r &= ((exponent - 32) >> 31);
- sal_Int32 sign = i >> 31;
- return r = (r ^ sign) - sign;
- }
-
- inline int floorDiv(int a, int b)
- {
- if(b == 0)
- return 0x80000000;
- if(a >= 0)
- return a / b;
- int q = -(-a / b); // quotient
- int r = -a % b; // remainder
- if(r)
- q--;
- return q;
- }
-
- inline int floorMod( int a, int b )
- {
- if(b == 0)
- return 0x80000000;
- if(a >= 0)
- return a % b;
- int r = -a % b; // remainder
- if(r)
- r = b - r;
- return r;
- }
-
- inline int ceilDiv( int a, int b )
- {
- if(b == 0)
- return 0x80000000;
- a += - 1 + b;
- if(a >= 0)
- return a / b;
- int q = -(-a / b); // quotient
- int r = -a % b; // remainder
- if(r)
- q--;
- return q;
- }
-
- inline int ceilMod( int a, int b )
- {
- if(b == 0)
- return 0x80000000;
- a += - 1 + b;
- if(a >= 0)
- return (a % b) + 1 - b;
- int r = -a % b;
- if(r)
- r = b - r;
- return r + 1 - b;
- }
-
- inline int ceilFix4(int x) { return (x + 0xF) & 0xFFFFFFF0; }
-
- struct vertex
- {
- float x,y;
- inline vertex( const Point &p )
- : x((float)p.getX()),y((float)p.getY()) {}
- };
-
- template<class T> inline void swap(T &a, T &b) { T t=a; a=b; b=t; }
-
- class SpanIterator
- {
- public:
-
- SpanIterator( sal_Int32 *pTable, size_t dwPitch, sal_Int32 dwNumScanlines );
- std::pair<sal_Int32,sal_Int32> GetNextSpan( void );
- sal_Int32 GetNumRemainingScanlines( void );
- sal_Int32 GetNumEqualScanlines( void );
- SpanIterator &operator++ ();
- SpanIterator &Skip( sal_Int32 dwNumScanlines );
- sal_Int32 GetRemainingSpans( void ) const { return maNumSpans; }
-
- private:
-
- sal_Int32 *mpTable;
- sal_Int32 *mpSpanArray;
- sal_Int32 maNumSpans;
- sal_Int32 maRemainingScanlines;
- size_t maPitch;
- };
-
- inline SpanIterator::SpanIterator( sal_Int32 *pTable, size_t dwPitch, sal_Int32 dwNumScanlines )
- : mpTable(pTable),maRemainingScanlines(dwNumScanlines),maPitch(dwPitch)
- {
- sal_Int32 *pNumSpans = mpTable;
- mpSpanArray = reinterpret_cast<sal_Int32 *>(pNumSpans+2);
- maNumSpans = *pNumSpans;
- }
-
- inline SpanIterator &SpanIterator::operator++ ()
- {
- --maRemainingScanlines;
- mpTable += maPitch;
- sal_Int32 *pNumSpans = mpTable;
- mpSpanArray = reinterpret_cast<sal_Int32 *>(pNumSpans+2);
- maNumSpans = *pNumSpans;
- return (*this);
- }
-
- inline SpanIterator &SpanIterator::Skip( sal_Int32 dwNumScanlines )
- {
- // don't skip more scanlines than there are...
- if(dwNumScanlines > maRemainingScanlines)
- dwNumScanlines = maRemainingScanlines;
-
- // skip in one fellow swoop...
- maRemainingScanlines -= dwNumScanlines;
- mpTable += maPitch * dwNumScanlines;
-
- // initialize necessary query fields...
- sal_Int32 *pNumSpans = mpTable;
- mpSpanArray = reinterpret_cast<sal_Int32 *>(pNumSpans+2);
- maNumSpans = *pNumSpans;
- return (*this);
- }
-
- inline std::pair<sal_Int32,sal_Int32> SpanIterator::GetNextSpan( void )
- {
- sal_Int32 x(0);
- sal_Int32 w(0);
- if(maNumSpans)
- {
- x = *mpSpanArray++;
- w = *mpSpanArray++;
- --maNumSpans;
- }
- return std::pair<sal_Int32,sal_Int32>(x,w);
- }
-
- inline sal_Int32 SpanIterator::GetNumEqualScanlines( void )
- {
- return mpTable[1];
- }
-
- inline sal_Int32 SpanIterator::GetNumRemainingScanlines( void )
- {
- return maRemainingScanlines;
- }
-
- class ScanlineContainer
- {
-
- public:
-
- ScanlineContainer( sal_uInt32 dwNumScanlines,
- sal_uInt32 dwNumSpansPerScanline );
-
- ~ScanlineContainer( void );
-
- void InsertSpan( sal_Int32 y, sal_Int32 lx, sal_Int32 rx );
-
- SpanIterator Iterate( void ) const { return SpanIterator(mpTable,maPitch,maNumScanlines); }
-
- inline sal_uInt32 GetNumSpans( void ) const { return maNumberOfSpans; }
-
- void Consolidate( void );
-
- private:
-
- // the span table will assist in determinate exactly how many clipping
- // regions [that is *spans*] we will end up with.
- // the counter for this purpose is right ahead.
- sal_uInt32 maNumberOfSpans;
-
- struct span
- {
- sal_Int32 x;
- sal_Int32 w;
- };
-
- sal_uInt32 maNumScanlines;
- sal_uInt32 maNumSpansPerScanline;
- sal_Int32 *mpTable;
- size_t maPitch;
- };
-
- ScanlineContainer::ScanlineContainer( sal_uInt32 dwNumScanlines,
- sal_uInt32 dwNumSpansPerScanline ) : maNumScanlines(dwNumScanlines),
- maNumSpansPerScanline(dwNumSpansPerScanline)
- {
- // #128002# add one scanline buffer at the end, as
- // SpanIterator::Skip reads two bytes past the end.
- ++dwNumScanlines;
-
- // since each triangle could possibly add another span
- // we can calculate the upper limit by [num scanlines * num triangles].
- const sal_uInt32 dwNumPossibleRegions = dwNumScanlines*dwNumSpansPerScanline;
-
- // calculate the number of bytes the span table will consume
- const size_t dwTableSize = dwNumPossibleRegions*sizeof(span)+dwNumScanlines*(sizeof(sal_Int32)<<1);
-
- // allocate the span table [on the stack]
- mpTable = static_cast<sal_Int32 *>(rtl_allocateMemory(dwTableSize));
-
- // calculate the table pitch, that is how many int's do i need to get from a scanline to the next.
- maPitch = (dwNumSpansPerScanline*sizeof(span)/sizeof(sal_Int32))+2;
-
- // we need to initialize the table here.
- // the first *int* on each scanline tells us how many spans are on it.
- sal_Int32 *pNumSpans = mpTable;
- for(unsigned int i=0; i<dwNumScanlines; ++i)
- {
- pNumSpans[0] = 0;
- pNumSpans[1] = 0;
- pNumSpans += maPitch;
- }
-
- maNumberOfSpans = 0;
- }
-
- ScanlineContainer::~ScanlineContainer( void )
- {
- rtl_freeMemory(mpTable);
- }
-
- void ScanlineContainer::InsertSpan( sal_Int32 y, sal_Int32 lx, sal_Int32 rx )
- {
- // there's new incoming span which we need to store in the table.
- // first see if its width contributes a valid span.
- if(sal_Int32 dwSpanWidth = rx-lx)
- {
- // first select the appropriate scanline the new span.
- sal_Int32 *pNumSpans = mpTable+(y*maPitch);
- span *pSpanArray = reinterpret_cast<span *>(pNumSpans+2);
-
- // retrieve the number of already contained spans.
- sal_Int32 dwNumSpan = *pNumSpans;
-
- // since we need to sort the spans from top to bottom
- // and left to right, we need to find the correct location
- // in the table.
- sal_Int32 dwIndex = 0;
- while(dwIndex<dwNumSpan)
- {
- // since we would like to avoid unnecessary spans
- // we try to consolidate them if possible.
- // consolidate with right neighbour
- if(pSpanArray[dwIndex].x == rx)
- {
- pSpanArray[dwIndex].x = lx;
- pSpanArray[dwIndex].w += dwSpanWidth;
- return;
- }
-
- // consolidate with left neighbour
- if((pSpanArray[dwIndex].x+pSpanArray[dwIndex].w) == lx)
- {
- pSpanArray[dwIndex].w += rx-lx;
- return;
- }
-
- // no consolidation possible, either this is a completely
- // seperate span or it is the first in the list.
- if(pSpanArray[dwIndex].x > lx)
- break;
-
- // forward to next element in the list.
- ++dwIndex;
- }
-
- // if we reach here, the new span needs to be stored
- // in the table, increase the number of spans in the
- // current scanline.
- *pNumSpans = dwNumSpan+1;
-
- // keep the list of spans in sorted order. 'dwIndex'
- // is where we want to store the new span. 'dwNumSpan'
- // is the number of spans already there. now we need
- // to move the offending spans out of the way.
- while(dwIndex != dwNumSpan)
- {
- pSpanArray[dwNumSpan].x = pSpanArray[dwNumSpan-1].x;
- pSpanArray[dwNumSpan].w = pSpanArray[dwNumSpan-1].w;
- --dwNumSpan;
- }
-
- // insert the new span
- pSpanArray[dwIndex].x = lx;
- pSpanArray[dwIndex].w = rx-lx;
-
- // remember the total number of spans in the table.
- ++maNumberOfSpans;
- }
- }
-
- void ScanlineContainer::Consolidate( void )
- {
- sal_Int32 *pScanline = mpTable;
-
- sal_Int32 dwRemaining = maNumScanlines;
- while(dwRemaining)
- {
- sal_Int32 dwNumSpans = pScanline[0];
- sal_Int32 *pSpanArray = pScanline+2;
-
- sal_Int32 dwRest = dwRemaining-1;
- sal_Int32 *pNext = pScanline;
- while(dwRest)
- {
- pNext += maPitch;
- sal_Int32 dwNumNextSpans = pNext[0];
- sal_Int32 *pSpanArrayNext = pNext+2;
- if(dwNumSpans != dwNumNextSpans)
- break;
-
- sal_Int32 dwCompare = dwNumSpans<<1;
- while(dwCompare)
- {
- if(pSpanArray[dwCompare-1] != pSpanArrayNext[dwCompare-1])
- break;
- --dwCompare;
- }
- if(dwCompare)
- break;
-
- --dwRest;
- }
-
- const sal_Int32 dwNumEqualScanlines(dwRemaining-dwRest);
- pScanline[1] = dwNumEqualScanlines;
- pScanline += maPitch*dwNumEqualScanlines;
- dwRemaining -= dwNumEqualScanlines;
-
- // since we track the total number of spans to generate,
- // we need to account for consolidated scanlines here.
- if(dwNumEqualScanlines > 1)
- maNumberOfSpans -= dwNumSpans * (dwNumEqualScanlines-1);
- }
- }
-}
-
-// TODO: we should consider passing a basegfx b2dpolypolygon here to
-// ensure that the signature isn't misleading.
-// if we could pass a b2dpolypolygon here, we could easily triangulate it.
-void OutputDevice::ImplSetTriangleClipRegion( const PolyPolygon &rPolyPolygon )
-{
- DBG_TESTSOLARMUTEX();
-
- if(!(IsDeviceOutputNecessary()))
- return;
- if(!(mpGraphics))
- if(!(ImplGetGraphics()))
- return;
-
- if( mpGraphics->supportsOperation( OutDevSupport_B2DClip ) )
- {
- // getB2DPolyPolygon() "optimizes away" some points
- // which prevents reliable undoing of the "triangle thingy" parameter
- // so the toolspoly -> b2dpoly conversion has to be done manually
- ::basegfx::B2DPolyPolygon aB2DPolyPolygon;
- for( USHORT nPolyIdx = 0; nPolyIdx < rPolyPolygon.Count(); ++nPolyIdx )
- {
- const Polygon& rPolygon = rPolyPolygon[ nPolyIdx ];
- ::basegfx::B2DPolygon aB2DPoly;
- for( USHORT nPointIdx = 0; nPointIdx < rPolygon.GetSize(); ++nPointIdx )
- {
- const Point& rPoint = rPolygon[ nPointIdx ];
- const ::basegfx::B2DPoint aB2DPoint( rPoint.X(), rPoint.Y() );
- aB2DPoly.append( aB2DPoint );
- }
- aB2DPolyPolygon.append( aB2DPoly );
- }
-
- const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation();
- aB2DPolyPolygon.transform( aTransform );
-
- // the rPolyPolygon argument is a "triangle thingy"
- // so convert it to a normal polypolyon first
- ::basegfx::B2DPolyPolygon aPolyTriangle;
- const int nPolyCount = aB2DPolyPolygon.count();
- for( int nPolyIdx = 0; nPolyIdx < nPolyCount; ++nPolyIdx )
- {
- const ::basegfx::B2DPolygon rPolygon = aB2DPolyPolygon.getB2DPolygon( nPolyIdx );
- const int nPointCount = rPolygon.count();
- for( int nPointIdx = 0; nPointIdx+2 < nPointCount; nPointIdx +=3 )
- {
- ::basegfx::B2DPolygon aTriangle;
- aTriangle.append( rPolygon.getB2DPoint( nPointIdx+0 ) );
- aTriangle.append( rPolygon.getB2DPoint( nPointIdx+1 ) );
- aTriangle.append( rPolygon.getB2DPoint( nPointIdx+2 ) );
- aPolyTriangle.append( aTriangle );
- }
- }
-
- // now set the clip region with the real polypolygon
- mpGraphics->BeginSetClipRegion( 0 );
- mpGraphics->UnionClipRegion( aPolyTriangle, this );
- mpGraphics->EndSetClipRegion();
-
- // and mark the clip status as ready
- mbOutputClipped = FALSE;
- mbClipRegion = TRUE;
- mbClipRegionSet = TRUE;
- mbInitClipRegion = FALSE;
- return;
- }
-
- sal_Int32 offset_x = 0;
- sal_Int32 offset_y = 0;
- if ( GetOutDevType() == OUTDEV_WINDOW )
- {
- offset_x = mnOutOffX+mnOutOffOrigX;
- offset_y = mnOutOffY+mnOutOffOrigY;
- }
-
- // first of all we need to know the upper limit
- // of the amount of possible clipping regions.
- sal_Int32 maxy = SAL_MIN_INT32;
- sal_Int32 miny = SAL_MAX_INT32;
- sal_uInt32 dwNumTriangles = 0;
- for(USHORT i=0; i<rPolyPolygon.Count(); ++i)
- {
- const Polygon &rPoly = rPolyPolygon.GetObject(i);
- const sal_Int32 dwNumVertices = rPoly.GetSize();
- if(!(dwNumVertices % 3))
- {
- for(USHORT j=0; j<rPoly.GetSize(); ++j)
- {
- const Point &p = rPoly.GetPoint(j);
- if(p.Y() < miny)
- miny = p.Y();
- if(p.Y() > maxy)
- maxy = p.Y();
- }
- dwNumTriangles += dwNumVertices / 3;
- }
- }
-
- const sal_uInt32 dwNumScanlines = (maxy-miny);
- if(!(dwNumScanlines))
- {
- // indicates that no output needs to be produced
- // since the clipping region did not provide any
- // visible areas.
- mbOutputClipped = TRUE;
-
- // indicates that a clip region has been
- // presented to the output device.
- mbClipRegion = TRUE;
-
- // indicates that the set clipping region
- // has been processed.
- mbClipRegionSet = TRUE;
-
- // under 'normal' circumstances a new clipping region
- // needs to be processed by ImplInitClipRegion(),
- // which we need to circumvent.
- mbInitClipRegion = FALSE;
- return;
- }
-
- // this container provides all services we need to
- // efficiently store/retrieve spans from the table.
- const sal_uInt32 dwNumSpansPerScanline = dwNumTriangles;
- ScanlineContainer container(dwNumScanlines,dwNumSpansPerScanline);
-
- // convert the incoming polypolygon to spans, we assume that
- // the polypolygon has already been triangulated since we don't
- // want to use the basegfx-types here. this could be leveraged
- // after the tools-types had been removed.
- for(USHORT i=0; i<rPolyPolygon.Count(); ++i)
- {
- const Polygon &rPoly = rPolyPolygon.GetObject(i);
- const USHORT dwNumVertices = rPoly.GetSize();
- if(!(dwNumVertices % 3))
- {
- for(USHORT j=0; j<dwNumVertices; j+=3)
- {
- const Point &p0 = rPoly.GetPoint(j+0);
- const Point &p1 = rPoly.GetPoint(j+1);
- const Point &p2 = rPoly.GetPoint(j+2);
-
- // what now follows is an extremely fast triangle
- // rasterizer from which all tricky and interesting
- // parts were forcibly amputated.
- // note: top.left fill-convention
- vertex v0(p0);
- vertex v1(p1);
- vertex v2(p2);
-
- //sprintf(string,"[%f,%f] [%f,%f] [%f,%f]\n",v0.x,v0.y,v1.x,v1.y,v2.x,v2.y);
- //OSL_TRACE(string);
-
- if(v0.y > v2.y) ::swap(v0, v2);
- if(v1.y > v2.y) ::swap(v1, v2);
- if(v0.y > v1.y) ::swap(v0, v1);
-
- const float float2fixed(16.0f);
-
- // vertex coordinates of the triangle [28.4 fixed-point]
- const int i4x0 = iround(float2fixed * (v0.x - 0.5f));
- const int i4y0 = iround(float2fixed * (v0.y - 0.5f));
- const int i4x1 = iround(float2fixed * (v1.x - 0.5f));
- const int i4y1 = iround(float2fixed * (v1.y - 0.5f));
- const int i4x2 = iround(float2fixed * (v2.x - 0.5f));
- const int i4y2 = iround(float2fixed * (v2.y - 0.5f));
-
- // vertex coordinate deltas [28.4 fixed-point]
- const int i4dx12 = i4x1-i4x0;
- const int i4dy12 = i4y1-i4y0;
- const int i4dx13 = i4x2-i4x0;
- const int i4dy13 = i4y2-i4y0;
- const int i4dx23 = i4x2-i4x1;
- const int i4dy23 = i4y2-i4y1;
-
- // slope of edges [quotient,remainder]
- const int mq12 = floorDiv(i4dx12 << 4, i4dy12 << 4);
- const int mq13 = floorDiv(i4dx13 << 4, i4dy13 << 4);
- const int mq23 = floorDiv(i4dx23 << 4, i4dy23 << 4);
- const int mr12 = floorMod(i4dx12 << 4, i4dy12 << 4);
- const int mr13 = floorMod(i4dx13 << 4, i4dy13 << 4);
- const int mr23 = floorMod(i4dx23 << 4, i4dy23 << 4);
-
- // convert the vertical coordinates back to integers.
- // according to the top-left fillrule we need to step
- // the coordinates to the ceiling.
- const int y0 = (i4y0+15)>>4;
- const int y1 = (i4y1+15)>>4;
- const int y2 = (i4y2+15)>>4;
-
- // calculate the value of the horizontal coordinate
- // from the edge that 'spans' the triangle.
- const int x = ceilDiv(i4dx13*i4dy12 + i4x0*i4dy13, i4dy13);
-
- // this will hold the horizontal coordinates
- // of the seperate spans during the rasterization process.
- int lx,rx;
-
- // this pair will serve as the error accumulator while
- // we step along the edges.
- int ld,rd,lD,rD;
-
- // these are the edge and error stepping values that
- // will be used while stepping.
- int lQ,rQ,lR,rR;
-
- if(i4x1 < x)
- {
- lx = ceilDiv(i4dx12 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy12, i4dy12 << 4);
- ld = ceilMod(i4dx12 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy12, i4dy12 << 4);
- rx = ceilDiv(i4dx13 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy13, i4dy13 << 4);
- rd = ceilMod(i4dx13 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy13, i4dy13 << 4);
- lQ = mq12;
- rQ = mq13;
- lR = mr12;
- rR = mr13;
- lD = i4dy12 << 4;
- rD = i4dy13 << 4;
- }
- else
- {
- lx = ceilDiv(i4dx13 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy13, i4dy13 << 4);
- ld = ceilMod(i4dx13 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy13, i4dy13 << 4);
- rx = ceilDiv(i4dx12 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy12, i4dy12 << 4);
- rd = ceilMod(i4dx12 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy12, i4dy12 << 4);
- lQ = mq13;
- rQ = mq12;
- lR = mr13;
- rR = mr12;
- lD = i4dy13 << 4;
- rD = i4dy12 << 4;
- }
-
- for(signed int y=y0; y<y1; y++)
- {
- container.InsertSpan(y-miny,lx,rx);
-
- lx += lQ; ld += lR;
- if(ld > 0) { ld -= lD; lx += 1; }
- rx += rQ; rd += rR;
- if(rd > 0) { rd -= rD; rx += 1; }
- }
-
- if(i4x1 < x)
- {
- lx = ceilDiv(i4dx23 * (ceilFix4(i4y1) - i4y1) + i4x1 * i4dy23, i4dy23 << 4);
- ld = ceilMod(i4dx23 * (ceilFix4(i4y1) - i4y1) + i4x1 * i4dy23, i4dy23 << 4);
- rx = ceilDiv(i4dx13 * (ceilFix4(i4y1) - i4y0) + i4x0 * i4dy13, i4dy13 << 4);
- rd = ceilMod(i4dx13 * (ceilFix4(i4y1) - i4y0) + i4x0 * i4dy13, i4dy13 << 4);
- lQ = mq23;
- lR = mr23;
- lD = i4dy23 << 4;
- }
- else
- {
- rx = ceilDiv(i4dx23 * (ceilFix4(i4y1) - i4y1) + i4x1 * i4dy23, i4dy23 << 4);
- rd = ceilMod(i4dx23 * (ceilFix4(i4y1) - i4y1) + i4x1 * i4dy23, i4dy23 << 4);
- rQ = mq23;
- rR = mr23;
- rD = i4dy23 << 4;
- }
-
- for(signed int y=y1; y<y2; y++)
- {
- container.InsertSpan(y-miny,lx,rx);
-
- lx += lQ; ld += lR;
- if(ld > 0) { ld -= lD; lx += 1; }
- rx += rQ; rd += rR;
- if(rd > 0) { rd -= rD; rx += 1; }
- }
- }
- }
- }
-
- // now try to consolidate as many scanlines as possible.
- // please note that this will probably change the number
- // of spans [at least this is why we do all this hassle].
- // so, if you use 'consolidate' you should *use* this
- // information during iteration, because the 'graphics'
- // object we tell all those regions about is a bit,
- // hm, how to say, *picky* if you supply not correctly
- // the amount of regions.
- container.Consolidate();
-
- // now forward the spantable to the graphics handler.
- SpanIterator it(container.Iterate());
- mpGraphics->BeginSetClipRegion( container.GetNumSpans() );
- while(miny < maxy)
- {
- const sal_Int32 dwNumEqual(it.GetNumEqualScanlines());
- while(it.GetRemainingSpans())
- {
- // retrieve the next span [x-coordinate, width] from the current scanline.
- std::pair<sal_Int32,sal_Int32> span(it.GetNextSpan());
-
- // now forward this to the graphics object.
- // the only part that is worth noting is that we use
- // the number of equal spanlines [the current is always the
- // first one of the equal bunch] as the height of the region.
- mpGraphics->UnionClipRegion( offset_x+span.first,
- offset_y+miny,
- span.second,
- dwNumEqual,
- this );
- }
- it.Skip(dwNumEqual);
- miny += dwNumEqual;
- }
- mpGraphics->EndSetClipRegion();
-
- // indicates that no output needs to be produced
- // since the clipping region did not provide any
- // visible areas. the clip covers the whole area
- // if there's not a single region.
- mbOutputClipped = (container.GetNumSpans() == 0);
-
- // indicates that a clip region has been
- // presented to the output device.
- mbClipRegion = TRUE;
-
- // indicates that the set clipping region
- // has been processed.
- mbClipRegionSet = TRUE;
-
- // under 'normal' circumstances a new clipping region
- // needs to be processed by ImplInitClipRegion(),
- // which we need to circumvent.
- mbInitClipRegion = FALSE;
-}
-
-// -----------------------------------------------------------------------
-
void OutputDevice::SetClipRegion()
{
OSL_TRACE( "OutputDevice::SetClipRegion()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaClipRegionAction( Region(), FALSE ) );
+ mpMetaFile->AddAction( new MetaClipRegionAction( Region(), sal_False ) );
ImplSetClipRegion( NULL );
@@ -1825,7 +1068,7 @@ void OutputDevice::SetClipRegion( const Region& rRegion )
DBG_CHKOBJ( &rRegion, Region, ImplDbgTestRegion );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaClipRegionAction( rRegion, TRUE ) );
+ mpMetaFile->AddAction( new MetaClipRegionAction( rRegion, sal_True ) );
if ( rRegion.GetType() == REGION_NULL )
ImplSetClipRegion( NULL );
@@ -1841,42 +1084,6 @@ void OutputDevice::SetClipRegion( const Region& rRegion )
// -----------------------------------------------------------------------
-void OutputDevice::SetTriangleClipRegion( const PolyPolygon &rPolyPolygon )
-{
- OSL_TRACE( "OutputDevice::SetTriangleClipRegion( rPolyPolygon )" );
- DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
-
- // in case the passed polypolygon is empty, use the
- // existing SetClipRegion() method which gracefully
- // unsets any previously set clipping region.
- if(!(rPolyPolygon.Count()))
- SetClipRegion();
-
- sal_Int32 offset_x = 0;
- sal_Int32 offset_y = 0;
- if ( GetOutDevType() == OUTDEV_WINDOW )
- {
- offset_x = mnOutOffX+mnOutOffOrigX;
- offset_y = mnOutOffY+mnOutOffOrigY;
- }
-
- // play nice with the rest of the system and provide an old-style region.
- // the rest of this method does not rely on this.
- maRegion = Region::GetRegionFromPolyPolygon( LogicToPixel(rPolyPolygon) );
- maRegion.Move(offset_x,offset_y);
-
- // feed region to metafile
- if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaClipRegionAction( maRegion, TRUE ) );
-
- ImplSetTriangleClipRegion( rPolyPolygon );
-
- if( mpAlphaVDev )
- mpAlphaVDev->SetTriangleClipRegion( rPolyPolygon );
-}
-
-// -----------------------------------------------------------------------
-
Region OutputDevice::GetClipRegion() const
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -1921,7 +1128,7 @@ void OutputDevice::MoveClipRegion( long nHorzMove, long nVertMove )
maRegion.Move( ImplLogicWidthToDevicePixel( nHorzMove ),
ImplLogicHeightToDevicePixel( nVertMove ) );
- mbInitClipRegion = TRUE;
+ mbInitClipRegion = sal_True;
}
if( mpAlphaVDev )
@@ -1940,8 +1147,8 @@ void OutputDevice::IntersectClipRegion( const Rectangle& rRect )
Rectangle aRect = LogicToPixel( rRect );
maRegion.Intersect( aRect );
- mbClipRegion = TRUE;
- mbInitClipRegion = TRUE;
+ mbClipRegion = sal_True;
+ mbInitClipRegion = sal_True;
if( mpAlphaVDev )
mpAlphaVDev->IntersectClipRegion( rRect );
@@ -1964,8 +1171,8 @@ void OutputDevice::IntersectClipRegion( const Region& rRegion )
Region aRegion = LogicToPixel( rRegion );
maRegion.Intersect( aRegion );
- mbClipRegion = TRUE;
- mbInitClipRegion = TRUE;
+ mbClipRegion = sal_True;
+ mbInitClipRegion = sal_True;
}
if( mpAlphaVDev )
@@ -1974,7 +1181,7 @@ void OutputDevice::IntersectClipRegion( const Region& rRegion )
// -----------------------------------------------------------------------
-void OutputDevice::SetDrawMode( ULONG nDrawMode )
+void OutputDevice::SetDrawMode( sal_uLong nDrawMode )
{
OSL_TRACE( "OutputDevice::SetDrawMode( %lx )", nDrawMode );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -1998,7 +1205,7 @@ void OutputDevice::SetRasterOp( RasterOp eRasterOp )
if ( meRasterOp != eRasterOp )
{
meRasterOp = eRasterOp;
- mbInitLineColor = mbInitFillColor = TRUE;
+ mbInitLineColor = mbInitFillColor = sal_True;
if( mpGraphics || ImplGetGraphics() )
mpGraphics->SetXORMode( (ROP_INVERT == meRasterOp) || (ROP_XOR == meRasterOp), ROP_INVERT == meRasterOp );
@@ -2016,12 +1223,12 @@ void OutputDevice::SetLineColor()
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaLineColorAction( Color(), FALSE ) );
+ mpMetaFile->AddAction( new MetaLineColorAction( Color(), sal_False ) );
if ( mbLineColor )
{
- mbInitLineColor = TRUE;
- mbLineColor = FALSE;
+ mbInitLineColor = sal_True;
+ mbLineColor = sal_False;
maLineColor = Color( COL_TRANSPARENT );
}
@@ -2054,7 +1261,7 @@ void OutputDevice::SetLineColor( const Color& rColor )
}
else if( mnDrawMode & DRAWMODE_GRAYLINE )
{
- const UINT8 cLum = aColor.GetLuminance();
+ const sal_uInt8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if( mnDrawMode & DRAWMODE_SETTINGSLINE )
@@ -2072,14 +1279,14 @@ void OutputDevice::SetLineColor( const Color& rColor )
}
if( mpMetaFile )
- mpMetaFile->AddAction( new MetaLineColorAction( aColor, TRUE ) );
+ mpMetaFile->AddAction( new MetaLineColorAction( aColor, sal_True ) );
if( ImplIsColorTransparent( aColor ) )
{
if ( mbLineColor )
{
- mbInitLineColor = TRUE;
- mbLineColor = FALSE;
+ mbInitLineColor = sal_True;
+ mbLineColor = sal_False;
maLineColor = Color( COL_TRANSPARENT );
}
}
@@ -2087,8 +1294,8 @@ void OutputDevice::SetLineColor( const Color& rColor )
{
if( maLineColor != aColor )
{
- mbInitLineColor = TRUE;
- mbLineColor = TRUE;
+ mbInitLineColor = sal_True;
+ mbLineColor = sal_True;
maLineColor = aColor;
}
}
@@ -2105,12 +1312,12 @@ void OutputDevice::SetFillColor()
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaFillColorAction( Color(), FALSE ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( Color(), sal_False ) );
if ( mbFillColor )
{
- mbInitFillColor = TRUE;
- mbFillColor = FALSE;
+ mbInitFillColor = sal_True;
+ mbFillColor = sal_False;
maFillColor = Color( COL_TRANSPARENT );
}
@@ -2143,7 +1350,7 @@ void OutputDevice::SetFillColor( const Color& rColor )
}
else if( mnDrawMode & DRAWMODE_GRAYFILL )
{
- const UINT8 cLum = aColor.GetLuminance();
+ const sal_uInt8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if( mnDrawMode & DRAWMODE_NOFILL )
@@ -2165,14 +1372,14 @@ void OutputDevice::SetFillColor( const Color& rColor )
}
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaFillColorAction( aColor, TRUE ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( aColor, sal_True ) );
if ( ImplIsColorTransparent( aColor ) )
{
if ( mbFillColor )
{
- mbInitFillColor = TRUE;
- mbFillColor = FALSE;
+ mbInitFillColor = sal_True;
+ mbFillColor = sal_False;
maFillColor = Color( COL_TRANSPARENT );
}
}
@@ -2180,8 +1387,8 @@ void OutputDevice::SetFillColor( const Color& rColor )
{
if ( maFillColor != aColor )
{
- mbInitFillColor = TRUE;
- mbFillColor = TRUE;
+ mbInitFillColor = sal_True;
+ mbFillColor = sal_True;
maFillColor = aColor;
}
}
@@ -2198,7 +1405,7 @@ void OutputDevice::SetBackground()
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
maBackground = Wallpaper();
- mbBackground = FALSE;
+ mbBackground = sal_False;
if( mpAlphaVDev )
mpAlphaVDev->SetBackground();
@@ -2214,9 +1421,9 @@ void OutputDevice::SetBackground( const Wallpaper& rBackground )
maBackground = rBackground;
if( rBackground.GetStyle() == WALLPAPER_NULL )
- mbBackground = FALSE;
+ mbBackground = sal_False;
else
- mbBackground = TRUE;
+ mbBackground = sal_True;
if( mpAlphaVDev )
mpAlphaVDev->SetBackground( rBackground );
@@ -2230,9 +1437,9 @@ void OutputDevice::SetRefPoint()
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaRefPointAction( Point(), FALSE ) );
+ mpMetaFile->AddAction( new MetaRefPointAction( Point(), sal_False ) );
- mbRefPoint = FALSE;
+ mbRefPoint = sal_False;
maRefPoint.X() = maRefPoint.Y() = 0L;
if( mpAlphaVDev )
@@ -2247,9 +1454,9 @@ void OutputDevice::SetRefPoint( const Point& rRefPoint )
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaRefPointAction( rRefPoint, TRUE ) );
+ mpMetaFile->AddAction( new MetaRefPointAction( rRefPoint, sal_True ) );
- mbRefPoint = TRUE;
+ mbRefPoint = sal_True;
maRefPoint = rRefPoint;
if( mpAlphaVDev )
@@ -2560,7 +1767,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly )
if( mpMetaFile )
mpMetaFile->AddAction( new MetaPolyLineAction( rPoly ) );
- USHORT nPoints = rPoly.GetSize();
+ sal_uInt16 nPoints = rPoly.GetSize();
if ( !IsDeviceOutputNecessary() || !mbLineColor || (nPoints < 2) || ImplIsRecordLayout() )
return;
@@ -2610,7 +1817,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly )
// #100127# Forward beziers to sal, if any
if( aPoly.HasFlags() )
{
- const BYTE* pFlgAry = aPoly.GetConstFlagAry();
+ const sal_uInt8* pFlgAry = aPoly.GetConstFlagAry();
if( !mpGraphics->DrawPolyLineBezier( nPoints, pPtAry, pFlgAry, this ) )
{
aPoly = ImplSubdivideBezier(aPoly);
@@ -2658,7 +1865,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly, const LineInfo& rLineInfo
void OutputDevice::ImpDrawPolyLineWithLineInfo(const Polygon& rPoly, const LineInfo& rLineInfo)
{
- USHORT nPoints(rPoly.GetSize());
+ sal_uInt16 nPoints(rPoly.GetSize());
if ( !IsDeviceOutputNecessary() || !mbLineColor || ( nPoints < 2 ) || ( LINE_NONE == rLineInfo.GetStyle() ) || ImplIsRecordLayout() )
return;
@@ -2730,7 +1937,7 @@ void OutputDevice::DrawPolygon( const Polygon& rPoly )
if( mpMetaFile )
mpMetaFile->AddAction( new MetaPolygonAction( rPoly ) );
- USHORT nPoints = rPoly.GetSize();
+ sal_uInt16 nPoints = rPoly.GetSize();
if ( !IsDeviceOutputNecessary() || (!mbLineColor && !mbFillColor) || (nPoints < 2) || ImplIsRecordLayout() )
return;
@@ -2793,7 +2000,7 @@ void OutputDevice::DrawPolygon( const Polygon& rPoly )
// #100127# Forward beziers to sal, if any
if( aPoly.HasFlags() )
{
- const BYTE* pFlgAry = aPoly.GetConstFlagAry();
+ const sal_uInt8* pFlgAry = aPoly.GetConstFlagAry();
if( !mpGraphics->DrawPolygonBezier( nPoints, pPtAry, pFlgAry, this ) )
{
aPoly = ImplSubdivideBezier(aPoly);
@@ -2820,7 +2027,7 @@ void OutputDevice::DrawPolyPolygon( const PolyPolygon& rPolyPoly )
if( mpMetaFile )
mpMetaFile->AddAction( new MetaPolyPolygonAction( rPolyPoly ) );
- USHORT nPoly = rPolyPoly.Count();
+ sal_uInt16 nPoly = rPolyPoly.Count();
if ( !IsDeviceOutputNecessary() || (!mbLineColor && !mbFillColor) || !nPoly || ImplIsRecordLayout() )
return;
@@ -3137,7 +2344,21 @@ void OutputDevice::DrawPolyLine(
// -----------------------------------------------------------------------
-void OutputDevice::Push( USHORT nFlags )
+sal_uInt32 OutputDevice::GetGCStackDepth() const
+{
+ const ImplObjStack* pData = mpObjStack;
+ sal_uInt32 nDepth = 0;
+ while( pData )
+ {
+ nDepth++;
+ pData = pData->mpPrev;
+ }
+ return nDepth;
+}
+
+// -----------------------------------------------------------------------
+
+void OutputDevice::Push( sal_uInt16 nFlags )
{
OSL_TRACE( "OutputDevice::Push()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -3327,7 +2548,7 @@ void OutputDevice::SetConnectMetaFile( GDIMetaFile* pMtf )
// -----------------------------------------------------------------------
-void OutputDevice::EnableOutput( BOOL bEnable )
+void OutputDevice::EnableOutput( sal_Bool bEnable )
{
mbOutput = (bEnable != 0);
@@ -3347,7 +2568,7 @@ void OutputDevice::SetSettings( const AllSettings& rSettings )
// -----------------------------------------------------------------------
-USHORT OutputDevice::GetBitCount() const
+sal_uInt16 OutputDevice::GetBitCount() const
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -3361,12 +2582,12 @@ USHORT OutputDevice::GetBitCount() const
return 0;
}
- return (USHORT)mpGraphics->GetBitCount();
+ return (sal_uInt16)mpGraphics->GetBitCount();
}
// -----------------------------------------------------------------------
-USHORT OutputDevice::GetAlphaBitCount() const
+sal_uInt16 OutputDevice::GetAlphaBitCount() const
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -3381,17 +2602,17 @@ USHORT OutputDevice::GetAlphaBitCount() const
// -----------------------------------------------------------------------
-ULONG OutputDevice::GetColorCount() const
+sal_uLong OutputDevice::GetColorCount() const
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- const USHORT nBitCount = GetBitCount();
- return( ( nBitCount > 31 ) ? ULONG_MAX : ( ( (ULONG) 1 ) << nBitCount) );
+ const sal_uInt16 nBitCount = GetBitCount();
+ return( ( nBitCount > 31 ) ? ULONG_MAX : ( ( (sal_uLong) 1 ) << nBitCount) );
}
// -----------------------------------------------------------------------
-BOOL OutputDevice::HasAlpha()
+sal_Bool OutputDevice::HasAlpha()
{
return mpAlphaVDev != NULL;
}
diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx
index f3eb277480fa..356542952360 100644
--- a/vcl/source/gdi/outdev2.cxx
+++ b/vcl/source/gdi/outdev2.cxx
@@ -86,17 +86,17 @@ DBG_NAMEEX( OutputDevice )
// - externals -
// -------------
-extern ULONG nVCLRLut[ 6 ];
-extern ULONG nVCLGLut[ 6 ];
-extern ULONG nVCLBLut[ 6 ];
-extern ULONG nVCLDitherLut[ 256 ];
-extern ULONG nVCLLut[ 256 ];
+extern sal_uLong nVCLRLut[ 6 ];
+extern sal_uLong nVCLGLut[ 6 ];
+extern sal_uLong nVCLBLut[ 6 ];
+extern sal_uLong nVCLDitherLut[ 256 ];
+extern sal_uLong nVCLLut[ 256 ];
// =======================================================================
-ULONG ImplAdjustTwoRect( TwoRect& rTwoRect, const Size& rSizePix )
+sal_uLong ImplAdjustTwoRect( TwoRect& rTwoRect, const Size& rSizePix )
{
- ULONG nMirrFlags = 0;
+ sal_uLong nMirrFlags = 0;
if ( rTwoRect.mnDestWidth < 0 )
{
@@ -388,7 +388,7 @@ void OutputDevice::DrawOutDev( const Point& rDestPt, const Size& rDestSize,
void OutputDevice::CopyArea( const Point& rDestPt,
const Point& rSrcPt, const Size& rSrcSize,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
OSL_TRACE( "OutputDevice::CopyArea()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -433,7 +433,7 @@ void OutputDevice::CopyArea( const Point& rDestPt,
((Window*)this)->ImplMoveAllInvalidateRegions( aSrcRect,
aPosAry.mnDestX-aPosAry.mnSrcX,
aPosAry.mnDestY-aPosAry.mnSrcY,
- FALSE );
+ sal_False );
mpGraphics->CopyArea( aPosAry.mnDestX, aPosAry.mnDestY,
aPosAry.mnSrcX, aPosAry.mnSrcY,
@@ -463,10 +463,10 @@ void OutputDevice::ImplDrawFrameDev( const Point& rPt, const Point& rDevPt, cons
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
GDIMetaFile* pOldMetaFile = mpMetaFile;
- BOOL bOldMap = mbMap;
+ sal_Bool bOldMap = mbMap;
RasterOp eOldROP = GetRasterOp();
mpMetaFile = NULL;
- mbMap = FALSE;
+ mbMap = sal_False;
SetRasterOp( ROP_OVERPAINT );
if ( !IsDeviceOutputNecessary() )
@@ -496,7 +496,7 @@ void OutputDevice::ImplDrawFrameDev( const Point& rPt, const Point& rDevPt, cons
ImplDrawOutDevDirect( &rOutDev, &aPosAry );
// Dafuer sorgen, das ClipRegion neu berechnet und gesetzt wird
- mbInitClipRegion = TRUE;
+ mbInitClipRegion = sal_True;
SetRasterOp( eOldROP );
mbMap = bOldMap;
@@ -510,8 +510,8 @@ void OutputDevice::ImplGetFrameDev( const Point& rPt, const Point& rDevPt, const
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- BOOL bOldMap = mbMap;
- mbMap = FALSE;
+ sal_Bool bOldMap = mbMap;
+ mbMap = sal_False;
rDev.DrawOutDev( rDevPt, rDevSize, rPt, rDevSize, *this );
mbMap = bOldMap;
}
@@ -577,7 +577,7 @@ void OutputDevice::DrawBitmap( const Point& rDestPt, const Size& rDestSize,
void OutputDevice::ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
- const Bitmap& rBitmap, const ULONG nAction )
+ const Bitmap& rBitmap, const sal_uLong nAction )
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -595,7 +595,7 @@ void OutputDevice::ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize,
{
if ( mnDrawMode & ( DRAWMODE_BLACKBITMAP | DRAWMODE_WHITEBITMAP ) )
{
- BYTE cCmpVal;
+ sal_uInt8 cCmpVal;
if ( mnDrawMode & DRAWMODE_BLACKBITMAP )
cCmpVal = ( mnDrawMode & DRAWMODE_GHOSTEDBITMAP ) ? 0x80 : 0;
@@ -654,7 +654,7 @@ void OutputDevice::ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize,
aPosAry.mnDestWidth = ImplLogicWidthToDevicePixel( rDestSize.Width() );
aPosAry.mnDestHeight = ImplLogicHeightToDevicePixel( rDestSize.Height() );
- const ULONG nMirrFlags = ImplAdjustTwoRect( aPosAry, aBmp.GetSizePixel() );
+ const sal_uLong nMirrFlags = ImplAdjustTwoRect( aPosAry, aBmp.GetSizePixel() );
if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight )
{
@@ -788,7 +788,7 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
void OutputDevice::ImplDrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
- const BitmapEx& rBitmapEx, const ULONG nAction )
+ const BitmapEx& rBitmapEx, const sal_uLong nAction )
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -807,7 +807,7 @@ void OutputDevice::ImplDrawBitmapEx( const Point& rDestPt, const Size& rDestSize
if ( mnDrawMode & ( DRAWMODE_BLACKBITMAP | DRAWMODE_WHITEBITMAP ) )
{
Bitmap aColorBmp( aBmpEx.GetSizePixel(), ( mnDrawMode & DRAWMODE_GHOSTEDBITMAP ) ? 4 : 1 );
- BYTE cCmpVal;
+ sal_uInt8 cCmpVal;
if ( mnDrawMode & DRAWMODE_BLACKBITMAP )
cCmpVal = ( mnDrawMode & DRAWMODE_GHOSTEDBITMAP ) ? 0x80 : 0;
@@ -901,7 +901,7 @@ void OutputDevice::ImplDrawBitmapEx( const Point& rDestPt, const Size& rDestSize
aPosAry.mnDestWidth = ImplLogicWidthToDevicePixel( rDestSize.Width() );
aPosAry.mnDestHeight = ImplLogicHeightToDevicePixel( rDestSize.Height() );
- const ULONG nMirrFlags = ImplAdjustTwoRect( aPosAry, aBmpEx.GetSizePixel() );
+ const sal_uLong nMirrFlags = ImplAdjustTwoRect( aPosAry, aBmpEx.GetSizePixel() );
if( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight )
{
@@ -1095,7 +1095,7 @@ void OutputDevice::DrawMask( const Point& rDestPt, const Size& rDestSize,
void OutputDevice::ImplDrawMask( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
const Bitmap& rBitmap, const Color& rMaskColor,
- const ULONG nAction )
+ const sal_uLong nAction )
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -1149,7 +1149,7 @@ void OutputDevice::ImplDrawMask( const Point& rDestPt, const Size& rDestSize,
aPosAry.mnDestHeight = ImplLogicHeightToDevicePixel( rDestSize.Height() );
// spiegeln via Koordinaten wollen wir nicht
- const ULONG nMirrFlags = ImplAdjustTwoRect( aPosAry, pImpBmp->ImplGetSize() );
+ const sal_uLong nMirrFlags = ImplAdjustTwoRect( aPosAry, pImpBmp->ImplGetSize() );
// check if output is necessary
if( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight )
@@ -1172,7 +1172,7 @@ void OutputDevice::ImplDrawMask( const Point& rDestPt, const Size& rDestSize,
// ------------------------------------------------------------------
-void OutputDevice::DrawImage( const Point& rPos, const Image& rImage, USHORT nStyle )
+void OutputDevice::DrawImage( const Point& rPos, const Image& rImage, sal_uInt16 nStyle )
{
DBG_ASSERT( GetOutDevType() != OUTDEV_PRINTER, "DrawImage(): Images can't be drawn on any mprinter" );
@@ -1209,7 +1209,7 @@ void OutputDevice::DrawImage( const Point& rPos, const Image& rImage, USHORT nSt
// ------------------------------------------------------------------
void OutputDevice::DrawImage( const Point& rPos, const Size& rSize,
- const Image& rImage, USHORT nStyle )
+ const Image& rImage, sal_uInt16 nStyle )
{
DBG_ASSERT( GetOutDevType() != OUTDEV_PRINTER, "DrawImage(): Images can't be drawn on any mprinter" );
@@ -1260,14 +1260,14 @@ Bitmap OutputDevice::GetBitmap( const Point& rSrcPt, const Size& rSize ) const
if ( nWidth && nHeight )
{
Rectangle aRect( Point( nX, nY ), Size( nWidth, nHeight ) );
- BOOL bClipped = FALSE;
+ sal_Bool bClipped = sal_False;
// X-Koordinate ausserhalb des Bereichs?
if ( nX < mnOutOffX )
{
nWidth -= ( mnOutOffX - nX );
nX = mnOutOffX;
- bClipped = TRUE;
+ bClipped = sal_True;
}
// Y-Koordinate ausserhalb des Bereichs?
@@ -1275,21 +1275,21 @@ Bitmap OutputDevice::GetBitmap( const Point& rSrcPt, const Size& rSize ) const
{
nHeight -= ( mnOutOffY - nY );
nY = mnOutOffY;
- bClipped = TRUE;
+ bClipped = sal_True;
}
// Breite ausserhalb des Bereichs?
if ( (nWidth + nX) > (mnOutWidth + mnOutOffX) )
{
nWidth = mnOutOffX + mnOutWidth - nX;
- bClipped = TRUE;
+ bClipped = sal_True;
}
// Hoehe ausserhalb des Bereichs?
if ( (nHeight + nY) > (mnOutHeight + mnOutOffY) )
{
nHeight = mnOutOffY + mnOutHeight - nY;
- bClipped = TRUE;
+ bClipped = sal_True;
}
if ( bClipped )
@@ -1321,10 +1321,10 @@ Bitmap OutputDevice::GetBitmap( const Point& rSrcPt, const Size& rSize ) const
aBmp = aVDev.GetBitmap( Point(), aVDev.GetOutputSizePixel() );
}
else
- bClipped = FALSE;
+ bClipped = sal_False;
}
else
- bClipped = FALSE;
+ bClipped = sal_False;
}
if ( !bClipped )
@@ -1372,8 +1372,8 @@ void OutputDevice::ImplGetFrameBitmap( const Point& rDestPt, const Size& rSize,
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- BOOL bOldMap = mbMap;
- ((OutputDevice*)this)->mbMap = FALSE;
+ sal_Bool bOldMap = mbMap;
+ ((OutputDevice*)this)->mbMap = sal_False;
rBitmap = GetBitmap( rDestPt, rSize );
((OutputDevice*)this)->mbMap = bOldMap;
}
@@ -1411,7 +1411,7 @@ Color* OutputDevice::GetPixel( const Polygon& rPts ) const
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
Color* pColors = NULL;
- const USHORT nSize = rPts.GetSize();
+ const sal_uInt16 nSize = rPts.GetSize();
if( nSize )
{
@@ -1424,7 +1424,7 @@ Color* OutputDevice::GetPixel( const Polygon& rPts ) const
{
pColors = new Color[ nSize ];
- for( USHORT i = 0; i < nSize; i++ )
+ for( sal_uInt16 i = 0; i < nSize; i++ )
{
Color& rCol = pColors[ i ];
const Point& rPt = rPts[ i ];
@@ -1503,7 +1503,7 @@ void OutputDevice::DrawPixel( const Point& rPt, const Color& rColor )
}
else if( mnDrawMode & DRAWMODE_GRAYLINE )
{
- const UINT8 cLum = aColor.GetLuminance();
+ const sal_uInt8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if( mnDrawMode & DRAWMODE_SETTINGSLINE )
@@ -1558,12 +1558,12 @@ void OutputDevice::DrawPixel( const Polygon& rPts, const Color* pColors )
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
DBG_ASSERT( pColors, "OutputDevice::DrawPixel: No color array specified" );
- const USHORT nSize = rPts.GetSize();
+ const sal_uInt16 nSize = rPts.GetSize();
if ( nSize )
{
if ( mpMetaFile )
- for ( USHORT i = 0; i < nSize; i++ )
+ for ( sal_uInt16 i = 0; i < nSize; i++ )
mpMetaFile->AddAction( new MetaPixelAction( rPts[ i ], pColors[ i ] ) );
if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
@@ -1578,7 +1578,7 @@ void OutputDevice::DrawPixel( const Polygon& rPts, const Color* pColors )
if ( mbOutputClipped )
return;
- for ( USHORT i = 0; i < nSize; i++ )
+ for ( sal_uInt16 i = 0; i < nSize; i++ )
{
const Point aPt( ImplLogicToDevicePixel( rPts[ i ] ) );
mpGraphics->DrawPixel( aPt.X(), aPt.Y(), ImplColorToSal( pColors[ i ] ), this );
@@ -1597,10 +1597,10 @@ void OutputDevice::DrawPixel( const Polygon& rPts, const Color& rColor )
{
if( rColor != COL_TRANSPARENT && ! ImplIsRecordLayout() )
{
- const USHORT nSize = rPts.GetSize();
+ const sal_uInt16 nSize = rPts.GetSize();
Color* pColArray = new Color[ nSize ];
- for( USHORT i = 0; i < nSize; i++ )
+ for( sal_uInt16 i = 0; i < nSize; i++ )
pColArray[ i ] = rColor;
DrawPixel( rPts, pColArray );
@@ -1615,11 +1615,11 @@ void OutputDevice::DrawPixel( const Polygon& rPts, const Color& rColor )
namespace
{
- BYTE lcl_calcColor( const BYTE nSourceColor, const BYTE nSourceOpaq, const BYTE nDestColor )
+ sal_uInt8 lcl_calcColor( const sal_uInt8 nSourceColor, const sal_uInt8 nSourceOpaq, const sal_uInt8 nDestColor )
{
int c = ( (int)nDestColor * ( 255 - nSourceOpaq ) )
+ (int)nSourceOpaq * (int)nSourceColor;
- return BYTE( c / 255 );
+ return sal_uInt8( c / 255 );
}
}
@@ -1643,8 +1643,8 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
OSL_ENSURE(mpAlphaVDev,
"ImplBlendWithAlpha(): call me only with valid alpha VDev!" );
- BOOL bOldMapMode( mpAlphaVDev->IsMapModeEnabled() );
- mpAlphaVDev->EnableMapMode(FALSE);
+ sal_Bool bOldMapMode( mpAlphaVDev->IsMapModeEnabled() );
+ mpAlphaVDev->EnableMapMode(sal_False);
Bitmap aAlphaBitmap( mpAlphaVDev->GetBitmap( aDstRect.TopLeft(), aDstRect.GetSize() ) );
BitmapWriteAccess* pAlphaW = aAlphaBitmap.AcquireWriteAccess();
@@ -1666,18 +1666,18 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
for( nX = 0, nOutX = nOffX; nX < nDstWidth; nX++, nOutX++ )
{
const long nMapX = pMapX[ nX ];
- const ULONG nD = nVCLDitherLut[ nModY | ( nOutX & 0x0FL ) ];
+ const sal_uLong nD = nVCLDitherLut[ nModY | ( nOutX & 0x0FL ) ];
aSrcCol = pP->GetColor( nMapY, nMapX );
aDstCol = pB->GetColor( nY, nX );
- const BYTE nSrcOpaq = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex();
- const BYTE nDstOpaq = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex();
+ const sal_uInt8 nSrcOpaq = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex();
+ const sal_uInt8 nDstOpaq = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex();
aDstCol.SetRed( lcl_calcColor( aSrcCol.GetRed(), nSrcOpaq, aDstCol.GetRed() ) );
aDstCol.SetBlue( lcl_calcColor( aSrcCol.GetBlue(), nSrcOpaq, aDstCol.GetBlue() ) );
aDstCol.SetGreen( lcl_calcColor( aSrcCol.GetGreen(), nSrcOpaq, aDstCol.GetGreen() ) );
- aIndex.SetIndex( (BYTE) ( nVCLRLut[ ( nVCLLut[ aDstCol.GetRed() ] + nD ) >> 16UL ] +
+ aIndex.SetIndex( (sal_uInt8) ( nVCLRLut[ ( nVCLLut[ aDstCol.GetRed() ] + nD ) >> 16UL ] +
nVCLGLut[ ( nVCLLut[ aDstCol.GetGreen() ] + nD ) >> 16UL ] +
nVCLBLut[ ( nVCLLut[ aDstCol.GetBlue() ] + nD ) >> 16UL ] ) );
pW->SetPixel( nY, nX, aIndex );
@@ -1686,9 +1686,9 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
// the inverse alpha space (with 255 meaning
// opaque), otherwise, transitivity is not
// achieved.
- const BYTE nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (BYTE)nDstOpaq, nSrcOpaq );
+ const sal_uInt8 nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (sal_uInt8)nDstOpaq, nSrcOpaq );
- aIndex.SetIndex( (BYTE) ( nVCLRLut[ ( nVCLLut[ nSrcAlpha ] + nD ) >> 16UL ] +
+ aIndex.SetIndex( (sal_uInt8) ( nVCLRLut[ ( nVCLLut[ nSrcAlpha ] + nD ) >> 16UL ] +
nVCLGLut[ ( nVCLLut[ nSrcAlpha ] + nD ) >> 16UL ] +
nVCLBLut[ ( nVCLLut[ nSrcAlpha ] + nD ) >> 16UL ] ) );
pAlphaW->SetPixel( nY, nX, aIndex );
@@ -1715,8 +1715,8 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
aSrcCol = pP->GetColor( nMapY, nMapX );
aDstCol = pB->GetColor( nY, nX );
- const BYTE nSrcOpaq = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex();
- const BYTE nDstOpaq = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex();
+ const sal_uInt8 nSrcOpaq = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex();
+ const sal_uInt8 nDstOpaq = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex();
aDstCol.SetRed( lcl_calcColor( aSrcCol.GetRed(), nSrcOpaq, aDstCol.GetRed() ) );
aDstCol.SetBlue( lcl_calcColor( aSrcCol.GetBlue(), nSrcOpaq, aDstCol.GetBlue() ) );
@@ -1728,7 +1728,7 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
// the inverse alpha space (with 255 meaning
// opaque), otherwise, transitivity is not
// achieved.
- const BYTE nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (BYTE)nDstOpaq, nSrcOpaq );
+ const sal_uInt8 nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (sal_uInt8)nDstOpaq, nSrcOpaq );
pAlphaW->SetPixel( nY, nX, Color(nSrcAlpha, nSrcAlpha, nSrcAlpha) );
}
@@ -1783,11 +1783,11 @@ Bitmap OutputDevice::ImplBlend( Bitmap aBmp,
for( nX = 0, nOutX = nOffX; nX < nDstWidth; nX++, nOutX++ )
{
const long nMapX = pMapX[ nX ];
- const ULONG nD = nVCLDitherLut[ nModY | ( nOutX & 0x0FL ) ];
+ const sal_uLong nD = nVCLDitherLut[ nModY | ( nOutX & 0x0FL ) ];
aDstCol = pB->GetColor( nY, nX );
- aDstCol.Merge( pP->GetColor( nMapY, nMapX ), (BYTE) pA->GetPixel( nMapY, nMapX ) );
- aIndex.SetIndex( (BYTE) ( nVCLRLut[ ( nVCLLut[ aDstCol.GetRed() ] + nD ) >> 16UL ] +
+ aDstCol.Merge( pP->GetColor( nMapY, nMapX ), (sal_uInt8) pA->GetPixel( nMapY, nMapX ) );
+ aIndex.SetIndex( (sal_uInt8) ( nVCLRLut[ ( nVCLLut[ aDstCol.GetRed() ] + nD ) >> 16UL ] +
nVCLGLut[ ( nVCLLut[ aDstCol.GetGreen() ] + nD ) >> 16UL ] +
nVCLBLut[ ( nVCLLut[ aDstCol.GetBlue() ] + nD ) >> 16UL ] ) );
pW->SetPixel( nY, nX, aIndex );
@@ -1922,7 +1922,7 @@ void OutputDevice::ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha,
Point aOutPt( LogicToPixel( rDestPt ) );
Size aOutSz( LogicToPixel( rDestSize ) );
Rectangle aDstRect( aNullPt, GetOutputSizePixel() );
- const BOOL bHMirr = aOutSz.Width() < 0, bVMirr = aOutSz.Height() < 0;
+ const sal_Bool bHMirr = aOutSz.Width() < 0, bVMirr = aOutSz.Height() < 0;
if( OUTDEV_WINDOW == meOutDevType )
{
@@ -1971,7 +1971,7 @@ void OutputDevice::ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha,
&& !aBmpRect.Intersection( Rectangle( rSrcPtPixel, rSrcSizePixel ) ).IsEmpty() )
{
GDIMetaFile* pOldMetaFile = mpMetaFile; mpMetaFile = NULL;
- const BOOL bOldMap = mbMap; mbMap = FALSE;
+ const sal_Bool bOldMap = mbMap; mbMap = sal_False;
Bitmap aBmp( GetBitmap( aDstRect.TopLeft(), aDstRect.GetSize() ) );
// #109044# The generated bitmap need not necessarily be
@@ -2096,7 +2096,7 @@ void OutputDevice::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask
if( !rBmp.IsEmpty() && aSrcRect.GetWidth() && aSrcRect.GetHeight() && aDestSz.Width() && aDestSz.Height() )
{
Bitmap aPaint( rBmp ), aMask( rMask );
- ULONG nMirrFlags = 0UL;
+ sal_uLong nMirrFlags = 0UL;
if( aMask.GetBitCount() > 1 )
aMask.Convert( BMP_CONVERSION_1BIT_THRESHOLD );
@@ -2143,9 +2143,9 @@ void OutputDevice::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask
long nX, nY, nWorkX, nWorkY, nWorkWidth, nWorkHeight;
long* pMapX = new long[ nSrcWidth + 1 ];
long* pMapY = new long[ nSrcHeight + 1 ];
- const BOOL bOldMap = mbMap;
+ const sal_Bool bOldMap = mbMap;
- mbMap = FALSE;
+ mbMap = sal_False;
// create forward mapping tables
for( nX = 0L; nX <= nSrcWidth; nX++ )
@@ -2157,7 +2157,7 @@ void OutputDevice::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask
// walk through all rectangles of mask
Region aWorkRgn( aMask.CreateRegion( COL_BLACK, Rectangle( Point(), aMask.GetSizePixel() ) ) );
ImplRegionInfo aInfo;
- BOOL bRgnRect = aWorkRgn.ImplGetFirstRect( aInfo, nWorkX, nWorkY, nWorkWidth, nWorkHeight );
+ sal_Bool bRgnRect = aWorkRgn.ImplGetFirstRect( aInfo, nWorkX, nWorkY, nWorkWidth, nWorkHeight );
while( bRgnRect )
{
@@ -2194,7 +2194,7 @@ void OutputDevice::ImplPrintMask( const Bitmap& rMask, const Color& rMaskColor,
if( !rMask.IsEmpty() && aSrcRect.GetWidth() && aSrcRect.GetHeight() && aDestSz.Width() && aDestSz.Height() )
{
Bitmap aMask( rMask );
- ULONG nMirrFlags = 0UL;
+ sal_uLong nMirrFlags = 0UL;
if( aMask.GetBitCount() > 1 )
aMask.Convert( BMP_CONVERSION_1BIT_THRESHOLD );
@@ -2229,10 +2229,10 @@ void OutputDevice::ImplPrintMask( const Bitmap& rMask, const Color& rMaskColor,
long* pMapX = new long[ nSrcWidth + 1 ];
long* pMapY = new long[ nSrcHeight + 1 ];
GDIMetaFile* pOldMetaFile = mpMetaFile;
- const BOOL bOldMap = mbMap;
+ const sal_Bool bOldMap = mbMap;
mpMetaFile = NULL;
- mbMap = FALSE;
+ mbMap = sal_False;
Push( PUSH_FILLCOLOR | PUSH_LINECOLOR );
SetLineColor( rMaskColor );
SetFillColor( rMaskColor );
@@ -2249,7 +2249,7 @@ void OutputDevice::ImplPrintMask( const Bitmap& rMask, const Color& rMaskColor,
// walk through all rectangles of mask
Region aWorkRgn( aMask.CreateRegion( COL_BLACK, Rectangle( Point(), aMask.GetSizePixel() ) ) );
ImplRegionInfo aInfo;
- BOOL bRgnRect = aWorkRgn.ImplGetFirstRect( aInfo, nWorkX, nWorkY, nWorkWidth, nWorkHeight );
+ sal_Bool bRgnRect = aWorkRgn.ImplGetFirstRect( aInfo, nWorkX, nWorkY, nWorkWidth, nWorkHeight );
while( bRgnRect )
{
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 4026abb1c48e..9a3d07353fff 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -28,56 +28,57 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <cstring>
-#include <i18npool/mslangid.hxx>
-
-#include <svsys.h>
-#include <vcl/salgdi.hxx>
-#include <vcl/sallayout.hxx>
-#include <rtl/tencinfo.h>
-#include <tools/debug.hxx>
-#include <vcl/svdata.hxx>
-#include <vcl/metric.hxx>
-#include <vcl/impfont.hxx>
-#include <vcl/metaact.hxx>
-#include <vcl/gdimtf.hxx>
-#include <vcl/outdata.hxx>
-#include <vcl/outfont.hxx>
-#include <basegfx/polygon/b2dpolygon.hxx>
-#include <basegfx/polygon/b2dpolypolygon.hxx>
-#include <basegfx/matrix/b2dhommatrix.hxx>
-#include <tools/poly.hxx>
-#include <vcl/outdev.h>
-#include <vcl/virdev.hxx>
-#include <vcl/print.hxx>
-#include <vcl/event.hxx>
-#include <vcl/window.h>
-#include <vcl/window.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/bmpacc.hxx>
-#include <unotools/fontcvt.hxx>
-#include <vcl/outdev.hxx>
-#include <vcl/edit.hxx>
-#include <unotools/fontcfg.hxx>
-#include <vcl/sysdata.hxx>
-#include <vcl/textlayout.hxx>
-#include <osl/file.h>
+
+#include "i18npool/mslangid.hxx"
+
+#include "svsys.h"
+#include "vcl/salgdi.hxx"
+#include "vcl/sallayout.hxx"
+#include "rtl/tencinfo.h"
+#include "tools/debug.hxx"
+#include "vcl/svdata.hxx"
+#include "vcl/metric.hxx"
+#include "vcl/impfont.hxx"
+#include "vcl/metaact.hxx"
+#include "vcl/gdimtf.hxx"
+#include "vcl/outdata.hxx"
+#include "vcl/outfont.hxx"
+#include "basegfx/polygon/b2dpolygon.hxx"
+#include "basegfx/polygon/b2dpolypolygon.hxx"
+#include "basegfx/matrix/b2dhommatrix.hxx"
+#include "tools/poly.hxx"
+#include "vcl/outdev.h"
+#include "vcl/virdev.hxx"
+#include "vcl/print.hxx"
+#include "vcl/event.hxx"
+#include "vcl/window.h"
+#include "vcl/window.hxx"
+#include "vcl/svapp.hxx"
+#include "vcl/bmpacc.hxx"
+#include "unotools/fontcvt.hxx"
+#include "vcl/outdev.hxx"
+#include "vcl/edit.hxx"
+#include "unotools/fontcfg.hxx"
+#include "vcl/sysdata.hxx"
+#include "vcl/textlayout.hxx"
+#include "vcl/svids.hrc"
+#include "osl/file.h"
#ifdef ENABLE_GRAPHITE
-#include <vcl/graphite_features.hxx>
+#include "vcl/graphite_features.hxx"
#endif
#ifdef USE_BUILTIN_RASTERIZER
-#include <vcl/glyphcache.hxx>
+#include "vcl/glyphcache.hxx"
#endif
-#include <vcl/unohelp.hxx>
-#include <pdfwriter_impl.hxx>
-#include <vcl/controllayout.hxx>
-#include <rtl/logfile.hxx>
+#include "vcl/unohelp.hxx"
+#include "pdfwriter_impl.hxx"
+#include "vcl/controllayout.hxx"
+#include "rtl/logfile.hxx"
-#include <com/sun/star/beans/PropertyValues.hdl>
-#include <com/sun/star/i18n/XBreakIterator.hpp>
-#include <com/sun/star/i18n/WordType.hpp>
-#include <com/sun/star/linguistic2/XLinguServiceManager.hpp>
+#include "com/sun/star/beans/PropertyValues.hpp"
+#include "com/sun/star/i18n/XBreakIterator.hpp"
+#include "com/sun/star/i18n/WordType.hpp"
+#include "com/sun/star/linguistic2/XLinguServiceManager.hpp"
#if defined UNX
#define GLYPH_FONT_HEIGHT 128
@@ -87,7 +88,7 @@
#define GLYPH_FONT_HEIGHT 256
#endif
-#include <sal/alloca.h>
+#include "sal/alloca.h"
#include <cmath>
#include <cstring>
@@ -225,7 +226,7 @@ void OutputDevice::ImplUpdateFontData( bool bNewFontLists )
if( mpFontCache && mpFontCache != pSVData->maGDIData.mpScreenFontCache )
delete mpFontCache;
mpFontList = mpPDFWriter->filterDevFontList( pSVData->maGDIData.mpScreenFontList );
- mpFontCache = new ImplFontCache( FALSE );
+ mpFontCache = new ImplFontCache( sal_False );
}
else
{
@@ -317,7 +318,7 @@ void ImplFreeOutDevFontData()
void OutputDevice::BeginFontSubstitution()
{
ImplSVData* pSVData = ImplGetSVData();
- pSVData->maGDIData.mbFontSubChanged = FALSE;
+ pSVData->maGDIData.mbFontSubChanged = sal_False;
}
// -----------------------------------------------------------------------
@@ -333,7 +334,7 @@ void OutputDevice::EndFontSubstitution()
DataChangedEvent aDCEvt( DATACHANGED_FONTSUBSTITUTION );
pApp->DataChanged( aDCEvt );
pApp->NotifyAllWindows( aDCEvt );
- pSVData->maGDIData.mbFontSubChanged = FALSE;
+ pSVData->maGDIData.mbFontSubChanged = sal_False;
}
}
@@ -341,19 +342,19 @@ void OutputDevice::EndFontSubstitution()
void OutputDevice::AddFontSubstitute( const XubString& rFontName,
const XubString& rReplaceFontName,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
ImplDirectFontSubstitution*& rpSubst = ImplGetSVData()->maGDIData.mpDirectFontSubst;
if( !rpSubst )
rpSubst = new ImplDirectFontSubstitution();
rpSubst->AddFontSubstitute( rFontName, rReplaceFontName, nFlags );
- ImplGetSVData()->maGDIData.mbFontSubChanged = TRUE;
+ ImplGetSVData()->maGDIData.mbFontSubChanged = sal_True;
}
// -----------------------------------------------------------------------
void ImplDirectFontSubstitution::AddFontSubstitute( const String& rFontName,
- const String& rSubstFontName, USHORT nFlags )
+ const String& rSubstFontName, sal_uInt16 nFlags )
{
maFontSubstList.push_back( ImplFontSubstEntry( rFontName, rSubstFontName, nFlags ) );
}
@@ -361,7 +362,7 @@ void ImplDirectFontSubstitution::AddFontSubstitute( const String& rFontName,
// -----------------------------------------------------------------------
ImplFontSubstEntry::ImplFontSubstEntry( const String& rFontName,
- const String& rSubstFontName, USHORT nSubstFlags )
+ const String& rSubstFontName, sal_uInt16 nSubstFlags )
: maName( rFontName )
, maReplaceName( rSubstFontName )
, mnFlags( nSubstFlags )
@@ -376,7 +377,7 @@ ImplFontSubstEntry::ImplFontSubstEntry( const String& rFontName,
void OutputDevice::ImplAddDevFontSubstitute( const XubString& rFontName,
const XubString& rReplaceFontName,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
ImplInitOutDevData();
mpOutDevData->maDevFontSubst.AddFontSubstitute( rFontName, rReplaceFontName, nFlags );
@@ -384,7 +385,7 @@ void OutputDevice::ImplAddDevFontSubstitute( const XubString& rFontName,
// -----------------------------------------------------------------------
-void OutputDevice::RemoveFontSubstitute( USHORT n )
+void OutputDevice::RemoveFontSubstitute( sal_uInt16 n )
{
ImplDirectFontSubstitution* pSubst = ImplGetSVData()->maGDIData.mpDirectFontSubst;
if( pSubst )
@@ -403,21 +404,21 @@ void ImplDirectFontSubstitution::RemoveFontSubstitute( int nIndex )
// -----------------------------------------------------------------------
-USHORT OutputDevice::GetFontSubstituteCount()
+sal_uInt16 OutputDevice::GetFontSubstituteCount()
{
const ImplDirectFontSubstitution* pSubst = ImplGetSVData()->maGDIData.mpDirectFontSubst;
if( !pSubst )
return 0;
int nCount = pSubst->GetFontSubstituteCount();
- return (USHORT)nCount;
+ return (sal_uInt16)nCount;
}
// -----------------------------------------------------------------------
-void OutputDevice::GetFontSubstitute( USHORT n,
+void OutputDevice::GetFontSubstitute( sal_uInt16 n,
XubString& rFontName,
XubString& rReplaceFontName,
- USHORT& rFlags )
+ sal_uInt16& rFlags )
{
const ImplDirectFontSubstitution* pSubst = ImplGetSVData()->maGDIData.mpDirectFontSubst;
if( pSubst )
@@ -427,7 +428,7 @@ void OutputDevice::GetFontSubstitute( USHORT n,
// -----------------------------------------------------------------------
bool ImplDirectFontSubstitution::GetFontSubstitute( int nIndex,
- String& rFontName, String& rSubstFontName, USHORT& rFlags ) const
+ String& rFontName, String& rSubstFontName, sal_uInt16& rFlags ) const
{
FontSubstList::const_iterator it = maFontSubstList.begin();
for( int nCount = 0; (it != maFontSubstList.end()) && (nCount++ != nIndex); ++it ) ;
@@ -444,7 +445,7 @@ bool ImplDirectFontSubstitution::GetFontSubstitute( int nIndex,
// -----------------------------------------------------------------------
bool ImplDirectFontSubstitution::FindFontSubstitute( String& rSubstName,
- const String& rSearchName, USHORT nFlags ) const
+ const String& rSearchName, sal_uInt16 nFlags ) const
{
// TODO: get rid of O(N) searches
FontSubstList::const_iterator it = maFontSubstList.begin();
@@ -465,7 +466,7 @@ bool ImplDirectFontSubstitution::FindFontSubstitute( String& rSubstName,
// -----------------------------------------------------------------------
static void ImplFontSubstitute( String& rFontName,
- USHORT nFlags, ImplDirectFontSubstitution* pDevSpecific )
+ sal_uInt16 nFlags, ImplDirectFontSubstitution* pDevSpecific )
{
#ifdef DBG_UTIL
String aTempName = rFontName;
@@ -496,8 +497,8 @@ static void ImplFontSubstitute( String& rFontName,
// -----------------------------------------------------------------------
-Font OutputDevice::GetDefaultFont( USHORT nType, LanguageType eLang,
- ULONG nFlags, const OutputDevice* pOutDev )
+Font OutputDevice::GetDefaultFont( sal_uInt16 nType, LanguageType eLang,
+ sal_uLong nFlags, const OutputDevice* pOutDev )
{
OSL_TRACE( "OutputDevice::GetDefaultFont()" );
@@ -730,7 +731,7 @@ static unsigned ImplIsCJKFont( const String& rFontName )
// -----------------------------------------------------------------------
-static void ImplCalcType( ULONG& rType, FontWeight& rWeight, FontWidth& rWidth,
+static void ImplCalcType( sal_uLong& rType, FontWeight& rWeight, FontWidth& rWidth,
FontFamily eFamily, const FontNameAttr* pFontAttr )
{
if ( eFamily != FAMILY_DONTKNOW )
@@ -1322,11 +1323,11 @@ void ImplDevFontList::InitGenericGlyphFallback( void ) const
"msmincho", "fzmingti", "fzheiti", "ipamincho", "sazanamimincho", "kochimincho", "",
"sunbatang", "sundotum", "baekmukdotum", "gulim", "batang", "dotum", "",
"hgmincholightj", "msunglightsc", "msunglighttc", "hymyeongjolightk", "",
- "tahoma", "dejavusans", "timesnewroman", "lucidatypewriter", "lucidasans", "nimbussansl", "",
+ "tahoma", "dejavusans", "timesnewroman", "liberationsans", "",
"shree", "mangal", "",
"raavi", "shruti", "tunga", "",
"latha", "gautami", "kartika", "vrinda", "",
- "shayyalmt", "naskmt", "",
+ "shayyalmt", "naskmt", "scheherazade", "",
"david", "nachlieli", "lucidagrande", "",
"norasi", "angsanaupc", "",
"khmerossystem", "",
@@ -1376,6 +1377,7 @@ void ImplDevFontList::InitGenericGlyphFallback( void ) const
}
}
+#ifdef SAL_FONTENUM_STABLE_ON_PLATFORM // #i113472#
// sort the list of fonts for glyph fallback by quality (highest first)
// #i33947# keep the EUDC font at the front of the list
// an insertion sort is good enough for this short list
@@ -1391,6 +1393,7 @@ void ImplDevFontList::InitGenericGlyphFallback( void ) const
break;
pFallbackList[ j+1 ] = pTestFont;
}
+#endif
mnFallbackCount = nMaxLevel;
mpFallbackList = pFallbackList;
@@ -1631,10 +1634,25 @@ ImplDevFontListData* ImplDevFontList::ImplFindBySubstFontAttr( const utl::FontNa
pFoundData = ImplFindBySearchName( aSearchName );
if( pFoundData )
- break;
+ return pFoundData;
}
- return pFoundData;
+ // use known attributes from the configuration to find a matching substitute
+ const sal_uLong nSearchType = rFontAttr.Type;
+ if( nSearchType != 0 )
+ {
+ const FontWeight eSearchWeight = rFontAttr.Weight;
+ const FontWidth eSearchWidth = rFontAttr.Width;
+ const FontItalic eSearchSlant = ITALIC_DONTKNOW;
+ const FontFamily eSearchFamily = FAMILY_DONTKNOW;
+ const String aSearchName;
+ pFoundData = ImplFindByAttributes( nSearchType,
+ eSearchWeight, eSearchWidth, eSearchFamily, eSearchSlant, aSearchName );
+ if( pFoundData )
+ return pFoundData;
+ }
+
+ return NULL;
}
// -----------------------------------------------------------------------
@@ -1660,20 +1678,20 @@ void ImplDevFontList::InitMatchData() const
}
//----------------------------------------------------------------------------
-ImplDevFontListData* ImplDevFontList::ImplFindByLocale(com::sun::star::lang::Locale lc) const
+ImplDevFontListData* ImplDevFontList::ImplFindByLocale( com::sun::star::lang::Locale& rLocale ) const
{
// get the default font for a specified locale
const DefaultFontConfiguration& rDefaults = *DefaultFontConfiguration::get();
- String aDefault = rDefaults.getUserInterfaceFont( lc );
+ const String aDefault = rDefaults.getUserInterfaceFont( rLocale );
ImplDevFontListData* pFontData = ImplFindByTokenNames( aDefault );
if( pFontData )
return pFontData;
- return 0;
+ return NULL;
}
// -----------------------------------------------------------------------
-ImplDevFontListData* ImplDevFontList::ImplFindByAttributes( ULONG nSearchType,
+ImplDevFontListData* ImplDevFontList::ImplFindByAttributes( sal_uLong nSearchType,
FontWeight eSearchWeight, FontWidth eSearchWidth, FontFamily /*eSearchFamily*/,
FontItalic eSearchItalic, const String& rSearchFamilyName ) const
{
@@ -1691,7 +1709,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByAttributes( ULONG nSearchType,
long nTestMatch;
long nBestMatch = 40000;
- ULONG nBestType = 0;
+ sal_uLong nBestType = 0;
DevFontList::const_iterator it = maDevFontList.begin();
for(; it != maDevFontList.end(); ++it )
@@ -1699,7 +1717,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByAttributes( ULONG nSearchType,
ImplDevFontListData* pData = (*it).second;
// Get all information about the matching font
- ULONG nMatchType = pData->mnMatchType;
+ sal_uLong nMatchType = pData->mnMatchType;
FontWeight eMatchWeight= pData->meMatchWeight;
FontWidth eMatchWidth = pData->meMatchWidth;
@@ -2410,7 +2428,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD,
// test if a font in the token list is available
// substitute the font if this was requested
- USHORT nSubstFlags = FONT_SUBSTITUTE_ALWAYS;
+ sal_uInt16 nSubstFlags = FONT_SUBSTITUTE_ALWAYS;
if ( bPrinter )
nSubstFlags |= FONT_SUBSTITUTE_SCREENONLY;
@@ -2539,7 +2557,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD,
String aSearchFamilyName;
FontWeight eSearchWeight = rFSD.meWeight;
FontWidth eSearchWidth = rFSD.meWidthType;
- ULONG nSearchType = 0;
+ sal_uLong nSearchType = 0;
FontSubstConfiguration::getMapName( aSearchName, aSearchShortName, aSearchFamilyName,
eSearchWeight, eSearchWidth, nSearchType );
@@ -2611,7 +2629,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD,
String aTempShortName;
String aTempFamilyName;
- ULONG nTempType = 0;
+ sal_uLong nTempType = 0;
FontWeight eTempWeight = rFSD.meWeight;
FontWidth eTempWidth = WIDTH_DONTKNOW;
FontSubstConfiguration::getMapName( aSearchName, aTempShortName, aTempFamilyName,
@@ -2883,17 +2901,17 @@ FontEmphasisMark OutputDevice::ImplGetEmphasisMarkStyle( const Font& rFont )
// -----------------------------------------------------------------------
-BOOL OutputDevice::ImplIsUnderlineAbove( const Font& rFont )
+sal_Bool OutputDevice::ImplIsUnderlineAbove( const Font& rFont )
{
if ( !rFont.IsVertical() )
- return FALSE;
+ return sal_False;
if( (LANGUAGE_JAPANESE == rFont.GetLanguage())
|| (LANGUAGE_JAPANESE == rFont.GetCJKContextLanguage()) )
// the underline is right for Japanese only
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
}
// =======================================================================
@@ -2908,6 +2926,18 @@ void OutputDevice::ImplInitFontList() const
mpGraphics->GetDevFontList( mpFontList );
}
}
+ if( meOutDevType == OUTDEV_WINDOW && ! mpFontList->Count() )
+ {
+ String aError( RTL_CONSTASCII_USTRINGPARAM( "Application error: no fonts and no vcl resource found on your system" ) );
+ ResMgr* pMgr = ImplGetResMgr();
+ if( pMgr )
+ {
+ String aResStr( ResId( SV_ACCESSERROR_NO_FONTS, *pMgr ) );
+ if( aResStr.Len() )
+ aError = aResStr;
+ }
+ Application::Abort( aError );
+ }
}
// =======================================================================
@@ -2946,7 +2976,7 @@ void OutputDevice::ImplInitTextColor()
if ( mbInitTextColor )
{
mpGraphics->SetTextColor( ImplColorToSal( GetTextColor() ) );
- mbInitTextColor = FALSE;
+ mbInitTextColor = sal_False;
}
}
@@ -3003,9 +3033,9 @@ bool OutputDevice::ImplNewFont() const
ImplFontEntry* pFontEntry = mpFontEntry;
// mark when lower layers need to get involved
- mbNewFont = FALSE;
+ mbNewFont = sal_False;
if( pFontEntry != pOldEntry )
- mbInitFont = TRUE;
+ mbInitFont = sal_True;
// select font when it has not been initialized yet
if ( !pFontEntry->mbInit )
@@ -3106,10 +3136,10 @@ bool OutputDevice::ImplNewFont() const
{
Size aOrigSize = maFont.GetSize();
const_cast<Font&>(maFont).SetSize( Size( nNewWidth, aSize.Height() ) );
- mbMap = FALSE;
- mbNewFont = TRUE;
+ mbMap = sal_False;
+ mbNewFont = sal_True;
ImplNewFont(); // recurse once using stretched width
- mbMap = TRUE;
+ mbMap = sal_True;
const_cast<Font&>(maFont).SetSize( aOrigSize );
}
}
@@ -3129,17 +3159,17 @@ long OutputDevice::ImplGetTextWidth( const SalLayout& rSalLayout ) const
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawTextRect( long nBaseX, long nBaseY,
- long nX, long nY, long nWidth, long nHeight )
+ long nDistX, long nDistY, long nWidth, long nHeight )
{
+ long nX = nDistX;
+ long nY = nDistY;
+
short nOrientation = mpFontEntry->mnOrientation;
if ( nOrientation )
{
// Rotate rect without rounding problems for 90 degree rotations
if ( !(nOrientation % 900) )
{
- nX -= nBaseX;
- nY -= nBaseY;
-
if ( nOrientation == 900 )
{
long nTemp = nX;
@@ -3167,12 +3197,11 @@ void OutputDevice::ImplDrawTextRect( long nBaseX, long nBaseY,
nHeight = nTemp;
nX -= nWidth;
}
-
- nX += nBaseX;
- nY += nBaseY;
}
else
{
+ nX += nBaseX;
+ nY += nBaseY;
// inflate because polygons are drawn smaller
Rectangle aRect( Point( nX, nY ), Size( nWidth+1, nHeight+1 ) );
Polygon aPoly( aRect );
@@ -3182,6 +3211,8 @@ void OutputDevice::ImplDrawTextRect( long nBaseX, long nBaseY,
}
}
+ nX += nBaseX;
+ nY += nBaseY;
mpGraphics->DrawRect( nX, nY, nWidth, nHeight, this );
}
@@ -3197,12 +3228,12 @@ void OutputDevice::ImplDrawTextBackground( const SalLayout& rSalLayout )
if ( mbLineColor || mbInitLineColor )
{
mpGraphics->SetLineColor();
- mbInitLineColor = TRUE;
+ mbInitLineColor = sal_True;
}
mpGraphics->SetFillColor( ImplColorToSal( GetTextFillColor() ) );
- mbInitFillColor = TRUE;
+ mbInitFillColor = sal_True;
- ImplDrawTextRect( nX, nY, nX, nY-mpFontEntry->maMetric.mnAscent-mnEmphasisAscent,
+ ImplDrawTextRect( nX, nY, 0, -(mpFontEntry->maMetric.mnAscent + mnEmphasisAscent),
nWidth,
mpFontEntry->mnLineHeight+mnEmphasisAscent+mnEmphasisDescent );
}
@@ -3466,7 +3497,7 @@ static void ImplDrawWavePixel( long nOriginX, long nOriginY,
short nOrientation,
SalGraphics* pGraphics,
OutputDevice* pOutDev,
- BOOL bDrawPixAsRect,
+ sal_Bool bDrawPixAsRect,
long nPixWidth, long nPixHeight )
{
@@ -3487,7 +3518,7 @@ static void ImplDrawWavePixel( long nOriginX, long nOriginY,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
- long nStartX, long nStartY,
+ long nDistX, long nDistY,
long nWidth, long nHeight,
long nLineWidth, short nOrientation,
const Color& rColor )
@@ -3495,11 +3526,14 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
if ( !nHeight )
return;
+ long nStartX = nBaseX + nDistX;
+ long nStartY = nBaseY + nDistY;
+
// Bei Hoehe von 1 Pixel reicht es, eine Linie auszugeben
if ( (nLineWidth == 1) && (nHeight == 1) )
{
mpGraphics->SetLineColor( ImplColorToSal( rColor ) );
- mbInitLineColor = TRUE;
+ mbInitLineColor = sal_True;
long nEndX = nStartX+nWidth;
long nEndY = nStartY;
@@ -3509,7 +3543,6 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
ImplRotatePos( nBaseX, nBaseY, nEndX, nEndY, nOrientation );
}
mpGraphics->DrawLine( nStartX, nStartY, nEndX, nEndY, this );
-
}
else
{
@@ -3523,28 +3556,28 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
long i;
long nPixWidth;
long nPixHeight;
- BOOL bDrawPixAsRect;
+ sal_Bool bDrawPixAsRect;
// Auf Druckern die Pixel per DrawRect() ausgeben
if ( (GetOutDevType() == OUTDEV_PRINTER) || (nLineWidth > 1) )
{
if ( mbLineColor || mbInitLineColor )
{
mpGraphics->SetLineColor();
- mbInitLineColor = TRUE;
+ mbInitLineColor = sal_True;
}
mpGraphics->SetFillColor( ImplColorToSal( rColor ) );
- mbInitFillColor = TRUE;
- bDrawPixAsRect = TRUE;
+ mbInitFillColor = sal_True;
+ bDrawPixAsRect = sal_True;
nPixWidth = nLineWidth;
nPixHeight = ((nLineWidth*mnDPIX)+(mnDPIY/2))/mnDPIY;
}
else
{
mpGraphics->SetLineColor( ImplColorToSal( rColor ) );
- mbInitLineColor = TRUE;
+ mbInitLineColor = sal_True;
nPixWidth = 1;
nPixHeight = 1;
- bDrawPixAsRect = FALSE;
+ bDrawPixAsRect = sal_False;
}
if ( !nDiffY )
@@ -3609,10 +3642,10 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawWaveTextLine( long nBaseX, long nBaseY,
- long nX, long nY, long nWidth,
+ long nDistX, long nDistY, long nWidth,
FontUnderline eTextLine,
Color aColor,
- BOOL bIsAbove )
+ sal_Bool bIsAbove )
{
ImplFontEntry* pFontEntry = mpFontEntry;
long nLineHeight;
@@ -3635,7 +3668,7 @@ void OutputDevice::ImplDrawWaveTextLine( long nBaseX, long nBaseY,
nLineWidth = 1;
if ( eTextLine == UNDERLINE_BOLDWAVE )
nLineWidth *= 2;
- nLinePos += nY - (nLineHeight / 2);
+ nLinePos += nDistY - (nLineHeight / 2);
long nLineWidthHeight = ((nLineWidth*mnDPIX)+(mnDPIY/2))/mnDPIY;
if ( eTextLine == UNDERLINE_DOUBLEWAVE )
{
@@ -3656,16 +3689,16 @@ void OutputDevice::ImplDrawWaveTextLine( long nBaseX, long nBaseY,
nLineDY2 = 1;
nLinePos -= nLineWidthHeight-nLineDY2;
- ImplDrawWaveLine( nBaseX, nBaseY, nX, nLinePos, nWidth, nLineHeight,
+ ImplDrawWaveLine( nBaseX, nBaseY, nDistX, nLinePos, nWidth, nLineHeight,
nLineWidth, mpFontEntry->mnOrientation, aColor );
nLinePos += nLineWidthHeight+nLineDY;
- ImplDrawWaveLine( nBaseX, nBaseY, nX, nLinePos, nWidth, nLineHeight,
+ ImplDrawWaveLine( nBaseX, nBaseY, nDistX, nLinePos, nWidth, nLineHeight,
nLineWidth, mpFontEntry->mnOrientation, aColor );
}
else
{
nLinePos -= nLineWidthHeight/2;
- ImplDrawWaveLine( nBaseX, nBaseY, nX, nLinePos, nWidth, nLineHeight,
+ ImplDrawWaveLine( nBaseX, nBaseY, nDistX, nLinePos, nWidth, nLineHeight,
nLineWidth, mpFontEntry->mnOrientation, aColor );
}
}
@@ -3673,16 +3706,18 @@ void OutputDevice::ImplDrawWaveTextLine( long nBaseX, long nBaseY,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawStraightTextLine( long nBaseX, long nBaseY,
- long nX, long nY, long nWidth,
+ long nDistX, long nDistY, long nWidth,
FontUnderline eTextLine,
Color aColor,
- BOOL bIsAbove )
+ sal_Bool bIsAbove )
{
ImplFontEntry* pFontEntry = mpFontEntry;
long nLineHeight = 0;
long nLinePos = 0;
long nLinePos2 = 0;
+ const long nY = nDistY;
+
if ( eTextLine > UNDERLINE_LAST )
eTextLine = UNDERLINE_SINGLE;
@@ -3745,12 +3780,12 @@ void OutputDevice::ImplDrawStraightTextLine( long nBaseX, long nBaseY,
if ( mbLineColor || mbInitLineColor )
{
mpGraphics->SetLineColor();
- mbInitLineColor = TRUE;
+ mbInitLineColor = sal_True;
}
mpGraphics->SetFillColor( ImplColorToSal( aColor ) );
- mbInitFillColor = TRUE;
+ mbInitFillColor = sal_True;
- long nLeft = nX;
+ long nLeft = nDistX;
switch ( eTextLine )
{
@@ -3903,7 +3938,7 @@ void OutputDevice::ImplDrawStraightTextLine( long nBaseX, long nBaseY,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY,
- long nX, long nY, long nWidth,
+ long nDistX, long nDistY, long nWidth,
FontStrikeout eStrikeout,
Color aColor )
{
@@ -3912,6 +3947,8 @@ void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY,
long nLinePos = 0;
long nLinePos2 = 0;
+ long nY = nDistY;
+
if ( eStrikeout > STRIKEOUT_LAST )
eStrikeout = STRIKEOUT_SINGLE;
@@ -3939,12 +3976,12 @@ void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY,
if ( mbLineColor || mbInitLineColor )
{
mpGraphics->SetLineColor();
- mbInitLineColor = TRUE;
+ mbInitLineColor = sal_True;
}
mpGraphics->SetFillColor( ImplColorToSal( aColor ) );
- mbInitFillColor = TRUE;
+ mbInitFillColor = sal_True;
- long nLeft = nX;
+ const long& nLeft = nDistX;
switch ( eStrikeout )
{
@@ -3965,7 +4002,7 @@ void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
- long nX, long nY, long nWidth,
+ long nDistX, long nDistY, long nWidth,
FontStrikeout eStrikeout,
Color aColor )
{
@@ -3999,12 +4036,12 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
// calculate acceptable strikeout length
// allow the strikeout to be one pixel larger than the text it strikes out
- long nMaxWidth = nStrikeoutWidth / 2;
+ long nMaxWidth = nStrikeoutWidth * 3 / 4;
if ( nMaxWidth < 2 )
nMaxWidth = 2;
nMaxWidth += nWidth + 1;
- int nStrikeStrLen = (nMaxWidth + nStrikeoutWidth - 1) / nStrikeoutWidth;
+ int nStrikeStrLen = (nMaxWidth - 1) / nStrikeoutWidth;
// if the text width is smaller than the strikeout text, then do not
// strike out at all. This case requires user interaction, e.g. adding
// a space to the text
@@ -4019,10 +4056,12 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
const String aStrikeoutText( aChars, xub_StrLen(nStrikeStrLen) );
if( mpFontEntry->mnOrientation )
- ImplRotatePos( nBaseX, nBaseY, nX, nY, mpFontEntry->mnOrientation );
+ ImplRotatePos( 0, 0, nDistX, nDistY, mpFontEntry->mnOrientation );
+ nBaseX += nDistX;
+ nBaseY += nDistY;
// strikeout text has to be left aligned
- ULONG nOrigTLM = mnTextLayoutMode;
+ sal_uLong nOrigTLM = mnTextLayoutMode;
mnTextLayoutMode = TEXT_LAYOUT_BIDI_STRONG | TEXT_LAYOUT_COMPLEX_DISABLED;
pLayout = ImplLayout( aStrikeoutText, 0, STRING_LEN );
mnTextLayoutMode = nOrigTLM;
@@ -4035,7 +4074,7 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
SetTextColor( aColor );
ImplInitTextColor();
- pLayout->DrawBase() = Point( nX+mnTextOffX, nY+mnTextOffY );
+ pLayout->DrawBase() = Point( nBaseX+mnTextOffX, nBaseY+mnTextOffY );
pLayout->DrawText( *mpGraphics );
pLayout->Release();
@@ -4045,12 +4084,12 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
// -----------------------------------------------------------------------
-void OutputDevice::ImplDrawTextLine( long nBaseX,
- long nX, long nY, long nWidth,
+void OutputDevice::ImplDrawTextLine( long nX, long nY,
+ long nDistX, long nWidth,
FontStrikeout eStrikeout,
FontUnderline eUnderline,
FontUnderline eOverline,
- BOOL bUnderlineAbove )
+ sal_Bool bUnderlineAbove )
{
if ( !nWidth )
return;
@@ -4058,14 +4097,18 @@ void OutputDevice::ImplDrawTextLine( long nBaseX,
Color aStrikeoutColor = GetTextColor();
Color aUnderlineColor = GetTextLineColor();
Color aOverlineColor = GetOverlineColor();
- BOOL bStrikeoutDone = FALSE;
- BOOL bUnderlineDone = FALSE;
- BOOL bOverlineDone = FALSE;
+ sal_Bool bStrikeoutDone = sal_False;
+ sal_Bool bUnderlineDone = sal_False;
+ sal_Bool bOverlineDone = sal_False;
- // TODO: fix rotated text
if ( IsRTLEnabled() )
+ {
// --- RTL --- mirror at basex
- nX = nBaseX - nWidth - (nX - nBaseX - 1);
+ long nXAdd = nWidth - nDistX;
+ if( mpFontEntry->mnOrientation )
+ nXAdd = FRound( nXAdd * cos( mpFontEntry->mnOrientation * F_PI1800 ) );
+ nX += nXAdd - 1;
+ }
if ( !IsTextLineColor() )
aUnderlineColor = GetTextColor();
@@ -4078,70 +4121,85 @@ void OutputDevice::ImplDrawTextLine( long nBaseX,
(eUnderline == UNDERLINE_DOUBLEWAVE) ||
(eUnderline == UNDERLINE_BOLDWAVE) )
{
- ImplDrawWaveTextLine( nBaseX, nY, nX, nY, nWidth, eUnderline, aUnderlineColor, bUnderlineAbove );
- bUnderlineDone = TRUE;
+ ImplDrawWaveTextLine( nX, nY, nDistX, 0, nWidth, eUnderline, aUnderlineColor, bUnderlineAbove );
+ bUnderlineDone = sal_True;
}
if ( (eOverline == UNDERLINE_SMALLWAVE) ||
(eOverline == UNDERLINE_WAVE) ||
(eOverline == UNDERLINE_DOUBLEWAVE) ||
(eOverline == UNDERLINE_BOLDWAVE) )
{
- ImplDrawWaveTextLine( nBaseX, nY, nX, nY, nWidth, eOverline, aOverlineColor, TRUE );
- bOverlineDone = TRUE;
+ ImplDrawWaveTextLine( nX, nY, nDistX, 0, nWidth, eOverline, aOverlineColor, sal_True );
+ bOverlineDone = sal_True;
}
if ( (eStrikeout == STRIKEOUT_SLASH) ||
(eStrikeout == STRIKEOUT_X) )
{
- ImplDrawStrikeoutChar( nBaseX, nY, nX, nY, nWidth, eStrikeout, aStrikeoutColor );
- bStrikeoutDone = TRUE;
+ ImplDrawStrikeoutChar( nX, nY, nDistX, 0, nWidth, eStrikeout, aStrikeoutColor );
+ bStrikeoutDone = sal_True;
}
if ( !bUnderlineDone )
- ImplDrawStraightTextLine( nBaseX, nY, nX, nY, nWidth, eUnderline, aUnderlineColor, bUnderlineAbove );
+ ImplDrawStraightTextLine( nX, nY, nDistX, 0, nWidth, eUnderline, aUnderlineColor, bUnderlineAbove );
if ( !bOverlineDone )
- ImplDrawStraightTextLine( nBaseX, nY, nX, nY, nWidth, eOverline, aOverlineColor, TRUE );
+ ImplDrawStraightTextLine( nX, nY, nDistX, 0, nWidth, eOverline, aOverlineColor, sal_True );
if ( !bStrikeoutDone )
- ImplDrawStrikeoutLine( nBaseX, nY, nX, nY, nWidth, eStrikeout, aStrikeoutColor );
+ ImplDrawStrikeoutLine( nX, nY, nDistX, 0, nWidth, eStrikeout, aStrikeoutColor );
}
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawTextLines( SalLayout& rSalLayout,
- FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, BOOL bWordLine, BOOL bUnderlineAbove )
+ FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, sal_Bool bWordLine, sal_Bool bUnderlineAbove )
{
if( bWordLine )
{
- Point aPos, aStartPt;
- sal_Int32 nWidth = 0, nAdvance=0;
+ // draw everything relative to the layout base point
+ const Point aStartPt = rSalLayout.DrawBase();
+ // calculate distance of each word from the base point
+ Point aPos;
+ sal_Int32 nDist = 0, nWidth = 0, nAdvance=0;
for( int nStart = 0;;)
{
+ // iterate through the layouted glyphs
sal_GlyphId nGlyphIndex;
if( !rSalLayout.GetNextGlyphs( 1, &nGlyphIndex, aPos, nStart, &nAdvance ) )
break;
+ // calculate the boundaries of each word
if( !rSalLayout.IsSpacingGlyph( nGlyphIndex ) )
{
if( !nWidth )
{
- aStartPt = aPos;//rSalLayout.DrawBase() - (aPos - rSalLayout.DrawOffset());
+ // get the distance to the base point (as projected to baseline)
+ nDist = aPos.X() - aStartPt.X();
+ if( mpFontEntry->mnOrientation )
+ {
+ const long nDY = aPos.Y() - aStartPt.Y();
+ const double fRad = mpFontEntry->mnOrientation * F_PI1800;
+ nDist = FRound( nDist*cos(fRad) - nDY*sin(fRad) );
+ }
}
+ // update the length of the textline
nWidth += nAdvance;
}
else if( nWidth > 0 )
{
- ImplDrawTextLine( rSalLayout.DrawBase().X(), aStartPt.X(), aStartPt.Y(), nWidth,
+ // draw the textline for each word
+ ImplDrawTextLine( aStartPt.X(), aStartPt.Y(), nDist, nWidth,
eStrikeout, eUnderline, eOverline, bUnderlineAbove );
nWidth = 0;
}
}
+ // draw textline for the last word
if( nWidth > 0 )
{
- ImplDrawTextLine( rSalLayout.DrawBase().X(), aStartPt.X(), aStartPt.Y(), nWidth,
+ ImplDrawTextLine( aStartPt.X(), aStartPt.Y(), nDist, nWidth,
eStrikeout, eUnderline, eOverline, bUnderlineAbove );
}
}
@@ -4149,7 +4207,7 @@ void OutputDevice::ImplDrawTextLines( SalLayout& rSalLayout,
{
Point aStartPt = rSalLayout.GetDrawPosition();
int nWidth = rSalLayout.GetTextWidth() / rSalLayout.GetUnitsPerPixel();
- ImplDrawTextLine( rSalLayout.DrawBase().X(), aStartPt.X(), aStartPt.Y(), nWidth,
+ ImplDrawTextLine( aStartPt.X(), aStartPt.Y(), 0, nWidth,
eStrikeout, eUnderline, eOverline, bUnderlineAbove );
}
}
@@ -4168,18 +4226,18 @@ void OutputDevice::ImplDrawMnemonicLine( long nX, long nY, long nWidth )
nX = nBaseX - nWidth - (nX - nBaseX - 1);
}
- ImplDrawTextLine( nBaseX, nX, nY, nWidth, STRIKEOUT_NONE, UNDERLINE_SINGLE, UNDERLINE_NONE, FALSE );
+ ImplDrawTextLine( nX, nY, 0, nWidth, STRIKEOUT_NONE, UNDERLINE_SINGLE, UNDERLINE_NONE, sal_False );
}
// -----------------------------------------------------------------------
-void OutputDevice::ImplGetEmphasisMark( PolyPolygon& rPolyPoly, BOOL& rPolyLine,
+void OutputDevice::ImplGetEmphasisMark( PolyPolygon& rPolyPoly, sal_Bool& rPolyLine,
Rectangle& rRect1, Rectangle& rRect2,
long& rYOff, long& rWidth,
FontEmphasisMark eEmphasis,
long nHeight, short /*nOrient*/ )
{
- static const BYTE aAccentPolyFlags[24] =
+ static const sal_uInt8 aAccentPolyFlags[24] =
{
0, 2, 2, 0, 2, 2, 0, 2, 2, 0, 2, 2, 0, 2, 2, 0, 2, 2, 0, 0, 2, 0, 2, 2
};
@@ -4214,7 +4272,7 @@ void OutputDevice::ImplGetEmphasisMark( PolyPolygon& rPolyPoly, BOOL& rPolyLine,
rWidth = 0;
rYOff = 0;
- rPolyLine = FALSE;
+ rPolyLine = sal_False;
if ( !nHeight )
return;
@@ -4255,7 +4313,7 @@ void OutputDevice::ImplGetEmphasisMark( PolyPolygon& rPolyPoly, BOOL& rPolyLine,
// BorderWidth is 15%
long nBorder = (nDotSize*150)/1000;
if ( nBorder <= 1 )
- rPolyLine = TRUE;
+ rPolyLine = sal_True;
else
{
Polygon aPoly2( Point( nRad, nRad ),
@@ -4329,7 +4387,7 @@ void OutputDevice::ImplGetEmphasisMark( PolyPolygon& rPolyPoly, BOOL& rPolyLine,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawEmphasisMark( long nBaseX, long nX, long nY,
- const PolyPolygon& rPolyPoly, BOOL bPolyLine,
+ const PolyPolygon& rPolyPoly, sal_Bool bPolyLine,
const Rectangle& rRect1, const Rectangle& rRect2 )
{
// TODO: pass nWidth as width of this mark
@@ -4380,10 +4438,10 @@ void OutputDevice::ImplDrawEmphasisMarks( SalLayout& rSalLayout )
{
Color aOldLineColor = GetLineColor();
Color aOldFillColor = GetFillColor();
- BOOL bOldMap = mbMap;
+ sal_Bool bOldMap = mbMap;
GDIMetaFile* pOldMetaFile = mpMetaFile;
mpMetaFile = NULL;
- EnableMapMode( FALSE );
+ EnableMapMode( sal_False );
FontEmphasisMark nEmphasisMark = ImplGetEmphasisMarkStyle( maFont );
PolyPolygon aPolyPoly;
@@ -4392,7 +4450,7 @@ void OutputDevice::ImplDrawEmphasisMarks( SalLayout& rSalLayout )
long nEmphasisYOff;
long nEmphasisWidth;
long nEmphasisHeight;
- BOOL bPolyLine;
+ sal_Bool bPolyLine;
if ( nEmphasisMark & EMPHASISMARK_POS_BELOW )
nEmphasisHeight = mnEmphasisDescent;
@@ -4516,12 +4574,12 @@ bool OutputDevice::ImplDrawRotateText( SalLayout& rSalLayout )
GDIMetaFile* pOldMetaFile = mpMetaFile;
long nOldOffX = mnOutOffX;
long nOldOffY = mnOutOffY;
- BOOL bOldMap = mbMap;
+ sal_Bool bOldMap = mbMap;
mnOutOffX = 0L;
mnOutOffY = 0L;
mpMetaFile = NULL;
- EnableMapMode( FALSE );
+ EnableMapMode( sal_False );
DrawMask( aPoint, aBmp, GetTextColor() );
@@ -4535,7 +4593,7 @@ bool OutputDevice::ImplDrawRotateText( SalLayout& rSalLayout )
// -----------------------------------------------------------------------
-void OutputDevice::ImplDrawTextDirect( SalLayout& rSalLayout, BOOL bTextLines )
+void OutputDevice::ImplDrawTextDirect( SalLayout& rSalLayout, sal_Bool bTextLines )
{
if( mpFontEntry->mnOwnOrientation )
if( ImplDrawRotateText( rSalLayout ) )
@@ -4729,7 +4787,7 @@ void OutputDevice::ImplDrawText( SalLayout& rSalLayout )
long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
long nWidth, const XubString& rStr,
- USHORT nStyle, const ::vcl::ITextLayout& _rLayout )
+ sal_uInt16 nStyle, const ::vcl::ITextLayout& _rLayout )
{
DBG_ASSERTWARNING( nWidth >= 0, "ImplGetTextLines: nWidth <= 0!" );
@@ -4798,10 +4856,10 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
// sal_uInt16 nWordStart = nBreakPos;
// sal_uInt16 nBreakPos_OLD = nBreakPos;
sal_uInt16 nWordStart = nPos;
- sal_uInt16 nWordEnd = (USHORT) aBoundary.endPos;
+ sal_uInt16 nWordEnd = (sal_uInt16) aBoundary.endPos;
DBG_ASSERT( nWordEnd > nWordStart, "ImpBreakLine: Start >= End?" );
- USHORT nWordLen = nWordEnd - nWordStart;
+ sal_uInt16 nWordLen = nWordEnd - nWordStart;
if ( ( nWordEnd >= nSoftBreak ) && ( nWordLen > 3 ) )
{
// #104415# May happen, because getLineBreak may differ from getWordBoudary with DICTIONARY_WORD
@@ -4882,7 +4940,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
else
{
// fallback to something really simple
- USHORT nSpacePos = STRING_LEN;
+ sal_uInt16 nSpacePos = STRING_LEN;
long nW = 0;
do
{
@@ -4924,7 +4982,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
}
}
#ifdef DBG_UTIL
- for ( USHORT nL = 0; nL < rLineInfo.Count(); nL++ )
+ for ( sal_uInt16 nL = 0; nL < rLineInfo.Count(); nL++ )
{
ImplTextLineInfo* pLine = rLineInfo.GetLine( nL );
String aLine( rStr, pLine->GetIndex(), pLine->GetLen() );
@@ -4938,12 +4996,12 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
// =======================================================================
-void OutputDevice::SetAntialiasing( USHORT nMode )
+void OutputDevice::SetAntialiasing( sal_uInt16 nMode )
{
if ( mnAntialiasing != nMode )
{
mnAntialiasing = nMode;
- mbInitFont = TRUE;
+ mbInitFont = sal_True;
if(mpGraphics)
{
@@ -4977,7 +5035,7 @@ void OutputDevice::SetFont( const Font& rNewFont )
aTextColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYTEXT )
{
- const UINT8 cLum = aTextColor.GetLuminance();
+ const sal_uInt8 cLum = aTextColor.GetLuminance();
aTextColor = Color( cLum, cLum, cLum );
}
else if ( mnDrawMode & DRAWMODE_SETTINGSTEXT )
@@ -4992,7 +5050,7 @@ void OutputDevice::SetFont( const Font& rNewFont )
aFont.SetColor( aTextColor );
- BOOL bTransFill = aFont.IsTransparent();
+ sal_Bool bTransFill = aFont.IsTransparent();
if ( !bTransFill )
{
Color aTextFillColor( aFont.GetFillColor() );
@@ -5003,7 +5061,7 @@ void OutputDevice::SetFont( const Font& rNewFont )
aTextFillColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYFILL )
{
- const UINT8 cLum = aTextFillColor.GetLuminance();
+ const sal_uInt8 cLum = aTextFillColor.GetLuminance();
aTextFillColor = Color( cLum, cLum, cLum );
}
else if( mnDrawMode & DRAWMODE_SETTINGSFILL )
@@ -5011,7 +5069,7 @@ void OutputDevice::SetFont( const Font& rNewFont )
else if ( mnDrawMode & DRAWMODE_NOFILL )
{
aTextFillColor = Color( COL_TRANSPARENT );
- bTransFill = TRUE;
+ bTransFill = sal_True;
}
if ( !bTransFill && (mnDrawMode & DRAWMODE_GHOSTEDFILL) )
@@ -5043,12 +5101,12 @@ void OutputDevice::SetFont( const Font& rNewFont )
&& (aFont.GetColor() != maFont.GetColor() || aFont.GetColor() != maTextColor ) )
{
maTextColor = aFont.GetColor();
- mbInitTextColor = TRUE;
+ mbInitTextColor = sal_True;
if( mpMetaFile )
mpMetaFile->AddAction( new MetaTextColorAction( aFont.GetColor() ) );
}
maFont = aFont;
- mbNewFont = TRUE;
+ mbNewFont = sal_True;
if( mpAlphaVDev )
{
@@ -5069,7 +5127,7 @@ void OutputDevice::SetFont( const Font& rNewFont )
// -----------------------------------------------------------------------
-void OutputDevice::SetLayoutMode( ULONG nTextLayoutMode )
+void OutputDevice::SetLayoutMode( sal_uLong nTextLayoutMode )
{
OSL_TRACE( "OutputDevice::SetTextLayoutMode()" );
@@ -5116,7 +5174,7 @@ void OutputDevice::SetTextColor( const Color& rColor )
aColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYTEXT )
{
- const UINT8 cLum = aColor.GetLuminance();
+ const sal_uInt8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if ( mnDrawMode & DRAWMODE_SETTINGSTEXT )
@@ -5136,7 +5194,7 @@ void OutputDevice::SetTextColor( const Color& rColor )
if ( maTextColor != aColor )
{
maTextColor = aColor;
- mbInitTextColor = TRUE;
+ mbInitTextColor = sal_True;
}
if( mpAlphaVDev )
@@ -5151,12 +5209,12 @@ void OutputDevice::SetTextFillColor()
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaTextFillColorAction( Color(), FALSE ) );
+ mpMetaFile->AddAction( new MetaTextFillColorAction( Color(), sal_False ) );
if ( maFont.GetColor() != Color( COL_TRANSPARENT ) )
maFont.SetFillColor( Color( COL_TRANSPARENT ) );
if ( !maFont.IsTransparent() )
- maFont.SetTransparent( TRUE );
+ maFont.SetTransparent( sal_True );
if( mpAlphaVDev )
mpAlphaVDev->SetTextFillColor();
@@ -5170,7 +5228,7 @@ void OutputDevice::SetTextFillColor( const Color& rColor )
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
Color aColor( rColor );
- BOOL bTransFill = ImplIsColorTransparent( aColor ) ? TRUE : FALSE;
+ sal_Bool bTransFill = ImplIsColorTransparent( aColor ) ? sal_True : sal_False;
if ( !bTransFill )
{
@@ -5184,7 +5242,7 @@ void OutputDevice::SetTextFillColor( const Color& rColor )
aColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYFILL )
{
- const UINT8 cLum = aColor.GetLuminance();
+ const sal_uInt8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if( mnDrawMode & DRAWMODE_SETTINGSFILL )
@@ -5192,7 +5250,7 @@ void OutputDevice::SetTextFillColor( const Color& rColor )
else if ( mnDrawMode & DRAWMODE_NOFILL )
{
aColor = Color( COL_TRANSPARENT );
- bTransFill = TRUE;
+ bTransFill = sal_True;
}
if ( !bTransFill && (mnDrawMode & DRAWMODE_GHOSTEDFILL) )
@@ -5205,7 +5263,7 @@ void OutputDevice::SetTextFillColor( const Color& rColor )
}
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaTextFillColorAction( aColor, TRUE ) );
+ mpMetaFile->AddAction( new MetaTextFillColorAction( aColor, sal_True ) );
if ( maFont.GetFillColor() != aColor )
maFont.SetFillColor( aColor );
@@ -5234,7 +5292,7 @@ void OutputDevice::SetTextLineColor()
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaTextLineColorAction( Color(), FALSE ) );
+ mpMetaFile->AddAction( new MetaTextLineColorAction( Color(), sal_False ) );
maTextLineColor = Color( COL_TRANSPARENT );
@@ -5261,7 +5319,7 @@ void OutputDevice::SetTextLineColor( const Color& rColor )
aColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYTEXT )
{
- const UINT8 cLum = aColor.GetLuminance();
+ const sal_uInt8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if ( mnDrawMode & DRAWMODE_SETTINGSTEXT )
@@ -5277,7 +5335,7 @@ void OutputDevice::SetTextLineColor( const Color& rColor )
}
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaTextLineColorAction( aColor, TRUE ) );
+ mpMetaFile->AddAction( new MetaTextLineColorAction( aColor, sal_True ) );
maTextLineColor = aColor;
@@ -5293,7 +5351,7 @@ void OutputDevice::SetOverlineColor()
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaOverlineColorAction( Color(), FALSE ) );
+ mpMetaFile->AddAction( new MetaOverlineColorAction( Color(), sal_False ) );
maOverlineColor = Color( COL_TRANSPARENT );
@@ -5320,7 +5378,7 @@ void OutputDevice::SetOverlineColor( const Color& rColor )
aColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYTEXT )
{
- const UINT8 cLum = aColor.GetLuminance();
+ const sal_uInt8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if ( mnDrawMode & DRAWMODE_SETTINGSTEXT )
@@ -5336,7 +5394,7 @@ void OutputDevice::SetOverlineColor( const Color& rColor )
}
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaOverlineColorAction( aColor, TRUE ) );
+ mpMetaFile->AddAction( new MetaOverlineColorAction( aColor, sal_True ) );
maOverlineColor = aColor;
@@ -5358,7 +5416,7 @@ void OutputDevice::SetTextAlign( TextAlign eAlign )
if ( maFont.GetAlign() != eAlign )
{
maFont.SetAlign( eAlign );
- mbNewFont = TRUE;
+ mbNewFont = sal_True;
}
if( mpAlphaVDev )
@@ -5371,7 +5429,7 @@ void OutputDevice::DrawTextLine( const Point& rPos, long nWidth,
FontStrikeout eStrikeout,
FontUnderline eUnderline,
FontUnderline eOverline,
- BOOL bUnderlineAbove )
+ sal_Bool bUnderlineAbove )
{
OSL_TRACE( "OutputDevice::DrawTextLine()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -5406,7 +5464,7 @@ void OutputDevice::DrawTextLine( const Point& rPos, long nWidth,
Point aPos = ImplLogicToDevicePixel( rPos );
nWidth = ImplLogicWidthToDevicePixel( nWidth );
aPos += Point( mnTextOffX, mnTextOffY );
- ImplDrawTextLine( aPos.X(), aPos.X(), aPos.Y(), nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
+ ImplDrawTextLine( aPos.X(), aPos.X(), 0, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
if( mpAlphaVDev )
mpAlphaVDev->DrawTextLine( rPos, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
@@ -5414,7 +5472,7 @@ void OutputDevice::DrawTextLine( const Point& rPos, long nWidth,
// ------------------------------------------------------------------------
-BOOL OutputDevice::IsTextUnderlineAbove( const Font& rFont )
+sal_Bool OutputDevice::IsTextUnderlineAbove( const Font& rFont )
{
return ImplIsUnderlineAbove( rFont );
}
@@ -5422,7 +5480,7 @@ BOOL OutputDevice::IsTextUnderlineAbove( const Font& rFont )
// ------------------------------------------------------------------------
void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos,
- USHORT nStyle )
+ sal_uInt16 nStyle )
{
OSL_TRACE( "OutputDevice::DrawWaveLine()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -5483,7 +5541,7 @@ void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos,
if( nWaveHeight > pFontEntry->maMetric.mnWUnderlineSize )
nWaveHeight = pFontEntry->maMetric.mnWUnderlineSize;
- ImplDrawWaveLine( nStartX, nStartY, nStartX, nStartY,
+ ImplDrawWaveLine( nStartX, nStartY, 0, 0,
nEndX-nStartX, nWaveHeight, 1,
nOrientation, GetLineColor() );
if( mpAlphaVDev )
@@ -5650,7 +5708,7 @@ long OutputDevice::GetTextArray( const String& rStr, sal_Int32* pDXAry,
if( nIndex >= rStr.Len() )
return 0;
- if( (ULONG)nIndex+nLen >= rStr.Len() )
+ if( (sal_uLong)nIndex+nLen >= rStr.Len() )
nLen = rStr.Len() - nIndex;
// do layout
@@ -5692,14 +5750,14 @@ long OutputDevice::GetTextArray( const String& rStr, sal_Int32* pDXAry,
bool OutputDevice::GetCaretPositions( const XubString& rStr, sal_Int32* pCaretXArray,
xub_StrLen nIndex, xub_StrLen nLen,
sal_Int32* pDXAry, long nLayoutWidth,
- BOOL bCellBreaking ) const
+ sal_Bool bCellBreaking ) const
{
OSL_TRACE( "OutputDevice::GetCaretPositions()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if( nIndex >= rStr.Len() )
return false;
- if( (ULONG)nIndex+nLen >= rStr.Len() )
+ if( (sal_uLong)nIndex+nLen >= rStr.Len() )
nLen = rStr.Len() - nIndex;
// layout complex text
@@ -5758,7 +5816,7 @@ bool OutputDevice::GetCaretPositions( const XubString& rStr, sal_Int32* pCaretXA
// -----------------------------------------------------------------------
-void OutputDevice::DrawStretchText( const Point& rStartPt, ULONG nWidth,
+void OutputDevice::DrawStretchText( const Point& rStartPt, sal_uLong nWidth,
const String& rStr,
xub_StrLen nIndex, xub_StrLen nLen )
{
@@ -5790,7 +5848,7 @@ ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( String& rStr,
{
// get string length for calculating extents
xub_StrLen nEndIndex = rStr.Len();
- if( (ULONG)nMinIndex + nLen < nEndIndex )
+ if( (sal_uLong)nMinIndex + nLen < nEndIndex )
nEndIndex = nMinIndex + nLen;
// don't bother if there is nothing to do
@@ -5859,7 +5917,7 @@ ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( String& rStr,
sal_UCS4 cChar = GetLocalizedChar( *pStr, meTextLanguage );
if( cChar != *pStr )
// TODO: are the localized digit surrogates?
- rStr.SetChar( static_cast<USHORT>(pStr - pBase),
+ rStr.SetChar( static_cast<sal_uInt16>(pStr - pBase),
static_cast<sal_Unicode>(cChar) );
}
}
@@ -6088,8 +6146,9 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay
ImplFontSelectData aFontSelData = mpFontEntry->maFontSelData;
- ImplFontMetricData aOrigMetric(aFontSelData);
- mpGraphics->GetFontMetric(&aOrigMetric);
+ ImplFontMetricData aOrigMetric( aFontSelData );
+ // TODO: use cached metric in fontentry
+ mpGraphics->GetFontMetric( &aOrigMetric );
// when device specific font substitution may have been performed for
// the originally selected font then make sure that a fallback to that
@@ -6169,7 +6228,7 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay
// -----------------------------------------------------------------------
-BOOL OutputDevice::GetTextIsRTL(
+sal_Bool OutputDevice::GetTextIsRTL(
const String& rString,
xub_StrLen nIndex, xub_StrLen nLen ) const
{
@@ -6178,14 +6237,14 @@ BOOL OutputDevice::GetTextIsRTL(
bool bRTL = false;
int nCharPos = -1;
aArgs.GetNextPos( &nCharPos, &bRTL );
- return (nCharPos != nIndex) ? TRUE : FALSE;
+ return (nCharPos != nIndex) ? sal_True : sal_False;
}
// -----------------------------------------------------------------------
xub_StrLen OutputDevice::GetTextBreak( const String& rStr, long nTextWidth,
xub_StrLen nIndex, xub_StrLen nLen,
- long nCharExtra, BOOL /*TODO: bCellBreaking*/ ) const
+ long nCharExtra, sal_Bool /*TODO: bCellBreaking*/ ) const
{
OSL_TRACE( "OutputDevice::GetTextBreak()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -6279,17 +6338,17 @@ xub_StrLen OutputDevice::GetTextBreak( const String& rStr, long nTextWidth,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& rRect,
- const String& rOrigStr, USHORT nStyle,
+ const String& rOrigStr, sal_uInt16 nStyle,
MetricVector* pVector, String* pDisplayText,
::vcl::ITextLayout& _rLayout )
{
Color aOldTextColor;
Color aOldTextFillColor;
- BOOL bRestoreFillColor = false;
+ sal_Bool bRestoreFillColor = false;
if ( (nStyle & TEXT_DRAW_DISABLE) && ! pVector )
{
- BOOL bHighContrastBlack = FALSE;
- BOOL bHighContrastWhite = FALSE;
+ sal_Bool bHighContrastBlack = sal_False;
+ sal_Bool bHighContrastWhite = sal_False;
const StyleSettings& rStyleSettings( rTargetDevice.GetSettings().GetStyleSettings() );
if( rStyleSettings.GetHighContrastMode() )
{
@@ -6309,7 +6368,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
aOldTextColor = rTargetDevice.GetTextColor();
if ( rTargetDevice.IsTextFillColor() )
{
- bRestoreFillColor = TRUE;
+ bRestoreFillColor = sal_True;
aOldTextFillColor = rTargetDevice.GetTextFillColor();
}
if( bHighContrastBlack )
@@ -6438,7 +6497,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
long nMnemonicWidth;
sal_Int32* pCaretXArray = (sal_Int32*) alloca( 2 * sizeof(sal_Int32) * nLineLen );
- /*BOOL bRet =*/ _rLayout.GetCaretPositions( aStr, pCaretXArray,
+ /*sal_Bool bRet =*/ _rLayout.GetCaretPositions( aStr, pCaretXArray,
nIndex, nLineLen );
long lc_x1 = pCaretXArray[2*(nMnemonicPos - nIndex)];
long lc_x2 = pCaretXArray[2*(nMnemonicPos - nIndex)+1];
@@ -6509,7 +6568,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
if ( nMnemonicPos != STRING_NOTFOUND )
{
sal_Int32* pCaretXArray = (sal_Int32*) alloca( 2 * sizeof(sal_Int32) * aStr.Len() );
- /*BOOL bRet =*/ _rLayout.GetCaretPositions( aStr, pCaretXArray, 0, aStr.Len() );
+ /*sal_Bool bRet =*/ _rLayout.GetCaretPositions( aStr, pCaretXArray, 0, aStr.Len() );
long lc_x1 = pCaretXArray[2*(nMnemonicPos)];
long lc_x2 = pCaretXArray[2*(nMnemonicPos)+1];
nMnemonicWidth = rTargetDevice.ImplLogicWidthToDevicePixel( ::abs((int)(lc_x1 - lc_x2)) );
@@ -6554,7 +6613,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
void OutputDevice::AddTextRectActions( const Rectangle& rRect,
const String& rOrigStr,
- USHORT nStyle,
+ sal_uInt16 nStyle,
GDIMetaFile& rMtf )
{
OSL_TRACE( "OutputDevice::AddTextRectActions( const Rectangle& )" );
@@ -6571,11 +6630,11 @@ void OutputDevice::AddTextRectActions( const Rectangle& rRect,
// temporarily swap in passed mtf for action generation, and
// disable output generation.
- const BOOL bOutputEnabled( IsOutputEnabled() );
+ const sal_Bool bOutputEnabled( IsOutputEnabled() );
GDIMetaFile* pMtf = mpMetaFile;
mpMetaFile = &rMtf;
- EnableOutput( FALSE );
+ EnableOutput( sal_False );
// #i47157# Factored out to ImplDrawTextRect(), to be shared
// between us and DrawText()
@@ -6589,7 +6648,7 @@ void OutputDevice::AddTextRectActions( const Rectangle& rRect,
// -----------------------------------------------------------------------
-void OutputDevice::DrawText( const Rectangle& rRect, const String& rOrigStr, USHORT nStyle,
+void OutputDevice::DrawText( const Rectangle& rRect, const String& rOrigStr, sal_uInt16 nStyle,
MetricVector* pVector, String* pDisplayText,
::vcl::ITextLayout* _pTextLayout )
{
@@ -6638,7 +6697,7 @@ void OutputDevice::DrawText( const Rectangle& rRect, const String& rOrigStr, USH
// -----------------------------------------------------------------------
Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
- const XubString& rStr, USHORT nStyle,
+ const XubString& rStr, sal_uInt16 nStyle,
TextRectInfo* pInfo,
const ::vcl::ITextLayout* _pTextLayout ) const
{
@@ -6668,7 +6727,7 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
nFormatLines = aMultiLineInfo.Count();
if ( !nTextHeight )
nTextHeight = 1;
- nLines = (USHORT)(aRect.GetHeight()/nTextHeight);
+ nLines = (sal_uInt16)(aRect.GetHeight()/nTextHeight);
if ( pInfo )
pInfo->mnLineCount = nFormatLines;
if ( !nLines )
@@ -6682,13 +6741,13 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
else
{
if ( pInfo )
- pInfo->mbEllipsis = TRUE;
+ pInfo->mbEllipsis = sal_True;
nMaxWidth = nWidth;
}
}
if ( pInfo )
{
- BOOL bMaxWidth = nMaxWidth == 0;
+ sal_Bool bMaxWidth = nMaxWidth == 0;
pInfo->mnMaxWidth = 0;
for ( i = 0; i < nLines; i++ )
{
@@ -6723,7 +6782,7 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
if ( (nMaxWidth > nWidth) && (nStyle & TEXT_DRAW_ELLIPSIS) )
{
if ( pInfo )
- pInfo->mbEllipsis = TRUE;
+ pInfo->mbEllipsis = sal_True;
nMaxWidth = nWidth;
}
}
@@ -6754,22 +6813,22 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
// -----------------------------------------------------------------------
-static BOOL ImplIsCharIn( xub_Unicode c, const sal_Char* pStr )
+static sal_Bool ImplIsCharIn( xub_Unicode c, const sal_Char* pStr )
{
while ( *pStr )
{
if ( *pStr == c )
- return TRUE;
+ return sal_True;
pStr++;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
String OutputDevice::GetEllipsisString( const String& rOrigStr, long nMaxWidth,
- USHORT nStyle ) const
+ sal_uInt16 nStyle ) const
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
DefaultTextLayout aTextLayout( *const_cast< OutputDevice* >( this ) );
@@ -6779,7 +6838,7 @@ String OutputDevice::GetEllipsisString( const String& rOrigStr, long nMaxWidth,
// -----------------------------------------------------------------------
String OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice, const XubString& rOrigStr, long nMaxWidth,
- USHORT nStyle, const ::vcl::ITextLayout& _rLayout )
+ sal_uInt16 nStyle, const ::vcl::ITextLayout& _rLayout )
{
OSL_TRACE( "OutputDevice::ImplGetEllipsisString()" );
@@ -6789,7 +6848,20 @@ String OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice, c
if ( nIndex != STRING_LEN )
{
- if ( nStyle & TEXT_DRAW_ENDELLIPSIS )
+ if( (nStyle & TEXT_DRAW_CENTERELLIPSIS) == TEXT_DRAW_CENTERELLIPSIS )
+ {
+ String aTmpStr( aStr );
+ xub_StrLen nEraseChars = 4;
+ while( nEraseChars < aStr.Len() && _rLayout.GetTextWidth( aTmpStr, 0, aTmpStr.Len() ) > nMaxWidth )
+ {
+ aTmpStr = aStr;
+ xub_StrLen i = (aTmpStr.Len() - nEraseChars)/2;
+ aTmpStr.Erase( i, nEraseChars++ );
+ aTmpStr.InsertAscii( "...", i );
+ }
+ aStr = aTmpStr;
+ }
+ else if ( nStyle & TEXT_DRAW_ENDELLIPSIS )
{
aStr.Erase( nIndex );
if ( nIndex > 1 )
@@ -6835,7 +6907,7 @@ String OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice, c
aStr = OutputDevice::ImplGetEllipsisString( rTargetDevice, aStr, nMaxWidth, nStyle | TEXT_DRAW_ENDELLIPSIS, _rLayout );
else
{
- USHORT nFirstContent = 0;
+ sal_uInt16 nFirstContent = 0;
while ( nFirstContent < nLastContent )
{
nFirstContent++;
@@ -6899,7 +6971,7 @@ String OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice, c
void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
xub_StrLen nIndex, xub_StrLen nLen,
- USHORT nStyle, MetricVector* pVector, String* pDisplayText )
+ sal_uInt16 nStyle, MetricVector* pVector, String* pDisplayText )
{
OSL_TRACE( "OutputDevice::DrawCtrlText()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -6918,7 +6990,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
if( nIndex >= rStr.Len() )
return;
- if( (ULONG)nIndex+nLen >= rStr.Len() )
+ if( (sal_uLong)nIndex+nLen >= rStr.Len() )
nLen = rStr.Len() - nIndex;
XubString aStr = rStr;
@@ -6940,7 +7012,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
--nLen;
DBG_ASSERT( nMnemonicPos < (nIndex+nLen), "Mnemonic underline marker after last character" );
}
- BOOL bInvalidPos = FALSE;
+ sal_Bool bInvalidPos = sal_False;
if( nMnemonicPos >= nLen )
{
@@ -6948,12 +7020,12 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
// may occur in BiDi-Strings: the '~' is sometimes found behind the last char
// due to some strange BiDi text editors
// ->place the underline behind the string to indicate a failure
- bInvalidPos = TRUE;
+ bInvalidPos = sal_True;
nMnemonicPos = nLen-1;
}
sal_Int32* pCaretXArray = (sal_Int32*)alloca( 2 * sizeof(sal_Int32) * nLen );
- /*BOOL bRet =*/ GetCaretPositions( aStr, pCaretXArray, nIndex, nLen );
+ /*sal_Bool bRet =*/ GetCaretPositions( aStr, pCaretXArray, nIndex, nLen );
long lc_x1 = pCaretXArray[ 2*(nMnemonicPos - nIndex) ];
long lc_x2 = pCaretXArray[ 2*(nMnemonicPos - nIndex)+1 ];
nMnemonicWidth = ::abs((int)(lc_x1 - lc_x2));
@@ -6973,9 +7045,9 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
{
Color aOldTextColor;
Color aOldTextFillColor;
- BOOL bRestoreFillColor;
- BOOL bHighContrastBlack = FALSE;
- BOOL bHighContrastWhite = FALSE;
+ sal_Bool bRestoreFillColor;
+ sal_Bool bHighContrastBlack = sal_False;
+ sal_Bool bHighContrastWhite = sal_False;
const StyleSettings& rStyleSettings( GetSettings().GetStyleSettings() );
if( rStyleSettings.GetHighContrastMode() )
{
@@ -6991,11 +7063,11 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
aOldTextColor = GetTextColor();
if ( IsTextFillColor() )
{
- bRestoreFillColor = TRUE;
+ bRestoreFillColor = sal_True;
aOldTextFillColor = GetTextFillColor();
}
else
- bRestoreFillColor = FALSE;
+ bRestoreFillColor = sal_False;
if( bHighContrastBlack )
SetTextColor( COL_GREEN );
@@ -7032,7 +7104,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
long OutputDevice::GetCtrlTextWidth( const String& rStr,
xub_StrLen nIndex, xub_StrLen nLen,
- USHORT nStyle ) const
+ sal_uInt16 nStyle ) const
{
OSL_TRACE( "OutputDevice::GetCtrlTextSize()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -7046,7 +7118,7 @@ long OutputDevice::GetCtrlTextWidth( const String& rStr,
if ( nMnemonicPos < nIndex )
nIndex--;
else if ( (nLen < STRING_LEN) &&
- (nMnemonicPos >= nIndex) && (nMnemonicPos < (ULONG)(nIndex+nLen)) )
+ (nMnemonicPos >= nIndex) && (nMnemonicPos < (sal_uLong)(nIndex+nLen)) )
nLen--;
}
return GetTextWidth( aStr, nIndex, nLen );
@@ -7135,7 +7207,7 @@ FontInfo OutputDevice::GetDevFont( int nDevFontIndex ) const
// -----------------------------------------------------------------------
-BOOL OutputDevice::AddTempDevFont( const String& rFileURL, const String& rFontName )
+sal_Bool OutputDevice::AddTempDevFont( const String& rFileURL, const String& rFontName )
{
OSL_TRACE( "OutputDevice::AddTempDevFont()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -7143,17 +7215,17 @@ BOOL OutputDevice::AddTempDevFont( const String& rFileURL, const String& rFontNa
ImplInitFontList();
if( !mpGraphics && !ImplGetGraphics() )
- return FALSE;
+ return sal_False;
bool bRC = mpGraphics->AddTempDevFont( mpFontList, rFileURL, rFontName );
if( !bRC )
- return FALSE;
+ return sal_False;
if( mpAlphaVDev )
mpAlphaVDev->AddTempDevFont( rFileURL, rFontName );
mpFontCache->Invalidate();
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -7207,7 +7279,7 @@ Size OutputDevice::GetDevFontSize( const Font& rFont, int nSizeIndex ) const
// -----------------------------------------------------------------------
-BOOL OutputDevice::IsFontAvailable( const String& rFontName ) const
+sal_Bool OutputDevice::IsFontAvailable( const String& rFontName ) const
{
OSL_TRACE( "OutputDevice::IsFontAvailable()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -7427,7 +7499,7 @@ xub_StrLen OutputDevice::ValidateKashidas ( const String& rTxt,
// TODO: best is to get rid of this method completely
-ULONG OutputDevice::GetKerningPairCount() const
+sal_uLong OutputDevice::GetKerningPairCount() const
{
OSL_TRACE( "OutputDevice::GetKerningPairCount()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -7453,7 +7525,7 @@ inline bool CmpKernData( const KerningPair& a, const KerningPair& b )
}
// TODO: best is to get rid of this method completely
-void OutputDevice::GetKerningPairs( ULONG nRequestedPairs, KerningPair* pKernPairs ) const
+void OutputDevice::GetKerningPairs( sal_uLong nRequestedPairs, KerningPair* pKernPairs ) const
{
OSL_TRACE( "OutputDevice::GetKerningPairs()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -7475,7 +7547,7 @@ void OutputDevice::GetKerningPairs( ULONG nRequestedPairs, KerningPair* pKernPai
// -----------------------------------------------------------------------
-BOOL OutputDevice::GetGlyphBoundRects( const Point& rOrigin, const String& rStr,
+sal_Bool OutputDevice::GetGlyphBoundRects( const Point& rOrigin, const String& rStr,
int nIndex, int nLen, int nBase, MetricVector& rVector )
{
OSL_TRACE( "OutputDevice::GetGlyphBoundRect_CTL()" );
@@ -7500,14 +7572,14 @@ BOOL OutputDevice::GetGlyphBoundRects( const Point& rOrigin, const String& rStr,
// -----------------------------------------------------------------------
-BOOL OutputDevice::GetTextBoundRect( Rectangle& rRect,
+sal_Bool OutputDevice::GetTextBoundRect( Rectangle& rRect,
const String& rStr, xub_StrLen nBase, xub_StrLen nIndex, xub_StrLen nLen,
- ULONG nLayoutWidth, const sal_Int32* pDXAry ) const
+ sal_uLong nLayoutWidth, const sal_Int32* pDXAry ) const
{
OSL_TRACE( "OutputDevice::GetTextBoundRect()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
rRect.SetEmpty();
SalLayout* pSalLayout = NULL;
@@ -7571,8 +7643,8 @@ BOOL OutputDevice::GetTextBoundRect( Rectangle& rRect,
// so we need a monochrome virtual device with matching font
VirtualDevice aVDev( 1 );
Font aFont( GetFont() );
- aFont.SetShadow( FALSE );
- aFont.SetOutline( FALSE );
+ aFont.SetShadow( sal_False );
+ aFont.SetOutline( sal_False );
aFont.SetRelief( RELIEF_NONE );
aFont.SetOrientation( 0 );
aFont.SetSize( Size( mpFontEntry->maFontSelData.mnWidth, mpFontEntry->maFontSelData.mnHeight ) );
@@ -7605,7 +7677,7 @@ BOOL OutputDevice::GetTextBoundRect( Rectangle& rRect,
Bitmap aBmp = aVDev.GetBitmap( Point(), aOutSize );
BitmapReadAccess* pAcc = aBmp.AcquireReadAccess();
if( !pAcc )
- return FALSE;
+ return sal_False;
const BitmapColor aBlack( pAcc->GetBestMatchingColor( Color( COL_BLACK ) ) );
const long nW = pAcc->Width();
const long nH = pAcc->Height();
@@ -7670,17 +7742,17 @@ BOOL OutputDevice::GetTextBoundRect( Rectangle& rRect,
aTopLeft.X() = ImplDevicePixelToLogicWidth( aTopLeft.X() );
aTopLeft.Y() = ImplDevicePixelToLogicHeight( aTopLeft.Y() );
rRect = Rectangle( aTopLeft, aSize );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector,
+sal_Bool OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector,
const String& rStr, xub_StrLen nBase, xub_StrLen nIndex, xub_StrLen nLen,
- BOOL bOptimize, ULONG nTWidth, const sal_Int32* pDXArray ) const
+ sal_Bool bOptimize, sal_uLong nTWidth, const sal_Int32* pDXArray ) const
{
// the fonts need to be initialized
if( mbNewFont )
@@ -7688,9 +7760,9 @@ BOOL OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector,
if( mbInitFont )
ImplInitFont();
if( !mpFontEntry )
- return FALSE;
+ return sal_False;
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
rVector.clear();
if( nLen == STRING_LEN )
nLen = rStr.Len() - nIndex;
@@ -7698,11 +7770,11 @@ BOOL OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector,
// we want to get the Rectangle in logical units, so to
// avoid rounding errors we just size the font in logical units
- BOOL bOldMap = mbMap;
+ sal_Bool bOldMap = mbMap;
if( bOldMap )
{
- const_cast<OutputDevice&>(*this).mbMap = FALSE;
- const_cast<OutputDevice&>(*this).mbNewFont = TRUE;
+ const_cast<OutputDevice&>(*this).mbMap = sal_False;
+ const_cast<OutputDevice&>(*this).mbNewFont = sal_True;
}
SalLayout* pSalLayout = NULL;
@@ -7762,7 +7834,7 @@ BOOL OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector,
{
// restore original font size and map mode
const_cast<OutputDevice&>(*this).mbMap = bOldMap;
- const_cast<OutputDevice&>(*this).mbNewFont = TRUE;
+ const_cast<OutputDevice&>(*this).mbNewFont = sal_True;
}
if( bRet || (OUTDEV_PRINTER == meOutDevType) || !mpFontEntry )
@@ -7809,7 +7881,7 @@ BOOL OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector,
pSalLayout->Release();
if( !nWidth || !nHeight )
- return TRUE;
+ return sal_True;
double fScaleX = static_cast< double >(nOrgWidth) / nWidth;
double fScaleY = static_cast< double >(nOrgHeight) / nHeight;
@@ -7866,10 +7938,10 @@ BOOL OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector,
else
{
// convert units to logical width
- for (USHORT j = 0; j < aPolyPoly.Count(); ++j)
+ for (sal_uInt16 j = 0; j < aPolyPoly.Count(); ++j)
{
Polygon& rPoly = aPolyPoly[j];
- for (USHORT k = 0; k < rPoly.GetSize(); ++k)
+ for (sal_uInt16 k = 0; k < rPoly.GetSize(); ++k)
{
Point& rPt = rPoly[k];
rPt -= aOffset;
@@ -7907,9 +7979,9 @@ BOOL OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector,
// -----------------------------------------------------------------------
-BOOL OutputDevice::GetTextOutlines( PolyPolyVector& rResultVector,
+sal_Bool OutputDevice::GetTextOutlines( PolyPolyVector& rResultVector,
const String& rStr, xub_StrLen nBase, xub_StrLen nIndex,
- xub_StrLen nLen, BOOL bOptimize, ULONG nTWidth, const sal_Int32* pDXArray ) const
+ xub_StrLen nLen, sal_Bool bOptimize, sal_uLong nTWidth, const sal_Int32* pDXArray ) const
{
rResultVector.clear();
@@ -7917,7 +7989,7 @@ BOOL OutputDevice::GetTextOutlines( PolyPolyVector& rResultVector,
::basegfx::B2DPolyPolygonVector aB2DPolyPolyVector;
if( !GetTextOutlines( aB2DPolyPolyVector, rStr, nBase, nIndex, nLen,
bOptimize, nTWidth, pDXArray ) )
- return FALSE;
+ return sal_False;
// convert to a tool polypolygon vector
rResultVector.reserve( aB2DPolyPolyVector.size() );
@@ -7925,14 +7997,14 @@ BOOL OutputDevice::GetTextOutlines( PolyPolyVector& rResultVector,
for(; aIt != aB2DPolyPolyVector.end(); ++aIt )
rResultVector.push_back(PolyPolygon(*aIt)); // #i76339#
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL OutputDevice::GetTextOutline( PolyPolygon& rPolyPoly,
+sal_Bool OutputDevice::GetTextOutline( PolyPolygon& rPolyPoly,
const String& rStr, xub_StrLen nBase, xub_StrLen nIndex, xub_StrLen nLen,
- BOOL bOptimize, ULONG nTWidth, const sal_Int32* pDXArray ) const
+ sal_Bool bOptimize, sal_uLong nTWidth, const sal_Int32* pDXArray ) const
{
rPolyPoly.Clear();
@@ -7940,7 +8012,7 @@ BOOL OutputDevice::GetTextOutline( PolyPolygon& rPolyPoly,
::basegfx::B2DPolyPolygonVector aB2DPolyPolyVector;
if( !GetTextOutlines( aB2DPolyPolyVector, rStr, nBase, nIndex, nLen,
bOptimize, nTWidth, pDXArray ) )
- return FALSE;
+ return sal_False;
// convert and merge into a tool polypolygon
::basegfx::B2DPolyPolygonVector::const_iterator aIt = aB2DPolyPolyVector.begin();
@@ -7948,7 +8020,7 @@ BOOL OutputDevice::GetTextOutline( PolyPolygon& rPolyPoly,
for( unsigned int i = 0; i < aIt->count(); ++i )
rPolyPoly.Insert(Polygon((*aIt).getB2DPolygon( i ))); // #i76339#
- return TRUE;
+ return sal_True;
}
bool OutputDevice::GetFontCapabilities( FontCapabilities& rFontCapabilities ) const
@@ -7969,22 +8041,22 @@ bool OutputDevice::GetFontCapabilities( FontCapabilities& rFontCapabilities ) co
// -----------------------------------------------------------------------
-BOOL OutputDevice::GetFontCharMap( FontCharMap& rFontCharMap ) const
+sal_Bool OutputDevice::GetFontCharMap( FontCharMap& rFontCharMap ) const
{
rFontCharMap.Reset();
// we need a graphics
if( !mpGraphics && !ImplGetGraphics() )
- return FALSE;
+ return sal_False;
if( mbNewFont )
ImplNewFont();
if( mbInitFont )
ImplInitFont();
if( !mpFontEntry )
- return FALSE;
+ return sal_False;
- // a little font charmap cache helps considerably
+#ifdef ENABLE_IFC_CACHE // a little font charmap cache helps considerably
static const int NMAXITEMS = 16;
static int nUsedItems = 0, nCurItem = 0;
@@ -8002,10 +8074,12 @@ BOOL OutputDevice::GetFontCharMap( FontCharMap& rFontCharMap ) const
rFontCharMap.Reset( aCache[i].maCharMap.mpImpl );
}
else // need to cache
+#endif // ENABLE_IFC_CACHE
{
- ImplFontCharMap* pNewMap = mpGraphics->GetImplFontCharMap();
+ const ImplFontCharMap* pNewMap = mpGraphics->GetImplFontCharMap();
rFontCharMap.Reset( pNewMap );
+#ifdef ENABLE_IFC_CACHE
// manage cache round-robin and insert data
CharMapCacheItem& rItem = aCache[ nCurItem ];
rItem.mpFontData = pFontData;
@@ -8016,11 +8090,12 @@ BOOL OutputDevice::GetFontCharMap( FontCharMap& rFontCharMap ) const
if( ++nUsedItems >= NMAXITEMS )
nUsedItems = NMAXITEMS;
+#endif // ENABLE_IFC_CACHE
}
if( rFontCharMap.IsDefaultMap() )
- return FALSE;
- return TRUE;
+ return sal_False;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -8031,7 +8106,7 @@ xub_StrLen OutputDevice::HasGlyphs( const Font& rTempFont, const String& rStr,
if( nIndex >= rStr.Len() )
return nIndex;
xub_StrLen nEnd = nIndex + nLen;
- if( (ULONG)nIndex+nLen > rStr.Len() )
+ if( (sal_uLong)nIndex+nLen > rStr.Len() )
nEnd = rStr.Len();
DBG_ASSERT( nIndex < nEnd, "StartPos >= EndPos?" );
@@ -8041,11 +8116,11 @@ xub_StrLen OutputDevice::HasGlyphs( const Font& rTempFont, const String& rStr,
const Font aOrigFont = GetFont();
const_cast<OutputDevice&>(*this).SetFont( rTempFont );
FontCharMap aFontCharMap;
- BOOL bRet = GetFontCharMap( aFontCharMap );
+ sal_Bool bRet = GetFontCharMap( aFontCharMap );
const_cast<OutputDevice&>(*this).SetFont( aOrigFont );
// if fontmap is unknown assume it doesn't have the glyphs
- if( bRet == FALSE )
+ if( bRet == sal_False )
return nIndex;
const sal_Unicode* pStr = rStr.GetBuffer();
diff --git a/vcl/source/gdi/outdev4.cxx b/vcl/source/gdi/outdev4.cxx
index 31dafbf1652f..94226e863de5 100644
--- a/vcl/source/gdi/outdev4.cxx
+++ b/vcl/source/gdi/outdev4.cxx
@@ -87,7 +87,7 @@ void OutputDevice::ImplDrawPolygon( const Polygon& rPoly, const PolyPolygon* pCl
ImplDrawPolyPolygon( rPoly, pClipPolyPoly );
else
{
- USHORT nPoints = rPoly.GetSize();
+ sal_uInt16 nPoints = rPoly.GetSize();
if ( nPoints < 2 )
return;
@@ -114,7 +114,7 @@ void OutputDevice::ImplDrawPolyPolygon( const PolyPolygon& rPolyPoly, const Poly
if( pPolyPoly->Count() == 1 )
{
const Polygon rPoly = pPolyPoly->GetObject( 0 );
- USHORT nSize = rPoly.GetSize();
+ sal_uInt16 nSize = rPoly.GetSize();
if( nSize >= 2 )
{
@@ -124,14 +124,14 @@ void OutputDevice::ImplDrawPolyPolygon( const PolyPolygon& rPolyPoly, const Poly
}
else if( pPolyPoly->Count() )
{
- USHORT nCount = pPolyPoly->Count();
+ sal_uInt16 nCount = pPolyPoly->Count();
sal_uInt32* pPointAry = new sal_uInt32[nCount];
PCONSTSALPOINT* pPointAryAry = new PCONSTSALPOINT[nCount];
- USHORT i = 0;
+ sal_uInt16 i = 0;
do
{
const Polygon& rPoly = pPolyPoly->GetObject( i );
- USHORT nSize = rPoly.GetSize();
+ sal_uInt16 nSize = rPoly.GetSize();
if ( nSize )
{
pPointAry[i] = nSize;
@@ -158,26 +158,26 @@ void OutputDevice::ImplDrawPolyPolygon( const PolyPolygon& rPolyPoly, const Poly
// -----------------------------------------------------------------------
-inline UINT8 ImplGetGradientColorValue( long nValue )
+inline sal_uInt8 ImplGetGradientColorValue( long nValue )
{
if ( nValue < 0 )
return 0;
else if ( nValue > 0xFF )
return 0xFF;
else
- return (UINT8)nValue;
+ return (sal_uInt8)nValue;
}
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect,
const Gradient& rGradient,
- BOOL bMtf, const PolyPolygon* pClipPolyPoly )
+ sal_Bool bMtf, const PolyPolygon* pClipPolyPoly )
{
// rotiertes BoundRect ausrechnen
Rectangle aRect;
Point aCenter;
- USHORT nAngle = rGradient.GetAngle() % 3600;
+ sal_uInt16 nAngle = rGradient.GetAngle() % 3600;
rGradient.GetBoundRect( rRect, aRect, aCenter );
@@ -281,9 +281,9 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect,
double fScanInc = (double)aRect.GetHeight() / (double)nSteps;
// Startfarbe berechnen und setzen
- UINT8 nRed;
- UINT8 nGreen;
- UINT8 nBlue;
+ sal_uInt8 nRed;
+ sal_uInt8 nGreen;
+ sal_uInt8 nBlue;
long nSteps2;
long nStepsHalf = 0;
if ( bLinear )
@@ -291,23 +291,23 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect,
// Um 1 erhoeht, um die Border innerhalb der Schleife
// zeichnen zu koennen
nSteps2 = nSteps + 1;
- nRed = (UINT8)nStartRed;
- nGreen = (UINT8)nStartGreen;
- nBlue = (UINT8)nStartBlue;
+ nRed = (sal_uInt8)nStartRed;
+ nGreen = (sal_uInt8)nStartGreen;
+ nBlue = (sal_uInt8)nStartBlue;
}
else
{
// Um 2 erhoeht, um die Border innerhalb der Schleife
// zeichnen zu koennen
nSteps2 = nSteps + 2;
- nRed = (UINT8)nEndRed;
- nGreen = (UINT8)nEndGreen;
- nBlue = (UINT8)nEndBlue;
+ nRed = (sal_uInt8)nEndRed;
+ nGreen = (sal_uInt8)nEndGreen;
+ nBlue = (sal_uInt8)nEndBlue;
nStepsHalf = nSteps >> 1;
}
if ( bMtf )
- mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), TRUE ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), sal_True ) );
else
mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) );
@@ -368,9 +368,9 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect,
// on.
if ( i >= nSteps )
{
- nRed = (UINT8)nEndRed;
- nGreen = (UINT8)nEndGreen;
- nBlue = (UINT8)nEndBlue;
+ nRed = (sal_uInt8)nEndRed;
+ nGreen = (sal_uInt8)nEndGreen;
+ nBlue = (sal_uInt8)nEndBlue;
}
else
{
@@ -392,7 +392,7 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect,
}
if ( bMtf )
- mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), TRUE ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), sal_True ) );
else
mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) );
}
@@ -402,7 +402,7 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect,
void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
const Gradient& rGradient,
- BOOL bMtf, const PolyPolygon* pClipPolyPoly )
+ sal_Bool bMtf, const PolyPolygon* pClipPolyPoly )
{
// Feststellen ob Ausgabe ueber Polygon oder PolyPolygon
// Bei Rasteroperationen ungleich Overpaint immer PolyPolygone,
@@ -427,7 +427,7 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
long nGreenSteps = nEndGreen - nStartGreen;
long nBlueSteps = nEndBlue - nStartBlue;
long nStepCount = rGradient.GetSteps();
- USHORT nAngle = rGradient.GetAngle() % 3600;
+ sal_uInt16 nAngle = rGradient.GetAngle() % 3600;
rGradient.GetBoundRect( rRect, aRect, aCenter );
@@ -480,11 +480,11 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
double fScanRight = aRect.Right();
double fScanBottom = aRect.Bottom();
double fScanInc = (double) nMinRect / (double) nSteps * 0.5;
- UINT8 nRed = (UINT8) nStartRed, nGreen = (UINT8) nStartGreen, nBlue = (UINT8) nStartBlue;
+ sal_uInt8 nRed = (sal_uInt8) nStartRed, nGreen = (sal_uInt8) nStartGreen, nBlue = (sal_uInt8) nStartBlue;
bool bPaintLastPolygon( false ); // #107349# Paint last polygon only if loop has generated any output
if( bMtf )
- mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), TRUE ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), sal_True ) );
else
mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) );
@@ -552,7 +552,7 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
// the one painted in the window outdev path below. To get
// matching colors, have to delay color setting here.
if( bMtf )
- mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), TRUE ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), sal_True ) );
else
mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) );
}
@@ -560,7 +560,7 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
{
// #107349# Set fill color _before_ geometry painting
if( bMtf )
- mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), TRUE ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), sal_True ) );
else
mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) );
@@ -587,7 +587,7 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
if( bMtf )
{
- mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), TRUE ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), sal_True ) );
mpMetaFile->AddAction( new MetaPolygonAction( rPoly ) );
}
else
@@ -647,7 +647,7 @@ void OutputDevice::DrawGradient( const Rectangle& rRect,
if ( mnDrawMode & DRAWMODE_GRAYGRADIENT )
{
- BYTE cStartLum = aStartCol.GetLuminance(), cEndLum = aEndCol.GetLuminance();
+ sal_uInt8 cStartLum = aStartCol.GetLuminance(), cEndLum = aEndCol.GetLuminance();
aStartCol = Color( cStartLum, cStartLum, cStartLum );
aEndCol = Color( cEndLum, cEndLum, cEndLum );
}
@@ -707,19 +707,19 @@ void OutputDevice::DrawGradient( const Rectangle& rRect,
if ( mbLineColor || mbInitLineColor )
{
mpGraphics->SetLineColor();
- mbInitLineColor = TRUE;
+ mbInitLineColor = sal_True;
}
- mbInitFillColor = TRUE;
+ mbInitFillColor = sal_True;
// calculate step count if neccessary
if ( !aGradient.GetSteps() )
aGradient.SetSteps( GRADIENT_DEFAULT_STEPCOUNT );
if( aGradient.GetStyle() == GRADIENT_LINEAR || aGradient.GetStyle() == GRADIENT_AXIAL )
- ImplDrawLinearGradient( aRect, aGradient, FALSE, NULL );
+ ImplDrawLinearGradient( aRect, aGradient, sal_False, NULL );
else
- ImplDrawComplexGradient( aRect, aGradient, FALSE, NULL );
+ ImplDrawComplexGradient( aRect, aGradient, sal_False, NULL );
}
Pop();
@@ -795,9 +795,9 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
}
else
{
- const BOOL bOldOutput = IsOutputEnabled();
+ const sal_Bool bOldOutput = IsOutputEnabled();
- EnableOutput( FALSE );
+ EnableOutput( sal_False );
Push( PUSH_RASTEROP );
SetRasterOp( ROP_XOR );
DrawGradient( aRect, rGradient );
@@ -825,7 +825,7 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
if ( mnDrawMode & DRAWMODE_GRAYGRADIENT )
{
- BYTE cStartLum = aStartCol.GetLuminance(), cEndLum = aEndCol.GetLuminance();
+ sal_uInt8 cStartLum = aStartCol.GetLuminance(), cEndLum = aEndCol.GetLuminance();
aStartCol = Color( cStartLum, cStartLum, cStartLum );
aEndCol = Color( cEndLum, cEndLum, cEndLum );
}
@@ -872,19 +872,19 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
if( mbLineColor || mbInitLineColor )
{
mpGraphics->SetLineColor();
- mbInitLineColor = TRUE;
+ mbInitLineColor = sal_True;
}
- mbInitFillColor = TRUE;
+ mbInitFillColor = sal_True;
// calculate step count if neccessary
if ( !aGradient.GetSteps() )
aGradient.SetSteps( GRADIENT_DEFAULT_STEPCOUNT );
if( aGradient.GetStyle() == GRADIENT_LINEAR || aGradient.GetStyle() == GRADIENT_AXIAL )
- ImplDrawLinearGradient( aRect, aGradient, FALSE, &aClipPolyPoly );
+ ImplDrawLinearGradient( aRect, aGradient, sal_False, &aClipPolyPoly );
else
- ImplDrawComplexGradient( aRect, aGradient, FALSE, &aClipPolyPoly );
+ ImplDrawComplexGradient( aRect, aGradient, sal_False, &aClipPolyPoly );
}
}
}
@@ -926,9 +926,9 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
if( pVDev->SetOutputSizePixel( aDstSize) )
{
MapMode aVDevMap;
- const BOOL bOldMap = mbMap;
+ const sal_Bool bOldMap = mbMap;
- EnableMapMode( FALSE );
+ EnableMapMode( sal_False );
pVDev->DrawOutDev( Point(), aDstSize, aDstRect.TopLeft(), aDstSize, *this );
pVDev->SetRasterOp( ROP_XOR );
@@ -977,7 +977,7 @@ void OutputDevice::AddGradientActions( const Rectangle& rRect, const Gradient& r
mpMetaFile = &rMtf;
mpMetaFile->AddAction( new MetaPushAction( PUSH_ALL ) );
mpMetaFile->AddAction( new MetaISectRectClipRegionAction( aRect ) );
- mpMetaFile->AddAction( new MetaLineColorAction( Color(), FALSE ) );
+ mpMetaFile->AddAction( new MetaLineColorAction( Color(), sal_False ) );
// because we draw with no border line, we have to expand gradient
// rect to avoid missing lines on the right and bottom edge
@@ -991,9 +991,9 @@ void OutputDevice::AddGradientActions( const Rectangle& rRect, const Gradient& r
aGradient.SetSteps( GRADIENT_DEFAULT_STEPCOUNT );
if( aGradient.GetStyle() == GRADIENT_LINEAR || aGradient.GetStyle() == GRADIENT_AXIAL )
- ImplDrawLinearGradient( aRect, aGradient, TRUE, NULL );
+ ImplDrawLinearGradient( aRect, aGradient, sal_True, NULL );
else
- ImplDrawComplexGradient( aRect, aGradient, TRUE, NULL );
+ ImplDrawComplexGradient( aRect, aGradient, sal_True, NULL );
mpMetaFile->AddAction( new MetaPopAction() );
mpMetaFile = pOldMtf;
@@ -1021,7 +1021,7 @@ void OutputDevice::DrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch
aColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYLINE )
{
- const UINT8 cLum = aColor.GetLuminance();
+ const sal_uInt8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if( mnDrawMode & DRAWMODE_SETTINGSLINE )
@@ -1058,17 +1058,17 @@ void OutputDevice::DrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch
{
PolyPolygon aPolyPoly( LogicToPixel( rPolyPoly ) );
GDIMetaFile* pOldMetaFile = mpMetaFile;
- BOOL bOldMap = mbMap;
+ sal_Bool bOldMap = mbMap;
aPolyPoly.Optimize( POLY_OPTIMIZE_NO_SAME );
aHatch.SetDistance( ImplLogicWidthToDevicePixel( aHatch.GetDistance() ) );
mpMetaFile = NULL;
- EnableMapMode( FALSE );
+ EnableMapMode( sal_False );
Push( PUSH_LINECOLOR );
SetLineColor( aHatch.GetColor() );
ImplInitLineColor();
- ImplDrawHatch( aPolyPoly, aHatch, FALSE );
+ ImplDrawHatch( aPolyPoly, aHatch, sal_False );
Pop();
EnableMapMode( bOldMap );
mpMetaFile = pOldMetaFile;
@@ -1094,8 +1094,8 @@ void OutputDevice::AddHatchActions( const PolyPolygon& rPolyPoly, const Hatch& r
mpMetaFile = &rMtf;
mpMetaFile->AddAction( new MetaPushAction( PUSH_ALL ) );
- mpMetaFile->AddAction( new MetaLineColorAction( rHatch.GetColor(), TRUE ) );
- ImplDrawHatch( aPolyPoly, rHatch, TRUE );
+ mpMetaFile->AddAction( new MetaLineColorAction( rHatch.GetColor(), sal_True ) );
+ ImplDrawHatch( aPolyPoly, rHatch, sal_True );
mpMetaFile->AddAction( new MetaPopAction() );
mpMetaFile = pOldMtf;
}
@@ -1103,7 +1103,7 @@ void OutputDevice::AddHatchActions( const PolyPolygon& rPolyPoly, const Hatch& r
// -----------------------------------------------------------------------
-void OutputDevice::ImplDrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch, BOOL bMtf )
+void OutputDevice::ImplDrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch, sal_Bool bMtf )
{
Rectangle aRect( rPolyPoly.GetBoundRect() );
const long nLogPixelWidth = ImplDevicePixelToLogicWidth( 1 );
@@ -1154,7 +1154,7 @@ void OutputDevice::ImplDrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHa
// -----------------------------------------------------------------------
-void OutputDevice::ImplCalcHatchValues( const Rectangle& rRect, long nDist, USHORT nAngle10,
+void OutputDevice::ImplCalcHatchValues( const Rectangle& rRect, long nDist, sal_uInt16 nAngle10,
Point& rPt1, Point& rPt2, Size& rInc, Point& rEndPt1 )
{
Point aRef;
@@ -1265,14 +1265,14 @@ void OutputDevice::ImplCalcHatchValues( const Rectangle& rRect, long nDist, USHO
// ------------------------------------------------------------------------
void OutputDevice::ImplDrawHatchLine( const Line& rLine, const PolyPolygon& rPolyPoly,
- Point* pPtBuffer, BOOL bMtf )
+ Point* pPtBuffer, sal_Bool bMtf )
{
double fX, fY;
long nAdd, nPCounter = 0;
for( long nPoly = 0, nPolyCount = rPolyPoly.Count(); nPoly < nPolyCount; nPoly++ )
{
- const Polygon& rPoly = rPolyPoly[ (USHORT) nPoly ];
+ const Polygon& rPoly = rPolyPoly[ (sal_uInt16) nPoly ];
if( rPoly.GetSize() > 1 )
{
@@ -1280,7 +1280,7 @@ void OutputDevice::ImplDrawHatchLine( const Line& rLine, const PolyPolygon& rPol
for( long i = 1, nCount = rPoly.GetSize(); i <= nCount; i++ )
{
- aCurSegment.SetEnd( rPoly[ (USHORT)( i % nCount ) ] );
+ aCurSegment.SetEnd( rPoly[ (sal_uInt16)( i % nCount ) ] );
nAdd = 0;
if( rLine.Intersection( aCurSegment, fX, fY ) )
@@ -1288,7 +1288,7 @@ void OutputDevice::ImplDrawHatchLine( const Line& rLine, const PolyPolygon& rPol
if( ( fabs( fX - aCurSegment.GetStart().X() ) <= 0.0000001 ) &&
( fabs( fY - aCurSegment.GetStart().Y() ) <= 0.0000001 ) )
{
- const Line aPrevSegment( rPoly[ (USHORT)( ( i > 1 ) ? ( i - 2 ) : ( nCount - 1 ) ) ], aCurSegment.GetStart() );
+ const Line aPrevSegment( rPoly[ (sal_uInt16)( ( i > 1 ) ? ( i - 2 ) : ( nCount - 1 ) ) ], aCurSegment.GetStart() );
const double fPrevDistance = rLine.GetDistance( aPrevSegment.GetStart() );
const double fCurDistance = rLine.GetDistance( aCurSegment.GetEnd() );
@@ -1301,7 +1301,7 @@ void OutputDevice::ImplDrawHatchLine( const Line& rLine, const PolyPolygon& rPol
else if( ( fabs( fX - aCurSegment.GetEnd().X() ) <= 0.0000001 ) &&
( fabs( fY - aCurSegment.GetEnd().Y() ) <= 0.0000001 ) )
{
- const Line aNextSegment( aCurSegment.GetEnd(), rPoly[ (USHORT)( ( i + 1 ) % nCount ) ] );
+ const Line aNextSegment( aCurSegment.GetEnd(), rPoly[ (sal_uInt16)( ( i + 1 ) % nCount ) ] );
if( ( fabs( rLine.GetDistance( aNextSegment.GetEnd() ) ) <= 0.0000001 ) &&
( rLine.GetDistance( aCurSegment.GetStart() ) > 0.0 ) )
diff --git a/vcl/source/gdi/outdev5.cxx b/vcl/source/gdi/outdev5.cxx
index 2f57a0d0555f..2df0ff86dc3e 100644
--- a/vcl/source/gdi/outdev5.cxx
+++ b/vcl/source/gdi/outdev5.cxx
@@ -49,7 +49,7 @@ DBG_NAMEEX( OutputDevice )
// =======================================================================
void OutputDevice::DrawRect( const Rectangle& rRect,
- ULONG nHorzRound, ULONG nVertRound )
+ sal_uLong nHorzRound, sal_uLong nVertRound )
{
OSL_TRACE( "OutputDevice::DrawRoundRect()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx
index df685b913b52..92898ebfdf3a 100644
--- a/vcl/source/gdi/outdev6.cxx
+++ b/vcl/source/gdi/outdev6.cxx
@@ -58,7 +58,7 @@ DBG_NAMEEX( OutputDevice )
// ------------------------------------------------------------------------
-void OutputDevice::DrawGrid( const Rectangle& rRect, const Size& rDist, ULONG nFlags )
+void OutputDevice::DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLong nFlags )
{
OSL_TRACE( "OutputDevice::DrawGrid()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -116,8 +116,8 @@ void OutputDevice::DrawGrid( const Rectangle& rRect, const Size& rDist, ULONG nF
if( mbInitFillColor )
ImplInitFillColor();
- const BOOL bOldMap = mbMap;
- EnableMapMode( FALSE );
+ const sal_Bool bOldMap = mbMap;
+ EnableMapMode( sal_False );
if( nFlags & GRID_DOTS )
{
@@ -223,7 +223,7 @@ void OutputDevice::DrawTransparent( const basegfx::B2DPolyPolygon& rB2DPolyPoly,
// ------------------------------------------------------------------------
void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
- USHORT nTransparencePercent )
+ sal_uInt16 nTransparencePercent )
{
OSL_TRACE( "OutputDevice::DrawTransparent()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -345,7 +345,7 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
const Size aDPISize( LogicToPixel( Size( 1, 1 ), MAP_INCH ) );
const long nBaseExtent = Max( FRound( aDPISize.Width() / 300. ), 1L );
long nMove;
- const USHORT nTrans = ( nTransparencePercent < 13 ) ? 0 :
+ const sal_uInt16 nTrans = ( nTransparencePercent < 13 ) ? 0 :
( nTransparencePercent < 38 ) ? 25 :
( nTransparencePercent < 63 ) ? 50 :
( nTransparencePercent < 88 ) ? 75 : 100;
@@ -366,8 +366,8 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
Push( PUSH_CLIPREGION | PUSH_LINECOLOR );
IntersectClipRegion( rPolyPoly );
SetLineColor( GetFillColor() );
- const BOOL bOldMap = mbMap;
- EnableMapMode( FALSE );
+ const sal_Bool bOldMap = mbMap;
+ EnableMapMode( sal_False );
if(nMove)
{
@@ -454,16 +454,16 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
{
VirtualDevice aVDev( *this, 1 );
const Size aDstSz( aDstRect.GetSize() );
- const BYTE cTrans = (BYTE) MinMax( FRound( nTransparencePercent * 2.55 ), 0, 255 );
+ const sal_uInt8 cTrans = (sal_uInt8) MinMax( FRound( nTransparencePercent * 2.55 ), 0, 255 );
if( aDstRect.Left() || aDstRect.Top() )
aPolyPoly.Move( -aDstRect.Left(), -aDstRect.Top() );
if( aVDev.SetOutputSizePixel( aDstSz ) )
{
- const BOOL bOldMap = mbMap;
+ const sal_Bool bOldMap = mbMap;
- EnableMapMode( FALSE );
+ EnableMapMode( sal_False );
aVDev.SetLineColor( COL_BLACK );
aVDev.SetFillColor( COL_BLACK );
@@ -491,25 +491,25 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
if( aPaint.GetBitCount() <= 8 )
{
const BitmapPalette& rPal = pW->GetPalette();
- const USHORT nCount = rPal.GetEntryCount();
- BitmapColor* pMap = (BitmapColor*) new BYTE[ nCount * sizeof( BitmapColor ) ];
+ const sal_uInt16 nCount = rPal.GetEntryCount();
+ BitmapColor* pMap = (BitmapColor*) new sal_uInt8[ nCount * sizeof( BitmapColor ) ];
- for( USHORT i = 0; i < nCount; i++ )
+ for( sal_uInt16 i = 0; i < nCount; i++ )
{
BitmapColor aCol( rPal[ i ] );
- pMap[ i ] = BitmapColor( (BYTE) rPal.GetBestIndex( aCol.Merge( aFillCol, cTrans ) ) );
+ pMap[ i ] = BitmapColor( (sal_uInt8) rPal.GetBestIndex( aCol.Merge( aFillCol, cTrans ) ) );
}
if( pR->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL &&
pW->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL )
{
- const BYTE cBlack = aBlack.GetIndex();
+ const sal_uInt8 cBlack = aBlack.GetIndex();
for( nY = 0; nY < nHeight; nY++ )
{
Scanline pWScan = pW->GetScanline( nY );
Scanline pRScan = pR->GetScanline( nY );
- BYTE cBit = 128;
+ sal_uInt8 cBit = 128;
for( nX = 0; nX < nWidth; nX++, cBit >>= 1, pWScan++ )
{
@@ -517,7 +517,7 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
cBit = 128, pRScan++;
if( ( *pRScan & cBit ) == cBlack )
- *pWScan = (BYTE) pMap[ *pWScan ].GetIndex();
+ *pWScan = (sal_uInt8) pMap[ *pWScan ].GetIndex();
}
}
}
@@ -529,20 +529,20 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
pW->SetPixel( nY, nX, pMap[ pW->GetPixel( nY, nX ).GetIndex() ] );
}
- delete[] (BYTE*) pMap;
+ delete[] (sal_uInt8*) pMap;
}
else
{
if( pR->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL &&
pW->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_BGR )
{
- const BYTE cBlack = aBlack.GetIndex();
+ const sal_uInt8 cBlack = aBlack.GetIndex();
for( nY = 0; nY < nHeight; nY++ )
{
Scanline pWScan = pW->GetScanline( nY );
Scanline pRScan = pR->GetScanline( nY );
- BYTE cBit = 128;
+ sal_uInt8 cBit = 128;
for( nX = 0; nX < nWidth; nX++, cBit >>= 1, pWScan += 3 )
{
@@ -606,9 +606,9 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
if( mpAlphaVDev )
{
const Color aFillCol( mpAlphaVDev->GetFillColor() );
- mpAlphaVDev->SetFillColor( Color(sal::static_int_cast<UINT8>(255*nTransparencePercent/100),
- sal::static_int_cast<UINT8>(255*nTransparencePercent/100),
- sal::static_int_cast<UINT8>(255*nTransparencePercent/100)) );
+ mpAlphaVDev->SetFillColor( Color(sal::static_int_cast<sal_uInt8>(255*nTransparencePercent/100),
+ sal::static_int_cast<sal_uInt8>(255*nTransparencePercent/100),
+ sal::static_int_cast<sal_uInt8>(255*nTransparencePercent/100)) );
mpAlphaVDev->DrawTransparent( rPolyPoly, nTransparencePercent );
@@ -723,19 +723,19 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos,
AlphaMask aAlpha;
MapMode aMap( GetMapMode() );
Point aOutPos( PixelToLogic( aDstRect.TopLeft() ) );
- const BOOL bOldMap = mbMap;
+ const sal_Bool bOldMap = mbMap;
aMap.SetOrigin( Point( -aOutPos.X(), -aOutPos.Y() ) );
pVDev->SetMapMode( aMap );
- const BOOL bVDevOldMap = pVDev->IsMapModeEnabled();
+ const sal_Bool bVDevOldMap = pVDev->IsMapModeEnabled();
// create paint bitmap
( (GDIMetaFile&) rMtf ).WindStart();
( (GDIMetaFile&) rMtf ).Play( pVDev, rPos, rSize );
( (GDIMetaFile&) rMtf ).WindStart();
- pVDev->EnableMapMode( FALSE );
+ pVDev->EnableMapMode( sal_False );
aPaint = pVDev->GetBitmap( Point(), pVDev->GetOutputSizePixel() );
- pVDev->EnableMapMode( bVDevOldMap ); // #i35331#: MUST NOT use EnableMapMode( TRUE ) here!
+ pVDev->EnableMapMode( bVDevOldMap ); // #i35331#: MUST NOT use EnableMapMode( sal_True ) here!
// create mask bitmap
pVDev->SetLineColor( COL_BLACK );
@@ -746,22 +746,22 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos,
( (GDIMetaFile&) rMtf ).WindStart();
( (GDIMetaFile&) rMtf ).Play( pVDev, rPos, rSize );
( (GDIMetaFile&) rMtf ).WindStart();
- pVDev->EnableMapMode( FALSE );
+ pVDev->EnableMapMode( sal_False );
aMask = pVDev->GetBitmap( Point(), pVDev->GetOutputSizePixel() );
- pVDev->EnableMapMode( bVDevOldMap ); // #i35331#: MUST NOT use EnableMapMode( TRUE ) here!
+ pVDev->EnableMapMode( bVDevOldMap ); // #i35331#: MUST NOT use EnableMapMode( sal_True ) here!
// create alpha mask from gradient
pVDev->SetDrawMode( DRAWMODE_GRAYGRADIENT );
pVDev->DrawGradient( Rectangle( rPos, rSize ), rTransparenceGradient );
pVDev->SetDrawMode( DRAWMODE_DEFAULT );
- pVDev->EnableMapMode( FALSE );
+ pVDev->EnableMapMode( sal_False );
pVDev->DrawMask( Point(), pVDev->GetOutputSizePixel(), aMask, Color( COL_WHITE ) );
aAlpha = pVDev->GetBitmap( Point(), pVDev->GetOutputSizePixel() );
delete pVDev;
- EnableMapMode( FALSE );
+ EnableMapMode( sal_False );
DrawBitmapEx( aDstRect.TopLeft(), BitmapEx( aPaint, aAlpha ) );
EnableMapMode( bOldMap );
}
@@ -785,8 +785,8 @@ void OutputDevice::ImplDrawColorWallpaper( long nX, long nY,
Color aOldFillColor = GetFillColor();
SetLineColor();
SetFillColor( rWallpaper.GetColor() );
- BOOL bMap = mbMap;
- EnableMapMode( FALSE );
+ sal_Bool bMap = mbMap;
+ EnableMapMode( sal_False );
DrawRect( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ) );
SetLineColor( aOldLineColor );
SetFillColor( aOldFillColor );
@@ -805,10 +805,10 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
Size aSize;
GDIMetaFile* pOldMetaFile = mpMetaFile;
const WallpaperStyle eStyle = rWallpaper.GetStyle();
- const BOOL bOldMap = mbMap;
- BOOL bDrawn = FALSE;
- BOOL bDrawGradientBackground = FALSE;
- BOOL bDrawColorBackground = FALSE;
+ const sal_Bool bOldMap = mbMap;
+ sal_Bool bDrawn = sal_False;
+ sal_Bool bDrawGradientBackground = sal_False;
+ sal_Bool bDrawColorBackground = sal_False;
if( pCached )
aBmpEx = *pCached;
@@ -817,13 +817,13 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
const long nBmpWidth = aBmpEx.GetSizePixel().Width();
const long nBmpHeight = aBmpEx.GetSizePixel().Height();
- const BOOL bTransparent = aBmpEx.IsTransparent();
+ const sal_Bool bTransparent = aBmpEx.IsTransparent();
// draw background
if( bTransparent )
{
if( rWallpaper.IsGradient() )
- bDrawGradientBackground = TRUE;
+ bDrawGradientBackground = sal_True;
else
{
if( !pCached && !rWallpaper.GetColor().GetTransparency() )
@@ -835,15 +835,15 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
aBmpEx = aVDev.GetBitmap( Point(), aVDev.GetOutputSizePixel() );
}
- bDrawColorBackground = TRUE;
+ bDrawColorBackground = sal_True;
}
}
else if( eStyle != WALLPAPER_TILE && eStyle != WALLPAPER_SCALE )
{
if( rWallpaper.IsGradient() )
- bDrawGradientBackground = TRUE;
+ bDrawGradientBackground = sal_True;
else
- bDrawColorBackground = TRUE;
+ bDrawColorBackground = sal_True;
}
// background of bitmap?
@@ -852,7 +852,7 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
else if( bDrawColorBackground && bTransparent )
{
ImplDrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
- bDrawColorBackground = FALSE;
+ bDrawColorBackground = sal_False;
}
// calc pos and size
@@ -869,7 +869,7 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
}
mpMetaFile = NULL;
- EnableMapMode( FALSE );
+ EnableMapMode( sal_False );
Push( PUSH_CLIPREGION );
IntersectClipRegion( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ) );
@@ -969,7 +969,7 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
for( long nBmpX = nStartX; nBmpX <= nRight; nBmpX += nBmpWidth )
DrawBitmapEx( Point( nBmpX, nBmpY ), aBmpEx );
- bDrawn = TRUE;
+ bDrawn = sal_True;
}
break;
}
@@ -1044,8 +1044,8 @@ void OutputDevice::ImplDrawGradientWallpaper( long nX, long nY,
{
Rectangle aBound;
GDIMetaFile* pOldMetaFile = mpMetaFile;
- const BOOL bOldMap = mbMap;
- BOOL bNeedGradient = TRUE;
+ const sal_Bool bOldMap = mbMap;
+ sal_Bool bNeedGradient = sal_True;
/*
if ( rWallpaper.IsRect() )
@@ -1055,7 +1055,7 @@ void OutputDevice::ImplDrawGradientWallpaper( long nX, long nY,
aBound = Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) );
mpMetaFile = NULL;
- EnableMapMode( FALSE );
+ EnableMapMode( sal_False );
Push( PUSH_CLIPREGION );
IntersectClipRegion( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ) );
@@ -1072,7 +1072,7 @@ void OutputDevice::ImplDrawGradientWallpaper( long nX, long nY,
if( mnOutOffX+nWidth > gradientWidth )
ImplDrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper.GetGradient().GetEndColor() );
if( mnOutOffX > gradientWidth )
- bNeedGradient = FALSE;
+ bNeedGradient = sal_False;
else
aBound = Rectangle( Point( -mnOutOffX, nY ), Size( gradientWidth, nHeight ) );
}
@@ -1134,7 +1134,7 @@ void OutputDevice::Erase()
if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
return;
- BOOL bNativeOK = FALSE;
+ sal_Bool bNativeOK = sal_False;
if( meOutDevType == OUTDEV_WINDOW )
{
Window* pWindow = static_cast<Window*>(this);
@@ -1218,7 +1218,7 @@ bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
aRect.Justify();
bDrawn = mpGraphics->DrawEPS( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(),
- (BYTE*) rGfxLink.GetData(), rGfxLink.GetDataSize(), this );
+ (sal_uInt8*) rGfxLink.GetData(), rGfxLink.GetDataSize(), this );
}
// else draw the substitution graphics
diff --git a/vcl/source/gdi/outdevnative.cxx b/vcl/source/gdi/outdevnative.cxx
index b5766c86db7d..4ac1d4610b3f 100644..100755
--- a/vcl/source/gdi/outdevnative.cxx
+++ b/vcl/source/gdi/outdevnative.cxx
@@ -88,6 +88,10 @@ MenubarValue::~MenubarValue()
{
}
+MenupopupValue::~MenupopupValue()
+{
+}
+
PushButtonValue::~PushButtonValue()
{
}
@@ -99,14 +103,14 @@ PushButtonValue::~PushButtonValue()
// -----------------------------------------------------------------------
-BOOL OutputDevice::IsNativeControlSupported( ControlType nType, ControlPart nPart )
+sal_Bool OutputDevice::IsNativeControlSupported( ControlType nType, ControlPart nPart )
{
if( !lcl_enableNativeWidget( *this ) )
- return FALSE;
+ return sal_False;
if ( !mpGraphics )
if ( !ImplGetGraphics() )
- return FALSE;
+ return sal_False;
return( mpGraphics->IsNativeControlSupported(nType, nPart) );
}
@@ -114,18 +118,18 @@ BOOL OutputDevice::IsNativeControlSupported( ControlType nType, ControlPart nPar
// -----------------------------------------------------------------------
-BOOL OutputDevice::HitTestNativeControl( ControlType nType,
+sal_Bool OutputDevice::HitTestNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
const Point& aPos,
- BOOL& rIsInside )
+ sal_Bool& rIsInside )
{
if( !lcl_enableNativeWidget( *this ) )
- return FALSE;
+ return sal_False;
if ( !mpGraphics )
if ( !ImplGetGraphics() )
- return FALSE;
+ return sal_False;
Point aWinOffs( mnOutOffX, mnOutOffY );
Rectangle screenRegion( rControlRegion );
@@ -201,14 +205,21 @@ static boost::shared_ptr< ImplControlValue > lcl_transformControlValue( const Im
case CTRL_GENERIC:
aResult.reset( new ImplControlValue( rVal ) );
break;
+ case CTRL_MENU_POPUP:
+ {
+ const MenupopupValue* pMVal = static_cast<const MenupopupValue*>(&rVal);
+ MenupopupValue* pNew = new MenupopupValue( *pMVal );
+ pNew->maItemRect = rDev.ImplLogicToDevicePixel( pMVal->maItemRect );
+ aResult.reset( pNew );
+ }
+ break;
default:
OSL_FAIL( "unknown ImplControlValue type !" );
break;
}
return aResult;
}
-
-BOOL OutputDevice::DrawNativeControl( ControlType nType,
+sal_Bool OutputDevice::DrawNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -216,17 +227,17 @@ BOOL OutputDevice::DrawNativeControl( ControlType nType,
::rtl::OUString aCaption )
{
if( !lcl_enableNativeWidget( *this ) )
- return FALSE;
+ return sal_False;
// make sure the current clip region is initialized correctly
if ( !mpGraphics )
if ( !ImplGetGraphics() )
- return FALSE;
+ return sal_False;
if ( mbInitClipRegion )
ImplInitClipRegion();
- if ( mbOutputClipped )
- return TRUE;
+ if ( mbOutputClipped || rControlRegion.IsEmpty() )
+ return sal_True;
if ( mbInitLineColor )
ImplInitLineColor();
@@ -243,7 +254,7 @@ BOOL OutputDevice::DrawNativeControl( ControlType nType,
if( aTestRegion == rControlRegion )
nState |= CTRL_CACHING_ALLOWED; // control is not clipped, caching allowed
- BOOL bRet = mpGraphics->DrawNativeControl(nType, nPart, screenRegion, nState, *aScreenCtrlValue, aCaption, this );
+ sal_Bool bRet = mpGraphics->DrawNativeControl(nType, nPart, screenRegion, nState, *aScreenCtrlValue, aCaption, this );
return bRet;
}
@@ -251,7 +262,7 @@ BOOL OutputDevice::DrawNativeControl( ControlType nType,
// -----------------------------------------------------------------------
-BOOL OutputDevice::DrawNativeControlText(ControlType nType,
+sal_Bool OutputDevice::DrawNativeControlText(ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -259,7 +270,7 @@ BOOL OutputDevice::DrawNativeControlText(ControlType nType,
::rtl::OUString aCaption )
{
if( !lcl_enableNativeWidget( *this ) )
- return FALSE;
+ return sal_False;
// make sure the current clip region is initialized correctly
if ( !mpGraphics )
@@ -281,7 +292,7 @@ BOOL OutputDevice::DrawNativeControlText(ControlType nType,
boost::shared_ptr< ImplControlValue > aScreenCtrlValue( lcl_transformControlValue( aValue, *this ) );
Rectangle screenRegion( ImplLogicToDevicePixel( rControlRegion ) );
- BOOL bRet = mpGraphics->DrawNativeControlText(nType, nPart, screenRegion, nState, *aScreenCtrlValue, aCaption, this );
+ sal_Bool bRet = mpGraphics->DrawNativeControlText(nType, nPart, screenRegion, nState, *aScreenCtrlValue, aCaption, this );
return bRet;
}
@@ -289,7 +300,7 @@ BOOL OutputDevice::DrawNativeControlText(ControlType nType,
// -----------------------------------------------------------------------
-BOOL OutputDevice::GetNativeControlRegion( ControlType nType,
+sal_Bool OutputDevice::GetNativeControlRegion( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -299,18 +310,18 @@ BOOL OutputDevice::GetNativeControlRegion( ControlType nType,
Rectangle &rNativeContentRegion )
{
if( !lcl_enableNativeWidget( *this ) )
- return FALSE;
+ return sal_False;
if ( !mpGraphics )
if ( !ImplGetGraphics() )
- return FALSE;
+ return sal_False;
// Convert the coordinates from relative to Window-absolute, so we draw
// in the correct place in platform code
boost::shared_ptr< ImplControlValue > aScreenCtrlValue( lcl_transformControlValue( aValue, *this ) );
Rectangle screenRegion( ImplLogicToDevicePixel( rControlRegion ) );
- BOOL bRet = mpGraphics->GetNativeControlRegion(nType, nPart, screenRegion, nState, *aScreenCtrlValue,
+ sal_Bool bRet = mpGraphics->GetNativeControlRegion(nType, nPart, screenRegion, nState, *aScreenCtrlValue,
aCaption, rNativeBoundingRegion,
rNativeContentRegion, this );
if( bRet )
diff --git a/vcl/source/gdi/outmap.cxx b/vcl/source/gdi/outmap.cxx
index d33f58d3ef14..a0b2c6521aac 100644
--- a/vcl/source/gdi/outmap.cxx
+++ b/vcl/source/gdi/outmap.cxx
@@ -131,7 +131,7 @@ static void ImplCalcBigIntThreshold( long nDPIX, long nDPIY,
{
// Schwellenwerte fuer BigInt Arithmetik berechnen
long nDenomHalfX = rMapRes.mnMapScDenomX / 2;
- ULONG nDenomX = rMapRes.mnMapScDenomX;
+ sal_uLong nDenomX = rMapRes.mnMapScDenomX;
long nProductX = nDPIX * rMapRes.mnMapScNumX;
if ( !nProductX )
@@ -142,9 +142,9 @@ static void ImplCalcBigIntThreshold( long nDPIX, long nDPIY,
if ( !nDenomX )
rThresRes.mnThresPixToLogX = LONG_MAX;
else if ( nProductX >= 0 )
- rThresRes.mnThresPixToLogX = (long)(((ULONG)LONG_MAX - (ULONG)( nProductX/2)) / nDenomX);
+ rThresRes.mnThresPixToLogX = (long)(((sal_uLong)LONG_MAX - (sal_uLong)( nProductX/2)) / nDenomX);
else
- rThresRes.mnThresPixToLogX = (long)(((ULONG)LONG_MAX + (ULONG)(-nProductX/2)) / nDenomX);
+ rThresRes.mnThresPixToLogX = (long)(((sal_uLong)LONG_MAX + (sal_uLong)(-nProductX/2)) / nDenomX);
}
if ( nDPIY && (LONG_MAX / nDPIY < Abs( rMapRes.mnMapScNumY ) ) ) // #111139# avoid div by zero
@@ -156,7 +156,7 @@ static void ImplCalcBigIntThreshold( long nDPIX, long nDPIY,
{
// Schwellenwerte fuer BigInt Arithmetik berechnen
long nDenomHalfY = rMapRes.mnMapScDenomY / 2;
- ULONG nDenomY = rMapRes.mnMapScDenomY;
+ sal_uLong nDenomY = rMapRes.mnMapScDenomY;
long nProductY = nDPIY * rMapRes.mnMapScNumY;
if ( !nProductY )
@@ -167,9 +167,9 @@ static void ImplCalcBigIntThreshold( long nDPIX, long nDPIY,
if ( !nDenomY )
rThresRes.mnThresPixToLogY = LONG_MAX;
else if ( nProductY >= 0 )
- rThresRes.mnThresPixToLogY = (long)(((ULONG)LONG_MAX - (ULONG)( nProductY/2)) / nDenomY);
+ rThresRes.mnThresPixToLogY = (long)(((sal_uLong)LONG_MAX - (sal_uLong)( nProductY/2)) / nDenomY);
else
- rThresRes.mnThresPixToLogY = (long)(((ULONG)LONG_MAX + (ULONG)(-nProductY/2)) / nDenomY);
+ rThresRes.mnThresPixToLogY = (long)(((sal_uLong)LONG_MAX + (sal_uLong)(-nProductY/2)) / nDenomY);
}
rThresRes.mnThresLogToPixX /= 2;
@@ -600,8 +600,8 @@ Polygon OutputDevice::ImplLogicToDevicePixel( const Polygon& rLogicPoly ) const
if ( !mbMap && !mnOutOffX && !mnOutOffY )
return rLogicPoly;
- USHORT i;
- USHORT nPoints = rLogicPoly.GetSize();
+ sal_uInt16 i;
+ sal_uInt16 nPoints = rLogicPoly.GetSize();
Polygon aPoly( rLogicPoly );
// Pointer auf das Point-Array holen (Daten werden kopiert)
@@ -644,8 +644,8 @@ PolyPolygon OutputDevice::ImplLogicToDevicePixel( const PolyPolygon& rLogicPolyP
return rLogicPolyPoly;
PolyPolygon aPolyPoly( rLogicPolyPoly );
- USHORT nPoly = aPolyPoly.Count();
- for( USHORT i = 0; i < nPoly; i++ )
+ sal_uInt16 nPoly = aPolyPoly.Count();
+ for( sal_uInt16 i = 0; i < nPoly; i++ )
{
Polygon& rPoly = aPolyPoly[i];
rPoly = ImplLogicToDevicePixel( rPoly );
@@ -725,7 +725,7 @@ Region OutputDevice::ImplPixelToDevicePixel( const Region& rRegion ) const
// -----------------------------------------------------------------------
-void OutputDevice::EnableMapMode( BOOL bEnable )
+void OutputDevice::EnableMapMode( sal_Bool bEnable )
{
mbMap = (bEnable != 0);
@@ -744,12 +744,12 @@ void OutputDevice::SetMapMode()
if ( mbMap || !maMapMode.IsDefault() )
{
- mbMap = FALSE;
+ mbMap = sal_False;
maMapMode = MapMode();
// create new objects (clip region werden nicht neu skaliert)
- mbNewFont = TRUE;
- mbInitFont = TRUE;
+ mbNewFont = sal_True;
+ mbInitFont = sal_True;
if ( GetOutDevType() == OUTDEV_WINDOW )
{
if ( ((Window*)this)->mpWindowImpl->mpCursor )
@@ -774,7 +774,7 @@ void OutputDevice::SetMapMode( const MapMode& rNewMapMode )
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- BOOL bRelMap = (rNewMapMode.GetMapUnit() == MAP_RELATIVE);
+ sal_Bool bRelMap = (rNewMapMode.GetMapUnit() == MAP_RELATIVE);
if ( mpMetaFile )
{
@@ -793,7 +793,7 @@ void OutputDevice::SetMapMode( const MapMode& rNewMapMode )
mpAlphaVDev->SetMapMode( rNewMapMode );
// Ist Default-MapMode, dann bereche nichts
- BOOL bOldMap = mbMap;
+ sal_Bool bOldMap = mbMap;
mbMap = !rNewMapMode.IsDefault();
if ( mbMap )
{
@@ -849,8 +849,8 @@ void OutputDevice::SetMapMode( const MapMode& rNewMapMode )
maMapMode = rNewMapMode;
// create new objects (clip region werden nicht neu skaliert)
- mbNewFont = TRUE;
- mbInitFont = TRUE;
+ mbNewFont = sal_True;
+ mbInitFont = sal_True;
if ( GetOutDevType() == OUTDEV_WINDOW )
{
if ( ((Window*)this)->mpWindowImpl->mpCursor )
@@ -1121,8 +1121,8 @@ Polygon OutputDevice::LogicToPixel( const Polygon& rLogicPoly ) const
if ( !mbMap )
return rLogicPoly;
- USHORT i;
- USHORT nPoints = rLogicPoly.GetSize();
+ sal_uInt16 i;
+ sal_uInt16 nPoints = rLogicPoly.GetSize();
Polygon aPoly( rLogicPoly );
// Pointer auf das Point-Array holen (Daten werden kopiert)
@@ -1155,8 +1155,8 @@ PolyPolygon OutputDevice::LogicToPixel( const PolyPolygon& rLogicPolyPoly ) cons
return rLogicPolyPoly;
PolyPolygon aPolyPoly( rLogicPolyPoly );
- USHORT nPoly = aPolyPoly.Count();
- for( USHORT i = 0; i < nPoly; i++ )
+ sal_uInt16 nPoly = aPolyPoly.Count();
+ for( sal_uInt16 i = 0; i < nPoly; i++ )
{
Polygon& rPoly = aPolyPoly[i];
rPoly = LogicToPixel( rPoly );
@@ -1217,7 +1217,7 @@ Region OutputDevice::LogicToPixel( const Region& rLogicRegion ) const
long nWidth;
long nHeight;
ImplRegionInfo aInfo;
- BOOL bRegionRect;
+ sal_Bool bRegionRect;
aRegion.ImplBeginAddRect();
bRegionRect = rLogicRegion.ImplGetFirstRect( aInfo, nX, nY, nWidth, nHeight );
@@ -1324,8 +1324,8 @@ Polygon OutputDevice::LogicToPixel( const Polygon& rLogicPoly,
ImplThresholdRes aThresRes;
ImplCalcMapResolution( rMapMode, mnDPIX, mnDPIY, aMapRes, aThresRes );
- USHORT i;
- USHORT nPoints = rLogicPoly.GetSize();
+ sal_uInt16 i;
+ sal_uInt16 nPoints = rLogicPoly.GetSize();
Polygon aPoly( rLogicPoly );
// Pointer auf das Point-Array holen (Daten werden kopiert)
@@ -1359,8 +1359,8 @@ PolyPolygon OutputDevice::LogicToPixel( const PolyPolygon& rLogicPolyPoly,
return rLogicPolyPoly;
PolyPolygon aPolyPoly( rLogicPolyPoly );
- USHORT nPoly = aPolyPoly.Count();
- for( USHORT i = 0; i < nPoly; i++ )
+ sal_uInt16 nPoly = aPolyPoly.Count();
+ for( sal_uInt16 i = 0; i < nPoly; i++ )
{
Polygon& rPoly = aPolyPoly[i];
rPoly = LogicToPixel( rPoly, rMapMode );
@@ -1415,7 +1415,7 @@ Region OutputDevice::LogicToPixel( const Region& rLogicRegion,
long nWidth;
long nHeight;
ImplRegionInfo aInfo;
- BOOL bRegionRect;
+ sal_Bool bRegionRect;
aRegion.ImplBeginAddRect();
bRegionRect = rLogicRegion.ImplGetFirstRect( aInfo, nX, nY, nWidth, nHeight );
@@ -1498,8 +1498,8 @@ Polygon OutputDevice::PixelToLogic( const Polygon& rDevicePoly ) const
if ( !mbMap )
return rDevicePoly;
- USHORT i;
- USHORT nPoints = rDevicePoly.GetSize();
+ sal_uInt16 i;
+ sal_uInt16 nPoints = rDevicePoly.GetSize();
Polygon aPoly( rDevicePoly );
// Pointer auf das Point-Array holen (Daten werden kopiert)
@@ -1532,8 +1532,8 @@ PolyPolygon OutputDevice::PixelToLogic( const PolyPolygon& rDevicePolyPoly ) con
return rDevicePolyPoly;
PolyPolygon aPolyPoly( rDevicePolyPoly );
- USHORT nPoly = aPolyPoly.Count();
- for( USHORT i = 0; i < nPoly; i++ )
+ sal_uInt16 nPoly = aPolyPoly.Count();
+ for( sal_uInt16 i = 0; i < nPoly; i++ )
{
Polygon& rPoly = aPolyPoly[i];
rPoly = PixelToLogic( rPoly );
@@ -1585,7 +1585,7 @@ Region OutputDevice::PixelToLogic( const Region& rDeviceRegion ) const
long nWidth;
long nHeight;
ImplRegionInfo aInfo;
- BOOL bRegionRect;
+ sal_Bool bRegionRect;
aRegion.ImplBeginAddRect();
bRegionRect = rDeviceRegion.ImplGetFirstRect( aInfo, nX, nY, nWidth, nHeight );
@@ -1696,8 +1696,8 @@ Polygon OutputDevice::PixelToLogic( const Polygon& rDevicePoly,
ImplThresholdRes aThresRes;
ImplCalcMapResolution( rMapMode, mnDPIX, mnDPIY, aMapRes, aThresRes );
- USHORT i;
- USHORT nPoints = rDevicePoly.GetSize();
+ sal_uInt16 i;
+ sal_uInt16 nPoints = rDevicePoly.GetSize();
Polygon aPoly( rDevicePoly );
// Pointer auf das Point-Array holen (Daten werden kopiert)
@@ -1731,8 +1731,8 @@ PolyPolygon OutputDevice::PixelToLogic( const PolyPolygon& rDevicePolyPoly,
return rDevicePolyPoly;
PolyPolygon aPolyPoly( rDevicePolyPoly );
- USHORT nPoly = aPolyPoly.Count();
- for( USHORT i = 0; i < nPoly; i++ )
+ sal_uInt16 nPoly = aPolyPoly.Count();
+ for( sal_uInt16 i = 0; i < nPoly; i++ )
{
Polygon& rPoly = aPolyPoly[i];
rPoly = PixelToLogic( rPoly, rMapMode );
@@ -1787,7 +1787,7 @@ Region OutputDevice::PixelToLogic( const Region& rDeviceRegion,
long nWidth;
long nHeight;
ImplRegionInfo aInfo;
- BOOL bRegionRect;
+ sal_Bool bRegionRect;
aRegion.ImplBeginAddRect();
bRegionRect = rDeviceRegion.ImplGetFirstRect( aInfo, nX, nY, nWidth, nHeight );
@@ -2103,7 +2103,7 @@ Rectangle OutputDevice::LogicToLogic( const Rectangle& rRectSource,
// -----------------------------------------------------------------------
-long* OutputDevice::LogicToLogic( long* pX, USHORT nCount,
+long* OutputDevice::LogicToLogic( long* pX, sal_uInt16 nCount,
const MapMode* pMapModeSource,
const MapMode* pMapModeDest ) const
{
diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx
index 0119350063e0..2b3173c4b128 100644
--- a/vcl/source/gdi/pdfextoutdevdata.cxx
+++ b/vcl/source/gdi/pdfextoutdevdata.cxx
@@ -783,7 +783,7 @@ void PDFExtOutDevData::EndGroup()
mpPageSyncData->PushAction( mrOutDev, PDFExtOutDevDataSync::EndGroup );
}
void PDFExtOutDevData::EndGroup( const Graphic& rGraphic,
- BYTE nTransparency,
+ sal_uInt8 nTransparency,
const Rectangle& rOutputRect,
const Rectangle& rVisibleOutputRect )
{
diff --git a/vcl/source/gdi/pdfwriter.cxx b/vcl/source/gdi/pdfwriter.cxx
index fd527fb94e55..881205e0af77 100644
--- a/vcl/source/gdi/pdfwriter.cxx
+++ b/vcl/source/gdi/pdfwriter.cxx
@@ -39,9 +39,9 @@ PDFWriter::AnyWidget::~AnyWidget()
{
}
-PDFWriter::PDFWriter( const PDFWriter::PDFWriterContext& rContext )
+PDFWriter::PDFWriter( const PDFWriter::PDFWriterContext& rContext, const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& xEnc )
:
- pImplementation( new PDFWriterImpl( rContext ) )
+ pImplementation( new PDFWriterImpl( rContext, xEnc, *this ) )
{
}
@@ -70,16 +70,6 @@ PDFWriter::PDFVersion PDFWriter::GetVersion() const
return ((PDFWriterImpl*)pImplementation)->getVersion();
}
-void PDFWriter::SetDocInfo( const PDFDocInfo& rInfo )
-{
- ((PDFWriterImpl*)pImplementation)->setDocInfo( rInfo );
-}
-
-const PDFDocInfo& PDFWriter::GetDocInfo() const
-{
- return ((PDFWriterImpl*)pImplementation)->getDocInfo();
-}
-
void PDFWriter::SetDocumentLocale( const com::sun::star::lang::Locale& rLoc )
{
((PDFWriterImpl*)pImplementation)->setDocumentLocale( rLoc );
@@ -101,7 +91,7 @@ void PDFWriter::DrawTextLine(
FontStrikeout eStrikeout,
FontUnderline eUnderline,
FontUnderline eOverline,
- BOOL bUnderlineAbove )
+ sal_Bool bUnderlineAbove )
{
((PDFWriterImpl*)pImplementation)->drawTextLine( rPos, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
}
@@ -118,7 +108,7 @@ void PDFWriter::DrawTextArray(
void PDFWriter::DrawStretchText(
const Point& rStartPt,
- ULONG nWidth,
+ sal_uLong nWidth,
const XubString& rStr,
xub_StrLen nIndex,
xub_StrLen nLen )
@@ -129,7 +119,7 @@ void PDFWriter::DrawStretchText(
void PDFWriter::DrawText(
const Rectangle& rRect,
const XubString& rStr,
- USHORT nStyle )
+ sal_uInt16 nStyle )
{
((PDFWriterImpl*)pImplementation)->drawText( rRect, rStr, nStyle );
}
@@ -159,7 +149,7 @@ void PDFWriter::DrawRect( const Rectangle& rRect )
((PDFWriterImpl*)pImplementation)->drawRectangle( rRect );
}
-void PDFWriter::DrawRect( const Rectangle& rRect, ULONG nHorzRound, ULONG nVertRound )
+void PDFWriter::DrawRect( const Rectangle& rRect, sal_uLong nHorzRound, sal_uLong nVertRound )
{
((PDFWriterImpl*)pImplementation)->drawRectangle( rRect, nHorzRound, nVertRound );
}
@@ -292,7 +282,7 @@ void PDFWriter::DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpap
((PDFWriterImpl*)pImplementation)->drawWallpaper( rRect, rWallpaper );
}
-void PDFWriter::DrawTransparent( const PolyPolygon& rPolyPoly, USHORT nTransparencePercent )
+void PDFWriter::DrawTransparent( const PolyPolygon& rPolyPoly, sal_uInt16 nTransparencePercent )
{
((PDFWriterImpl*)pImplementation)->drawTransparent( rPolyPoly, nTransparencePercent );
}
@@ -302,7 +292,7 @@ void PDFWriter::BeginTransparencyGroup()
((PDFWriterImpl*)pImplementation)->beginTransparencyGroup();
}
-void PDFWriter::EndTransparencyGroup( const Rectangle& rRect, USHORT nTransparentPercent )
+void PDFWriter::EndTransparencyGroup( const Rectangle& rRect, sal_uInt16 nTransparentPercent )
{
((PDFWriterImpl*)pImplementation)->endTransparencyGroup( rRect, nTransparentPercent );
}
@@ -312,7 +302,7 @@ void PDFWriter::EndTransparencyGroup( const Rectangle& rRect, const Bitmap& rAlp
((PDFWriterImpl*)pImplementation)->endTransparencyGroup( rRect, rAlphaMask );
}
-void PDFWriter::Push( USHORT nFlags )
+void PDFWriter::Push( sal_uInt16 nFlags )
{
((PDFWriterImpl*)pImplementation)->push( nFlags );
}
@@ -367,12 +357,12 @@ void PDFWriter::IntersectClipRegion( const Rectangle& rRect )
((PDFWriterImpl*)pImplementation)->intersectClipRegion( rRect );
}
-void PDFWriter::SetAntialiasing( USHORT nMode )
+void PDFWriter::SetAntialiasing( sal_uInt16 nMode )
{
((PDFWriterImpl*)pImplementation)->setAntiAlias( (sal_Int32)nMode );
}
-void PDFWriter::SetLayoutMode( ULONG nMode )
+void PDFWriter::SetLayoutMode( sal_uLong nMode )
{
((PDFWriterImpl*)pImplementation)->setLayoutMode( (sal_Int32)nMode );
}
@@ -571,4 +561,18 @@ std::set< PDFWriter::ErrorCode > PDFWriter::GetErrors()
return ((PDFWriterImpl*)pImplementation)->getErrors();
}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >
+PDFWriter::InitEncryption( const rtl::OUString& i_rOwnerPassword,
+ const rtl::OUString& i_rUserPassword,
+ bool b128Bit
+ )
+{
+ return PDFWriterImpl::initEncryption( i_rOwnerPassword, i_rUserPassword, b128Bit );
+}
+
+void PDFWriter::PlayMetafile( const GDIMetaFile& i_rMTF, const vcl::PDFWriter::PlayMetafileContext& i_rPlayContext, PDFExtOutDevData* i_pData )
+{
+ ((PDFWriterImpl*)pImplementation)->playMetafile( i_rMTF, i_pData, i_rPlayContext, NULL);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 6afa91f16c73..1373d0f9b280 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -55,6 +55,7 @@
#include <vcl/metric.hxx>
#include <vcl/fontsubset.hxx>
#include <vcl/textlayout.hxx>
+#include <vcl/cvtgrf.hxx>
#include <svsys.h>
#include <vcl/salgdi.hxx>
#include <vcl/svapp.hxx>
@@ -68,6 +69,7 @@
#include "cppuhelper/implbase1.hxx"
#include <icc/sRGB-IEC61966-2.1.hxx>
#include <vcl/lineinfo.hxx>
+#include "vcl/strhelper.hxx"
using namespace vcl;
@@ -120,12 +122,10 @@ void doTestCode()
aContext.Version = PDFWriter::PDF_1_4;
aContext.Tagged = true;
aContext.InitialPage = 2;
+ aContext.DocumentInfo.Title = OUString( RTL_CONSTASCII_USTRINGPARAM( "PDF export test document" ) );
+ aContext.DocumentInfo.Producer = OUString( RTL_CONSTASCII_USTRINGPARAM( "VCL" ) );
PDFWriter aWriter( aContext );
- PDFDocInfo aDocInfo;
- aDocInfo.Title = OUString( RTL_CONSTASCII_USTRINGPARAM( "PDF export test document" ) );
- aDocInfo.Producer = OUString( RTL_CONSTASCII_USTRINGPARAM( "VCL" ) );
- aWriter.SetDocInfo( aDocInfo );
aWriter.NewPage( 595, 842 );
aWriter.BeginStructureElement( PDFWriter::Document );
// set duration of 3 sec for first page
@@ -259,7 +259,7 @@ void doTestCode()
BitmapWriteAccess* pAcc = aTransMask.AcquireWriteAccess();
for( int nX = 0; nX < 256; nX++ )
for( int nY = 0; nY < 256; nY++ )
- pAcc->SetPixel( nX, nY, BitmapColor( (BYTE)((nX+nY)/2) ) );
+ pAcc->SetPixel( nX, nY, BitmapColor( (sal_uInt8)((nX+nY)/2) ) );
aTransMask.ReleaseAccess( pAcc );
aTransMask.SetPrefMapMode( MAP_MM );
aTransMask.SetPrefSize( Size( 10, 10 ) );
@@ -503,6 +503,12 @@ static inline double pixelToPoint( sal_Int32 px ) { return double(px)/fDivisor;
static inline double pixelToPoint( double px ) { return px/fDivisor; }
static inline sal_Int32 pointToPixel( double pt ) { return sal_Int32(pt*fDivisor); }
+const sal_uInt8 PDFWriterImpl::s_nPadString[32] =
+{
+ 0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41, 0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08,
+ 0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80, 0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A
+};
+
static void appendHex( sal_Int8 nInt, OStringBuffer& rBuffer )
{
static const sal_Char pHexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7',
@@ -890,34 +896,44 @@ static void appendDouble( double fValue, OStringBuffer& rBuffer, sal_Int32 nPrec
}
-static void appendColor( const Color& rColor, OStringBuffer& rBuffer )
+static void appendColor( const Color& rColor, OStringBuffer& rBuffer, bool bConvertToGrey = false )
{
if( rColor != Color( COL_TRANSPARENT ) )
{
- appendDouble( (double)rColor.GetRed() / 255.0, rBuffer );
- rBuffer.append( ' ' );
- appendDouble( (double)rColor.GetGreen() / 255.0, rBuffer );
- rBuffer.append( ' ' );
- appendDouble( (double)rColor.GetBlue() / 255.0, rBuffer );
+ if( bConvertToGrey )
+ {
+ sal_uInt8 cByte = rColor.GetLuminance();
+ appendDouble( (double)cByte / 255.0, rBuffer );
+ }
+ else
+ {
+ appendDouble( (double)rColor.GetRed() / 255.0, rBuffer );
+ rBuffer.append( ' ' );
+ appendDouble( (double)rColor.GetGreen() / 255.0, rBuffer );
+ rBuffer.append( ' ' );
+ appendDouble( (double)rColor.GetBlue() / 255.0, rBuffer );
+ }
}
}
-static void appendStrokingColor( const Color& rColor, OStringBuffer& rBuffer )
+void PDFWriterImpl::appendStrokingColor( const Color& rColor, OStringBuffer& rBuffer )
{
if( rColor != Color( COL_TRANSPARENT ) )
{
- appendColor( rColor, rBuffer );
- rBuffer.append( " RG" );
+ bool bGrey = m_aContext.ColorMode == PDFWriter::DrawGreyscale;
+ appendColor( rColor, rBuffer, bGrey );
+ rBuffer.append( bGrey ? " G" : " RG" );
}
}
-static void appendNonStrokingColor( const Color& rColor, OStringBuffer& rBuffer )
+void PDFWriterImpl::appendNonStrokingColor( const Color& rColor, OStringBuffer& rBuffer )
{
if( rColor != Color( COL_TRANSPARENT ) )
{
- appendColor( rColor, rBuffer );
- rBuffer.append( " rg" );
+ bool bGrey = m_aContext.ColorMode == PDFWriter::DrawGreyscale;
+ appendColor( rColor, rBuffer, bGrey );
+ rBuffer.append( bGrey ? " g" : " rg" );
}
}
@@ -1438,17 +1454,17 @@ void PDFWriterImpl::PDFPage::convertRect( Rectangle& rRect ) const
void PDFWriterImpl::PDFPage::appendPolygon( const Polygon& rPoly, OStringBuffer& rBuffer, bool bClose ) const
{
- USHORT nPoints = rPoly.GetSize();
+ sal_uInt16 nPoints = rPoly.GetSize();
/*
* #108582# applications do weird things
*/
sal_uInt32 nBufLen = rBuffer.getLength();
if( nPoints > 0 )
{
- const BYTE* pFlagArray = rPoly.GetConstFlagAry();
+ const sal_uInt8* pFlagArray = rPoly.GetConstFlagAry();
appendPoint( rPoly[0], rBuffer );
rBuffer.append( " m\n" );
- for( USHORT i = 1; i < nPoints; i++ )
+ for( sal_uInt16 i = 1; i < nPoints; i++ )
{
if( pFlagArray && pFlagArray[i] == POLY_CONTROL && nPoints-i > 2 )
{
@@ -1559,8 +1575,8 @@ void PDFWriterImpl::PDFPage::appendPolygon( const basegfx::B2DPolygon& rPoly, OS
void PDFWriterImpl::PDFPage::appendPolyPolygon( const PolyPolygon& rPolyPoly, OStringBuffer& rBuffer, bool bClose ) const
{
- USHORT nPolygons = rPolyPoly.Count();
- for( USHORT n = 0; n < nPolygons; n++ )
+ sal_uInt16 nPolygons = rPolyPoly.Count();
+ for( sal_uInt16 n = 0; n < nPolygons; n++ )
appendPolygon( rPolyPoly[n], rBuffer, bClose );
}
@@ -1695,7 +1711,9 @@ void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal
* class PDFWriterImpl
*/
-PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext )
+ PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext,
+ const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& xEnc,
+ PDFWriter& i_rOuterFace)
:
m_pReferenceDevice( NULL ),
m_aMapMode( MAP_POINT, Point(), Fraction( 1L, pointToPixel(1) ), Fraction( 1L, pointToPixel(1) ) ),
@@ -1716,12 +1734,10 @@ PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext )
m_aCipher( (rtlCipher)NULL ),
m_aDigest( NULL ),
m_bEncryptThisStream( false ),
- m_aDocID( 32 ),
- m_aCreationDateString( 64 ),
- m_aCreationMetaDateString( 64 ),
m_pEncryptionBuffer( NULL ),
m_nEncryptionBufferSize( 0 ),
- m_bIsPDF_A1( false )
+ m_bIsPDF_A1( false ),
+ m_rOuterFace( i_rOuterFace )
{
#ifdef DO_TEST_PDF
static bool bOnce = true;
@@ -1760,14 +1776,37 @@ PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext )
m_bOpen = true;
-/* prepare the cypher engine, can be done in CTOR, free in DTOR */
+ // setup DocInfo
+ setupDocInfo();
+ /* prepare the cypher engine, can be done in CTOR, free in DTOR */
m_aCipher = rtl_cipher_createARCFOUR( rtl_Cipher_ModeStream );
m_aDigest = rtl_digest_createMD5();
-/* the size of the Codec default maximum */
+ /* the size of the Codec default maximum */
checkEncryptionBufferSize( 0x4000 );
+ if( xEnc.is() )
+ prepareEncryption( xEnc );
+
+ if( m_aContext.Encryption.Encrypt() )
+ {
+ // sanity check
+ if( m_aContext.Encryption.OValue.size() != ENCRYPTED_PWD_SIZE ||
+ m_aContext.Encryption.UValue.size() != ENCRYPTED_PWD_SIZE ||
+ m_aContext.Encryption.EncryptionKey.size() != MAXIMUM_RC4_KEY_LENGTH
+ )
+ {
+ // the field lengths are invalid ? This was not setup by initEncryption.
+ // do not encrypt after all
+ m_aContext.Encryption.OValue.clear();
+ m_aContext.Encryption.UValue.clear();
+ OSL_ENSURE( 0, "encryption data failed sanity check, encryption disabled" );
+ }
+ else // setup key lengths
+ m_nAccessPermissions = computeAccessPermissions( m_aContext.Encryption, m_nKeyLength, m_nRC4KeyLength );
+ }
+
// write header
OStringBuffer aBuffer( 20 );
aBuffer.append( "%PDF-" );
@@ -1813,139 +1852,138 @@ PDFWriterImpl::~PDFWriterImpl()
rtl_freeMemory( m_pEncryptionBuffer );
}
-void PDFWriterImpl::setDocInfo( const PDFDocInfo& rInfo )
+void PDFWriterImpl::setupDocInfo()
{
- m_aDocInfo.Title = rInfo.Title;
- m_aDocInfo.Author = rInfo.Author;
- m_aDocInfo.Subject = rInfo.Subject;
- m_aDocInfo.Keywords = rInfo.Keywords;
- m_aDocInfo.Creator = rInfo.Creator;
- m_aDocInfo.Producer = rInfo.Producer;
+ std::vector< sal_uInt8 > aId;
+ computeDocumentIdentifier( aId, m_aContext.DocumentInfo, m_aCreationDateString, m_aCreationMetaDateString );
+ if( m_aContext.Encryption.DocumentIdentifier.empty() )
+ m_aContext.Encryption.DocumentIdentifier = aId;
+}
-//build the document id
+void PDFWriterImpl::computeDocumentIdentifier( std::vector< sal_uInt8 >& o_rIdentifier,
+ const vcl::PDFWriter::PDFDocInfo& i_rDocInfo,
+ rtl::OString& o_rCString1,
+ rtl::OString& o_rCString2
+ )
+{
+ o_rIdentifier.clear();
+
+ //build the document id
rtl::OString aInfoValuesOut;
OStringBuffer aID( 1024 );
- if( m_aDocInfo.Title.Len() )
- appendUnicodeTextString( m_aDocInfo.Title, aID );
- if( m_aDocInfo.Author.Len() )
- appendUnicodeTextString( m_aDocInfo.Author, aID );
- if( m_aDocInfo.Subject.Len() )
- appendUnicodeTextString( m_aDocInfo.Subject, aID );
- if( m_aDocInfo.Keywords.Len() )
- appendUnicodeTextString( m_aDocInfo.Keywords, aID );
- if( m_aDocInfo.Creator.Len() )
- appendUnicodeTextString( m_aDocInfo.Creator, aID );
- if( m_aDocInfo.Producer.Len() )
- appendUnicodeTextString( m_aDocInfo.Producer, aID );
+ if( i_rDocInfo.Title.Len() )
+ appendUnicodeTextString( i_rDocInfo.Title, aID );
+ if( i_rDocInfo.Author.Len() )
+ appendUnicodeTextString( i_rDocInfo.Author, aID );
+ if( i_rDocInfo.Subject.Len() )
+ appendUnicodeTextString( i_rDocInfo.Subject, aID );
+ if( i_rDocInfo.Keywords.Len() )
+ appendUnicodeTextString( i_rDocInfo.Keywords, aID );
+ if( i_rDocInfo.Creator.Len() )
+ appendUnicodeTextString( i_rDocInfo.Creator, aID );
+ if( i_rDocInfo.Producer.Len() )
+ appendUnicodeTextString( i_rDocInfo.Producer, aID );
TimeValue aTVal, aGMT;
oslDateTime aDT;
osl_getSystemTime( &aGMT );
osl_getLocalTimeFromSystemTime( &aGMT, &aTVal );
osl_getDateTimeFromTimeValue( &aTVal, &aDT );
- m_aCreationDateString.append( "D:" );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/1000)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/100)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Year)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Month/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Month)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Day/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Day)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Hours/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Hours)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Minutes/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Minutes)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Seconds/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Seconds)%10)) );
-//--> i59651, we fill the Metadata date string as well, if PDF/A is requested
- if( m_bIsPDF_A1 )
- {
-// according to ISO 19005-1:2005 6.7.3 the date is corrected for
-// local time zone offset UTC only, whereas Acrobat 8 seems
-// to use the localtime notation only
-// according to a raccomandation in XMP Specification (Jan 2004, page 75)
-// the Acrobat way seems the right approach
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/1000)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/100)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year)%10)) );
- m_aCreationMetaDateString.append( "-" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Month/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Month)%10)) );
- m_aCreationMetaDateString.append( "-" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Day/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Day)%10)) );
- m_aCreationMetaDateString.append( "T" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Hours/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Hours)%10)) );
- m_aCreationMetaDateString.append( ":" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Minutes/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Minutes)%10)) );
- m_aCreationMetaDateString.append( ":" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Seconds/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Seconds)%10)) );
- }
+ rtl::OStringBuffer aCreationDateString(64), aCreationMetaDateString(64);
+ aCreationDateString.append( "D:" );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/1000)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/100)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Year)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Month/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Month)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Day/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Day)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Hours/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Hours)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Minutes/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Minutes)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Seconds/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Seconds)%10)) );
+
+ //--> i59651, we fill the Metadata date string as well, if PDF/A is requested
+ // according to ISO 19005-1:2005 6.7.3 the date is corrected for
+ // local time zone offset UTC only, whereas Acrobat 8 seems
+ // to use the localtime notation only
+ // according to a raccomandation in XMP Specification (Jan 2004, page 75)
+ // the Acrobat way seems the right approach
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/1000)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/100)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year)%10)) );
+ aCreationMetaDateString.append( "-" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Month/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Month)%10)) );
+ aCreationMetaDateString.append( "-" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Day/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Day)%10)) );
+ aCreationMetaDateString.append( "T" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Hours/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Hours)%10)) );
+ aCreationMetaDateString.append( ":" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Minutes/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Minutes)%10)) );
+ aCreationMetaDateString.append( ":" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Seconds/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Seconds)%10)) );
+
sal_uInt32 nDelta = 0;
if( aGMT.Seconds > aTVal.Seconds )
{
- m_aCreationDateString.append( "-" );
+ aCreationDateString.append( "-" );
nDelta = aGMT.Seconds-aTVal.Seconds;
- if( m_bIsPDF_A1 )
- m_aCreationMetaDateString.append( "-" );
+ aCreationMetaDateString.append( "-" );
}
else if( aGMT.Seconds < aTVal.Seconds )
{
- m_aCreationDateString.append( "+" );
+ aCreationDateString.append( "+" );
nDelta = aTVal.Seconds-aGMT.Seconds;
- if( m_bIsPDF_A1 )
- m_aCreationMetaDateString.append( "+" );
+ aCreationMetaDateString.append( "+" );
}
else
{
- m_aCreationDateString.append( "Z" );
- if( m_bIsPDF_A1 )
- m_aCreationMetaDateString.append( "Z" );
+ aCreationDateString.append( "Z" );
+ aCreationMetaDateString.append( "Z" );
}
if( nDelta )
{
- m_aCreationDateString.append( (sal_Char)('0' + ((nDelta/36000)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((nDelta/3600)%10)) );
- m_aCreationDateString.append( "'" );
- m_aCreationDateString.append( (sal_Char)('0' + ((nDelta/600)%6)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((nDelta/60)%10)) );
- if( m_bIsPDF_A1 )
- {
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/36000)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/3600)%10)) );
- m_aCreationMetaDateString.append( ":" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/600)%6)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/60)%10)) );
- }
+ aCreationDateString.append( (sal_Char)('0' + ((nDelta/36000)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((nDelta/3600)%10)) );
+ aCreationDateString.append( "'" );
+ aCreationDateString.append( (sal_Char)('0' + ((nDelta/600)%6)) );
+ aCreationDateString.append( (sal_Char)('0' + ((nDelta/60)%10)) );
+
+ aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/36000)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/3600)%10)) );
+ aCreationMetaDateString.append( ":" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/600)%6)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/60)%10)) );
}
- m_aCreationDateString.append( "'" );
- aID.append( m_aCreationDateString.getStr(), m_aCreationDateString.getLength() );
+ aCreationDateString.append( "'" );
+ aID.append( aCreationDateString.getStr(), aCreationDateString.getLength() );
aInfoValuesOut = aID.makeStringAndClear();
+ o_rCString1 = aCreationDateString.makeStringAndClear();
+ o_rCString2 = aCreationMetaDateString.makeStringAndClear();
- DBG_ASSERT( m_aDigest != NULL, "PDFWrite_Impl::setDocInfo: cannot obtain a digest object !" );
-
- m_aDocID.setLength( 0 );
- if( m_aDigest )
+ rtlDigest aDigest = rtl_digest_createMD5();
+ OSL_ENSURE( aDigest != NULL, "PDFWriterImpl::computeDocumentIdentifier: cannot obtain a digest object !" );
+ if( aDigest )
{
- osl_getSystemTime( &aGMT );
- rtlDigestError nError = rtl_digest_updateMD5( m_aDigest, &aGMT, sizeof( aGMT ) );
- if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, m_aContext.URL.getStr(), m_aContext.URL.getLength()*sizeof(sal_Unicode) );
+ rtlDigestError nError = rtl_digest_updateMD5( aDigest, &aGMT, sizeof( aGMT ) );
if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, aInfoValuesOut.getStr(), aInfoValuesOut.getLength() );
+ nError = rtl_digest_updateMD5( aDigest, aInfoValuesOut.getStr(), aInfoValuesOut.getLength() );
if( nError == rtl_Digest_E_None )
{
-//the binary form of the doc id is needed for encryption stuff
- rtl_digest_getMD5( m_aDigest, m_nDocID, 16 );
- for( unsigned int i = 0; i < 16; i++ )
- appendHex( m_nDocID[i], m_aDocID );
+ o_rIdentifier = std::vector< sal_uInt8 >( 16, 0 );
+ //the binary form of the doc id is needed for encryption stuff
+ rtl_digest_getMD5( aDigest, &o_rIdentifier[0], 16 );
}
}
}
@@ -1958,7 +1996,7 @@ append the string as unicode hex, encrypted if needed
inline void PDFWriterImpl::appendUnicodeTextStringEncrypt( const rtl::OUString& rInString, const sal_Int32 nInObjectNumber, OStringBuffer& rOutBuffer )
{
rOutBuffer.append( "<" );
- if( m_aContext.Encrypt )
+ if( m_aContext.Encryption.Encrypt() )
{
const sal_Unicode* pStr = rInString.getStr();
sal_Int32 nLen = rInString.getLength();
@@ -1995,7 +2033,7 @@ inline void PDFWriterImpl::appendLiteralStringEncrypt( rtl::OStringBuffer& rInSt
rOutBuffer.append( "(" );
sal_Int32 nChars = rInString.getLength();
//check for encryption, if ok, encrypt the string, then convert with appndLiteralString
- if( m_aContext.Encrypt && checkEncryptionBufferSize( nChars ) )
+ if( m_aContext.Encryption.Encrypt() && checkEncryptionBufferSize( nChars ) )
{
//encrypt the string in a buffer, then append it
enableStringEncryption( nInObjectNumber );
@@ -2016,22 +2054,22 @@ inline void PDFWriterImpl::appendLiteralStringEncrypt( const rtl::OString& rInSt
void PDFWriterImpl::appendLiteralStringEncrypt( const rtl::OUString& rInString, const sal_Int32 nInObjectNumber, rtl::OStringBuffer& rOutBuffer, rtl_TextEncoding nEnc )
{
rtl::OString aBufferString( rtl::OUStringToOString( rInString, nEnc ) );
- sal_Int32 nLen = aBufferString.getLength();
- rtl::OStringBuffer aBuf( nLen );
- const sal_Char* pT = aBufferString.getStr();
+ sal_Int32 nLen = aBufferString.getLength();
+ rtl::OStringBuffer aBuf( nLen );
+ const sal_Char* pT = aBufferString.getStr();
- for( sal_Int32 i = 0; i < nLen; i++, pT++ )
+ for( sal_Int32 i = 0; i < nLen; i++, pT++ )
+ {
+ if( (*pT & 0x80) == 0 )
+ aBuf.append( *pT );
+ else
{
- if( (*pT & 0x80) == 0 )
- aBuf.append( *pT );
- else
- {
- aBuf.append( '<' );
- appendHex( *pT, aBuf );
- aBuf.append( '>' );
- }
+ aBuf.append( '<' );
+ appendHex( *pT, aBuf );
+ aBuf.append( '>' );
}
- aBufferString = aBuf.makeStringAndClear();
+ }
+ aBufferString = aBuf.makeStringAndClear();
appendLiteralStringEncrypt( aBufferString, nInObjectNumber, rOutBuffer);
}
@@ -2050,12 +2088,12 @@ bool PDFWriterImpl::compressStream( SvMemoryStream* pStream )
{
#ifndef DEBUG_DISABLE_PDFCOMPRESSION
pStream->Seek( STREAM_SEEK_TO_END );
- ULONG nEndPos = pStream->Tell();
+ sal_uLong nEndPos = pStream->Tell();
pStream->Seek( STREAM_SEEK_TO_BEGIN );
ZCodec* pCodec = new ZCodec( 0x4000, 0x4000 );
SvMemoryStream aStream;
pCodec->BeginCompression();
- pCodec->Write( aStream, (const BYTE*)pStream->GetData(), nEndPos );
+ pCodec->Write( aStream, (const sal_uInt8*)pStream->GetData(), nEndPos );
pCodec->EndCompression();
delete pCodec;
nEndPos = aStream.Tell();
@@ -2114,7 +2152,7 @@ bool PDFWriterImpl::writeBuffer( const void* pBuffer, sal_uInt64 nBytes )
sal_uInt64 nWritten;
if( m_pCodec )
{
- m_pCodec->Write( *m_pMemStream, static_cast<const BYTE*>(pBuffer), (ULONG)nBytes );
+ m_pCodec->Write( *m_pMemStream, static_cast<const sal_uInt8*>(pBuffer), (sal_uLong)nBytes );
nWritten = nBytes;
}
else
@@ -2156,13 +2194,16 @@ OutputDevice* PDFWriterImpl::getReferenceDevice()
m_pReferenceDevice = pVDev;
- pVDev->SetReferenceDevice( VirtualDevice::REFDEV_MODE_PDF1 );
+ if( m_aContext.DPIx == 0 || m_aContext.DPIy == 0 )
+ pVDev->SetReferenceDevice( VirtualDevice::REFDEV_MODE_PDF1 );
+ else
+ pVDev->SetReferenceDevice( m_aContext.DPIx, m_aContext.DPIy );
pVDev->SetOutputSizePixel( Size( 640, 480 ) );
pVDev->SetMapMode( MAP_MM );
m_pReferenceDevice->mpPDFWriter = this;
- m_pReferenceDevice->ImplUpdateFontData( TRUE );
+ m_pReferenceDevice->ImplUpdateFontData( sal_True );
}
return m_pReferenceDevice;
}
@@ -2398,9 +2439,6 @@ SalLayout* PDFWriterImpl::GetTextLayout( ImplLayoutArgs& rArgs, ImplFontSelectDa
sal_Int32 PDFWriterImpl::newPage( sal_Int32 nPageWidth, sal_Int32 nPageHeight, PDFWriter::Orientation eOrientation )
{
- if( m_aContext.Encrypt && m_aPages.empty() )
- initEncryption();
-
endPage();
m_nCurrentPage = m_aPages.size();
m_aPages.push_back( PDFPage(this, nPageWidth, nPageHeight, eOrientation ) );
@@ -2938,12 +2976,9 @@ bool PDFWriterImpl::emitTilings()
aTilingObj.setLength( 0 );
-#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( "PDFWriterImpl::emitTilings" );
- emitComment( aLine.getStr() );
- }
-#endif
+ #if OSL_DEBUG_LEVEL > 1
+ emitComment( "PDFWriterImpl::emitTilings" );
+ #endif
sal_Int32 nX = (sal_Int32)it->m_aRectangle.Left();
sal_Int32 nY = (sal_Int32)it->m_aRectangle.Top();
@@ -3428,10 +3463,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
// now we can actually write the font stream !
#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( " PDFWriterImpl::emitEmbeddedFont" );
- emitComment( aLine.getStr() );
- }
+ emitComment( " PDFWriterImpl::emitEmbeddedFont" );
#endif
OStringBuffer aLine( 512 );
nStreamObject = createObject();
@@ -3850,17 +3882,14 @@ sal_Int32 PDFWriterImpl::createToUnicodeCMap( sal_uInt8* pEncoding,
ZCodec* pCodec = new ZCodec( 0x4000, 0x4000 );
SvMemoryStream aStream;
pCodec->BeginCompression();
- pCodec->Write( aStream, (const BYTE*)aContents.getStr(), aContents.getLength() );
+ pCodec->Write( aStream, (const sal_uInt8*)aContents.getStr(), aContents.getLength() );
pCodec->EndCompression();
delete pCodec;
#endif
-#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( " PDFWriterImpl::createToUnicodeCMap" );
- emitComment( aLine.getStr() );
- }
-#endif
+ #if OSL_DEBUG_LEVEL > 1
+ emitComment( "PDFWriterImpl::createToUnicodeCMap" );
+ #endif
OStringBuffer aLine( 40 );
aLine.append( nStream );
@@ -4047,10 +4076,7 @@ bool PDFWriterImpl::emitFonts()
CHECK_RETURN( (osl_File_E_None == osl_setFilePos( aFontFile, osl_Pos_Absolut, 0 ) ) );
#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine1( " PDFWriterImpl::emitFonts" );
- emitComment( aLine1.getStr() );
- }
+ emitComment( "PDFWriterImpl::emitFonts" );
#endif
sal_Int32 nFontStream = createObject();
sal_Int32 nStreamLengthObject = createObject();
@@ -4674,7 +4700,7 @@ we check in the following sequence:
appendLiteralStringEncrypt( bSetRelative ? INetURLObject::GetRelURL( m_aContext.BaseURL, aURLNoMark,
INetURLObject::WAS_ENCODED,
INetURLObject::DECODE_WITH_CHARSET ) :
- aURLNoMark, rLink.m_nObject, aLine, osl_getThreadTextEncoding() );
+ aURLNoMark, rLink.m_nObject, aLine, osl_getThreadTextEncoding() );
if( aFragment.getLength() > 0 )
{
aLine.append("/D/");
@@ -5326,12 +5352,9 @@ bool PDFWriterImpl::emitAppearances( PDFWidget& rWidget, OStringBuffer& rAnnotDi
pApppearanceStream->Seek( STREAM_SEEK_TO_BEGIN );
sal_Int32 nObject = createObject();
CHECK_RETURN( updateObject( nObject ) );
-#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( " PDFWriterImpl::emitAppearances" );
- emitComment( aLine.getStr() );
- }
-#endif
+ #if OSL_DEBUG_LEVEL > 1
+ emitComment( "PDFWriterImpl::emitAppearances" );
+ #endif
OStringBuffer aLine;
aLine.append( nObject );
@@ -5871,7 +5894,7 @@ bool PDFWriterImpl::emitCatalog()
}
// viewer preferences, if we had some, then emit
if( m_aContext.HideViewerToolbar ||
- ( m_aContext.Version > PDFWriter::PDF_1_3 && m_aDocInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle ) ||
+ ( m_aContext.Version > PDFWriter::PDF_1_3 && m_aContext.DocumentInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle ) ||
m_aContext.HideViewerMenubar ||
m_aContext.HideViewerWindowControls || m_aContext.FitWindow ||
m_aContext.CenterWindow || (m_aContext.FirstPageLeft && m_aContext.PageLayout == PDFWriter::ContinuousFacing ) ||
@@ -5888,7 +5911,7 @@ bool PDFWriterImpl::emitCatalog()
aLine.append( "/FitWindow true\n" );
if( m_aContext.CenterWindow )
aLine.append( "/CenterWindow true\n" );
- if( m_aContext.Version > PDFWriter::PDF_1_3 && m_aDocInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle )
+ if( m_aContext.Version > PDFWriter::PDF_1_3 && m_aContext.DocumentInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle )
aLine.append( "/DisplayDocTitle true\n" );
if( m_aContext.FirstPageLeft && m_aContext.PageLayout == PDFWriter::ContinuousFacing )
aLine.append( "/Direction/R2L\n" );
@@ -5992,40 +6015,40 @@ sal_Int32 PDFWriterImpl::emitInfoDict( )
aLine.append( nObject );
aLine.append( " 0 obj\n"
"<<" );
- if( m_aDocInfo.Title.Len() )
+ if( m_aContext.DocumentInfo.Title.Len() )
{
aLine.append( "/Title" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Title, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Title, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aDocInfo.Author.Len() )
+ if( m_aContext.DocumentInfo.Author.Len() )
{
aLine.append( "/Author" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Author, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Author, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aDocInfo.Subject.Len() )
+ if( m_aContext.DocumentInfo.Subject.Len() )
{
aLine.append( "/Subject" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Subject, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Subject, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aDocInfo.Keywords.Len() )
+ if( m_aContext.DocumentInfo.Keywords.Len() )
{
aLine.append( "/Keywords" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Keywords, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Keywords, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aDocInfo.Creator.Len() )
+ if( m_aContext.DocumentInfo.Creator.Len() )
{
aLine.append( "/Creator" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Creator, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Creator, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aDocInfo.Producer.Len() )
+ if( m_aContext.DocumentInfo.Producer.Len() )
{
aLine.append( "/Producer" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Producer, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Producer, nObject, aLine );
aLine.append( "\n" );
}
@@ -6271,45 +6294,45 @@ sal_Int32 PDFWriterImpl::emitDocumentMetadata()
aMetadataStream.append( " <pdfaid:conformance>A</pdfaid:conformance>\n" );
aMetadataStream.append( " </rdf:Description>\n" );
//... Dublin Core properties go here
- if( m_aDocInfo.Title.Len() ||
- m_aDocInfo.Author.Len() ||
- m_aDocInfo.Subject.Len() )
+ if( m_aContext.DocumentInfo.Title.Len() ||
+ m_aContext.DocumentInfo.Author.Len() ||
+ m_aContext.DocumentInfo.Subject.Len() )
{
aMetadataStream.append( " <rdf:Description rdf:about=\"\"\n" );
aMetadataStream.append( " xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n" );
- if( m_aDocInfo.Title.Len() )
+ if( m_aContext.DocumentInfo.Title.Len() )
{
// this is according to PDF/A-1, technical corrigendum 1 (2007-04-01)
aMetadataStream.append( " <dc:title>\n" );
aMetadataStream.append( " <rdf:Alt>\n" );
aMetadataStream.append( " <rdf:li xml:lang=\"x-default\">" );
rtl::OUString aTitle;
- escapeStringXML( m_aDocInfo.Title, aTitle );
+ escapeStringXML( m_aContext.DocumentInfo.Title, aTitle );
aMetadataStream.append( OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</rdf:li>\n" );
aMetadataStream.append( " </rdf:Alt>\n" );
aMetadataStream.append( " </dc:title>\n" );
}
- if( m_aDocInfo.Author.Len() )
+ if( m_aContext.DocumentInfo.Author.Len() )
{
aMetadataStream.append( " <dc:creator>\n" );
aMetadataStream.append( " <rdf:Seq>\n" );
aMetadataStream.append( " <rdf:li>" );
rtl::OUString aAuthor;
- escapeStringXML( m_aDocInfo.Author, aAuthor );
+ escapeStringXML( m_aContext.DocumentInfo.Author, aAuthor );
aMetadataStream.append( OUStringToOString( aAuthor , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</rdf:li>\n" );
aMetadataStream.append( " </rdf:Seq>\n" );
aMetadataStream.append( " </dc:creator>\n" );
}
- if( m_aDocInfo.Subject.Len() )
+ if( m_aContext.DocumentInfo.Subject.Len() )
{
// this is according to PDF/A-1, technical corrigendum 1 (2007-04-01)
aMetadataStream.append( " <dc:description>\n" );
aMetadataStream.append( " <rdf:Alt>\n" );
aMetadataStream.append( " <rdf:li xml:lang=\"x-default\">" );
rtl::OUString aSubject;
- escapeStringXML( m_aDocInfo.Subject, aSubject );
+ escapeStringXML( m_aContext.DocumentInfo.Subject, aSubject );
aMetadataStream.append( OUStringToOString( aSubject , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</rdf:li>\n" );
aMetadataStream.append( " </rdf:Alt>\n" );
@@ -6319,24 +6342,24 @@ sal_Int32 PDFWriterImpl::emitDocumentMetadata()
}
//... PDF properties go here
- if( m_aDocInfo.Producer.Len() ||
- m_aDocInfo.Keywords.Len() )
+ if( m_aContext.DocumentInfo.Producer.Len() ||
+ m_aContext.DocumentInfo.Keywords.Len() )
{
aMetadataStream.append( " <rdf:Description rdf:about=\"\"\n" );
aMetadataStream.append( " xmlns:pdf=\"http://ns.adobe.com/pdf/1.3/\">\n" );
- if( m_aDocInfo.Producer.Len() )
+ if( m_aContext.DocumentInfo.Producer.Len() )
{
aMetadataStream.append( " <pdf:Producer>" );
rtl::OUString aProducer;
- escapeStringXML( m_aDocInfo.Producer, aProducer );
+ escapeStringXML( m_aContext.DocumentInfo.Producer, aProducer );
aMetadataStream.append( OUStringToOString( aProducer , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</pdf:Producer>\n" );
}
- if( m_aDocInfo.Keywords.Len() )
+ if( m_aContext.DocumentInfo.Keywords.Len() )
{
aMetadataStream.append( " <pdf:Keywords>" );
rtl::OUString aKeywords;
- escapeStringXML( m_aDocInfo.Keywords, aKeywords );
+ escapeStringXML( m_aContext.DocumentInfo.Keywords, aKeywords );
aMetadataStream.append( OUStringToOString( aKeywords , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</pdf:Keywords>\n" );
}
@@ -6345,11 +6368,11 @@ sal_Int32 PDFWriterImpl::emitDocumentMetadata()
aMetadataStream.append( " <rdf:Description rdf:about=\"\"\n" );
aMetadataStream.append( " xmlns:xmp=\"http://ns.adobe.com/xap/1.0/\">\n" );
- if( m_aDocInfo.Creator.Len() )
+ if( m_aContext.DocumentInfo.Creator.Len() )
{
aMetadataStream.append( " <xmp:CreatorTool>" );
rtl::OUString aCreator;
- escapeStringXML( m_aDocInfo.Creator, aCreator );
+ escapeStringXML( m_aContext.DocumentInfo.Creator, aCreator );
aMetadataStream.append( OUStringToOString( aCreator , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</xmp:CreatorTool>\n" );
}
@@ -6405,7 +6428,7 @@ bool PDFWriterImpl::emitTrailer()
sal_Int32 nSecObject = 0;
- if( m_aContext.Encrypt == true )
+ if( m_aContext.Encryption.Encrypt() )
{
//emit the security information
//must be emitted as indirect dictionary object, since
@@ -6419,16 +6442,16 @@ bool PDFWriterImpl::emitTrailer()
aLineS.append( " 0 obj\n"
"<</Filter/Standard/V " );
// check the version
- if( m_aContext.Security128bit == true )
+ if( m_aContext.Encryption.Security128bit )
aLineS.append( "2/Length 128/R 3" );
else
aLineS.append( "1/R 2" );
// emit the owner password, must not be encrypted
aLineS.append( "/O(" );
- appendLiteralString( (const sal_Char*)m_nEncryptedOwnerPassword, 32, aLineS );
+ appendLiteralString( (const sal_Char*)&m_aContext.Encryption.OValue[0], sal_Int32(m_aContext.Encryption.OValue.size()), aLineS );
aLineS.append( ")/U(" );
- appendLiteralString( (const sal_Char*)m_nEncryptedUserPassword, 32, aLineS );
+ appendLiteralString( (const sal_Char*)&m_aContext.Encryption.UValue[0], sal_Int32(m_aContext.Encryption.UValue.size()), aLineS );
aLineS.append( ")/P " );// the permission set
aLineS.append( m_nAccessPermissions );
aLineS.append( ">>\nendobj\n\n" );
@@ -6494,13 +6517,21 @@ bool PDFWriterImpl::emitTrailer()
aLine.append( nDocInfoObject );
aLine.append( " 0 R\n" );
}
- if( m_aDocID.getLength() )
+ if( ! m_aContext.Encryption.DocumentIdentifier.empty() )
{
aLine.append( "/ID [ <" );
- aLine.append( m_aDocID.getStr(), m_aDocID.getLength() );
+ for( std::vector< sal_uInt8 >::const_iterator it = m_aContext.Encryption.DocumentIdentifier.begin();
+ it != m_aContext.Encryption.DocumentIdentifier.end(); ++it )
+ {
+ appendHex( sal_Int8(*it), aLine );
+ }
aLine.append( ">\n"
"<" );
- aLine.append( m_aDocID.getStr(), m_aDocID.getLength() );
+ for( std::vector< sal_uInt8 >::const_iterator it = m_aContext.Encryption.DocumentIdentifier.begin();
+ it != m_aContext.Encryption.DocumentIdentifier.end(); ++it )
+ {
+ appendHex( sal_Int8(*it), aLine );
+ }
aLine.append( "> ]\n" );
}
if( aDocChecksum.getLength() )
@@ -6987,7 +7018,7 @@ void PDFWriterImpl::drawRelief( SalLayout& rLayout, const String& rText, bool bT
Font aSetFont = m_aCurrentPDFState.m_aFont;
aSetFont.SetRelief( RELIEF_NONE );
- aSetFont.SetShadow( FALSE );
+ aSetFont.SetShadow( sal_False );
aSetFont.SetColor( aReliefColor );
setTextLineColor( aReliefColor );
@@ -7024,8 +7055,8 @@ void PDFWriterImpl::drawShadow( SalLayout& rLayout, const String& rText, bool bT
rFont.SetColor( Color( COL_LIGHTGRAY ) );
else
rFont.SetColor( Color( COL_BLACK ) );
- rFont.SetShadow( FALSE );
- rFont.SetOutline( FALSE );
+ rFont.SetShadow( sal_False );
+ rFont.SetOutline( sal_False );
setFont( rFont );
setTextLineColor( rFont.GetColor() );
setOverlineColor( rFont.GetColor() );
@@ -7479,7 +7510,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT
)
)
{
- BOOL bUnderlineAbove = OutputDevice::ImplIsUnderlineAbove( m_aCurrentPDFState.m_aFont );
+ sal_Bool bUnderlineAbove = OutputDevice::ImplIsUnderlineAbove( m_aCurrentPDFState.m_aFont );
if( m_aCurrentPDFState.m_aFont.IsWordLineMode() )
{
Point aPos, aStartPt;
@@ -7532,7 +7563,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT
long nEmphYOff;
long nEmphWidth;
long nEmphHeight;
- BOOL bEmphPolyLine;
+ sal_Bool bEmphPolyLine;
FontEmphasisMark nEmphMark;
push( PUSH_ALL );
@@ -7613,7 +7644,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT
}
void PDFWriterImpl::drawEmphasisMark( long nX, long nY,
- const PolyPolygon& rPolyPoly, BOOL bPolyLine,
+ const PolyPolygon& rPolyPoly, sal_Bool bPolyLine,
const Rectangle& rRect1, const Rectangle& rRect2 )
{
// TODO: pass nWidth as width of this mark
@@ -7683,7 +7714,7 @@ void PDFWriterImpl::drawTextArray( const Point& rPos, const String& rText, const
}
}
-void PDFWriterImpl::drawStretchText( const Point& rPos, ULONG nWidth, const String& rText, xub_StrLen nIndex, xub_StrLen nLen, bool bTextLines )
+void PDFWriterImpl::drawStretchText( const Point& rPos, sal_uLong nWidth, const String& rText, xub_StrLen nIndex, xub_StrLen nLen, bool bTextLines )
{
MARK( "drawStretchText" );
@@ -7699,7 +7730,7 @@ void PDFWriterImpl::drawStretchText( const Point& rPos, ULONG nWidth, const Stri
}
}
-void PDFWriterImpl::drawText( const Rectangle& rRect, const String& rOrigStr, USHORT nStyle, bool bTextLines )
+void PDFWriterImpl::drawText( const Rectangle& rRect, const String& rOrigStr, sal_uInt16 nStyle, bool bTextLines )
{
long nWidth = rRect.GetWidth();
long nHeight = rRect.GetHeight();
@@ -8242,17 +8273,17 @@ void PDFWriterImpl::drawStrikeoutChar( const Point& rPos, long nWidth, FontStrik
while( m_pReferenceDevice->GetTextWidth( aStrikeout ) >= nWidth )
aStrikeout.Erase( 0, 1 );
aStrikeout.Append( aStrikeoutChar );
- BOOL bShadow = m_aCurrentPDFState.m_aFont.IsShadow();
+ sal_Bool bShadow = m_aCurrentPDFState.m_aFont.IsShadow();
if ( bShadow )
{
Font aFont = m_aCurrentPDFState.m_aFont;
- aFont.SetShadow( FALSE );
+ aFont.SetShadow( sal_False );
setFont( aFont );
updateGraphicsState();
}
// strikeout string is left aligned non-CTL text
- ULONG nOrigTLM = m_pReferenceDevice->GetLayoutMode();
+ sal_uLong nOrigTLM = m_pReferenceDevice->GetLayoutMode();
m_pReferenceDevice->SetLayoutMode( TEXT_LAYOUT_BIDI_STRONG|TEXT_LAYOUT_COMPLEX_DISABLED );
drawText( rPos, aStrikeout, 0, aStrikeout.Len(), false );
m_pReferenceDevice->SetLayoutMode( nOrigTLM );
@@ -8260,7 +8291,7 @@ void PDFWriterImpl::drawStrikeoutChar( const Point& rPos, long nWidth, FontStrik
if ( bShadow )
{
Font aFont = m_aCurrentPDFState.m_aFont;
- aFont.SetShadow( TRUE );
+ aFont.SetShadow( sal_True );
setFont( aFont );
updateGraphicsState();
}
@@ -8927,7 +8958,7 @@ void PDFWriterImpl::drawPolyLine( const Polygon& rPoly )
{
MARK( "drawPolyLine" );
- USHORT nPoints = rPoly.GetSize();
+ sal_uInt16 nPoints = rPoly.GetSize();
if( nPoints < 2 )
return;
@@ -9120,7 +9151,7 @@ void PDFWriterImpl::drawPolyLine( const Polygon& rPoly, const PDFWriter::ExtLine
aBoundRect.Right() += nLW;
aBoundRect.Bottom() += nLW;
}
- endTransparencyGroup( aBoundRect, (USHORT)(100.0*rInfo.m_fTransparency) );
+ endTransparencyGroup( aBoundRect, (sal_uInt16)(100.0*rInfo.m_fTransparency) );
}
}
@@ -9161,7 +9192,7 @@ void PDFWriterImpl::drawPixel( const Polygon& rPoints, const Color* pColors )
if( m_aGraphicsStack.front().m_aLineColor == Color( COL_TRANSPARENT ) && ! pColors )
return;
- USHORT nPoints = rPoints.GetSize();
+ sal_uInt16 nPoints = rPoints.GetSize();
OStringBuffer aLine( nPoints*40 );
aLine.append( "q " );
if( ! pColors )
@@ -9176,7 +9207,7 @@ void PDFWriterImpl::drawPixel( const Polygon& rPoints, const Color* pColors )
aPixel.append( ' ' );
appendDouble( 1.0/double(getReferenceDevice()->ImplGetDPIY()), aPixel );
OString aPixelStr = aPixel.makeStringAndClear();
- for( USHORT i = 0; i < nPoints; i++ )
+ for( sal_uInt16 i = 0; i < nPoints; i++ )
{
if( pColors )
{
@@ -9208,14 +9239,11 @@ bool PDFWriterImpl::writeTransparentObject( TransparencyEmit& rObject )
bool bFlateFilter = compressStream( rObject.m_pContentStream );
rObject.m_pContentStream->Seek( STREAM_SEEK_TO_END );
- ULONG nSize = rObject.m_pContentStream->Tell();
+ sal_uLong nSize = rObject.m_pContentStream->Tell();
rObject.m_pContentStream->Seek( STREAM_SEEK_TO_BEGIN );
-#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( " PDFWriterImpl::writeTransparentObject" );
- emitComment( aLine.getStr() );
- }
-#endif
+ #if OSL_DEBUG_LEVEL > 1
+ emitComment( "PDFWriterImpl::writeTransparentObject" );
+ #endif
OStringBuffer aLine( 512 );
CHECK_RETURN( updateObject( rObject.m_nObject ) );
aLine.append( rObject.m_nObject );
@@ -9348,28 +9376,25 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject )
sal_Int32 nFunctionObject = createObject();
CHECK_RETURN( updateObject( nFunctionObject ) );
- OutputDevice* pRefDevice = getReferenceDevice();
- pRefDevice->Push( PUSH_ALL );
- if( rObject.m_aSize.Width() > pRefDevice->GetOutputSizePixel().Width() )
- rObject.m_aSize.Width() = pRefDevice->GetOutputSizePixel().Width();
- if( rObject.m_aSize.Height() > pRefDevice->GetOutputSizePixel().Height() )
- rObject.m_aSize.Height() = pRefDevice->GetOutputSizePixel().Height();
- pRefDevice->SetMapMode( MapMode( MAP_PIXEL ) );
- pRefDevice->DrawGradient( Rectangle( Point( 0, 0 ), rObject.m_aSize ), rObject.m_aGradient );
+ VirtualDevice aDev;
+ aDev.SetOutputSizePixel( rObject.m_aSize );
+ aDev.SetMapMode( MapMode( MAP_PIXEL ) );
+ if( m_aContext.ColorMode == PDFWriter::DrawGreyscale )
+ aDev.SetDrawMode( aDev.GetDrawMode() |
+ ( DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_GRAYTEXT |
+ DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT ) );
+ aDev.DrawGradient( Rectangle( Point( 0, 0 ), rObject.m_aSize ), rObject.m_aGradient );
- Bitmap aSample = pRefDevice->GetBitmap( Point( 0, 0 ), rObject.m_aSize );
+ Bitmap aSample = aDev.GetBitmap( Point( 0, 0 ), rObject.m_aSize );
BitmapReadAccess* pAccess = aSample.AcquireReadAccess();
AccessReleaser aReleaser( pAccess );
Size aSize = aSample.GetSizePixel();
sal_Int32 nStreamLengthObject = createObject();
-#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( " PDFWriterImpl::writeGradientFunction" );
- emitComment( aLine.getStr() );
- }
-#endif
+ #if OSL_DEBUG_LEVEL > 1
+ emitComment( "PDFWriterImpl::writeGradientFunction" );
+ #endif
OStringBuffer aLine( 120 );
aLine.append( nFunctionObject );
aLine.append( " 0 obj\n"
@@ -9382,6 +9407,7 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject )
aLine.append( " ]\n"
"/BitsPerSample 8\n"
"/Range[ 0 1 0 1 0 1 ]\n"
+ "/Order 3\n"
"/Length " );
aLine.append( nStreamLengthObject );
aLine.append( " 0 R\n"
@@ -9397,7 +9423,7 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject )
checkAndEnableStreamEncryption( nFunctionObject );
beginCompression();
- for( int y = 0; y < aSize.Height(); y++ )
+ for( int y = aSize.Height()-1; y >= 0; y-- )
{
for( int x = 0; x < aSize.Width(); x++ )
{
@@ -9448,8 +9474,6 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject )
"endobj\n\n" );
CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) );
- pRefDevice->Pop();
-
return true;
}
@@ -9478,12 +9502,9 @@ bool PDFWriterImpl::writeJPG( JPGEmit& rObject )
m_aErrors.insert( PDFWriter::Warning_Transparency_Omitted_PDF13 );
}
-#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( " PDFWriterImpl::writeJPG" );
- emitComment( aLine.getStr() );
- }
-#endif
+ #if OSL_DEBUG_LEVEL > 1
+ emitComment( "PDFWriterImpl::writeJPG" );
+ #endif
OStringBuffer aLine(200);
aLine.append( rObject.m_nObject );
@@ -9603,26 +9624,32 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
sal_Int32 nStreamLengthObject = createObject();
sal_Int32 nMaskObject = 0;
-#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( " PDFWriterImpl::writeBitmapObject" );
- emitComment( aLine.getStr() );
- }
-#endif
+ #if OSL_DEBUG_LEVEL > 1
+ emitComment( "PDFWriterImpl::writeBitmapObject" );
+ #endif
OStringBuffer aLine(1024);
aLine.append( rObject.m_nObject );
aLine.append( " 0 obj\n"
"<</Type/XObject/Subtype/Image/Width " );
aLine.append( (sal_Int32)aBitmap.GetSizePixel().Width() );
- aLine.append( " /Height " );
+ aLine.append( "/Height " );
aLine.append( (sal_Int32)aBitmap.GetSizePixel().Height() );
- aLine.append( " /BitsPerComponent " );
+ aLine.append( "/BitsPerComponent " );
aLine.append( nBitsPerComponent );
- aLine.append( " /Length " );
+ aLine.append( "/Length " );
aLine.append( nStreamLengthObject );
aLine.append( " 0 R\n" );
#ifndef DEBUG_DISABLE_PDFCOMPRESSION
- aLine.append( "/Filter/FlateDecode" );
+ if( nBitsPerComponent != 1 )
+ {
+ aLine.append( "/Filter/FlateDecode" );
+ }
+ else
+ {
+ aLine.append( "/Filter/CCITTFaxDecode/DecodeParms<</K -1/BlackIs1 true/Columns " );
+ aLine.append( (sal_Int32)aBitmap.GetSizePixel().Width() );
+ aLine.append( ">>\n" );
+ }
#endif
if( ! bMask )
{
@@ -9646,7 +9673,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
aLine.append( "[ /Indexed/DeviceRGB " );
aLine.append( (sal_Int32)(pAccess->GetPaletteEntryCount()-1) );
aLine.append( "\n<" );
- if( m_aContext.Encrypt )
+ if( m_aContext.Encryption.Encrypt() )
{
enableStringEncryption( rObject.m_nObject );
//check encryption buffer size
@@ -9654,7 +9681,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
{
int nChar = 0;
//fill the encryption buffer
- for( USHORT i = 0; i < pAccess->GetPaletteEntryCount(); i++ )
+ for( sal_uInt16 i = 0; i < pAccess->GetPaletteEntryCount(); i++ )
{
const BitmapColor& rColor = pAccess->GetPaletteColor( i );
m_pEncryptionBuffer[nChar++] = rColor.GetRed();
@@ -9665,7 +9692,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
rtl_cipher_encodeARCFOUR( m_aCipher, m_pEncryptionBuffer, nChar, m_pEncryptionBuffer, nChar );
//now queue the data for output
nChar = 0;
- for( USHORT i = 0; i < pAccess->GetPaletteEntryCount(); i++ )
+ for( sal_uInt16 i = 0; i < pAccess->GetPaletteEntryCount(); i++ )
{
appendHex(m_pEncryptionBuffer[nChar++], aLine );
appendHex(m_pEncryptionBuffer[nChar++], aLine );
@@ -9675,7 +9702,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
}
else //no encryption requested (PDF/A-1a program flow drops here)
{
- for( USHORT i = 0; i < pAccess->GetPaletteEntryCount(); i++ )
+ for( sal_uInt16 i = 0; i < pAccess->GetPaletteEntryCount(); i++ )
{
const BitmapColor& rColor = pAccess->GetPaletteColor( i );
appendHex( rColor.GetRed(), aLine );
@@ -9690,7 +9717,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
{
if( aBitmap.GetBitCount() == 1 )
{
- aLine.append( " /ImageMask true\n" );
+ aLine.append( "/ImageMask true\n" );
sal_Int32 nBlackIndex = pAccess->GetBestPaletteIndex( BitmapColor( Color( COL_BLACK ) ) );
DBG_ASSERT( nBlackIndex == 0 || nBlackIndex == 1, "wrong black index" );
if( nBlackIndex )
@@ -9752,33 +9779,42 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
CHECK_RETURN( (osl_File_E_None == osl_getFilePos( m_aFile, &nStartPos )) );
checkAndEnableStreamEncryption( rObject.m_nObject );
- beginCompression();
- if( ! bTrueColor || pAccess->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB )
+#ifndef DEBUG_DISABLE_PDFCOMPRESSION
+ if( nBitsPerComponent == 1 )
{
- const int nScanLineBytes = 1 + ( pAccess->GetBitCount() * ( pAccess->Width() - 1 ) / 8U );
-
- for( int i = 0; i < pAccess->Height(); i++ )
- {
- CHECK_RETURN( writeBuffer( pAccess->GetScanline( i ), nScanLineBytes ) );
- }
+ writeG4Stream( pAccess );
}
else
+#endif
{
- const int nScanLineBytes = pAccess->Width()*3;
- boost::shared_array<sal_uInt8> pCol( new sal_uInt8[ nScanLineBytes ] );
- for( int y = 0; y < pAccess->Height(); y++ )
+ beginCompression();
+ if( ! bTrueColor || pAccess->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB )
{
- for( int x = 0; x < pAccess->Width(); x++ )
+ const int nScanLineBytes = 1 + ( pAccess->GetBitCount() * ( pAccess->Width() - 1 ) / 8U );
+
+ for( int i = 0; i < pAccess->Height(); i++ )
{
- BitmapColor aColor = pAccess->GetColor( y, x );
- pCol[3*x+0] = aColor.GetRed();
- pCol[3*x+1] = aColor.GetGreen();
- pCol[3*x+2] = aColor.GetBlue();
+ CHECK_RETURN( writeBuffer( pAccess->GetScanline( i ), nScanLineBytes ) );
}
- CHECK_RETURN( writeBuffer( pCol.get(), nScanLineBytes ) );
}
+ else
+ {
+ const int nScanLineBytes = pAccess->Width()*3;
+ boost::shared_array<sal_uInt8> pCol( new sal_uInt8[ nScanLineBytes ] );
+ for( int y = 0; y < pAccess->Height(); y++ )
+ {
+ for( int x = 0; x < pAccess->Width(); x++ )
+ {
+ BitmapColor aColor = pAccess->GetColor( y, x );
+ pCol[3*x+0] = aColor.GetRed();
+ pCol[3*x+1] = aColor.GetGreen();
+ pCol[3*x+2] = aColor.GetBlue();
+ }
+ CHECK_RETURN( writeBuffer( pCol.get(), nScanLineBytes ) );
+ }
+ }
+ endCompression();
}
- endCompression();
disableStreamEncryption();
sal_uInt64 nEndPos = 0;
@@ -9818,8 +9854,25 @@ void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const
if( ! (rSizePixel.Width() && rSizePixel.Height()) )
return;
- SvMemoryStream* pStream = new SvMemoryStream;
rDCTData.Seek( 0 );
+ if( bIsTrueColor && m_aContext.ColorMode == PDFWriter::DrawGreyscale )
+ {
+ // need to convert to grayscale;
+ // load stream to bitmap and draw the bitmap instead
+ Graphic aGraphic;
+ GraphicConverter::Import( rDCTData, aGraphic, CVT_JPG );
+ Bitmap aBmp( aGraphic.GetBitmap() );
+ if( !!rMask && rMask.GetSizePixel() == aBmp.GetSizePixel() )
+ {
+ BitmapEx aBmpEx( aBmp, rMask );
+ drawBitmap( rTargetArea.TopLeft(), rTargetArea.GetSize(), aBmpEx );
+ }
+ else
+ drawBitmap( rTargetArea.TopLeft(), rTargetArea.GetSize(), aBmp );
+ return;
+ }
+
+ SvMemoryStream* pStream = new SvMemoryStream;
*pStream << rDCTData;
pStream->Seek( STREAM_SEEK_TO_END );
@@ -9910,18 +9963,28 @@ void PDFWriterImpl::drawBitmap( const Point& rDestPoint, const Size& rDestSize,
writeBuffer( aLine.getStr(), aLine.getLength() );
}
-const PDFWriterImpl::BitmapEmit& PDFWriterImpl::createBitmapEmit( const BitmapEx& rBitmap, bool bDrawMask )
+const PDFWriterImpl::BitmapEmit& PDFWriterImpl::createBitmapEmit( const BitmapEx& i_rBitmap, bool bDrawMask )
{
+ BitmapEx aBitmap( i_rBitmap );
+ if( m_aContext.ColorMode == PDFWriter::DrawGreyscale )
+ {
+ BmpConversion eConv = BMP_CONVERSION_8BIT_GREYS;
+ int nDepth = aBitmap.GetBitmap().GetBitCount();
+ if( nDepth <= 4 )
+ eConv = BMP_CONVERSION_4BIT_GREYS;
+ if( nDepth > 1 )
+ aBitmap.Convert( eConv );
+ }
BitmapID aID;
- aID.m_aPixelSize = rBitmap.GetSizePixel();
- aID.m_nSize = rBitmap.GetBitCount();
- aID.m_nChecksum = rBitmap.GetBitmap().GetChecksum();
+ aID.m_aPixelSize = aBitmap.GetSizePixel();
+ aID.m_nSize = aBitmap.GetBitCount();
+ aID.m_nChecksum = aBitmap.GetBitmap().GetChecksum();
aID.m_nMaskChecksum = 0;
- if( rBitmap.IsAlpha() )
- aID.m_nMaskChecksum = rBitmap.GetAlpha().GetChecksum();
+ if( aBitmap.IsAlpha() )
+ aID.m_nMaskChecksum = aBitmap.GetAlpha().GetChecksum();
else
{
- Bitmap aMask = rBitmap.GetMask();
+ Bitmap aMask = aBitmap.GetMask();
if( ! aMask.IsEmpty() )
aID.m_nMaskChecksum = aMask.GetChecksum();
}
@@ -9935,7 +9998,7 @@ const PDFWriterImpl::BitmapEmit& PDFWriterImpl::createBitmapEmit( const BitmapEx
{
m_aBitmaps.push_front( BitmapEmit() );
m_aBitmaps.front().m_aID = aID;
- m_aBitmaps.front().m_aBitmap = rBitmap;
+ m_aBitmaps.front().m_aBitmap = aBitmap;
m_aBitmaps.front().m_nObject = createObject();
m_aBitmaps.front().m_bDrawMask = bDrawMask;
it = m_aBitmaps.begin();
@@ -9998,15 +10061,16 @@ sal_Int32 PDFWriterImpl::createGradient( const Gradient& rGradient, const Size&
rSize ) );
// check if we already have this gradient
std::list<GradientEmit>::iterator it;
+ // rounding to point will generally lose some pixels
+ // round up to point boundary
+ aPtSize.Width()++;
+ aPtSize.Height()++;
for( it = m_aGradients.begin(); it != m_aGradients.end(); ++it )
{
if( it->m_aGradient == rGradient )
{
- if( it->m_aSize.Width() < aPtSize.Width() )
- it->m_aSize.Width() = aPtSize.Width();
- if( it->m_aSize.Height() <= aPtSize.Height() )
- it->m_aSize.Height() = aPtSize.Height();
- break;
+ if( it->m_aSize == aPtSize )
+ break;
}
}
if( it == m_aGradients.end() )
@@ -10081,12 +10145,12 @@ void PDFWriterImpl::drawGradient( const PolyPolygon& rPolyPoly, const Gradient&
return;
}
- sal_Int32 nGradient = createGradient( rGradient, rPolyPoly.GetBoundRect().GetSize() );
+ Rectangle aBoundRect = rPolyPoly.GetBoundRect();
+ sal_Int32 nGradient = createGradient( rGradient, aBoundRect.GetSize() );
updateGraphicsState();
- Rectangle aBoundRect = rPolyPoly.GetBoundRect();
- Point aTranslate = aBoundRect.BottomLeft() + Point( 0, 1 );
+ Point aTranslate = aBoundRect.BottomLeft();
int nPolygons = rPolyPoly.Count();
OStringBuffer aLine( 80*nPolygons );
@@ -10125,7 +10189,7 @@ void PDFWriterImpl::drawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch
aPolyPoly.Optimize( POLY_OPTIMIZE_NO_SAME );
push( PUSH_LINECOLOR );
setLineColor( rHatch.GetColor() );
- getReferenceDevice()->ImplDrawHatch( aPolyPoly, rHatch, FALSE );
+ getReferenceDevice()->ImplDrawHatch( aPolyPoly, rHatch, sal_False );
pop();
}
}
@@ -10833,7 +10897,7 @@ sal_Int32 PDFWriterImpl::setOutlineItemText( sal_Int32 nItem, const OUString& rT
if( nItem < 1 || nItem >= (sal_Int32)m_aOutline.size() )
return -1;
- m_aOutline[ nItem ].m_aTitle = rText;
+ m_aOutline[ nItem ].m_aTitle = psp::WhitespaceToSpace( rText );
return 0;
}
@@ -12032,269 +12096,6 @@ void PDFWriterImpl::addStream( const String& rMimeType, PDFOutputStream* pStream
}
}
-/*************************************************************
-begin i12626 methods
-
-Implements Algorithm 3.2, step 1 only
-*/
-void PDFWriterImpl::padPassword( rtl::OUString aPassword, sal_uInt8 *paPasswordTarget )
-{
-// get ansi-1252 version of the password string CHECKIT ! i12626
- rtl::OString aString = rtl::OUStringToOString( aPassword, RTL_TEXTENCODING_MS_1252 );
-
-//copy the string to the target
- sal_Int32 nToCopy = ( aString.getLength() < 32 ) ? aString.getLength() : 32;
- sal_Int32 nCurrentChar;
-
- for( nCurrentChar = 0; nCurrentChar < nToCopy; nCurrentChar++ )
- paPasswordTarget[nCurrentChar] = (sal_uInt8)( aString.getStr()[nCurrentChar] );
-
-//pad it
- if( nCurrentChar < 32 )
- {//fill with standard byte string
- sal_Int32 i,y;
- for( i = nCurrentChar, y = 0 ; i < 32; i++, y++ )
- paPasswordTarget[i] = m_nPadString[y];
- }
-}
-
-/**********************************
-Algorithm 3.2 Compute the encryption key used
-
-step 1 should already be done before calling, the paThePaddedPassword parameter should contain
-the padded password and must be 32 byte long, the encryption key is returned into the paEncryptionKey parameter,
-it will be 16 byte long for 128 bit security; for 40 bit security only the first 5 bytes are used
-
-TODO: in pdf ver 1.5 and 1.6 the step 6 is different, should be implemented. See spec.
-
-*/
-void PDFWriterImpl::computeEncryptionKey(sal_uInt8 *paThePaddedPassword, sal_uInt8 *paEncryptionKey )
-{
-//step 2
- if( m_aDigest )
- {
- rtlDigestError nError = rtl_digest_updateMD5( m_aDigest, paThePaddedPassword, ENCRYPTED_PWD_SIZE );
-//step 3
- if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, m_nEncryptedOwnerPassword , sizeof( m_nEncryptedOwnerPassword ) );
-//Step 4
- sal_uInt8 nPerm[4];
-
- nPerm[0] = (sal_uInt8)m_nAccessPermissions;
- nPerm[1] = (sal_uInt8)( m_nAccessPermissions >> 8 );
- nPerm[2] = (sal_uInt8)( m_nAccessPermissions >> 16 );
- nPerm[3] = (sal_uInt8)( m_nAccessPermissions >> 24 );
-
- if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, nPerm , sizeof( nPerm ) );
-
-//step 5, get the document ID, binary form
- if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, m_nDocID , sizeof( m_nDocID ) );
-//get the digest
- sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ] = {0};
- if( nError == rtl_Digest_E_None )
- {
- rtl_digest_getMD5( m_aDigest, nMD5Sum, sizeof( nMD5Sum ) );
-
-//step 6, only if 128 bit
- if( m_aContext.Security128bit )
- {
- for( sal_Int32 i = 0; i < 50; i++ )
- {
- nError = rtl_digest_updateMD5( m_aDigest, &nMD5Sum, sizeof( nMD5Sum ) );
- if( nError != rtl_Digest_E_None )
- break;
- rtl_digest_getMD5( m_aDigest, nMD5Sum, sizeof( nMD5Sum ) );
- }
- }
- }
-//Step 7
- for( sal_Int32 i = 0; i < MD5_DIGEST_SIZE; i++ )
- paEncryptionKey[i] = nMD5Sum[i];
- }
-}
-
-/**********************************
-Algorithm 3.3 Compute the encryption dictionary /O value, save into the class data member
-the step numbers down here correspond to the ones in PDF v.1.4 specfication
-*/
-void PDFWriterImpl::computeODictionaryValue()
-{
-//step 1 already done, data is in m_nPaddedOwnerPassword
-//step 2
- if( m_aDigest )
- {
- rtlDigestError nError = rtl_digest_updateMD5( m_aDigest, &m_nPaddedOwnerPassword, sizeof( m_nPaddedOwnerPassword ) );
- if( nError == rtl_Digest_E_None )
- {
- sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
-
- rtl_digest_getMD5( m_aDigest, nMD5Sum, sizeof(nMD5Sum) );
-//step 3, only if 128 bit
- if( m_aContext.Security128bit )
- {
- sal_Int32 i;
- for( i = 0; i < 50; i++ )
- {
- nError = rtl_digest_updateMD5( m_aDigest, nMD5Sum, sizeof( nMD5Sum ) );
- if( nError != rtl_Digest_E_None )
- break;
- rtl_digest_getMD5( m_aDigest, nMD5Sum, sizeof( nMD5Sum ) );
- }
- }
-//Step 4, the key is in nMD5Sum
-//step 5 already done, data is in m_nPaddedUserPassword
-//step 6
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode,
- nMD5Sum, m_nKeyLength , NULL, 0 );
-// encrypt the user password using the key set above
- rtl_cipher_encodeARCFOUR( m_aCipher, m_nPaddedUserPassword, sizeof( m_nPaddedUserPassword ), // the data to be encrypted
- m_nEncryptedOwnerPassword, sizeof( m_nEncryptedOwnerPassword ) ); //encrypted data, stored in class data member
-//Step 7, only if 128 bit
- if( m_aContext.Security128bit )
- {
- sal_uInt32 i, y;
- sal_uInt8 nLocalKey[ SECUR_128BIT_KEY ]; // 16 = 128 bit key
- for( i = 1; i <= 19; i++ ) // do it 19 times, start with 1
- {
- for( y = 0; y < sizeof( nLocalKey ); y++ )
- nLocalKey[y] = (sal_uInt8)( nMD5Sum[y] ^ i );
-
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode,
- nLocalKey, SECUR_128BIT_KEY, NULL, 0 ); //destination data area, on init can be NULL
- rtl_cipher_encodeARCFOUR( m_aCipher, m_nEncryptedOwnerPassword, sizeof( m_nEncryptedOwnerPassword ), // the data to be encrypted
- m_nEncryptedOwnerPassword, sizeof( m_nEncryptedOwnerPassword ) ); // encrypted data, can be the same as the input, encrypt "in place"
-//step 8, store in class data member
- }
- }
- }
- }
-}
-
-/**********************************
-Algorithms 3.4 and 3.5 Compute the encryption dictionary /U value, save into the class data member, revision 2 (40 bit) or 3 (128 bit)
-*/
-void PDFWriterImpl::computeUDictionaryValue()
-{
-//step 1, common to both 3.4 and 3.5
- computeEncryptionKey( m_nPaddedUserPassword , m_nEncryptionKey );
-
- if( m_aContext.Security128bit == false )
- {
-//3.4
-//step 2 and 3
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode,
- m_nEncryptionKey, 5 , // key and key length
- NULL, 0 ); //destination data area
-// encrypt the user password using the key set above, save for later use
- rtl_cipher_encodeARCFOUR( m_aCipher, m_nPadString, sizeof( m_nPadString ), // the data to be encrypted
- m_nEncryptedUserPassword, sizeof( m_nEncryptedUserPassword ) ); //encrypted data, stored in class data member
- }
- else
- {
-//or 3.5, for 128 bit security
-//step6, initilize the last 16 bytes of the encrypted user password to 0
- for(sal_uInt32 i = MD5_DIGEST_SIZE; i < sizeof( m_nEncryptedUserPassword ); i++)
- m_nEncryptedUserPassword[i] = 0;
-//step 2
- if( m_aDigest )
- {
- rtlDigestError nError = rtl_digest_updateMD5( m_aDigest, m_nPadString, sizeof( m_nPadString ) );
-//step 3
- if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, m_nDocID , sizeof(m_nDocID) );
-
- sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
- rtl_digest_getMD5( m_aDigest, nMD5Sum, sizeof(nMD5Sum) );
-//Step 4
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode,
- m_nEncryptionKey, SECUR_128BIT_KEY, NULL, 0 ); //destination data area
- rtl_cipher_encodeARCFOUR( m_aCipher, nMD5Sum, sizeof( nMD5Sum ), // the data to be encrypted
- m_nEncryptedUserPassword, sizeof( nMD5Sum ) ); //encrypted data, stored in class data member
-//step 5
- sal_uInt32 i, y;
- sal_uInt8 nLocalKey[SECUR_128BIT_KEY];
-
- for( i = 1; i <= 19; i++ ) // do it 19 times, start with 1
- {
- for( y = 0; y < sizeof( nLocalKey ) ; y++ )
- nLocalKey[y] = (sal_uInt8)( m_nEncryptionKey[y] ^ i );
-
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode,
- nLocalKey, SECUR_128BIT_KEY, // key and key length
- NULL, 0 ); //destination data area, on init can be NULL
- rtl_cipher_encodeARCFOUR( m_aCipher, m_nEncryptedUserPassword, SECUR_128BIT_KEY, // the data to be encrypted
- m_nEncryptedUserPassword, SECUR_128BIT_KEY ); // encrypted data, can be the same as the input, encrypt "in place"
- }
- }
- }
-}
-
-/* init the encryption engine
-1. init the document id, used both for building the document id and for building the encryption key(s)
-2. build the encryption key following algorithms described in the PDF specification
- */
-void PDFWriterImpl::initEncryption()
-{
- m_aOwnerPassword = m_aContext.OwnerPassword;
- m_aUserPassword = m_aContext.UserPassword;
-/* password stuff computing, before sending out anything */
- DBG_ASSERT( m_aCipher != NULL, "PDFWriterImpl::initEncryption: a cipher (ARCFOUR) object is not available !" );
- DBG_ASSERT( m_aDigest != NULL, "PDFWriterImpl::initEncryption: a digest (MD5) object is not available !" );
-
- if( m_aCipher && m_aDigest )
- {
-//if there is no owner password, force it to the user password
- if( m_aOwnerPassword.getLength() == 0 )
- m_aOwnerPassword = m_aUserPassword;
-
- initPadString();
-/*
-1) pad passwords
-*/
- padPassword( m_aOwnerPassword, m_nPaddedOwnerPassword );
- padPassword( m_aUserPassword, m_nPaddedUserPassword );
-/*
-2) compute the access permissions, in numerical form
-
-the default value depends on the revision 2 (40 bit) or 3 (128 bit security):
-- for 40 bit security the unused bit must be set to 1, since they are not used
-- for 128 bit security the same bit must be preset to 0 and set later if needed
-according to the table 3.15, pdf v 1.4 */
- m_nAccessPermissions = ( m_aContext.Security128bit ) ? 0xfffff0c0 : 0xffffffc0 ;
-
-/* check permissions for 40 bit security case */
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanPrintTheDocument ) ? 1 << 2 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanModifyTheContent ) ? 1 << 3 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanCopyOrExtract ) ? 1 << 4 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanAddOrModify ) ? 1 << 5 : 0;
- m_nKeyLength = SECUR_40BIT_KEY;
- m_nRC4KeyLength = SECUR_40BIT_KEY+5; // for this value see PDF spec v 1.4, algorithm 3.1 step 4, where n is 5
-
- if( m_aContext.Security128bit )
- {
- m_nKeyLength = SECUR_128BIT_KEY;
- m_nRC4KeyLength = 16; // for this value see PDF spec v 1.4, algorithm 3.1 step 4, where n is 16, thus maximum
- // permitted value is 16
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanFillInteractive ) ? 1 << 8 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanExtractForAccessibility ) ? 1 << 9 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanAssemble ) ? 1 << 10 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanPrintFull ) ? 1 << 11 : 0;
- }
- computeODictionaryValue();
- computeUDictionaryValue();
-
-//clear out exceding key values, prepares for generation number default to 0 as well
-// see checkAndEnableStreamEncryption in pdfwriter_impl.hxx
- sal_Int32 i, y;
- for( i = m_nKeyLength, y = 0; y < 5 ; y++ )
- m_nEncryptionKey[i++] = 0;
- }
- else //either no cipher or no digest or both, something is wrong with memory or something else
- m_aContext.Encrypt = false; //then turn the encryption off
-}
-/* end i12626 methods */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx
index 8aacf749942e..09459e40a896 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -60,6 +60,8 @@ class ImplFontSelectData;
class ImplFontMetricData;
class FontSubsetInfo;
class ZCodec;
+class EncHashTransporter;
+struct BitStreamState;
// the maximum password length
#define ENCRYPTED_PWD_SIZE 32
@@ -448,7 +450,7 @@ public:
rtl::OString m_aName;
rtl::OUString m_aDescription;
rtl::OUString m_aText;
- USHORT m_nTextStyle;
+ sal_uInt16 m_nTextStyle;
rtl::OUString m_aValue;
rtl::OString m_aDAString;
rtl::OString m_aDRDict;
@@ -597,7 +599,6 @@ private:
MapMode m_aMapMode; // PDFWriterImpl scaled units
std::vector< PDFPage > m_aPages;
- PDFDocInfo m_aDocInfo;
/* maps object numbers to file offsets (needed for xref) */
std::vector< sal_uInt64 > m_aObjects;
/* contains Bitmaps until they are written to the
@@ -798,116 +799,37 @@ i12626
/* used to cipher the stream data and for password management */
rtlCipher m_aCipher;
rtlDigest m_aDigest;
-/* pad string used for password in Standard security handler */
- sal_uInt8 m_nPadString[ENCRYPTED_PWD_SIZE];
-/* the owner password, in clear text */
- rtl::OUString m_aOwnerPassword;
-/* the padded owner password */
- sal_uInt8 m_nPaddedOwnerPassword[ENCRYPTED_PWD_SIZE];
-/* the encryption dictionary owner password, according to algorithm 3.3 */
- sal_uInt8 m_nEncryptedOwnerPassword[ENCRYPTED_PWD_SIZE];
-/* the user password, in clear text */
- rtl::OUString m_aUserPassword;
-/* the padded user password */
- sal_uInt8 m_nPaddedUserPassword[ENCRYPTED_PWD_SIZE];
-/* the encryption dictionary user password, according to algorithm 3.4 or 3.5 depending on the
- security handler revision */
- sal_uInt8 m_nEncryptedUserPassword[ENCRYPTED_PWD_SIZE];
-
-/* the encryption key, formed with the user password according to algorithm 3.2, maximum length is 16 bytes + 3 + 2
- for 128 bit security */
- sal_uInt8 m_nEncryptionKey[MAXIMUM_RC4_KEY_LENGTH];
+ /* pad string used for password in Standard security handler */
+ static const sal_uInt8 s_nPadString[ENCRYPTED_PWD_SIZE];
+
+ /* the encryption key, formed with the user password according to algorithm 3.2, maximum length is 16 bytes + 3 + 2
+ for 128 bit security */
sal_Int32 m_nKeyLength; // key length, 16 or 5
sal_Int32 m_nRC4KeyLength; // key length, 16 or 10, to be input to the algorith 3.1
-/* set to true if the following stream must be encrypted, used inside writeBuffer() */
+ /* set to true if the following stream must be encrypted, used inside writeBuffer() */
sal_Bool m_bEncryptThisStream;
-/* the numerical value of the access permissions, according to PDF spec, must be signed */
+ /* the numerical value of the access permissions, according to PDF spec, must be signed */
sal_Int32 m_nAccessPermissions;
-/* the document ID, the raw MD5 hash */
- sal_uInt8 m_nDocID[MD5_DIGEST_SIZE];
-/* string buffer to hold document ID, this is the output string */
- rtl::OStringBuffer m_aDocID;
-/* string to hold the PDF creation date */
- rtl::OStringBuffer m_aCreationDateString;
-/* string to hold the PDF creation date, for PDF/A metadata */
- rtl::OStringBuffer m_aCreationMetaDateString;
-/* the buffer where the data are encrypted, dynamically allocated */
+ /* string to hold the PDF creation date */
+ rtl::OString m_aCreationDateString;
+ /* string to hold the PDF creation date, for PDF/A metadata */
+ rtl::OString m_aCreationMetaDateString;
+ /* the buffer where the data are encrypted, dynamically allocated */
sal_uInt8 *m_pEncryptionBuffer;
-/* size of the buffer */
+ /* size of the buffer */
sal_Int32 m_nEncryptionBufferSize;
-/* check and reallocate the buffer for encryption */
- sal_Bool checkEncryptionBufferSize( register sal_Int32 newSize )
- {
- if( m_nEncryptionBufferSize < newSize )
- {
-/* reallocate the buffer, the used function allocate as rtl_allocateMemory
- if the pointer parameter is NULL */
- m_pEncryptionBuffer = (sal_uInt8*)rtl_reallocateMemory( m_pEncryptionBuffer, newSize );
- if( m_pEncryptionBuffer )
- m_nEncryptionBufferSize = newSize;
- else
- m_nEncryptionBufferSize = 0;
- }
- return ( m_nEncryptionBufferSize != 0 );
- }
-/* init the internal pad string */
- void initPadString()
- {
- static const sal_uInt8 nPadString[32] =
- {
- 0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41, 0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08,
- 0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80, 0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A
- };
-
- for(sal_uInt32 i = 0; i < sizeof( nPadString ); i++ )
- m_nPadString[i] = nPadString[i];
-
- };
-/* initialize the encryption engine */
- void initEncryption();
-
-/* this function implements part of the PDF spec algorithm 3.1 in encryption, the rest (the actual encryption) is in PDFWriterImpl::writeBuffer */
- void checkAndEnableStreamEncryption( register sal_Int32 nObject )
- {
- if( m_aContext.Encrypt )
- {
- m_bEncryptThisStream = true;
- register sal_Int32 i = m_nKeyLength;
- m_nEncryptionKey[i++] = (sal_uInt8)nObject;
- m_nEncryptionKey[i++] = (sal_uInt8)( nObject >> 8 );
- m_nEncryptionKey[i++] = (sal_uInt8)( nObject >> 16 );
-//the other location of m_nEncryptionKey are already set to 0, our fixed generation number
-// do the MD5 hash
- sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
- // the i+2 to take into account the generation number, always zero
- rtl_digest_MD5( &m_nEncryptionKey, i+2, nMD5Sum, sizeof(nMD5Sum) );
-// initialize the RC4 with the key
-// key legth: see algoritm 3.1, step 4: (N+5) max 16
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode, nMD5Sum, m_nRC4KeyLength, NULL, 0 );
- }
- };
+ /* check and reallocate the buffer for encryption */
+ sal_Bool checkEncryptionBufferSize( register sal_Int32 newSize );
+ /* this function implements part of the PDF spec algorithm 3.1 in encryption, the rest (the actual encryption) is in PDFWriterImpl::writeBuffer */
+ void checkAndEnableStreamEncryption( register sal_Int32 nObject );
void disableStreamEncryption() { m_bEncryptThisStream = false; };
-/* */
- void enableStringEncryption( register sal_Int32 nObject )
- {
- register sal_Int32 i = m_nKeyLength;
- m_nEncryptionKey[i++] = (sal_uInt8)nObject;
- m_nEncryptionKey[i++] = (sal_uInt8)( nObject >> 8 );
- m_nEncryptionKey[i++] = (sal_uInt8)( nObject >> 16 );
-//the other location of m_nEncryptionKey are already set to 0, our fixed generation number
-// do the MD5 hash
- sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
- // the i+2 to take into account the generation number, always zero
- rtl_digest_MD5( &m_nEncryptionKey, i+2, nMD5Sum, sizeof(nMD5Sum) );
-// initialize the RC4 with the key
-// key legth: see algoritm 3.1, step 4: (N+5) max 16
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode, nMD5Sum, m_nRC4KeyLength, NULL, 0 );
- };
+ /* */
+ void enableStringEncryption( register sal_Int32 nObject );
// test if the encryption is active, if yes than encrypt the unicode string and add to the OStringBuffer parameter
void appendUnicodeTextStringEncrypt( const rtl::OUString& rInString, const sal_Int32 nInObjectNumber, rtl::OStringBuffer& rOutBuffer );
@@ -1093,28 +1015,68 @@ i12626
bool checkEmitStructure();
/* draws an emphasis mark */
- void drawEmphasisMark( long nX, long nY, const PolyPolygon& rPolyPoly, BOOL bPolyLine, const Rectangle& rRect1, const Rectangle& rRect2 );
+ void drawEmphasisMark( long nX, long nY, const PolyPolygon& rPolyPoly, sal_Bool bPolyLine, const Rectangle& rRect1, const Rectangle& rRect2 );
/* true if PDF/A-1a or PDF/A-1b is output */
sal_Bool m_bIsPDF_A1;
-
-/*
-i12626
-methods for PDF security
-
- pad a password according algorithm 3.2, step 1 */
- void padPassword( const rtl::OUString aPassword, sal_uInt8 *paPasswordTarget );
-/* algorithm 3.2: compute an encryption key */
- void computeEncryptionKey( sal_uInt8 *paThePaddedPassword, sal_uInt8 *paEncryptionKey );
-/* algorithm 3.3: computing the encryption dictionary'ss owner password value ( /O ) */
- void computeODictionaryValue();
-/* algorithm 3.4 or 3.5: computing the encryption dictionary's user password value ( /U ) revision 2 or 3 of the standard security handler */
- void computeUDictionaryValue();
-
+ PDFWriter& m_rOuterFace;
+
+ /*
+ i12626
+ methods for PDF security
+
+ pad a password according algorithm 3.2, step 1 */
+ static void padPassword( const rtl::OUString& i_rPassword, sal_uInt8* o_pPaddedPW );
+ /* algorithm 3.2: compute an encryption key */
+ static bool computeEncryptionKey( EncHashTransporter*,
+ vcl::PDFWriter::PDFEncryptionProperties& io_rProperties,
+ sal_Int32 i_nAccessPermissions
+ );
+ /* algorithm 3.3: computing the encryption dictionary'ss owner password value ( /O ) */
+ static bool computeODictionaryValue( const sal_uInt8* i_pPaddedOwnerPassword, const sal_uInt8* i_pPaddedUserPassword,
+ std::vector< sal_uInt8 >& io_rOValue,
+ sal_Int32 i_nKeyLength
+ );
+ /* algorithm 3.4 or 3.5: computing the encryption dictionary's user password value ( /U ) revision 2 or 3 of the standard security handler */
+ static bool computeUDictionaryValue( EncHashTransporter* i_pTransporter,
+ vcl::PDFWriter::PDFEncryptionProperties& io_rProperties,
+ sal_Int32 i_nKeyLength,
+ sal_Int32 i_nAccessPermissions
+ );
+
+ static void computeDocumentIdentifier( std::vector< sal_uInt8 >& o_rIdentifier,
+ const vcl::PDFWriter::PDFDocInfo& i_rDocInfo,
+ rtl::OString& o_rCString1,
+ rtl::OString& o_rCString2
+ );
+ static sal_Int32 computeAccessPermissions( const vcl::PDFWriter::PDFEncryptionProperties& i_rProperties,
+ sal_Int32& o_rKeyLength, sal_Int32& o_rRC4KeyLength );
+ void setupDocInfo();
+ bool prepareEncryption( const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& );
+
+ // helper for playMetafile
+ void implWriteGradient( const PolyPolygon& rPolyPoly, const Gradient& rGradient,
+ VirtualDevice* pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& );
+ void implWriteBitmapEx( const Point& rPoint, const Size& rSize, const BitmapEx& rBitmapEx,
+ VirtualDevice* pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& );
+
+ // helpers for CCITT 1bit bitmap stream
+ void putG4Bits( sal_uInt32 i_nLength, sal_uInt32 i_nCode, BitStreamState& io_rState );
+ void putG4Span( long i_nSpan, bool i_bWhitePixel, BitStreamState& io_rState );
+ void writeG4Stream( BitmapReadAccess* i_pBitmap );
+
+ // color helper functions
+ void appendStrokingColor( const Color& rColor, rtl::OStringBuffer& rBuffer );
+ void appendNonStrokingColor( const Color& rColor, rtl::OStringBuffer& rBuffer );
public:
- PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext );
+ PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext, const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >&, PDFWriter& );
~PDFWriterImpl();
+ static com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >
+ initEncryption( const rtl::OUString& i_rOwnerPassword,
+ const rtl::OUString& i_rUserPassword,
+ bool b128Bit );
+
/* for OutputDevice so the reference device can have a list
* that contains only suitable fonts (subsettable or builtin)
* produces a new font list
@@ -1136,6 +1098,7 @@ public:
bool emit();
std::set< PDFWriter::ErrorCode > getErrors();
void insertError( PDFWriter::ErrorCode eErr ) { m_aErrors.insert( eErr ); }
+ void playMetafile( const GDIMetaFile&, vcl::PDFExtOutDevData*, const vcl::PDFWriter::PlayMetafileContext&, VirtualDevice* pDummyDev = NULL );
Size getCurPageSize() const
{
@@ -1146,8 +1109,6 @@ public:
}
PDFWriter::PDFVersion getVersion() const { return m_aContext.Version; }
- void setDocInfo( const PDFDocInfo& rInfo );
- const PDFDocInfo& getDocInfo() const { return m_aDocInfo; }
void setDocumentLocale( const com::sun::star::lang::Locale& rLoc )
{ m_aContext.DocumentLocale = rLoc; }
@@ -1204,13 +1165,13 @@ public:
void setTextFillColor( const Color& rColor )
{
m_aGraphicsStack.front().m_aFont.SetFillColor( rColor );
- m_aGraphicsStack.front().m_aFont.SetTransparent( ImplIsColorTransparent( rColor ) ? TRUE : FALSE );
+ m_aGraphicsStack.front().m_aFont.SetTransparent( ImplIsColorTransparent( rColor ) ? sal_True : sal_False );
m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsState::updateFont;
}
void setTextFillColor()
{
m_aGraphicsStack.front().m_aFont.SetFillColor( Color( COL_TRANSPARENT ) );
- m_aGraphicsStack.front().m_aFont.SetTransparent( TRUE );
+ m_aGraphicsStack.front().m_aFont.SetTransparent( sal_True );
m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsState::updateFont;
}
void setTextColor( const Color& rColor )
@@ -1261,10 +1222,10 @@ public:
/* actual drawing functions */
void drawText( const Point& rPos, const String& rText, xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN, bool bTextLines = true );
void drawTextArray( const Point& rPos, const String& rText, const sal_Int32* pDXArray = NULL, xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN, bool bTextLines = true );
- void drawStretchText( const Point& rPos, ULONG nWidth, const String& rText,
+ void drawStretchText( const Point& rPos, sal_uLong nWidth, const String& rText,
xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
bool bTextLines = true );
- void drawText( const Rectangle& rRect, const String& rOrigStr, USHORT nStyle, bool bTextLines = true );
+ void drawText( const Rectangle& rRect, const String& rOrigStr, sal_uInt16 nStyle, bool bTextLines = true );
void drawTextLine( const Point& rPos, long nWidth, FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, bool bUnderlineAbove );
void drawWaveTextLine( rtl::OStringBuffer& aLine, long nWidth, FontUnderline eTextLine, Color aColor, bool bIsAbove );
void drawStraightTextLine( rtl::OStringBuffer& aLine, long nWidth, FontUnderline eTextLine, Color aColor, bool bIsAbove );
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
new file mode 100644
index 000000000000..3e957d175897
--- /dev/null
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -0,0 +1,2037 @@
+/*************************************************************************
+ *
+ * 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_vcl.hxx"
+
+#include "pdfwriter_impl.hxx"
+
+#include "vcl/pdfextoutdevdata.hxx"
+#include "vcl/virdev.hxx"
+#include "vcl/gdimtf.hxx"
+#include "vcl/metaact.hxx"
+#include "vcl/bmpacc.hxx"
+#include "vcl/graph.hxx"
+#include "vcl/svdata.hxx"
+#include "unotools/streamwrap.hxx"
+#include "unotools/processfactory.hxx"
+#include "comphelper/processfactory.hxx"
+
+#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/io/XSeekable.hpp"
+#include "com/sun/star/graphic/XGraphicProvider.hpp"
+
+#include "cppuhelper/implbase1.hxx"
+
+#include <rtl/digest.h>
+
+#undef USE_PDFGRADIENTS
+
+using namespace vcl;
+using namespace rtl;
+using namespace com::sun::star;
+using namespace com::sun::star::uno;
+using namespace com::sun::star::beans;
+
+// -----------------------------------------------------------------------------
+
+void PDFWriterImpl::implWriteGradient( const PolyPolygon& i_rPolyPoly, const Gradient& i_rGradient,
+ VirtualDevice* i_pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& i_rContext )
+{
+ GDIMetaFile aTmpMtf;
+
+ i_pDummyVDev->AddGradientActions( i_rPolyPoly.GetBoundRect(), i_rGradient, aTmpMtf );
+
+ m_rOuterFace.Push();
+ m_rOuterFace.IntersectClipRegion( i_rPolyPoly.getB2DPolyPolygon() );
+ playMetafile( aTmpMtf, NULL, i_rContext, i_pDummyVDev );
+ m_rOuterFace.Pop();
+}
+
+// -----------------------------------------------------------------------------
+
+void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSize, const BitmapEx& i_rBitmapEx,
+ VirtualDevice* i_pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& i_rContext )
+{
+ if ( !i_rBitmapEx.IsEmpty() && i_rSize.Width() && i_rSize.Height() )
+ {
+ BitmapEx aBitmapEx( i_rBitmapEx );
+ Point aPoint( i_rPoint );
+ Size aSize( i_rSize );
+
+ // #i19065# Negative sizes have mirror semantics on
+ // OutputDevice. BitmapEx and co. have no idea about that, so
+ // perform that _before_ doing anything with aBitmapEx.
+ sal_uLong nMirrorFlags(BMP_MIRROR_NONE);
+ if( aSize.Width() < 0 )
+ {
+ aSize.Width() *= -1;
+ aPoint.X() -= aSize.Width();
+ nMirrorFlags |= BMP_MIRROR_HORZ;
+ }
+ if( aSize.Height() < 0 )
+ {
+ aSize.Height() *= -1;
+ aPoint.Y() -= aSize.Height();
+ nMirrorFlags |= BMP_MIRROR_VERT;
+ }
+
+ if( nMirrorFlags != BMP_MIRROR_NONE )
+ {
+ aBitmapEx.Mirror( nMirrorFlags );
+ }
+ if( i_rContext.m_nMaxImageResolution > 50 )
+ {
+ // do downsampling if neccessary
+ const Size aDstSizeTwip( i_pDummyVDev->PixelToLogic( i_pDummyVDev->LogicToPixel( aSize ), MAP_TWIP ) );
+ const Size aBmpSize( aBitmapEx.GetSizePixel() );
+ const double fBmpPixelX = aBmpSize.Width();
+ const double fBmpPixelY = aBmpSize.Height();
+ const double fMaxPixelX = aDstSizeTwip.Width() * i_rContext.m_nMaxImageResolution / 1440.0;
+ const double fMaxPixelY = aDstSizeTwip.Height() * i_rContext.m_nMaxImageResolution / 1440.0;
+
+ // check, if the bitmap DPI exceeds the maximum DPI (allow 4 pixel rounding tolerance)
+ if( ( ( fBmpPixelX > ( fMaxPixelX + 4 ) ) ||
+ ( fBmpPixelY > ( fMaxPixelY + 4 ) ) ) &&
+ ( fBmpPixelY > 0.0 ) && ( fMaxPixelY > 0.0 ) )
+ {
+ // do scaling
+ Size aNewBmpSize;
+ const double fBmpWH = fBmpPixelX / fBmpPixelY;
+ const double fMaxWH = fMaxPixelX / fMaxPixelY;
+
+ if( fBmpWH < fMaxWH )
+ {
+ aNewBmpSize.Width() = FRound( fMaxPixelY * fBmpWH );
+ aNewBmpSize.Height() = FRound( fMaxPixelY );
+ }
+ else if( fBmpWH > 0.0 )
+ {
+ aNewBmpSize.Width() = FRound( fMaxPixelX );
+ aNewBmpSize.Height() = FRound( fMaxPixelX / fBmpWH);
+ }
+ if( aNewBmpSize.Width() && aNewBmpSize.Height() )
+ aBitmapEx.Scale( aNewBmpSize );
+ else
+ aBitmapEx.SetEmpty();
+ }
+ }
+
+ const Size aSizePixel( aBitmapEx.GetSizePixel() );
+ if ( aSizePixel.Width() && aSizePixel.Height() )
+ {
+ if( m_aContext.ColorMode == PDFWriter::DrawGreyscale )
+ {
+ BmpConversion eConv = BMP_CONVERSION_8BIT_GREYS;
+ int nDepth = aBitmapEx.GetBitmap().GetBitCount();
+ if( nDepth <= 4 )
+ eConv = BMP_CONVERSION_4BIT_GREYS;
+ if( nDepth > 1 )
+ aBitmapEx.Convert( eConv );
+ }
+ sal_Bool bUseJPGCompression = !i_rContext.m_bOnlyLosslessCompression;
+ if ( ( aSizePixel.Width() < 32 ) || ( aSizePixel.Height() < 32 ) )
+ bUseJPGCompression = sal_False;
+
+ SvMemoryStream aStrm;
+ Bitmap aMask;
+
+ bool bTrueColorJPG = true;
+ if ( bUseJPGCompression )
+ {
+ sal_uInt32 nZippedFileSize; // sj: we will calculate the filesize of a zipped bitmap
+ { // to determine if jpeg compression is usefull
+ SvMemoryStream aTemp;
+ aTemp.SetCompressMode( aTemp.GetCompressMode() | COMPRESSMODE_ZBITMAP );
+ aTemp.SetVersion( SOFFICE_FILEFORMAT_40 ); // sj: up from version 40 our bitmap stream operator
+ aTemp << aBitmapEx; // is capable of zlib stream compression
+ aTemp.Seek( STREAM_SEEK_TO_END );
+ nZippedFileSize = aTemp.Tell();
+ }
+ if ( aBitmapEx.IsTransparent() )
+ {
+ if ( aBitmapEx.IsAlpha() )
+ aMask = aBitmapEx.GetAlpha().GetBitmap();
+ else
+ aMask = aBitmapEx.GetMask();
+ }
+ Graphic aGraphic( aBitmapEx.GetBitmap() );
+ sal_Int32 nColorMode = 0;
+
+ Sequence< PropertyValue > aFilterData( 2 );
+ aFilterData[ 0 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) );
+ aFilterData[ 0 ].Value <<= sal_Int32(i_rContext.m_nJPEGQuality);
+ aFilterData[ 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "ColorMode" ) );
+ aFilterData[ 1 ].Value <<= nColorMode;
+
+ try
+ {
+ uno::Reference < io::XStream > xStream = new utl::OStreamWrapper( aStrm );
+ uno::Reference< io::XSeekable > xSeekable( xStream, UNO_QUERY_THROW );
+ uno::Reference< graphic::XGraphicProvider > xGraphicProvider( ImplGetSVData()->maAppData.mxMSF->createInstance(
+ OUString::createFromAscii( "com.sun.star.graphic.GraphicProvider" ) ), UNO_QUERY );
+ if ( xGraphicProvider.is() )
+ {
+ uno::Reference< graphic::XGraphic > xGraphic( aGraphic.GetXGraphic() );
+ uno::Reference < io::XOutputStream > xOut( xStream->getOutputStream() );
+ rtl::OUString aMimeType( ::rtl::OUString::createFromAscii( "image/jpeg" ) );
+ uno::Sequence< beans::PropertyValue > aOutMediaProperties( 3 );
+ aOutMediaProperties[0].Name = ::rtl::OUString::createFromAscii( "OutputStream" );
+ aOutMediaProperties[0].Value <<= xOut;
+ aOutMediaProperties[1].Name = ::rtl::OUString::createFromAscii( "MimeType" );
+ aOutMediaProperties[1].Value <<= aMimeType;
+ aOutMediaProperties[2].Name = ::rtl::OUString::createFromAscii( "FilterData" );
+ aOutMediaProperties[2].Value <<= aFilterData;
+ xGraphicProvider->storeGraphic( xGraphic, aOutMediaProperties );
+ xOut->flush();
+ if ( xSeekable->getLength() > nZippedFileSize )
+ {
+ bUseJPGCompression = sal_False;
+ }
+ else
+ {
+ aStrm.Seek( STREAM_SEEK_TO_END );
+
+ xSeekable->seek( 0 );
+ Sequence< PropertyValue > aArgs( 1 );
+ aArgs[ 0 ].Name = ::rtl::OUString::createFromAscii( "InputStream" );
+ aArgs[ 0 ].Value <<= xStream;
+ uno::Reference< XPropertySet > xPropSet( xGraphicProvider->queryGraphicDescriptor( aArgs ) );
+ if ( xPropSet.is() )
+ {
+ sal_Int16 nBitsPerPixel = 24;
+ if ( xPropSet->getPropertyValue( ::rtl::OUString::createFromAscii( "BitsPerPixel" ) ) >>= nBitsPerPixel )
+ {
+ bTrueColorJPG = nBitsPerPixel != 8;
+ }
+ }
+ }
+ }
+ else
+ bUseJPGCompression = sal_False;
+ }
+ catch( uno::Exception& )
+ {
+ bUseJPGCompression = sal_False;
+ }
+ }
+ if ( bUseJPGCompression )
+ m_rOuterFace.DrawJPGBitmap( aStrm, bTrueColorJPG, aSizePixel, Rectangle( aPoint, aSize ), aMask );
+ else if ( aBitmapEx.IsTransparent() )
+ m_rOuterFace.DrawBitmapEx( aPoint, aSize, aBitmapEx );
+ else
+ m_rOuterFace.DrawBitmap( aPoint, aSize, aBitmapEx.GetBitmap() );
+ }
+ }
+}
+
+
+// -----------------------------------------------------------------------------
+
+void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevData* i_pOutDevData, const vcl::PDFWriter::PlayMetafileContext& i_rContext, VirtualDevice* pDummyVDev )
+{
+ bool bAssertionFired( false );
+
+ VirtualDevice* pPrivateDevice = NULL;
+ if( ! pDummyVDev )
+ {
+ pPrivateDevice = pDummyVDev = new VirtualDevice();
+ pDummyVDev->EnableOutput( sal_False );
+ pDummyVDev->SetMapMode( i_rMtf.GetPrefMapMode() );
+ }
+ GDIMetaFile aMtf( i_rMtf );
+
+ for( sal_uInt32 i = 0, nCount = aMtf.GetActionCount(); i < nCount; )
+ {
+ if ( !i_pOutDevData || !i_pOutDevData->PlaySyncPageAct( m_rOuterFace, i ) )
+ {
+ const MetaAction* pAction = aMtf.GetAction( i );
+ const sal_uInt16 nType = pAction->GetType();
+
+ switch( nType )
+ {
+ case( META_PIXEL_ACTION ):
+ {
+ const MetaPixelAction* pA = (const MetaPixelAction*) pAction;
+ m_rOuterFace.DrawPixel( pA->GetPoint(), pA->GetColor() );
+ }
+ break;
+
+ case( META_POINT_ACTION ):
+ {
+ const MetaPointAction* pA = (const MetaPointAction*) pAction;
+ m_rOuterFace.DrawPixel( pA->GetPoint() );
+ }
+ break;
+
+ case( META_LINE_ACTION ):
+ {
+ const MetaLineAction* pA = (const MetaLineAction*) pAction;
+ if ( pA->GetLineInfo().IsDefault() )
+ m_rOuterFace.DrawLine( pA->GetStartPoint(), pA->GetEndPoint() );
+ else
+ m_rOuterFace.DrawLine( pA->GetStartPoint(), pA->GetEndPoint(), pA->GetLineInfo() );
+ }
+ break;
+
+ case( META_RECT_ACTION ):
+ {
+ const MetaRectAction* pA = (const MetaRectAction*) pAction;
+ m_rOuterFace.DrawRect( pA->GetRect() );
+ }
+ break;
+
+ case( META_ROUNDRECT_ACTION ):
+ {
+ const MetaRoundRectAction* pA = (const MetaRoundRectAction*) pAction;
+ m_rOuterFace.DrawRect( pA->GetRect(), pA->GetHorzRound(), pA->GetVertRound() );
+ }
+ break;
+
+ case( META_ELLIPSE_ACTION ):
+ {
+ const MetaEllipseAction* pA = (const MetaEllipseAction*) pAction;
+ m_rOuterFace.DrawEllipse( pA->GetRect() );
+ }
+ break;
+
+ case( META_ARC_ACTION ):
+ {
+ const MetaArcAction* pA = (const MetaArcAction*) pAction;
+ m_rOuterFace.DrawArc( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() );
+ }
+ break;
+
+ case( META_PIE_ACTION ):
+ {
+ const MetaArcAction* pA = (const MetaArcAction*) pAction;
+ m_rOuterFace.DrawPie( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() );
+ }
+ break;
+
+ case( META_CHORD_ACTION ):
+ {
+ const MetaChordAction* pA = (const MetaChordAction*) pAction;
+ m_rOuterFace.DrawChord( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() );
+ }
+ break;
+
+ case( META_POLYGON_ACTION ):
+ {
+ const MetaPolygonAction* pA = (const MetaPolygonAction*) pAction;
+ m_rOuterFace.DrawPolygon( pA->GetPolygon() );
+ }
+ break;
+
+ case( META_POLYLINE_ACTION ):
+ {
+ const MetaPolyLineAction* pA = (const MetaPolyLineAction*) pAction;
+ if ( pA->GetLineInfo().IsDefault() )
+ m_rOuterFace.DrawPolyLine( pA->GetPolygon() );
+ else
+ m_rOuterFace.DrawPolyLine( pA->GetPolygon(), pA->GetLineInfo() );
+ }
+ break;
+
+ case( META_POLYPOLYGON_ACTION ):
+ {
+ const MetaPolyPolygonAction* pA = (const MetaPolyPolygonAction*) pAction;
+ m_rOuterFace.DrawPolyPolygon( pA->GetPolyPolygon() );
+ }
+ break;
+
+ case( META_GRADIENT_ACTION ):
+ {
+ const MetaGradientAction* pA = (const MetaGradientAction*) pAction;
+ #ifdef USE_PDFGRADIENTS
+ m_rOuterFace.DrawGradient( pA->GetRect(), pA->GetGradient() );
+ #else
+ const PolyPolygon aPolyPoly( pA->GetRect() );
+ implWriteGradient( aPolyPoly, pA->GetGradient(), pDummyVDev, i_rContext );
+ #endif
+ }
+ break;
+
+ case( META_GRADIENTEX_ACTION ):
+ {
+ const MetaGradientExAction* pA = (const MetaGradientExAction*) pAction;
+ #ifdef USE_PDFGRADIENTS
+ m_rOuterFace.DrawGradient( pA->GetPolyPolygon(), pA->GetGradient() );
+ #else
+ implWriteGradient( pA->GetPolyPolygon(), pA->GetGradient(), pDummyVDev, i_rContext );
+ #endif
+ }
+ break;
+
+ case META_HATCH_ACTION:
+ {
+ const MetaHatchAction* pA = (const MetaHatchAction*) pAction;
+ m_rOuterFace.DrawHatch( pA->GetPolyPolygon(), pA->GetHatch() );
+ }
+ break;
+
+ case( META_TRANSPARENT_ACTION ):
+ {
+ const MetaTransparentAction* pA = (const MetaTransparentAction*) pAction;
+ m_rOuterFace.DrawTransparent( pA->GetPolyPolygon(), pA->GetTransparence() );
+ }
+ break;
+
+ case( META_FLOATTRANSPARENT_ACTION ):
+ {
+ const MetaFloatTransparentAction* pA = (const MetaFloatTransparentAction*) pAction;
+
+ GDIMetaFile aTmpMtf( pA->GetGDIMetaFile() );
+ const Point& rPos = pA->GetPoint();
+ const Size& rSize= pA->GetSize();
+ const Gradient& rTransparenceGradient = pA->GetGradient();
+
+ // special case constant alpha value
+ if( rTransparenceGradient.GetStartColor() == rTransparenceGradient.GetEndColor() )
+ {
+ const Color aTransCol( rTransparenceGradient.GetStartColor() );
+ const sal_uInt16 nTransPercent = aTransCol.GetLuminance() * 100 / 255;
+ m_rOuterFace.BeginTransparencyGroup();
+ playMetafile( aTmpMtf, NULL, i_rContext, pDummyVDev );
+ m_rOuterFace.EndTransparencyGroup( Rectangle( rPos, rSize ), nTransPercent );
+ }
+ else
+ {
+ const Size aDstSizeTwip( pDummyVDev->PixelToLogic( pDummyVDev->LogicToPixel( rSize ), MAP_TWIP ) );
+ sal_Int32 nMaxBmpDPI = i_rContext.m_bOnlyLosslessCompression ? 300 : 72;
+ if( i_rContext.m_nMaxImageResolution > 50 )
+ {
+ if ( nMaxBmpDPI > i_rContext.m_nMaxImageResolution )
+ nMaxBmpDPI = i_rContext.m_nMaxImageResolution;
+ }
+ const sal_Int32 nPixelX = (sal_Int32)((double)aDstSizeTwip.Width() * (double)nMaxBmpDPI / 1440.0);
+ const sal_Int32 nPixelY = (sal_Int32)((double)aDstSizeTwip.Height() * (double)nMaxBmpDPI / 1440.0);
+ if ( nPixelX && nPixelY )
+ {
+ Size aDstSizePixel( nPixelX, nPixelY );
+ VirtualDevice* pVDev = new VirtualDevice;
+ if( pVDev->SetOutputSizePixel( aDstSizePixel ) )
+ {
+ Bitmap aPaint, aMask;
+ AlphaMask aAlpha;
+ Point aPoint;
+
+ MapMode aMapMode( pDummyVDev->GetMapMode() );
+ aMapMode.SetOrigin( aPoint );
+ pVDev->SetMapMode( aMapMode );
+ Size aDstSize( pVDev->PixelToLogic( aDstSizePixel ) );
+
+ Point aMtfOrigin( aTmpMtf.GetPrefMapMode().GetOrigin() );
+ if ( aMtfOrigin.X() || aMtfOrigin.Y() )
+ aTmpMtf.Move( -aMtfOrigin.X(), -aMtfOrigin.Y() );
+ double fScaleX = (double)aDstSize.Width() / (double)aTmpMtf.GetPrefSize().Width();
+ double fScaleY = (double)aDstSize.Height() / (double)aTmpMtf.GetPrefSize().Height();
+ if( fScaleX != 1.0 || fScaleY != 1.0 )
+ aTmpMtf.Scale( fScaleX, fScaleY );
+ aTmpMtf.SetPrefMapMode( aMapMode );
+
+ // create paint bitmap
+ aTmpMtf.WindStart();
+ aTmpMtf.Play( pVDev, aPoint, aDstSize );
+ aTmpMtf.WindStart();
+
+ pVDev->EnableMapMode( sal_False );
+ aPaint = pVDev->GetBitmap( aPoint, aDstSizePixel );
+ pVDev->EnableMapMode( sal_True );
+
+ // create mask bitmap
+ pVDev->SetLineColor( COL_BLACK );
+ pVDev->SetFillColor( COL_BLACK );
+ pVDev->DrawRect( Rectangle( aPoint, aDstSize ) );
+ pVDev->SetDrawMode( DRAWMODE_WHITELINE | DRAWMODE_WHITEFILL | DRAWMODE_WHITETEXT |
+ DRAWMODE_WHITEBITMAP | DRAWMODE_WHITEGRADIENT );
+ aTmpMtf.WindStart();
+ aTmpMtf.Play( pVDev, aPoint, aDstSize );
+ aTmpMtf.WindStart();
+ pVDev->EnableMapMode( sal_False );
+ aMask = pVDev->GetBitmap( aPoint, aDstSizePixel );
+ pVDev->EnableMapMode( sal_True );
+
+ // create alpha mask from gradient
+ pVDev->SetDrawMode( DRAWMODE_GRAYGRADIENT );
+ pVDev->DrawGradient( Rectangle( aPoint, aDstSize ), rTransparenceGradient );
+ pVDev->SetDrawMode( DRAWMODE_DEFAULT );
+ pVDev->EnableMapMode( sal_False );
+ pVDev->DrawMask( aPoint, aDstSizePixel, aMask, Color( COL_WHITE ) );
+ aAlpha = pVDev->GetBitmap( aPoint, aDstSizePixel );
+ implWriteBitmapEx( rPos, rSize, BitmapEx( aPaint, aAlpha ), pDummyVDev, i_rContext );
+ }
+ delete pVDev;
+ }
+ }
+ }
+ break;
+
+ case( META_EPS_ACTION ):
+ {
+ const MetaEPSAction* pA = (const MetaEPSAction*) pAction;
+ const GDIMetaFile aSubstitute( pA->GetSubstitute() );
+
+ m_rOuterFace.Push();
+ pDummyVDev->Push();
+
+ MapMode aMapMode( aSubstitute.GetPrefMapMode() );
+ Size aOutSize( pDummyVDev->LogicToLogic( pA->GetSize(), pDummyVDev->GetMapMode(), aMapMode ) );
+ aMapMode.SetScaleX( Fraction( aOutSize.Width(), aSubstitute.GetPrefSize().Width() ) );
+ aMapMode.SetScaleY( Fraction( aOutSize.Height(), aSubstitute.GetPrefSize().Height() ) );
+ aMapMode.SetOrigin( pDummyVDev->LogicToLogic( pA->GetPoint(), pDummyVDev->GetMapMode(), aMapMode ) );
+
+ m_rOuterFace.SetMapMode( aMapMode );
+ pDummyVDev->SetMapMode( aMapMode );
+ playMetafile( aSubstitute, NULL, i_rContext, pDummyVDev );
+ pDummyVDev->Pop();
+ m_rOuterFace.Pop();
+ }
+ break;
+
+ case( META_COMMENT_ACTION ):
+ if( ! i_rContext.m_bTransparenciesWereRemoved )
+ {
+ const MetaCommentAction* pA = (const MetaCommentAction*) pAction;
+ String aSkipComment;
+
+ if( pA->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_BEGIN" ) == COMPARE_EQUAL )
+ {
+ const MetaGradientExAction* pGradAction = NULL;
+ sal_Bool bDone = sal_False;
+
+ while( !bDone && ( ++i < nCount ) )
+ {
+ pAction = aMtf.GetAction( i );
+
+ if( pAction->GetType() == META_GRADIENTEX_ACTION )
+ pGradAction = (const MetaGradientExAction*) pAction;
+ else if( ( pAction->GetType() == META_COMMENT_ACTION ) &&
+ ( ( (const MetaCommentAction*) pAction )->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_END" ) == COMPARE_EQUAL ) )
+ {
+ bDone = sal_True;
+ }
+ }
+
+ if( pGradAction )
+ {
+ #if USE_PDFGRADIENTS
+ m_rOuterFace.DrawGradient( pGradAction->GetPolyPolygon(), pGradAction->GetGradient() );
+ #else
+ implWriteGradient( pGradAction->GetPolyPolygon(), pGradAction->GetGradient(), pDummyVDev, i_rContext );
+ #endif
+ }
+ }
+ else
+ {
+ const sal_uInt8* pData = pA->GetData();
+ if ( pData )
+ {
+ SvMemoryStream aMemStm( (void*)pData, pA->GetDataSize(), STREAM_READ );
+ sal_Bool bSkipSequence = sal_False;
+ ByteString sSeqEnd;
+
+ if( pA->GetComment().Equals( "XPATHSTROKE_SEQ_BEGIN" ) )
+ {
+ sSeqEnd = ByteString( "XPATHSTROKE_SEQ_END" );
+ SvtGraphicStroke aStroke;
+ aMemStm >> aStroke;
+
+ Polygon aPath;
+ aStroke.getPath( aPath );
+
+ PolyPolygon aStartArrow;
+ PolyPolygon aEndArrow;
+ double fTransparency( aStroke.getTransparency() );
+ double fStrokeWidth( aStroke.getStrokeWidth() );
+ SvtGraphicStroke::DashArray aDashArray;
+
+ aStroke.getStartArrow( aStartArrow );
+ aStroke.getEndArrow( aEndArrow );
+ aStroke.getDashArray( aDashArray );
+
+ bSkipSequence = sal_True;
+ if ( aStartArrow.Count() || aEndArrow.Count() )
+ bSkipSequence = sal_False;
+ if ( aDashArray.size() && ( fStrokeWidth != 0.0 ) && ( fTransparency == 0.0 ) )
+ bSkipSequence = sal_False;
+ if ( bSkipSequence )
+ {
+ PDFWriter::ExtLineInfo aInfo;
+ aInfo.m_fLineWidth = fStrokeWidth;
+ aInfo.m_fTransparency = fTransparency;
+ aInfo.m_fMiterLimit = aStroke.getMiterLimit();
+ switch( aStroke.getCapType() )
+ {
+ default:
+ case SvtGraphicStroke::capButt: aInfo.m_eCap = PDFWriter::capButt;break;
+ case SvtGraphicStroke::capRound: aInfo.m_eCap = PDFWriter::capRound;break;
+ case SvtGraphicStroke::capSquare: aInfo.m_eCap = PDFWriter::capSquare;break;
+ }
+ switch( aStroke.getJoinType() )
+ {
+ default:
+ case SvtGraphicStroke::joinMiter: aInfo.m_eJoin = PDFWriter::joinMiter;break;
+ case SvtGraphicStroke::joinRound: aInfo.m_eJoin = PDFWriter::joinRound;break;
+ case SvtGraphicStroke::joinBevel: aInfo.m_eJoin = PDFWriter::joinBevel;break;
+ case SvtGraphicStroke::joinNone:
+ aInfo.m_eJoin = PDFWriter::joinMiter;
+ aInfo.m_fMiterLimit = 0.0;
+ break;
+ }
+ aInfo.m_aDashArray = aDashArray;
+
+ if(SvtGraphicStroke::joinNone == aStroke.getJoinType()
+ && fStrokeWidth > 0.0)
+ {
+ // emulate no edge rounding by handling single edges
+ const sal_uInt16 nPoints(aPath.GetSize());
+ const bool bCurve(aPath.HasFlags());
+
+ for(sal_uInt16 a(0); a + 1 < nPoints; a++)
+ {
+ if(bCurve
+ && POLY_NORMAL != aPath.GetFlags(a + 1)
+ && a + 2 < nPoints
+ && POLY_NORMAL != aPath.GetFlags(a + 2)
+ && a + 3 < nPoints)
+ {
+ const Polygon aSnippet(4,
+ aPath.GetConstPointAry() + a,
+ aPath.GetConstFlagAry() + a);
+ m_rOuterFace.DrawPolyLine( aSnippet, aInfo );
+ a += 2;
+ }
+ else
+ {
+ const Polygon aSnippet(2,
+ aPath.GetConstPointAry() + a);
+ m_rOuterFace.DrawPolyLine( aSnippet, aInfo );
+ }
+ }
+ }
+ else
+ {
+ m_rOuterFace.DrawPolyLine( aPath, aInfo );
+ }
+ }
+ }
+ else if ( pA->GetComment().Equals( "XPATHFILL_SEQ_BEGIN" ) )
+ {
+ sSeqEnd = ByteString( "XPATHFILL_SEQ_END" );
+ SvtGraphicFill aFill;
+ aMemStm >> aFill;
+
+ if ( ( aFill.getFillType() == SvtGraphicFill::fillSolid ) && ( aFill.getFillRule() == SvtGraphicFill::fillEvenOdd ) )
+ {
+ double fTransparency = aFill.getTransparency();
+ if ( fTransparency == 0.0 )
+ {
+ PolyPolygon aPath;
+ aFill.getPath( aPath );
+
+ bSkipSequence = sal_True;
+ m_rOuterFace.DrawPolyPolygon( aPath );
+ }
+ else if ( fTransparency == 1.0 )
+ bSkipSequence = sal_True;
+ }
+/* #i81548# removing optimization for fill textures, because most of the texture settings are not
+ exported properly. In OpenOffice 3.1 the drawing layer will support graphic primitives, then it
+ will not be a problem to optimize the filltexture export. But for wysiwyg is more important than
+ filesize.
+ else if( aFill.getFillType() == SvtGraphicFill::fillTexture && aFill.isTiling() )
+ {
+ sal_Int32 nPattern = mnCachePatternId;
+ Graphic aPatternGraphic;
+ aFill.getGraphic( aPatternGraphic );
+ bool bUseCache = false;
+ SvtGraphicFill::Transform aPatTransform;
+ aFill.getTransform( aPatTransform );
+
+ if( mnCachePatternId >= 0 )
+ {
+ SvtGraphicFill::Transform aCacheTransform;
+ maCacheFill.getTransform( aCacheTransform );
+ if( aCacheTransform.matrix[0] == aPatTransform.matrix[0] &&
+ aCacheTransform.matrix[1] == aPatTransform.matrix[1] &&
+ aCacheTransform.matrix[2] == aPatTransform.matrix[2] &&
+ aCacheTransform.matrix[3] == aPatTransform.matrix[3] &&
+ aCacheTransform.matrix[4] == aPatTransform.matrix[4] &&
+ aCacheTransform.matrix[5] == aPatTransform.matrix[5]
+ )
+ {
+ Graphic aCacheGraphic;
+ maCacheFill.getGraphic( aCacheGraphic );
+ if( aCacheGraphic == aPatternGraphic )
+ bUseCache = true;
+ }
+ }
+
+ if( ! bUseCache )
+ {
+
+ // paint graphic to metafile
+ GDIMetaFile aPattern;
+ pDummyVDev->SetConnectMetaFile( &aPattern );
+ pDummyVDev->Push();
+ pDummyVDev->SetMapMode( aPatternGraphic.GetPrefMapMode() );
+
+ aPatternGraphic.Draw( &rDummyVDev, Point( 0, 0 ) );
+ pDummyVDev->Pop();
+ pDummyVDev->SetConnectMetaFile( NULL );
+ aPattern.WindStart();
+
+ MapMode aPatternMapMode( aPatternGraphic.GetPrefMapMode() );
+ // prepare pattern from metafile
+ Size aPrefSize( aPatternGraphic.GetPrefSize() );
+ // FIXME: this magic -1 shouldn't be necessary
+ aPrefSize.Width() -= 1;
+ aPrefSize.Height() -= 1;
+ aPrefSize = m_rOuterFace.GetReferenceDevice()->
+ LogicToLogic( aPrefSize,
+ &aPatternMapMode,
+ &m_rOuterFace.GetReferenceDevice()->GetMapMode() );
+ // build bounding rectangle of pattern
+ Rectangle aBound( Point( 0, 0 ), aPrefSize );
+ m_rOuterFace.BeginPattern( aBound );
+ m_rOuterFace.Push();
+ pDummyVDev->Push();
+ m_rOuterFace.SetMapMode( aPatternMapMode );
+ pDummyVDev->SetMapMode( aPatternMapMode );
+ ImplWriteActions( m_rOuterFace, NULL, aPattern, rDummyVDev );
+ pDummyVDev->Pop();
+ m_rOuterFace.Pop();
+
+ nPattern = m_rOuterFace.EndPattern( aPatTransform );
+
+ // try some caching and reuse pattern
+ mnCachePatternId = nPattern;
+ maCacheFill = aFill;
+ }
+
+ // draw polypolygon with pattern fill
+ PolyPolygon aPath;
+ aFill.getPath( aPath );
+ m_rOuterFace.DrawPolyPolygon( aPath, nPattern, aFill.getFillRule() == SvtGraphicFill::fillEvenOdd );
+
+ bSkipSequence = sal_True;
+ }
+*/
+ }
+ if ( bSkipSequence )
+ {
+ while( ++i < nCount )
+ {
+ pAction = aMtf.GetAction( i );
+ if ( pAction->GetType() == META_COMMENT_ACTION )
+ {
+ ByteString sComment( ((MetaCommentAction*)pAction)->GetComment() );
+ if ( sComment.Equals( sSeqEnd ) )
+ break;
+ }
+ // #i44496#
+ // the replacement action for stroke is a filled rectangle
+ // the set fillcolor of the replacement is part of the graphics
+ // state and must not be skipped
+ else if( pAction->GetType() == META_FILLCOLOR_ACTION )
+ {
+ const MetaFillColorAction* pMA = (const MetaFillColorAction*) pAction;
+ if( pMA->IsSetting() )
+ m_rOuterFace.SetFillColor( pMA->GetColor() );
+ else
+ m_rOuterFace.SetFillColor();
+ }
+ }
+ }
+ }
+ }
+ }
+ break;
+
+ case( META_BMP_ACTION ):
+ {
+ const MetaBmpAction* pA = (const MetaBmpAction*) pAction;
+ BitmapEx aBitmapEx( pA->GetBitmap() );
+ Size aSize( OutputDevice::LogicToLogic( aBitmapEx.GetPrefSize(),
+ aBitmapEx.GetPrefMapMode(), pDummyVDev->GetMapMode() ) );
+ if( ! ( aSize.Width() && aSize.Height() ) )
+ aSize = pDummyVDev->PixelToLogic( aBitmapEx.GetSizePixel() );
+ implWriteBitmapEx( pA->GetPoint(), aSize, aBitmapEx, pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_BMPSCALE_ACTION ):
+ {
+ const MetaBmpScaleAction* pA = (const MetaBmpScaleAction*) pAction;
+ implWriteBitmapEx( pA->GetPoint(), pA->GetSize(), BitmapEx( pA->GetBitmap() ), pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_BMPSCALEPART_ACTION ):
+ {
+ const MetaBmpScalePartAction* pA = (const MetaBmpScalePartAction*) pAction;
+ BitmapEx aBitmapEx( pA->GetBitmap() );
+ aBitmapEx.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) );
+ implWriteBitmapEx( pA->GetDestPoint(), pA->GetDestSize(), aBitmapEx, pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_BMPEX_ACTION ):
+ {
+ const MetaBmpExAction* pA = (const MetaBmpExAction*) pAction;
+ BitmapEx aBitmapEx( pA->GetBitmapEx() );
+ Size aSize( OutputDevice::LogicToLogic( aBitmapEx.GetPrefSize(),
+ aBitmapEx.GetPrefMapMode(), pDummyVDev->GetMapMode() ) );
+ implWriteBitmapEx( pA->GetPoint(), aSize, aBitmapEx, pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_BMPEXSCALE_ACTION ):
+ {
+ const MetaBmpExScaleAction* pA = (const MetaBmpExScaleAction*) pAction;
+ implWriteBitmapEx( pA->GetPoint(), pA->GetSize(), pA->GetBitmapEx(), pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_BMPEXSCALEPART_ACTION ):
+ {
+ const MetaBmpExScalePartAction* pA = (const MetaBmpExScalePartAction*) pAction;
+ BitmapEx aBitmapEx( pA->GetBitmapEx() );
+ aBitmapEx.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) );
+ implWriteBitmapEx( pA->GetDestPoint(), pA->GetDestSize(), aBitmapEx, pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_MASK_ACTION ):
+ case( META_MASKSCALE_ACTION ):
+ case( META_MASKSCALEPART_ACTION ):
+ {
+ OSL_TRACE( "MetaMask...Action not supported yet" );
+ }
+ break;
+
+ case( META_TEXT_ACTION ):
+ {
+ const MetaTextAction* pA = (const MetaTextAction*) pAction;
+ m_rOuterFace.DrawText( pA->GetPoint(), String( pA->GetText(), pA->GetIndex(), pA->GetLen() ) );
+ }
+ break;
+
+ case( META_TEXTRECT_ACTION ):
+ {
+ const MetaTextRectAction* pA = (const MetaTextRectAction*) pAction;
+ m_rOuterFace.DrawText( pA->GetRect(), String( pA->GetText() ), pA->GetStyle() );
+ }
+ break;
+
+ case( META_TEXTARRAY_ACTION ):
+ {
+ const MetaTextArrayAction* pA = (const MetaTextArrayAction*) pAction;
+ m_rOuterFace.DrawTextArray( pA->GetPoint(), pA->GetText(), pA->GetDXArray(), pA->GetIndex(), pA->GetLen() );
+ }
+ break;
+
+ case( META_STRETCHTEXT_ACTION ):
+ {
+ const MetaStretchTextAction* pA = (const MetaStretchTextAction*) pAction;
+ m_rOuterFace.DrawStretchText( pA->GetPoint(), pA->GetWidth(), pA->GetText(), pA->GetIndex(), pA->GetLen() );
+ }
+ break;
+
+
+ case( META_TEXTLINE_ACTION ):
+ {
+ const MetaTextLineAction* pA = (const MetaTextLineAction*) pAction;
+ m_rOuterFace.DrawTextLine( pA->GetStartPoint(), pA->GetWidth(), pA->GetStrikeout(), pA->GetUnderline(), pA->GetOverline() );
+
+ }
+ break;
+
+ case( META_CLIPREGION_ACTION ):
+ {
+ const MetaClipRegionAction* pA = (const MetaClipRegionAction*) pAction;
+
+ if( pA->IsClipping() )
+ {
+ if( pA->GetRegion().IsEmpty() )
+ m_rOuterFace.SetClipRegion( basegfx::B2DPolyPolygon() );
+ else
+ {
+ Region aReg( pA->GetRegion() );
+ m_rOuterFace.SetClipRegion( aReg.ConvertToB2DPolyPolygon() );
+ }
+ }
+ else
+ m_rOuterFace.SetClipRegion();
+ }
+ break;
+
+ case( META_ISECTRECTCLIPREGION_ACTION ):
+ {
+ const MetaISectRectClipRegionAction* pA = (const MetaISectRectClipRegionAction*) pAction;
+ m_rOuterFace.IntersectClipRegion( pA->GetRect() );
+ }
+ break;
+
+ case( META_ISECTREGIONCLIPREGION_ACTION ):
+ {
+ const MetaISectRegionClipRegionAction* pA = (const MetaISectRegionClipRegionAction*) pAction;
+ Region aReg( pA->GetRegion() );
+ m_rOuterFace.IntersectClipRegion( aReg.ConvertToB2DPolyPolygon() );
+ }
+ break;
+
+ case( META_MOVECLIPREGION_ACTION ):
+ {
+ const MetaMoveClipRegionAction* pA = (const MetaMoveClipRegionAction*) pAction;
+ m_rOuterFace.MoveClipRegion( pA->GetHorzMove(), pA->GetVertMove() );
+ }
+ break;
+
+ case( META_MAPMODE_ACTION ):
+ {
+ const_cast< MetaAction* >( pAction )->Execute( pDummyVDev );
+ m_rOuterFace.SetMapMode( pDummyVDev->GetMapMode() );
+ }
+ break;
+
+ case( META_LINECOLOR_ACTION ):
+ {
+ const MetaLineColorAction* pA = (const MetaLineColorAction*) pAction;
+
+ if( pA->IsSetting() )
+ m_rOuterFace.SetLineColor( pA->GetColor() );
+ else
+ m_rOuterFace.SetLineColor();
+ }
+ break;
+
+ case( META_FILLCOLOR_ACTION ):
+ {
+ const MetaFillColorAction* pA = (const MetaFillColorAction*) pAction;
+
+ if( pA->IsSetting() )
+ m_rOuterFace.SetFillColor( pA->GetColor() );
+ else
+ m_rOuterFace.SetFillColor();
+ }
+ break;
+
+ case( META_TEXTLINECOLOR_ACTION ):
+ {
+ const MetaTextLineColorAction* pA = (const MetaTextLineColorAction*) pAction;
+
+ if( pA->IsSetting() )
+ m_rOuterFace.SetTextLineColor( pA->GetColor() );
+ else
+ m_rOuterFace.SetTextLineColor();
+ }
+ break;
+
+ case( META_OVERLINECOLOR_ACTION ):
+ {
+ const MetaOverlineColorAction* pA = (const MetaOverlineColorAction*) pAction;
+
+ if( pA->IsSetting() )
+ m_rOuterFace.SetOverlineColor( pA->GetColor() );
+ else
+ m_rOuterFace.SetOverlineColor();
+ }
+ break;
+
+ case( META_TEXTFILLCOLOR_ACTION ):
+ {
+ const MetaTextFillColorAction* pA = (const MetaTextFillColorAction*) pAction;
+
+ if( pA->IsSetting() )
+ m_rOuterFace.SetTextFillColor( pA->GetColor() );
+ else
+ m_rOuterFace.SetTextFillColor();
+ }
+ break;
+
+ case( META_TEXTCOLOR_ACTION ):
+ {
+ const MetaTextColorAction* pA = (const MetaTextColorAction*) pAction;
+ m_rOuterFace.SetTextColor( pA->GetColor() );
+ }
+ break;
+
+ case( META_TEXTALIGN_ACTION ):
+ {
+ const MetaTextAlignAction* pA = (const MetaTextAlignAction*) pAction;
+ m_rOuterFace.SetTextAlign( pA->GetTextAlign() );
+ }
+ break;
+
+ case( META_FONT_ACTION ):
+ {
+ const MetaFontAction* pA = (const MetaFontAction*) pAction;
+ m_rOuterFace.SetFont( pA->GetFont() );
+ }
+ break;
+
+ case( META_PUSH_ACTION ):
+ {
+ const MetaPushAction* pA = (const MetaPushAction*) pAction;
+
+ pDummyVDev->Push( pA->GetFlags() );
+ m_rOuterFace.Push( pA->GetFlags() );
+ }
+ break;
+
+ case( META_POP_ACTION ):
+ {
+ pDummyVDev->Pop();
+ m_rOuterFace.Pop();
+ }
+ break;
+
+ case( META_LAYOUTMODE_ACTION ):
+ {
+ const MetaLayoutModeAction* pA = (const MetaLayoutModeAction*) pAction;
+ m_rOuterFace.SetLayoutMode( pA->GetLayoutMode() );
+ }
+ break;
+
+ case META_TEXTLANGUAGE_ACTION:
+ {
+ const MetaTextLanguageAction* pA = (const MetaTextLanguageAction*) pAction;
+ m_rOuterFace.SetDigitLanguage( pA->GetTextLanguage() );
+ }
+ break;
+
+ case( META_WALLPAPER_ACTION ):
+ {
+ const MetaWallpaperAction* pA = (const MetaWallpaperAction*) pAction;
+ m_rOuterFace.DrawWallpaper( pA->GetRect(), pA->GetWallpaper() );
+ }
+ break;
+
+ case( META_RASTEROP_ACTION ):
+ {
+ // !!! >>> we don't want to support this actions
+ }
+ break;
+
+ case( META_REFPOINT_ACTION ):
+ {
+ // !!! >>> we don't want to support this actions
+ }
+ break;
+
+ default:
+ // #i24604# Made assertion fire only once per
+ // metafile. The asserted actions here are all
+ // deprecated
+ if( !bAssertionFired )
+ {
+ bAssertionFired = true;
+ OSL_TRACE( "PDFExport::ImplWriteActions: deprecated and unsupported MetaAction encountered" );
+ }
+ break;
+ }
+ i++;
+ }
+ }
+
+ delete pPrivateDevice;
+}
+
+// Encryption methods
+
+/* a crutch to transport an rtlDigest safely though UNO API
+ this is needed for the PDF export dialog, which otherwise would have to pass
+ clear text passwords down till they can be used in PDFWriter. Unfortunately
+ the MD5 sum of the password (which is needed to create the PDF encryption key)
+ is not sufficient, since an rtl MD5 digest cannot be created in an arbitrary state
+ which would be needed in PDFWriterImpl::computeEncryptionKey.
+*/
+class EncHashTransporter : public cppu::WeakImplHelper1 < com::sun::star::beans::XMaterialHolder >
+{
+ rtlDigest maUDigest;
+ sal_IntPtr maID;
+ std::vector< sal_uInt8 > maOValue;
+
+ static std::map< sal_IntPtr, EncHashTransporter* > sTransporters;
+public:
+ EncHashTransporter()
+ : maUDigest( rtl_digest_createMD5() )
+ {
+ maID = reinterpret_cast< sal_IntPtr >(this);
+ while( sTransporters.find( maID ) != sTransporters.end() ) // paranoia mode
+ maID++;
+ sTransporters[ maID ] = this;
+ }
+
+ virtual ~EncHashTransporter()
+ {
+ sTransporters.erase( maID );
+ if( maUDigest )
+ rtl_digest_destroyMD5( maUDigest );
+ OSL_TRACE( "EncHashTransporter freed\n" );
+ }
+
+ rtlDigest getUDigest() const { return maUDigest; };
+ std::vector< sal_uInt8 >& getOValue() { return maOValue; }
+ void invalidate()
+ {
+ if( maUDigest )
+ {
+ rtl_digest_destroyMD5( maUDigest );
+ maUDigest = NULL;
+ }
+ }
+
+ // XMaterialHolder
+ virtual uno::Any SAL_CALL getMaterial() throw()
+ {
+ return uno::makeAny( sal_Int64(maID) );
+ }
+
+ static EncHashTransporter* getEncHashTransporter( const uno::Reference< beans::XMaterialHolder >& );
+
+};
+
+std::map< sal_IntPtr, EncHashTransporter* > EncHashTransporter::sTransporters;
+
+EncHashTransporter* EncHashTransporter::getEncHashTransporter( const uno::Reference< beans::XMaterialHolder >& xRef )
+{
+ EncHashTransporter* pResult = NULL;
+ if( xRef.is() )
+ {
+ uno::Any aMat( xRef->getMaterial() );
+ sal_Int64 nMat = 0;
+ if( aMat >>= nMat )
+ {
+ std::map< sal_IntPtr, EncHashTransporter* >::iterator it = sTransporters.find( static_cast<sal_IntPtr>(nMat) );
+ if( it != sTransporters.end() )
+ pResult = it->second;
+ }
+ }
+ return pResult;
+}
+
+sal_Bool PDFWriterImpl::checkEncryptionBufferSize( register sal_Int32 newSize )
+{
+ if( m_nEncryptionBufferSize < newSize )
+ {
+ /* reallocate the buffer, the used function allocate as rtl_allocateMemory
+ if the pointer parameter is NULL */
+ m_pEncryptionBuffer = (sal_uInt8*)rtl_reallocateMemory( m_pEncryptionBuffer, newSize );
+ if( m_pEncryptionBuffer )
+ m_nEncryptionBufferSize = newSize;
+ else
+ m_nEncryptionBufferSize = 0;
+ }
+ return ( m_nEncryptionBufferSize != 0 );
+}
+
+void PDFWriterImpl::checkAndEnableStreamEncryption( register sal_Int32 nObject )
+{
+ if( m_aContext.Encryption.Encrypt() )
+ {
+ m_bEncryptThisStream = true;
+ sal_Int32 i = m_nKeyLength;
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)nObject;
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)( nObject >> 8 );
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)( nObject >> 16 );
+ //the other location of m_nEncryptionKey are already set to 0, our fixed generation number
+ // do the MD5 hash
+ sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
+ // the i+2 to take into account the generation number, always zero
+ rtl_digest_MD5( &m_aContext.Encryption.EncryptionKey[0], i+2, nMD5Sum, sizeof(nMD5Sum) );
+ // initialize the RC4 with the key
+ // key legth: see algoritm 3.1, step 4: (N+5) max 16
+ rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode, nMD5Sum, m_nRC4KeyLength, NULL, 0 );
+ }
+}
+
+void PDFWriterImpl::enableStringEncryption( register sal_Int32 nObject )
+{
+ if( m_aContext.Encryption.Encrypt() )
+ {
+ sal_Int32 i = m_nKeyLength;
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)nObject;
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)( nObject >> 8 );
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)( nObject >> 16 );
+ //the other location of m_nEncryptionKey are already set to 0, our fixed generation number
+ // do the MD5 hash
+ sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
+ // the i+2 to take into account the generation number, always zero
+ rtl_digest_MD5( &m_aContext.Encryption.EncryptionKey[0], i+2, nMD5Sum, sizeof(nMD5Sum) );
+ // initialize the RC4 with the key
+ // key legth: see algoritm 3.1, step 4: (N+5) max 16
+ rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode, nMD5Sum, m_nRC4KeyLength, NULL, 0 );
+ }
+}
+
+/* init the encryption engine
+1. init the document id, used both for building the document id and for building the encryption key(s)
+2. build the encryption key following algorithms described in the PDF specification
+ */
+uno::Reference< beans::XMaterialHolder > PDFWriterImpl::initEncryption( const rtl::OUString& i_rOwnerPassword,
+ const rtl::OUString& i_rUserPassword,
+ bool b128Bit
+ )
+{
+ uno::Reference< beans::XMaterialHolder > xResult;
+ if( i_rOwnerPassword.getLength() || i_rUserPassword.getLength() )
+ {
+ EncHashTransporter* pTransporter = new EncHashTransporter;
+ xResult = pTransporter;
+
+ // get padded passwords
+ sal_uInt8 aPadUPW[ENCRYPTED_PWD_SIZE], aPadOPW[ENCRYPTED_PWD_SIZE];
+ padPassword( i_rOwnerPassword.getLength() ? i_rOwnerPassword : i_rUserPassword, aPadOPW );
+ padPassword( i_rUserPassword, aPadUPW );
+ sal_Int32 nKeyLength = SECUR_40BIT_KEY;
+ if( b128Bit )
+ nKeyLength = SECUR_128BIT_KEY;
+
+ if( computeODictionaryValue( aPadOPW, aPadUPW, pTransporter->getOValue(), nKeyLength ) )
+ {
+ rtlDigest aDig = pTransporter->getUDigest();
+ if( rtl_digest_updateMD5( aDig, aPadUPW, ENCRYPTED_PWD_SIZE ) != rtl_Digest_E_None )
+ xResult.clear();
+ }
+ else
+ xResult.clear();
+
+ // trash temporary padded cleartext PWDs
+ rtl_zeroMemory( aPadOPW, sizeof(aPadOPW) );
+ rtl_zeroMemory( aPadUPW, sizeof(aPadUPW) );
+
+ }
+ return xResult;
+}
+
+bool PDFWriterImpl::prepareEncryption( const uno::Reference< beans::XMaterialHolder >& xEnc )
+{
+ bool bSuccess = false;
+ EncHashTransporter* pTransporter = EncHashTransporter::getEncHashTransporter( xEnc );
+ if( pTransporter )
+ {
+ sal_Int32 nKeyLength = 0, nRC4KeyLength = 0;
+ sal_Int32 nAccessPermissions = computeAccessPermissions( m_aContext.Encryption, nKeyLength, nRC4KeyLength );
+ m_aContext.Encryption.OValue = pTransporter->getOValue();
+ bSuccess = computeUDictionaryValue( pTransporter, m_aContext.Encryption, nKeyLength, nAccessPermissions );
+ }
+ if( ! bSuccess )
+ {
+ m_aContext.Encryption.OValue.clear();
+ m_aContext.Encryption.UValue.clear();
+ m_aContext.Encryption.EncryptionKey.clear();
+ }
+ return bSuccess;
+}
+
+sal_Int32 PDFWriterImpl::computeAccessPermissions( const vcl::PDFWriter::PDFEncryptionProperties& i_rProperties,
+ sal_Int32& o_rKeyLength, sal_Int32& o_rRC4KeyLength )
+{
+ /*
+ 2) compute the access permissions, in numerical form
+
+ the default value depends on the revision 2 (40 bit) or 3 (128 bit security):
+ - for 40 bit security the unused bit must be set to 1, since they are not used
+ - for 128 bit security the same bit must be preset to 0 and set later if needed
+ according to the table 3.15, pdf v 1.4 */
+ sal_Int32 nAccessPermissions = ( i_rProperties.Security128bit ) ? 0xfffff0c0 : 0xffffffc0 ;
+
+ /* check permissions for 40 bit security case */
+ nAccessPermissions |= ( i_rProperties.CanPrintTheDocument ) ? 1 << 2 : 0;
+ nAccessPermissions |= ( i_rProperties.CanModifyTheContent ) ? 1 << 3 : 0;
+ nAccessPermissions |= ( i_rProperties.CanCopyOrExtract ) ? 1 << 4 : 0;
+ nAccessPermissions |= ( i_rProperties.CanAddOrModify ) ? 1 << 5 : 0;
+ o_rKeyLength = SECUR_40BIT_KEY;
+ o_rRC4KeyLength = SECUR_40BIT_KEY+5; // for this value see PDF spec v 1.4, algorithm 3.1 step 4, where n is 5
+
+ if( i_rProperties.Security128bit )
+ {
+ o_rKeyLength = SECUR_128BIT_KEY;
+ o_rRC4KeyLength = 16; // for this value see PDF spec v 1.4, algorithm 3.1 step 4, where n is 16, thus maximum
+ // permitted value is 16
+ nAccessPermissions |= ( i_rProperties.CanFillInteractive ) ? 1 << 8 : 0;
+ nAccessPermissions |= ( i_rProperties.CanExtractForAccessibility ) ? 1 << 9 : 0;
+ nAccessPermissions |= ( i_rProperties.CanAssemble ) ? 1 << 10 : 0;
+ nAccessPermissions |= ( i_rProperties.CanPrintFull ) ? 1 << 11 : 0;
+ }
+ return nAccessPermissions;
+}
+
+/*************************************************************
+begin i12626 methods
+
+Implements Algorithm 3.2, step 1 only
+*/
+void PDFWriterImpl::padPassword( const rtl::OUString& i_rPassword, sal_uInt8* o_pPaddedPW )
+{
+ // get ansi-1252 version of the password string CHECKIT ! i12626
+ rtl::OString aString( rtl::OUStringToOString( i_rPassword, RTL_TEXTENCODING_MS_1252 ) );
+
+ //copy the string to the target
+ sal_Int32 nToCopy = ( aString.getLength() < ENCRYPTED_PWD_SIZE ) ? aString.getLength() : ENCRYPTED_PWD_SIZE;
+ sal_Int32 nCurrentChar;
+
+ for( nCurrentChar = 0; nCurrentChar < nToCopy; nCurrentChar++ )
+ o_pPaddedPW[nCurrentChar] = (sal_uInt8)( aString.getStr()[nCurrentChar] );
+
+ //pad it with standard byte string
+ sal_Int32 i,y;
+ for( i = nCurrentChar, y = 0 ; i < ENCRYPTED_PWD_SIZE; i++, y++ )
+ o_pPaddedPW[i] = s_nPadString[y];
+
+ // trash memory of temporary clear text password
+ rtl_zeroMemory( (sal_Char*)aString.getStr(), aString.getLength() );
+}
+
+/**********************************
+Algorithm 3.2 Compute the encryption key used
+
+step 1 should already be done before calling, the paThePaddedPassword parameter should contain
+the padded password and must be 32 byte long, the encryption key is returned into the paEncryptionKey parameter,
+it will be 16 byte long for 128 bit security; for 40 bit security only the first 5 bytes are used
+
+TODO: in pdf ver 1.5 and 1.6 the step 6 is different, should be implemented. See spec.
+
+*/
+bool PDFWriterImpl::computeEncryptionKey( EncHashTransporter* i_pTransporter, vcl::PDFWriter::PDFEncryptionProperties& io_rProperties, sal_Int32 i_nAccessPermissions )
+{
+ bool bSuccess = true;
+ sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
+
+ // transporter contains an MD5 digest with the padded user password already
+ rtlDigest aDigest = i_pTransporter->getUDigest();
+ rtlDigestError nError = rtl_Digest_E_None;
+ if( aDigest )
+ {
+ //step 3
+ if( ! io_rProperties.OValue.empty() )
+ nError = rtl_digest_updateMD5( aDigest, &io_rProperties.OValue[0] , sal_Int32(io_rProperties.OValue.size()) );
+ else
+ bSuccess = false;
+ //Step 4
+ sal_uInt8 nPerm[4];
+
+ nPerm[0] = (sal_uInt8)i_nAccessPermissions;
+ nPerm[1] = (sal_uInt8)( i_nAccessPermissions >> 8 );
+ nPerm[2] = (sal_uInt8)( i_nAccessPermissions >> 16 );
+ nPerm[3] = (sal_uInt8)( i_nAccessPermissions >> 24 );
+
+ if( nError == rtl_Digest_E_None )
+ nError = rtl_digest_updateMD5( aDigest, nPerm , sizeof( nPerm ) );
+
+ //step 5, get the document ID, binary form
+ if( nError == rtl_Digest_E_None )
+ nError = rtl_digest_updateMD5( aDigest, &io_rProperties.DocumentIdentifier[0], sal_Int32(io_rProperties.DocumentIdentifier.size()) );
+ //get the digest
+ if( nError == rtl_Digest_E_None )
+ {
+ rtl_digest_getMD5( aDigest, nMD5Sum, sizeof( nMD5Sum ) );
+
+ //step 6, only if 128 bit
+ if( io_rProperties.Security128bit )
+ {
+ for( sal_Int32 i = 0; i < 50; i++ )
+ {
+ nError = rtl_digest_updateMD5( aDigest, &nMD5Sum, sizeof( nMD5Sum ) );
+ if( nError != rtl_Digest_E_None )
+ {
+ bSuccess = false;
+ break;
+ }
+ rtl_digest_getMD5( aDigest, nMD5Sum, sizeof( nMD5Sum ) );
+ }
+ }
+ }
+ }
+ else
+ bSuccess = false;
+
+ i_pTransporter->invalidate();
+
+ //Step 7
+ if( bSuccess )
+ {
+ io_rProperties.EncryptionKey.resize( MAXIMUM_RC4_KEY_LENGTH );
+ for( sal_Int32 i = 0; i < MD5_DIGEST_SIZE; i++ )
+ io_rProperties.EncryptionKey[i] = nMD5Sum[i];
+ }
+ else
+ io_rProperties.EncryptionKey.clear();
+
+ return bSuccess;
+}
+
+/**********************************
+Algorithm 3.3 Compute the encryption dictionary /O value, save into the class data member
+the step numbers down here correspond to the ones in PDF v.1.4 specfication
+*/
+bool PDFWriterImpl::computeODictionaryValue( const sal_uInt8* i_pPaddedOwnerPassword,
+ const sal_uInt8* i_pPaddedUserPassword,
+ std::vector< sal_uInt8 >& io_rOValue,
+ sal_Int32 i_nKeyLength
+ )
+{
+ bool bSuccess = true;
+
+ io_rOValue.resize( ENCRYPTED_PWD_SIZE );
+
+ rtlDigest aDigest = rtl_digest_createMD5();
+ rtlCipher aCipher = rtl_cipher_createARCFOUR( rtl_Cipher_ModeStream );
+ if( aDigest && aCipher)
+ {
+ //step 1 already done, data is in i_pPaddedOwnerPassword
+ //step 2
+
+ rtlDigestError nError = rtl_digest_updateMD5( aDigest, i_pPaddedOwnerPassword, ENCRYPTED_PWD_SIZE );
+ if( nError == rtl_Digest_E_None )
+ {
+ sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
+
+ rtl_digest_getMD5( aDigest, nMD5Sum, sizeof(nMD5Sum) );
+//step 3, only if 128 bit
+ if( i_nKeyLength == SECUR_128BIT_KEY )
+ {
+ sal_Int32 i;
+ for( i = 0; i < 50; i++ )
+ {
+ nError = rtl_digest_updateMD5( aDigest, nMD5Sum, sizeof( nMD5Sum ) );
+ if( nError != rtl_Digest_E_None )
+ {
+ bSuccess = false;
+ break;
+ }
+ rtl_digest_getMD5( aDigest, nMD5Sum, sizeof( nMD5Sum ) );
+ }
+ }
+ //Step 4, the key is in nMD5Sum
+ //step 5 already done, data is in i_pPaddedUserPassword
+ //step 6
+ rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
+ nMD5Sum, i_nKeyLength , NULL, 0 );
+ // encrypt the user password using the key set above
+ rtl_cipher_encodeARCFOUR( aCipher, i_pPaddedUserPassword, ENCRYPTED_PWD_SIZE, // the data to be encrypted
+ &io_rOValue[0], sal_Int32(io_rOValue.size()) ); //encrypted data
+ //Step 7, only if 128 bit
+ if( i_nKeyLength == SECUR_128BIT_KEY )
+ {
+ sal_uInt32 i, y;
+ sal_uInt8 nLocalKey[ SECUR_128BIT_KEY ]; // 16 = 128 bit key
+
+ for( i = 1; i <= 19; i++ ) // do it 19 times, start with 1
+ {
+ for( y = 0; y < sizeof( nLocalKey ); y++ )
+ nLocalKey[y] = (sal_uInt8)( nMD5Sum[y] ^ i );
+
+ rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
+ nLocalKey, SECUR_128BIT_KEY, NULL, 0 ); //destination data area, on init can be NULL
+ rtl_cipher_encodeARCFOUR( aCipher, &io_rOValue[0], sal_Int32(io_rOValue.size()), // the data to be encrypted
+ &io_rOValue[0], sal_Int32(io_rOValue.size()) ); // encrypted data, can be the same as the input, encrypt "in place"
+ //step 8, store in class data member
+ }
+ }
+ }
+ else
+ bSuccess = false;
+ }
+ else
+ bSuccess = false;
+
+ if( aDigest )
+ rtl_digest_destroyMD5( aDigest );
+ if( aCipher )
+ rtl_cipher_destroyARCFOUR( aCipher );
+
+ if( ! bSuccess )
+ io_rOValue.clear();
+ return bSuccess;
+}
+
+/**********************************
+Algorithms 3.4 and 3.5 Compute the encryption dictionary /U value, save into the class data member, revision 2 (40 bit) or 3 (128 bit)
+*/
+bool PDFWriterImpl::computeUDictionaryValue( EncHashTransporter* i_pTransporter,
+ vcl::PDFWriter::PDFEncryptionProperties& io_rProperties,
+ sal_Int32 i_nKeyLength,
+ sal_Int32 i_nAccessPermissions
+ )
+{
+ bool bSuccess = true;
+
+ io_rProperties.UValue.resize( ENCRYPTED_PWD_SIZE );
+
+ rtlDigest aDigest = rtl_digest_createMD5();
+ rtlCipher aCipher = rtl_cipher_createARCFOUR( rtl_Cipher_ModeStream );
+ if( aDigest && aCipher )
+ {
+ //step 1, common to both 3.4 and 3.5
+ if( computeEncryptionKey( i_pTransporter, io_rProperties, i_nAccessPermissions ) )
+ {
+ // prepare encryption key for object
+ for( sal_Int32 i = i_nKeyLength, y = 0; y < 5 ; y++ )
+ io_rProperties.EncryptionKey[i++] = 0;
+
+ if( io_rProperties.Security128bit == false )
+ {
+ //3.4
+ //step 2 and 3
+ rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
+ &io_rProperties.EncryptionKey[0], 5 , // key and key length
+ NULL, 0 ); //destination data area
+ // encrypt the user password using the key set above, save for later use
+ rtl_cipher_encodeARCFOUR( aCipher, s_nPadString, sizeof( s_nPadString ), // the data to be encrypted
+ &io_rProperties.UValue[0], sal_Int32(io_rProperties.UValue.size()) ); //encrypted data, stored in class data member
+ }
+ else
+ {
+ //or 3.5, for 128 bit security
+ //step6, initilize the last 16 bytes of the encrypted user password to 0
+ for(sal_uInt32 i = MD5_DIGEST_SIZE; i < sal_uInt32(io_rProperties.UValue.size()); i++)
+ io_rProperties.UValue[i] = 0;
+ //step 2
+ rtlDigestError nError = rtl_digest_updateMD5( aDigest, s_nPadString, sizeof( s_nPadString ) );
+ //step 3
+ if( nError == rtl_Digest_E_None )
+ nError = rtl_digest_updateMD5( aDigest, &io_rProperties.DocumentIdentifier[0], sal_Int32(io_rProperties.DocumentIdentifier.size()) );
+ else
+ bSuccess = false;
+
+ sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
+ rtl_digest_getMD5( aDigest, nMD5Sum, sizeof(nMD5Sum) );
+ //Step 4
+ rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
+ &io_rProperties.EncryptionKey[0], SECUR_128BIT_KEY, NULL, 0 ); //destination data area
+ rtl_cipher_encodeARCFOUR( aCipher, nMD5Sum, sizeof( nMD5Sum ), // the data to be encrypted
+ &io_rProperties.UValue[0], sizeof( nMD5Sum ) ); //encrypted data, stored in class data member
+ //step 5
+ sal_uInt32 i, y;
+ sal_uInt8 nLocalKey[SECUR_128BIT_KEY];
+
+ for( i = 1; i <= 19; i++ ) // do it 19 times, start with 1
+ {
+ for( y = 0; y < sizeof( nLocalKey ) ; y++ )
+ nLocalKey[y] = (sal_uInt8)( io_rProperties.EncryptionKey[y] ^ i );
+
+ rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
+ nLocalKey, SECUR_128BIT_KEY, // key and key length
+ NULL, 0 ); //destination data area, on init can be NULL
+ rtl_cipher_encodeARCFOUR( aCipher, &io_rProperties.UValue[0], SECUR_128BIT_KEY, // the data to be encrypted
+ &io_rProperties.UValue[0], SECUR_128BIT_KEY ); // encrypted data, can be the same as the input, encrypt "in place"
+ }
+ }
+ }
+ else
+ bSuccess = false;
+ }
+ else
+ bSuccess = false;
+
+ if( aDigest )
+ rtl_digest_destroyMD5( aDigest );
+ if( aCipher )
+ rtl_cipher_destroyARCFOUR( aCipher );
+
+ if( ! bSuccess )
+ io_rProperties.UValue.clear();
+ return bSuccess;
+}
+
+/* end i12626 methods */
+
+static const long unsetRun[256] =
+{
+ 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, /* 0x00 - 0x0f */
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0x10 - 0x1f */
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0x20 - 0x2f */
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0x30 - 0x3f */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x40 - 0x4f */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x50 - 0x5f */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x60 - 0x6f */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x70 - 0x7f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 - 0x8f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 - 0x9f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xa0 - 0xaf */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xb0 - 0xbf */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xc0 - 0xcf */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xd0 - 0xdf */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xe0 - 0xef */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xf0 - 0xff */
+};
+
+static const long setRun[256] =
+{
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 - 0x0f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 - 0x1f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 - 0x2f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 - 0x3f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x4f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 - 0x5f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x6f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 - 0x7f */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x80 - 0x8f */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x90 - 0x9f */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xa0 - 0xaf */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xb0 - 0xbf */
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0xc0 - 0xcf */
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0xd0 - 0xdf */
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0xe0 - 0xef */
+ 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 8, /* 0xf0 - 0xff */
+};
+
+inline bool isSet( const Scanline i_pLine, long i_nIndex )
+{
+ return (i_pLine[ i_nIndex/8 ] & (0x80 >> (i_nIndex&7))) != 0;
+}
+
+long findBitRun( const Scanline i_pLine, long i_nStartIndex, long i_nW, bool i_bSet )
+{
+ if( i_nStartIndex < 0 )
+ return i_nW;
+
+ long nIndex = i_nStartIndex;
+ if( nIndex < i_nW )
+ {
+ const sal_uInt8 * pByte = static_cast<sal_uInt8*>(i_pLine) + (nIndex/8);
+ sal_uInt8 nByte = *pByte;
+
+ // run up to byte boundary
+ long nBitInByte = (nIndex & 7);
+ if( nBitInByte )
+ {
+ sal_uInt8 nMask = 0x80 >> nBitInByte;
+ while( nBitInByte != 8 )
+ {
+ if( (nByte & nMask) != (i_bSet ? nMask : 0) )
+ return nIndex < i_nW ? nIndex : i_nW;
+ nMask = nMask >> 1;
+ nBitInByte++;
+ nIndex++;
+ }
+ if( nIndex < i_nW )
+ {
+ pByte++;
+ nByte = *pByte;
+ }
+ }
+
+ sal_uInt8 nRunByte;
+ const long* pRunTable;
+ if( i_bSet )
+ {
+ nRunByte = 0xff;
+ pRunTable = setRun;
+ }
+ else
+ {
+ nRunByte = 0;
+ pRunTable = unsetRun;
+ }
+
+ while( nByte == nRunByte && nIndex < i_nW )
+ {
+ nIndex += 8;
+ pByte++;
+ nByte = *pByte;
+ }
+ if( nIndex < i_nW )
+ {
+ nIndex += pRunTable[nByte];
+ }
+ }
+ return nIndex < i_nW ? nIndex : i_nW;
+}
+
+struct BitStreamState
+{
+ sal_uInt8 mnBuffer;
+ sal_uInt32 mnNextBitPos;
+
+ BitStreamState()
+ : mnBuffer( 0 )
+ , mnNextBitPos( 8 )
+ {
+ }
+
+ const sal_uInt8* getByte() const { return &mnBuffer; }
+ void flush() { mnNextBitPos = 8; mnBuffer = 0; }
+};
+
+void PDFWriterImpl::putG4Bits( sal_uInt32 i_nLength, sal_uInt32 i_nCode, BitStreamState& io_rState )
+{
+ while( i_nLength > io_rState.mnNextBitPos )
+ {
+ io_rState.mnBuffer |= static_cast<sal_uInt8>( i_nCode >> (i_nLength - io_rState.mnNextBitPos) );
+ i_nLength -= io_rState.mnNextBitPos;
+ writeBuffer( io_rState.getByte(), 1 );
+ io_rState.flush();
+ }
+ OSL_ASSERT( i_nLength < 9 );
+ static const unsigned int msbmask[9] = { 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff };
+ io_rState.mnBuffer |= static_cast<sal_uInt8>( (i_nCode & msbmask[i_nLength]) << (io_rState.mnNextBitPos - i_nLength) );
+ io_rState.mnNextBitPos -= i_nLength;
+ if( io_rState.mnNextBitPos == 0 )
+ {
+ writeBuffer( io_rState.getByte(), 1 );
+ io_rState.flush();
+ }
+}
+
+struct PixelCode
+{
+ sal_uInt32 mnEncodedPixels;
+ sal_uInt32 mnCodeBits;
+ sal_uInt32 mnCode;
+};
+
+static const PixelCode WhitePixelCodes[] =
+{
+ { 0, 8, 0x35 }, // 0011 0101
+ { 1, 6, 0x7 }, // 0001 11
+ { 2, 4, 0x7 }, // 0111
+ { 3, 4, 0x8 }, // 1000
+ { 4, 4, 0xB }, // 1011
+ { 5, 4, 0xC }, // 1100
+ { 6, 4, 0xE }, // 1110
+ { 7, 4, 0xF }, // 1111
+ { 8, 5, 0x13 }, // 1001 1
+ { 9, 5, 0x14 }, // 1010 0
+ { 10, 5, 0x7 }, // 0011 1
+ { 11, 5, 0x8 }, // 0100 0
+ { 12, 6, 0x8 }, // 0010 00
+ { 13, 6, 0x3 }, // 0000 11
+ { 14, 6, 0x34 }, // 1101 00
+ { 15, 6, 0x35 }, // 1101 01
+ { 16, 6, 0x2A }, // 1010 10
+ { 17, 6, 0x2B }, // 1010 11
+ { 18, 7, 0x27 }, // 0100 111
+ { 19, 7, 0xC }, // 0001 100
+ { 20, 7, 0x8 }, // 0001 000
+ { 21, 7, 0x17 }, // 0010 111
+ { 22, 7, 0x3 }, // 0000 011
+ { 23, 7, 0x4 }, // 0000 100
+ { 24, 7, 0x28 }, // 0101 000
+ { 25, 7, 0x2B }, // 0101 011
+ { 26, 7, 0x13 }, // 0010 011
+ { 27, 7, 0x24 }, // 0100 100
+ { 28, 7, 0x18 }, // 0011 000
+ { 29, 8, 0x2 }, // 0000 0010
+ { 30, 8, 0x3 }, // 0000 0011
+ { 31, 8, 0x1A }, // 0001 1010
+ { 32, 8, 0x1B }, // 0001 1011
+ { 33, 8, 0x12 }, // 0001 0010
+ { 34, 8, 0x13 }, // 0001 0011
+ { 35, 8, 0x14 }, // 0001 0100
+ { 36, 8, 0x15 }, // 0001 0101
+ { 37, 8, 0x16 }, // 0001 0110
+ { 38, 8, 0x17 }, // 0001 0111
+ { 39, 8, 0x28 }, // 0010 1000
+ { 40, 8, 0x29 }, // 0010 1001
+ { 41, 8, 0x2A }, // 0010 1010
+ { 42, 8, 0x2B }, // 0010 1011
+ { 43, 8, 0x2C }, // 0010 1100
+ { 44, 8, 0x2D }, // 0010 1101
+ { 45, 8, 0x4 }, // 0000 0100
+ { 46, 8, 0x5 }, // 0000 0101
+ { 47, 8, 0xA }, // 0000 1010
+ { 48, 8, 0xB }, // 0000 1011
+ { 49, 8, 0x52 }, // 0101 0010
+ { 50, 8, 0x53 }, // 0101 0011
+ { 51, 8, 0x54 }, // 0101 0100
+ { 52, 8, 0x55 }, // 0101 0101
+ { 53, 8, 0x24 }, // 0010 0100
+ { 54, 8, 0x25 }, // 0010 0101
+ { 55, 8, 0x58 }, // 0101 1000
+ { 56, 8, 0x59 }, // 0101 1001
+ { 57, 8, 0x5A }, // 0101 1010
+ { 58, 8, 0x5B }, // 0101 1011
+ { 59, 8, 0x4A }, // 0100 1010
+ { 60, 8, 0x4B }, // 0100 1011
+ { 61, 8, 0x32 }, // 0011 0010
+ { 62, 8, 0x33 }, // 0011 0011
+ { 63, 8, 0x34 }, // 0011 0100
+ { 64, 5, 0x1B }, // 1101 1
+ { 128, 5, 0x12 }, // 1001 0
+ { 192, 6, 0x17 }, // 0101 11
+ { 256, 7, 0x37 }, // 0110 111
+ { 320, 8, 0x36 }, // 0011 0110
+ { 384, 8, 0x37 }, // 0011 0111
+ { 448, 8, 0x64 }, // 0110 0100
+ { 512, 8, 0x65 }, // 0110 0101
+ { 576, 8, 0x68 }, // 0110 1000
+ { 640, 8, 0x67 }, // 0110 0111
+ { 704, 9, 0xCC }, // 0110 0110 0
+ { 768, 9, 0xCD }, // 0110 0110 1
+ { 832, 9, 0xD2 }, // 0110 1001 0
+ { 896, 9, 0xD3 }, // 0110 1001 1
+ { 960, 9, 0xD4 }, // 0110 1010 0
+ { 1024, 9, 0xD5 }, // 0110 1010 1
+ { 1088, 9, 0xD6 }, // 0110 1011 0
+ { 1152, 9, 0xD7 }, // 0110 1011 1
+ { 1216, 9, 0xD8 }, // 0110 1100 0
+ { 1280, 9, 0xD9 }, // 0110 1100 1
+ { 1344, 9, 0xDA }, // 0110 1101 0
+ { 1408, 9, 0xDB }, // 0110 1101 1
+ { 1472, 9, 0x98 }, // 0100 1100 0
+ { 1536, 9, 0x99 }, // 0100 1100 1
+ { 1600, 9, 0x9A }, // 0100 1101 0
+ { 1664, 6, 0x18 }, // 0110 00
+ { 1728, 9, 0x9B }, // 0100 1101 1
+ { 1792, 11, 0x8 }, // 0000 0001 000
+ { 1856, 11, 0xC }, // 0000 0001 100
+ { 1920, 11, 0xD }, // 0000 0001 101
+ { 1984, 12, 0x12 }, // 0000 0001 0010
+ { 2048, 12, 0x13 }, // 0000 0001 0011
+ { 2112, 12, 0x14 }, // 0000 0001 0100
+ { 2176, 12, 0x15 }, // 0000 0001 0101
+ { 2240, 12, 0x16 }, // 0000 0001 0110
+ { 2304, 12, 0x17 }, // 0000 0001 0111
+ { 2368, 12, 0x1C }, // 0000 0001 1100
+ { 2432, 12, 0x1D }, // 0000 0001 1101
+ { 2496, 12, 0x1E }, // 0000 0001 1110
+ { 2560, 12, 0x1F } // 0000 0001 1111
+};
+
+static const PixelCode BlackPixelCodes[] =
+{
+ { 0, 10, 0x37 }, // 0000 1101 11
+ { 1, 3, 0x2 }, // 010
+ { 2, 2, 0x3 }, // 11
+ { 3, 2, 0x2 }, // 10
+ { 4, 3, 0x3 }, // 011
+ { 5, 4, 0x3 }, // 0011
+ { 6, 4, 0x2 }, // 0010
+ { 7, 5, 0x3 }, // 0001 1
+ { 8, 6, 0x5 }, // 0001 01
+ { 9, 6, 0x4 }, // 0001 00
+ { 10, 7, 0x4 }, // 0000 100
+ { 11, 7, 0x5 }, // 0000 101
+ { 12, 7, 0x7 }, // 0000 111
+ { 13, 8, 0x4 }, // 0000 0100
+ { 14, 8, 0x7 }, // 0000 0111
+ { 15, 9, 0x18 }, // 0000 1100 0
+ { 16, 10, 0x17 }, // 0000 0101 11
+ { 17, 10, 0x18 }, // 0000 0110 00
+ { 18, 10, 0x8 }, // 0000 0010 00
+ { 19, 11, 0x67 }, // 0000 1100 111
+ { 20, 11, 0x68 }, // 0000 1101 000
+ { 21, 11, 0x6C }, // 0000 1101 100
+ { 22, 11, 0x37 }, // 0000 0110 111
+ { 23, 11, 0x28 }, // 0000 0101 000
+ { 24, 11, 0x17 }, // 0000 0010 111
+ { 25, 11, 0x18 }, // 0000 0011 000
+ { 26, 12, 0xCA }, // 0000 1100 1010
+ { 27, 12, 0xCB }, // 0000 1100 1011
+ { 28, 12, 0xCC }, // 0000 1100 1100
+ { 29, 12, 0xCD }, // 0000 1100 1101
+ { 30, 12, 0x68 }, // 0000 0110 1000
+ { 31, 12, 0x69 }, // 0000 0110 1001
+ { 32, 12, 0x6A }, // 0000 0110 1010
+ { 33, 12, 0x6B }, // 0000 0110 1011
+ { 34, 12, 0xD2 }, // 0000 1101 0010
+ { 35, 12, 0xD3 }, // 0000 1101 0011
+ { 36, 12, 0xD4 }, // 0000 1101 0100
+ { 37, 12, 0xD5 }, // 0000 1101 0101
+ { 38, 12, 0xD6 }, // 0000 1101 0110
+ { 39, 12, 0xD7 }, // 0000 1101 0111
+ { 40, 12, 0x6C }, // 0000 0110 1100
+ { 41, 12, 0x6D }, // 0000 0110 1101
+ { 42, 12, 0xDA }, // 0000 1101 1010
+ { 43, 12, 0xDB }, // 0000 1101 1011
+ { 44, 12, 0x54 }, // 0000 0101 0100
+ { 45, 12, 0x55 }, // 0000 0101 0101
+ { 46, 12, 0x56 }, // 0000 0101 0110
+ { 47, 12, 0x57 }, // 0000 0101 0111
+ { 48, 12, 0x64 }, // 0000 0110 0100
+ { 49, 12, 0x65 }, // 0000 0110 0101
+ { 50, 12, 0x52 }, // 0000 0101 0010
+ { 51, 12, 0x53 }, // 0000 0101 0011
+ { 52, 12, 0x24 }, // 0000 0010 0100
+ { 53, 12, 0x37 }, // 0000 0011 0111
+ { 54, 12, 0x38 }, // 0000 0011 1000
+ { 55, 12, 0x27 }, // 0000 0010 0111
+ { 56, 12, 0x28 }, // 0000 0010 1000
+ { 57, 12, 0x58 }, // 0000 0101 1000
+ { 58, 12, 0x59 }, // 0000 0101 1001
+ { 59, 12, 0x2B }, // 0000 0010 1011
+ { 60, 12, 0x2C }, // 0000 0010 1100
+ { 61, 12, 0x5A }, // 0000 0101 1010
+ { 62, 12, 0x66 }, // 0000 0110 0110
+ { 63, 12, 0x67 }, // 0000 0110 0111
+ { 64, 10, 0xF }, // 0000 0011 11
+ { 128, 12, 0xC8 }, // 0000 1100 1000
+ { 192, 12, 0xC9 }, // 0000 1100 1001
+ { 256, 12, 0x5B }, // 0000 0101 1011
+ { 320, 12, 0x33 }, // 0000 0011 0011
+ { 384, 12, 0x34 }, // 0000 0011 0100
+ { 448, 12, 0x35 }, // 0000 0011 0101
+ { 512, 13, 0x6C }, // 0000 0011 0110 0
+ { 576, 13, 0x6D }, // 0000 0011 0110 1
+ { 640, 13, 0x4A }, // 0000 0010 0101 0
+ { 704, 13, 0x4B }, // 0000 0010 0101 1
+ { 768, 13, 0x4C }, // 0000 0010 0110 0
+ { 832, 13, 0x4D }, // 0000 0010 0110 1
+ { 896, 13, 0x72 }, // 0000 0011 1001 0
+ { 960, 13, 0x73 }, // 0000 0011 1001 1
+ { 1024, 13, 0x74 }, // 0000 0011 1010 0
+ { 1088, 13, 0x75 }, // 0000 0011 1010 1
+ { 1152, 13, 0x76 }, // 0000 0011 1011 0
+ { 1216, 13, 0x77 }, // 0000 0011 1011 1
+ { 1280, 13, 0x52 }, // 0000 0010 1001 0
+ { 1344, 13, 0x53 }, // 0000 0010 1001 1
+ { 1408, 13, 0x54 }, // 0000 0010 1010 0
+ { 1472, 13, 0x55 }, // 0000 0010 1010 1
+ { 1536, 13, 0x5A }, // 0000 0010 1101 0
+ { 1600, 13, 0x5B }, // 0000 0010 1101 1
+ { 1664, 13, 0x64 }, // 0000 0011 0010 0
+ { 1728, 13, 0x65 }, // 0000 0011 0010 1
+ { 1792, 11, 0x8 }, // 0000 0001 000
+ { 1856, 11, 0xC }, // 0000 0001 100
+ { 1920, 11, 0xD }, // 0000 0001 101
+ { 1984, 12, 0x12 }, // 0000 0001 0010
+ { 2048, 12, 0x13 }, // 0000 0001 0011
+ { 2112, 12, 0x14 }, // 0000 0001 0100
+ { 2176, 12, 0x15 }, // 0000 0001 0101
+ { 2240, 12, 0x16 }, // 0000 0001 0110
+ { 2304, 12, 0x17 }, // 0000 0001 0111
+ { 2368, 12, 0x1C }, // 0000 0001 1100
+ { 2432, 12, 0x1D }, // 0000 0001 1101
+ { 2496, 12, 0x1E }, // 0000 0001 1110
+ { 2560, 12, 0x1F } // 0000 0001 1111
+};
+
+
+void PDFWriterImpl::putG4Span( long i_nSpan, bool i_bWhitePixel, BitStreamState& io_rState )
+{
+ const PixelCode* pTable = i_bWhitePixel ? WhitePixelCodes : BlackPixelCodes;
+ // maximum encoded span is 2560 consecutive pixels
+ while( i_nSpan > 2623 )
+ {
+ // write 2560 bits, that is entry (63 + (2560 >> 6)) == 103 in the appropriate table
+ putG4Bits( pTable[103].mnCodeBits, pTable[103].mnCode, io_rState );
+ i_nSpan -= pTable[103].mnEncodedPixels;
+ }
+ // write multiples of 64 pixels up to 2560
+ if( i_nSpan > 63 )
+ {
+ sal_uInt32 nTabIndex = 63 + (i_nSpan >> 6);
+ OSL_ASSERT( pTable[nTabIndex].mnEncodedPixels == static_cast<sal_uInt32>(64*(i_nSpan >> 6)) );
+ putG4Bits( pTable[nTabIndex].mnCodeBits, pTable[nTabIndex].mnCode, io_rState );
+ i_nSpan -= pTable[nTabIndex].mnEncodedPixels;
+ }
+ putG4Bits( pTable[i_nSpan].mnCodeBits, pTable[i_nSpan].mnCode, io_rState );
+}
+
+void PDFWriterImpl::writeG4Stream( BitmapReadAccess* i_pBitmap )
+{
+ long nW = i_pBitmap->Width();
+ long nH = i_pBitmap->Height();
+ if( nW <= 0 || nH <= 0 )
+ return;
+ if( i_pBitmap->GetBitCount() != 1 )
+ return;
+
+ BitStreamState aBitState;
+
+ // the first reference line is virtual and completely empty
+ const Scanline pFirstRefLine = (Scanline)rtl_allocateZeroMemory( nW/8 + 1 );
+ Scanline pRefLine = pFirstRefLine;
+ for( long nY = 0; nY < nH; nY++ )
+ {
+ const Scanline pCurLine = i_pBitmap->GetScanline( nY );
+ long nLineIndex = 0;
+ bool bRunSet = (*pCurLine & 0x80) ? true : false;
+ bool bRefSet = (*pRefLine & 0x80) ? true : false;
+ long nRunIndex1 = bRunSet ? 0 : findBitRun( pCurLine, 0, nW, bRunSet );
+ long nRefIndex1 = bRefSet ? 0 : findBitRun( pRefLine, 0, nW, bRefSet );
+ for( ; nLineIndex < nW; )
+ {
+ long nRefIndex2 = findBitRun( pRefLine, nRefIndex1, nW, isSet( pRefLine, nRefIndex1 ) );
+ if( nRefIndex2 >= nRunIndex1 )
+ {
+ long nDiff = nRefIndex1 - nRunIndex1;
+ if( -3 <= nDiff && nDiff <= 3 )
+ { // vertical coding
+ static const struct
+ {
+ sal_uInt32 mnCodeBits;
+ sal_uInt32 mnCode;
+ } VerticalCodes[7] = {
+ { 7, 0x03 }, // 0000 011
+ { 6, 0x03 }, // 0000 11
+ { 3, 0x03 }, // 011
+ { 1, 0x1 }, // 1
+ { 3, 0x2 }, // 010
+ { 6, 0x02 }, // 0000 10
+ { 7, 0x02 } // 0000 010
+ };
+ // convert to index
+ nDiff += 3;
+
+ // emit diff code
+ putG4Bits( VerticalCodes[nDiff].mnCodeBits, VerticalCodes[nDiff].mnCode, aBitState );
+ nLineIndex = nRunIndex1;
+ }
+ else
+ { // difference too large, horizontal coding
+ // emit horz code 001
+ putG4Bits( 3, 0x1, aBitState );
+ long nRunIndex2 = findBitRun( pCurLine, nRunIndex1, nW, isSet( pCurLine, nRunIndex1 ) );
+ bool bWhiteFirst = ( nLineIndex + nRunIndex1 == 0 || ! isSet( pCurLine, nLineIndex ) );
+ putG4Span( nRunIndex1 - nLineIndex, bWhiteFirst, aBitState );
+ putG4Span( nRunIndex2 - nRunIndex1, ! bWhiteFirst, aBitState );
+ nLineIndex = nRunIndex2;
+ }
+ }
+ else
+ { // emit pass code 0001
+ putG4Bits( 4, 0x1, aBitState );
+ nLineIndex = nRefIndex2;
+ }
+ if( nLineIndex < nW )
+ {
+ bool bSet = isSet( pCurLine, nLineIndex );
+ nRunIndex1 = findBitRun( pCurLine, nLineIndex, nW, bSet );
+ nRefIndex1 = findBitRun( pRefLine, nLineIndex, nW, ! bSet );
+ nRefIndex1 = findBitRun( pRefLine, nRefIndex1, nW, bSet );
+ }
+ }
+
+ // the current line is the reference for the next line
+ pRefLine = pCurLine;
+ }
+ // terminate strip with EOFB
+ putG4Bits( 12, 1, aBitState );
+ putG4Bits( 12, 1, aBitState );
+ if( aBitState.mnNextBitPos != 8 )
+ {
+ writeBuffer( aBitState.getByte(), 1 );
+ aBitState.flush();
+ }
+
+ rtl_freeMemory( pFirstRefLine );
+}
diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx
index 94605be2686d..66e3cd1bea1a 100644
--- a/vcl/source/gdi/pngread.cxx
+++ b/vcl/source/gdi/pngread.cxx
@@ -73,7 +73,7 @@ namespace vcl
// ------------------------------------------------------------------------------
-static const BYTE mpDefaultColorTable[ 256 ] =
+static const sal_uInt8 mpDefaultColorTable[ 256 ] =
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
@@ -112,11 +112,11 @@ private:
AlphaMask* mpAlphaMask;
BitmapWriteAccess* mpMaskAcc;
ZCodec* mpZCodec;
- BYTE* mpInflateInBuf; // as big as the size of a scanline + alphachannel + 1
- BYTE* mpScanPrior; // pointer to the latest scanline
- BYTE* mpTransTab; // for transparency in images with palette colortype
- BYTE* mpScanCurrent; // pointer into the current scanline
- BYTE* mpColorTable; //
+ sal_uInt8* mpInflateInBuf; // as big as the size of a scanline + alphachannel + 1
+ sal_uInt8* mpScanPrior; // pointer to the latest scanline
+ sal_uInt8* mpTransTab; // for transparency in images with palette colortype
+ sal_uInt8* mpScanCurrent; // pointer into the current scanline
+ sal_uInt8* mpColorTable; //
sal_Size mnStreamSize; // estimate of PNG file size
sal_uInt32 mnChunkType; // Type of current PNG chunk
sal_Int32 mnChunkLen; // Length of current PNG chunk
@@ -132,48 +132,48 @@ private:
sal_uInt32 mnYAdd; // the increment for input images Y coords for the current pass
int mnPreviewShift; // shift to convert orig image coords into preview image coords
int mnPreviewMask; // == ((1 << mnPreviewShift) - 1)
- USHORT mnIStmOldMode;
- USHORT mnTargetDepth; // pixel depth of target bitmap
- BYTE mnTransRed;
- BYTE mnTransGreen;
- BYTE mnTransBlue;
- BYTE mnPngDepth; // pixel depth of PNG data
- BYTE mnColorType;
- BYTE mnCompressionType;
- BYTE mnFilterType;
- BYTE mnInterlaceType;
+ sal_uInt16 mnIStmOldMode;
+ sal_uInt16 mnTargetDepth; // pixel depth of target bitmap
+ sal_uInt8 mnTransRed;
+ sal_uInt8 mnTransGreen;
+ sal_uInt8 mnTransBlue;
+ sal_uInt8 mnPngDepth; // pixel depth of PNG data
+ sal_uInt8 mnColorType;
+ sal_uInt8 mnCompressionType;
+ sal_uInt8 mnFilterType;
+ sal_uInt8 mnInterlaceType;
BitmapColor mcTranspColor; // transparency mask's transparency "color"
BitmapColor mcOpaqueColor; // transparency mask's opaque "color"
- BOOL mbTransparent; // graphic includes an tRNS Chunk or an alpha Channel
- BOOL mbAlphaChannel; // is true for ColorType 4 and 6
- BOOL mbRGBTriple;
- BOOL mbPalette; // FALSE if we need a Palette
- BOOL mbGrayScale;
- BOOL mbzCodecInUse;
- BOOL mbStatus;
- BOOL mbIDAT; // TRUE if finished with enough IDAT chunks
- BOOL mbGamma; // TRUE if Gamma Correction available
- BOOL mbpHYs; // TRUE if pysical size of pixel available
+ sal_Bool mbTransparent; // graphic includes an tRNS Chunk or an alpha Channel
+ sal_Bool mbAlphaChannel; // is true for ColorType 4 and 6
+ sal_Bool mbRGBTriple;
+ sal_Bool mbPalette; // sal_False if we need a Palette
+ sal_Bool mbGrayScale;
+ sal_Bool mbzCodecInUse;
+ sal_Bool mbStatus;
+ sal_Bool mbIDAT; // sal_True if finished with enough IDAT chunks
+ sal_Bool mbGamma; // sal_True if Gamma Correction available
+ sal_Bool mbpHYs; // sal_True if pysical size of pixel available
sal_Bool mbIgnoreGammaChunk;
bool ReadNextChunk();
void ReadRemainingChunks();
void ImplSetPixel( sal_uInt32 y, sal_uInt32 x, const BitmapColor & );
- void ImplSetPixel( sal_uInt32 y, sal_uInt32 x, BYTE nPalIndex );
- void ImplSetTranspPixel( sal_uInt32 y, sal_uInt32 x, const BitmapColor &, BOOL bTrans );
- void ImplSetAlphaPixel( sal_uInt32 y, sal_uInt32 x, BYTE nPalIndex, BYTE nAlpha );
- void ImplSetAlphaPixel( sal_uInt32 y, sal_uInt32 x, const BitmapColor&, BYTE nAlpha );
+ void ImplSetPixel( sal_uInt32 y, sal_uInt32 x, sal_uInt8 nPalIndex );
+ void ImplSetTranspPixel( sal_uInt32 y, sal_uInt32 x, const BitmapColor &, sal_Bool bTrans );
+ void ImplSetAlphaPixel( sal_uInt32 y, sal_uInt32 x, sal_uInt8 nPalIndex, sal_uInt8 nAlpha );
+ void ImplSetAlphaPixel( sal_uInt32 y, sal_uInt32 x, const BitmapColor&, sal_uInt8 nAlpha );
void ImplReadIDAT();
bool ImplPreparePass();
void ImplApplyFilter();
void ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd );
- BOOL ImplReadTransparent();
+ sal_Bool ImplReadTransparent();
void ImplGetGamma();
void ImplGetBackground();
- BYTE ImplScaleColor();
- BOOL ImplReadHeader( const Size& rPreviewSizeHint );
- BOOL ImplReadPalette();
+ sal_uInt8 ImplScaleColor();
+ sal_Bool ImplReadHeader( const Size& rPreviewSizeHint );
+ sal_Bool ImplReadPalette();
void ImplGetGrayPalette( sal_uInt16 );
sal_uInt32 ImplReadsal_uInt32();
@@ -204,8 +204,8 @@ PNGReaderImpl::PNGReaderImpl( SvStream& rPNGStream )
mpColorTable ( (sal_uInt8*) mpDefaultColorTable ),
mnPass ( 0 ),
mbzCodecInUse ( sal_False ),
- mbStatus( TRUE),
- mbIDAT( FALSE ),
+ mbStatus( sal_True),
+ mbIDAT( sal_False ),
mbGamma ( sal_False ),
mbpHYs ( sal_False ),
mbIgnoreGammaChunk ( sal_False )
@@ -361,7 +361,7 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
case PNGCHUNK_gAMA : // the gamma chunk must precede
{ // the 'IDAT' and also the 'PLTE'(if available )
- if ( !mbIgnoreGammaChunk && ( mbIDAT == FALSE ) )
+ if ( !mbIgnoreGammaChunk && ( mbIDAT == sal_False ) )
ImplGetGamma();
}
break;
@@ -382,7 +382,7 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
case PNGCHUNK_bKGD : // the background chunk must appear
{
- if ( ( mbIDAT == FALSE ) && mbPalette ) // before the 'IDAT' and after the
+ if ( ( mbIDAT == sal_False ) && mbPalette ) // before the 'IDAT' and after the
ImplGetBackground(); // PLTE(if available ) chunk.
}
break;
@@ -390,7 +390,7 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
case PNGCHUNK_IDAT :
{
if ( !mpInflateInBuf ) // taking care that the header has properly been read
- mbStatus = FALSE;
+ mbStatus = sal_False;
else if ( !mbIDAT ) // the gfx is finished, but there may be left a zlibCRC of about 4Bytes
ImplReadIDAT();
}
@@ -463,27 +463,27 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
// ------------------------------------------------------------------------
-BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
+sal_Bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
{
if( mnChunkLen < 13 )
- return FALSE;
+ return sal_False;
maOrigSize.Width() = ImplReadsal_uInt32();
maOrigSize.Height() = ImplReadsal_uInt32();
if ( !maOrigSize.Width() || !maOrigSize.Height() )
- return FALSE;
+ return sal_False;
mnPngDepth = *(maDataIter++);
mnColorType = *(maDataIter++);
mnCompressionType = *(maDataIter++);
if( mnCompressionType != 0 ) // unknown compression type
- return FALSE;
+ return sal_False;
mnFilterType = *(maDataIter++);
if( mnFilterType != 0 ) // unknown filter type
- return FALSE;
+ return sal_False;
mnInterlaceType = *(maDataIter++);
switch ( mnInterlaceType ) // filter type valid ?
@@ -495,12 +495,12 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
mnPass = 0;
break;
default:
- return FALSE;
+ return sal_False;
}
- mbPalette = TRUE;
- mbIDAT = mbAlphaChannel = mbTransparent = FALSE;
- mbGrayScale = mbRGBTriple = FALSE;
+ mbPalette = sal_True;
+ mbIDAT = mbAlphaChannel = mbTransparent = sal_False;
+ mbGrayScale = mbRGBTriple = sal_False;
mnTargetDepth = mnPngDepth;
sal_uInt64 nScansize64 = ( ( static_cast< sal_uInt64 >( maOrigSize.Width() ) * mnPngDepth ) + 7 ) >> 3;
@@ -513,7 +513,7 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
{
case 2 : // 2bit target not available -> use four bits
mnTargetDepth = 4; // we have to expand the bitmap
- mbGrayScale = TRUE;
+ mbGrayScale = sal_True;
break;
case 16 :
mnTargetDepth = 8; // we have to reduce the bitmap
@@ -521,17 +521,17 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
case 1 :
case 4 :
case 8 :
- mbGrayScale = TRUE;
+ mbGrayScale = sal_True;
break;
default :
- return FALSE;
+ return sal_False;
}
}
break;
case 2 : // each pixel is an RGB triple
{
- mbRGBTriple = TRUE;
+ mbRGBTriple = sal_True;
nScansize64 *= 3;
switch ( mnPngDepth )
{
@@ -540,7 +540,7 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
mnTargetDepth = 24;
break;
default :
- return FALSE;
+ return sal_False;
}
}
break;
@@ -555,10 +555,10 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
case 1 :
case 4 :
case 8 :
- mbPalette = FALSE;
+ mbPalette = sal_False;
break;
default :
- return FALSE;
+ return sal_False;
}
}
break;
@@ -566,25 +566,25 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
case 4 : // each pixel is a grayscale sample followed by an alpha sample
{
nScansize64 *= 2;
- mbAlphaChannel = TRUE;
+ mbAlphaChannel = sal_True;
switch ( mnPngDepth )
{
case 16 :
mnTargetDepth = 8; // we have to reduce the bitmap
case 8 :
- mbGrayScale = TRUE;
+ mbGrayScale = sal_True;
break;
default :
- return FALSE;
+ return sal_False;
}
}
break;
case 6 : // each pixel is an RGB triple followed by an alpha sample
{
- mbRGBTriple = TRUE;
+ mbRGBTriple = sal_True;
nScansize64 *= 4;
- mbAlphaChannel = TRUE;
+ mbAlphaChannel = sal_True;
switch (mnPngDepth )
{
case 16 : // we have to reduce the bitmap
@@ -592,13 +592,13 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
mnTargetDepth = 24;
break;
default :
- return FALSE;
+ return sal_False;
}
}
break;
default :
- return FALSE;
+ return sal_False;
}
mnBPP = static_cast< sal_uInt32 >( nScansize64 / maOrigSize.Width() );
@@ -608,17 +608,17 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
nScansize64++; // each scanline includes one filterbyte
if ( nScansize64 > SAL_MAX_UINT32 )
- return FALSE;
+ return sal_False;
mnScansize = static_cast< sal_uInt32 >( nScansize64 );
// TODO: switch between both scanlines instead of copying
- mpInflateInBuf = new (std::nothrow) BYTE[ mnScansize ];
+ mpInflateInBuf = new (std::nothrow) sal_uInt8[ mnScansize ];
mpScanCurrent = mpInflateInBuf;
- mpScanPrior = new (std::nothrow) BYTE[ mnScansize ];
+ mpScanPrior = new (std::nothrow) sal_uInt8[ mnScansize ];
if ( !mpInflateInBuf || !mpScanPrior )
- return FALSE;
+ return sal_False;
// calculate target size from original size and the preview hint
if( rPreviewSizeHint.Width() || rPreviewSizeHint.Height() )
@@ -657,7 +657,7 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
mpBmp = new Bitmap( maTargetSize, mnTargetDepth );
mpAcc = mpBmp->AcquireWriteAccess();
if( !mpAcc )
- return FALSE;
+ return sal_False;
mpBmp->SetSourceSizePixel( maOrigSize );
@@ -667,7 +667,7 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
mpAlphaMask->Erase( 128 );
mpMaskAcc = mpAlphaMask->AcquireWriteAccess();
if( !mpMaskAcc )
- return FALSE;
+ return sal_False;
}
if ( mbGrayScale )
@@ -675,7 +675,7 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
ImplPreparePass();
- return TRUE;
+ return sal_True;
}
// ------------------------------------------------------------------------
@@ -695,38 +695,38 @@ void PNGReaderImpl::ImplGetGrayPalette( sal_uInt16 nBitDepth )
mpAcc->SetPaletteEntryCount( nPaletteEntryCount );
for ( sal_uInt32 i = 0, nStart = 0; nStart < 256; i++, nStart += nAdd )
- mpAcc->SetPaletteColor( (USHORT)i, BitmapColor( mpColorTable[ nStart ],
+ mpAcc->SetPaletteColor( (sal_uInt16)i, BitmapColor( mpColorTable[ nStart ],
mpColorTable[ nStart ], mpColorTable[ nStart ] ) );
}
// ------------------------------------------------------------------------
-BOOL PNGReaderImpl::ImplReadPalette()
+sal_Bool PNGReaderImpl::ImplReadPalette()
{
sal_uInt16 nCount = static_cast<sal_uInt16>( mnChunkLen / 3 );
if ( ( ( mnChunkLen % 3 ) == 0 ) && ( ( 0 < nCount ) && ( nCount <= 256 ) ) && mpAcc )
{
- mbPalette = TRUE;
- mpAcc->SetPaletteEntryCount( (USHORT) nCount );
+ mbPalette = sal_True;
+ mpAcc->SetPaletteEntryCount( (sal_uInt16) nCount );
for ( sal_uInt16 i = 0; i < nCount; i++ )
{
- BYTE nRed = mpColorTable[ *maDataIter++ ];
- BYTE nGreen = mpColorTable[ *maDataIter++ ];
- BYTE nBlue = mpColorTable[ *maDataIter++ ];
+ sal_uInt8 nRed = mpColorTable[ *maDataIter++ ];
+ sal_uInt8 nGreen = mpColorTable[ *maDataIter++ ];
+ sal_uInt8 nBlue = mpColorTable[ *maDataIter++ ];
mpAcc->SetPaletteColor( i, Color( nRed, nGreen, nBlue ) );
}
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
return mbStatus;
}
// ------------------------------------------------------------------------
-BOOL PNGReaderImpl::ImplReadTransparent()
+sal_Bool PNGReaderImpl::ImplReadTransparent()
{
bool bNeedAlpha = false;
@@ -765,7 +765,7 @@ BOOL PNGReaderImpl::ImplReadTransparent()
{
if ( mnChunkLen <= 256 )
{
- mpTransTab = new BYTE [ 256 ];
+ mpTransTab = new sal_uInt8 [ 256 ];
rtl_fillMemory( mpTransTab, 256, 0xff );
rtl_copyMemory( mpTransTab, &(*maDataIter), mnChunkLen );
maDataIter += mnChunkLen;
@@ -793,13 +793,13 @@ BOOL PNGReaderImpl::ImplReadTransparent()
}
mbTransparent = (mpMaskAcc != NULL);
if( !mbTransparent )
- return FALSE;
+ return sal_False;
mcOpaqueColor = BitmapColor( 0x00 );
mcTranspColor = BitmapColor( 0xFF );
mpMaskAcc->Erase( 0x00 );
}
- return TRUE;
+ return sal_True;
}
// ------------------------------------------------------------------------
@@ -815,7 +815,7 @@ void PNGReaderImpl::ImplGetGamma()
if ( fInvGamma != 1.0 )
{
- mbGamma = TRUE;
+ mbGamma = sal_True;
if ( mpColorTable == mpDefaultColorTable )
mpColorTable = new sal_uInt8[ 256 ];
@@ -838,10 +838,10 @@ void PNGReaderImpl::ImplGetBackground()
{
if ( mnChunkLen == 1 )
{
- UINT16 nCol = *maDataIter++;
+ sal_uInt16 nCol = *maDataIter++;
if ( nCol < mpAcc->GetPaletteEntryCount() )
{
- mpAcc->Erase( mpAcc->GetPaletteColor( (BYTE)nCol ) );
+ mpAcc->Erase( mpAcc->GetPaletteColor( (sal_uInt8)nCol ) );
break;
}
}
@@ -900,9 +900,9 @@ void PNGReaderImpl::ImplReadIDAT()
{
if( mnChunkLen > 0 )
{
- if ( mbzCodecInUse == FALSE )
+ if ( mbzCodecInUse == sal_False )
{
- mbzCodecInUse = TRUE;
+ mbzCodecInUse = sal_True;
mpZCodec->BeginCompression( ZCODEC_PNG_DEFAULT );
}
mpZCodec->SetBreak( mnChunkLen );
@@ -915,7 +915,7 @@ void PNGReaderImpl::ImplReadIDAT()
sal_Int32 nRead = mpZCodec->ReadAsynchron( aIStrm, mpScanCurrent, nToRead );
if ( nRead < 0 )
{
- mbStatus = FALSE;
+ mbStatus = sal_False;
break;
}
if ( nRead < nToRead )
@@ -946,7 +946,7 @@ void PNGReaderImpl::ImplReadIDAT()
if( mbIDAT )
{
mpZCodec->EndCompression();
- mbzCodecInUse = FALSE;
+ mbzCodecInUse = sal_False;
}
}
@@ -1021,9 +1021,9 @@ bool PNGReaderImpl::ImplPreparePass()
void PNGReaderImpl::ImplApplyFilter()
{
OSL_ASSERT( mnScansize >= mnBPP + 1 );
- const BYTE* const pScanEnd = mpInflateInBuf + mnScansize;
+ const sal_uInt8* const pScanEnd = mpInflateInBuf + mnScansize;
- BYTE nFilterType = *mpInflateInBuf; // the filter type may change each scanline
+ sal_uInt8 nFilterType = *mpInflateInBuf; // the filter type may change each scanline
switch ( nFilterType )
{
default: // unknown Scanline Filter Type
@@ -1033,26 +1033,26 @@ void PNGReaderImpl::ImplApplyFilter()
case 1: // Scanline Filter Type "Sub"
{
- BYTE* p1 = mpInflateInBuf + 1;
- const BYTE* p2 = p1;
+ sal_uInt8* p1 = mpInflateInBuf + 1;
+ const sal_uInt8* p2 = p1;
p1 += mnBPP;
// use left pixels
do
- *p1 = static_cast<BYTE>( *p1 + *(p2++) );
+ *p1 = static_cast<sal_uInt8>( *p1 + *(p2++) );
while( ++p1 < pScanEnd );
}
break;
case 2: // Scanline Filter Type "Up"
{
- BYTE* p1 = mpInflateInBuf + 1;
- const BYTE* p2 = mpScanPrior + 1;
+ sal_uInt8* p1 = mpInflateInBuf + 1;
+ const sal_uInt8* p2 = mpScanPrior + 1;
// use pixels from prior line
while( p1 < pScanEnd )
{
- *p1 = static_cast<BYTE>( *p1 + *(p2++) );
+ *p1 = static_cast<sal_uInt8>( *p1 + *(p2++) );
++p1;
}
}
@@ -1060,18 +1060,18 @@ void PNGReaderImpl::ImplApplyFilter()
case 3: // Scanline Filter Type "Average"
{
- BYTE* p1 = mpInflateInBuf + 1;
- const BYTE* p2 = mpScanPrior + 1;
- const BYTE* p3 = p1;
+ sal_uInt8* p1 = mpInflateInBuf + 1;
+ const sal_uInt8* p2 = mpScanPrior + 1;
+ const sal_uInt8* p3 = p1;
// use one pixel from prior line
for( int n = mnBPP; --n >= 0; ++p1, ++p2)
- *p1 = static_cast<BYTE>( *p1 + (*p2 >> 1) );
+ *p1 = static_cast<sal_uInt8>( *p1 + (*p2 >> 1) );
// predict by averaging the left and prior line pixels
while( p1 < pScanEnd )
{
- *p1 = static_cast<BYTE>( *p1 + ((*(p2++) + *(p3++)) >> 1) );
+ *p1 = static_cast<sal_uInt8>( *p1 + ((*(p2++) + *(p3++)) >> 1) );
++p1;
}
}
@@ -1079,14 +1079,14 @@ void PNGReaderImpl::ImplApplyFilter()
case 4: // Scanline Filter Type "PaethPredictor"
{
- BYTE* p1 = mpInflateInBuf + 1;
- const BYTE* p2 = mpScanPrior + 1;
- const BYTE* p3 = p1;
- const BYTE* p4 = p2;
+ sal_uInt8* p1 = mpInflateInBuf + 1;
+ const sal_uInt8* p2 = mpScanPrior + 1;
+ const sal_uInt8* p3 = p1;
+ const sal_uInt8* p4 = p2;
// use one pixel from prior line
for( int n = mnBPP; --n >= 0; ++p1)
- *p1 = static_cast<BYTE>( *p1 + *(p2++) );
+ *p1 = static_cast<sal_uInt8>( *p1 + *(p2++) );
// predict by using the left and the prior line pixels
while( p1 < pScanEnd )
@@ -1111,7 +1111,7 @@ void PNGReaderImpl::ImplApplyFilter()
if( npa > npc )
na = nc;
- *p1 = static_cast<BYTE>( *p1 + na );
+ *p1 = static_cast<sal_uInt8>( *p1 + na );
++p1;
}
}
@@ -1137,7 +1137,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd )
// => TODO; also do this for nX here instead of in the ImplSet*Pixel() methods
const sal_uInt32 nY = mnYpos >> mnPreviewShift;
- const BYTE* pTmp = mpInflateInBuf + 1;
+ const sal_uInt8* pTmp = mpInflateInBuf + 1;
if ( mpAcc->HasPalette() ) // alphachannel is not allowed by pictures including palette entries
{
switch ( mpAcc->GetBitCount() )
@@ -1148,12 +1148,12 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd )
{
for ( sal_Int32 nX = nXStart, nShift = 0; nX < maOrigSize.Width(); nX += nXAdd )
{
- BYTE nCol;
+ sal_uInt8 nCol;
nShift = (nShift - 1) & 7;
if ( nShift == 0 )
nCol = *(pTmp++);
else
- nCol = static_cast<BYTE>( *pTmp >> nShift );
+ nCol = static_cast<sal_uInt8>( *pTmp >> nShift );
nCol &= 1;
ImplSetAlphaPixel( nY, nX, nCol, mpTransTab[ nCol ] );
@@ -1165,11 +1165,11 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd )
{
nShift = (nShift - 1) & 7;
- BYTE nCol;
+ sal_uInt8 nCol;
if ( nShift == 0 )
nCol = *(pTmp++);
else
- nCol = static_cast<BYTE>( *pTmp >> nShift );
+ nCol = static_cast<sal_uInt8>( *pTmp >> nShift );
nCol &= 1;
ImplSetPixel( nY, nX, nCol );
@@ -1201,7 +1201,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd )
{
for ( sal_Int32 nX = nXStart, nXIndex = 0; nX < maOrigSize.Width(); nX += nXAdd, nXIndex++ )
{
- BYTE nCol;
+ sal_uInt8 nCol;
switch( nXIndex & 3 )
{
case 0 :
@@ -1323,7 +1323,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd )
break;
default :
- mbStatus = FALSE;
+ mbStatus = sal_False;
break;
}
}
@@ -1449,7 +1449,7 @@ void PNGReaderImpl::ImplSetPixel( sal_uInt32 nY, sal_uInt32 nX, const BitmapColo
// ------------------------------------------------------------------------
-void PNGReaderImpl::ImplSetPixel( sal_uInt32 nY, sal_uInt32 nX, BYTE nPalIndex )
+void PNGReaderImpl::ImplSetPixel( sal_uInt32 nY, sal_uInt32 nX, sal_uInt8 nPalIndex )
{
// TODO: get preview mode checks out of inner loop
if( nX & mnPreviewMask )
@@ -1461,7 +1461,7 @@ void PNGReaderImpl::ImplSetPixel( sal_uInt32 nY, sal_uInt32 nX, BYTE nPalIndex )
// ------------------------------------------------------------------------
-void PNGReaderImpl::ImplSetTranspPixel( sal_uInt32 nY, sal_uInt32 nX, const BitmapColor& rBitmapColor, BOOL bTrans )
+void PNGReaderImpl::ImplSetTranspPixel( sal_uInt32 nY, sal_uInt32 nX, const BitmapColor& rBitmapColor, sal_Bool bTrans )
{
// TODO: get preview mode checks out of inner loop
if( nX & mnPreviewMask )
@@ -1479,7 +1479,7 @@ void PNGReaderImpl::ImplSetTranspPixel( sal_uInt32 nY, sal_uInt32 nX, const Bitm
// ------------------------------------------------------------------------
void PNGReaderImpl::ImplSetAlphaPixel( sal_uInt32 nY, sal_uInt32 nX,
- BYTE nPalIndex, BYTE nAlpha )
+ sal_uInt8 nPalIndex, sal_uInt8 nAlpha )
{
// TODO: get preview mode checks out of inner loop
if( nX & mnPreviewMask )
@@ -1493,7 +1493,7 @@ void PNGReaderImpl::ImplSetAlphaPixel( sal_uInt32 nY, sal_uInt32 nX,
// ------------------------------------------------------------------------
void PNGReaderImpl::ImplSetAlphaPixel( sal_uInt32 nY, sal_uInt32 nX,
- const BitmapColor& rBitmapColor, BYTE nAlpha )
+ const BitmapColor& rBitmapColor, sal_uInt8 nAlpha )
{
// TODO: get preview mode checks out of inner loop
if( nX & mnPreviewMask )
diff --git a/vcl/source/gdi/pngwrite.cxx b/vcl/source/gdi/pngwrite.cxx
index 6cacfe51aed2..b87457c35054 100644
--- a/vcl/source/gdi/pngwrite.cxx
+++ b/vcl/source/gdi/pngwrite.cxx
@@ -89,35 +89,35 @@ private:
sal_Int32 mnCompLevel;
sal_Int32 mnInterlaced;
sal_uInt32 mnMaxChunkSize;
- BOOL mbStatus;
+ sal_Bool mbStatus;
BitmapReadAccess* mpAccess;
BitmapReadAccess* mpMaskAccess;
ZCodec* mpZCodec;
- BYTE* mpDeflateInBuf; // as big as the size of a scanline + alphachannel + 1
- BYTE* mpPreviousScan; // as big as mpDeflateInBuf
- BYTE* mpCurrentScan;
- ULONG mnDeflateInSize;
-
- ULONG mnWidth, mnHeight;
- BYTE mnBitsPerPixel;
- BYTE mnFilterType; // 0 oder 4;
- ULONG mnBBP; // bytes per pixel ( needed for filtering )
- BOOL mbTrueAlpha;
- ULONG mnCRC;
+ sal_uInt8* mpDeflateInBuf; // as big as the size of a scanline + alphachannel + 1
+ sal_uInt8* mpPreviousScan; // as big as mpDeflateInBuf
+ sal_uInt8* mpCurrentScan;
+ sal_uLong mnDeflateInSize;
+
+ sal_uLong mnWidth, mnHeight;
+ sal_uInt8 mnBitsPerPixel;
+ sal_uInt8 mnFilterType; // 0 oder 4;
+ sal_uLong mnBBP; // bytes per pixel ( needed for filtering )
+ sal_Bool mbTrueAlpha;
+ sal_uLong mnCRC;
long mnChunkDatSize;
- ULONG mnLastPercent;
+ sal_uLong mnLastPercent;
void ImplWritepHYs( const BitmapEx& rBitmapEx );
void ImplWriteIDAT();
- ULONG ImplGetFilter( ULONG nY, ULONG nXStart=0, ULONG nXAdd=1 );
+ sal_uLong ImplGetFilter( sal_uLong nY, sal_uLong nXStart=0, sal_uLong nXAdd=1 );
void ImplClearFirstScanline();
void ImplWriteTransparent();
- BOOL ImplWriteHeader();
+ sal_Bool ImplWriteHeader();
void ImplWritePalette();
- void ImplOpenChunk( ULONG nChunkType );
- void ImplWriteChunk( BYTE nNumb );
+ void ImplOpenChunk( sal_uLong nChunkType );
+ void ImplWriteChunk( sal_uInt8 nNumb );
void ImplWriteChunk( sal_uInt32 nNumb );
void ImplWriteChunk( unsigned char* pSource, sal_uInt32 nDatSize );
void ImplCloseChunk( void ) const;
@@ -128,7 +128,7 @@ private:
PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData ) :
mnCompLevel ( PNG_DEF_COMPRESSION ),
- mbStatus ( TRUE ),
+ mbStatus ( sal_True ),
mpAccess ( NULL ),
mpMaskAccess ( NULL ),
mpZCodec ( new ZCodec( DEFAULT_IN_BUFSIZE, DEFAULT_OUT_BUFSIZE, MAX_MEM_USAGE ) ),
@@ -161,7 +161,7 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
}
}
}
- mnBitsPerPixel = (BYTE)aBmp.GetBitCount();
+ mnBitsPerPixel = (sal_uInt8)aBmp.GetBitCount();
if( rBmpEx.IsTransparent() )
{
@@ -189,14 +189,14 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
aBmp.ReleaseAccess( mpAccess );
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
}
else
{
- mpAccess = aBmp.AcquireReadAccess(); // TRUE RGB with alphachannel
+ mpAccess = aBmp.AcquireReadAccess(); // sal_True RGB with alphachannel
if( mpAccess )
{
- if ( ( mbTrueAlpha = rBmpEx.IsAlpha() ) != FALSE )
+ if ( ( mbTrueAlpha = rBmpEx.IsAlpha() ) != sal_False )
{
AlphaMask aMask( rBmpEx.GetAlpha() );
mpMaskAccess = aMask.AcquireReadAccess();
@@ -210,7 +210,7 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
aMask.ReleaseAccess( mpMaskAccess );
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
}
else
{
@@ -226,12 +226,12 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
aMask.ReleaseAccess( mpMaskAccess );
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
}
aBmp.ReleaseAccess( mpAccess );
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
}
}
else
@@ -250,7 +250,7 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
aBmp.ReleaseAccess( mpAccess );
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
}
if ( mbStatus )
{
@@ -309,7 +309,7 @@ std::vector< vcl::PNGWriter::ChunkData >& PNGWriterImpl::GetChunks()
// ------------------------------------------------------------------------
-BOOL PNGWriterImpl::ImplWriteHeader()
+sal_Bool PNGWriterImpl::ImplWriteHeader()
{
ImplOpenChunk(PNGCHUNK_IHDR);
ImplWriteChunk( sal_uInt32( mnWidth = mpAccess->Width() ) );
@@ -317,13 +317,13 @@ BOOL PNGWriterImpl::ImplWriteHeader()
if ( mnWidth && mnHeight && mnBitsPerPixel && mbStatus )
{
- BYTE nBitDepth = mnBitsPerPixel;
+ sal_uInt8 nBitDepth = mnBitsPerPixel;
if ( mnBitsPerPixel <= 8 )
mnFilterType = 0;
else
mnFilterType = 4;
- BYTE nColorType = 2; // colortype:
+ sal_uInt8 nColorType = 2; // colortype:
// bit 0 -> palette is used
if ( mpAccess->HasPalette() ) // bit 1 -> color is used
nColorType |= 1; // bit 2 -> alpha channel is used
@@ -335,13 +335,13 @@ BOOL PNGWriterImpl::ImplWriteHeader()
ImplWriteChunk( nBitDepth );
ImplWriteChunk( nColorType ); // colortype
- ImplWriteChunk((BYTE) 0 ); // compression type
- ImplWriteChunk((BYTE) 0 ); // filter type - is not supported in this version
- ImplWriteChunk((BYTE) mnInterlaced ); // interlace type
+ ImplWriteChunk((sal_uInt8) 0 ); // compression type
+ ImplWriteChunk((sal_uInt8) 0 ); // filter type - is not supported in this version
+ ImplWriteChunk((sal_uInt8) mnInterlaced ); // interlace type
ImplCloseChunk();
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
return mbStatus;
}
@@ -349,13 +349,13 @@ BOOL PNGWriterImpl::ImplWriteHeader()
void PNGWriterImpl::ImplWritePalette()
{
- const ULONG nCount = mpAccess->GetPaletteEntryCount();
- BYTE* pTempBuf = new BYTE[ nCount*3 ];
- BYTE* pTmp = pTempBuf;
+ const sal_uLong nCount = mpAccess->GetPaletteEntryCount();
+ sal_uInt8* pTempBuf = new sal_uInt8[ nCount*3 ];
+ sal_uInt8* pTmp = pTempBuf;
ImplOpenChunk( PNGCHUNK_PLTE );
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
const BitmapColor& rColor = mpAccess->GetPaletteColor( i );
*pTmp++ = rColor.GetRed();
@@ -371,12 +371,12 @@ void PNGWriterImpl::ImplWritePalette()
void PNGWriterImpl::ImplWriteTransparent ()
{
- const ULONG nTransIndex = mpAccess->GetBestMatchingColor( BMP_COL_TRANS );
+ const sal_uLong nTransIndex = mpAccess->GetBestMatchingColor( BMP_COL_TRANS );
ImplOpenChunk( PNGCHUNK_tRNS );
- for ( ULONG n = 0UL; n <= nTransIndex; n++ )
- ImplWriteChunk( ( nTransIndex == n ) ? (BYTE) 0x0 : (BYTE) 0xff );
+ for ( sal_uLong n = 0UL; n <= nTransIndex; n++ )
+ ImplWriteChunk( ( nTransIndex == n ) ? (sal_uInt8) 0x0 : (sal_uInt8) 0xff );
ImplCloseChunk();
}
@@ -415,12 +415,12 @@ void PNGWriterImpl::ImplWriteIDAT ()
mnDeflateInSize = mnBBP * mnWidth + 1;
- mpDeflateInBuf = new BYTE[ mnDeflateInSize ];
+ mpDeflateInBuf = new sal_uInt8[ mnDeflateInSize ];
if ( mnFilterType ) // using filter type 4 we need memory for the scanline 3 times
{
- mpPreviousScan = new BYTE[ mnDeflateInSize ];
- mpCurrentScan = new BYTE[ mnDeflateInSize ];
+ mpPreviousScan = new sal_uInt8[ mnDeflateInSize ];
+ mpCurrentScan = new sal_uInt8[ mnDeflateInSize ];
ImplClearFirstScanline();
}
mpZCodec->BeginCompression( ZCODEC_PNG_DEFAULT + mnCompLevel );
@@ -428,13 +428,13 @@ void PNGWriterImpl::ImplWriteIDAT ()
SvMemoryStream aOStm;
if ( mnInterlaced == 0 )
{
- for ( ULONG nY = 0; nY < mnHeight; nY++ )
+ for ( sal_uLong nY = 0; nY < mnHeight; nY++ )
mpZCodec->Write( aOStm, mpDeflateInBuf, ImplGetFilter( nY ) );
}
else
{
// interlace mode
- ULONG nY;
+ sal_uLong nY;
for ( nY = 0; nY < mnHeight; nY+=8 ) // pass 1
mpZCodec->Write( aOStm, mpDeflateInBuf, ImplGetFilter ( nY, 0, 8 ) );
ImplClearFirstScanline();
@@ -498,9 +498,9 @@ void PNGWriterImpl::ImplWriteIDAT ()
// appends to the currently used pass
// the complete size of scanline will be returned - in interlace mode zero is possible!
-ULONG PNGWriterImpl::ImplGetFilter ( ULONG nY, ULONG nXStart, ULONG nXAdd )
+sal_uLong PNGWriterImpl::ImplGetFilter ( sal_uLong nY, sal_uLong nXStart, sal_uLong nXAdd )
{
- BYTE* pDest;
+ sal_uInt8* pDest;
if ( mnFilterType )
pDest = mpCurrentScan;
@@ -517,16 +517,16 @@ ULONG PNGWriterImpl::ImplGetFilter ( ULONG nY, ULONG nXStart, ULONG nXAdd )
{
case( 1 ):
{
- ULONG nX, nXIndex;
+ sal_uLong nX, nXIndex;
for ( nX = nXStart, nXIndex = 0; nX < mnWidth; nX+=nXAdd, nXIndex++ )
{
- ULONG nShift = ( nXIndex & 7 ) ^ 7;
+ sal_uLong nShift = ( nXIndex & 7 ) ^ 7;
if ( nShift == 7)
- *pDest = (BYTE)(mpAccess->GetPixel( nY, nX ) << nShift);
+ *pDest = (sal_uInt8)(mpAccess->GetPixel( nY, nX ) << nShift);
else if ( nShift == 0 )
- *pDest++ |= (BYTE) mpAccess->GetPixel( nY, nX ) << nShift;
+ *pDest++ |= (sal_uInt8) mpAccess->GetPixel( nY, nX ) << nShift;
else
- *pDest |= (BYTE) mpAccess->GetPixel( nY, nX ) << nShift;
+ *pDest |= (sal_uInt8) mpAccess->GetPixel( nY, nX ) << nShift;
}
if ( ( nXIndex & 7 ) != 0 ) pDest++; // byte is not completely used, so the
} // bufferpointer is to correct
@@ -534,13 +534,13 @@ ULONG PNGWriterImpl::ImplGetFilter ( ULONG nY, ULONG nXStart, ULONG nXAdd )
case( 4 ):
{
- ULONG nX, nXIndex;
+ sal_uLong nX, nXIndex;
for ( nX = nXStart, nXIndex = 0; nX < mnWidth; nX+= nXAdd, nXIndex++ )
{
if( nXIndex & 1 )
- *pDest++ |= (BYTE) mpAccess->GetPixel( nY, nX );
+ *pDest++ |= (sal_uInt8) mpAccess->GetPixel( nY, nX );
else
- *pDest = (BYTE) mpAccess->GetPixel( nY, nX ) << 4;
+ *pDest = (sal_uInt8) mpAccess->GetPixel( nY, nX ) << 4;
}
if ( nXIndex & 1 ) pDest++;
}
@@ -548,13 +548,13 @@ ULONG PNGWriterImpl::ImplGetFilter ( ULONG nY, ULONG nXStart, ULONG nXAdd )
case( 8 ):
{
- for ( ULONG nX = nXStart; nX < mnWidth; nX+=nXAdd )
+ for ( sal_uLong nX = nXStart; nX < mnWidth; nX+=nXAdd )
*pDest++ = mpAccess->GetPixel( nY, nX );
}
break;
default :
- mbStatus = FALSE;
+ mbStatus = sal_False;
break;
}
}
@@ -564,7 +564,7 @@ ULONG PNGWriterImpl::ImplGetFilter ( ULONG nY, ULONG nXStart, ULONG nXAdd )
{
if ( mbTrueAlpha )
{
- for ( ULONG nX = nXStart; nX < mnWidth; nX += nXAdd )
+ for ( sal_uLong nX = nXStart; nX < mnWidth; nX += nXAdd )
{
const BitmapColor& rColor = mpAccess->GetPixel( nY, nX );
*pDest++ = rColor.GetRed();
@@ -577,7 +577,7 @@ ULONG PNGWriterImpl::ImplGetFilter ( ULONG nY, ULONG nXStart, ULONG nXAdd )
{
const BitmapColor aTrans( mpMaskAccess->GetBestMatchingColor( Color( COL_WHITE ) ) );
- for ( ULONG nX = nXStart; nX < mnWidth; nX+=nXAdd )
+ for ( sal_uLong nX = nXStart; nX < mnWidth; nX+=nXAdd )
{
const BitmapColor& rColor = mpAccess->GetPixel( nY, nX );
*pDest++ = rColor.GetRed();
@@ -593,7 +593,7 @@ ULONG PNGWriterImpl::ImplGetFilter ( ULONG nY, ULONG nXStart, ULONG nXAdd )
}
else
{
- for ( ULONG nX = nXStart; nX < mnWidth; nX+=nXAdd )
+ for ( sal_uLong nX = nXStart; nX < mnWidth; nX+=nXAdd )
{
const BitmapColor& rColor = mpAccess->GetPixel( nY, nX );
*pDest++ = rColor.GetRed();
@@ -610,13 +610,13 @@ ULONG PNGWriterImpl::ImplGetFilter ( ULONG nY, ULONG nXStart, ULONG nXAdd )
pDest = mpDeflateInBuf;
*pDest++ = 4; // filter type
- ULONG na, nb, nc;
+ sal_uLong na, nb, nc;
long np, npa, npb, npc;
- BYTE* p1 = mpCurrentScan + 1; // Current Pixel
- BYTE* p2 = p1 - mnBBP; // left pixel
- BYTE* p3 = mpPreviousScan; // upper pixel
- BYTE* p4 = p3 - mnBBP; // upperleft Pixel;
+ sal_uInt8* p1 = mpCurrentScan + 1; // Current Pixel
+ sal_uInt8* p2 = p1 - mnBBP; // left pixel
+ sal_uInt8* p3 = mpPreviousScan; // upper pixel
+ sal_uInt8* p4 = p3 - mnBBP; // upperleft Pixel;
while ( pDest < mpDeflateInBuf + mnDeflateInSize )
{
@@ -640,9 +640,9 @@ ULONG PNGWriterImpl::ImplGetFilter ( ULONG nY, ULONG nXStart, ULONG nXAdd )
npb =-npb;
if ( npc < 0 )
npc =-npc;
- if ( ( npa <= npb ) && ( npa <= npc ) ) *pDest++ = *p1++ - (BYTE)na;
- else if ( npb <= npc ) *pDest++ = *p1++ - (BYTE)nb;
- else *pDest++ = *p1++ - (BYTE)nc;
+ if ( ( npa <= npb ) && ( npa <= npc ) ) *pDest++ = *p1++ - (sal_uInt8)na;
+ else if ( npb <= npc ) *pDest++ = *p1++ - (sal_uInt8)nb;
+ else *pDest++ = *p1++ - (sal_uInt8)nc;
p4++;
p2++;
}
@@ -664,7 +664,7 @@ void PNGWriterImpl::ImplClearFirstScanline()
// ------------------------------------------------------------------------
-void PNGWriterImpl::ImplOpenChunk ( ULONG nChunkType )
+void PNGWriterImpl::ImplOpenChunk ( sal_uLong nChunkType )
{
maChunkSeq.resize( maChunkSeq.size() + 1 );
maChunkSeq.back().nType = nChunkType;
@@ -672,7 +672,7 @@ void PNGWriterImpl::ImplOpenChunk ( ULONG nChunkType )
// ------------------------------------------------------------------------
-void PNGWriterImpl::ImplWriteChunk ( BYTE nSource )
+void PNGWriterImpl::ImplWriteChunk ( sal_uInt8 nSource )
{
maChunkSeq.back().aData.push_back( nSource );
}
diff --git a/vcl/source/gdi/polyscan.cxx b/vcl/source/gdi/polyscan.cxx
index b96591b6aa40..81d05bf33354 100644
--- a/vcl/source/gdi/polyscan.cxx
+++ b/vcl/source/gdi/polyscan.cxx
@@ -122,9 +122,9 @@ void PolyScanline::Set( long nStart, long nEnd )
// ------------------------------------------------------------------------
-BOOL PolyScanline::GetFirstSegment( PolyScanSegment& rSegment )
+sal_Bool PolyScanline::GetFirstSegment( PolyScanSegment& rSegment )
{
- BOOL bRet = GetFirstX( rSegment.mnStart );
+ sal_Bool bRet = GetFirstX( rSegment.mnStart );
if( bRet && !GetNextX( rSegment.mnEnd ) )
rSegment.mnEnd = rSegment.mnStart;
@@ -134,9 +134,9 @@ BOOL PolyScanline::GetFirstSegment( PolyScanSegment& rSegment )
// ------------------------------------------------------------------------
-BOOL PolyScanline::GetNextSegment( PolyScanSegment& rSegment )
+sal_Bool PolyScanline::GetNextSegment( PolyScanSegment& rSegment )
{
- BOOL bRet = GetNextX( rSegment.mnStart );
+ sal_Bool bRet = GetNextX( rSegment.mnStart );
if( bRet && !GetNextX( rSegment.mnEnd ) )
rSegment.mnEnd = rSegment.mnStart;
@@ -153,7 +153,7 @@ PolyScanner::PolyScanner( const Rectangle& rRect )
if( !rRect.IsEmpty() )
{
Rectangle aRect( rRect );
- ULONG nHeight;
+ sal_uLong nHeight;
aRect.Justify();
mnLeft = aRect.Left();
@@ -162,7 +162,7 @@ PolyScanner::PolyScanner( const Rectangle& rRect )
mnBottom = aRect.Bottom();
mpArray = new PolyScanline[ nHeight = Height() ];
- for( ULONG i = 0UL; i < nHeight; i++ )
+ for( sal_uLong i = 0UL; i < nHeight; i++ )
mpArray[ i ].Set( mnLeft, mnRight );
}
else
@@ -182,10 +182,10 @@ PolyScanner::PolyScanner( const Polygon& rPoly )
{
long nLast = nCount - 1;
Point aFirst( rPoly[ 0 ] );
- Point aLast( rPoly[ (USHORT) nLast ] );
+ Point aLast( rPoly[ (sal_uInt16) nLast ] );
while( nLast && ( aLast == aFirst ) )
- aLast = rPoly[ (USHORT) --nLast ];
+ aLast = rPoly[ (sal_uInt16) --nLast ];
if( !nLast )
{
@@ -198,7 +198,7 @@ PolyScanner::PolyScanner( const Polygon& rPoly )
else
{
const Rectangle aRect( rPoly.GetBoundRect() );
- ULONG nHeight;
+ sal_uLong nHeight;
mnLeft = aRect.Left();
mnTop = aRect.Top();
@@ -209,7 +209,7 @@ PolyScanner::PolyScanner( const Polygon& rPoly )
for( long i = 1L; i <= nLast; i++ )
{
- const Point& rPt = rPoly[ (USHORT) i ];
+ const Point& rPt = rPoly[ (sal_uInt16) i ];
if( rPt != aLast )
{
@@ -241,7 +241,7 @@ PolyScanner::~PolyScanner()
// ------------------------------------------------------------------------
-PolyScanline* PolyScanner::operator[]( ULONG nPos ) const
+PolyScanline* PolyScanner::operator[]( sal_uLong nPos ) const
{
DBG_ASSERT( nPos < Count(), "nPos out of range!" );
return( mpArray ? ( mpArray + nPos ) : NULL );
@@ -282,7 +282,7 @@ void PolyScanner::InsertLine( const Point& rStart, const Point& rEnd )
const long nYInc = ( nStartY < nEndY ) ? 1L : -1L;
long nLastX = nStartX;
long nLastY = nStartY;
- BOOL bLast = FALSE;
+ sal_Bool bLast = sal_False;
mpArray[ nStartY - mnTop ].Insert( nStartX );
@@ -300,10 +300,10 @@ void PolyScanner::InsertLine( const Point& rStart, const Point& rEnd )
mpArray[ nLastY - mnTop ].Insert( nLastX );
mpArray[ nY - mnTop ].Insert( nX );
- bLast = FALSE;
+ bLast = sal_False;
}
else
- bLast = TRUE;
+ bLast = sal_True;
nLastX = nX;
nLastY = nY;
@@ -333,10 +333,10 @@ void PolyScanner::InsertLine( const Point& rStart, const Point& rEnd )
mpArray[ nLastY - mnTop ].Insert( nLastX );
mpArray[ nY - mnTop ].Insert( nX );
- bLast = FALSE;
+ bLast = sal_False;
}
else
- bLast = TRUE;
+ bLast = sal_True;
nLastX = nX;
nLastY = nY;
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 774673de0a04..15964d9da09f 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -40,6 +40,7 @@
#include <vcl/unohelp.hxx>
#include <tools/debug.hxx>
+#include <tools/resary.hxx>
#include <tools/stream.hxx>
#include <tools/vcompat.hxx>
#include <vcl/svdata.hxx>
@@ -53,11 +54,18 @@
#include <vcl/gdimtf.hxx>
#include <vcl/metaact.hxx>
#include <vcl/print.hxx>
+#include <vcl/svids.hrc>
#include <comphelper/processfactory.hxx>
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/container/XNameAccess.hpp"
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
+using namespace com::sun::star::beans;
+using namespace com::sun::star::container;
int nImplSysDialog = 0;
@@ -110,16 +118,16 @@ void ImplUpdateJobSetupPaper( JobSetup& rJobSetup )
// ------------------
PrinterOptions::PrinterOptions() :
- mbReduceTransparency( FALSE ),
+ mbReduceTransparency( sal_False ),
meReducedTransparencyMode( PRINTER_TRANSPARENCY_AUTO ),
- mbReduceGradients( FALSE ),
+ mbReduceGradients( sal_False ),
meReducedGradientsMode( PRINTER_GRADIENT_STRIPES ),
mnReducedGradientStepCount( 64 ),
- mbReduceBitmaps( FALSE ),
+ mbReduceBitmaps( sal_False ),
meReducedBitmapMode( PRINTER_BITMAP_NORMAL ),
mnReducedBitmapResolution( 200 ),
- mbReducedBitmapsIncludeTransparency( TRUE ),
- mbConvertToGreyscales( FALSE )
+ mbReducedBitmapsIncludeTransparency( sal_True ),
+ mbConvertToGreyscales( sal_False )
{
}
@@ -129,6 +137,105 @@ PrinterOptions::~PrinterOptions()
{
}
+#define PROPERTYNAME_REDUCETRANSPARENCY rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReduceTransparency"))
+#define PROPERTYNAME_REDUCEDTRANSPARENCYMODE rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedTransparencyMode"))
+#define PROPERTYNAME_REDUCEGRADIENTS rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReduceGradients"))
+#define PROPERTYNAME_REDUCEDGRADIENTMODE rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedGradientMode"))
+#define PROPERTYNAME_REDUCEDGRADIENTSTEPCOUNT rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedGradientStepCount"))
+#define PROPERTYNAME_REDUCEBITMAPS rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReduceBitmaps"))
+#define PROPERTYNAME_REDUCEDBITMAPMODE rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedBitmapMode"))
+#define PROPERTYNAME_REDUCEDBITMAPRESOLUTION rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedBitmapResolution"))
+#define PROPERTYNAME_REDUCEDBITMAPINCLUDESTRANSPARENCY rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedBitmapIncludesTransparency"))
+#define PROPERTYNAME_CONVERTTOGREYSCALES rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ConvertToGreyscales"))
+
+bool PrinterOptions::ReadFromConfig( bool i_bFile )
+{
+ bool bSuccess = false;
+ // save old state in case something goes wrong
+ PrinterOptions aOldValues( *this );
+
+ // get the configuration service
+ Reference< XMultiServiceFactory > xConfigProvider;
+ Reference< XNameAccess > xConfigAccess;
+ try
+ {
+ // get service provider
+ Reference< XMultiServiceFactory > xSMgr( comphelper::getProcessServiceFactory() );
+ // create configuration hierachical access name
+ if( xSMgr.is() )
+ {
+ try
+ {
+ xConfigProvider = Reference< XMultiServiceFactory >(
+ xSMgr->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationProvider" ))),
+ UNO_QUERY );
+ if( xConfigProvider.is() )
+ {
+ Sequence< Any > aArgs(1);
+ PropertyValue aVal;
+ aVal.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) );
+ if( i_bFile )
+ aVal.Value <<= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common/Print/Option/File" ) );
+ else
+ aVal.Value <<= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common/Print/Option/Printer" ) );
+ aArgs.getArray()[0] <<= aVal;
+ xConfigAccess = Reference< XNameAccess >(
+ xConfigProvider->createInstanceWithArguments(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationAccess" )), aArgs ),
+ UNO_QUERY );
+ if( xConfigAccess.is() )
+ {
+ Reference< XPropertySet > xSet( xConfigAccess, UNO_QUERY );
+ if( xSet.is() )
+ {
+ sal_Int32 nValue = 0;
+ sal_Bool bValue = 0;
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCETRANSPARENCY) >>= bValue )
+ SetReduceTransparency( bValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDTRANSPARENCYMODE) >>= nValue )
+ SetReducedTransparencyMode( (PrinterTransparencyMode)nValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEGRADIENTS) >>= bValue )
+ SetReduceGradients( bValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDGRADIENTMODE) >>= nValue )
+ SetReducedGradientMode( (PrinterGradientMode)nValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDGRADIENTSTEPCOUNT) >>= nValue )
+ SetReducedGradientStepCount( (sal_uInt16)nValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEBITMAPS) >>= bValue )
+ SetReduceBitmaps( bValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDBITMAPMODE) >>= nValue )
+ SetReducedBitmapMode( (PrinterBitmapMode)nValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDBITMAPRESOLUTION) >>= nValue )
+ SetReducedBitmapResolution( (sal_uInt16)nValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDBITMAPINCLUDESTRANSPARENCY) >>= bValue )
+ SetReducedBitmapIncludesTransparency( bValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_CONVERTTOGREYSCALES) >>= bValue )
+ SetConvertToGreyscales( bValue );
+
+ bSuccess = true;
+ }
+ }
+ }
+ }
+ catch( Exception& )
+ {
+ }
+ }
+ }
+ catch( WrappedTargetException& )
+ {
+ }
+
+ if( ! bSuccess )
+ *this = aOldValues;
+ return bSuccess;
+}
+
+void Printer::SetPrinterOptions( const PrinterOptions& i_rOptions )
+{
+ *mpPrinterOptions = i_rOptions;
+}
+
// -------------
// - QueueInfo -
// -------------
@@ -348,24 +455,24 @@ XubString Printer::GetDefaultPrinterName()
void Printer::ImplInitData()
{
- mbDevOutput = FALSE;
+ mbDevOutput = sal_False;
meOutDevType = OUTDEV_PRINTER;
- mbDefPrinter = FALSE;
+ mbDefPrinter = sal_False;
mnError = 0;
mnCurPage = 0;
mnCurPrintPage = 0;
mnPageQueueSize = 0;
mnCopyCount = 1;
- mbCollateCopy = FALSE;
- mbPrinting = FALSE;
- mbJobActive = FALSE;
- mbPrintFile = FALSE;
- mbInPrintPage = FALSE;
- mbNewJobSetup = FALSE;
+ mbCollateCopy = sal_False;
+ mbPrinting = sal_False;
+ mbJobActive = sal_False;
+ mbPrintFile = sal_False;
+ mbInPrintPage = sal_False;
+ mbNewJobSetup = sal_False;
mpInfoPrinter = NULL;
mpPrinter = NULL;
mpDisplayDev = NULL;
- mbIsQueuePrinter = FALSE;
+ mbIsQueuePrinter = sal_False;
mpPrinterOptions = new PrinterOptions;
// Printer in die Liste eintragen
@@ -430,7 +537,7 @@ void Printer::ImplInit( SalPrinterQueueInfo* pInfo )
// Daten initialisieren
ImplUpdatePageData();
mpFontList = new ImplDevFontList();
- mpFontCache = new ImplFontCache( TRUE );
+ mpFontCache = new ImplFontCache( sal_True );
mpGraphics->GetDevFontList( mpFontList );
}
@@ -539,7 +646,7 @@ void Printer::ImplUpdatePageData()
void Printer::ImplUpdateFontList()
{
- ImplUpdateFontData( TRUE );
+ ImplUpdateFontData( sal_True );
}
// -----------------------------------------------------------------------
@@ -552,7 +659,7 @@ Printer::Printer()
{
ImplInit( pInfo );
if ( !IsDisplayPrinter() )
- mbDefPrinter = TRUE;
+ mbDefPrinter = sal_True;
}
else
ImplInitDisplay( NULL );
@@ -670,57 +777,57 @@ void Printer::Compat_OldPrinterMetrics( bool bSet )
mpInfoPrinter->m_bCompatMetrics = bSet;
// get new font data
- ImplUpdateFontData( TRUE );
+ ImplUpdateFontData( sal_True );
}
// -----------------------------------------------------------------------
-ULONG Printer::GetCapabilities( USHORT nType ) const
+sal_uLong Printer::GetCapabilities( sal_uInt16 nType ) const
{
if ( IsDisplayPrinter() )
- return FALSE;
+ return sal_False;
if( mpInfoPrinter )
return mpInfoPrinter->GetCapabilities( maJobSetup.ImplGetConstData(), nType );
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Printer::HasSupport( PrinterSupport eFeature ) const
+sal_Bool Printer::HasSupport( PrinterSupport eFeature ) const
{
switch ( eFeature )
{
case SUPPORT_SET_ORIENTATION:
- return (BOOL)GetCapabilities( PRINTER_CAPABILITIES_SETORIENTATION );
+ return (sal_Bool)GetCapabilities( PRINTER_CAPABILITIES_SETORIENTATION );
case SUPPORT_SET_PAPERBIN:
- return (BOOL)GetCapabilities( PRINTER_CAPABILITIES_SETPAPERBIN );
+ return (sal_Bool)GetCapabilities( PRINTER_CAPABILITIES_SETPAPERBIN );
case SUPPORT_SET_PAPERSIZE:
- return (BOOL)GetCapabilities( PRINTER_CAPABILITIES_SETPAPERSIZE );
+ return (sal_Bool)GetCapabilities( PRINTER_CAPABILITIES_SETPAPERSIZE );
case SUPPORT_SET_PAPER:
- return (BOOL)GetCapabilities( PRINTER_CAPABILITIES_SETPAPER );
+ return (sal_Bool)GetCapabilities( PRINTER_CAPABILITIES_SETPAPER );
case SUPPORT_COPY:
return (GetCapabilities( PRINTER_CAPABILITIES_COPIES ) != 0);
case SUPPORT_COLLATECOPY:
return (GetCapabilities( PRINTER_CAPABILITIES_COLLATECOPIES ) != 0);
case SUPPORT_SETUPDIALOG:
- return (BOOL)GetCapabilities( PRINTER_CAPABILITIES_SUPPORTDIALOG );
+ return (sal_Bool)GetCapabilities( PRINTER_CAPABILITIES_SUPPORTDIALOG );
case SUPPORT_FAX:
- return (BOOL) GetCapabilities( PRINTER_CAPABILITIES_FAX );
+ return (sal_Bool) GetCapabilities( PRINTER_CAPABILITIES_FAX );
case SUPPORT_PDF:
- return (BOOL) GetCapabilities( PRINTER_CAPABILITIES_PDF );
+ return (sal_Bool) GetCapabilities( PRINTER_CAPABILITIES_PDF );
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL Printer::SetJobSetup( const JobSetup& rSetup )
+sal_Bool Printer::SetJobSetup( const JobSetup& rSetup )
{
if ( IsDisplayPrinter() || mbInPrintPage )
- return FALSE;
+ return sal_False;
JobSetup aJobSetup = rSetup;
@@ -728,60 +835,60 @@ BOOL Printer::SetJobSetup( const JobSetup& rSetup )
if ( mpInfoPrinter->SetPrinterData( aJobSetup.ImplGetData() ) )
{
ImplUpdateJobSetupPaper( aJobSetup );
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
ImplUpdatePageData();
ImplUpdateFontList();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Printer::Setup( Window* pWindow )
+sal_Bool Printer::Setup( Window* pWindow )
{
if ( IsDisplayPrinter() )
- return FALSE;
+ return sal_False;
if ( IsJobActive() || IsPrinting() )
- return FALSE;
+ return sal_False;
JobSetup aJobSetup = maJobSetup;
SalFrame* pFrame;
if ( !pWindow )
pWindow = ImplGetDefaultWindow();
if( !pWindow )
- return FALSE;
+ return sal_False;
pFrame = pWindow->ImplGetFrame();
ImplReleaseGraphics();
ImplSVData* pSVData = ImplGetSVData();
pSVData->maAppData.mnModalMode++;
nImplSysDialog++;
- BOOL bSetup = mpInfoPrinter->Setup( pFrame, aJobSetup.ImplGetData() );
+ sal_Bool bSetup = mpInfoPrinter->Setup( pFrame, aJobSetup.ImplGetData() );
pSVData->maAppData.mnModalMode--;
nImplSysDialog--;
if ( bSetup )
{
ImplUpdateJobSetupPaper( aJobSetup );
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
ImplUpdatePageData();
ImplUpdateFontList();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Printer::SetPrinterProps( const Printer* pPrinter )
+sal_Bool Printer::SetPrinterProps( const Printer* pPrinter )
{
if ( IsJobActive() || IsPrinting() )
- return FALSE;
+ return sal_False;
ImplSVData* pSVData = ImplGetSVData();
@@ -821,14 +928,14 @@ BOOL Printer::SetPrinterProps( const Printer* pPrinter )
mpFontCache = NULL;
mpFontList = NULL;
- mbInitFont = TRUE;
- mbNewFont = TRUE;
+ mbInitFont = sal_True;
+ mbNewFont = sal_True;
mpInfoPrinter = NULL;
}
// Neuen Printer bauen
ImplInitDisplay( NULL );
- return TRUE;
+ return sal_True;
}
// Alten Printer zerstoeren?
@@ -863,8 +970,8 @@ BOOL Printer::SetPrinterProps( const Printer* pPrinter )
delete mpFontList;
mpFontCache = NULL;
mpFontList = NULL;
- mbInitFont = TRUE;
- mbNewFont = TRUE;
+ mbInitFont = sal_True;
+ mbNewFont = sal_True;
mpInfoPrinter = NULL;
}
@@ -882,15 +989,15 @@ BOOL Printer::SetPrinterProps( const Printer* pPrinter )
else
SetJobSetup( pPrinter->GetJobSetup() );
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Printer::SetOrientation( Orientation eOrientation )
+sal_Bool Printer::SetOrientation( Orientation eOrientation )
{
if ( mbInPrintPage )
- return FALSE;
+ return sal_False;
if ( maJobSetup.ImplGetConstData()->meOrientation != eOrientation )
{
@@ -900,26 +1007,26 @@ BOOL Printer::SetOrientation( Orientation eOrientation )
if ( IsDisplayPrinter() )
{
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
- return TRUE;
+ return sal_True;
}
ImplReleaseGraphics();
if ( mpInfoPrinter->SetData( SAL_JOBSET_ORIENTATION, pSetupData ) )
{
ImplUpdateJobSetupPaper( aJobSetup );
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
ImplUpdatePageData();
ImplUpdateFontList();
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -931,10 +1038,10 @@ Orientation Printer::GetOrientation() const
// -----------------------------------------------------------------------
-BOOL Printer::SetPaperBin( USHORT nPaperBin )
+sal_Bool Printer::SetPaperBin( sal_uInt16 nPaperBin )
{
if ( mbInPrintPage )
- return FALSE;
+ return sal_False;
if ( (maJobSetup.ImplGetConstData()->mnPaperBin != nPaperBin) &&
(nPaperBin < GetPaperBinCount()) )
@@ -945,31 +1052,31 @@ BOOL Printer::SetPaperBin( USHORT nPaperBin )
if ( IsDisplayPrinter() )
{
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
- return TRUE;
+ return sal_True;
}
ImplReleaseGraphics();
if ( mpInfoPrinter->SetData( SAL_JOBSET_PAPERBIN, pSetupData ) )
{
ImplUpdateJobSetupPaper( aJobSetup );
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
ImplUpdatePageData();
ImplUpdateFontList();
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-USHORT Printer::GetPaperBin() const
+sal_uInt16 Printer::GetPaperBin() const
{
return maJobSetup.ImplGetConstData()->mnPaperBin;
}
@@ -1067,10 +1174,10 @@ void Printer::ImplFindPaperFormatForUserSize( JobSetup& aJobSetup, bool bMatchNe
// -----------------------------------------------------------------------
-BOOL Printer::SetPaper( Paper ePaper )
+sal_Bool Printer::SetPaper( Paper ePaper )
{
if ( mbInPrintPage )
- return FALSE;
+ return sal_False;
if ( maJobSetup.ImplGetConstData()->mePaperFormat != ePaper )
{
@@ -1086,9 +1193,9 @@ BOOL Printer::SetPaper( Paper ePaper )
if ( IsDisplayPrinter() )
{
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
- return TRUE;
+ return sal_True;
}
ImplReleaseGraphics();
@@ -1097,30 +1204,30 @@ BOOL Printer::SetPaper( Paper ePaper )
if ( mpInfoPrinter->SetData( SAL_JOBSET_PAPERSIZE|SAL_JOBSET_ORIENTATION, pSetupData ) )
{
ImplUpdateJobSetupPaper( aJobSetup );
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
ImplUpdatePageData();
ImplUpdateFontList();
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL Printer::SetPaperSizeUser( const Size& rSize )
+sal_Bool Printer::SetPaperSizeUser( const Size& rSize )
{
return SetPaperSizeUser( rSize, false );
}
-BOOL Printer::SetPaperSizeUser( const Size& rSize, bool bMatchNearest )
+sal_Bool Printer::SetPaperSizeUser( const Size& rSize, bool bMatchNearest )
{
if ( mbInPrintPage )
- return FALSE;
+ return sal_False;
Size aPixSize = LogicToPixel( rSize );
Size aPageSize = PixelToLogic( aPixSize, MAP_100TH_MM );
@@ -1136,9 +1243,9 @@ BOOL Printer::SetPaperSizeUser( const Size& rSize, bool bMatchNearest )
if ( IsDisplayPrinter() )
{
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
- return TRUE;
+ return sal_True;
}
ImplReleaseGraphics();
@@ -1148,17 +1255,17 @@ BOOL Printer::SetPaperSizeUser( const Size& rSize, bool bMatchNearest )
if ( mpInfoPrinter->SetData( SAL_JOBSET_PAPERSIZE|SAL_JOBSET_ORIENTATION, pSetupData ) )
{
ImplUpdateJobSetupPaper( aJobSetup );
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
ImplUpdatePageData();
ImplUpdateFontList();
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -1174,6 +1281,48 @@ int Printer::GetPaperInfoCount() const
// -----------------------------------------------------------------------
+rtl::OUString Printer::GetPaperName( Paper ePaper )
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ if( ! pSVData->mpPaperNames )
+ {
+ pSVData->mpPaperNames = new boost::unordered_map< int, rtl::OUString >();
+ if( ImplGetResMgr() )
+ {
+ ResStringArray aPaperStrings( VclResId( RID_STR_PAPERNAMES ) );
+ static const int PaperIndex[] =
+ {
+ PAPER_A0, PAPER_A1, PAPER_A2, PAPER_A3, PAPER_A4, PAPER_A5,
+ PAPER_B4_ISO, PAPER_B5_ISO, PAPER_LETTER, PAPER_LEGAL, PAPER_TABLOID,
+ PAPER_USER, PAPER_B6_ISO, PAPER_ENV_C4, PAPER_ENV_C5, PAPER_ENV_C6, PAPER_ENV_C65,
+ PAPER_ENV_DL, PAPER_SLIDE_DIA, PAPER_SCREEN, PAPER_C, PAPER_D, PAPER_E,
+ PAPER_EXECUTIVE, PAPER_FANFOLD_LEGAL_DE, PAPER_ENV_MONARCH, PAPER_ENV_PERSONAL,
+ PAPER_ENV_9, PAPER_ENV_10, PAPER_ENV_11, PAPER_ENV_12, PAPER_KAI16,
+ PAPER_KAI32, PAPER_KAI32BIG, PAPER_B4_JIS, PAPER_B5_JIS, PAPER_B6_JIS
+ };
+ OSL_ENSURE( sal_uInt32(sizeof(PaperIndex)/sizeof(PaperIndex[0])) == aPaperStrings.Count(), "localized paper name count wrong" );
+ for( int i = 0; i < int(sizeof(PaperIndex)/sizeof(PaperIndex[0])); i++ )
+ (*pSVData->mpPaperNames)[PaperIndex[i]] = aPaperStrings.GetString(i);
+ }
+ }
+
+ boost::unordered_map<int,rtl::OUString>::const_iterator it = pSVData->mpPaperNames->find( (int)ePaper );
+ return (it != pSVData->mpPaperNames->end()) ? it->second : rtl::OUString();
+}
+
+// -----------------------------------------------------------------------
+
+rtl::OUString Printer::GetPaperName( bool i_bPaperUser ) const
+{
+ Size aPageSize = PixelToLogic( GetPaperSizePixel(), MAP_100TH_MM );
+ Paper ePaper = ImplGetPaperFormat( aPageSize.Width(), aPageSize.Height() );
+ if( ePaper == PAPER_USER )
+ ePaper = ImplGetPaperFormat( aPageSize.Height(), aPageSize.Width() );
+ return (ePaper != PAPER_USER || i_bPaperUser ) ? GetPaperName( ePaper ) : rtl::OUString();
+}
+
+// -----------------------------------------------------------------------
+
const PaperInfo& Printer::GetPaperInfo( int nPaper ) const
{
if( ! mpInfoPrinter )
@@ -1194,10 +1343,10 @@ DuplexMode Printer::GetDuplexMode() const
// -----------------------------------------------------------------------
-BOOL Printer::SetDuplexMode( DuplexMode eDuplex )
+sal_Bool Printer::SetDuplexMode( DuplexMode eDuplex )
{
if ( mbInPrintPage )
- return FALSE;
+ return sal_False;
if ( maJobSetup.ImplGetConstData()->meDuplexMode != eDuplex )
{
@@ -1207,26 +1356,26 @@ BOOL Printer::SetDuplexMode( DuplexMode eDuplex )
if ( IsDisplayPrinter() )
{
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
- return TRUE;
+ return sal_True;
}
ImplReleaseGraphics();
if ( mpInfoPrinter->SetData( SAL_JOBSET_DUPLEXMODE, pSetupData ) )
{
ImplUpdateJobSetupPaper( aJobSetup );
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
ImplUpdatePageData();
ImplUpdateFontList();
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -1245,17 +1394,17 @@ Paper Printer::GetPaper() const
// -----------------------------------------------------------------------
-USHORT Printer::GetPaperBinCount() const
+sal_uInt16 Printer::GetPaperBinCount() const
{
if ( IsDisplayPrinter() )
return 0;
- return (USHORT)mpInfoPrinter->GetPaperBinCount( maJobSetup.ImplGetConstData() );
+ return (sal_uInt16)mpInfoPrinter->GetPaperBinCount( maJobSetup.ImplGetConstData() );
}
// -----------------------------------------------------------------------
-XubString Printer::GetPaperBinName( USHORT nPaperBin ) const
+XubString Printer::GetPaperBinName( sal_uInt16 nPaperBin ) const
{
if ( IsDisplayPrinter() )
return ImplGetSVEmptyStr();
@@ -1268,11 +1417,11 @@ XubString Printer::GetPaperBinName( USHORT nPaperBin ) const
// -----------------------------------------------------------------------
-BOOL Printer::SetCopyCount( USHORT nCopy, BOOL bCollate )
+sal_Bool Printer::SetCopyCount( sal_uInt16 nCopy, sal_Bool bCollate )
{
mnCopyCount = nCopy;
mbCollateCopy = bCollate;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -1285,9 +1434,9 @@ void Printer::Error()
// -----------------------------------------------------------------------
-ULONG Printer::ImplSalPrinterErrorCodeToVCL( ULONG nError )
+sal_uLong Printer::ImplSalPrinterErrorCodeToVCL( sal_uLong nError )
{
- ULONG nVCLError;
+ sal_uLong nVCLError;
switch ( nError )
{
case 0:
@@ -1308,7 +1457,7 @@ ULONG Printer::ImplSalPrinterErrorCodeToVCL( ULONG nError )
void Printer::ImplEndPrint()
{
- mbPrinting = FALSE;
+ mbPrinting = sal_False;
mnCurPrintPage = 0;
maJobName.Erase();
}
@@ -1325,15 +1474,15 @@ IMPL_LINK( Printer, ImplDestroyPrinterAsync, void*, pSalPrinter )
// -----------------------------------------------------------------------
-BOOL Printer::EndJob()
+sal_Bool Printer::EndJob()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( !IsJobActive() )
return bRet;
DBG_ASSERT( !mbInPrintPage, "Printer::EndJob() - StartPage() without EndPage() called" );
- mbJobActive = FALSE;
+ mbJobActive = sal_False;
if ( mpPrinter )
{
@@ -1341,13 +1490,13 @@ BOOL Printer::EndJob()
mnCurPage = 0;
- bRet = TRUE;
+ bRet = sal_True;
- mbPrinting = FALSE;
+ mbPrinting = sal_False;
mnCurPrintPage = 0;
maJobName.Erase();
- mbDevOutput = FALSE;
+ mbDevOutput = sal_False;
bRet = mpPrinter->EndJob();
// Hier den Drucker nicht asyncron zerstoeren, da es
// W95 nicht verkraftet, wenn gleichzeitig gedruckt wird
@@ -1361,34 +1510,34 @@ BOOL Printer::EndJob()
// -----------------------------------------------------------------------
-BOOL Printer::AbortJob()
+sal_Bool Printer::AbortJob()
{
// Wenn wir einen Queue-Printer haben, kann man diesen noch mit
// AbortJob() abbrechen, solange dieser noch am Drucken ist
if ( !IsJobActive() && !IsPrinting() )
- return FALSE;
+ return sal_False;
- mbJobActive = FALSE;
- mbInPrintPage = FALSE;
+ mbJobActive = sal_False;
+ mbInPrintPage = sal_False;
mpJobGraphics = NULL;
if ( mpPrinter )
{
- mbPrinting = FALSE;
+ mbPrinting = sal_False;
mnCurPage = 0;
mnCurPrintPage = 0;
maJobName.Erase();
ImplReleaseGraphics();
- mbDevOutput = FALSE;
+ mbDevOutput = sal_False;
mpPrinter->AbortJob();
Application::PostUserEvent( LINK( this, Printer, ImplDestroyPrinterAsync ), mpPrinter );
mpPrinter = NULL;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -1406,12 +1555,12 @@ void Printer::ImplStartPage()
ImplReleaseGraphics();
mpJobGraphics = pGraphics;
}
- mbDevOutput = TRUE;
+ mbDevOutput = sal_True;
// PrintJob not aborted ???
if ( IsJobActive() )
{
- mbInPrintPage = TRUE;
+ mbInPrintPage = sal_True;
mnCurPage++;
mnCurPrintPage++;
}
@@ -1425,16 +1574,16 @@ void Printer::ImplEndPage()
if ( !IsJobActive() )
return;
- mbInPrintPage = FALSE;
+ mbInPrintPage = sal_False;
if ( mpPrinter )
{
mpPrinter->EndPage();
ImplReleaseGraphics();
- mbDevOutput = FALSE;
+ mbDevOutput = sal_False;
mpJobGraphics = NULL;
- mbNewJobSetup = FALSE;
+ mbNewJobSetup = sal_False;
}
}
diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx
index c8be71b70a45..38c589eb12b2 100644
--- a/vcl/source/gdi/print2.cxx
+++ b/vcl/source/gdi/print2.cxx
@@ -155,7 +155,7 @@ static void ImplConvertTransparentAction( GDIMetaFile& o_rMtf,
if( rAct.GetType() == META_TRANSPARENT_ACTION )
{
const MetaTransparentAction* pTransAct = static_cast<const MetaTransparentAction*>(&rAct);
- USHORT nTransparency( pTransAct->GetTransparence() );
+ sal_uInt16 nTransparency( pTransAct->GetTransparence() );
// #i10613# Respect transparency for draw color
if( nTransparency )
@@ -164,16 +164,16 @@ static void ImplConvertTransparentAction( GDIMetaFile& o_rMtf,
// assume white background for alpha blending
Color aLineColor( rStateOutDev.GetLineColor() );
- aLineColor.SetRed( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aLineColor.GetRed()) / 100L ) );
- aLineColor.SetGreen( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aLineColor.GetGreen()) / 100L ) );
- aLineColor.SetBlue( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aLineColor.GetBlue()) / 100L ) );
- o_rMtf.AddAction( new MetaLineColorAction(aLineColor, TRUE) );
+ aLineColor.SetRed( static_cast<sal_uInt8>( (255L*nTransparency + (100L - nTransparency)*aLineColor.GetRed()) / 100L ) );
+ aLineColor.SetGreen( static_cast<sal_uInt8>( (255L*nTransparency + (100L - nTransparency)*aLineColor.GetGreen()) / 100L ) );
+ aLineColor.SetBlue( static_cast<sal_uInt8>( (255L*nTransparency + (100L - nTransparency)*aLineColor.GetBlue()) / 100L ) );
+ o_rMtf.AddAction( new MetaLineColorAction(aLineColor, sal_True) );
Color aFillColor( rStateOutDev.GetFillColor() );
- aFillColor.SetRed( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aFillColor.GetRed()) / 100L ) );
- aFillColor.SetGreen( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aFillColor.GetGreen()) / 100L ) );
- aFillColor.SetBlue( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aFillColor.GetBlue()) / 100L ) );
- o_rMtf.AddAction( new MetaFillColorAction(aFillColor, TRUE) );
+ aFillColor.SetRed( static_cast<sal_uInt8>( (255L*nTransparency + (100L - nTransparency)*aFillColor.GetRed()) / 100L ) );
+ aFillColor.SetGreen( static_cast<sal_uInt8>( (255L*nTransparency + (100L - nTransparency)*aFillColor.GetGreen()) / 100L ) );
+ aFillColor.SetBlue( static_cast<sal_uInt8>( (255L*nTransparency + (100L - nTransparency)*aFillColor.GetBlue()) / 100L ) );
+ o_rMtf.AddAction( new MetaFillColorAction(aFillColor, sal_True) );
}
o_rMtf.AddAction( new MetaPolyPolygonAction(pTransAct->GetPolyPolygon()) );
@@ -405,9 +405,21 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
break;
case META_LINE_ACTION:
- aActionBounds = Rectangle( static_cast<const MetaLineAction&>(rAct).GetStartPoint(),
- static_cast<const MetaLineAction&>(rAct).GetEndPoint() );
+ {
+ const MetaLineAction& rMetaLineAction = static_cast<const MetaLineAction&>(rAct);
+ aActionBounds = Rectangle( rMetaLineAction.GetStartPoint(), rMetaLineAction.GetEndPoint() );
+ aActionBounds.Justify();
+ const long nLineWidth(rMetaLineAction.GetLineInfo().GetWidth());
+ if(nLineWidth)
+ {
+ const long nHalfLineWidth((nLineWidth + 1) / 2);
+ aActionBounds.Left() -= nHalfLineWidth;
+ aActionBounds.Top() -= nHalfLineWidth;
+ aActionBounds.Right() += nHalfLineWidth;
+ aActionBounds.Bottom() += nHalfLineWidth;
+ }
break;
+ }
case META_RECT_ACTION:
aActionBounds = static_cast<const MetaRectAction&>(rAct).GetRect();
@@ -447,8 +459,20 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
break;
case META_POLYLINE_ACTION:
- aActionBounds = static_cast<const MetaPolyLineAction&>(rAct).GetPolygon().GetBoundRect();
+ {
+ const MetaPolyLineAction& rMetaPolyLineAction = static_cast<const MetaPolyLineAction&>(rAct);
+ aActionBounds = rMetaPolyLineAction.GetPolygon().GetBoundRect();
+ const long nLineWidth(rMetaPolyLineAction.GetLineInfo().GetWidth());
+ if(nLineWidth)
+ {
+ const long nHalfLineWidth((nLineWidth + 1) / 2);
+ aActionBounds.Left() -= nHalfLineWidth;
+ aActionBounds.Top() -= nHalfLineWidth;
+ aActionBounds.Right() += nHalfLineWidth;
+ aActionBounds.Bottom() += nHalfLineWidth;
+ }
break;
+ }
case META_POLYGON_ACTION:
aActionBounds = static_cast<const MetaPolygonAction&>(rAct).GetPolygon().GetBoundRect();
@@ -724,7 +748,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
VirtualDevice aMapModeVDev;
aMapModeVDev.mnDPIX = mnDPIX;
aMapModeVDev.mnDPIY = mnDPIY;
- aMapModeVDev.EnableOutput(FALSE);
+ aMapModeVDev.EnableOutput(sal_False);
int nLastBgAction, nActionNum;
@@ -832,13 +856,12 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
++nActionNum;
}
- ConnectedComponentsList aCCList; // list containing distinct sets of connected components as elements.
+ // clean up aMapModeVDev
+ sal_uInt32 nCount = aMapModeVDev.GetGCStackDepth();
+ while( nCount-- )
+ aMapModeVDev.Pop();
- // create an OutputDevice to record mapmode changes and the like
- VirtualDevice aMapModeVDev2;
- aMapModeVDev2.mnDPIX = mnDPIX;
- aMapModeVDev2.mnDPIY = mnDPIY;
- aMapModeVDev2.EnableOutput(FALSE);
+ ConnectedComponentsList aCCList; // list containing distinct sets of connected components as elements.
// fast-forward until one after the last background action
// (need to reconstruct map mode vdev state)
@@ -853,7 +876,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
pCurrAct, nActionNum) );
// execute action to get correct MapModes etc.
- pCurrAct->Execute( &aMapModeVDev2 );
+ pCurrAct->Execute( &aMapModeVDev );
pCurrAct=const_cast<GDIMetaFile&>(rInMtf).NextAction();
++nActionNum;
}
@@ -870,10 +893,10 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
pCurrAct=const_cast<GDIMetaFile&>(rInMtf).NextAction(), ++nActionNum )
{
// execute action to get correct MapModes etc.
- pCurrAct->Execute( &aMapModeVDev2 );
+ pCurrAct->Execute( &aMapModeVDev );
// cache bounds of current action
- const Rectangle aBBCurrAct( ImplCalcActionBounds(*pCurrAct, aMapModeVDev2) );
+ const Rectangle aBBCurrAct( ImplCalcActionBounds(*pCurrAct, aMapModeVDev) );
// accumulate collected bounds here, initialize with current action
Rectangle aTotalBounds( aBBCurrAct ); // thus,
@@ -902,7 +925,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
// not be considered for connected components,
// too. Just put each of them into a separate
// component.
- aTotalComponents.bIsFullyTransparent = !ImplIsNotTransparent(*pCurrAct, aMapModeVDev2);
+ aTotalComponents.bIsFullyTransparent = !ImplIsNotTransparent(*pCurrAct, aMapModeVDev);
if( !aBBCurrAct.IsEmpty() &&
!aTotalComponents.bIsFullyTransparent )
@@ -1170,7 +1193,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
Size aDstSzPix;
VirtualDevice aMapVDev; // here, we record only mapmode information
- aMapVDev.EnableOutput(FALSE);
+ aMapVDev.EnableOutput(sal_False);
VirtualDevice aPaintVDev; // into this one, we render.
@@ -1201,7 +1224,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
aMapVDev.mnDPIX = aPaintVDev.mnDPIX = mnDPIX;
aMapVDev.mnDPIY = aPaintVDev.mnDPIY = mnDPIY;
- aPaintVDev.EnableOutput(FALSE);
+ aPaintVDev.EnableOutput(sal_False);
// iterate over all actions
for( pCurrAct=const_cast<GDIMetaFile&>(rInMtf).FirstAction(), nActionNum=0;
@@ -1213,10 +1236,10 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
// the current aCCList element
// (aCurr)
if( aCCList_MemberMap[nActionNum] == &(*aCurr) )
- aPaintVDev.EnableOutput(TRUE);
+ aPaintVDev.EnableOutput(sal_True);
// but process every action
- const USHORT nType( pCurrAct->GetType() );
+ const sal_uInt16 nType( pCurrAct->GetType() );
if( META_MAPMODE_ACTION == nType )
{
@@ -1251,8 +1274,8 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
Application::Reschedule();
}
- const BOOL bOldMap = mbMap;
- mbMap = aPaintVDev.mbMap = FALSE;
+ const sal_Bool bOldMap = mbMap;
+ mbMap = aPaintVDev.mbMap = sal_False;
Bitmap aBandBmp( aPaintVDev.GetBitmap( Point(), aDstSzPix ) );
@@ -1268,7 +1291,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
rOutMtf.AddAction( new MetaBmpScaleAction( aDstPtPix, aDstSzPix, aBandBmp ) );
rOutMtf.AddAction( new MetaCommentAction( "PRNSPOOL_TRANSPARENTBITMAP_END" ) );
- aPaintVDev.mbMap = TRUE;
+ aPaintVDev.mbMap = sal_True;
mbMap = bOldMap;
aMapVDev.Pop();
aPaintVDev.Pop();
@@ -1288,18 +1311,16 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
}
}
+ // clean up aMapModeVDev
+ nCount = aMapModeVDev.GetGCStackDepth();
+ while( nCount-- )
+ aMapModeVDev.Pop();
+
//
// STAGE 4: Copy actions to output metafile
// ========================================
//
- // create an OutputDevice to record color settings, mapmode
- // changes and the like
- VirtualDevice aMapModeVDev3;
- aMapModeVDev3.mnDPIX = mnDPIX;
- aMapModeVDev3.mnDPIY = mnDPIY;
- aMapModeVDev3.EnableOutput(FALSE);
-
// iterate over all actions and duplicate the ones not in a
// special aCCList member into rOutMtf
for( pCurrAct=const_cast<GDIMetaFile&>(rInMtf).FirstAction(), nActionNum=0;
@@ -1327,7 +1348,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
// given background color
ImplConvertTransparentAction(rOutMtf,
*pCurrAct,
- aMapModeVDev3,
+ aMapModeVDev,
aBackgroundComponent.aBgColor);
}
else
@@ -1336,7 +1357,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
rOutMtf.AddAction( ( pCurrAct->Duplicate(), pCurrAct ) );
}
- pCurrAct->Execute(&aMapModeVDev3);
+ pCurrAct->Execute(&aMapModeVDev);
}
}
@@ -1514,7 +1535,7 @@ void Printer::DrawGradientEx( OutputDevice* pOut, const Rectangle& rRect, const
( (long) rEndColor.GetGreen() * rGradient.GetEndIntensity() ) / 100L ) >> 1;
const long nB = ( ( (long) rStartColor.GetBlue() * rGradient.GetStartIntensity() ) / 100L +
( (long) rEndColor.GetBlue() * rGradient.GetEndIntensity() ) / 100L ) >> 1;
- const Color aColor( (BYTE) nR, (BYTE) nG, (BYTE) nB );
+ const Color aColor( (sal_uInt8) nR, (sal_uInt8) nG, (sal_uInt8) nB );
pOut->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
pOut->SetLineColor( aColor );
@@ -1557,7 +1578,7 @@ void Printer::DrawGradientEx( OutputDevice* pOut, const PolyPolygon& rPolyPoly,
( (long) rEndColor.GetGreen() * rGradient.GetEndIntensity() ) / 100L ) >> 1;
const long nB = ( ( (long) rStartColor.GetBlue() * rGradient.GetStartIntensity() ) / 100L +
( (long) rEndColor.GetBlue() * rGradient.GetEndIntensity() ) / 100L ) >> 1;
- const Color aColor( (BYTE) nR, (BYTE) nG, (BYTE) nB );
+ const Color aColor( (sal_uInt8) nR, (sal_uInt8) nG, (sal_uInt8) nB );
pOut->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
pOut->SetLineColor( aColor );
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index a96804f5448f..c277d16305e7 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -146,6 +146,7 @@ public:
typedef boost::unordered_map< rtl::OUString, size_t, rtl::OUStringHash > PropertyToIndexMap;
typedef boost::unordered_map< rtl::OUString, ControlDependency, rtl::OUStringHash > ControlDependencyMap;
+ typedef boost::unordered_map< rtl::OUString, Sequence< sal_Bool >, rtl::OUStringHash > ChoiceDisableMap;
boost::shared_ptr<Printer> mpPrinter;
Sequence< PropertyValue > maUIOptions;
@@ -154,6 +155,7 @@ public:
PropertyToIndexMap maPropertyToIndex;
Link maOptionChangeHdl;
ControlDependencyMap maControlDependencies;
+ ChoiceDisableMap maChoiceDisableMap;
sal_Bool mbFirstPage;
sal_Bool mbLastPage;
sal_Bool mbReversePageOrder;
@@ -182,17 +184,17 @@ public:
{}
~ImplPrinterControllerData() { delete mpProgress; }
- Size getRealPaperSize( const Size& i_rPageSize ) const
+ Size getRealPaperSize( const Size& i_rPageSize, bool bNoNUP ) const
{
if( maFixedPageSize.Width() > 0 && maFixedPageSize.Height() > 0 )
return maFixedPageSize;
- if( maMultiPage.nRows * maMultiPage.nColumns > 1 )
+ if( maMultiPage.nRows * maMultiPage.nColumns > 1 && ! bNoNUP )
return maMultiPage.aPaperSize;
return i_rPageSize;
}
bool isFixedPageSize() const
{ return maFixedPageSize.Width() != 0 && maFixedPageSize.Height() != 0; }
- PrinterController::PageSize modifyJobSetup( const Sequence< PropertyValue >& i_rProps );
+ PrinterController::PageSize modifyJobSetup( const Sequence< PropertyValue >& i_rProps, bool bNoNUP );
};
PrinterController::PrinterController()
@@ -484,18 +486,18 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
mnError = PRINTER_OK;
if ( IsDisplayPrinter() )
- return FALSE;
+ return sal_False;
if ( IsJobActive() || IsPrinting() )
- return FALSE;
+ return sal_False;
- ULONG nCopies = mnCopyCount;
+ sal_uLong nCopies = mnCopyCount;
bool bCollateCopy = mbCollateCopy;
- bool bUserCopy = FALSE;
+ bool bUserCopy = sal_False;
if ( nCopies > 1 )
{
- ULONG nDevCopy;
+ sal_uLong nDevCopy;
if ( bCollateCopy )
nDevCopy = GetCapabilities( PRINTER_CAPABILITIES_COLLATECOPIES );
@@ -505,20 +507,20 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
// need to do copies by hand ?
if ( nCopies > nDevCopy )
{
- bUserCopy = TRUE;
+ bUserCopy = sal_True;
nCopies = 1;
- bCollateCopy = FALSE;
+ bCollateCopy = sal_False;
}
}
else
- bCollateCopy = FALSE;
+ bCollateCopy = sal_False;
ImplSVData* pSVData = ImplGetSVData();
mpPrinter = pSVData->mpDefInst->CreatePrinter( mpInfoPrinter );
if ( !mpPrinter )
- return FALSE;
+ return sal_False;
sal_Bool bSinglePrintJobs = sal_False;
beans::PropertyValue* pSingleValue = i_pController->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintCollateAsSingleJobs" ) ) );
@@ -527,10 +529,6 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
pSingleValue->Value >>= bSinglePrintJobs;
}
- // remark: currently it is still possible to use EnablePrintFile and
- // SetPrintFileName to redirect printout into file
- // it can be argued that those methods should be removed in favor
- // of only using the LocalFileName property
beans::PropertyValue* pFileValue = i_pController->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LocalFileName" ) ) );
if( pFileValue )
{
@@ -538,7 +536,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
pFileValue->Value >>= aFile;
if( aFile.getLength() )
{
- mbPrintFile = TRUE;
+ mbPrintFile = sal_True;
maPrintFile = aFile;
bSinglePrintJobs = sal_False;
}
@@ -547,14 +545,15 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
XubString* pPrintFile = NULL;
if ( mbPrintFile )
pPrintFile = &maPrintFile;
+ mpPrinterOptions->ReadFromConfig( mbPrintFile );
maJobName = i_rJobName;
mnCurPage = 1;
mnCurPrintPage = 1;
- mbPrinting = TRUE;
- if( ImplGetSVData()->maGDIData.mbPrinterPullModel )
+ mbPrinting = sal_True;
+ if( GetCapabilities( PRINTER_CAPABILITIES_USEPULLMODEL ) )
{
- mbJobActive = TRUE;
+ mbJobActive = sal_True;
// sallayer does all necessary page printing
// and also handles showing a dialog
// that also means it must call jobStarted when the dialog is finished
@@ -575,7 +574,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
pSVData->mpDefInst->DestroyPrinter( mpPrinter );
mnCurPage = 0;
mnCurPrintPage = 0;
- mbPrinting = FALSE;
+ mbPrinting = sal_False;
mpPrinter = NULL;
return false;
@@ -616,7 +615,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
i_pController->isDirectPrint(),
maJobSetup.ImplGetConstData() ) )
{
- mbJobActive = TRUE;
+ mbJobActive = sal_True;
i_pController->createProgressDialog();
int nPages = i_pController->getFilteredPageCount();
for( int nOuterIteration = 0; nOuterIteration < nOuterRepeatCount && ! bAborted; nOuterIteration++ )
@@ -653,7 +652,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
maJobName = i_rJobName;
mnCurPage = 1;
mnCurPrintPage = 1;
- mbPrinting = TRUE;
+ mbPrinting = sal_True;
}
else
bError = true;
@@ -674,7 +673,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
pSVData->mpDefInst->DestroyPrinter( mpPrinter );
mnCurPage = 0;
mnCurPrintPage = 0;
- mbPrinting = FALSE;
+ mbPrinting = sal_False;
mpPrinter = NULL;
return false;
@@ -727,6 +726,13 @@ void PrinterController::setPrinter( const boost::shared_ptr<Printer>& i_rPrinter
mpImplData->mnFixedPaperBin = -1;
}
+void PrinterController:: resetPrinterOptions( bool i_bFileOutput )
+{
+ PrinterOptions aOpt;
+ aOpt.ReadFromConfig( i_bFileOutput );
+ mpImplData->mpPrinter->SetPrinterOptions( aOpt );
+}
+
bool PrinterController::setupPrinter( Window* i_pParent )
{
bool bRet = false;
@@ -735,7 +741,7 @@ bool PrinterController::setupPrinter( Window* i_pParent )
// get old data
Size aPaperSize( mpImplData->mpPrinter->PixelToLogic(
mpImplData->mpPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) );
- USHORT nPaperBin = mpImplData->mpPrinter->GetPaperBin();
+ sal_uInt16 nPaperBin = mpImplData->mpPrinter->GetPaperBin();
// call driver setup
bRet = mpImplData->mpPrinter->Setup( i_pParent );
@@ -744,7 +750,7 @@ bool PrinterController::setupPrinter( Window* i_pParent )
// was papersize or bin overridden ? if so we need to take action
Size aNewPaperSize( mpImplData->mpPrinter->PixelToLogic(
mpImplData->mpPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) );
- USHORT nNewPaperBin = mpImplData->mpPrinter->GetPaperBin();
+ sal_uInt16 nNewPaperBin = mpImplData->mpPrinter->GetPaperBin();
if( aNewPaperSize != aPaperSize || nNewPaperBin != nPaperBin )
{
mpImplData->maFixedPageSize = aNewPaperSize;
@@ -761,7 +767,7 @@ bool PrinterController::setupPrinter( Window* i_pParent )
return bRet;
}
-PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( const Sequence< PropertyValue >& i_rProps )
+PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( const Sequence< PropertyValue >& i_rProps, bool bNoNUP )
{
PrinterController::PageSize aPageSize;
aPageSize.aSize = mpPrinter->GetPaperSize();
@@ -796,7 +802,7 @@ PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( cons
if( aSetSize.Width && aSetSize.Height )
{
Size aSetPaperSize( aSetSize.Width, aSetSize.Height );
- Size aRealPaperSize( getRealPaperSize( aSetPaperSize ) );
+ Size aRealPaperSize( getRealPaperSize( aSetPaperSize, bNoNUP ) );
if( aRealPaperSize != aCurSize )
aIsSize = aSetSize;
}
@@ -806,7 +812,7 @@ PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( cons
aPageSize.aSize.Width() = aIsSize.Width;
aPageSize.aSize.Height() = aIsSize.Height;
- Size aRealPaperSize( getRealPaperSize( aPageSize.aSize ) );
+ Size aRealPaperSize( getRealPaperSize( aPageSize.aSize, bNoNUP ) );
if( aRealPaperSize != aCurSize )
mpPrinter->SetPaperSizeUser( aRealPaperSize, ! isFixedPageSize() );
}
@@ -872,12 +878,12 @@ PrinterController::PageSize PrinterController::getPageFile( int i_nUnfilteredPag
mpImplData->mpPrinter->SetMapMode( aMapMode );
// modify job setup if necessary
- PrinterController::PageSize aPageSize = mpImplData->modifyJobSetup( aPageParm );
+ PrinterController::PageSize aPageSize = mpImplData->modifyJobSetup( aPageParm, true );
o_rMtf.SetPrefSize( aPageSize.aSize );
o_rMtf.SetPrefMapMode( aMapMode );
- mpImplData->mpPrinter->EnableOutput( FALSE );
+ mpImplData->mpPrinter->EnableOutput( sal_False );
o_rMtf.Record( mpImplData->mpPrinter.get() );
@@ -906,7 +912,7 @@ static void appendSubPage( GDIMetaFile& o_rMtf, const Rectangle& i_rClipRect, GD
o_rMtf.AddAction( new MetaPushAction( PUSH_ALL ) );
// clip to page rect
- o_rMtf.AddAction( new MetaClipRegionAction( Region( i_rClipRect ), TRUE ) );
+ o_rMtf.AddAction( new MetaClipRegionAction( Region( i_rClipRect ), sal_True ) );
// append the subpage
io_rSubPage.WindStart();
@@ -923,8 +929,8 @@ static void appendSubPage( GDIMetaFile& o_rMtf, const Rectangle& i_rClipRect, GD
o_rMtf.AddAction( new MetaMapModeAction( MapMode( MAP_100TH_MM ) ) );
Rectangle aBorderRect( i_rClipRect );
- o_rMtf.AddAction( new MetaLineColorAction( Color( COL_BLACK ), TRUE ) );
- o_rMtf.AddAction( new MetaFillColorAction( Color( COL_TRANSPARENT ), FALSE ) );
+ o_rMtf.AddAction( new MetaLineColorAction( Color( COL_BLACK ), sal_True ) );
+ o_rMtf.AddAction( new MetaFillColorAction( Color( COL_TRANSPARENT ), sal_False ) );
o_rMtf.AddAction( new MetaRectAction( aBorderRect ) );
// restore gstate
@@ -954,7 +960,7 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte
rMPS.nTopMargin == 0 && rMPS.nBottomMargin == 0 )
{
PrinterController::PageSize aPageSize = getPageFile( i_nFilteredPage, o_rMtf, i_bMayUseCache );
- Size aPaperSize = mpImplData->getRealPaperSize( aPageSize.aSize );
+ Size aPaperSize = mpImplData->getRealPaperSize( aPageSize.aSize, true );
mpImplData->mpPrinter->SetMapMode( MapMode( MAP_100TH_MM ) );
mpImplData->mpPrinter->SetPaperSizeUser( aPaperSize, ! mpImplData->isFixedPageSize() );
if( aPaperSize != aPageSize.aSize )
@@ -976,7 +982,7 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte
sal_Bool bIsLastPage = mpImplData->mbLastPage;
mpImplData->mbLastPage = sal_False;
- Size aPaperSize( mpImplData->getRealPaperSize( mpImplData->maMultiPage.aPaperSize ) );
+ Size aPaperSize( mpImplData->getRealPaperSize( mpImplData->maMultiPage.aPaperSize, false ) );
// multi page area: page size minus margins + one time spacing right and down
// the added spacing is so each subpage can be calculated including its spacing
@@ -1025,6 +1031,14 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte
nCellX = (nSubPage / rMPS.nRows);
nCellY = (nSubPage % rMPS.nRows);
break;
+ case PrinterController::RLTB:
+ nCellX = rMPS.nColumns - 1 - (nSubPage % rMPS.nColumns);
+ nCellY = (nSubPage / rMPS.nColumns);
+ break;
+ case PrinterController::TBRL:
+ nCellX = rMPS.nColumns - 1 - (nSubPage / rMPS.nRows);
+ nCellY = (nSubPage % rMPS.nRows);
+ break;
}
// scale the metafile down to a sub page size
double fScaleX = double(aSubPageSize.Width())/double(aPageSize.aSize.Width());
@@ -1067,9 +1081,9 @@ int PrinterController::getFilteredPageCount()
return (getPageCountProtected() * mpImplData->maMultiPage.nRepeat + (nDiv-1)) / nDiv;
}
-ULONG PrinterController::removeTransparencies( GDIMetaFile& i_rIn, GDIMetaFile& o_rOut )
+sal_uLong PrinterController::removeTransparencies( GDIMetaFile& i_rIn, GDIMetaFile& o_rOut )
{
- ULONG nRestoreDrawMode = mpImplData->mpPrinter->GetDrawMode();
+ sal_uLong nRestoreDrawMode = mpImplData->mpPrinter->GetDrawMode();
sal_Int32 nMaxBmpDPIX = mpImplData->mpPrinter->ImplGetDPIX();
sal_Int32 nMaxBmpDPIY = mpImplData->mpPrinter->ImplGetDPIY();
@@ -1167,9 +1181,9 @@ void PrinterController::printFilteredPage( int i_nPage )
}
GDIMetaFile aCleanedFile;
- ULONG nRestoreDrawMode = removeTransparencies( aPageFile, aCleanedFile );
+ sal_uLong nRestoreDrawMode = removeTransparencies( aPageFile, aCleanedFile );
- mpImplData->mpPrinter->EnableOutput( TRUE );
+ mpImplData->mpPrinter->EnableOutput( sal_True );
// actually print the page
mpImplData->mpPrinter->ImplStartPage();
@@ -1334,6 +1348,7 @@ void PrinterController::setUIOptions( const Sequence< beans::PropertyValue >& i_
bool bHaveProperty = false;
rtl::OUString aPropName;
vcl::ImplPrinterControllerData::ControlDependency aDep;
+ Sequence< sal_Bool > aChoicesDisabled;
for( int n = 0; n < aOptProp.getLength(); n++ )
{
const beans::PropertyValue& rEntry( aOptProp[ n ] );
@@ -1361,6 +1376,10 @@ void PrinterController::setUIOptions( const Sequence< beans::PropertyValue >& i_
{
rEntry.Value >>= aDep.mnDependsOnEntry;
}
+ else if( rEntry.Name.equalsAscii( "ChoicesDisabled" ) )
+ {
+ rEntry.Value >>= aChoicesDisabled;
+ }
}
if( bHaveProperty )
{
@@ -1373,6 +1392,8 @@ void PrinterController::setUIOptions( const Sequence< beans::PropertyValue >& i_
}
if( aDep.maDependsOnName.getLength() > 0 )
mpImplData->maControlDependencies[ aPropName ] = aDep;
+ if( aChoicesDisabled.getLength() > 0 )
+ mpImplData->maChoiceDisableMap[ aPropName ] = aChoicesDisabled;
}
}
}
@@ -1448,6 +1469,20 @@ bool PrinterController::isUIOptionEnabled( const rtl::OUString& i_rProperty ) co
return bEnabled;
}
+bool PrinterController::isUIChoiceEnabled( const rtl::OUString& i_rProperty, sal_Int32 i_nValue ) const
+{
+ bool bEnabled = true;
+ ImplPrinterControllerData::ChoiceDisableMap::const_iterator it =
+ mpImplData->maChoiceDisableMap.find( i_rProperty );
+ if(it != mpImplData->maChoiceDisableMap.end() )
+ {
+ const Sequence< sal_Bool >& rDisabled( it->second );
+ if( i_nValue >= 0 && i_nValue < rDisabled.getLength() )
+ bEnabled = ! rDisabled[i_nValue];
+ }
+ return bEnabled;
+}
+
rtl::OUString PrinterController::getDependency( const rtl::OUString& i_rProperty ) const
{
rtl::OUString aDependency;
@@ -1560,7 +1595,7 @@ void PrinterController::pushPropertiesToPrinter()
pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Collate" ) ) );
if( pVal )
pVal->Value >>= bCollate;
- mpImplData->mpPrinter->SetCopyCount( static_cast<USHORT>(nCopyCount), bCollate );
+ mpImplData->mpPrinter->SetCopyCount( static_cast<sal_uInt16>(nCopyCount), bCollate );
// duplex mode
pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DuplexMode" ) ) );
@@ -1694,7 +1729,7 @@ void PrinterOptionsHelper::appendPrintUIOptions( uno::Sequence< beans::PropertyV
}
Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
- const Sequence< rtl::OUString >& i_rHelpTexts,
+ const Sequence< rtl::OUString >& i_rHelpIds,
const rtl::OUString& i_rType,
const PropertyValue* i_pVal,
const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
@@ -1703,7 +1738,7 @@ Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
sal_Int32 nElements =
1 // ControlType
+ (i_rTitle.getLength() ? 1 : 0) // Text
- + (i_rHelpTexts.getLength() ? 1 : 0) // HelpText
+ + (i_rHelpIds.getLength() ? 1 : 0) // HelpId
+ (i_pVal ? 1 : 0) // Property
+ i_rControlOptions.maAddProps.getLength() // additional props
+ (i_rControlOptions.maGroupHint.getLength() ? 1 : 0) // grouping
@@ -1726,10 +1761,10 @@ Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
aCtrl[nUsed ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ) );
aCtrl[nUsed++].Value = makeAny( i_rTitle );
}
- if( i_rHelpTexts.getLength() )
+ if( i_rHelpIds.getLength() )
{
- aCtrl[nUsed ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpText" ) );
- aCtrl[nUsed++].Value = makeAny( i_rHelpTexts );
+ aCtrl[nUsed ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpId" ) );
+ aCtrl[nUsed++].Value = makeAny( i_rHelpIds );
}
aCtrl[nUsed ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ControlType" ) );
aCtrl[nUsed++].Value = makeAny( i_rType );
@@ -1778,74 +1813,80 @@ Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
return makeAny( aCtrl );
}
-Any PrinterOptionsHelper::getGroupControlOpt( const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpText )
+Any PrinterOptionsHelper::getGroupControlOpt( const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpId )
{
- Sequence< rtl::OUString > aHelpText;
- if( i_rHelpText.getLength() > 0 )
+ Sequence< rtl::OUString > aHelpId;
+ if( i_rHelpId.getLength() > 0 )
{
- aHelpText.realloc( 1 );
- *aHelpText.getArray() = i_rHelpText;
+ aHelpId.realloc( 1 );
+ *aHelpId.getArray() = i_rHelpId;
}
- return getUIControlOpt( i_rTitle, aHelpText, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Group" ) ) );
+ return getUIControlOpt( i_rTitle, aHelpId, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Group" ) ) );
}
Any PrinterOptionsHelper::getSubgroupControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
)
{
- Sequence< rtl::OUString > aHelpText;
- if( i_rHelpText.getLength() > 0 )
+ Sequence< rtl::OUString > aHelpId;
+ if( i_rHelpId.getLength() > 0 )
{
- aHelpText.realloc( 1 );
- *aHelpText.getArray() = i_rHelpText;
+ aHelpId.realloc( 1 );
+ *aHelpId.getArray() = i_rHelpId;
}
- return getUIControlOpt( i_rTitle, aHelpText, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Subgroup" ) ),
+ return getUIControlOpt( i_rTitle, aHelpId, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Subgroup" ) ),
NULL, i_rControlOptions );
}
Any PrinterOptionsHelper::getBoolControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const rtl::OUString& i_rProperty,
sal_Bool i_bValue,
const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
)
{
- Sequence< rtl::OUString > aHelpText;
- if( i_rHelpText.getLength() > 0 )
+ Sequence< rtl::OUString > aHelpId;
+ if( i_rHelpId.getLength() > 0 )
{
- aHelpText.realloc( 1 );
- *aHelpText.getArray() = i_rHelpText;
+ aHelpId.realloc( 1 );
+ *aHelpId.getArray() = i_rHelpId;
}
PropertyValue aVal;
aVal.Name = i_rProperty;
aVal.Value = makeAny( i_bValue );
- return getUIControlOpt( i_rTitle, aHelpText, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Bool" ) ), &aVal, i_rControlOptions );
+ return getUIControlOpt( i_rTitle, aHelpId, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Bool" ) ), &aVal, i_rControlOptions );
}
Any PrinterOptionsHelper::getChoiceControlOpt( const rtl::OUString& i_rTitle,
- const Sequence< rtl::OUString >& i_rHelpText,
+ const Sequence< rtl::OUString >& i_rHelpId,
const rtl::OUString& i_rProperty,
const Sequence< rtl::OUString >& i_rChoices,
sal_Int32 i_nValue,
const rtl::OUString& i_rType,
+ const Sequence< sal_Bool >& i_rDisabledChoices,
const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
)
{
UIControlOptions aOpt( i_rControlOptions );
sal_Int32 nUsed = aOpt.maAddProps.getLength();
- aOpt.maAddProps.realloc( nUsed + 1 );
+ aOpt.maAddProps.realloc( nUsed + 1 + (i_rDisabledChoices.getLength() ? 1 : 0) );
aOpt.maAddProps[nUsed].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Choices" ) );
aOpt.maAddProps[nUsed].Value = makeAny( i_rChoices );
+ if( i_rDisabledChoices.getLength() )
+ {
+ aOpt.maAddProps[nUsed+1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ChoicesDisabled" ) );
+ aOpt.maAddProps[nUsed+1].Value = makeAny( i_rDisabledChoices );
+ }
PropertyValue aVal;
aVal.Name = i_rProperty;
aVal.Value = makeAny( i_nValue );
- return getUIControlOpt( i_rTitle, i_rHelpText, i_rType, &aVal, aOpt );
+ return getUIControlOpt( i_rTitle, i_rHelpId, i_rType, &aVal, aOpt );
}
Any PrinterOptionsHelper::getRangeControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const rtl::OUString& i_rProperty,
sal_Int32 i_nValue,
sal_Int32 i_nMinValue,
@@ -1864,17 +1905,17 @@ Any PrinterOptionsHelper::getRangeControlOpt( const rtl::OUString& i_rTitle,
aOpt.maAddProps[nUsed++].Value = makeAny( i_nMaxValue );
}
- Sequence< rtl::OUString > aHelpText;
- if( i_rHelpText.getLength() > 0 )
+ Sequence< rtl::OUString > aHelpId;
+ if( i_rHelpId.getLength() > 0 )
{
- aHelpText.realloc( 1 );
- *aHelpText.getArray() = i_rHelpText;
+ aHelpId.realloc( 1 );
+ *aHelpId.getArray() = i_rHelpId;
}
PropertyValue aVal;
aVal.Name = i_rProperty;
aVal.Value = makeAny( i_nValue );
return getUIControlOpt( i_rTitle,
- aHelpText,
+ aHelpId,
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Range" ) ),
&aVal,
aOpt
@@ -1882,23 +1923,23 @@ Any PrinterOptionsHelper::getRangeControlOpt( const rtl::OUString& i_rTitle,
}
Any PrinterOptionsHelper::getEditControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const rtl::OUString& i_rProperty,
const rtl::OUString& i_rValue,
const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
)
{
- Sequence< rtl::OUString > aHelpText;
- if( i_rHelpText.getLength() > 0 )
+ Sequence< rtl::OUString > aHelpId;
+ if( i_rHelpId.getLength() > 0 )
{
- aHelpText.realloc( 1 );
- *aHelpText.getArray() = i_rHelpText;
+ aHelpId.realloc( 1 );
+ *aHelpId.getArray() = i_rHelpId;
}
PropertyValue aVal;
aVal.Name = i_rProperty;
aVal.Value = makeAny( i_rValue );
return getUIControlOpt( i_rTitle,
- aHelpText,
+ aHelpId,
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Edit" ) ),
&aVal,
i_rControlOptions
diff --git a/vcl/source/gdi/regband.cxx b/vcl/source/gdi/regband.cxx
index e22b37c0970c..21c82cd51f3a 100644
--- a/vcl/source/gdi/regband.cxx
+++ b/vcl/source/gdi/regband.cxx
@@ -64,7 +64,7 @@ ImplRegionBand::ImplRegionBand( long nTop, long nBottom )
mpPrevBand = NULL;
mpFirstSep = NULL;
mpFirstBandPoint = NULL;
- mbTouched = FALSE;
+ mbTouched = sal_False;
}
// -----------------------------------------------------------------------
@@ -213,8 +213,8 @@ void ImplRegionBand::ProcessPoints()
// generate separations from lines and process union with existing
// separations
-BOOL ImplRegionBand::InsertPoint( long nX, long nLineId,
- BOOL bEndPoint, LineType eLineType )
+sal_Bool ImplRegionBand::InsertPoint( long nX, long nLineId,
+ sal_Bool bEndPoint, LineType eLineType )
{
if ( !mpFirstBandPoint )
{
@@ -224,7 +224,7 @@ BOOL ImplRegionBand::InsertPoint( long nX, long nLineId,
mpFirstBandPoint->mbEndPoint = bEndPoint;
mpFirstBandPoint->meLineType = eLineType;
mpFirstBandPoint->mpNextBandPoint = NULL;
- return TRUE;
+ return sal_True;
}
// look if line allready touched the band
@@ -243,8 +243,8 @@ BOOL ImplRegionBand::InsertPoint( long nX, long nLineId,
{
// if we've only got one point => replace first point
pRegionBandPoint->mnX = nX;
- pRegionBandPoint->mbEndPoint = TRUE;
- return TRUE;
+ pRegionBandPoint->mbEndPoint = sal_True;
+ return sal_True;
}
else
{
@@ -268,7 +268,7 @@ BOOL ImplRegionBand::InsertPoint( long nX, long nLineId,
}
}
else
- return FALSE;
+ return sal_False;
}
// use next element
@@ -299,7 +299,7 @@ BOOL ImplRegionBand::InsertPoint( long nX, long nLineId,
else
pLastTestedRegionBandPoint->mpNextBandPoint = pNewRegionBandPoint;
- return TRUE;
+ return sal_True;
}
// use next element
@@ -318,7 +318,7 @@ BOOL ImplRegionBand::InsertPoint( long nX, long nLineId,
// connections to the new point
pLastTestedRegionBandPoint->mpNextBandPoint = pNewRegionBandPoint;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -352,7 +352,7 @@ void ImplRegionBand::ScaleX( double fHorzScale )
//
// combine overlaping sparations
-BOOL ImplRegionBand::OptimizeBand()
+sal_Bool ImplRegionBand::OptimizeBand()
{
ImplRegionBandSep* pPrevSep = 0;
ImplRegionBandSep* pSep = mpFirstSep;
@@ -390,7 +390,7 @@ BOOL ImplRegionBand::OptimizeBand()
pSep = pSep->mpNextSep;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -405,7 +405,7 @@ void ImplRegionBand::Union( long nXLeft, long nXRight )
mpFirstSep = new ImplRegionBandSep;
mpFirstSep->mnXLeft = nXLeft;
mpFirstSep->mnXRight = nXRight;
- mpFirstSep->mbRemoved = FALSE;
+ mpFirstSep->mbRemoved = sal_False;
mpFirstSep->mpNextSep = NULL;
return;
}
@@ -426,7 +426,7 @@ void ImplRegionBand::Union( long nXLeft, long nXRight )
pNewSep = new ImplRegionBandSep;
pNewSep->mnXLeft = nXLeft;
pNewSep->mnXRight = nXRight;
- pNewSep->mbRemoved = FALSE;
+ pNewSep->mbRemoved = sal_False;
pNewSep->mpNextSep = pSep;
if ( pSep == mpFirstSep )
@@ -453,7 +453,7 @@ void ImplRegionBand::Union( long nXLeft, long nXRight )
pNewSep = new ImplRegionBandSep;
pNewSep->mnXLeft = nXLeft;
pNewSep->mnXRight = nXRight;
- pNewSep->mbRemoved = FALSE;
+ pNewSep->mbRemoved = sal_False;
pSep->mpNextSep = pNewSep;
pNewSep->mpNextSep = NULL;
@@ -474,7 +474,7 @@ void ImplRegionBand::Intersect( long nXLeft, long nXRight )
DBG_ASSERT( nXLeft <= nXRight, "ImplRegionBand::Intersect(): nxLeft > nXRight" );
// band has been touched
- mbTouched = TRUE;
+ mbTouched = sal_True;
// band empty? -> nothing to do
if ( !mpFirstSep )
@@ -487,7 +487,7 @@ void ImplRegionBand::Intersect( long nXLeft, long nXRight )
// new separation completly outside? -> remove separation
if ( (nXRight < pSep->mnXLeft) || (nXLeft > pSep->mnXRight) )
// will be removed from the optimizer
- pSep->mbRemoved = TRUE;
+ pSep->mbRemoved = sal_True;
// new separation overlaping from left? -> reduce right boundary
if ( (nXLeft <= pSep->mnXLeft) &&
@@ -521,7 +521,7 @@ void ImplRegionBand::Exclude( long nXLeft, long nXRight )
DBG_ASSERT( nXLeft <= nXRight, "ImplRegionBand::Exclude(): nxLeft > nXRight" );
// band has been touched
- mbTouched = TRUE;
+ mbTouched = sal_True;
// band empty? -> nothing to do
if ( !mpFirstSep )
@@ -533,14 +533,14 @@ void ImplRegionBand::Exclude( long nXLeft, long nXRight )
ImplRegionBandSep* pSep = mpFirstSep;
while ( pSep )
{
- BOOL bSepProcessed = FALSE;
+ sal_Bool bSepProcessed = sal_False;
// new separation completely overlapping? -> remove separation
if ( (nXLeft <= pSep->mnXLeft) && (nXRight >= pSep->mnXRight) )
{
// will be removed from the optimizer
- pSep->mbRemoved = TRUE;
- bSepProcessed = TRUE;
+ pSep->mbRemoved = sal_True;
+ bSepProcessed = sal_True;
}
// new separation overlaping from left? -> reduce boundary
@@ -549,7 +549,7 @@ void ImplRegionBand::Exclude( long nXLeft, long nXRight )
if ( (nXRight >= pSep->mnXLeft) && (nXLeft <= pSep->mnXLeft) )
{
pSep->mnXLeft = nXRight+1;
- bSepProcessed = TRUE;
+ bSepProcessed = sal_True;
}
}
@@ -559,7 +559,7 @@ void ImplRegionBand::Exclude( long nXLeft, long nXRight )
if ( (nXLeft <= pSep->mnXRight) && (nXRight > pSep->mnXRight) )
{
pSep->mnXRight = nXLeft-1;
- bSepProcessed = TRUE;
+ bSepProcessed = sal_True;
}
}
@@ -572,7 +572,7 @@ void ImplRegionBand::Exclude( long nXLeft, long nXRight )
pNewSep = new ImplRegionBandSep;
pNewSep->mnXLeft = pSep->mnXLeft;
pNewSep->mnXRight = nXLeft-1;
- pNewSep->mbRemoved = FALSE;
+ pNewSep->mbRemoved = sal_False;
pSep->mnXLeft = nXRight+1;
@@ -652,7 +652,7 @@ void ImplRegionBand::XOr( long nXLeft, long nXRight )
mpFirstSep = new ImplRegionBandSep;
mpFirstSep->mnXLeft = nXLeft;
mpFirstSep->mnXRight = nXRight;
- mpFirstSep->mbRemoved = FALSE;
+ mpFirstSep->mbRemoved = sal_False;
mpFirstSep->mpNextSep = NULL;
return;
}
@@ -681,7 +681,7 @@ void ImplRegionBand::XOr( long nXLeft, long nXRight )
pNewSep->mnXLeft = nXLeft;
pNewSep->mnXRight = nXRight;
pNewSep->mpNextSep = pSep;
- pNewSep->mbRemoved = FALSE;
+ pNewSep->mbRemoved = sal_False;
// connections from the new separation
pNewSep->mpNextSep = pSep;
@@ -697,7 +697,7 @@ void ImplRegionBand::XOr( long nXLeft, long nXRight )
else if( nXLeft == nOldLeft && nXRight == nOldRight )
{
// #3
- pSep->mbRemoved = TRUE;
+ pSep->mbRemoved = sal_True;
pPrevSep = NULL; // do not run accidentally into the "right" case when breaking the loop
break;
}
@@ -730,7 +730,7 @@ void ImplRegionBand::XOr( long nXLeft, long nXRight )
// cannot break here, simply mark segment as removed,
// and go on with adapted nXLeft/nXRight
- pSep->mbRemoved = TRUE;
+ pSep->mbRemoved = sal_True;
}
else
{
@@ -810,7 +810,7 @@ void ImplRegionBand::XOr( long nXLeft, long nXRight )
pNewSep->mnXLeft = nXLeft;
pNewSep->mnXRight = nXRight;
pNewSep->mpNextSep = pSep->mpNextSep;
- pNewSep->mbRemoved = FALSE;
+ pNewSep->mbRemoved = sal_False;
// connections from the new separation
pSep->mpNextSep = pNewSep;
@@ -832,7 +832,7 @@ void ImplRegionBand::XOr( long nXLeft, long nXRight )
pNewSep->mnXLeft = nXLeft;
pNewSep->mnXRight = nXRight;
pNewSep->mpNextSep = NULL;
- pNewSep->mbRemoved = FALSE;
+ pNewSep->mbRemoved = sal_False;
// connections from the new separation
pPrevSep->mpNextSep = pNewSep;
@@ -843,50 +843,50 @@ void ImplRegionBand::XOr( long nXLeft, long nXRight )
// -----------------------------------------------------------------------
-BOOL ImplRegionBand::IsInside( long nX )
+sal_Bool ImplRegionBand::IsInside( long nX )
{
ImplRegionBandSep* pSep = mpFirstSep;
while ( pSep )
{
if ( (pSep->mnXLeft <= nX) && (pSep->mnXRight >= nX) )
- return TRUE;
+ return sal_True;
pSep = pSep->mpNextSep;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL ImplRegionBand::IsOver( long nLeft, long nRight )
+sal_Bool ImplRegionBand::IsOver( long nLeft, long nRight )
{
ImplRegionBandSep* pSep = mpFirstSep;
while ( pSep )
{
if ( (pSep->mnXLeft < nRight) && (pSep->mnXRight > nLeft) )
- return TRUE;
+ return sal_True;
pSep = pSep->mpNextSep;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL ImplRegionBand::IsInside( long nLeft, long nRight )
+sal_Bool ImplRegionBand::IsInside( long nLeft, long nRight )
{
ImplRegionBandSep* pSep = mpFirstSep;
while ( pSep )
{
if ( (pSep->mnXLeft >= nLeft) && (nRight <= pSep->mnXRight) )
- return TRUE;
+ return sal_True;
pSep = pSep->mpNextSep;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -913,7 +913,7 @@ long ImplRegionBand::GetXRightBoundary() const
// -----------------------------------------------------------------------
-BOOL ImplRegionBand::operator==( const ImplRegionBand& rRegionBand ) const
+sal_Bool ImplRegionBand::operator==( const ImplRegionBand& rRegionBand ) const
{
ImplRegionBandSep* pOwnRectBandSep = mpFirstSep;
ImplRegionBandSep* pSecondRectBandSep = rRegionBand.mpFirstSep;
@@ -923,12 +923,12 @@ BOOL ImplRegionBand::operator==( const ImplRegionBand& rRegionBand ) const
long nOwnXLeft = pOwnRectBandSep->mnXLeft;
long nSecondXLeft = pSecondRectBandSep->mnXLeft;
if ( nOwnXLeft != nSecondXLeft )
- return FALSE;
+ return sal_False;
long nOwnXRight = pOwnRectBandSep->mnXRight;
long nSecondXRight = pSecondRectBandSep->mnXRight;
if ( nOwnXRight != nSecondXRight )
- return FALSE;
+ return sal_False;
// get next separation from current band
pOwnRectBandSep = pOwnRectBandSep->mpNextSep;
@@ -939,9 +939,9 @@ BOOL ImplRegionBand::operator==( const ImplRegionBand& rRegionBand ) const
// differnt number of separations?
if ( pOwnRectBandSep || pSecondRectBandSep )
- return FALSE;
+ return sal_False;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx
index a00795e2e2ce..480a17a9f88b 100644..100755
--- a/vcl/source/gdi/region.cxx
+++ b/vcl/source/gdi/region.cxx
@@ -41,6 +41,8 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/polygon/b2dpolygonclipper.hxx>
+#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
#include <basegfx/range/b2drange.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
@@ -79,19 +81,19 @@ namespace {
bool ImplIsPolygonRectilinear (const PolyPolygon& rPolyPoly)
{
// Iterate over all polygons.
- const USHORT nPolyCount = rPolyPoly.Count();
- for (USHORT nPoly = 0; nPoly < nPolyCount; ++nPoly)
+ const sal_uInt16 nPolyCount = rPolyPoly.Count();
+ for (sal_uInt16 nPoly = 0; nPoly < nPolyCount; ++nPoly)
{
const Polygon& aPoly = rPolyPoly.GetObject(nPoly);
// Iterate over all edges of the current polygon.
- const USHORT nSize = aPoly.GetSize();
+ const sal_uInt16 nSize = aPoly.GetSize();
if (nSize < 2)
continue;
Point aPoint (aPoly.GetPoint(0));
const Point aLastPoint (aPoint);
- for (USHORT nPoint = 1; nPoint < nSize; ++nPoint)
+ for (sal_uInt16 nPoint = 1; nPoint < nSize; ++nPoint)
{
const Point aNextPoint (aPoly.GetPoint(nPoint));
// When there is at least one edge that is neither vertical nor
@@ -183,20 +185,20 @@ ImplRegion* ImplRectilinearPolygonToBands (const PolyPolygon& rPolyPoly)
long nLineId = 0L;
// Iterate over all polygons.
- const USHORT nPolyCount = rPolyPoly.Count();
- for (USHORT nPoly = 0; nPoly < nPolyCount; ++nPoly)
+ const sal_uInt16 nPolyCount = rPolyPoly.Count();
+ for (sal_uInt16 nPoly = 0; nPoly < nPolyCount; ++nPoly)
{
const Polygon& aPoly = rPolyPoly.GetObject(nPoly);
// Iterate over all edges of the current polygon.
- const USHORT nSize = aPoly.GetSize();
+ const sal_uInt16 nSize = aPoly.GetSize();
if (nSize < 2)
continue;
// Avoid fetching every point twice (each point is the start point
// of one and the end point of another edge.)
Point aStart (aPoly.GetPoint(0));
Point aEnd;
- for (USHORT nPoint = 1; nPoint <= nSize; ++nPoint, aStart=aEnd)
+ for (sal_uInt16 nPoint = 1; nPoint <= nSize; ++nPoint, aStart=aEnd)
{
// We take the implicit closing edge into account by mapping
// index nSize to 0.
@@ -262,7 +264,7 @@ ImplRegion* ImplRectilinearPolygonToBands (const PolyPolygon& rPolyPoly)
// Add the x-value as point to all bands in the nTop->nBottom range.
for (pBand=pTopBand; pBand!=NULL&&pBand->mnYTop<=nBottom; pBand=pBand->mpNextBand)
- pBand->InsertPoint(aStart.X(), nLineId++, TRUE, eLineType);
+ pBand->InsertPoint(aStart.X(), nLineId++, sal_True, eLineType);
}
}
@@ -286,19 +288,19 @@ ImplRegion* ImplGeneralPolygonToBands (
pImplRegion->CreateBandRange( rPolygonBoundingBox.Top(), rPolygonBoundingBox.Bottom() );
// insert polygons
- const USHORT nPolyCount = rPolyPoly.Count();
- for ( USHORT nPoly = 0; nPoly < nPolyCount; nPoly++ )
+ const sal_uInt16 nPolyCount = rPolyPoly.Count();
+ for ( sal_uInt16 nPoly = 0; nPoly < nPolyCount; nPoly++ )
{
// get reference to current polygon
const Polygon& aPoly = rPolyPoly.GetObject( nPoly );
- const USHORT nSize = aPoly.GetSize();
+ const sal_uInt16 nSize = aPoly.GetSize();
// not enough points ( <= 2 )? -> nothing to do!
if ( nSize <= 2 )
continue;
// band the polygon
- for ( USHORT nPoint = 1; nPoint < nSize; nPoint++ )
+ for ( sal_uInt16 nPoint = 1; nPoint < nSize; nPoint++ )
pImplRegion->InsertLine( aPoly.GetPoint(nPoint-1), aPoly.GetPoint(nPoint), nLineID++ );
// close polygon with line from first point to last point, if neccesary
@@ -338,7 +340,7 @@ const char* ImplDbgTestRegion( const void* pObj )
if ( (pImplRegion != &aImplEmptyRegion) && (pImplRegion != &aImplNullRegion) )
{
- ULONG nCount = 0;
+ sal_uLong nCount = 0;
const ImplRegionBand* pBand = pImplRegion->ImplGetFirstRegionBand();
while ( pBand )
{
@@ -536,14 +538,14 @@ void ImplRegion::CreateBandRange( long nYTop, long nYBottom )
// -----------------------------------------------------------------------
-BOOL ImplRegion::InsertLine( const Point& rStartPt, const Point& rEndPt,
+sal_Bool ImplRegion::InsertLine( const Point& rStartPt, const Point& rEndPt,
long nLineId )
{
long nX, nY;
// lines consisting of a single point do not interest here
if ( rStartPt == rEndPt )
- return TRUE;
+ return sal_True;
LineType eLineType = (rStartPt.Y() > rEndPt.Y()) ? LINE_DESCENDING : LINE_ASCENDING;
if ( rStartPt.X() == rEndPt.X() )
@@ -620,25 +622,25 @@ BOOL ImplRegion::InsertLine( const Point& rStartPt, const Point& rEndPt,
}
// last point
- InsertPoint( Point( nEndX, nEndY ), nLineId, TRUE, eLineType );
+ InsertPoint( Point( nEndX, nEndY ), nLineId, sal_True, eLineType );
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
//
// search for appropriate place for the new point
-BOOL ImplRegion::InsertPoint( const Point &rPoint, long nLineID,
- BOOL bEndPoint, LineType eLineType )
+sal_Bool ImplRegion::InsertPoint( const Point &rPoint, long nLineID,
+ sal_Bool bEndPoint, LineType eLineType )
{
DBG_ASSERT( mpFirstBand != NULL, "ImplRegion::InsertPoint - no bands available!" );
if ( rPoint.Y() == mpLastCheckedBand->mnYTop )
{
mpLastCheckedBand->InsertPoint( rPoint.X(), nLineID, bEndPoint, eLineType );
- return TRUE;
+ return sal_True;
}
if ( rPoint.Y() > mpLastCheckedBand->mnYTop )
@@ -650,7 +652,7 @@ BOOL ImplRegion::InsertPoint( const Point &rPoint, long nLineID,
if ( rPoint.Y() == mpLastCheckedBand->mnYTop )
{
mpLastCheckedBand->InsertPoint( rPoint.X(), nLineID, bEndPoint, eLineType );
- return TRUE;
+ return sal_True;
}
mpLastCheckedBand = mpLastCheckedBand->mpNextBand;
@@ -667,7 +669,7 @@ BOOL ImplRegion::InsertPoint( const Point &rPoint, long nLineID,
if ( rPoint.Y() == mpLastCheckedBand->mnYTop )
{
mpLastCheckedBand->InsertPoint( rPoint.X(), nLineID, bEndPoint, eLineType );
- return TRUE;
+ return sal_True;
}
mpLastCheckedBand = mpLastCheckedBand->mpPrevBand;
@@ -681,7 +683,7 @@ BOOL ImplRegion::InsertPoint( const Point &rPoint, long nLineID,
// reinitialize pointer (should never be reached!)
mpLastCheckedBand = mpFirstBand;
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -699,9 +701,9 @@ void ImplRegion::InsertBands( long nTop, long nBottom )
}
// find/insert bands for the boundaries of the rectangle
- BOOL bTopBoundaryInserted = FALSE;
- BOOL bTop2BoundaryInserted = FALSE;
- BOOL bBottomBoundaryInserted = FALSE;
+ sal_Bool bTopBoundaryInserted = sal_False;
+ sal_Bool bTop2BoundaryInserted = sal_False;
+ sal_Bool bBottomBoundaryInserted = sal_False;
// special case: top boundary is above the first band
ImplRegionBand* pNewBand;
@@ -716,7 +718,7 @@ void ImplRegion::InsertBands( long nTop, long nBottom )
pNewBand->mpNextBand = mpFirstBand;
mpFirstBand = pNewBand;
- bTopBoundaryInserted = TRUE;
+ bTopBoundaryInserted = sal_True;
}
// insert band(s) into the list
@@ -760,13 +762,13 @@ void ImplRegion::InsertBands( long nTop, long nBottom )
//
// create new band and insert it into the list
-BOOL ImplRegion::InsertSingleBand( ImplRegionBand* pBand,
+sal_Bool ImplRegion::InsertSingleBand( ImplRegionBand* pBand,
long nYBandPosition )
{
// boundary already included in band with height 1? -> nothing to do!
if ( (pBand->mnYTop == pBand->mnYBottom) &&
(nYBandPosition == pBand->mnYTop) )
- return TRUE;
+ return sal_True;
// insert single height band on top?
ImplRegionBand* pNewBand;
@@ -781,7 +783,7 @@ BOOL ImplRegion::InsertSingleBand( ImplRegionBand* pBand,
pBand->mnYBottom = nYBandPosition;
pBand->mpNextBand = pNewBand;
- return TRUE;
+ return sal_True;
}
// top of new rectangle within the current band? -> insert new band and copy data
@@ -808,7 +810,7 @@ BOOL ImplRegion::InsertSingleBand( ImplRegionBand* pBand,
pBand->mnYBottom = nYBandPosition - 1;
pBand->mpNextBand = pNewBand;
- return TRUE;
+ return sal_True;
}
// create new band behind the current in the list
@@ -825,7 +827,7 @@ BOOL ImplRegion::InsertSingleBand( ImplRegionBand* pBand,
// append band to the list
pBand->mpNextBand = pNewBand;
- return TRUE;
+ return sal_True;
}
if ( nYBandPosition > pBand->mnYBottom )
@@ -835,11 +837,11 @@ BOOL ImplRegion::InsertSingleBand( ImplRegionBand* pBand,
// append band to the list
pBand->mpNextBand = pNewBand;
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
// ------------------------------------------------------------------------
@@ -980,7 +982,7 @@ void ImplRegion::XOr( long nLeft, long nTop, long nRight, long nBottom )
//
// remove empty bands
-BOOL ImplRegion::OptimizeBandList()
+sal_Bool ImplRegion::OptimizeBandList()
{
DBG_ASSERT( (this != &aImplNullRegion) && (this != &aImplEmptyRegion),
"ImplRegion::OptimizeBandList() - Empty oder NULL-Region" );
@@ -991,7 +993,7 @@ BOOL ImplRegion::OptimizeBandList()
ImplRegionBand* pBand = mpFirstBand;
while ( pBand )
{
- const BOOL bBTEqual = pBand->mpNextBand &&
+ const sal_Bool bBTEqual = pBand->mpNextBand &&
(pBand->mnYBottom == pBand->mpNextBand->mnYTop);
// no separation? -> remove!
@@ -1199,7 +1201,7 @@ void Region::ImplCreateRectRegion( const Rectangle& rRect )
void Region::ImplCreatePolyPolyRegion( const PolyPolygon& rPolyPoly )
{
- const USHORT nPolyCount = rPolyPoly.Count();
+ const sal_uInt16 nPolyCount = rPolyPoly.Count();
if ( nPolyCount )
{
// polypolygon empty? -> empty region
@@ -1363,13 +1365,35 @@ void Region::Scale( double fScaleX, double fScaleY )
// -----------------------------------------------------------------------
-BOOL Region::Union( const Rectangle& rRect )
+sal_Bool Region::Union( const Rectangle& rRect )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
// is rectangle empty? -> nothing to do
if ( rRect.IsEmpty() )
- return TRUE;
+ return sal_True;
+
+ if( HasPolyPolygon() )
+ {
+ // get this B2DPolyPolygon
+ basegfx::B2DPolyPolygon aThisPolyPoly( ConvertToB2DPolyPolygon() );
+ aThisPolyPoly = basegfx::tools::prepareForPolygonOperation( aThisPolyPoly );
+
+ if( aThisPolyPoly.count() == 0 )
+ {
+ *this = rRect;
+ return true;
+ }
+
+ // get the other B2DPolyPolygon
+ basegfx::B2DPolygon aRectPoly( basegfx::tools::createPolygonFromRect( basegfx::B2DRectangle( rRect.Left(), rRect.Top(), rRect.Right(), rRect.Bottom() ) ) );
+ basegfx::B2DPolyPolygon aOtherPolyPoly( aRectPoly );
+
+ basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationOr( aThisPolyPoly, aOtherPolyPoly );
+ *this = Region( aClip );
+
+ return sal_True;
+ }
ImplPolyPolyRegionToBandRegion();
@@ -1400,12 +1424,12 @@ BOOL Region::Union( const Rectangle& rRect )
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL Region::Intersect( const Rectangle& rRect )
+sal_Bool Region::Intersect( const Rectangle& rRect )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
@@ -1421,7 +1445,7 @@ BOOL Region::Intersect( const Rectangle& rRect )
delete mpImplRegion;
}
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
- return TRUE;
+ return sal_True;
}
// #103137# Avoid banding for special cases
@@ -1439,14 +1463,30 @@ BOOL Region::Intersect( const Rectangle& rRect )
// unnecessary banding
mpImplRegion->mpPolyPoly->Clip( rRect );
- return TRUE;
+ return sal_True;
+ }
+ else if( mpImplRegion->mpB2DPolyPoly )
+ {
+ // #127431# make ImplRegion unique, if not already.
+ if( mpImplRegion->mnRefCount > 1 )
+ {
+ mpImplRegion->mnRefCount--;
+ mpImplRegion = new ImplRegion( *mpImplRegion->mpB2DPolyPoly );
+ }
+
+ *mpImplRegion->mpB2DPolyPoly =
+ basegfx::tools::clipPolyPolygonOnRange( *mpImplRegion->mpB2DPolyPoly,
+ basegfx::B2DRange( rRect.Left(), rRect.Top(),
+ rRect.Right(), rRect.Bottom() ),
+ true, false );
+ return sal_True;
}
else
ImplPolyPolyRegionToBandRegion();
// is region empty? -> nothing to do!
if ( mpImplRegion == &aImplEmptyRegion )
- return TRUE;
+ return sal_True;
// get justified rectangle
long nLeft = Min( rRect.Left(), rRect.Right() );
@@ -1467,7 +1507,7 @@ BOOL Region::Intersect( const Rectangle& rRect )
mpImplRegion->mpFirstBand->Union( nLeft, nRight );
mpImplRegion->mnRectCount = 1;
- return TRUE;
+ return sal_True;
}
// no own instance data? -> make own copy!
@@ -1511,24 +1551,43 @@ BOOL Region::Intersect( const Rectangle& rRect )
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL Region::Exclude( const Rectangle& rRect )
+sal_Bool Region::Exclude( const Rectangle& rRect )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
// is rectangle empty? -> nothing to do
if ( rRect.IsEmpty() )
- return TRUE;
+ return sal_True;
+
+ if( HasPolyPolygon() )
+ {
+ // get this B2DPolyPolygon
+ basegfx::B2DPolyPolygon aThisPolyPoly( ConvertToB2DPolyPolygon() );
+ aThisPolyPoly = basegfx::tools::prepareForPolygonOperation( aThisPolyPoly );
+
+ if( aThisPolyPoly.count() == 0 )
+ return sal_True;
+
+ // get the other B2DPolyPolygon
+ basegfx::B2DPolygon aRectPoly( basegfx::tools::createPolygonFromRect( basegfx::B2DRectangle( rRect.Left(), rRect.Top(), rRect.Right(), rRect.Bottom() ) ) );
+ basegfx::B2DPolyPolygon aOtherPolyPoly( aRectPoly );
+
+ basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationDiff( aThisPolyPoly, aOtherPolyPoly );
+ *this = Region( aClip );
+
+ return sal_True;
+ }
ImplPolyPolyRegionToBandRegion();
// no instance data? -> create!
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return TRUE;
+ return sal_True;
// no own instance data? -> make own copy!
if ( mpImplRegion->mnRefCount > 1 )
@@ -1553,18 +1612,40 @@ BOOL Region::Exclude( const Rectangle& rRect )
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL Region::XOr( const Rectangle& rRect )
+sal_Bool Region::XOr( const Rectangle& rRect )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
// is rectangle empty? -> nothing to do
if ( rRect.IsEmpty() )
- return TRUE;
+ return sal_True;
+
+ if( HasPolyPolygon() )
+ {
+ // get this B2DPolyPolygon
+ basegfx::B2DPolyPolygon aThisPolyPoly( ConvertToB2DPolyPolygon() );
+ aThisPolyPoly = basegfx::tools::prepareForPolygonOperation( aThisPolyPoly );
+
+ if( aThisPolyPoly.count() == 0 )
+ {
+ *this = rRect;
+ return sal_True;
+ }
+
+ // get the other B2DPolyPolygon
+ basegfx::B2DPolygon aRectPoly( basegfx::tools::createPolygonFromRect( basegfx::B2DRectangle( rRect.Left(), rRect.Top(), rRect.Right(), rRect.Bottom() ) ) );
+ basegfx::B2DPolyPolygon aOtherPolyPoly( aRectPoly );
+
+ basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationXor( aThisPolyPoly, aOtherPolyPoly );
+ *this = Region( aClip );
+
+ return sal_True;
+ }
ImplPolyPolyRegionToBandRegion();
@@ -1595,21 +1676,48 @@ BOOL Region::XOr( const Rectangle& rRect )
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
+void Region::ImplUnionPolyPolygon( const Region& i_rRegion )
+{
+ // get this B2DPolyPolygon
+ basegfx::B2DPolyPolygon aThisPolyPoly( ConvertToB2DPolyPolygon() );
+ aThisPolyPoly = basegfx::tools::prepareForPolygonOperation( aThisPolyPoly );
+
+ if( aThisPolyPoly.count() == 0 )
+ {
+ *this = i_rRegion;
+ return;
+ }
+
+ // get the other B2DPolyPolygon
+ basegfx::B2DPolyPolygon aOtherPolyPoly( const_cast<Region&>(i_rRegion).ConvertToB2DPolyPolygon() );
+ aOtherPolyPoly = basegfx::tools::prepareForPolygonOperation( aOtherPolyPoly );
-BOOL Region::Union( const Region& rRegion )
+
+ basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationOr( aThisPolyPoly, aOtherPolyPoly );
+
+ *this = Region( aClip );
+}
+
+sal_Bool Region::Union( const Region& rRegion )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
+ if( rRegion.HasPolyPolygon() || HasPolyPolygon() )
+ {
+ ImplUnionPolyPolygon( rRegion );
+ return sal_True;
+ }
+
ImplPolyPolyRegionToBandRegion();
((Region*)&rRegion)->ImplPolyPolyRegionToBandRegion();
// is region empty or null? -> nothing to do
if ( (rRegion.mpImplRegion == &aImplEmptyRegion) || (rRegion.mpImplRegion == &aImplNullRegion) )
- return TRUE;
+ return sal_True;
// no instance data? -> create!
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
@@ -1645,28 +1753,50 @@ BOOL Region::Union( const Region& rRegion )
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
+void Region::ImplIntersectWithPolyPolygon( const Region& i_rRegion )
+{
+ // get this B2DPolyPolygon
+ basegfx::B2DPolyPolygon aThisPolyPoly( ConvertToB2DPolyPolygon() );
+ if( aThisPolyPoly.count() == 0 )
+ {
+ *this = i_rRegion;
+ return;
+ }
-BOOL Region::Intersect( const Region& rRegion )
+ // get the other B2DPolyPolygon
+ basegfx::B2DPolyPolygon aOtherPolyPoly( const_cast<Region&>(i_rRegion).ConvertToB2DPolyPolygon() );
+
+ basegfx::B2DPolyPolygon aClip = basegfx::tools::clipPolyPolygonOnPolyPolygon( aOtherPolyPoly, aThisPolyPoly, true, false );
+ *this = Region( aClip );
+}
+
+sal_Bool Region::Intersect( const Region& rRegion )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
// same instance data? -> nothing to do!
if ( mpImplRegion == rRegion.mpImplRegion )
- return TRUE;
+ return sal_True;
+
+ if( rRegion.HasPolyPolygon() || HasPolyPolygon() )
+ {
+ ImplIntersectWithPolyPolygon( rRegion );
+ return sal_True;
+ }
ImplPolyPolyRegionToBandRegion();
((Region*)&rRegion)->ImplPolyPolyRegionToBandRegion();
if ( mpImplRegion == &aImplEmptyRegion )
- return TRUE;
+ return sal_True;
// is region null? -> nothing to do
if ( rRegion.mpImplRegion == &aImplNullRegion )
- return TRUE;
+ return sal_True;
// is rectangle empty? -> nothing to do
if ( rRegion.mpImplRegion == &aImplEmptyRegion )
@@ -1680,7 +1810,7 @@ BOOL Region::Intersect( const Region& rRegion )
delete mpImplRegion;
}
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
- return TRUE;
+ return sal_True;
}
// is own region NULL-region? -> copy data!
@@ -1688,7 +1818,7 @@ BOOL Region::Intersect( const Region& rRegion )
{
mpImplRegion = rRegion.mpImplRegion;
rRegion.mpImplRegion->mnRefCount++;
- return TRUE;
+ return sal_True;
}
// Wenn wir weniger Rechtecke haben, drehen wir den Intersect-Aufruf um
@@ -1708,7 +1838,7 @@ BOOL Region::Intersect( const Region& rRegion )
ImplRegionBand* pBand = mpImplRegion->mpFirstBand;
while ( pBand )
{
- pBand->mbTouched = FALSE;
+ pBand->mbTouched = sal_False;
pBand = pBand->mpNextBand;
}
@@ -1784,25 +1914,46 @@ BOOL Region::Intersect( const Region& rRegion )
}
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
+void Region::ImplExcludePolyPolygon( const Region& i_rRegion )
+{
+ // get this B2DPolyPolygon
+ basegfx::B2DPolyPolygon aThisPolyPoly( ConvertToB2DPolyPolygon() );
+ if( aThisPolyPoly.count() == 0 )
+ return;
+ aThisPolyPoly = basegfx::tools::prepareForPolygonOperation( aThisPolyPoly );
+
+ // get the other B2DPolyPolygon
+ basegfx::B2DPolyPolygon aOtherPolyPoly( const_cast<Region&>(i_rRegion).ConvertToB2DPolyPolygon() );
+ aOtherPolyPoly = basegfx::tools::prepareForPolygonOperation( aOtherPolyPoly );
+
+ basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationDiff( aThisPolyPoly, aOtherPolyPoly );
+ *this = Region( aClip );
+}
-BOOL Region::Exclude( const Region& rRegion )
+sal_Bool Region::Exclude( const Region& rRegion )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
+ if( rRegion.HasPolyPolygon() || HasPolyPolygon() )
+ {
+ ImplExcludePolyPolygon( rRegion );
+ return sal_True;
+ }
+
ImplPolyPolyRegionToBandRegion();
((Region*)&rRegion)->ImplPolyPolyRegionToBandRegion();
// is region empty or null? -> nothing to do
if ( (rRegion.mpImplRegion == &aImplEmptyRegion) || (rRegion.mpImplRegion == &aImplNullRegion) )
- return TRUE;
+ return sal_True;
// no instance data? -> nothing to do
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return TRUE;
+ return sal_True;
// no own instance data? -> make own copy!
if ( mpImplRegion->mnRefCount > 1 )
@@ -1837,27 +1988,51 @@ BOOL Region::Exclude( const Region& rRegion )
pBand = pBand->mpNextBand;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
+void Region::ImplXOrPolyPolygon( const Region& i_rRegion )
+{
+ // get this B2DPolyPolygon
+ basegfx::B2DPolyPolygon aThisPolyPoly( ConvertToB2DPolyPolygon() );
+ if( aThisPolyPoly.count() == 0 )
+ {
+ *this = i_rRegion;
+ return;
+ }
+ aThisPolyPoly = basegfx::tools::prepareForPolygonOperation( aThisPolyPoly );
+
+ // get the other B2DPolyPolygon
+ basegfx::B2DPolyPolygon aOtherPolyPoly( const_cast<Region&>(i_rRegion).ConvertToB2DPolyPolygon() );
+ aOtherPolyPoly = basegfx::tools::prepareForPolygonOperation( aOtherPolyPoly );
+
+ basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationXor( aThisPolyPoly, aOtherPolyPoly );
+ *this = Region( aClip );
+}
-BOOL Region::XOr( const Region& rRegion )
+sal_Bool Region::XOr( const Region& rRegion )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
+ if( rRegion.HasPolyPolygon() || HasPolyPolygon() )
+ {
+ ImplXOrPolyPolygon( rRegion );
+ return sal_True;
+ }
+
ImplPolyPolyRegionToBandRegion();
((Region*)&rRegion)->ImplPolyPolyRegionToBandRegion();
// is region empty or null? -> nothing to do
if ( (rRegion.mpImplRegion == &aImplEmptyRegion) || (rRegion.mpImplRegion == &aImplNullRegion) )
- return TRUE;
+ return sal_True;
// no own instance data? -> XOr = copy
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
{
*this = rRegion;
- return TRUE;
+ return sal_True;
}
// no own instance data? -> make own copy!
@@ -1890,7 +2065,7 @@ BOOL Region::XOr( const Region& rRegion )
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -1944,7 +2119,7 @@ Rectangle Region::GetBoundRect() const
// -----------------------------------------------------------------------
-BOOL Region::HasPolyPolygon() const
+sal_Bool Region::HasPolyPolygon() const
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
if( !mpImplRegion )
@@ -2026,7 +2201,7 @@ basegfx::B2DPolyPolygon Region::ConvertToB2DPolyPolygon()
// -----------------------------------------------------------------------
-BOOL Region::ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
+bool Region::ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
long& rX, long& rY,
long& rWidth, long& rHeight ) const
{
@@ -2036,11 +2211,11 @@ BOOL Region::ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
// no internal data? -> region is empty!
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return FALSE;
+ return false;
// no band in the list? -> region is empty!
if ( mpImplRegion->mpFirstBand == NULL )
- return FALSE;
+ return false;
// initialise pointer for first access
ImplRegionBand* pCurrRectBand = mpImplRegion->mpFirstBand;
@@ -2048,7 +2223,7 @@ BOOL Region::ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
DBG_ASSERT( pCurrRectBandSep != NULL, "Erstes Band wurde nicht optimiert." );
if ( !pCurrRectBandSep )
- return FALSE;
+ return false;
// get boundaries of current rectangle
rX = pCurrRectBandSep->mnXLeft;
@@ -2060,12 +2235,12 @@ BOOL Region::ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
rImplRegionInfo.mpVoidCurrRectBand = (void*)pCurrRectBand;
rImplRegionInfo.mpVoidCurrRectBandSep = (void*)pCurrRectBandSep;
- return TRUE;
+ return true;
}
// -----------------------------------------------------------------------
-BOOL Region::ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
+bool Region::ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
long& rX, long& rY,
long& rWidth, long& rHeight ) const
{
@@ -2073,7 +2248,7 @@ BOOL Region::ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
// no internal data? -> region is empty!
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return FALSE;
+ return false;
// get last pointers
ImplRegionBand* pCurrRectBand = (ImplRegionBand*)rImplRegionInfo.mpVoidCurrRectBand;
@@ -2090,7 +2265,7 @@ BOOL Region::ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
// no band found? -> not further rectangles!
if( !pCurrRectBand )
- return FALSE;
+ return false;
// get first separation in current band
pCurrRectBandSep = pCurrRectBand->mpFirstSep;
@@ -2106,7 +2281,7 @@ BOOL Region::ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
rImplRegionInfo.mpVoidCurrRectBand = (void*)pCurrRectBand;
rImplRegionInfo.mpVoidCurrRectBandSep = (void*)pCurrRectBandSep;
- return TRUE;
+ return true;
}
// -----------------------------------------------------------------------
@@ -2125,7 +2300,7 @@ RegionType Region::GetType() const
// -----------------------------------------------------------------------
-BOOL Region::IsInside( const Point& rPoint ) const
+sal_Bool Region::IsInside( const Point& rPoint ) const
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
@@ -2138,7 +2313,7 @@ BOOL Region::IsInside( const Point& rPoint ) const
// no instance data? -> not inside
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return FALSE;
+ return sal_False;
// search band list
ImplRegionBand* pBand = mpImplRegion->mpFirstBand;
@@ -2150,30 +2325,30 @@ BOOL Region::IsInside( const Point& rPoint ) const
{
// is point within separation of the band?
if ( pBand->IsInside( rPoint.X() ) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
pBand = pBand->mpNextBand;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Region::IsInside( const Rectangle& rRect ) const
+sal_Bool Region::IsInside( const Rectangle& rRect ) const
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
// is rectangle empty? -> not inside
if ( rRect.IsEmpty() )
- return FALSE;
+ return sal_False;
// no instance data? -> not inside
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return FALSE;
+ return sal_False;
// create region from rectangle and intersect own region
Region aRegion = rRect;
@@ -2185,12 +2360,12 @@ BOOL Region::IsInside( const Rectangle& rRect ) const
// -----------------------------------------------------------------------
-BOOL Region::IsOver( const Rectangle& rRect ) const
+sal_Bool Region::IsOver( const Rectangle& rRect ) const
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return FALSE;
+ return sal_False;
// Can we optimize this ??? - is used in StarDraw for brushes pointers
// Why we have no IsOver for Regions ???
@@ -2287,20 +2462,20 @@ Region& Region::operator=( const Rectangle& rRect )
// -----------------------------------------------------------------------
-BOOL Region::operator==( const Region& rRegion ) const
+sal_Bool Region::operator==( const Region& rRegion ) const
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
DBG_CHKOBJ( &rRegion, Region, ImplDbgTestRegion );
// reference to same object? -> equal!
if ( mpImplRegion == rRegion.mpImplRegion )
- return TRUE;
+ return sal_True;
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return FALSE;
+ return sal_False;
if ( (rRegion.mpImplRegion == &aImplEmptyRegion) || (rRegion.mpImplRegion == &aImplNullRegion) )
- return FALSE;
+ return sal_False;
if ( rRegion.mpImplRegion->mpPolyPoly && mpImplRegion->mpPolyPoly )
return *rRegion.mpImplRegion->mpPolyPoly == *mpImplRegion->mpPolyPoly;
@@ -2311,13 +2486,13 @@ BOOL Region::operator==( const Region& rRegion ) const
// Eine der beiden Regions kann jetzt Empty sein
if ( mpImplRegion == rRegion.mpImplRegion )
- return TRUE;
+ return sal_True;
if ( mpImplRegion == &aImplEmptyRegion )
- return FALSE;
+ return sal_False;
if ( rRegion.mpImplRegion == &aImplEmptyRegion )
- return FALSE;
+ return sal_False;
}
// initialise pointers
@@ -2331,22 +2506,22 @@ BOOL Region::operator==( const Region& rRegion ) const
long nOwnXLeft = pOwnRectBandSep->mnXLeft;
long nSecondXLeft = pSecondRectBandSep->mnXLeft;
if ( nOwnXLeft != nSecondXLeft )
- return FALSE;
+ return sal_False;
long nOwnYTop = pOwnRectBand->mnYTop;
long nSecondYTop = pSecondRectBand->mnYTop;
if ( nOwnYTop != nSecondYTop )
- return FALSE;
+ return sal_False;
long nOwnXRight = pOwnRectBandSep->mnXRight;
long nSecondXRight = pSecondRectBandSep->mnXRight;
if ( nOwnXRight != nSecondXRight )
- return FALSE;
+ return sal_False;
long nOwnYBottom = pOwnRectBand->mnYBottom;
long nSecondYBottom = pSecondRectBand->mnYBottom;
if ( nOwnYBottom != nSecondYBottom )
- return FALSE;
+ return sal_False;
// get next separation from current band
pOwnRectBandSep = pOwnRectBandSep->mpNextSep;
@@ -2377,13 +2552,13 @@ BOOL Region::operator==( const Region& rRegion ) const
}
if ( pOwnRectBandSep && !pSecondRectBandSep )
- return FALSE;
+ return sal_False;
if ( !pOwnRectBandSep && pSecondRectBandSep )
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -2395,8 +2570,8 @@ SvStream& operator>>( SvStream& rIStrm, Region& rRegion )
DBG_CHKOBJ( &rRegion, Region, ImplDbgTestRegion );
VersionCompat aCompat( rIStrm, STREAM_READ );
- UINT16 nVersion;
- UINT16 nTmp16;
+ sal_uInt16 nVersion;
+ sal_uInt16 nTmp16;
// statische Object haben RefCount von 0
if ( rRegion.mpImplRegion->mnRefCount )
@@ -2489,7 +2664,7 @@ SvStream& operator>>( SvStream& rIStrm, Region& rRegion )
if( aCompat.GetVersion() >= 2 )
{
- BOOL bHasPolyPolygon;
+ sal_Bool bHasPolyPolygon;
rIStrm >> bHasPolyPolygon;
@@ -2513,7 +2688,7 @@ SvStream& operator<<( SvStream& rOStrm, const Region& rRegion )
{
DBG_CHKOBJ( &rRegion, Region, ImplDbgTestRegion );
- UINT16 nVersion = 2;
+ sal_uInt16 nVersion = 2;
VersionCompat aCompat( rOStrm, STREAM_WRITE, nVersion );
Region aTmpRegion( rRegion );
@@ -2524,7 +2699,7 @@ SvStream& operator<<( SvStream& rOStrm, const Region& rRegion )
rOStrm << nVersion;
// put type
- rOStrm << (UINT16)aTmpRegion.GetType();
+ rOStrm << (sal_uInt16)aTmpRegion.GetType();
// put all bands if not null or empty
if ( (aTmpRegion.mpImplRegion != &aImplEmptyRegion) && (aTmpRegion.mpImplRegion != &aImplNullRegion) )
@@ -2533,7 +2708,7 @@ SvStream& operator<<( SvStream& rOStrm, const Region& rRegion )
while ( pBand )
{
// put boundaries
- rOStrm << (UINT16) STREAMENTRY_BANDHEADER;
+ rOStrm << (sal_uInt16) STREAMENTRY_BANDHEADER;
rOStrm << pBand->mnYTop;
rOStrm << pBand->mnYBottom;
@@ -2542,7 +2717,7 @@ SvStream& operator<<( SvStream& rOStrm, const Region& rRegion )
while ( pSep )
{
// put separation
- rOStrm << (UINT16) STREAMENTRY_SEPARATION;
+ rOStrm << (sal_uInt16) STREAMENTRY_SEPARATION;
rOStrm << pSep->mnXLeft;
rOStrm << pSep->mnXRight;
@@ -2554,10 +2729,10 @@ SvStream& operator<<( SvStream& rOStrm, const Region& rRegion )
}
// put endmarker
- rOStrm << (UINT16) STREAMENTRY_END;
+ rOStrm << (sal_uInt16) STREAMENTRY_END;
// write polypolygon if available
- const BOOL bHasPolyPolygon = rRegion.HasPolyPolygon();
+ const sal_Bool bHasPolyPolygon = rRegion.HasPolyPolygon();
rOStrm << bHasPolyPolygon;
if( bHasPolyPolygon )
@@ -2594,12 +2769,12 @@ void Region::ImplBeginAddRect()
// -----------------------------------------------------------------------
-BOOL Region::ImplAddRect( const Rectangle& rRect )
+sal_Bool Region::ImplAddRect( const Rectangle& rRect )
{
// Hier kein CheckThis, da nicht alle Daten auf Stand
if ( rRect.IsEmpty() )
- return TRUE;
+ return sal_True;
// get justified rectangle
long nTop;
@@ -2659,7 +2834,7 @@ BOOL Region::ImplAddRect( const Rectangle& rRect )
mpImplRegion->mpLastCheckedBand->Union( nLeft, nRight );
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -2728,14 +2903,14 @@ void Region::ImplEndAddRect()
// -----------------------------------------------------------------------
-ULONG Region::GetRectCount() const
+sal_uLong Region::GetRectCount() const
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
((Region*)this)->ImplPolyPolyRegionToBandRegion();
#ifdef DBG_UTIL
- ULONG nCount = 0;
+ sal_uLong nCount = 0;
// all bands if not null or empty
if ( (mpImplRegion != &aImplEmptyRegion) && (mpImplRegion != &aImplNullRegion) )
@@ -2781,7 +2956,7 @@ RegionHandle Region::BeginEnumRects()
ImplRegionHandle* pData = new ImplRegionHandle;
pData->mpRegion = new Region( *this );
- pData->mbFirst = TRUE;
+ pData->mbFirst = sal_True;
// save pointers
pData->mpCurrRectBand = pData->mpRegion->mpImplRegion->mpFirstBand;
@@ -2792,16 +2967,16 @@ RegionHandle Region::BeginEnumRects()
// -----------------------------------------------------------------------
-BOOL Region::GetEnumRects( RegionHandle pVoidData, Rectangle& rRect )
+sal_Bool Region::GetEnumRects( RegionHandle pVoidData, Rectangle& rRect )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
ImplRegionHandle* pData = (ImplRegionHandle*)pVoidData;
if ( !pData )
- return FALSE;
+ return sal_False;
if ( pData->mbFirst )
- pData->mbFirst = FALSE;
+ pData->mbFirst = sal_False;
else
{
// get next separation from current band
@@ -2815,7 +2990,7 @@ BOOL Region::GetEnumRects( RegionHandle pVoidData, Rectangle& rRect )
// no band found? -> not further rectangles!
if ( !pData->mpCurrRectBand )
- return FALSE;
+ return sal_False;
// get first separation in current band
pData->mpCurrRectBandSep = pData->mpCurrRectBand->mpFirstSep;
@@ -2827,7 +3002,7 @@ BOOL Region::GetEnumRects( RegionHandle pVoidData, Rectangle& rRect )
rRect.Bottom() = pData->mpCurrRectBand->mnYBottom;
rRect.Left() = pData->mpCurrRectBandSep->mnXLeft;
rRect.Right() = pData->mpCurrRectBandSep->mnXRight;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -2851,7 +3026,7 @@ static inline bool ImplPolygonRectTest( const Polygon& rPoly, Rectangle* pRectOu
{
bool bIsRect = false;
const Point* pPoints = rPoly.GetConstPointAry();
- USHORT nPoints = rPoly.GetSize();
+ sal_uInt16 nPoints = rPoly.GetSize();
if( nPoints == 4 || (nPoints == 5 && pPoints[0] == pPoints[4]) )
{
long nX1 = pPoints[0].X(), nX2 = pPoints[2].X(),
@@ -2902,7 +3077,7 @@ Region Region::GetRegionFromPolyPolygon( const PolyPolygon& rPolyPoly )
int nPolygonRects = 0, nPolygonPolygons = 0;
int nPolygons = rPolyPoly.Count();
- for( USHORT i = 0; i < nPolygons; i++ )
+ for( sal_uInt16 i = 0; i < nPolygons; i++ )
{
const Polygon& rPoly = rPolyPoly[i];
if( ImplPolygonRectTest( rPoly ) )
@@ -2915,7 +3090,7 @@ Region Region::GetRegionFromPolyPolygon( const PolyPolygon& rPolyPoly )
Region aResult;
Rectangle aRect;
- for( USHORT i = 0; i < nPolygons; i++ )
+ for( sal_uInt16 i = 0; i < nPolygons; i++ )
{
const Polygon& rPoly = rPolyPoly[i];
if( ImplPolygonRectTest( rPoly, &aRect ) )
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index ea8d10377e61..9fa4d813b2b7 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -171,7 +171,7 @@ void SalGraphics::mirror( long& x, long& nWidth, const OutputDevice *pOutDev, bo
}
}
-BOOL SalGraphics::mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev, bool bBack ) const
+sal_Bool SalGraphics::mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev, bool bBack ) const
{
long w;
if( pOutDev && pOutDev->GetOutDevType() == OUTDEV_VIRDEV )
@@ -244,22 +244,37 @@ BOOL SalGraphics::mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *
pPtAry2[j].mnY = pPtAry[i].mnY;
}
}
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
void SalGraphics::mirror( Region& rRgn, const OutputDevice *pOutDev, bool bBack ) const
{
- // mirror the bounding rect and move Region by resulting offset
- Rectangle aRect( rRgn.GetBoundRect() );
- long nWidth = aRect.GetWidth();
- long x = aRect.Left();
- long x_org = x;
+ if( rRgn.HasPolyPolygon() )
+ {
+ basegfx::B2DPolyPolygon aPolyPoly( rRgn.ConvertToB2DPolyPolygon() );
+ aPolyPoly = mirror( aPolyPoly, pOutDev, bBack );
+ rRgn = Region( aPolyPoly );
+ }
+ else
+ {
+ ImplRegionInfo aInfo;
+ bool bRegionRect;
+ Region aMirroredRegion;
+ long nX, nY, nWidth, nHeight;
- mirror( x, nWidth, pOutDev, bBack );
- rRgn.Move( x - x_org, 0 );
+ bRegionRect = rRgn.ImplGetFirstRect( aInfo, nX, nY, nWidth, nHeight );
+ while ( bRegionRect )
+ {
+ Rectangle aRect( Point(nX, nY), Size(nWidth, nHeight) );
+ mirror( aRect, pOutDev, bBack );
+ aMirroredRegion.Union( aRect );
+ bRegionRect = rRgn.ImplGetNextRect( aInfo, nX, nY, nWidth, nHeight );
+ }
+ rRgn = aMirroredRegion;
+ }
}
void SalGraphics::mirror( Rectangle& rRect, const OutputDevice *pOutDev, bool bBack ) const
@@ -357,22 +372,15 @@ basegfx::B2DPolyPolygon SalGraphics::mirror( const basegfx::B2DPolyPolygon& i_rP
// ----------------------------------------------------------------------------
-BOOL SalGraphics::UnionClipRegion( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev )
+bool SalGraphics::SetClipRegion( const Region& i_rClip, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
- mirror( nX, nWidth, pOutDev );
- return unionClipRegion( nX, nY, nWidth, nHeight );
-}
-
-bool SalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- return false;
-}
-
-BOOL SalGraphics::UnionClipRegion( const ::basegfx::B2DPolyPolygon& rPoly, const OutputDevice* pOutDev )
-{
- (void)pOutDev;// TODO: SAL_LAYOUT_BIDI_RTL
- return unionClipRegion( rPoly );
+ {
+ Region aMirror( i_rClip );
+ mirror( aMirror, pOutDev );
+ return setClipRegion( aMirror );
+ }
+ return setClipRegion( i_rClip );
}
void SalGraphics::DrawPixel( long nX, long nY, const OutputDevice *pOutDev )
@@ -411,12 +419,12 @@ bool SalGraphics::drawPolyLine(
return false;
}
-void SalGraphics::DrawPolyLine( ULONG nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev )
+void SalGraphics::DrawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
SalPoint* pPtAry2 = new SalPoint[nPoints];
- BOOL bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
+ sal_Bool bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
drawPolyLine( nPoints, bCopied ? pPtAry2 : pPtAry );
delete [] pPtAry2;
}
@@ -424,12 +432,12 @@ void SalGraphics::DrawPolyLine( ULONG nPoints, const SalPoint* pPtAry, const Out
drawPolyLine( nPoints, pPtAry );
}
-void SalGraphics::DrawPolygon( ULONG nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev )
+void SalGraphics::DrawPolygon( sal_uLong nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
SalPoint* pPtAry2 = new SalPoint[nPoints];
- BOOL bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
+ sal_Bool bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
drawPolygon( nPoints, bCopied ? pPtAry2 : pPtAry );
delete [] pPtAry2;
}
@@ -443,10 +451,10 @@ void SalGraphics::DrawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints,
{
// TODO: optimize, reduce new/delete calls
SalPoint **pPtAry2 = new SalPoint*[nPoly];
- ULONG i;
+ sal_uLong i;
for(i=0; i<nPoly; i++)
{
- ULONG nPoints = pPoints[i];
+ sal_uLong nPoints = pPoints[i];
pPtAry2[i] = new SalPoint[ nPoints ];
mirror( nPoints, pPtAry[i], pPtAry2[i], pOutDev );
}
@@ -464,7 +472,7 @@ void SalGraphics::DrawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints,
bool SalGraphics::DrawPolyPolygon( const ::basegfx::B2DPolyPolygon& i_rPolyPolygon, double i_fTransparency, const OutputDevice* i_pOutDev )
{
bool bRet = false;
- if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
+ if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (i_pOutDev && i_pOutDev->IsRTLEnabled()) )
{
basegfx::B2DPolyPolygon aMirror( mirror( i_rPolyPolygon, i_pOutDev ) );
bRet = drawPolyPolygon( aMirror, i_fTransparency );
@@ -479,13 +487,13 @@ bool SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double /*fT
return false;
}
-sal_Bool SalGraphics::DrawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry, const OutputDevice* pOutDev )
+sal_Bool SalGraphics::DrawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry, const OutputDevice* pOutDev )
{
sal_Bool bResult = sal_False;
- if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
+ if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
SalPoint* pPtAry2 = new SalPoint[nPoints];
- BOOL bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
+ sal_Bool bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
bResult = drawPolyLineBezier( nPoints, bCopied ? pPtAry2 : pPtAry, pFlgAry );
delete [] pPtAry2;
}
@@ -494,13 +502,13 @@ sal_Bool SalGraphics::DrawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry,
return bResult;
}
-sal_Bool SalGraphics::DrawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry, const OutputDevice* pOutDev )
+sal_Bool SalGraphics::DrawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry, const OutputDevice* pOutDev )
{
sal_Bool bResult = sal_False;
- if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
+ if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
SalPoint* pPtAry2 = new SalPoint[nPoints];
- BOOL bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
+ sal_Bool bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
bResult = drawPolygonBezier( nPoints, bCopied ? pPtAry2 : pPtAry, pFlgAry );
delete [] pPtAry2;
}
@@ -510,17 +518,17 @@ sal_Bool SalGraphics::DrawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry,
}
sal_Bool SalGraphics::DrawPolyPolygonBezier( sal_uInt32 i_nPoly, const sal_uInt32* i_pPoints,
- const SalPoint* const* i_pPtAry, const BYTE* const* i_pFlgAry, const OutputDevice* i_pOutDev )
+ const SalPoint* const* i_pPtAry, const sal_uInt8* const* i_pFlgAry, const OutputDevice* i_pOutDev )
{
sal_Bool bRet = sal_False;
- if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
+ if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (i_pOutDev && i_pOutDev->IsRTLEnabled()) )
{
// TODO: optimize, reduce new/delete calls
SalPoint **pPtAry2 = new SalPoint*[i_nPoly];
- ULONG i;
+ sal_uLong i;
for(i=0; i<i_nPoly; i++)
{
- ULONG nPoints = i_pPoints[i];
+ sal_uLong nPoints = i_pPoints[i];
pPtAry2[i] = new SalPoint[ nPoints ];
mirror( nPoints, i_pPtAry[i], pPtAry2[i], i_pOutDev );
}
@@ -541,7 +549,7 @@ bool SalGraphics::DrawPolyLine( const ::basegfx::B2DPolygon& i_rPolygon, double
const OutputDevice* i_pOutDev )
{
bool bRet = false;
- if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
+ if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (i_pOutDev && i_pOutDev->IsRTLEnabled()) )
{
basegfx::B2DPolygon aMirror( mirror( i_rPolygon, i_pOutDev ) );
bRet = drawPolyLine( aMirror, fTransparency, i_rLineWidth, i_eLineJoin );
@@ -554,7 +562,7 @@ bool SalGraphics::DrawPolyLine( const ::basegfx::B2DPolygon& i_rPolygon, double
void SalGraphics::CopyArea( long nDestX, long nDestY,
long nSrcX, long nSrcY,
long nSrcWidth, long nSrcHeight,
- USHORT nFlags, const OutputDevice *pOutDev )
+ sal_uInt16 nFlags, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
@@ -648,12 +656,12 @@ void SalGraphics::Invert( long nX, long nY, long nWidth, long nHeight, SalInv
mirror( nX, nWidth, pOutDev );
invert( nX, nY, nWidth, nHeight, nFlags );
}
-void SalGraphics::Invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags, const OutputDevice *pOutDev )
+void SalGraphics::Invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
SalPoint* pPtAry2 = new SalPoint[nPoints];
- BOOL bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
+ sal_Bool bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
invert( nPoints, bCopied ? pPtAry2 : pPtAry, nFlags );
delete [] pPtAry2;
}
@@ -661,15 +669,15 @@ void SalGraphics::Invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nF
invert( nPoints, pPtAry, nFlags );
}
-BOOL SalGraphics::DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize, const OutputDevice *pOutDev )
+sal_Bool SalGraphics::DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
mirror( nX, nWidth, pOutDev );
return drawEPS( nX, nY, nWidth, nHeight, pPtr, nSize );
}
-BOOL SalGraphics::HitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
- const Point& aPos, BOOL& rIsInside, const OutputDevice *pOutDev )
+sal_Bool SalGraphics::HitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ const Point& aPos, sal_Bool& rIsInside, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
@@ -718,7 +726,7 @@ void SalGraphics::mirror( ControlType , const ImplControlValue& rVal, const Outp
}
}
-BOOL SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+sal_Bool SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const OUString& aCaption, const OutputDevice *pOutDev )
{
@@ -727,7 +735,7 @@ BOOL SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, const
Rectangle rgn( rControlRegion );
mirror( rgn, pOutDev );
mirror( nType, aValue, pOutDev );
- BOOL bRet = drawNativeControl( nType, nPart, rgn, nState, aValue, aCaption );
+ sal_Bool bRet = drawNativeControl( nType, nPart, rgn, nState, aValue, aCaption );
mirror( nType, aValue, pOutDev, true );
return bRet;
}
@@ -735,7 +743,7 @@ BOOL SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, const
return drawNativeControl( nType, nPart, rControlRegion, nState, aValue, aCaption );
}
-BOOL SalGraphics::DrawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+sal_Bool SalGraphics::DrawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const OUString& aCaption, const OutputDevice *pOutDev )
{
@@ -744,7 +752,7 @@ BOOL SalGraphics::DrawNativeControlText( ControlType nType, ControlPart nPart, c
Rectangle rgn( rControlRegion );
mirror( rgn, pOutDev );
mirror( nType, aValue, pOutDev );
- BOOL bRet = drawNativeControlText( nType, nPart, rgn, nState, aValue, aCaption );
+ sal_Bool bRet = drawNativeControlText( nType, nPart, rgn, nState, aValue, aCaption );
mirror( nType, aValue, pOutDev, true );
return bRet;
}
@@ -752,7 +760,7 @@ BOOL SalGraphics::DrawNativeControlText( ControlType nType, ControlPart nPart, c
return drawNativeControlText( nType, nPart, rControlRegion, nState, aValue, aCaption );
}
-BOOL SalGraphics::GetNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
+sal_Bool SalGraphics::GetNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const OUString& aCaption,
Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion, const OutputDevice *pOutDev )
{
@@ -767,12 +775,12 @@ BOOL SalGraphics::GetNativeControlRegion( ControlType nType, ControlPart nPart,
mirror( rNativeBoundingRegion, pOutDev, true );
mirror( rNativeContentRegion, pOutDev, true );
mirror( nType, aValue, pOutDev, true );
- return TRUE;
+ return sal_True;
}
else
{
mirror( nType, aValue, pOutDev, true );
- return FALSE;
+ return sal_False;
}
}
else
@@ -812,7 +820,7 @@ bool SalGraphics::filterText( const String&, String&, xub_StrLen, xub_StrLen&, x
void SalGraphics::AddDevFontSubstitute( OutputDevice* pOutDev,
const String& rFontName,
const String& rReplaceFontName,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
pOutDev->ImplAddDevFontSubstitute( rFontName, rReplaceFontName, nFlags );
}
diff --git a/vcl/source/gdi/salmisc.cxx b/vcl/source/gdi/salmisc.cxx
index 293098496d15..3a9bd669f54f 100644
--- a/vcl/source/gdi/salmisc.cxx
+++ b/vcl/source/gdi/salmisc.cxx
@@ -102,12 +102,12 @@ static void ImplPALToPAL( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuff
BitmapColor* pColMapBuf = aColMap.ImplGetColorBuffer();
BitmapColor aIndex( 0 );
- for( USHORT i = 0, nSrcCount = aColMap.GetEntryCount(), nDstCount = rDstBuffer.maPalette.GetEntryCount(); i < nSrcCount; i++ )
+ for( sal_uInt16 i = 0, nSrcCount = aColMap.GetEntryCount(), nDstCount = rDstBuffer.maPalette.GetEntryCount(); i < nSrcCount; i++ )
{
if( ( i < nDstCount ) && ( rSrcBuffer.maPalette[ i ] == rDstBuffer.maPalette[ i ] ) )
- aIndex.SetIndex( sal::static_int_cast<BYTE>(i) );
+ aIndex.SetIndex( sal::static_int_cast<sal_uInt8>(i) );
else
- aIndex.SetIndex( sal::static_int_cast<BYTE>(rDstBuffer.maPalette.GetBestIndex( rSrcBuffer.maPalette[ i ] )) );
+ aIndex.SetIndex( sal::static_int_cast<sal_uInt8>(rDstBuffer.maPalette.GetBestIndex( rSrcBuffer.maPalette[ i ] )) );
pColMapBuf[ i ] = aIndex;
}
@@ -213,7 +213,7 @@ static void ImplTCToTC( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffer
if( BMP_SCANLINE_FORMAT( rSrcBuffer.mnFormat ) == BMP_FORMAT_24BIT_TC_BGR )
{
BitmapColor aCol;
- BYTE* pPixel = NULL;
+ sal_uInt8* pPixel = NULL;
for( long nActY = 0, nMapY; nActY < nHeight; nActY++ )
{
@@ -254,7 +254,7 @@ static void ImplTCToPAL( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffe
const ColorMask& rSrcMask = rSrcBuffer.maColorMask;
const ColorMask& rDstMask = rDstBuffer.maColorMask;
BitmapPalette aColMap( rSrcBuffer.maPalette.GetEntryCount() );
- BYTE* pColToPalMap = new BYTE[ TC_TO_PAL_COLORS ];
+ sal_uInt8* pColToPalMap = new sal_uInt8[ TC_TO_PAL_COLORS ];
BitmapColor aIndex( 0 );
for( long nR = 0; nR < 16; nR++ )
@@ -263,10 +263,10 @@ static void ImplTCToPAL( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffe
{
for( long nB = 0; nB < 16; nB++ )
{
- BitmapColor aCol( sal::static_int_cast<BYTE>(nR << 4),
- sal::static_int_cast<BYTE>(nG << 4),
- sal::static_int_cast<BYTE>(nB << 4) );
- pColToPalMap[ ImplIndexFromColor( aCol ) ] = (BYTE) rDstBuffer.maPalette.GetBestIndex( aCol );
+ BitmapColor aCol( sal::static_int_cast<sal_uInt8>(nR << 4),
+ sal::static_int_cast<sal_uInt8>(nG << 4),
+ sal::static_int_cast<sal_uInt8>(nB << 4) );
+ pColToPalMap[ ImplIndexFromColor( aCol ) ] = (sal_uInt8) rDstBuffer.maPalette.GetBestIndex( aCol );
}
}
}
@@ -294,7 +294,7 @@ static void ImplTCToPAL( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffe
// ---------------------
BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRect& rTwoRect,
- ULONG nDstBitmapFormat, BitmapPalette* pDstPal, ColorMask* pDstMask )
+ sal_uLong nDstBitmapFormat, BitmapPalette* pDstPal, ColorMask* pDstMask )
{
FncGetPixel pFncGetPixel;
FncSetPixel pFncSetPixel;
@@ -331,7 +331,7 @@ BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRec
}
// set function for setting pixels
- const ULONG nDstScanlineFormat = BMP_SCANLINE_FORMAT( nDstBitmapFormat );
+ const sal_uLong nDstScanlineFormat = BMP_SCANLINE_FORMAT( nDstBitmapFormat );
switch( nDstScanlineFormat )
{
IMPL_CASE_SET_FORMAT( _1BIT_MSB_PAL, 1 );
@@ -368,7 +368,7 @@ BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRec
pDstBuffer->mnScanlineSize = AlignedWidth4Bytes( pDstBuffer->mnBitCount * pDstBuffer->mnWidth );
try
{
- pDstBuffer->mpBits = new BYTE[ pDstBuffer->mnScanlineSize * pDstBuffer->mnHeight ];
+ pDstBuffer->mpBits = new sal_uInt8[ pDstBuffer->mnScanlineSize * pDstBuffer->mnHeight ];
}
catch( const std::bad_alloc& )
{
diff --git a/vcl/source/gdi/salnativewidgets-none.cxx b/vcl/source/gdi/salnativewidgets-none.cxx
index 0bf74e46d3fd..cc204069c2c4 100644
--- a/vcl/source/gdi/salnativewidgets-none.cxx
+++ b/vcl/source/gdi/salnativewidgets-none.cxx
@@ -41,29 +41,29 @@ using ::rtl::OUString;
/*
* IsNativeControlSupported()
*
- * Returns TRUE if the platform supports native
+ * Returns sal_True if the platform supports native
* drawing of the control defined by nPart
*/
-BOOL SalGraphics::IsNativeControlSupported( ControlType, ControlPart )
+sal_Bool SalGraphics::IsNativeControlSupported( ControlType, ControlPart )
{
- return( FALSE );
+ return( sal_False );
}
/*
* HitTestNativeControl()
*
- * If the return value is TRUE, bIsInside contains information whether
+ * If the return value is sal_True, bIsInside contains information whether
* aPos was or was not inside the native widget specified by the
* nType/nPart combination.
*/
-BOOL SalGraphics::hitTestNativeControl( ControlType,
+sal_Bool SalGraphics::hitTestNativeControl( ControlType,
ControlPart,
const Rectangle&,
const Point&,
- BOOL& )
+ sal_Bool& )
{
- return( FALSE );
+ return( sal_False );
}
@@ -76,14 +76,14 @@ BOOL SalGraphics::hitTestNativeControl( ControlType,
* aValue: An optional value (tristate/numerical/string)
* aCaption: A caption or title string (like button text etc)
*/
-BOOL SalGraphics::drawNativeControl( ControlType,
+sal_Bool SalGraphics::drawNativeControl( ControlType,
ControlPart,
const Rectangle&,
ControlState,
const ImplControlValue&,
const OUString& )
{
- return( FALSE );
+ return( sal_False );
}
@@ -97,22 +97,22 @@ BOOL SalGraphics::drawNativeControl( ControlType,
* aValue: An optional value (tristate/numerical/string)
* aCaption: A caption or title string (like button text etc)
*/
-BOOL SalGraphics::drawNativeControlText( ControlType,
+sal_Bool SalGraphics::drawNativeControlText( ControlType,
ControlPart,
const Rectangle&,
ControlState,
const ImplControlValue&,
const OUString& )
{
- return( FALSE );
+ return( sal_False );
}
/*
* GetNativeControlRegion()
*
- * If the return value is TRUE, rNativeBoundingRegion
- * contains the TRUE bounding region covered by the control
+ * If the return value is sal_True, rNativeBoundingRegion
+ * contains the sal_True bounding region covered by the control
* including any adornment, while rNativeContentRegion contains the area
* within the control that can be safely drawn into without drawing over
* the borders of the control.
@@ -121,7 +121,7 @@ BOOL SalGraphics::drawNativeControlText( ControlType,
* aValue: An optional value (tristate/numerical/string)
* aCaption: A caption or title string (like button text etc)
*/
-BOOL SalGraphics::getNativeControlRegion( ControlType,
+sal_Bool SalGraphics::getNativeControlRegion( ControlType,
ControlPart,
const Rectangle&,
ControlState,
@@ -130,7 +130,7 @@ BOOL SalGraphics::getNativeControlRegion( ControlType,
Rectangle &,
Rectangle & )
{
- return( FALSE );
+ return( sal_False );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/svcompat.cxx b/vcl/source/gdi/svcompat.cxx
index 8415d5bbfc39..c594dd1f93d7 100644
--- a/vcl/source/gdi/svcompat.cxx
+++ b/vcl/source/gdi/svcompat.cxx
@@ -35,7 +35,7 @@
// - ImplCompat -
// --------------
-ImplCompat::ImplCompat( SvStream& rStm, USHORT nStreamMode, USHORT nVersion ) :
+ImplCompat::ImplCompat( SvStream& rStm, sal_uInt16 nStreamMode, sal_uInt16 nVersion ) :
mpRWStm ( &rStm ),
mnStmMode ( nStreamMode ),
mnVersion ( nVersion )
@@ -63,7 +63,7 @@ ImplCompat::~ImplCompat()
{
if( STREAM_WRITE == mnStmMode )
{
- const UINT32 nEndPos = mpRWStm->Tell();
+ const sal_uInt32 nEndPos = mpRWStm->Tell();
mpRWStm->Seek( mnCompatPos );
*mpRWStm << ( nEndPos - mnTotalSize );
@@ -71,7 +71,7 @@ ImplCompat::~ImplCompat()
}
else
{
- const UINT32 nReadSize = mpRWStm->Tell() - mnCompatPos;
+ const sal_uInt32 nReadSize = mpRWStm->Tell() - mnCompatPos;
if( mnTotalSize > nReadSize )
mpRWStm->SeekRel( mnTotalSize - nReadSize );
diff --git a/vcl/source/gdi/textlayout.cxx b/vcl/source/gdi/textlayout.cxx
index 2def0fdc065d..1afa8840fcf3 100644..100755
--- a/vcl/source/gdi/textlayout.cxx
+++ b/vcl/source/gdi/textlayout.cxx
@@ -110,7 +110,7 @@ namespace vcl
public:
// equivalents to the respective OutputDevice methods, which take the reference device into account
long GetTextArray( const XubString& _rText, sal_Int32* _pDXAry, xub_StrLen _nStartIndex, xub_StrLen _nLength ) const;
- Rectangle DrawText( const Rectangle& _rRect, const XubString& _rText, USHORT _nStyle, MetricVector* _pVector, String* _pDisplayText );
+ Rectangle DrawText( const Rectangle& _rRect, const XubString& _rText, sal_uInt16 _nStyle, MetricVector* _pVector, String* _pDisplayText );
protected:
void onBeginDrawText()
@@ -310,13 +310,13 @@ namespace vcl
}
//--------------------------------------------------------------------
- Rectangle ReferenceDeviceTextLayout::DrawText( const Rectangle& _rRect, const XubString& _rText, USHORT _nStyle, MetricVector* _pVector, String* _pDisplayText )
+ Rectangle ReferenceDeviceTextLayout::DrawText( const Rectangle& _rRect, const XubString& _rText, sal_uInt16 _nStyle, MetricVector* _pVector, String* _pDisplayText )
{
if ( !_rText.Len() )
return Rectangle();
// determine text layout mode from the RTL-ness of the control whose text we render
- ULONG nTextLayoutMode = m_bRTLEnabled ? TEXT_LAYOUT_BIDI_RTL : TEXT_LAYOUT_BIDI_LTR;
+ sal_uLong nTextLayoutMode = m_bRTLEnabled ? TEXT_LAYOUT_BIDI_RTL : TEXT_LAYOUT_BIDI_LTR;
m_rReferenceDevice.SetLayoutMode( nTextLayoutMode );
m_rTargetDevice.SetLayoutMode( nTextLayoutMode | TEXT_LAYOUT_TEXTORIGIN_LEFT );
// TEXT_LAYOUT_TEXTORIGIN_LEFT is because when we do actually draw the text (in DrawText( Point, ... )), then
@@ -376,7 +376,7 @@ namespace vcl
}
//--------------------------------------------------------------------
- Rectangle ControlTextRenderer::DrawText( const Rectangle& _rRect, const XubString& _rText, USHORT _nStyle,
+ Rectangle ControlTextRenderer::DrawText( const Rectangle& _rRect, const XubString& _rText, sal_uInt16 _nStyle,
MetricVector* _pVector, String* _pDisplayText )
{
return m_pImpl->DrawText( _rRect, _rText, _nStyle, _pVector, _pDisplayText );
diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx
index e08b6d820a47..981fc38b7375 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -47,7 +47,7 @@ using namespace ::com::sun::star::uno;
// =======================================================================
void VirtualDevice::ImplInitVirDev( const OutputDevice* pOutDev,
- long nDX, long nDY, USHORT nBitCount, const SystemGraphicsData *pData )
+ long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData )
{
DBG_ASSERT( nBitCount <= 1,
"VirtualDevice::VirtualDevice(): Only 0 or 1 is for BitCount allowed" );
@@ -85,7 +85,7 @@ void VirtualDevice::ImplInitVirDev( const OutputDevice* pOutDev,
mnBitCount = ( nBitCount ? nBitCount : pOutDev->GetBitCount() );
mnOutWidth = nDX;
mnOutHeight = nDY;
- mbScreenComp = TRUE;
+ mbScreenComp = sal_True;
mnAlphaDepth = -1;
// #i59315# init vdev size from system object, when passed a
@@ -98,12 +98,12 @@ void VirtualDevice::ImplInitVirDev( const OutputDevice* pOutDev,
SetAntialiasing( ANTIALIASING_DISABLE_TEXT );
if ( pOutDev->GetOutDevType() == OUTDEV_PRINTER )
- mbScreenComp = FALSE;
+ mbScreenComp = sal_False;
else if ( pOutDev->GetOutDevType() == OUTDEV_VIRDEV )
mbScreenComp = ((VirtualDevice*)pOutDev)->mbScreenComp;
meOutDevType = OUTDEV_VIRDEV;
- mbDevOutput = TRUE;
+ mbDevOutput = sal_True;
mpFontList = pSVData->maGDIData.mpScreenFontList;
mpFontCache = pSVData->maGDIData.mpScreenFontCache;
mnDPIX = pOutDev->mnDPIX;
@@ -135,7 +135,7 @@ void VirtualDevice::ImplInitVirDev( const OutputDevice* pOutDev,
// -----------------------------------------------------------------------
-VirtualDevice::VirtualDevice( USHORT nBitCount )
+VirtualDevice::VirtualDevice( sal_uInt16 nBitCount )
: mpVirDev( NULL ),
meRefDevMode( REFDEV_NONE )
{
@@ -146,7 +146,7 @@ VirtualDevice::VirtualDevice( USHORT nBitCount )
// -----------------------------------------------------------------------
-VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, USHORT nBitCount )
+VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, sal_uInt16 nBitCount )
: mpVirDev( NULL ),
meRefDevMode( REFDEV_NONE )
{
@@ -157,7 +157,7 @@ VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, USHORT nBitCount )
// -----------------------------------------------------------------------
-VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, USHORT nBitCount, USHORT nAlphaBitCount )
+VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, sal_uInt16 nBitCount, sal_uInt16 nAlphaBitCount )
: mpVirDev( NULL ),
meRefDevMode( REFDEV_NONE )
{
@@ -171,7 +171,7 @@ VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, USHORT nBitCount, US
// -----------------------------------------------------------------------
-VirtualDevice::VirtualDevice( const SystemGraphicsData *pData, USHORT nBitCount )
+VirtualDevice::VirtualDevice( const SystemGraphicsData *pData, sal_uInt16 nBitCount )
: mpVirDev( NULL ),
meRefDevMode( REFDEV_NONE )
{
@@ -207,20 +207,20 @@ VirtualDevice::~VirtualDevice()
// -----------------------------------------------------------------------
-BOOL VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, BOOL bErase )
+sal_Bool VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, sal_Bool bErase )
{
OSL_TRACE( "VirtualDevice::ImplSetOutputSizePixel( %ld, %ld, %d )", rNewSize.Width(), rNewSize.Height(), (int)bErase );
if ( !mpVirDev )
- return FALSE;
+ return sal_False;
else if ( rNewSize == GetOutputSizePixel() )
{
if ( bErase )
Erase();
- return TRUE;
+ return sal_True;
}
- BOOL bRet;
+ sal_Bool bRet;
long nNewWidth = rNewSize.Width(), nNewHeight = rNewSize.Height();
if ( nNewWidth < 1 )
@@ -249,7 +249,7 @@ BOOL VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, BOOL bErase )
if ( !mpGraphics )
{
if ( !ImplGetGraphics() )
- return FALSE;
+ return sal_False;
}
pNewVirDev = pSVData->mpDefInst->CreateVirtualDevice( mpGraphics, nNewWidth, nNewHeight, mnBitCount );
@@ -285,16 +285,16 @@ BOOL VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, BOOL bErase )
mpVirDev = pNewVirDev;
mnOutWidth = rNewSize.Width();
mnOutHeight = rNewSize.Height();
- bRet = TRUE;
+ bRet = sal_True;
}
else
{
- bRet = FALSE;
+ bRet = sal_False;
pSVData->mpDefInst->DestroyVirtualDevice( pNewVirDev );
}
}
else
- bRet = FALSE;
+ bRet = sal_False;
}
return bRet;
@@ -318,7 +318,7 @@ void VirtualDevice::ImplFillOpaqueRectangle( const Rectangle& rRect )
// -----------------------------------------------------------------------
-BOOL VirtualDevice::SetOutputSizePixel( const Size& rNewSize, BOOL bErase )
+sal_Bool VirtualDevice::SetOutputSizePixel( const Size& rNewSize, sal_Bool bErase )
{
if( ImplSetOutputSizePixel(rNewSize, bErase) )
{
@@ -347,10 +347,10 @@ BOOL VirtualDevice::SetOutputSizePixel( const Size& rNewSize, BOOL bErase )
mpAlphaVDev->SetMapMode( GetMapMode() );
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -362,7 +362,7 @@ void VirtualDevice::SetReferenceDevice( RefDevMode i_eRefDevMode )
{
case REFDEV_NONE:
default:
- DBG_ASSERT( FALSE, "VDev::SetRefDev illegal argument!" );
+ DBG_ASSERT( sal_False, "VDev::SetRefDev illegal argument!" );
break;
case REFDEV_MODE06:
nDPIX = nDPIY = 600;
@@ -390,17 +390,17 @@ void VirtualDevice::ImplSetReferenceDevice( RefDevMode i_eRefDevMode, sal_Int32
mnDPIX = i_nDPIX;
mnDPIY = i_nDPIY;
- EnableOutput( FALSE ); // prevent output on reference device
- mbScreenComp = FALSE;
+ EnableOutput( sal_False ); // prevent output on reference device
+ mbScreenComp = sal_False;
// invalidate currently selected fonts
- mbInitFont = TRUE;
- mbNewFont = TRUE;
+ mbInitFont = sal_True;
+ mbNewFont = sal_True;
// avoid adjusting font lists when already in refdev mode
- BYTE nOldRefDevMode = meRefDevMode;
- BYTE nOldCompatFlag = (BYTE)meRefDevMode & REFDEV_FORCE_ZERO_EXTLEAD;
- meRefDevMode = (BYTE)(i_eRefDevMode | nOldCompatFlag);
+ sal_uInt8 nOldRefDevMode = meRefDevMode;
+ sal_uInt8 nOldCompatFlag = (sal_uInt8)meRefDevMode & REFDEV_FORCE_ZERO_EXTLEAD;
+ meRefDevMode = (sal_uInt8)(i_eRefDevMode | nOldCompatFlag);
if( (nOldRefDevMode ^ nOldCompatFlag) != REFDEV_NONE )
return;
@@ -441,7 +441,7 @@ void VirtualDevice::ImplSetReferenceDevice( RefDevMode i_eRefDevMode, sal_Int32
void VirtualDevice::Compat_ZeroExtleadBug()
{
- meRefDevMode = (BYTE)meRefDevMode | REFDEV_FORCE_ZERO_EXTLEAD;
+ meRefDevMode = (sal_uInt8)meRefDevMode | REFDEV_FORCE_ZERO_EXTLEAD;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/gdi/wall.cxx b/vcl/source/gdi/wall.cxx
index 2feff9a9f5ef..600f78941cbe 100644
--- a/vcl/source/gdi/wall.cxx
+++ b/vcl/source/gdi/wall.cxx
@@ -112,7 +112,7 @@ void ImplWallpaper::ImplReleaseCachedBitmap()
SvStream& operator>>( SvStream& rIStm, ImplWallpaper& rImplWallpaper )
{
VersionCompat aCompat( rIStm, STREAM_READ );
- UINT16 nTmp16;
+ sal_uInt16 nTmp16;
delete rImplWallpaper.mpRect;
rImplWallpaper.mpRect = NULL;
@@ -130,7 +130,7 @@ SvStream& operator>>( SvStream& rIStm, ImplWallpaper& rImplWallpaper )
// version 2
if( aCompat.GetVersion() >= 2 )
{
- BOOL bRect, bGrad, bBmp, bDummy;
+ sal_Bool bRect, bGrad, bBmp, bDummy;
rIStm >> bRect >> bGrad >> bBmp >> bDummy >> bDummy >> bDummy;
@@ -155,7 +155,7 @@ SvStream& operator>>( SvStream& rIStm, ImplWallpaper& rImplWallpaper )
// version 3 (new color format)
if( aCompat.GetVersion() >= 3 )
{
- rImplWallpaper.maColor.Read( rIStm, TRUE );
+ rImplWallpaper.maColor.Read( rIStm, sal_True );
}
}
@@ -167,13 +167,13 @@ SvStream& operator>>( SvStream& rIStm, ImplWallpaper& rImplWallpaper )
SvStream& operator<<( SvStream& rOStm, const ImplWallpaper& rImplWallpaper )
{
VersionCompat aCompat( rOStm, STREAM_WRITE, 3 );
- BOOL bRect = ( rImplWallpaper.mpRect != NULL );
- BOOL bGrad = ( rImplWallpaper.mpGradient != NULL );
- BOOL bBmp = ( rImplWallpaper.mpBitmap != NULL );
- BOOL bDummy = FALSE;
+ sal_Bool bRect = ( rImplWallpaper.mpRect != NULL );
+ sal_Bool bGrad = ( rImplWallpaper.mpGradient != NULL );
+ sal_Bool bBmp = ( rImplWallpaper.mpBitmap != NULL );
+ sal_Bool bDummy = sal_False;
// version 1
- rOStm << rImplWallpaper.maColor << (UINT16) rImplWallpaper.meStyle;
+ rOStm << rImplWallpaper.maColor << (sal_uInt16) rImplWallpaper.meStyle;
// version 2
rOStm << bRect << bGrad << bBmp << bDummy << bDummy << bDummy;
@@ -188,14 +188,14 @@ SvStream& operator<<( SvStream& rOStm, const ImplWallpaper& rImplWallpaper )
rOStm << *rImplWallpaper.mpBitmap;
// version 3 (new color format)
- ( (Color&) rImplWallpaper.maColor ).Write( rOStm, TRUE );
+ ( (Color&) rImplWallpaper.maColor ).Write( rOStm, sal_True );
return rOStm;
}
// -----------------------------------------------------------------------
-inline void Wallpaper::ImplMakeUnique( BOOL bReleaseCache )
+inline void Wallpaper::ImplMakeUnique( sal_Bool bReleaseCache )
{
// Falls noch andere Referenzen bestehen, dann kopieren
if ( mpImplWallpaper->mnRefCount != 1 )
@@ -314,7 +314,7 @@ void Wallpaper::SetStyle( WallpaperStyle eStyle )
{
DBG_CHKTHIS( Wallpaper, NULL );
- ImplMakeUnique( FALSE );
+ ImplMakeUnique( sal_False );
if( eStyle == WALLPAPER_APPLICATIONGRADIENT )
// set a dummy gradient, the correct gradient
@@ -392,7 +392,7 @@ BitmapEx Wallpaper::GetBitmap() const
// -----------------------------------------------------------------------
-BOOL Wallpaper::IsBitmap() const
+sal_Bool Wallpaper::IsBitmap() const
{
DBG_CHKTHIS( Wallpaper, NULL );
@@ -450,7 +450,7 @@ Gradient Wallpaper::GetGradient() const
// -----------------------------------------------------------------------
-BOOL Wallpaper::IsGradient() const
+sal_Bool Wallpaper::IsGradient() const
{
DBG_CHKTHIS( Wallpaper, NULL );
@@ -480,7 +480,7 @@ void Wallpaper::SetRect( const Rectangle& rRect )
{
DBG_CHKTHIS( Wallpaper, NULL );
- ImplMakeUnique( FALSE );
+ ImplMakeUnique( sal_False );
if ( rRect.IsEmpty() )
{
@@ -507,7 +507,7 @@ void Wallpaper::SetRect()
if ( mpImplWallpaper->mpRect )
{
- ImplMakeUnique( FALSE );
+ ImplMakeUnique( sal_False );
delete mpImplWallpaper->mpRect;
mpImplWallpaper->mpRect = NULL;
}
@@ -530,7 +530,7 @@ Rectangle Wallpaper::GetRect() const
// -----------------------------------------------------------------------
-BOOL Wallpaper::IsRect() const
+sal_Bool Wallpaper::IsRect() const
{
DBG_CHKTHIS( Wallpaper, NULL );
@@ -540,26 +540,26 @@ BOOL Wallpaper::IsRect() const
// -----------------------------------------------------------------------
-BOOL Wallpaper::IsFixed() const
+sal_Bool Wallpaper::IsFixed() const
{
if ( mpImplWallpaper->meStyle == WALLPAPER_NULL )
- return FALSE;
+ return sal_False;
else
return (!mpImplWallpaper->mpBitmap && !mpImplWallpaper->mpGradient);
}
// -----------------------------------------------------------------------
-BOOL Wallpaper::IsScrollable() const
+sal_Bool Wallpaper::IsScrollable() const
{
if ( mpImplWallpaper->meStyle == WALLPAPER_NULL )
- return FALSE;
+ return sal_False;
else if ( !mpImplWallpaper->mpBitmap && !mpImplWallpaper->mpGradient )
- return TRUE;
+ return sal_True;
else if ( mpImplWallpaper->mpBitmap )
return (mpImplWallpaper->meStyle == WALLPAPER_TILE);
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -591,37 +591,37 @@ Wallpaper& Wallpaper::operator=( const Wallpaper& rWallpaper )
// -----------------------------------------------------------------------
-BOOL Wallpaper::operator==( const Wallpaper& rWallpaper ) const
+sal_Bool Wallpaper::operator==( const Wallpaper& rWallpaper ) const
{
DBG_CHKTHIS( Wallpaper, NULL );
DBG_CHKOBJ( &rWallpaper, Wallpaper, NULL );
if ( mpImplWallpaper == rWallpaper.mpImplWallpaper )
- return TRUE;
+ return sal_True;
if ( ( mpImplWallpaper->meStyle != rWallpaper.mpImplWallpaper->meStyle ) ||
( mpImplWallpaper->maColor != rWallpaper.mpImplWallpaper->maColor ) )
- return FALSE;
+ return sal_False;
if ( mpImplWallpaper->mpRect != rWallpaper.mpImplWallpaper->mpRect
&& ( !mpImplWallpaper->mpRect
|| !rWallpaper.mpImplWallpaper->mpRect
|| *(mpImplWallpaper->mpRect) != *(rWallpaper.mpImplWallpaper->mpRect) ) )
- return FALSE;
+ return sal_False;
if ( mpImplWallpaper->mpBitmap != rWallpaper.mpImplWallpaper->mpBitmap
&& ( !mpImplWallpaper->mpBitmap
|| !rWallpaper.mpImplWallpaper->mpBitmap
|| *(mpImplWallpaper->mpBitmap) != *(rWallpaper.mpImplWallpaper->mpBitmap) ) )
- return FALSE;
+ return sal_False;
if ( mpImplWallpaper->mpGradient != rWallpaper.mpImplWallpaper->mpGradient
&& ( !mpImplWallpaper->mpGradient
|| !rWallpaper.mpImplWallpaper->mpGradient
|| *(mpImplWallpaper->mpGradient) != *(rWallpaper.mpImplWallpaper->mpGradient) ) )
- return FALSE;
+ return sal_False;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx
index 3a285e1338bc..52c80febe64b 100644
--- a/vcl/source/glyphs/gcach_ftyp.cxx
+++ b/vcl/source/glyphs/gcach_ftyp.cxx
@@ -314,7 +314,7 @@ const void * graphiteFontTable(const void* appFaceHandle, unsigned int name, siz
tableId.m_id = swapped.m_id;
#endif
tableId.m_c[4] = '\0';
- ULONG nLength = 0;
+ sal_uLong nLength = 0;
const void * pTable = static_cast<const void*>(pFontInfo->GetTable(tableId.m_c, &nLength));
if (len) *len = static_cast<size_t>(nLength);
return pTable;
@@ -338,6 +338,7 @@ FtFontInfo::FtFontInfo( const ImplDevFontAttributes& rDevFontAttributes,
#endif
mnFontId( nFontId ),
maDevFontAttributes( rDevFontAttributes ),
+ mpFontCharMap( NULL ),
mpChar2Glyph( NULL ),
mpGlyph2Char( NULL ),
mpExtraKernInfo( pExtraKernInfo )
@@ -355,6 +356,8 @@ FtFontInfo::FtFontInfo( const ImplDevFontAttributes& rDevFontAttributes,
FtFontInfo::~FtFontInfo()
{
+ if( mpFontCharMap )
+ mpFontCharMap->DeReference();
delete mpExtraKernInfo;
delete mpChar2Glyph;
delete mpGlyph2Char;
@@ -469,7 +472,7 @@ static unsigned GetUShort( const unsigned char* p ){ return((p[0]<<8)+p[1]);}
// -----------------------------------------------------------------------
-const unsigned char* FtFontInfo::GetTable( const char* pTag, ULONG* pLength ) const
+const unsigned char* FtFontInfo::GetTable( const char* pTag, sal_uLong* pLength ) const
{
const unsigned char* pBuffer = mpFontFile->GetBuffer();
int nFileSize = mpFontFile->GetFileSize();
@@ -492,7 +495,7 @@ const unsigned char* FtFontInfo::GetTable( const char* pTag, ULONG* pLength ) co
{
if( p[0]==pTag[0] && p[1]==pTag[1] && p[2]==pTag[2] && p[3]==pTag[3] )
{
- ULONG nLength = GetUInt( p + 12 );
+ sal_uLong nLength = GetUInt( p + 12 );
if( pLength != NULL )
*pLength = nLength;
const unsigned char* pTable = pBuffer + GetUInt( p + 8 );
@@ -1097,7 +1100,7 @@ void FreetypeServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor
// Check for CJK capabilities of the current font
// #107888# workaround for Asian...
// TODO: remove when ExtLeading fully implemented
- BOOL bCJKCapable = ((pOS2->ulUnicodeRange2 & 0x2DF00000) != 0);
+ sal_Bool bCJKCapable = ((pOS2->ulUnicodeRange2 & 0x2DF00000) != 0);
if ( bCJKCapable && (pOS2->usWinAscent || pOS2->usWinDescent) )
{
@@ -1524,7 +1527,7 @@ bool FreetypeServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& rRawBitmap
// #i15743# freetype API 2.1.3 changed the FT_RENDER_MODE_MONO constant
FT_Render_Mode nRenderMode = (FT_Render_Mode)((nFTVERSION<2103) ? 1 : FT_RENDER_MODE_MONO);
- rc = FT_Glyph_To_Bitmap( &pGlyphFT, nRenderMode, NULL, TRUE );
+ rc = FT_Glyph_To_Bitmap( &pGlyphFT, nRenderMode, NULL, sal_True );
if( rc != FT_Err_Ok )
{
FT_Done_Glyph( pGlyphFT );
@@ -1552,7 +1555,7 @@ bool FreetypeServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& rRawBitmap
rRawBitmap.mnScanlineSize = rBitmapFT.pitch;
}
- const ULONG nNeededSize = rRawBitmap.mnScanlineSize * rRawBitmap.mnHeight;
+ const sal_uLong nNeededSize = rRawBitmap.mnScanlineSize * rRawBitmap.mnHeight;
if( rRawBitmap.mnAllocated < nNeededSize )
{
@@ -1578,10 +1581,10 @@ bool FreetypeServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& rRawBitmap
}
unsigned char* p = rRawBitmap.mpBits;
- for( ULONG y=0; y < rRawBitmap.mnHeight; y++ )
+ for( sal_uLong y=0; y < rRawBitmap.mnHeight; y++ )
{
unsigned char nLastByte = 0;
- for( ULONG x=0; x < rRawBitmap.mnScanlineSize; x++ )
+ for( sal_uLong x=0; x < rRawBitmap.mnScanlineSize; x++ )
{
unsigned char nTmp = p[x] << 7;
p[x] |= (p[x] >> 1) | nLastByte;
@@ -1679,7 +1682,7 @@ bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap
bool bEmbedded = (pGlyphFT->format == FT_GLYPH_FORMAT_BITMAP);
if( !bEmbedded )
{
- rc = FT_Glyph_To_Bitmap( &pGlyphFT, FT_RENDER_MODE_NORMAL, NULL, TRUE );
+ rc = FT_Glyph_To_Bitmap( &pGlyphFT, FT_RENDER_MODE_NORMAL, NULL, sal_True );
if( rc != FT_Err_Ok )
{
FT_Done_Glyph( pGlyphFT );
@@ -1703,7 +1706,7 @@ bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap
}
rRawBitmap.mnScanlineSize = (rRawBitmap.mnScanlineSize + 3) & -4;
- const ULONG nNeededSize = rRawBitmap.mnScanlineSize * rRawBitmap.mnHeight;
+ const sal_uLong nNeededSize = rRawBitmap.mnScanlineSize * rRawBitmap.mnHeight;
if( rRawBitmap.mnAllocated < nNeededSize )
{
delete[] rRawBitmap.mpBits;
@@ -1743,10 +1746,10 @@ bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap
{
// overlay with glyph image shifted by one left pixel
unsigned char* p = rRawBitmap.mpBits;
- for( ULONG y=0; y < rRawBitmap.mnHeight; y++ )
+ for( sal_uLong y=0; y < rRawBitmap.mnHeight; y++ )
{
unsigned char nLastByte = 0;
- for( ULONG x=0; x < rRawBitmap.mnWidth; x++ )
+ for( sal_uLong x=0; x < rRawBitmap.mnWidth; x++ )
{
unsigned char nTmp = p[x];
p[x] |= p[x] | nLastByte;
@@ -1759,9 +1762,9 @@ bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap
if( !bEmbedded && mbUseGamma )
{
unsigned char* p = rRawBitmap.mpBits;
- for( ULONG y=0; y < rRawBitmap.mnHeight; y++ )
+ for( sal_uLong y=0; y < rRawBitmap.mnHeight; y++ )
{
- for( ULONG x=0; x < rRawBitmap.mnWidth; x++ )
+ for( sal_uLong x=0; x < rRawBitmap.mnWidth; x++ )
{
p[x] = aGammaTable[ p[x] ];
}
@@ -1789,16 +1792,39 @@ bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap
// determine unicode ranges in font
// -----------------------------------------------------------------------
-// TODO: replace with GetFontCharMap()
-bool FreetypeServerFont::GetFontCodeRanges( CmapResult& rResult ) const
+const ImplFontCharMap* FreetypeServerFont::GetImplFontCharMap( void ) const
{
- rResult.mbSymbolic = mpFontInfo->IsSymbolFont();
+ const ImplFontCharMap* pIFCMap = mpFontInfo->GetImplFontCharMap();
+ return pIFCMap;
+}
+
+const ImplFontCharMap* FtFontInfo::GetImplFontCharMap( void )
+{
+ // check if the charmap is already cached
+ if( mpFontCharMap )
+ return mpFontCharMap;
+
+ // get the charmap and cache it
+ CmapResult aCmapResult;
+ bool bOK = GetFontCodeRanges( aCmapResult );
+ if( bOK )
+ mpFontCharMap = new ImplFontCharMap( aCmapResult );
+ else
+ mpFontCharMap = ImplFontCharMap::GetDefaultMap();
+ mpFontCharMap->AddReference();
+ return mpFontCharMap;
+}
+
+// TODO: merge into method GetFontCharMap()
+bool FtFontInfo::GetFontCodeRanges( CmapResult& rResult ) const
+{
+ rResult.mbSymbolic = IsSymbolFont();
// TODO: is the full CmapResult needed on platforms calling this?
if( FT_IS_SFNT( maFaceFT ) )
{
- ULONG nLength = 0;
- const unsigned char* pCmap = mpFontInfo->GetTable( "cmap", &nLength );
+ sal_uLong nLength = 0;
+ const unsigned char* pCmap = GetTable( "cmap", &nLength );
if( pCmap && (nLength > 0) )
if( ParseCMAP( pCmap, nLength, rResult ) )
return true;
@@ -1843,7 +1869,7 @@ bool FreetypeServerFont::GetFontCapabilities(vcl::FontCapabilities &rFontCapabil
{
bool bRet = false;
- ULONG nLength = 0;
+ sal_uLong nLength = 0;
// load GSUB table
const FT_Byte* pGSUB = mpFontInfo->GetTable("GSUB", &nLength);
if (pGSUB)
@@ -1896,7 +1922,7 @@ int FreetypeServerFont::GetGlyphKernValue( int nGlyphLeft, int nGlyphRight ) con
// -----------------------------------------------------------------------
-ULONG FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
+sal_uLong FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
{
// if no kerning info is available in the font file
*ppKernPairs = NULL;
@@ -1922,7 +1948,7 @@ ULONG FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
pFTActivateSize( maSizeFT );
// first figure out which glyph pairs are involved in kerning
- ULONG nKernLength = 0;
+ sal_uLong nKernLength = 0;
const FT_Byte* const pKern = mpFontInfo->GetTable( "kern", &nKernLength );
if( !pKern )
return 0;
@@ -1940,19 +1966,19 @@ ULONG FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
aKernPair.mnKern = 0; // To prevent "is used uninitialized" warning...
const FT_Byte* pBuffer = pKern;
- ULONG nVersion = GetUShort( pBuffer+0 );
- USHORT nTableCnt = GetUShort( pBuffer+2 );
+ sal_uLong nVersion = GetUShort( pBuffer+0 );
+ sal_uInt16 nTableCnt = GetUShort( pBuffer+2 );
// Microsoft/Old TrueType style kern table
if ( nVersion == 0 )
{
pBuffer += 4;
- for( USHORT nTableIdx = 0; nTableIdx < nTableCnt; ++nTableIdx )
+ for( sal_uInt16 nTableIdx = 0; nTableIdx < nTableCnt; ++nTableIdx )
{
- // USHORT nSubVersion = GetUShort( pBuffer+0 );
- // USHORT nSubLength = GetUShort( pBuffer+2 );
- USHORT nSubCoverage = GetUShort( pBuffer+4 );
+ // sal_uInt16 nSubVersion = GetUShort( pBuffer+0 );
+ // sal_uInt16 nSubLength = GetUShort( pBuffer+2 );
+ sal_uInt16 nSubCoverage = GetUShort( pBuffer+4 );
pBuffer += 6;
if( (nSubCoverage&0x03) != 0x01 ) // no interest in minimum info here
continue;
@@ -1960,7 +1986,7 @@ ULONG FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
{
case 0: // version 0, kerning format 0
{
- USHORT nPairs = GetUShort( pBuffer );
+ sal_uInt16 nPairs = GetUShort( pBuffer );
pBuffer += 8; // skip search hints
aKernGlyphVector.reserve( aKernGlyphVector.size() + nPairs );
for( int i = 0; i < nPairs; ++i )
@@ -1977,21 +2003,21 @@ ULONG FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
case 2: // version 0, kerning format 2
{
const FT_Byte* pSubTable = pBuffer;
- //USHORT nRowWidth = GetUShort( pBuffer+0 );
- USHORT nOfsLeft = GetUShort( pBuffer+2 );
- USHORT nOfsRight = GetUShort( pBuffer+4 );
- USHORT nOfsArray = GetUShort( pBuffer+6 );
+ //sal_uInt16 nRowWidth = GetUShort( pBuffer+0 );
+ sal_uInt16 nOfsLeft = GetUShort( pBuffer+2 );
+ sal_uInt16 nOfsRight = GetUShort( pBuffer+4 );
+ sal_uInt16 nOfsArray = GetUShort( pBuffer+6 );
pBuffer += 8;
const FT_Byte* pTmp = pSubTable + nOfsLeft;
- USHORT nFirstLeft = GetUShort( pTmp+0 );
- USHORT nLastLeft = GetUShort( pTmp+2 ) + nFirstLeft - 1;
+ sal_uInt16 nFirstLeft = GetUShort( pTmp+0 );
+ sal_uInt16 nLastLeft = GetUShort( pTmp+2 ) + nFirstLeft - 1;
pTmp = pSubTable + nOfsRight;
- USHORT nFirstRight = GetUShort( pTmp+0 );
- USHORT nLastRight = GetUShort( pTmp+2 ) + nFirstRight - 1;
+ sal_uInt16 nFirstRight = GetUShort( pTmp+0 );
+ sal_uInt16 nLastRight = GetUShort( pTmp+2 ) + nFirstRight - 1;
- ULONG nPairs = (ULONG)(nLastLeft - nFirstLeft + 1) * (nLastRight - nFirstRight + 1);
+ sal_uLong nPairs = (sal_uLong)(nLastLeft - nFirstLeft + 1) * (nLastRight - nFirstRight + 1);
aKernGlyphVector.reserve( aKernGlyphVector.size() + nPairs );
pTmp = pSubTable + nOfsArray;
@@ -2020,11 +2046,11 @@ ULONG FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
nTableCnt = NEXT_U32( pBuffer );
if ( nVersion == 0x00010000 )
{
- for( USHORT nTableIdx = 0; nTableIdx < nTableCnt; ++nTableIdx )
+ for( sal_uInt16 nTableIdx = 0; nTableIdx < nTableCnt; ++nTableIdx )
{
- /*ULONG nLength =*/ NEXT_U32( pBuffer );
- USHORT nCoverage = NEXT_U16( pBuffer );
- /*USHORT nTupleIndex =*/ NEXT_U16( pBuffer );
+ /*sal_uLong nLength =*/ NEXT_U32( pBuffer );
+ sal_uInt16 nCoverage = NEXT_U16( pBuffer );
+ /*sal_uInt16 nTupleIndex =*/ NEXT_U16( pBuffer );
// Kerning sub-table format, 0 through 3
sal_uInt8 nSubTableFormat = nCoverage & 0x00FF;
@@ -2033,7 +2059,7 @@ ULONG FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
{
case 0: // version 0, kerning format 0
{
- USHORT nPairs = NEXT_U16( pBuffer );
+ sal_uInt16 nPairs = NEXT_U16( pBuffer );
pBuffer += 6; // skip search hints
aKernGlyphVector.reserve( aKernGlyphVector.size() + nPairs );
for( int i = 0; i < nPairs; ++i )
@@ -2049,20 +2075,20 @@ ULONG FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
case 2: // version 0, kerning format 2
{
const FT_Byte* pSubTable = pBuffer;
- /*USHORT nRowWidth =*/ NEXT_U16( pBuffer );
- USHORT nOfsLeft = NEXT_U16( pBuffer );
- USHORT nOfsRight = NEXT_U16( pBuffer );
- USHORT nOfsArray = NEXT_U16( pBuffer );
+ /*sal_uInt16 nRowWidth =*/ NEXT_U16( pBuffer );
+ sal_uInt16 nOfsLeft = NEXT_U16( pBuffer );
+ sal_uInt16 nOfsRight = NEXT_U16( pBuffer );
+ sal_uInt16 nOfsArray = NEXT_U16( pBuffer );
const FT_Byte* pTmp = pSubTable + nOfsLeft;
- USHORT nFirstLeft = NEXT_U16( pTmp );
- USHORT nLastLeft = NEXT_U16( pTmp ) + nFirstLeft - 1;
+ sal_uInt16 nFirstLeft = NEXT_U16( pTmp );
+ sal_uInt16 nLastLeft = NEXT_U16( pTmp ) + nFirstLeft - 1;
pTmp = pSubTable + nOfsRight;
- USHORT nFirstRight = NEXT_U16( pTmp );
- USHORT nLastRight = NEXT_U16( pTmp ) + nFirstRight - 1;
+ sal_uInt16 nFirstRight = NEXT_U16( pTmp );
+ sal_uInt16 nLastRight = NEXT_U16( pTmp ) + nFirstRight - 1;
- ULONG nPairs = (ULONG)(nLastLeft - nFirstLeft + 1) * (nLastRight - nFirstRight + 1);
+ sal_uLong nPairs = (sal_uLong)(nLastLeft - nFirstLeft + 1) * (nLastRight - nFirstRight + 1);
aKernGlyphVector.reserve( aKernGlyphVector.size() + nPairs );
pTmp = pSubTable + nOfsArray;
@@ -2089,17 +2115,17 @@ ULONG FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
}
// now create VCL's ImplKernPairData[] format for all glyph pairs
- ULONG nKernCount = aKernGlyphVector.size();
+ sal_uLong nKernCount = aKernGlyphVector.size();
if( nKernCount )
{
// prepare glyphindex to character mapping
// TODO: this is needed to support VCL's existing kerning infrastructure,
// eliminate it up by redesigning kerning infrastructure to work with glyph indizes
- typedef boost::unordered_multimap<USHORT,sal_Unicode> Cmap;
+ typedef boost::unordered_multimap<sal_uInt16,sal_Unicode> Cmap;
Cmap aCmap;
for( sal_Unicode aChar = 0x0020; aChar < 0xFFFE; ++aChar )
{
- USHORT nGlyphIndex = GetGlyphIndex( aChar );
+ sal_uInt16 nGlyphIndex = GetGlyphIndex( aChar );
if( nGlyphIndex )
aCmap.insert( Cmap::value_type( nGlyphIndex, aChar ) );
}
@@ -2154,7 +2180,7 @@ ULONG FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
class PolyArgs
{
public:
- PolyArgs( PolyPolygon& rPolyPoly, USHORT nMaxPoints );
+ PolyArgs( PolyPolygon& rPolyPoly, sal_uInt16 nMaxPoints );
~PolyArgs();
void AddPoint( long nX, long nY, PolyFlags);
@@ -2167,19 +2193,19 @@ private:
PolyPolygon& mrPolyPoly;
Point* mpPointAry;
- BYTE* mpFlagAry;
+ sal_uInt8* mpFlagAry;
FT_Vector maPosition;
- USHORT mnMaxPoints;
- USHORT mnPoints;
- USHORT mnPoly;
+ sal_uInt16 mnMaxPoints;
+ sal_uInt16 mnPoints;
+ sal_uInt16 mnPoly;
long mnHeight;
bool bHasOffline;
};
// -----------------------------------------------------------------------
-PolyArgs::PolyArgs( PolyPolygon& rPolyPoly, USHORT nMaxPoints )
+PolyArgs::PolyArgs( PolyPolygon& rPolyPoly, sal_uInt16 nMaxPoints )
: mrPolyPoly(rPolyPoly),
mnMaxPoints(nMaxPoints),
mnPoints(0),
@@ -2188,7 +2214,7 @@ PolyArgs::PolyArgs( PolyPolygon& rPolyPoly, USHORT nMaxPoints )
bHasOffline(false)
{
mpPointAry = new Point[ mnMaxPoints ];
- mpFlagAry = new BYTE [ mnMaxPoints ];
+ mpFlagAry = new sal_uInt8 [ mnMaxPoints ];
}
// -----------------------------------------------------------------------
@@ -2396,56 +2422,56 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
{
#define MKTAG(s) ((((((s[0]<<8)+s[1])<<8)+s[2])<<8)+s[3])
- typedef std::vector<ULONG> ReqFeatureTagList;
+ typedef std::vector<sal_uLong> ReqFeatureTagList;
ReqFeatureTagList aReqFeatureTagList;
if( rFSD.mbVertical )
aReqFeatureTagList.push_back( MKTAG("vert") );
- ULONG nRequestedScript = 0; //MKTAG("hani");//### TODO: where to get script?
- ULONG nRequestedLangsys = 0; //MKTAG("ZHT"); //### TODO: where to get langsys?
+ sal_uLong nRequestedScript = 0; //MKTAG("hani");//### TODO: where to get script?
+ sal_uLong nRequestedLangsys = 0; //MKTAG("ZHT"); //### TODO: where to get langsys?
// TODO: request more features depending on script and language system
if( aReqFeatureTagList.size() == 0) // nothing to do
return true;
// load GSUB table into memory
- ULONG nLength = 0;
+ sal_uLong nLength = 0;
const FT_Byte* const pGsubBase = mpFontInfo->GetTable( "GSUB", &nLength );
if( !pGsubBase )
return false;
// parse GSUB header
const FT_Byte* pGsubHeader = pGsubBase;
- const USHORT nOfsScriptList = GetUShort( pGsubHeader+4 );
- const USHORT nOfsFeatureTable = GetUShort( pGsubHeader+6 );
- const USHORT nOfsLookupList = GetUShort( pGsubHeader+8 );
+ const sal_uInt16 nOfsScriptList = GetUShort( pGsubHeader+4 );
+ const sal_uInt16 nOfsFeatureTable = GetUShort( pGsubHeader+6 );
+ const sal_uInt16 nOfsLookupList = GetUShort( pGsubHeader+8 );
pGsubHeader += 10;
- typedef std::vector<USHORT> UshortList;
+ typedef std::vector<sal_uInt16> UshortList;
UshortList aFeatureIndexList;
UshortList aFeatureOffsetList;
// parse Script Table
const FT_Byte* pScriptHeader = pGsubBase + nOfsScriptList;
- const USHORT nCntScript = GetUShort( pScriptHeader+0 );
+ const sal_uInt16 nCntScript = GetUShort( pScriptHeader+0 );
pScriptHeader += 2;
- for( USHORT nScriptIndex = 0; nScriptIndex < nCntScript; ++nScriptIndex )
+ for( sal_uInt16 nScriptIndex = 0; nScriptIndex < nCntScript; ++nScriptIndex )
{
- const ULONG nScriptTag = GetUInt( pScriptHeader+0 ); // e.g. hani/arab/kana/hang
- const USHORT nOfsScriptTable= GetUShort( pScriptHeader+4 );
+ const sal_uLong nScriptTag = GetUInt( pScriptHeader+0 ); // e.g. hani/arab/kana/hang
+ const sal_uInt16 nOfsScriptTable= GetUShort( pScriptHeader+4 );
pScriptHeader += 6; //###
if( (nScriptTag != nRequestedScript) && (nRequestedScript != 0) )
continue;
const FT_Byte* pScriptTable = pGsubBase + nOfsScriptList + nOfsScriptTable;
- const USHORT nDefaultLangsysOfs = GetUShort( pScriptTable+0 );
- const USHORT nCntLangSystem = GetUShort( pScriptTable+2 );
+ const sal_uInt16 nDefaultLangsysOfs = GetUShort( pScriptTable+0 );
+ const sal_uInt16 nCntLangSystem = GetUShort( pScriptTable+2 );
pScriptTable += 4;
- USHORT nLangsysOffset = 0;
+ sal_uInt16 nLangsysOffset = 0;
- for( USHORT nLangsysIndex = 0; nLangsysIndex < nCntLangSystem; ++nLangsysIndex )
+ for( sal_uInt16 nLangsysIndex = 0; nLangsysIndex < nCntLangSystem; ++nLangsysIndex )
{
- const ULONG nTag = GetUInt( pScriptTable+0 ); // e.g. KOR/ZHS/ZHT/JAN
- const USHORT nOffset= GetUShort( pScriptTable+4 );
+ const sal_uLong nTag = GetUInt( pScriptTable+0 ); // e.g. KOR/ZHS/ZHT/JAN
+ const sal_uInt16 nOffset= GetUShort( pScriptTable+4 );
pScriptTable += 6;
if( (nTag != nRequestedLangsys) && (nRequestedLangsys != 0) )
continue;
@@ -2456,13 +2482,13 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
if( (nDefaultLangsysOfs != 0) && (nDefaultLangsysOfs != nLangsysOffset) )
{
const FT_Byte* pLangSys = pGsubBase + nOfsScriptList + nOfsScriptTable + nDefaultLangsysOfs;
- const USHORT nReqFeatureIdx = GetUShort( pLangSys+2 );
- const USHORT nCntFeature = GetUShort( pLangSys+4 );
+ const sal_uInt16 nReqFeatureIdx = GetUShort( pLangSys+2 );
+ const sal_uInt16 nCntFeature = GetUShort( pLangSys+4 );
pLangSys += 6;
aFeatureIndexList.push_back( nReqFeatureIdx );
- for( USHORT i = 0; i < nCntFeature; ++i )
+ for( sal_uInt16 i = 0; i < nCntFeature; ++i )
{
- const USHORT nFeatureIndex = GetUShort( pLangSys );
+ const sal_uInt16 nFeatureIndex = GetUShort( pLangSys );
pLangSys += 2;
aFeatureIndexList.push_back( nFeatureIndex );
}
@@ -2471,13 +2497,13 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
if( nLangsysOffset != 0 )
{
const FT_Byte* pLangSys = pGsubBase + nOfsScriptList + nOfsScriptTable + nLangsysOffset;
- const USHORT nReqFeatureIdx = GetUShort( pLangSys+2 );
- const USHORT nCntFeature = GetUShort( pLangSys+4 );
+ const sal_uInt16 nReqFeatureIdx = GetUShort( pLangSys+2 );
+ const sal_uInt16 nCntFeature = GetUShort( pLangSys+4 );
pLangSys += 6;
aFeatureIndexList.push_back( nReqFeatureIdx );
- for( USHORT i = 0; i < nCntFeature; ++i )
+ for( sal_uInt16 i = 0; i < nCntFeature; ++i )
{
- const USHORT nFeatureIndex = GetUShort( pLangSys );
+ const sal_uInt16 nFeatureIndex = GetUShort( pLangSys );
pLangSys += 2;
aFeatureIndexList.push_back( nFeatureIndex );
}
@@ -2492,12 +2518,12 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
// parse Feature Table
const FT_Byte* pFeatureHeader = pGsubBase + nOfsFeatureTable;
- const USHORT nCntFeature = GetUShort( pFeatureHeader );
+ const sal_uInt16 nCntFeature = GetUShort( pFeatureHeader );
pFeatureHeader += 2;
- for( USHORT nFeatureIndex = 0; nFeatureIndex < nCntFeature; ++nFeatureIndex )
+ for( sal_uInt16 nFeatureIndex = 0; nFeatureIndex < nCntFeature; ++nFeatureIndex )
{
- const ULONG nTag = GetUInt( pFeatureHeader+0 ); // e.g. locl/vert/trad/smpl/liga/fina/...
- const USHORT nOffset= GetUShort( pFeatureHeader+4 );
+ const sal_uLong nTag = GetUInt( pFeatureHeader+0 ); // e.g. locl/vert/trad/smpl/liga/fina/...
+ const sal_uInt16 nOffset= GetUShort( pFeatureHeader+4 );
pFeatureHeader += 6;
// short circuit some feature lookups
@@ -2512,11 +2538,11 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
}
const FT_Byte* pFeatureTable = pGsubBase + nOfsFeatureTable + nOffset;
- const USHORT nCntLookups = GetUShort( pFeatureTable+0 );
+ const sal_uInt16 nCntLookups = GetUShort( pFeatureTable+0 );
pFeatureTable += 2;
- for( USHORT i = 0; i < nCntLookups; ++i )
+ for( sal_uInt16 i = 0; i < nCntLookups; ++i )
{
- const USHORT nLookupIndex = GetUShort( pFeatureTable );
+ const sal_uInt16 nLookupIndex = GetUShort( pFeatureTable );
pFeatureTable += 2;
aLookupIndexList.push_back( nLookupIndex );
}
@@ -2526,11 +2552,11 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
// parse Lookup List
const FT_Byte* pLookupHeader = pGsubBase + nOfsLookupList;
- const USHORT nCntLookupTable = GetUShort( pLookupHeader );
+ const sal_uInt16 nCntLookupTable = GetUShort( pLookupHeader );
pLookupHeader += 2;
- for( USHORT nLookupIdx = 0; nLookupIdx < nCntLookupTable; ++nLookupIdx )
+ for( sal_uInt16 nLookupIdx = 0; nLookupIdx < nCntLookupTable; ++nLookupIdx )
{
- const USHORT nOffset = GetUShort( pLookupHeader );
+ const sal_uInt16 nOffset = GetUShort( pLookupHeader );
pLookupHeader += 2;
if( std::count( aLookupIndexList.begin(), aLookupIndexList.end(), nLookupIdx ) )
aLookupOffsetList.push_back( nOffset );
@@ -2539,43 +2565,43 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
UshortList::const_iterator lookup_it = aLookupOffsetList.begin();
for(; lookup_it != aLookupOffsetList.end(); ++lookup_it )
{
- const USHORT nOfsLookupTable = *lookup_it;
+ const sal_uInt16 nOfsLookupTable = *lookup_it;
const FT_Byte* pLookupTable = pGsubBase + nOfsLookupList + nOfsLookupTable;
- const USHORT eLookupType = GetUShort( pLookupTable+0 );
- const USHORT nCntLookupSubtable = GetUShort( pLookupTable+4 );
+ const sal_uInt16 eLookupType = GetUShort( pLookupTable+0 );
+ const sal_uInt16 nCntLookupSubtable = GetUShort( pLookupTable+4 );
pLookupTable += 6;
// TODO: switch( eLookupType )
if( eLookupType != 1 ) // TODO: once we go beyond SingleSubst
continue;
- for( USHORT nSubTableIdx = 0; nSubTableIdx < nCntLookupSubtable; ++nSubTableIdx )
+ for( sal_uInt16 nSubTableIdx = 0; nSubTableIdx < nCntLookupSubtable; ++nSubTableIdx )
{
- const USHORT nOfsSubLookupTable = GetUShort( pLookupTable );
+ const sal_uInt16 nOfsSubLookupTable = GetUShort( pLookupTable );
pLookupTable += 2;
const FT_Byte* pSubLookup = pGsubBase + nOfsLookupList + nOfsLookupTable + nOfsSubLookupTable;
- const USHORT nFmtSubstitution = GetUShort( pSubLookup+0 );
- const USHORT nOfsCoverage = GetUShort( pSubLookup+2 );
+ const sal_uInt16 nFmtSubstitution = GetUShort( pSubLookup+0 );
+ const sal_uInt16 nOfsCoverage = GetUShort( pSubLookup+2 );
pSubLookup += 4;
- typedef std::pair<USHORT,USHORT> GlyphSubst;
+ typedef std::pair<sal_uInt16,sal_uInt16> GlyphSubst;
typedef std::vector<GlyphSubst> SubstVector;
SubstVector aSubstVector;
const FT_Byte* pCoverage = pGsubBase + nOfsLookupList + nOfsLookupTable + nOfsSubLookupTable + nOfsCoverage;
- const USHORT nFmtCoverage = GetUShort( pCoverage+0 );
+ const sal_uInt16 nFmtCoverage = GetUShort( pCoverage+0 );
pCoverage += 2;
switch( nFmtCoverage )
{
case 1: // Coverage Format 1
{
- const USHORT nCntGlyph = GetUShort( pCoverage );
+ const sal_uInt16 nCntGlyph = GetUShort( pCoverage );
pCoverage += 2;
aSubstVector.reserve( nCntGlyph );
- for( USHORT i = 0; i < nCntGlyph; ++i )
+ for( sal_uInt16 i = 0; i < nCntGlyph; ++i )
{
- const USHORT nGlyphId = GetUShort( pCoverage );
+ const sal_uInt16 nGlyphId = GetUShort( pCoverage );
pCoverage += 2;
aSubstVector.push_back( GlyphSubst( nGlyphId, 0 ) );
}
@@ -2584,16 +2610,16 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
case 2: // Coverage Format 2
{
- const USHORT nCntRange = GetUShort( pCoverage );
+ const sal_uInt16 nCntRange = GetUShort( pCoverage );
pCoverage += 2;
for( int i = nCntRange; --i >= 0; )
{
- const UINT32 nGlyph0 = GetUShort( pCoverage+0 );
- const UINT32 nGlyph1 = GetUShort( pCoverage+2 );
- const USHORT nCovIdx = GetUShort( pCoverage+4 );
+ const sal_uInt32 nGlyph0 = GetUShort( pCoverage+0 );
+ const sal_uInt32 nGlyph1 = GetUShort( pCoverage+2 );
+ const sal_uInt16 nCovIdx = GetUShort( pCoverage+4 );
pCoverage += 6;
- for( UINT32 j = nGlyph0; j <= nGlyph1; ++j )
- aSubstVector.push_back( GlyphSubst( static_cast<USHORT>(j + nCovIdx), 0 ) );
+ for( sal_uInt32 j = nGlyph0; j <= nGlyph1; ++j )
+ aSubstVector.push_back( GlyphSubst( static_cast<sal_uInt16>(j + nCovIdx), 0 ) );
}
}
break;
@@ -2605,7 +2631,7 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
{
case 1: // Single Substitution Format 1
{
- const USHORT nDeltaGlyphId = GetUShort( pSubLookup );
+ const sal_uInt16 nDeltaGlyphId = GetUShort( pSubLookup );
pSubLookup += 2;
for(; it != aSubstVector.end(); ++it )
(*it).second = (*it).first + nDeltaGlyphId;
@@ -2614,11 +2640,11 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
case 2: // Single Substitution Format 2
{
- const USHORT nCntGlyph = GetUShort( pSubLookup );
+ const sal_uInt16 nCntGlyph = GetUShort( pSubLookup );
pSubLookup += 2;
for( int i = nCntGlyph; (it != aSubstVector.end()) && (--i>=0); ++it )
{
- const USHORT nGlyphId = GetUShort( pSubLookup );
+ const sal_uInt16 nGlyphId = GetUShort( pSubLookup );
pSubLookup += 2;
(*it).second = nGlyphId;
}
diff --git a/vcl/source/glyphs/gcach_ftyp.hxx b/vcl/source/glyphs/gcach_ftyp.hxx
index 0313406d30ea..caf8bfab1f9c 100644
--- a/vcl/source/glyphs/gcach_ftyp.hxx
+++ b/vcl/source/glyphs/gcach_ftyp.hxx
@@ -82,7 +82,7 @@ public:
const ExtraKernInfo* );
~FtFontInfo();
- const unsigned char* GetTable( const char*, ULONG* pLength=0 ) const;
+ const unsigned char* GetTable( const char*, sal_uLong* pLength=0 ) const;
FT_FaceRec_* GetFaceFT();
#ifdef ENABLE_GRAPHITE
@@ -102,6 +102,9 @@ public:
int GetGlyphIndex( sal_UCS4 cChar ) const;
void CacheGlyphIndex( sal_UCS4 cChar, int nGI ) const;
+ bool GetFontCodeRanges( CmapResult& ) const;
+ const ImplFontCharMap* GetImplFontCharMap( void );
+
bool HasExtraKerning() const;
int GetExtraKernPairs( ImplKernPairData** ) const;
int GetExtraGlyphKernValue( int nLeftGlyph, int nRightGlyph ) const;
@@ -119,6 +122,8 @@ private:
sal_IntPtr mnFontId;
ImplDevFontAttributes maDevFontAttributes;
+ const ImplFontCharMap* mpFontCharMap;
+
// cache unicode->glyphid mapping because looking it up is expensive
// TODO: change to boost::unordered_multimap when a use case requires a m:n mapping
typedef ::boost::unordered_map<int,int> Int2IntMap;
@@ -193,6 +198,7 @@ public:
virtual bool NeedsArtificialItalic() const { return mbArtItalic; }
virtual void FetchFontMetric( ImplFontMetricData&, long& rFactor ) const;
+ virtual const ImplFontCharMap* GetImplFontCharMap( void ) const;
virtual int GetGlyphIndex( sal_UCS4 ) const;
int GetRawGlyphIndex( sal_UCS4 ) const;
@@ -203,9 +209,9 @@ public:
virtual bool GetGlyphBitmap8( int nGlyphIndex, RawBitmap& ) const;
virtual bool GetGlyphOutline( int nGlyphIndex, ::basegfx::B2DPolyPolygon& ) const;
virtual int GetGlyphKernValue( int nLeftGlyph, int nRightGlyph ) const;
- virtual ULONG GetKernPairs( ImplKernPairData** ) const;
+ virtual sal_uLong GetKernPairs( ImplKernPairData** ) const;
- const unsigned char* GetTable( const char* pName, ULONG* pLength )
+ const unsigned char* GetTable( const char* pName, sal_uLong* pLength )
{ return mpFontInfo->GetTable( pName, pLength ); }
int GetEmUnits() const;
const FT_Size_Metrics& GetMetricsFT() const { return maSizeFT->metrics; }
@@ -218,7 +224,6 @@ protected:
int ApplyGlyphTransform( int nGlyphFlags, FT_GlyphRec_*, bool ) const;
virtual void InitGlyphData( int nGlyphIndex, GlyphData& ) const;
- virtual bool GetFontCodeRanges( CmapResult& ) const;
virtual bool GetFontCapabilities(vcl::FontCapabilities &) const;
bool ApplyGSUB( const ImplFontSelectData& );
virtual ServerFontLayoutEngine* GetLayoutEngine();
diff --git a/vcl/source/glyphs/gcach_layout.cxx b/vcl/source/glyphs/gcach_layout.cxx
index d1b99bcd85e1..63a332869664 100644..100755
--- a/vcl/source/glyphs/gcach_layout.cxx
+++ b/vcl/source/glyphs/gcach_layout.cxx
@@ -229,7 +229,7 @@ const void* IcuFontFromServerFont::getFontTable( LETag nICUTableTag ) const
pTagName[3] = (char)(nICUTableTag);
pTagName[4] = 0;
- ULONG nLength;
+ sal_uLong nLength;
const unsigned char* pBuffer = mrServerFont.GetTable( pTagName, &nLength );
#ifdef VERBOSE_DEBUG
fprintf(stderr,"IcuGetTable(\"%s\") => %p\n", pTagName, pBuffer);
diff --git a/vcl/source/glyphs/gcach_rbmp.cxx b/vcl/source/glyphs/gcach_rbmp.cxx
index f951590b4b45..161e4c6314e7 100644..100755
--- a/vcl/source/glyphs/gcach_rbmp.cxx
+++ b/vcl/source/glyphs/gcach_rbmp.cxx
@@ -172,9 +172,9 @@ static void ImplRotate1_180( unsigned char* p1, const unsigned char* p2,
bool RawBitmap::Rotate( int nAngle )
{
- ULONG nNewScanlineSize = 0;
- ULONG nNewHeight = 0;
- ULONG nNewWidth = 0;
+ sal_uLong nNewScanlineSize = 0;
+ sal_uLong nNewHeight = 0;
+ sal_uLong nNewWidth = 0;
// do inplace rotation or prepare double buffered rotation
switch( nAngle )
diff --git a/vcl/source/glyphs/gcach_vdev.cxx b/vcl/source/glyphs/gcach_vdev.cxx
index 7a090de30128..944d9aee16a3 100644
--- a/vcl/source/glyphs/gcach_vdev.cxx
+++ b/vcl/source/glyphs/gcach_vdev.cxx
@@ -138,7 +138,7 @@ void VirtDevServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor
rTo.meWeight = aFSD.meWeight;
rTo.meItalic = aFSD.meItalic;
rTo.mePitch = aFSD.mePitch;
- rTo.mbDevice = FALSE;
+ rTo.mbDevice = sal_False;
}
// -----------------------------------------------------------------------
@@ -195,7 +195,7 @@ bool VirtDevServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& ) const
String aGlyphStr( &aChar, 1 );
// draw bitmap
- vdev.SetOutputSizePixel( aSize, TRUE );
+ vdev.SetOutputSizePixel( aSize, sal_True );
vdev.DrawText( Point(0,0)-rGD.GetMetric().GetOffset(), aGlyphStr );
// create new glyph item
@@ -223,7 +223,7 @@ int VirtDevServerFont::GetGlyphKernValue( int, int ) const
// -----------------------------------------------------------------------
-ULONG VirtDevServerFont::GetKernPairs( ImplKernPairData** ppImplKernPairs ) const
+sal_uLong VirtDevServerFont::GetKernPairs( ImplKernPairData** ppImplKernPairs ) const
{
Font aFont;
aFont.SetName ( GetFontSelData().maName );
@@ -236,7 +236,7 @@ ULONG VirtDevServerFont::GetKernPairs( ImplKernPairData** ppImplKernPairs ) cons
VirtualDevice vdev( 1 );
vdev.SetFont( aFont );
- ULONG nPairs = vdev.GetKerningPairCount();
+ sal_uLong nPairs = vdev.GetKerningPairCount();
if( nPairs > 0 )
{
KerningPair* const pKernPairs = new KerningPair[ nPairs ];
@@ -245,7 +245,7 @@ ULONG VirtDevServerFont::GetKernPairs( ImplKernPairData** ppImplKernPairs ) cons
*ppImplKernPairs = new ImplKernPairData[ nPairs ];
ImplKernPairData* pTo = *ppImplKernPairs;
KerningPair* pFrom = pKernPairs;
- for ( ULONG n = 0; n < nPairs; n++ )
+ for ( sal_uLong n = 0; n < nPairs; n++ )
{
pTo->mnChar1 = pFrom->nChar1;
pTo->mnChar2 = pFrom->nChar2;
diff --git a/vcl/source/glyphs/gcach_vdev.hxx b/vcl/source/glyphs/gcach_vdev.hxx
index 48d602677c16..61cd02b1f9cc 100644
--- a/vcl/source/glyphs/gcach_vdev.hxx
+++ b/vcl/source/glyphs/gcach_vdev.hxx
@@ -45,7 +45,7 @@ protected:
static VirtDevServerFont* CreateFont( const ImplFontSelectData& );
virtual void FetchFontMetric( ImplFontMetricData&, long& rFactor ) const;
- virtual ULONG GetKernPairs( ImplKernPairData** ) const;
+ virtual sal_uLong GetKernPairs( ImplKernPairData** ) const;
virtual int GetGlyphKernValue( int, int ) const;
virtual int GetGlyphIndex( sal_Unicode ) const;
diff --git a/vcl/source/glyphs/glyphcache.cxx b/vcl/source/glyphs/glyphcache.cxx
index 6824b7d70ac8..deef658c0c56 100644
--- a/vcl/source/glyphs/glyphcache.cxx
+++ b/vcl/source/glyphs/glyphcache.cxx
@@ -85,6 +85,18 @@ GlyphCache::~GlyphCache()
void GlyphCache::InvalidateAllGlyphs()
{
+ // an application about to exit can omit garbage collecting the heap
+ // since it makes things slower and introduces risks if the heap was not perfect
+ // for debugging, for memory grinding or leak checking the env allows to force GC
+ const char* pEnv = getenv( "SAL_FORCE_GC_ON_EXIT" );
+ if( pEnv && (*pEnv != '0') )
+ {
+ // uncache of all glyph shapes and metrics
+ for( FontList::iterator it = maFontList.begin(); it != maFontList.end(); ++it )
+ delete const_cast<ServerFont*>( it->second );
+ maFontList.clear();
+ mpCurrentGCFont = NULL;
+ }
}
// -----------------------------------------------------------------------
@@ -289,9 +301,9 @@ void GlyphCache::UncacheFont( ServerFont& rServerFont )
// -----------------------------------------------------------------------
-ULONG GlyphCache::CalcByteCount() const
+sal_uLong GlyphCache::CalcByteCount() const
{
- ULONG nCacheSize = sizeof(*this);
+ sal_uLong nCacheSize = sizeof(*this);
for( FontList::const_iterator it = maFontList.begin(); it != maFontList.end(); ++it )
{
const ServerFont* pSF = it->second;
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx
index 9d02c5fa6b88..76db71bfb0dc 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -920,7 +920,7 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDelt
assert((nChar2BaseJ >= -1) && (nChar2BaseJ < (signed)mvGlyphs.size()));
if (nChar2BaseJ != -1 )
{
- nLastGlyph = nChar2BaseJ + ((bRtl)? 1 : -1);
+ nLastGlyph = nChar2BaseJ + ((bRtl)? +1 : -1);
nLastChar = j - 1;
break;
}
diff --git a/vcl/source/helper/canvasbitmap.cxx b/vcl/source/helper/canvasbitmap.cxx
index fc15cc77dcce..3138c55b2bb5 100644
--- a/vcl/source/helper/canvasbitmap.cxx
+++ b/vcl/source/helper/canvasbitmap.cxx
@@ -66,7 +66,7 @@ namespace
}
}
-void VclCanvasBitmap::setComponentInfo( ULONG redShift, ULONG greenShift, ULONG blueShift )
+void VclCanvasBitmap::setComponentInfo( sal_uLong redShift, sal_uLong greenShift, sal_uLong blueShift )
{
// sort channels in increasing order of appearance in the pixel
// (starting with the least significant bits)
@@ -683,14 +683,14 @@ sal_Bool SAL_CALL VclCanvasBitmap::getIndex( uno::Sequence< double >& o_entry, s
{
SolarMutexGuard aGuard;
- const USHORT nCount( m_pBmpAcc ?
+ const sal_uInt16 nCount( m_pBmpAcc ?
(m_pBmpAcc->HasPalette() ? m_pBmpAcc->GetPaletteEntryCount() : 0 ) : 0 );
OSL_ENSURE(nIndex >= 0 && nIndex < nCount,"Palette index out of range");
if( nIndex < 0 || nIndex >= nCount )
throw lang::IndexOutOfBoundsException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Palette index out of range")),
static_cast<rendering::XBitmapPalette*>(this));
- const BitmapColor aCol = m_pBmpAcc->GetPaletteColor(sal::static_int_cast<USHORT>(nIndex));
+ const BitmapColor aCol = m_pBmpAcc->GetPaletteColor(sal::static_int_cast<sal_uInt16>(nIndex));
o_entry.realloc(3);
double* pColor=o_entry.getArray();
pColor[0] = aCol.GetRed();
@@ -704,7 +704,7 @@ sal_Bool SAL_CALL VclCanvasBitmap::setIndex( const uno::Sequence< double >&, sal
{
SolarMutexGuard aGuard;
- const USHORT nCount( m_pBmpAcc ?
+ const sal_uInt16 nCount( m_pBmpAcc ?
(m_pBmpAcc->HasPalette() ? m_pBmpAcc->GetPaletteEntryCount() : 0 ) : 0 );
OSL_ENSURE(nIndex >= 0 && nIndex < nCount,"Palette index out of range");
@@ -788,7 +788,7 @@ uno::Sequence<rendering::RGBColor> SAL_CALL VclCanvasBitmap::convertToRGB( const
for( sal_Size i=0; i<nLen; i+=nComponentsPerPixel )
{
const BitmapColor aCol = m_pBmpAcc->GetPaletteColor(
- sal::static_int_cast<USHORT>(deviceColor[i+m_nIndexIndex]));
+ sal::static_int_cast<sal_uInt16>(deviceColor[i+m_nIndexIndex]));
// TODO(F3): Convert result to sRGB color space
*pOut++ = rendering::RGBColor(toDoubleColor(aCol.GetRed()),
@@ -837,7 +837,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertToARGB( con
for( sal_Size i=0; i<nLen; i+=nComponentsPerPixel )
{
const BitmapColor aCol = m_pBmpAcc->GetPaletteColor(
- sal::static_int_cast<USHORT>(deviceColor[i+m_nIndexIndex]));
+ sal::static_int_cast<sal_uInt16>(deviceColor[i+m_nIndexIndex]));
// TODO(F3): Convert result to sRGB color space
const double nAlpha( m_nAlphaIndex != -1 ? 1.0 - deviceColor[i+m_nAlphaIndex] : 1.0 );
@@ -890,7 +890,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertToPARGB( co
for( sal_Size i=0; i<nLen; i+=nComponentsPerPixel )
{
const BitmapColor aCol = m_pBmpAcc->GetPaletteColor(
- sal::static_int_cast<USHORT>(deviceColor[i+m_nIndexIndex]));
+ sal::static_int_cast<sal_uInt16>(deviceColor[i+m_nIndexIndex]));
// TODO(F3): Convert result to sRGB color space
const double nAlpha( m_nAlphaIndex != -1 ? 1.0 - deviceColor[i+m_nAlphaIndex] : 1.0 );
@@ -1086,7 +1086,7 @@ uno::Sequence<double> SAL_CALL VclCanvasBitmap::convertFromIntegerColorSpace( co
for( sal_Size i=0; i<nLen; i+=nComponentsPerPixel )
{
const BitmapColor aCol = m_pBmpAcc->GetPaletteColor(
- sal::static_int_cast<USHORT>(deviceColor[i+m_nIndexIndex]));
+ sal::static_int_cast<sal_uInt16>(deviceColor[i+m_nIndexIndex]));
// TODO(F3): Convert result to sRGB color space
const double nAlpha( m_nAlphaIndex != -1 ? 1.0 - deviceColor[i+m_nAlphaIndex] : 1.0 );
@@ -1146,7 +1146,7 @@ uno::Sequence<rendering::RGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToRGB
{
SolarMutexGuard aGuard;
- const BYTE* pIn( reinterpret_cast<const BYTE*>(deviceColor.getConstArray()) );
+ const sal_uInt8* pIn( reinterpret_cast<const sal_uInt8*>(deviceColor.getConstArray()) );
const sal_Size nLen( deviceColor.getLength() );
const sal_Int32 nNumColors((nLen*8 + m_nBitsPerOutputPixel-1)/m_nBitsPerOutputPixel);
@@ -1182,7 +1182,7 @@ uno::Sequence<rendering::RGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToRGB
const BitmapColor aCol =
m_bPalette ?
m_pBmpAcc->GetPaletteColor(
- sal::static_int_cast<USHORT>(
+ sal::static_int_cast<sal_uInt16>(
m_pBmpAcc->GetPixelFromData(
pIn, i ))) :
m_pBmpAcc->GetPixelFromData(pIn, i);
@@ -1201,7 +1201,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToAR
{
SolarMutexGuard aGuard;
- const BYTE* pIn( reinterpret_cast<const BYTE*>(deviceColor.getConstArray()) );
+ const sal_uInt8* pIn( reinterpret_cast<const sal_uInt8*>(deviceColor.getConstArray()) );
const sal_Size nLen( deviceColor.getLength() );
const sal_Int32 nNumColors((nLen*8 + m_nBitsPerOutputPixel-1)/m_nBitsPerOutputPixel);
@@ -1239,7 +1239,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToAR
const BitmapColor aCol =
m_bPalette ?
m_pBmpAcc->GetPaletteColor(
- sal::static_int_cast<USHORT>(
+ sal::static_int_cast<sal_uInt16>(
m_pBmpAcc->GetPixelFromData(
pIn, i ))) :
m_pBmpAcc->GetPixelFromData(pIn, i);
@@ -1259,7 +1259,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToPA
{
SolarMutexGuard aGuard;
- const BYTE* pIn( reinterpret_cast<const BYTE*>(deviceColor.getConstArray()) );
+ const sal_uInt8* pIn( reinterpret_cast<const sal_uInt8*>(deviceColor.getConstArray()) );
const sal_Size nLen( deviceColor.getLength() );
const sal_Int32 nNumColors((nLen*8 + m_nBitsPerOutputPixel-1)/m_nBitsPerOutputPixel);
@@ -1298,7 +1298,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToPA
const BitmapColor aCol =
m_bPalette ?
m_pBmpAcc->GetPaletteColor(
- sal::static_int_cast<USHORT>(
+ sal::static_int_cast<sal_uInt16>(
m_pBmpAcc->GetPixelFromData(
pIn, i ))) :
m_pBmpAcc->GetPixelFromData(pIn, i);
@@ -1322,7 +1322,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromRGB( con
const sal_Int32 nNumBytes((nLen*m_nBitsPerOutputPixel+7)/8);
uno::Sequence< sal_Int8 > aRes(nNumBytes);
- BYTE* pColors=reinterpret_cast<BYTE*>(aRes.getArray());
+ sal_uInt8* pColors=reinterpret_cast<sal_uInt8*>(aRes.getArray());
if( m_aBmpEx.IsTransparent() )
{
@@ -1335,12 +1335,12 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromRGB( con
const BitmapColor aCol2 =
m_bPalette ?
BitmapColor(
- sal::static_int_cast<BYTE>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
+ sal::static_int_cast<sal_uInt8>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
aCol;
m_pBmpAcc->SetPixelOnData(pColors,0,aCol2);
pColors += nNonAlphaBytes;
- *pColors++ = BYTE(255);
+ *pColors++ = sal_uInt8(255);
}
}
else
@@ -1353,7 +1353,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromRGB( con
const BitmapColor aCol2 =
m_bPalette ?
BitmapColor(
- sal::static_int_cast<BYTE>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
+ sal::static_int_cast<sal_uInt8>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
aCol;
m_pBmpAcc->SetPixelOnData(pColors,i,aCol2);
@@ -1371,7 +1371,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromARGB( co
const sal_Int32 nNumBytes((nLen*m_nBitsPerOutputPixel+7)/8);
uno::Sequence< sal_Int8 > aRes(nNumBytes);
- BYTE* pColors=reinterpret_cast<BYTE*>(aRes.getArray());
+ sal_uInt8* pColors=reinterpret_cast<sal_uInt8*>(aRes.getArray());
if( m_aBmpEx.IsTransparent() )
{
@@ -1384,7 +1384,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromARGB( co
const BitmapColor aCol2 =
m_bPalette ?
BitmapColor(
- sal::static_int_cast<BYTE>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
+ sal::static_int_cast<sal_uInt8>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
aCol;
m_pBmpAcc->SetPixelOnData(pColors,0,aCol2);
@@ -1402,7 +1402,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromARGB( co
const BitmapColor aCol2 =
m_bPalette ?
BitmapColor(
- sal::static_int_cast<BYTE>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
+ sal::static_int_cast<sal_uInt8>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
aCol;
m_pBmpAcc->SetPixelOnData(pColors,i,aCol2);
@@ -1420,7 +1420,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromPARGB( c
const sal_Int32 nNumBytes((nLen*m_nBitsPerOutputPixel+7)/8);
uno::Sequence< sal_Int8 > aRes(nNumBytes);
- BYTE* pColors=reinterpret_cast<BYTE*>(aRes.getArray());
+ sal_uInt8* pColors=reinterpret_cast<sal_uInt8*>(aRes.getArray());
if( m_aBmpEx.IsTransparent() )
{
@@ -1434,7 +1434,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromPARGB( c
const BitmapColor aCol2 =
m_bPalette ?
BitmapColor(
- sal::static_int_cast<BYTE>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
+ sal::static_int_cast<sal_uInt8>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
aCol;
m_pBmpAcc->SetPixelOnData(pColors,0,aCol2);
@@ -1452,7 +1452,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromPARGB( c
const BitmapColor aCol2 =
m_bPalette ?
BitmapColor(
- sal::static_int_cast<BYTE>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
+ sal::static_int_cast<sal_uInt8>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
aCol;
m_pBmpAcc->SetPixelOnData(pColors,i,aCol2);
diff --git a/vcl/source/helper/canvastools.cxx b/vcl/source/helper/canvastools.cxx
index 005d544b9e02..3bf73ca7588d 100644
--- a/vcl/source/helper/canvastools.cxx
+++ b/vcl/source/helper/canvastools.cxx
@@ -117,11 +117,11 @@ namespace vcl
{
RTL_LOGFILE_CONTEXT( aLog, "::vcl::unotools::polygonFromPoint2DSequence()" );
- const USHORT nCurrSize( sal::static_int_cast<USHORT>(points.getLength()) );
+ const sal_uInt16 nCurrSize( sal::static_int_cast<sal_uInt16>(points.getLength()) );
::Polygon aPoly( nCurrSize );
- USHORT nCurrPoint;
+ sal_uInt16 nCurrPoint;
for( nCurrPoint=0; nCurrPoint<nCurrSize; ++nCurrPoint )
aPoly[nCurrPoint] = pointFromRealPoint2D( points[nCurrPoint] );
@@ -255,7 +255,7 @@ namespace vcl
{
const rendering::ARGBColor& rColor=aARGBColors[x];
rWriteAcc->SetPixel( aRect.Y1, x,
- (BYTE)rWriteAcc->GetBestPaletteIndex(
+ (sal_uInt8)rWriteAcc->GetBestPaletteIndex(
BitmapColor( toByteColor(rColor.Red),
toByteColor(rColor.Green),
toByteColor(rColor.Blue))) );
@@ -287,7 +287,7 @@ namespace vcl
{
const rendering::RGBColor& rColor=aRGBColors[x];
rWriteAcc->SetPixel( aRect.Y1, x,
- (BYTE)rWriteAcc->GetBestPaletteIndex(
+ (sal_uInt8)rWriteAcc->GetBestPaletteIndex(
BitmapColor( toByteColor(rColor.Red),
toByteColor(rColor.Green),
toByteColor(rColor.Blue))) );
@@ -385,8 +385,8 @@ namespace vcl
else
nDepth = 8;
- const USHORT nPaletteEntries(
- sal::static_int_cast<USHORT>(
+ const sal_uInt16 nPaletteEntries(
+ sal::static_int_cast<sal_uInt16>(
std::min(sal_Int32(255), nEntryCount)));
// copy palette entries
@@ -395,7 +395,7 @@ namespace vcl
uno::Reference<rendering::XColorSpace> xPalColorSpace( xPalette->getColorSpace() );
uno::Sequence<double> aPaletteEntry;
- for( USHORT j=0; j<nPaletteEntries; ++j )
+ for( sal_uInt16 j=0; j<nPaletteEntries; ++j )
{
if( !xPalette->getIndex(aPaletteEntry,j) &&
nAlphaDepth == 0 )
@@ -423,14 +423,14 @@ namespace vcl
( nDepth <= 8 ) ? 8 : 24;
::Bitmap aBitmap( aPixelSize,
- sal::static_int_cast<USHORT>(nDepth),
+ sal::static_int_cast<sal_uInt16>(nDepth),
aLayout.Palette.is() ? &aPalette : NULL );
::Bitmap aAlpha;
if( nAlphaDepth )
aAlpha = ::Bitmap( aPixelSize,
- sal::static_int_cast<USHORT>(nAlphaDepth),
+ sal::static_int_cast<sal_uInt16>(nAlphaDepth),
&::Bitmap::GetGreyPalette(
- sal::static_int_cast<USHORT>(1L << nAlphaDepth)) );
+ sal::static_int_cast<sal_uInt16>(1L << nAlphaDepth)) );
{ // limit scoped access
ScopedBitmapWriteAccess pWriteAccess( aBitmap.AcquireWriteAccess(),
diff --git a/vcl/source/helper/lazydelete.cxx b/vcl/source/helper/lazydelete.cxx
index 398b8338884d..9173474af759 100644
--- a/vcl/source/helper/lazydelete.cxx
+++ b/vcl/source/helper/lazydelete.cxx
@@ -69,7 +69,7 @@ void LazyDelete::flush()
// specialized is_less function for Window
template<> bool LazyDeletor<Window>::is_less( Window* left, Window* right )
{
- return (left != right && right->IsChild( left, TRUE )) ? true : false;
+ return (left != right && right->IsChild( left, sal_True )) ? true : false;
}
// specialized is_less function for Menu
diff --git a/vcl/source/helper/makefile.mk b/vcl/source/helper/makefile.mk
index e708bdec9eaa..1a417417dbe4 100644
--- a/vcl/source/helper/makefile.mk
+++ b/vcl/source/helper/makefile.mk
@@ -46,7 +46,6 @@ SLOFILES=\
$(SLO)$/canvastools.obj \
$(SLO)$/xconnection.obj \
$(SLO)$/threadex.obj \
- $(SLO)$/smartid.obj \
$(SLO)$/lazydelete.obj
# --- Targets ------------------------------------------------------
diff --git a/vcl/source/helper/smartid.cxx b/vcl/source/helper/smartid.cxx
deleted file mode 100644
index 41a4cbe814ea..000000000000
--- a/vcl/source/helper/smartid.cxx
+++ /dev/null
@@ -1,267 +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_vcl.hxx"
-#include <vcl/smartid.hxx>
-
-struct ImplSmartIdData
-{
- String aUId;
- ULONG nUId;
- BOOL bHasStringId;
- BOOL bHasNumericId;
-};
-
-
-ImplSmartIdData* SmartId::GetSmartIdData()
-{
- if ( !mpData )
- {
- mpData = new ImplSmartIdData;
-// mpData->aUId = "";
- mpData->nUId = 0;
- mpData->bHasStringId = FALSE;
- mpData->bHasNumericId = FALSE;
- }
- return mpData;
-}
-
-
-SmartId::SmartId( const String& rId )
-: mpData( NULL )
-{
- GetSmartIdData()->aUId = rId;
- GetSmartIdData()->bHasStringId = TRUE;
-}
-
-SmartId::SmartId( ULONG nId )
-: mpData( NULL )
-{
- GetSmartIdData()->nUId = nId;
- GetSmartIdData()->bHasNumericId = TRUE;
-}
-
-SmartId::SmartId( const String& rId, ULONG nId )
-: mpData( NULL )
-{
- GetSmartIdData()->aUId = rId;
- GetSmartIdData()->bHasStringId = TRUE;
- GetSmartIdData()->nUId = nId;
- GetSmartIdData()->bHasNumericId = TRUE;
-}
-
-SmartId::SmartId()
-: mpData( NULL )
-{}
-
-SmartId::SmartId( const SmartId& rId )
-: mpData( NULL )
-{
- if ( rId.mpData )
- {
- GetSmartIdData();
- mpData->aUId = rId.mpData->aUId;
- mpData->bHasStringId = rId.mpData->bHasStringId;
- mpData->nUId = rId.mpData->nUId;
- mpData->bHasNumericId = rId.mpData->bHasNumericId;
- }
-}
-
-SmartId& SmartId::operator = ( const SmartId& rId )
-{
- if ( rId.mpData )
- GetSmartIdData();
- else
- {
- delete mpData;
- mpData = NULL;
- }
- if ( mpData && rId.mpData )
- {
- mpData->aUId = rId.mpData->aUId;
- mpData->bHasStringId = rId.mpData->bHasStringId;
- mpData->nUId = rId.mpData->nUId;
- mpData->bHasNumericId = rId.mpData->bHasNumericId;
- }
- return *this;
-}
-
-SmartId::~SmartId()
-{
- if ( mpData )
- delete mpData;
-#ifdef DBG_UTIL
- if ( mpData )
- mpData = (ImplSmartIdData*)0xDeadBeef;
-#endif
-}
-
-void SmartId::UpdateId( const SmartId& rId, SmartIdUpdateMode aMode )
-{
- // Check if ImplData is needed
- if ( aMode != SMART_SET_SMART || ( rId.HasString() || rId.HasNumeric() ) )
- GetSmartIdData();
-
- if ( aMode == SMART_SET_STR || aMode == SMART_SET_ALL || ( aMode == SMART_SET_SMART && rId.HasString() ) )
- {
- GetSmartIdData()->aUId = rId.GetStr();
- GetSmartIdData()->bHasStringId = rId.HasString();
- }
- if ( aMode == SMART_SET_NUM || aMode == SMART_SET_ALL || ( aMode == SMART_SET_SMART && rId.HasNumeric() ) )
- {
- GetSmartIdData()->nUId = rId.GetNum();
- GetSmartIdData()->bHasNumericId = rId.HasNumeric();
- }
-
- // remove ImplData when no IDs are set. This is Important because Implementation of Equals() Matches and HasAny relies on it
- if ( mpData && !mpData->bHasStringId && !mpData->bHasNumericId )
- {
- delete mpData;
- mpData = NULL;
- }
-}
-
-BOOL SmartId::HasNumeric() const
-{
- if ( !mpData )
- return FALSE;
- else
- return mpData->bHasNumericId;
-}
-
-BOOL SmartId::HasString() const
-{
- if ( !mpData )
- return FALSE;
- else
- return mpData->bHasStringId;
-}
-
-BOOL SmartId::HasAny() const
-{
- return mpData != NULL;
-}
-
-ULONG SmartId::GetNum() const
-{
- if ( !mpData )
- return 0;
- else
- return mpData->nUId;
-}
-
-String SmartId::GetStr() const
-{
- if ( !mpData )
- return String();
- else
- return mpData->aUId;
-}
-
-
-String SmartId::GetText() const // return String for UI usage
-{
- String aRes;
- if ( HasNumeric() )
- aRes = String::CreateFromInt64( GetNum() );
- if ( HasString() )
- {
- if ( HasNumeric() )
- aRes.AppendAscii( "/" );
- aRes.Append( GetStr() );
- }
- return aRes;
-}
-
-BOOL SmartId::Matches( const String &rId )const
-{
- if ( HasString() )
- return GetStr().EqualsIgnoreCaseAscii( rId );
- else
- return FALSE;
-}
-
-BOOL SmartId::Matches( const ULONG nId ) const
-{
- if ( HasNumeric() )
- return GetNum() == nId;
- else
- return FALSE;
-}
-
-/******************************************************************************
-If Both Ids have nither Strings nor Numbers they don't match
-If both Ids have Strings the result of Matching these is returned.
-Numbers are then Ignored.
-Else Matching Numbers is attempted.
-******************************************************************************/
-BOOL SmartId::Matches( const SmartId &rId ) const
-{
- if ( !mpData || !rId.mpData )
- return FALSE;
- else if ( HasString() && rId.HasString() )
- return Matches( rId.GetStr() );
- else
- return rId.HasNumeric() && Matches( rId.GetNum() );
-}
-
-BOOL SmartId::Equals( const SmartId &rId ) const
-{
- if ( mpData && rId.mpData )
- return mpData->aUId.EqualsIgnoreCaseAscii( rId.mpData->aUId )
- && mpData->bHasStringId == rId.mpData->bHasStringId
- && mpData->nUId == rId.mpData->nUId
- && mpData->bHasNumericId == rId.mpData->bHasNumericId;
- else if ( !mpData && !rId.mpData )
- return TRUE;
- else
- return FALSE;
-}
-
-BOOL SmartId::operator == ( const SmartId& rRight ) const
-{
- return Equals( rRight );
-}
-
-BOOL SmartId::operator < ( const SmartId& rRight ) const
-{
- if ( HasString() && rRight.HasString() && GetStr() != rRight.GetStr() )
- return GetStr() < rRight.GetStr();
- else if ( HasNumeric() && rRight.HasNumeric() && GetNum() != rRight.GetNum() )
- return GetNum() < rRight.GetNum();
- else
- { // Sort Strings to Front
- if ( HasString() )
- return rRight.HasString() && rRight.HasNumeric();
- else
- return rRight.HasString() || (!HasNumeric() && rRight.HasNumeric());
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx
index 7009468a02ec..c8b5cc7fbf22 100644
--- a/vcl/source/helper/strhelper.cxx
+++ b/vcl/source/helper/strhelper.cxx
@@ -326,7 +326,7 @@ int GetCommandLineTokenCount( const ByteString& rLine )
return nTokenCount;
}
-String WhitespaceToSpace( const String& rLine, BOOL bProtect )
+String WhitespaceToSpace( const String& rLine, sal_Bool bProtect )
{
int nLen = rLine.Len();
if( ! nLen )
@@ -358,11 +358,11 @@ String WhitespaceToSpace( const String& rLine, BOOL bProtect )
pRun++;
}
else if( bProtect && *pRun == '`' )
- CopyUntil( pLeap, pRun, '`', TRUE );
+ CopyUntil( pLeap, pRun, '`', sal_True );
else if( bProtect && *pRun == '\'' )
- CopyUntil( pLeap, pRun, '\'', TRUE );
+ CopyUntil( pLeap, pRun, '\'', sal_True );
else if( bProtect && *pRun == '"' )
- CopyUntil( pLeap, pRun, '"', TRUE );
+ CopyUntil( pLeap, pRun, '"', sal_True );
else
{
*pLeap = *pRun;
@@ -383,7 +383,7 @@ String WhitespaceToSpace( const String& rLine, BOOL bProtect )
return aRet;
}
-ByteString WhitespaceToSpace( const ByteString& rLine, BOOL bProtect )
+ByteString WhitespaceToSpace( const ByteString& rLine, sal_Bool bProtect )
{
int nLen = rLine.Len();
if( ! nLen )
@@ -415,11 +415,11 @@ ByteString WhitespaceToSpace( const ByteString& rLine, BOOL bProtect )
pRun++;
}
else if( bProtect && *pRun == '`' )
- CopyUntil( pLeap, pRun, '`', TRUE );
+ CopyUntil( pLeap, pRun, '`', sal_True );
else if( bProtect && *pRun == '\'' )
- CopyUntil( pLeap, pRun, '\'', TRUE );
+ CopyUntil( pLeap, pRun, '\'', sal_True );
else if( bProtect && *pRun == '"' )
- CopyUntil( pLeap, pRun, '"', TRUE );
+ CopyUntil( pLeap, pRun, '"', sal_True );
else
{
*pLeap = *pRun;
diff --git a/vcl/source/helper/threadex.cxx b/vcl/source/helper/threadex.cxx
index 85ccffd34b6c..ad351410e2c2 100644
--- a/vcl/source/helper/threadex.cxx
+++ b/vcl/source/helper/threadex.cxx
@@ -112,8 +112,8 @@ long SolarThreadExecutor::impl_execute( const TimeValue* _pTimeout )
{
osl_resetCondition( m_aStart );
osl_resetCondition( m_aFinish );
- ULONG nSolarMutexCount = Application::ReleaseSolarMutex();
- ULONG nEvent = Application::PostUserEvent( LINK( this, SolarThreadExecutor, worker ) );
+ sal_uLong nSolarMutexCount = Application::ReleaseSolarMutex();
+ sal_uLong nEvent = Application::PostUserEvent( LINK( this, SolarThreadExecutor, worker ) );
if ( osl_cond_result_timeout == osl_waitCondition( m_aStart, _pTimeout ) )
{
m_bTimeout = true;
diff --git a/vcl/source/helper/xconnection.cxx b/vcl/source/helper/xconnection.cxx
index 0d03348e7712..d6aa0429bcf3 100644
--- a/vcl/source/helper/xconnection.cxx
+++ b/vcl/source/helper/xconnection.cxx
@@ -30,11 +30,18 @@
#include "precompiled_vcl.hxx"
#include "svsys.h"
+#include "rtl/ref.hxx"
#include "vcl/xconnection.hxx"
#include "vcl/svdata.hxx"
#include "vcl/salinst.hxx"
#include "vcl/svapp.hxx"
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
using namespace osl;
using namespace vcl;
using namespace com::sun::star::uno;
@@ -44,13 +51,9 @@ using ::rtl::OUString;
DisplayConnection::DisplayConnection()
{
- ImplSVData* pSVData = ImplGetSVData();
- pSVData->mpDefInst->SetEventCallback( this, dispatchEvent );
- pSVData->mpDefInst->SetErrorEventCallback( this, dispatchErrorEvent );
-
SalInstance::ConnectionIdentifierType eType;
int nBytes;
- void* pBytes = pSVData->mpDefInst->GetConnectionIdentifier( eType, nBytes );
+ void* pBytes = ImplGetSVData()->mpDefInst->GetConnectionIdentifier( eType, nBytes );
switch( eType )
{
case SalInstance::AsciiCString:
@@ -63,39 +66,54 @@ DisplayConnection::DisplayConnection()
}
DisplayConnection::~DisplayConnection()
+{}
+
+void DisplayConnection::start()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ pSVData->mpDefInst->SetEventCallback( this );
+}
+
+void DisplayConnection::terminate()
{
ImplSVData* pSVData = ImplGetSVData();
if( pSVData )
{
- pSVData->mpDefInst->SetEventCallback( NULL, NULL );
- pSVData->mpDefInst->SetErrorEventCallback( NULL, NULL );
+ pSVData->mpDefInst->SetEventCallback( NULL );
}
-}
+ SolarMutexReleaser aRel;
+
+ MutexGuard aGuard( m_aMutex );
+ Any aEvent;
+ std::list< css::uno::Reference< XEventHandler > > aLocalList( m_aHandlers );
+ for( ::std::list< css::uno::Reference< XEventHandler > >::const_iterator it = aLocalList.begin(); it != aLocalList.end(); ++it )
+ (*it)->handleEvent( aEvent );
+}
-void SAL_CALL DisplayConnection::addEventHandler( const Any& /*window*/, const Reference< XEventHandler >& handler, sal_Int32 /*eventMask*/ ) throw()
+void SAL_CALL DisplayConnection::addEventHandler( const Any& /*window*/, const css::uno::Reference< XEventHandler >& handler, sal_Int32 /*eventMask*/ ) throw()
{
MutexGuard aGuard( m_aMutex );
m_aHandlers.push_back( handler );
}
-void SAL_CALL DisplayConnection::removeEventHandler( const Any& /*window*/, const Reference< XEventHandler >& handler ) throw()
+void SAL_CALL DisplayConnection::removeEventHandler( const Any& /*window*/, const css::uno::Reference< XEventHandler >& handler ) throw()
{
MutexGuard aGuard( m_aMutex );
m_aHandlers.remove( handler );
}
-void SAL_CALL DisplayConnection::addErrorHandler( const Reference< XEventHandler >& handler ) throw()
+void SAL_CALL DisplayConnection::addErrorHandler( const css::uno::Reference< XEventHandler >& handler ) throw()
{
MutexGuard aGuard( m_aMutex );
m_aErrorHandlers.push_back( handler );
}
-void SAL_CALL DisplayConnection::removeErrorHandler( const Reference< XEventHandler >& handler ) throw()
+void SAL_CALL DisplayConnection::removeErrorHandler( const css::uno::Reference< XEventHandler >& handler ) throw()
{
MutexGuard aGuard( m_aMutex );
@@ -107,52 +125,37 @@ Any SAL_CALL DisplayConnection::getIdentifier() throw()
return m_aAny;
}
-void DisplayConnection::dispatchDowningEvent()
-{
- SolarMutexReleaser aRel;
-
- MutexGuard aGuard( m_aMutex );
- Any aEvent;
- std::list< Reference< XEventHandler > > aLocalList( m_aHandlers );
- for( ::std::list< Reference< XEventHandler > >::const_iterator it = aLocalList.begin(); it != aLocalList.end(); ++it )
- (*it)->handleEvent( aEvent );
-}
-
-bool DisplayConnection::dispatchEvent( void* pThis, void* pData, int nBytes )
+bool DisplayConnection::dispatchEvent( void* pData, int nBytes )
{
SolarMutexReleaser aRel;
- DisplayConnection* This = (DisplayConnection*)pThis;
-
Sequence< sal_Int8 > aSeq( (sal_Int8*)pData, nBytes );
Any aEvent;
aEvent <<= aSeq;
- ::std::list< Reference< XEventHandler > > handlers;
+ ::std::list< css::uno::Reference< XEventHandler > > handlers;
{
- MutexGuard aGuard( This->m_aMutex );
- handlers = This->m_aHandlers;
+ MutexGuard aGuard( m_aMutex );
+ handlers = m_aHandlers;
}
- for( ::std::list< Reference< XEventHandler > >::const_iterator it = handlers.begin(); it != handlers.end(); ++it )
+ for( ::std::list< css::uno::Reference< XEventHandler > >::const_iterator it = handlers.begin(); it != handlers.end(); ++it )
if( (*it)->handleEvent( aEvent ) )
return true;
return false;
}
-bool DisplayConnection::dispatchErrorEvent( void* pThis, void* pData, int nBytes )
+bool DisplayConnection::dispatchErrorEvent( void* pData, int nBytes )
{
SolarMutexReleaser aRel;
- DisplayConnection* This = (DisplayConnection*)pThis;
-
Sequence< sal_Int8 > aSeq( (sal_Int8*)pData, nBytes );
Any aEvent;
aEvent <<= aSeq;
- ::std::list< Reference< XEventHandler > > handlers;
+ ::std::list< css::uno::Reference< XEventHandler > > handlers;
{
- MutexGuard aGuard( This->m_aMutex );
- handlers = This->m_aErrorHandlers;
+ MutexGuard aGuard( m_aMutex );
+ handlers = m_aErrorHandlers;
}
- for( ::std::list< Reference< XEventHandler > >::const_iterator it = handlers.begin(); it != handlers.end(); ++it )
+ for( ::std::list< css::uno::Reference< XEventHandler > >::const_iterator it = handlers.begin(); it != handlers.end(); ++it )
if( (*it)->handleEvent( aEvent ) )
return true;
diff --git a/vcl/source/salmain/makefile.mk b/vcl/source/salmain/makefile.mk
index de085b482c4d..9c790bf28d75 100644
--- a/vcl/source/salmain/makefile.mk
+++ b/vcl/source/salmain/makefile.mk
@@ -28,11 +28,14 @@
PRJ = ..$/..
PRJNAME = vcl
TARGET = salmain
-LIBTARGET = NO
ENABLE_EXCEPTIONS = TRUE
.INCLUDE: settings.mk
OBJFILES = $(OBJ)$/salmain.obj
+LIB1TARGET=$(LB)$/vclmain.lib
+LIB1ARCHIV=$(LB)$/libvclmain.a
+LIB1FILES=$(LB)$/salmain.lib
+
.INCLUDE: target.mk
diff --git a/vcl/source/src/images.src b/vcl/source/src/images.src
index 871cd6af2b29..541ac34c29e7 100644
--- a/vcl/source/src/images.src
+++ b/vcl/source/src/images.src
@@ -38,25 +38,6 @@ Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_STDOFFSET)
File = "check.png";
};
-Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_WINOFFSET)
-{
- File = "checkwin.png";
-};
-
-Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_OS2OFFSET)
-{
- File = "checkos2.png";
-};
-
-Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_MACOFFSET)
-{
- File = "checkmac.png";
-};
-
-Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_UNIXOFFSET)
-{
- File = "checkunx.png";
-};
Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_MONOOFFSET)
{
@@ -80,26 +61,6 @@ Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_STDOFFSET)
File = "radio.png";
};
-Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_WINOFFSET)
-{
- File = "radiowin.png";
-};
-
-Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_OS2OFFSET)
-{
- File = "radioos2.png";
-};
-
-Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_MACOFFSET)
-{
- File = "radiomac.png";
-};
-
-Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_UNIXOFFSET)
-{
- File = "radiounx.png";
-};
-
Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_MONOOFFSET)
{
File = "radiomono.bmp";
diff --git a/vcl/source/src/makefile.mk b/vcl/source/src/makefile.mk
index 40b7d4e75dfe..2db77b7ffc74 100644
--- a/vcl/source/src/makefile.mk
+++ b/vcl/source/src/makefile.mk
@@ -44,7 +44,7 @@ SRC1FILES= images.src \
helptext.src \
units.src \
btntext.src \
- print.src
+ print.src \
RESLIB1NAME= $(RESTARGET)
RESLIB1IMAGES= $(PRJ)$/source/src
diff --git a/vcl/source/src/print.src b/vcl/source/src/print.src
index 01d3c64f7fdb..b4f4d56029e1 100644
--- a/vcl/source/src/print.src
+++ b/vcl/source/src/print.src
@@ -29,6 +29,7 @@
ModalDialog SV_DLG_PRINT
{
+ HelpID = ".HelpID:vcl:PrintDialog:Dialog";
Text [en-US] = "Print";
Closeable = TRUE;
Sizeable = TRUE;
@@ -44,16 +45,19 @@ ModalDialog SV_DLG_PRINT
Pos = MAP_APPFONT( 240, 195 );
Size = MAP_APPFONT( 50, 15 );
Text [en-US] = "~Print";
+ HelpID = ".HelpID:vcl:PrintDialog:OK";
};
CancelButton SV_PRINT_CANCEL
{
Pos = MAP_APPFONT( 295, 195 );
Size = MAP_APPFONT( 50, 15 );
+ HelpID = ".HelpID:vcl:PrintDialog:Cancel";
};
HelpButton SV_PRINT_HELP
{
Pos = MAP_APPFONT( 5, 5 );
Size = MAP_APPFONT( 50, 15 );
+ HelpID = ".HelpID:vcl:PrintDialog:Help";
};
Window SV_PRINT_PAGE_PREVIEW
@@ -61,6 +65,7 @@ ModalDialog SV_DLG_PRINT
Pos = MAP_APPFONT( 5, 5 );
Size = MAP_APPFONT( 130, 130 );
Border = FALSE;
+ HelpID = ".HelpID:vcl:PrintDialog:Preview";
};
NumericField SV_PRINT_PAGE_EDIT
{
@@ -69,7 +74,7 @@ ModalDialog SV_DLG_PRINT
SVLook = TRUE;
Spin = FALSE;
Border = TRUE;
- HelpText [en-US] = "Select page to display in preview.";
+ HelpID = ".HelpID:vcl:PrintDialog:PageEdit";
};
FixedText SV_PRINT_PAGE_TXT
{
@@ -77,23 +82,25 @@ ModalDialog SV_DLG_PRINT
Size = MAP_APPFONT( 30, 12 );
Text [ en-US ] = "/ %n";
VCenter = TRUE;
+ HelpID = ".HelpID:vcl:PrintDialog:NumPagesText";
};
PushButton SV_PRINT_PAGE_FORWARD
{
Pos = MAP_APPFONT( 95, 140 );
Size = MAP_APPFONT( 15, 12 );
- HelpText [en-US] = "Scroll one page forward.";
+ HelpID = ".HelpID:vcl:PrintDialog:ForwardBtn";
};
PushButton SV_PRINT_PAGE_BACKWARD
{
Pos = MAP_APPFONT( 80, 140 );
Size = MAP_APPFONT( 15, 12 );
- HelpText [en-US] = "Scroll one page backward.";
+ HelpID = ".HelpID:vcl:PrintDialog:BackwardBtn";
};
TabControl SV_PRINT_TABCTRL
{
Pos = MAP_APPFONT( 140, 5 );
Size = MAP_APPFONT( 205, 175 );
+ HelpID = ".HelpID:vcl:PrintDialog:TabPages";
};
FixedLine SV_PRINT_BUTTONLINE
{
@@ -123,6 +130,7 @@ ModalDialog SV_DLG_PRINT
TabPage SV_PRINT_TAB_NUP
{
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage";
Text [en-US] = "Page Layout";
Hide = TRUE;
@@ -132,34 +140,28 @@ ModalDialog SV_DLG_PRINT
Size = MAP_APPFONT( 150, 10 );
Text [en-US] = "Layout";
};
- RadioButton SV_PRINT_PRT_NUP_DEFAULT_BTN
- {
- Pos = MAP_APPFONT( 0, 0 );
- Size = MAP_APPFONT( 10, 10 );
- Text [en-US] = "~Default";
- HelpText [en-US] = "Print one page per sheet of paper.";
- };
RadioButton SV_PRINT_PRT_NUP_BROCHURE_BTN
{
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:Brochure";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 10 );
Text = "";
};
RadioButton SV_PRINT_PRT_NUP_PAGES_BTN
{
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:PagesPerSheet";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 10 );
Text [en-US] = "Pa~ges per sheet";
- HelpText [en-US] = "Print multiple pages per sheet of paper.";
};
ListBox SV_PRINT_PRT_NUP_PAGES_BOX
{
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:PagesPerSheetBox";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 80 );
Border = TRUE;
DropDown = TRUE;
CurPos = 0;
- HelpText [en-US] = "Select how many pages to print per sheet of paper.";
StringList [en-US] =
{
< "1"; 1; >;
@@ -180,6 +182,7 @@ ModalDialog SV_DLG_PRINT
};
NumericField SV_PRINT_PRT_NUP_COLS_EDT
{
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:ColumnsBox";
Pos = MAP_APPFONT( 55, 20 );
Size = MAP_APPFONT( 40, 12 );
Border = TRUE;
@@ -187,7 +190,6 @@ ModalDialog SV_DLG_PRINT
Minimum = 1;
Maximum = 32;
Value = 1;
- HelpText [en-US] = "Select number of columns.";
};
FixedText SV_PRINT_PRT_NUP_TIMES_TXT
{
@@ -198,6 +200,7 @@ ModalDialog SV_DLG_PRINT
};
NumericField SV_PRINT_PRT_NUP_ROWS_EDT
{
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:RowsBox";
Pos = MAP_APPFONT( 55, 35 );
Size = MAP_APPFONT( 40, 12 );
Border = TRUE;
@@ -205,7 +208,6 @@ ModalDialog SV_DLG_PRINT
Minimum = 1;
Maximum = 32;
Value = 1;
- HelpText [en-US] = "Select number of rows.";
};
FixedText SV_PRINT_PRT_NUP_MARGINS_PAGES_1_TXT
{
@@ -215,13 +217,13 @@ ModalDialog SV_DLG_PRINT
};
MetricField SV_PRINT_PRT_NUP_MARGINS_PAGES_EDT
{
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:PageMarginBox";
Pos = MAP_APPFONT( 55, 95 );
Size = MAP_APPFONT( 40, 12 );
Spin = TRUE;
Border = TRUE;
Value = 0;
Unit = FUNIT_MM;
- HelpText [en-US] = "Select margin between individual pages on each sheet of paper.";
};
FixedText SV_PRINT_PRT_NUP_MARGINS_PAGES_2_TXT
{
@@ -237,13 +239,13 @@ ModalDialog SV_DLG_PRINT
};
MetricField SV_PRINT_PRT_NUP_MARGINS_SHEET_EDT
{
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:SheetMarginBox";
Pos = MAP_APPFONT( 155, 95 );
Size = MAP_APPFONT( 40, 12 );
Spin = TRUE;
Border = TRUE;
Value = 0;
Unit = FUNIT_MM;
- HelpText [en-US] = "Select margin between the printed pages and paper edge.";
};
FixedText SV_PRINT_PRT_NUP_MARGINS_SHEET_2_TXT
{
@@ -259,6 +261,7 @@ ModalDialog SV_DLG_PRINT
};
ListBox SV_PRINT_PRT_NUP_ORIENTATION_BOX
{
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:OrientationBox";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 40 );
Border = TRUE;
@@ -270,7 +273,6 @@ ModalDialog SV_DLG_PRINT
< "Portrait"; SV_PRINT_PRT_NUP_ORIENTATION_PORTRAIT; >;
< "Landscape"; SV_PRINT_PRT_NUP_ORIENTATION_LANDSCAPE; >;
};
- HelpText [en-US] = "Select the orientation of the paper.";
};
FixedText SV_PRINT_PRT_NUP_ORDER_TXT
{
@@ -280,29 +282,32 @@ ModalDialog SV_DLG_PRINT
};
ListBox SV_PRINT_PRT_NUP_ORDER_BOX
{
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:OrderBox";
Pos = MAP_APPFONT( 0, 0 );
- Size = MAP_APPFONT( 10, 20 );
+ Size = MAP_APPFONT( 10, 50 );
DropDown = TRUE;
Border = TRUE;
CurPos = 0;
StringList [en-US] =
{
- < "left to right, then down"; SV_PRINT_PRT_NUP_ORDER_LRTD; >;
- < "top to bottom, then right"; SV_PRINT_PRT_NUP_ORDER_TDLR; >;
+ < "left to right, then down"; SV_PRINT_PRT_NUP_ORDER_LRTB; >;
+ < "top to bottom, then right"; SV_PRINT_PRT_NUP_ORDER_TBLR; >;
+ < "top to bottom, then left"; SV_PRINT_PRT_NUP_ORDER_TBRL; >;
+ < "right to left, then down"; SV_PRINT_PRT_NUP_ORDER_RLTB; >;
};
- HelpText [en-US] = "Select order in which pages are to be printed.";
};
CheckBox SV_PRINT_PRT_NUP_BORDER_CB
{
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:BorderBox";
Pos = MAP_APPFONT( 10, 65 );
Size = MAP_APPFONT( 150, 12 );
Text [en-US] = "Draw a border around each page";
- HelpText [en-US] = "Check to draw a border around each page.";
};
};
TabPage SV_PRINT_TAB_JOB
{
+ HelpID = ".HelpID:vcl:PrintDialog:JobPage";
Text [en-US] = "General";
Hide = TRUE;
@@ -314,18 +319,18 @@ ModalDialog SV_DLG_PRINT
};
ListBox SV_PRINT_PRINTERS
{
+ HelpID = ".HelpID:vcl:PrintDialog:JobPage:PrinterList";
Pos = MAP_APPFONT( 5, 5 );
Size = MAP_APPFONT( 100, 80 );
Border = TRUE;
Sort = TRUE;
- HelpText [en-US] = "Select the printer to print on.";
};
CheckBox SV_PRINT_DETAILS_BTN
{
+ HelpID = ".HelpID:vcl:PrintDialog:JobPage:DetailsBtn";
Pos = MAP_APPFONT( 5, 5 );
Size = MAP_APPFONT( 5, 5 );
Text [en-US] = "Details";
- HelpText [en-US] = "Show/Hide detailed information of the selected printer.";
};
FixedText SV_PRINT_STATUS_TXT
{
@@ -347,10 +352,10 @@ ModalDialog SV_DLG_PRINT
};
PushButton SV_PRINT_PRT_SETUP
{
+ HelpID = ".HelpID:vcl:PrintDialog:JobPage:Properties";
Pos = MAP_APPFONT( 115, 5 );
Size = MAP_APPFONT( 50, 15 );
Text [en-US] = "Properties...";
- HelpText [en-US] = "Call the setup dialog of the selected printer.";
};
FixedLine SV_PRINT_COPIES
{
@@ -366,6 +371,7 @@ ModalDialog SV_DLG_PRINT
};
NumericField SV_PRINT_COPYCOUNT_FIELD
{
+ HelpID = ".HelpID:vcl:PrintDialog:JobPage:Copies";
Pos = MAP_APPFONT( 10, 56 );
Size = MAP_APPFONT( 40, 12 );
Border = TRUE;
@@ -373,7 +379,6 @@ ModalDialog SV_DLG_PRINT
Minimum = 1;
Maximum = 16384;
Value = 1;
- HelpText [en-US] = "Select the number of copies to be produced.";
};
FixedImage SV_PRINT_COLLATE_IMAGE
{
@@ -382,10 +387,10 @@ ModalDialog SV_DLG_PRINT
};
CheckBox SV_PRINT_COLLATE
{
+ HelpID = ".HelpID:vcl:PrintDialog:JobPage:Collate";
Pos = MAP_APPFONT( 95, 45 );
Size = MAP_APPFONT( 70, 10 );
Text [en-US] = "Collate";
- HelpText [en-US] = "Select whether copies should be collated or not.";
};
Image SV_PRINT_COLLATE_IMG
@@ -397,12 +402,21 @@ ModalDialog SV_DLG_PRINT
{
ImageBitmap = Bitmap { File = "ncollate.png" ; };
};
+
+ CheckBox SV_PRINT_OPT_REVERSE
+ {
+ HelpID = ".HelpID:vcl:PrintDialog:OptPage:ToReverse";
+ Pos = MAP_APPFONT( 10, 50 );
+ Size = MAP_APPFONT( 200, 12 );
+ Text [en-US] = "Print in ~reverse page order";
+ };
};
TabPage SV_PRINT_TAB_OPT
{
Text [en-US] = "Options";
Hide = TRUE;
+ HelpID = ".HelpID:vcl:PrintDialog:OptPage";
FixedLine SV_PRINT_OPT_PRINT_FL
{
@@ -412,30 +426,24 @@ ModalDialog SV_DLG_PRINT
};
CheckBox SV_PRINT_OPT_TOFILE
{
+ HelpID = ".HelpID:vcl:PrintDialog:OptPage:ToFile";
Pos = MAP_APPFONT( 10, 20 );
Size = MAP_APPFONT( 200, 12 );
Text [en-US] = "Print to ~file";
- HelpText [en-US] = "Check to send output to a file instead of the actual printer.";
};
CheckBox SV_PRINT_OPT_SINGLEJOBS
{
+ HelpID = ".HelpID:vcl:PrintDialog:OptPage:SingleJobs";
Pos = MAP_APPFONT( 10, 35 );
Size = MAP_APPFONT( 200, 12 );
Text [en-US] = "~Create single print jobs for collated output";
- HelpText [en-US] = "Check to not rely on the printer to create collated copies but create a print job for each copy instead.";
- };
- CheckBox SV_PRINT_OPT_REVERSE
- {
- Pos = MAP_APPFONT( 10, 50 );
- Size = MAP_APPFONT( 200, 12 );
- Text [en-US] = "Print in ~reverse page order";
- HelpText [en-US] = "Check to print pages in reverse order.";
};
};
};
ModelessDialog SV_DLG_PRINT_PROGRESS
{
+ HelpID = "vcl:ModelessDialog:SV_DLG_PRINT_PROGRESS";
Text [en-US] = "Printing";
Closeable = FALSE;
Sizeable = FALSE;
@@ -478,5 +486,51 @@ StringArray SV_PRINT_NATIVE_STRINGS
< "Page number"; >;
< "Number of pages"; >;
< "More"; >;
+ < "Print selection only"; >;
+ };
+};
+
+StringArray RID_STR_PAPERNAMES
+{
+ ItemList [en-US] =
+ {
+ < "A0"; >;
+ < "A1"; >;
+ < "A2"; >;
+ < "A3"; >;
+ < "A4"; >;
+ < "A5"; >;
+ < "B4 (ISO)"; >;
+ < "B5 (ISO)"; >;
+ < "Letter"; >;
+ < "Legal"; >;
+ < "Tabloid"; >;
+ < "User Defined"; >;
+ < "B6 (ISO)"; >;
+ < "C4 Envelope"; >;
+ < "C5 Envelope"; >;
+ < "C6 Envelope"; >;
+ < "C6/5 Envelope"; >;
+ < "DL Envelope"; >;
+ < "Dia Slide"; >;
+ < "Screen"; >;
+ < "C"; >;
+ < "D"; >;
+ < "E"; >;
+ < "Executive"; >;
+ < "Long Bond"; >;
+ < "#8 (Monarch) Envelope"; >;
+ < "#6 3/4 (Personal) Envelope"; >;
+ < "#9 Envelope"; >;
+ < "#10 Envelope"; >;
+ < "#11 Envelope"; >;
+ < "#12 Envelope"; >;
+ < "16 Kai"; >;
+ < "32 Kai"; >;
+ < "Big 32 Kai"; >;
+ < "B4 (JIS)"; >;
+ < "B5 (JIS)"; >;
+ < "B6 (JIS)"; >;
};
};
+
diff --git a/vcl/source/src/stdtext.src b/vcl/source/src/stdtext.src
index 2c6574220a5f..1b95f7bb1d72 100644
--- a/vcl/source/src/stdtext.src
+++ b/vcl/source/src/stdtext.src
@@ -101,6 +101,11 @@ String SV_ACCESSERROR_TURNAROUND_MSG
Text [ en-US ] = "The Java Access Bridge could not be started.";
};
+String SV_ACCESSERROR_NO_FONTS
+{
+ Text [ en-US ] = "No fonts could be found on the system.";
+};
+
String SV_STDTEXT_ABOUT
{
Text [ en-US ] = "About %PRODUCTNAME";
diff --git a/vcl/source/src/throbber.src b/vcl/source/src/throbber.src
new file mode 100755
index 000000000000..d3c5ea44035c
--- /dev/null
+++ b/vcl/source/src/throbber.src
@@ -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.
+ *
+ ************************************************************************/
+
+// TODO: we need a mechanism to add images to images.zip, *without*
+// referring them in resource files. The below resources are never loaded
+// at runtime, instead, the images in images.zip are accessed via
+// private:graphicrepository/* URLs.
+
+Resource 1000
+{
+ Image 1 { ImageBitmap = Bitmap{ file = "shared/spinner-16-01.png"; }; };
+ Image 2 { ImageBitmap = Bitmap{ file = "shared/spinner-16-02.png"; }; };
+ Image 3 { ImageBitmap = Bitmap{ file = "shared/spinner-16-03.png"; }; };
+ Image 4 { ImageBitmap = Bitmap{ file = "shared/spinner-16-04.png"; }; };
+ Image 5 { ImageBitmap = Bitmap{ file = "shared/spinner-16-05.png"; }; };
+ Image 6 { ImageBitmap = Bitmap{ file = "shared/spinner-16-06.png"; }; };
+};
+
+Resource 1001
+{
+ Image 1 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-01.png"; }; };
+ Image 2 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-02.png"; }; };
+ Image 3 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-03.png"; }; };
+ Image 4 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-04.png"; }; };
+ Image 5 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-05.png"; }; };
+ Image 6 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-06.png"; }; };
+};
+
+Resource 1002
+{
+ Image 1 { ImageBitmap = Bitmap{ file = "shared/spinner-32-01.png"; }; };
+ Image 2 { ImageBitmap = Bitmap{ file = "shared/spinner-32-02.png"; }; };
+ Image 3 { ImageBitmap = Bitmap{ file = "shared/spinner-32-03.png"; }; };
+ Image 4 { ImageBitmap = Bitmap{ file = "shared/spinner-32-04.png"; }; };
+ Image 5 { ImageBitmap = Bitmap{ file = "shared/spinner-32-05.png"; }; };
+ Image 6 { ImageBitmap = Bitmap{ file = "shared/spinner-32-06.png"; }; };
+ Image 7 { ImageBitmap = Bitmap{ file = "shared/spinner-32-07.png"; }; };
+ Image 8 { ImageBitmap = Bitmap{ file = "shared/spinner-32-08.png"; }; };
+ Image 9 { ImageBitmap = Bitmap{ file = "shared/spinner-32-09.png"; }; };
+ Image 10 { ImageBitmap = Bitmap{ file = "shared/spinner-32-10.png"; }; };
+ Image 11 { ImageBitmap = Bitmap{ file = "shared/spinner-32-11.png"; }; };
+ Image 12 { ImageBitmap = Bitmap{ file = "shared/spinner-32-12.png"; }; };
+};
+
+Resource 1003
+{
+ Image 1 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-01.png"; }; };
+ Image 2 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-02.png"; }; };
+ Image 3 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-03.png"; }; };
+ Image 4 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-04.png"; }; };
+ Image 5 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-05.png"; }; };
+ Image 6 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-06.png"; }; };
+ Image 7 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-07.png"; }; };
+ Image 8 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-08.png"; }; };
+ Image 9 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-09.png"; }; };
+ Image 10 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-10.png"; }; };
+ Image 11 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-11.png"; }; };
+ Image 12 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-12.png"; }; };
+};
+
+Resource 1004
+{
+ Image 1 { ImageBitmap = Bitmap{ file = "shared/spinner-64-01.png"; }; };
+ Image 2 { ImageBitmap = Bitmap{ file = "shared/spinner-64-02.png"; }; };
+ Image 3 { ImageBitmap = Bitmap{ file = "shared/spinner-64-03.png"; }; };
+ Image 4 { ImageBitmap = Bitmap{ file = "shared/spinner-64-04.png"; }; };
+ Image 5 { ImageBitmap = Bitmap{ file = "shared/spinner-64-05.png"; }; };
+ Image 6 { ImageBitmap = Bitmap{ file = "shared/spinner-64-06.png"; }; };
+ Image 7 { ImageBitmap = Bitmap{ file = "shared/spinner-64-07.png"; }; };
+ Image 8 { ImageBitmap = Bitmap{ file = "shared/spinner-64-08.png"; }; };
+ Image 9 { ImageBitmap = Bitmap{ file = "shared/spinner-64-09.png"; }; };
+ Image 10 { ImageBitmap = Bitmap{ file = "shared/spinner-64-10.png"; }; };
+ Image 11 { ImageBitmap = Bitmap{ file = "shared/spinner-64-11.png"; }; };
+ Image 12 { ImageBitmap = Bitmap{ file = "shared/spinner-64-12.png"; }; };
+};
+
+Resource 1005
+{
+ Image 1 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-01.png"; }; };
+ Image 2 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-02.png"; }; };
+ Image 3 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-03.png"; }; };
+ Image 4 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-04.png"; }; };
+ Image 5 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-05.png"; }; };
+ Image 6 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-06.png"; }; };
+ Image 7 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-07.png"; }; };
+ Image 8 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-08.png"; }; };
+ Image 9 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-09.png"; }; };
+ Image 10 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-10.png"; }; };
+ Image 11 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-11.png"; }; };
+ Image 12 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-12.png"; }; };
+};
diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx
index 22287a42ffca..50d288b71686 100644
--- a/vcl/source/window/accel.cxx
+++ b/vcl/source/window/accel.cxx
@@ -42,7 +42,7 @@
DECLARE_TABLE( ImplAccelTable, ImplAccelEntry* )
typedef ::std::vector< ImplAccelEntry* > ImplAccelList;
-#define ACCELENTRY_NOTFOUND ((USHORT)0xFFFF)
+#define ACCELENTRY_NOTFOUND ((sal_uInt16)0xFFFF)
// =======================================================================
@@ -59,14 +59,14 @@ DBG_NAME( Accelerator )
// =======================================================================
-USHORT ImplAccelEntryGetIndex( ImplAccelList* pList, USHORT nId,
- USHORT* pIndex = NULL )
+sal_uInt16 ImplAccelEntryGetIndex( ImplAccelList* pList, sal_uInt16 nId,
+ sal_uInt16* pIndex = NULL )
{
size_t nLow;
size_t nHigh;
size_t nMid;
size_t nCount = pList->size();
- USHORT nCompareId;
+ sal_uInt16 nCompareId;
// Abpruefen, ob der erste Key groesser als der Vergleichskey ist
if ( !nCount || (nId < (*pList)[ 0 ]->mnId) )
@@ -90,7 +90,7 @@ USHORT ImplAccelEntryGetIndex( ImplAccelList* pList, USHORT nId,
if ( nId > nCompareId )
nLow = nMid + 1;
else
- return (USHORT)nMid;
+ return (sal_uInt16)nMid;
}
}
while ( nLow <= nHigh );
@@ -98,9 +98,9 @@ USHORT ImplAccelEntryGetIndex( ImplAccelList* pList, USHORT nId,
if ( pIndex )
{
if ( nId > nCompareId )
- *pIndex = (USHORT)(nMid+1);
+ *pIndex = (sal_uInt16)(nMid+1);
else
- *pIndex = (USHORT)nMid;
+ *pIndex = (sal_uInt16)nMid;
}
return ACCELENTRY_NOTFOUND;
@@ -110,8 +110,8 @@ USHORT ImplAccelEntryGetIndex( ImplAccelList* pList, USHORT nId,
static void ImplAccelEntryInsert( ImplAccelList* pList, ImplAccelEntry* pEntry )
{
- USHORT nInsIndex;
- USHORT nIndex = ImplAccelEntryGetIndex( pList, pEntry->mnId, &nInsIndex );
+ sal_uInt16 nInsIndex;
+ sal_uInt16 nIndex = ImplAccelEntryGetIndex( pList, pEntry->mnId, &nInsIndex );
if ( nIndex != ACCELENTRY_NOTFOUND )
{
@@ -145,9 +145,9 @@ static void ImplAccelEntryInsert( ImplAccelList* pList, ImplAccelEntry* pEntry )
// -----------------------------------------------------------------------
-static USHORT ImplAccelEntryGetFirstPos( ImplAccelList* pList, USHORT nId )
+static sal_uInt16 ImplAccelEntryGetFirstPos( ImplAccelList* pList, sal_uInt16 nId )
{
- USHORT nIndex = ImplAccelEntryGetIndex( pList, nId );
+ sal_uInt16 nIndex = ImplAccelEntryGetIndex( pList, nId );
if ( nIndex != ACCELENTRY_NOTFOUND )
{
while ( nIndex )
@@ -170,7 +170,7 @@ void Accelerator::ImplInit()
{
mnCurId = 0;
mnCurRepeat = 0;
- mbIsCancel = FALSE;
+ mbIsCancel = sal_False;
mpDel = NULL;
}
@@ -199,7 +199,7 @@ void Accelerator::ImplCopyData( ImplAccelData& rAccelData )
else
pEntry->mpAutoAccel = NULL;
- mpData->maKeyTable.Insert( (ULONG)pEntry->maKeyCode.GetFullKeyCode(), pEntry );
+ mpData->maKeyTable.Insert( (sal_uLong)pEntry->maKeyCode.GetFullKeyCode(), pEntry );
mpData->maIdList.push_back( pEntry );
}
}
@@ -221,18 +221,18 @@ void Accelerator::ImplDeleteData()
// -----------------------------------------------------------------------
-void Accelerator::ImplInsertAccel( USHORT nItemId, const KeyCode& rKeyCode,
- BOOL bEnable, Accelerator* pAutoAccel )
+void Accelerator::ImplInsertAccel( sal_uInt16 nItemId, const KeyCode& rKeyCode,
+ sal_Bool bEnable, Accelerator* pAutoAccel )
{
DBG_CHKTHIS( Accelerator, NULL );
DBG_ASSERT( nItemId, "Accelerator::InsertItem(): ItemId == 0" );
if ( rKeyCode.IsFunction() )
{
- USHORT nCode1;
- USHORT nCode2;
- USHORT nCode3;
- USHORT nCode4;
+ sal_uInt16 nCode1;
+ sal_uInt16 nCode2;
+ sal_uInt16 nCode3;
+ sal_uInt16 nCode4;
ImplGetKeyCode( rKeyCode.GetFunction(), nCode1, nCode2, nCode3, nCode4 );
if ( nCode1 )
ImplInsertAccel( nItemId, KeyCode( nCode1, nCode1 ), bEnable, pAutoAccel );
@@ -260,7 +260,7 @@ void Accelerator::ImplInsertAccel( USHORT nItemId, const KeyCode& rKeyCode,
pEntry->mbEnabled = bEnable;
// Ab in die Tabellen
- ULONG nCode = rKeyCode.GetFullKeyCode();
+ sal_uLong nCode = rKeyCode.GetFullKeyCode();
if ( !nCode )
{
OSL_FAIL( "Accelerator::InsertItem(): KeyCode with KeyCode 0 not allowed" );
@@ -319,9 +319,9 @@ void Accelerator::ImplLoadRes( const ResId& rResId )
GetRes( rResId );
maHelpStr = ReadStringRes();
- ULONG nObjFollows = ReadLongRes();
+ sal_uLong nObjFollows = ReadLongRes();
- for( ULONG i = 0; i < nObjFollows; i++ )
+ for( sal_uLong i = 0; i < nObjFollows; i++ )
{
InsertItem( ResId( (RSHEADER_TYPE *)GetClassRes(), *rResId.GetResMgr() ) );
IncrementRes( GetObjSizeRes( (RSHEADER_TYPE *)GetClassRes() ) );
@@ -336,7 +336,7 @@ Accelerator::~Accelerator()
// AccelManager benachrichtigen, das Accelrator geloescht wurde
if ( mpDel )
- *mpDel = TRUE;
+ *mpDel = sal_True;
ImplDeleteData();
delete mpData;
@@ -365,9 +365,9 @@ void Accelerator::Select()
// -----------------------------------------------------------------------
-void Accelerator::InsertItem( USHORT nItemId, const KeyCode& rKeyCode )
+void Accelerator::InsertItem( sal_uInt16 nItemId, const KeyCode& rKeyCode )
{
- ImplInsertAccel( nItemId, rKeyCode, TRUE, NULL );
+ ImplInsertAccel( nItemId, rKeyCode, sal_True, NULL );
}
// -----------------------------------------------------------------------
@@ -376,15 +376,15 @@ void Accelerator::InsertItem( const ResId& rResId )
{
DBG_CHKTHIS( Accelerator, NULL );
- ULONG nObjMask;
- USHORT nAccelKeyId;
- USHORT bDisable;
+ sal_uLong nObjMask;
+ sal_uInt16 nAccelKeyId;
+ sal_uInt16 bDisable;
KeyCode aKeyCode;
Accelerator* pAutoAccel = NULL;
GetRes( rResId.SetRT( RSC_ACCELITEM ) );
nObjMask = ReadLongRes();
- nAccelKeyId = sal::static_int_cast<USHORT>(ReadLongRes());
+ nAccelKeyId = sal::static_int_cast<sal_uInt16>(ReadLongRes());
bDisable = ReadShortRes();
if ( nObjMask & ACCELITEM_KEY )
@@ -407,15 +407,15 @@ void Accelerator::InsertItem( const ResId& rResId )
// -----------------------------------------------------------------------
-void Accelerator::RemoveItem( USHORT nItemId )
+void Accelerator::RemoveItem( sal_uInt16 nItemId )
{
DBG_CHKTHIS( Accelerator, NULL );
// Aus der Id-Liste entfernen
- USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
+ sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
{
- USHORT nItemCount = GetItemCount();
+ sal_uInt16 nItemCount = GetItemCount();
do
{
ImplAccelEntry* pEntry = ( nIndex < mpData->maIdList.size() ) ? mpData->maIdList[ nIndex ] : NULL;
@@ -450,8 +450,8 @@ void Accelerator::RemoveItem( const KeyCode rKeyCode )
if ( pEntry )
{
// Aus der Id-Liste entfernen
- USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), pEntry->mnId );
- USHORT nItemCount = GetItemCount();
+ sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), pEntry->mnId );
+ sal_uInt16 nItemCount = GetItemCount();
do
{
if ( mpData->maIdList[ nIndex ] == pEntry )
@@ -486,16 +486,16 @@ void Accelerator::Clear()
// -----------------------------------------------------------------------
-USHORT Accelerator::GetItemCount() const
+sal_uInt16 Accelerator::GetItemCount() const
{
DBG_CHKTHIS( Accelerator, NULL );
- return (USHORT)mpData->maIdList.size();
+ return (sal_uInt16)mpData->maIdList.size();
}
// -----------------------------------------------------------------------
-USHORT Accelerator::GetItemId( USHORT nPos ) const
+sal_uInt16 Accelerator::GetItemId( sal_uInt16 nPos ) const
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -508,7 +508,7 @@ USHORT Accelerator::GetItemId( USHORT nPos ) const
// -----------------------------------------------------------------------
-KeyCode Accelerator::GetItemKeyCode( USHORT nPos ) const
+KeyCode Accelerator::GetItemKeyCode( sal_uInt16 nPos ) const
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -521,7 +521,7 @@ KeyCode Accelerator::GetItemKeyCode( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT Accelerator::GetItemId( const KeyCode& rKeyCode ) const
+sal_uInt16 Accelerator::GetItemId( const KeyCode& rKeyCode ) const
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -534,11 +534,11 @@ USHORT Accelerator::GetItemId( const KeyCode& rKeyCode ) const
// -----------------------------------------------------------------------
-KeyCode Accelerator::GetKeyCode( USHORT nItemId ) const
+KeyCode Accelerator::GetKeyCode( sal_uInt16 nItemId ) const
{
DBG_CHKTHIS( Accelerator, NULL );
- USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
+ sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
return mpData->maIdList[ nIndex ]->maKeyCode;
else
@@ -547,17 +547,17 @@ KeyCode Accelerator::GetKeyCode( USHORT nItemId ) const
// -----------------------------------------------------------------------
-BOOL Accelerator::IsIdValid( USHORT nItemId ) const
+sal_Bool Accelerator::IsIdValid( sal_uInt16 nItemId ) const
{
DBG_CHKTHIS( Accelerator, NULL );
- USHORT nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
+ sal_uInt16 nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
return (nIndex != ACCELENTRY_NOTFOUND);
}
// -----------------------------------------------------------------------
-BOOL Accelerator::IsKeyCodeValid( const KeyCode rKeyCode ) const
+sal_Bool Accelerator::IsKeyCodeValid( const KeyCode rKeyCode ) const
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -567,7 +567,7 @@ BOOL Accelerator::IsKeyCodeValid( const KeyCode rKeyCode ) const
// -----------------------------------------------------------------------
-BOOL Accelerator::Call( const KeyCode& rKeyCode, USHORT nRepeat )
+sal_Bool Accelerator::Call( const KeyCode& rKeyCode, sal_uInt16 nRepeat )
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -576,7 +576,7 @@ BOOL Accelerator::Call( const KeyCode& rKeyCode, USHORT nRepeat )
{
if ( pEntry->mbEnabled )
{
- BOOL bDel = FALSE;
+ sal_Bool bDel = sal_False;
mnCurId = pEntry->mnId;
maCurKeyCode = rKeyCode;
mnCurRepeat = nRepeat;
@@ -589,23 +589,23 @@ BOOL Accelerator::Call( const KeyCode& rKeyCode, USHORT nRepeat )
mnCurRepeat = 0;
}
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void Accelerator::SetAccel( USHORT nItemId, Accelerator* pAccel )
+void Accelerator::SetAccel( sal_uInt16 nItemId, Accelerator* pAccel )
{
DBG_CHKTHIS( Accelerator, NULL );
- USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
+ sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
{
- USHORT nItemCount = GetItemCount();
+ sal_uInt16 nItemCount = GetItemCount();
do
{
ImplAccelEntry* pEntry = mpData->maIdList[ nIndex ];
@@ -621,11 +621,11 @@ void Accelerator::SetAccel( USHORT nItemId, Accelerator* pAccel )
// -----------------------------------------------------------------------
-Accelerator* Accelerator::GetAccel( USHORT nItemId ) const
+Accelerator* Accelerator::GetAccel( sal_uInt16 nItemId ) const
{
DBG_CHKTHIS( Accelerator, NULL );
- USHORT nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
+ sal_uInt16 nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
return mpData->maIdList[ nIndex ]->mpAccel;
else
@@ -653,19 +653,19 @@ Accelerator* Accelerator::GetAccel( const KeyCode rKeyCode ) const
if ( pEntry )
return pEntry->mpAccel;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void Accelerator::EnableItem( USHORT nItemId, BOOL bEnable )
+void Accelerator::EnableItem( sal_uInt16 nItemId, sal_Bool bEnable )
{
DBG_CHKTHIS( Accelerator, NULL );
- USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
+ sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
{
- USHORT nItemCount = GetItemCount();
+ sal_uInt16 nItemCount = GetItemCount();
do
{
ImplAccelEntry* pEntry = mpData->maIdList[ nIndex ];
@@ -681,20 +681,20 @@ void Accelerator::EnableItem( USHORT nItemId, BOOL bEnable )
// -----------------------------------------------------------------------
-BOOL Accelerator::IsItemEnabled( USHORT nItemId ) const
+sal_Bool Accelerator::IsItemEnabled( sal_uInt16 nItemId ) const
{
DBG_CHKTHIS( Accelerator, NULL );
- USHORT nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
+ sal_uInt16 nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
return mpData->maIdList[ nIndex ]->mbEnabled;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void Accelerator::EnableItem( const KeyCode rKeyCode, BOOL bEnable )
+void Accelerator::EnableItem( const KeyCode rKeyCode, sal_Bool bEnable )
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -705,7 +705,7 @@ void Accelerator::EnableItem( const KeyCode rKeyCode, BOOL bEnable )
// -----------------------------------------------------------------------
-BOOL Accelerator::IsItemEnabled( const KeyCode rKeyCode ) const
+sal_Bool Accelerator::IsItemEnabled( const KeyCode rKeyCode ) const
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -713,7 +713,7 @@ BOOL Accelerator::IsItemEnabled( const KeyCode rKeyCode ) const
if ( pEntry )
return pEntry->mbEnabled;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -728,7 +728,7 @@ Accelerator& Accelerator::operator=( const Accelerator& rAccel )
maCurKeyCode = KeyCode();
mnCurId = 0;
mnCurRepeat = 0;
- mbIsCancel = FALSE;
+ mbIsCancel = sal_False;
// Tabellen loeschen und kopieren
ImplDeleteData();
diff --git a/vcl/source/window/accmgr.cxx b/vcl/source/window/accmgr.cxx
index b45020460c08..c8b1e42c5ed1 100644
--- a/vcl/source/window/accmgr.cxx
+++ b/vcl/source/window/accmgr.cxx
@@ -50,20 +50,20 @@ ImplAccelManager::~ImplAccelManager()
// -----------------------------------------------------------------------
-BOOL ImplAccelManager::InsertAccel( Accelerator* pAccel )
+sal_Bool ImplAccelManager::InsertAccel( Accelerator* pAccel )
{
if ( !mpAccelList ) {
mpAccelList = new ImplAccelList;
} else {
for ( size_t i = 0, n = mpAccelList->size(); i < n; ++i ) {
if ( (*mpAccelList)[ i ] == pAccel ) {
- return FALSE;
+ return sal_False;
}
}
}
mpAccelList->insert( mpAccelList->begin(), pAccel );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -79,7 +79,7 @@ void ImplAccelManager::RemoveAccel( Accelerator* pAccel )
//we're removing an accelerator that a sub-accelerator which is in the
//sequence list, throw away the entire sequence
if ( mpSequenceList ) {
- for (USHORT i = 0; i < pAccel->GetItemCount(); ++i) {
+ for (sal_uInt16 i = 0; i < pAccel->GetItemCount(); ++i) {
Accelerator* pSubAccel = pAccel->GetAccel( pAccel->GetItemId(i) );
for ( size_t j = 0, n = mpSequenceList->size(); j < n; ++j ) {
if ( (*mpSequenceList)[ j ] == pSubAccel ) {
@@ -105,7 +105,7 @@ void ImplAccelManager::RemoveAccel( Accelerator* pAccel )
// -----------------------------------------------------------------------
-void ImplAccelManager::EndSequence( BOOL bCancel )
+void ImplAccelManager::EndSequence( sal_Bool bCancel )
{
// Sind wir ueberhaupt in einer Sequenz ?
if ( !mpSequenceList )
@@ -115,13 +115,13 @@ void ImplAccelManager::EndSequence( BOOL bCancel )
for ( size_t i = 0, n = mpSequenceList->size(); i < n; ++i )
{
Accelerator* pTempAccel = (*mpSequenceList)[ i ];
- BOOL bDel = FALSE;
+ sal_Bool bDel = sal_False;
pTempAccel->mbIsCancel = bCancel;
pTempAccel->mpDel = &bDel;
pTempAccel->Deactivate();
if ( !bDel )
{
- pTempAccel->mbIsCancel = FALSE;
+ pTempAccel->mbIsCancel = sal_False;
pTempAccel->mpDel = NULL;
}
}
@@ -133,15 +133,15 @@ void ImplAccelManager::EndSequence( BOOL bCancel )
// -----------------------------------------------------------------------
-BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat )
+sal_Bool ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, sal_uInt16 nRepeat )
{
Accelerator* pAccel;
// Haben wir ueberhaupt Acceleratoren ??
if ( !mpAccelList )
- return FALSE;
+ return sal_False;
if ( mpAccelList->empty() )
- return FALSE;
+ return sal_False;
// Sind wir in einer Sequenz ?
if ( mpSequenceList )
@@ -154,7 +154,7 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat )
{
// Sequenz abbrechen
FlushAccel();
- return FALSE;
+ return sal_False;
}
// Ist der Eintrag da drin ?
@@ -172,7 +172,7 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat )
// Activate-Handler vom Neuen rufen
pNextAccel->Activate();
- return TRUE;
+ return sal_True;
}
else
{
@@ -184,7 +184,7 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat )
// Dem Accelerator das aktuelle Item setzen
// und Handler rufen
- BOOL bDel = FALSE;
+ sal_Bool bDel = sal_False;
pAccel->maCurKeyCode = rKeyCode;
pAccel->mnCurId = pEntry->mnId;
pAccel->mnCurRepeat = nRepeat;
@@ -201,14 +201,14 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat )
pAccel->mpDel = NULL;
}
- return TRUE;
+ return sal_True;
}
else
{
// Sequenz abbrechen, weil Acceleraor disabled
// Taste wird weitergeleitet (ans System)
FlushAccel();
- return FALSE;
+ return sal_False;
}
}
}
@@ -216,7 +216,7 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat )
{
// Sequenz abbrechen wegen falscher Taste
FlushAccel();
- return FALSE;
+ return sal_False;
}
}
@@ -245,7 +245,7 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat )
// Activate-Handler vom Neuen rufen
pNextAccel->Activate();
- return TRUE;
+ return sal_True;
}
else
{
@@ -258,7 +258,7 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat )
// Dem Accelerator das aktuelle Item setzen
// und Handler rufen
- BOOL bDel = FALSE;
+ sal_Bool bDel = sal_False;
pAccel->maCurKeyCode = rKeyCode;
pAccel->mnCurId = pEntry->mnId;
pAccel->mnCurRepeat = nRepeat;
@@ -275,15 +275,15 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat )
pAccel->mpDel = NULL;
}
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
}
}
- return FALSE;
+ return sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/arrange.cxx b/vcl/source/window/arrange.cxx
index 88e9af2b9f1c..28e0d8ae65fe 100644
--- a/vcl/source/window/arrange.cxx
+++ b/vcl/source/window/arrange.cxx
@@ -30,15 +30,37 @@
#include "vcl/arrange.hxx"
#include "vcl/edit.hxx"
+#include "vcl/svdata.hxx"
+#include "vcl/svapp.hxx"
+
+#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/awt/Rectangle.hpp"
#include "osl/diagnose.h"
using namespace vcl;
+using namespace com::sun::star;
// ----------------------------------------
// vcl::WindowArranger
//-----------------------------------------
+long WindowArranger::getDefaultBorder()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ long nResult = pSVData->maAppData.mnDefaultLayoutBorder;
+ if( nResult < 0 )
+ {
+ OutputDevice* pDefDev = Application::GetDefaultDevice();
+ if( pDefDev )
+ {
+ Size aBorder( pDefDev->LogicToPixel( Size( 3, 3 ), MapMode( MAP_APPFONT ) ) );
+ nResult = pSVData->maAppData.mnDefaultLayoutBorder = aBorder.Height();
+ }
+ }
+ return nResult > 0 ? nResult : 0;
+}
+
WindowArranger::~WindowArranger()
{}
@@ -157,16 +179,26 @@ Size WindowArranger::Element::getOptimalSize( WindowSizeType i_eType ) const
Size aResult;
if( ! m_bHidden )
{
+ bool bVisible = false;
if( m_pElement && m_pElement->IsVisible() )
+ {
aResult = m_pElement->GetOptimalSize( i_eType );
- else if( m_pChild )
+ bVisible = true;
+ }
+ else if( m_pChild && m_pChild->isVisible() )
+ {
aResult = m_pChild->getOptimalSize( i_eType );
- if( aResult.Width() < m_aMinSize.Width() )
- aResult.Width() = m_aMinSize.Width();
- if( aResult.Height() < m_aMinSize.Height() )
- aResult.Height() = m_aMinSize.Height();
- aResult.Width() += m_nLeftBorder + m_nRightBorder;
- aResult.Height() += m_nTopBorder + m_nBottomBorder;
+ bVisible = true;
+ }
+ if( bVisible )
+ {
+ if( aResult.Width() < m_aMinSize.Width() )
+ aResult.Width() = m_aMinSize.Width();
+ if( aResult.Height() < m_aMinSize.Height() )
+ aResult.Height() = m_aMinSize.Height();
+ aResult.Width() += getBorderValue( m_nLeftBorder ) + getBorderValue( m_nRightBorder );
+ aResult.Height() += getBorderValue( m_nTopBorder ) + getBorderValue( m_nBottomBorder );
+ }
}
return aResult;
@@ -176,16 +208,74 @@ void WindowArranger::Element::setPosSize( const Point& i_rPos, const Size& i_rSi
{
Point aPoint( i_rPos );
Size aSize( i_rSize );
- aPoint.X() += m_nLeftBorder;
- aPoint.Y() += m_nTopBorder;
- aSize.Width() -= m_nLeftBorder + m_nRightBorder;
- aSize.Height() -= m_nTopBorder + m_nBottomBorder;
+ aPoint.X() += getBorderValue( m_nLeftBorder );
+ aPoint.Y() += getBorderValue( m_nTopBorder );
+ aSize.Width() -= getBorderValue( m_nLeftBorder ) + getBorderValue( m_nRightBorder );
+ aSize.Height() -= getBorderValue( m_nTopBorder ) + getBorderValue( m_nBottomBorder );
if( m_pElement )
m_pElement->SetPosSizePixel( aPoint, aSize );
else if( m_pChild )
m_pChild->setManagedArea( Rectangle( aPoint, aSize ) );
}
+uno::Sequence< beans::PropertyValue > WindowArranger::getProperties() const
+{
+ uno::Sequence< beans::PropertyValue > aRet( 3 );
+ aRet[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OuterBorder" ) );
+ aRet[0].Value = uno::makeAny( sal_Int32( getBorderValue( m_nOuterBorder ) ) );
+ aRet[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ManagedArea" ) );
+ awt::Rectangle aArea( m_aManagedArea.getX(), m_aManagedArea.getY(), m_aManagedArea.getWidth(), m_aManagedArea.getHeight() );
+ aRet[1].Value = uno::makeAny( aArea );
+ aRet[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) );
+ aRet[2].Value = uno::makeAny( sal_Bool( isVisible() ) );
+ return aRet;
+}
+
+void WindowArranger::setProperties( const uno::Sequence< beans::PropertyValue >& i_rProps )
+{
+ const beans::PropertyValue* pProps = i_rProps.getConstArray();
+ bool bResize = false;
+ for( sal_Int32 i = 0; i < i_rProps.getLength(); i++ )
+ {
+ if( pProps[i].Name.equalsAscii( "OuterBorder" ) )
+ {
+ sal_Int32 nVal = 0;
+ if( pProps[i].Value >>= nVal )
+ {
+ if( getBorderValue( m_nOuterBorder ) != nVal )
+ {
+ m_nOuterBorder = nVal;
+ bResize = true;
+ }
+ }
+ }
+ else if( pProps[i].Name.equalsAscii( "ManagedArea" ) )
+ {
+ awt::Rectangle aArea( 0, 0, 0, 0 );
+ if( pProps[i].Value >>= aArea )
+ {
+ m_aManagedArea.setX( aArea.X );
+ m_aManagedArea.setY( aArea.Y );
+ m_aManagedArea.setWidth( aArea.Width );
+ m_aManagedArea.setHeight( aArea.Height );
+ bResize = true;
+ }
+ }
+ else if( pProps[i].Name.equalsAscii( "Visible" ) )
+ {
+ sal_Bool bVal = sal_False;
+ if( pProps[i].Value >>= bVal )
+ {
+ show( bVal, false );
+ bResize = true;
+ }
+ }
+ }
+ if( bResize )
+ resize();
+}
+
+
// ----------------------------------------
// vcl::RowOrColumn
//-----------------------------------------
@@ -202,6 +292,7 @@ RowOrColumn::~RowOrColumn()
Size RowOrColumn::getOptimalSize( WindowSizeType i_eType ) const
{
Size aRet( 0, 0 );
+ long nDistance = getBorderValue( m_nBorderWidth );
for( std::vector< WindowArranger::Element >::const_iterator it = m_aElements.begin();
it != m_aElements.end(); ++it )
{
@@ -212,7 +303,7 @@ Size RowOrColumn::getOptimalSize( WindowSizeType i_eType ) const
if( m_bColumn )
{
// add the distance between elements
- aRet.Height() += m_nBorderWidth;
+ aRet.Height() += nDistance;
// check if the width needs adjustment
if( aRet.Width() < aElementSize.Width() )
aRet.Width() = aElementSize.Width();
@@ -221,7 +312,7 @@ Size RowOrColumn::getOptimalSize( WindowSizeType i_eType ) const
else
{
// add the distance between elements
- aRet.Width() += m_nBorderWidth;
+ aRet.Width() += nDistance;
// check if the height needs adjustment
if( aRet.Height() < aElementSize.Height() )
aRet.Height() = aElementSize.Height();
@@ -234,13 +325,14 @@ Size RowOrColumn::getOptimalSize( WindowSizeType i_eType ) const
{
// subtract the border for the first element
if( m_bColumn )
- aRet.Height() -= m_nBorderWidth;
+ aRet.Height() -= nDistance;
else
- aRet.Width() -= m_nBorderWidth;
+ aRet.Width() -= nDistance;
// add the outer border
- aRet.Width() += 2*m_nOuterBorder;
- aRet.Height() += 2*m_nOuterBorder;
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ aRet.Width() += 2*nOuterBorder;
+ aRet.Height() += 2*nOuterBorder;
}
return aRet;
@@ -345,7 +437,9 @@ void RowOrColumn::resize()
size_t nElements = m_aElements.size();
// get all element sizes for sizing
std::vector<Size> aElementSizes( nElements );
- long nUsedWidth = 2*m_nOuterBorder - (nElements ? m_nBorderWidth : 0);
+ long nDistance = getBorderValue( m_nBorderWidth );
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ long nUsedWidth = 2*nOuterBorder - (nElements ? nDistance : 0);
for( size_t i = 0; i < nElements; i++ )
{
if( m_aElements[i].isVisible() )
@@ -353,13 +447,13 @@ void RowOrColumn::resize()
aElementSizes[i] = m_aElements[i].getOptimalSize( eType );
if( m_bColumn )
{
- aElementSizes[i].Width() = m_aManagedArea.GetWidth() - 2* m_nOuterBorder;
- nUsedWidth += aElementSizes[i].Height() + m_nBorderWidth;
+ aElementSizes[i].Width() = m_aManagedArea.GetWidth() - 2 * nOuterBorder;
+ nUsedWidth += aElementSizes[i].Height() + nDistance;
}
else
{
- aElementSizes[i].Height() = m_aManagedArea.GetHeight() - 2* m_nOuterBorder;
- nUsedWidth += aElementSizes[i].Width() + m_nBorderWidth;
+ aElementSizes[i].Height() = m_aManagedArea.GetHeight() - 2 * nOuterBorder;
+ nUsedWidth += aElementSizes[i].Width() + nDistance;
}
}
}
@@ -376,8 +470,8 @@ void RowOrColumn::resize()
// get starting position
Point aElementPos( m_aManagedArea.TopLeft() );
// outer border
- aElementPos.X() += m_nOuterBorder;
- aElementPos.Y() += m_nOuterBorder;
+ aElementPos.X() += nOuterBorder;
+ aElementPos.Y() += nOuterBorder;
// position managed windows
for( size_t i = 0; i < nElements; i++ )
@@ -387,27 +481,27 @@ void RowOrColumn::resize()
{
m_aElements[i].setPosSize( aElementPos, aElementSizes[i] );
if( m_bColumn )
- aElementPos.Y() += m_nBorderWidth + aElementSizes[i].Height();
+ aElementPos.Y() += nDistance + aElementSizes[i].Height();
else
- aElementPos.X() += m_nBorderWidth + aElementSizes[i].Width();
+ aElementPos.X() += nDistance + aElementSizes[i].Width();
}
}
}
-size_t RowOrColumn::addWindow( Window* i_pWindow, sal_Int32 i_nExpandPrio, size_t i_nIndex )
+size_t RowOrColumn::addWindow( Window* i_pWindow, sal_Int32 i_nExpandPrio, const Size& i_rMinSize, size_t i_nIndex )
{
size_t nIndex = i_nIndex;
if( i_nIndex >= m_aElements.size() )
{
nIndex = m_aElements.size();
- m_aElements.push_back( WindowArranger::Element( i_pWindow, boost::shared_ptr<WindowArranger>(), i_nExpandPrio ) );
+ m_aElements.push_back( WindowArranger::Element( i_pWindow, boost::shared_ptr<WindowArranger>(), i_nExpandPrio, i_rMinSize ) );
}
else
{
std::vector< WindowArranger::Element >::iterator it = m_aElements.begin();
while( i_nIndex-- )
++it;
- m_aElements.insert( it, WindowArranger::Element( i_pWindow, boost::shared_ptr<WindowArranger>(), i_nExpandPrio ) );
+ m_aElements.insert( it, WindowArranger::Element( i_pWindow, boost::shared_ptr<WindowArranger>(), i_nExpandPrio, i_rMinSize ) );
}
return nIndex;
}
@@ -480,14 +574,14 @@ Size LabeledElement::getOptimalSize( WindowSizeType i_eType ) const
if( m_nLabelColumnWidth != 0 )
aRet.Width() = m_nLabelColumnWidth;
else
- aRet.Width() += m_nDistance;
+ aRet.Width() += getBorderValue( m_nDistance );
}
Size aElementSize( m_aElement.getOptimalSize( i_eType ) );
aRet.Width() += aElementSize.Width();
if( aElementSize.Height() > aRet.Height() )
aRet.Height() = aElementSize.Height();
if( aRet.Height() != 0 )
- aRet.Height() += 2*m_nOuterBorder;
+ aRet.Height() += 2 * getBorderValue( m_nOuterBorder );
return aRet;
}
@@ -496,23 +590,25 @@ void LabeledElement::resize()
{
Size aLabelSize( m_aLabel.getOptimalSize( WINDOWSIZE_MINIMUM ) );
Size aElementSize( m_aElement.getOptimalSize( WINDOWSIZE_PREFERRED ) );
- if( m_nDistance + aLabelSize.Width() + aElementSize.Width() > m_aManagedArea.GetWidth() )
+ long nDistance = getBorderValue( m_nDistance );
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ if( nDistance + aLabelSize.Width() + aElementSize.Width() > m_aManagedArea.GetWidth() )
aElementSize = m_aElement.getOptimalSize( WINDOWSIZE_MINIMUM );
// align label and element vertically in LabeledElement
- long nYOff = (m_aManagedArea.GetHeight() - 2*m_nOuterBorder - aLabelSize.Height()) / 2;
+ long nYOff = (m_aManagedArea.GetHeight() - 2*nOuterBorder - aLabelSize.Height()) / 2;
Point aPos( m_aManagedArea.Left(),
- m_aManagedArea.Top() + m_nOuterBorder + nYOff );
+ m_aManagedArea.Top() + nOuterBorder + nYOff );
Size aSize( aLabelSize );
if( m_nLabelColumnWidth != 0 )
aSize.Width() = m_nLabelColumnWidth;
m_aLabel.setPosSize( aPos, aSize );
- aPos.X() += aSize.Width() + m_nDistance;
- nYOff = (m_aManagedArea.GetHeight() - 2*m_nOuterBorder - aElementSize.Height()) / 2;
- aPos.Y() = m_aManagedArea.Top() + m_nOuterBorder + nYOff;
+ aPos.X() += aSize.Width() + nDistance;
+ nYOff = (m_aManagedArea.GetHeight() - 2*nOuterBorder - aElementSize.Height()) / 2;
+ aPos.Y() = m_aManagedArea.Top() + nOuterBorder + nYOff;
aSize.Width() = aElementSize.Width();
- aSize.Height() = m_aManagedArea.GetHeight() - 2*m_nOuterBorder;
+ aSize.Height() = m_aManagedArea.GetHeight() - 2*nOuterBorder;
// label style
// 0: position left and right
@@ -579,18 +675,22 @@ long LabelColumn::getLabelWidth() const
if( pLW )
{
Size aLabSize( pLW->GetOptimalSize( WINDOWSIZE_MINIMUM ) );
+ long nLB = 0;
+ pLabel->getBorders(0, &nLB);
+ aLabSize.Width() += getBorderValue( nLB );
if( aLabSize.Width() > nWidth )
nWidth = aLabSize.Width();
}
}
}
}
- return nWidth + getBorderWidth();
+ return nWidth + getBorderValue( getBorderWidth() );
}
Size LabelColumn::getOptimalSize( WindowSizeType i_eType ) const
{
long nWidth = getLabelWidth();
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
Size aColumnSize;
// every child is a LabeledElement
@@ -623,19 +723,19 @@ Size LabelColumn::getOptimalSize( WindowSizeType i_eType ) const
}
if( aElementSize.Width() )
{
- aElementSize.Width() += 2*m_nOuterBorder;
+ aElementSize.Width() += 2*nOuterBorder;
if( aElementSize.Width() > aColumnSize.Width() )
aColumnSize.Width() = aElementSize.Width();
}
if( aElementSize.Height() )
{
- aColumnSize.Height() += getBorderWidth() + aElementSize.Height();
+ aColumnSize.Height() += getBorderValue( getBorderWidth() ) + aElementSize.Height();
}
}
if( nEle > 0 && aColumnSize.Height() )
{
- aColumnSize.Height() -= getBorderWidth(); // for the first element
- aColumnSize.Height() += 2*m_nOuterBorder;
+ aColumnSize.Height() -= getBorderValue( getBorderWidth() ); // for the first element
+ aColumnSize.Height() += 2*nOuterBorder;
}
return aColumnSize;
}
@@ -668,12 +768,13 @@ size_t LabelColumn::addRow( Window* i_pLabel, boost::shared_ptr<WindowArranger>
return nIndex;
}
-size_t LabelColumn::addRow( Window* i_pLabel, Window* i_pElement, long i_nIndent )
+size_t LabelColumn::addRow( Window* i_pLabel, Window* i_pElement, long i_nIndent, const Size& i_rElementMinSize )
{
boost::shared_ptr< LabeledElement > xLabel( new LabeledElement( this, 1 ) );
xLabel->setLabel( i_pLabel );
xLabel->setBorders( 0, i_nIndent, 0, 0, 0 );
xLabel->setElement( i_pElement );
+ xLabel->setMinimumSize( 1, i_rElementMinSize );
size_t nIndex = addChild( xLabel );
resize();
return nIndex;
@@ -691,19 +792,23 @@ Indenter::~Indenter()
Size Indenter::getOptimalSize( WindowSizeType i_eType ) const
{
Size aSize( m_aElement.getOptimalSize( i_eType ) );
- aSize.Width() += 2*m_nOuterBorder + m_nIndent;
- aSize.Height() += 2*m_nOuterBorder;
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ long nIndent = getBorderValue( m_nIndent );
+ aSize.Width() += 2*nOuterBorder + nIndent;
+ aSize.Height() += 2*nOuterBorder;
return aSize;
}
void Indenter::resize()
{
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ long nIndent = getBorderValue( m_nIndent );
Point aPt( m_aManagedArea.TopLeft() );
- aPt.X() += m_nOuterBorder + m_nIndent;
- aPt.Y() += m_nOuterBorder;
+ aPt.X() += nOuterBorder + nIndent;
+ aPt.Y() += nOuterBorder;
Size aSz( m_aManagedArea.GetSize() );
- aSz.Width() -= 2*m_nOuterBorder + m_nIndent;
- aSz.Height() -= 2*m_nOuterBorder;
+ aSz.Width() -= 2*nOuterBorder + nIndent;
+ aSz.Height() -= 2*nOuterBorder;
m_aElement.setPosSize( aPt, aSz );
}
@@ -729,9 +834,13 @@ MatrixArranger::~MatrixArranger()
{
}
-Size MatrixArranger::getOptimalSize( WindowSizeType i_eType, std::vector<long>& o_rColumnWidths, std::vector<long>& o_rRowHeights ) const
+Size MatrixArranger::getOptimalSize( WindowSizeType i_eType,
+ std::vector<long>& o_rColumnWidths, std::vector<long>& o_rRowHeights,
+ std::vector<sal_Int32>& o_rColumnPrio, std::vector<sal_Int32>& o_rRowPrio
+ ) const
{
- Size aMatrixSize( 2*m_nOuterBorder, 2*m_nOuterBorder );
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ Size aMatrixSize( 2*nOuterBorder, 2*nOuterBorder );
// first find out the current number of rows and columns
sal_uInt32 nRows = 0, nColumns = 0;
@@ -747,6 +856,8 @@ Size MatrixArranger::getOptimalSize( WindowSizeType i_eType, std::vector<long>&
// now allocate row and column depth vectors
o_rColumnWidths = std::vector< long >( nColumns, 0 );
o_rRowHeights = std::vector< long >( nRows, 0 );
+ o_rColumnPrio = std::vector< sal_Int32 >( nColumns, 0 );
+ o_rRowPrio = std::vector< sal_Int32 >( nRows, 0 );
// get sizes an allocate them into rows/columns
for( std::vector< MatrixElement >::const_iterator it = m_aElements.begin();
@@ -757,18 +868,24 @@ Size MatrixArranger::getOptimalSize( WindowSizeType i_eType, std::vector<long>&
o_rColumnWidths[ it->m_nX ] = aSize.Width();
if( aSize.Height() > o_rRowHeights[ it->m_nY ] )
o_rRowHeights[ it->m_nY ] = aSize.Height();
+ if( it->m_nExpandPriority > o_rColumnPrio[ it->m_nX ] )
+ o_rColumnPrio[ it->m_nX ] = it->m_nExpandPriority;
+ if( it->m_nExpandPriority > o_rRowPrio[ it->m_nY ] )
+ o_rRowPrio[ it->m_nY ] = it->m_nExpandPriority;
}
// add up sizes
+ long nDistanceX = getBorderValue( m_nBorderX );
+ long nDistanceY = getBorderValue( m_nBorderY );
for( sal_uInt32 i = 0; i < nColumns; i++ )
- aMatrixSize.Width() += o_rColumnWidths[i] + m_nBorderX;
+ aMatrixSize.Width() += o_rColumnWidths[i] + nDistanceX;
if( nColumns > 0 )
- aMatrixSize.Width() -= m_nBorderX;
+ aMatrixSize.Width() -= nDistanceX;
for( sal_uInt32 i = 0; i < nRows; i++ )
- aMatrixSize.Height() += o_rRowHeights[i] + m_nBorderY;
+ aMatrixSize.Height() += o_rRowHeights[i] + nDistanceY;
if( nRows > 0 )
- aMatrixSize.Height() -= m_nBorderY;
+ aMatrixSize.Height() -= nDistanceY;
return aMatrixSize;
}
@@ -776,9 +893,48 @@ Size MatrixArranger::getOptimalSize( WindowSizeType i_eType, std::vector<long>&
Size MatrixArranger::getOptimalSize( WindowSizeType i_eType ) const
{
std::vector<long> aColumnWidths, aRowHeights;
- return getOptimalSize( i_eType, aColumnWidths, aRowHeights );
+ std::vector<sal_Int32> aColumnPrio, aRowPrio;
+ return getOptimalSize( i_eType, aColumnWidths, aRowHeights, aColumnPrio, aRowPrio );
}
+void MatrixArranger::distributeExtraSize( std::vector<long>& io_rSizes, const std::vector<sal_Int32>& i_rPrios, long i_nExtraWidth )
+{
+ if( ! io_rSizes.empty() && io_rSizes.size() == i_rPrios.size() ) // sanity check
+ {
+ // find all elements with the highest expand priority
+ size_t nElements = io_rSizes.size();
+ std::vector< size_t > aIndices;
+ sal_Int32 nHighPrio = 0;
+ for( size_t i = 0; i < nElements; i++ )
+ {
+ sal_Int32 nCurPrio = i_rPrios[ i ];
+ if( nCurPrio > nHighPrio )
+ {
+ aIndices.clear();
+ nHighPrio = nCurPrio;
+ }
+ if( nCurPrio == nHighPrio )
+ aIndices.push_back( i );
+ }
+
+ // distribute extra space evenly among collected elements
+ nElements = aIndices.size();
+ if( nElements > 0 )
+ {
+ long nDelta = i_nExtraWidth / nElements;
+ for( size_t i = 0; i < nElements; i++ )
+ {
+ io_rSizes[ aIndices[i] ] += nDelta;
+ i_nExtraWidth -= nDelta;
+ }
+ // add the last pixels to the last row element
+ if( i_nExtraWidth > 0 && nElements > 0 )
+ io_rSizes[aIndices.back()] += i_nExtraWidth;
+ }
+ }
+}
+
+
void MatrixArranger::resize()
{
// assure that we have at least one row and column
@@ -787,30 +943,44 @@ void MatrixArranger::resize()
// check if we can get optimal size, else fallback to minimal size
std::vector<long> aColumnWidths, aRowHeights;
- Size aOptSize( getOptimalSize( WINDOWSIZE_PREFERRED, aColumnWidths, aRowHeights ) );
+ std::vector<sal_Int32> aColumnPrio, aRowPrio;
+ Size aOptSize( getOptimalSize( WINDOWSIZE_PREFERRED, aColumnWidths, aRowHeights, aColumnPrio, aRowPrio ) );
if( aOptSize.Height() > m_aManagedArea.GetHeight() ||
aOptSize.Width() > m_aManagedArea.GetWidth() )
{
std::vector<long> aMinColumnWidths, aMinRowHeights;
- getOptimalSize( WINDOWSIZE_MINIMUM, aMinColumnWidths, aMinRowHeights );
+ getOptimalSize( WINDOWSIZE_MINIMUM, aMinColumnWidths, aMinRowHeights, aColumnPrio, aRowPrio );
if( aOptSize.Height() > m_aManagedArea.GetHeight() )
aRowHeights = aMinRowHeights;
if( aOptSize.Width() > m_aManagedArea.GetWidth() )
aColumnWidths = aMinColumnWidths;
}
- // FIXME: distribute extra space available
+ // distribute extra space available
+ long nExtraSize = m_aManagedArea.GetWidth();
+ for( size_t i = 0; i < aColumnWidths.size(); ++i )
+ nExtraSize -= aColumnWidths[i] + m_nBorderX;
+ if( nExtraSize > 0 )
+ distributeExtraSize( aColumnWidths, aColumnPrio, nExtraSize );
+ nExtraSize = m_aManagedArea.GetHeight();
+ for( size_t i = 0; i < aRowHeights.size(); ++i )
+ nExtraSize -= aRowHeights[i] + m_nBorderY;
+ if( nExtraSize > 0 )
+ distributeExtraSize( aRowHeights, aRowPrio, nExtraSize );
// prepare offsets
+ long nDistanceX = getBorderValue( m_nBorderX );
+ long nDistanceY = getBorderValue( m_nBorderY );
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
std::vector<long> aColumnX( aColumnWidths.size() );
- aColumnX[0] = m_aManagedArea.Left() + m_nOuterBorder;
+ aColumnX[0] = m_aManagedArea.Left() + nOuterBorder;
for( size_t i = 1; i < aColumnX.size(); i++ )
- aColumnX[i] = aColumnX[i-1] + aColumnWidths[i-1] + m_nBorderX;
+ aColumnX[i] = aColumnX[i-1] + aColumnWidths[i-1] + nDistanceX;
std::vector<long> aRowY( aRowHeights.size() );
- aRowY[0] = m_aManagedArea.Top() + m_nOuterBorder;
+ aRowY[0] = m_aManagedArea.Top() + nOuterBorder;
for( size_t i = 1; i < aRowY.size(); i++ )
- aRowY[i] = aRowY[i-1] + aRowHeights[i-1] + m_nBorderY;
+ aRowY[i] = aRowY[i-1] + aRowHeights[i-1] + nDistanceY;
// now iterate over the elements and assign their positions
for( std::vector< MatrixElement >::iterator it = m_aElements.begin();
@@ -822,7 +992,7 @@ void MatrixArranger::resize()
}
}
-size_t MatrixArranger::addWindow( Window* i_pWindow, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio )
+size_t MatrixArranger::addWindow( Window* i_pWindow, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio, const Size& i_rMinSize )
{
sal_uInt64 nMapValue = getMap( i_nX, i_nY );
std::map< sal_uInt64, size_t >::const_iterator it = m_aMatrixMap.find( nMapValue );
@@ -830,7 +1000,7 @@ size_t MatrixArranger::addWindow( Window* i_pWindow, sal_uInt32 i_nX, sal_uInt32
if( it == m_aMatrixMap.end() )
{
m_aMatrixMap[ nMapValue ] = nIndex = m_aElements.size();
- m_aElements.push_back( MatrixElement( i_pWindow, i_nX, i_nY, boost::shared_ptr<WindowArranger>(), i_nExpandPrio ) );
+ m_aElements.push_back( MatrixElement( i_pWindow, i_nX, i_nY, boost::shared_ptr<WindowArranger>(), i_nExpandPrio, i_rMinSize ) );
}
else
{
@@ -838,6 +1008,7 @@ size_t MatrixArranger::addWindow( Window* i_pWindow, sal_uInt32 i_nX, sal_uInt32
rEle.m_pElement = i_pWindow;
rEle.m_pChild.reset();
rEle.m_nExpandPriority = i_nExpandPrio;
+ rEle.m_aMinSize = i_rMinSize;
rEle.m_nX = i_nX;
rEle.m_nY = i_nY;
nIndex = it->second;
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index ebb63f07b11b..a71aadc3cdad 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -53,7 +53,7 @@ using namespace ::com::sun::star::uno;
// =======================================================================
-static void ImplGetPinImage( USHORT nStyle, BOOL bPinIn, Image& rImage )
+static void ImplGetPinImage( sal_uInt16 nStyle, sal_Bool bPinIn, Image& rImage )
{
// ImageListe laden, wenn noch nicht vorhanden
ImplSVData* pSVData = ImplGetSVData();
@@ -71,7 +71,7 @@ static void ImplGetPinImage( USHORT nStyle, BOOL bPinIn, Image& rImage )
}
// Image ermitteln und zurueckgeben
- USHORT nId;
+ sal_uInt16 nId;
if ( nStyle & BUTTON_DRAW_PRESSED )
{
if ( bPinIn )
@@ -126,9 +126,9 @@ static void ImplDrawBrdWinSymbol( OutputDevice* pDev,
static void ImplDrawBrdWinSymbolButton( OutputDevice* pDev,
const Rectangle& rRect,
- SymbolType eSymbol, USHORT nState )
+ SymbolType eSymbol, sal_uInt16 nState )
{
- BOOL bMouseOver = (nState & BUTTON_DRAW_HIGHLIGHT) != 0;
+ sal_Bool bMouseOver = (nState & BUTTON_DRAW_HIGHLIGHT) != 0;
nState &= ~BUTTON_DRAW_HIGHLIGHT;
Rectangle aTempRect;
@@ -141,8 +141,8 @@ static void ImplDrawBrdWinSymbolButton( OutputDevice* pDev,
pWin->SetFillColor( pDev->GetSettings().GetStyleSettings().GetWindowColor() );
pWin->SetLineColor();
pWin->DrawRect( rRect );
- pWin->DrawSelectionBackground( rRect, 2, (nState & BUTTON_DRAW_PRESSED) ? TRUE : FALSE,
- TRUE, FALSE );
+ pWin->DrawSelectionBackground( rRect, 2, (nState & BUTTON_DRAW_PRESSED) ? sal_True : sal_False,
+ sal_True, sal_False );
}
aTempRect = rRect;
aTempRect.nLeft+=3;
@@ -171,23 +171,23 @@ ImplBorderWindowView::~ImplBorderWindowView()
// -----------------------------------------------------------------------
-BOOL ImplBorderWindowView::MouseMove( const MouseEvent& )
+sal_Bool ImplBorderWindowView::MouseMove( const MouseEvent& )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL ImplBorderWindowView::MouseButtonDown( const MouseEvent& )
+sal_Bool ImplBorderWindowView::MouseButtonDown( const MouseEvent& )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL ImplBorderWindowView::Tracking( const TrackingEvent& )
+sal_Bool ImplBorderWindowView::Tracking( const TrackingEvent& )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -242,7 +242,7 @@ void ImplBorderWindowView::ImplInitTitle( ImplBorderFrameData* pData )
// -----------------------------------------------------------------------
-USHORT ImplBorderWindowView::ImplHitTest( ImplBorderFrameData* pData, const Point& rPos )
+sal_uInt16 ImplBorderWindowView::ImplHitTest( ImplBorderFrameData* pData, const Point& rPos )
{
ImplBorderWindow* pBorderWindow = pData->mpBorderWindow;
@@ -321,15 +321,15 @@ USHORT ImplBorderWindowView::ImplHitTest( ImplBorderFrameData* pData, const Poin
// -----------------------------------------------------------------------
-BOOL ImplBorderWindowView::ImplMouseMove( ImplBorderFrameData* pData, const MouseEvent& rMEvt )
+sal_Bool ImplBorderWindowView::ImplMouseMove( ImplBorderFrameData* pData, const MouseEvent& rMEvt )
{
- USHORT oldCloseState = pData->mnCloseState;
- USHORT oldMenuState = pData->mnMenuState;
+ sal_uInt16 oldCloseState = pData->mnCloseState;
+ sal_uInt16 oldMenuState = pData->mnMenuState;
pData->mnCloseState &= ~BUTTON_DRAW_HIGHLIGHT;
pData->mnMenuState &= ~BUTTON_DRAW_HIGHLIGHT;
Point aMousePos = rMEvt.GetPosPixel();
- USHORT nHitTest = ImplHitTest( pData, aMousePos );
+ sal_uInt16 nHitTest = ImplHitTest( pData, aMousePos );
PointerStyle ePtrStyle = POINTER_ARROW;
if ( nHitTest & BORDERWINDOW_HITTEST_LEFT )
ePtrStyle = POINTER_WINDOW_WSIZE;
@@ -358,12 +358,12 @@ BOOL ImplBorderWindowView::ImplMouseMove( ImplBorderFrameData* pData, const Mous
if( pData->mnMenuState != oldMenuState )
pData->mpBorderWindow->Invalidate( pData->maMenuRect );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, const MouseEvent& rMEvt )
+sal_Bool ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, const MouseEvent& rMEvt )
{
ImplBorderWindow* pBorderWindow = pData->mpBorderWindow;
@@ -371,11 +371,11 @@ BOOL ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, cons
{
pData->maMouseOff = rMEvt.GetPosPixel();
pData->mnHitTest = ImplHitTest( pData, pData->maMouseOff );
- USHORT nDragFullTest = 0;
+ sal_uInt16 nDragFullTest = 0;
if ( pData->mnHitTest )
{
- BOOL bTracking = TRUE;
- BOOL bHitTest = TRUE;
+ sal_Bool bTracking = sal_True;
+ sal_Bool bHitTest = sal_True;
if ( pData->mnHitTest & BORDERWINDOW_HITTEST_CLOSE )
{
@@ -440,18 +440,18 @@ BOOL ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, cons
}
else
{
- bTracking = FALSE;
+ bTracking = sal_False;
if ( (pData->mnHitTest & BORDERWINDOW_DRAW_TITLE) &&
((rMEvt.GetClicks() % 2) == 0) )
{
pData->mnHitTest = 0;
- bHitTest = FALSE;
+ bHitTest = sal_False;
if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() )
{
SystemWindow* pClientWindow = (SystemWindow*)(pBorderWindow->ImplGetClientWindow());
- if ( TRUE /*pBorderWindow->mbDockBtn*/ ) // always perform docking on double click, no button required
+ if ( sal_True /*pBorderWindow->mbDockBtn*/ ) // always perform docking on double click, no button required
pClientWindow->TitleButtonClick( TITLE_BUTTON_DOCKING );
else if ( pBorderWindow->GetStyle() & WB_ROLLABLE )
{
@@ -468,9 +468,9 @@ BOOL ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, cons
if ( bTracking )
{
- pData->mbDragFull = FALSE;
+ pData->mbDragFull = sal_False;
if ( nDragFullTest )
- pData->mbDragFull = TRUE; // always fulldrag for proper docking, ignore system settings
+ pData->mbDragFull = sal_True; // always fulldrag for proper docking, ignore system settings
pBorderWindow->StartTracking();
}
else if ( bHitTest )
@@ -478,18 +478,18 @@ BOOL ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, cons
}
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const TrackingEvent& rTEvt )
+sal_Bool ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const TrackingEvent& rTEvt )
{
ImplBorderWindow* pBorderWindow = pData->mpBorderWindow;
if ( rTEvt.IsTrackingEnded() )
{
- USHORT nHitTest = pData->mnHitTest;
+ sal_uInt16 nHitTest = pData->mnHitTest;
pData->mnHitTest = 0;
if ( nHitTest & BORDERWINDOW_HITTEST_CLOSE )
@@ -931,7 +931,7 @@ BOOL ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const Track
}
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -940,9 +940,9 @@ String ImplBorderWindowView::ImplRequestHelp( ImplBorderFrameData* pData,
const Point& rPos,
Rectangle& rHelpRect )
{
- USHORT nHelpId = 0;
+ sal_uInt16 nHelpId = 0;
String aHelpStr;
- USHORT nHitTest = ImplHitTest( pData, rPos );
+ sal_uInt16 nHitTest = ImplHitTest( pData, rPos );
if ( nHitTest )
{
if ( nHitTest & BORDERWINDOW_HITTEST_CLOSE )
@@ -1062,7 +1062,7 @@ long ImplNoBorderWindowView::CalcTitleWidth() const
// -----------------------------------------------------------------------
-void ImplNoBorderWindowView::DrawWindow( USHORT, OutputDevice*, const Point* )
+void ImplNoBorderWindowView::DrawWindow( sal_uInt16, OutputDevice*, const Point* )
{
}
@@ -1088,7 +1088,7 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei
mnHeight = nHeight;
mbNWFBorder = false;
- USHORT nBorderStyle = mpBorderWindow->GetBorderStyle();
+ sal_uInt16 nBorderStyle = mpBorderWindow->GetBorderStyle();
if ( nBorderStyle & WINDOW_BORDER_NOBORDER )
{
mnLeftBorder = 0;
@@ -1164,16 +1164,16 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei
if( mnWidth && mnHeight )
{
- mpBorderWindow->SetPaintTransparent( TRUE );
+ mpBorderWindow->SetPaintTransparent( sal_True );
mpBorderWindow->SetBackground();
- pCtrl->SetPaintTransparent( TRUE );
+ pCtrl->SetPaintTransparent( sal_True );
Window* pCompoundParent = NULL;
if( pWin->GetParent() && pWin->GetParent()->IsCompoundControl() )
pCompoundParent = pWin->GetParent();
if( pCompoundParent )
- pCompoundParent->SetPaintTransparent( TRUE );
+ pCompoundParent->SetPaintTransparent( sal_True );
if( mnWidth < aBounds.GetWidth() || mnHeight < aBounds.GetHeight() )
{
@@ -1196,7 +1196,7 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei
if( ! mbNWFBorder )
{
- USHORT nStyle = FRAME_DRAW_NODRAW;
+ sal_uInt16 nStyle = FRAME_DRAW_NODRAW;
// Wenn Border umgesetzt wurde oder BorderWindow ein Frame-Fenster
// ist, dann Border nach aussen
if ( (nBorderStyle & WINDOW_BORDER_DOUBLEOUT) || mpBorderWindow->mbSmallOutBorder )
@@ -1237,13 +1237,13 @@ long ImplSmallBorderWindowView::CalcTitleWidth() const
// -----------------------------------------------------------------------
-void ImplSmallBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice*, const Point* )
+void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice*, const Point* )
{
- USHORT nBorderStyle = mpBorderWindow->GetBorderStyle();
+ sal_uInt16 nBorderStyle = mpBorderWindow->GetBorderStyle();
if ( nBorderStyle & WINDOW_BORDER_NOBORDER )
return;
- BOOL bNativeOK = FALSE;
+ sal_Bool bNativeOK = sal_False;
// for native widget drawing we must find out what
// control this border belongs to
Window *pWin = NULL, *pCtrl = NULL;
@@ -1334,9 +1334,9 @@ void ImplSmallBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice*, co
nState |= CTRL_STATE_FOCUSED;
}
- BOOL bMouseOver = FALSE;
+ sal_Bool bMouseOver = sal_False;
Window *pCtrlChild = pCtrl->GetWindow( WINDOW_FIRSTCHILD );
- while( pCtrlChild && (bMouseOver = pCtrlChild->IsMouseOver()) == FALSE )
+ while( pCtrlChild && (bMouseOver = pCtrlChild->IsMouseOver()) == sal_False )
pCtrlChild = pCtrlChild->GetWindow( WINDOW_NEXT );
if( bMouseOver )
@@ -1385,7 +1385,7 @@ void ImplSmallBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice*, co
}
else
{
- USHORT nStyle = 0;
+ sal_uInt16 nStyle = 0;
// Wenn Border umgesetzt wurde oder BorderWindow ein Frame-Fenster
// ist, dann Border nach aussen
if ( (nBorderStyle & WINDOW_BORDER_DOUBLEOUT) || mpBorderWindow->mbSmallOutBorder )
@@ -1417,7 +1417,7 @@ void ImplSmallBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice*, co
ImplStdBorderWindowView::ImplStdBorderWindowView( ImplBorderWindow* pBorderWindow )
{
maFrameData.mpBorderWindow = pBorderWindow;
- maFrameData.mbDragFull = FALSE;
+ maFrameData.mbDragFull = sal_False;
maFrameData.mnHitTest = 0;
maFrameData.mnPinState = 0;
maFrameData.mnCloseState = 0;
@@ -1444,21 +1444,21 @@ ImplStdBorderWindowView::~ImplStdBorderWindowView()
// -----------------------------------------------------------------------
-BOOL ImplStdBorderWindowView::MouseMove( const MouseEvent& rMEvt )
+sal_Bool ImplStdBorderWindowView::MouseMove( const MouseEvent& rMEvt )
{
return ImplMouseMove( &maFrameData, rMEvt );
}
// -----------------------------------------------------------------------
-BOOL ImplStdBorderWindowView::MouseButtonDown( const MouseEvent& rMEvt )
+sal_Bool ImplStdBorderWindowView::MouseButtonDown( const MouseEvent& rMEvt )
{
return ImplMouseButtonDown( &maFrameData, rMEvt );
}
// -----------------------------------------------------------------------
-BOOL ImplStdBorderWindowView::Tracking( const TrackingEvent& rTEvt )
+sal_Bool ImplStdBorderWindowView::Tracking( const TrackingEvent& rTEvt )
{
return ImplTracking( &maFrameData, rTEvt );
}
@@ -1654,7 +1654,7 @@ long ImplStdBorderWindowView::CalcTitleWidth() const
// -----------------------------------------------------------------------
-void ImplStdBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice* pOutDev, const Point* pOffset )
+void ImplStdBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* pOutDev, const Point* pOffset )
{
ImplBorderFrameData* pData = &maFrameData;
OutputDevice* pDev = pOutDev ? pOutDev : pData->mpOutDev;
@@ -1666,7 +1666,7 @@ void ImplStdBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice* pOutD
Color aFaceColor( rStyleSettings.GetFaceColor() );
Color aFrameColor( aFaceColor );
- aFrameColor.DecreaseContrast( (UINT8) (0.50 * 255));
+ aFrameColor.DecreaseContrast( (sal_uInt8) (0.50 * 255));
// Draw Frame
if ( nDrawFlags & BORDERWINDOW_DRAW_FRAME )
@@ -1762,7 +1762,7 @@ void ImplStdBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice* pOutD
if ( pOffset )
aInRect.Move( pOffset->X(), pOffset->Y() );
- USHORT nTextStyle = TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER | TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_CLIP;
+ sal_uInt16 nTextStyle = TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER | TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_CLIP;
// must show tooltip ?
TextRectInfo aInfo;
@@ -1852,14 +1852,14 @@ void ImplStdBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice* pOutD
// =======================================================================
void ImplBorderWindow::ImplInit( Window* pParent,
- WinBits nStyle, USHORT nTypeStyle,
+ WinBits nStyle, sal_uInt16 nTypeStyle,
const ::com::sun::star::uno::Any& )
{
ImplInit( pParent, nStyle, nTypeStyle, NULL );
}
void ImplBorderWindow::ImplInit( Window* pParent,
- WinBits nStyle, USHORT nTypeStyle,
+ WinBits nStyle, sal_uInt16 nTypeStyle,
SystemParentData* pSystemParentData
)
{
@@ -1870,44 +1870,44 @@ void ImplBorderWindow::ImplInit( Window* pParent,
nTestStyle |= WB_APP;
nStyle &= nTestStyle;
- mpWindowImpl->mbBorderWin = TRUE;
- mbSmallOutBorder = FALSE;
+ mpWindowImpl->mbBorderWin = sal_True;
+ mbSmallOutBorder = sal_False;
if ( nTypeStyle & BORDERWINDOW_STYLE_FRAME )
{
if( (nStyle & WB_SYSTEMCHILDWINDOW) )
{
- mpWindowImpl->mbOverlapWin = TRUE;
- mpWindowImpl->mbFrame = TRUE;
- mbFrameBorder = FALSE;
+ mpWindowImpl->mbOverlapWin = sal_True;
+ mpWindowImpl->mbFrame = sal_True;
+ mbFrameBorder = sal_False;
}
else if( (nStyle & (WB_OWNERDRAWDECORATION | WB_POPUP)) )
{
- mpWindowImpl->mbOverlapWin = TRUE;
- mpWindowImpl->mbFrame = TRUE;
- mbFrameBorder = (nOrgStyle & WB_NOBORDER) ? FALSE : TRUE;
+ mpWindowImpl->mbOverlapWin = sal_True;
+ mpWindowImpl->mbFrame = sal_True;
+ mbFrameBorder = (nOrgStyle & WB_NOBORDER) ? sal_False : sal_True;
}
else
{
- mpWindowImpl->mbOverlapWin = TRUE;
- mpWindowImpl->mbFrame = TRUE;
- mbFrameBorder = FALSE;
+ mpWindowImpl->mbOverlapWin = sal_True;
+ mpWindowImpl->mbFrame = sal_True;
+ mbFrameBorder = sal_False;
// closeable windows may have a border as well, eg. system floating windows without caption
if ( (nOrgStyle & (WB_BORDER | WB_NOBORDER | WB_MOVEABLE | WB_SIZEABLE/* | WB_CLOSEABLE*/)) == WB_BORDER )
- mbSmallOutBorder = TRUE;
+ mbSmallOutBorder = sal_True;
}
}
else if ( nTypeStyle & BORDERWINDOW_STYLE_OVERLAP )
{
- mpWindowImpl->mbOverlapWin = TRUE;
- mbFrameBorder = TRUE;
+ mpWindowImpl->mbOverlapWin = sal_True;
+ mbFrameBorder = sal_True;
}
else
- mbFrameBorder = FALSE;
+ mbFrameBorder = sal_False;
if ( nTypeStyle & BORDERWINDOW_STYLE_FLOAT )
- mbFloatWindow = TRUE;
+ mbFloatWindow = sal_True;
else
- mbFloatWindow = FALSE;
+ mbFloatWindow = sal_False;
Window::ImplInit( pParent, nStyle, pSystemParentData );
SetBackground();
@@ -1920,13 +1920,13 @@ void ImplBorderWindow::ImplInit( Window* pParent,
mnMaxHeight = SHRT_MAX;
mnRollHeight = 0;
mnOrgMenuHeight = 0;
- mbPined = FALSE;
- mbRollUp = FALSE;
- mbMenuHide = FALSE;
- mbDockBtn = FALSE;
- mbMenuBtn = FALSE;
- mbHideBtn = FALSE;
- mbHelpBtn = FALSE;
+ mbPined = sal_False;
+ mbRollUp = sal_False;
+ mbMenuHide = sal_False;
+ mbDockBtn = sal_False;
+ mbMenuBtn = sal_False;
+ mbHideBtn = sal_False;
+ mbHelpBtn = sal_False;
mbDisplayActive = IsActive();
if ( nTypeStyle & BORDERWINDOW_STYLE_FLOAT )
@@ -1941,7 +1941,7 @@ void ImplBorderWindow::ImplInit( Window* pParent,
ImplBorderWindow::ImplBorderWindow( Window* pParent,
SystemParentData* pSystemParentData,
- WinBits nStyle, USHORT nTypeStyle
+ WinBits nStyle, sal_uInt16 nTypeStyle
) : Window( WINDOW_BORDERWINDOW )
{
ImplInit( pParent, nStyle, nTypeStyle, pSystemParentData );
@@ -1950,14 +1950,14 @@ ImplBorderWindow::ImplBorderWindow( Window* pParent,
// -----------------------------------------------------------------------
ImplBorderWindow::ImplBorderWindow( Window* pParent, WinBits nStyle ,
- USHORT nTypeStyle ) :
+ sal_uInt16 nTypeStyle ) :
Window( WINDOW_BORDERWINDOW )
{
ImplInit( pParent, nStyle, nTypeStyle, ::com::sun::star::uno::Any() );
}
ImplBorderWindow::ImplBorderWindow( Window* pParent,
- WinBits nStyle, USHORT nTypeStyle,
+ WinBits nStyle, sal_uInt16 nTypeStyle,
const ::com::sun::star::uno::Any& aSystemToken ) :
Window( WINDOW_BORDERWINDOW )
{
@@ -2008,7 +2008,7 @@ void ImplBorderWindow::Draw( const Rectangle&, OutputDevice* pOutDev, const Poin
void ImplBorderWindow::Activate()
{
- SetDisplayActive( TRUE );
+ SetDisplayActive( sal_True );
Window::Activate();
}
@@ -2019,7 +2019,7 @@ void ImplBorderWindow::Deactivate()
// Fenster die immer Active sind, nehmen wir von dieser Regel aus,
// genauso, wenn ein Menu aktiv wird, ignorieren wir das Deactivate
if ( GetActivateMode() && !ImplGetSVData()->maWinData.mbNoDeactivate )
- SetDisplayActive( FALSE );
+ SetDisplayActive( sal_False );
Window::Deactivate();
}
@@ -2133,7 +2133,7 @@ void ImplBorderWindow::DataChanged( const DataChangedEvent& rDCEvt )
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
if ( !mpWindowImpl->mbFrame || (GetStyle() & (WB_OWNERDRAWDECORATION | WB_POPUP)) )
- UpdateView( TRUE, ImplGetWindow()->GetOutputSizePixel() );
+ UpdateView( sal_True, ImplGetWindow()->GetOutputSizePixel() );
}
Window::DataChanged( rDCEvt );
@@ -2162,7 +2162,7 @@ void ImplBorderWindow::InitView()
// -----------------------------------------------------------------------
-void ImplBorderWindow::UpdateView( BOOL bNewView, const Size& rNewOutSize )
+void ImplBorderWindow::UpdateView( sal_Bool bNewView, const Size& rNewOutSize )
{
sal_Int32 nLeftBorder;
sal_Int32 nTopBorder;
@@ -2238,7 +2238,7 @@ void ImplBorderWindow::InvalidateBorder()
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetDisplayActive( BOOL bActive )
+void ImplBorderWindow::SetDisplayActive( sal_Bool bActive )
{
if ( mbDisplayActive != bActive )
{
@@ -2250,26 +2250,26 @@ void ImplBorderWindow::SetDisplayActive( BOOL bActive )
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetTitleType( USHORT nTitleType, const Size& rSize )
+void ImplBorderWindow::SetTitleType( sal_uInt16 nTitleType, const Size& rSize )
{
mnTitleType = nTitleType;
- UpdateView( FALSE, rSize );
+ UpdateView( sal_False, rSize );
}
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetBorderStyle( USHORT nStyle )
+void ImplBorderWindow::SetBorderStyle( sal_uInt16 nStyle )
{
if ( !mbFrameBorder && (mnBorderStyle != nStyle) )
{
mnBorderStyle = nStyle;
- UpdateView( FALSE, ImplGetWindow()->GetOutputSizePixel() );
+ UpdateView( sal_False, ImplGetWindow()->GetOutputSizePixel() );
}
}
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetPin( BOOL bPin )
+void ImplBorderWindow::SetPin( sal_Bool bPin )
{
mbPined = bPin;
InvalidateBorder();
@@ -2277,11 +2277,11 @@ void ImplBorderWindow::SetPin( BOOL bPin )
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetRollUp( BOOL bRollUp, const Size& rSize )
+void ImplBorderWindow::SetRollUp( sal_Bool bRollUp, const Size& rSize )
{
mbRollUp = bRollUp;
mnRollHeight = rSize.Height();
- UpdateView( FALSE, rSize );
+ UpdateView( sal_False, rSize );
}
// -----------------------------------------------------------------------
@@ -2296,7 +2296,7 @@ void ImplBorderWindow::SetCloser()
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetDockButton( BOOL bDockButton )
+void ImplBorderWindow::SetDockButton( sal_Bool bDockButton )
{
mbDockBtn = bDockButton;
Size aSize = GetOutputSizePixel();
@@ -2306,7 +2306,7 @@ void ImplBorderWindow::SetDockButton( BOOL bDockButton )
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetHideButton( BOOL bHideButton )
+void ImplBorderWindow::SetHideButton( sal_Bool bHideButton )
{
mbHideBtn = bHideButton;
Size aSize = GetOutputSizePixel();
@@ -2316,7 +2316,7 @@ void ImplBorderWindow::SetHideButton( BOOL bHideButton )
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetHelpButton( BOOL bHelpButton )
+void ImplBorderWindow::SetHelpButton( sal_Bool bHelpButton )
{
mbHelpBtn = bHelpButton;
Size aSize = GetOutputSizePixel();
@@ -2326,7 +2326,7 @@ void ImplBorderWindow::SetHelpButton( BOOL bHelpButton )
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetMenuButton( BOOL bMenuButton )
+void ImplBorderWindow::SetMenuButton( sal_Bool bMenuButton )
{
mbMenuBtn = bMenuButton;
Size aSize = GetOutputSizePixel();
@@ -2353,7 +2353,7 @@ void ImplBorderWindow::SetMenuBarWindow( Window* pWindow )
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetMenuBarMode( BOOL bHide )
+void ImplBorderWindow::SetMenuBarMode( sal_Bool bHide )
{
mbMenuHide = bHide;
UpdateMenuHeight();
diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx
index c5f329f11c38..cf9697b4f602 100644
--- a/vcl/source/window/btndlg.cxx
+++ b/vcl/source/window/btndlg.cxx
@@ -40,7 +40,7 @@ typedef boost::ptr_vector<ImplBtnDlgItem>::const_iterator btn_const_iterator;
struct ImplBtnDlgItem
{
- USHORT mnId;
+ sal_uInt16 mnId;
bool mbOwnButton;
bool mbDummyAlign;
long mnSepSize;
@@ -52,7 +52,7 @@ void ButtonDialog::ImplInitButtonDialogData()
mnButtonSize = 0;
mnCurButtonId = 0;
mnFocusButtonId = BUTTONDIALOG_BUTTON_NOTFOUND;
- mbFormat = TRUE;
+ mbFormat = sal_True;
}
ButtonDialog::ButtonDialog( WindowType nType ) :
@@ -86,7 +86,7 @@ ButtonDialog::~ButtonDialog()
}
}
-PushButton* ButtonDialog::ImplCreatePushButton( USHORT nBtnFlags )
+PushButton* ButtonDialog::ImplCreatePushButton( sal_uInt16 nBtnFlags )
{
PushButton* pBtn;
WinBits nStyle = 0;
@@ -108,7 +108,7 @@ PushButton* ButtonDialog::ImplCreatePushButton( USHORT nBtnFlags )
return pBtn;
}
-ImplBtnDlgItem* ButtonDialog::ImplGetItem( USHORT nId ) const
+ImplBtnDlgItem* ButtonDialog::ImplGetItem( sal_uInt16 nId ) const
{
for ( btn_const_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
{
@@ -223,7 +223,7 @@ void ButtonDialog::ImplPosControls()
SetOutputSizePixel( aDlgSize );
- mbFormat = FALSE;
+ mbFormat = sal_False;
}
IMPL_LINK( ButtonDialog, ImplClickHdl, PushButton*, pBtn )
@@ -281,13 +281,13 @@ void ButtonDialog::Click()
maClickHdl.Call( this );
}
-void ButtonDialog::AddButton( const XubString& rText, USHORT nId,
- USHORT nBtnFlags, long nSepPixel )
+void ButtonDialog::AddButton( const XubString& rText, sal_uInt16 nId,
+ sal_uInt16 nBtnFlags, long nSepPixel )
{
// PageItem anlegen
ImplBtnDlgItem* pItem = new ImplBtnDlgItem;
pItem->mnId = nId;
- pItem->mbOwnButton = TRUE;
+ pItem->mbOwnButton = sal_True;
pItem->mnSepSize = nSepPixel;
pItem->mpPushButton = ImplCreatePushButton( nBtnFlags );
@@ -299,16 +299,16 @@ void ButtonDialog::AddButton( const XubString& rText, USHORT nId,
if ( nBtnFlags & BUTTONDIALOG_FOCUSBUTTON )
mnFocusButtonId = nId;
- mbFormat = TRUE;
+ mbFormat = sal_True;
}
-void ButtonDialog::AddButton( StandardButtonType eType, USHORT nId,
- USHORT nBtnFlags, long nSepPixel )
+void ButtonDialog::AddButton( StandardButtonType eType, sal_uInt16 nId,
+ sal_uInt16 nBtnFlags, long nSepPixel )
{
// PageItem anlegen
ImplBtnDlgItem* pItem = new ImplBtnDlgItem;
pItem->mnId = nId;
- pItem->mbOwnButton = TRUE;
+ pItem->mbOwnButton = sal_True;
pItem->mnSepSize = nSepPixel;
if ( eType == BUTTON_OK )
@@ -333,16 +333,16 @@ void ButtonDialog::AddButton( StandardButtonType eType, USHORT nId,
maItemList.push_back(pItem);
- mbFormat = TRUE;
+ mbFormat = sal_True;
}
-void ButtonDialog::AddButton( PushButton* pBtn, USHORT nId,
- USHORT nBtnFlags, long nSepPixel )
+void ButtonDialog::AddButton( PushButton* pBtn, sal_uInt16 nId,
+ sal_uInt16 nBtnFlags, long nSepPixel )
{
// PageItem anlegen
ImplBtnDlgItem* pItem = new ImplBtnDlgItem;
pItem->mnId = nId;
- pItem->mbOwnButton = FALSE;
+ pItem->mbOwnButton = sal_False;
pItem->mnSepSize = nSepPixel;
pItem->mpPushButton = pBtn;
@@ -351,10 +351,10 @@ void ButtonDialog::AddButton( PushButton* pBtn, USHORT nId,
maItemList.push_back(pItem);
- mbFormat = TRUE;
+ mbFormat = sal_True;
}
-void ButtonDialog::RemoveButton( USHORT nId )
+void ButtonDialog::RemoveButton( sal_uInt16 nId )
{
btn_iterator it;
for (it = maItemList.begin(); it != maItemList.end(); ++it)
@@ -367,7 +367,6 @@ void ButtonDialog::RemoveButton( USHORT nId )
delete it->mpPushButton;
maItemList.erase(it);
- mbFormat = TRUE;
break;
}
}
@@ -387,15 +386,15 @@ void ButtonDialog::Clear()
}
maItemList.clear();
- mbFormat = TRUE;
+ mbFormat = sal_True;
}
-USHORT ButtonDialog::GetButtonCount() const
+sal_uInt16 ButtonDialog::GetButtonCount() const
{
- return (USHORT)maItemList.size();
+ return (sal_uInt16)maItemList.size();
}
-USHORT ButtonDialog::GetButtonId( USHORT nButton ) const
+sal_uInt16 ButtonDialog::GetButtonId( sal_uInt16 nButton ) const
{
if ( nButton < maItemList.size() )
return maItemList[nButton].mnId;
@@ -403,7 +402,7 @@ USHORT ButtonDialog::GetButtonId( USHORT nButton ) const
return BUTTONDIALOG_BUTTON_NOTFOUND;
}
-PushButton* ButtonDialog::GetPushButton( USHORT nId ) const
+PushButton* ButtonDialog::GetPushButton( sal_uInt16 nId ) const
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
@@ -413,18 +412,18 @@ PushButton* ButtonDialog::GetPushButton( USHORT nId ) const
return NULL;
}
-void ButtonDialog::SetButtonText( USHORT nId, const XubString& rText )
+void ButtonDialog::SetButtonText( sal_uInt16 nId, const XubString& rText )
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
if ( pItem )
{
pItem->mpPushButton->SetText( rText );
- mbFormat = TRUE;
+ mbFormat = sal_True;
}
}
-XubString ButtonDialog::GetButtonText( USHORT nId ) const
+XubString ButtonDialog::GetButtonText( sal_uInt16 nId ) const
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
@@ -434,7 +433,7 @@ XubString ButtonDialog::GetButtonText( USHORT nId ) const
return ImplGetSVEmptyStr();
}
-void ButtonDialog::SetButtonHelpText( USHORT nId, const XubString& rText )
+void ButtonDialog::SetButtonHelpText( sal_uInt16 nId, const XubString& rText )
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
@@ -442,7 +441,7 @@ void ButtonDialog::SetButtonHelpText( USHORT nId, const XubString& rText )
pItem->mpPushButton->SetHelpText( rText );
}
-XubString ButtonDialog::GetButtonHelpText( USHORT nId ) const
+XubString ButtonDialog::GetButtonHelpText( sal_uInt16 nId ) const
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
@@ -452,22 +451,19 @@ XubString ButtonDialog::GetButtonHelpText( USHORT nId ) const
return ImplGetSVEmptyStr();
}
-void ButtonDialog::SetButtonHelpId( USHORT nId, ULONG nHelpId )
+void ButtonDialog::SetButtonHelpId( sal_uInt16 nId, const rtl::OString& rHelpId )
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
if ( pItem )
- pItem->mpPushButton->SetHelpId( nHelpId );
+ pItem->mpPushButton->SetHelpId( rHelpId );
}
-ULONG ButtonDialog::GetButtonHelpId( USHORT nId ) const
+rtl::OString ButtonDialog::GetButtonHelpId( sal_uInt16 nId ) const
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
- if ( pItem )
- return pItem->mpPushButton->GetHelpId();
- else
- return 0;
+ return pItem ? rtl::OString( pItem->mpPushButton->GetHelpId() ) : rtl::OString();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/cmdevt.cxx b/vcl/source/window/cmdevt.cxx
index ae5b765909ba..1fa77a3621cd 100644
--- a/vcl/source/window/cmdevt.cxx
+++ b/vcl/source/window/cmdevt.cxx
@@ -42,24 +42,24 @@ CommandExtTextInputData::CommandExtTextInputData()
mnDeltaStart = 0;
mnOldTextLen = 0;
mnCursorFlags = 0;
- mbOnlyCursor = FALSE;
+ mbOnlyCursor = sal_False;
}
// -----------------------------------------------------------------------
CommandExtTextInputData::CommandExtTextInputData( const XubString& rText,
- const USHORT* pTextAttr,
+ const sal_uInt16* pTextAttr,
xub_StrLen nCursorPos,
- USHORT nCursorFlags,
+ sal_uInt16 nCursorFlags,
xub_StrLen nDeltaStart,
xub_StrLen nOldTextLen,
- BOOL bOnlyCursor ) :
+ sal_Bool bOnlyCursor ) :
maText( rText )
{
if ( pTextAttr && maText.Len() )
{
- mpTextAttr = new USHORT[maText.Len()];
- memcpy( mpTextAttr, pTextAttr, maText.Len()*sizeof(USHORT) );
+ mpTextAttr = new sal_uInt16[maText.Len()];
+ memcpy( mpTextAttr, pTextAttr, maText.Len()*sizeof(sal_uInt16) );
}
else
mpTextAttr = NULL;
@@ -77,8 +77,8 @@ CommandExtTextInputData::CommandExtTextInputData( const CommandExtTextInputData&
{
if ( rData.mpTextAttr && maText.Len() )
{
- mpTextAttr = new USHORT[maText.Len()];
- memcpy( mpTextAttr, rData.mpTextAttr, maText.Len()*sizeof(USHORT) );
+ mpTextAttr = new sal_uInt16[maText.Len()];
+ memcpy( mpTextAttr, rData.mpTextAttr, maText.Len()*sizeof(sal_uInt16) );
}
else
mpTextAttr = NULL;
diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx
index 21ef136ad663..318529dcc7d9 100644
--- a/vcl/source/window/cursor.cxx
+++ b/vcl/source/window/cursor.cxx
@@ -48,8 +48,8 @@ struct ImplCursorData
long mnPixSlant; // Pixel-Slant
short mnOrientation; // Pixel-Orientation
unsigned char mnDirection; // indicates writing direction
- USHORT mnStyle; // Cursor-Style
- BOOL mbCurVisible; // Ist Cursor aktuell sichtbar
+ sal_uInt16 mnStyle; // Cursor-Style
+ sal_Bool mbCurVisible; // Ist Cursor aktuell sichtbar
Window* mpWindow; // Zugeordnetes Windows
};
@@ -58,9 +58,9 @@ struct ImplCursorData
static void ImplCursorInvert( ImplCursorData* pData )
{
Window* pWindow = pData->mpWindow;
- BOOL bMapMode = pWindow->IsMapModeEnabled();
- pWindow->EnableMapMode( FALSE );
- USHORT nInvertStyle;
+ sal_Bool bMapMode = pWindow->IsMapModeEnabled();
+ pWindow->EnableMapMode( sal_False );
+ sal_uInt16 nInvertStyle;
if ( pData->mnStyle & CURSOR_SHADOW )
nInvertStyle = INVERT_50;
else
@@ -155,7 +155,7 @@ void Cursor::ImplDraw()
// Ausgabeflaeche berechnen und ausgeben
ImplCursorInvert( mpData );
- mpData->mbCurVisible = TRUE;
+ mpData->mbCurVisible = sal_True;
}
}
@@ -166,13 +166,13 @@ void Cursor::ImplRestore()
if ( mpData && mpData->mbCurVisible )
{
ImplCursorInvert( mpData );
- mpData->mbCurVisible = FALSE;
+ mpData->mbCurVisible = sal_False;
}
}
// -----------------------------------------------------------------------
-void Cursor::ImplShow( BOOL bDrawDirect )
+void Cursor::ImplShow( sal_Bool bDrawDirect )
{
if ( mbVisible )
{
@@ -194,7 +194,7 @@ void Cursor::ImplShow( BOOL bDrawDirect )
if ( !mpData )
{
mpData = new ImplCursorData;
- mpData->mbCurVisible = FALSE;
+ mpData->mbCurVisible = sal_False;
mpData->maTimer.SetTimeoutHdl( LINK( this, Cursor, ImplTimerHdl ) );
}
@@ -269,7 +269,7 @@ Cursor::Cursor()
mnOrientation = 0;
mnDirection = 0;
mnStyle = 0;
- mbVisible = FALSE;
+ mbVisible = sal_False;
}
// -----------------------------------------------------------------------
@@ -302,7 +302,7 @@ Cursor::~Cursor()
// -----------------------------------------------------------------------
-void Cursor::SetStyle( USHORT nStyle )
+void Cursor::SetStyle( sal_uInt16 nStyle )
{
if ( mnStyle != nStyle )
{
@@ -317,7 +317,7 @@ void Cursor::Show()
{
if ( !mbVisible )
{
- mbVisible = TRUE;
+ mbVisible = sal_True;
ImplShow();
}
}
@@ -328,7 +328,7 @@ void Cursor::Hide()
{
if ( mbVisible )
{
- mbVisible = FALSE;
+ mbVisible = sal_False;
ImplHide();
}
}
@@ -449,7 +449,7 @@ Cursor& Cursor::operator=( const Cursor& rCursor )
// -----------------------------------------------------------------------
-BOOL Cursor::operator==( const Cursor& rCursor ) const
+sal_Bool Cursor::operator==( const Cursor& rCursor ) const
{
if ( (maPos == rCursor.maPos) &&
(maSize == rCursor.maSize) &&
@@ -457,9 +457,9 @@ BOOL Cursor::operator==( const Cursor& rCursor ) const
(mnOrientation == rCursor.mnOrientation) &&
(mnDirection == rCursor.mnDirection) &&
(mbVisible == rCursor.mbVisible) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx
index 0cb89a025f5d..125c927bf673 100644
--- a/vcl/source/window/decoview.cxx
+++ b/vcl/source/window/decoview.cxx
@@ -45,71 +45,6 @@
// =======================================================================
-void ImplDrawOS2Symbol( OutputDevice* pDev, const Rectangle& rRect,
- USHORT nStyle, BOOL bClose )
-{
- DecorationView aView( pDev );
- const StyleSettings& rStyleSettings = pDev->GetSettings().GetStyleSettings();
- Rectangle aRect = rRect;
- Color aColor1;
- Color aColor2;
-
- pDev->SetFillColor();
-
- if ( nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED) )
- {
- aColor1 = rStyleSettings.GetShadowColor();
- aColor2 = rStyleSettings.GetLightColor();
- }
- else
- {
- aColor1 = rStyleSettings.GetLightColor();
- aColor2 = rStyleSettings.GetShadowColor();
- }
- aView.DrawFrame( aRect, aColor1, aColor2 );
-
- aRect.Left() += 2;
- aRect.Top() += 2;
- aRect.Right() -= 2;
- aRect.Bottom() -= 2;
-
- if ( nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED) )
- pDev->SetLineColor( rStyleSettings.GetLightColor() );
- else
- pDev->SetLineColor( rStyleSettings.GetShadowColor() );
- if ( bClose )
- {
- pDev->DrawLine( aRect.TopLeft(), Point( aRect.Left(), aRect.Bottom()-2 ) );
- pDev->DrawLine( aRect.TopLeft(), Point( aRect.Right()-2, aRect.Top() ) );
- pDev->DrawLine( Point( aRect.Left()+2, aRect.Bottom()-1 ),
- Point( aRect.Right()-1, aRect.Top()+2 ) );
- }
- else
- {
- pDev->DrawLine( aRect.TopLeft(), aRect.BottomLeft() );
- pDev->DrawLine( aRect.TopLeft(), Point( aRect.Right()-1, aRect.Top() ) );
- }
-
- if ( nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED) )
- pDev->SetLineColor( rStyleSettings.GetShadowColor() );
- else
- pDev->SetLineColor( rStyleSettings.GetLightColor() );
- if ( bClose )
- {
- pDev->DrawLine( Point( aRect.Right(), aRect.Top()+2 ), aRect.BottomRight() );
- pDev->DrawLine( Point( aRect.Left()+2, aRect.Bottom() ), aRect.BottomRight() );
- pDev->DrawLine( Point( aRect.Right()-2, aRect.Top()+1 ),
- Point( aRect.Left()+1, aRect.Bottom()-2 ) );
- }
- else
- {
- pDev->DrawLine( aRect.TopRight(), aRect.BottomRight() );
- pDev->DrawLine( Point( aRect.Left()+1, aRect.Bottom() ), aRect.BottomRight() );
- }
-}
-
-// =======================================================================
-
static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect,
SymbolType eType )
{
@@ -509,7 +444,7 @@ static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect,
case SYMBOL_CHECKMARK:
{
// #106953# never mirror checkmarks
- BOOL bRTL = pDev->ImplHasMirroredGraphics() && pDev->IsRTLEnabled();
+ sal_Bool bRTL = pDev->ImplHasMirroredGraphics() && pDev->IsRTLEnabled();
Point aPos1( bRTL ? rRect.Right() : rRect.Left(),
rRect.Bottom() - rRect.GetHeight() / 3 );
Point aPos2( bRTL ? rRect.Right() - rRect.GetWidth()/3 : rRect.Left() + rRect.GetWidth()/3,
@@ -631,57 +566,22 @@ static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect,
pDev->DrawRect( aRect );
}
break;
-
- case SYMBOL_OS2CLOSE:
- {
- Rectangle aRect( nCenterX-n2, nCenterY-n2,
- nCenterX+n2, nCenterY+n2 );
- ImplDrawOS2Symbol( pDev, aRect, 0, TRUE );
- }
- break;
-
- case SYMBOL_OS2FLOAT:
- {
- Rectangle aRect( nCenterX-n2+4, nCenterY-n2+4,
- nCenterX+n2-4, nCenterY+n2-3 );
- ImplDrawOS2Symbol( pDev, aRect, 0, FALSE );
- DecorationView aDecoView( pDev );
- Rectangle aRect2( nCenterX-n2, nCenterY-n2,
- nCenterX-n2+2, nCenterY+n2 );
- aDecoView.DrawFrame( aRect2,
- pDev->GetSettings().GetStyleSettings().GetLightColor(),
- pDev->GetSettings().GetStyleSettings().GetShadowColor() );
- Rectangle aRect3( nCenterX+n2-2, nCenterY-n2,
- nCenterX+n2, nCenterY+n2 );
- aDecoView.DrawFrame( aRect3,
- pDev->GetSettings().GetStyleSettings().GetLightColor(),
- pDev->GetSettings().GetStyleSettings().GetShadowColor() );
- }
- break;
-
- case SYMBOL_OS2HIDE:
- {
- Rectangle aRect( nCenterX-n2+3, nCenterY-n2+3,
- nCenterX+n2-3, nCenterY+n2-3 );
- ImplDrawOS2Symbol( pDev, aRect, 0, FALSE );
- }
- break;
}
}
// -----------------------------------------------------------------------
void DecorationView::DrawSymbol( const Rectangle& rRect, SymbolType eType,
- const Color& rColor, USHORT nStyle )
+ const Color& rColor, sal_uInt16 nStyle )
{
const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings();
Rectangle aRect = mpOutDev->LogicToPixel( rRect );
Color aOldLineColor = mpOutDev->GetLineColor();
Color aOldFillColor = mpOutDev->GetFillColor();
- BOOL bOldMapMode = mpOutDev->IsMapModeEnabled();
+ sal_Bool bOldMapMode = mpOutDev->IsMapModeEnabled();
mpOutDev->SetLineColor();
mpOutDev->SetFillColor( rColor );
- mpOutDev->EnableMapMode( FALSE );
+ mpOutDev->EnableMapMode( sal_False );
if ( (rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ||
(mpOutDev->GetOutDevType() == OUTDEV_PRINTER) )
@@ -725,8 +625,8 @@ void DecorationView::DrawFrame( const Rectangle& rRect,
Rectangle aRect = mpOutDev->LogicToPixel( rRect );
Color aOldLineColor = mpOutDev->GetLineColor();
Color aOldFillColor = mpOutDev->GetFillColor();
- BOOL bOldMapMode = mpOutDev->IsMapModeEnabled();
- mpOutDev->EnableMapMode( FALSE );
+ sal_Bool bOldMapMode = mpOutDev->IsMapModeEnabled();
+ mpOutDev->EnableMapMode( sal_False );
mpOutDev->SetLineColor();
mpOutDev->ImplDraw2ColorFrame( aRect, rLeftTopColor, rRightBottomColor );
mpOutDev->SetLineColor( aOldLineColor );
@@ -737,7 +637,7 @@ void DecorationView::DrawFrame( const Rectangle& rRect,
// =======================================================================
void DecorationView::DrawHighlightFrame( const Rectangle& rRect,
- USHORT nStyle )
+ sal_uInt16 nStyle )
{
const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings();
Color aLightColor = rStyleSettings.GetLightColor();
@@ -787,7 +687,7 @@ void DecorationView::DrawHighlightFrame( const Rectangle& rRect,
// =======================================================================
static void ImplDrawDPILineRect( OutputDevice* pDev, Rectangle& rRect,
- const Color* pColor, BOOL bRound = FALSE )
+ const Color* pColor, sal_Bool bRound = sal_False )
{
long nLineWidth = pDev->ImplGetDPIX()/300;
long nLineHeight = pDev->ImplGetDPIY()/300;
@@ -836,10 +736,10 @@ static void ImplDrawDPILineRect( OutputDevice* pDev, Rectangle& rRect,
// =======================================================================
static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
- const StyleSettings& rStyleSettings, USHORT nStyle )
+ const StyleSettings& rStyleSettings, sal_uInt16 nStyle )
{
// mask menu style
- BOOL bMenuStyle = (nStyle & FRAME_DRAW_MENU) ? TRUE : FALSE;
+ sal_Bool bMenuStyle = (nStyle & FRAME_DRAW_MENU) ? sal_True : sal_False;
nStyle &= ~FRAME_DRAW_MENU;
Window *pWin = NULL;
@@ -850,7 +750,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
// menus may use different border colors (eg on XP)
// normal frames will be drawn using the shadow color
// whereas window frame borders will use black
- BOOL bFlatBorders = ( !bMenuStyle && rStyleSettings.GetUseFlatBorders() );
+ sal_Bool bFlatBorders = ( !bMenuStyle && rStyleSettings.GetUseFlatBorders() );
// no flat borders for standard VCL controls (ie formcontrols that keep their classic look)
// will not affect frame windows (like dropdowns)
@@ -859,13 +759,13 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
// check for formcontrol, i.e., a control without NWF enabled
Control *pControl = dynamic_cast< Control* >( pWin->GetWindow( WINDOW_CLIENT ) );
if( pControl && pControl->IsNativeWidgetEnabled() )
- bFlatBorders = TRUE;
+ bFlatBorders = sal_True;
else
- bFlatBorders = FALSE;
+ bFlatBorders = sal_False;
}
// no round corners for window frame borders
- BOOL bRound = (bFlatBorders && !(nStyle & FRAME_DRAW_WINDOWBORDER));
+ sal_Bool bRound = (bFlatBorders && !(nStyle & FRAME_DRAW_WINDOWBORDER));
if ( (rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ||
(pDev->GetOutDevType() == OUTDEV_PRINTER) ||
@@ -874,7 +774,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
if ( nStyle & FRAME_DRAW_NODRAW )
{
- USHORT nValueStyle = bMenuStyle ? nStyle | FRAME_DRAW_MENU : nStyle;
+ sal_uInt16 nValueStyle = bMenuStyle ? nStyle | FRAME_DRAW_MENU : nStyle;
if( pWin->GetType() == WINDOW_BORDERWINDOW )
nValueStyle |= FRAME_DRAW_BORDERWINDOWBORDER;
ImplControlValue aControlValue( nValueStyle );
@@ -889,7 +789,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
ImplDrawDPILineRect( pDev, rRect, NULL, bRound );
else
{
- USHORT nFrameStyle = nStyle & FRAME_DRAW_STYLE;
+ sal_uInt16 nFrameStyle = nStyle & FRAME_DRAW_STYLE;
if ( nFrameStyle == FRAME_DRAW_GROUP )
{
@@ -919,7 +819,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
{
if( pWin && pWin->IsNativeControlSupported(CTRL_FRAME, PART_BORDER) )
{
- USHORT nValueStyle = bMenuStyle ? nStyle | FRAME_DRAW_MENU : nStyle;
+ sal_uInt16 nValueStyle = bMenuStyle ? nStyle | FRAME_DRAW_MENU : nStyle;
if( pWin->GetType() == WINDOW_BORDERWINDOW )
nValueStyle |= FRAME_DRAW_BORDERWINDOWBORDER;
ImplControlValue aControlValue( nValueStyle );
@@ -956,7 +856,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
}
else
{
- USHORT nFrameStyle = nStyle & FRAME_DRAW_STYLE;
+ sal_uInt16 nFrameStyle = nStyle & FRAME_DRAW_STYLE;
if ( nFrameStyle == FRAME_DRAW_GROUP )
{
pDev->SetFillColor();
@@ -1031,7 +931,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
rRect.Right()--;
rRect.Bottom()--;
- BOOL bDrawn = TRUE;
+ sal_Bool bDrawn = sal_True;
if ( nFrameStyle == FRAME_DRAW_DOUBLEIN )
{
if( bFlatBorders ) // no 3d effect
@@ -1051,7 +951,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
rStyleSettings.GetLightColor(),
rStyleSettings.GetShadowColor() );
else
- bDrawn = FALSE;
+ bDrawn = sal_False;
}
if( bDrawn )
{
@@ -1068,14 +968,14 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
// -----------------------------------------------------------------------
-Rectangle DecorationView::DrawFrame( const Rectangle& rRect, USHORT nStyle )
+Rectangle DecorationView::DrawFrame( const Rectangle& rRect, sal_uInt16 nStyle )
{
Rectangle aRect = rRect;
- BOOL bOldMap = mpOutDev->IsMapModeEnabled();
+ sal_Bool bOldMap = mpOutDev->IsMapModeEnabled();
if ( bOldMap )
{
aRect = mpOutDev->LogicToPixel( aRect );
- mpOutDev->EnableMapMode( FALSE );
+ mpOutDev->EnableMapMode( sal_False );
}
if ( !rRect.IsEmpty() )
@@ -1104,7 +1004,7 @@ Rectangle DecorationView::DrawFrame( const Rectangle& rRect, USHORT nStyle )
// =======================================================================
static void ImplDrawButton( OutputDevice* pDev, Rectangle& rRect,
- const StyleSettings& rStyleSettings, USHORT nStyle )
+ const StyleSettings& rStyleSettings, sal_uInt16 nStyle )
{
Rectangle aFillRect = rRect;
@@ -1317,14 +1217,14 @@ static void ImplDrawButton( OutputDevice* pDev, Rectangle& rRect,
// -----------------------------------------------------------------------
-Rectangle DecorationView::DrawButton( const Rectangle& rRect, USHORT nStyle )
+Rectangle DecorationView::DrawButton( const Rectangle& rRect, sal_uInt16 nStyle )
{
Rectangle aRect = rRect;
- BOOL bOldMap = mpOutDev->IsMapModeEnabled();
+ sal_Bool bOldMap = mpOutDev->IsMapModeEnabled();
if ( bOldMap )
{
aRect = mpOutDev->LogicToPixel( aRect );
- mpOutDev->EnableMapMode( FALSE );
+ mpOutDev->EnableMapMode( sal_False );
}
if ( !rRect.IsEmpty() )
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 63da028e82d2..7e2725e07023 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -73,24 +73,24 @@ static ByteString ImplGetDialogText( Dialog* pDialog )
// =======================================================================
-static BOOL ImplIsMnemonicCtrl( Window* pWindow )
+static sal_Bool ImplIsMnemonicCtrl( Window* pWindow )
{
if( ! pWindow->GetSettings().GetStyleSettings().GetAutoMnemonic() )
- return FALSE;
+ return sal_False;
if ( (pWindow->GetType() == WINDOW_RADIOBUTTON) ||
(pWindow->GetType() == WINDOW_CHECKBOX) ||
(pWindow->GetType() == WINDOW_TRISTATEBOX) ||
(pWindow->GetType() == WINDOW_PUSHBUTTON) )
- return TRUE;
+ return sal_True;
if ( pWindow->GetType() == WINDOW_FIXEDTEXT )
{
if ( pWindow->GetStyle() & (WB_INFO | WB_NOLABEL) )
- return FALSE;
+ return sal_False;
Window* pNextWindow = pWindow->GetWindow( WINDOW_NEXT );
if ( !pNextWindow )
- return FALSE;
+ return sal_False;
pNextWindow = pNextWindow->GetWindow( WINDOW_CLIENT );
if ( !(pNextWindow->GetStyle() & WB_TABSTOP) ||
(pNextWindow->GetType() == WINDOW_FIXEDTEXT) ||
@@ -99,12 +99,12 @@ static BOOL ImplIsMnemonicCtrl( Window* pWindow )
(pNextWindow->GetType() == WINDOW_CHECKBOX) ||
(pNextWindow->GetType() == WINDOW_TRISTATEBOX) ||
(pNextWindow->GetType() == WINDOW_PUSHBUTTON) )
- return FALSE;
+ return sal_False;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -215,7 +215,7 @@ static PushButton* ImplGetCancelButton( Dialog* pDialog )
static void ImplMouseAutoPos( Dialog* pDialog )
{
- ULONG nMouseOptions = pDialog->GetSettings().GetMouseSettings().GetOptions();
+ sal_uLong nMouseOptions = pDialog->GetSettings().GetMouseSettings().GetOptions();
if ( nMouseOptions & MOUSE_OPTION_AUTOCENTERPOS )
{
Size aSize = pDialog->GetOutputSizePixel();
@@ -250,13 +250,13 @@ struct DialogImpl
void Dialog::ImplInitDialogData()
{
- mpWindowImpl->mbDialog = TRUE;
+ mpWindowImpl->mbDialog = sal_True;
mpDialogParent = NULL;
mpPrevExecuteDlg = NULL;
- mbInExecute = FALSE;
- mbOldSaveBack = FALSE;
- mbInClose = FALSE;
- mbModalMode = FALSE;
+ mbInExecute = sal_False;
+ mbOldSaveBack = sal_False;
+ mbInClose = sal_False;
+ mbModalMode = sal_False;
mnMousePositioned = 0;
mpDialogImpl = new DialogImpl;
}
@@ -265,7 +265,7 @@ void Dialog::ImplInitDialogData()
void Dialog::ImplInit( Window* pParent, WinBits nStyle )
{
- USHORT nSysWinMode = Application::GetSystemWindowMode();
+ sal_uInt16 nSysWinMode = Application::GetSystemWindowMode();
if ( !(nStyle & WB_NODIALOGCONTROL) )
nStyle |= WB_DIALOGCONTROL;
@@ -291,7 +291,7 @@ void Dialog::ImplInit( Window* pParent, WinBits nStyle )
while ( pExeDlg )
{
// Nur wenn er sichtbar und enabled ist
- if ( pParent->ImplGetFirstOverlapWindow()->IsWindowOrChild( pExeDlg, TRUE ) &&
+ if ( pParent->ImplGetFirstOverlapWindow()->IsWindowOrChild( pExeDlg, sal_True ) &&
pExeDlg->IsReallyVisible() &&
pExeDlg->IsEnabled() && pExeDlg->IsInputEnabled() && !pExeDlg->IsInModalMode() )
{
@@ -341,8 +341,8 @@ void Dialog::ImplInit( Window* pParent, WinBits nStyle )
}
else
{
- mpWindowImpl->mbFrame = TRUE;
- mpWindowImpl->mbOverlapWin = TRUE;
+ mpWindowImpl->mbFrame = sal_True;
+ mpWindowImpl->mbOverlapWin = sal_True;
SystemWindow::ImplInit( pParent, (nStyle & (WB_MOVEABLE | WB_SIZEABLE | WB_ROLLABLE | WB_CLOSEABLE | WB_STANDALONE)) | WB_CLOSEABLE, NULL );
// Now set all style bits
mpWindowImpl->mnStyle = nStyle;
@@ -374,7 +374,7 @@ void Dialog::ImplInitSettings()
else if( IsNativeControlSupported( CTRL_WINDOW_BACKGROUND, PART_BACKGROUND_DIALOG ) )
{
mpWindowImpl->mnNativeBackground = PART_BACKGROUND_DIALOG;
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
}
// fallback to settings color
else
@@ -467,7 +467,7 @@ long Dialog::Notify( NotifyEvent& rNEvt )
{
const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
KeyCode aKeyCode = pKEvt->GetKeyCode();
- USHORT nKeyCode = aKeyCode.GetCode();
+ sal_uInt16 nKeyCode = aKeyCode.GetCode();
if ( (nKeyCode == KEY_ESCAPE) &&
((GetStyle() & WB_CLOSEABLE) || ImplGetCancelButton( this ) || ImplGetOKButton( this )) )
@@ -477,7 +477,7 @@ long Dialog::Notify( NotifyEvent& rNEvt )
// post this Close asynchronous so we can leave our key handler before
// we get destroyed
PostUserEvent( LINK( this, Dialog, ImplAsyncCloseHdl ), this );
- return TRUE;
+ return sal_True;
}
}
else if ( rNEvt.GetType() == EVENT_GETFOCUS )
@@ -488,8 +488,8 @@ long Dialog::Notify( NotifyEvent& rNEvt )
if( mbInExecute && mbModalMode )
{
// do not change modal counter (pSVData->maAppData.mnModalDialog)
- SetModalInputMode( FALSE );
- SetModalInputMode( TRUE );
+ SetModalInputMode( sal_False );
+ SetModalInputMode( sal_True );
// #93022# def-button might have changed after show
if( !mnMousePositioned )
@@ -554,7 +554,7 @@ void Dialog::DataChanged( const DataChangedEvent& rDCEvt )
// -----------------------------------------------------------------------
-BOOL Dialog::Close()
+sal_Bool Dialog::Close()
{
ImplDelData aDelData;
ImplAddDel( &aDelData );
@@ -567,21 +567,21 @@ BOOL Dialog::Close()
// ( Note: ) this used to work ( something changes somewhere )
if (mnCancelClose != 0)
{
- return FALSE;
+ return sal_False;
}
//liuchen 2009-7-22
if ( aDelData.IsDelete() )
- return FALSE;
+ return sal_False;
ImplRemoveDel( &aDelData );
if ( mpWindowImpl->mxWindowPeer.is() && IsCreatedWithToolkit() && !IsInExecute() )
- return FALSE;
+ return sal_False;
- mbInClose = TRUE;
+ mbInClose = sal_True;
if ( !(GetStyle() & WB_CLOSEABLE) )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
ImplAddDel( &aDelData );
PushButton* pButton = ImplGetCancelButton( this );
if ( pButton )
@@ -592,30 +592,30 @@ BOOL Dialog::Close()
if ( pButton )
pButton->Click();
else
- bRet = FALSE;
+ bRet = sal_False;
}
if ( aDelData.IsDelete() )
- return TRUE;
+ return sal_True;
ImplRemoveDel( &aDelData );
return bRet;
}
if ( IsInExecute() )
{
- EndDialog( FALSE );
- mbInClose = FALSE;
- return TRUE;
+ EndDialog( sal_False );
+ mbInClose = sal_False;
+ return sal_True;
}
else
{
- mbInClose = FALSE;
+ mbInClose = sal_False;
return SystemWindow::Close();
}
}
// -----------------------------------------------------------------------
-BOOL Dialog::ImplStartExecuteModal()
+sal_Bool Dialog::ImplStartExecuteModal()
{
if ( mbInExecute )
{
@@ -624,7 +624,7 @@ BOOL Dialog::ImplStartExecuteModal()
aErrorStr += ImplGetDialogText( this );
OSL_FAIL( aErrorStr.GetBuffer() );
#endif
- return FALSE;
+ return sal_False;
}
if ( Application::IsDialogCancelEnabled() )
@@ -634,7 +634,7 @@ BOOL Dialog::ImplStartExecuteModal()
aErrorStr += ImplGetDialogText( this );
OSL_FAIL( aErrorStr.GetBuffer() );
#endif
- return FALSE;
+ return sal_False;
}
#ifdef DBG_UTIL
@@ -663,15 +663,15 @@ BOOL Dialog::ImplStartExecuteModal()
pSVData->maWinData.mpTrackWin->EndTracking( ENDTRACK_CANCEL );
if ( pSVData->maWinData.mpCaptureWin )
pSVData->maWinData.mpCaptureWin->ReleaseMouse();
- EnableInput( TRUE, TRUE );
+ EnableInput( sal_True, sal_True );
if ( GetParent() )
{
NotifyEvent aNEvt( EVENT_EXECUTEDIALOG, this );
GetParent()->Notify( aNEvt );
}
- mbInExecute = TRUE;
- SetModalInputMode( TRUE );
+ mbInExecute = sal_True;
+ SetModalInputMode( sal_True );
mbOldSaveBack = IsSaveBackgroundEnabled();
EnableSaveBackground();
@@ -681,7 +681,7 @@ BOOL Dialog::ImplStartExecuteModal()
Show();
pSVData->maAppData.mnModalMode++;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -753,7 +753,7 @@ void Dialog::StartExecuteModal( const Link& rEndDialogHdl )
// -----------------------------------------------------------------------
-BOOL Dialog::IsStartedModal() const
+sal_Bool Dialog::IsStartedModal() const
{
return mpDialogImpl->mbStartedModal;
}
@@ -764,7 +764,7 @@ void Dialog::EndDialog( long nResult )
{
if ( mbInExecute )
{
- SetModalInputMode( FALSE );
+ SetModalInputMode( sal_False );
// Dialog aus der Kette der Dialoge die in Execute stehen entfernen
ImplSVData* pSVData = ImplGetSVData();
@@ -812,7 +812,7 @@ void Dialog::EndDialog( long nResult )
mpDialogImpl->mbStartedModal = false;
mpDialogImpl->mnResult = -1;
}
- mbInExecute = FALSE;
+ mbInExecute = sal_False;
}
}
@@ -833,9 +833,9 @@ void Dialog::EndAllDialogs( Window* pParent )
while ( pModDialog )
{
pTempModDialog = pModDialog->mpPrevExecuteDlg;
- if( !pParent || ( pParent && pParent->IsWindowOrChild( pModDialog, TRUE ) ) )
+ if( !pParent || ( pParent && pParent->IsWindowOrChild( pModDialog, sal_True ) ) )
{
- pModDialog->EndDialog( FALSE );
+ pModDialog->EndDialog( sal_False );
pModDialog->PostUserEvent( Link() );
}
pModDialog = pTempModDialog;
@@ -844,7 +844,7 @@ void Dialog::EndAllDialogs( Window* pParent )
// -----------------------------------------------------------------------
-void Dialog::SetModalInputMode( BOOL bModal )
+void Dialog::SetModalInputMode( sal_Bool bModal )
{
if ( bModal == mbModalMode )
return;
@@ -858,8 +858,8 @@ void Dialog::SetModalInputMode( BOOL bModal )
// Diable the prev Modal Dialog, because our dialog must close at first,
// before the other dialog can be closed (because the other dialog
// is on stack since our dialog returns)
- if ( mpPrevExecuteDlg && !mpPrevExecuteDlg->IsWindowOrChild( this, TRUE ) )
- mpPrevExecuteDlg->EnableInput( FALSE, TRUE, TRUE, this );
+ if ( mpPrevExecuteDlg && !mpPrevExecuteDlg->IsWindowOrChild( this, sal_True ) )
+ mpPrevExecuteDlg->EnableInput( sal_False, sal_True, sal_True, this );
// determine next overlap dialog parent
Window* pParent = GetParent();
@@ -886,20 +886,20 @@ void Dialog::SetModalInputMode( BOOL bModal )
}
// Enable the prev Modal Dialog
- if ( mpPrevExecuteDlg && !mpPrevExecuteDlg->IsWindowOrChild( this, TRUE ) )
+ if ( mpPrevExecuteDlg && !mpPrevExecuteDlg->IsWindowOrChild( this, sal_True ) )
{
- mpPrevExecuteDlg->EnableInput( TRUE, TRUE, TRUE, this );
+ mpPrevExecuteDlg->EnableInput( sal_True, sal_True, sal_True, this );
// ensure continued modality of prev dialog
// do not change modality counter
- mpPrevExecuteDlg->SetModalInputMode( FALSE );
- mpPrevExecuteDlg->SetModalInputMode( TRUE );
+ mpPrevExecuteDlg->SetModalInputMode( sal_False );
+ mpPrevExecuteDlg->SetModalInputMode( sal_True );
}
}
}
// -----------------------------------------------------------------------
-void Dialog::SetModalInputMode( BOOL bModal, BOOL bSubModalDialogs )
+void Dialog::SetModalInputMode( sal_Bool bModal, sal_Bool bSubModalDialogs )
{
if ( bSubModalDialogs )
{
@@ -908,7 +908,7 @@ void Dialog::SetModalInputMode( BOOL bModal, BOOL bSubModalDialogs )
while ( pOverlap )
{
if ( pOverlap->IsDialog() )
- ((Dialog*)pOverlap)->SetModalInputMode( bModal, TRUE );
+ ((Dialog*)pOverlap)->SetModalInputMode( bModal, sal_True );
pOverlap = pOverlap->mpWindowImpl->mpNext;
}
}
@@ -943,7 +943,7 @@ void Dialog::GrabFocusToFirstControl()
!pFocusControl->IsVisible() ||
!pFocusControl->IsEnabled() || !pFocusControl->IsInputEnabled() )
{
- USHORT n = 0;
+ sal_uInt16 n = 0;
pFocusControl = ImplGetDlgWindow( n, DLGWINDOW_FIRST );
}
if ( pFocusControl )
@@ -955,13 +955,13 @@ void Dialog::GetDrawWindowBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
ImplBorderWindow aImplWin( (Window*)this, WB_BORDER|WB_STDWORK, BORDERWINDOW_STYLE_OVERLAP );
// aImplWin.SetText( GetText() );
// aImplWin.SetPosSizePixel( aPos.X(), aPos.Y(), aSize.Width(), aSize.Height() );
-// aImplWin.SetDisplayActive( TRUE );
+// aImplWin.SetDisplayActive( sal_True );
// aImplWin.InitView();
aImplWin.GetBorder( rLeftBorder, rTopBorder, rRightBorder, rBottomBorder );
}
-void Dialog::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG )
+void Dialog::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -987,7 +987,7 @@ void Dialog::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULO
ImplBorderWindow aImplWin( this, WB_BORDER|WB_STDWORK, BORDERWINDOW_STYLE_OVERLAP );
aImplWin.SetText( GetText() );
aImplWin.SetPosSizePixel( aPos.X(), aPos.Y(), aSize.Width(), aSize.Height() );
- aImplWin.SetDisplayActive( TRUE );
+ aImplWin.SetDisplayActive( sal_True );
aImplWin.InitView();
aImplWin.Draw( Rectangle( aPos, aSize ), pDev, aPos );
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index a1e8d3219d33..ce7b6dca8119 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -45,7 +45,7 @@ using namespace ::com::sun::star;
// =======================================================================
-static BOOL ImplHasIndirectTabParent( Window* pWindow )
+static sal_Bool ImplHasIndirectTabParent( Window* pWindow )
{
// The window has inderect tab parent if it is included in tab hierarchy
// of the indirect parent window
@@ -75,7 +75,7 @@ static Window* ImplGetTopParentOfTabHierarchy( Window* pParent )
// -----------------------------------------------------------------------
-static Window* ImplGetSubChildWindow( Window* pParent, USHORT n, USHORT& nIndex )
+static Window* ImplGetSubChildWindow( Window* pParent, sal_uInt16 n, sal_uInt16& nIndex )
{
Window* pTabPage = NULL;
Window* pFoundWindow = NULL;
@@ -151,7 +151,7 @@ static Window* ImplGetSubChildWindow( Window* pParent, USHORT n, USHORT& nIndex
// -----------------------------------------------------------------------
-static Window* ImplGetChildWindow( Window* pParent, USHORT n, USHORT& nIndex, BOOL bTestEnable )
+static Window* ImplGetChildWindow( Window* pParent, sal_uInt16 n, sal_uInt16& nIndex, sal_Bool bTestEnable )
{
pParent = ImplGetTopParentOfTabHierarchy( pParent );
@@ -159,7 +159,7 @@ static Window* ImplGetChildWindow( Window* pParent, USHORT n, USHORT& nIndex, BO
Window* pWindow = ImplGetSubChildWindow( pParent, n, nIndex );
if ( bTestEnable )
{
- USHORT n2 = nIndex;
+ sal_uInt16 n2 = nIndex;
while ( pWindow && (!pWindow->IsEnabled() || !pWindow->IsInputEnabled()) )
{
n2 = nIndex+1;
@@ -185,7 +185,7 @@ static Window* ImplGetChildWindow( Window* pParent, USHORT n, USHORT& nIndex, BO
// -----------------------------------------------------------------------
-static Window* ImplGetNextWindow( Window* pParent, USHORT n, USHORT& nIndex, BOOL bTestEnable )
+static Window* ImplGetNextWindow( Window* pParent, sal_uInt16 n, sal_uInt16& nIndex, sal_Bool bTestEnable )
{
Window* pWindow = ImplGetChildWindow( pParent, n+1, nIndex, bTestEnable );
if ( n == nIndex )
@@ -198,17 +198,17 @@ static Window* ImplGetNextWindow( Window* pParent, USHORT n, USHORT& nIndex, BOO
// -----------------------------------------------------------------------
-Window* Window::ImplGetDlgWindow( USHORT nIndex, USHORT nType,
- USHORT nFormStart, USHORT nFormEnd,
- USHORT* pIndex )
+Window* Window::ImplGetDlgWindow( sal_uInt16 nIndex, sal_uInt16 nType,
+ sal_uInt16 nFormStart, sal_uInt16 nFormEnd,
+ sal_uInt16* pIndex )
{
DBG_ASSERT( (nIndex >= nFormStart) && (nIndex <= nFormEnd),
"Window::ImplGetDlgWindow() - nIndex not in Form" );
Window* pWindow = NULL;
- USHORT i;
- USHORT nTemp;
- USHORT nStartIndex;
+ sal_uInt16 i;
+ sal_uInt16 nTemp;
+ sal_uInt16 nStartIndex;
if ( nType == DLGWINDOW_PREV )
{
@@ -219,7 +219,7 @@ Window* Window::ImplGetDlgWindow( USHORT nIndex, USHORT nType,
i--;
else
i = nFormEnd;
- pWindow = ImplGetChildWindow( this, i, nTemp, TRUE );
+ pWindow = ImplGetChildWindow( this, i, nTemp, sal_True );
if ( !pWindow )
break;
if ( (i == nTemp) && (pWindow->GetStyle() & WB_TABSTOP) )
@@ -239,19 +239,19 @@ Window* Window::ImplGetDlgWindow( USHORT nIndex, USHORT nType,
{
if ( i < nFormEnd )
{
- pWindow = ImplGetNextWindow( this, i, i, TRUE );
+ pWindow = ImplGetNextWindow( this, i, i, sal_True );
if ( (i > nFormEnd) || (i < nFormStart) )
- pWindow = ImplGetChildWindow( this, nFormStart, i, TRUE );
+ pWindow = ImplGetChildWindow( this, nFormStart, i, sal_True );
}
else
- pWindow = ImplGetChildWindow( this, nFormStart, i, TRUE );
+ pWindow = ImplGetChildWindow( this, nFormStart, i, sal_True );
}
if ( i <= nFormEnd )
{
// 2ten Index mitfuehren, falls alle Controls disablte
- USHORT nStartIndex2 = i;
- USHORT nOldIndex = i+1;
+ sal_uInt16 nStartIndex2 = i;
+ sal_uInt16 nOldIndex = i+1;
do
{
@@ -264,9 +264,9 @@ Window* Window::ImplGetDlgWindow( USHORT nIndex, USHORT nType,
}
nOldIndex = i;
if ( (i > nFormEnd) || (i < nFormStart) )
- pWindow = ImplGetChildWindow( this, nFormStart, i, TRUE );
+ pWindow = ImplGetChildWindow( this, nFormStart, i, sal_True );
else
- pWindow = ImplGetNextWindow( this, i, i, TRUE );
+ pWindow = ImplGetNextWindow( this, i, i, sal_True );
}
while ( (i != nStartIndex) && (i != nStartIndex2) );
@@ -304,20 +304,20 @@ Window* Window::ImplGetDlgWindow( USHORT nIndex, USHORT nType,
// -----------------------------------------------------------------------
-static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT& rIndex,
- USHORT& rFormStart, USHORT& rFormEnd )
+static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, sal_uInt16& rIndex,
+ sal_uInt16& rFormStart, sal_uInt16& rFormEnd )
{
Window* pSWindow;
Window* pSecondWindow = NULL;
Window* pTempWindow = NULL;
- USHORT i;
- USHORT nSecond_i = 0;
- USHORT nFormStart = 0;
- USHORT nSecondFormStart = 0;
- USHORT nFormEnd;
+ sal_uInt16 i;
+ sal_uInt16 nSecond_i = 0;
+ sal_uInt16 nFormStart = 0;
+ sal_uInt16 nSecondFormStart = 0;
+ sal_uInt16 nFormEnd;
// Focus-Fenster in der Child-Liste suchen
- Window* pFirstChildWindow = pSWindow = ImplGetChildWindow( pParent, 0, i, FALSE );
+ Window* pFirstChildWindow = pSWindow = ImplGetChildWindow( pParent, 0, i, sal_False );
if( pWindow == NULL )
pWindow = pSWindow;
@@ -340,7 +340,7 @@ static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT&
break;
}
- pSWindow = ImplGetNextWindow( pParent, i, i, FALSE );
+ pSWindow = ImplGetNextWindow( pParent, i, i, sal_False );
if ( !i )
pSWindow = NULL;
}
@@ -370,7 +370,7 @@ static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT&
do
{
nFormEnd = i;
- pTempWindow = ImplGetNextWindow( pParent, i, i, FALSE );
+ pTempWindow = ImplGetNextWindow( pParent, i, i, sal_False );
// the DialogControlStart mark is only accepted for the direct children
if ( !i
@@ -388,7 +388,7 @@ static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT&
if ( nIteration >= 2 )
{
// this is an unexpected scenario
- DBG_ASSERT( FALSE, "It seems to be an endless loop!" );
+ DBG_ASSERT( sal_False, "It seems to be an endless loop!" );
rFormStart = 0;
break;
}
@@ -402,16 +402,16 @@ static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT&
// -----------------------------------------------------------------------
-static Window* ImplFindAccelWindow( Window* pParent, USHORT& rIndex, xub_Unicode cCharCode,
- USHORT nFormStart, USHORT nFormEnd, BOOL bCheckEnable = TRUE )
+static Window* ImplFindAccelWindow( Window* pParent, sal_uInt16& rIndex, xub_Unicode cCharCode,
+ sal_uInt16 nFormStart, sal_uInt16 nFormEnd, sal_Bool bCheckEnable = sal_True )
{
DBG_ASSERT( (rIndex >= nFormStart) && (rIndex <= nFormEnd),
"Window::ImplFindAccelWindow() - rIndex not in Form" );
xub_Unicode cCompareChar;
- USHORT nStart = rIndex;
- USHORT i = rIndex;
- int bSearch = TRUE;
+ sal_uInt16 nStart = rIndex;
+ sal_uInt16 i = rIndex;
+ int bSearch = sal_True;
Window* pWindow;
// MT: Where can we keep the CharClass?!
@@ -423,13 +423,13 @@ static Window* ImplFindAccelWindow( Window* pParent, USHORT& rIndex, xub_Unicode
cCharCode = xCharClass->toUpper( String(cCharCode), 0, 1, rLocale )[0];
if ( i < nFormEnd )
- pWindow = ImplGetNextWindow( pParent, i, i, TRUE );
+ pWindow = ImplGetNextWindow( pParent, i, i, sal_True );
else
- pWindow = ImplGetChildWindow( pParent, nFormStart, i, TRUE );
+ pWindow = ImplGetChildWindow( pParent, nFormStart, i, sal_True );
while( bSearch && pWindow )
{
const XubString aStr = pWindow->GetText();
- USHORT nPos = aStr.Search( '~' );
+ sal_uInt16 nPos = aStr.Search( '~' );
while ( nPos != STRING_NOTFOUND )
{
cCompareChar = aStr.GetChar( nPos+1 );
@@ -453,9 +453,9 @@ static Window* ImplFindAccelWindow( Window* pParent, USHORT& rIndex, xub_Unicode
// children checked for accelerators
if( (pWindow->GetStyle() & WB_CHILDDLGCTRL) != 0 )
{
- USHORT nChildIndex;
- USHORT nChildFormStart;
- USHORT nChildFormEnd;
+ sal_uInt16 nChildIndex;
+ sal_uInt16 nChildFormStart;
+ sal_uInt16 nChildFormEnd;
// get form start and end
::ImplFindDlgCtrlWindow( pWindow, NULL,
@@ -485,14 +485,14 @@ static Window* ImplFindAccelWindow( Window* pParent, USHORT& rIndex, xub_Unicode
// -----------------------------------------------------------------------
-void Window::ImplControlFocus( USHORT nFlags )
+void Window::ImplControlFocus( sal_uInt16 nFlags )
{
if ( nFlags & GETFOCUS_MNEMONIC )
{
if ( GetType() == WINDOW_RADIOBUTTON )
{
if ( !((RadioButton*)this)->IsChecked() )
- ((RadioButton*)this)->ImplCallClick( TRUE, nFlags );
+ ((RadioButton*)this)->ImplCallClick( sal_True, nFlags );
else
ImplGrabFocus( nFlags );
}
@@ -505,8 +505,8 @@ void Window::ImplControlFocus( USHORT nFlags )
((CheckBox*)this)->ImplCheck();
else if ( mpWindowImpl->mbPushButton )
{
- ((PushButton*)this)->SetPressed( TRUE );
- ((PushButton*)this)->SetPressed( FALSE );
+ ((PushButton*)this)->SetPressed( sal_True );
+ ((PushButton*)this)->SetPressed( sal_False );
((PushButton*)this)->Click();
}
}
@@ -517,7 +517,7 @@ void Window::ImplControlFocus( USHORT nFlags )
if ( GetType() == WINDOW_RADIOBUTTON )
{
if ( !((RadioButton*)this)->IsChecked() )
- ((RadioButton*)this)->ImplCallClick( TRUE, nFlags );
+ ((RadioButton*)this)->ImplCallClick( sal_True, nFlags );
else
ImplGrabFocus( nFlags );
}
@@ -528,32 +528,32 @@ void Window::ImplControlFocus( USHORT nFlags )
// -----------------------------------------------------------------------
-BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
+sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput )
{
KeyCode aKeyCode = rKEvt.GetKeyCode();
- USHORT nKeyCode = aKeyCode.GetCode();
+ sal_uInt16 nKeyCode = aKeyCode.GetCode();
Window* pSWindow;
Window* pTempWindow;
Window* pButtonWindow;
- USHORT i;
- USHORT iButton;
- USHORT iButtonStart;
- USHORT iTemp;
- USHORT nIndex;
- USHORT nFormStart;
- USHORT nFormEnd;
- USHORT nDlgCtrlFlags;
+ sal_uInt16 i;
+ sal_uInt16 iButton;
+ sal_uInt16 iButtonStart;
+ sal_uInt16 iTemp;
+ sal_uInt16 nIndex;
+ sal_uInt16 nFormStart;
+ sal_uInt16 nFormEnd;
+ sal_uInt16 nDlgCtrlFlags;
// Ohne Focus-Window koennen wir auch keine Steuerung uebernehmen
Window* pFocusWindow = Application::GetFocusWindow();
if ( !pFocusWindow || !ImplIsWindowOrChild( pFocusWindow ) )
- return FALSE;
+ return sal_False;
// Focus-Fenster in der Child-Liste suchen
pSWindow = ::ImplFindDlgCtrlWindow( this, pFocusWindow,
nIndex, nFormStart, nFormEnd );
if ( !pSWindow )
- return FALSE;
+ return sal_False;
i = nIndex;
nDlgCtrlFlags = 0;
@@ -572,7 +572,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
if ( nKeyCode == KEY_RETURN )
{
// Wir suchen zuerst nach einem DefPushButton/CancelButton
- pButtonWindow = ImplGetChildWindow( this, nFormStart, iButton, TRUE );
+ pButtonWindow = ImplGetChildWindow( this, nFormStart, iButton, sal_True );
iButtonStart = iButton;
while ( pButtonWindow )
{
@@ -580,17 +580,17 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
pButtonWindow->mpWindowImpl->mbPushButton )
break;
- pButtonWindow = ImplGetNextWindow( this, iButton, iButton, TRUE );
+ pButtonWindow = ImplGetNextWindow( this, iButton, iButton, sal_True );
if ( (iButton <= iButtonStart) || (iButton > nFormEnd) )
pButtonWindow = NULL;
}
if ( bKeyInput && !pButtonWindow && (nDlgCtrlFlags & WINDOW_DLGCTRL_RETURN) )
{
- USHORT nType;
- USHORT nGetFocusFlags = GETFOCUS_TAB;
- USHORT nNewIndex;
- USHORT iStart;
+ sal_uInt16 nType;
+ sal_uInt16 nGetFocusFlags = GETFOCUS_TAB;
+ sal_uInt16 nNewIndex;
+ sal_uInt16 iStart;
if ( aKeyCode.IsShift() )
{
nType = DLGWINDOW_PREV;
@@ -619,7 +619,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
nGetFocusFlags |= GETFOCUS_AROUND;
}
pTempWindow->ImplControlFocus( nGetFocusFlags );
- return TRUE;
+ return sal_True;
}
else
{
@@ -641,21 +641,21 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
if ( !ImplCallPreNotify( aNEvt2 ) )
pSWindow->GetFocus();
pSWindow->mpWindowImpl->mnGetFocusFlags = 0;
- return TRUE;
+ return sal_True;
}
}
}
else if ( nKeyCode == KEY_ESCAPE )
{
// Wir suchen zuerst nach einem DefPushButton/CancelButton
- pButtonWindow = ImplGetChildWindow( this, nFormStart, iButton, TRUE );
+ pButtonWindow = ImplGetChildWindow( this, nFormStart, iButton, sal_True );
iButtonStart = iButton;
while ( pButtonWindow )
{
if ( pButtonWindow->GetType() == WINDOW_CANCELBUTTON )
break;
- pButtonWindow = ImplGetNextWindow( this, iButton, iButton, TRUE );
+ pButtonWindow = ImplGetNextWindow( this, iButton, iButton, sal_True );
if ( (iButton <= iButtonStart) || (iButton > nFormEnd) )
pButtonWindow = NULL;
}
@@ -664,9 +664,9 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
{
if ( mpWindowImpl->mpDlgCtrlDownWindow != pButtonWindow )
{
- ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( FALSE );
+ ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( sal_False );
mpWindowImpl->mpDlgCtrlDownWindow = NULL;
- return TRUE;
+ return sal_True;
}
}
}
@@ -677,10 +677,10 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
// keine Alt-Taste abfangen, wegen Windows
if ( !aKeyCode.IsMod2() )
{
- USHORT nType;
- USHORT nGetFocusFlags = GETFOCUS_TAB;
- USHORT nNewIndex;
- BOOL bFormular = FALSE;
+ sal_uInt16 nType;
+ sal_uInt16 nGetFocusFlags = GETFOCUS_TAB;
+ sal_uInt16 nNewIndex;
+ sal_Bool bFormular = sal_False;
// Bei Ctrl-Tab erstmal testen, ob zwischen Formularen
// gesprungen werden soll
@@ -689,7 +689,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
// Gruppe suchen
Window* pFormularFirstWindow = NULL;
Window* pLastFormularFirstWindow = NULL;
- pTempWindow = ImplGetChildWindow( this, 0, iTemp, FALSE );
+ pTempWindow = ImplGetChildWindow( this, 0, iTemp, sal_False );
Window* pPrevFirstFormularFirstWindow = NULL;
Window* pFirstFormularFirstWindow = pTempWindow;
while ( pTempWindow )
@@ -697,7 +697,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
if ( pTempWindow->ImplGetWindow()->IsDialogControlStart() )
{
if ( iTemp != 0 )
- bFormular = TRUE;
+ bFormular = sal_True;
if ( aKeyCode.IsShift() )
{
if ( iTemp <= nIndex )
@@ -712,7 +712,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
pLastFormularFirstWindow = pTempWindow;
}
- pTempWindow = ImplGetNextWindow( this, iTemp, iTemp, FALSE );
+ pTempWindow = ImplGetNextWindow( this, iTemp, iTemp, sal_False );
if ( !iTemp )
pTempWindow = NULL;
}
@@ -727,9 +727,9 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
pFormularFirstWindow = pFirstFormularFirstWindow;
}
- USHORT nFoundFormStart = 0;
- USHORT nFoundFormEnd = 0;
- USHORT nTempIndex = 0;
+ sal_uInt16 nFoundFormStart = 0;
+ sal_uInt16 nFoundFormEnd = 0;
+ sal_uInt16 nTempIndex = 0;
if ( ::ImplFindDlgCtrlWindow( this, pFormularFirstWindow, nTempIndex,
nFoundFormStart, nFoundFormEnd ) )
{
@@ -738,7 +738,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
if ( pFormularFirstWindow )
{
pFormularFirstWindow->ImplControlFocus();
- return TRUE;
+ return sal_True;
}
}
}
@@ -774,7 +774,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
if ( !ImplCallPreNotify( aNEvt2 ) )
pSWindow->GetFocus();
pSWindow->mpWindowImpl->mnGetFocusFlags = 0;
- return TRUE;
+ return sal_True;
}
else if ( pWindow )
{
@@ -790,7 +790,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
nGetFocusFlags |= GETFOCUS_AROUND;
}
pWindow->ImplControlFocus( nGetFocusFlags );
- return TRUE;
+ return sal_True;
}
}
}
@@ -813,7 +813,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
{
if ( pWindow != pSWindow )
pWindow->ImplControlFocus( GETFOCUS_CURSOR | GETFOCUS_BACKWARD );
- return TRUE;
+ return sal_True;
}
if ( nStyle & WB_GROUP )
@@ -840,7 +840,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
if ( pWindow->IsVisible() && pWindow->IsEnabled() && pWindow->IsInputEnabled() )
{
pWindow->ImplControlFocus( GETFOCUS_CURSOR | GETFOCUS_BACKWARD );
- return TRUE;
+ return sal_True;
}
pWindow = pWindow->GetWindow( WINDOW_NEXT );
@@ -854,11 +854,11 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
pSWindow = ::ImplFindAccelWindow( this, i, c, nFormStart, nFormEnd );
if ( pSWindow )
{
- USHORT nGetFocusFlags = GETFOCUS_MNEMONIC;
+ sal_uInt16 nGetFocusFlags = GETFOCUS_MNEMONIC;
if ( pSWindow == ::ImplFindAccelWindow( this, i, c, nFormStart, nFormEnd ) )
nGetFocusFlags |= GETFOCUS_UNIQUEMNEMONIC;
pSWindow->ImplControlFocus( nGetFocusFlags );
- return TRUE;
+ return sal_True;
}
}
}
@@ -870,30 +870,30 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
{
if ( mpWindowImpl->mpDlgCtrlDownWindow && (mpWindowImpl->mpDlgCtrlDownWindow != pButtonWindow) )
{
- ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( FALSE );
+ ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( sal_False );
mpWindowImpl->mpDlgCtrlDownWindow = NULL;
}
- ((PushButton*)pButtonWindow)->SetPressed( TRUE );
+ ((PushButton*)pButtonWindow)->SetPressed( sal_True );
mpWindowImpl->mpDlgCtrlDownWindow = pButtonWindow;
}
else if ( mpWindowImpl->mpDlgCtrlDownWindow == pButtonWindow )
{
mpWindowImpl->mpDlgCtrlDownWindow = NULL;
- ((PushButton*)pButtonWindow)->SetPressed( FALSE );
+ ((PushButton*)pButtonWindow)->SetPressed( sal_False );
((PushButton*)pButtonWindow)->Click();
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
// checks if this window has dialog control
-BOOL Window::ImplHasDlgCtrl()
+sal_Bool Window::ImplHasDlgCtrl()
{
Window* pDlgCtrlParent;
@@ -905,9 +905,9 @@ BOOL Window::ImplHasDlgCtrl()
pDlgCtrlParent = pDlgCtrlParent->ImplGetParent();
if ( !pDlgCtrlParent || ((pDlgCtrlParent->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) != WB_DIALOGCONTROL) )
- return FALSE;
+ return sal_False;
else
- return TRUE;
+ return sal_True;
}
void Window::ImplDlgCtrlNextWindow()
@@ -915,9 +915,9 @@ void Window::ImplDlgCtrlNextWindow()
Window* pDlgCtrlParent;
Window* pDlgCtrl;
Window* pSWindow;
- USHORT nIndex;
- USHORT nFormStart;
- USHORT nFormEnd;
+ sal_uInt16 nIndex;
+ sal_uInt16 nFormStart;
+ sal_uInt16 nFormEnd;
// lookup window for dialog control
pDlgCtrl = this;
@@ -944,14 +944,14 @@ if ( !pDlgCtrlParent || (GetStyle() & WB_NODIALOGCONTROL) || ((pDlgCtrlParent->G
// -----------------------------------------------------------------------
static void ImplDlgCtrlUpdateDefButton( Window* pParent, Window* pFocusWindow,
- BOOL bGetFocus )
+ sal_Bool bGetFocus )
{
PushButton* pOldDefButton = NULL;
PushButton* pNewDefButton = NULL;
Window* pSWindow;
- USHORT i;
- USHORT nFormStart;
- USHORT nFormEnd;
+ sal_uInt16 i;
+ sal_uInt16 nFormStart;
+ sal_uInt16 nFormEnd;
// Formular suchen
pSWindow = ::ImplFindDlgCtrlWindow( pParent, pFocusWindow, i, nFormStart, nFormEnd );
@@ -961,7 +961,7 @@ static void ImplDlgCtrlUpdateDefButton( Window* pParent, Window* pFocusWindow,
nFormEnd = 0xFFFF;
}
- pSWindow = ImplGetChildWindow( pParent, nFormStart, i, FALSE );
+ pSWindow = ImplGetChildWindow( pParent, nFormStart, i, sal_False );
while ( pSWindow )
{
if ( pSWindow->ImplIsPushButton() )
@@ -975,14 +975,14 @@ static void ImplDlgCtrlUpdateDefButton( Window* pParent, Window* pFocusWindow,
pNewDefButton = pPushButton;
}
- pSWindow = ImplGetNextWindow( pParent, i, i, FALSE );
+ pSWindow = ImplGetNextWindow( pParent, i, i, sal_False );
if ( !i || (i > nFormEnd) )
pSWindow = NULL;
}
if ( !bGetFocus )
{
- USHORT nDummy;
+ sal_uInt16 nDummy;
Window* pNewFocusWindow = Application::GetFocusWindow();
if ( !pNewFocusWindow || !pParent->ImplIsWindowOrChild( pNewFocusWindow ) )
pNewDefButton = NULL;
@@ -994,19 +994,19 @@ static void ImplDlgCtrlUpdateDefButton( Window* pParent, Window* pFocusWindow,
if ( pOldDefButton != pNewDefButton )
{
if ( pOldDefButton )
- pOldDefButton->ImplSetDefButton( FALSE );
+ pOldDefButton->ImplSetDefButton( sal_False );
if ( pNewDefButton )
- pNewDefButton->ImplSetDefButton( TRUE );
+ pNewDefButton->ImplSetDefButton( sal_True );
}
}
// -----------------------------------------------------------------------
-void Window::ImplDlgCtrlFocusChanged( Window* pWindow, BOOL bGetFocus )
+void Window::ImplDlgCtrlFocusChanged( Window* pWindow, sal_Bool bGetFocus )
{
if ( mpWindowImpl->mpDlgCtrlDownWindow && !bGetFocus )
{
- ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( FALSE );
+ ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( sal_False );
mpWindowImpl->mpDlgCtrlDownWindow = NULL;
}
@@ -1017,9 +1017,9 @@ void Window::ImplDlgCtrlFocusChanged( Window* pWindow, BOOL bGetFocus )
Window* Window::ImplFindDlgCtrlWindow( Window* pWindow )
{
- USHORT nIndex;
- USHORT nFormStart;
- USHORT nFormEnd;
+ sal_uInt16 nIndex;
+ sal_uInt16 nFormStart;
+ sal_uInt16 nFormEnd;
// Focus-Fenster in der Child-Liste suchen und zurueckgeben
return ::ImplFindDlgCtrlWindow( this, pWindow, nIndex, nFormStart, nFormEnd );
@@ -1045,7 +1045,7 @@ Window* Window::GetParentLabeledBy( const Window* ) const
static sal_Unicode getAccel( const String& rStr )
{
sal_Unicode nChar = 0;
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
do
{
nPos = rStr.Search( '~', nPos );
@@ -1067,10 +1067,10 @@ static Window* ImplGetLabelFor( Window* pFrameWindow, WindowType nMyType, Window
{
// #i100833# MT 2010/02: Group box and fixed lines can also lable a fixed text.
// See tools/options/print for example.
- BOOL bThisIsAGroupControl = (nMyType == WINDOW_GROUPBOX) || (nMyType == WINDOW_FIXEDLINE);
+ sal_Bool bThisIsAGroupControl = (nMyType == WINDOW_GROUPBOX) || (nMyType == WINDOW_FIXEDLINE);
Window* pSWindow = NULL;
// get index, form start and form end
- USHORT nIndex=0, nFormStart=0, nFormEnd=0;
+ sal_uInt16 nIndex=0, nFormStart=0, nFormEnd=0;
pSWindow = ::ImplFindDlgCtrlWindow( pFrameWindow,
pLabel,
nIndex,
@@ -1084,7 +1084,7 @@ static Window* ImplGetLabelFor( Window* pFrameWindow, WindowType nMyType, Window
nAccel,
nFormStart,
nFormEnd,
- FALSE );
+ sal_False );
}
else
{
@@ -1096,7 +1096,7 @@ static Window* ImplGetLabelFor( Window* pFrameWindow, WindowType nMyType, Window
pSWindow = ::ImplGetChildWindow( pFrameWindow,
nIndex,
nIndex,
- FALSE );
+ sal_False );
if( pSWindow && pSWindow->IsVisible() && ! (pSWindow->GetStyle() & WB_NOLABEL) )
{
WindowType nType = pSWindow->GetType();
@@ -1119,11 +1119,15 @@ static Window* ImplGetLabelFor( Window* pFrameWindow, WindowType nMyType, Window
return pWindow;
}
-Window* Window::GetLabelFor() const
+Window* Window::GetAccessibleRelationLabelFor() const
{
if ( mpWindowImpl->mbDisableAccessibleLabelForRelation )
return NULL;
+ if ( mpWindowImpl->mpAccessibleInfos && mpWindowImpl->mpAccessibleInfos->pLabelForWindow )
+ return mpWindowImpl->mpAccessibleInfos->pLabelForWindow;
+
+
Window* pWindow = NULL;
Window* pFrameWindow = ImplGetFrameWindow();
@@ -1161,7 +1165,7 @@ static Window* ImplGetLabeledBy( Window* pFrameWindow, WindowType nMyType, Windo
// is directly before the control
// get form start and form end and index of this control
- USHORT nIndex, nFormStart, nFormEnd;
+ sal_uInt16 nIndex, nFormStart, nFormEnd;
Window* pSWindow = ::ImplFindDlgCtrlWindow( pFrameWindow,
pLabeled,
nIndex,
@@ -1176,13 +1180,13 @@ static Window* ImplGetLabeledBy( Window* pFrameWindow, WindowType nMyType, Windo
{
nFormStart = nIndex-1;
}
- for( USHORT nSearchIndex = nIndex-1; nSearchIndex >= nFormStart; nSearchIndex-- )
+ for( sal_uInt16 nSearchIndex = nIndex-1; nSearchIndex >= nFormStart; nSearchIndex-- )
{
- USHORT nFoundIndex = 0;
+ sal_uInt16 nFoundIndex = 0;
pSWindow = ::ImplGetChildWindow( pFrameWindow,
nSearchIndex,
nFoundIndex,
- FALSE );
+ sal_False );
if( pSWindow && pSWindow->IsVisible() && !(pSWindow->GetStyle() & WB_NOLABEL) )
{
WindowType nType = pSWindow->GetType();
@@ -1204,11 +1208,14 @@ static Window* ImplGetLabeledBy( Window* pFrameWindow, WindowType nMyType, Windo
return pWindow;
}
-Window* Window::GetLabeledBy() const
+Window* Window::GetAccessibleRelationLabeledBy() const
{
if ( mpWindowImpl->mbDisableAccessibleLabeledByRelation )
return NULL;
+ if ( mpWindowImpl->mpAccessibleInfos && mpWindowImpl->mpAccessibleInfos->pLabeledByWindow )
+ return mpWindowImpl->mpAccessibleInfos->pLabeledByWindow;
+
Window* pWindow = NULL;
Window* pFrameWindow = ImplGetFrameWindow();
@@ -1237,6 +1244,62 @@ Window* Window::GetLabeledBy() const
return pWindow;
}
+Window* Window::GetAccessibleRelationMemberOf() const
+{
+ Window* pWindow = NULL;
+ Window* pFrameWindow = GetParent();
+ if ( !pFrameWindow )
+ {
+ pFrameWindow = ImplGetFrameWindow();
+ }
+ // if( ! ( GetType() == WINDOW_FIXEDTEXT ||
+ if( !( GetType() == WINDOW_FIXEDLINE ||
+ GetType() == WINDOW_GROUPBOX ) )
+ {
+ // search for a control that makes member of this window
+ // it is considered the last fixed line or group box
+ // that comes before this control; with the exception of push buttons
+ // which are labeled only if the fixed line or group box
+ // is directly before the control
+ // get form start and form end and index of this control
+ sal_uInt16 nIndex, nFormStart, nFormEnd;
+ Window* pSWindow = ::ImplFindDlgCtrlWindow( pFrameWindow,
+ const_cast<Window*>(this),
+ nIndex,
+ nFormStart,
+ nFormEnd );
+ if( pSWindow && nIndex != nFormStart )
+ {
+ if( GetType() == WINDOW_PUSHBUTTON ||
+ GetType() == WINDOW_HELPBUTTON ||
+ GetType() == WINDOW_OKBUTTON ||
+ GetType() == WINDOW_CANCELBUTTON )
+ {
+ nFormStart = nIndex-1;
+ }
+ for( sal_uInt16 nSearchIndex = nIndex-1; nSearchIndex >= nFormStart; nSearchIndex-- )
+ {
+ sal_uInt16 nFoundIndex = 0;
+ pSWindow = ::ImplGetChildWindow( pFrameWindow,
+ nSearchIndex,
+ nFoundIndex,
+ sal_False );
+ if( pSWindow && pSWindow->IsVisible() &&
+ ( pSWindow->GetType() == WINDOW_FIXEDLINE ||
+ pSWindow->GetType() == WINDOW_GROUPBOX ) )
+ {
+ pWindow = pSWindow;
+ break;
+ }
+ if( nFoundIndex > nSearchIndex || nSearchIndex == 0 )
+ break;
+ }
+ }
+ }
+ return pWindow;
+}
+//-----IAccessibility2 Implementation 2009
+
// -----------------------------------------------------------------------
KeyEvent Window::GetActivationKey() const
@@ -1246,20 +1309,24 @@ KeyEvent Window::GetActivationKey() const
sal_Unicode nAccel = getAccel( GetText() );
if( ! nAccel )
{
- Window* pWindow = GetLabeledBy();
+ Window* pWindow = GetAccessibleRelationLabeledBy();
if( pWindow )
nAccel = getAccel( pWindow->GetText() );
}
if( nAccel )
{
- USHORT nCode = 0;
+ sal_uInt16 nCode = 0;
if( nAccel >= 'a' && nAccel <= 'z' )
nCode = KEY_A + (nAccel-'a');
else if( nAccel >= 'A' && nAccel <= 'Z' )
nCode = KEY_A + (nAccel-'A');
else if( nAccel >= '0' && nAccel <= '9' )
nCode = KEY_0 + (nAccel-'0');
- KeyCode aKeyCode( nCode, FALSE, FALSE, TRUE, FALSE );
+ else if( nAccel == '.' )
+ nCode = KEY_POINT;
+ else if( nAccel == '-' )
+ nCode = KEY_SUBTRACT;
+ KeyCode aKeyCode( nCode, sal_False, sal_False, sal_True, sal_False );
aKeyEvent = KeyEvent( nAccel, aKeyCode );
}
return aKeyEvent;
diff --git a/vcl/source/window/dockingarea.cxx b/vcl/source/window/dockingarea.cxx
index 231f17759b86..ded887c59933 100644
--- a/vcl/source/window/dockingarea.cxx
+++ b/vcl/source/window/dockingarea.cxx
@@ -127,7 +127,7 @@ void DockingAreaWindow::StateChanged( StateChangedType nType )
// -----------------------------------------------------------------------
-BOOL DockingAreaWindow::IsHorizontal() const
+sal_Bool DockingAreaWindow::IsHorizontal() const
{
return ( mpImplData->meAlign == WINDOWALIGN_TOP || mpImplData->meAlign == WINDOWALIGN_BOTTOM );
}
@@ -150,7 +150,7 @@ WindowAlign DockingAreaWindow::GetAlign() const
void DockingAreaWindow::Paint( const Rectangle& )
{
- EnableNativeWidget( TRUE ); // only required because the toolkit curently switches this flag off
+ EnableNativeWidget( sal_True ); // only required because the toolkit curently switches this flag off
if( IsNativeControlSupported( CTRL_TOOLBAR, PART_ENTIRE_CONTROL ) )
{
ToolbarValue aControlValue;
@@ -159,7 +159,7 @@ void DockingAreaWindow::Paint( const Rectangle& )
{
// give NWF a hint that this dockingarea is adjacent to the menubar
// useful for special gradient effects that should cover both windows
- aControlValue.mbIsTopDockingArea = TRUE;
+ aControlValue.mbIsTopDockingArea = sal_True;
}
ControlState nState = CTRL_STATE_ENABLED;
@@ -173,8 +173,8 @@ void DockingAreaWindow::Paint( const Rectangle& )
aCtrlRegion, nState, aControlValue, rtl::OUString() );
// each toolbar gets a thin border to better recognize its borders on the homogeneous docking area
- USHORT nChildren = GetChildCount();
- for( USHORT n = 0; n < nChildren; n++ )
+ sal_uInt16 nChildren = GetChildCount();
+ for( sal_uInt16 n = 0; n < nChildren; n++ )
{
Window* pChild = GetChild( n );
if ( pChild->IsVisible() )
@@ -198,8 +198,8 @@ void DockingAreaWindow::Paint( const Rectangle& )
// create map to find toolbar lines
Size aOutSz = GetOutputSizePixel();
std::map< int, int > ranges;
- USHORT nChildren = GetChildCount();
- for( USHORT n = 0; n < nChildren; n++ )
+ sal_uInt16 nChildren = GetChildCount();
+ for( sal_uInt16 n = 0; n < nChildren; n++ )
{
Window* pChild = GetChild( n );
Point aPos = pChild->GetPosPixel();
diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx
index ee8e584ac234..017fdc5390db 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -59,13 +59,13 @@ class ImplDockFloatWin2 : public FloatingWindow
{
private:
ImplDockingWindowWrapper* mpDockWin;
- ULONG mnLastTicks;
+ sal_uLong mnLastTicks;
Timer maDockTimer;
Timer maEndDockTimer;
Point maDockPos;
Rectangle maDockRect;
- BOOL mbInMove;
- ULONG mnLastUserEvent;
+ sal_Bool mbInMove;
+ sal_uLong mnLastUserEvent;
DECL_LINK( DockingHdl, ImplDockFloatWin2* );
DECL_LINK( DockTimerHdl, ImplDockFloatWin2* );
@@ -77,18 +77,18 @@ public:
virtual void Move();
virtual void Resize();
- virtual void TitleButtonClick( USHORT nButton );
+ virtual void TitleButtonClick( sal_uInt16 nButton );
virtual void Pin();
virtual void Roll();
virtual void PopupModeEnd();
virtual void Resizing( Size& rSize );
- virtual BOOL Close();
+ virtual sal_Bool Close();
using Window::SetPosSizePixel;
virtual void SetPosSizePixel( long nX, long nY,
long nWidth, long nHeight,
- USHORT nFlags = WINDOW_POSSIZE_ALL );
+ sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
- ULONG GetLastTicks() const { return mnLastTicks; }
+ sal_uLong GetLastTicks() const { return mnLastTicks; }
};
// =======================================================================
@@ -98,16 +98,16 @@ ImplDockFloatWin2::ImplDockFloatWin2( Window* pParent, WinBits nWinBits,
FloatingWindow( pParent, nWinBits ),
mpDockWin( pDockingWin ),
mnLastTicks( Time::GetSystemTicks() ),
- mbInMove( FALSE ),
+ mbInMove( sal_False ),
mnLastUserEvent( 0 )
{
// Daten vom DockingWindow uebernehmen
if ( pDockingWin )
{
SetSettings( pDockingWin->GetWindow()->GetSettings() );
- Enable( pDockingWin->GetWindow()->IsEnabled(), FALSE );
- EnableInput( pDockingWin->GetWindow()->IsInputEnabled(), FALSE );
- AlwaysEnableInput( pDockingWin->GetWindow()->IsAlwaysEnableInput(), FALSE );
+ Enable( pDockingWin->GetWindow()->IsEnabled(), sal_False );
+ EnableInput( pDockingWin->GetWindow()->IsInputEnabled(), sal_False );
+ AlwaysEnableInput( pDockingWin->GetWindow()->IsAlwaysEnableInput(), sal_False );
EnableAlwaysOnTop( pDockingWin->GetWindow()->IsAlwaysOnTopEnabled() );
SetActivateMode( pDockingWin->GetWindow()->GetActivateMode() );
}
@@ -147,7 +147,7 @@ IMPL_LINK( ImplDockFloatWin2, DockTimerHdl, ImplDockFloatWin2*, EMPTYARG )
else if( ! ( aState.mnState & ( MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT ) ) )
{
mpDockWin->GetWindow()->GetParent()->ImplGetFrameWindow()->HideTracking();
- mpDockWin->EndDocking( maDockRect, FALSE );
+ mpDockWin->EndDocking( maDockRect, sal_False );
}
else
{
@@ -167,7 +167,7 @@ IMPL_LINK( ImplDockFloatWin2, EndDockTimerHdl, ImplDockFloatWin2*, EMPTYARG )
if( ! ( aState.mnState & ( MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT ) ) )
{
mpDockWin->GetWindow()->GetParent()->ImplGetFrameWindow()->HideTracking();
- mpDockWin->EndDocking( maDockRect, TRUE );
+ mpDockWin->EndDocking( maDockRect, sal_True );
}
else
{
@@ -186,7 +186,7 @@ IMPL_LINK( ImplDockFloatWin2, DockingHdl, ImplDockFloatWin2*, EMPTYARG )
Window *pDockingArea = mpDockWin->GetWindow()->GetParent();
PointerState aState = pDockingArea->GetPointerState();
- BOOL bRealMove = TRUE;
+ sal_Bool bRealMove = sal_True;
if( GetStyle() & WB_OWNERDRAWDECORATION )
{
// for windows with ownerdraw decoration
@@ -207,9 +207,9 @@ IMPL_LINK( ImplDockFloatWin2, DockingHdl, ImplDockFloatWin2*, EMPTYARG )
PointerState aBorderState = pBorder->GetPointerState();
if( aBorderRect.IsInside( aBorderState.maPos ) )
- bRealMove = TRUE;
+ bRealMove = sal_True;
else
- bRealMove = FALSE;
+ bRealMove = sal_False;
}
}
@@ -229,7 +229,7 @@ IMPL_LINK( ImplDockFloatWin2, DockingHdl, ImplDockFloatWin2*, EMPTYARG )
if( ! mpDockWin->IsDocking() )
mpDockWin->StartDocking( aMousePos, maDockRect );
- BOOL bFloatMode = mpDockWin->Docking( aMousePos, maDockRect );
+ sal_Bool bFloatMode = mpDockWin->Docking( aMousePos, maDockRect );
if( ! bFloatMode )
{
@@ -247,7 +247,7 @@ IMPL_LINK( ImplDockFloatWin2, DockingHdl, ImplDockFloatWin2*, EMPTYARG )
EndDockTimerHdl( this );
}
}
- mbInMove = FALSE;
+ mbInMove = sal_False;
return 0;
}
// -----------------------------------------------------------------------
@@ -257,7 +257,7 @@ void ImplDockFloatWin2::Move()
if( mbInMove )
return;
- mbInMove = TRUE;
+ mbInMove = sal_True;
FloatingWindow::Move();
mpDockWin->GetWindow()->Move();
@@ -289,7 +289,7 @@ void ImplDockFloatWin2::Resize()
void ImplDockFloatWin2::SetPosSizePixel( long nX, long nY,
long nWidth, long nHeight,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
FloatingWindow::SetPosSizePixel( nX, nY, nWidth, nHeight, nFlags );
}
@@ -297,7 +297,7 @@ void ImplDockFloatWin2::SetPosSizePixel( long nX, long nY,
// -----------------------------------------------------------------------
-void ImplDockFloatWin2::TitleButtonClick( USHORT nButton )
+void ImplDockFloatWin2::TitleButtonClick( sal_uInt16 nButton )
{
FloatingWindow::TitleButtonClick( nButton );
mpDockWin->TitleButtonClick( nButton );
@@ -337,7 +337,7 @@ void ImplDockFloatWin2::Resizing( Size& rSize )
// -----------------------------------------------------------------------
-BOOL ImplDockFloatWin2::Close()
+sal_Bool ImplDockFloatWin2::Close()
{
return mpDockWin->Close();
}
@@ -373,33 +373,33 @@ ImplDockingWindowWrapper* DockingManager::GetDockingWindowWrapper( const Window
return NULL;
}
-BOOL DockingManager::IsDockable( const Window *pWindow )
+sal_Bool DockingManager::IsDockable( const Window *pWindow )
{
ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
/*
if( pWindow->HasDockingHandler() )
- return TRUE;
+ return sal_True;
*/
return (pWrapper != NULL);
}
-BOOL DockingManager::IsFloating( const Window *pWindow )
+sal_Bool DockingManager::IsFloating( const Window *pWindow )
{
ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
if( pWrapper )
return pWrapper->IsFloatingMode();
else
- return FALSE;
+ return sal_False;
}
-BOOL DockingManager::IsLocked( const Window *pWindow )
+sal_Bool DockingManager::IsLocked( const Window *pWindow )
{
ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
if( pWrapper && pWrapper->IsLocked() )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
void DockingManager::Lock( const Window *pWindow )
@@ -416,14 +416,14 @@ void DockingManager::Unlock( const Window *pWindow )
pWrapper->Unlock();
}
-void DockingManager::SetFloatingMode( const Window *pWindow, BOOL bFloating )
+void DockingManager::SetFloatingMode( const Window *pWindow, sal_Bool bFloating )
{
ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
if( pWrapper )
pWrapper->SetFloatingMode( bFloating );
}
-void DockingManager::StartPopupMode( ToolBox *pParentToolBox, const Window *pWindow, ULONG nFlags )
+void DockingManager::StartPopupMode( ToolBox *pParentToolBox, const Window *pWindow, sal_uLong nFlags )
{
ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
if( pWrapper )
@@ -438,13 +438,13 @@ void DockingManager::StartPopupMode( ToolBox *pParentToolBox, const Window *pWin
FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE );
}
-BOOL DockingManager::IsInPopupMode( const Window *pWindow )
+sal_Bool DockingManager::IsInPopupMode( const Window *pWindow )
{
ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
if( pWrapper && pWrapper->IsInPopupMode() )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -488,7 +488,7 @@ void DockingManager::RemoveWindow( const Window *pWindow )
void DockingManager::SetPosSizePixel( Window *pWindow, long nX, long nY,
long nWidth, long nHeight,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
if( pWrapper )
@@ -529,8 +529,8 @@ class ImplPopupFloatWin : public FloatingWindow
{
private:
ImplDockingWindowWrapper* mpDockingWin;
- BOOL mbHighlight;
- BOOL mbMoving;
+ sal_Bool mbHighlight;
+ sal_Bool mbMoving;
bool mbTrackingEnabled;
Point maDelta;
Point maTearOffPosition;
@@ -563,13 +563,13 @@ public:
ImplPopupFloatWin::ImplPopupFloatWin( Window* pParent, ImplDockingWindowWrapper* pDockingWin, bool bHasGrip ) :
FloatingWindow( pParent, WB_NOBORDER | WB_SYSTEMWINDOW | WB_NOSHADOW)
{
- mpWindowImpl->mbToolbarFloatingWindow = TRUE; // indicate window type, required for accessibility
+ mpWindowImpl->mbToolbarFloatingWindow = sal_True; // indicate window type, required for accessibility
// which should not see this window as a toplevel window
mpDockingWin = pDockingWin;
- mbHighlight = FALSE;
- mbMoving = FALSE;
- mbTrackingEnabled = FALSE;
- mbGripAtBottom = TRUE;
+ mbHighlight = sal_False;
+ mbMoving = sal_False;
+ mbTrackingEnabled = sal_False;
+ mbGripAtBottom = sal_True;
mbHasGrip = bHasGrip;
ImplSetBorder();
@@ -679,9 +679,9 @@ void ImplPopupFloatWin::DrawBorder()
void ImplPopupFloatWin::DrawGrip()
{
- BOOL bLinecolor = IsLineColor();
+ sal_Bool bLinecolor = IsLineColor();
Color aLinecolor = GetLineColor();
- BOOL bFillcolor = IsFillColor();
+ sal_Bool bFillcolor = IsFillColor();
Color aFillcolor = GetFillColor();
// draw background
@@ -694,7 +694,7 @@ void ImplPopupFloatWin::DrawGrip()
if( mbHighlight )
{
Erase( aRect );
- DrawSelectionBackground( aRect, 2, FALSE, TRUE, FALSE );
+ DrawSelectionBackground( aRect, 2, sal_False, sal_True, sal_False );
}
else
{
@@ -781,18 +781,18 @@ void ImplPopupFloatWin::MouseMove( const MouseEvent& rMEvt )
if( mbTrackingEnabled && rMEvt.IsLeft() && GetDragRect().IsInside( aMousePos ) )
{
// start window move
- mbMoving = TRUE;
+ mbMoving = sal_True;
StartTracking( STARTTRACK_NOKEYCANCEL );
return;
}
if( !mbHighlight && GetDragRect().IsInside( aMousePos ) )
{
- mbHighlight = TRUE;
+ mbHighlight = sal_True;
DrawGrip();
}
if( mbHighlight && ( rMEvt.IsLeaveWindow() || !GetDragRect().IsInside( aMousePos ) ) )
{
- mbHighlight = FALSE;
+ mbHighlight = sal_False;
DrawGrip();
}
}
@@ -829,7 +829,7 @@ void ImplPopupFloatWin::Tracking( const TrackingEvent& rTEvt )
{
if ( rTEvt.IsTrackingEnded() )
{
- mbMoving = FALSE;
+ mbMoving = sal_False;
EndPopupMode( FLOATWIN_POPUPMODEEND_TEAROFF );
}
else if ( !rTEvt.GetMouseEvent().IsSynthetic() )
@@ -853,39 +853,39 @@ ImplDockingWindowWrapper::ImplDockingWindowWrapper( const Window *pWindow )
mpDockingWindow = (Window*) pWindow;
mpParent = pWindow->GetParent();
- mbDockable = TRUE;
- mbLocked = FALSE;
+ mbDockable = sal_True;
+ mbLocked = sal_False;
mnFloatBits = WB_BORDER | WB_CLOSEABLE | WB_SIZEABLE | (pWindow->GetStyle() & DOCKWIN_FLOATSTYLES);
DockingWindow *pDockWin = dynamic_cast< DockingWindow* > ( mpDockingWindow );
if( pDockWin )
mnFloatBits = pDockWin->GetFloatStyle();
// must be enabled in Window::Notify to prevent permanent docking during mouse move
- mbStartDockingEnabled = FALSE;
+ mbStartDockingEnabled = sal_False;
}
ImplDockingWindowWrapper::~ImplDockingWindowWrapper()
{
if ( IsFloatingMode() )
{
- GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE );
- SetFloatingMode( FALSE );
+ GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE );
+ SetFloatingMode( sal_False );
}
}
// -----------------------------------------------------------------------
-BOOL ImplDockingWindowWrapper::ImplStartDocking( const Point& rPos )
+sal_Bool ImplDockingWindowWrapper::ImplStartDocking( const Point& rPos )
{
if ( !mbDockable )
- return FALSE;
+ return sal_False;
if( !mbStartDockingEnabled )
- return FALSE;
+ return sal_False;
maMouseOff = rPos;
maMouseStart = maMouseOff;
- mbDocking = TRUE;
+ mbDocking = sal_True;
mbLastFloatMode = IsFloatingMode();
mbStartFloat = mbLastFloatMode;
@@ -929,7 +929,7 @@ BOOL ImplDockingWindowWrapper::ImplStartDocking( const Point& rPos )
GetWindow()->ImplGetFrameWindow()->ImplUpdateAll();
GetWindow()->StartTracking( STARTTRACK_KEYMOD );
- return TRUE;
+ return sal_True;
}
// =======================================================================
@@ -938,15 +938,15 @@ void ImplDockingWindowWrapper::ImplInitData()
{
mpDockingWindow = NULL;
- //GetWindow()->mpWindowImpl->mbDockWin = TRUE; // TODO: must be eliminated
+ //GetWindow()->mpWindowImpl->mbDockWin = sal_True; // TODO: must be eliminated
mpFloatWin = NULL;
- mbDockCanceled = FALSE;
- mbFloatPrevented = FALSE;
- mbDocking = FALSE;
- mbPined = FALSE;
- mbRollUp = FALSE;
- mbDockBtn = FALSE;
- mbHideBtn = FALSE;
+ mbDockCanceled = sal_False;
+ mbFloatPrevented = sal_False;
+ mbDocking = sal_False;
+ mbPined = sal_False;
+ mbRollUp = sal_False;
+ mbDockBtn = sal_False;
+ mbHideBtn = sal_False;
maMaxOutSize = Size( SHRT_MAX, SHRT_MAX );
}
@@ -959,13 +959,13 @@ void ImplDockingWindowWrapper::Tracking( const TrackingEvent& rTEvt )
{
if ( rTEvt.IsTrackingEnded() )
{
- mbDocking = FALSE;
+ mbDocking = sal_False;
GetWindow()->HideTracking();
if ( rTEvt.IsTrackingCanceled() )
{
- mbDockCanceled = TRUE;
+ mbDockCanceled = sal_True;
EndDocking( Rectangle( Point( mnTrackX, mnTrackY ), Size( mnTrackWidth, mnTrackHeight ) ), mbLastFloatMode );
- mbDockCanceled = FALSE;
+ mbDockCanceled = sal_False;
}
else
EndDocking( Rectangle( Point( mnTrackX, mnTrackY ), Size( mnTrackWidth, mnTrackHeight ) ), mbLastFloatMode );
@@ -993,9 +993,9 @@ void ImplDockingWindowWrapper::Tracking( const TrackingEvent& rTEvt )
aPos.X() += maMouseOff.X();
aPos.Y() += maMouseOff.Y();
- BOOL bFloatMode = Docking( aPos, aTrackRect );
+ sal_Bool bFloatMode = Docking( aPos, aTrackRect );
- mbFloatPrevented = FALSE;
+ mbFloatPrevented = sal_False;
if ( mbLastFloatMode != bFloatMode )
{
if ( bFloatMode )
@@ -1018,7 +1018,7 @@ void ImplDockingWindowWrapper::Tracking( const TrackingEvent& rTEvt )
mbLastFloatMode = bFloatMode;
}
- USHORT nTrackStyle;
+ sal_uInt16 nTrackStyle;
if ( bFloatMode )
nTrackStyle = SHOWTRACK_OBJECT;
else
@@ -1055,12 +1055,12 @@ void ImplDockingWindowWrapper::StartDocking( const Point& rPoint, Rectangle& rRe
DockingData data( rPoint, rRect, IsFloatingMode() );
GetWindow()->ImplCallEventListeners( VCLEVENT_WINDOW_STARTDOCKING, &data );
- mbDocking = TRUE;
+ mbDocking = sal_True;
}
// -----------------------------------------------------------------------
-BOOL ImplDockingWindowWrapper::Docking( const Point& rPoint, Rectangle& rRect )
+sal_Bool ImplDockingWindowWrapper::Docking( const Point& rPoint, Rectangle& rRect )
{
DockingData data( rPoint, rRect, IsFloatingMode() );
@@ -1071,18 +1071,18 @@ BOOL ImplDockingWindowWrapper::Docking( const Point& rPoint, Rectangle& rRect )
// -----------------------------------------------------------------------
-void ImplDockingWindowWrapper::EndDocking( const Rectangle& rRect, BOOL bFloatMode )
+void ImplDockingWindowWrapper::EndDocking( const Rectangle& rRect, sal_Bool bFloatMode )
{
Rectangle aRect( rRect );
if ( !IsDockingCanceled() )
{
- BOOL bShow = FALSE;
+ sal_Bool bShow = sal_False;
if ( bFloatMode != IsFloatingMode() )
{
- GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE );
SetFloatingMode( bFloatMode );
- bShow = TRUE;
+ bShow = sal_True;
if ( bFloatMode )
{
// #i44800# always use outputsize - as in all other places
@@ -1098,30 +1098,30 @@ void ImplDockingWindowWrapper::EndDocking( const Rectangle& rRect, BOOL bFloatMo
}
if ( bShow )
- GetWindow()->Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ GetWindow()->Show( sal_True, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
}
EndDockingData data( aRect, IsFloatingMode(), IsDockingCanceled() );
GetWindow()->ImplCallEventListeners( VCLEVENT_WINDOW_ENDDOCKING, &data );
- mbDocking = FALSE;
+ mbDocking = sal_False;
// must be enabled in Window::Notify to prevent permanent docking during mouse move
- mbStartDockingEnabled = FALSE;
+ mbStartDockingEnabled = sal_False;
}
// -----------------------------------------------------------------------
-BOOL ImplDockingWindowWrapper::PrepareToggleFloatingMode()
+sal_Bool ImplDockingWindowWrapper::PrepareToggleFloatingMode()
{
- BOOL bFloating = TRUE;
+ sal_Bool bFloating = sal_True;
GetWindow()->ImplCallEventListeners( VCLEVENT_WINDOW_PREPARETOGGLEFLOATING, &bFloating );
return bFloating;
}
// -----------------------------------------------------------------------
-BOOL ImplDockingWindowWrapper::Close()
+sal_Bool ImplDockingWindowWrapper::Close()
{
// TODO: send event
/*
@@ -1129,15 +1129,15 @@ BOOL ImplDockingWindowWrapper::Close()
ImplAddDel( &aDelData );
GetWindow()->ImplCallEventListeners( VCLEVENT_WINDOW_CLOSE );
if ( aDelData.IsDelete() )
- return FALSE;
+ return sal_False;
ImplRemoveDel( &aDelData );
if ( mpWindowImpl->mxWindowPeer.is() && IsCreatedWithToolkit() )
- return FALSE;
+ return sal_False;
- GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE );
*/
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -1154,12 +1154,12 @@ void ImplDockingWindowWrapper::ToggleFloatingMode()
GetWindow()->ImplCallEventListeners( VCLEVENT_WINDOW_TOGGLEFLOATING );
// must be enabled in Window::Notify to prevent permanent docking during mouse move
- mbStartDockingEnabled = FALSE;
+ mbStartDockingEnabled = sal_False;
}
// -----------------------------------------------------------------------
-void ImplDockingWindowWrapper::TitleButtonClick( USHORT nType )
+void ImplDockingWindowWrapper::TitleButtonClick( sal_uInt16 nType )
{
if( nType == TITLE_BUTTON_MENU )
{
@@ -1208,7 +1208,7 @@ void ImplDockingWindowWrapper::Resizing( Size& rSize )
// -----------------------------------------------------------------------
-void ImplDockingWindowWrapper::ShowTitleButton( USHORT nButton, BOOL bVisible )
+void ImplDockingWindowWrapper::ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible )
{
if ( mpFloatWin )
mpFloatWin->ShowTitleButton( nButton, bVisible );
@@ -1223,7 +1223,7 @@ void ImplDockingWindowWrapper::ShowTitleButton( USHORT nButton, BOOL bVisible )
// -----------------------------------------------------------------------
-BOOL ImplDockingWindowWrapper::IsTitleButtonVisible( USHORT nButton ) const
+sal_Bool ImplDockingWindowWrapper::IsTitleButtonVisible( sal_uInt16 nButton ) const
{
if ( mpFloatWin )
return mpFloatWin->IsTitleButtonVisible( nButton );
@@ -1238,13 +1238,13 @@ BOOL ImplDockingWindowWrapper::IsTitleButtonVisible( USHORT nButton ) const
// -----------------------------------------------------------------------
-void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, ULONG nFlags )
+void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, sal_uLong nFlags )
{
// do nothing if window is floating
if( IsFloatingMode() )
return;
- GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE );
// prepare reparenting
Window* pRealParent = GetWindow()->GetWindow( WINDOW_PARENT );
@@ -1301,7 +1301,7 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, ULONG nF
IMPL_LINK( ImplDockingWindowWrapper, PopupModeEnd, void*, EMPTYARG )
{
- GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE );
// set parameter for handler before destroying floating window
ImplPopupFloatWin *pPopupFloatWin = (ImplPopupFloatWin*) mpFloatWin;
@@ -1332,17 +1332,17 @@ IMPL_LINK( ImplDockingWindowWrapper, PopupModeEnd, void*, EMPTYARG )
}
-BOOL ImplDockingWindowWrapper::IsInPopupMode() const
+sal_Bool ImplDockingWindowWrapper::IsInPopupMode() const
{
if( GetFloatingWindow() )
return GetFloatingWindow()->IsInPopupMode();
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void ImplDockingWindowWrapper::SetFloatingMode( BOOL bFloatMode )
+void ImplDockingWindowWrapper::SetFloatingMode( sal_Bool bFloatMode )
{
// do nothing if window is docked and locked
if( !IsFloatingMode() && IsLocked() )
@@ -1352,11 +1352,11 @@ void ImplDockingWindowWrapper::SetFloatingMode( BOOL bFloatMode )
{
if ( PrepareToggleFloatingMode() )
{
- BOOL bVisible = GetWindow()->IsVisible();
+ sal_Bool bVisible = GetWindow()->IsVisible();
if ( bFloatMode )
{
- GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE );
maDockPos = GetWindow()->GetPosPixel();
@@ -1422,13 +1422,13 @@ void ImplDockingWindowWrapper::SetFloatingMode( BOOL bFloatMode )
mpFloatWin = pWin;
if ( bVisible )
- GetWindow()->Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ GetWindow()->Show( sal_True, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
ToggleFloatingMode();
}
else
{
- GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE );
// FloatingDaten wird im FloatingWindow speichern
maFloatPos = mpFloatWin->GetPosPixel();
@@ -1493,7 +1493,7 @@ void ImplDockingWindowWrapper::SetTabStop()
void ImplDockingWindowWrapper::SetPosSizePixel( long nX, long nY,
long nWidth, long nHeight,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
if ( mpFloatWin )
mpFloatWin->SetPosSizePixel( nX, nY, nWidth, nHeight, nFlags );
@@ -1561,14 +1561,14 @@ Point ImplDockingWindowWrapper::GetFloatingPos() const
// old inlines from DockingWindow
// -----------------------------------------------------------------------
-void ImplDockingWindowWrapper::SetPin( BOOL bPin )
+void ImplDockingWindowWrapper::SetPin( sal_Bool bPin )
{
if ( mpFloatWin )
mpFloatWin->SetPin( bPin );
mbPined = bPin;
}
-BOOL ImplDockingWindowWrapper::IsPined() const
+sal_Bool ImplDockingWindowWrapper::IsPined() const
{
if ( mpFloatWin )
return mpFloatWin->IsPined();
@@ -1579,17 +1579,17 @@ void ImplDockingWindowWrapper::RollUp()
{
if ( mpFloatWin )
mpFloatWin->RollUp();
- mbRollUp = TRUE;
+ mbRollUp = sal_True;
}
void ImplDockingWindowWrapper::RollDown()
{
if ( mpFloatWin )
mpFloatWin->RollDown();
- mbRollUp = FALSE;
+ mbRollUp = sal_False;
}
-BOOL ImplDockingWindowWrapper::IsRollUp() const
+sal_Bool ImplDockingWindowWrapper::IsRollUp() const
{
if ( mpFloatWin )
return mpFloatWin->IsRollUp();
@@ -1646,7 +1646,7 @@ void ImplDockingWindowWrapper::SetFloatingPos( const Point& rNewPos )
maFloatPos = rNewPos;
}
-BOOL ImplDockingWindowWrapper::IsFloatingMode() const
+sal_Bool ImplDockingWindowWrapper::IsFloatingMode() const
{
return (mpFloatWin != NULL);
}
@@ -1664,7 +1664,7 @@ Rectangle ImplDockingWindowWrapper::GetDragArea() const
void ImplDockingWindowWrapper::Lock()
{
- mbLocked = TRUE;
+ mbLocked = sal_True;
// only toolbars support locking
ToolBox *pToolBox = dynamic_cast< ToolBox * >( GetWindow() );
if( pToolBox )
@@ -1673,14 +1673,14 @@ void ImplDockingWindowWrapper::Lock()
void ImplDockingWindowWrapper::Unlock()
{
- mbLocked = FALSE;
+ mbLocked = sal_False;
// only toolbars support locking
ToolBox *pToolBox = dynamic_cast< ToolBox * >( GetWindow() );
if( pToolBox )
pToolBox->Lock( mbLocked );
}
-BOOL ImplDockingWindowWrapper::IsLocked() const
+sal_Bool ImplDockingWindowWrapper::IsLocked() const
{
return mbLocked;
}
diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index a176f97d88d5..c9b71b01f78e 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -79,12 +79,12 @@ class ImplDockFloatWin : public FloatingWindow
{
private:
DockingWindow* mpDockWin;
- ULONG mnLastTicks;
+ sal_uLong mnLastTicks;
Timer maDockTimer;
Point maDockPos;
Rectangle maDockRect;
- BOOL mbInMove;
- ULONG mnLastUserEvent;
+ sal_Bool mbInMove;
+ sal_uLong mnLastUserEvent;
DECL_LINK( DockingHdl, ImplDockFloatWin* );
DECL_LINK( DockTimerHdl, ImplDockFloatWin* );
@@ -95,14 +95,14 @@ public:
virtual void Move();
virtual void Resize();
- virtual void TitleButtonClick( USHORT nButton );
+ virtual void TitleButtonClick( sal_uInt16 nButton );
virtual void Pin();
virtual void Roll();
virtual void PopupModeEnd();
virtual void Resizing( Size& rSize );
- virtual BOOL Close();
+ virtual sal_Bool Close();
- ULONG GetLastTicks() const { return mnLastTicks; }
+ sal_uLong GetLastTicks() const { return mnLastTicks; }
};
@@ -111,16 +111,16 @@ ImplDockFloatWin::ImplDockFloatWin( Window* pParent, WinBits nWinBits,
FloatingWindow( pParent, nWinBits ),
mpDockWin( pDockingWin ),
mnLastTicks( Time::GetSystemTicks() ),
- mbInMove( FALSE ),
+ mbInMove( sal_False ),
mnLastUserEvent( 0 )
{
// Daten vom DockingWindow uebernehmen
if ( pDockingWin )
{
SetSettings( pDockingWin->GetSettings() );
- Enable( pDockingWin->IsEnabled(), FALSE );
- EnableInput( pDockingWin->IsInputEnabled(), FALSE );
- AlwaysEnableInput( pDockingWin->IsAlwaysEnableInput(), FALSE );
+ Enable( pDockingWin->IsEnabled(), sal_False );
+ EnableInput( pDockingWin->IsInputEnabled(), sal_False );
+ AlwaysEnableInput( pDockingWin->IsAlwaysEnableInput(), sal_False );
EnableAlwaysOnTop( pDockingWin->IsAlwaysOnTopEnabled() );
SetActivateMode( pDockingWin->GetActivateMode() );
}
@@ -152,14 +152,14 @@ IMPL_LINK( ImplDockFloatWin, DockTimerHdl, ImplDockFloatWin*, EMPTYARG )
{
// i43499 CTRL disables docking now
mpDockWin->GetParent()->ImplGetFrameWindow()->HideTracking();
- mpDockWin->EndDocking( maDockRect, TRUE );
+ mpDockWin->EndDocking( maDockRect, sal_True );
if( aState.mnState & ( MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT ) )
maDockTimer.Start();
}
else if( ! ( aState.mnState & ( MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT ) ) )
{
mpDockWin->GetParent()->ImplGetFrameWindow()->HideTracking();
- mpDockWin->EndDocking( maDockRect, FALSE );
+ mpDockWin->EndDocking( maDockRect, sal_False );
}
else
{
@@ -190,7 +190,7 @@ IMPL_LINK( ImplDockFloatWin, DockingHdl, ImplDockFloatWin*, EMPTYARG )
// mouse pos also in screen pixels
Point aMousePos = mpDockWin->GetParent()->OutputToScreenPixel( aState.maPos );
- BOOL bFloatMode = mpDockWin->Docking( aMousePos, maDockRect );
+ sal_Bool bFloatMode = mpDockWin->Docking( aMousePos, maDockRect );
if( ! bFloatMode )
{
mpDockWin->GetParent()->ImplGetFrameWindow()->ShowTracking( maDockRect, SHOWTRACK_OBJECT | SHOWTRACK_WINDOW );
@@ -200,10 +200,10 @@ IMPL_LINK( ImplDockFloatWin, DockingHdl, ImplDockFloatWin*, EMPTYARG )
{
mpDockWin->GetParent()->ImplGetFrameWindow()->HideTracking();
maDockTimer.Stop();
- mpDockWin->EndDocking( maDockRect, TRUE );
+ mpDockWin->EndDocking( maDockRect, sal_True );
}
}
- mbInMove = FALSE;
+ mbInMove = sal_False;
return 0;
}
// -----------------------------------------------------------------------
@@ -213,7 +213,7 @@ void ImplDockFloatWin::Move()
if( mbInMove )
return;
- mbInMove = TRUE;
+ mbInMove = sal_True;
FloatingWindow::Move();
mpDockWin->Move();
@@ -241,7 +241,7 @@ void ImplDockFloatWin::Resize()
// -----------------------------------------------------------------------
-void ImplDockFloatWin::TitleButtonClick( USHORT nButton )
+void ImplDockFloatWin::TitleButtonClick( sal_uInt16 nButton )
{
FloatingWindow::TitleButtonClick( nButton );
mpDockWin->TitleButtonClick( nButton );
@@ -281,21 +281,21 @@ void ImplDockFloatWin::Resizing( Size& rSize )
// -----------------------------------------------------------------------
-BOOL ImplDockFloatWin::Close()
+sal_Bool ImplDockFloatWin::Close()
{
return mpDockWin->Close();
}
// =======================================================================
-BOOL DockingWindow::ImplStartDocking( const Point& rPos )
+sal_Bool DockingWindow::ImplStartDocking( const Point& rPos )
{
if ( !mbDockable )
- return FALSE;
+ return sal_False;
maMouseOff = rPos;
maMouseStart = maMouseOff;
- mbDocking = TRUE;
+ mbDocking = sal_True;
mbLastFloatMode = IsFloatingMode();
mbStartFloat = mbLastFloatMode;
@@ -328,17 +328,17 @@ BOOL DockingWindow::ImplStartDocking( const Point& rPos )
if ( GetSettings().GetStyleSettings().GetDragFullOptions() & DRAGFULL_OPTION_DOCKING &&
!( mnFloatBits & ( WB_MOVEABLE | WB_SIZEABLE | WB_CLOSEABLE ) ) ) // no full drag when migrating to system window
- mbDragFull = TRUE;
+ mbDragFull = sal_True;
else
{
StartDocking();
- mbDragFull = FALSE;
+ mbDragFull = sal_False;
ImplUpdateAll();
ImplGetFrameWindow()->ImplUpdateAll();
}
StartTracking( STARTTRACK_KEYMOD );
- return TRUE;
+ return sal_True;
}
// =======================================================================
@@ -346,17 +346,17 @@ BOOL DockingWindow::ImplStartDocking( const Point& rPos )
void DockingWindow::ImplInitDockingWindowData()
{
mpImplData = new ImplData;
- mpWindowImpl->mbDockWin = TRUE;
+ mpWindowImpl->mbDockWin = sal_True;
mpFloatWin = NULL;
- mbDockCanceled = FALSE;
- mbDockPrevented = FALSE;
- mbFloatPrevented = FALSE;
- mbDocking = FALSE;
- mbPined = FALSE;
- mbRollUp = FALSE;
- mbDockBtn = FALSE;
- mbHideBtn = FALSE;
+ mbDockCanceled = sal_False;
+ mbDockPrevented = sal_False;
+ mbFloatPrevented = sal_False;
+ mbDocking = sal_False;
+ mbPined = sal_False;
+ mbRollUp = sal_False;
+ mbDockBtn = sal_False;
+ mbHideBtn = sal_False;
}
// -----------------------------------------------------------------------
@@ -405,7 +405,7 @@ void DockingWindow::ImplLoadRes( const ResId& rResId )
{
Window::ImplLoadRes( rResId );
- ULONG nMask = ReadLongRes();
+ sal_uLong nMask = ReadLongRes();
if ( (RSC_DOCKINGWINDOW_XYMAPMODE | RSC_DOCKINGWINDOW_X |
RSC_DOCKINGWINDOW_Y) & nMask )
@@ -434,8 +434,8 @@ void DockingWindow::ImplLoadRes( const ResId& rResId )
if ( nMask & RSC_DOCKINGWINDOW_FLOATING )
{
- if ( (BOOL)ReadShortRes() )
- SetFloatingMode( TRUE );
+ if ( (sal_Bool)ReadShortRes() )
+ SetFloatingMode( sal_True );
}
}
@@ -477,8 +477,8 @@ DockingWindow::~DockingWindow()
{
if ( IsFloatingMode() )
{
- Show( FALSE, SHOW_NOFOCUSCHANGE );
- SetFloatingMode( FALSE );
+ Show( sal_False, SHOW_NOFOCUSCHANGE );
+ SetFloatingMode( sal_False );
}
delete mpImplData;
}
@@ -494,7 +494,7 @@ void DockingWindow::Tracking( const TrackingEvent& rTEvt )
{
if ( rTEvt.IsTrackingEnded() )
{
- mbDocking = FALSE;
+ mbDocking = sal_False;
if ( mbDragFull )
{
// Bei Abbruch alten Zustand wieder herstellen
@@ -510,9 +510,9 @@ void DockingWindow::Tracking( const TrackingEvent& rTEvt )
HideTracking();
if ( rTEvt.IsTrackingCanceled() )
{
- mbDockCanceled = TRUE;
+ mbDockCanceled = sal_True;
EndDocking( Rectangle( Point( mnTrackX, mnTrackY ), Size( mnTrackWidth, mnTrackHeight ) ), mbLastFloatMode );
- mbDockCanceled = FALSE;
+ mbDockCanceled = sal_False;
}
else
EndDocking( Rectangle( Point( mnTrackX, mnTrackY ), Size( mnTrackWidth, mnTrackHeight ) ), mbLastFloatMode );
@@ -542,9 +542,9 @@ void DockingWindow::Tracking( const TrackingEvent& rTEvt )
aFramePos.Y() += maMouseOff.Y();
if ( mbDragFull )
StartDocking();
- BOOL bFloatMode = Docking( aFramePos, aTrackRect );
- mbDockPrevented = FALSE;
- mbFloatPrevented = FALSE;
+ sal_Bool bFloatMode = Docking( aFramePos, aTrackRect );
+ mbDockPrevented = sal_False;
+ mbFloatPrevented = sal_False;
if ( mbLastFloatMode != bFloatMode )
{
if ( bFloatMode )
@@ -582,7 +582,7 @@ void DockingWindow::Tracking( const TrackingEvent& rTEvt )
}
else
{
- USHORT nTrackStyle;
+ sal_uInt16 nTrackStyle;
if ( bFloatMode )
nTrackStyle = SHOWTRACK_BIG;
else
@@ -622,7 +622,7 @@ long DockingWindow::Notify( NotifyEvent& rNEvt )
if ( pMEvt->IsMod1() && (pMEvt->GetClicks() == 2) )
{
SetFloatingMode( !IsFloatingMode() );
- return TRUE;
+ return sal_True;
}
else if ( pMEvt->GetClicks() == 1 )
{
@@ -640,7 +640,7 @@ long DockingWindow::Notify( NotifyEvent& rNEvt )
}
ImplStartDocking( aPos );
}
- return TRUE;
+ return sal_True;
}
}
}
@@ -651,7 +651,7 @@ long DockingWindow::Notify( NotifyEvent& rNEvt )
rKey.IsShift() && rKey.IsMod1() )
{
SetFloatingMode( !IsFloatingMode() );
- return TRUE;
+ return sal_True;
}
}
}
@@ -663,28 +663,28 @@ long DockingWindow::Notify( NotifyEvent& rNEvt )
void DockingWindow::StartDocking()
{
- mbDocking = TRUE;
+ mbDocking = sal_True;
}
// -----------------------------------------------------------------------
-BOOL DockingWindow::Docking( const Point&, Rectangle& )
+sal_Bool DockingWindow::Docking( const Point&, Rectangle& )
{
return IsFloatingMode();
}
// -----------------------------------------------------------------------
-void DockingWindow::EndDocking( const Rectangle& rRect, BOOL bFloatMode )
+void DockingWindow::EndDocking( const Rectangle& rRect, sal_Bool bFloatMode )
{
if ( !IsDockingCanceled() )
{
- BOOL bShow = FALSE;
+ sal_Bool bShow = sal_False;
if ( bFloatMode != IsFloatingMode() )
{
- Show( FALSE, SHOW_NOFOCUSCHANGE );
+ Show( sal_False, SHOW_NOFOCUSCHANGE );
SetFloatingMode( bFloatMode );
- bShow = TRUE;
+ bShow = sal_True;
if ( bFloatMode && mpFloatWin )
mpFloatWin->SetPosSizePixel( rRect.TopLeft(), rRect.GetSize() );
}
@@ -698,32 +698,32 @@ void DockingWindow::EndDocking( const Rectangle& rRect, BOOL bFloatMode )
if ( bShow )
Show();
}
- mbDocking = FALSE;
+ mbDocking = sal_False;
}
// -----------------------------------------------------------------------
-BOOL DockingWindow::PrepareToggleFloatingMode()
+sal_Bool DockingWindow::PrepareToggleFloatingMode()
{
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL DockingWindow::Close()
+sal_Bool DockingWindow::Close()
{
ImplDelData aDelData;
ImplAddDel( &aDelData );
ImplCallEventListeners( VCLEVENT_WINDOW_CLOSE );
if ( aDelData.IsDelete() )
- return FALSE;
+ return sal_False;
ImplRemoveDel( &aDelData );
if ( mpWindowImpl->mxWindowPeer.is() && IsCreatedWithToolkit() )
- return FALSE;
+ return sal_False;
- Show( FALSE, SHOW_NOFOCUSCHANGE );
- return TRUE;
+ Show( sal_False, SHOW_NOFOCUSCHANGE );
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -734,7 +734,7 @@ void DockingWindow::ToggleFloatingMode()
// -----------------------------------------------------------------------
-void DockingWindow::TitleButtonClick( USHORT )
+void DockingWindow::TitleButtonClick( sal_uInt16 )
{
}
@@ -791,7 +791,7 @@ void DockingWindow::DataChanged( const DataChangedEvent& rDCEvt )
// -----------------------------------------------------------------------
-void DockingWindow::ShowTitleButton( USHORT nButton, BOOL bVisible )
+void DockingWindow::ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible )
{
if ( mpFloatWin )
mpFloatWin->ShowTitleButton( nButton, bVisible );
@@ -806,7 +806,7 @@ void DockingWindow::ShowTitleButton( USHORT nButton, BOOL bVisible )
// -----------------------------------------------------------------------
-BOOL DockingWindow::IsTitleButtonVisible( USHORT nButton ) const
+sal_Bool DockingWindow::IsTitleButtonVisible( sal_uInt16 nButton ) const
{
if ( mpFloatWin )
return mpFloatWin->IsTitleButtonVisible( nButton );
@@ -821,7 +821,7 @@ BOOL DockingWindow::IsTitleButtonVisible( USHORT nButton ) const
// -----------------------------------------------------------------------
-void DockingWindow::SetFloatingMode( BOOL bFloatMode )
+void DockingWindow::SetFloatingMode( sal_Bool bFloatMode )
{
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
if( pWrapper )
@@ -833,11 +833,11 @@ void DockingWindow::SetFloatingMode( BOOL bFloatMode )
{
if ( PrepareToggleFloatingMode() ) // changes to floating mode can be vetoed
{
- BOOL bVisible = IsVisible();
+ sal_Bool bVisible = IsVisible();
if ( bFloatMode )
{
- Show( FALSE, SHOW_NOFOCUSCHANGE );
+ Show( sal_False, SHOW_NOFOCUSCHANGE );
maDockPos = Window::GetPosPixel();
@@ -886,7 +886,7 @@ void DockingWindow::SetFloatingMode( BOOL bFloatMode )
}
else
{
- Show( FALSE, SHOW_NOFOCUSCHANGE );
+ Show( sal_False, SHOW_NOFOCUSCHANGE );
// FloatingDaten wird im FloatingWindow speichern
maFloatPos = mpFloatWin->GetPosPixel();
@@ -967,7 +967,7 @@ void DockingWindow::SetTabStop()
void DockingWindow::SetPosSizePixel( long nX, long nY,
long nWidth, long nHeight,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
if( pWrapper )
@@ -1093,7 +1093,7 @@ Point DockingWindow::GetFloatingPos() const
return maFloatPos;
}
-BOOL DockingWindow::IsFloatingMode() const
+sal_Bool DockingWindow::IsFloatingMode() const
{
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
if( pWrapper )
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 9896333174ce..2c21ec7a83d1 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -75,9 +75,9 @@ void FloatingWindow::ImplInit( Window* pParent, WinBits nStyle )
{
mpImplData = new ImplData;
- mpWindowImpl->mbFloatWin = TRUE;
- mbInCleanUp = FALSE;
- mbGrabFocus = FALSE;
+ mpWindowImpl->mbFloatWin = sal_True;
+ mbInCleanUp = sal_False;
+ mbGrabFocus = sal_False;
DBG_ASSERT( pParent, "FloatWindow::FloatingWindow(): - pParent == NULL!" );
@@ -89,7 +89,7 @@ void FloatingWindow::ImplInit( Window* pParent, WinBits nStyle )
// no Border, then we dont need a border window
if ( !nStyle )
{
- mpWindowImpl->mbOverlapWin = TRUE;
+ mpWindowImpl->mbOverlapWin = sal_True;
nStyle |= WB_DIALOGCONTROL;
SystemWindow::ImplInit( pParent, nStyle, NULL );
}
@@ -104,14 +104,14 @@ void FloatingWindow::ImplInit( Window* pParent, WinBits nStyle )
WinBits nFloatWinStyle = nStyle;
// #99154# floaters are not closeable by default anymore, eg fullscreen floater
// nFloatWinStyle |= WB_CLOSEABLE;
- mpWindowImpl->mbFrame = TRUE;
- mpWindowImpl->mbOverlapWin = TRUE;
+ mpWindowImpl->mbFrame = sal_True;
+ mpWindowImpl->mbOverlapWin = sal_True;
SystemWindow::ImplInit( pParent, nFloatWinStyle & ~WB_BORDER, NULL );
}
else
{
ImplBorderWindow* pBorderWin;
- USHORT nBorderStyle = BORDERWINDOW_STYLE_BORDER | BORDERWINDOW_STYLE_FLOAT;
+ sal_uInt16 nBorderStyle = BORDERWINDOW_STYLE_BORDER | BORDERWINDOW_STYLE_FLOAT;
if( nStyle & WB_OWNERDRAWDECORATION ) nBorderStyle |= BORDERWINDOW_STYLE_FRAME;
else nBorderStyle |= BORDERWINDOW_STYLE_OVERLAP;
@@ -125,7 +125,7 @@ void FloatingWindow::ImplInit( Window* pParent, WinBits nStyle )
SystemWindow::ImplInit( pBorderWin, nStyle & ~WB_BORDER, NULL );
pBorderWin->mpWindowImpl->mpClientWindow = this;
pBorderWin->GetBorder( mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder );
- pBorderWin->SetDisplayActive( TRUE );
+ pBorderWin->SetDisplayActive( sal_True );
mpWindowImpl->mpBorderWindow = pBorderWin;
mpWindowImpl->mpRealParent = pParent;
}
@@ -138,11 +138,11 @@ void FloatingWindow::ImplInit( Window* pParent, WinBits nStyle )
mnTitle = (nStyle & (WB_MOVEABLE | WB_POPUP)) ? FLOATWIN_TITLE_NORMAL : FLOATWIN_TITLE_NONE;
mnOldTitle = mnTitle;
mnPopupModeFlags = 0;
- mbInPopupMode = FALSE;
- mbPopupMode = FALSE;
- mbPopupModeCanceled = FALSE;
- mbPopupModeTearOff = FALSE;
- mbMouseDown = FALSE;
+ mbInPopupMode = sal_False;
+ mbPopupMode = sal_False;
+ mbPopupModeCanceled = sal_False;
+ mbPopupModeTearOff = sal_False;
+ mbMouseDown = sal_False;
ImplInitSettings();
}
@@ -191,7 +191,7 @@ void FloatingWindow::ImplLoadRes( const ResId& rResId )
{
SystemWindow::ImplLoadRes( rResId );
- ULONG nObjMask = ReadLongRes();
+ sal_uLong nObjMask = ReadLongRes();
if ( (RSC_FLOATINGWINDOW_WHMAPMODE | RSC_FLOATINGWINDOW_WIDTH |
RSC_FLOATINGWINDOW_HEIGHT) & nObjMask )
@@ -237,7 +237,7 @@ FloatingWindow::~FloatingWindow()
// -----------------------------------------------------------------------
-Point FloatingWindow::CalcFloatingPosition( Window* pWindow, const Rectangle& rRect, ULONG nFlags, USHORT& rArrangeIndex )
+Point FloatingWindow::CalcFloatingPosition( Window* pWindow, const Rectangle& rRect, sal_uLong nFlags, sal_uInt16& rArrangeIndex )
{
return ImplCalcPos( pWindow, rRect, nFlags, rArrangeIndex );
}
@@ -245,8 +245,8 @@ Point FloatingWindow::CalcFloatingPosition( Window* pWindow, const Rectangle& rR
// -----------------------------------------------------------------------
Point FloatingWindow::ImplCalcPos( Window* pWindow,
- const Rectangle& rRect, ULONG nFlags,
- USHORT& rArrangeIndex )
+ const Rectangle& rRect, sal_uLong nFlags,
+ sal_uInt16& rArrangeIndex )
{
// Fenster-Position ermitteln
Point aPos;
@@ -262,7 +262,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
Rectangle normRect( rRect ); // rRect is already relative to top-level window
normRect.SetPos( pW->ScreenToOutputPixel( normRect.TopLeft() ) );
- BOOL bRTL = Application::GetSettings().GetLayoutRTL();
+ sal_Bool bRTL = Application::GetSettings().GetLayoutRTL();
Rectangle devRect( pW->OutputToAbsoluteScreenPixel( normRect.TopLeft() ),
pW->OutputToAbsoluteScreenPixel( normRect.BottomRight() ) );
@@ -276,9 +276,9 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
Application::GetBestScreen( bRTL ? devRectRTL : devRect ) );
- USHORT nArrangeAry[5];
- USHORT nArrangeIndex;
- BOOL bBreak;
+ sal_uInt16 nArrangeAry[5];
+ sal_uInt16 nArrangeIndex;
+ sal_Bool bBreak;
Point e1,e2; // the common edge between the item rect and the floating window
if ( nFlags & FLOATWIN_POPUPMODE_LEFT )
@@ -320,7 +320,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
for ( ; nArrangeIndex < 5; nArrangeIndex++ )
{
- bBreak = TRUE;
+ bBreak = sal_True;
switch ( nArrangeAry[nArrangeIndex] )
{
@@ -331,12 +331,12 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
if( bRTL ) // --- RTL --- we're comparing screen coordinates here
{
if( (devRectRTL.Right()+aSize.Width()) > aScreenRect.Right() )
- bBreak = FALSE;
+ bBreak = sal_False;
}
else
{
if ( aPos.X() < aScreenRect.Left() )
- bBreak = FALSE;
+ bBreak = sal_False;
}
if( bBreak )
{
@@ -355,12 +355,12 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
if( bRTL ) // --- RTL --- we're comparing screen coordinates here
{
if( (devRectRTL.Left() - aSize.Width()) < aScreenRect.Left() )
- bBreak = FALSE;
+ bBreak = sal_False;
}
else
{
if ( aPos.X()+aSize.Width() > aScreenRect.Right() )
- bBreak = FALSE;
+ bBreak = sal_False;
}
if( bBreak )
{
@@ -377,7 +377,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
aPos.X() = devRect.Left();
aPos.Y() = devRect.Top()-aSize.Height()+1;
if ( aPos.Y() < aScreenRect.Top() )
- bBreak = FALSE;
+ bBreak = sal_False;
if( bBreak )
{
e1 = devRect.TopLeft();
@@ -392,7 +392,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
case FLOATWIN_POPUPMODE_DOWN:
aPos = devRect.BottomLeft();
if ( aPos.Y()+aSize.Height() > aScreenRect.Bottom() )
- bBreak = FALSE;
+ bBreak = sal_False;
if( bBreak )
{
e1 = devRect.BottomLeft();
@@ -463,7 +463,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
// -----------------------------------------------------------------------
-FloatingWindow* FloatingWindow::ImplFloatHitTest( Window* pReference, const Point& rPos, USHORT& rHitTest )
+FloatingWindow* FloatingWindow::ImplFloatHitTest( Window* pReference, const Point& rPos, sal_uInt16& rHitTest )
{
FloatingWindow* pWin = this;
@@ -538,20 +538,20 @@ FloatingWindow* FloatingWindow::ImplFindLastLevelFloat()
// -----------------------------------------------------------------------
-BOOL FloatingWindow::ImplIsFloatPopupModeWindow( const Window* pWindow )
+sal_Bool FloatingWindow::ImplIsFloatPopupModeWindow( const Window* pWindow )
{
FloatingWindow* pWin = this;
do
{
if ( pWin->mpFirstPopupModeWin == pWindow )
- return TRUE;
+ return sal_True;
pWin = pWin->mpNextFloat;
}
while ( pWin );
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -560,7 +560,7 @@ IMPL_LINK( FloatingWindow, ImplEndPopupModeHdl, void*, EMPTYARG )
{
mnPostId = 0;
mnPopupModeFlags = 0;
- mbPopupMode = FALSE;
+ mbPopupMode = sal_False;
PopupModeEnd();
return 0;
}
@@ -577,12 +577,12 @@ long FloatingWindow::Notify( NotifyEvent& rNEvt )
{
const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
KeyCode aKeyCode = pKEvt->GetKeyCode();
- USHORT nKeyCode = aKeyCode.GetCode();
+ sal_uInt16 nKeyCode = aKeyCode.GetCode();
if ( (nKeyCode == KEY_ESCAPE) && (GetStyle() & WB_CLOSEABLE) )
{
Close();
- return TRUE;
+ return sal_True;
}
}
}
@@ -622,7 +622,7 @@ void FloatingWindow::DataChanged( const DataChangedEvent& rDCEvt )
void FloatingWindow::ImplCallPopupModeEnd()
{
// PopupMode wurde beendet
- mbInPopupMode = FALSE;
+ mbInPopupMode = sal_False;
// Handler asyncron rufen
if ( !mnPostId )
@@ -638,13 +638,13 @@ void FloatingWindow::PopupModeEnd()
// -----------------------------------------------------------------------
-void FloatingWindow::SetTitleType( USHORT nTitle )
+void FloatingWindow::SetTitleType( sal_uInt16 nTitle )
{
if ( (mnTitle != nTitle) && mpWindowImpl->mpBorderWindow )
{
mnTitle = nTitle;
Size aOutSize = GetOutputSizePixel();
- USHORT nTitleStyle;
+ sal_uInt16 nTitleStyle;
if ( nTitle == FLOATWIN_TITLE_NORMAL )
nTitleStyle = BORDERWINDOW_TITLE_SMALL;
else if ( nTitle == FLOATWIN_TITLE_TEAROFF )
@@ -660,11 +660,11 @@ void FloatingWindow::SetTitleType( USHORT nTitle )
// -----------------------------------------------------------------------
-void FloatingWindow::StartPopupMode( const Rectangle& rRect, ULONG nFlags )
+void FloatingWindow::StartPopupMode( const Rectangle& rRect, sal_uLong nFlags )
{
// avoid flickering
if ( IsVisible() )
- Show( FALSE, SHOW_NOFOCUSCHANGE );
+ Show( sal_False, SHOW_NOFOCUSCHANGE );
if ( IsRollUp() )
RollDown();
@@ -688,7 +688,7 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, ULONG nFlags )
nFlags |= FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE;
// compute window position according to flags and arrangement
- USHORT nArrangeIndex;
+ sal_uInt16 nArrangeIndex;
SetPosPixel( ImplCalcPos( this, rRect, nFlags, nArrangeIndex ) );
// set data and display window
@@ -709,11 +709,11 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, ULONG nFlags )
maFloatRect.Right() += 2;
maFloatRect.Bottom() += 2;
mnPopupModeFlags = nFlags;
- mbInPopupMode = TRUE;
- mbPopupMode = TRUE;
- mbPopupModeCanceled = FALSE;
- mbPopupModeTearOff = FALSE;
- mbMouseDown = FALSE;
+ mbInPopupMode = sal_True;
+ mbPopupMode = sal_True;
+ mbPopupModeCanceled = sal_False;
+ mbPopupModeTearOff = sal_False;
+ mbMouseDown = sal_False;
mbOldSaveBackMode = IsSaveBackgroundEnabled();
EnableSaveBackground();
@@ -725,22 +725,22 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, ULONG nFlags )
if( nFlags & FLOATWIN_POPUPMODE_GRABFOCUS )
{
// force key input even without focus (useful for menues)
- mbGrabFocus = TRUE;
+ mbGrabFocus = sal_True;
}
- Show( TRUE, SHOW_NOACTIVATE );
+ Show( sal_True, SHOW_NOACTIVATE );
}
// -----------------------------------------------------------------------
-void FloatingWindow::StartPopupMode( ToolBox* pBox, ULONG nFlags )
+void FloatingWindow::StartPopupMode( ToolBox* pBox, sal_uLong nFlags )
{
// get selected button
- USHORT nItemId = pBox->GetDownItemId();
+ sal_uInt16 nItemId = pBox->GetDownItemId();
if ( !nItemId )
return;
mpImplData->mpBox = pBox;
- pBox->ImplFloatControl( TRUE, this );
+ pBox->ImplFloatControl( sal_True, this );
// retrieve some data from the ToolBox
Rectangle aRect = pBox->GetItemRect( nItemId );
@@ -779,14 +779,14 @@ void FloatingWindow::StartPopupMode( ToolBox* pBox, ULONG nFlags )
// -----------------------------------------------------------------------
-void FloatingWindow::ImplEndPopupMode( USHORT nFlags, ULONG nFocusId )
+void FloatingWindow::ImplEndPopupMode( sal_uInt16 nFlags, sal_uLong nFocusId )
{
if ( !mbInPopupMode )
return;
ImplSVData* pSVData = ImplGetSVData();
- mbInCleanUp = TRUE; // prevent killing this window due to focus change while working with it
+ mbInCleanUp = sal_True; // prevent killing this window due to focus change while working with it
// Bei allen nachfolgenden PopupMode-Fenster den Modus auch beenden
while ( pSVData->maWinData.mpFirstFloat && pSVData->maWinData.mpFirstFloat != this )
@@ -797,13 +797,13 @@ void FloatingWindow::ImplEndPopupMode( USHORT nFlags, ULONG nFocusId )
pSVData->maWinData.mpFirstFloat = mpNextFloat;
mpNextFloat = NULL;
- ULONG nPopupModeFlags = mnPopupModeFlags;
+ sal_uLong nPopupModeFlags = mnPopupModeFlags;
// Wenn nicht abgerissen wurde, dann Fenster wieder Hiden
if ( !(nFlags & FLOATWIN_POPUPMODEEND_TEAROFF) ||
!(nPopupModeFlags & FLOATWIN_POPUPMODE_ALLOWTEAROFF) )
{
- Show( FALSE, SHOW_NOFOCUSCHANGE );
+ Show( sal_False, SHOW_NOFOCUSCHANGE );
// Focus evt. auf ein entsprechendes FloatingWindow weiterschalten
if ( nFocusId )
@@ -811,13 +811,13 @@ void FloatingWindow::ImplEndPopupMode( USHORT nFlags, ULONG nFocusId )
else if ( pSVData->maWinData.mpFocusWin && pSVData->maWinData.mpFirstFloat &&
ImplIsWindowOrChild( pSVData->maWinData.mpFocusWin ) )
pSVData->maWinData.mpFirstFloat->GrabFocus();
- mbPopupModeTearOff = FALSE;
+ mbPopupModeTearOff = sal_False;
}
else
{
- mbPopupModeTearOff = TRUE;
+ mbPopupModeTearOff = sal_True;
if ( nFocusId )
- Window::EndSaveFocus( nFocusId, FALSE );
+ Window::EndSaveFocus( nFocusId, sal_False );
}
EnableSaveBackground( mbOldSaveBackMode );
@@ -829,7 +829,7 @@ void FloatingWindow::ImplEndPopupMode( USHORT nFlags, ULONG nFocusId )
// ToolBox wieder auf normal schalten
if ( mpImplData->mpBox )
{
- mpImplData->mpBox->ImplFloatControl( FALSE, this );
+ mpImplData->mpBox->ImplFloatControl( sal_False, this );
mpImplData->mpBox = NULL;
}
@@ -850,12 +850,12 @@ void FloatingWindow::ImplEndPopupMode( USHORT nFlags, ULONG nFocusId )
}
}
- mbInCleanUp = FALSE;
+ mbInCleanUp = sal_False;
}
// -----------------------------------------------------------------------
-void FloatingWindow::EndPopupMode( USHORT nFlags )
+void FloatingWindow::EndPopupMode( sal_uInt16 nFlags )
{
ImplEndPopupMode( nFlags );
}
diff --git a/vcl/source/window/javachild.cxx b/vcl/source/window/javachild.cxx
index 3b26e92829a7..1f15019999e5 100644
--- a/vcl/source/window/javachild.cxx
+++ b/vcl/source/window/javachild.cxx
@@ -3,10 +3,13 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
+ * $RCSfile: javachild.cxx,v $
+ * $Revision: 1.12 $
+ *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -29,30 +32,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-
-#ifdef SOLAR_JAVA
-#include <jni.h>
-#endif
-#include <comphelper/processfactory.hxx>
-
-#include <vcl/unohelp.hxx>
-#include <rtl/process.h>
-#include <rtl/ref.hxx>
-#include <jvmaccess/virtualmachine.hxx>
-#include <com/sun/star/java/XJavaVM.hpp>
-#include <com/sun/star/java/XJavaThreadRegister_11.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
-#include <svsys.h>
-#include <vcl/salinst.hxx>
-#include <vcl/salframe.hxx>
-#include <vcl/window.hxx>
-#include <vcl/salobj.hxx>
#include <vcl/javachild.hxx>
-#include <vcl/svdata.hxx>
-#include <vcl/sysdata.hxx>
-
-using namespace ::com::sun::star;
// -------------------
// - JavaChildWindow -
@@ -78,131 +58,9 @@ JavaChildWindow::~JavaChildWindow()
// -----------------------------------------------------------------------
-void JavaChildWindow::implTestJavaException( void* pEnv )
-{
-#ifdef SOLAR_JAVA
- JNIEnv* pJavaEnv = reinterpret_cast< JNIEnv* >( pEnv );
- jthrowable jtThrowable = pJavaEnv->ExceptionOccurred();
-
- if( jtThrowable )
- { // is it a java exception ?
-#if OSL_DEBUG_LEVEL > 1
- pJavaEnv->ExceptionDescribe();
-#endif // OSL_DEBUG_LEVEL > 1
- pJavaEnv->ExceptionClear();
-
- jclass jcThrowable = pJavaEnv->FindClass("java/lang/Throwable");
- jmethodID jmThrowable_getMessage = pJavaEnv->GetMethodID(jcThrowable, "getMessage", "()Ljava/lang/String;");
- jstring jsMessage = (jstring) pJavaEnv->CallObjectMethod(jtThrowable, jmThrowable_getMessage);
- ::rtl::OUString ouMessage;
-
- if(jsMessage)
- {
- const jchar * jcMessage = pJavaEnv->GetStringChars(jsMessage, NULL);
- ouMessage = ::rtl::OUString(jcMessage);
- pJavaEnv->ReleaseStringChars(jsMessage, jcMessage);
- }
-
- throw uno::RuntimeException(ouMessage, uno::Reference<uno::XInterface>());
- }
-#endif // SOLAR_JAVA
-}
-
-// -----------------------------------------------------------------------
-
sal_IntPtr JavaChildWindow::getParentWindowHandleForJava()
{
- sal_IntPtr nRet = 0;
-
-#if defined WNT
- nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->hWnd );
-#elif defined QUARTZ
- // FIXME: this is wrong
- nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->pView );
-#elif defined UNX
-#ifdef SOLAR_JAVA
- uno::Reference< lang::XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
-
- if( xFactory.is() && ( GetSystemData()->aWindow > 0 ) )
- {
- try
- {
- ::rtl::Reference< ::jvmaccess::VirtualMachine > xVM;
- uno::Reference< java::XJavaVM > xJavaVM( xFactory->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.java.JavaVirtualMachine") ) ), uno::UNO_QUERY );
- uno::Sequence< sal_Int8 > aProcessID( 17 );
-
- rtl_getGlobalProcessId( (sal_uInt8*) aProcessID.getArray() );
- aProcessID[ 16 ] = 0;
- OSL_ENSURE(sizeof (sal_Int64) >= sizeof (jvmaccess::VirtualMachine *), "Pointer cannot be represented as sal_Int64");
- sal_Int64 nPointer = reinterpret_cast< sal_Int64 >( static_cast< jvmaccess::VirtualMachine * >(0));
- xJavaVM->getJavaVM(aProcessID) >>= nPointer;
- xVM = reinterpret_cast< jvmaccess::VirtualMachine * >(nPointer);
-
- if( xVM.is() )
- {
- try
- {
- ::jvmaccess::VirtualMachine::AttachGuard aVMAttachGuard( xVM );
- JNIEnv* pEnv = aVMAttachGuard.getEnvironment();
-
- jclass jcToolkit = pEnv->FindClass("java/awt/Toolkit");
- implTestJavaException(pEnv);
-
- jmethodID jmToolkit_getDefaultToolkit = pEnv->GetStaticMethodID( jcToolkit, "getDefaultToolkit", "()Ljava/awt/Toolkit;" );
- implTestJavaException(pEnv);
-
- pEnv->CallStaticObjectMethod(jcToolkit, jmToolkit_getDefaultToolkit);
- implTestJavaException(pEnv);
-
- jclass jcMotifAppletViewer = pEnv->FindClass("sun/plugin/navig/motif/MotifAppletViewer");
- if( pEnv->ExceptionOccurred() )
- {
- pEnv->ExceptionClear();
-
- jcMotifAppletViewer = pEnv->FindClass( "sun/plugin/viewer/MNetscapePluginContext");
- implTestJavaException(pEnv);
- }
-
- jclass jcClassLoader = pEnv->FindClass("java/lang/ClassLoader");
- implTestJavaException(pEnv);
-
- jmethodID jmClassLoader_loadLibrary = pEnv->GetStaticMethodID( jcClassLoader, "loadLibrary", "(Ljava/lang/Class;Ljava/lang/String;Z)V");
- implTestJavaException(pEnv);
-
- jstring jsplugin = pEnv->NewStringUTF("javaplugin_jni");
- implTestJavaException(pEnv);
-
- pEnv->CallStaticVoidMethod(jcClassLoader, jmClassLoader_loadLibrary, jcMotifAppletViewer, jsplugin, JNI_FALSE);
- implTestJavaException(pEnv);
-
- jmethodID jmMotifAppletViewer_getWidget = pEnv->GetStaticMethodID( jcMotifAppletViewer, "getWidget", "(IIIII)I" );
- implTestJavaException(pEnv);
-
- const Size aSize( GetOutputSizePixel() );
- jint ji_widget = pEnv->CallStaticIntMethod( jcMotifAppletViewer, jmMotifAppletViewer_getWidget,
- GetSystemData()->aWindow, 0, 0, aSize.Width(), aSize.Height() );
- implTestJavaException(pEnv);
-
- nRet = static_cast< sal_IntPtr >( ji_widget );
- }
- catch( uno::RuntimeException& )
- {
- }
-
- if( !nRet )
- nRet = static_cast< sal_IntPtr >( GetSystemData()->aWindow );
- }
- }
- catch( ... )
- {
- }
- }
-#endif // SOLAR_JAVA
-#else // WNT || QUARTZ || UNX
- // TBD
-#endif
-
- return nRet;
+ return SystemChildWindow::GetParentWindowHandle( sal_True );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/keycod.cxx b/vcl/source/window/keycod.cxx
index 575b8022b739..05370f3a029f 100644
--- a/vcl/source/window/keycod.cxx
+++ b/vcl/source/window/keycod.cxx
@@ -41,7 +41,7 @@
// =======================================================================
-static USHORT aImplKeyFuncTab[(KEYFUNC_FRONT+1)*4] =
+static sal_uInt16 aImplKeyFuncTab[(KEYFUNC_FRONT+1)*4] =
{
0, 0, 0, 0, // KEYFUNC_DONTKNOW
KEY_N | KEY_MOD1, 0, 0, 0, // KEYFUNC_NEW
@@ -66,9 +66,9 @@ static USHORT aImplKeyFuncTab[(KEYFUNC_FRONT+1)*4] =
// -----------------------------------------------------------------------
-void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT& rCode3, USHORT& rCode4 )
+void ImplGetKeyCode( KeyFuncType eFunc, sal_uInt16& rCode1, sal_uInt16& rCode2, sal_uInt16& rCode3, sal_uInt16& rCode4 )
{
- USHORT nIndex = (USHORT)eFunc;
+ sal_uInt16 nIndex = (sal_uInt16)eFunc;
nIndex *= 4;
rCode1 = aImplKeyFuncTab[nIndex];
rCode2 = aImplKeyFuncTab[nIndex+1];
@@ -80,7 +80,7 @@ void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT&
KeyCode::KeyCode( KeyFuncType eFunction )
{
- USHORT nDummy;
+ sal_uInt16 nDummy;
ImplGetKeyCode( eFunction, nCode, nDummy, nDummy, nDummy );
eFunc = eFunction;
}
@@ -96,18 +96,18 @@ KeyCode::KeyCode( const ResId& rResId )
{
pResMgr->Increment( sizeof( RSHEADER_TYPE ) );
- ULONG nKeyCode = pResMgr->ReadLong();
- ULONG nModifier = pResMgr->ReadLong();
- ULONG nKeyFunc = pResMgr->ReadLong();
+ sal_uLong nKeyCode = pResMgr->ReadLong();
+ sal_uLong nModifier = pResMgr->ReadLong();
+ sal_uLong nKeyFunc = pResMgr->ReadLong();
eFunc = (KeyFuncType)nKeyFunc;
if ( eFunc != KEYFUNC_DONTKNOW )
{
- USHORT nDummy;
+ sal_uInt16 nDummy;
ImplGetKeyCode( eFunc, nCode, nDummy, nDummy, nDummy );
}
else
- nCode = sal::static_int_cast<USHORT>(nKeyCode | nModifier);
+ nCode = sal::static_int_cast<sal_uInt16>(nKeyCode | nModifier);
}
}
@@ -136,15 +136,15 @@ KeyFuncType KeyCode::GetFunction() const
if ( eFunc != KEYFUNC_DONTKNOW )
return eFunc;
- USHORT nCompCode = GetModifier() | GetCode();
+ sal_uInt16 nCompCode = GetModifier() | GetCode();
if ( nCompCode )
{
- for ( USHORT i = (USHORT)KEYFUNC_NEW; i < (USHORT)KEYFUNC_FRONT; i++ )
+ for ( sal_uInt16 i = (sal_uInt16)KEYFUNC_NEW; i < (sal_uInt16)KEYFUNC_FRONT; i++ )
{
- USHORT nKeyCode1;
- USHORT nKeyCode2;
- USHORT nKeyCode3;
- USHORT nKeyCode4;
+ sal_uInt16 nKeyCode1;
+ sal_uInt16 nKeyCode2;
+ sal_uInt16 nKeyCode3;
+ sal_uInt16 nKeyCode4;
ImplGetKeyCode( (KeyFuncType)i, nKeyCode1, nKeyCode2, nKeyCode3, nKeyCode4 );
if ( (nCompCode == nKeyCode1) || (nCompCode == nKeyCode2) || (nCompCode == nKeyCode3) || (nCompCode == nKeyCode4) )
return (KeyFuncType)i;
diff --git a/vcl/source/window/keyevent.cxx b/vcl/source/window/keyevent.cxx
index 2677c31cc100..db8144c3d648 100644
--- a/vcl/source/window/keyevent.cxx
+++ b/vcl/source/window/keyevent.cxx
@@ -75,8 +75,8 @@ KeyEvent KeyEvent::LogicalTextDirectionality (TextDirectionality eMode) const
{
KeyEvent aClone(*this);
- USHORT nCode = maKeyCode.GetCode();
- USHORT nMod = maKeyCode.GetAllModifier();
+ sal_uInt16 nCode = maKeyCode.GetCode();
+ sal_uInt16 nMod = maKeyCode.GetAllModifier();
switch (eMode)
{
diff --git a/vcl/source/window/makefile.mk b/vcl/source/window/makefile.mk
index 82ce26f8e78e..1c63376dfda5 100644
--- a/vcl/source/window/makefile.mk
+++ b/vcl/source/window/makefile.mk
@@ -85,6 +85,8 @@ SLOFILES= \
$(SLO)$/winproc.obj \
$(SLO)$/window2.obj \
$(SLO)$/window3.obj \
+ $(SLO)$/window4.obj \
+ $(SLO)$/wpropset.obj \
$(SLO)$/wrkwin.obj
# --- Targets ------------------------------------------------------
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 6d76050623cd..6ab9dda55fc2 100644..100755
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1,3 +1,4 @@
+
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
@@ -80,9 +81,9 @@ namespace vcl
struct MenuLayoutData : public ControlLayoutData
{
- std::vector< USHORT > m_aLineItemIds;
- std::vector< USHORT > m_aLineItemPositions;
- std::map< USHORT, Rectangle > m_aVisibleItemBoundRects;
+ std::vector< sal_uInt16 > m_aLineItemIds;
+ std::vector< sal_uInt16 > m_aLineItemPositions;
+ std::map< sal_uInt16, Rectangle > m_aVisibleItemBoundRects;
};
}
@@ -96,6 +97,7 @@ DBG_NAME( Menu )
#define EXTRASPACEY 2
#define EXTRAITEMHEIGHT 4
+#define GUTTERBORDER 8
// document closer
#define IID_DOCUMENTCLOSE 1
@@ -104,32 +106,32 @@ DBG_NAME( Menu )
#include <xwphook.h>
-// return TRUE if hilite should be executed: left mouse button down
+// return sal_True if hilite should be executed: left mouse button down
// or xwp mouse hook enabled
-static BOOL ImplHilite( const MouseEvent& rMEvt )
+static sal_Bool ImplHilite( const MouseEvent& rMEvt )
{
- static BOOL init = FALSE;
+ static sal_Bool init = sal_False;
static HOOKCONFIG hc;
// read XWP settings at program startup
- if (init == FALSE) {
- BOOL rc;
- ULONG cb = sizeof(HOOKCONFIG);
+ if (init == sal_False) {
+ sal_Bool rc;
+ sal_uLong cb = sizeof(HOOKCONFIG);
memset(&hc, 0, sizeof(HOOKCONFIG));
rc = PrfQueryProfileData( HINI_USER, INIAPP_XWPHOOK, INIKEY_HOOK_CONFIG,
&hc, &cb);
- init = TRUE;
+ init = sal_True;
}
// check mouse left button
if (rMEvt.GetButtons() == MOUSE_LEFT)
- return TRUE;
+ return sal_True;
// return xwp flag
return hc.fSlidingMenus;
}
#endif
-static BOOL ImplAccelDisabled()
+static sal_Bool ImplAccelDisabled()
{
// display of accelerator strings may be suppressed via configuration
static int nAccelDisabled = -1;
@@ -142,12 +144,12 @@ static BOOL ImplAccelDisabled()
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SuppressAccelerators" ) ) );
nAccelDisabled = aStr.equalsIgnoreAsciiCaseAscii( "true" ) ? 1 : 0;
}
- return (nAccelDisabled == 1) ? TRUE : FALSE;
+ return (nAccelDisabled == 1) ? sal_True : sal_False;
}
struct MenuItemData
{
- USHORT nId; // SV Id
+ sal_uInt16 nId; // SV Id
MenuItemType eType; // MenuItem-Type
MenuItemBits nBits; // MenuItem-Bits
Menu* pSubMenu; // Pointer auf das SubMenu
@@ -157,15 +159,15 @@ struct MenuItemData
XubString aTipHelpText; // TipHelp-String (eg, expanded filenames)
XubString aCommandStr; // CommandString
XubString aHelpCommandStr; // Help command string (to reference external help)
- ULONG nHelpId; // Help-Id
- ULONG nUserValue; // User value
+ rtl::OString aHelpId; // Help-Id
+ sal_uLong nUserValue; // User value
Image aImage; // Image
KeyCode aAccelKey; // Accelerator-Key
- BOOL bChecked; // Checked
- BOOL bEnabled; // Enabled
- BOOL bVisible; // Visible (note: this flag will not override MENU_FLAG_HIDEDISABLEDENTRIES when true)
- BOOL bIsTemporary; // Temporary inserted ('No selection possible')
- BOOL bMirrorMode;
+ sal_Bool bChecked; // Checked
+ sal_Bool bEnabled; // Enabled
+ sal_Bool bVisible; // Visible (note: this flag will not override MENU_FLAG_HIDEDISABLEDENTRIES when true)
+ sal_Bool bIsTemporary; // Temporary inserted ('No selection possible')
+ sal_Bool bMirrorMode;
long nItemImageAngle;
Size aSz; // nur temporaer gueltig
XubString aAccessibleName; // accessible name
@@ -210,22 +212,22 @@ public:
MenuItemList() : List( 16, 4 ) {}
~MenuItemList();
- MenuItemData* Insert( USHORT nId, MenuItemType eType, MenuItemBits nBits,
+ MenuItemData* Insert( sal_uInt16 nId, MenuItemType eType, MenuItemBits nBits,
const XubString& rStr, const Image& rImage,
- Menu* pMenu, USHORT nPos );
- void InsertSeparator( USHORT nPos );
- void Remove( USHORT nPos );
+ Menu* pMenu, sal_uInt16 nPos );
+ void InsertSeparator( sal_uInt16 nPos );
+ void Remove( sal_uInt16 nPos );
- MenuItemData* GetData( USHORT nSVId, USHORT& rPos ) const;
- MenuItemData* GetData( USHORT nSVId ) const
- { USHORT nTemp; return GetData( nSVId, nTemp ); }
- MenuItemData* GetDataFromPos( ULONG nPos ) const
+ MenuItemData* GetData( sal_uInt16 nSVId, sal_uInt16& rPos ) const;
+ MenuItemData* GetData( sal_uInt16 nSVId ) const
+ { sal_uInt16 nTemp; return GetData( nSVId, nTemp ); }
+ MenuItemData* GetDataFromPos( sal_uLong nPos ) const
{ return (MenuItemData*)List::GetObject( nPos ); }
- MenuItemData* SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCode, USHORT& rPos, USHORT& nDuplicates, USHORT nCurrentPos ) const;
- USHORT GetItemCount( xub_Unicode cSelectChar ) const;
- USHORT GetItemCount( KeyCode aKeyCode ) const;
+ MenuItemData* SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCode, sal_uInt16& rPos, sal_uInt16& nDuplicates, sal_uInt16 nCurrentPos ) const;
+ sal_uInt16 GetItemCount( xub_Unicode cSelectChar ) const;
+ sal_uInt16 GetItemCount( KeyCode aKeyCode ) const;
uno::Reference< i18n::XCharacterClassification > GetCharClass() const;
};
@@ -234,17 +236,17 @@ public:
MenuItemList::~MenuItemList()
{
- for ( ULONG n = Count(); n; )
+ for ( sal_uLong n = Count(); n; )
{
MenuItemData* pData = GetDataFromPos( --n );
delete pData;
}
}
-MenuItemData* MenuItemList::Insert( USHORT nId, MenuItemType eType,
+MenuItemData* MenuItemList::Insert( sal_uInt16 nId, MenuItemType eType,
MenuItemBits nBits,
const XubString& rStr, const Image& rImage,
- Menu* pMenu, USHORT nPos )
+ Menu* pMenu, sal_uInt16 nPos )
{
MenuItemData* pData = new MenuItemData( rStr, rImage );
pData->nId = nId;
@@ -252,13 +254,12 @@ MenuItemData* MenuItemList::Insert( USHORT nId, MenuItemType eType,
pData->nBits = nBits;
pData->pSubMenu = NULL;
pData->pAutoSubMenu = NULL;
- pData->nHelpId = 0;
pData->nUserValue = 0;
- pData->bChecked = FALSE;
- pData->bEnabled = TRUE;
- pData->bVisible = TRUE;
- pData->bIsTemporary = FALSE;
- pData->bMirrorMode = FALSE;
+ pData->bChecked = sal_False;
+ pData->bEnabled = sal_True;
+ pData->bVisible = sal_True;
+ pData->bIsTemporary = sal_False;
+ pData->bMirrorMode = sal_False;
pData->nItemImageAngle = 0;
SalItemParams aSalMIData;
@@ -276,7 +277,7 @@ MenuItemData* MenuItemList::Insert( USHORT nId, MenuItemType eType,
return pData;
}
-void MenuItemList::InsertSeparator( USHORT nPos )
+void MenuItemList::InsertSeparator( sal_uInt16 nPos )
{
MenuItemData* pData = new MenuItemData;
pData->nId = 0;
@@ -284,13 +285,12 @@ void MenuItemList::InsertSeparator( USHORT nPos )
pData->nBits = 0;
pData->pSubMenu = NULL;
pData->pAutoSubMenu = NULL;
- pData->nHelpId = 0;
pData->nUserValue = 0;
- pData->bChecked = FALSE;
- pData->bEnabled = TRUE;
- pData->bVisible = TRUE;
- pData->bIsTemporary = FALSE;
- pData->bMirrorMode = FALSE;
+ pData->bChecked = sal_False;
+ pData->bEnabled = sal_True;
+ pData->bVisible = sal_True;
+ pData->bIsTemporary = sal_False;
+ pData->bMirrorMode = sal_False;
pData->nItemImageAngle = 0;
SalItemParams aSalMIData;
@@ -307,14 +307,14 @@ void MenuItemList::InsertSeparator( USHORT nPos )
List::Insert( (void*)pData, nPos );
}
-void MenuItemList::Remove( USHORT nPos )
+void MenuItemList::Remove( sal_uInt16 nPos )
{
- MenuItemData* pData = (MenuItemData*)List::Remove( (ULONG)nPos );
+ MenuItemData* pData = (MenuItemData*)List::Remove( (sal_uLong)nPos );
if ( pData )
delete pData;
}
-MenuItemData* MenuItemList::GetData( USHORT nSVId, USHORT& rPos ) const
+MenuItemData* MenuItemList::GetData( sal_uInt16 nSVId, sal_uInt16& rPos ) const
{
rPos = 0;
MenuItemData* pData = (MenuItemData*)GetObject( rPos );
@@ -330,11 +330,11 @@ MenuItemData* MenuItemList::GetData( USHORT nSVId, USHORT& rPos ) const
return NULL;
}
-MenuItemData* MenuItemList::SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCode, USHORT& rPos, USHORT& nDuplicates, USHORT nCurrentPos ) const
+MenuItemData* MenuItemList::SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCode, sal_uInt16& rPos, sal_uInt16& nDuplicates, sal_uInt16 nCurrentPos ) const
{
const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetUILocaleI18nHelper();
- USHORT nListCount = (USHORT)Count();
+ sal_uInt16 nListCount = (sal_uInt16)Count();
// try character code first
nDuplicates = GetItemCount( cSelectChar ); // return number of duplicates
@@ -367,7 +367,7 @@ MenuItemData* MenuItemList::SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCod
MenuItemData* pData = GetDataFromPos( rPos );
if ( pData->bEnabled )
{
- USHORT n = pData->aText.Search( '~' );
+ sal_uInt16 n = pData->aText.Search( '~' );
if ( n != STRING_NOTFOUND )
{
KeyCode mnKeyCode;
@@ -391,13 +391,13 @@ MenuItemData* MenuItemList::SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCod
return NULL;
}
-USHORT MenuItemList::GetItemCount( xub_Unicode cSelectChar ) const
+sal_uInt16 MenuItemList::GetItemCount( xub_Unicode cSelectChar ) const
{
// returns number of entries with same mnemonic
const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetUILocaleI18nHelper();
- USHORT nItems = 0, nPos;
- for ( nPos = (USHORT)Count(); nPos; )
+ sal_uInt16 nItems = 0, nPos;
+ for ( nPos = (sal_uInt16)Count(); nPos; )
{
MenuItemData* pData = GetDataFromPos( --nPos );
if ( pData->bEnabled && rI18nHelper.MatchMnemonic( pData->aText, cSelectChar ) )
@@ -407,7 +407,7 @@ USHORT MenuItemList::GetItemCount( xub_Unicode cSelectChar ) const
return nItems;
}
-USHORT MenuItemList::GetItemCount( KeyCode aKeyCode ) const
+sal_uInt16 MenuItemList::GetItemCount( KeyCode aKeyCode ) const
{
// returns number of entries with same mnemonic
// uses key codes instead of character codes
@@ -416,13 +416,13 @@ USHORT MenuItemList::GetItemCount( KeyCode aKeyCode ) const
if( aKeyCode.GetCode() >= KEY_A && aKeyCode.GetCode() <= KEY_Z )
ascii = sal::static_int_cast<char>('A' + (aKeyCode.GetCode() - KEY_A));
- USHORT nItems = 0, nPos;
- for ( nPos = (USHORT)Count(); nPos; )
+ sal_uInt16 nItems = 0, nPos;
+ for ( nPos = (sal_uInt16)Count(); nPos; )
{
MenuItemData* pData = GetDataFromPos( --nPos );
if ( pData->bEnabled )
{
- USHORT n = pData->aText.Search( '~' );
+ sal_uInt16 n = pData->aText.Search( '~' );
if ( n != STRING_NOTFOUND )
{
KeyCode mnKeyCode;
@@ -464,21 +464,21 @@ private:
Timer aHighlightChangedTimer;
Timer aSubmenuCloseTimer;
Timer aScrollTimer;
- ULONG nSaveFocusId;
+ sal_uLong nSaveFocusId;
// long nStartY;
- USHORT nHighlightedItem; // gehighlightetes/selektiertes Item
- USHORT nMBDownPos;
- USHORT nScrollerHeight;
- USHORT nFirstEntry;
- USHORT nBorder;
- USHORT nPosInParent;
- BOOL bInExecute;
-
- BOOL bScrollMenu;
- BOOL bScrollUp;
- BOOL bScrollDown;
- BOOL bIgnoreFirstMove;
- BOOL bKeyInput;
+ sal_uInt16 nHighlightedItem; // gehighlightetes/selektiertes Item
+ sal_uInt16 nMBDownPos;
+ sal_uInt16 nScrollerHeight;
+ sal_uInt16 nFirstEntry;
+ sal_uInt16 nBorder;
+ sal_uInt16 nPosInParent;
+ sal_Bool bInExecute;
+
+ sal_Bool bScrollMenu;
+ sal_Bool bScrollUp;
+ sal_Bool bScrollDown;
+ sal_Bool bIgnoreFirstMove;
+ sal_Bool bKeyInput;
DECL_LINK( PopupEnd, FloatingWindow* );
DECL_LINK( HighlightChanged, Timer* );
@@ -489,16 +489,16 @@ private:
void StateChanged( StateChangedType nType );
void DataChanged( const DataChangedEvent& rDCEvt );
protected:
- Region ImplCalcClipRegion( BOOL bIncludeLogo = TRUE ) const;
+ Region ImplCalcClipRegion( sal_Bool bIncludeLogo = sal_True ) const;
void ImplInitClipRegion();
- void ImplDrawScroller( BOOL bUp );
+ void ImplDrawScroller( sal_Bool bUp );
using Window::ImplScroll;
void ImplScroll( const Point& rMousePos );
- void ImplScroll( BOOL bUp );
- void ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd = FALSE );
- void ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDown );
+ void ImplScroll( sal_Bool bUp );
+ void ImplCursorUpDown( sal_Bool bUp, sal_Bool bHomeEnd = sal_False );
+ void ImplHighlightItem( const MouseEvent& rMEvt, sal_Bool bMBDown );
long ImplGetStartY() const;
- Rectangle ImplGetItemRect( USHORT nPos );
+ Rectangle ImplGetItemRect( sal_uInt16 nPos );
public:
MenuFloatingWindow( Menu* pMenu, Window* pParent, WinBits nStyle );
@@ -515,27 +515,27 @@ public:
virtual void RequestHelp( const HelpEvent& rHEvt );
virtual void Resize();
- void SetFocusId( ULONG nId ) { nSaveFocusId = nId; }
- ULONG GetFocusId() const { return nSaveFocusId; }
+ void SetFocusId( sal_uLong nId ) { nSaveFocusId = nId; }
+ sal_uLong GetFocusId() const { return nSaveFocusId; }
- void EnableScrollMenu( BOOL b );
- BOOL IsScrollMenu() const { return bScrollMenu; }
- USHORT GetScrollerHeight() const { return nScrollerHeight; }
+ void EnableScrollMenu( sal_Bool b );
+ sal_Bool IsScrollMenu() const { return bScrollMenu; }
+ sal_uInt16 GetScrollerHeight() const { return nScrollerHeight; }
void Execute();
- void StopExecute( ULONG nFocusId = 0 );
+ void StopExecute( sal_uLong nFocusId = 0 );
void EndExecute();
- void EndExecute( USHORT nSelectId );
+ void EndExecute( sal_uInt16 nSelectId );
PopupMenu* GetActivePopup() const { return pActivePopup; }
void KillActivePopup( PopupMenu* pThisOnly = NULL );
- void HighlightItem( USHORT nPos, BOOL bHighlight );
- void ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer );
- USHORT GetHighlightedItem() const { return nHighlightedItem; }
+ void HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight );
+ void ChangeHighlightItem( sal_uInt16 n, sal_Bool bStartPopupTimer );
+ sal_uInt16 GetHighlightedItem() const { return nHighlightedItem; }
- void SetPosInParent( USHORT nPos ) { nPosInParent = nPos; }
- USHORT GetPosInParent() const { return nPosInParent; }
+ void SetPosInParent( sal_uInt16 nPos ) { nPosInParent = nPos; }
+ sal_uInt16 GetPosInParent() const { return nPosInParent; }
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
};
@@ -606,10 +606,10 @@ void DecoToolBox::calcMinSize()
}
else
{
- USHORT nItems = GetItemCount();
- for( USHORT i = 0; i < nItems; i++ )
+ sal_uInt16 nItems = GetItemCount();
+ for( sal_uInt16 i = 0; i < nItems; i++ )
{
- USHORT nId = GetItemId( i );
+ sal_uInt16 nId = GetItemId( i );
aTbx.InsertItem( nId, GetItemImage( nId ) );
}
}
@@ -670,7 +670,7 @@ class MenuBarWindow : public Window
private:
struct AddButtonEntry
{
- USHORT m_nId;
+ sal_uInt16 m_nId;
Link m_aSelectLink;
Link m_aHighlightLink;
@@ -679,25 +679,25 @@ private:
Menu* pMenu;
PopupMenu* pActivePopup;
- USHORT nHighlightedItem;
- ULONG nSaveFocusId;
- BOOL mbAutoPopup;
- BOOL bIgnoreFirstMove;
- BOOL bStayActive;
+ sal_uInt16 nHighlightedItem;
+ sal_uLong nSaveFocusId;
+ sal_Bool mbAutoPopup;
+ sal_Bool bIgnoreFirstMove;
+ sal_Bool bStayActive;
DecoToolBox aCloser;
PushButton aFloatBtn;
PushButton aHideBtn;
- std::map< USHORT, AddButtonEntry > m_aAddButtons;
+ std::map< sal_uInt16, AddButtonEntry > m_aAddButtons;
- void HighlightItem( USHORT nPos, BOOL bHighlight );
- void ChangeHighlightItem( USHORT n, BOOL bSelectPopupEntry, BOOL bAllowRestoreFocus = TRUE, BOOL bDefaultToDocument = TRUE );
+ void HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight );
+ void ChangeHighlightItem( sal_uInt16 n, sal_Bool bSelectPopupEntry, sal_Bool bAllowRestoreFocus = sal_True, sal_Bool bDefaultToDocument = sal_True );
- USHORT ImplFindEntry( const Point& rMousePos ) const;
- void ImplCreatePopup( BOOL bPreSelectFirst );
- BOOL ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu = TRUE );
- Rectangle ImplGetItemRect( USHORT nPos );
+ sal_uInt16 ImplFindEntry( const Point& rMousePos ) const;
+ void ImplCreatePopup( sal_Bool bPreSelectFirst );
+ sal_Bool ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bFromMenu = sal_True );
+ Rectangle ImplGetItemRect( sal_uInt16 nPos );
void ImplInitStyleSettings();
@@ -716,7 +716,7 @@ public:
MenuBarWindow( Window* pParent );
~MenuBarWindow();
- void ShowButtons( BOOL bClose, BOOL bFloat, BOOL bHide );
+ void ShowButtons( sal_Bool bClose, sal_Bool bFloat, sal_Bool bHide );
virtual void MouseMove( const MouseEvent& rMEvt );
virtual void MouseButtonDown( const MouseEvent& rMEvt );
@@ -726,26 +726,26 @@ public:
virtual void Resize();
virtual void RequestHelp( const HelpEvent& rHEvt );
- void SetFocusId( ULONG nId ) { nSaveFocusId = nId; }
- ULONG GetFocusId() const { return nSaveFocusId; }
+ void SetFocusId( sal_uLong nId ) { nSaveFocusId = nId; }
+ sal_uLong GetFocusId() const { return nSaveFocusId; }
void SetMenu( MenuBar* pMenu );
void KillActivePopup();
PopupMenu* GetActivePopup() const { return pActivePopup; }
void PopupClosed( Menu* pMenu );
- USHORT GetHighlightedItem() const { return nHighlightedItem; }
+ sal_uInt16 GetHighlightedItem() const { return nHighlightedItem; }
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
- void SetAutoPopup( BOOL bAuto ) { mbAutoPopup = bAuto; }
+ void SetAutoPopup( sal_Bool bAuto ) { mbAutoPopup = bAuto; }
void ImplLayoutChanged();
Size MinCloseButtonSize();
// add an arbitrary button to the menubar (will appear next to closer)
- USHORT AddMenuBarButton( const Image&, const Link&, const String&, USHORT nPos );
- void SetMenuBarButtonHighlightHdl( USHORT nId, const Link& );
- Rectangle GetMenuBarButtonRectPixel( USHORT nId );
- void RemoveMenuBarButton( USHORT nId );
- bool HandleMenuButtonEvent( USHORT i_nButtonId );
+ sal_uInt16 AddMenuBarButton( const Image&, const Link&, const String&, sal_uInt16 nPos );
+ void SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link& );
+ Rectangle GetMenuBarButtonRectPixel( sal_uInt16 nId );
+ void RemoveMenuBarButton( sal_uInt16 nId );
+ bool HandleMenuButtonEvent( sal_uInt16 i_nButtonId );
};
static void ImplAddNWFSeparator( Window *pThis, const MenubarValue& rMenubarValue )
@@ -775,24 +775,24 @@ static void ImplSetMenuItemData( MenuItemData* pData )
pData->eType = MENUITEM_STRINGIMAGE;
}
-static ULONG ImplChangeTipTimeout( ULONG nTimeout, Window *pWindow )
+static sal_uLong ImplChangeTipTimeout( sal_uLong nTimeout, Window *pWindow )
{
AllSettings aAllSettings( pWindow->GetSettings() );
HelpSettings aHelpSettings( aAllSettings.GetHelpSettings() );
- ULONG nRet = aHelpSettings.GetTipTimeout();
+ sal_uLong nRet = aHelpSettings.GetTipTimeout();
aHelpSettings.SetTipTimeout( nTimeout );
aAllSettings.SetHelpSettings( aHelpSettings );
pWindow->SetSettings( aAllSettings );
return nRet;
}
-static BOOL ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, USHORT nHighlightedItem, const HelpEvent& rHEvt, const Rectangle &rHighlightRect )
+static sal_Bool ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, sal_uInt16 nHighlightedItem, const HelpEvent& rHEvt, const Rectangle &rHighlightRect )
{
if( ! pMenu )
- return FALSE;
+ return sal_False;
- BOOL bDone = FALSE;
- USHORT nId = 0;
+ sal_Bool bDone = sal_False;
+ sal_uInt16 nId = 0;
if ( nHighlightedItem != ITEMPOS_INVALID )
{
@@ -815,23 +815,23 @@ static BOOL ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, USHORT nHighl
else
{
// give user a chance to read the full filename
- ULONG oldTimeout=ImplChangeTipTimeout( 60000, pMenuWindow );
+ sal_uLong oldTimeout=ImplChangeTipTimeout( 60000, pMenuWindow );
// call always, even when strlen==0 to correctly remove tip
Help::ShowQuickHelp( pMenuWindow, aRect, pMenu->GetTipHelpText( nId ) );
ImplChangeTipTimeout( oldTimeout, pMenuWindow );
}
- bDone = TRUE;
+ bDone = sal_True;
}
else if ( ( rHEvt.GetMode() & HELPMODE_QUICK ) && pMenuWindow )
{
Point aPos = rHEvt.GetMousePosPixel();
Rectangle aRect( aPos, Size() );
// give user a chance to read the full filename
- ULONG oldTimeout=ImplChangeTipTimeout( 60000, pMenuWindow );
+ sal_uLong oldTimeout=ImplChangeTipTimeout( 60000, pMenuWindow );
// call always, even when strlen==0 to correctly remove tip
Help::ShowQuickHelp( pMenuWindow, aRect, pMenu->GetTipHelpText( nId ) );
ImplChangeTipTimeout( oldTimeout, pMenuWindow );
- bDone = TRUE;
+ bDone = sal_True;
}
else if ( rHEvt.GetMode() & (HELPMODE_CONTEXT | HELPMODE_EXTENDED) )
{
@@ -842,16 +842,16 @@ static BOOL ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, USHORT nHighl
// Ist eine ID vorhanden, dann Hilfe mit der ID aufrufen, sonst
// den Hilfe-Index
String aCommand = pMenu->GetItemCommand( nId );
- ULONG nHelpId = pMenu->GetHelpId( nId );
+ rtl::OString aHelpId( pMenu->GetHelpId( nId ) );
+ if( ! aHelpId.getLength() )
+ aHelpId = OOO_HELP_INDEX;
if ( aCommand.Len() )
pHelp->Start( aCommand, NULL );
- else if ( nHelpId )
- pHelp->Start( nHelpId, NULL );
else
- pHelp->Start( OOO_HELP_INDEX, NULL );
+ pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), NULL );
}
- bDone = TRUE;
+ bDone = sal_True;
}
return bDone;
}
@@ -861,7 +861,7 @@ static int ImplGetTopDockingAreaHeight( Window *pWindow )
// find docking area that is top aligned and return its height
// note: dockingareas are direct children of the SystemWindow
int height=0;
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
if( pWindow->ImplGetFrameWindow() )
{
Window *pWin = pWindow->ImplGetFrameWindow()->GetWindow( WINDOW_FIRSTCHILD); //mpWindowImpl->mpFirstChild;
@@ -875,7 +875,7 @@ static int ImplGetTopDockingAreaHeight( Window *pWindow )
DockingAreaWindow *pDockingArea = dynamic_cast< DockingAreaWindow* >( pWin );
if( pDockingArea && pDockingArea->GetAlign() == WINDOWALIGN_TOP )
{
- bDone = TRUE;
+ bDone = sal_True;
if( pDockingArea->IsVisible() )
height = pDockingArea->GetOutputSizePixel().Height();
}
@@ -894,13 +894,13 @@ static int ImplGetTopDockingAreaHeight( Window *pWindow )
Menu::Menu()
{
DBG_CTOR( Menu, NULL );
- bIsMenuBar = FALSE;
+ bIsMenuBar = sal_False;
ImplInit();
}
// this constructor makes sure we're creating the native menu
// with the correct type (ie, MenuBar vs. PopupMenu)
-Menu::Menu( BOOL bMenubar )
+Menu::Menu( sal_Bool bMenubar )
{
DBG_CTOR( Menu, NULL );
bIsMenuBar = bMenubar;
@@ -944,7 +944,7 @@ Menu::~Menu()
pDelData = pDelData->mpNext;
}
- bKilled = TRUE;
+ bKilled = sal_True;
delete pItemList;
delete pLogo;
@@ -965,20 +965,20 @@ void Menu::ImplInit()
mpSalMenu = NULL;
nMenuFlags = 0;
nDefaultItem = 0;
- //bIsMenuBar = FALSE; // this is now set in the ctor, must not be changed here!!!
+ //bIsMenuBar = sal_False; // this is now set in the ctor, must not be changed here!!!
nSelectedId = 0;
pItemList = new MenuItemList;
pLogo = NULL;
pStartedFrom = NULL;
pWindow = NULL;
nEventId = 0;
- bCanceled = FALSE;
- bInCallback = FALSE;
- bKilled = FALSE;
+ bCanceled = sal_False;
+ bInCallback = sal_False;
+ bKilled = sal_False;
mpLayoutData = NULL;
mpFirstDel = NULL; // Dtor notification list
// Native-support: returns NULL if not supported
- mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu( bIsMenuBar );
+ mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu( bIsMenuBar, this );
}
Menu* Menu::ImplGetStartedFrom() const
@@ -995,13 +995,13 @@ void Menu::ImplLoadRes( const ResId& rResId )
rResId.SetRT( RSC_MENU );
GetRes( rResId );
- ULONG nObjMask = ReadLongRes();
+ sal_uLong nObjMask = ReadLongRes();
if( nObjMask & RSC_MENU_ITEMS )
{
- ULONG nObjFollows = ReadLongRes();
+ sal_uLong nObjFollows = ReadLongRes();
// MenuItems einfuegen
- for( ULONG i = 0; i < nObjFollows; i++ )
+ for( sal_uLong i = 0; i < nObjFollows; i++ )
{
InsertItem( ResId( (RSHEADER_TYPE*)GetClassRes(), *pMgr ) );
IncrementRes( GetObjSizeRes( (RSHEADER_TYPE*)GetClassRes() ) );
@@ -1016,13 +1016,13 @@ void Menu::ImplLoadRes( const ResId& rResId )
aTitleText = ReadStringRes();
}
if( nObjMask & RSC_MENU_DEFAULTITEMID )
- SetDefaultItem( sal::static_int_cast<USHORT>(ReadLongRes()) );
+ SetDefaultItem( sal::static_int_cast<sal_uInt16>(ReadLongRes()) );
}
void Menu::CreateAutoMnemonics()
{
MnemonicGenerator aMnemonicGenerator;
- ULONG n;
+ sal_uLong n;
for ( n = 0; n < pItemList->Count(); n++ )
{
MenuItemData* pData = pItemList->GetDataFromPos(n);
@@ -1039,7 +1039,7 @@ void Menu::CreateAutoMnemonics()
void Menu::Activate()
{
- bInCallback = TRUE;
+ bInCallback = sal_True;
ImplMenuDelData aDelData( this );
@@ -1054,27 +1054,27 @@ void Menu::Activate()
Menu* pStartMenu = ImplGetStartMenu();
if ( pStartMenu && ( pStartMenu != this ) )
{
- pStartMenu->bInCallback = TRUE;
+ pStartMenu->bInCallback = sal_True;
// MT 11/01: Call EventListener here? I don't know...
pStartMenu->aActivateHdl.Call( this );
- pStartMenu->bInCallback = FALSE;
+ pStartMenu->bInCallback = sal_False;
}
}
}
- bInCallback = FALSE;
+ bInCallback = sal_False;
}
}
void Menu::Deactivate()
{
- for ( USHORT n = (USHORT)pItemList->Count(); n; )
+ for ( sal_uInt16 n = (sal_uInt16)pItemList->Count(); n; )
{
MenuItemData* pData = pItemList->GetDataFromPos( --n );
if ( pData->bIsTemporary )
pItemList->Remove( n );
}
- bInCallback = TRUE;
+ bInCallback = sal_True;
ImplMenuDelData aDelData( this );
@@ -1089,9 +1089,9 @@ void Menu::Deactivate()
{
if ( pStartMenu && ( pStartMenu != this ) )
{
- pStartMenu->bInCallback = TRUE;
+ pStartMenu->bInCallback = sal_True;
pStartMenu->aDeactivateHdl.Call( this );
- pStartMenu->bInCallback = FALSE;
+ pStartMenu->bInCallback = sal_False;
}
}
}
@@ -1099,7 +1099,7 @@ void Menu::Deactivate()
if( !aDelData.isDeleted() )
{
- bInCallback = FALSE;
+ bInCallback = sal_False;
}
}
@@ -1120,11 +1120,11 @@ void Menu::ImplSelect()
MenuItemData* pData = GetItemList()->GetData( nSelectedId );
if ( pData && (pData->nBits & MIB_AUTOCHECK) )
{
- BOOL bChecked = IsItemChecked( nSelectedId );
+ sal_Bool bChecked = IsItemChecked( nSelectedId );
if ( pData->nBits & MIB_RADIOCHECK )
{
if ( !bChecked )
- CheckItem( nSelectedId, TRUE );
+ CheckItem( nSelectedId, sal_True );
}
else
CheckItem( nSelectedId, !bChecked );
@@ -1170,7 +1170,7 @@ void Menu::RequestHelp( const HelpEvent& )
{
}
-void Menu::ImplCallEventListeners( ULONG nEvent, USHORT nPos )
+void Menu::ImplCallEventListeners( sal_uLong nEvent, sal_uInt16 nPos )
{
ImplMenuDelData aDelData( this );
@@ -1224,14 +1224,14 @@ void Menu::RemoveEventListener( const Link& rEventListener )
// mpDummy4_WindowChildEventListeners->remove( rEventListener );
//}
-void Menu::InsertItem( USHORT nItemId, const XubString& rStr, MenuItemBits nItemBits, USHORT nPos )
+void Menu::InsertItem( sal_uInt16 nItemId, const XubString& rStr, MenuItemBits nItemBits, sal_uInt16 nPos )
{
DBG_ASSERT( nItemId, "Menu::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == MENU_ITEM_NOTFOUND,
"Menu::InsertItem(): ItemId already exists" );
// if Position > ItemCount, append
- if ( nPos >= (USHORT)pItemList->Count() )
+ if ( nPos >= (sal_uInt16)pItemList->Count() )
nPos = MENU_APPEND;
// put Item in MenuItemList
@@ -1253,39 +1253,39 @@ void Menu::InsertItem( USHORT nItemId, const XubString& rStr, MenuItemBits nItem
ImplCallEventListeners( VCLEVENT_MENU_INSERTITEM, nPos );
}
-void Menu::InsertItem( USHORT nItemId, const Image& rImage,
- MenuItemBits nItemBits, USHORT nPos )
+void Menu::InsertItem( sal_uInt16 nItemId, const Image& rImage,
+ MenuItemBits nItemBits, sal_uInt16 nPos )
{
InsertItem( nItemId, ImplGetSVEmptyStr(), nItemBits, nPos );
SetItemImage( nItemId, rImage );
}
-void Menu::InsertItem( USHORT nItemId,
+void Menu::InsertItem( sal_uInt16 nItemId,
const XubString& rStr, const Image& rImage,
- MenuItemBits nItemBits, USHORT nPos )
+ MenuItemBits nItemBits, sal_uInt16 nPos )
{
InsertItem( nItemId, rStr, nItemBits, nPos );
SetItemImage( nItemId, rImage );
}
-void Menu::InsertItem( const ResId& rResId, USHORT nPos )
+void Menu::InsertItem( const ResId& rResId, sal_uInt16 nPos )
{
ResMgr* pMgr = rResId.GetResMgr();
if( ! pMgr )
return;
- ULONG nObjMask;
+ sal_uLong nObjMask;
GetRes( rResId.SetRT( RSC_MENUITEM ) );
nObjMask = ReadLongRes();
- BOOL bSep = FALSE;
+ sal_Bool bSep = sal_False;
if ( nObjMask & RSC_MENUITEM_SEPARATOR )
- bSep = (BOOL)ReadShortRes();
+ bSep = (sal_Bool)ReadShortRes();
- USHORT nItemId = 1;
+ sal_uInt16 nItemId = 1;
if ( nObjMask & RSC_MENUITEM_ID )
- nItemId = sal::static_int_cast<USHORT>(ReadLongRes());
+ nItemId = sal::static_int_cast<sal_uInt16>(ReadLongRes());
MenuItemBits nStatus = 0;
if ( nObjMask & RSC_MENUITEM_STATUS )
@@ -1321,15 +1321,14 @@ void Menu::InsertItem( const ResId& rResId, USHORT nPos )
SetHelpText( nItemId, aHelpText );
}
- ULONG nHelpId = 0;
if ( nObjMask & RSC_MENUITEM_HELPID )
{
- nHelpId = ReadLongRes();
+ rtl::OString aHelpId( ReadByteStringRes() );
if ( !bSep )
- SetHelpId( nItemId, nHelpId );
+ SetHelpId( nItemId, aHelpId );
}
- if( !bSep /* && SvHelpSettings::HelpText( aHelpText, nHelpId ) */ )
+ if( !bSep )
SetHelpText( nItemId, aHelpText );
if ( nObjMask & RSC_MENUITEM_KEYCODE )
@@ -1341,12 +1340,12 @@ void Menu::InsertItem( const ResId& rResId, USHORT nPos )
if( nObjMask & RSC_MENUITEM_CHECKED )
{
if ( !bSep )
- CheckItem( nItemId, (BOOL)ReadShortRes() );
+ CheckItem( nItemId, (sal_Bool)ReadShortRes() );
}
if ( nObjMask & RSC_MENUITEM_DISABLE )
{
if ( !bSep )
- EnableItem( nItemId, !(BOOL)ReadShortRes() );
+ EnableItem( nItemId, !(sal_Bool)ReadShortRes() );
}
if ( nObjMask & RSC_MENUITEM_COMMAND )
{
@@ -1373,21 +1372,21 @@ void Menu::InsertItem( const ResId& rResId, USHORT nPos )
delete mpLayoutData, mpLayoutData = NULL;
}
-void Menu::InsertSeparator( USHORT nPos )
+void Menu::InsertSeparator( sal_uInt16 nPos )
{
// do nothing if its a menu bar
if ( bIsMenuBar )
return;
// if position > ItemCount, append
- if ( nPos >= (USHORT)pItemList->Count() )
+ if ( nPos >= (sal_uInt16)pItemList->Count() )
nPos = MENU_APPEND;
// put separator in item list
pItemList->InsertSeparator( nPos );
// update native menu
- USHORT itemPos = nPos != MENU_APPEND ? nPos : (USHORT)pItemList->Count() - 1;
+ sal_uInt16 itemPos = nPos != MENU_APPEND ? nPos : (sal_uInt16)pItemList->Count() - 1;
MenuItemData *pData = pItemList->GetDataFromPos( itemPos );
if( ImplGetSalMenu() && pData && pData->pSalMenuItem )
ImplGetSalMenu()->InsertItem( pData->pSalMenuItem, nPos );
@@ -1397,9 +1396,9 @@ void Menu::InsertSeparator( USHORT nPos )
ImplCallEventListeners( VCLEVENT_MENU_INSERTITEM, nPos );
}
-void Menu::RemoveItem( USHORT nPos )
+void Menu::RemoveItem( sal_uInt16 nPos )
{
- BOOL bRemove = FALSE;
+ sal_Bool bRemove = sal_False;
if ( nPos < GetItemCount() )
{
@@ -1408,7 +1407,7 @@ void Menu::RemoveItem( USHORT nPos )
ImplGetSalMenu()->RemoveItem( nPos );
pItemList->Remove( nPos );
- bRemove = TRUE;
+ bRemove = sal_True;
}
Window* pWin = ImplGetWindow();
@@ -1424,8 +1423,8 @@ void Menu::RemoveItem( USHORT nPos )
ImplCallEventListeners( VCLEVENT_MENU_REMOVEITEM, nPos );
}
-void ImplCopyItem( Menu* pThis, const Menu& rMenu, USHORT nPos, USHORT nNewPos,
- USHORT nMode = 0 )
+void ImplCopyItem( Menu* pThis, const Menu& rMenu, sal_uInt16 nPos, sal_uInt16 nNewPos,
+ sal_uInt16 nMode = 0 )
{
MenuItemType eType = rMenu.GetItemType( nPos );
@@ -1436,7 +1435,7 @@ void ImplCopyItem( Menu* pThis, const Menu& rMenu, USHORT nPos, USHORT nNewPos,
pThis->InsertSeparator( nNewPos );
else
{
- USHORT nId = rMenu.GetItemId( nPos );
+ sal_uInt16 nId = rMenu.GetItemId( nPos );
DBG_ASSERT( pThis->GetItemPos( nId ) == MENU_ITEM_NOTFOUND,
"Menu::CopyItem(): ItemId already exists" );
@@ -1451,10 +1450,10 @@ void ImplCopyItem( Menu* pThis, const Menu& rMenu, USHORT nPos, USHORT nNewPos,
pThis->InsertItem( nId, pData->aImage, pData->nBits, nNewPos );
if ( rMenu.IsItemChecked( nId ) )
- pThis->CheckItem( nId, TRUE );
+ pThis->CheckItem( nId, sal_True );
if ( !rMenu.IsItemEnabled( nId ) )
- pThis->EnableItem( nId, FALSE );
- pThis->SetHelpId( nId, pData->nHelpId );
+ pThis->EnableItem( nId, sal_False );
+ pThis->SetHelpId( nId, pData->aHelpId );
pThis->SetHelpText( nId, pData->aHelpText );
pThis->SetAccelKey( nId, pData->aAccelKey );
pThis->SetItemCommand( nId, pData->aCommandStr );
@@ -1476,26 +1475,26 @@ void ImplCopyItem( Menu* pThis, const Menu& rMenu, USHORT nPos, USHORT nNewPos,
}
}
-void Menu::CopyItem( const Menu& rMenu, USHORT nPos, USHORT nNewPos )
+void Menu::CopyItem( const Menu& rMenu, sal_uInt16 nPos, sal_uInt16 nNewPos )
{
ImplCopyItem( this, rMenu, nPos, nNewPos );
}
void Menu::Clear()
{
- for ( USHORT i = GetItemCount(); i; i-- )
+ for ( sal_uInt16 i = GetItemCount(); i; i-- )
RemoveItem( 0 );
}
-USHORT Menu::GetItemCount() const
+sal_uInt16 Menu::GetItemCount() const
{
- return (USHORT)pItemList->Count();
+ return (sal_uInt16)pItemList->Count();
}
-USHORT Menu::ImplGetVisibleItemCount() const
+sal_uInt16 Menu::ImplGetVisibleItemCount() const
{
- USHORT nItems = 0;
- for ( USHORT n = (USHORT)pItemList->Count(); n; )
+ sal_uInt16 nItems = 0;
+ for ( sal_uInt16 n = (sal_uInt16)pItemList->Count(); n; )
{
if ( ImplIsVisible( --n ) )
nItems++;
@@ -1503,9 +1502,9 @@ USHORT Menu::ImplGetVisibleItemCount() const
return nItems;
}
-USHORT Menu::ImplGetFirstVisible() const
+sal_uInt16 Menu::ImplGetFirstVisible() const
{
- for ( USHORT n = 0; n < pItemList->Count(); n++ )
+ for ( sal_uInt16 n = 0; n < pItemList->Count(); n++ )
{
if ( ImplIsVisible( n ) )
return n;
@@ -1513,9 +1512,9 @@ USHORT Menu::ImplGetFirstVisible() const
return ITEMPOS_INVALID;
}
-USHORT Menu::ImplGetPrevVisible( USHORT nPos ) const
+sal_uInt16 Menu::ImplGetPrevVisible( sal_uInt16 nPos ) const
{
- for ( USHORT n = nPos; n; )
+ for ( sal_uInt16 n = nPos; n; )
{
if ( n && ImplIsVisible( --n ) )
return n;
@@ -1523,9 +1522,9 @@ USHORT Menu::ImplGetPrevVisible( USHORT nPos ) const
return ITEMPOS_INVALID;
}
-USHORT Menu::ImplGetNextVisible( USHORT nPos ) const
+sal_uInt16 Menu::ImplGetNextVisible( sal_uInt16 nPos ) const
{
- for ( USHORT n = nPos+1; n < pItemList->Count(); n++ )
+ for ( sal_uInt16 n = nPos+1; n < pItemList->Count(); n++ )
{
if ( ImplIsVisible( n ) )
return n;
@@ -1533,7 +1532,7 @@ USHORT Menu::ImplGetNextVisible( USHORT nPos ) const
return ITEMPOS_INVALID;
}
-USHORT Menu::GetItemId( USHORT nPos ) const
+sal_uInt16 Menu::GetItemId( sal_uInt16 nPos ) const
{
MenuItemData* pData = pItemList->GetDataFromPos( nPos );
@@ -1543,9 +1542,9 @@ USHORT Menu::GetItemId( USHORT nPos ) const
return 0;
}
-USHORT Menu::GetItemPos( USHORT nItemId ) const
+sal_uInt16 Menu::GetItemPos( sal_uInt16 nItemId ) const
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( pData )
@@ -1554,7 +1553,7 @@ USHORT Menu::GetItemPos( USHORT nItemId ) const
return MENU_ITEM_NOTFOUND;
}
-MenuItemType Menu::GetItemType( USHORT nPos ) const
+MenuItemType Menu::GetItemType( sal_uInt16 nPos ) const
{
MenuItemData* pData = pItemList->GetDataFromPos( nPos );
@@ -1564,19 +1563,19 @@ MenuItemType Menu::GetItemType( USHORT nPos ) const
return MENUITEM_DONTKNOW;
}
-USHORT Menu::GetCurItemId() const
+sal_uInt16 Menu::GetCurItemId() const
{
return nSelectedId;
}
-void Menu::SetItemBits( USHORT nItemId, MenuItemBits nBits )
+void Menu::SetItemBits( sal_uInt16 nItemId, MenuItemBits nBits )
{
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
pData->nBits = nBits;
}
-MenuItemBits Menu::GetItemBits( USHORT nItemId ) const
+MenuItemBits Menu::GetItemBits( sal_uInt16 nItemId ) const
{
MenuItemBits nBits = 0;
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -1585,22 +1584,22 @@ MenuItemBits Menu::GetItemBits( USHORT nItemId ) const
return nBits;
}
-void Menu::SetUserValue( USHORT nItemId, ULONG nValue )
+void Menu::SetUserValue( sal_uInt16 nItemId, sal_uLong nValue )
{
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
pData->nUserValue = nValue;
}
-ULONG Menu::GetUserValue( USHORT nItemId ) const
+sal_uLong Menu::GetUserValue( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
return pData ? pData->nUserValue : 0;
}
-void Menu::SetPopupMenu( USHORT nItemId, PopupMenu* pMenu )
+void Menu::SetPopupMenu( sal_uInt16 nItemId, PopupMenu* pMenu )
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
// Item does not exist -> return NULL
@@ -1630,7 +1629,7 @@ void Menu::SetPopupMenu( USHORT nItemId, PopupMenu* pMenu )
ImplCallEventListeners( VCLEVENT_MENU_SUBMENUCHANGED, nPos );
}
-PopupMenu* Menu::GetPopupMenu( USHORT nItemId ) const
+PopupMenu* Menu::GetPopupMenu( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -1640,9 +1639,9 @@ PopupMenu* Menu::GetPopupMenu( USHORT nItemId ) const
return NULL;
}
-void Menu::SetAccelKey( USHORT nItemId, const KeyCode& rKeyCode )
+void Menu::SetAccelKey( sal_uInt16 nItemId, const KeyCode& rKeyCode )
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( !pData )
@@ -1658,7 +1657,7 @@ void Menu::SetAccelKey( USHORT nItemId, const KeyCode& rKeyCode )
ImplGetSalMenu()->SetAccelerator( nPos, pData->pSalMenuItem, rKeyCode, rKeyCode.GetName() );
}
-KeyCode Menu::GetAccelKey( USHORT nItemId ) const
+KeyCode Menu::GetAccelKey( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -1668,16 +1667,16 @@ KeyCode Menu::GetAccelKey( USHORT nItemId ) const
return KeyCode();
}
-KeyEvent Menu::GetActivationKey( USHORT nItemId ) const
+KeyEvent Menu::GetActivationKey( sal_uInt16 nItemId ) const
{
KeyEvent aRet;
MenuItemData* pData = pItemList->GetData( nItemId );
if( pData )
{
- USHORT nPos = pData->aText.Search( '~' );
+ sal_uInt16 nPos = pData->aText.Search( '~' );
if( nPos != STRING_NOTFOUND && nPos < pData->aText.Len()-1 )
{
- USHORT nCode = 0;
+ sal_uInt16 nCode = 0;
sal_Unicode cAccel = pData->aText.GetChar( nPos+1 );
if( cAccel >= 'a' && cAccel <= 'z' )
nCode = KEY_A + (cAccel-'a');
@@ -1693,9 +1692,9 @@ KeyEvent Menu::GetActivationKey( USHORT nItemId ) const
return aRet;
}
-void Menu::CheckItem( USHORT nItemId, BOOL bCheck )
+void Menu::CheckItem( sal_uInt16 nItemId, sal_Bool bCheck )
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( !pData || pData->bChecked == bCheck )
@@ -1706,9 +1705,9 @@ void Menu::CheckItem( USHORT nItemId, BOOL bCheck )
(pData->nBits & MIB_RADIOCHECK) )
{
MenuItemData* pGroupData;
- USHORT nGroupPos;
- USHORT nItemCount = GetItemCount();
- BOOL bFound = FALSE;
+ sal_uInt16 nGroupPos;
+ sal_uInt16 nItemCount = GetItemCount();
+ sal_Bool bFound = sal_False;
nGroupPos = nPos;
while ( nGroupPos )
@@ -1718,8 +1717,8 @@ void Menu::CheckItem( USHORT nItemId, BOOL bCheck )
{
if ( IsItemChecked( pGroupData->nId ) )
{
- CheckItem( pGroupData->nId, FALSE );
- bFound = TRUE;
+ CheckItem( pGroupData->nId, sal_False );
+ bFound = sal_True;
break;
}
}
@@ -1738,7 +1737,7 @@ void Menu::CheckItem( USHORT nItemId, BOOL bCheck )
{
if ( IsItemChecked( pGroupData->nId ) )
{
- CheckItem( pGroupData->nId, FALSE );
+ CheckItem( pGroupData->nId, sal_False );
break;
}
}
@@ -1758,20 +1757,20 @@ void Menu::CheckItem( USHORT nItemId, BOOL bCheck )
ImplCallEventListeners( bCheck ? VCLEVENT_MENU_ITEMCHECKED : VCLEVENT_MENU_ITEMUNCHECKED, nPos );
}
-BOOL Menu::IsItemChecked( USHORT nItemId ) const
+sal_Bool Menu::IsItemChecked( sal_uInt16 nItemId ) const
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( !pData )
- return FALSE;
+ return sal_False;
return pData->bChecked;
}
-void Menu::EnableItem( USHORT nItemId, BOOL bEnable )
+void Menu::EnableItem( sal_uInt16 nItemId, sal_Bool bEnable )
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pItemData = pItemList->GetData( nItemId, nPos );
if ( pItemData && ( pItemData->bEnabled != bEnable ) )
@@ -1783,8 +1782,8 @@ void Menu::EnableItem( USHORT nItemId, BOOL bEnable )
{
DBG_ASSERT( bIsMenuBar, "Menu::EnableItem - Popup visible!" );
long nX = 0;
- ULONG nCount = pItemList->Count();
- for ( ULONG n = 0; n < nCount; n++ )
+ sal_uLong nCount = pItemList->Count();
+ for ( sal_uLong n = 0; n < nCount; n++ )
{
MenuItemData* pData = pItemList->GetDataFromPos( n );
if ( n == nPos )
@@ -1803,20 +1802,20 @@ void Menu::EnableItem( USHORT nItemId, BOOL bEnable )
}
}
-BOOL Menu::IsItemEnabled( USHORT nItemId ) const
+sal_Bool Menu::IsItemEnabled( sal_uInt16 nItemId ) const
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( !pData )
- return FALSE;
+ return sal_False;
return pData->bEnabled;
}
-void Menu::ShowItem( USHORT nItemId, BOOL bVisible )
+void Menu::ShowItem( sal_uInt16 nItemId, sal_Bool bVisible )
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
DBG_ASSERT( !bIsMenuBar, "Menu::ShowItem - ignored for menu bar entries!" );
@@ -1838,9 +1837,9 @@ void Menu::ShowItem( USHORT nItemId, BOOL bVisible )
}
}
-void Menu::SetItemText( USHORT nItemId, const XubString& rStr )
+void Menu::SetItemText( sal_uInt16 nItemId, const XubString& rStr )
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( !pData )
@@ -1867,9 +1866,9 @@ void Menu::SetItemText( USHORT nItemId, const XubString& rStr )
}
}
-XubString Menu::GetItemText( USHORT nItemId ) const
+XubString Menu::GetItemText( sal_uInt16 nItemId ) const
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( pData )
@@ -1878,9 +1877,9 @@ XubString Menu::GetItemText( USHORT nItemId ) const
return ImplGetSVEmptyStr();
}
-void Menu::SetItemImage( USHORT nItemId, const Image& rImage )
+void Menu::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( !pData )
@@ -1904,9 +1903,9 @@ static inline Image ImplRotImage( const Image& rImage, long nAngle10 )
return Image( aBmpEx );
}
-void Menu::SetItemImageAngle( USHORT nItemId, long nAngle10 )
+void Menu::SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 )
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( pData )
@@ -1931,9 +1930,9 @@ static inline Image ImplMirrorImage( const Image& rImage )
return Image( aBmpEx );
}
-void Menu::SetItemImageMirrorMode( USHORT nItemId, BOOL bMirror )
+void Menu::SetItemImageMirrorMode( sal_uInt16 nItemId, sal_Bool bMirror )
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( pData )
@@ -1949,7 +1948,7 @@ void Menu::SetItemImageMirrorMode( USHORT nItemId, BOOL bMirror )
}
}
-Image Menu::GetItemImage( USHORT nItemId ) const
+Image Menu::GetItemImage( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -1959,7 +1958,7 @@ Image Menu::GetItemImage( USHORT nItemId ) const
return Image();
}
-long Menu::GetItemImageAngle( USHORT nItemId ) const
+long Menu::GetItemImageAngle( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -1969,17 +1968,17 @@ long Menu::GetItemImageAngle( USHORT nItemId ) const
return 0;
}
-BOOL Menu::GetItemImageMirrorMode( USHORT nItemId ) const
+sal_Bool Menu::GetItemImageMirrorMode( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
return pData->bMirrorMode;
else
- return FALSE;
+ return sal_False;
}
-void Menu::SetItemCommand( USHORT nItemId, const String& rCommand )
+void Menu::SetItemCommand( sal_uInt16 nItemId, const String& rCommand )
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -1987,7 +1986,7 @@ void Menu::SetItemCommand( USHORT nItemId, const String& rCommand )
pData->aCommandStr = rCommand;
}
-const XubString& Menu::GetItemCommand( USHORT nItemId ) const
+const XubString& Menu::GetItemCommand( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -1997,7 +1996,7 @@ const XubString& Menu::GetItemCommand( USHORT nItemId ) const
return ImplGetSVEmptyStr();
}
-void Menu::SetHelpCommand( USHORT nItemId, const XubString& rStr )
+void Menu::SetHelpCommand( sal_uInt16 nItemId, const XubString& rStr )
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -2005,7 +2004,7 @@ void Menu::SetHelpCommand( USHORT nItemId, const XubString& rStr )
pData->aHelpCommandStr = rStr;
}
-const XubString& Menu::GetHelpCommand( USHORT nItemId ) const
+const XubString& Menu::GetHelpCommand( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -2015,7 +2014,7 @@ const XubString& Menu::GetHelpCommand( USHORT nItemId ) const
return ImplGetSVEmptyStr();
}
-void Menu::SetHelpText( USHORT nItemId, const XubString& rStr )
+void Menu::SetHelpText( sal_uInt16 nItemId, const XubString& rStr )
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -2023,14 +2022,14 @@ void Menu::SetHelpText( USHORT nItemId, const XubString& rStr )
pData->aHelpText = rStr;
}
-const XubString& Menu::ImplGetHelpText( USHORT nItemId ) const
+const XubString& Menu::ImplGetHelpText( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
{
if ( !pData->aHelpText.Len() &&
- (( pData->nHelpId ) || ( pData->aCommandStr.Len() )))
+ (( pData->aHelpId.getLength() ) || ( pData->aCommandStr.Len() )))
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
@@ -2038,8 +2037,8 @@ const XubString& Menu::ImplGetHelpText( USHORT nItemId ) const
if ( pData->aCommandStr.Len() )
pData->aHelpText = pHelp->GetHelpText( pData->aCommandStr, NULL );
- if( !pData->aHelpText.Len() && pData->nHelpId )
- pData->aHelpText = pHelp->GetHelpText( pData->nHelpId, NULL );
+ if( !pData->aHelpText.Len() && pData->aHelpId.getLength() )
+ pData->aHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pData->aHelpId, RTL_TEXTENCODING_UTF8 ), NULL );
}
}
@@ -2049,12 +2048,12 @@ const XubString& Menu::ImplGetHelpText( USHORT nItemId ) const
return ImplGetSVEmptyStr();
}
-const XubString& Menu::GetHelpText( USHORT nItemId ) const
+const XubString& Menu::GetHelpText( sal_uInt16 nItemId ) const
{
return ImplGetHelpText( nItemId );
}
-void Menu::SetTipHelpText( USHORT nItemId, const XubString& rStr )
+void Menu::SetTipHelpText( sal_uInt16 nItemId, const XubString& rStr )
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -2062,7 +2061,7 @@ void Menu::SetTipHelpText( USHORT nItemId, const XubString& rStr )
pData->aTipHelpText = rStr;
}
-const XubString& Menu::GetTipHelpText( USHORT nItemId ) const
+const XubString& Menu::GetTipHelpText( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -2072,22 +2071,29 @@ const XubString& Menu::GetTipHelpText( USHORT nItemId ) const
return ImplGetSVEmptyStr();
}
-void Menu::SetHelpId( USHORT nItemId, ULONG nHelpId )
+void Menu::SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId )
{
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
- pData->nHelpId = nHelpId;
+ pData->aHelpId = rHelpId;
}
-ULONG Menu::GetHelpId( USHORT nItemId ) const
+rtl::OString Menu::GetHelpId( sal_uInt16 nItemId ) const
{
+ rtl::OString aRet;
+
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
- return pData->nHelpId;
- else
- return 0;
+ {
+ if ( pData->aHelpId.getLength() )
+ aRet = pData->aHelpId;
+ else
+ aRet = ::rtl::OUStringToOString( pData->aCommandStr, RTL_TEXTENCODING_UTF8 );
+ }
+
+ return aRet;
}
Menu& Menu::operator=( const Menu& rMenu )
@@ -2096,8 +2102,8 @@ Menu& Menu::operator=( const Menu& rMenu )
Clear();
// Items kopieren
- USHORT nCount = rMenu.GetItemCount();
- for ( USHORT i = 0; i < nCount; i++ )
+ sal_uInt16 nCount = rMenu.GetItemCount();
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
ImplCopyItem( this, rMenu, i, MENU_APPEND, 1 );
nDefaultItem = rMenu.nDefaultItem;
@@ -2111,24 +2117,24 @@ Menu& Menu::operator=( const Menu& rMenu )
return *this;
}
-BOOL Menu::ImplIsVisible( USHORT nPos ) const
+sal_Bool Menu::ImplIsVisible( sal_uInt16 nPos ) const
{
- BOOL bVisible = TRUE;
+ sal_Bool bVisible = sal_True;
MenuItemData* pData = pItemList->GetDataFromPos( nPos );
// check general visibility first
if( pData && !pData->bVisible )
- bVisible = FALSE;
+ bVisible = sal_False;
if ( bVisible && pData && pData->eType == MENUITEM_SEPARATOR )
{
if( nPos == 0 ) // no separator should be shown at the very beginning
- bVisible = FALSE;
+ bVisible = sal_False;
else
{
// always avoid adjacent separators
- USHORT nCount = (USHORT) pItemList->Count();
- USHORT n;
+ sal_uInt16 nCount = (sal_uInt16) pItemList->Count();
+ sal_uInt16 n;
MenuItemData* pNextData = NULL;
// search next visible item
for( n = nPos + 1; n < nCount; n++ )
@@ -2141,10 +2147,10 @@ BOOL Menu::ImplIsVisible( USHORT nPos ) const
}
}
if( n == nCount ) // no next visible item
- bVisible = FALSE;
+ bVisible = sal_False;
// check for separator
if( pNextData && pNextData->bVisible && pNextData->eType == MENUITEM_SEPARATOR )
- bVisible = FALSE;
+ bVisible = sal_False;
if( bVisible )
{
@@ -2158,7 +2164,7 @@ BOOL Menu::ImplIsVisible( USHORT nPos ) const
}
}
if( n == 0 ) // no previous visible item
- bVisible = FALSE;
+ bVisible = sal_False;
}
}
}
@@ -2169,10 +2175,10 @@ BOOL Menu::ImplIsVisible( USHORT nPos ) const
!( nMenuFlags & MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES ) )
{
if( !pData ) // e.g. nPos == ITEMPOS_INVALID
- bVisible = FALSE;
+ bVisible = sal_False;
else if ( pData->eType != MENUITEM_SEPARATOR ) // separators handled above
{
- // bVisible = pData->bEnabled && ( !pData->pSubMenu || pData->pSubMenu->HasValidEntries( TRUE ) );
+ // bVisible = pData->bEnabled && ( !pData->pSubMenu || pData->pSubMenu->HasValidEntries( sal_True ) );
bVisible = pData->bEnabled; // SubMenus nicht pruefen, weil sie ggf. erst im Activate() gefuellt werden.
}
}
@@ -2180,34 +2186,34 @@ BOOL Menu::ImplIsVisible( USHORT nPos ) const
return bVisible;
}
-BOOL Menu::IsItemVisible( USHORT nItemId ) const
+sal_Bool Menu::IsItemVisible( sal_uInt16 nItemId ) const
{
return IsMenuVisible() && ImplIsVisible( GetItemPos( nItemId ) );
}
-BOOL Menu::IsItemPosVisible( USHORT nItemPos ) const
+sal_Bool Menu::IsItemPosVisible( sal_uInt16 nItemPos ) const
{
return IsMenuVisible() && ImplIsVisible( nItemPos );
}
-BOOL Menu::IsMenuVisible() const
+sal_Bool Menu::IsMenuVisible() const
{
return pWindow && pWindow->IsReallyVisible();
}
-BOOL Menu::ImplIsSelectable( USHORT nPos ) const
+sal_Bool Menu::ImplIsSelectable( sal_uInt16 nPos ) const
{
- BOOL bSelectable = TRUE;
+ sal_Bool bSelectable = sal_True;
MenuItemData* pData = pItemList->GetDataFromPos( nPos );
// check general visibility first
if ( pData && ( pData->nBits & MIB_NOSELECT ) )
- bSelectable = FALSE;
+ bSelectable = sal_False;
return bSelectable;
}
-void Menu::SelectItem( USHORT nItemId )
+void Menu::SelectItem( sal_uInt16 nItemId )
{
if( bIsMenuBar )
static_cast<MenuBar*>(this)->SelectEntry( nItemId );
@@ -2362,7 +2368,7 @@ Size Menu::ImplCalcSize( Window* pWin )
if ( rSettings.GetUseImagesInMenus() )
{
nMinMenuItemHeight = 16;
- for ( USHORT i = (USHORT)pItemList->Count(); i; )
+ for ( sal_uInt16 i = (sal_uInt16)pItemList->Count(); i; )
{
MenuItemData* pData = pItemList->GetDataFromPos( --i );
if ( ImplIsVisible( i ) && (( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE )))
@@ -2380,7 +2386,7 @@ Size Menu::ImplCalcSize( Window* pWin )
}
}
- for ( USHORT n = (USHORT)pItemList->Count(); n; )
+ for ( sal_uInt16 n = (sal_uInt16)pItemList->Count(); n; )
{
MenuItemData* pData = pItemList->GetDataFromPos( --n );
@@ -2478,8 +2484,18 @@ Size Menu::ImplCalcSize( Window* pWin )
if ( !bIsMenuBar )
{
- USHORT gfxExtra = (USHORT) Max( nExtra, 7L ); // #107710# increase space between checkmarks/images/text
- nCheckPos = (USHORT)nExtra;
+ // popup menus should not be wider than half the screen
+ // except on rather small screens
+ // TODO: move GetScreenNumber from SystemWindow to Window ?
+ // currently we rely on internal privileges
+ unsigned int nScreenNumber = pWin->ImplGetWindowImpl()->mpFrame->maGeometry.nScreenNumber;
+ Rectangle aDispRect( Application::GetScreenPosSizePixel( nScreenNumber ) );
+ long nScreenWidth = aDispRect.GetWidth() >= 800 ? aDispRect.GetWidth() : 800;
+ if( nMaxWidth > nScreenWidth/2 )
+ nMaxWidth = nScreenWidth/2;
+
+ sal_uInt16 gfxExtra = (sal_uInt16) Max( nExtra, 7L ); // #107710# increase space between checkmarks/images/text
+ nCheckPos = (sal_uInt16)nExtra;
if ( ( nMenuFlags & MENU_FLAG_SHOWCHECKIMAGES ) || bSpaceForCheckbox )
{
long nImgOrChkWidth = 0;
@@ -2489,12 +2505,12 @@ Size Menu::ImplCalcSize( Window* pWin )
else // non NWF case
nImgOrChkWidth = nFontHeight/2 + gfxExtra;
nImgOrChkWidth = Max( nImgOrChkWidth, aMaxImgSz.Width() + gfxExtra );
- nTextPos = (USHORT)(nImagePos + nImgOrChkWidth);
+ nTextPos = (sal_uInt16)(nImagePos + nImgOrChkWidth);
}
else
{
nImagePos = nCheckPos;
- nTextPos = (USHORT)(nImagePos + Max( aMaxImgSz.Width(), nCheckWidth ));
+ nTextPos = (sal_uInt16)(nImagePos + Max( aMaxImgSz.Width(), nCheckWidth ));
}
nTextPos = nTextPos + gfxExtra;
@@ -2507,7 +2523,7 @@ Size Menu::ImplCalcSize( Window* pWin )
}
else
{
- nTextPos = (USHORT)(2*nExtra);
+ nTextPos = (sal_uInt16)(2*nExtra);
aSz.Height() = nFontHeight+6;
// get menubar height from native methods if supported
@@ -2549,7 +2565,7 @@ Size Menu::ImplCalcSize( Window* pWin )
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;
@@ -2567,11 +2583,31 @@ 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 );
+ }
+}
+
+static String getShortenedString( const String& i_rLong, Window* i_pWin, long i_nMaxWidth )
+{
+ xub_StrLen nPos = STRING_NOTFOUND;
+ String aNonMnem( OutputDevice::GetNonMnemonicString( i_rLong, nPos ) );
+ aNonMnem = i_pWin->GetEllipsisString( aNonMnem, i_nMaxWidth, TEXT_DRAW_CENTERELLIPSIS );
+ // re-insert mnemonic
+ if( nPos != STRING_NOTFOUND )
+ {
+ if( nPos < aNonMnem.Len() && i_rLong.GetChar(nPos+1) == aNonMnem.GetChar(nPos) )
+ {
+ rtl::OUStringBuffer aBuf( i_rLong.Len() );
+ aBuf.append( aNonMnem.GetBuffer(), nPos );
+ aBuf.append( sal_Unicode('~') );
+ aBuf.append( aNonMnem.GetBuffer()+nPos );
+ aNonMnem = aBuf.makeStringAndClear();
+ }
}
+ return aNonMnem;
}
-void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData* pThisItemOnly, BOOL bHighlighted, bool bLayout ) const
+void Menu::ImplPaint( Window* pWin, sal_uInt16 nBorder, long nStartY, MenuItemData* pThisItemOnly, sal_Bool bHighlighted, bool bLayout ) const
{
// Fuer Symbole: nFontHeight x nFontHeight
long nFontHeight = pWin->GetTextHeight();
@@ -2597,10 +2633,10 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
}
Size aOutSz = pWin->GetOutputSizePixel();
- USHORT nCount = (USHORT)pItemList->Count();
+ sal_uInt16 nCount = (sal_uInt16)pItemList->Count();
if( bLayout )
mpLayoutData->m_aVisibleItemBoundRects.clear();
- for ( USHORT n = 0; n < nCount; n++ )
+ for ( sal_uInt16 n = 0; n < nCount; n++ )
{
MenuItemData* pData = pItemList->GetDataFromPos( n );
if ( ImplIsVisible( n ) && ( !pThisItemOnly || ( pData == pThisItemOnly ) ) )
@@ -2617,9 +2653,9 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
long nTextOffsetY = ((pData->aSz.Height()-nFontHeight)/2);
if( bIsMenuBar )
nTextOffsetY += (aOutSz.Height()-pData->aSz.Height()) / 2;
- USHORT nTextStyle = 0;
- USHORT nSymbolStyle = 0;
- USHORT nImageStyle = 0;
+ sal_uInt16 nTextStyle = 0;
+ sal_uInt16 nSymbolStyle = 0;
+ sal_uInt16 nImageStyle = 0;
// SubMenus ohne Items werden nicht mehr disablte dargestellt,
// wenn keine Items enthalten sind, da die Anwendung selber
// darauf achten muss. Ansonsten gibt es Faelle, wo beim
@@ -2634,14 +2670,36 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
// Separator
if ( !bLayout && !bIsMenuBar && ( pData->eType == MENUITEM_SEPARATOR ) )
{
- aTmpPos.Y() = aPos.Y() + ((pData->aSz.Height()-2)/2);
- aTmpPos.X() = aPos.X() + 2 + nOuterSpace;
- pWin->SetLineColor( rSettings.GetShadowColor() );
- pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) );
- aTmpPos.Y()++;
- pWin->SetLineColor( rSettings.GetLightColor() );
- pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) );
- pWin->SetLineColor();
+ bool bNativeOk = false;
+ if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP,
+ PART_MENU_SEPARATOR ) )
+ {
+ ControlState nState = 0;
+ if ( pData->bEnabled )
+ nState |= CTRL_STATE_ENABLED;
+ if ( bHighlighted )
+ nState |= CTRL_STATE_SELECTED;
+ Size aSz( pData->aSz );
+ aSz.Width() = aOutSz.Width() - 2*nOuterSpace;
+ Rectangle aItemRect( aPos, aSz );
+ MenupopupValue aVal( nTextPos-GUTTERBORDER, aItemRect );
+ bNativeOk = pWin->DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_SEPARATOR,
+ aItemRect,
+ nState,
+ aVal,
+ OUString() );
+ }
+ if( ! bNativeOk )
+ {
+ aTmpPos.Y() = aPos.Y() + ((pData->aSz.Height()-2)/2);
+ aTmpPos.X() = aPos.X() + 2 + nOuterSpace;
+ pWin->SetLineColor( rSettings.GetShadowColor() );
+ pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) );
+ aTmpPos.Y()++;
+ pWin->SetLineColor( rSettings.GetLightColor() );
+ pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) );
+ pWin->SetLineColor();
+ }
}
Rectangle aOuterCheckRect( Point( aPos.X()+nCheckPos, aPos.Y() ), Size( pData->aSz.Height(), pData->aSz.Height() ) );
@@ -2686,10 +2744,11 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
aTmpPos.Y() = aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - nCtrlHeight)/2;
Rectangle aCheckRect( aTmpPos, Size( nCtrlHeight, nCtrlHeight ) );
+ MenupopupValue aVal( nTextPos-GUTTERBORDER, Rectangle( aPos, pData->aSz ) );
pWin->DrawNativeControl( CTRL_MENU_POPUP, nPart,
aCheckRect,
nState,
- ImplControlValue(),
+ aVal,
OUString() );
}
else if ( pData->bChecked ) // by default do nothing for unchecked items
@@ -2737,7 +2796,7 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
aTmpPos.X() = aPos.X() + nTextPos;
aTmpPos.Y() = aPos.Y();
aTmpPos.Y() += nTextOffsetY;
- USHORT nStyle = nTextStyle|TEXT_DRAW_MNEMONIC;
+ sal_uInt16 nStyle = nTextStyle|TEXT_DRAW_MNEMONIC;
if ( pData->bIsTemporary )
nStyle |= TEXT_DRAW_DISABLE;
MetricVector* pVector = bLayout ? &mpLayoutData->m_aUnicodeBoundRects : NULL;
@@ -2761,7 +2820,19 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
pWin->GetSettings().GetStyleSettings().GetMenuColor();
pWin->SetBackground( Wallpaper( aBg ) );
}
- pWin->DrawCtrlText( aTmpPos, pData->aText, 0, pData->aText.Len(), nStyle, pVector, pDisplayText );
+ // how much space is there for the text ?
+ long nMaxItemTextWidth = aOutSz.Width() - aTmpPos.X() - nExtra - nOuterSpace;
+ if( !bIsMenuBar && pData->aAccelKey.GetCode() && !ImplAccelDisabled() )
+ {
+ XubString aAccText = pData->aAccelKey.GetName();
+ nMaxItemTextWidth -= pWin->GetTextWidth( aAccText ) + 3*nExtra;
+ }
+ if( !bIsMenuBar && pData->pSubMenu )
+ {
+ nMaxItemTextWidth -= nFontHeight - nExtra;
+ }
+ String aItemText( getShortenedString( pData->aText, pWin, nMaxItemTextWidth ) );
+ pWin->DrawCtrlText( aTmpPos, aItemText, 0, aItemText.Len(), nStyle, pVector, pDisplayText );
if( bSetTmpBackground )
pWin->SetBackground();
}
@@ -2797,16 +2868,6 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
aDecoView.DrawSymbol(
Rectangle( aTmpPos, Size( nFontHeight/2, nFontHeight/2 ) ),
SYMBOL_SPIN_RIGHT, pWin->GetTextColor(), nSymbolStyle );
-// if ( pData->nBits & MIB_POPUPSELECT )
-// {
-// aTmpPos.Y() += nFontHeight/2 ;
-// pWin->SetLineColor( rSettings.GetShadowColor() );
-// pWin->DrawLine( aTmpPos, Point( aTmpPos.X() + nFontHeight/3, aTmpPos.Y() ) );
-// pWin->SetLineColor( rSettings.GetLightColor() );
-// aTmpPos.Y()++;
-// pWin->DrawLine( aTmpPos, Point( aTmpPos.X() + nFontHeight/3, aTmpPos.Y() ) );
-// pWin->SetLineColor();
-// }
}
if ( pThisItemOnly && bHighlighted )
@@ -2869,7 +2930,7 @@ Menu* Menu::ImplGetStartMenu()
return pStart;
}
-void Menu::ImplCallHighlight( USHORT nHighlightedItem )
+void Menu::ImplCallHighlight( sal_uInt16 nHighlightedItem )
{
ImplMenuDelData aDelData( this );
@@ -2897,7 +2958,7 @@ Menu* Menu::ImplFindSelectMenu()
{
Menu* pSelMenu = nEventId ? this : NULL;
- for ( ULONG n = GetItemList()->Count(); n && !pSelMenu; )
+ for ( sal_uLong n = GetItemList()->Count(); n && !pSelMenu; )
{
MenuItemData* pData = GetItemList()->GetDataFromPos( --n );
@@ -2908,11 +2969,11 @@ Menu* Menu::ImplFindSelectMenu()
return pSelMenu;
}
-Menu* Menu::ImplFindMenu( USHORT nItemId )
+Menu* Menu::ImplFindMenu( sal_uInt16 nItemId )
{
Menu* pSelMenu = NULL;
- for ( ULONG n = GetItemList()->Count(); n && !pSelMenu; )
+ for ( sal_uLong n = GetItemList()->Count(); n && !pSelMenu; )
{
MenuItemData* pData = GetItemList()->GetDataFromPos( --n );
@@ -2925,25 +2986,25 @@ Menu* Menu::ImplFindMenu( USHORT nItemId )
return pSelMenu;
}
-void Menu::RemoveDisabledEntries( BOOL bCheckPopups, BOOL bRemoveEmptyPopups )
+void Menu::RemoveDisabledEntries( sal_Bool bCheckPopups, sal_Bool bRemoveEmptyPopups )
{
- for ( USHORT n = 0; n < GetItemCount(); n++ )
+ for ( sal_uInt16 n = 0; n < GetItemCount(); n++ )
{
- BOOL bRemove = FALSE;
+ sal_Bool bRemove = sal_False;
MenuItemData* pItem = pItemList->GetDataFromPos( n );
if ( pItem->eType == MENUITEM_SEPARATOR )
{
if ( !n || ( GetItemType( n-1 ) == MENUITEM_SEPARATOR ) )
- bRemove = TRUE;
+ bRemove = sal_True;
}
else
bRemove = !pItem->bEnabled;
if ( bCheckPopups && pItem->pSubMenu )
{
- pItem->pSubMenu->RemoveDisabledEntries( TRUE );
+ pItem->pSubMenu->RemoveDisabledEntries( sal_True );
if ( bRemoveEmptyPopups && !pItem->pSubMenu->GetItemCount() )
- bRemove = TRUE;
+ bRemove = sal_True;
}
if ( bRemove )
@@ -2952,7 +3013,7 @@ void Menu::RemoveDisabledEntries( BOOL bCheckPopups, BOOL bRemoveEmptyPopups )
if ( GetItemCount() )
{
- USHORT nLast = GetItemCount() - 1;
+ sal_uInt16 nLast = GetItemCount() - 1;
MenuItemData* pItem = pItemList->GetDataFromPos( nLast );
if ( pItem->eType == MENUITEM_SEPARATOR )
RemoveItem( nLast );
@@ -2960,19 +3021,19 @@ void Menu::RemoveDisabledEntries( BOOL bCheckPopups, BOOL bRemoveEmptyPopups )
delete mpLayoutData, mpLayoutData = NULL;
}
-BOOL Menu::HasValidEntries( BOOL bCheckPopups )
+sal_Bool Menu::HasValidEntries( sal_Bool bCheckPopups )
{
- BOOL bValidEntries = FALSE;
- USHORT nCount = GetItemCount();
- for ( USHORT n = 0; !bValidEntries && ( n < nCount ); n++ )
+ sal_Bool bValidEntries = sal_False;
+ sal_uInt16 nCount = GetItemCount();
+ for ( sal_uInt16 n = 0; !bValidEntries && ( n < nCount ); n++ )
{
MenuItemData* pItem = pItemList->GetDataFromPos( n );
if ( pItem->bEnabled && ( pItem->eType != MENUITEM_SEPARATOR ) )
{
if ( bCheckPopups && pItem->pSubMenu )
- bValidEntries = pItem->pSubMenu->HasValidEntries( TRUE );
+ bValidEntries = pItem->pSubMenu->HasValidEntries( sal_True );
else
- bValidEntries = TRUE;
+ bValidEntries = sal_True;
}
}
return bValidEntries;
@@ -3010,12 +3071,12 @@ void Menu::ImplFillLayoutData() const
mpLayoutData = new MenuLayoutData();
if( bIsMenuBar )
{
- ImplPaint( pWindow, 0, 0, 0, FALSE, true );
+ ImplPaint( pWindow, 0, 0, 0, sal_False, true );
}
else
{
MenuFloatingWindow* pFloat = (MenuFloatingWindow*)pWindow;
- ImplPaint( pWindow, pFloat->nScrollerHeight, pFloat->ImplGetStartY(), 0, FALSE, true );
+ ImplPaint( pWindow, pFloat->nScrollerHeight, pFloat->ImplGetStartY(), 0, sal_False, true );
}
}
}
@@ -3027,7 +3088,7 @@ String Menu::GetDisplayText() const
return mpLayoutData ? mpLayoutData->m_aDisplayText : String();
}
-Rectangle Menu::GetCharacterBounds( USHORT nItemID, long nIndex ) const
+Rectangle Menu::GetCharacterBounds( sal_uInt16 nItemID, long nIndex ) const
{
long nItemIndex = -1;
if( ! mpLayoutData )
@@ -3047,7 +3108,7 @@ Rectangle Menu::GetCharacterBounds( USHORT nItemID, long nIndex ) const
}
-long Menu::GetIndexForPoint( const Point& rPoint, USHORT& rItemID ) const
+long Menu::GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const
{
long nIndex = -1;
rItemID = 0;
@@ -3085,7 +3146,7 @@ Pair Menu::GetLineStartEnd( long nLine ) const
return mpLayoutData ? mpLayoutData->GetLineStartEnd( nLine ) : Pair( -1, -1 );
}
-Pair Menu::GetItemStartEnd( USHORT nItem ) const
+Pair Menu::GetItemStartEnd( sal_uInt16 nItem ) const
{
if( ! mpLayoutData )
ImplFillLayoutData();
@@ -3097,9 +3158,9 @@ Pair Menu::GetItemStartEnd( USHORT nItem ) const
return Pair( -1, -1 );
}
-USHORT Menu::GetDisplayItemId( long nLine ) const
+sal_uInt16 Menu::GetDisplayItemId( long nLine ) const
{
- USHORT nItemId = 0;
+ sal_uInt16 nItemId = 0;
if( ! mpLayoutData )
ImplFillLayoutData();
if( mpLayoutData && ( nLine >= 0 ) && ( nLine < (long)mpLayoutData->m_aLineItemIds.size() ) )
@@ -3107,19 +3168,19 @@ USHORT Menu::GetDisplayItemId( long nLine ) const
return nItemId;
}
-BOOL Menu::ConvertPoint( Point& rPoint, Window* pReferenceWindow ) const
+sal_Bool Menu::ConvertPoint( Point& rPoint, Window* pReferenceWindow ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pWindow && pReferenceWindow )
{
rPoint = pReferenceWindow->OutputToAbsoluteScreenPixel( rPoint );
rPoint = pWindow->AbsoluteScreenToOutputPixel( rPoint );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
}
-Rectangle Menu::GetBoundingRectangle( USHORT nPos ) const
+Rectangle Menu::GetBoundingRectangle( sal_uInt16 nPos ) const
{
Rectangle aRet;
@@ -3127,16 +3188,16 @@ Rectangle Menu::GetBoundingRectangle( USHORT nPos ) const
ImplFillLayoutData();
if( mpLayoutData )
{
- std::map< USHORT, Rectangle >::const_iterator it = mpLayoutData->m_aVisibleItemBoundRects.find( nPos );
+ std::map< sal_uInt16, Rectangle >::const_iterator it = mpLayoutData->m_aVisibleItemBoundRects.find( nPos );
if( it != mpLayoutData->m_aVisibleItemBoundRects.end() )
aRet = it->second;
}
return aRet;
}
-void Menu::SetAccessibleName( USHORT nItemId, const XubString& rStr )
+void Menu::SetAccessibleName( sal_uInt16 nItemId, const XubString& rStr )
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( pData && !rStr.Equals( pData->aAccessibleName ) )
@@ -3146,7 +3207,7 @@ void Menu::SetAccessibleName( USHORT nItemId, const XubString& rStr )
}
}
-XubString Menu::GetAccessibleName( USHORT nItemId ) const
+XubString Menu::GetAccessibleName( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -3156,7 +3217,7 @@ XubString Menu::GetAccessibleName( USHORT nItemId ) const
return ImplGetSVEmptyStr();
}
-void Menu::SetAccessibleDescription( USHORT nItemId, const XubString& rStr )
+void Menu::SetAccessibleDescription( sal_uInt16 nItemId, const XubString& rStr )
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -3164,7 +3225,7 @@ void Menu::SetAccessibleDescription( USHORT nItemId, const XubString& rStr )
pData->aAccessibleDescription = rStr;
}
-XubString Menu::GetAccessibleDescription( USHORT nItemId ) const
+XubString Menu::GetAccessibleDescription( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -3181,19 +3242,19 @@ void Menu::ImplSetSalMenu( SalMenu *pSalMenu )
mpSalMenu = pSalMenu;
}
-BOOL Menu::GetSystemMenuData( SystemMenuData* pData ) const
+sal_Bool Menu::GetSystemMenuData( SystemMenuData* pData ) const
{
Menu* pMenu = (Menu*)this;
if( pData && pMenu->ImplGetSalMenu() )
{
pMenu->ImplGetSalMenu()->GetSystemMenuData( pData );
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
-bool Menu::IsHighlighted( USHORT nItemPos ) const
+bool Menu::IsHighlighted( sal_uInt16 nItemPos ) const
{
bool bRet = false;
@@ -3208,19 +3269,19 @@ bool Menu::IsHighlighted( USHORT nItemPos ) const
return bRet;
}
-void Menu::HighlightItem( USHORT nItemPos )
+void Menu::HighlightItem( sal_uInt16 nItemPos )
{
if ( pWindow )
{
if ( bIsMenuBar )
{
MenuBarWindow* pMenuWin = static_cast< MenuBarWindow* >( pWindow );
- pMenuWin->SetAutoPopup( FALSE );
- pMenuWin->ChangeHighlightItem( nItemPos, FALSE );
+ pMenuWin->SetAutoPopup( sal_False );
+ pMenuWin->ChangeHighlightItem( nItemPos, sal_False );
}
else
{
- static_cast< MenuFloatingWindow* >( pWindow )->ChangeHighlightItem( nItemPos, FALSE );
+ static_cast< MenuFloatingWindow* >( pWindow )->ChangeHighlightItem( nItemPos, sal_False );
}
}
}
@@ -3229,54 +3290,54 @@ void Menu::HighlightItem( USHORT nItemPos )
// - MenuBar -
// -----------
-MenuBar::MenuBar() : Menu( TRUE )
+MenuBar::MenuBar() : Menu( sal_True )
{
- mbDisplayable = TRUE;
- mbCloserVisible = FALSE;
- mbFloatBtnVisible = FALSE;
- mbHideBtnVisible = FALSE;
+ mbDisplayable = sal_True;
+ mbCloserVisible = sal_False;
+ mbFloatBtnVisible = sal_False;
+ mbHideBtnVisible = sal_False;
}
-MenuBar::MenuBar( const MenuBar& rMenu ) : Menu( TRUE )
+MenuBar::MenuBar( const MenuBar& rMenu ) : Menu( sal_True )
{
- mbDisplayable = TRUE;
- mbCloserVisible = FALSE;
- mbFloatBtnVisible = FALSE;
- mbHideBtnVisible = FALSE;
+ mbDisplayable = sal_True;
+ mbCloserVisible = sal_False;
+ mbFloatBtnVisible = sal_False;
+ mbHideBtnVisible = sal_False;
*this = rMenu;
- bIsMenuBar = TRUE;
+ bIsMenuBar = sal_True;
}
-MenuBar::MenuBar( const ResId& rResId ) : Menu ( TRUE )
+MenuBar::MenuBar( const ResId& rResId ) : Menu ( sal_True )
{
- mbDisplayable = TRUE;
- mbCloserVisible = FALSE;
- mbFloatBtnVisible = FALSE;
- mbHideBtnVisible = FALSE;
+ mbDisplayable = sal_True;
+ mbCloserVisible = sal_False;
+ mbFloatBtnVisible = sal_False;
+ mbHideBtnVisible = sal_False;
ImplLoadRes( rResId );
}
MenuBar::~MenuBar()
{
- ImplDestroy( this, TRUE );
+ ImplDestroy( this, sal_True );
}
-void MenuBar::ShowCloser( BOOL bShow )
+void MenuBar::ShowCloser( sal_Bool bShow )
{
ShowButtons( bShow, mbFloatBtnVisible, mbHideBtnVisible );
}
-void MenuBar::ShowFloatButton( BOOL bShow )
+void MenuBar::ShowFloatButton( sal_Bool bShow )
{
ShowButtons( mbCloserVisible, bShow, mbHideBtnVisible );
}
-void MenuBar::ShowHideButton( BOOL bShow )
+void MenuBar::ShowHideButton( sal_Bool bShow )
{
ShowButtons( mbCloserVisible, mbFloatBtnVisible, bShow );
}
-void MenuBar::ShowButtons( BOOL bClose, BOOL bFloat, BOOL bHide )
+void MenuBar::ShowButtons( sal_Bool bClose, sal_Bool bFloat, sal_Bool bHide )
{
if ( (bClose != mbCloserVisible) ||
(bFloat != mbFloatBtnVisible) ||
@@ -3290,7 +3351,7 @@ void MenuBar::ShowButtons( BOOL bClose, BOOL bFloat, BOOL bHide )
}
}
-void MenuBar::SetDisplayable( BOOL bDisplayable )
+void MenuBar::SetDisplayable( sal_Bool bDisplayable )
{
if( bDisplayable != mbDisplayable )
{
@@ -3321,7 +3382,7 @@ Window* MenuBar::ImplCreate( Window* pParent, Window* pWindow, MenuBar* pMenu )
return pWindow;
}
-void MenuBar::ImplDestroy( MenuBar* pMenu, BOOL bDelete )
+void MenuBar::ImplDestroy( MenuBar* pMenu, sal_Bool bDelete )
{
MenuBarWindow* pWindow = (MenuBarWindow*) pMenu->ImplGetWindow();
if ( pWindow && bDelete )
@@ -3332,9 +3393,9 @@ void MenuBar::ImplDestroy( MenuBar* pMenu, BOOL bDelete )
pMenu->pWindow = NULL;
}
-BOOL MenuBar::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu )
+sal_Bool MenuBar::ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bFromMenu )
{
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
// No keyboard processing when system handles the menu or our menubar is invisible
if( !IsDisplayable() ||
@@ -3350,7 +3411,7 @@ BOOL MenuBar::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu )
// -----------------------------------------------------------------------
-void MenuBar::SelectEntry( USHORT nId )
+void MenuBar::SelectEntry( sal_uInt16 nId )
{
MenuBarWindow* pMenuWin = (MenuBarWindow*) ImplGetWindow();
@@ -3360,14 +3421,14 @@ void MenuBar::SelectEntry( USHORT nId )
nId = GetItemPos( nId );
// #99705# popup the selected menu
- pMenuWin->SetAutoPopup( TRUE );
+ pMenuWin->SetAutoPopup( sal_True );
if( ITEMPOS_INVALID != pMenuWin->nHighlightedItem )
{
pMenuWin->KillActivePopup();
- pMenuWin->ChangeHighlightItem( ITEMPOS_INVALID, FALSE );
+ pMenuWin->ChangeHighlightItem( ITEMPOS_INVALID, sal_False );
}
if( nId != ITEMPOS_INVALID )
- pMenuWin->ChangeHighlightItem( nId, FALSE );
+ pMenuWin->ChangeHighlightItem( nId, sal_False );
}
}
@@ -3375,38 +3436,38 @@ void MenuBar::SelectEntry( USHORT nId )
// handler for native menu selection and command events
-BOOL MenuBar::HandleMenuActivateEvent( Menu *pMenu ) const
+sal_Bool MenuBar::HandleMenuActivateEvent( Menu *pMenu ) const
{
if( pMenu )
{
ImplMenuDelData aDelData( this );
pMenu->pStartedFrom = (Menu*)this;
- pMenu->bInCallback = TRUE;
+ pMenu->bInCallback = sal_True;
pMenu->Activate();
if( !aDelData.isDeleted() )
- pMenu->bInCallback = FALSE;
+ pMenu->bInCallback = sal_False;
}
- return TRUE;
+ return sal_True;
}
-BOOL MenuBar::HandleMenuDeActivateEvent( Menu *pMenu ) const
+sal_Bool MenuBar::HandleMenuDeActivateEvent( Menu *pMenu ) const
{
if( pMenu )
{
ImplMenuDelData aDelData( this );
pMenu->pStartedFrom = (Menu*)this;
- pMenu->bInCallback = TRUE;
+ pMenu->bInCallback = sal_True;
pMenu->Deactivate();
if( !aDelData.isDeleted() )
- pMenu->bInCallback = FALSE;
+ pMenu->bInCallback = sal_False;
}
- return TRUE;
+ return sal_True;
}
-BOOL MenuBar::HandleMenuHighlightEvent( Menu *pMenu, USHORT nHighlightEventId ) const
+sal_Bool MenuBar::HandleMenuHighlightEvent( Menu *pMenu, sal_uInt16 nHighlightEventId ) const
{
if( !pMenu )
pMenu = ((Menu*) this)->ImplFindMenu( nHighlightEventId );
@@ -3424,13 +3485,13 @@ BOOL MenuBar::HandleMenuHighlightEvent( Menu *pMenu, USHORT nHighlightEventId )
pMenu->pStartedFrom = (Menu*)this;
pMenu->ImplCallHighlight( pMenu->mnHighlightedItemPos );
}
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
-BOOL MenuBar::HandleMenuCommandEvent( Menu *pMenu, USHORT nCommandEventId ) const
+sal_Bool MenuBar::HandleMenuCommandEvent( Menu *pMenu, sal_uInt16 nCommandEventId ) const
{
if( !pMenu )
pMenu = ((Menu*) this)->ImplFindMenu( nCommandEventId );
@@ -3439,47 +3500,47 @@ BOOL MenuBar::HandleMenuCommandEvent( Menu *pMenu, USHORT nCommandEventId ) cons
pMenu->nSelectedId = nCommandEventId;
pMenu->pStartedFrom = (Menu*)this;
pMenu->ImplSelect();
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
-USHORT MenuBar::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, USHORT i_nPos )
+sal_uInt16 MenuBar::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, sal_uInt16 i_nPos )
{
return AddMenuBarButton( i_rImage, i_rLink, String(), i_nPos );
}
-USHORT MenuBar::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, const String& i_rToolTip, USHORT i_nPos )
+sal_uInt16 MenuBar::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, const String& i_rToolTip, sal_uInt16 i_nPos )
{
return pWindow ? static_cast<MenuBarWindow*>(pWindow)->AddMenuBarButton( i_rImage, i_rLink, i_rToolTip, i_nPos ) : 0;
}
-void MenuBar::SetMenuBarButtonHighlightHdl( USHORT nId, const Link& rLink )
+void MenuBar::SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link& rLink )
{
if( pWindow )
static_cast<MenuBarWindow*>(pWindow)->SetMenuBarButtonHighlightHdl( nId, rLink );
}
-Rectangle MenuBar::GetMenuBarButtonRectPixel( USHORT nId )
+Rectangle MenuBar::GetMenuBarButtonRectPixel( sal_uInt16 nId )
{
return pWindow ? static_cast<MenuBarWindow*>(pWindow)->GetMenuBarButtonRectPixel( nId ) : Rectangle();
}
-void MenuBar::RemoveMenuBarButton( USHORT nId )
+void MenuBar::RemoveMenuBarButton( sal_uInt16 nId )
{
if( pWindow )
static_cast<MenuBarWindow*>(pWindow)->RemoveMenuBarButton( nId );
}
-BOOL MenuBar::HandleMenuButtonEvent( Menu *, USHORT i_nButtonId ) const
+sal_Bool MenuBar::HandleMenuButtonEvent( Menu *, sal_uInt16 i_nButtonId ) const
{
return static_cast<MenuBarWindow*>(pWindow)->HandleMenuButtonEvent( i_nButtonId );
}
// -----------------------------------------------------------------------
-// BOOL PopupMenu::bAnyPopupInExecute = FALSE;
+// sal_Bool PopupMenu::bAnyPopupInExecute = sal_False;
PopupMenu::PopupMenu()
{
@@ -3504,9 +3565,9 @@ PopupMenu::~PopupMenu()
*pRefAutoSubMenu = NULL; // #111060# avoid second delete in ~MenuItemData
}
-BOOL PopupMenu::IsInExecute()
+sal_Bool PopupMenu::IsInExecute()
{
- return GetActivePopupMenu() ? TRUE : FALSE;
+ return GetActivePopupMenu() ? sal_True : sal_False;
}
PopupMenu* PopupMenu::GetActivePopupMenu()
@@ -3515,22 +3576,22 @@ PopupMenu* PopupMenu::GetActivePopupMenu()
return pSVData->maAppData.mpActivePopupMenu;
}
-void PopupMenu::EndExecute( USHORT nSelectId )
+void PopupMenu::EndExecute( sal_uInt16 nSelectId )
{
if ( ImplGetWindow() )
ImplGetFloatingWindow()->EndExecute( nSelectId );
}
-void PopupMenu::SelectEntry( USHORT nId )
+void PopupMenu::SelectEntry( sal_uInt16 nId )
{
if ( ImplGetWindow() )
{
if( nId != ITEMPOS_INVALID )
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = GetItemList()->GetData( nId, nPos );
if ( pData->pSubMenu )
- ImplGetFloatingWindow()->ChangeHighlightItem( nPos, TRUE );
+ ImplGetFloatingWindow()->ChangeHighlightItem( nPos, sal_True );
else
ImplGetFloatingWindow()->EndExecute( nId );
}
@@ -3538,7 +3599,7 @@ void PopupMenu::SelectEntry( USHORT nId )
{
MenuFloatingWindow* pFloat = ImplGetFloatingWindow();
pFloat->GrabFocus();
- USHORT nPos;
+ sal_uInt16 nPos;
for( nPos = 0; nPos < GetItemList()->Count(); nPos++ )
{
MenuItemData* pData = (MenuItemData*)GetItemList()->GetObject( nPos );
@@ -3547,27 +3608,27 @@ void PopupMenu::SelectEntry( USHORT nId )
pFloat->KillActivePopup();
}
}
- pFloat->ChangeHighlightItem( ITEMPOS_INVALID, FALSE );
+ pFloat->ChangeHighlightItem( ITEMPOS_INVALID, sal_False );
}
}
}
-void PopupMenu::SetSelectedEntry( USHORT nId )
+void PopupMenu::SetSelectedEntry( sal_uInt16 nId )
{
nSelectedId = nId;
}
-USHORT PopupMenu::Execute( Window* pExecWindow, const Point& rPopupPos )
+sal_uInt16 PopupMenu::Execute( Window* pExecWindow, const Point& rPopupPos )
{
return Execute( pExecWindow, Rectangle( rPopupPos, rPopupPos ), POPUPMENU_EXECUTE_DOWN );
}
-USHORT PopupMenu::Execute( Window* pExecWindow, const Rectangle& rRect, USHORT nFlags )
+sal_uInt16 PopupMenu::Execute( Window* pExecWindow, const Rectangle& rRect, sal_uInt16 nFlags )
{
ENSURE_OR_RETURN( pExecWindow, "PopupMenu::Execute: need a non-NULL window!", 0 );
- ULONG nPopupModeFlags = 0;
+ sal_uLong nPopupModeFlags = 0;
if ( nFlags & POPUPMENU_EXECUTE_DOWN )
nPopupModeFlags = FLOATWIN_POPUPMODE_DOWN;
else if ( nFlags & POPUPMENU_EXECUTE_UP )
@@ -3582,10 +3643,10 @@ USHORT PopupMenu::Execute( Window* pExecWindow, const Rectangle& rRect, USHORT n
if (nFlags & POPUPMENU_NOMOUSEUPCLOSE ) // allow popup menus to stay open on mouse button up
nPopupModeFlags |= FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE; // useful if the menu was opened on mousebutton down (eg toolbox configuration)
- return ImplExecute( pExecWindow, rRect, nPopupModeFlags, 0, FALSE );
+ return ImplExecute( pExecWindow, rRect, nPopupModeFlags, 0, sal_False );
}
-USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupModeFlags, Menu* pSFrom, BOOL bPreSelectFirst )
+sal_uInt16 PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, sal_uLong nPopupModeFlags, Menu* pSFrom, sal_Bool bPreSelectFirst )
{
if ( !pSFrom && ( PopupMenu::IsInExecute() || !GetItemCount() ) )
return 0;
@@ -3596,15 +3657,15 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
pStartedFrom = pSFrom;
nSelectedId = 0;
- bCanceled = FALSE;
+ bCanceled = sal_False;
- ULONG nFocusId = 0;
- BOOL bRealExecute = FALSE;
+ sal_uLong nFocusId = 0;
+ sal_Bool bRealExecute = sal_False;
if ( !pStartedFrom )
{
- pSVData->maWinData.mbNoDeactivate = TRUE;
+ pSVData->maWinData.mbNoDeactivate = sal_True;
nFocusId = Window::SaveFocus();
- bRealExecute = TRUE;
+ bRealExecute = sal_True;
}
else
{
@@ -3631,9 +3692,9 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
ImplDelData aDelData;
pW->ImplAddDel( &aDelData );
- bInCallback = TRUE; // hier schon setzen, falls Activate ueberladen
+ bInCallback = sal_True; // hier schon setzen, falls Activate ueberladen
Activate();
- bInCallback = FALSE;
+ bInCallback = sal_False;
if ( aDelData.IsDelete() )
return 0; // Error
@@ -3659,7 +3720,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
nMenuFlags |= MENU_FLAG_HIDEDISABLEDENTRIES;
- USHORT nVisibleEntries = ImplGetVisibleItemCount();
+ sal_uInt16 nVisibleEntries = ImplGetVisibleItemCount();
if ( !nVisibleEntries )
{
ResMgr* pResMgr = ImplGetResMgr();
@@ -3668,7 +3729,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
String aTmpEntryText( ResId( SV_RESID_STRING_NOSELECTIONPOSSIBLE, *pResMgr ) );
MenuItemData* pData = pItemList->Insert(
0xFFFF, MENUITEM_STRING, 0, aTmpEntryText, Image(), NULL, 0xFFFF );
- pData->bIsTemporary = TRUE;
+ pData->bIsTemporary = sal_True;
}
}
else if ( Application::GetSettings().GetStyleSettings().GetAutoMnemonic() && !( nMenuFlags & MENU_FLAG_NOAUTOMNEMONICS ) )
@@ -3703,9 +3764,9 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
nMaxHeight -= nTop+nBottom;
if ( aSz.Height() > nMaxHeight )
{
- pWin->EnableScrollMenu( TRUE );
- USHORT nStart = ImplGetFirstVisible();
- USHORT nEntries = ImplCalcVisEntries( nMaxHeight, nStart );
+ pWin->EnableScrollMenu( sal_True );
+ sal_uInt16 nStart = ImplGetFirstVisible();
+ sal_uInt16 nEntries = ImplCalcVisEntries( nMaxHeight, nStart );
aSz.Height() = ImplCalcHeight( nEntries );
}
@@ -3720,7 +3781,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
if ( GetItemCount() )
{
SalMenu* pMenu = ImplGetSalMenu();
- if( pMenu && pMenu->ShowNativePopupMenu( pWin, aRect, nPopupModeFlags | FLOATWIN_POPUPMODE_GRABFOCUS ) )
+ if( pMenu && bRealExecute && pMenu->ShowNativePopupMenu( pWin, aRect, nPopupModeFlags | FLOATWIN_POPUPMODE_GRABFOCUS ) )
{
pWin->StopExecute(0);
pWin->doShutdown();
@@ -3734,7 +3795,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
}
if( pSFrom )
{
- USHORT aPos;
+ sal_uInt16 aPos;
if( pSFrom->bIsMenuBar )
aPos = ((MenuBarWindow *) pSFrom->pWindow)->GetHighlightedItem();
else
@@ -3746,14 +3807,14 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
}
if ( bPreSelectFirst )
{
- USHORT nCount = (USHORT)pItemList->Count();
- for ( USHORT n = 0; n < nCount; n++ )
+ sal_uInt16 nCount = (sal_uInt16)pItemList->Count();
+ for ( sal_uInt16 n = 0; n < nCount; n++ )
{
MenuItemData* pData = pItemList->GetDataFromPos( n );
if ( ( pData->bEnabled || !Application::GetSettings().GetStyleSettings().GetSkipDisabledInMenus() )
&& ( pData->eType != MENUITEM_SEPARATOR ) && ImplIsVisible( n ) && ImplIsSelectable( n ) )
{
- pWin->ChangeHighlightItem( n, FALSE );
+ pWin->ChangeHighlightItem( n, sal_False );
break;
}
}
@@ -3783,7 +3844,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
if ( nFocusId )
{
pWin->SetFocusId( 0 );
- pSVData->maWinData.mbNoDeactivate = FALSE;
+ pSVData->maWinData.mbNoDeactivate = sal_False;
}
pWin->ImplEndPopupMode( 0, nFocusId );
@@ -3814,18 +3875,18 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
return bRealExecute ? nSelectedId : 0;
}
-USHORT PopupMenu::ImplCalcVisEntries( long nMaxHeight, USHORT nStartEntry, USHORT* pLastVisible ) const
+sal_uInt16 PopupMenu::ImplCalcVisEntries( long nMaxHeight, sal_uInt16 nStartEntry, sal_uInt16* pLastVisible ) const
{
nMaxHeight -= 2 * ImplGetFloatingWindow()->GetScrollerHeight();
long nHeight = 0;
- USHORT nEntries = (USHORT) pItemList->Count();
- USHORT nVisEntries = 0;
+ sal_uInt16 nEntries = (sal_uInt16) pItemList->Count();
+ sal_uInt16 nVisEntries = 0;
if ( pLastVisible )
*pLastVisible = 0;
- for ( USHORT n = nStartEntry; n < nEntries; n++ )
+ for ( sal_uInt16 n = nStartEntry; n < nEntries; n++ )
{
if ( ImplIsVisible( n ) )
{
@@ -3842,14 +3903,14 @@ USHORT PopupMenu::ImplCalcVisEntries( long nMaxHeight, USHORT nStartEntry, USHOR
return nVisEntries;
}
-long PopupMenu::ImplCalcHeight( USHORT nEntries ) const
+long PopupMenu::ImplCalcHeight( sal_uInt16 nEntries ) const
{
long nHeight = 0;
- USHORT nFound = 0;
- for ( USHORT n = 0; ( nFound < nEntries ) && ( n < pItemList->Count() ); n++ )
+ sal_uInt16 nFound = 0;
+ for ( sal_uInt16 n = 0; ( nFound < nEntries ) && ( n < pItemList->Count() ); n++ )
{
- if ( ImplIsVisible( (USHORT) n ) )
+ if ( ImplIsVisible( (sal_uInt16) n ) )
{
MenuItemData* pData = pItemList->GetDataFromPos( n );
nHeight += pData->aSz.Height();
@@ -3863,7 +3924,7 @@ long PopupMenu::ImplCalcHeight( USHORT nEntries ) const
}
-static void ImplInitMenuWindow( Window* pWin, BOOL bFont, BOOL bMenuBar )
+static void ImplInitMenuWindow( Window* pWin, sal_Bool bFont, sal_Bool bMenuBar )
{
const StyleSettings& rStyleSettings = pWin->GetSettings().GetStyleSettings();
@@ -3880,7 +3941,7 @@ static void ImplInitMenuWindow( Window* pWin, BOOL bFont, BOOL bMenuBar )
Wallpaper aWallpaper;
aWallpaper.SetStyle( WALLPAPER_APPLICATIONGRADIENT );
pWin->SetBackground( aWallpaper );
- pWin->SetPaintTransparent( FALSE );
+ pWin->SetPaintTransparent( sal_False );
pWin->SetParentClipMode( 0 );
}
}
@@ -3905,12 +3966,12 @@ static void ImplInitMenuWindow( Window* pWin, BOOL bFont, BOOL bMenuBar )
MenuFloatingWindow::MenuFloatingWindow( Menu* pMen, Window* pParent, WinBits nStyle ) :
FloatingWindow( pParent, nStyle )
{
- mpWindowImpl->mbMenuFloatingWindow= TRUE;
+ mpWindowImpl->mbMenuFloatingWindow= sal_True;
pMenu = pMen;
pActivePopup = 0;
nSaveFocusId = 0;
- bInExecute = FALSE;
- bScrollMenu = FALSE;
+ bInExecute = sal_False;
+ bScrollMenu = sal_False;
nHighlightedItem = ITEMPOS_INVALID;
nMBDownPos = ITEMPOS_INVALID;
nPosInParent = ITEMPOS_INVALID;
@@ -3918,13 +3979,13 @@ MenuFloatingWindow::MenuFloatingWindow( Menu* pMen, Window* pParent, WinBits nSt
// nStartY = 0;
nBorder = EXTRASPACEY;
nFirstEntry = 0;
- bScrollUp = FALSE;
- bScrollDown = FALSE;
- bIgnoreFirstMove = TRUE;
- bKeyInput = FALSE;
+ bScrollUp = sal_False;
+ bScrollDown = sal_False;
+ bIgnoreFirstMove = sal_True;
+ bKeyInput = sal_False;
EnableSaveBackground();
- ImplInitMenuWindow( this, TRUE, FALSE );
+ ImplInitMenuWindow( this, sal_True, sal_False );
SetPopupModeEndHdl( LINK( this, MenuFloatingWindow, PopupEnd ) );
@@ -3950,7 +4011,7 @@ void MenuFloatingWindow::doShutdown()
{
// #102461# remove highlight in parent
MenuItemData* pData;
- USHORT i, nCount = (USHORT)pMenu->pStartedFrom->pItemList->Count();
+ sal_uInt16 i, nCount = (sal_uInt16)pMenu->pStartedFrom->pItemList->Count();
for(i = 0; i < nCount; i++)
{
pData = pMenu->pStartedFrom->pItemList->GetDataFromPos( i );
@@ -3961,7 +4022,7 @@ void MenuFloatingWindow::doShutdown()
{
MenuFloatingWindow* pPWin = (MenuFloatingWindow*)pMenu->pStartedFrom->ImplGetWindow();
if( pPWin )
- pPWin->HighlightItem( i, FALSE );
+ pPWin->HighlightItem( i, sal_False );
}
}
@@ -3997,13 +4058,13 @@ long MenuFloatingWindow::ImplGetStartY() const
long nY = 0;
if( pMenu )
{
- for ( USHORT n = 0; n < nFirstEntry; n++ )
+ for ( sal_uInt16 n = 0; n < nFirstEntry; n++ )
nY += pMenu->GetItemList()->GetDataFromPos( n )->aSz.Height();
}
return -nY;
}
-Region MenuFloatingWindow::ImplCalcClipRegion( BOOL bIncludeLogo ) const
+Region MenuFloatingWindow::ImplCalcClipRegion( sal_Bool bIncludeLogo ) const
{
Size aOutSz = GetOutputSizePixel();
Point aPos;
@@ -4033,7 +4094,7 @@ void MenuFloatingWindow::ImplInitClipRegion()
}
}
-void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDown )
+void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, sal_Bool bMBDown )
{
if( ! pMenu )
return;
@@ -4043,10 +4104,10 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDow
Size aOutSz = GetOutputSizePixel();
if ( ( nMouseY >= nY ) && ( nMouseY < ( aOutSz.Height() - nY ) ) )
{
- BOOL bHighlighted = FALSE;
- USHORT nCount = (USHORT)pMenu->pItemList->Count();
+ sal_Bool bHighlighted = sal_False;
+ sal_uInt16 nCount = (sal_uInt16)pMenu->pItemList->Count();
nY += ImplGetStartY(); // ggf. gescrollt.
- for ( USHORT n = 0; !bHighlighted && ( n < nCount ); n++ )
+ for ( sal_uInt16 n = 0; !bHighlighted && ( n < nCount ); n++ )
{
if ( pMenu->ImplIsVisible( n ) )
{
@@ -4055,7 +4116,7 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDow
nY += pItemData->aSz.Height();
if ( ( nOldY <= nMouseY ) && ( nY > nMouseY ) && pMenu->ImplIsSelectable( n ) )
{
- BOOL bPopupArea = TRUE;
+ sal_Bool bPopupArea = sal_True;
if ( pItemData->nBits & MIB_POPUPSELECT )
{
// Nur wenn ueber dem Pfeil geklickt wurde...
@@ -4068,10 +4129,10 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDow
{
if ( n != nHighlightedItem )
{
- ChangeHighlightItem( (USHORT)n, FALSE );
+ ChangeHighlightItem( (sal_uInt16)n, sal_False );
}
- BOOL bAllowNewPopup = TRUE;
+ sal_Bool bAllowNewPopup = sal_True;
if ( pActivePopup )
{
MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
@@ -4089,7 +4150,7 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDow
{
if ( n != nHighlightedItem )
{
- ChangeHighlightItem( (USHORT)n, TRUE );
+ ChangeHighlightItem( (sal_uInt16)n, sal_True );
}
else if ( pItemData->nBits & MIB_POPUPSELECT )
{
@@ -4097,17 +4158,17 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDow
HighlightChanged( NULL );
}
}
- bHighlighted = TRUE;
+ bHighlighted = sal_True;
}
}
}
if ( !bHighlighted )
- ChangeHighlightItem( ITEMPOS_INVALID, TRUE );
+ ChangeHighlightItem( ITEMPOS_INVALID, sal_True );
}
else
{
ImplScroll( rMEvt.GetPosPixel() );
- ChangeHighlightItem( ITEMPOS_INVALID, TRUE );
+ ChangeHighlightItem( ITEMPOS_INVALID, sal_True );
}
}
@@ -4121,12 +4182,12 @@ IMPL_LINK( MenuFloatingWindow, PopupEnd, FloatingWindow*, EMPTYARG )
{
//DBG_ASSERT( !pActivePopup->ImplGetWindow(), "PopupEnd, obwohl pActivePopup MIT Window!" );
KillActivePopup(); // should be ok to just remove it
- //pActivePopup->bCanceled = TRUE;
+ //pActivePopup->bCanceled = sal_True;
}
- bInExecute = FALSE;
- pMenu->bInCallback = TRUE;
+ bInExecute = sal_False;
+ pMenu->bInCallback = sal_True;
pMenu->Deactivate();
- pMenu->bInCallback = FALSE;
+ pMenu->bInCallback = sal_False;
}
else
{
@@ -4176,7 +4237,7 @@ IMPL_LINK( MenuFloatingWindow, HighlightChanged, Timer*, pTimer )
{
if ( pActivePopup && ( pActivePopup != pItemData->pSubMenu ) )
{
- ULONG nOldFlags = GetPopupModeFlags();
+ sal_uLong nOldFlags = GetPopupModeFlags();
SetPopupModeFlags( GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
KillActivePopup();
SetPopupModeFlags( nOldFlags );
@@ -4186,7 +4247,7 @@ IMPL_LINK( MenuFloatingWindow, HighlightChanged, Timer*, pTimer )
pActivePopup = (PopupMenu*)pItemData->pSubMenu;
long nY = nScrollerHeight+ImplGetStartY();
MenuItemData* pData = 0;
- for ( ULONG n = 0; n < nHighlightedItem; n++ )
+ for ( sal_uLong n = 0; n < nHighlightedItem; n++ )
{
pData = pMenu->pItemList->GetDataFromPos( n );
nY += pData->aSz.Height();
@@ -4217,9 +4278,9 @@ IMPL_LINK( MenuFloatingWindow, HighlightChanged, Timer*, pTimer )
// die lange im Activate Rescheduled haben und jetzt schon nicht mehr
// angezeigt werden sollen.
Menu* pTest = pActivePopup;
- ULONG nOldFlags = GetPopupModeFlags();
+ sal_uLong nOldFlags = GetPopupModeFlags();
SetPopupModeFlags( GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
- USHORT nRet = pActivePopup->ImplExecute( this, Rectangle( aItemTopLeft, aItemBottomRight ), FLOATWIN_POPUPMODE_RIGHT, pMenu, pTimer ? FALSE : TRUE );
+ sal_uInt16 nRet = pActivePopup->ImplExecute( this, Rectangle( aItemTopLeft, aItemBottomRight ), FLOATWIN_POPUPMODE_RIGHT, pMenu, pTimer ? sal_False : sal_True );
SetPopupModeFlags( nOldFlags );
// nRet != 0, wenn es waerend Activate() abgeschossen wurde...
@@ -4254,11 +4315,11 @@ IMPL_LINK( MenuFloatingWindow, ShowHideListener, VclWindowEvent*, pEvent )
return 0;
}
-void MenuFloatingWindow::EnableScrollMenu( BOOL b )
+void MenuFloatingWindow::EnableScrollMenu( sal_Bool b )
{
bScrollMenu = b;
- nScrollerHeight = b ? (USHORT) GetSettings().GetStyleSettings().GetScrollBarSize() /2 : 0;
- bScrollDown = TRUE;
+ nScrollerHeight = b ? (sal_uInt16) GetSettings().GetStyleSettings().GetScrollBarSize() /2 : 0;
+ bScrollDown = sal_True;
ImplInitClipRegion();
}
@@ -4268,8 +4329,8 @@ void MenuFloatingWindow::Execute()
pSVData->maAppData.mpActivePopupMenu = (PopupMenu*)pMenu;
- bInExecute = TRUE;
-// bCallingSelect = FALSE;
+ bInExecute = sal_True;
+// bCallingSelect = sal_False;
while ( bInExecute )
Application::Yield();
@@ -4280,24 +4341,24 @@ void MenuFloatingWindow::Execute()
// Application::Yield();
}
-void MenuFloatingWindow::StopExecute( ULONG nFocusId )
+void MenuFloatingWindow::StopExecute( sal_uLong nFocusId )
{
// Focus wieder herstellen
// (kann schon im Select wieder hergestellt wurden sein)
if ( nSaveFocusId )
{
- Window::EndSaveFocus( nFocusId, FALSE );
+ Window::EndSaveFocus( nFocusId, sal_False );
nFocusId = nSaveFocusId;
if ( nFocusId )
{
nSaveFocusId = 0;
- ImplGetSVData()->maWinData.mbNoDeactivate = FALSE;
+ ImplGetSVData()->maWinData.mbNoDeactivate = sal_False;
}
}
ImplEndPopupMode( 0, nFocusId );
aHighlightChangedTimer.Stop();
- bInExecute = FALSE;
+ bInExecute = sal_False;
if ( pActivePopup )
{
KillActivePopup();
@@ -4315,15 +4376,15 @@ void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly )
if( ((FloatingWindow *) pActivePopup->pWindow)->IsInCleanUp() )
return; // kill it later
if ( pActivePopup->bInCallback )
- pActivePopup->bCanceled = TRUE;
+ pActivePopup->bCanceled = sal_True;
// Vor allen Aktionen schon pActivePopup = 0, falls z.B.
// PopupModeEndHdl des zu zerstoerenden Popups mal synchron gerufen wird.
PopupMenu* pPopup = pActivePopup;
pActivePopup = NULL;
- pPopup->bInCallback = TRUE;
+ pPopup->bInCallback = sal_True;
pPopup->Deactivate();
- pPopup->bInCallback = FALSE;
+ pPopup->bInCallback = sal_False;
if ( pPopup->ImplGetWindow() )
{
pPopup->ImplGetFloatingWindow()->StopExecute();
@@ -4339,14 +4400,14 @@ void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly )
void MenuFloatingWindow::EndExecute()
{
Menu* pStart = pMenu ? pMenu->ImplGetStartMenu() : NULL;
- ULONG nFocusId = 0;
+ sal_uLong nFocusId = 0;
if ( pStart && pStart->bIsMenuBar )
{
nFocusId = ((MenuBarWindow*)((MenuBar*)pStart)->ImplGetWindow())->GetFocusId();
if ( nFocusId )
{
((MenuBarWindow*)((MenuBar*)pStart)->ImplGetWindow())->SetFocusId( 0 );
- ImplGetSVData()->maWinData.mbNoDeactivate = FALSE;
+ ImplGetSVData()->maWinData.mbNoDeactivate = sal_False;
}
}
@@ -4363,7 +4424,7 @@ void MenuFloatingWindow::EndExecute()
// Dies Fenster wird gleich zerstoert => Daten lokal merken...
Menu* pM = pMenu;
- USHORT nItem = nHighlightedItem;
+ sal_uInt16 nItem = nHighlightedItem;
pCleanUpFrom->StopExecute( nFocusId );
@@ -4381,9 +4442,9 @@ void MenuFloatingWindow::EndExecute()
}
}
-void MenuFloatingWindow::EndExecute( USHORT nId )
+void MenuFloatingWindow::EndExecute( sal_uInt16 nId )
{
- USHORT nPos;
+ sal_uInt16 nPos;
if ( pMenu && pMenu->GetItemList()->GetData( nId, nPos ) )
nHighlightedItem = nPos;
else
@@ -4400,7 +4461,7 @@ void MenuFloatingWindow::MouseButtonDown( const MouseEvent& rMEvt )
//if ( pActivePopup && pActivePopup->ImplGetWindow() && !pActivePopup->ImplGetFloatingWindow()->pActivePopup )
// pActivePopup->ImplGetFloatingWindow()->ToTop( TOTOP_NOGRABFOCUS );
- ImplHighlightItem( rMEvt, TRUE );
+ ImplHighlightItem( rMEvt, sal_True );
nMBDownPos = nHighlightedItem;
}
@@ -4410,7 +4471,7 @@ void MenuFloatingWindow::MouseButtonUp( const MouseEvent& rMEvt )
MenuItemData* pData = pMenu ? pMenu->GetItemList()->GetDataFromPos( nHighlightedItem ) : NULL;
// nMBDownPos in lokaler Variable merken und gleich zuruecksetzen,
// weil nach EndExecute zu spaet
- USHORT _nMBDownPos = nMBDownPos;
+ sal_uInt16 _nMBDownPos = nMBDownPos;
nMBDownPos = ITEMPOS_INVALID;
if ( pData && pData->bEnabled && ( pData->eType != MENUITEM_SEPARATOR ) )
{
@@ -4448,7 +4509,7 @@ void MenuFloatingWindow::MouseMove( const MouseEvent& rMEvt )
pActivePopup->ImplGetFloatingWindow()->aSubmenuCloseTimer.Start();
if( !pActivePopup || (pData && pData->pSubMenu != pActivePopup ) )
- ChangeHighlightItem( ITEMPOS_INVALID, FALSE );
+ ChangeHighlightItem( ITEMPOS_INVALID, sal_False );
#ifdef OS2
}
#endif
@@ -4463,13 +4524,13 @@ void MenuFloatingWindow::MouseMove( const MouseEvent& rMEvt )
{
aSubmenuCloseTimer.Stop();
if( bIgnoreFirstMove )
- bIgnoreFirstMove = FALSE;
+ bIgnoreFirstMove = sal_False;
else
- ImplHighlightItem( rMEvt, FALSE );
+ ImplHighlightItem( rMEvt, sal_False );
}
}
-void MenuFloatingWindow::ImplScroll( BOOL bUp )
+void MenuFloatingWindow::ImplScroll( sal_Bool bUp )
{
KillActivePopup();
Update();
@@ -4477,7 +4538,7 @@ void MenuFloatingWindow::ImplScroll( BOOL bUp )
if( ! pMenu )
return;
- HighlightItem( nHighlightedItem, FALSE );
+ HighlightItem( nHighlightedItem, sal_False );
pMenu->ImplKillLayoutData();
@@ -4492,17 +4553,17 @@ void MenuFloatingWindow::ImplScroll( BOOL bUp )
if ( !bScrollDown )
{
- bScrollDown = TRUE;
- ImplDrawScroller( FALSE );
+ bScrollDown = sal_True;
+ ImplDrawScroller( sal_False );
}
if ( pMenu->ImplGetPrevVisible( nFirstEntry ) == ITEMPOS_INVALID )
{
- bScrollUp = FALSE;
- ImplDrawScroller( TRUE );
+ bScrollUp = sal_False;
+ ImplDrawScroller( sal_True );
}
- Scroll( 0, nScrollEntryHeight, ImplCalcClipRegion( FALSE ).GetBoundRect(), SCROLL_CLIP );
+ Scroll( 0, nScrollEntryHeight, ImplCalcClipRegion( sal_False ).GetBoundRect(), SCROLL_CLIP );
}
else if ( bScrollDown && !bUp )
{
@@ -4514,24 +4575,24 @@ void MenuFloatingWindow::ImplScroll( BOOL bUp )
if ( !bScrollUp )
{
- bScrollUp = TRUE;
- ImplDrawScroller( TRUE );
+ bScrollUp = sal_True;
+ ImplDrawScroller( sal_True );
}
long nHeight = GetOutputSizePixel().Height();
- USHORT nLastVisible;
+ sal_uInt16 nLastVisible;
((PopupMenu*)pMenu)->ImplCalcVisEntries( nHeight, nFirstEntry, &nLastVisible );
if ( pMenu->ImplGetNextVisible( nLastVisible ) == ITEMPOS_INVALID )
{
- bScrollDown = FALSE;
- ImplDrawScroller( FALSE );
+ bScrollDown = sal_False;
+ ImplDrawScroller( sal_False );
}
// nStartY -= nEntryHeight;
- Scroll( 0, -nScrollEntryHeight, ImplCalcClipRegion( FALSE ).GetBoundRect(), SCROLL_CLIP );
+ Scroll( 0, -nScrollEntryHeight, ImplCalcClipRegion( sal_False ).GetBoundRect(), SCROLL_CLIP );
}
- HighlightItem( nHighlightedItem, TRUE );
+ HighlightItem( nHighlightedItem, sal_True );
}
void MenuFloatingWindow::ImplScroll( const Point& rMousePos )
@@ -4544,12 +4605,12 @@ void MenuFloatingWindow::ImplScroll( const Point& rMousePos )
if ( bScrollUp && ( nMouseY < nY ) )
{
- ImplScroll( TRUE );
+ ImplScroll( sal_True );
nDelta = nY - nMouseY;
}
else if ( bScrollDown && ( nMouseY > ( aOutSz.Height() - nY ) ) )
{
- ImplScroll( FALSE );
+ ImplScroll( sal_False );
nDelta = nMouseY - ( aOutSz.Height() - nY );
}
@@ -4571,7 +4632,7 @@ void MenuFloatingWindow::ImplScroll( const Point& rMousePos )
aScrollTimer.Start();
}
}
-void MenuFloatingWindow::ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer )
+void MenuFloatingWindow::ChangeHighlightItem( sal_uInt16 n, sal_Bool bStartPopupTimer )
{
// #57934# ggf. das aktive Popup sofort schliessen, damit TH's Hintergrundsicherung funktioniert.
// #65750# Dann verzichten wir lieber auf den schmalen Streifen Hintergrundsicherung.
@@ -4586,11 +4647,11 @@ void MenuFloatingWindow::ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer )
if ( nHighlightedItem != ITEMPOS_INVALID )
{
- HighlightItem( nHighlightedItem, FALSE );
+ HighlightItem( nHighlightedItem, sal_False );
pMenu->ImplCallEventListeners( VCLEVENT_MENU_DEHIGHLIGHT, nHighlightedItem );
}
- nHighlightedItem = (USHORT)n;
+ nHighlightedItem = (sal_uInt16)n;
DBG_ASSERT( pMenu->ImplIsVisible( nHighlightedItem ) || nHighlightedItem == ITEMPOS_INVALID, "ChangeHighlightItem: Not visible!" );
if( nHighlightedItem != ITEMPOS_INVALID )
{
@@ -4598,7 +4659,7 @@ void MenuFloatingWindow::ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer )
{
// #102461# make sure parent entry is highlighted as well
MenuItemData* pData;
- USHORT i, nCount = (USHORT)pMenu->pStartedFrom->pItemList->Count();
+ sal_uInt16 i, nCount = (sal_uInt16)pMenu->pStartedFrom->pItemList->Count();
for(i = 0; i < nCount; i++)
{
pData = pMenu->pStartedFrom->pItemList->GetDataFromPos( i );
@@ -4610,12 +4671,12 @@ void MenuFloatingWindow::ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer )
MenuFloatingWindow* pPWin = (MenuFloatingWindow*)pMenu->pStartedFrom->ImplGetWindow();
if( pPWin && pPWin->nHighlightedItem != i )
{
- pPWin->HighlightItem( i, TRUE );
+ pPWin->HighlightItem( i, sal_True );
pPWin->nHighlightedItem = i;
}
}
}
- HighlightItem( nHighlightedItem, TRUE );
+ HighlightItem( nHighlightedItem, sal_True );
pMenu->ImplCallHighlight( nHighlightedItem );
}
else
@@ -4634,7 +4695,7 @@ void MenuFloatingWindow::ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer )
}
}
-void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
+void MenuFloatingWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight )
{
if( ! pMenu )
return;
@@ -4650,8 +4711,8 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
int nOuterSpace = ImplGetSVData()->maNWFData.mnMenuFormatExtraBorder;
nY += nOuterSpace;
- USHORT nCount = (USHORT)pMenu->pItemList->Count();
- for ( USHORT n = 0; n < nCount; n++ )
+ sal_uInt16 nCount = (sal_uInt16)pMenu->pItemList->Count();
+ for ( sal_uInt16 n = 0; n < nCount; n++ )
{
MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
if ( n == nPos )
@@ -4659,7 +4720,7 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
DBG_ASSERT( pMenu->ImplIsVisible( n ), "Highlight: Item not visible!" );
if ( pData->eType != MENUITEM_SEPARATOR )
{
- BOOL bRestoreLineColor = FALSE;
+ sal_Bool bRestoreLineColor = sal_False;
Color oldLineColor;
bool bDrawItemRect = true;
@@ -4676,19 +4737,20 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
Push( PUSH_CLIPREGION );
IntersectClipRegion( Rectangle( Point( nX, nY ), Size( aSz.Width(), pData->aSz.Height() ) ) );
Rectangle aCtrlRect( Point( nX, 0 ), Size( aPxSize.Width()-nX, aPxSize.Height() ) );
+ MenupopupValue aVal( pMenu->nTextPos-GUTTERBORDER, aItemRect );
DrawNativeControl( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL,
aCtrlRect,
CTRL_STATE_ENABLED,
- ImplControlValue(),
+ aVal,
OUString() );
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 | ( pData->bEnabled? CTRL_STATE_ENABLED: 0 ),
- ImplControlValue(),
+ aVal,
OUString() ) )
{
bDrawItemRect = bHighlight;
@@ -4709,7 +4771,7 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
SetFillColor();
oldLineColor = GetLineColor();
SetLineColor( GetSettings().GetStyleSettings().GetMenuHighlightColor() );
- bRestoreLineColor = TRUE;
+ bRestoreLineColor = sal_True;
}
}
else
@@ -4728,7 +4790,7 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
}
}
-Rectangle MenuFloatingWindow::ImplGetItemRect( USHORT nPos )
+Rectangle MenuFloatingWindow::ImplGetItemRect( sal_uInt16 nPos )
{
if( ! pMenu )
return Rectangle();
@@ -4742,8 +4804,8 @@ Rectangle MenuFloatingWindow::ImplGetItemRect( USHORT nPos )
if ( pMenu->pLogo )
nX = pMenu->pLogo->aBitmap.GetSizePixel().Width();
- USHORT nCount = (USHORT)pMenu->pItemList->Count();
- for ( USHORT n = 0; n < nCount; n++ )
+ sal_uInt16 nCount = (sal_uInt16)pMenu->pItemList->Count();
+ for ( sal_uInt16 n = 0; n < nCount; n++ )
{
MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
if ( n == nPos )
@@ -4766,14 +4828,14 @@ Rectangle MenuFloatingWindow::ImplGetItemRect( USHORT nPos )
}
-void MenuFloatingWindow::ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd )
+void MenuFloatingWindow::ImplCursorUpDown( sal_Bool bUp, sal_Bool bHomeEnd )
{
if( ! pMenu )
return;
const StyleSettings& rSettings = GetSettings().GetStyleSettings();
- USHORT n = nHighlightedItem;
+ sal_uInt16 n = nHighlightedItem;
if ( n == ITEMPOS_INVALID )
{
if ( bUp )
@@ -4782,7 +4844,7 @@ void MenuFloatingWindow::ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd )
n = pMenu->GetItemCount()-1;
}
- USHORT nLoop = n;
+ sal_uInt16 nLoop = n;
if( bHomeEnd )
{
@@ -4794,7 +4856,7 @@ void MenuFloatingWindow::ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd )
}
else
{
- n = (USHORT)-1;
+ n = (sal_uInt16)-1;
nLoop = n+1;
}
}
@@ -4830,21 +4892,21 @@ void MenuFloatingWindow::ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd )
// Selektion noch im sichtbaren Bereich?
if ( IsScrollMenu() )
{
- ChangeHighlightItem( ITEMPOS_INVALID, FALSE );
+ ChangeHighlightItem( ITEMPOS_INVALID, sal_False );
while ( n < nFirstEntry )
- ImplScroll( TRUE );
+ ImplScroll( sal_True );
Size aOutSz = GetOutputSizePixel();
- USHORT nLastVisible;
+ sal_uInt16 nLastVisible;
((PopupMenu*)pMenu)->ImplCalcVisEntries( aOutSz.Height(), nFirstEntry, &nLastVisible );
while ( n > nLastVisible )
{
- ImplScroll( FALSE );
+ ImplScroll( sal_False );
((PopupMenu*)pMenu)->ImplCalcVisEntries( aOutSz.Height(), nFirstEntry, &nLastVisible );
}
}
- ChangeHighlightItem( n, FALSE );
+ ChangeHighlightItem( n, sal_False );
break;
}
} while ( n != nLoop );
@@ -4855,8 +4917,8 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent )
ImplDelData aDelData;
ImplAddDel( &aDelData );
- USHORT nCode = rKEvent.GetKeyCode().GetCode();
- bKeyInput = TRUE;
+ sal_uInt16 nCode = rKEvent.GetKeyCode().GetCode();
+ bKeyInput = sal_True;
switch ( nCode )
{
case KEY_UP:
@@ -4868,7 +4930,7 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent )
case KEY_END:
case KEY_HOME:
{
- ImplCursorUpDown( nCode == KEY_END, TRUE );
+ ImplCursorUpDown( nCode == KEY_END, sal_True );
}
break;
case KEY_F6:
@@ -4924,14 +4986,14 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent )
{
if( pMenu )
{
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
if ( nHighlightedItem != ITEMPOS_INVALID )
{
MenuItemData* pData = pMenu->GetItemList()->GetDataFromPos( nHighlightedItem );
if ( pData && pData->pSubMenu )
{
HighlightChanged( 0 );
- bDone = TRUE;
+ bDone = sal_True;
}
}
if ( !bDone )
@@ -4979,14 +5041,14 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent )
default:
{
xub_Unicode nCharCode = rKEvent.GetCharCode();
- USHORT nPos = 0;
- USHORT nDuplicates = 0;
+ sal_uInt16 nPos = 0;
+ sal_uInt16 nDuplicates = 0;
MenuItemData* pData = (nCharCode && pMenu) ? pMenu->GetItemList()->SearchItem( nCharCode, rKEvent.GetKeyCode(), nPos, nDuplicates, nHighlightedItem ) : NULL;
if ( pData )
{
if ( pData->pSubMenu || nDuplicates > 1 )
{
- ChangeHighlightItem( nPos, FALSE );
+ ChangeHighlightItem( nPos, sal_False );
HighlightChanged( 0 );
}
else
@@ -5008,7 +5070,7 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent )
if ( !aDelData.IsDelete() )
{
ImplRemoveDel( &aDelData );
- bKeyInput = FALSE;
+ bKeyInput = sal_False;
}
}
@@ -5023,25 +5085,26 @@ void MenuFloatingWindow::Paint( const Rectangle& )
long nX = pMenu->pLogo ? pMenu->pLogo->aBitmap.GetSizePixel().Width() : 0;
Size aPxSize( GetOutputSizePixel() );
aPxSize.Width() -= nX;
+ ImplControlValue aVal( pMenu->nTextPos-GUTTERBORDER );
DrawNativeControl( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL,
Rectangle( Point( nX, 0 ), aPxSize ),
CTRL_STATE_ENABLED,
- ImplControlValue(),
+ aVal,
OUString() );
ImplInitClipRegion();
}
if ( IsScrollMenu() )
{
- ImplDrawScroller( TRUE );
- ImplDrawScroller( FALSE );
+ ImplDrawScroller( sal_True );
+ ImplDrawScroller( sal_False );
}
SetFillColor( GetSettings().GetStyleSettings().GetMenuColor() );
pMenu->ImplPaint( this, nScrollerHeight, ImplGetStartY() );
if ( nHighlightedItem != ITEMPOS_INVALID )
- HighlightItem( nHighlightedItem, TRUE );
+ HighlightItem( nHighlightedItem, sal_True );
}
-void MenuFloatingWindow::ImplDrawScroller( BOOL bUp )
+void MenuFloatingWindow::ImplDrawScroller( sal_Bool bUp )
{
if( ! pMenu )
return;
@@ -5056,7 +5119,7 @@ void MenuFloatingWindow::ImplDrawScroller( BOOL bUp )
DecorationView aDecoView( this );
SymbolType eSymbol = bUp ? SYMBOL_SPIN_UP : SYMBOL_SPIN_DOWN;
- USHORT nStyle = 0;
+ sal_uInt16 nStyle = 0;
if ( ( bUp && !bScrollUp ) || ( !bUp && !bScrollDown ) )
nStyle |= SYMBOL_DRAW_DISABLE;
@@ -5067,7 +5130,7 @@ void MenuFloatingWindow::ImplDrawScroller( BOOL bUp )
void MenuFloatingWindow::RequestHelp( const HelpEvent& rHEvt )
{
- USHORT nId = nHighlightedItem;
+ sal_uInt16 nId = nHighlightedItem;
Menu* pM = pMenu;
Window* pW = this;
@@ -5091,7 +5154,7 @@ void MenuFloatingWindow::StateChanged( StateChangedType nType )
if ( ( nType == STATE_CHANGE_CONTROLFOREGROUND ) || ( nType == STATE_CHANGE_CONTROLBACKGROUND ) )
{
- ImplInitMenuWindow( this, FALSE, FALSE );
+ ImplInitMenuWindow( this, sal_False, sal_False );
Invalidate();
}
}
@@ -5105,7 +5168,7 @@ void MenuFloatingWindow::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitMenuWindow( this, FALSE, FALSE );
+ ImplInitMenuWindow( this, sal_False, sal_False );
Invalidate();
}
}
@@ -5145,10 +5208,10 @@ MenuBarWindow::MenuBarWindow( Window* pParent ) :
pActivePopup = NULL;
nSaveFocusId = 0;
nHighlightedItem = ITEMPOS_INVALID;
- mbAutoPopup = TRUE;
+ mbAutoPopup = sal_True;
nSaveFocusId = 0;
- bIgnoreFirstMove = TRUE;
- bStayActive = FALSE;
+ bIgnoreFirstMove = sal_True;
+ bStayActive = sal_False;
ResMgr* pResMgr = ImplGetResMgr();
@@ -5159,7 +5222,7 @@ MenuBarWindow::MenuBarWindow( Window* pParent ) :
aCloser.SetOutStyle( TOOLBOX_STYLE_FLAT );
aCloser.SetBackground();
- aCloser.SetPaintTransparent( TRUE );
+ aCloser.SetPaintTransparent( sal_True );
aCloser.SetParentClipMode( PARENTCLIPMODE_NOCLIP );
aCloser.InsertItem( IID_DOCUMENTCLOSE, aCloser.maImage, 0 );
@@ -5192,7 +5255,7 @@ void MenuBarWindow::SetMenu( MenuBar* pMen )
pMenu = pMen;
KillActivePopup();
nHighlightedItem = ITEMPOS_INVALID;
- ImplInitMenuWindow( this, TRUE, TRUE );
+ ImplInitMenuWindow( this, sal_True, sal_True );
if ( pMen )
{
aCloser.ShowItem( IID_DOCUMENTCLOSE, pMen->HasCloser() );
@@ -5212,7 +5275,7 @@ void MenuBarWindow::SetMenu( MenuBar* pMen )
}
}
-void MenuBarWindow::ShowButtons( BOOL bClose, BOOL bFloat, BOOL bHide )
+void MenuBarWindow::ShowButtons( sal_Bool bClose, sal_Bool bFloat, sal_Bool bHide )
{
aCloser.ShowItem( IID_DOCUMENTCLOSE, bClose );
aCloser.Show( bClose || ! m_aAddButtons.empty() );
@@ -5240,7 +5303,7 @@ IMPL_LINK( MenuBarWindow, CloserHdl, PushButton*, EMPTYARG )
}
else
{
- std::map<USHORT,AddButtonEntry>::iterator it = m_aAddButtons.find( aCloser.GetCurItemId() );
+ std::map<sal_uInt16,AddButtonEntry>::iterator it = m_aAddButtons.find( aCloser.GetCurItemId() );
if( it != m_aAddButtons.end() )
{
MenuBar::MenuBarButtonCallbackArg aArg;
@@ -5266,10 +5329,10 @@ IMPL_LINK( MenuBarWindow, ToolboxEventHdl, VclWindowEvent*, pEvent )
aArg.nId = aCloser.GetHighlightItemId();
else if( pEvent->GetId() == VCLEVENT_TOOLBOX_HIGHLIGHTOFF )
{
- USHORT nPos = static_cast< USHORT >(reinterpret_cast<sal_IntPtr>(pEvent->GetData()));
+ sal_uInt16 nPos = static_cast< sal_uInt16 >(reinterpret_cast<sal_IntPtr>(pEvent->GetData()));
aArg.nId = aCloser.GetItemId( nPos );
}
- std::map< USHORT, AddButtonEntry >::iterator it = m_aAddButtons.find( aArg.nId );
+ std::map< sal_uInt16, AddButtonEntry >::iterator it = m_aAddButtons.find( aArg.nId );
if( it != m_aAddButtons.end() )
{
it->second.m_aHighlightLink.Call( &aArg );
@@ -5299,12 +5362,12 @@ IMPL_LINK( MenuBarWindow, HideHdl, PushButton*, EMPTYARG )
return pMenu ? ((MenuBar*)pMenu)->GetHideButtonClickHdl().Call( pMenu ) : 0;
}
-void MenuBarWindow::ImplCreatePopup( BOOL bPreSelectFirst )
+void MenuBarWindow::ImplCreatePopup( sal_Bool bPreSelectFirst )
{
MenuItemData* pItemData = pMenu ? pMenu->GetItemList()->GetDataFromPos( nHighlightedItem ) : NULL;
if ( pItemData )
{
- bIgnoreFirstMove = TRUE;
+ bIgnoreFirstMove = sal_True;
if ( pActivePopup && ( pActivePopup != pItemData->pSubMenu ) )
{
KillActivePopup();
@@ -5314,7 +5377,7 @@ void MenuBarWindow::ImplCreatePopup( BOOL bPreSelectFirst )
pActivePopup = (PopupMenu*)pItemData->pSubMenu;
long nX = 0;
MenuItemData* pData = 0;
- for ( ULONG n = 0; n < nHighlightedItem; n++ )
+ for ( sal_uLong n = 0; n < nHighlightedItem; n++ )
{
pData = pMenu->GetItemList()->GetDataFromPos( n );
nX += pData->aSz.Width();
@@ -5361,11 +5424,11 @@ void MenuBarWindow::KillActivePopup()
return; // kill it later
if ( pActivePopup->bInCallback )
- pActivePopup->bCanceled = TRUE;
+ pActivePopup->bCanceled = sal_True;
- pActivePopup->bInCallback = TRUE;
+ pActivePopup->bInCallback = sal_True;
pActivePopup->Deactivate();
- pActivePopup->bInCallback = FALSE;
+ pActivePopup->bInCallback = sal_False;
// Abfrage auf pActivePopup, falls im Deactivate abgeschossen...
if ( pActivePopup && pActivePopup->ImplGetWindow() )
{
@@ -5383,22 +5446,22 @@ void MenuBarWindow::PopupClosed( Menu* pPopup )
if ( pPopup == pActivePopup )
{
KillActivePopup();
- ChangeHighlightItem( ITEMPOS_INVALID, FALSE, ImplGetFrameWindow()->ImplGetFrameData()->mbHasFocus, FALSE );
+ ChangeHighlightItem( ITEMPOS_INVALID, sal_False, ImplGetFrameWindow()->ImplGetFrameData()->mbHasFocus, sal_False );
}
}
void MenuBarWindow::MouseButtonDown( const MouseEvent& rMEvt )
{
- mbAutoPopup = TRUE;
- USHORT nEntry = ImplFindEntry( rMEvt.GetPosPixel() );
+ mbAutoPopup = sal_True;
+ sal_uInt16 nEntry = ImplFindEntry( rMEvt.GetPosPixel() );
if ( ( nEntry != ITEMPOS_INVALID ) && ( nEntry != nHighlightedItem ) )
{
- ChangeHighlightItem( nEntry, FALSE );
+ ChangeHighlightItem( nEntry, sal_False );
}
else
{
KillActivePopup();
- ChangeHighlightItem( ITEMPOS_INVALID, FALSE );
+ ChangeHighlightItem( ITEMPOS_INVALID, sal_False );
}
}
@@ -5414,20 +5477,20 @@ void MenuBarWindow::MouseMove( const MouseEvent& rMEvt )
if( bIgnoreFirstMove )
{
- bIgnoreFirstMove = FALSE;
+ bIgnoreFirstMove = sal_False;
return;
}
- USHORT nEntry = ImplFindEntry( rMEvt.GetPosPixel() );
+ sal_uInt16 nEntry = ImplFindEntry( rMEvt.GetPosPixel() );
if ( ( nEntry != ITEMPOS_INVALID )
#ifdef OS2
&& ( ImplHilite(rMEvt) )
#endif
&& ( nEntry != nHighlightedItem ) )
- ChangeHighlightItem( nEntry, FALSE );
+ ChangeHighlightItem( nEntry, sal_False );
}
-void MenuBarWindow::ChangeHighlightItem( USHORT n, BOOL bSelectEntry, BOOL bAllowRestoreFocus, BOOL bDefaultToDocument)
+void MenuBarWindow::ChangeHighlightItem( sal_uInt16 n, sal_Bool bSelectEntry, sal_Bool bAllowRestoreFocus, sal_Bool bDefaultToDocument)
{
if( ! pMenu )
return;
@@ -5438,21 +5501,21 @@ void MenuBarWindow::ChangeHighlightItem( USHORT n, BOOL bSelectEntry, BOOL bAllo
KillActivePopup(); // pActivePopup ggf. ohne pWin, wenn in Activate() Rescheduled wurde
// Activate am MenuBar immer nur einmal pro Vorgang...
- BOOL bJustActivated = FALSE;
+ sal_Bool bJustActivated = sal_False;
if ( ( nHighlightedItem == ITEMPOS_INVALID ) && ( n != ITEMPOS_INVALID ) )
{
- ImplGetSVData()->maWinData.mbNoDeactivate = TRUE;
+ ImplGetSVData()->maWinData.mbNoDeactivate = sal_True;
if( !bStayActive )
{
// #105406# avoid saving the focus when we already have the focus
- BOOL bNoSaveFocus = (this == ImplGetSVData()->maWinData.mpFocusWin );
+ sal_Bool bNoSaveFocus = (this == ImplGetSVData()->maWinData.mpFocusWin );
if( nSaveFocusId )
{
if( !ImplGetSVData()->maWinData.mbNoSaveFocus )
{
// we didn't clean up last time
- Window::EndSaveFocus( nSaveFocusId, FALSE ); // clean up
+ Window::EndSaveFocus( nSaveFocusId, sal_False ); // clean up
nSaveFocusId = 0;
if( !bNoSaveFocus )
nSaveFocusId = Window::SaveFocus(); // only save focus when initially activated
@@ -5468,21 +5531,21 @@ void MenuBarWindow::ChangeHighlightItem( USHORT n, BOOL bSelectEntry, BOOL bAllo
}
}
else
- bStayActive = FALSE;
- pMenu->bInCallback = TRUE; // hier schon setzen, falls Activate ueberladen
+ bStayActive = sal_False;
+ pMenu->bInCallback = sal_True; // hier schon setzen, falls Activate ueberladen
pMenu->Activate();
- pMenu->bInCallback = FALSE;
- bJustActivated = TRUE;
+ pMenu->bInCallback = sal_False;
+ bJustActivated = sal_True;
}
else if ( ( nHighlightedItem != ITEMPOS_INVALID ) && ( n == ITEMPOS_INVALID ) )
{
- pMenu->bInCallback = TRUE;
+ pMenu->bInCallback = sal_True;
pMenu->Deactivate();
- pMenu->bInCallback = FALSE;
- ImplGetSVData()->maWinData.mbNoDeactivate = FALSE;
+ pMenu->bInCallback = sal_False;
+ ImplGetSVData()->maWinData.mbNoDeactivate = sal_False;
if( !ImplGetSVData()->maWinData.mbNoSaveFocus )
{
- ULONG nTempFocusId = nSaveFocusId;
+ sal_uLong nTempFocusId = nSaveFocusId;
nSaveFocusId = 0;
Window::EndSaveFocus( nTempFocusId, bAllowRestoreFocus );
// #105406# restore focus to document if we could not save focus before
@@ -5493,13 +5556,13 @@ void MenuBarWindow::ChangeHighlightItem( USHORT n, BOOL bSelectEntry, BOOL bAllo
if ( nHighlightedItem != ITEMPOS_INVALID )
{
- HighlightItem( nHighlightedItem, FALSE );
+ HighlightItem( nHighlightedItem, sal_False );
pMenu->ImplCallEventListeners( VCLEVENT_MENU_DEHIGHLIGHT, nHighlightedItem );
}
- nHighlightedItem = (USHORT)n;
+ nHighlightedItem = (sal_uInt16)n;
DBG_ASSERT( ( nHighlightedItem == ITEMPOS_INVALID ) || pMenu->ImplIsVisible( nHighlightedItem ), "ChangeHighlightItem: Not visible!" );
- HighlightItem( nHighlightedItem, TRUE );
+ HighlightItem( nHighlightedItem, sal_True );
pMenu->ImplCallHighlight( nHighlightedItem );
if( mbAutoPopup )
@@ -5510,14 +5573,14 @@ void MenuBarWindow::ChangeHighlightItem( USHORT n, BOOL bSelectEntry, BOOL bAllo
GrabFocus();
}
-void MenuBarWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
+void MenuBarWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight )
{
if( ! pMenu )
return;
long nX = 0;
- ULONG nCount = pMenu->pItemList->Count();
- for ( ULONG n = 0; n < nCount; n++ )
+ sal_uLong nCount = pMenu->pItemList->Count();
+ for ( sal_uLong n = 0; n < nCount; n++ )
{
MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
if ( n == nPos )
@@ -5588,14 +5651,14 @@ void MenuBarWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
}
}
-Rectangle MenuBarWindow::ImplGetItemRect( USHORT nPos )
+Rectangle MenuBarWindow::ImplGetItemRect( sal_uInt16 nPos )
{
Rectangle aRect;
if( pMenu )
{
long nX = 0;
- ULONG nCount = pMenu->pItemList->Count();
- for ( ULONG n = 0; n < nCount; n++ )
+ sal_uLong nCount = pMenu->pItemList->Count();
+ for ( sal_uLong n = 0; n < nCount; n++ )
{
MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
if ( n == nPos )
@@ -5618,16 +5681,16 @@ void MenuBarWindow::KeyInput( const KeyEvent& rKEvent )
Window::KeyInput( rKEvent );
}
-BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu )
+sal_Bool MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bFromMenu )
{
if( ! pMenu )
- return FALSE;
+ return sal_False;
if ( pMenu->bInCallback )
- return TRUE; // schlucken
+ return sal_True; // schlucken
- BOOL bDone = FALSE;
- USHORT nCode = rKEvent.GetKeyCode().GetCode();
+ sal_Bool bDone = sal_False;
+ sal_uInt16 nCode = rKEvent.GetKeyCode().GetCode();
if( GetParent() )
{
@@ -5636,7 +5699,7 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu
SystemWindow *pSysWin = (SystemWindow*)GetParent()->GetWindow( WINDOW_CLIENT );
if( pSysWin->GetTaskPaneList() )
if( pSysWin->GetTaskPaneList()->HandleKeyEvent( rKEvent ) )
- return TRUE;
+ return sal_True;
}
}
@@ -5645,22 +5708,22 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu
mbAutoPopup = ImplGetSVData()->maNWFData.mbOpenMenuOnF10;
if ( nHighlightedItem == ITEMPOS_INVALID )
{
- ChangeHighlightItem( 0, FALSE );
+ ChangeHighlightItem( 0, sal_False );
GrabFocus();
}
else
{
- ChangeHighlightItem( ITEMPOS_INVALID, FALSE );
+ ChangeHighlightItem( ITEMPOS_INVALID, sal_False );
nSaveFocusId = 0;
}
- bDone = TRUE;
+ bDone = sal_True;
}
else if ( bFromMenu )
{
if ( ( nCode == KEY_LEFT ) || ( nCode == KEY_RIGHT ) ||
( nCode == KEY_HOME ) || ( nCode == KEY_END ) )
{
- USHORT n = nHighlightedItem;
+ sal_uInt16 n = nHighlightedItem;
if ( n == ITEMPOS_INVALID )
{
if ( nCode == KEY_LEFT)
@@ -5680,10 +5743,10 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu
bWasHighlight = (pSubWindow->GetHighlightedItem() != ITEMPOS_INVALID);
}
- USHORT nLoop = n;
+ sal_uInt16 nLoop = n;
if( nCode == KEY_HOME )
- { n = (USHORT)-1; nLoop = n+1; }
+ { n = (sal_uInt16)-1; nLoop = n+1; }
if( nCode == KEY_END )
{ n = pMenu->GetItemCount(); nLoop = n-1; }
@@ -5706,14 +5769,14 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu
MenuItemData* pData = (MenuItemData*)pMenu->GetItemList()->GetDataFromPos( n );
if ( ( pData->eType != MENUITEM_SEPARATOR ) && pMenu->ImplIsVisible( n ) )
{
- BOOL bDoSelect = TRUE;
+ sal_Bool bDoSelect = sal_True;
if( ImplGetSVData()->maNWFData.mbOpenMenuOnF10 )
bDoSelect = bWasHighlight;
ChangeHighlightItem( n, bDoSelect );
break;
}
} while ( n != nLoop );
- bDone = TRUE;
+ bDone = sal_True;
}
else if ( nCode == KEY_RETURN )
{
@@ -5721,36 +5784,36 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu
else
if ( !mbAutoPopup )
{
- ImplCreatePopup( TRUE );
- mbAutoPopup = TRUE;
+ ImplCreatePopup( sal_True );
+ mbAutoPopup = sal_True;
}
- bDone = TRUE;
+ bDone = sal_True;
}
else if ( ( nCode == KEY_UP ) || ( nCode == KEY_DOWN ) )
{
if ( !mbAutoPopup )
{
- ImplCreatePopup( TRUE );
- mbAutoPopup = TRUE;
+ ImplCreatePopup( sal_True );
+ mbAutoPopup = sal_True;
}
- bDone = TRUE;
+ bDone = sal_True;
}
else if ( nCode == KEY_ESCAPE || ( nCode == KEY_F6 && rKEvent.GetKeyCode().IsMod1() ) )
{
if( pActivePopup )
{
// bring focus to menu bar without any open popup
- mbAutoPopup = FALSE;
- USHORT n = nHighlightedItem;
+ mbAutoPopup = sal_False;
+ sal_uInt16 n = nHighlightedItem;
nHighlightedItem = ITEMPOS_INVALID;
- bStayActive = TRUE;
- ChangeHighlightItem( n, FALSE );
- bStayActive = FALSE;
+ bStayActive = sal_True;
+ ChangeHighlightItem( n, sal_False );
+ bStayActive = sal_False;
KillActivePopup();
GrabFocus();
}
else
- ChangeHighlightItem( ITEMPOS_INVALID, FALSE );
+ ChangeHighlightItem( ITEMPOS_INVALID, sal_False );
if( nCode == KEY_F6 && rKEvent.GetKeyCode().IsMod1() )
{
@@ -5758,7 +5821,7 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu
GrabFocusToDocument();
}
- bDone = TRUE;
+ bDone = sal_True;
}
}
@@ -5767,19 +5830,19 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu
xub_Unicode nCharCode = rKEvent.GetCharCode();
if ( nCharCode )
{
- USHORT nEntry, nDuplicates;
+ sal_uInt16 nEntry, nDuplicates;
MenuItemData* pData = pMenu->GetItemList()->SearchItem( nCharCode, rKEvent.GetKeyCode(), nEntry, nDuplicates, nHighlightedItem );
if ( pData && (nEntry != ITEMPOS_INVALID) )
{
- mbAutoPopup = TRUE;
- ChangeHighlightItem( nEntry, TRUE );
- bDone = TRUE;
+ mbAutoPopup = sal_True;
+ ChangeHighlightItem( nEntry, sal_True );
+ bDone = sal_True;
}
else
{
// Wegen Systemmenu und anderen System-HotKeys, nur
// eigenstaendige Character-Kombinationen auswerten
- USHORT nKeyCode = rKEvent.GetKeyCode().GetCode();
+ sal_uInt16 nKeyCode = rKEvent.GetKeyCode().GetCode();
if ( ((nKeyCode >= KEY_A) && (nKeyCode <= KEY_Z)) )
Sound::Beep();
}
@@ -5814,7 +5877,7 @@ void MenuBarWindow::Paint( const Rectangle& )
SetFillColor( GetSettings().GetStyleSettings().GetMenuColor() );
pMenu->ImplPaint( this, 0 );
if ( nHighlightedItem != ITEMPOS_INVALID )
- HighlightItem( nHighlightedItem, TRUE );
+ HighlightItem( nHighlightedItem, sal_True );
// in high contrast mode draw a separating line on the lower edge
if( ! IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL) &&
@@ -5866,20 +5929,20 @@ void MenuBarWindow::Resize()
Invalidate();
}
-USHORT MenuBarWindow::ImplFindEntry( const Point& rMousePos ) const
+sal_uInt16 MenuBarWindow::ImplFindEntry( const Point& rMousePos ) const
{
if( pMenu )
{
long nX = 0;
- USHORT nCount = (USHORT)pMenu->pItemList->Count();
- for ( USHORT n = 0; n < nCount; n++ )
+ sal_uInt16 nCount = (sal_uInt16)pMenu->pItemList->Count();
+ for ( sal_uInt16 n = 0; n < nCount; n++ )
{
MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
if ( pMenu->ImplIsVisible( n ) )
{
nX += pData->aSz.Width();
if ( nX > rMousePos.X() )
- return (USHORT)n;
+ return (sal_uInt16)n;
}
}
}
@@ -5888,9 +5951,9 @@ USHORT MenuBarWindow::ImplFindEntry( const Point& rMousePos ) const
void MenuBarWindow::RequestHelp( const HelpEvent& rHEvt )
{
- USHORT nId = nHighlightedItem;
+ sal_uInt16 nId = nHighlightedItem;
if ( rHEvt.GetMode() & (HELPMODE_CONTEXT | HELPMODE_EXTENDED) )
- ChangeHighlightItem( ITEMPOS_INVALID, TRUE );
+ ChangeHighlightItem( ITEMPOS_INVALID, sal_True );
Rectangle aHighlightRect( ImplGetItemRect( nHighlightedItem ) );
if( !ImplHandleHelpEvent( this, pMenu, nId, rHEvt, aHighlightRect ) )
@@ -5904,7 +5967,7 @@ void MenuBarWindow::StateChanged( StateChangedType nType )
if ( ( nType == STATE_CHANGE_CONTROLFOREGROUND ) ||
( nType == STATE_CHANGE_CONTROLBACKGROUND ) )
{
- ImplInitMenuWindow( this, FALSE, TRUE );
+ ImplInitMenuWindow( this, sal_False, sal_True );
Invalidate();
}
else if( pMenu )
@@ -5916,7 +5979,7 @@ void MenuBarWindow::ImplLayoutChanged()
{
if( pMenu )
{
- ImplInitMenuWindow( this, TRUE, TRUE );
+ ImplInitMenuWindow( this, sal_True, sal_True );
// Falls sich der Font geaendert hat.
long nHeight = pMenu->ImplCalcSize( this ).Height();
@@ -5968,16 +6031,16 @@ void MenuBarWindow::DataChanged( const DataChangedEvent& rDCEvt )
void MenuBarWindow::LoseFocus()
{
- if ( !HasChildPathFocus( TRUE ) )
- ChangeHighlightItem( ITEMPOS_INVALID, FALSE, FALSE );
+ if ( !HasChildPathFocus( sal_True ) )
+ ChangeHighlightItem( ITEMPOS_INVALID, sal_False, sal_False );
}
void MenuBarWindow::GetFocus()
{
if ( nHighlightedItem == ITEMPOS_INVALID )
{
- mbAutoPopup = FALSE; // do not open menu when activated by focus handling like taskpane cycling
- ChangeHighlightItem( 0, FALSE );
+ mbAutoPopup = sal_False; // do not open menu when activated by focus handling like taskpane cycling
+ ChangeHighlightItem( 0, sal_False );
}
}
@@ -5991,13 +6054,13 @@ void MenuBarWindow::GetFocus()
return xAcc;
}
-USHORT MenuBarWindow::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, const String& i_rToolTip, USHORT i_nPos )
+sal_uInt16 MenuBarWindow::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, const String& i_rToolTip, sal_uInt16 i_nPos )
{
// find first free button id
- USHORT nId = IID_DOCUMENTCLOSE;
- std::map< USHORT, AddButtonEntry >::const_iterator it;
+ sal_uInt16 nId = IID_DOCUMENTCLOSE;
+ std::map< sal_uInt16, AddButtonEntry >::const_iterator it;
if( i_nPos > m_aAddButtons.size() )
- i_nPos = static_cast<USHORT>(m_aAddButtons.size());
+ i_nPos = static_cast<sal_uInt16>(m_aAddButtons.size());
do
{
nId++;
@@ -6020,14 +6083,14 @@ USHORT MenuBarWindow::AddMenuBarButton( const Image& i_rImage, const Link& i_rLi
return nId;
}
-void MenuBarWindow::SetMenuBarButtonHighlightHdl( USHORT nId, const Link& rLink )
+void MenuBarWindow::SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link& rLink )
{
- std::map< USHORT, AddButtonEntry >::iterator it = m_aAddButtons.find( nId );
+ std::map< sal_uInt16, AddButtonEntry >::iterator it = m_aAddButtons.find( nId );
if( it != m_aAddButtons.end() )
it->second.m_aHighlightLink = rLink;
}
-Rectangle MenuBarWindow::GetMenuBarButtonRectPixel( USHORT nId )
+Rectangle MenuBarWindow::GetMenuBarButtonRectPixel( sal_uInt16 nId )
{
Rectangle aRect;
if( m_aAddButtons.find( nId ) != m_aAddButtons.end() )
@@ -6052,9 +6115,9 @@ Rectangle MenuBarWindow::GetMenuBarButtonRectPixel( USHORT nId )
return aRect;
}
-void MenuBarWindow::RemoveMenuBarButton( USHORT nId )
+void MenuBarWindow::RemoveMenuBarButton( sal_uInt16 nId )
{
- USHORT nPos = aCloser.GetItemPos( nId );
+ sal_uInt16 nPos = aCloser.GetItemPos( nId );
aCloser.RemoveItem( nPos );
m_aAddButtons.erase( nId );
aCloser.calcMinSize();
@@ -6064,9 +6127,9 @@ void MenuBarWindow::RemoveMenuBarButton( USHORT nId )
pMenu->mpSalMenu->RemoveMenuBarButton( nId );
}
-bool MenuBarWindow::HandleMenuButtonEvent( USHORT i_nButtonId )
+bool MenuBarWindow::HandleMenuButtonEvent( sal_uInt16 i_nButtonId )
{
- std::map< USHORT, AddButtonEntry >::iterator it = m_aAddButtons.find( i_nButtonId );
+ std::map< sal_uInt16, AddButtonEntry >::iterator it = m_aAddButtons.find( i_nButtonId );
if( it != m_aAddButtons.end() )
{
MenuBar::MenuBarButtonCallbackArg aArg;
@@ -6075,7 +6138,7 @@ bool MenuBarWindow::HandleMenuButtonEvent( USHORT i_nButtonId )
aArg.pMenuBar = dynamic_cast<MenuBar*>(pMenu);
return it->second.m_aSelectLink.Call( &aArg );
}
- return FALSE;
+ return sal_False;
}
ImplMenuDelData::ImplMenuDelData( const Menu* pMenu )
diff --git a/vcl/source/window/mnemonic.cxx b/vcl/source/window/mnemonic.cxx
index 3b61abb81bee..ca8bcf3c2917 100644
--- a/vcl/source/window/mnemonic.cxx
+++ b/vcl/source/window/mnemonic.cxx
@@ -49,9 +49,9 @@ MnemonicGenerator::MnemonicGenerator()
// -----------------------------------------------------------------------
-USHORT MnemonicGenerator::ImplGetMnemonicIndex( sal_Unicode c )
+sal_uInt16 MnemonicGenerator::ImplGetMnemonicIndex( sal_Unicode c )
{
- static USHORT const aImplMnemonicRangeTab[MNEMONIC_RANGES*2] =
+ static sal_uInt16 const aImplMnemonicRangeTab[MNEMONIC_RANGES*2] =
{
MNEMONIC_RANGE_1_START, MNEMONIC_RANGE_1_END,
MNEMONIC_RANGE_2_START, MNEMONIC_RANGE_2_END,
@@ -59,8 +59,8 @@ USHORT MnemonicGenerator::ImplGetMnemonicIndex( sal_Unicode c )
MNEMONIC_RANGE_4_START, MNEMONIC_RANGE_4_END
};
- USHORT nMnemonicIndex = 0;
- for ( USHORT i = 0; i < MNEMONIC_RANGES; i++ )
+ sal_uInt16 nMnemonicIndex = 0;
+ for ( sal_uInt16 i = 0; i < MNEMONIC_RANGES; i++ )
{
if ( (c >= aImplMnemonicRangeTab[i*2]) &&
(c <= aImplMnemonicRangeTab[i*2+1]) )
@@ -107,7 +107,7 @@ void MnemonicGenerator::RegisterMnemonic( const XubString& rKey )
sal_Unicode cMnemonic = ImplFindMnemonic( aKey );
if ( cMnemonic )
{
- USHORT nMnemonicIndex = ImplGetMnemonicIndex( cMnemonic );
+ sal_uInt16 nMnemonicIndex = ImplGetMnemonicIndex( cMnemonic );
if ( nMnemonicIndex != MNEMONIC_INDEX_NOTFOUND )
maMnemonics[nMnemonicIndex] = 0;
}
@@ -119,7 +119,7 @@ void MnemonicGenerator::RegisterMnemonic( const XubString& rKey )
{
sal_Unicode c = aKey.GetChar( nIndex );
- USHORT nMnemonicIndex = ImplGetMnemonicIndex( c );
+ sal_uInt16 nMnemonicIndex = ImplGetMnemonicIndex( c );
if ( nMnemonicIndex != MNEMONIC_INDEX_NOTFOUND )
{
if ( maMnemonics[nMnemonicIndex] && (maMnemonics[nMnemonicIndex] < 0xFF) )
@@ -133,24 +133,24 @@ void MnemonicGenerator::RegisterMnemonic( const XubString& rKey )
// -----------------------------------------------------------------------
-BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey )
+sal_Bool MnemonicGenerator::CreateMnemonic( XubString& rKey )
{
if ( !rKey.Len() || ImplFindMnemonic( rKey ) )
- return FALSE;
+ return sal_False;
const ::com::sun::star::lang::Locale& rLocale = Application::GetSettings().GetUILocale();
uno::Reference < i18n::XCharacterClassification > xCharClass = GetCharClass();
// Don't crash even when we don't have access to i18n service
if ( !xCharClass.is() )
- return FALSE;
+ return sal_False;
XubString aKey = xCharClass->toUpper( rKey, 0, rKey.Len(), rLocale );
- BOOL bChanged = FALSE;
+ sal_Bool bChanged = sal_False;
xub_StrLen nLen = aKey.Len();
- BOOL bCJK = FALSE;
+ sal_Bool bCJK = sal_False;
switch( Application::GetSettings().GetUILanguage() )
{
case LANGUAGE_JAPANESE:
@@ -161,7 +161,7 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey )
case LANGUAGE_CHINESE_MACAU:
case LANGUAGE_KOREAN:
case LANGUAGE_KOREAN_JOHAB:
- bCJK = TRUE;
+ bCJK = sal_True;
break;
default:
break;
@@ -173,8 +173,8 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey )
// #110720#, avoid CJK-style mnemonics for latin-only strings that do not contain useful mnemonic chars
if( bCJK )
{
- BOOL bLatinOnly = TRUE;
- BOOL bMnemonicIndexFound = FALSE;
+ sal_Bool bLatinOnly = sal_True;
+ sal_Bool bMnemonicIndexFound = sal_False;
sal_Unicode c;
xub_StrLen nIndex;
@@ -184,19 +184,19 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey )
if ( ((c >= 0x3000) && (c <= 0xD7FF)) || // cjk
((c >= 0xFF61) && (c <= 0xFFDC)) ) // halfwidth forms
{
- bLatinOnly = FALSE;
+ bLatinOnly = sal_False;
break;
}
if( ImplGetMnemonicIndex( c ) != MNEMONIC_INDEX_NOTFOUND )
- bMnemonicIndexFound = TRUE;
+ bMnemonicIndexFound = sal_True;
}
if( bLatinOnly && !bMnemonicIndexFound )
- return FALSE;
+ return sal_False;
}
int nCJK = 0;
- USHORT nMnemonicIndex;
+ sal_uInt16 nMnemonicIndex;
sal_Unicode c;
xub_StrLen nIndex = 0;
if( !bCJK )
@@ -226,7 +226,7 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey )
{
maMnemonics[nMnemonicIndex] = 0;
rKey.Insert( MNEMONIC_CHAR, nIndex );
- bChanged = TRUE;
+ bChanged = sal_True;
break;
}
}
@@ -247,8 +247,8 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey )
// 2) search for a unique/uncommon character
if ( !bChanged )
{
- USHORT nBestCount = 0xFFFF;
- USHORT nBestMnemonicIndex = 0;
+ sal_uInt16 nBestCount = 0xFFFF;
+ sal_uInt16 nBestMnemonicIndex = 0;
xub_StrLen nBestIndex = 0;
nIndex = 0;
do
@@ -278,7 +278,7 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey )
{
maMnemonics[nBestMnemonicIndex] = 0;
rKey.Insert( MNEMONIC_CHAR, nBestIndex );
- bChanged = TRUE;
+ bChanged = sal_True;
}
}
}
@@ -326,7 +326,7 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey )
nIndex--;
}
rKey.Insert( aStr, nIndex );
- bChanged = TRUE;
+ bChanged = sal_True;
break;
}
}
@@ -351,7 +351,7 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey )
// {
// maMnemonics[nMnemonicIndex] = 0;
// rKey.Insert( MNEMONIC_CHAR, nIndex );
-// bChanged = TRUE;
+// bChanged = sal_True;
// break;
// }
//
diff --git a/vcl/source/window/mnemonicengine.cxx b/vcl/source/window/mnemonicengine.cxx
index f76c29e5ba9c..1ca9f2c22d57 100644
--- a/vcl/source/window/mnemonicengine.cxx
+++ b/vcl/source/window/mnemonicengine.cxx
@@ -103,7 +103,7 @@ namespace vcl
//--------------------------------------------------------------------
bool MnemonicEngine::HandleKeyEvent( const KeyEvent& _rKEvt )
{
- BOOL bAccelKey = _rKEvt.GetKeyCode().IsMod2();
+ sal_Bool bAccelKey = _rKEvt.GetKeyCode().IsMod2();
if ( !bAccelKey )
return false;
diff --git a/vcl/source/window/mouseevent.cxx b/vcl/source/window/mouseevent.cxx
index 4dbb7385f94f..2e76750e1cf5 100644
--- a/vcl/source/window/mouseevent.cxx
+++ b/vcl/source/window/mouseevent.cxx
@@ -39,7 +39,7 @@
MouseEvent::MouseEvent( const ::com::sun::star::awt::MouseEvent& rEvent )
: maPos( rEvent.X, rEvent.Y )
, mnMode( 0 )
-, mnClicks( static_cast< USHORT >( rEvent.ClickCount ) )
+, mnClicks( static_cast< sal_uInt16 >( rEvent.ClickCount ) )
, mnCode( 0 )
{
if( rEvent.Modifiers )
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index 07eafcac357a..ae4c148d5807 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -70,10 +70,10 @@ void MessBox::ImplInitMessBoxData()
mpFixedText = NULL;
mpFixedImage = NULL;
mnSoundType = 0;
- mbHelpBtn = FALSE;
- mbSound = TRUE;
+ mbHelpBtn = sal_False;
+ mbSound = sal_True;
mpCheckBox = NULL;
- mbCheck = FALSE;
+ mbCheck = sal_False;
}
// -----------------------------------------------------------------------
@@ -81,11 +81,11 @@ void MessBox::ImplInitMessBoxData()
void MessBox::ImplInitButtons()
{
WinBits nStyle = GetStyle();
- USHORT nOKFlags = BUTTONDIALOG_OKBUTTON;
- USHORT nCancelFlags = BUTTONDIALOG_CANCELBUTTON;
- USHORT nRetryFlags = 0;
- USHORT nYesFlags = 0;
- USHORT nNoFlags = 0;
+ sal_uInt16 nOKFlags = BUTTONDIALOG_OKBUTTON;
+ sal_uInt16 nCancelFlags = BUTTONDIALOG_CANCELBUTTON;
+ sal_uInt16 nRetryFlags = 0;
+ sal_uInt16 nYesFlags = 0;
+ sal_uInt16 nNoFlags = 0;
if ( nStyle & WB_OK_CANCEL )
{
@@ -133,8 +133,8 @@ void MessBox::ImplInitButtons()
}
else if ( nStyle & WB_ABORT_RETRY_IGNORE )
{
- USHORT nAbortFlags = 0;
- USHORT nIgnoreFlags = 0;
+ sal_uInt16 nAbortFlags = 0;
+ sal_uInt16 nIgnoreFlags = 0;
if ( nStyle & WB_DEF_CANCEL )
nAbortFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
@@ -186,16 +186,15 @@ MessBox::MessBox( Window* pParent, const ResId& rResId ) :
ImplInitMessBoxData();
GetRes( rResId.SetRT( RSC_MESSBOX ) );
- USHORT nHiButtons = ReadShortRes();
- USHORT nLoButtons = ReadShortRes();
- USHORT nHiDefButton = ReadShortRes();
- USHORT nLoDefButton = ReadShortRes();
- USHORT nHiHelpId = ReadShortRes();
- USHORT nLoHelpId = ReadShortRes();
- /* USHORT bSysModal = */ ReadShortRes();
- SetHelpId( ((ULONG)nHiHelpId << 16) + nLoHelpId );
- WinBits nBits = (((ULONG)nHiButtons << 16) + nLoButtons) |
- (((ULONG)nHiDefButton << 16) + nLoDefButton);
+ sal_uInt16 nHiButtons = ReadShortRes();
+ sal_uInt16 nLoButtons = ReadShortRes();
+ sal_uInt16 nHiDefButton = ReadShortRes();
+ sal_uInt16 nLoDefButton = ReadShortRes();
+ rtl::OString aHelpId( ReadByteStringRes() );
+ /* sal_uInt16 bSysModal = */ ReadShortRes();
+ SetHelpId( aHelpId );
+ WinBits nBits = (((sal_uLong)nHiButtons << 16) + nLoButtons) |
+ (((sal_uLong)nHiDefButton << 16) + nLoDefButton);
ImplInit( pParent, nBits | WB_MOVEABLE | WB_HORZ | WB_CENTER );
ImplLoadRes( rResId );
@@ -227,12 +226,12 @@ MessBox::~MessBox()
void MessBox::ImplPosControls()
{
- if ( GetHelpId() )
+ if ( GetHelpId().getLength() )
{
if ( !mbHelpBtn )
{
AddButton( BUTTON_HELP, BUTTONID_HELP, BUTTONDIALOG_HELPBUTTON, 3 );
- mbHelpBtn = TRUE;
+ mbHelpBtn = sal_True;
}
}
else
@@ -240,7 +239,7 @@ void MessBox::ImplPosControls()
if ( mbHelpBtn )
{
RemoveButton( BUTTONID_HELP );
- mbHelpBtn = FALSE;
+ mbHelpBtn = sal_False;
}
}
@@ -258,7 +257,7 @@ void MessBox::ImplPosControls()
long nMaxLineWidth;
long nWidth;
WinBits nWinStyle = WB_LEFT | WB_WORDBREAK | WB_NOLABEL | WB_INFO;
- USHORT nTextStyle = TEXT_DRAW_MULTILINE | TEXT_DRAW_TOP | TEXT_DRAW_LEFT;
+ sal_uInt16 nTextStyle = TEXT_DRAW_MULTILINE | TEXT_DRAW_TOP | TEXT_DRAW_LEFT;
if ( mpFixedText )
delete mpFixedText;
@@ -277,7 +276,7 @@ void MessBox::ImplPosControls()
// Message-Text um Tabs bereinigen
XubString aTabStr( RTL_CONSTASCII_USTRINGPARAM( " " ) );
- USHORT nIndex = 0;
+ sal_uInt16 nIndex = 0;
while ( nIndex != STRING_NOTFOUND )
nIndex = aMessText.SearchAndReplace( '\t', aTabStr, nIndex );
@@ -414,6 +413,8 @@ void MessBox::ImplPosControls()
}
mpFixedText = new FixedText( this, nWinStyle );
+ if( mpFixedText->GetStyle() & WB_EXTRAOFFSET ) // TODO: use CalcMinimumSize() instead
+ aFixedSize.Width() += 2;
mpFixedText->SetPosSizePixel( aTextPos, aFixedSize );
mpFixedText->SetText( aMessText );
mpFixedText->Show();
@@ -435,14 +436,14 @@ void MessBox::StateChanged( StateChangedType nType )
// -----------------------------------------------------------------------
-BOOL MessBox::GetCheckBoxState() const
+sal_Bool MessBox::GetCheckBoxState() const
{
return mpCheckBox ? mpCheckBox->IsChecked() : mbCheck;
}
// -----------------------------------------------------------------------
-void MessBox::SetCheckBoxState( BOOL bCheck )
+void MessBox::SetCheckBoxState( sal_Bool bCheck )
{
if( mpCheckBox ) mpCheckBox->Check( bCheck );
mbCheck = bCheck;
@@ -459,10 +460,10 @@ void MessBox::SetDefaultCheckBoxText()
// -----------------------------------------------------------------------
-BOOL MessBox::SetModeImage( const Image& rImage )
+sal_Bool MessBox::SetModeImage( const Image& rImage )
{
SetImage( rImage );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -494,7 +495,7 @@ void InfoBox::ImplInitInfoBoxData()
SetText( Application::GetDisplayName() );
SetImage( InfoBox::GetStandardImage() );
- mnSoundType = ((USHORT)SOUND_INFO)+1;
+ mnSoundType = ((sal_uInt16)SOUND_INFO)+1;
}
// -----------------------------------------------------------------------
@@ -530,7 +531,7 @@ void WarningBox::ImplInitWarningBoxData()
SetText( Application::GetDisplayName() );
SetImage( WarningBox::GetStandardImage() );
- mnSoundType = ((USHORT)SOUND_WARNING)+1;
+ mnSoundType = ((sal_uInt16)SOUND_WARNING)+1;
}
// -----------------------------------------------------------------------
@@ -576,7 +577,7 @@ void ErrorBox::ImplInitErrorBoxData()
SetText( Application::GetDisplayName() );
SetImage( ErrorBox::GetStandardImage() );
- mnSoundType = ((USHORT)SOUND_ERROR)+1;
+ mnSoundType = ((sal_uInt16)SOUND_ERROR)+1;
}
// -----------------------------------------------------------------------
@@ -613,7 +614,7 @@ void QueryBox::ImplInitQueryBoxData()
SetText( Application::GetDisplayName() );
SetImage( QueryBox::GetStandardImage() );
- mnSoundType = ((USHORT)SOUND_QUERY)+1;
+ mnSoundType = ((sal_uInt16)SOUND_QUERY)+1;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 4932b689a9c2..40b80e234ff3 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -47,7 +47,7 @@
#include "unotools/localedatawrapper.hxx"
-#include "rtl/ustrbuf.hxx"
+#include "rtl/strbuf.hxx"
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/container/XNameAccess.hpp"
@@ -61,19 +61,23 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::container;
using namespace com::sun::star::beans;
-#define HELPID_PREFIX ".HelpId:vcl:PrintDialog"
-#define SMHID2( a, b ) SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( HELPID_PREFIX ":" a ":" b ) ), HID_PRINTDLG ) )
-#define SMHID1( a ) SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( HELPID_PREFIX ":" a ) ), HID_PRINTDLG ) )
-
PrintDialog::PrintPreviewWindow::PrintPreviewWindow( Window* i_pParent, const ResId& i_rId )
: Window( i_pParent, i_rId )
, maOrigSize( 10, 10 )
, maPageVDev( *this )
, maToolTipString( String( VclResId( SV_PRINT_PRINTPREVIEW_TXT ) ) )
+ , mbGreyscale( false )
+ , maHorzDim( this, WB_HORZ | WB_CENTER )
+ , maVertDim( this, WB_VERT | WB_VCENTER )
{
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
maPageVDev.SetBackground( Color( COL_WHITE ) );
+ maHorzDim.Show();
+ maVertDim.Show();
+
+ maHorzDim.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "2.0in" ) ) );
+ maVertDim.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "2.0in" ) ) );
}
PrintDialog::PrintPreviewWindow::~PrintPreviewWindow()
@@ -93,9 +97,10 @@ void PrintDialog::PrintPreviewWindow::DataChanged( const DataChangedEvent& i_rDC
void PrintDialog::PrintPreviewWindow::Resize()
{
Size aNewSize( GetSizePixel() );
+ long nTextHeight = maHorzDim.GetTextHeight();
// leave small space for decoration
- aNewSize.Width() -= 2;
- aNewSize.Height() -= 2;
+ aNewSize.Width() -= nTextHeight + 2;
+ aNewSize.Height() -= nTextHeight + 2;
Size aScaledSize;
double fScale = 1.0;
@@ -136,17 +141,29 @@ void PrintDialog::PrintPreviewWindow::Resize()
fZoom /= 2.0;
}
- maPageVDev.SetOutputSizePixel( aScaledSize, FALSE );
+ maPageVDev.SetOutputSizePixel( aScaledSize, sal_False );
+
+ // position dimension lines
+ Point aRef( nTextHeight + (aNewSize.Width() - maPreviewSize.Width())/2,
+ nTextHeight + (aNewSize.Height() - maPreviewSize.Height())/2 );
+ maHorzDim.SetPosSizePixel( Point( aRef.X(), aRef.Y() - nTextHeight ),
+ Size( maPreviewSize.Width(), nTextHeight ) );
+ maVertDim.SetPosSizePixel( Point( aRef.X() - nTextHeight, aRef.Y() ),
+ Size( nTextHeight, maPreviewSize.Height() ) );
+
}
void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& )
{
+ long nTextHeight = maHorzDim.GetTextHeight();
Size aSize( GetSizePixel() );
+ aSize.Width() -= nTextHeight;
+ aSize.Height() -= nTextHeight;
if( maReplacementString.getLength() != 0 )
{
// replacement is active
Push();
- Rectangle aTextRect( Point( 0, 0 ), aSize );
+ Rectangle aTextRect( Point( nTextHeight, nTextHeight ), aSize );
DecorationView aVw( this );
aVw.DrawFrame( aTextRect, FRAME_DRAW_GROUP );
aTextRect.Left() += 2;
@@ -164,8 +181,8 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& )
{
GDIMetaFile aMtf( maMtf );
- Point aOffset( (aSize.Width() - maPreviewSize.Width()) / 2,
- (aSize.Height() - maPreviewSize.Height()) / 2 );
+ Point aOffset( (aSize.Width() - maPreviewSize.Width()) / 2 + nTextHeight,
+ (aSize.Height() - maPreviewSize.Height()) / 2 + nTextHeight );
Size aVDevSize( maPageVDev.GetOutputSizePixel() );
const Size aLogicSize( maPageVDev.PixelToLogic( aVDevSize, MapMode( MAP_100TH_MM ) ) );
@@ -180,6 +197,11 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& )
maPageVDev.Erase();
maPageVDev.Push();
maPageVDev.SetMapMode( MAP_100TH_MM );
+ sal_uLong nOldDrawMode = maPageVDev.GetDrawMode();
+ if( mbGreyscale )
+ maPageVDev.SetDrawMode( maPageVDev.GetDrawMode() |
+ ( DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_GRAYTEXT |
+ DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT ) );
aMtf.WindStart();
aMtf.Scale( fScale, fScale );
aMtf.WindStart();
@@ -189,6 +211,7 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& )
SetMapMode( MAP_PIXEL );
maPageVDev.SetMapMode( MAP_PIXEL );
DrawOutDev( aOffset, maPreviewSize, Point( 0, 0 ), aVDevSize, maPageVDev );
+ maPageVDev.SetDrawMode( nOldDrawMode );
DecorationView aVw( this );
Rectangle aFrame( aOffset + Point( -1, -1 ), Size( maPreviewSize.Width() + 2, maPreviewSize.Height() + 2 ) );
@@ -218,27 +241,50 @@ void PrintDialog::PrintPreviewWindow::Command( const CommandEvent& rEvt )
void PrintDialog::PrintPreviewWindow::setPreview( const GDIMetaFile& i_rNewPreview,
const Size& i_rOrigSize,
+ const rtl::OUString& i_rPaperName,
const rtl::OUString& i_rReplacement,
sal_Int32 i_nDPIX,
- sal_Int32 i_nDPIY
+ sal_Int32 i_nDPIY,
+ bool i_bGreyscale
)
{
rtl::OUStringBuffer aBuf( 256 );
aBuf.append( maToolTipString );
- #if OSL_DEBUG_LEVEL > 0
- aBuf.appendAscii( "\n---\nPageSize: " );
- aBuf.append( sal_Int32( i_rOrigSize.Width()/100) );
- aBuf.appendAscii( "mm x " );
- aBuf.append( sal_Int32( i_rOrigSize.Height()/100) );
- aBuf.appendAscii( "mm" );
- #endif
SetQuickHelpText( aBuf.makeStringAndClear() );
maMtf = i_rNewPreview;
maOrigSize = i_rOrigSize;
maReplacementString = i_rReplacement;
+ mbGreyscale = i_bGreyscale;
maPageVDev.SetReferenceDevice( i_nDPIX, i_nDPIY );
- maPageVDev.EnableOutput( TRUE );
+ maPageVDev.EnableOutput( sal_True );
+
+ // use correct measurements
+ const LocaleDataWrapper& rLocWrap( GetSettings().GetLocaleDataWrapper() );
+ MapUnit eUnit = MAP_MM;
+ int nDigits = 0;
+ if( rLocWrap.getMeasurementSystemEnum() == MEASURE_US )
+ {
+ eUnit = MAP_100TH_INCH;
+ nDigits = 2;
+ }
+ Size aLogicPaperSize( LogicToLogic( i_rOrigSize, MapMode( MAP_100TH_MM ), MapMode( eUnit ) ) );
+ String aNumText( rLocWrap.getNum( aLogicPaperSize.Width(), nDigits ) );
+ aBuf.append( aNumText );
+ aBuf.appendAscii( eUnit == MAP_MM ? "mm" : "in" );
+ if( i_rPaperName.getLength() )
+ {
+ aBuf.appendAscii( " (" );
+ aBuf.append( i_rPaperName );
+ aBuf.append( sal_Unicode(')') );
+ }
+ maHorzDim.SetText( aBuf.makeStringAndClear() );
+
+ aNumText = rLocWrap.getNum( aLogicPaperSize.Height(), nDigits );
+ aBuf.append( aNumText );
+ aBuf.appendAscii( eUnit == MAP_MM ? "mm" : "in" );
+ maVertDim.SetText( aBuf.makeStringAndClear() );
+
Resize();
Invalidate();
}
@@ -291,12 +337,18 @@ void PrintDialog::ShowNupOrderWindow::Paint( const Rectangle& i_rRect )
int nX = 0, nY = 0;
switch( mnOrderMode )
{
- case SV_PRINT_PRT_NUP_ORDER_LRTD:
+ case SV_PRINT_PRT_NUP_ORDER_LRTB:
nX = (i % mnColumns); nY = (i / mnColumns);
break;
- case SV_PRINT_PRT_NUP_ORDER_TDLR:
+ case SV_PRINT_PRT_NUP_ORDER_TBLR:
nX = (i / mnRows); nY = (i % mnRows);
break;
+ case SV_PRINT_PRT_NUP_ORDER_RLTB:
+ nX = mnColumns - 1 - (i % mnColumns); nY = (i / mnColumns);
+ break;
+ case SV_PRINT_PRT_NUP_ORDER_TBRL:
+ nX = mnColumns - 1 - (i / mnRows); nY = (i % mnRows);
+ break;
}
Size aTextSize( GetTextWidth( aPageText ), nTextHeight );
int nDeltaX = (aSubSize.Width() - aTextSize.Width()) / 2;
@@ -336,13 +388,13 @@ PrintDialog::NUpTabPage::NUpTabPage( Window* i_pParent, const ResId& rResId )
FreeResource();
maNupOrderWin.Show();
- maPagesBtn.Check( TRUE );
- maBrochureBtn.Show( FALSE );
+ maPagesBtn.Check( sal_True );
+ maBrochureBtn.Show( sal_False );
// setup field units for metric fields
const LocaleDataWrapper& rLocWrap( maPageMarginEdt.GetLocaleDataWrapper() );
FieldUnit eUnit = FUNIT_MM;
- USHORT nDigits = 0;
+ sal_uInt16 nDigits = 0;
if( rLocWrap.getMeasurementSystemEnum() == MEASURE_US )
{
eUnit = FUNIT_INCH;
@@ -356,28 +408,6 @@ PrintDialog::NUpTabPage::NUpTabPage( Window* i_pParent, const ResId& rResId )
maPageMarginEdt.SetDecimalDigits( nDigits );
maSheetMarginEdt.SetDecimalDigits( nDigits );
- SMHID1( "NUpPage" );
- maNupLine.SMHID2("NUpPage", "Layout");
- maBrochureBtn.SMHID2("NUpPage", "Brochure" );
- maPagesBtn.SMHID2( "NUpPage", "PagesPerSheet" );
- maPagesBoxTitleTxt.SMHID2( "NUpPage", "PagesPerSheetLabel" );
- maNupPagesBox.SMHID2( "NUpPage", "PagesPerSheetBox" );
- maNupNumPagesTxt.SMHID2( "NUpPage", "Columns" );
- maNupColEdt.SMHID2( "NUpPage", "ColumnsBox" );
- maNupTimesTxt.SMHID2( "NUpPage", "Rows" );
- maNupRowsEdt.SMHID2( "NUpPage", "RowsBox" );
- maPageMarginTxt1.SMHID2( "NUpPage", "PageMargin" );
- maPageMarginEdt.SMHID2( "NUpPage", "PageMarginBox" );
- maPageMarginTxt2.SMHID2( "NUpPage", "PageMarginCont" );
- maSheetMarginTxt1.SMHID2( "NUpPage", "SheetMargin" );
- maSheetMarginEdt.SMHID2( "NUpPage", "SheetMarginBox" );
- maSheetMarginTxt2.SMHID2( "NUpPage", "SheetMarginCont" );
- maNupOrientationTxt.SMHID2( "NUpPage", "Orientation" );
- maNupOrientationBox.SMHID2( "NUpPage", "OrientationBox" );
- maNupOrderTxt.SMHID2( "NUpPage", "Order" );
- maNupOrderBox.SMHID2( "NUpPage", "OrderBox" );
- maBorderCB.SMHID2( "NUpPage", "BorderBox" );
-
setupLayout();
}
@@ -387,7 +417,7 @@ PrintDialog::NUpTabPage::~NUpTabPage()
void PrintDialog::NUpTabPage::enableNupControls( bool bEnable )
{
- maNupPagesBox.Enable( TRUE );
+ maNupPagesBox.Enable( sal_True );
maNupNumPagesTxt.Enable( bEnable );
maNupColEdt.Enable( bEnable );
maNupTimesTxt.Enable( bEnable );
@@ -420,22 +450,21 @@ void PrintDialog::NUpTabPage::showAdvancedControls( bool i_bShow )
maSheetMarginTxt2.Show( i_bShow );
maNupOrientationTxt.Show( i_bShow );
maNupOrientationBox.Show( i_bShow );
- maLayout.resize();
+ getLayout()->resize();
}
void PrintDialog::NUpTabPage::setupLayout()
{
+ boost::shared_ptr<vcl::RowOrColumn> xLayout =
+ boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() );
Size aBorder( LogicToPixel( Size( 6, 6 ), MapMode( MAP_APPFONT ) ) );
/* According to OOo style guide, the horizontal indentation of child
elements to their parent element should always be 6 map units. */
long nIndent = aBorder.Width();
- maLayout.setParentWindow( this );
- maLayout.setOuterBorder( aBorder.Width() );
-
- maLayout.addWindow( &maNupLine );
- boost::shared_ptr< vcl::RowOrColumn > xRow( new vcl::RowOrColumn( &maLayout, false ) );
- maLayout.addChild( xRow );
+ xLayout->addWindow( &maNupLine );
+ boost::shared_ptr< vcl::RowOrColumn > xRow( new vcl::RowOrColumn( xLayout.get(), false ) );
+ xLayout->addChild( xRow );
boost::shared_ptr< vcl::Indenter > xIndent( new vcl::Indenter( xRow.get() ) );
xRow->addChild( xIndent );
@@ -471,7 +500,7 @@ void PrintDialog::NUpTabPage::setupLayout()
xMainCol->addRow( &maNupOrderTxt, &maNupOrderBox, nIndent );
xMainCol->setBorders( xMainCol->addWindow( &maBorderCB ), nIndent, 0, 0, 0 );
- xSpacer.reset( new vcl::Spacer( xMainCol.get(), 0, Size( 10, aBorder.Width() ) ) );
+ xSpacer.reset( new vcl::Spacer( xMainCol.get(), 0, Size( 10, WindowArranger::getDefaultBorder() ) ) );
xMainCol->addChild( xSpacer );
xRow.reset( new vcl::RowOrColumn( xMainCol.get(), false ) );
@@ -483,11 +512,6 @@ void PrintDialog::NUpTabPage::setupLayout()
showAdvancedControls( false );
}
-void PrintDialog::NUpTabPage::Resize()
-{
- maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) );
-}
-
void PrintDialog::NUpTabPage::initFromMultiPageSetup( const vcl::PrinterController::MultiPageSetup& i_rMPS )
{
maSheetMarginEdt.SetValue( maSheetMarginEdt.Normalize( i_rMPS.nLeftMargin ), FUNIT_100TH_MM );
@@ -523,30 +547,13 @@ PrintDialog::JobTabPage::JobTabPage( Window* i_pParent, const ResId& rResId )
, maCopyCountField( this, VclResId( SV_PRINT_COPYCOUNT_FIELD ) )
, maCollateBox( this, VclResId( SV_PRINT_COLLATE ) )
, maCollateImage( this, VclResId( SV_PRINT_COLLATE_IMAGE ) )
+ , maReverseOrderBox( this, VclResId( SV_PRINT_OPT_REVERSE ) )
, maCollateImg( VclResId( SV_PRINT_COLLATE_IMG ) )
, maNoCollateImg( VclResId( SV_PRINT_NOCOLLATE_IMG ) )
, mnCollateUIMode( 0 )
- , maLayout( NULL, true )
{
FreeResource();
- SMHID1( "JobPage" );
- maPrinterFL.SMHID2( "JobPage", "Printer" );
- maPrinters.SMHID2( "JobPage", "PrinterList" );
- maDetailsBtn.SMHID2( "JobPage", "DetailsBtn" );
- maStatusLabel.SMHID2( "JobPage", "StatusLabel" );
- maStatusTxt.SMHID2( "JobPage", "StatusText" );
- maLocationLabel.SMHID2( "JobPage", "LocationLabel" );
- maLocationTxt.SMHID2( "JobPage", "LocationText" );
- maCommentLabel.SMHID2( "JobPage", "CommentLabel" );
- maCommentTxt.SMHID2( "JobPage", "CommentText" );
- maSetupButton.SMHID2( "JobPage", "Properties" );
- maCopies.SMHID2( "JobPage", "CopiesLine" );
- maCopySpacer.SMHID2( "JobPage", "CopySpacer" );
- maCopyCount.SMHID2( "JobPage", "CopiesText" );
- maCopyCountField.SMHID2( "JobPage", "Copies" );
- maCollateBox.SMHID2( "JobPage", "Collate" );
- maCollateImage.SMHID2( "JobPage", "CollateImage" );
maCopySpacer.Show();
maStatusTxt.Show();
@@ -566,39 +573,37 @@ void PrintDialog::JobTabPage::setupLayout()
// sets the results of GetOptimalSize in a normal ListBox
maPrinters.SetDropDownLineCount( 4 );
- Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
-
- maLayout.setParentWindow( this );
- maLayout.setOuterBorder( aBorder.Width() );
+ boost::shared_ptr<vcl::RowOrColumn> xLayout =
+ boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() );
// add printer fixed line
- maLayout.addWindow( &maPrinterFL );
+ xLayout->addWindow( &maPrinterFL );
// add print LB
- maLayout.addWindow( &maPrinters, 3 );
+ xLayout->addWindow( &maPrinters, 3 );
// create a row for details button/text and properties button
- boost::shared_ptr< vcl::RowOrColumn > xDetRow( new vcl::RowOrColumn( &maLayout, false ) );
- maLayout.addChild( xDetRow );
+ boost::shared_ptr< vcl::RowOrColumn > xDetRow( new vcl::RowOrColumn( xLayout.get(), false ) );
+ xLayout->addChild( xDetRow );
xDetRow->addWindow( &maDetailsBtn );
xDetRow->addChild( new vcl::Spacer( xDetRow.get(), 2 ) );
xDetRow->addWindow( &maSetupButton );
// create an indent for details
- boost::shared_ptr< vcl::Indenter > xIndent( new vcl::Indenter( &maLayout ) );
- maLayout.addChild( xIndent );
+ boost::shared_ptr< vcl::Indenter > xIndent( new vcl::Indenter( xLayout.get() ) );
+ xLayout->addChild( xIndent );
// remember details controls
mxDetails = xIndent;
// create a column for the details
- boost::shared_ptr< vcl::LabelColumn > xLabelCol( new vcl::LabelColumn( xIndent.get(), aBorder.Height() ) );
+ boost::shared_ptr< vcl::LabelColumn > xLabelCol( new vcl::LabelColumn( xIndent.get() ) );
xIndent->setChild( xLabelCol );
xLabelCol->addRow( &maStatusLabel, &maStatusTxt );
xLabelCol->addRow( &maLocationLabel, &maLocationTxt );
xLabelCol->addRow( &maCommentLabel, &maCommentTxt );
// add print range and copies columns
- maLayout.addWindow( &maCopies );
- boost::shared_ptr< vcl::RowOrColumn > xRangeRow( new vcl::RowOrColumn( &maLayout, false, aBorder.Width() ) );
- maLayout.addChild( xRangeRow );
+ xLayout->addWindow( &maCopies );
+ boost::shared_ptr< vcl::RowOrColumn > xRangeRow( new vcl::RowOrColumn( xLayout.get(), false ) );
+ xLayout->addChild( xRangeRow );
// create print range and add to range row
mxPrintRange.reset( new vcl::RowOrColumn( xRangeRow.get() ) );
@@ -632,8 +637,8 @@ void PrintDialog::JobTabPage::readFromSettings()
if( aValue.equalsIgnoreAsciiCaseAscii( "alwaysoff" ) )
{
mnCollateUIMode = 1;
- maCollateBox.Check( FALSE );
- maCollateBox.Enable( FALSE );
+ maCollateBox.Check( sal_False );
+ maCollateBox.Enable( sal_False );
}
else
{
@@ -657,24 +662,13 @@ void PrintDialog::JobTabPage::storeToSettings()
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("false")) );
}
-void PrintDialog::JobTabPage::Resize()
-{
- maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
-}
-
PrintDialog::OutputOptPage::OutputOptPage( Window* i_pParent, const ResId& i_rResId )
: TabPage( i_pParent, i_rResId )
, maOptionsLine( this, VclResId( SV_PRINT_OPT_PRINT_FL ) )
, maToFileBox( this, VclResId( SV_PRINT_OPT_TOFILE ) )
, maCollateSingleJobsBox( this, VclResId( SV_PRINT_OPT_SINGLEJOBS ) )
- , maReverseOrderBox( this, VclResId( SV_PRINT_OPT_REVERSE ) )
{
FreeResource();
- SMHID1( "OptPage" );
- maOptionsLine.SMHID2( "OptPage", "Options" );
- maToFileBox.SMHID2( "OptPage", "ToFile" );
- maCollateSingleJobsBox.SMHID2( "OptPage", "SingleJobs" );
- maReverseOrderBox.SMHID2( "OptPage", "Reverse" );
setupLayout();
}
@@ -685,20 +679,17 @@ PrintDialog::OutputOptPage::~OutputOptPage()
void PrintDialog::OutputOptPage::setupLayout()
{
- Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
-
- maLayout.setParentWindow( this );
- maLayout.setOuterBorder( aBorder.Width() );
+ boost::shared_ptr<vcl::RowOrColumn> xLayout =
+ boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() );
- maLayout.addWindow( &maOptionsLine );
- boost::shared_ptr<vcl::Indenter> xIndent( new vcl::Indenter( &maLayout, aBorder.Width() ) );
- maLayout.addChild( xIndent );
- boost::shared_ptr<vcl::RowOrColumn> xCol( new vcl::RowOrColumn( xIndent.get(), aBorder.Height() ) );
+ xLayout->addWindow( &maOptionsLine );
+ boost::shared_ptr<vcl::Indenter> xIndent( new vcl::Indenter( xLayout.get(), -1 ) );
+ xLayout->addChild( xIndent );
+ boost::shared_ptr<vcl::RowOrColumn> xCol( new vcl::RowOrColumn( xIndent.get() ) );
xIndent->setChild( xCol );
mxOptGroup = xCol;
xCol->addWindow( &maToFileBox );
xCol->addWindow( &maCollateSingleJobsBox );
- xCol->addWindow( &maReverseOrderBox );
}
void PrintDialog::OutputOptPage::readFromSettings()
@@ -714,12 +705,6 @@ void PrintDialog::OutputOptPage::storeToSettings()
: rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("false")) );
}
-void PrintDialog::OutputOptPage::Resize()
-{
- maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
-}
-
-
PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterController>& i_rController )
: ModalDialog( i_pParent, VclResId( SV_DLG_PRINT ) )
, maOKButton( this, VclResId( SV_PRINT_OK ) )
@@ -759,16 +744,14 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont
// set symbols on forward and backward button
maBackwardBtn.SetSymbol( SYMBOL_PREV );
maForwardBtn.SetSymbol( SYMBOL_NEXT );
- maBackwardBtn.ImplSetSmallSymbol( TRUE );
- maForwardBtn.ImplSetSmallSymbol( TRUE );
+ maBackwardBtn.ImplSetSmallSymbol( sal_True );
+ maForwardBtn.ImplSetSmallSymbol( sal_True );
maPageStr = maNumPagesText.GetText();
// init reverse print
- maOptionsPage.maReverseOrderBox.Check( maPController->getReversePrint() );
+ maJobPage.maReverseOrderBox.Check( maPController->getReversePrint() );
- // get the first page
- preparePreview( true, true );
// fill printer listbox
const std::vector< rtl::OUString >& rQueues( Printer::GetPrinterQueues() );
@@ -800,6 +783,12 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont
maPController->setPrinter( boost::shared_ptr<Printer>( new Printer( Printer::GetDefaultPrinterName() ) ) );
}
}
+ // not printing to file
+ maPController->resetPrinterOptions( false );
+
+ // get the first page
+ preparePreview( true, true );
+
// update the text fields for the printer
updatePrinterText();
@@ -835,7 +824,7 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont
maJobPage.maDetailsBtn.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
maNUpPage.maBorderCB.SetClickHdl( LINK( this, PrintDialog, ClickHdl ) );
maOptionsPage.maToFileBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
- maOptionsPage.maReverseOrderBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
+ maJobPage.maReverseOrderBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
maOptionsPage.maCollateSingleJobsBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
maNUpPage.maPagesBtn.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
@@ -887,18 +876,6 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont
}
}
- // set HelpIDs
- SMHID1( "Dialog" );
- maOKButton.SMHID1( "OK" );
- maCancelButton.SMHID1( "Cancel" );
- maHelpButton.SMHID1( "Help" );
- maPreviewWindow.SMHID1( "Preview" );
- maNumPagesText.SMHID1( "NumPagesText" );
- maPageEdit.SMHID1( "PageEdit" );
- maForwardBtn.SMHID1( "ForwardBtn" );
- maBackwardBtn.SMHID1( "BackwardBtn" );
- maTabCtrl.SMHID1( "TabPages" );
-
// append further tab pages
if( mbShowLayoutPage )
{
@@ -927,13 +904,14 @@ PrintDialog::~PrintDialog()
void PrintDialog::setupLayout()
{
- Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
+ boost::shared_ptr<vcl::RowOrColumn> xLayout =
+ boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() );
+ xLayout->setOuterBorder( 0 );
- maLayout.setParentWindow( this );
- boost::shared_ptr< vcl::RowOrColumn > xPreviewAndTab( new vcl::RowOrColumn( &maLayout, false ) );
- size_t nIndex = maLayout.addChild( xPreviewAndTab, 5 );
- maLayout.setBorders( nIndex, aBorder.Width(), aBorder.Width(), aBorder.Width(), 0 );
+ boost::shared_ptr< vcl::RowOrColumn > xPreviewAndTab( new vcl::RowOrColumn( xLayout.get(), false ) );
+ size_t nIndex = xLayout->addChild( xPreviewAndTab, 5 );
+ xLayout->setBorders( nIndex, -1, -1, -1, 0 );
// setup column for preview and sub controls
boost::shared_ptr< vcl::RowOrColumn > xPreview( new vcl::RowOrColumn( xPreviewAndTab.get() ) );
@@ -957,12 +935,12 @@ void PrintDialog::setupLayout()
xPreviewAndTab->addWindow( &maTabCtrl );
// add the button line
- maLayout.addWindow( &maButtonLine );
+ xLayout->addWindow( &maButtonLine );
// add the row for the buttons
- boost::shared_ptr< vcl::RowOrColumn > xButtons( new vcl::RowOrColumn( &maLayout, false ) );
- nIndex = maLayout.addChild( xButtons );
- maLayout.setBorders( nIndex, aBorder.Width(), 0, aBorder.Width(), aBorder.Width() );
+ boost::shared_ptr< vcl::RowOrColumn > xButtons( new vcl::RowOrColumn( xLayout.get(), false ) );
+ nIndex = xLayout->addChild( xButtons );
+ xLayout->setBorders( nIndex, -1, 0, -1, -1 );
Size aMinSize( maCancelButton.GetSizePixel() );
// insert help button
@@ -984,10 +962,10 @@ void PrintDialog::readFromSettings()
SettingsConfigItem* pItem = SettingsConfigItem::get();
rtl::OUString aValue = pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LastPage" ) ) );
- USHORT nCount = maTabCtrl.GetPageCount();
- for( USHORT i = 0; i < nCount; i++ )
+ sal_uInt16 nCount = maTabCtrl.GetPageCount();
+ for( sal_uInt16 i = 0; i < nCount; i++ )
{
- USHORT nPageId = maTabCtrl.GetPageId( i );
+ sal_uInt16 nPageId = maTabCtrl.GetPageId( i );
if( aValue.equals( maTabCtrl.GetPageText( nPageId ) ) )
{
maTabCtrl.SelectTabPage( nPageId );
@@ -995,6 +973,11 @@ void PrintDialog::readFromSettings()
}
}
maOKButton.SetText( maOptionsPage.maToFileBox.IsChecked() ? maPrintToFileText : maPrintText );
+ if( maOptionsPage.maToFileBox.IsChecked() )
+ {
+ maPController->resetPrinterOptions( true );
+ preparePreview( true, true );
+ }
}
void PrintDialog::storeToSettings()
@@ -1027,7 +1010,7 @@ int PrintDialog::getCopyCount()
bool PrintDialog::isCollate()
{
- return maJobPage.maCopyCountField.GetValue() > 1 ? maJobPage.maCollateBox.IsChecked() : FALSE;
+ return maJobPage.maCopyCountField.GetValue() > 1 ? maJobPage.maCollateBox.IsChecked() : sal_False;
}
bool PrintDialog::isSingleJobs()
@@ -1035,35 +1018,18 @@ bool PrintDialog::isSingleJobs()
return maOptionsPage.maCollateSingleJobsBox.IsChecked();
}
-static void setSmartId( Window* i_pWindow, const char* i_pType, sal_Int32 i_nId = -1, const rtl::OUString& i_rPropName = rtl::OUString() )
+void setHelpId( Window* i_pWindow, const Sequence< rtl::OUString >& i_rHelpIds, sal_Int32 i_nIndex )
{
- rtl::OUStringBuffer aBuf( 256 );
- aBuf.appendAscii( HELPID_PREFIX );
- if( i_rPropName.getLength() )
- {
- aBuf.append( sal_Unicode( ':' ) );
- aBuf.append( i_rPropName );
- }
- if( i_pType )
- {
- aBuf.append( sal_Unicode( ':' ) );
- aBuf.appendAscii( i_pType );
- }
- if( i_nId >= 0 )
- {
- aBuf.append( sal_Unicode( ':' ) );
- aBuf.append( i_nId );
- }
- i_pWindow->SetSmartHelpId( SmartId( aBuf.makeStringAndClear(), HID_PRINTDLG ) );
+ if( i_nIndex >= 0 && i_nIndex < i_rHelpIds.getLength() )
+ i_pWindow->SetHelpId( rtl::OUStringToOString( i_rHelpIds.getConstArray()[i_nIndex], RTL_TEXTENCODING_UTF8 ) );
}
-static void setHelpText( Window* /*i_pWindow*/, const Sequence< rtl::OUString >& /*i_rHelpTexts*/, sal_Int32 /*i_nIndex*/ )
+static void setHelpText( Window* i_pWindow, const Sequence< rtl::OUString >& i_rHelpTexts, sal_Int32 i_nIndex )
{
// without a help text set and the correct smartID,
// help texts will be retrieved from the online help system
-
- // passed help texts for optional UI is used only for native dialogs which currently
- // cannot access the same (rather implicit) mechanism
+ if( i_nIndex >= 0 && i_nIndex < i_rHelpTexts.getLength() )
+ i_pWindow->SetHelpText( i_rHelpTexts.getConstArray()[i_nIndex] );
}
void updateMaxSize( const Size& i_rCheckSize, Size& o_rMaxSize )
@@ -1076,17 +1042,15 @@ void updateMaxSize( const Size& i_rCheckSize, Size& o_rMaxSize )
void PrintDialog::setupOptionalUI()
{
- Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
-
- std::vector<vcl::RowOrColumn*> aDynamicColumns;
- vcl::RowOrColumn* pCurColumn = 0;
+ std::vector< boost::shared_ptr<vcl::RowOrColumn> > aDynamicColumns;
+ boost::shared_ptr< vcl::RowOrColumn > pCurColumn;
Window* pCurParent = 0, *pDynamicPageParent = 0;
- USHORT nOptPageId = 9, nCurSubGroup = 0;
+ sal_uInt16 nOptPageId = 9, nCurSubGroup = 0;
bool bOnStaticPage = false;
bool bSubgroupOnStaticPage = false;
- std::multimap< rtl::OUString, vcl::RowOrColumn* > aPropertyToDependencyRowMap;
+ std::multimap< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> > aPropertyToDependencyRowMap;
const Sequence< PropertyValue >& rOptions( maPController->getUIOptions() );
for( int i = 0; i < rOptions.getLength(); i++ )
@@ -1099,7 +1063,9 @@ void PrintDialog::setupOptionalUI()
rtl::OUString aText;
rtl::OUString aPropertyName;
Sequence< rtl::OUString > aChoices;
+ Sequence< sal_Bool > aChoicesDisabled;
Sequence< rtl::OUString > aHelpTexts;
+ Sequence< rtl::OUString > aHelpIds;
sal_Int64 nMinValue = 0, nMaxValue = 0;
sal_Int32 nCurHelpText = 0;
rtl::OUString aGroupingHint;
@@ -1122,6 +1088,10 @@ void PrintDialog::setupOptionalUI()
{
rEntry.Value >>= aChoices;
}
+ else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ChoicesDisabled" ) ) )
+ {
+ rEntry.Value >>= aChoicesDisabled;
+ }
else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Property" ) ) )
{
PropertyValue aVal;
@@ -1169,6 +1139,18 @@ void PrintDialog::setupOptionalUI()
}
}
}
+ else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "HelpId" ) ) )
+ {
+ if( ! (rEntry.Value >>= aHelpIds ) )
+ {
+ rtl::OUString aHelpId;
+ if( (rEntry.Value >>= aHelpId) )
+ {
+ aHelpIds.realloc( 1 );
+ *aHelpIds.getArray() = aHelpId;
+ }
+ }
+ }
else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "HintNoLayoutPage" ) ) )
{
sal_Bool bNoLayoutPage = sal_False;
@@ -1190,37 +1172,40 @@ void PrintDialog::setupOptionalUI()
{
// restore to dynamic
pCurParent = pDynamicPageParent;
- pCurColumn = aDynamicColumns.empty() ? NULL : aDynamicColumns.back();
+ if( ! aDynamicColumns.empty() )
+ pCurColumn = aDynamicColumns.back();
+ else
+ pCurColumn.reset();
bOnStaticPage = false;
bSubgroupOnStaticPage = false;
if( aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PrintRange" ) ) )
{
- pCurColumn = maJobPage.mxPrintRange.get();
+ pCurColumn = maJobPage.mxPrintRange;
pCurParent = &maJobPage; // set job page as current parent
bOnStaticPage = true;
}
else if( aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "OptionsPage" ) ) )
{
- pCurColumn = &maOptionsPage.maLayout;
+ pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maOptionsPage.getLayout());
pCurParent = &maOptionsPage; // set options page as current parent
bOnStaticPage = true;
}
else if( aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "OptionsPageOptGroup" ) ) )
{
- pCurColumn = maOptionsPage.mxOptGroup.get();
+ pCurColumn = maOptionsPage.mxOptGroup;
pCurParent = &maOptionsPage; // set options page as current parent
bOnStaticPage = true;
}
else if( aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "LayoutPage" ) ) )
{
- pCurColumn = &maNUpPage.maLayout;
+ pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maNUpPage.getLayout());
pCurParent = &maNUpPage; // set layout page as current parent
bOnStaticPage = true;
}
else if( aGroupingHint.getLength() )
{
- pCurColumn = &maJobPage.maLayout;
+ pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maJobPage.getLayout());
pCurParent = &maJobPage; // set job page as current parent
bOnStaticPage = true;
}
@@ -1238,17 +1223,16 @@ void PrintDialog::setupOptionalUI()
maTabCtrl.SetTabPage( nOptPageId, pNewGroup );
// set help id
- setSmartId( pNewGroup, "TabPage", nOptPageId );
+ setHelpId( pNewGroup, aHelpIds, 0 );
// set help text
setHelpText( pNewGroup, aHelpTexts, 0 );
// reset subgroup counter
nCurSubGroup = 0;
- aDynamicColumns.push_back( new vcl::RowOrColumn( NULL, true, aBorder.Width() ) );
+ aDynamicColumns.push_back( boost::dynamic_pointer_cast<vcl::RowOrColumn>(pNewGroup->getLayout()) );
pCurColumn = aDynamicColumns.back();
pCurColumn->setParentWindow( pNewGroup );
- pCurColumn->setOuterBorder( aBorder.Width() );
bSubgroupOnStaticPage = false;
bOnStaticPage = false;
}
@@ -1270,7 +1254,7 @@ void PrintDialog::setupOptionalUI()
pNewSub->Show();
// set help id
- setSmartId( pNewSub, "FixedLine", sal_Int32( nCurSubGroup++ ) );
+ setHelpId( pNewSub, aHelpIds, 0 );
// set help text
setHelpText( pNewSub, aHelpTexts, 0 );
// add group to current column
@@ -1278,10 +1262,10 @@ void PrintDialog::setupOptionalUI()
}
// add an indent to the current column
- vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn, aBorder.Width() );
+ vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn.get(), -1 );
pCurColumn->addChild( pIndent );
// and create a column inside the indent
- pCurColumn = new vcl::RowOrColumn( pIndent );
+ pCurColumn.reset( new vcl::RowOrColumn( pIndent ) );
pIndent->setChild( pCurColumn );
}
// EVIL
@@ -1305,17 +1289,17 @@ void PrintDialog::setupOptionalUI()
maPropertyToWindowMap[ aPropertyName ].push_back( &maNUpPage.maBrochureBtn );
maControlToPropertyMap[&maNUpPage.maBrochureBtn] = aPropertyName;
- aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, maNUpPage.mxBrochureDep.get() ) );
+ aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, maNUpPage.mxBrochureDep ) );
}
else
{
- vcl::RowOrColumn* pSaveCurColumn = pCurColumn;
+ boost::shared_ptr<vcl::RowOrColumn> pSaveCurColumn( pCurColumn );
if( bUseDependencyRow )
{
// find the correct dependency row (if any)
- std::pair< std::multimap< rtl::OUString, vcl::RowOrColumn* >::iterator,
- std::multimap< rtl::OUString, vcl::RowOrColumn* >::iterator > aDepRange;
+ std::pair< std::multimap< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >::iterator,
+ std::multimap< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >::iterator > aDepRange;
aDepRange = aPropertyToDependencyRowMap.equal_range( aDependsOnName );
if( aDepRange.first != aDepRange.second )
{
@@ -1350,20 +1334,20 @@ void PrintDialog::setupOptionalUI()
maControlToPropertyMap[pNewBox] = aPropertyName;
// set help id
- setSmartId( pNewBox, "CheckBox", -1, aPropertyName );
+ setHelpId( pNewBox, aHelpIds, 0 );
// set help text
setHelpText( pNewBox, aHelpTexts, 0 );
- vcl::RowOrColumn* pDependencyRow = new vcl::RowOrColumn( pCurColumn, false );
+ boost::shared_ptr<vcl::RowOrColumn> pDependencyRow( new vcl::RowOrColumn( pCurColumn.get(), false ) );
pCurColumn->addChild( pDependencyRow );
- aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, pDependencyRow ) );
+ aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, pDependencyRow ) );
// add checkbox to current column
pDependencyRow->addWindow( pNewBox );
}
else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Radio" ) ) && pCurParent )
{
- vcl::RowOrColumn* pRadioColumn = pCurColumn;
+ boost::shared_ptr<vcl::RowOrColumn> pRadioColumn( pCurColumn );
if( aText.getLength() )
{
// add a FixedText:
@@ -1373,16 +1357,17 @@ void PrintDialog::setupOptionalUI()
pHeading->Show();
// set help id
- setSmartId( pHeading, "FixedText", -1, aPropertyName );
+ setHelpId( pHeading, aHelpIds, nCurHelpText );
// set help text
- setHelpText( pHeading, aHelpTexts, nCurHelpText++ );
+ setHelpText( pHeading, aHelpTexts, nCurHelpText );
+ nCurHelpText++;
// add fixed text to current column
pCurColumn->addWindow( pHeading );
// add an indent to the current column
- vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn, 15 );
+ vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn.get(), 15 );
pCurColumn->addChild( pIndent );
// and create a column inside the indent
- pRadioColumn = new vcl::RowOrColumn( pIndent );
+ pRadioColumn.reset( new vcl::RowOrColumn( pIndent ) );
pIndent->setChild( pRadioColumn );
}
// iterate options
@@ -1392,26 +1377,29 @@ void PrintDialog::setupOptionalUI()
pVal->Value >>= nSelectVal;
for( sal_Int32 m = 0; m < aChoices.getLength(); m++ )
{
- boost::shared_ptr<vcl::LabeledElement> pLabel( new vcl::LabeledElement( pRadioColumn, 1 ) );
+ boost::shared_ptr<vcl::LabeledElement> pLabel( new vcl::LabeledElement( pRadioColumn.get(), 1 ) );
pRadioColumn->addChild( pLabel );
boost::shared_ptr<vcl::RowOrColumn> pDependencyRow( new vcl::RowOrColumn( pLabel.get(), false ) );
pLabel->setElement( pDependencyRow );
- aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, pDependencyRow.get() ) );
+ aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, pDependencyRow ) );
RadioButton* pBtn = new RadioButton( pCurParent, m == 0 ? WB_GROUP : 0 );
maControls.push_front( pBtn );
pBtn->SetText( aChoices[m] );
pBtn->Check( m == nSelectVal );
pBtn->SetToggleHdl( LINK( this, PrintDialog, UIOption_RadioHdl ) );
+ if( aChoicesDisabled.getLength() > m && aChoicesDisabled[m] == sal_True )
+ pBtn->Enable( sal_False );
pBtn->Show();
maPropertyToWindowMap[ aPropertyName ].push_back( pBtn );
maControlToPropertyMap[pBtn] = aPropertyName;
maControlToNumValMap[pBtn] = m;
// set help id
- setSmartId( pBtn, "RadioButton", m, aPropertyName );
+ setHelpId( pBtn, aHelpIds, nCurHelpText );
// set help text
- setHelpText( pBtn, aHelpTexts, nCurHelpText++ );
+ setHelpText( pBtn, aHelpTexts, nCurHelpText );
+ nCurHelpText++;
// add the radio button to the column
pLabel->setLabel( pBtn );
}
@@ -1422,9 +1410,9 @@ void PrintDialog::setupOptionalUI()
) && pCurParent )
{
// create a row in the current column
- vcl::RowOrColumn* pFieldColumn = new vcl::RowOrColumn( pCurColumn, false );
+ boost::shared_ptr<vcl::RowOrColumn> pFieldColumn( new vcl::RowOrColumn( pCurColumn.get(), false ) );
pCurColumn->addChild( pFieldColumn );
- aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, pFieldColumn ) );
+ aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, pFieldColumn ) );
vcl::LabeledElement* pLabel = NULL;
if( aText.getLength() )
@@ -1435,11 +1423,9 @@ void PrintDialog::setupOptionalUI()
pHeading->SetText( aText );
pHeading->Show();
- // set help id
- setSmartId( pHeading, "FixedText", -1, aPropertyName );
// add to row
- pLabel = new vcl::LabeledElement( pFieldColumn, 2 );
+ pLabel = new vcl::LabeledElement( pFieldColumn.get(), 2 );
pFieldColumn->addChild( pLabel );
pLabel->setLabel( pHeading );
}
@@ -1458,13 +1444,13 @@ void PrintDialog::setupOptionalUI()
PropertyValue* pVal = maPController->getValue( aPropertyName );
if( pVal && pVal->Value.hasValue() )
pVal->Value >>= nSelectVal;
- pList->SelectEntryPos( static_cast<USHORT>(nSelectVal) );
+ pList->SelectEntryPos( static_cast<sal_uInt16>(nSelectVal) );
pList->SetSelectHdl( LINK( this, PrintDialog, UIOption_SelectHdl ) );
- pList->SetDropDownLineCount( static_cast<USHORT>(aChoices.getLength()) );
+ pList->SetDropDownLineCount( static_cast<sal_uInt16>(aChoices.getLength()) );
pList->Show();
// set help id
- setSmartId( pList, "ListBox", -1, aPropertyName );
+ setHelpId( pList, aHelpIds, 0 );
// set help text
setHelpText( pList, aHelpTexts, 0 );
@@ -1497,7 +1483,7 @@ void PrintDialog::setupOptionalUI()
pField->Show();
// set help id
- setSmartId( pField, "NumericField", -1, aPropertyName );
+ setHelpId( pField, aHelpIds, 0 );
// set help text
setHelpText( pField, aHelpTexts, 0 );
@@ -1524,7 +1510,7 @@ void PrintDialog::setupOptionalUI()
pField->Show();
// set help id
- setSmartId( pField, "Edit", -1, aPropertyName );
+ setHelpId( pField, aHelpIds, 0 );
// set help text
setHelpText( pField, aHelpTexts, 0 );
@@ -1554,9 +1540,9 @@ void PrintDialog::setupOptionalUI()
if( maNUpPage.mxPagesBtnLabel.get() )
{
maNUpPage.maPagesBoxTitleTxt.SetText( maNUpPage.maPagesBtn.GetText() );
- maNUpPage.maPagesBoxTitleTxt.Show( TRUE );
+ maNUpPage.maPagesBoxTitleTxt.Show( sal_True );
maNUpPage.mxPagesBtnLabel->setLabel( &maNUpPage.maPagesBoxTitleTxt );
- maNUpPage.maPagesBtn.Show( FALSE );
+ maNUpPage.maPagesBtn.Show( sal_False );
}
}
@@ -1567,18 +1553,28 @@ void PrintDialog::setupOptionalUI()
if( maJobPage.mxPrintRange->countElements() == 0 )
{
maJobPage.mxPrintRange->show( false, false );
- maJobPage.maCopySpacer.Show( FALSE );
+ maJobPage.maCopySpacer.Show( sal_False );
+ maJobPage.maReverseOrderBox.Show( sal_False );
+ }
+ else
+ {
+ // add an indent to the current column
+ vcl::Indenter* pIndent = new vcl::Indenter( maJobPage.mxPrintRange.get(), -1 );
+ maJobPage.mxPrintRange->addChild( pIndent );
+ // and create a column inside the indent
+ pIndent->setWindow( &maJobPage.maReverseOrderBox );
+ maJobPage.maReverseOrderBox.Show( sal_True );
}
#ifdef WNT
// FIXME: the GetNativeControlRegion call on Windows has some issues
// (which skew the results of GetOptimalSize())
// however fixing this thoroughly needs to take interaction with paint into
- // acoount, making the right fix less simple. Fix this the right way
+ // account, making the right fix less simple. Fix this the right way
// at some point. For now simply add some space at the lowest element
- size_t nIndex = maJobPage.maLayout.countElements();
+ size_t nIndex = maJobPage.getLayout()->countElements();
if( nIndex > 0 ) // sanity check
- maJobPage.maLayout.setBorders( nIndex-1, 0, 0, 0, aBorder.Width() );
+ maJobPage.getLayout()->setBorders( nIndex-1, 0, 0, 0, -1 );
#endif
// create auto mnemomnics now so they can be calculated in layout
@@ -1588,13 +1584,13 @@ void PrintDialog::setupOptionalUI()
ImplWindowAutoMnemonic( this );
// calculate job page
- Size aMaxSize = maJobPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED );
+ Size aMaxSize = maJobPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED );
// and layout page
- updateMaxSize( maNUpPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize );
+ updateMaxSize( maNUpPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize );
// and options page
- updateMaxSize( maOptionsPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize );
+ updateMaxSize( maOptionsPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize );
- for( std::vector< vcl::RowOrColumn* >::iterator it = aDynamicColumns.begin();
+ for( std::vector< boost::shared_ptr<vcl::RowOrColumn> >::iterator it = aDynamicColumns.begin();
it != aDynamicColumns.end(); ++it )
{
Size aPageSize( (*it)->getOptimalSize( WINDOWSIZE_PREFERRED ) );
@@ -1622,19 +1618,8 @@ void PrintDialog::setupOptionalUI()
maTabCtrl.SetMinimumSizePixel( maTabCtrl.GetSizePixel() );
}
- // and finally arrange controls
- for( std::vector< vcl::RowOrColumn* >::iterator it = aDynamicColumns.begin();
- it != aDynamicColumns.end(); ++it )
- {
- (*it)->setManagedArea( Rectangle( Point(), aTabSize ) );
- delete *it;
- *it = NULL;
- }
- maJobPage.Resize();
- maNUpPage.Resize();
- maOptionsPage.Resize();
+ Size aSz = getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED );
- Size aSz = maLayout.getOptimalSize( WINDOWSIZE_PREFERRED );
SetOutputSizePixel( aSz );
}
@@ -1651,7 +1636,7 @@ void PrintDialog::checkControlDependencies()
if( maJobPage.maCopyCountField.GetValue() > 1 )
maJobPage.maCollateBox.Enable( maJobPage.mnCollateUIMode == 0 );
else
- maJobPage.maCollateBox.Enable( FALSE );
+ maJobPage.maCollateBox.Enable( sal_False );
Image aImg( maJobPage.maCollateBox.IsChecked() ? maJobPage.maCollateImg : maJobPage.maNoCollateImg );
@@ -1660,7 +1645,7 @@ void PrintDialog::checkControlDependencies()
// adjust size of image
maJobPage.maCollateImage.SetSizePixel( aImgSize );
maJobPage.maCollateImage.SetImage( aImg );
- maJobPage.maLayout.resize();
+ maJobPage.getLayout()->resize();
// enable setup button only for printers that can be setup
bool bHaveSetup = maPController->getPrinter()->HasSupport( SUPPORT_SETUPDIALOG );
@@ -1675,7 +1660,7 @@ void PrintDialog::checkControlDependencies()
aPrinterSize.Width() = aSetupPos.X() - aPrinterPos.X() - LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ).Width();
maJobPage.maPrinters.SetSizePixel( aPrinterSize );
maJobPage.maSetupButton.Show();
- maLayout.resize();
+ getLayout()->resize();
}
}
else
@@ -1689,7 +1674,7 @@ void PrintDialog::checkControlDependencies()
aPrinterSize.Width() = aSetupPos.X() + aSetupSize.Width() - aPrinterPos.X();
maJobPage.maPrinters.SetSizePixel( aPrinterSize );
maJobPage.maSetupButton.Hide();
- maLayout.resize();
+ getLayout()->resize();
}
}
}
@@ -1718,6 +1703,16 @@ void PrintDialog::checkOptionalControlDependencies()
}
}
+ if( bShouldbeEnabled && dynamic_cast<RadioButton*>(it->first) )
+ {
+ std::map< Window*, sal_Int32 >::const_iterator r_it = maControlToNumValMap.find( it->first );
+ if( r_it != maControlToNumValMap.end() )
+ {
+ bShouldbeEnabled = maPController->isUIChoiceEnabled( it->second, r_it->second );
+ }
+ }
+
+
bool bIsEnabled = it->first->IsEnabled();
// Enable does not do a change check first, so can be less cheap than expected
if( bShouldbeEnabled != bIsEnabled )
@@ -1806,8 +1801,11 @@ void PrintDialog::preparePreview( bool i_bNewPage, bool i_bMayUseCache )
}
Size aCurPageSize = aPrt->PixelToLogic( aPrt->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) );
- maPreviewWindow.setPreview( aMtf, aCurPageSize, nPages > 0 ? rtl::OUString() : maNoPageStr,
- aPrt->ImplGetDPIX(), aPrt->ImplGetDPIY()
+ maPreviewWindow.setPreview( aMtf, aCurPageSize,
+ aPrt->GetPaperName( false ),
+ nPages > 0 ? rtl::OUString() : maNoPageStr,
+ aPrt->ImplGetDPIX(), aPrt->ImplGetDPIY(),
+ aPrt->GetPrinterOptions().IsConvertToGreyscales()
);
maForwardBtn.Enable( mnCurPage < nPages-1 );
@@ -1920,7 +1918,7 @@ void PrintDialog::updateNupFromPages()
if( bCustom )
{
// see if we have to enlarge the dialog to make the tab page fit
- Size aCurSize( maNUpPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED ) );
+ Size aCurSize( maNUpPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ) );
Size aTabSize( maTabCtrl.GetTabPageSizePixel() );
if( aTabSize.Height() < aCurSize.Height() )
{
@@ -1956,10 +1954,14 @@ void PrintDialog::updateNup()
int nOrderMode = int(sal_IntPtr(maNUpPage.maNupOrderBox.GetEntryData(
maNUpPage.maNupOrderBox.GetSelectEntryPos() )));
- if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_LRTD )
+ if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_LRTB )
aMPS.nOrder = PrinterController::LRTB;
- else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_TDLR )
+ else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_TBLR )
aMPS.nOrder = PrinterController::TBLR;
+ else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_RLTB )
+ aMPS.nOrder = PrinterController::RLTB;
+ else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_TBRL )
+ aMPS.nOrder = PrinterController::TBRL;
int nOrientationMode = int(sal_IntPtr(maNUpPage.maNupOrientationBox.GetEntryData(
maNUpPage.maNupOrientationBox.GetSelectEntryPos() )));
@@ -1994,6 +1996,7 @@ IMPL_LINK( PrintDialog, SelectHdl, ListBox*, pBox )
String aNewPrinter( pBox->GetSelectEntry() );
// set new printer
maPController->setPrinter( boost::shared_ptr<Printer>( new Printer( aNewPrinter ) ) );
+ maPController->resetPrinterOptions( maOptionsPage.maToFileBox.IsChecked() );
// update text fields
updatePrinterText();
}
@@ -2024,8 +2027,7 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
Help* pHelp = Application::GetHelp();
if( pHelp )
{
- // FIXME: find out proper help URL and use here
- pHelp->Start( HID_PRINTDLG, GetParent() );
+ pHelp->Start( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:OK" ) ), &maOKButton );
}
}
else if( pButton == &maForwardBtn )
@@ -2039,7 +2041,9 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
else if( pButton == &maOptionsPage.maToFileBox )
{
maOKButton.SetText( maOptionsPage.maToFileBox.IsChecked() ? maPrintToFileText : maPrintText );
- maLayout.resize();
+ maPController->resetPrinterOptions( maOptionsPage.maToFileBox.IsChecked() );
+ getLayout()->resize();
+ preparePreview( true, true );
}
else if( pButton == &maNUpPage.maBrochureBtn )
{
@@ -2075,7 +2079,7 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
{
maDetailsCollapsedSize = GetOutputSizePixel();
// enlarge dialog if necessary
- Size aMinSize( maJobPage.maLayout.getOptimalSize( WINDOWSIZE_MINIMUM ) );
+ Size aMinSize( maJobPage.getLayout()->getOptimalSize( WINDOWSIZE_MINIMUM ) );
Size aCurSize( maJobPage.GetSizePixel() );
if( aCurSize.Height() < aMinSize.Height() )
{
@@ -2104,9 +2108,9 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
makeAny( sal_Bool(isCollate()) ) );
checkControlDependencies();
}
- else if( pButton == &maOptionsPage.maReverseOrderBox )
+ else if( pButton == &maJobPage.maReverseOrderBox )
{
- sal_Bool bChecked = maOptionsPage.maReverseOrderBox.IsChecked();
+ sal_Bool bChecked = maJobPage.maReverseOrderBox.IsChecked();
maPController->setReversePrint( bChecked );
maPController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintReverse" ) ),
makeAny( bChecked ) );
@@ -2212,7 +2216,7 @@ void PrintDialog::updateWindowFromProperty( const rtl::OUString& i_rProperty )
ListBox* pList = dynamic_cast< ListBox* >( rWindows.front() );
if( pList )
{
- pList->SelectEntryPos( static_cast< USHORT >(nVal) );
+ pList->SelectEntryPos( static_cast< sal_uInt16 >(nVal) );
}
else if( nVal >= 0 && nVal < sal_Int32(rWindows.size() ) )
{
@@ -2349,7 +2353,7 @@ void PrintDialog::Command( const CommandEvent& rEvt )
void PrintDialog::Resize()
{
- maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
+ // maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
// and do the preview; however the metafile does not need to be gotten anew
preparePreview( false );
@@ -2453,6 +2457,7 @@ void PrintProgressDialog::tick()
void PrintProgressDialog::reset()
{
+ mbCanceled = false;
setProgress( 0 );
}
@@ -2477,9 +2482,9 @@ void PrintProgressDialog::Paint( const Rectangle& )
nOffset,
nWidth,
mnProgressHeight,
- static_cast<USHORT>(0),
- static_cast<USHORT>(10000*mnCur/mnMax),
- static_cast<USHORT>(10000/nMaxCount),
+ static_cast<sal_uInt16>(0),
+ static_cast<sal_uInt16>(10000*mnCur/mnMax),
+ static_cast<sal_uInt16>(10000/nMaxCount),
maProgressRect
);
Pop();
diff --git a/vcl/source/window/scrwnd.cxx b/vcl/source/window/scrwnd.cxx
index ab4068ac6e3d..588f4d4fa1fa 100644
--- a/vcl/source/window/scrwnd.cxx
+++ b/vcl/source/window/scrwnd.cxx
@@ -69,12 +69,12 @@ ImplWheelWindow::ImplWheelWindow( Window* pParent ) :
DBG_ASSERT( pParent, "ImplWheelWindow::ImplWheelWindow(): Parent not set!" );
const Size aSize( pParent->GetOutputSizePixel() );
- const USHORT nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
- const BOOL bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
- const BOOL bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
+ const sal_uInt16 nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
+ const sal_Bool bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
+ const sal_Bool bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
// calculate maximum speed distance
- mnMaxWidth = (ULONG) ( 0.4 * hypot( (double) aSize.Width(), aSize.Height() ) );
+ mnMaxWidth = (sal_uLong) ( 0.4 * hypot( (double) aSize.Width(), aSize.Height() ) );
// create wheel window
SetTitleType( FLOATWIN_TITLE_NONE );
@@ -116,7 +116,7 @@ void ImplWheelWindow::ImplStop()
{
ReleaseMouse();
mpTimer->Stop();
- Show(FALSE);
+ Show(sal_False);
}
// ------------------------------------------------------------------------
@@ -148,7 +148,7 @@ void ImplWheelWindow::ImplCreateImageList()
// ------------------------------------------------------------------------
-void ImplWheelWindow::ImplSetWheelMode( ULONG nWheelMode )
+void ImplWheelWindow::ImplSetWheelMode( sal_uLong nWheelMode )
{
if( nWheelMode != mnWheelMode )
{
@@ -173,7 +173,7 @@ void ImplWheelWindow::ImplSetWheelMode( ULONG nWheelMode )
void ImplWheelWindow::ImplDrawWheel()
{
- USHORT nId;
+ sal_uInt16 nId;
switch( mnWheelMode )
{
@@ -201,13 +201,13 @@ void ImplWheelWindow::ImplRecalcScrollValues()
}
else
{
- ULONG nCurTime;
+ sal_uLong nCurTime;
// calc current time
if( mnMaxWidth )
{
const double fExp = ( (double) mnActDist / mnMaxWidth ) * log10( (double) MAX_TIME / MIN_TIME );
- nCurTime = (ULONG) ( MAX_TIME / pow( 10., fExp ) );
+ nCurTime = (sal_uLong) ( MAX_TIME / pow( 10., fExp ) );
}
else
nCurTime = MAX_TIME;
@@ -251,9 +251,9 @@ void ImplWheelWindow::ImplRecalcScrollValues()
PointerStyle ImplWheelWindow::ImplGetMousePointer( long nDistX, long nDistY )
{
PointerStyle eStyle;
- const USHORT nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
- const BOOL bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
- const BOOL bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
+ const sal_uInt16 nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
+ const sal_Bool bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
+ const sal_Bool bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
if( bHorz || bVert )
{
@@ -331,13 +331,13 @@ void ImplWheelWindow::MouseMove( const MouseEvent& rMEvt )
const long nDistX = aMousePos.X() - maCenter.X();
const long nDistY = aMousePos.Y() - maCenter.Y();
- mnActDist = (ULONG) hypot( (double) nDistX, nDistY );
+ mnActDist = (sal_uLong) hypot( (double) nDistX, nDistY );
const PointerStyle eActStyle = ImplGetMousePointer( nDistX, nDistY );
- const USHORT nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
- const BOOL bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
- const BOOL bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
- const BOOL bOuter = mnActDist > WHEEL_RADIUS;
+ const sal_uInt16 nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
+ const sal_Bool bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
+ const sal_Bool bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
+ const sal_Bool bOuter = mnActDist > WHEEL_RADIUS;
if( bOuter && ( maLastMousePos != aMousePos ) )
{
@@ -389,17 +389,17 @@ IMPL_LINK( ImplWheelWindow, ImplScrollHdl, Timer*, EMPTYARG )
const Point aMousePos( pWindow->OutputToScreenPixel( pWindow->GetPointerPosPixel() ) );
Point aCmdMousePos( pWindow->ImplFrameToOutput( aMousePos ) );
CommandScrollData aScrollData( mnActDeltaX, mnActDeltaY );
- CommandEvent aCEvt( aCmdMousePos, COMMAND_AUTOSCROLL, TRUE, &aScrollData );
+ CommandEvent aCEvt( aCmdMousePos, COMMAND_AUTOSCROLL, sal_True, &aScrollData );
NotifyEvent aNCmdEvt( EVENT_COMMAND, pWindow, &aCEvt );
if ( !ImplCallPreNotify( aNCmdEvt ) )
{
- const ULONG nTime = Time::GetSystemTicks();
+ const sal_uLong nTime = Time::GetSystemTicks();
ImplDelData aDel( this );
pWindow->Command( aCEvt );
if( aDel.IsDead() )
return 0;
- mnRepaintTime = Max( Time::GetSystemTicks() - nTime, (ULONG)1 );
+ mnRepaintTime = Max( Time::GetSystemTicks() - nTime, (sal_uLong)1 );
ImplRecalcScrollValues();
}
}
diff --git a/vcl/source/window/scrwnd.hxx b/vcl/source/window/scrwnd.hxx
index 0b00d0940059..ccc38c778c99 100644
--- a/vcl/source/window/scrwnd.hxx
+++ b/vcl/source/window/scrwnd.hxx
@@ -58,12 +58,12 @@ private:
Point maLastMousePos;
Point maCenter;
Timer* mpTimer;
- ULONG mnRepaintTime;
- ULONG mnTimeout;
- ULONG mnWheelMode;
- ULONG mnMaxWidth;
- ULONG mnActWidth;
- ULONG mnActDist;
+ sal_uLong mnRepaintTime;
+ sal_uLong mnTimeout;
+ sal_uLong mnWheelMode;
+ sal_uLong mnMaxWidth;
+ sal_uLong mnActWidth;
+ sal_uLong mnActDist;
long mnActDeltaX;
long mnActDeltaY;
@@ -88,8 +88,8 @@ public:
~ImplWheelWindow();
void ImplStop();
- void ImplSetWheelMode( ULONG nWheelMode );
- ULONG ImplGetWheelMode() const { return mnWheelMode; }
+ void ImplSetWheelMode( sal_uLong nWheelMode );
+ sal_uLong ImplGetWheelMode() const { return mnWheelMode; }
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/seleng.cxx b/vcl/source/window/seleng.cxx
index 0c0352893a68..b8b6735d81ca 100644
--- a/vcl/source/window/seleng.cxx
+++ b/vcl/source/window/seleng.cxx
@@ -37,7 +37,7 @@
-inline BOOL SelectionEngine::ShouldDeselect( BOOL bModifierKey1 ) const
+inline sal_Bool SelectionEngine::ShouldDeselect( sal_Bool bModifierKey1 ) const
{
// return !( eSelMode == MULTIPLE_SELECTION && bModifierKey1 );
return eSelMode != MULTIPLE_SELECTION || !bModifierKey1;
@@ -53,7 +53,7 @@ inline BOOL SelectionEngine::ShouldDeselect( BOOL bModifierKey1 ) const
*************************************************************************/
SelectionEngine::SelectionEngine( Window* pWindow, FunctionSet* pFuncSet,
- ULONG nAutoRepeatInterval ) :
+ sal_uLong nAutoRepeatInterval ) :
pWin( pWindow ),
nUpdateInterval( nAutoRepeatInterval )
{
@@ -118,7 +118,7 @@ void SelectionEngine::ActivateDragMode()
|*
*************************************************************************/
-void SelectionEngine::CursorPosChanging( BOOL bShift, BOOL bMod1 )
+void SelectionEngine::CursorPosChanging( sal_Bool bShift, sal_Bool bMod1 )
{
if ( !pFunctionSet )
return;
@@ -172,19 +172,19 @@ void SelectionEngine::CursorPosChanging( BOOL bShift, BOOL bMod1 )
|*
*************************************************************************/
-BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
+sal_Bool SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
{
nFlags &= (~SELENG_CMDEVT);
if ( !pFunctionSet || !pWin )
- return FALSE;
+ return sal_False;
const bool bRightClickCursorPositioning =
rMEvt.IsRight() && rMEvt.GetClicks() == 1 && !IsInSelection();
if ( (rMEvt.GetClicks() > 1 || rMEvt.IsRight()) && !bRightClickCursorPositioning )
- return FALSE;
+ return sal_False;
- USHORT nModifier = rMEvt.GetModifier() | nLockedMods;
+ sal_uInt16 nModifier = rMEvt.GetModifier() | nLockedMods;
if ( nModifier & KEY_MOD2 )
- return FALSE;
+ return sal_False;
// in SingleSelection: Control-Taste filtern (damit auch
// mit Ctrl-Click ein D&D gestartet werden kann)
if ( nModifier == KEY_MOD1 && eSelMode == SINGLE_SELECTION )
@@ -207,14 +207,14 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
{
case 0: // KEY_NO_KEY
{
- BOOL bSelAtPoint = pFunctionSet->IsSelectionAtPoint( aPos );
+ sal_Bool bSelAtPoint = pFunctionSet->IsSelectionAtPoint( aPos );
nFlags &= (~SELENG_IN_ADD);
if ( (nFlags & SELENG_DRG_ENAB) && bSelAtPoint )
{
nFlags |= SELENG_WAIT_UPEVT;
nFlags &= ~(SELENG_IN_SEL);
pWin->ReleaseMouse();
- return TRUE; //auf STARTDRAG-Command-Event warten
+ return sal_True; //auf STARTDRAG-Command-Event warten
}
if ( eSelMode != SINGLE_SELECTION )
{
@@ -222,14 +222,14 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
pFunctionSet->DeselectAll();
else
pFunctionSet->DestroyAnchor();
- nFlags &= (~SELENG_HAS_ANCH); // bHasAnchor = FALSE;
+ nFlags &= (~SELENG_HAS_ANCH); // bHasAnchor = sal_False;
}
pFunctionSet->SetCursorAtPoint( aPos );
// Sonderbehandlung Single-Selection, damit Select+Drag
// in einem Zug moeglich ist
if (eSelMode == SINGLE_SELECTION && (nFlags & SELENG_DRG_ENAB))
nFlags |= SELENG_WAIT_UPEVT;
- return TRUE;
+ return sal_True;
}
case KEY_SHIFT:
@@ -237,7 +237,7 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
{
pWin->ReleaseMouse();
nFlags &= (~SELENG_IN_SEL);
- return FALSE;
+ return sal_False;
}
if ( nFlags & SELENG_ADD_ALW )
nFlags |= SELENG_IN_ADD;
@@ -252,7 +252,7 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
nFlags |= SELENG_HAS_ANCH;
}
pFunctionSet->SetCursorAtPoint( aPos );
- return TRUE;
+ return sal_True;
case KEY_MOD1:
// Control nur bei Mehrfachselektion erlaubt
@@ -260,7 +260,7 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
{
nFlags &= (~SELENG_IN_SEL);
pWin->ReleaseMouse();
- return TRUE; // Mausclick verschlucken
+ return sal_True; // Mausclick verschlucken
}
if ( nFlags & SELENG_HAS_ANCH )
{
@@ -271,32 +271,32 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
if ( pFunctionSet->IsSelectionAtPoint( aPos ) )
{
pFunctionSet->DeselectAtPoint( aPos );
- pFunctionSet->SetCursorAtPoint( aPos, TRUE );
+ pFunctionSet->SetCursorAtPoint( aPos, sal_True );
}
else
{
pFunctionSet->SetCursorAtPoint( aPos );
}
- return TRUE;
+ return sal_True;
case KEY_SHIFT + KEY_MOD1:
if ( eSelMode != MULTIPLE_SELECTION )
{
pWin->ReleaseMouse();
nFlags &= (~SELENG_IN_SEL);
- return FALSE;
+ return sal_False;
}
- nFlags |= SELENG_IN_ADD; //bIsInAddMode = TRUE;
+ nFlags |= SELENG_IN_ADD; //bIsInAddMode = sal_True;
if ( !(nFlags & SELENG_HAS_ANCH) )
{
pFunctionSet->CreateAnchor();
nFlags |= SELENG_HAS_ANCH;
}
pFunctionSet->SetCursorAtPoint( aPos );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -305,14 +305,14 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
|*
*************************************************************************/
-BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
+sal_Bool SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
{
aWTimer.Stop();
//DbgOut("Up");
if( !pFunctionSet || !pWin )
{
nFlags &= ~(SELENG_CMDEVT | SELENG_WAIT_UPEVT | SELENG_IN_SEL);
- return FALSE;
+ return sal_False;
}
if( !rMEvt.IsRight() )
@@ -325,7 +325,7 @@ BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
{
// MouseButtonDown in Sel aber kein CommandEvent eingetrudelt
// ==> deselektieren
- USHORT nModifier = aLastMove.GetModifier() | nLockedMods;
+ sal_uInt16 nModifier = aLastMove.GetModifier() | nLockedMods;
if( nModifier == KEY_MOD1 || IsAlwaysAdding() )
{
if( !(nModifier & KEY_SHIFT) )
@@ -335,7 +335,7 @@ BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
}
pFunctionSet->DeselectAtPoint( aLastMove.GetPosPixel() );
nFlags &= (~SELENG_HAS_ANCH); // nix Anker
- pFunctionSet->SetCursorAtPoint( aLastMove.GetPosPixel(), TRUE );
+ pFunctionSet->SetCursorAtPoint( aLastMove.GetPosPixel(), sal_True );
}
else
{
@@ -346,7 +346,7 @@ BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
}
nFlags &= ~(SELENG_CMDEVT | SELENG_WAIT_UPEVT | SELENG_IN_SEL);
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -355,21 +355,21 @@ BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
|*
*************************************************************************/
-BOOL SelectionEngine::SelMouseMove( const MouseEvent& rMEvt )
+sal_Bool SelectionEngine::SelMouseMove( const MouseEvent& rMEvt )
{
if ( !pFunctionSet || !(nFlags & SELENG_IN_SEL) ||
(nFlags & (SELENG_CMDEVT | SELENG_WAIT_UPEVT)) )
- return FALSE;
+ return sal_False;
if( !(nFlags & SELENG_EXPANDONMOVE) )
- return FALSE; // auf DragEvent warten!
+ return sal_False; // auf DragEvent warten!
aLastMove = rMEvt;
// wenn die Maus ausserhalb der Area steht, dann wird die
// Frequenz des SetCursorAtPoint() nur durch den Timer bestimmt
if( aWTimer.IsActive() && !aArea.IsInside( rMEvt.GetPosPixel() ))
- return TRUE;
+ return sal_True;
aWTimer.SetTimeout( nUpdateInterval );
aWTimer.Start();
@@ -386,7 +386,7 @@ BOOL SelectionEngine::SelMouseMove( const MouseEvent& rMEvt )
//DbgOut("Move:SetCursor");
pFunctionSet->SetCursorAtPoint( rMEvt.GetPosPixel() );
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -456,7 +456,7 @@ void SelectionEngine::Command( const CommandEvent& rCEvt )
}
}
-void SelectionEngine::SetUpdateInterval( ULONG nInterval )
+void SelectionEngine::SetUpdateInterval( sal_uLong nInterval )
{
if (nInterval < SELENG_AUTOREPEAT_INTERVAL_MIN)
// Set a lower threshold. On Windows, setting this value too low
diff --git a/vcl/source/window/split.cxx b/vcl/source/window/split.cxx
index df03cf321ce3..1d4c8bfae815 100644
--- a/vcl/source/window/split.cxx
+++ b/vcl/source/window/split.cxx
@@ -61,13 +61,13 @@ namespace
void Splitter::ImplInitSplitterData()
{
- ImplGetWindowImpl()->mbSplitter = TRUE;
+ ImplGetWindowImpl()->mbSplitter = sal_True;
mpRefWin = NULL;
mnSplitPos = 0;
mnLastSplitPos = 0;
mnStartSplitPos = 0;
- mbDragFull = FALSE;
- mbKbdSplitting = FALSE;
+ mbDragFull = sal_False;
+ mbKbdSplitting = sal_False;
mbInKeyEvent = 0;
mnKeyboardStepSize = SPLITTER_DEFAULTSTEPSIZE;
}
@@ -89,13 +89,13 @@ void Splitter::ImplInit( Window* pParent, WinBits nWinStyle )
if ( nWinStyle & WB_HSCROLL )
{
ePointerStyle = POINTER_HSPLIT;
- mbHorzSplit = TRUE;
+ mbHorzSplit = sal_True;
SetSizePixel( Size( nB, nA ) );
}
else
{
ePointerStyle = POINTER_VSPLIT;
- mbHorzSplit = FALSE;
+ mbHorzSplit = sal_False;
SetSizePixel( Size( nA, nB ) );
}
@@ -218,11 +218,11 @@ Splitter* Splitter::ImplFindSibling()
// -----------------------------------------------------------------------
-BOOL Splitter::ImplSplitterActive()
+sal_Bool Splitter::ImplSplitterActive()
{
// is splitter in document or at scrollbar handle ?
- BOOL bActive = TRUE;
+ sal_Bool bActive = sal_True;
const StyleSettings& rSettings = GetSettings().GetStyleSettings();
long nA = rSettings.GetScrollBarSize();
long nB = rSettings.GetSplitSize();
@@ -231,12 +231,12 @@ BOOL Splitter::ImplSplitterActive()
if ( mbHorzSplit )
{
if( aSize.Width() == nB && aSize.Height() == nA )
- bActive = FALSE;
+ bActive = sal_False;
}
else
{
if( aSize.Width() == nA && aSize.Height() == nB )
- bActive = FALSE;
+ bActive = sal_False;
}
return bActive;
}
@@ -352,13 +352,13 @@ void Splitter::Tracking( const TrackingEvent& rTEvt )
void Splitter::ImplKbdTracking( KeyCode aKeyCode )
{
- USHORT nCode = aKeyCode.GetCode();
+ sal_uInt16 nCode = aKeyCode.GetCode();
if ( nCode == KEY_ESCAPE || nCode == KEY_RETURN )
{
if( !mbKbdSplitting )
return;
else
- mbKbdSplitting = FALSE;
+ mbKbdSplitting = sal_False;
if ( nCode != KEY_ESCAPE )
{
@@ -553,7 +553,7 @@ void Splitter::ImplStartKbdSplitting()
if( mbKbdSplitting )
return;
- mbKbdSplitting = TRUE;
+ mbKbdSplitting = sal_True;
StartSplit();
@@ -625,7 +625,7 @@ void Splitter::LoseFocus()
{
KeyCode aReturnKey( KEY_RETURN );
ImplKbdTracking( aReturnKey );
- mbKbdSplitting = FALSE;
+ mbKbdSplitting = sal_False;
}
Invalidate();
}
@@ -641,7 +641,7 @@ void Splitter::KeyInput( const KeyEvent& rKEvt )
Splitter *pSibling = ImplFindSibling();
KeyCode aKeyCode = rKEvt.GetKeyCode();
- USHORT nCode = aKeyCode.GetCode();
+ sal_uInt16 nCode = aKeyCode.GetCode();
switch ( nCode )
{
case KEY_UP:
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index 3cf2af7bacc8..d0bf60b6412c 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -46,7 +46,8 @@
// =======================================================================
-// Achtung: Darf keine Objekte enthalten, da mit memmove/memcpy gearbeitet wird
+// Attention: Must not contain non-PODs because array is enlarged/copied
+// with the use of memmove/memcpy.
struct ImplSplitItem
{
long mnSize;
@@ -64,10 +65,14 @@ struct ImplSplitItem
ImplSplitSet* mpSet;
Window* mpWindow;
Window* mpOrgParent;
- USHORT mnId;
+ sal_uInt16 mnId;
SplitWindowItemBits mnBits;
- BOOL mbFixed;
- BOOL mbSubSize;
+ sal_Bool mbFixed;
+ sal_Bool mbSubSize;
+ /// Minimal width or height of the item. -1 means no restriction.
+ long mnMinSize;
+ /// Maximal width or height of the item. -1 means no restriction.
+ long mnMaxSize;
};
struct ImplSplitSet
@@ -77,25 +82,47 @@ struct ImplSplitSet
Bitmap* mpBitmap;
long mnLastSize;
long mnSplitSize;
- USHORT mnItems;
- USHORT mnId;
- BOOL mbCalcPix;
+ sal_uInt16 mnItems;
+ sal_uInt16 mnId;
+ sal_Bool mbCalcPix;
};
+
+
+/** Check whether the given size is inside the valid range defined by
+ [rItem.mnMinSize,rItem.mnMaxSize]. When it is not inside it then return
+ the upper or lower bound, respectively. Otherwise return the given size
+ unmodified.
+ Note that either mnMinSize and/or mnMaxSize can be -1 in which case the
+ size has not lower or upper bound.
+*/
+namespace {
+ long ValidateSize (const long nSize, const ImplSplitItem rItem)
+ {
+ if (rItem.mnMinSize>=0 && nSize<rItem.mnMinSize)
+ return rItem.mnMinSize;
+ else if (rItem.mnMaxSize>0 && nSize>rItem.mnMaxSize)
+ return rItem.mnMaxSize;
+ else
+ return nSize;
+ }
+}
+
+
#define SPLITWIN_SPLITSIZE 3
#define SPLITWIN_SPLITSIZEEX 4
#define SPLITWIN_SPLITSIZEEXLN 6
#define SPLITWIN_SPLITSIZEAUTOHIDE 36
#define SPLITWIN_SPLITSIZEFADE 36
-#define SPLIT_HORZ ((USHORT)0x0001)
-#define SPLIT_VERT ((USHORT)0x0002)
-#define SPLIT_WINDOW ((USHORT)0x0004)
-#define SPLIT_NOSPLIT ((USHORT)0x8000)
+#define SPLIT_HORZ ((sal_uInt16)0x0001)
+#define SPLIT_VERT ((sal_uInt16)0x0002)
+#define SPLIT_WINDOW ((sal_uInt16)0x0004)
+#define SPLIT_NOSPLIT ((sal_uInt16)0x8000)
// =======================================================================
-static void ImplCalcBorder( WindowAlign eAlign, BOOL bNoAlign,
+static void ImplCalcBorder( WindowAlign eAlign, sal_Bool bNoAlign,
long& rLeft, long& rTop,
long& rRight, long& rBottom )
{
@@ -250,13 +277,13 @@ void SplitWindow::ImplDrawBorderLine( SplitWindow* pWin )
// -----------------------------------------------------------------------
-static ImplSplitSet* ImplFindSet( ImplSplitSet* pSet, USHORT nId )
+static ImplSplitSet* ImplFindSet( ImplSplitSet* pSet, sal_uInt16 nId )
{
if ( pSet->mnId == nId )
return pSet;
- USHORT i;
- USHORT nItems = pSet->mnItems;
+ sal_uInt16 i;
+ sal_uInt16 nItems = pSet->mnItems;
ImplSplitItem* pItems = pSet->mpItems;
for ( i = 0; i < nItems; i++ )
@@ -280,10 +307,10 @@ static ImplSplitSet* ImplFindSet( ImplSplitSet* pSet, USHORT nId )
// -----------------------------------------------------------------------
-static ImplSplitSet* ImplFindItem( ImplSplitSet* pSet, USHORT nId, USHORT& rPos )
+static ImplSplitSet* ImplFindItem( ImplSplitSet* pSet, sal_uInt16 nId, sal_uInt16& rPos )
{
- USHORT i;
- USHORT nItems = pSet->mnItems;
+ sal_uInt16 i;
+ sal_uInt16 nItems = pSet->mnItems;
ImplSplitItem* pItems = pSet->mpItems;
for ( i = 0; i < nItems; i++ )
@@ -310,10 +337,10 @@ static ImplSplitSet* ImplFindItem( ImplSplitSet* pSet, USHORT nId, USHORT& rPos
// -----------------------------------------------------------------------
-static USHORT ImplFindItem( ImplSplitSet* pSet, Window* pWindow )
+static sal_uInt16 ImplFindItem( ImplSplitSet* pSet, Window* pWindow )
{
- USHORT i;
- USHORT nItems = pSet->mnItems;
+ sal_uInt16 i;
+ sal_uInt16 nItems = pSet->mnItems;
ImplSplitItem* pItems = pSet->mpItems;
for ( i = 0; i < nItems; i++ )
@@ -324,7 +351,7 @@ static USHORT ImplFindItem( ImplSplitSet* pSet, Window* pWindow )
{
if ( pItems[i].mpSet )
{
- USHORT nId = ImplFindItem( pItems[i].mpSet, pWindow );
+ sal_uInt16 nId = ImplFindItem( pItems[i].mpSet, pWindow );
if ( nId )
return nId;
}
@@ -336,11 +363,11 @@ static USHORT ImplFindItem( ImplSplitSet* pSet, Window* pWindow )
// -----------------------------------------------------------------------
-static USHORT ImplFindItem( ImplSplitSet* pSet, const Point& rPos,
- BOOL bRows, BOOL bDown = TRUE )
+static sal_uInt16 ImplFindItem( ImplSplitSet* pSet, const Point& rPos,
+ sal_Bool bRows, sal_Bool bDown = sal_True )
{
- USHORT i;
- USHORT nItems = pSet->mnItems;
+ sal_uInt16 i;
+ sal_uInt16 nItems = pSet->mnItems;
ImplSplitItem* pItems = pSet->mpItems;
for ( i = 0; i < nItems; i++ )
@@ -386,8 +413,8 @@ static USHORT ImplFindItem( ImplSplitSet* pSet, const Point& rPos,
static void ImplDeleteSet( ImplSplitSet* pSet )
{
- USHORT i;
- USHORT nItems = pSet->mnItems;
+ sal_uInt16 i;
+ sal_uInt16 nItems = pSet->mnItems;
ImplSplitItem* pItems = pSet->mpItems;
for ( i = 0; i < nItems; i++ )
@@ -411,7 +438,7 @@ static void ImplDeleteSet( ImplSplitSet* pSet )
static void ImplSetSplitSize( ImplSplitSet* pSet, long nNewSize )
{
pSet->mnSplitSize = nNewSize;
- for ( USHORT i = 0; i < pSet->mnItems; i++ )
+ for ( sal_uInt16 i = 0; i < pSet->mnItems; i++ )
{
if ( pSet->mpItems[i].mpSet )
ImplSetSplitSize( pSet->mpItems[i].mpSet, nNewSize );
@@ -423,18 +450,18 @@ static void ImplSetSplitSize( ImplSplitSet* pSet, long nNewSize )
static void ImplCalcSet( ImplSplitSet* pSet,
long nSetLeft, long nSetTop,
long nSetWidth, long nSetHeight,
- BOOL bRows, BOOL bDown = TRUE )
+ sal_Bool bRows, sal_Bool bDown = sal_True )
{
if ( !pSet->mpItems )
return;
- USHORT i;
- USHORT j;
- USHORT nMins;
- USHORT nCalcItems;
- USHORT nItems = pSet->mnItems;
- USHORT nVisItems;
- USHORT nAbsItems;
+ sal_uInt16 i;
+ sal_uInt16 j;
+ sal_uInt16 nMins;
+ sal_uInt16 nCalcItems;
+ sal_uInt16 nItems = pSet->mnItems;
+ sal_uInt16 nVisItems;
+ sal_uInt16 nAbsItems;
long nCalcSize;
long nSizeDelta;
long nCurSize;
@@ -448,7 +475,7 @@ static void ImplCalcSet( ImplSplitSet* pSet,
long nMaxPos;
long* pSize;
ImplSplitItem* pItems = pSet->mpItems;
- BOOL bEmpty;
+ sal_Bool bEmpty;
// Anzahl sichtbarer Items ermitteln
nVisItems = 0;
@@ -528,7 +555,7 @@ static void ImplCalcSet( ImplSplitSet* pSet,
nCurSize += pItems[i].mnPixSize;
}
- pSet->mbCalcPix = FALSE;
+ pSet->mbCalcPix = sal_False;
pSet->mnLastSize = nCalcSize;
// Fenster einpassen
@@ -552,7 +579,7 @@ static void ImplCalcSet( ImplSplitSet* pSet,
}
}
// Rundungsfehler werden hier nicht ausgelichen
- if ( (nAbsItems < (USHORT)(Abs( nSizeDelta ))) && nSizeWinSize )
+ if ( (nAbsItems < (sal_uInt16)(Abs( nSizeDelta ))) && nSizeWinSize )
{
for ( i = 0; i < nItems; i++ )
{
@@ -579,10 +606,10 @@ static void ImplCalcSet( ImplSplitSet* pSet,
{
for ( i = 0; i < nItems; i++ )
{
- pItems[i].mbSubSize = FALSE;
+ pItems[i].mbSubSize = sal_False;
if ( j >= 2 )
- pItems[i].mbSubSize = TRUE;
+ pItems[i].mbSubSize = sal_True;
else
{
if ( !(pItems[i].mnBits & SWIB_INVISIBLE) )
@@ -590,11 +617,11 @@ static void ImplCalcSet( ImplSplitSet* pSet,
if ( (nSizeDelta > 0) || pItems[i].mnPixSize )
{
if ( j >= 1 )
- pItems[i].mbSubSize = TRUE;
+ pItems[i].mbSubSize = sal_True;
else
{
if ( (j == 0) && (pItems[i].mnBits & (SWIB_RELATIVESIZE | SWIB_PERCENTSIZE)) )
- pItems[i].mbSubSize = TRUE;
+ pItems[i].mbSubSize = sal_True;
}
}
}
@@ -691,20 +718,20 @@ static void ImplCalcSet( ImplSplitSet* pSet,
pItems[i].mnOldHeight = pItems[i].mnHeight;
if ( pItems[i].mnBits & SWIB_INVISIBLE )
- bEmpty = TRUE;
+ bEmpty = sal_True;
else
{
- bEmpty = FALSE;
+ bEmpty = sal_False;
if ( bDown )
{
if ( nPos+pItems[i].mnPixSize > nMaxPos )
- bEmpty = TRUE;
+ bEmpty = sal_True;
}
else
{
nPos -= pItems[i].mnPixSize;
if ( nPos < nMaxPos )
- bEmpty = TRUE;
+ bEmpty = sal_True;
}
}
@@ -775,9 +802,9 @@ static void ImplCalcSet( ImplSplitSet* pSet,
// Fixed setzen
for ( i = 0; i < nItems; i++ )
{
- pItems[i].mbFixed = FALSE;
+ pItems[i].mbFixed = sal_False;
if ( pItems[i].mnBits & SWIB_FIXED )
- pItems[i].mbFixed = TRUE;
+ pItems[i].mbFixed = sal_True;
else
{
// Wenn Child-Set vorhanden, ist dieses Item auch Fixed, wenn
@@ -788,7 +815,7 @@ static void ImplCalcSet( ImplSplitSet* pSet,
{
if ( pItems[i].mpSet->mpItems[j].mbFixed )
{
- pItems[i].mbFixed = TRUE;
+ pItems[i].mbFixed = sal_True;
break;
}
}
@@ -799,11 +826,11 @@ static void ImplCalcSet( ImplSplitSet* pSet,
// -----------------------------------------------------------------------
-void SplitWindow::ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, BOOL bHide,
- BOOL bRows, BOOL /*bDown*/ )
+void SplitWindow::ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, sal_Bool bHide,
+ sal_Bool bRows, sal_Bool /*bDown*/ )
{
- USHORT i;
- USHORT nItems = pSet->mnItems;
+ sal_uInt16 i;
+ sal_uInt16 nItems = pSet->mnItems;
ImplSplitItem* pItems = pSet->mpItems;
if ( pWindow->IsReallyVisible() && pWindow->IsUpdateMode() && pWindow->mbInvalidate )
@@ -873,9 +900,9 @@ void SplitWindow::ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, BOOL b
{
if ( pItems[i].mpSet )
{
- BOOL bTempHide = bHide;
+ sal_Bool bTempHide = bHide;
if ( !pItems[i].mnWidth || !pItems[i].mnHeight )
- bTempHide = TRUE;
+ bTempHide = sal_True;
ImplCalcSet2( pWindow, pItems[i].mpSet, bTempHide,
((pItems[i].mnBits & SWIB_COLSET) == 0) );
}
@@ -902,10 +929,10 @@ void SplitWindow::ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, BOOL b
// -----------------------------------------------------------------------
-static void ImplCalcLogSize( ImplSplitItem* pItems, USHORT nItems )
+static void ImplCalcLogSize( ImplSplitItem* pItems, sal_uInt16 nItems )
{
// Original-Groessen updaten
- USHORT i;
+ sal_uInt16 i;
long nRelSize = 0;
long nPerSize = 0;
for ( i = 0; i < nItems; i++ )
@@ -970,8 +997,8 @@ void SplitWindow::ImplDrawBack( SplitWindow* pWindow, const Rectangle& rRect,
void SplitWindow::ImplDrawBack( SplitWindow* pWindow, ImplSplitSet* pSet )
{
- USHORT i;
- USHORT nItems = pSet->mnItems;
+ sal_uInt16 i;
+ sal_uInt16 nItems = pSet->mnItems;
ImplSplitItem* pItems = pSet->mpItems;
// Beim Mainset auch den Hintergrund zeichnen
@@ -1013,20 +1040,20 @@ void SplitWindow::ImplDrawBack( SplitWindow* pWindow, ImplSplitSet* pSet )
// -----------------------------------------------------------------------
static void ImplDrawSplit( SplitWindow* pWindow, ImplSplitSet* pSet,
- BOOL bRows, BOOL bDown = TRUE )
+ sal_Bool bRows, sal_Bool bDown = sal_True )
{
if ( !pSet->mpItems )
return;
- USHORT i;
- USHORT nItems = pSet->mnItems;
+ sal_uInt16 i;
+ sal_uInt16 nItems = pSet->mnItems;
long nPos;
long nTop;
long nBottom;
ImplSplitItem* pItems = pSet->mpItems;
const StyleSettings& rStyleSettings = pWindow->GetSettings().GetStyleSettings();
- BOOL bFlat = (pWindow->GetStyle() & WB_FLATSPLITDRAW) == WB_FLATSPLITDRAW;
+ sal_Bool bFlat = (pWindow->GetStyle() & WB_FLATSPLITDRAW) == WB_FLATSPLITDRAW;
for ( i = 0; i < nItems-1; i++ )
{
@@ -1107,16 +1134,16 @@ static void ImplDrawSplit( SplitWindow* pWindow, ImplSplitSet* pSet,
// -----------------------------------------------------------------------
-USHORT SplitWindow::ImplTestSplit( ImplSplitSet* pSet, const Point& rPos,
- long& rMouseOff, ImplSplitSet** ppFoundSet, USHORT& rFoundPos,
- BOOL bRows, BOOL /*bDown*/ )
+sal_uInt16 SplitWindow::ImplTestSplit( ImplSplitSet* pSet, const Point& rPos,
+ long& rMouseOff, ImplSplitSet** ppFoundSet, sal_uInt16& rFoundPos,
+ sal_Bool bRows, sal_Bool /*bDown*/ )
{
if ( !pSet->mpItems )
return 0;
- USHORT i;
- USHORT nSplitTest;
- USHORT nItems = pSet->mnItems;
+ sal_uInt16 i;
+ sal_uInt16 nSplitTest;
+ sal_uInt16 nItems = pSet->mnItems;
long nMPos1;
long nMPos2;
long nPos;
@@ -1187,8 +1214,8 @@ USHORT SplitWindow::ImplTestSplit( ImplSplitSet* pSet, const Point& rPos,
// -----------------------------------------------------------------------
-USHORT SplitWindow::ImplTestSplit( SplitWindow* pWindow, const Point& rPos,
- long& rMouseOff, ImplSplitSet** ppFoundSet, USHORT& rFoundPos )
+sal_uInt16 SplitWindow::ImplTestSplit( SplitWindow* pWindow, const Point& rPos,
+ long& rMouseOff, ImplSplitSet** ppFoundSet, sal_uInt16& rFoundPos )
{
// Resizeable SplitWindow muss anders behandelt werden
if ( pWindow->mnWinStyle & WB_SIZEABLE )
@@ -1300,7 +1327,7 @@ void SplitWindow::ImplInit( Window* pParent, WinBits nStyle )
pNewSet->mnItems = 0;
pNewSet->mnId = 0;
pNewSet->mnSplitSize = SPLITWIN_SPLITSIZE;
- pNewSet->mbCalcPix = TRUE;
+ pNewSet->mbCalcPix = sal_True;
mpMainSet = pNewSet;
mpBaseSet = pNewSet;
@@ -1321,29 +1348,29 @@ void SplitWindow::ImplInit( Window* pParent, WinBits nStyle )
mnMouseModifier = 0;
mnMStartPos = 0;
mnMSplitPos = 0;
- mbDragFull = FALSE;
- mbHorz = TRUE;
- mbBottomRight = FALSE;
- mbCalc = FALSE;
- mbRecalc = TRUE;
- mbInvalidate = TRUE;
- mbAutoHide = FALSE;
- mbFadeIn = FALSE;
- mbFadeOut = FALSE;
- mbAutoHideIn = FALSE;
- mbAutoHideDown = FALSE;
- mbFadeInDown = FALSE;
- mbFadeOutDown = FALSE;
- mbAutoHidePressed = FALSE;
- mbFadeInPressed = FALSE;
- mbFadeOutPressed = FALSE;
- mbFadeNoButtonMode = FALSE;
- mbNoAlign = FALSE;
+ mbDragFull = sal_False;
+ mbHorz = sal_True;
+ mbBottomRight = sal_False;
+ mbCalc = sal_False;
+ mbRecalc = sal_True;
+ mbInvalidate = sal_True;
+ mbAutoHide = sal_False;
+ mbFadeIn = sal_False;
+ mbFadeOut = sal_False;
+ mbAutoHideIn = sal_False;
+ mbAutoHideDown = sal_False;
+ mbFadeInDown = sal_False;
+ mbFadeOutDown = sal_False;
+ mbAutoHidePressed = sal_False;
+ mbFadeInPressed = sal_False;
+ mbFadeOutPressed = sal_False;
+ mbFadeNoButtonMode = sal_False;
+ mbNoAlign = sal_False;
if ( nStyle & WB_NOSPLITDRAW )
{
pNewSet->mnSplitSize -= 2;
- mbInvalidate = FALSE;
+ mbInvalidate = sal_False;
}
if ( nStyle & WB_BORDER )
@@ -1476,7 +1503,7 @@ Size SplitWindow::CalcLayoutSizePixel( const Size& aNewSize )
{
long nCurSize;
long nCalcSize = 0;
- USHORT i;
+ sal_uInt16 i;
for ( i = 0; i < mpMainSet->mnItems; i++ )
{
@@ -1544,7 +1571,7 @@ void SplitWindow::ImplCalcLayout()
{
long nCurSize;
long nCalcSize = 0;
- USHORT i;
+ sal_uInt16 i;
for ( i = 0; i < mpMainSet->mnItems; i++ )
{
@@ -1563,9 +1590,9 @@ void SplitWindow::ImplCalcLayout()
nCurSize -= nSplitSize;
nCurSize -= (mpMainSet->mnItems-1)*mpMainSet->mnSplitSize;
- mbRecalc = FALSE;
+ mbRecalc = sal_False;
ImplSetWindowSize( nCalcSize-nCurSize );
- mbRecalc = TRUE;
+ mbRecalc = sal_True;
}
}
@@ -1606,15 +1633,15 @@ void SplitWindow::ImplCalcLayout()
// Sets rekursiv berechnen
ImplCalcSet( mpMainSet, nL, nT, nW, nH, mbHorz, !mbBottomRight );
- ImplCalcSet2( this, mpMainSet, FALSE, mbHorz, !mbBottomRight );
- mbCalc = FALSE;
+ ImplCalcSet2( this, mpMainSet, sal_False, mbHorz, !mbBottomRight );
+ mbCalc = sal_False;
}
// -----------------------------------------------------------------------
void SplitWindow::ImplUpdate()
{
- mbCalc = TRUE;
+ mbCalc = sal_True;
if ( IsReallyShown() && IsUpdateMode() && mbRecalc )
{
@@ -1654,7 +1681,7 @@ void SplitWindow::ImplUpdateSet( ImplSplitSet* pSet )
else
{
ImplSplitItem* pItem;
- USHORT nPos;
+ sal_uInt16 nPos;
pSet = ImplFindItem( mpMainSet, pSet->mnId, nPos );
pItem = &(pSet->mpItems[nPos]);
@@ -1694,7 +1721,7 @@ void SplitWindow::ImplSplitMousePos( Point& rMousePos )
// -----------------------------------------------------------------------
-void SplitWindow::ImplGetButtonRect( Rectangle& rRect, long nEx, BOOL bTest ) const
+void SplitWindow::ImplGetButtonRect( Rectangle& rRect, long nEx, sal_Bool bTest ) const
{
long nSplitSize = mpMainSet->mnSplitSize-2;
if ( mbAutoHide || mbFadeOut || mbFadeIn )
@@ -1767,7 +1794,7 @@ void SplitWindow::ImplGetButtonRect( Rectangle& rRect, long nEx, BOOL bTest ) co
// -----------------------------------------------------------------------
-void SplitWindow::ImplGetAutoHideRect( Rectangle& rRect, BOOL bTest ) const
+void SplitWindow::ImplGetAutoHideRect( Rectangle& rRect, sal_Bool bTest ) const
{
Rectangle aRect;
@@ -1784,7 +1811,7 @@ void SplitWindow::ImplGetAutoHideRect( Rectangle& rRect, BOOL bTest ) const
// -----------------------------------------------------------------------
-void SplitWindow::ImplGetFadeInRect( Rectangle& rRect, BOOL bTest ) const
+void SplitWindow::ImplGetFadeInRect( Rectangle& rRect, sal_Bool bTest ) const
{
Rectangle aRect;
@@ -1796,12 +1823,12 @@ void SplitWindow::ImplGetFadeInRect( Rectangle& rRect, BOOL bTest ) const
// -----------------------------------------------------------------------
-void SplitWindow::ImplGetFadeOutRect( Rectangle& rRect, BOOL ) const
+void SplitWindow::ImplGetFadeOutRect( Rectangle& rRect, sal_Bool ) const
{
Rectangle aRect;
if ( mbFadeOut )
- ImplGetButtonRect( aRect, 0, FALSE );
+ ImplGetButtonRect( aRect, 0, sal_False );
rRect = aRect;
}
@@ -1876,7 +1903,7 @@ void SplitWindow::ImplDrawButtonRect( const Rectangle& rRect, long nSize )
// -----------------------------------------------------------------------
-void SplitWindow::ImplDrawAutoHide( BOOL bInPaint )
+void SplitWindow::ImplDrawAutoHide( sal_Bool bInPaint )
{
if ( mbAutoHide )
{
@@ -1921,7 +1948,7 @@ void SplitWindow::ImplDrawAutoHide( BOOL bInPaint )
}
// Image ermitteln und zurueckgeben
- USHORT nId;
+ sal_uInt16 nId;
if ( mbAutoHidePressed )
{
if ( mbAutoHideIn )
@@ -1953,7 +1980,7 @@ void SplitWindow::ImplDrawAutoHide( BOOL bInPaint )
// -----------------------------------------------------------------------
-void SplitWindow::ImplDrawFadeArrow( const Point& rPt, BOOL bHorz, BOOL bLeft )
+void SplitWindow::ImplDrawFadeArrow( const Point& rPt, sal_Bool bHorz, sal_Bool bLeft )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -2009,14 +2036,14 @@ void SplitWindow::ImplDrawFadeArrow( const Point& rPt, BOOL bHorz, BOOL bLeft )
}
}
-void SplitWindow::ImplDrawGrip( const Rectangle& rRect, BOOL bHorz, BOOL bLeft )
+void SplitWindow::ImplDrawGrip( const Rectangle& rRect, sal_Bool bHorz, sal_Bool bLeft )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
if( rRect.IsInside( GetPointerPosPixel() ) )
{
DrawWallpaper( rRect, Wallpaper( Color( COL_WHITE ) ) );
- DrawSelectionBackground( rRect, 2, FALSE, FALSE, FALSE );
+ DrawSelectionBackground( rRect, 2, sal_False, sal_False, sal_False );
}
if( bHorz )
@@ -2067,7 +2094,7 @@ void SplitWindow::ImplDrawGrip( const Rectangle& rRect, BOOL bHorz, BOOL bLeft )
}
}
-void SplitWindow::ImplDrawFadeIn( BOOL bInPaint )
+void SplitWindow::ImplDrawFadeIn( sal_Bool bInPaint )
{
if ( mbFadeIn )
{
@@ -2075,17 +2102,17 @@ void SplitWindow::ImplDrawFadeIn( BOOL bInPaint )
Image aImage;
ImplGetFadeInRect( aTempRect );
- BOOL bLeft;
+ sal_Bool bLeft;
if ( meAlign == WINDOWALIGN_TOP )
- bLeft = FALSE;
+ bLeft = sal_False;
else if ( meAlign == WINDOWALIGN_BOTTOM )
- bLeft = TRUE;
+ bLeft = sal_True;
else if ( meAlign == WINDOWALIGN_LEFT )
- bLeft = FALSE;
+ bLeft = sal_False;
else if ( meAlign == WINDOWALIGN_RIGHT )
- bLeft = TRUE;
+ bLeft = sal_True;
else
- bLeft = TRUE;
+ bLeft = sal_True;
if ( !bInPaint )
Erase( aTempRect );
@@ -2096,7 +2123,7 @@ void SplitWindow::ImplDrawFadeIn( BOOL bInPaint )
// -----------------------------------------------------------------------
-void SplitWindow::ImplDrawFadeOut( BOOL bInPaint )
+void SplitWindow::ImplDrawFadeOut( sal_Bool bInPaint )
{
if ( mbFadeOut )
{
@@ -2104,17 +2131,17 @@ void SplitWindow::ImplDrawFadeOut( BOOL bInPaint )
Image aImage;
ImplGetFadeOutRect( aTempRect );
- BOOL bLeft;
+ sal_Bool bLeft;
if ( meAlign == WINDOWALIGN_TOP )
- bLeft = TRUE;
+ bLeft = sal_True;
else if ( meAlign == WINDOWALIGN_BOTTOM )
- bLeft = FALSE;
+ bLeft = sal_False;
else if ( meAlign == WINDOWALIGN_LEFT )
- bLeft = TRUE;
+ bLeft = sal_True;
else if ( meAlign == WINDOWALIGN_RIGHT )
- bLeft = FALSE;
+ bLeft = sal_False;
else
- bLeft = TRUE;
+ bLeft = sal_True;
if ( !bInPaint )
Erase( aTempRect );
@@ -2133,15 +2160,15 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt )
{
ImplSplitItem* pSplitItem;
long nCurMaxSize;
- USHORT nTemp;
- BOOL bDown;
- BOOL bPropSmaller;
+ sal_uInt16 nTemp;
+ sal_Bool bDown;
+ sal_Bool bPropSmaller;
mnMouseModifier = rMEvt.GetModifier();
if ( !(mnMouseModifier & KEY_SHIFT) || (mnSplitPos+1 >= mpSplitSet->mnItems) )
- bPropSmaller = FALSE;
+ bPropSmaller = sal_False;
else
- bPropSmaller = TRUE;
+ bPropSmaller = sal_True;
// Hier kann noch die maximale Groesse gesetzt werden
StartSplit();
@@ -2159,9 +2186,9 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt )
if ( mpSplitSet->mpItems )
{
- bDown = TRUE;
+ bDown = sal_True;
if ( (mpSplitSet == mpMainSet) && mbBottomRight )
- bDown = FALSE;
+ bDown = sal_False;
pSplitItem = &(mpSplitSet->mpItems[mnSplitPos]);
maDragRect.Left() = pSplitItem->mnLeft;
@@ -2292,9 +2319,9 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt )
else
{
ImplSplitItem* pItems = mpSplitSet->mpItems;
- USHORT nItems = mpSplitSet->mnItems;
+ sal_uInt16 nItems = mpSplitSet->mnItems;
mpLastSizes = new long[nItems*2];
- for ( USHORT i = 0; i < nItems; i++ )
+ for ( sal_uInt16 i = 0; i < nItems; i++ )
{
mpLastSizes[i*2] = pItems[i].mnSize;
mpLastSizes[i*2+1] = pItems[i].mnPixSize;
@@ -2369,35 +2396,35 @@ void SplitWindow::MouseButtonDown( const MouseEvent& rMEvt )
Point aMousePosPixel = rMEvt.GetPosPixel();
Rectangle aTestRect;
- mbFadeNoButtonMode = FALSE;
- ImplGetAutoHideRect( aTestRect, TRUE );
+ mbFadeNoButtonMode = sal_False;
+ ImplGetAutoHideRect( aTestRect, sal_True );
if ( aTestRect.IsInside( aMousePosPixel ) )
{
- mbAutoHideDown = TRUE;
- mbAutoHidePressed = TRUE;
- ImplDrawAutoHide( FALSE );
+ mbAutoHideDown = sal_True;
+ mbAutoHidePressed = sal_True;
+ ImplDrawAutoHide( sal_False );
}
else
{
- ImplGetFadeOutRect( aTestRect, TRUE );
+ ImplGetFadeOutRect( aTestRect, sal_True );
if ( aTestRect.IsInside( aMousePosPixel ) )
{
- mbFadeOutDown = TRUE;
- mbFadeOutPressed = TRUE;
- ImplDrawFadeOut( FALSE );
+ mbFadeOutDown = sal_True;
+ mbFadeOutPressed = sal_True;
+ ImplDrawFadeOut( sal_False );
}
else
{
- ImplGetFadeInRect( aTestRect, TRUE );
+ ImplGetFadeInRect( aTestRect, sal_True );
if ( aTestRect.IsInside( aMousePosPixel ) )
{
- mbFadeInDown = TRUE;
- mbFadeInPressed = TRUE;
- ImplDrawFadeIn( FALSE );
+ mbFadeInDown = sal_True;
+ mbFadeInPressed = sal_True;
+ ImplDrawFadeIn( sal_False );
}
else if ( !aTestRect.IsEmpty() && !(mnWinStyle & WB_SIZEABLE) )
{
- mbFadeNoButtonMode = TRUE;
+ mbFadeNoButtonMode = sal_True;
FadeIn();
return;
}
@@ -2419,8 +2446,8 @@ void SplitWindow::MouseMove( const MouseEvent& rMEvt )
Point aPos = rMEvt.GetPosPixel();
long nTemp;
ImplSplitSet* pTempSplitSet;
- USHORT nTempSplitPos;
- USHORT nSplitTest = ImplTestSplit( this, aPos, nTemp, &pTempSplitSet, nTempSplitPos );
+ sal_uInt16 nTempSplitPos;
+ sal_uInt16 nSplitTest = ImplTestSplit( this, aPos, nTemp, &pTempSplitSet, nTempSplitPos );
PointerStyle eStyle = POINTER_ARROW;
Rectangle aAutoHideRect;
Rectangle aFadeInRect;
@@ -2457,30 +2484,30 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
{
if ( rTEvt.IsTrackingEnded() )
{
- mbAutoHideDown = FALSE;
+ mbAutoHideDown = sal_False;
if ( mbAutoHidePressed )
{
- mbAutoHidePressed = FALSE;
+ mbAutoHidePressed = sal_False;
if ( !rTEvt.IsTrackingCanceled() )
{
mbAutoHideIn = !mbAutoHideIn;
- ImplDrawAutoHide( FALSE );
+ ImplDrawAutoHide( sal_False );
AutoHide();
}
else
- ImplDrawAutoHide( FALSE );
+ ImplDrawAutoHide( sal_False );
}
}
else
{
Rectangle aTestRect;
- ImplGetAutoHideRect( aTestRect, TRUE );
- BOOL bNewPressed = aTestRect.IsInside( aMousePosPixel );
+ ImplGetAutoHideRect( aTestRect, sal_True );
+ sal_Bool bNewPressed = aTestRect.IsInside( aMousePosPixel );
if ( bNewPressed != mbAutoHidePressed )
{
mbAutoHidePressed = bNewPressed;
- ImplDrawAutoHide( FALSE );
+ ImplDrawAutoHide( sal_False );
}
}
}
@@ -2488,11 +2515,11 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
{
if ( rTEvt.IsTrackingEnded() )
{
- mbFadeInDown = FALSE;
+ mbFadeInDown = sal_False;
if ( mbFadeInPressed )
{
- mbFadeInPressed = FALSE;
- ImplDrawFadeIn( FALSE );
+ mbFadeInPressed = sal_False;
+ ImplDrawFadeIn( sal_False );
if ( !rTEvt.IsTrackingCanceled() )
FadeIn();
@@ -2501,12 +2528,12 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
else
{
Rectangle aTestRect;
- ImplGetFadeInRect( aTestRect, TRUE );
- BOOL bNewPressed = aTestRect.IsInside( aMousePosPixel );
+ ImplGetFadeInRect( aTestRect, sal_True );
+ sal_Bool bNewPressed = aTestRect.IsInside( aMousePosPixel );
if ( bNewPressed != mbFadeInPressed )
{
mbFadeInPressed = bNewPressed;
- ImplDrawFadeIn( FALSE );
+ ImplDrawFadeIn( sal_False );
}
}
}
@@ -2514,11 +2541,11 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
{
if ( rTEvt.IsTrackingEnded() )
{
- mbFadeOutDown = FALSE;
+ mbFadeOutDown = sal_False;
if ( mbFadeOutPressed )
{
- mbFadeOutPressed = FALSE;
- ImplDrawFadeOut( FALSE );
+ mbFadeOutPressed = sal_False;
+ ImplDrawFadeOut( sal_False );
if ( !rTEvt.IsTrackingCanceled() )
FadeOut();
@@ -2527,12 +2554,12 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
else
{
Rectangle aTestRect;
- ImplGetFadeOutRect( aTestRect, TRUE );
- BOOL bNewPressed = aTestRect.IsInside( aMousePosPixel );
- if ( bNewPressed == FALSE )
+ ImplGetFadeOutRect( aTestRect, sal_True );
+ sal_Bool bNewPressed = aTestRect.IsInside( aMousePosPixel );
+ if ( bNewPressed == sal_False )
{
mbFadeOutPressed = bNewPressed;
- ImplDrawFadeOut( FALSE );
+ ImplDrawFadeOut( sal_False );
// We need a mouseevent with a position inside the button for the
// ImplStartSplit function!
@@ -2542,14 +2569,14 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
aOrgMEvt.GetModifier() );
ImplStartSplit( aNewMEvt );
- mbFadeOutDown = FALSE;
+ mbFadeOutDown = sal_False;
}
}
}
else
{
ImplSplitMousePos( aMousePosPixel );
- BOOL bSplit = TRUE;
+ sal_Bool bSplit = sal_True;
if ( mbDragFull )
{
if ( rTEvt.IsTrackingEnded() )
@@ -2557,8 +2584,8 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
if ( rTEvt.IsTrackingCanceled() )
{
ImplSplitItem* pItems = mpSplitSet->mpItems;
- USHORT nItems = mpSplitSet->mnItems;
- for ( USHORT i = 0; i < nItems; i++ )
+ sal_uInt16 nItems = mpSplitSet->mnItems;
+ for ( sal_uInt16 i = 0; i < nItems; i++ )
{
pItems[i].mnSize = mpLastSizes[i*2];
pItems[i].mnPixSize = mpLastSizes[i*2+1];
@@ -2566,7 +2593,7 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
ImplUpdate();
Split();
}
- bSplit = FALSE;
+ bSplit = sal_False;
}
}
else
@@ -2579,14 +2606,14 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
else
{
ImplDrawSplitTracking( this, aMousePosPixel );
- bSplit = FALSE;
+ bSplit = sal_False;
}
}
if ( bSplit )
{
- BOOL bPropSmaller = (mnMouseModifier & KEY_SHIFT) ? TRUE : FALSE;
- BOOL bPropGreater = (mnMouseModifier & KEY_MOD1) ? TRUE : FALSE;
+ sal_Bool bPropSmaller = (mnMouseModifier & KEY_SHIFT) ? sal_True : sal_False;
+ sal_Bool bPropGreater = (mnMouseModifier & KEY_MOD1) ? sal_True : sal_False;
long nDelta = mnMSplitPos-mnMStartPos;
if ( (mnSplitTest & SPLIT_WINDOW) && !mpMainSet->mpItems )
@@ -2670,9 +2697,9 @@ void SplitWindow::Paint( const Rectangle& )
ImplDrawBorder( this );
ImplDrawBorderLine( this );
- ImplDrawFadeOut( TRUE );
- ImplDrawFadeIn( TRUE );
- ImplDrawAutoHide( TRUE );
+ ImplDrawFadeOut( sal_True );
+ ImplDrawFadeIn( sal_True );
+ ImplDrawAutoHide( sal_True );
// FrameSet-Hintergruende zeichnen
ImplDrawBack( this, mpMainSet );
@@ -2710,9 +2737,9 @@ void SplitWindow::RequestHelp( const HelpEvent& rHEvt )
{
Point aMousePosPixel = ScreenToOutputPixel( rHEvt.GetMousePosPixel() );
Rectangle aHelpRect;
- USHORT nHelpResId = 0;
+ sal_uInt16 nHelpResId = 0;
- ImplGetAutoHideRect( aHelpRect, TRUE );
+ ImplGetAutoHideRect( aHelpRect, sal_True );
if ( aHelpRect.IsInside( aMousePosPixel ) )
{
if ( mbAutoHideIn )
@@ -2722,12 +2749,12 @@ void SplitWindow::RequestHelp( const HelpEvent& rHEvt )
}
else
{
- ImplGetFadeInRect( aHelpRect, TRUE );
+ ImplGetFadeInRect( aHelpRect, sal_True );
if ( aHelpRect.IsInside( aMousePosPixel ) )
nHelpResId = SV_HELPTEXT_FADEIN;
else
{
- ImplGetFadeOutRect( aHelpRect, TRUE );
+ ImplGetFadeOutRect( aHelpRect, sal_True );
if ( aHelpRect.IsInside( aMousePosPixel ) )
nHelpResId = SV_HELPTEXT_FADEOUT;
}
@@ -2798,17 +2825,17 @@ void SplitWindow::DataChanged( const DataChangedEvent& rDCEvt )
// -----------------------------------------------------------------------
-void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize,
- USHORT nPos, USHORT nSetId,
+void SplitWindow::InsertItem( sal_uInt16 nId, Window* pWindow, long nSize,
+ sal_uInt16 nPos, sal_uInt16 nSetId,
SplitWindowItemBits nBits )
{
#ifdef DBG_UTIL
- USHORT nDbgDummy;
+ sal_uInt16 nDbgDummy;
DBG_ASSERT( ImplFindSet( mpMainSet, nSetId ), "SplitWindow::InsertItem() - Set not exists" );
DBG_ASSERT( !ImplFindItem( mpMainSet, nId, nDbgDummy ), "SplitWindow::InsertItem() - Id already exists" );
#endif
- // Size muss min. 1 sein
+ // Size has to be at least 1.
if ( nSize < 1 )
nSize = 1;
@@ -2816,7 +2843,7 @@ void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize,
ImplSplitSet* pNewSet;
ImplSplitItem* pItem;
- // Platz fuer neues Item schaffen
+ // Make room for the new item.
if ( nPos > pSet->mnItems )
nPos = pSet->mnItems;
ImplSplitItem* pNewItems = new ImplSplitItem[pSet->mnItems+1];
@@ -2827,21 +2854,23 @@ void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize,
delete[] pSet->mpItems;
pSet->mpItems = pNewItems;
pSet->mnItems++;
- pSet->mbCalcPix = TRUE;
+ pSet->mbCalcPix = sal_True;
- // Item anlegen und erweitern
+ // Create and initialize item.
pItem = &(pSet->mpItems[nPos]);
memset( pItem, 0, sizeof( ImplSplitItem ) );
pItem->mnSize = nSize;
pItem->mnId = nId;
pItem->mnBits = nBits;
+ pItem->mnMinSize=-1;
+ pItem->mnMaxSize=-1;
if ( pWindow )
{
pItem->mpWindow = pWindow;
pItem->mpOrgParent = pWindow->GetParent();
- // Window mit SplitWindow verbinden
+ // Attach window to SplitWindow.
pWindow->Hide();
pWindow->SetParent( this );
}
@@ -2855,7 +2884,7 @@ void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize,
pNewSet->mnItems = 0;
pNewSet->mnId = nId;
pNewSet->mnSplitSize = pSet->mnSplitSize;
- pNewSet->mbCalcPix = TRUE;
+ pNewSet->mbCalcPix = sal_True;
pItem->mpSet = pNewSet;
}
@@ -2865,8 +2894,8 @@ void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize,
// -----------------------------------------------------------------------
-void SplitWindow::InsertItem( USHORT nId, long nSize,
- USHORT nPos, USHORT nSetId,
+void SplitWindow::InsertItem( sal_uInt16 nId, long nSize,
+ sal_uInt16 nPos, sal_uInt16 nSetId,
SplitWindowItemBits nBits )
{
InsertItem( nId, NULL, nSize, nPos, nSetId, nBits );
@@ -2874,15 +2903,15 @@ void SplitWindow::InsertItem( USHORT nId, long nSize,
// -----------------------------------------------------------------------
-void SplitWindow::MoveItem( USHORT nId, USHORT nNewPos, USHORT nNewSetId )
+void SplitWindow::MoveItem( sal_uInt16 nId, sal_uInt16 nNewPos, sal_uInt16 nNewSetId )
{
#ifdef DBG_UTIL
- USHORT nDbgDummy;
+ sal_uInt16 nDbgDummy;
DBG_ASSERT( ImplFindItem( mpMainSet, nId, nDbgDummy ), "SplitWindow::MoveItem() - Id not found" );
DBG_ASSERT( ImplFindSet( mpMainSet, nNewSetId ), "SplitWindow::MoveItem() - Set not exists" );
#endif
- USHORT nPos;
+ sal_uInt16 nPos;
ImplSplitSet* pNewSet = ImplFindSet( mpMainSet, nNewSetId );
ImplSplitSet* pSet = ImplFindItem( mpMainSet, nId, nPos );
ImplSplitItem aTempItem;
@@ -2915,7 +2944,7 @@ void SplitWindow::MoveItem( USHORT nId, USHORT nNewPos, USHORT nNewSetId )
nNewPos = pNewSet->mnItems;
memcpy( &aTempItem, &(pSet->mpItems[nPos]), sizeof( aTempItem ) );
pSet->mnItems--;
- pSet->mbCalcPix = TRUE;
+ pSet->mbCalcPix = sal_True;
if ( pSet->mnItems )
{
memmove( pSet->mpItems+nPos, pSet->mpItems+nPos+1,
@@ -2937,7 +2966,7 @@ void SplitWindow::MoveItem( USHORT nId, USHORT nNewPos, USHORT nNewSetId )
delete[] pNewSet->mpItems;
pNewSet->mpItems = pNewItems;
pNewSet->mnItems++;
- pNewSet->mbCalcPix = TRUE;
+ pNewSet->mbCalcPix = sal_True;
memcpy( &(pNewSet->mpItems[nNewPos]), &aTempItem, sizeof( aTempItem ) );
ImplUpdate();
}
@@ -2945,15 +2974,15 @@ void SplitWindow::MoveItem( USHORT nId, USHORT nNewPos, USHORT nNewSetId )
// -----------------------------------------------------------------------
-void SplitWindow::RemoveItem( USHORT nId, BOOL bHide )
+void SplitWindow::RemoveItem( sal_uInt16 nId, sal_Bool bHide )
{
#ifdef DBG_UTIL
- USHORT nDbgDummy;
+ sal_uInt16 nDbgDummy;
DBG_ASSERT( ImplFindItem( mpMainSet, nId, nDbgDummy ), "SplitWindow::RemoveItem() - Id not found" );
#endif
// Set suchen
- USHORT nPos;
+ sal_uInt16 nPos;
ImplSplitSet* pSet = ImplFindItem( mpMainSet, nId, nPos );
ImplSplitItem* pItem = &(pSet->mpItems[nPos]);
Window* pWindow = pItem->mpWindow;
@@ -2965,7 +2994,7 @@ void SplitWindow::RemoveItem( USHORT nId, BOOL bHide )
// Item entfernen
pSet->mnItems--;
- pSet->mbCalcPix = TRUE;
+ pSet->mbCalcPix = sal_True;
if ( pSet->mnItems )
{
memmove( pSet->mpItems+nPos, pSet->mpItems+nPos+1,
@@ -3007,7 +3036,7 @@ void SplitWindow::Clear()
mpMainSet->mnItems = 0;
mpMainSet->mnId = 0;
mpMainSet->mnSplitSize = SPLITWIN_SPLITSIZE;
- mpMainSet->mbCalcPix = TRUE;
+ mpMainSet->mbCalcPix = sal_True;
if ( mnWinStyle & WB_NOSPLITDRAW )
mpMainSet->mnSplitSize -= 2;
mpBaseSet = mpMainSet;
@@ -3018,22 +3047,22 @@ void SplitWindow::Clear()
// -----------------------------------------------------------------------
-void SplitWindow::SetBaseSet( USHORT nSetId )
+void SplitWindow::SetBaseSet( sal_uInt16 nSetId )
{
mpBaseSet = ImplFindSet( mpMainSet, nSetId );
}
// -----------------------------------------------------------------------
-USHORT SplitWindow::GetBaseSet() const
+sal_uInt16 SplitWindow::GetBaseSet() const
{
return mpBaseSet->mnId;
}
// -----------------------------------------------------------------------
-void SplitWindow::SetSplitSize( USHORT nSetId, long nSplitSize,
- BOOL bWithChilds )
+void SplitWindow::SetSplitSize( sal_uInt16 nSetId, long nSplitSize,
+ sal_Bool bWithChilds )
{
ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId );
if ( pSet )
@@ -3048,7 +3077,7 @@ void SplitWindow::SetSplitSize( USHORT nSetId, long nSplitSize,
// -----------------------------------------------------------------------
-long SplitWindow::GetSplitSize( USHORT nSetId ) const
+long SplitWindow::GetSplitSize( sal_uInt16 nSetId ) const
{
ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId );
if ( pSet )
@@ -3059,7 +3088,7 @@ long SplitWindow::GetSplitSize( USHORT nSetId ) const
// -----------------------------------------------------------------------
-void SplitWindow::SetItemBackground( USHORT nSetId )
+void SplitWindow::SetItemBackground( sal_uInt16 nSetId )
{
Wallpaper aWall;
SetItemBackground( nSetId, aWall );
@@ -3067,13 +3096,13 @@ void SplitWindow::SetItemBackground( USHORT nSetId )
// -----------------------------------------------------------------------
-void SplitWindow::SetItemBackground( USHORT nSetId, const Wallpaper& rWallpaper )
+void SplitWindow::SetItemBackground( sal_uInt16 nSetId, const Wallpaper& rWallpaper )
{
ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId );
if ( pSet )
{
- BOOL bUpdate = TRUE;
+ sal_Bool bUpdate = sal_True;
if ( rWallpaper.GetStyle() == WALLPAPER_NULL )
{
@@ -3083,12 +3112,12 @@ void SplitWindow::SetItemBackground( USHORT nSetId, const Wallpaper& rWallpaper
pSet->mpWallpaper = NULL;
}
else
- bUpdate = FALSE;
+ bUpdate = sal_False;
}
else
{
// Ab jetzt muss immer invalidiert werden
- mbInvalidate = TRUE;
+ mbInvalidate = sal_True;
if ( !pSet->mpWallpaper )
pSet->mpWallpaper = new Wallpaper( rWallpaper );
@@ -3107,7 +3136,7 @@ void SplitWindow::SetItemBackground( USHORT nSetId, const Wallpaper& rWallpaper
// -----------------------------------------------------------------------
-Wallpaper SplitWindow::GetItemBackground( USHORT nSetId ) const
+Wallpaper SplitWindow::GetItemBackground( sal_uInt16 nSetId ) const
{
ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId );
@@ -3122,25 +3151,25 @@ Wallpaper SplitWindow::GetItemBackground( USHORT nSetId ) const
// -----------------------------------------------------------------------
-BOOL SplitWindow::IsItemBackground( USHORT nSetId ) const
+sal_Bool SplitWindow::IsItemBackground( sal_uInt16 nSetId ) const
{
ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId );
if ( pSet && pSet->mpWallpaper )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void SplitWindow::SetItemBitmap( USHORT nSetId, const Bitmap& rBitmap )
+void SplitWindow::SetItemBitmap( sal_uInt16 nSetId, const Bitmap& rBitmap )
{
ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId );
if ( pSet )
{
- BOOL bUpdate = TRUE;
+ sal_Bool bUpdate = sal_True;
if ( !rBitmap )
{
@@ -3150,12 +3179,12 @@ void SplitWindow::SetItemBitmap( USHORT nSetId, const Bitmap& rBitmap )
pSet->mpBitmap = NULL;
}
else
- bUpdate = FALSE;
+ bUpdate = sal_False;
}
else
{
// Ab jetzt muss immer invalidiert werden
- mbInvalidate = TRUE;
+ mbInvalidate = sal_True;
if ( !pSet->mpBitmap )
pSet->mpBitmap = new Bitmap( rBitmap );
@@ -3174,7 +3203,7 @@ void SplitWindow::SetItemBitmap( USHORT nSetId, const Bitmap& rBitmap )
// -----------------------------------------------------------------------
-Bitmap SplitWindow::GetItemBitmap( USHORT nSetId ) const
+Bitmap SplitWindow::GetItemBitmap( sal_uInt16 nSetId ) const
{
ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId );
@@ -3189,15 +3218,15 @@ Bitmap SplitWindow::GetItemBitmap( USHORT nSetId ) const
// -----------------------------------------------------------------------
-void SplitWindow::SplitItem( USHORT nId, long nNewSize,
- BOOL bPropSmall, BOOL bPropGreat )
+void SplitWindow::SplitItem( sal_uInt16 nId, long nNewSize,
+ sal_Bool bPropSmall, sal_Bool bPropGreat )
{
- USHORT nItems;
- USHORT nPos;
- USHORT nMin;
- USHORT nMax;
- USHORT i;
- USHORT n;
+ sal_uInt16 nItems;
+ sal_uInt16 nPos;
+ sal_uInt16 nMin;
+ sal_uInt16 nMax;
+ sal_uInt16 i;
+ sal_uInt16 n;
long nDelta;
long nTempDelta;
ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
@@ -3209,6 +3238,10 @@ void SplitWindow::SplitItem( USHORT nId, long nNewSize,
nItems = pSet->mnItems;
pItems = pSet->mpItems;
+ // When there is an explicit minimum or maximum size then move nNewSize
+ // into that range (when it is not yet already in it.)
+ nNewSize = ValidateSize(nNewSize, pItems[nPos]);
+
if ( mbCalc )
{
pItems[nPos].mnSize = nNewSize;
@@ -3234,8 +3267,8 @@ void SplitWindow::SplitItem( USHORT nId, long nNewSize,
}
// Wenn das Fenster sizeable ist, wird das TopSet anders behandelt
- BOOL bSmall = TRUE;
- BOOL bGreat = TRUE;
+ sal_Bool bSmall = sal_True;
+ sal_Bool bGreat = sal_True;
if ( (pSet == mpMainSet) && (mnWinStyle & WB_SIZEABLE) )
{
if ( nPos < pSet->mnItems-1 )
@@ -3245,29 +3278,29 @@ void SplitWindow::SplitItem( USHORT nId, long nNewSize,
((nDelta < 0) && bPropGreat)) )
{
if ( nDelta < 0 )
- bGreat = FALSE;
+ bGreat = sal_False;
else
- bSmall = FALSE;
+ bSmall = sal_False;
}
}
else
{
if ( nDelta < 0 )
- bGreat = FALSE;
+ bGreat = sal_False;
else
- bSmall = FALSE;
+ bSmall = sal_False;
}
}
else if ( nPos >= nMax )
{
- bSmall = FALSE;
- bGreat = FALSE;
+ bSmall = sal_False;
+ bGreat = sal_False;
}
else if ( nPos && (nPos >= pSet->mnItems-1) )
{
nPos--;
nDelta *= -1;
- BOOL bTemp = bPropSmall;
+ sal_Bool bTemp = bPropSmall;
bPropSmall = bPropGreat;
bPropGreat = bTemp;
}
@@ -3420,9 +3453,9 @@ void SplitWindow::SplitItem( USHORT nId, long nNewSize,
// -----------------------------------------------------------------------
-void SplitWindow::SetItemSize( USHORT nId, long nNewSize )
+void SplitWindow::SetItemSize( sal_uInt16 nId, long nNewSize )
{
- USHORT nPos;
+ sal_uInt16 nPos;
ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
ImplSplitItem* pItem;
@@ -3435,16 +3468,16 @@ void SplitWindow::SetItemSize( USHORT nId, long nNewSize )
{
// Neue Groesse setzen und neu durchrechnen
pItem->mnSize = nNewSize;
- pSet->mbCalcPix = TRUE;
+ pSet->mbCalcPix = sal_True;
ImplUpdate();
}
}
// -----------------------------------------------------------------------
-long SplitWindow::GetItemSize( USHORT nId ) const
+long SplitWindow::GetItemSize( sal_uInt16 nId ) const
{
- USHORT nPos;
+ sal_uInt16 nPos;
ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
if ( pSet )
@@ -3455,9 +3488,9 @@ long SplitWindow::GetItemSize( USHORT nId ) const
// -----------------------------------------------------------------------
-long SplitWindow::GetItemSize( USHORT nId, SplitWindowItemBits nBits ) const
+long SplitWindow::GetItemSize( sal_uInt16 nId, SplitWindowItemBits nBits ) const
{
- USHORT nPos;
+ sal_uInt16 nPos;
ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
if ( pSet )
@@ -3471,9 +3504,9 @@ long SplitWindow::GetItemSize( USHORT nId, SplitWindowItemBits nBits ) const
long nRelSize = 0;
long nPerSize = 0;
ImplSplitItem* pItems;
- USHORT nItems;
+ sal_uInt16 nItems;
SplitWindowItemBits nTempBits;
- USHORT i;
+ sal_uInt16 i;
nItems = pSet->mnItems;
pItems = pSet->mpItems;
for ( i = 0; i < nItems; i++ )
@@ -3510,11 +3543,41 @@ long SplitWindow::GetItemSize( USHORT nId, SplitWindowItemBits nBits ) const
return 0;
}
+
+
+
+void SplitWindow::SetItemSizeRange (sal_uInt16 nId, const Range aRange)
+{
+ sal_uInt16 nPos;
+ ImplSplitSet* pSet = ImplFindItem(mpBaseSet, nId, nPos);
+
+ if (pSet != NULL)
+ {
+ pSet->mpItems[nPos].mnMinSize = aRange.Min();
+ pSet->mpItems[nPos].mnMaxSize = aRange.Max();
+ }
+}
+
+
+
+
+Range SplitWindow::GetItemSizeRange (sal_uInt16 nId) const
+{
+ sal_uInt16 nPos;
+ ImplSplitSet* pSet = ImplFindItem(mpBaseSet, nId, nPos);
+
+ if (pSet != NULL)
+ return Range (pSet->mpItems[nPos].mnMinSize, pSet->mpItems[nPos].mnMaxSize);
+ else
+ return Range(-1,-1);
+}
+
+
// -----------------------------------------------------------------------
-void SplitWindow::SetItemBits( USHORT nId, SplitWindowItemBits nNewBits )
+void SplitWindow::SetItemBits( sal_uInt16 nId, SplitWindowItemBits nNewBits )
{
- USHORT nPos;
+ sal_uInt16 nPos;
ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
ImplSplitItem* pItem;
@@ -3529,16 +3592,16 @@ void SplitWindow::SetItemBits( USHORT nId, SplitWindowItemBits nNewBits )
{
// Neue Bits setzen und neu durchrechnen
pItem->mnBits = nNewBits;
- pSet->mbCalcPix = TRUE;
+ pSet->mbCalcPix = sal_True;
ImplUpdate();
}
}
// -----------------------------------------------------------------------
-SplitWindowItemBits SplitWindow::GetItemBits( USHORT nId ) const
+SplitWindowItemBits SplitWindow::GetItemBits( sal_uInt16 nId ) const
{
- USHORT nPos;
+ sal_uInt16 nPos;
ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
if ( pSet )
@@ -3549,9 +3612,9 @@ SplitWindowItemBits SplitWindow::GetItemBits( USHORT nId ) const
// -----------------------------------------------------------------------
-Window* SplitWindow::GetItemWindow( USHORT nId ) const
+Window* SplitWindow::GetItemWindow( sal_uInt16 nId ) const
{
- USHORT nPos;
+ sal_uInt16 nPos;
ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
if ( pSet )
@@ -3562,9 +3625,9 @@ Window* SplitWindow::GetItemWindow( USHORT nId ) const
// -----------------------------------------------------------------------
-USHORT SplitWindow::GetSet( USHORT nId ) const
+sal_uInt16 SplitWindow::GetSet( sal_uInt16 nId ) const
{
- USHORT nPos;
+ sal_uInt16 nPos;
ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
if ( pSet )
@@ -3575,55 +3638,55 @@ USHORT SplitWindow::GetSet( USHORT nId ) const
// -----------------------------------------------------------------------
-BOOL SplitWindow::GetSet( USHORT nId, USHORT& rSetId, USHORT& rPos ) const
+sal_Bool SplitWindow::GetSet( sal_uInt16 nId, sal_uInt16& rSetId, sal_uInt16& rPos ) const
{
ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, rPos );
if ( pSet )
{
rSetId = pSet->mnId;
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL SplitWindow::IsItemValid( USHORT nId ) const
+sal_Bool SplitWindow::IsItemValid( sal_uInt16 nId ) const
{
- USHORT nPos;
+ sal_uInt16 nPos;
ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
if ( pSet )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-USHORT SplitWindow::GetItemId( Window* pWindow ) const
+sal_uInt16 SplitWindow::GetItemId( Window* pWindow ) const
{
return ImplFindItem( mpBaseSet, pWindow );
}
// -----------------------------------------------------------------------
-USHORT SplitWindow::GetItemId( const Point& rPos ) const
+sal_uInt16 SplitWindow::GetItemId( const Point& rPos ) const
{
return ImplFindItem( mpBaseSet, rPos, mbHorz, !mbBottomRight );
}
// -----------------------------------------------------------------------
-USHORT SplitWindow::GetItemPos( USHORT nId, USHORT nSetId ) const
+sal_uInt16 SplitWindow::GetItemPos( sal_uInt16 nId, sal_uInt16 nSetId ) const
{
ImplSplitSet* pSet = ImplFindSet( mpBaseSet, nSetId );
- USHORT nPos = SPLITWINDOW_ITEM_NOTFOUND;
+ sal_uInt16 nPos = SPLITWINDOW_ITEM_NOTFOUND;
if ( pSet )
{
- for ( USHORT i = 0; i < pSet->mnItems; i++ )
+ for ( sal_uInt16 i = 0; i < pSet->mnItems; i++ )
{
if ( pSet->mpItems[i].mnId == nId )
{
@@ -3638,7 +3701,7 @@ USHORT SplitWindow::GetItemPos( USHORT nId, USHORT nSetId ) const
// -----------------------------------------------------------------------
-USHORT SplitWindow::GetItemId( USHORT nPos, USHORT nSetId ) const
+sal_uInt16 SplitWindow::GetItemId( sal_uInt16 nPos, sal_uInt16 nSetId ) const
{
ImplSplitSet* pSet = ImplFindSet( mpBaseSet, nSetId );
if ( pSet && (nPos < pSet->mnItems) )
@@ -3649,7 +3712,7 @@ USHORT SplitWindow::GetItemId( USHORT nPos, USHORT nSetId ) const
// -----------------------------------------------------------------------
-USHORT SplitWindow::GetItemCount( USHORT nSetId ) const
+sal_uInt16 SplitWindow::GetItemCount( sal_uInt16 nSetId ) const
{
ImplSplitSet* pSet = ImplFindSet( mpBaseSet, nSetId );
if ( pSet )
@@ -3664,28 +3727,28 @@ void SplitWindow::ImplNewAlign()
{
if ( mbNoAlign )
{
- mbHorz = FALSE;
- mbBottomRight = FALSE;
+ mbHorz = sal_False;
+ mbBottomRight = sal_False;
}
else if ( meAlign == WINDOWALIGN_TOP )
{
- mbHorz = TRUE;
- mbBottomRight = FALSE;
+ mbHorz = sal_True;
+ mbBottomRight = sal_False;
}
else if ( meAlign == WINDOWALIGN_BOTTOM )
{
- mbHorz = TRUE;
- mbBottomRight = TRUE;
+ mbHorz = sal_True;
+ mbBottomRight = sal_True;
}
else if ( meAlign == WINDOWALIGN_LEFT )
{
- mbHorz = FALSE;
- mbBottomRight = FALSE;
+ mbHorz = sal_False;
+ mbBottomRight = sal_False;
}
else if ( meAlign == WINDOWALIGN_RIGHT )
{
- mbHorz = FALSE;
- mbBottomRight = TRUE;
+ mbHorz = sal_False;
+ mbBottomRight = sal_True;
}
if ( mnWinStyle & WB_BORDER )
@@ -3701,7 +3764,7 @@ void SplitWindow::ImplNewAlign()
// -----------------------------------------------------------------------
-void SplitWindow::SetNoAlign( BOOL bNoAlign )
+void SplitWindow::SetNoAlign( sal_Bool bNoAlign )
{
bNoAlign = bNoAlign != 0;
if ( mbNoAlign != bNoAlign )
@@ -3725,7 +3788,7 @@ void SplitWindow::SetAlign( WindowAlign eNewAlign )
// -----------------------------------------------------------------------
Size SplitWindow::CalcWindowSizePixel( const Size& rSize, WindowAlign eAlign,
- WinBits nWinStyle, BOOL bExtra )
+ WinBits nWinStyle, sal_Bool bExtra )
{
long nLeft;
long nTop;
@@ -3733,7 +3796,7 @@ Size SplitWindow::CalcWindowSizePixel( const Size& rSize, WindowAlign eAlign,
long nBottom;
Size aSize = rSize;
- ImplCalcBorder( eAlign, FALSE, nLeft, nTop, nRight, nBottom );
+ ImplCalcBorder( eAlign, sal_False, nLeft, nTop, nRight, nBottom );
aSize.Width() += nLeft+nRight;
aSize.Height() += nTop+nBottom;
@@ -3758,7 +3821,7 @@ Size SplitWindow::CalcWindowSizePixel( const Size& rSize, WindowAlign eAlign,
// -----------------------------------------------------------------------
-void SplitWindow::ShowAutoHideButton( BOOL bShow )
+void SplitWindow::ShowAutoHideButton( sal_Bool bShow )
{
mbAutoHide = bShow;
ImplUpdate();
@@ -3766,7 +3829,7 @@ void SplitWindow::ShowAutoHideButton( BOOL bShow )
// -----------------------------------------------------------------------
-void SplitWindow::ShowFadeInHideButton( BOOL bShow )
+void SplitWindow::ShowFadeInHideButton( sal_Bool bShow )
{
mbFadeIn = bShow;
ImplUpdate();
@@ -3774,7 +3837,7 @@ void SplitWindow::ShowFadeInHideButton( BOOL bShow )
// -----------------------------------------------------------------------
-void SplitWindow::ShowFadeOutButton( BOOL bShow )
+void SplitWindow::ShowFadeOutButton( sal_Bool bShow )
{
mbFadeOut = bShow;
ImplUpdate();
@@ -3782,7 +3845,7 @@ void SplitWindow::ShowFadeOutButton( BOOL bShow )
// -----------------------------------------------------------------------
-void SplitWindow::SetAutoHideState( BOOL bAutoHide )
+void SplitWindow::SetAutoHideState( sal_Bool bAutoHide )
{
mbAutoHideIn = bAutoHide;
if ( IsReallyVisible() )
@@ -3812,7 +3875,7 @@ long SplitWindow::GetFadeInSize() const
Rectangle SplitWindow::GetAutoHideRect() const
{
Rectangle aRect;
- ImplGetAutoHideRect( aRect, TRUE );
+ ImplGetAutoHideRect( aRect, sal_True );
return aRect;
}
@@ -3821,7 +3884,7 @@ Rectangle SplitWindow::GetAutoHideRect() const
Rectangle SplitWindow::GetFadeInRect() const
{
Rectangle aRect;
- ImplGetFadeInRect( aRect, TRUE );
+ ImplGetFadeInRect( aRect, sal_True );
return aRect;
}
@@ -3830,7 +3893,7 @@ Rectangle SplitWindow::GetFadeInRect() const
Rectangle SplitWindow::GetFadeOutRect() const
{
Rectangle aRect;
- ImplGetFadeOutRect( aRect, TRUE );
+ ImplGetFadeOutRect( aRect, sal_True );
return aRect;
}
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index 924cb837545c..9280bb25b80c 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -78,7 +78,7 @@ StatusBar::ImplData::~ImplData()
struct ImplStatusItem
{
- USHORT mnId;
+ sal_uInt16 mnId;
StatusBarItemBits mnBits;
long mnWidth;
long mnOffset;
@@ -87,16 +87,16 @@ struct ImplStatusItem
XubString maText;
XubString maHelpText;
XubString maQuickHelpText;
- ULONG mnHelpId;
+ rtl::OString maHelpId;
void* mpUserData;
- BOOL mbVisible;
+ sal_Bool mbVisible;
XubString maAccessibleName;
XubString maCommand;
};
// =======================================================================
-inline long ImplCalcProgessWidth( USHORT nMax, long nSize )
+inline long ImplCalcProgessWidth( sal_uInt16 nMax, long nSize )
{
return ((nMax*(nSize+(nSize/2)))-(nSize/2)+(STATUSBAR_PRGS_OFFSET*2));
}
@@ -104,7 +104,7 @@ inline long ImplCalcProgessWidth( USHORT nMax, long nSize )
// -----------------------------------------------------------------------
static Point ImplGetItemTextPos( const Size& rRectSize, const Size& rTextSize,
- USHORT nStyle )
+ sal_uInt16 nStyle )
{
long nX;
long nY;
@@ -124,12 +124,12 @@ static Point ImplGetItemTextPos( const Size& rRectSize, const Size& rTextSize,
// -----------------------------------------------------------------------
-BOOL StatusBar::ImplIsItemUpdate()
+sal_Bool StatusBar::ImplIsItemUpdate()
{
if ( !mbProgressMode && mbVisibleItems && IsReallyVisible() && IsUpdateMode() )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -148,11 +148,11 @@ void StatusBar::ImplInit( Window* pParent, WinBits nStyle )
mpItemList = new ImplStatusItemList;
mpImplData->mpVirDev = new VirtualDevice( *this );
mnCurItemId = 0;
- mbFormat = TRUE;
- mbVisibleItems = TRUE;
- mbProgressMode = FALSE;
- mbInUserDraw = FALSE;
- mbBottomBorder = FALSE;
+ mbFormat = sal_True;
+ mbVisibleItems = sal_True;
+ mbProgressMode = sal_False;
+ mbInUserDraw = sal_False;
+ mbBottomBorder = sal_False;
mnItemsWidth = STATUSBAR_OFFSET_X;
mnDX = 0;
mnDY = 0;
@@ -160,7 +160,7 @@ void StatusBar::ImplInit( Window* pParent, WinBits nStyle )
mnItemY = STATUSBAR_OFFSET_Y;
mnTextY = STATUSBAR_OFFSET_TEXTY;
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
SetLineColor();
SetOutputSizePixel( CalcWindowSizePixel() );
@@ -205,8 +205,8 @@ StatusBar::~StatusBar()
// -----------------------------------------------------------------------
-void StatusBar::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void StatusBar::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -253,7 +253,7 @@ void StatusBar::ImplInitSettings( BOOL bFont,
IsNativeControlSupported( CTRL_WINDOW_BACKGROUND, PART_BACKGROUND_WINDOW ) )
{
ImplGetWindowImpl()->mnNativeBackground = PART_BACKGROUND_WINDOW;
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
}
}
}
@@ -266,7 +266,7 @@ void StatusBar::ImplFormat()
long nExtraWidth;
long nExtraWidth2;
long nX;
- USHORT nAutoSizeItems = 0;
+ sal_uInt16 nAutoSizeItems = 0;
// Breiten zusammenrechnen
mnItemsWidth = STATUSBAR_OFFSET_X;
@@ -309,6 +309,8 @@ void StatusBar::ImplFormat()
nExtraWidth2 = 0;
}
nX = STATUSBAR_OFFSET_X;
+ if( ImplHasMirroredGraphics() && IsRTLEnabled() )
+ nX += ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset;
}
for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
@@ -329,12 +331,12 @@ void StatusBar::ImplFormat()
}
}
- mbFormat = FALSE;
+ mbFormat = sal_False;
}
// -----------------------------------------------------------------------
-Rectangle StatusBar::ImplGetItemRectPos( USHORT nPos ) const
+Rectangle StatusBar::ImplGetItemRectPos( sal_uInt16 nPos ) const
{
Rectangle aRect;
ImplStatusItem* pItem;
@@ -357,7 +359,7 @@ Rectangle StatusBar::ImplGetItemRectPos( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT StatusBar::ImplGetFirstVisiblePos() const
+sal_uInt16 StatusBar::ImplGetFirstVisiblePos() const
{
ImplStatusItem* pItem;
@@ -367,7 +369,7 @@ USHORT StatusBar::ImplGetFirstVisiblePos() const
if ( pItem )
{
if ( pItem->mbVisible )
- return USHORT(nPos);
+ return sal_uInt16(nPos);
}
}
@@ -376,7 +378,7 @@ USHORT StatusBar::ImplGetFirstVisiblePos() const
// -----------------------------------------------------------------------
-void StatusBar::ImplDrawText( BOOL bOffScreen, long nOldTextWidth )
+void StatusBar::ImplDrawText( sal_Bool bOffScreen, long nOldTextWidth )
{
// Das ueberschreiben der Item-Box verhindern
Rectangle aTextRect;
@@ -390,7 +392,7 @@ void StatusBar::ImplDrawText( BOOL bOffScreen, long nOldTextWidth )
{
// Position ermitteln
XubString aStr = GetText();
- USHORT nPos = aStr.Search( _LF );
+ sal_uInt16 nPos = aStr.Search( _LF );
if ( nPos != STRING_NOTFOUND )
aStr.Erase( nPos );
@@ -413,7 +415,7 @@ void StatusBar::ImplDrawText( BOOL bOffScreen, long nOldTextWidth )
// -----------------------------------------------------------------------
-void StatusBar::ImplDrawItem( BOOL bOffScreen, USHORT nPos, BOOL bDrawText, BOOL bDrawFrame )
+void StatusBar::ImplDrawItem( sal_Bool bOffScreen, sal_uInt16 nPos, sal_Bool bDrawText, sal_Bool bDrawFrame )
{
Rectangle aRect = ImplGetItemRectPos( nPos );
@@ -455,12 +457,12 @@ void StatusBar::ImplDrawItem( BOOL bOffScreen, USHORT nPos, BOOL bDrawText, BOOL
{
if ( bOffScreen )
{
- mbInUserDraw = TRUE;
+ mbInUserDraw = sal_True;
mpImplData->mpVirDev->EnableRTL( IsRTLEnabled() );
UserDrawEvent aODEvt( mpImplData->mpVirDev, Rectangle( Point(), aTextRectSize ), pItem->mnId );
UserDraw( aODEvt );
- mpImplData->mpVirDev->EnableRTL( FALSE );
- mbInUserDraw = FALSE;
+ mpImplData->mpVirDev->EnableRTL( sal_False );
+ mbInUserDraw = sal_False;
}
else
{
@@ -481,7 +483,7 @@ void StatusBar::ImplDrawItem( BOOL bOffScreen, USHORT nPos, BOOL bDrawText, BOOL
{
if( !(pItem->mnBits & SIB_FLAT) )
{
- USHORT nStyle;
+ sal_uInt16 nStyle;
if ( pItem->mnBits & SIB_IN )
nStyle = FRAME_DRAW_IN;
@@ -515,7 +517,7 @@ void StatusBar::ImplDrawItem( BOOL bOffScreen, USHORT nPos, BOOL bDrawText, BOOL
void DrawProgress( Window* pWindow, const Point& rPos,
long nOffset, long nPrgsWidth, long nPrgsHeight,
- USHORT nPercent1, USHORT nPercent2, USHORT nPercentCount,
+ sal_uInt16 nPercent1, sal_uInt16 nPercent2, sal_uInt16 nPercentCount,
const Rectangle& rFramePosSize
)
{
@@ -553,7 +555,7 @@ void DrawProgress( Window* pWindow, const Point& rPos,
pWindow->Push( PUSH_CLIPREGION );
pWindow->IntersectClipRegion( rFramePosSize );
}
- BOOL bNativeOK = pWindow->DrawNativeControl( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
+ sal_Bool bNativeOK = pWindow->DrawNativeControl( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
CTRL_STATE_ENABLED, aValue, rtl::OUString() );
if( bNeedErase )
pWindow->Pop();
@@ -565,8 +567,8 @@ void DrawProgress( Window* pWindow, const Point& rPos,
}
// Werte vorberechnen
- USHORT nPerc1 = nPercent1 / nPercentCount;
- USHORT nPerc2 = nPercent2 / nPercentCount;
+ sal_uInt16 nPerc1 = nPercent1 / nPercentCount;
+ sal_uInt16 nPerc2 = nPercent2 / nPercentCount;
if ( nPerc1 > nPerc2 )
{
@@ -631,8 +633,8 @@ void DrawProgress( Window* pWindow, const Point& rPos,
// -----------------------------------------------------------------------
-void StatusBar::ImplDrawProgress( BOOL bPaint,
- USHORT nPercent1, USHORT nPercent2 )
+void StatusBar::ImplDrawProgress( sal_Bool bPaint,
+ sal_uInt16 nPercent1, sal_uInt16 nPercent2 )
{
bool bNative = IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL );
// bPaint: draw text also, else only update progress
@@ -675,7 +677,7 @@ void StatusBar::ImplCalcProgressRect()
// calculate size of progress rects
mnPrgsSize = maPrgsFrameRect.Bottom()-maPrgsFrameRect.Top()-(STATUSBAR_PRGS_OFFSET*2);
- USHORT nMaxPercent = STATUSBAR_PRGS_COUNT;
+ sal_uInt16 nMaxPercent = STATUSBAR_PRGS_COUNT;
long nMaxWidth = mnDX-STATUSBAR_OFFSET-1;
@@ -690,7 +692,7 @@ void StatusBar::ImplCalcProgressRect()
// save the divisor for later
mnPercentCount = 10000 / nMaxPercent;
- BOOL bNativeOK = FALSE;
+ sal_Bool bNativeOK = sal_False;
if( IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) )
{
ImplControlValue aValue;
@@ -698,7 +700,7 @@ void StatusBar::ImplCalcProgressRect()
Rectangle aNativeControlRegion, aNativeContentRegion;
if( (bNativeOK = GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
CTRL_STATE_ENABLED, aValue, rtl::OUString(),
- aNativeControlRegion, aNativeContentRegion ) ) != FALSE )
+ aNativeControlRegion, aNativeContentRegion ) ) != sal_False )
{
long nProgressHeight = aNativeControlRegion.GetHeight();
if( nProgressHeight > maPrgsFrameRect.GetHeight() )
@@ -730,7 +732,7 @@ void StatusBar::MouseButtonDown( const MouseEvent& rMEvt )
{
ImplStatusItem* pItem = (*mpItemList)[ i ];
// Ist es dieses Item
- if ( ImplGetItemRectPos( USHORT(i) ).IsInside( aMousePos ) )
+ if ( ImplGetItemRectPos( sal_uInt16(i) ).IsInside( aMousePos ) )
{
mnCurItemId = pItem->mnId;
if ( rMEvt.GetClicks() == 2 )
@@ -760,22 +762,22 @@ void StatusBar::Paint( const Rectangle& )
if ( mbFormat )
ImplFormat();
- USHORT nItemCount = USHORT( mpItemList->size() );
+ sal_uInt16 nItemCount = sal_uInt16( mpItemList->size() );
if ( mbProgressMode )
- ImplDrawProgress( TRUE, 0, mnPercent );
+ ImplDrawProgress( sal_True, 0, mnPercent );
else
{
// Text zeichen
if ( !mbVisibleItems || (GetStyle() & WB_RIGHT) )
- ImplDrawText( FALSE, 0 );
+ ImplDrawText( sal_False, 0 );
// Items zeichnen
if ( mbVisibleItems )
{
// Items zeichnen
- for ( USHORT i = 0; i < nItemCount; i++ )
- ImplDrawItem( FALSE, i, TRUE, TRUE );
+ for ( sal_uInt16 i = 0; i < nItemCount; i++ )
+ ImplDrawItem( sal_False, i, sal_True, sal_True );
}
}
@@ -812,7 +814,7 @@ void StatusBar::Resize()
{
// Breite und Hoehe abfragen und merken
Size aSize = GetOutputSizePixel();
- mnDX = aSize.Width();
+ mnDX = aSize.Width() - ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset;
mnDY = aSize.Height();
mnCalcHeight = mnDY;
// subtract border
@@ -829,7 +831,7 @@ void StatusBar::Resize()
mnTextY += 2;
// Formatierung neu ausloesen
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( mbProgressMode )
ImplCalcProgressRect();
@@ -845,7 +847,7 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt )
if( rHEvt.KeyboardActivated() )
return;
- USHORT nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
+ sal_uInt16 nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
if ( nItemId )
{
@@ -883,9 +885,9 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt )
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
String aCommand = GetItemCommand( nItemId );
- ULONG nHelpId = GetHelpId( nItemId );
+ rtl::OString aHelpId( GetHelpId( nItemId ) );
- if ( aCommand.Len() || nHelpId )
+ if ( aCommand.Len() || aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
@@ -893,8 +895,8 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt )
{
if ( aCommand.Len() )
pHelp->Start( aCommand, this );
- else if ( nHelpId )
- pHelp->Start( nHelpId, this );
+ else if ( aHelpId.getLength() )
+ pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return;
}
@@ -917,18 +919,18 @@ void StatusBar::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- mbFormat = TRUE;
- ImplInitSettings( TRUE, FALSE, FALSE );
+ mbFormat = sal_True;
+ 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();
}
}
@@ -947,8 +949,8 @@ void StatusBar::DataChanged( const DataChangedEvent& rDCEvt )
)
)
{
- mbFormat = TRUE;
- ImplInitSettings( TRUE, TRUE, TRUE );
+ mbFormat = sal_True;
+ ImplInitSettings( sal_True, sal_True, sal_True );
long nFudge = GetTextHeight() / 4;
for ( size_t i = 0, n = mpItemList->size(); i < n; ++i )
{
@@ -990,9 +992,9 @@ void StatusBar::UserDraw( const UserDrawEvent& )
// -----------------------------------------------------------------------
-void StatusBar::InsertItem( USHORT nItemId, ULONG nWidth,
+void StatusBar::InsertItem( sal_uInt16 nItemId, sal_uLong nWidth,
StatusBarItemBits nBits,
- long nOffset, USHORT nPos )
+ long nOffset, sal_uInt16 nPos )
{
DBG_ASSERT( nItemId, "StatusBar::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == STATUSBAR_ITEM_NOTFOUND,
@@ -1011,9 +1013,8 @@ void StatusBar::InsertItem( USHORT nItemId, ULONG nWidth,
pItem->mnBits = nBits;
pItem->mnWidth = (long)nWidth+nFudge+STATUSBAR_OFFSET;
pItem->mnOffset = nOffset;
- pItem->mnHelpId = 0;
pItem->mpUserData = 0;
- pItem->mbVisible = TRUE;
+ pItem->mbVisible = sal_True;
// Item in die Liste einfuegen
if ( nPos < mpItemList->size() ) {
@@ -1022,7 +1023,7 @@ void StatusBar::InsertItem( USHORT nItemId, ULONG nWidth,
mpItemList->push_back( pItem );
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( ImplIsItemUpdate() )
Invalidate();
@@ -1031,15 +1032,15 @@ void StatusBar::InsertItem( USHORT nItemId, ULONG nWidth,
// -----------------------------------------------------------------------
-void StatusBar::RemoveItem( USHORT nItemId )
+void StatusBar::RemoveItem( sal_uInt16 nItemId )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
delete (*mpItemList)[ nPos ];
mpItemList->erase( mpItemList->begin() + nPos );
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( ImplIsItemUpdate() )
Invalidate();
@@ -1049,18 +1050,18 @@ void StatusBar::RemoveItem( USHORT nItemId )
// -----------------------------------------------------------------------
-void StatusBar::ShowItem( USHORT nItemId )
+void StatusBar::ShowItem( sal_uInt16 nItemId )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
ImplStatusItem* pItem = (*mpItemList)[ nPos ];
if ( !pItem->mbVisible )
{
- pItem->mbVisible = TRUE;
+ pItem->mbVisible = sal_True;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( ImplIsItemUpdate() )
Invalidate();
@@ -1071,18 +1072,18 @@ void StatusBar::ShowItem( USHORT nItemId )
// -----------------------------------------------------------------------
-void StatusBar::HideItem( USHORT nItemId )
+void StatusBar::HideItem( sal_uInt16 nItemId )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
ImplStatusItem* pItem = (*mpItemList)[ nPos ];
if ( pItem->mbVisible )
{
- pItem->mbVisible = FALSE;
+ pItem->mbVisible = sal_False;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( ImplIsItemUpdate() )
Invalidate();
@@ -1093,14 +1094,14 @@ void StatusBar::HideItem( USHORT nItemId )
// -----------------------------------------------------------------------
-BOOL StatusBar::IsItemVisible( USHORT nItemId ) const
+sal_Bool StatusBar::IsItemVisible( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->mbVisible;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -1109,7 +1110,7 @@ void StatusBar::ShowItems()
{
if ( !mbVisibleItems )
{
- mbVisibleItems = TRUE;
+ mbVisibleItems = sal_True;
if ( !mbProgressMode )
Invalidate();
@@ -1123,7 +1124,7 @@ void StatusBar::HideItems()
{
if ( mbVisibleItems )
{
- mbVisibleItems = FALSE;
+ mbVisibleItems = sal_False;
if ( !mbProgressMode )
Invalidate();
@@ -1146,7 +1147,7 @@ void StatusBar::CopyItems( const StatusBar& rStatusBar )
mpItemList->push_back( new ImplStatusItem( *(*rStatusBar.mpItemList)[ i ] ) );
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( ImplIsItemUpdate() )
Invalidate();
}
@@ -1161,7 +1162,7 @@ void StatusBar::Clear()
}
mpItemList->clear();
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( ImplIsItemUpdate() )
Invalidate();
@@ -1170,14 +1171,14 @@ void StatusBar::Clear()
// -----------------------------------------------------------------------
-USHORT StatusBar::GetItemCount() const
+sal_uInt16 StatusBar::GetItemCount() const
{
- return (USHORT)mpItemList->size();
+ return (sal_uInt16)mpItemList->size();
}
// -----------------------------------------------------------------------
-USHORT StatusBar::GetItemId( USHORT nPos ) const
+sal_uInt16 StatusBar::GetItemId( sal_uInt16 nPos ) const
{
if ( nPos < mpItemList->size() )
return (*mpItemList)[ nPos ]->mnId;
@@ -1186,11 +1187,11 @@ USHORT StatusBar::GetItemId( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT StatusBar::GetItemPos( USHORT nItemId ) const
+sal_uInt16 StatusBar::GetItemPos( sal_uInt16 nItemId ) const
{
for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
if ( (*mpItemList)[ i ]->mnId == nItemId ) {
- return USHORT( i );
+ return sal_uInt16( i );
}
}
@@ -1199,12 +1200,12 @@ USHORT StatusBar::GetItemPos( USHORT nItemId ) const
// -----------------------------------------------------------------------
-USHORT StatusBar::GetItemId( const Point& rPos ) const
+sal_uInt16 StatusBar::GetItemId( const Point& rPos ) const
{
if ( AreItemsVisible() && !mbFormat )
{
- USHORT nItemCount = GetItemCount();
- USHORT nPos;
+ sal_uInt16 nItemCount = GetItemCount();
+ sal_uInt16 nPos;
for ( nPos = 0; nPos < nItemCount; nPos++ )
{
// Rechteck holen
@@ -1219,13 +1220,13 @@ USHORT StatusBar::GetItemId( const Point& rPos ) const
// -----------------------------------------------------------------------
-Rectangle StatusBar::GetItemRect( USHORT nItemId ) const
+Rectangle StatusBar::GetItemRect( sal_uInt16 nItemId ) const
{
Rectangle aRect;
if ( AreItemsVisible() && !mbFormat )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
// Rechteck holen und Rahmen abziehen
@@ -1244,11 +1245,11 @@ Rectangle StatusBar::GetItemRect( USHORT nItemId ) const
// -----------------------------------------------------------------------
-Point StatusBar::GetItemTextPos( USHORT nItemId ) const
+Point StatusBar::GetItemTextPos( sal_uInt16 nItemId ) const
{
if ( !mbFormat )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
// Rechteck holen
@@ -1274,9 +1275,9 @@ Point StatusBar::GetItemTextPos( USHORT nItemId ) const
// -----------------------------------------------------------------------
-ULONG StatusBar::GetItemWidth( USHORT nItemId ) const
+sal_uLong StatusBar::GetItemWidth( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->mnWidth;
@@ -1286,9 +1287,9 @@ ULONG StatusBar::GetItemWidth( USHORT nItemId ) const
// -----------------------------------------------------------------------
-StatusBarItemBits StatusBar::GetItemBits( USHORT nItemId ) const
+StatusBarItemBits StatusBar::GetItemBits( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->mnBits;
@@ -1298,9 +1299,9 @@ StatusBarItemBits StatusBar::GetItemBits( USHORT nItemId ) const
// -----------------------------------------------------------------------
-long StatusBar::GetItemOffset( USHORT nItemId ) const
+long StatusBar::GetItemOffset( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->mnOffset;
@@ -1310,9 +1311,9 @@ long StatusBar::GetItemOffset( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void StatusBar::SetItemText( USHORT nItemId, const XubString& rText )
+void StatusBar::SetItemText( sal_uInt16 nItemId, const XubString& rText )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
@@ -1338,7 +1339,7 @@ void StatusBar::SetItemText( USHORT nItemId, const XubString& rText )
if ( pItem->mbVisible && !mbFormat && ImplIsItemUpdate() )
{
Update();
- ImplDrawItem( TRUE, nPos, TRUE, FALSE );
+ ImplDrawItem( sal_True, nPos, sal_True, sal_False );
Flush();
}
}
@@ -1347,9 +1348,9 @@ void StatusBar::SetItemText( USHORT nItemId, const XubString& rText )
// -----------------------------------------------------------------------
-const XubString& StatusBar::GetItemText( USHORT nItemId ) const
+const XubString& StatusBar::GetItemText( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->maText;
@@ -1359,9 +1360,9 @@ const XubString& StatusBar::GetItemText( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void StatusBar::SetItemCommand( USHORT nItemId, const XubString& rCommand )
+void StatusBar::SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
@@ -1374,9 +1375,9 @@ void StatusBar::SetItemCommand( USHORT nItemId, const XubString& rCommand )
// -----------------------------------------------------------------------
-const XubString& StatusBar::GetItemCommand( USHORT nItemId )
+const XubString& StatusBar::GetItemCommand( sal_uInt16 nItemId )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->maCommand;
@@ -1386,9 +1387,9 @@ const XubString& StatusBar::GetItemCommand( USHORT nItemId )
// -----------------------------------------------------------------------
-void StatusBar::SetItemData( USHORT nItemId, void* pNewData )
+void StatusBar::SetItemData( sal_uInt16 nItemId, void* pNewData )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
@@ -1400,7 +1401,7 @@ void StatusBar::SetItemData( USHORT nItemId, void* pNewData )
!mbFormat && ImplIsItemUpdate() )
{
Update();
- ImplDrawItem( TRUE, nPos, FALSE, FALSE );
+ ImplDrawItem( sal_True, nPos, sal_False, sal_False );
Flush();
}
}
@@ -1408,9 +1409,9 @@ void StatusBar::SetItemData( USHORT nItemId, void* pNewData )
// -----------------------------------------------------------------------
-void* StatusBar::GetItemData( USHORT nItemId ) const
+void* StatusBar::GetItemData( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->mpUserData;
@@ -1420,9 +1421,9 @@ void* StatusBar::GetItemData( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void StatusBar::SetHelpText( USHORT nItemId, const XubString& rText )
+void StatusBar::SetHelpText( sal_uInt16 nItemId, const XubString& rText )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
(*mpItemList)[ nPos ]->maHelpText = rText;
@@ -1430,22 +1431,22 @@ void StatusBar::SetHelpText( USHORT nItemId, const XubString& rText )
// -----------------------------------------------------------------------
-const XubString& StatusBar::GetHelpText( USHORT nItemId ) const
+const XubString& StatusBar::GetHelpText( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
ImplStatusItem* pItem = (*mpItemList)[ nPos ];
- if ( !pItem->maHelpText.Len() && ( pItem->mnHelpId || pItem->maCommand.Len() ))
+ if ( !pItem->maHelpText.Len() && ( pItem->maHelpId.getLength() || pItem->maCommand.Len() ))
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
if ( pItem->maCommand.Len() )
pItem->maHelpText = pHelp->GetHelpText( pItem->maCommand, this );
- if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
- pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
+ if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
+ pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
}
@@ -1457,9 +1458,9 @@ const XubString& StatusBar::GetHelpText( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void StatusBar::SetQuickHelpText( USHORT nItemId, const XubString& rText )
+void StatusBar::SetQuickHelpText( sal_uInt16 nItemId, const XubString& rText )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
(*mpItemList)[ nPos ]->maQuickHelpText = rText;
@@ -1467,9 +1468,9 @@ void StatusBar::SetQuickHelpText( USHORT nItemId, const XubString& rText )
// -----------------------------------------------------------------------
-const XubString& StatusBar::GetQuickHelpText( USHORT nItemId ) const
+const XubString& StatusBar::GetQuickHelpText( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
@@ -1482,24 +1483,31 @@ const XubString& StatusBar::GetQuickHelpText( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void StatusBar::SetHelpId( USHORT nItemId, ULONG nHelpId )
+void StatusBar::SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- (*mpItemList)[ nPos ]->mnHelpId = nHelpId;
+ (*mpItemList)[ nPos ]->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
-ULONG StatusBar::GetHelpId( USHORT nItemId ) const
+rtl::OString StatusBar::GetHelpId( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
+ rtl::OString aRet;
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- return (*mpItemList)[ nPos ]->mnHelpId;
+ {
+ ImplStatusItem* pItem = (*mpItemList)[ nPos ];
+ if ( pItem->maHelpId.getLength() )
+ aRet = pItem->maHelpId;
+ else
+ aRet = ::rtl::OUStringToOString( pItem->maCommand, RTL_TEXTENCODING_UTF8 );
+ }
- return 0;
+ return aRet;
}
// -----------------------------------------------------------------------
@@ -1516,11 +1524,11 @@ void StatusBar::ImplCalcBorder( )
}
if ( IsBottomBorder() )
mnCalcHeight -= 2;
- mbFormat = TRUE;
+ mbFormat = sal_True;
Invalidate();
}
-void StatusBar::SetBottomBorder( BOOL bBottomBorder )
+void StatusBar::SetBottomBorder( sal_Bool bBottomBorder )
{
if ( mbBottomBorder != bBottomBorder )
{
@@ -1529,7 +1537,7 @@ void StatusBar::SetBottomBorder( BOOL bBottomBorder )
}
}
-void StatusBar::SetTopBorder( BOOL bTopBorder )
+void StatusBar::SetTopBorder( sal_Bool bTopBorder )
{
if ( mpImplData->mbTopBorder != static_cast<bool>(bTopBorder) )
{
@@ -1538,7 +1546,7 @@ void StatusBar::SetTopBorder( BOOL bTopBorder )
}
}
-BOOL StatusBar::IsTopBorder() const
+sal_Bool StatusBar::IsTopBorder() const
{
return mpImplData->mbTopBorder;
}
@@ -1549,7 +1557,7 @@ void StatusBar::StartProgressMode( const XubString& rText )
{
DBG_ASSERT( !mbProgressMode, "StatusBar::StartProgressMode(): progress mode is active" );
- mbProgressMode = TRUE;
+ mbProgressMode = sal_True;
mnPercent = 0;
maPrgsTxt = rText;
@@ -1573,7 +1581,7 @@ void StatusBar::StartProgressMode( const XubString& rText )
// -----------------------------------------------------------------------
-void StatusBar::SetProgressValue( USHORT nNewPercent )
+void StatusBar::SetProgressValue( sal_uInt16 nNewPercent )
{
DBG_ASSERT( mbProgressMode, "StatusBar::SetProgressValue(): no progrss mode" );
DBG_ASSERTWARNING( nNewPercent <= 100, "StatusBar::SetProgressValue(): nPercent > 100" );
@@ -1584,7 +1592,7 @@ void StatusBar::SetProgressValue( USHORT nNewPercent )
{
Update();
SetLineColor();
- ImplDrawProgress( FALSE, mnPercent, nNewPercent );
+ ImplDrawProgress( sal_False, mnPercent, nNewPercent );
Flush();
}
mnPercent = nNewPercent;
@@ -1596,7 +1604,7 @@ void StatusBar::EndProgressMode()
{
DBG_ASSERT( mbProgressMode, "StatusBar::EndProgressMode(): no progress mode" );
- mbProgressMode = FALSE;
+ mbProgressMode = sal_False;
maPrgsTxt.Erase();
// Paint neu ausloesen um StatusBar wieder herzustellen
@@ -1643,7 +1651,7 @@ void StatusBar::SetText( const XubString& rText )
Update();
long nOldTextWidth = GetTextWidth( GetText() );
Window::SetText( rText );
- ImplDrawText( TRUE, nOldTextWidth );
+ ImplDrawText( sal_True, nOldTextWidth );
Flush();
}
}
@@ -1727,9 +1735,9 @@ Size StatusBar::CalcWindowSizePixel() const
// -----------------------------------------------------------------------
-void StatusBar::SetAccessibleName( USHORT nItemId, const XubString& rName )
+void StatusBar::SetAccessibleName( sal_uInt16 nItemId, const XubString& rName )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
@@ -1745,9 +1753,9 @@ void StatusBar::SetAccessibleName( USHORT nItemId, const XubString& rName )
// -----------------------------------------------------------------------
-const XubString& StatusBar::GetAccessibleName( USHORT nItemId ) const
+const XubString& StatusBar::GetAccessibleName( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->maAccessibleName;
diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx
index a1a33b905cdf..6d9de205dfce 100644
--- a/vcl/source/window/syschild.cxx
+++ b/vcl/source/window/syschild.cxx
@@ -30,23 +30,38 @@
#include "precompiled_vcl.hxx"
#include <svsys.h>
+#include <rtl/process.h>
+#include <rtl/ref.hxx>
+#include <tools/rc.h>
+#include <vcl/window.h>
#include <vcl/salinst.hxx>
#include <vcl/salframe.hxx>
#include <vcl/window.hxx>
#include <vcl/salobj.hxx>
-
-#include <tools/rc.h>
#include <vcl/svdata.hxx>
-#include <vcl/window.h>
+#include <vcl/sysdata.hxx>
#include <vcl/svapp.hxx>
#include <vcl/syschild.hxx>
+#include <vcl/unohelp.hxx>
+
+#ifdef SOLAR_JAVA
+#include <jni.h>
+#endif
+
+#include <comphelper/processfactory.hxx>
+#include <jvmaccess/virtualmachine.hxx>
+#include <com/sun/star/java/XJavaVM.hpp>
+#include <com/sun/star/java/XJavaThreadRegister_11.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <vcl/syschild.hxx>
+using namespace ::com::sun::star;
// =======================================================================
long ImplSysChildProc( void* pInst, SalObject* /* pObject */,
- USHORT nEvent, const void* /* pEvent */ )
+ sal_uInt16 nEvent, const void* /* pEvent */ )
{
SystemChildWindow* pWindow = (SystemChildWindow*)pInst;
long nRet = 0;
@@ -58,33 +73,33 @@ long ImplSysChildProc( void* pInst, SalObject* /* pObject */,
// Focus holen und zwar so, das alle Handler gerufen
// werden, als ob dieses Fenster den Focus bekommt,
// ohne das der Frame den Focus wieder klaut
- pWindow->ImplGetFrameData()->mbSysObjFocus = TRUE;
- pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = TRUE;
+ pWindow->ImplGetFrameData()->mbSysObjFocus = sal_True;
+ pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = sal_True;
pWindow->ToTop( TOTOP_NOGRABFOCUS );
if( aDogTag.IsDead() )
break;
- pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = FALSE;
- pWindow->ImplGetFrameData()->mbInSysObjFocusHdl = TRUE;
+ pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = sal_False;
+ pWindow->ImplGetFrameData()->mbInSysObjFocusHdl = sal_True;
pWindow->GrabFocus();
if( aDogTag.IsDead() )
break;
- pWindow->ImplGetFrameData()->mbInSysObjFocusHdl = FALSE;
+ pWindow->ImplGetFrameData()->mbInSysObjFocusHdl = sal_False;
break;
case SALOBJ_EVENT_LOSEFOCUS:
// Hintenrum einen LoseFocus ausloesen, das der Status
// der Fenster dem entsprechenden Activate-Status
// entspricht
- pWindow->ImplGetFrameData()->mbSysObjFocus = FALSE;
+ pWindow->ImplGetFrameData()->mbSysObjFocus = sal_False;
if ( !pWindow->ImplGetFrameData()->mnFocusId )
{
- pWindow->ImplGetFrameData()->mbStartFocusState = TRUE;
+ pWindow->ImplGetFrameData()->mbStartFocusState = sal_True;
Application::PostUserEvent( pWindow->ImplGetFrameData()->mnFocusId, LINK( pWindow->ImplGetFrameWindow(), Window, ImplAsyncFocusHdl ) );
}
break;
case SALOBJ_EVENT_TOTOP:
- pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = TRUE;
+ pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = sal_True;
if ( !Application::GetFocusWindow() || pWindow->HasChildPathFocus() )
pWindow->ToTop( TOTOP_NOGRABFOCUS );
else
@@ -94,7 +109,7 @@ long ImplSysChildProc( void* pInst, SalObject* /* pObject */,
pWindow->GrabFocus();
if( aDogTag.IsDead() )
break;
- pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = FALSE;
+ pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = sal_False;
break;
}
@@ -103,7 +118,7 @@ long ImplSysChildProc( void* pInst, SalObject* /* pObject */,
// =======================================================================
-void SystemChildWindow::ImplInitSysChild( Window* pParent, WinBits nStyle, SystemWindowData *pData, BOOL bShow )
+void SystemChildWindow::ImplInitSysChild( Window* pParent, WinBits nStyle, SystemWindowData *pData, sal_Bool bShow )
{
mpWindowImpl->mpSysObj = ImplGetSVData()->mpDefInst->CreateObject( pParent->ImplGetFrame(), pData, bShow );
@@ -128,7 +143,7 @@ SystemChildWindow::SystemChildWindow( Window* pParent, WinBits nStyle ) :
// -----------------------------------------------------------------------
-SystemChildWindow::SystemChildWindow( Window* pParent, WinBits nStyle, SystemWindowData *pData, BOOL bShow ) :
+SystemChildWindow::SystemChildWindow( Window* pParent, WinBits nStyle, SystemWindowData *pData, sal_Bool bShow ) :
Window( WINDOW_SYSTEMCHILDWINDOW )
{
ImplInitSysChild( pParent, nStyle, pData, bShow );
@@ -172,24 +187,161 @@ const SystemEnvData* SystemChildWindow::GetSystemData() const
// -----------------------------------------------------------------------
-void SystemChildWindow::EnableEraseBackground( BOOL bEnable )
+void SystemChildWindow::EnableEraseBackground( sal_Bool bEnable )
{
if ( mpWindowImpl->mpSysObj )
mpWindowImpl->mpSysObj->EnableEraseBackground( bEnable );
}
-BOOL SystemChildWindow::IsEraseBackgroundEnabled()
+// -----------------------------------------------------------------------
+
+sal_Bool SystemChildWindow::IsEraseBackgroundEnabled()
{
if ( mpWindowImpl->mpSysObj )
return mpWindowImpl->mpSysObj->IsEraseBackgroundEnabled();
else
- return FALSE;
+ return sal_False;
+}
+
+// -----------------------------------------------------------------------
+
+void SystemChildWindow::ImplTestJavaException( void* pEnv )
+{
+#ifdef SOLAR_JAVA
+ JNIEnv* pJavaEnv = reinterpret_cast< JNIEnv* >( pEnv );
+ jthrowable jtThrowable = pJavaEnv->ExceptionOccurred();
+
+ if( jtThrowable )
+ { // is it a java exception ?
+#if OSL_DEBUG_LEVEL > 1
+ pJavaEnv->ExceptionDescribe();
+#endif // OSL_DEBUG_LEVEL > 1
+ pJavaEnv->ExceptionClear();
+
+ jclass jcThrowable = pJavaEnv->FindClass("java/lang/Throwable");
+ jmethodID jmThrowable_getMessage = pJavaEnv->GetMethodID(jcThrowable, "getMessage", "()Ljava/lang/String;");
+ jstring jsMessage = (jstring) pJavaEnv->CallObjectMethod(jtThrowable, jmThrowable_getMessage);
+ ::rtl::OUString ouMessage;
+
+ if(jsMessage)
+ {
+ const jchar * jcMessage = pJavaEnv->GetStringChars(jsMessage, NULL);
+ ouMessage = ::rtl::OUString(jcMessage);
+ pJavaEnv->ReleaseStringChars(jsMessage, jcMessage);
+ }
+
+ throw uno::RuntimeException(ouMessage, uno::Reference<uno::XInterface>());
+ }
+#endif // SOLAR_JAVA
}
-void SystemChildWindow::SetForwardKey( BOOL bEnable )
+void SystemChildWindow::SetForwardKey( sal_Bool bEnable )
+{
+ if ( mpWindowImpl->mpSysObj )
+ mpWindowImpl->mpSysObj->SetForwardKey( bEnable );
+}
+
+// -----------------------------------------------------------------------
+
+sal_IntPtr SystemChildWindow::GetParentWindowHandle( sal_Bool bUseJava )
{
- if ( mpWindowImpl->mpSysObj )
- mpWindowImpl->mpSysObj->SetForwardKey( bEnable );
+ sal_IntPtr nRet = 0;
+
+#if defined WNT
+ nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->hWnd );
+#elif defined QUARTZ
+ // FIXME: this is wrong
+ nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->pView );
+#elif defined UNX
+ if( !bUseJava )
+ {
+ nRet = (sal_IntPtr) GetSystemData()->aWindow;
+ }
+#ifdef SOLAR_JAVA
+ else
+ {
+ uno::Reference< lang::XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
+
+ if( xFactory.is() && ( GetSystemData()->aWindow > 0 ) )
+ {
+ try
+ {
+ ::rtl::Reference< ::jvmaccess::VirtualMachine > xVM;
+ uno::Reference< java::XJavaVM > xJavaVM( xFactory->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.java.JavaVirtualMachine") ) ), uno::UNO_QUERY );
+ uno::Sequence< sal_Int8 > aProcessID( 17 );
+
+ rtl_getGlobalProcessId( (sal_uInt8*) aProcessID.getArray() );
+ aProcessID[ 16 ] = 0;
+ OSL_ENSURE(sizeof (sal_Int64) >= sizeof (jvmaccess::VirtualMachine *), "Pointer cannot be represented as sal_Int64");
+ sal_Int64 nPointer = reinterpret_cast< sal_Int64 >( static_cast< jvmaccess::VirtualMachine * >(0));
+ xJavaVM->getJavaVM(aProcessID) >>= nPointer;
+ xVM = reinterpret_cast< jvmaccess::VirtualMachine * >(nPointer);
+
+ if( xVM.is() )
+ {
+ try
+ {
+ ::jvmaccess::VirtualMachine::AttachGuard aVMAttachGuard( xVM );
+ JNIEnv* pEnv = aVMAttachGuard.getEnvironment();
+
+ jclass jcToolkit = pEnv->FindClass("java/awt/Toolkit");
+ ImplTestJavaException(pEnv);
+
+ jmethodID jmToolkit_getDefaultToolkit = pEnv->GetStaticMethodID( jcToolkit, "getDefaultToolkit", "()Ljava/awt/Toolkit;" );
+ ImplTestJavaException(pEnv);
+
+ pEnv->CallStaticObjectMethod(jcToolkit, jmToolkit_getDefaultToolkit);
+ ImplTestJavaException(pEnv);
+
+ jclass jcMotifAppletViewer = pEnv->FindClass("sun/plugin/navig/motif/MotifAppletViewer");
+ if( pEnv->ExceptionOccurred() )
+ {
+ pEnv->ExceptionClear();
+
+ jcMotifAppletViewer = pEnv->FindClass( "sun/plugin/viewer/MNetscapePluginContext");
+ ImplTestJavaException(pEnv);
+ }
+
+ jclass jcClassLoader = pEnv->FindClass("java/lang/ClassLoader");
+ ImplTestJavaException(pEnv);
+
+ jmethodID jmClassLoader_loadLibrary = pEnv->GetStaticMethodID( jcClassLoader, "loadLibrary", "(Ljava/lang/Class;Ljava/lang/String;Z)V");
+ ImplTestJavaException(pEnv);
+
+ jstring jsplugin = pEnv->NewStringUTF("javaplugin_jni");
+ ImplTestJavaException(pEnv);
+
+ pEnv->CallStaticVoidMethod(jcClassLoader, jmClassLoader_loadLibrary, jcMotifAppletViewer, jsplugin, JNI_FALSE);
+ ImplTestJavaException(pEnv);
+
+ jmethodID jmMotifAppletViewer_getWidget = pEnv->GetStaticMethodID( jcMotifAppletViewer, "getWidget", "(IIIII)I" );
+ ImplTestJavaException(pEnv);
+
+ const Size aSize( GetOutputSizePixel() );
+ jint ji_widget = pEnv->CallStaticIntMethod( jcMotifAppletViewer, jmMotifAppletViewer_getWidget,
+ GetSystemData()->aWindow, 0, 0, aSize.Width(), aSize.Height() );
+ ImplTestJavaException(pEnv);
+
+ nRet = static_cast< sal_IntPtr >( ji_widget );
+ }
+ catch( uno::RuntimeException& )
+ {
+ }
+
+ if( !nRet )
+ nRet = static_cast< sal_IntPtr >( GetSystemData()->aWindow );
+ }
+ }
+ catch( ... )
+ {
+ }
+ }
+ }
+#endif // SOLAR_JAVA
+#else // WNT || QUARTZ || UNX
+#endif
+
+ return nRet;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index fe3b6f5a585b..3343779f632b 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -79,16 +79,16 @@ SystemWindow::SystemWindow( WindowType nType ) :
Window( nType )
{
mpImplData = new ImplData;
- mpWindowImpl->mbSysWin = TRUE;
+ mpWindowImpl->mbSysWin = sal_True;
mpWindowImpl->mnActivateMode = ACTIVATE_MODE_GRABFOCUS;
mpMenuBar = NULL;
- mbPined = FALSE;
- mbRollUp = FALSE;
- mbRollFunc = FALSE;
- mbDockBtn = FALSE;
- mbHideBtn = FALSE;
- mbSysChild = FALSE;
+ mbPined = sal_False;
+ mbRollUp = sal_False;
+ mbRollFunc = sal_False;
+ mbDockBtn = sal_False;
+ mbHideBtn = sal_False;
+ mbSysChild = sal_False;
mnMenuBarMode = MENUBAR_MODE_NORMAL;
mnIcon = 0;
}
@@ -113,8 +113,8 @@ long SystemWindow::Notify( NotifyEvent& rNEvt )
if( pWin && pWin->IsSystemWindow() )
pMBar = ((SystemWindow*)pWin)->GetMenuBar();
}
- if ( pMBar && pMBar->ImplHandleKeyEvent( *rNEvt.GetKeyEvent(), FALSE ) )
- return TRUE;
+ if ( pMBar && pMBar->ImplHandleKeyEvent( *rNEvt.GetKeyEvent(), sal_False ) )
+ return sal_True;
}
return Window::Notify( rNEvt );
@@ -133,7 +133,7 @@ long SystemWindow::PreNotify( NotifyEvent& rNEvt )
{
// Ctrl-F6 goes directly to the document
GrabFocusToDocument();
- return TRUE;
+ return sal_True;
}
else
{
@@ -158,7 +158,7 @@ long SystemWindow::PreNotify( NotifyEvent& rNEvt )
pTList = pSysWin->mpImplData->mpTaskPaneList;
}
if( pTList && pTList->HandleKeyEvent( *rNEvt.GetKeyEvent() ) )
- return TRUE;
+ return sal_True;
}
}
return Window::PreNotify( rNEvt );
@@ -188,17 +188,17 @@ TaskPaneList* SystemWindow::GetTaskPaneList()
// -----------------------------------------------------------------------
-BOOL SystemWindow::Close()
+sal_Bool SystemWindow::Close()
{
ImplDelData aDelData;
ImplAddDel( &aDelData );
ImplCallEventListeners( VCLEVENT_WINDOW_CLOSE );
if ( aDelData.IsDelete() )
- return FALSE;
+ return sal_False;
ImplRemoveDel( &aDelData );
if ( mpWindowImpl->mxWindowPeer.is() && IsCreatedWithToolkit() )
- return FALSE;
+ return sal_False;
// Is Window not closeable, ignore close
Window* pBorderWin = ImplGetBorderWindow();
@@ -210,17 +210,17 @@ BOOL SystemWindow::Close()
if ( !(nStyle & WB_CLOSEABLE) )
{
Sound::Beep( SOUND_DISABLE, this );
- return FALSE;
+ return sal_False;
}
Hide();
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-void SystemWindow::TitleButtonClick( USHORT )
+void SystemWindow::TitleButtonClick( sal_uInt16 )
{
}
@@ -244,14 +244,14 @@ void SystemWindow::Resizing( Size& )
// -----------------------------------------------------------------------
-void SystemWindow::SetZLevel( BYTE nLevel )
+void SystemWindow::SetZLevel( sal_uInt8 nLevel )
{
Window* pWindow = this;
while ( pWindow->mpWindowImpl->mpBorderWindow )
pWindow = pWindow->mpWindowImpl->mpBorderWindow;
if ( pWindow->mpWindowImpl->mbOverlapWin && !pWindow->mpWindowImpl->mbFrame )
{
- BYTE nOldLevel = pWindow->mpWindowImpl->mpOverlapData->mnTopLevel;
+ sal_uInt8 nOldLevel = pWindow->mpWindowImpl->mpOverlapData->mnTopLevel;
pWindow->mpWindowImpl->mpOverlapData->mnTopLevel = nLevel;
// Wenn der neue Level groesser als der alte ist, schieben
// wir das Fenster nach hinten
@@ -297,7 +297,7 @@ const rtl::OUString& SystemWindow::GetRepresentedURL() const
// -----------------------------------------------------------------------
-void SystemWindow::SetIcon( USHORT nIcon )
+void SystemWindow::SetIcon( sal_uInt16 nIcon )
{
if ( mnIcon == nIcon )
return;
@@ -317,7 +317,7 @@ void SystemWindow::SetIcon( USHORT nIcon )
// -----------------------------------------------------------------------
-BYTE SystemWindow::GetZLevel() const
+sal_uInt8 SystemWindow::GetZLevel() const
{
const Window* pWindow = this;
while ( pWindow->mpWindowImpl->mpBorderWindow )
@@ -325,12 +325,12 @@ BYTE SystemWindow::GetZLevel() const
if ( pWindow->mpWindowImpl->mpOverlapData )
return pWindow->mpWindowImpl->mpOverlapData->mnTopLevel;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void SystemWindow::EnableSaveBackground( BOOL bSave )
+void SystemWindow::EnableSaveBackground( sal_Bool bSave )
{
if( ImplGetSVData()->maWinData.mbNoSaveBackground )
bSave = false;
@@ -348,7 +348,7 @@ void SystemWindow::EnableSaveBackground( BOOL bSave )
// -----------------------------------------------------------------------
-BOOL SystemWindow::IsSaveBackgroundEnabled() const
+sal_Bool SystemWindow::IsSaveBackgroundEnabled() const
{
const Window* pWindow = this;
while ( pWindow->mpWindowImpl->mpBorderWindow )
@@ -356,12 +356,12 @@ BOOL SystemWindow::IsSaveBackgroundEnabled() const
if ( pWindow->mpWindowImpl->mpOverlapData )
return pWindow->mpWindowImpl->mpOverlapData->mbSaveBack;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void SystemWindow::ShowTitleButton( USHORT nButton, BOOL bVisible )
+void SystemWindow::ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible )
{
if ( nButton == TITLE_BUTTON_DOCKING )
{
@@ -392,7 +392,7 @@ void SystemWindow::ShowTitleButton( USHORT nButton, BOOL bVisible )
// -----------------------------------------------------------------------
-BOOL SystemWindow::IsTitleButtonVisible( USHORT nButton ) const
+sal_Bool SystemWindow::IsTitleButtonVisible( sal_uInt16 nButton ) const
{
if ( nButton == TITLE_BUTTON_DOCKING )
return mbDockBtn;
@@ -402,7 +402,7 @@ BOOL SystemWindow::IsTitleButtonVisible( USHORT nButton ) const
// -----------------------------------------------------------------------
-void SystemWindow::SetPin( BOOL bPin )
+void SystemWindow::SetPin( sal_Bool bPin )
{
if ( bPin != mbPined )
{
@@ -419,16 +419,16 @@ void SystemWindow::RollUp()
if ( !mbRollUp )
{
maOrgSize = GetOutputSizePixel();
- mbRollFunc = TRUE;
+ mbRollFunc = sal_True;
Size aSize = maRollUpOutSize;
if ( !aSize.Width() )
aSize.Width() = GetOutputSizePixel().Width();
- mbRollUp = TRUE;
+ mbRollUp = sal_True;
if ( mpWindowImpl->mpBorderWindow )
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetRollUp( TRUE, aSize );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetRollUp( sal_True, aSize );
else
SetOutputSizePixel( aSize );
- mbRollFunc = FALSE;
+ mbRollFunc = sal_False;
}
}
@@ -438,9 +438,9 @@ void SystemWindow::RollDown()
{
if ( mbRollUp )
{
- mbRollUp = FALSE;
+ mbRollUp = sal_False;
if ( mpWindowImpl->mpBorderWindow )
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetRollUp( FALSE, maOrgSize );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetRollUp( sal_False, maOrgSize );
else
SetOutputSizePixel( maOrgSize );
}
@@ -502,7 +502,7 @@ Size SystemWindow::GetResizeOutputSizePixel() const
static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rStr )
{
- ULONG nValidMask = 0;
+ sal_uLong nValidMask = 0;
xub_StrLen nIndex = 0;
ByteString aTokenStr;
@@ -555,7 +555,7 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
{
// #94144# allow Minimize again, should be masked out when read from configuration
// 91625 - ignore Minimize
- ULONG nState = (ULONG)aTokenStr.ToInt32();
+ sal_uLong nState = (sal_uLong)aTokenStr.ToInt32();
//nState &= ~(WINDOWSTATE_STATE_MINIMIZED);
rData.SetState( nState );
nValidMask |= WINDOWSTATE_MASK_STATE;
@@ -617,7 +617,7 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
static void ImplWindowStateToStr( const WindowStateData& rData, ByteString& rStr )
{
- ULONG nValidMask = rData.GetMask();
+ sal_uLong nValidMask = rData.GetMask();
if ( !nValidMask )
return;
@@ -637,7 +637,7 @@ static void ImplWindowStateToStr( const WindowStateData& rData, ByteString& rStr
{
// #94144# allow Minimize again, should be masked out when read from configuration
// 91625 - ignore Minimize
- ULONG nState = rData.GetState();
+ sal_uLong nState = rData.GetState();
//nState &= ~(WINDOWSTATE_STATE_MINIMIZED);
rStr.Append( ByteString::CreateFromInt32( (long)nState ) );
}
@@ -717,7 +717,7 @@ void SystemWindow::ImplMoveToScreen( long& io_rX, long& io_rY, long i_nWidth, lo
void SystemWindow::SetWindowStateData( const WindowStateData& rData )
{
- ULONG nValidMask = rData.GetMask();
+ sal_uLong nValidMask = rData.GetMask();
if ( !nValidMask )
return;
@@ -730,7 +730,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
if ( pWindow->mpWindowImpl->mbFrame )
{
- ULONG nState = rData.GetState();
+ sal_uLong nState = rData.GetState();
SalFrameState aState;
aState.mnMask = rData.GetMask();
aState.mnX = rData.GetX();
@@ -769,7 +769,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
Rectangle aDesktop = GetDesktopRectPixel();
ImplSVData *pSVData = ImplGetSVData();
Window *pWin = pSVData->maWinData.mpFirstFrame;
- BOOL bWrapped = FALSE;
+ sal_Bool bWrapped = sal_False;
while( pWin )
{
if( !pWin->ImplIsRealParentPath( this ) && ( pWin != this ) &&
@@ -790,7 +790,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
(unsigned long) (aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > (unsigned long) aDesktop.nBottom )
break; // further displacement not possible -> break
// avoid endless testing
- bWrapped = TRUE;
+ bWrapped = sal_True;
}
else
{
@@ -827,7 +827,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
}
else
{
- USHORT nPosSize = 0;
+ sal_uInt16 nPosSize = 0;
if ( nValidMask & WINDOWSTATE_MASK_X )
nPosSize |= WINDOW_POSSIZE_X;
if ( nValidMask & WINDOWSTATE_MASK_Y )
@@ -859,7 +859,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
// 91625 - ignore Minimize
if ( nValidMask & WINDOWSTATE_MASK_STATE )
{
- ULONG nState = rData.GetState();
+ sal_uLong nState = rData.GetState();
if ( nState & WINDOWSTATE_STATE_ROLLUP )
RollUp();
else
@@ -872,7 +872,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
void SystemWindow::GetWindowStateData( WindowStateData& rData ) const
{
- ULONG nValidMask = rData.GetMask();
+ sal_uLong nValidMask = rData.GetMask();
if ( !nValidMask )
return;
@@ -934,7 +934,7 @@ void SystemWindow::GetWindowStateData( WindowStateData& rData ) const
{
Point aPos = GetPosPixel();
Size aSize = GetSizePixel();
- ULONG nState = 0;
+ sal_uLong nState = 0;
if ( IsRollUp() )
{
@@ -969,7 +969,7 @@ void SystemWindow::SetWindowState( const ByteString& rStr )
// -----------------------------------------------------------------------
-ByteString SystemWindow::GetWindowState( ULONG nMask ) const
+ByteString SystemWindow::GetWindowState( sal_uLong nMask ) const
{
WindowStateData aData;
aData.SetMask( nMask );
@@ -1013,7 +1013,7 @@ void SystemWindow::SetMenuBar( MenuBar* pMenuBar )
ImplToBottomChild();
if ( pOldMenuBar )
{
- BOOL bDelete = (pMenuBar == 0) ? TRUE : FALSE;
+ sal_Bool bDelete = (pMenuBar == 0) ? sal_True : sal_False;
if( bDelete && pOldWindow )
{
if( mpImplData->mpTaskPaneList )
@@ -1046,7 +1046,7 @@ void SystemWindow::SetMenuBar( MenuBar* pMenuBar )
// -----------------------------------------------------------------------
-void SystemWindow::SetMenuBarMode( USHORT nMode )
+void SystemWindow::SetMenuBarMode( sal_uInt16 nMode )
{
if ( mnMenuBarMode != nMode )
{
@@ -1054,20 +1054,20 @@ void SystemWindow::SetMenuBarMode( USHORT nMode )
if ( mpWindowImpl->mpBorderWindow && (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) )
{
if ( nMode == MENUBAR_MODE_HIDE )
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarMode( TRUE );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarMode( sal_True );
else
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarMode( FALSE );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarMode( sal_False );
}
}
}
// -----------------------------------------------------------------------
-BOOL SystemWindow::ImplIsInTaskPaneList( Window* pWin )
+sal_Bool SystemWindow::ImplIsInTaskPaneList( Window* pWin )
{
if( mpImplData && mpImplData->mpTaskPaneList )
return mpImplData->mpTaskPaneList->IsInList( pWin );
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx
index 54985a3a36e2..32e8a0dcec92 100644
--- a/vcl/source/window/tabdlg.cxx
+++ b/vcl/source/window/tabdlg.cxx
@@ -42,7 +42,7 @@ void TabDialog::ImplInitTabDialogData()
mpFixedLine = NULL;
mpViewWindow = NULL;
meViewAlign = WINDOWALIGN_LEFT;
- mbPosControls = TRUE;
+ mbPosControls = sal_True;
}
// -----------------------------------------------------------------------
@@ -104,7 +104,7 @@ void TabDialog::ImplPosControls()
long nViewOffY = 0;
long nViewWidth = 0;
long nViewHeight = 0;
- USHORT nViewPosFlags = WINDOW_POSSIZE_POS;
+ sal_uInt16 nViewPosFlags = WINDOW_POSSIZE_POS;
Size aViewSize = mpViewWindow->GetSizePixel();
if ( meViewAlign == WINDOWALIGN_TOP )
{
@@ -152,7 +152,7 @@ void TabDialog::ImplPosControls()
pTabControl->SetPosPixel( aTabOffset );
// Alle anderen Childs positionieren
- BOOL bTabCtrl = FALSE;
+ sal_Bool bTabCtrl = sal_False;
int nLines = 0;
long nX;
long nY = aDlgSize.Height();
@@ -170,7 +170,7 @@ void TabDialog::ImplPosControls()
if ( pChild2->IsVisible() && (pChild2 != mpViewWindow) )
{
if ( pChild2 == pTabControl )
- bTabCtrl = TRUE;
+ bTabCtrl = sal_True;
else if ( bTabCtrl )
{
if ( !nLines )
@@ -212,7 +212,7 @@ void TabDialog::ImplPosControls()
mpFixedLine->Show();
}
- mbPosControls = FALSE;
+ mbPosControls = sal_False;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx
index cccd315d7189..f109f2079a4c 100644
--- a/vcl/source/window/tabpage.cxx
+++ b/vcl/source/window/tabpage.cxx
@@ -57,7 +57,7 @@ void TabPage::ImplInit( Window* pParent, WinBits nStyle )
// if the tabpage is drawn (ie filled) by a native widget, make sure all contols will have transparent background
// otherwise they will paint with a wrong background
if( IsNativeControlSupported(CTRL_TAB_BODY, PART_ENTIRE_CONTROL) && GetParent() && (GetParent()->GetType() == WINDOW_TABCONTROL) )
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
}
// -----------------------------------------------------------------------
@@ -67,16 +67,16 @@ void TabPage::ImplInitSettings()
Window* pParent = GetParent();
if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() )
{
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
}
else
{
- EnableChildTransparentMode( FALSE );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -166,7 +166,7 @@ void TabPage::Paint( const Rectangle& )
}
// -----------------------------------------------------------------------
-void TabPage::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG )
+void TabPage::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
diff --git a/vcl/source/window/taskpanelist.cxx b/vcl/source/window/taskpanelist.cxx
index f705609306a1..56bd9d799cce 100644
--- a/vcl/source/window/taskpanelist.cxx
+++ b/vcl/source/window/taskpanelist.cxx
@@ -140,7 +140,7 @@ void TaskPaneList::AddWindow( Window *pWindow )
}
mTaskPanes.insert( insertionPos, pWindow );
- pWindow->ImplIsInTaskPaneList( TRUE );
+ pWindow->ImplIsInTaskPaneList( sal_True );
}
}
@@ -153,25 +153,25 @@ void TaskPaneList::RemoveWindow( Window *pWindow )
if( p != mTaskPanes.end() )
{
mTaskPanes.erase( p );
- pWindow->ImplIsInTaskPaneList( FALSE );
+ pWindow->ImplIsInTaskPaneList( sal_False );
}
}
// --------------------------------------------------
-BOOL TaskPaneList::IsInList( Window *pWindow )
+sal_Bool TaskPaneList::IsInList( Window *pWindow )
{
::std::vector< Window* >::iterator p;
p = ::std::find( mTaskPanes.begin(), mTaskPanes.end(), pWindow );
if( p != mTaskPanes.end() )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// --------------------------------------------------
-BOOL TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent )
+sal_Bool TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent )
{
// F6 cycles through everything and works always
@@ -183,11 +183,11 @@ BOOL TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent )
//
// Since the design of Ctrl-Tab looks to be inconsistent ( non-modal dialogs are not reachable
// and the shortcut conflicts with tab-control shortcut ), it is no more supported
- BOOL bSplitterOnly = FALSE;
- BOOL bFocusInList = FALSE;
+ sal_Bool bSplitterOnly = sal_False;
+ sal_Bool bFocusInList = sal_False;
KeyCode aKeyCode = aKeyEvent.GetKeyCode();
- BOOL bForward = !aKeyCode.IsShift();
- if( aKeyCode.GetCode() == KEY_F6 ) // F6
+ sal_Bool bForward = !aKeyCode.IsShift();
+ if( aKeyCode.GetCode() == KEY_F6 && ! aKeyCode.IsMod2() ) // F6
{
bSplitterOnly = aKeyCode.IsMod1() && aKeyCode.IsShift();
@@ -196,43 +196,43 @@ BOOL TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent )
while( p != mTaskPanes.end() )
{
Window *pWin = *p;
- if( pWin->HasChildPathFocus( TRUE ) )
+ if( pWin->HasChildPathFocus( sal_True ) )
{
- bFocusInList = TRUE;
+ bFocusInList = sal_True;
// Ctrl-F6 goes directly to the document
if( !pWin->IsDialog() && aKeyCode.IsMod1() && !aKeyCode.IsShift() )
{
pWin->GrabFocusToDocument();
- return TRUE;
+ return sal_True;
}
// activate next task pane
Window *pNextWin = NULL;
if( bSplitterOnly )
- pNextWin = FindNextSplitter( *p, TRUE );
+ pNextWin = FindNextSplitter( *p, sal_True );
else
pNextWin = FindNextFloat( *p, bForward );
if( pNextWin != pWin )
{
- ImplGetSVData()->maWinData.mbNoSaveFocus = TRUE;
+ ImplGetSVData()->maWinData.mbNoSaveFocus = sal_True;
ImplTaskPaneListGrabFocus( pNextWin );
- ImplGetSVData()->maWinData.mbNoSaveFocus = FALSE;
+ ImplGetSVData()->maWinData.mbNoSaveFocus = sal_False;
}
else
{
// forward key if no splitter found
if( bSplitterOnly )
- return FALSE;
+ return sal_False;
// we did not find another taskpane, so
// put focus back into document
pWin->GrabFocusToDocument();
}
- return TRUE;
+ return sal_True;
}
else
p++;
@@ -243,24 +243,24 @@ BOOL TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent )
{
Window *pWin;
if( bSplitterOnly )
- pWin = FindNextSplitter( NULL, TRUE );
+ pWin = FindNextSplitter( NULL, sal_True );
else
pWin = FindNextFloat( NULL, bForward );
if( pWin )
{
ImplTaskPaneListGrabFocus( pWin );
- return TRUE;
+ return sal_True;
}
}
}
- return FALSE;
+ return sal_False;
}
// --------------------------------------------------
// returns next valid pane
-Window* TaskPaneList::FindNextPane( Window *pWindow, BOOL bForward )
+Window* TaskPaneList::FindNextPane( Window *pWindow, sal_Bool bForward )
{
if( bForward )
::std::stable_sort( mTaskPanes.begin(), mTaskPanes.end(), LTRSort() );
@@ -295,7 +295,7 @@ Window* TaskPaneList::FindNextPane( Window *pWindow, BOOL bForward )
// --------------------------------------------------
// returns next splitter
-Window* TaskPaneList::FindNextSplitter( Window *pWindow, BOOL bForward )
+Window* TaskPaneList::FindNextSplitter( Window *pWindow, sal_Bool bForward )
{
if( bForward )
::std::stable_sort( mTaskPanes.begin(), mTaskPanes.end(), LTRSort() );
@@ -334,7 +334,7 @@ Window* TaskPaneList::FindNextSplitter( Window *pWindow, BOOL bForward )
// --------------------------------------------------
// returns first valid item (regardless of type) if pWindow==0, otherwise returns next valid float
-Window* TaskPaneList::FindNextFloat( Window *pWindow, BOOL bForward )
+Window* TaskPaneList::FindNextFloat( Window *pWindow, sal_Bool bForward )
{
if( bForward )
::std::stable_sort( mTaskPanes.begin(), mTaskPanes.end(), LTRSort() );
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index d8698966d14e..0eae498111ab 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -108,24 +108,24 @@ DBG_NAMEEX( Window )
#define TB_MAX_GROUPS 100
-#define DOCK_LINEHSIZE ((USHORT)0x0001)
-#define DOCK_LINEVSIZE ((USHORT)0x0002)
-#define DOCK_LINERIGHT ((USHORT)0x1000)
-#define DOCK_LINEBOTTOM ((USHORT)0x2000)
-#define DOCK_LINELEFT ((USHORT)0x4000)
-#define DOCK_LINETOP ((USHORT)0x8000)
+#define DOCK_LINEHSIZE ((sal_uInt16)0x0001)
+#define DOCK_LINEVSIZE ((sal_uInt16)0x0002)
+#define DOCK_LINERIGHT ((sal_uInt16)0x1000)
+#define DOCK_LINEBOTTOM ((sal_uInt16)0x2000)
+#define DOCK_LINELEFT ((sal_uInt16)0x4000)
+#define DOCK_LINETOP ((sal_uInt16)0x8000)
#define DOCK_LINEOFFSET 3
// -----------------------------------------------------------------------
-static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, USHORT highlight, BOOL bChecked, BOOL bEnabled, BOOL bIsWindow );
+static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bEnabled, sal_Bool bIsWindow );
// -----------------------------------------------------------------------
struct ImplToolSize
{
long mnWidth;
long mnHeight;
- USHORT mnLines;
+ sal_uInt16 mnLines;
};
struct ImplToolSizeArray
@@ -153,12 +153,12 @@ private:
Accelerator maAccel;
long mnMinWidth;
long mnMaxWidth;
- USHORT mnLineMode;
- USHORT mnStartLines;
+ sal_uInt16 mnLineMode;
+ sal_uInt16 mnStartLines;
void* mpCustomizeData;
- BOOL mbCustomizeMode;
- BOOL mbResizeMode;
- BOOL mbShowDragRect;
+ sal_Bool mbCustomizeMode;
+ sal_Bool mbResizeMode;
+ sal_Bool mbShowDragRect;
public:
ImplTBDragMgr();
@@ -182,18 +182,18 @@ public:
void StartDragging( ToolBox* pDragBox,
const Point& rPos, const Rectangle& rRect,
- USHORT nLineMode, BOOL bResizeItem,
+ sal_uInt16 nLineMode, sal_Bool bResizeItem,
void* pData = NULL );
void Dragging( const Point& rPos );
- void EndDragging( BOOL bOK = TRUE );
+ void EndDragging( sal_Bool bOK = sal_True );
void HideDragRect() { if ( mbShowDragRect ) mpDragBox->HideTracking(); }
void UpdateDragRect();
DECL_LINK( SelectHdl, Accelerator* );
void StartCustomizeMode();
void EndCustomizeMode();
- BOOL IsCustomizeMode() { return mbCustomizeMode; }
- BOOL IsResizeMode() { return mbResizeMode; }
+ sal_Bool IsCustomizeMode() { return mbCustomizeMode; }
+ sal_Bool IsResizeMode() { return mbResizeMode; }
};
// -----------------------------------------------------------------------
@@ -338,7 +338,7 @@ void ToolBox::ImplDrawGrip( ToolBox* pThis )
// execute pending paint requests
ImplCheckUpdate( pThis );
- BOOL bNativeOk = FALSE;
+ sal_Bool bNativeOk = sal_False;
if( pThis->IsNativeControlSupported( CTRL_TOOLBAR, pThis->mbHorz ? PART_THUMB_HORZ : PART_THUMB_VERT ) )
{
ToolbarValue aToolbarValue;
@@ -422,7 +422,7 @@ void ToolBox::ImplDrawGradientBackground( ToolBox* pThis, ImplDockingWindowWrapp
g.SetStartColor( startCol );
g.SetEndColor( endCol );
- BOOL bLineColor = pThis->IsLineColor();
+ sal_Bool bLineColor = pThis->IsLineColor();
Color aOldCol = pThis->GetLineColor();
pThis->SetLineColor( pThis->GetSettings().GetStyleSettings().GetShadowColor() );
@@ -512,7 +512,7 @@ void ToolBox::ImplDrawGradientBackground( ToolBox* pThis, ImplDockingWindowWrapp
if( pThis->mbHorz )
{
long y = 0;
- BOOL bDrawSep = FALSE; // pThis->ImplIsFloatingMode() && ( pThis->mnWinStyle & WB_LINESPACING );
+ sal_Bool bDrawSep = sal_False; // pThis->ImplIsFloatingMode() && ( pThis->mnWinStyle & WB_LINESPACING );
pThis->DrawGradient( Rectangle( 0, y, aTopLineSz.Width(), y+aTopLineSz.Height()), g );
y += aTopLineSz.Height();
@@ -554,7 +554,7 @@ void ToolBox::ImplDrawGradientBackground( ToolBox* pThis, ImplDockingWindowWrapp
}
-BOOL ToolBox::ImplDrawNativeBackground( ToolBox* pThis, const Region & )
+sal_Bool ToolBox::ImplDrawNativeBackground( ToolBox* pThis, const Region & )
{
// use NWF
Point aPt;
@@ -578,7 +578,7 @@ void ToolBox::ImplDrawTransparentBackground( ToolBox* pThis, const Region &rRegi
pThis->mpData->mbIsPaintLocked = bOldPaintLock;
}
-void ToolBox::ImplDrawConstantBackground( ToolBox* pThis, const Region &rRegion, BOOL bIsInPopupMode )
+void ToolBox::ImplDrawConstantBackground( ToolBox* pThis, const Region &rRegion, sal_Bool bIsInPopupMode )
{
// draw a constant color
if( !bIsInPopupMode )
@@ -599,7 +599,7 @@ void ToolBox::ImplDrawBackground( ToolBox* pThis, const Rectangle &rRect )
ImplCheckUpdate( pThis );
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( pThis );
- BOOL bIsInPopupMode = pThis->ImplIsInPopupMode();
+ sal_Bool bIsInPopupMode = pThis->ImplIsInPopupMode();
Region aPaintRegion( rRect );
@@ -624,7 +624,7 @@ void ToolBox::ImplDrawBackground( ToolBox* pThis, const Rectangle &rRect )
// toolbars known to the dockingmanager will be drawn using NWF or a gradient
// docked toolbars are transparent and NWF is already used in the docking area which is their common background
// so NWF is used here for floating toolbars only
- BOOL bNativeOk = FALSE;
+ sal_Bool bNativeOk = sal_False;
if( pThis->ImplIsFloatingMode() && pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_ENTIRE_CONTROL) )
bNativeOk = ImplDrawNativeBackground( pThis, aPaintRegion );
@@ -644,7 +644,7 @@ void ToolBox::ImplDrawBackground( ToolBox* pThis, const Rectangle &rRect )
pThis->Pop();
}
-void ToolBox::ImplErase( ToolBox* pThis, const Rectangle &rRect, BOOL bHighlight, BOOL bHasOpenPopup )
+void ToolBox::ImplErase( ToolBox* pThis, const Rectangle &rRect, sal_Bool bHighlight, sal_Bool bHasOpenPopup )
{
// the background of non NWF buttons is painted in a constant color
// to have the same highlight color (transparency in DrawSelectionBackground())
@@ -763,7 +763,7 @@ const ImplToolItem *ToolBox::ImplGetFirstClippedItem( const ToolBox* pThis )
// -----------------------------------------------------------------------
-Size ToolBox::ImplCalcSize( const ToolBox* pThis, USHORT nCalcLines, USHORT nCalcMode )
+Size ToolBox::ImplCalcSize( const ToolBox* pThis, sal_uInt16 nCalcLines, sal_uInt16 nCalcMode )
{
long nMax;
long nLeft = 0;
@@ -772,45 +772,45 @@ Size ToolBox::ImplCalcSize( const ToolBox* pThis, USHORT nCalcLines, USHORT nCal
long nBottom = 0;
Size aSize;
WindowAlign eOldAlign = pThis->meAlign;
- BOOL bOldHorz = pThis->mbHorz;
- BOOL bOldAssumeDocked = pThis->mpData->mbAssumeDocked;
- BOOL bOldAssumeFloating = pThis->mpData->mbAssumeFloating;
+ sal_Bool bOldHorz = pThis->mbHorz;
+ sal_Bool bOldAssumeDocked = pThis->mpData->mbAssumeDocked;
+ sal_Bool bOldAssumeFloating = pThis->mpData->mbAssumeFloating;
if ( nCalcMode )
{
- BOOL bOldFloatingMode = pThis->ImplIsFloatingMode();
+ sal_Bool bOldFloatingMode = pThis->ImplIsFloatingMode();
- pThis->mpData->mbAssumeDocked = FALSE;
- pThis->mpData->mbAssumeFloating = FALSE;
+ pThis->mpData->mbAssumeDocked = sal_False;
+ pThis->mpData->mbAssumeFloating = sal_False;
if ( nCalcMode == TB_CALCMODE_HORZ )
{
- pThis->mpData->mbAssumeDocked = TRUE; // force non-floating mode during calculation
+ pThis->mpData->mbAssumeDocked = sal_True; // force non-floating mode during calculation
ImplCalcBorder( WINDOWALIGN_TOP, nLeft, nTop, nRight, nBottom, pThis );
- ((ToolBox*)pThis)->mbHorz = TRUE;
+ ((ToolBox*)pThis)->mbHorz = sal_True;
if ( pThis->mbHorz != bOldHorz )
((ToolBox*)pThis)->meAlign = WINDOWALIGN_TOP;
}
else if ( nCalcMode == TB_CALCMODE_VERT )
{
- pThis->mpData->mbAssumeDocked = TRUE; // force non-floating mode during calculation
+ pThis->mpData->mbAssumeDocked = sal_True; // force non-floating mode during calculation
ImplCalcBorder( WINDOWALIGN_LEFT, nLeft, nTop, nRight, nBottom, pThis );
- ((ToolBox*)pThis)->mbHorz = FALSE;
+ ((ToolBox*)pThis)->mbHorz = sal_False;
if ( pThis->mbHorz != bOldHorz )
((ToolBox*)pThis)->meAlign = WINDOWALIGN_LEFT;
}
else if ( nCalcMode == TB_CALCMODE_FLOAT )
{
- pThis->mpData->mbAssumeFloating = TRUE; // force non-floating mode during calculation
+ pThis->mpData->mbAssumeFloating = sal_True; // force non-floating mode during calculation
nLeft = nTop = nRight = nBottom = 0;
- ((ToolBox*)pThis)->mbHorz = TRUE;
+ ((ToolBox*)pThis)->mbHorz = sal_True;
if ( pThis->mbHorz != bOldHorz )
((ToolBox*)pThis)->meAlign = WINDOWALIGN_TOP;
}
if ( (pThis->meAlign != eOldAlign) || (pThis->mbHorz != bOldHorz) ||
(pThis->ImplIsFloatingMode() != bOldFloatingMode ) )
- ((ToolBox*)pThis)->mbCalc = TRUE;
+ ((ToolBox*)pThis)->mbCalc = sal_True;
}
else
ImplCalcBorder( pThis->meAlign, nLeft, nTop, nRight, nBottom, pThis );
@@ -872,7 +872,7 @@ Size ToolBox::ImplCalcSize( const ToolBox* pThis, USHORT nCalcLines, USHORT nCal
{
((ToolBox*)pThis)->meAlign = eOldAlign;
((ToolBox*)pThis)->mbHorz = bOldHorz;
- ((ToolBox*)pThis)->mbCalc = TRUE;
+ ((ToolBox*)pThis)->mbCalc = sal_True;
}
}
@@ -918,13 +918,13 @@ void ToolBox::ImplCalcFloatSizes( ToolBox* pThis )
// calc an upper bound for ImplCalcBreaks below
long upperBoundWidth = nCalcSize * pThis->mpData->m_aItems.size();
- USHORT i;
- USHORT nLines;
- USHORT nCalcLines;
- USHORT nTempLines;
+ sal_uInt16 i;
+ sal_uInt16 nLines;
+ sal_uInt16 nCalcLines;
+ sal_uInt16 nTempLines;
long nHeight;
long nMaxLineWidth;
- nCalcLines = pThis->ImplCalcBreaks( nCalcSize, &nMaxLineWidth, TRUE );
+ nCalcLines = pThis->ImplCalcBreaks( nCalcSize, &nMaxLineWidth, sal_True );
pThis->mpFloatSizeAry = new ImplToolSizeArray;
pThis->mpFloatSizeAry->mpSize = new ImplToolSize[nCalcLines];
@@ -946,7 +946,7 @@ void ToolBox::ImplCalcFloatSizes( ToolBox* pThis )
do
{
nCalcSize += pThis->mnMaxItemWidth;
- nTempLines = pThis->ImplCalcBreaks( nCalcSize, &nMaxLineWidth, TRUE );
+ nTempLines = pThis->ImplCalcBreaks( nCalcSize, &nMaxLineWidth, sal_True );
}
while ( (nCalcSize < upperBoundWidth) && (nLines < nTempLines) && (nTempLines != 1) );
if ( nTempLines < nLines )
@@ -958,7 +958,7 @@ void ToolBox::ImplCalcFloatSizes( ToolBox* pThis )
// -----------------------------------------------------------------------
-Size ToolBox::ImplCalcFloatSize( ToolBox* pThis, USHORT& rLines )
+Size ToolBox::ImplCalcFloatSize( ToolBox* pThis, sal_uInt16& rLines )
{
ImplCalcFloatSizes( pThis );
@@ -969,7 +969,7 @@ Size ToolBox::ImplCalcFloatSize( ToolBox* pThis, USHORT& rLines )
rLines = pThis->mnLines;
}
- USHORT i = 0;
+ sal_uInt16 i = 0;
while ( i < pThis->mpFloatSizeAry->mnLastEntry &&
rLines < pThis->mpFloatSizeAry->mpSize[i].mnLines )
i++;
@@ -988,7 +988,7 @@ void ToolBox::ImplCalcMinMaxFloatSize( ToolBox* pThis, Size& rMinSize, Size& rMa
{
ImplCalcFloatSizes( pThis );
- USHORT i = 0;
+ sal_uInt16 i = 0;
rMinSize = Size( pThis->mpFloatSizeAry->mpSize[i].mnWidth, pThis->mpFloatSizeAry->mpSize[i].mnHeight );
rMaxSize = Size( pThis->mpFloatSizeAry->mpSize[i].mnWidth, pThis->mpFloatSizeAry->mpSize[i].mnHeight );
while ( ++i <= pThis->mpFloatSizeAry->mnLastEntry )
@@ -1014,7 +1014,7 @@ void ToolBox::ImplSetMinMaxFloatSize( ToolBox *pThis )
{
pWrapper->SetMinOutputSizePixel( aMinSize );
pWrapper->SetMaxOutputSizePixel( aMaxSize );
- pWrapper->ShowTitleButton( TITLE_BUTTON_MENU, ( pThis->GetMenuType() & TOOLBOX_MENUTYPE_CUSTOMIZE) ? TRUE : FALSE );
+ pWrapper->ShowTitleButton( TITLE_BUTTON_MENU, ( pThis->GetMenuType() & TOOLBOX_MENUTYPE_CUSTOMIZE) ? sal_True : sal_False );
}
else
{
@@ -1027,7 +1027,7 @@ void ToolBox::ImplSetMinMaxFloatSize( ToolBox *pThis )
// -----------------------------------------------------------------------
-USHORT ToolBox::ImplCalcLines( ToolBox* pThis, long nToolSize )
+sal_uInt16 ToolBox::ImplCalcLines( ToolBox* pThis, long nToolSize )
{
long nLineHeight;
@@ -1055,12 +1055,12 @@ USHORT ToolBox::ImplCalcLines( ToolBox* pThis, long nToolSize )
if( nLines < 1 )
nLines = 1;
- return static_cast<USHORT>(nLines);
+ return static_cast<sal_uInt16>(nLines);
}
// -----------------------------------------------------------------------
-USHORT ToolBox::ImplTestLineSize( ToolBox* pThis, const Point& rPos )
+sal_uInt16 ToolBox::ImplTestLineSize( ToolBox* pThis, const Point& rPos )
{
if ( !pThis->ImplIsFloatingMode() &&
(!pThis->mbScroll || (pThis->mnLines > 1) || (pThis->mnCurLines > pThis->mnVisLines)) )
@@ -1095,9 +1095,9 @@ USHORT ToolBox::ImplTestLineSize( ToolBox* pThis, const Point& rPos )
// -----------------------------------------------------------------------
void ToolBox::ImplLineSizing( ToolBox* pThis, const Point& rPos, Rectangle& rRect,
- USHORT nLineMode )
+ sal_uInt16 nLineMode )
{
- BOOL mbHorz;
+ sal_Bool mbHorz;
long nOneLineSize;
long nCurSize;
long nMaxSize;
@@ -1107,31 +1107,31 @@ void ToolBox::ImplLineSizing( ToolBox* pThis, const Point& rPos, Rectangle& rRec
if ( nLineMode & DOCK_LINERIGHT )
{
nCurSize = rPos.X() - rRect.Left();
- mbHorz = FALSE;
+ mbHorz = sal_False;
}
else if ( nLineMode & DOCK_LINEBOTTOM )
{
nCurSize = rPos.Y() - rRect.Top();
- mbHorz = TRUE;
+ mbHorz = sal_True;
}
else if ( nLineMode & DOCK_LINELEFT )
{
nCurSize = rRect.Right() - rPos.X();
- mbHorz = FALSE;
+ mbHorz = sal_False;
}
else if ( nLineMode & DOCK_LINETOP )
{
nCurSize = rRect.Bottom() - rPos.Y();
- mbHorz = TRUE;
+ mbHorz = sal_True;
}
else {
OSL_FAIL( "ImplLineSizing: Trailing else" );
nCurSize = 0;
- mbHorz = FALSE;
+ mbHorz = sal_False;
}
Size aWinSize = pThis->GetSizePixel();
- USHORT nMaxLines = (pThis->mnLines > pThis->mnCurLines) ? pThis->mnLines : pThis->mnCurLines;
+ sal_uInt16 nMaxLines = (pThis->mnLines > pThis->mnCurLines) ? pThis->mnLines : pThis->mnCurLines;
if ( nMaxLines > TB_MAXLINES )
nMaxLines = TB_MAXLINES;
if ( mbHorz )
@@ -1149,7 +1149,7 @@ void ToolBox::ImplLineSizing( ToolBox* pThis, const Point& rPos, Rectangle& rRec
nMaxSize = aWinSize.Width();
}
- USHORT i = 1;
+ sal_uInt16 i = 1;
if ( nCurSize <= nOneLineSize )
nSize = nOneLineSize;
else
@@ -1190,9 +1190,9 @@ void ToolBox::ImplLineSizing( ToolBox* pThis, const Point& rPos, Rectangle& rRec
// -----------------------------------------------------------------------
-USHORT ToolBox::ImplFindItemPos( ToolBox* pBox, const Point& rPos )
+sal_uInt16 ToolBox::ImplFindItemPos( ToolBox* pBox, const Point& rPos )
{
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
long nLast = 0;
Point aPos = rPos;
Size aSize( pBox->mnDX, pBox->mnDY );
@@ -1259,9 +1259,9 @@ ImplTBDragMgr::ImplTBDragMgr()
mpBoxList = new ImplTBList();
mnLineMode = 0;
mnStartLines = 0;
- mbCustomizeMode = FALSE;
- mbResizeMode = FALSE;
- mbShowDragRect = FALSE;
+ mbCustomizeMode = sal_False;
+ mbResizeMode = sal_False;
+ mbShowDragRect = sal_False;
mpDragBox = NULL;
maAccel.InsertItem( KEY_RETURN, KeyCode( KEY_RETURN ) );
@@ -1311,12 +1311,12 @@ ToolBox* ImplTBDragMgr::FindToolBox( const Rectangle& rRect )
void ImplTBDragMgr::StartDragging( ToolBox* pToolBox,
const Point& rPos, const Rectangle& rRect,
- USHORT nDragLineMode, BOOL bResizeItem,
+ sal_uInt16 nDragLineMode, sal_Bool bResizeItem,
void* pData )
{
mpDragBox = pToolBox;
pToolBox->CaptureMouse();
- pToolBox->mbDragging = TRUE;
+ pToolBox->mbDragging = sal_True;
Application::InsertAccel( &maAccel );
if ( nDragLineMode )
@@ -1348,7 +1348,7 @@ void ImplTBDragMgr::StartDragging( ToolBox* pToolBox,
maMouseOff.Y() = rRect.Top() - rPos.Y();
maRect = rRect;
maStartRect = rRect;
- mbShowDragRect = TRUE;
+ mbShowDragRect = sal_True;
pToolBox->ShowTracking( maRect );
}
@@ -1388,12 +1388,12 @@ void ImplTBDragMgr::Dragging( const Point& rPos )
// -----------------------------------------------------------------------
-void ImplTBDragMgr::EndDragging( BOOL bOK )
+void ImplTBDragMgr::EndDragging( sal_Bool bOK )
{
mpDragBox->HideTracking();
mpDragBox->ReleaseMouse();
- mpDragBox->mbDragging = FALSE;
- mbShowDragRect = FALSE;
+ mpDragBox->mbDragging = sal_False;
+ mbShowDragRect = sal_False;
Application::RemoveAccel( &maAccel );
if ( mnLineMode )
@@ -1401,16 +1401,16 @@ void ImplTBDragMgr::EndDragging( BOOL bOK )
if ( !bOK )
{
mpDragBox->mnDockLines = mnStartLines;
- mpDragBox->EndDocking( maStartRect, FALSE );
+ mpDragBox->EndDocking( maStartRect, sal_False );
}
else
- mpDragBox->EndDocking( maRect, FALSE );
+ mpDragBox->EndDocking( maRect, sal_False );
mnLineMode = 0;
mnStartLines = 0;
}
else
{
- USHORT nTempItem = mpDragBox->mnConfigItem;
+ sal_uInt16 nTempItem = mpDragBox->mnConfigItem;
if ( nTempItem )
{
mpDragBox->mnConfigItem = 0;
@@ -1428,7 +1428,7 @@ void ImplTBDragMgr::EndDragging( BOOL bOK )
pItem->mpWindow->SetSizePixel( aSize );
// ToolBox neu brechnen und neu ausgeben
- mpDragBox->ImplInvalidate( TRUE );
+ mpDragBox->ImplInvalidate( sal_True );
mpDragBox->Customize( ToolBoxCustomizeEvent( mpDragBox, nTempItem,
TOOLBOX_CUSTOMIZE_RESIZE,
mpCustomizeData ) );
@@ -1455,7 +1455,7 @@ void ImplTBDragMgr::EndDragging( BOOL bOK )
}
aPos = pDropBox->ScreenToOutputPixel( aPos );
- USHORT nPos = ToolBox::ImplFindItemPos( pDropBox, aPos );
+ sal_uInt16 nPos = ToolBox::ImplFindItemPos( pDropBox, aPos );
mpDragBox->Customize( ToolBoxCustomizeEvent( pDropBox, nTempItem,
nPos, mpCustomizeData ) );
}
@@ -1467,7 +1467,7 @@ void ImplTBDragMgr::EndDragging( BOOL bOK )
}
}
mpCustomizeData = NULL;
- mbResizeMode = FALSE;
+ mbResizeMode = sal_False;
mpDragBox->Deactivate();
}
@@ -1490,18 +1490,18 @@ void ImplTBDragMgr::UpdateDragRect()
IMPL_LINK( ImplTBDragMgr, SelectHdl, Accelerator*, pAccel )
{
if ( pAccel->GetCurItemId() == KEY_ESCAPE )
- EndDragging( FALSE );
+ EndDragging( sal_False );
else
- EndDragging( TRUE );
+ EndDragging( sal_True );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
void ImplTBDragMgr::StartCustomizeMode()
{
- mbCustomizeMode = TRUE;
+ mbCustomizeMode = sal_True;
for ( size_t i = 0, n = mpBoxList->size(); i < n; ++i ) {
(*mpBoxList)[ i ]->ImplStartCustomizeMode();
@@ -1512,7 +1512,7 @@ void ImplTBDragMgr::StartCustomizeMode()
void ImplTBDragMgr::EndCustomizeMode()
{
- mbCustomizeMode = FALSE;
+ mbCustomizeMode = sal_False;
for ( size_t i = 0, n = mpBoxList->size(); i < n; ++i ) {
(*mpBoxList)[ i ]->ImplEndCustomizeMode();
@@ -1523,7 +1523,7 @@ void ImplTBDragMgr::EndCustomizeMode()
static void ImplDrawOutButton( OutputDevice* pOutDev, const Rectangle& rRect,
- USHORT nStyle )
+ sal_uInt16 nStyle )
{
const StyleSettings& rStyleSettings = pOutDev->GetSettings().GetStyleSettings();
Color aShadowColor = rStyleSettings.GetShadowColor();
@@ -1571,7 +1571,7 @@ void ToolBox::ImplInit( Window* pParent, WinBits nStyle )
{
// Variablen initialisieren
- ImplGetWindowImpl()->mbToolBox = TRUE;
+ ImplGetWindowImpl()->mbToolBox = sal_True;
mpBtnDev = NULL;
mpFloatSizeAry = NULL;
mpData = new ImplToolBoxPrivateData;
@@ -1602,25 +1602,25 @@ void ToolBox::ImplInit( Window* pParent, WinBits nStyle )
mnConfigItem = 0;
mnMouseClicks = 0;
mnMouseModifier = 0;
- mbDrag = FALSE;
- mbSelection = FALSE;
- mbCommandDrag = FALSE;
- mbUpper = FALSE;
- mbLower = FALSE;
- mbNextTool = FALSE;
- mbIn = FALSE;
- mbCalc = TRUE;
- mbFormat = FALSE;
- mbFullPaint = FALSE;
- mbHorz = TRUE;
+ mbDrag = sal_False;
+ mbSelection = sal_False;
+ mbCommandDrag = sal_False;
+ mbUpper = sal_False;
+ mbLower = sal_False;
+ mbNextTool = sal_False;
+ mbIn = sal_False;
+ mbCalc = sal_True;
+ mbFormat = sal_False;
+ mbFullPaint = sal_False;
+ mbHorz = sal_True;
mbScroll = (nStyle & WB_SCROLL) != 0;
- mbCustomize = FALSE;
- mbCustomizeMode = FALSE;
- mbDragging = FALSE;
- mbMenuStrings = FALSE;
- mbIsShift = FALSE;
- mbIsKeyEvent = FALSE;
- mbChangingHighlight = FALSE;
+ mbCustomize = sal_False;
+ mbCustomizeMode = sal_False;
+ mbDragging = sal_False;
+ mbMenuStrings = sal_False;
+ mbIsShift = sal_False;
+ mbIsKeyEvent = sal_False;
+ mbChangingHighlight = sal_False;
meButtonType = BUTTON_SYMBOL;
meAlign = WINDOWALIGN_TOP;
meLastStyle = POINTER_ARROW;
@@ -1647,13 +1647,13 @@ void ToolBox::ImplInit( Window* pParent, WinBits nStyle )
ImplGetWindowImpl()->mnStyle &= ~WB_DIALOGCONTROL;
}
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
}
// -----------------------------------------------------------------------
-void ToolBox::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void ToolBox::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
mpData->mbNativeButtons = IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON );
@@ -1687,7 +1687,7 @@ void ToolBox::ImplInitSettings( BOOL bFont,
{
aColor = GetControlBackground();
SetBackground( aColor );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
SetParentClipMode( 0 );
}
else
@@ -1695,7 +1695,7 @@ void ToolBox::ImplInitSettings( BOOL bFont,
if( IsNativeControlSupported( CTRL_TOOLBAR, PART_ENTIRE_CONTROL ) )
{
SetBackground();
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
mpData->maDisplayBackground = Wallpaper( rStyleSettings.GetFaceColor() );
}
@@ -1707,7 +1707,7 @@ void ToolBox::ImplInitSettings( BOOL bFont,
aColor = rStyleSettings.GetWindowColor();
SetBackground( aColor );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
SetParentClipMode( 0 );
ImplUpdateImageList();
@@ -1726,7 +1726,7 @@ void ToolBox::ImplLoadRes( const ResId& rResId )
DockingWindow::ImplLoadRes( rResId );
- ULONG nObjMask;
+ sal_uLong nObjMask;
nObjMask = ReadLongRes();
@@ -1737,17 +1737,17 @@ void ToolBox::ImplLoadRes( const ResId& rResId )
SetAlign( (WindowAlign)ReadLongRes() );
if ( nObjMask & RSC_TOOLBOX_LINECOUNT )
- SetLineCount( sal::static_int_cast<USHORT>(ReadLongRes()) );
+ SetLineCount( sal::static_int_cast<sal_uInt16>(ReadLongRes()) );
if ( nObjMask & RSC_TOOLBOX_CUSTOMIZE )
{
- BOOL bCust = (BOOL)ReadShortRes();
+ sal_Bool bCust = (sal_Bool)ReadShortRes();
EnableCustomize( bCust );
}
if ( nObjMask & RSC_TOOLBOX_MENUSTRINGS )
{
- BOOL bCust = (BOOL)ReadShortRes();
+ sal_Bool bCust = (sal_Bool)ReadShortRes();
EnableMenuStrings( bCust );
}
@@ -1762,10 +1762,10 @@ void ToolBox::ImplLoadRes( const ResId& rResId )
if ( nObjMask & RSC_TOOLBOX_ITEMLIST )
{
- ULONG nEle = ReadLongRes();
+ sal_uLong nEle = ReadLongRes();
// Item hinzufuegen
- for ( ULONG i = 0; i < nEle; i++ )
+ for ( sal_uLong i = 0; i < nEle; i++ )
{
InsertItem( ResId( (RSHEADER_TYPE *)GetClassRes(), *pMgr ) );
IncrementRes( GetObjSizeRes( (RSHEADER_TYPE *)GetClassRes() ) );
@@ -1796,7 +1796,7 @@ ToolBox::ToolBox( Window* pParent, const ResId& rResId ) :
// Groesse des FloatingWindows berechnen und umschalten, wenn die
// ToolBox initial im FloatingModus ist
if ( ImplIsFloatingMode() )
- mbHorz = TRUE;
+ mbHorz = sal_True;
else
Resize();
@@ -1847,7 +1847,7 @@ ToolBox::~ToolBox()
// -----------------------------------------------------------------------
-ImplToolItem* ToolBox::ImplGetItem( USHORT nItemId ) const
+ImplToolItem* ToolBox::ImplGetItem( sal_uInt16 nItemId ) const
{
std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin();
while ( it != mpData->m_aItems.end() )
@@ -1861,7 +1861,7 @@ ImplToolItem* ToolBox::ImplGetItem( USHORT nItemId ) const
}
// -----------------------------------------------------------------------
-static void ImplAddButtonBorder( long &rWidth, long& rHeight, USHORT aOutStyle, BOOL bNativeButtons )
+static void ImplAddButtonBorder( long &rWidth, long& rHeight, sal_uInt16 aOutStyle, sal_Bool bNativeButtons )
{
if ( aOutStyle & TOOLBOX_STYLE_OUTBUTTON )
{
@@ -1884,13 +1884,13 @@ static void ImplAddButtonBorder( long &rWidth, long& rHeight, USHORT aOutStyle,
// -----------------------------------------------------------------------
-BOOL ToolBox::ImplCalcItem()
+sal_Bool ToolBox::ImplCalcItem()
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
// recalc required ?
if ( !mbCalc )
- return FALSE;
+ return sal_False;
ImplDisableFlatButtons();
@@ -1982,27 +1982,27 @@ BOOL ToolBox::ImplCalcItem()
std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin();
while ( it != mpData->m_aItems.end() )
{
- BOOL bImage;
- BOOL bText;
+ sal_Bool bImage;
+ sal_Bool bText;
- it->mbVisibleText = FALSE; // indicates if text will definitely be drawn, influences dropdown pos
+ it->mbVisibleText = sal_False; // indicates if text will definitely be drawn, influences dropdown pos
if ( it->meType == TOOLBOXITEM_BUTTON )
{
// check if image and/or text exists
if ( !(it->maImage) )
- bImage = FALSE;
+ bImage = sal_False;
else
- bImage = TRUE;
+ bImage = sal_True;
if ( !it->maText.Len() )
- bText = FALSE;
+ bText = sal_False;
else
- bText = TRUE;
+ bText = sal_True;
ButtonType tmpButtonType = determineButtonType( &(*it), meButtonType ); // default to toolbox setting
if ( bImage || bText )
{
- it->mbEmptyBtn = FALSE;
+ it->mbEmptyBtn = sal_False;
if ( tmpButtonType == BUTTON_SYMBOL )
{
@@ -2015,7 +2015,7 @@ BOOL ToolBox::ImplCalcItem()
{
it->maItemSize = Size( GetCtrlTextWidth( it->maText )+TB_TEXTOFFSET,
GetTextHeight() );
- it->mbVisibleText = TRUE;
+ it->mbVisibleText = sal_True;
}
}
else if ( tmpButtonType == BUTTON_TEXT )
@@ -2025,7 +2025,7 @@ BOOL ToolBox::ImplCalcItem()
{
it->maItemSize = Size( GetCtrlTextWidth( it->maText )+TB_TEXTOFFSET,
GetTextHeight() );
- it->mbVisibleText = TRUE;
+ it->mbVisibleText = sal_True;
}
else
{
@@ -2053,7 +2053,7 @@ BOOL ToolBox::ImplCalcItem()
else
{ // no image and no text
it->maItemSize = Size( nDefWidth, nDefHeight );
- it->mbEmptyBtn = TRUE;
+ it->mbEmptyBtn = sal_True;
}
// Gegebenenfalls die Fensterhoehe mit beruecksichtigen
@@ -2133,8 +2133,8 @@ BOOL ToolBox::ImplCalcItem()
nMaxWidth = nFixedWidth;
}
- mbCalc = FALSE;
- mbFormat = TRUE;
+ mbCalc = sal_False;
+ mbFormat = sal_True;
// do we have to recalc the sizes ?
if ( (nMaxWidth != mnMaxItemWidth) || (nMaxHeight != mnMaxItemHeight) )
@@ -2142,25 +2142,25 @@ BOOL ToolBox::ImplCalcItem()
mnMaxItemWidth = nMaxWidth;
mnMaxItemHeight = nMaxHeight;
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-USHORT ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, BOOL bCalcHorz )
+sal_uInt16 ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, sal_Bool bCalcHorz )
{
- ULONG nLineStart = 0;
- ULONG nGroupStart = 0;
+ sal_uLong nLineStart = 0;
+ sal_uLong nGroupStart = 0;
long nLineWidth = 0;
long nCurWidth;
long nLastGroupLineWidth = 0;
long nMaxLineWidth = 0;
- USHORT nLines = 1;
- BOOL bWindow;
- BOOL bBreak = FALSE;
+ sal_uInt16 nLines = 1;
+ sal_Bool bWindow;
+ sal_Bool bBreak = sal_False;
long nWidthTotal = nWidth;
// when docked the menubutton will be in the first line
@@ -2172,12 +2172,12 @@ USHORT ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, BOOL bCalcHorz
while ( it != mpData->m_aItems.end() )
{
it->mbBreak = bBreak;
- bBreak = FALSE;
+ bBreak = sal_False;
if ( it->mbVisible )
{
- bWindow = FALSE;
- bBreak = FALSE;
+ bWindow = sal_False;
+ bBreak = sal_False;
nCurWidth = 0;
if ( it->meType == TOOLBOXITEM_BUTTON || it->meType == TOOLBOXITEM_SPACE )
@@ -2193,7 +2193,7 @@ USHORT ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, BOOL bCalcHorz
if ( !mbScroll || (nWinItemWidth <= nWidthTotal) )
{
nCurWidth = nWinItemWidth;
- bWindow = TRUE;
+ bWindow = sal_True;
}
else
{
@@ -2206,13 +2206,13 @@ USHORT ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, BOOL bCalcHorz
// check for line break
if ( (nLineWidth+nCurWidth > nWidthTotal) && mbScroll )
- bBreak = TRUE;
+ bBreak = sal_True;
}
else if ( it->meType == TOOLBOXITEM_SEPARATOR )
nCurWidth = it->mnSepSize;
// treat breaks as separators, except when using old style toolbars (ie. no menu button)
else if ( (it->meType == TOOLBOXITEM_BREAK) && !IsMenuEnabled() )
- bBreak = TRUE;
+ bBreak = sal_True;
if ( bBreak )
{
@@ -2228,8 +2228,8 @@ USHORT ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, BOOL bCalcHorz
nLineWidth = 0;
nLineStart = it - mpData->m_aItems.begin();
nGroupStart = nLineStart;
- it->mbBreak = TRUE;
- bBreak = FALSE;
+ it->mbBreak = sal_True;
+ bBreak = sal_False;
}
else
{
@@ -2293,7 +2293,7 @@ USHORT ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, BOOL bCalcHorz
// -----------------------------------------------------------------------
namespace
{
- BOOL ImplFollowedByVisibleButton( std::vector< ImplToolItem >::iterator _aSeparator, std::vector< ImplToolItem >::iterator _aEnd )
+ sal_Bool ImplFollowedByVisibleButton( std::vector< ImplToolItem >::iterator _aSeparator, std::vector< ImplToolItem >::iterator _aEnd )
{
std::vector< ImplToolItem >::iterator aLookup = _aSeparator;
while ( ++aLookup != _aEnd )
@@ -2302,9 +2302,9 @@ namespace
return ImplFollowedByVisibleButton( aLookup, _aEnd );
if ( ( aLookup->meType == TOOLBOXITEM_BUTTON ) && aLookup->mbVisible )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
}
@@ -2324,7 +2324,7 @@ Size ToolBox::ImplGetOptimalFloatingSize( FloatingSizeMode eMode )
if( eMode == FSMODE_AUTO || eMode == FSMODE_FAVOURHEIGHT )
{
// calc number of floating lines for current window height
- USHORT nFloatLinesHeight = ImplCalcLines( this, mnDY );
+ sal_uInt16 nFloatLinesHeight = ImplCalcLines( this, mnDY );
// calc window size according to this number
aSize1 = ImplCalcFloatSize( this, nFloatLinesHeight );
@@ -2340,9 +2340,9 @@ Size ToolBox::ImplGetOptimalFloatingSize( FloatingSizeMode eMode )
int nBorderY = 2*TB_BORDER_OFFSET2 + mnTopBorder + mnBottomBorder + 2*mnBorderY;
Size aSz( aCurrentSize );
long maxX;
- USHORT nLines = ImplCalcBreaks( aSz.Width()-nBorderX, &maxX, mbHorz );
+ sal_uInt16 nLines = ImplCalcBreaks( aSz.Width()-nBorderX, &maxX, mbHorz );
- USHORT manyLines = 1000;
+ sal_uInt16 manyLines = 1000;
Size aMinimalFloatSize = ImplCalcFloatSize( this, manyLines );
aSz.Height() = nBorderY + nLineHeight * nLines;
@@ -2379,7 +2379,7 @@ Size ToolBox::ImplGetOptimalFloatingSize( FloatingSizeMode eMode )
}
-void ToolBox::ImplFormat( BOOL bResize )
+void ToolBox::ImplFormat( sal_Bool bResize )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -2399,15 +2399,15 @@ void ToolBox::ImplFormat( BOOL bResize )
long nMax; // width of layoutarea in pixels
long nX;
long nY;
- USHORT nFormatLine;
- BOOL bMustFullPaint;
- BOOL bLastSep;
+ sal_uInt16 nFormatLine;
+ sal_Bool bMustFullPaint;
+ sal_Bool bLastSep;
std::vector< ImplToolItem >::iterator it;
std::vector< ImplToolItem >::iterator temp_it;
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
- BOOL bIsInPopupMode = ImplIsInPopupMode();
+ sal_Bool bIsInPopupMode = ImplIsInPopupMode();
// FloatSizeAry gegebenenfalls loeschen
if ( mpFloatSizeAry )
@@ -2426,9 +2426,9 @@ void ToolBox::ImplFormat( BOOL bResize )
ImplUpdateDragArea( this );
if ( ImplCalcItem() )
- bMustFullPaint = TRUE;
+ bMustFullPaint = sal_True;
else
- bMustFullPaint = FALSE;
+ bMustFullPaint = sal_False;
// calculate new size during interactive resize or
@@ -2571,7 +2571,7 @@ void ToolBox::ImplFormat( BOOL bResize )
nX = nLeft; // top-left offset
nY = nTop;
nFormatLine = 1;
- bLastSep = TRUE;
+ bLastSep = sal_True;
// save old scroll rectangles and reset them
Rectangle aOldLowerRect = maLowerRect;
@@ -2705,7 +2705,7 @@ void ToolBox::ImplFormat( BOOL bResize )
// hide double separators
if ( it->meType == TOOLBOXITEM_SEPARATOR )
{
- it->mbVisible = FALSE;
+ it->mbVisible = sal_False;
if ( !bLastSep )
{
// check if any visible items have to appear behind it
@@ -2716,18 +2716,18 @@ void ToolBox::ImplFormat( BOOL bResize )
((temp_it->meType == TOOLBOXITEM_BUTTON) &&
temp_it->mbVisible) )
{
- it->mbVisible = TRUE;
+ it->mbVisible = sal_True;
break;
}
++temp_it;
}
}
- bLastSep = TRUE;
+ bLastSep = sal_True;
}
else if ( it->mbVisible )
- bLastSep = FALSE;
+ bLastSep = sal_False;
- it->mbShowWindow = FALSE;
+ it->mbShowWindow = sal_False;
// check for line break and advance nX/nY accordingly
if ( it->mbBreak )
@@ -2908,7 +2908,7 @@ void ToolBox::ImplFormat( BOOL bResize )
}
// indicate formatting is done
- mbFormat = FALSE;
+ mbFormat = sal_False;
}
// -----------------------------------------------------------------------
@@ -2919,7 +2919,7 @@ IMPL_LINK( ToolBox, ImplDropdownLongClickHdl, ToolBox*, EMPTYARG )
(mpData->m_aItems[ mnCurPos ].mnBits & TIB_DROPDOWN)
)
{
- mpData->mbDropDownByKeyboard = FALSE;
+ mpData->mbDropDownByKeyboard = sal_False;
GetDropdownClickHdl().Call( this );
// do not reset data if the dropdown handler opened a floating window
@@ -2928,7 +2928,7 @@ IMPL_LINK( ToolBox, ImplDropdownLongClickHdl, ToolBox*, EMPTYARG )
{
// no floater was opened
Deactivate();
- ImplDrawItem( mnCurPos, FALSE );
+ ImplDrawItem( mnCurPos, sal_False );
mnCurPos = TOOLBOX_ITEM_NOTFOUND;
mnCurItemId = 0;
@@ -2956,7 +2956,7 @@ IMPL_LINK( ToolBox, ImplUpdateHdl, void*, EMPTYARG )
// -----------------------------------------------------------------------
-static void ImplDrawMoreIndicator( ToolBox *pBox, const Rectangle& rRect, BOOL bSetColor, BOOL bRotate )
+static void ImplDrawMoreIndicator( ToolBox *pBox, const Rectangle& rRect, sal_Bool bSetColor, sal_Bool bRotate )
{
Color aOldFillColor = pBox->GetFillColor();
Color aOldLineColor = pBox->GetLineColor();
@@ -3011,10 +3011,10 @@ static void ImplDrawMoreIndicator( ToolBox *pBox, const Rectangle& rRect, BOOL b
pBox->SetLineColor( aOldLineColor );
}
-static void ImplDrawDropdownArrow( ToolBox *pBox, const Rectangle& rDropDownRect, BOOL bSetColor, BOOL bRotate )
+static void ImplDrawDropdownArrow( ToolBox *pBox, const Rectangle& rDropDownRect, sal_Bool bSetColor, sal_Bool bRotate )
{
- BOOL bLineColor = pBox->IsLineColor();
- BOOL bFillColor = pBox->IsFillColor();
+ sal_Bool bLineColor = pBox->IsLineColor();
+ sal_Bool bFillColor = pBox->IsFillColor();
Color aOldFillColor = pBox->GetFillColor();
Color aOldLineColor = pBox->GetLineColor();
pBox->SetLineColor();
@@ -3064,8 +3064,8 @@ static void ImplDrawDropdownArrow( ToolBox *pBox, const Rectangle& rDropDownRect
pBox->SetLineColor( );
}
-void ToolBox::ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, BOOL bBlack, BOOL bColTransform,
- BOOL bLeft, BOOL bTop, long nSize )
+void ToolBox::ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, sal_Bool bBlack, sal_Bool bColTransform,
+ sal_Bool bLeft, sal_Bool bTop, long nSize )
{
Color aOldFillColor = pBox->GetFillColor();
WindowAlign eAlign = pBox->meAlign;
@@ -3160,7 +3160,7 @@ void ToolBox::ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, BOOL bBlack, B
}
void ToolBox::SetToolArrowClipregion( ToolBox* pBox, long nX, long nY,
- BOOL bLeft, BOOL bTop, long nSize )
+ sal_Bool bLeft, sal_Bool bTop, long nSize )
{
WindowAlign eAlign = pBox->meAlign;
long nHalfSize;
@@ -3215,7 +3215,7 @@ void ToolBox::SetToolArrowClipregion( ToolBox* pBox, long nX, long nY,
// -----------------------------------------------------------------------
-void ToolBox::ImplDrawMenubutton( ToolBox *pThis, BOOL bHighlight )
+void ToolBox::ImplDrawMenubutton( ToolBox *pThis, sal_Bool bHighlight )
{
if( !pThis->mpData->maMenubuttonItem.maRect.IsEmpty() )
{
@@ -3226,11 +3226,11 @@ void ToolBox::ImplDrawMenubutton( ToolBox *pThis, BOOL bHighlight )
// execute pending paint requests
ImplCheckUpdate( pThis );
- BOOL bFillColor = pThis->IsFillColor();
- BOOL bLineColor = pThis->IsLineColor();
+ sal_Bool bFillColor = pThis->IsFillColor();
+ sal_Bool bLineColor = pThis->IsLineColor();
Color aOldFillCol = pThis->GetFillColor();
Color aOldLineCol = pThis->GetLineColor();
- BOOL bNativeButtons = pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON );
+ sal_Bool bNativeButtons = pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON );
Rectangle aInnerRect( pThis->mpData->maMenubuttonItem.maRect );
if( pThis->mpData->mnMenuButtonWidth > TB_MENUBUTTON_SIZE )
@@ -3270,9 +3270,9 @@ void ToolBox::ImplDrawMenubutton( ToolBox *pThis, BOOL bHighlight )
if( bHighlight )
{
if( bNativeButtons )
- ImplDrawButton( pThis, pThis->mpData->maMenubuttonItem.maRect, 2, FALSE, TRUE, FALSE );
+ ImplDrawButton( pThis, pThis->mpData->maMenubuttonItem.maRect, 2, sal_False, sal_True, sal_False );
else
- pThis->DrawSelectionBackground( aInnerRect, 2, FALSE, FALSE, FALSE );
+ pThis->DrawSelectionBackground( aInnerRect, 2, sal_False, sal_False, sal_False );
}
else
{
@@ -3294,7 +3294,7 @@ void ToolBox::ImplDrawMenubutton( ToolBox *pThis, BOOL bHighlight )
aRect.Left() = aRect.Right() - aRect.getWidth()/3;
if( pThis->mpData->maMenuType & TOOLBOX_MENUTYPE_CUSTOMIZE )
- ImplDrawDropdownArrow( pThis, aRect, TRUE, !pThis->mbHorz );
+ ImplDrawDropdownArrow( pThis, aRect, sal_True, !pThis->mbHorz );
if( pThis->ImplHasClippedItems() )
{
@@ -3304,7 +3304,7 @@ void ToolBox::ImplDrawMenubutton( ToolBox *pThis, BOOL bHighlight )
else
aRect.Right() = aRect.Left() + aRect.getWidth()/3;
- ImplDrawMoreIndicator( pThis, aRect, TRUE, !pThis->mbHorz );
+ ImplDrawMoreIndicator( pThis, aRect, sal_True, !pThis->mbHorz );
}
// store highlight state
@@ -3324,30 +3324,30 @@ void ToolBox::ImplDrawMenubutton( ToolBox *pThis, BOOL bHighlight )
// -----------------------------------------------------------------------
-void ToolBox::ImplDrawSpin( BOOL bUpperIn, BOOL bLowerIn )
+void ToolBox::ImplDrawSpin( sal_Bool bUpperIn, sal_Bool bLowerIn )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- BOOL bTmpUpper;
- BOOL bTmpLower;
+ sal_Bool bTmpUpper;
+ sal_Bool bTmpLower;
if ( maUpperRect.IsEmpty() || maLowerRect.IsEmpty() )
return;
if ( mnCurLine > 1 )
- bTmpUpper = TRUE;
+ bTmpUpper = sal_True;
else
- bTmpUpper = FALSE;
+ bTmpUpper = sal_False;
if ( mnCurLine+mnVisLines-1 < mnCurLines )
- bTmpLower = TRUE;
+ bTmpLower = sal_True;
else
- bTmpLower = FALSE;
+ bTmpLower = sal_False;
if ( !IsEnabled() )
{
- bTmpUpper = FALSE;
- bTmpLower = FALSE;
+ bTmpUpper = sal_False;
+ bTmpLower = sal_False;
}
ImplDrawSpinButton( this, maUpperRect, maLowerRect,
@@ -3356,7 +3356,7 @@ void ToolBox::ImplDrawSpin( BOOL bUpperIn, BOOL bLowerIn )
// -----------------------------------------------------------------------
-void ToolBox::ImplDrawNext( BOOL bIn )
+void ToolBox::ImplDrawNext( sal_Bool bIn )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -3368,7 +3368,7 @@ void ToolBox::ImplDrawNext( BOOL bIn )
// Button malen
long nX = SMALLBUTTON_OFF_NORMAL_X;
long nY = SMALLBUTTON_OFF_NORMAL_Y;
- USHORT nStyle = 0;
+ sal_uInt16 nStyle = 0;
if ( bIn == 1 )
{
nStyle |= BUTTON_DRAW_PRESSED;
@@ -3378,17 +3378,17 @@ void ToolBox::ImplDrawNext( BOOL bIn )
aDecoView.DrawButton( maNextToolRect, nStyle );
// Inhalt ausgeben
- BOOL bLeft = FALSE;
- BOOL bTop = FALSE;
+ sal_Bool bLeft = sal_False;
+ sal_Bool bTop = sal_False;
if ( mbHorz )
{
- bLeft = TRUE;
+ bLeft = sal_True;
nX += (maNextToolRect.GetWidth()-6)/2-4;
nY += (maNextToolRect.GetHeight()-6)/2-6;
}
else
{
- bTop = TRUE;
+ bTop = sal_True;
nY += (maNextToolRect.GetHeight()-6)/2-4;
nX += (maNextToolRect.GetWidth()-6)/2-6;
}
@@ -3397,14 +3397,14 @@ void ToolBox::ImplDrawNext( BOOL bIn )
nY += maNextToolRect.Top();
SetLineColor();
SetFillColor( COL_LIGHTBLUE );
- ImplDrawToolArrow( this, nX, nY, TRUE, FALSE, bLeft, bTop, 10 );
+ ImplDrawToolArrow( this, nX, nY, sal_True, sal_False, bLeft, bTop, 10 );
}
// -----------------------------------------------------------------------
-void ToolBox::ImplDrawSeparator( USHORT nPos, Rectangle rRect )
+void ToolBox::ImplDrawSeparator( sal_uInt16 nPos, Rectangle rRect )
{
- BOOL bNativeOk = FALSE;
+ bool bNativeOk = false;
ImplToolItem* pItem = &mpData->m_aItems[nPos];
if( IsNativeControlSupported( CTRL_TOOLBAR, PART_SEPARATOR ) )
@@ -3450,12 +3450,12 @@ void ToolBox::ImplDrawSeparator( USHORT nPos, Rectangle rRect )
// -----------------------------------------------------------------------
-static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, USHORT highlight, BOOL bChecked, BOOL bEnabled, BOOL bIsWindow )
+static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bEnabled, sal_Bool bIsWindow )
{
// draws toolbar button background either native or using a coloured selection
- // if bIsWindow is TRUE, the corresponding item is a control and only a selection border will be drawn
+ // if bIsWindow is sal_True, the corresponding item is a control and only a selection border will be drawn
- BOOL bNativeOk = FALSE;
+ sal_Bool bNativeOk = sal_False;
if( !bIsWindow && pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) )
{
ImplControlValue aControlValue;
@@ -3473,10 +3473,10 @@ static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, USHORT highl
}
if( !bNativeOk )
- pThis->DrawSelectionBackground( rRect, bIsWindow ? 3 : highlight, bChecked, TRUE, bIsWindow, 2, NULL, NULL );
+ pThis->DrawSelectionBackground( rRect, bIsWindow ? 3 : highlight, bChecked, sal_True, bIsWindow, 2, NULL, NULL );
}
-void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLayout )
+void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPaint, sal_Bool bLayout )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -3494,6 +3494,8 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
MetricVector* pVector = bLayout ? &mpData->m_pLayoutData->m_aUnicodeBoundRects : NULL;
String* pDisplayText = bLayout ? &mpData->m_pLayoutData->m_aDisplayText : NULL;
+ bHighlight = bHighlight && pItem->mbEnabled;
+
// Falls Rechteck ausserhalb des sichbaren Bereichs liegt
if ( pItem->maRect.IsEmpty() )
return;
@@ -3501,13 +3503,13 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
// no gradient background for items that have a popup open
- BOOL bHasOpenPopup = (mpFloatWin != NULL) && (mnDownItemId==pItem->mnId);
+ sal_Bool bHasOpenPopup = (mpFloatWin != NULL) && (mnDownItemId==pItem->mnId);
- BOOL bHighContrastWhite = FALSE;
+ sal_Bool bHighContrastWhite = sal_False;
// check the face color as highcontrast indicator
// because the toolbox itself might have a gradient
if( rStyleSettings.GetFaceColor() == Color( COL_WHITE ) )
- bHighContrastWhite = TRUE;
+ bHighContrastWhite = sal_True;
// Compute buttons area.
Size aBtnSize = pItem->maRect.GetSize();
@@ -3534,7 +3536,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
long nImageOffY = 0;
long nTextOffX = 0;
long nTextOffY = 0;
- USHORT nStyle = 0;
+ sal_uInt16 nStyle = 0;
// draw separators in flat style only
if ( !bLayout &&
@@ -3577,18 +3579,18 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
Size aSize( GetCtrlTextWidth( pItem->maText ), GetTextHeight() );
Point aPos( pItem->maRect.Left()+2, pItem->maRect.Top() );
aPos.Y() += (pItem->maRect.GetHeight()-aSize.Height())/2;
- BOOL bClip;
+ sal_Bool bClip;
if ( (aSize.Width() > pItem->maRect.GetWidth()-2) ||
(aSize.Height() > pItem->maRect.GetHeight()-2) )
{
- bClip = TRUE;
+ bClip = sal_True;
Rectangle aTempRect( pItem->maRect.Left()+1, pItem->maRect.Top()+1,
pItem->maRect.Right()-1, pItem->maRect.Bottom()-1 );
Region aTempRegion( aTempRect );
SetClipRegion( aTempRegion );
}
else
- bClip = FALSE;
+ bClip = sal_False;
if( bLayout )
{
mpData->m_pLayoutData->m_aLineIndices.push_back( mpData->m_pLayoutData->m_aDisplayText.Len() );
@@ -3656,8 +3658,8 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
nOffY += pItem->maRect.Top();
// determine what has to be drawn on the button: image, text or both
- BOOL bImage;
- BOOL bText;
+ sal_Bool bImage;
+ sal_Bool bText;
ButtonType tmpButtonType = determineButtonType( pItem, meButtonType ); // default to toolbox setting
pItem->DetermineButtonDrawStyle( tmpButtonType, bImage, bText );
@@ -3676,7 +3678,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
if ( bImage && ! bLayout )
{
const Image* pImage;
- if ( bHighlight && (!(pItem->maHighImage)) == FALSE )
+ if ( bHighlight && (!(pItem->maHighImage)) == sal_False )
pImage = &(pItem->maHighImage);
else
pImage = &(pItem->maImage);
@@ -3684,7 +3686,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
aImageSize = pImage->GetSizePixel();
// determine drawing flags
- USHORT nImageStyle = 0;
+ sal_uInt16 nImageStyle = 0;
if ( !pItem->mbEnabled || !IsEnabled() )
nImageStyle |= IMAGE_DRAW_DISABLE;
@@ -3715,7 +3717,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
if( bHasOpenPopup )
ImplDrawFloatwinBorder( pItem );
else
- ImplDrawButton( this, aButtonRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), pItem->mbShowWindow ? TRUE : FALSE );
+ ImplDrawButton( this, aButtonRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), pItem->mbShowWindow ? sal_True : sal_False );
if( bHighlight )
{
@@ -3727,7 +3729,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
}
// draw the text
- BOOL bRotate = FALSE;
+ sal_Bool bRotate = sal_False;
if ( bText )
{
nTextOffX = nOffX;
@@ -3738,7 +3740,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
if( pItem->mbVisibleText && !ImplIsFloatingMode() &&
((meAlign == WINDOWALIGN_LEFT) || (meAlign == WINDOWALIGN_RIGHT)) )
{
- bRotate = TRUE;
+ bRotate = sal_True;
Font aRotateFont = aOldFont;
/*
@@ -3781,10 +3783,10 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
if( bHasOpenPopup )
ImplDrawFloatwinBorder( pItem );
else
- ImplDrawButton( this, pItem->maRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), pItem->mbShowWindow ? TRUE : FALSE );
+ ImplDrawButton( this, pItem->maRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), pItem->mbShowWindow ? sal_True : sal_False );
}
- USHORT nTextStyle = 0;
+ sal_uInt16 nTextStyle = 0;
if ( !pItem->mbEnabled )
nTextStyle |= TEXT_DRAW_DISABLE;
if( bLayout )
@@ -3806,10 +3808,10 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
if ( pItem->mnBits & TIB_DROPDOWN )
{
Rectangle aDropDownRect( pItem->GetDropDownRect( mbHorz ) );
- BOOL bSetColor = TRUE;
+ sal_Bool bSetColor = sal_True;
if ( !pItem->mbEnabled || !IsEnabled() )
{
- bSetColor = FALSE;
+ bSetColor = sal_False;
SetFillColor( rStyleSettings.GetShadowColor() );
}
@@ -3823,7 +3825,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
if( bHasOpenPopup )
ImplDrawFloatwinBorder( pItem );
else
- ImplDrawButton( this, aDropDownRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), FALSE );
+ ImplDrawButton( this, aDropDownRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), sal_False );
}
}
ImplDrawDropdownArrow( this, aDropDownRect, bSetColor, bRotate );
@@ -3838,7 +3840,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
void ToolBox::ImplStartCustomizeMode()
{
- mbCustomizeMode = TRUE;
+ mbCustomizeMode = sal_True;
mpData->ImplClearLayoutData();
@@ -3857,7 +3859,7 @@ void ToolBox::ImplStartCustomizeMode()
}
}
-void ToolBox::SetCustomizeMode( BOOL bSet )
+void ToolBox::SetCustomizeMode( sal_Bool bSet )
{
if ( bSet )
ImplStartCustomizeMode();
@@ -3869,7 +3871,7 @@ void ToolBox::SetCustomizeMode( BOOL bSet )
void ToolBox::ImplEndCustomizeMode()
{
- mbCustomizeMode = FALSE;
+ mbCustomizeMode = sal_False;
mpData->ImplClearLayoutData();
@@ -3925,7 +3927,7 @@ void ToolBox::ImplDrawFloatwinBorder( ImplToolItem* pItem )
}
}
-void ToolBox::ImplFloatControl( BOOL bStart, FloatingWindow* pFloatWindow )
+void ToolBox::ImplFloatControl( sal_Bool bStart, FloatingWindow* pFloatWindow )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -3934,9 +3936,9 @@ void ToolBox::ImplFloatControl( BOOL bStart, FloatingWindow* pFloatWindow )
mpFloatWin = pFloatWindow;
// redraw item, to trigger drawing of a special border
- ImplDrawItem( mnCurPos, TRUE );
+ ImplDrawItem( mnCurPos, sal_True );
- mbDrag = FALSE;
+ mbDrag = sal_False;
EndTracking();
ReleaseMouse();
}
@@ -3946,7 +3948,7 @@ void ToolBox::ImplFloatControl( BOOL bStart, FloatingWindow* pFloatWindow )
// if focus is still in this toolbox, then the floater was opened by keyboard
// draw current item with highlight and keep old state
- BOOL bWasKeyboardActivate = mpData->mbDropDownByKeyboard;
+ sal_Bool bWasKeyboardActivate = mpData->mbDropDownByKeyboard;
if ( mnCurPos != TOOLBOX_ITEM_NOTFOUND )
@@ -3966,15 +3968,15 @@ void ToolBox::ImplFloatControl( BOOL bStart, FloatingWindow* pFloatWindow )
// -----------------------------------------------------------------------
-void ToolBox::ShowLine( BOOL bNext )
+void ToolBox::ShowLine( sal_Bool bNext )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( mpData->mbPageScroll )
{
- USHORT delta = mnVisLines;
+ sal_uInt16 delta = mnVisLines;
if ( bNext )
{
mnCurLine = mnCurLine + delta;
@@ -4002,7 +4004,7 @@ void ToolBox::ShowLine( BOOL bNext )
// -----------------------------------------------------------------------
-BOOL ToolBox::ImplHandleMouseMove( const MouseEvent& rMEvt, BOOL bRepeat )
+sal_Bool ToolBox::ImplHandleMouseMove( const MouseEvent& rMEvt, sal_Bool bRepeat )
{
Point aMousePos = rMEvt.GetPosPixel();
@@ -4015,7 +4017,7 @@ BOOL ToolBox::ImplHandleMouseMove( const MouseEvent& rMEvt, BOOL bRepeat )
{
if ( !mnCurItemId )
{
- ImplDrawItem( mnCurPos, TRUE );
+ ImplDrawItem( mnCurPos, sal_True );
mnCurItemId = pItem->mnId;
Highlight();
}
@@ -4034,48 +4036,48 @@ BOOL ToolBox::ImplHandleMouseMove( const MouseEvent& rMEvt, BOOL bRepeat )
}
}
- return TRUE;
+ return sal_True;
}
if ( mbUpper )
{
- BOOL bNewIn = maUpperRect.IsInside( aMousePos );
+ sal_Bool bNewIn = maUpperRect.IsInside( aMousePos );
if ( bNewIn != mbIn )
{
mbIn = bNewIn;
- ImplDrawSpin( mbIn, FALSE );
+ ImplDrawSpin( mbIn, sal_False );
}
- return TRUE;
+ return sal_True;
}
if ( mbLower )
{
- BOOL bNewIn = maLowerRect.IsInside( aMousePos );
+ sal_Bool bNewIn = maLowerRect.IsInside( aMousePos );
if ( bNewIn != mbIn )
{
mbIn = bNewIn;
- ImplDrawSpin( FALSE, mbIn );
+ ImplDrawSpin( sal_False, mbIn );
}
- return TRUE;
+ return sal_True;
}
if ( mbNextTool )
{
- BOOL bNewIn = maNextToolRect.IsInside( aMousePos );
+ sal_Bool bNewIn = maNextToolRect.IsInside( aMousePos );
if ( bNewIn != mbIn )
{
mbIn = bNewIn;
ImplDrawNext( mbIn );
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, BOOL bCancel )
+sal_Bool ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, sal_Bool bCancel )
{
ImplDisableFlatButtons();
@@ -4099,12 +4101,12 @@ BOOL ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, BOOL bCancel )
Deactivate();
if ( mbDrag )
- mbDrag = FALSE;
+ mbDrag = sal_False;
else
{
- mbSelection = FALSE;
+ mbSelection = sal_False;
if ( mnCurPos == TOOLBOX_ITEM_NOTFOUND )
- return TRUE;
+ return sal_True;
}
// Wurde Maus ueber dem Item losgelassen
@@ -4142,7 +4144,7 @@ BOOL ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, BOOL bCancel )
ImplAddDel( &aDelData );
Select();
if ( aDelData.IsDelete() )
- return TRUE;
+ return sal_True;
ImplRemoveDel( &aDelData );
}
}
@@ -4154,11 +4156,11 @@ BOOL ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, BOOL bCancel )
// Items nicht geloescht, im Select-Handler
if ( mnCurItemId )
{
- BOOL bHighlight;
+ sal_Bool bHighlight;
if ( (mnCurItemId == mnHighItemId) && (mnOutStyle & TOOLBOX_STYLE_FLAT) )
bHighlight = 2;
else
- bHighlight = FALSE;
+ bHighlight = sal_False;
// Get current pos for the case that items are inserted/removed
// in the toolBox
mnCurPos = GetItemPos( mnCurItemId );
@@ -4176,28 +4178,28 @@ BOOL ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, BOOL bCancel )
mnDownItemId = 0;
mnMouseClicks = 0;
mnMouseModifier = 0;
- return TRUE;
+ return sal_True;
}
else if ( mbUpper || mbLower )
{
if ( mbIn )
ShowLine( !mbUpper );
- mbUpper = FALSE;
- mbLower = FALSE;
- mbIn = FALSE;
- ImplDrawSpin( FALSE, FALSE );
- return TRUE;
+ mbUpper = sal_False;
+ mbLower = sal_False;
+ mbIn = sal_False;
+ ImplDrawSpin( sal_False, sal_False );
+ return sal_True;
}
else if ( mbNextTool )
{
- mbNextTool = FALSE;
- mbIn = FALSE;
- ImplDrawNext( FALSE );
+ mbNextTool = sal_False;
+ mbIn = sal_False;
+ ImplDrawNext( sal_False );
NextToolBox();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -4219,10 +4221,10 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
// only highlight when the focus is not inside a child window of a toolbox
// eg, in a edit control
// and do not hilight when focus is in a different toolbox
- BOOL bDrawHotSpot = TRUE;
+ sal_Bool bDrawHotSpot = sal_True;
Window *pWin = Application::GetFocusWindow();
if( pWin && pWin->ImplGetWindowImpl()->mbToolBox && pWin != this )
- bDrawHotSpot = FALSE;
+ bDrawHotSpot = sal_False;
/*
else
if( pWin && !pWin->ImplGetWindowImpl()->mbToolBox )
@@ -4231,7 +4233,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
pWin = pWin->GetParent();
if( pWin && pWin->ImplGetWindowImpl()->mbToolBox )
{
- bDrawHotSpot = FALSE;
+ bDrawHotSpot = sal_False;
break;
}
}
@@ -4239,8 +4241,8 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
if ( mbSelection && bDrawHotSpot )
{
- USHORT i = 0;
- USHORT nNewPos = TOOLBOX_ITEM_NOTFOUND;
+ sal_uInt16 i = 0;
+ sal_uInt16 nNewPos = TOOLBOX_ITEM_NOTFOUND;
// Item suchen, das geklickt wurde
std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin();
@@ -4283,7 +4285,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
if ( mnCurPos != TOOLBOX_ITEM_NOTFOUND )
{
mnCurItemId = mnHighItemId = it->mnId;
- ImplDrawItem( mnCurPos, 2 /*TRUE*/ ); // always use shadow effect (2)
+ ImplDrawItem( mnCurPos, 2 /*sal_True*/ ); // always use shadow effect (2)
}
else
mnCurItemId = mnHighItemId = 0;
@@ -4311,7 +4313,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
{
if ( rMEvt.GetMode() & MOUSE_SIMPLEMOVE )
{
- USHORT nLinePtr = ImplTestLineSize( this, rMEvt.GetPosPixel() );
+ sal_uInt16 nLinePtr = ImplTestLineSize( this, rMEvt.GetPosPixel() );
if ( nLinePtr & DOCK_LINEHSIZE )
{
if ( meAlign == WINDOWALIGN_LEFT )
@@ -4354,7 +4356,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
if ( bDrawHotSpot && ( ((eStyle == POINTER_ARROW) && (mnOutStyle & TOOLBOX_STYLE_HANDPOINTER)) ||
(mnOutStyle & TOOLBOX_STYLE_FLAT) || !mnOutStyle ) )
{
- BOOL bClearHigh = TRUE;
+ sal_Bool bClearHigh = sal_True;
if ( !rMEvt.IsLeaveWindow() && (mnCurPos == TOOLBOX_ITEM_NOTFOUND) )
{
std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin();
@@ -4366,21 +4368,21 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
{
if ( !mnOutStyle || (mnOutStyle & TOOLBOX_STYLE_FLAT) )
{
- bClearHigh = FALSE;
+ bClearHigh = sal_False;
if ( mnHighItemId != it->mnId )
{
- USHORT nTempPos = sal::static_int_cast<USHORT>(it - mpData->m_aItems.begin());
+ sal_uInt16 nTempPos = sal::static_int_cast<sal_uInt16>(it - mpData->m_aItems.begin());
if ( mnHighItemId )
{
ImplHideFocus();
- USHORT nPos = GetItemPos( mnHighItemId );
+ sal_uInt16 nPos = GetItemPos( mnHighItemId );
ImplDrawItem( nPos );
ImplCallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHTOFF, reinterpret_cast< void* >( nPos ) );
}
if ( mpData->mbMenubuttonSelected )
{
// remove highlight from menubutton
- ImplDrawMenubutton( this, FALSE );
+ ImplDrawMenubutton( this, sal_False );
}
mnHighItemId = it->mnId;
ImplDrawItem( nTempPos, 2 );
@@ -4399,21 +4401,21 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
}
// only clear highlight when focus is not in toolbar
- BOOL bMenuButtonHit = mpData->maMenubuttonItem.maRect.IsInside( aMousePos );
+ sal_Bool bMenuButtonHit = mpData->maMenubuttonItem.maRect.IsInside( aMousePos );
if ( bClearHigh || bMenuButtonHit )
{
if ( !bMenuButtonHit && mpData->mbMenubuttonSelected )
{
// remove highlight from menubutton
- ImplDrawMenubutton( this, FALSE );
+ ImplDrawMenubutton( this, sal_False );
}
if( mnHighItemId )
{
- USHORT nClearPos = GetItemPos( mnHighItemId );
+ sal_uInt16 nClearPos = GetItemPos( mnHighItemId );
if ( nClearPos != TOOLBOX_ITEM_NOTFOUND )
{
- ImplDrawItem( nClearPos, (nClearPos == mnCurPos) ? TRUE : FALSE );
+ ImplDrawItem( nClearPos, (nClearPos == mnCurPos) ? sal_True : sal_False );
if( nClearPos != mnCurPos )
ImplCallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHTOFF, reinterpret_cast< void* >( nClearPos ) );
}
@@ -4423,7 +4425,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
if( bMenuButtonHit )
{
- ImplDrawMenubutton( this, TRUE );
+ ImplDrawMenubutton( this, sal_True );
}
}
}
@@ -4458,8 +4460,8 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
}
Point aMousePos = rMEvt.GetPosPixel();
- USHORT i = 0;
- USHORT nNewPos = TOOLBOX_ITEM_NOTFOUND;
+ sal_uInt16 i = 0;
+ sal_uInt16 nNewPos = TOOLBOX_ITEM_NOTFOUND;
// Item suchen, das geklickt wurde
std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin();
@@ -4494,12 +4496,12 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
Rectangle aItemRect = GetItemRect( it->mnId );
mnConfigItem = it->mnId;
- BOOL bResizeItem;
+ sal_Bool bResizeItem;
if ( mbCustomizeMode && it->mbShowWindow &&
(it->maRect.Right()-TB_RESIZE_OFFSET <= aMousePos.X()) )
- bResizeItem = TRUE;
+ bResizeItem = sal_True;
else
- bResizeItem = FALSE;
+ bResizeItem = sal_False;
pMgr->StartDragging( this, aMousePos, aItemRect, 0, bResizeItem );
return;
}
@@ -4513,7 +4515,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
// Aktuelle Daten setzen
- USHORT nTrackFlags = 0;
+ sal_uInt16 nTrackFlags = 0;
mnCurPos = i;
mnCurItemId = it->mnId;
mnDownItemId = mnCurItemId;
@@ -4525,13 +4527,13 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
if ( mbSelection )
{
- ImplDrawItem( mnCurPos, TRUE );
+ ImplDrawItem( mnCurPos, sal_True );
Highlight();
}
else
{
// Hier schon bDrag setzen, da in EndSelection ausgewertet wird
- mbDrag = TRUE;
+ mbDrag = sal_True;
// Bei Doppelklick nur den Handler rufen, aber bevor der
// Button gehiltet wird, da evt. in diesem Handler der
@@ -4542,7 +4544,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
if ( mbDrag )
{
- ImplDrawItem( mnCurPos, TRUE );
+ ImplDrawItem( mnCurPos, sal_True );
Highlight();
}
@@ -4554,7 +4556,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
// dropdownonly always triggers the dropdown handler, over the whole button area
// the drop down arrow should not trigger the item action
- mpData->mbDropDownByKeyboard = FALSE;
+ mpData->mbDropDownByKeyboard = sal_False;
GetDropdownClickHdl().Call( this );
// do not reset data if the dropdown handler opened a floating window
@@ -4563,7 +4565,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
{
// no floater was opened
Deactivate();
- ImplDrawItem( mnCurPos, FALSE );
+ ImplDrawItem( mnCurPos, sal_False );
mnCurPos = TOOLBOX_ITEM_NOTFOUND;
mnCurItemId = 0;
@@ -4613,9 +4615,9 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
if ( mnCurLine > 1 )
{
StartTracking();
- mbUpper = TRUE;
- mbIn = TRUE;
- ImplDrawSpin( TRUE, FALSE );
+ mbUpper = sal_True;
+ mbIn = sal_True;
+ ImplDrawSpin( sal_True, sal_False );
}
return;
}
@@ -4624,25 +4626,25 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
if ( mnCurLine+mnVisLines-1 < mnCurLines )
{
StartTracking();
- mbLower = TRUE;
- mbIn = TRUE;
- ImplDrawSpin( FALSE, TRUE );
+ mbLower = sal_True;
+ mbIn = sal_True;
+ ImplDrawSpin( sal_False, sal_True );
}
return;
}
if ( maNextToolRect.IsInside( aMousePos ) )
{
StartTracking();
- mbNextTool = TRUE;
- mbIn = TRUE;
- ImplDrawNext( TRUE );
+ mbNextTool = sal_True;
+ mbIn = sal_True;
+ ImplDrawNext( sal_True );
return;
}
// Linesizing testen
if ( (mnWinStyle & TB_WBLINESIZING) == TB_WBLINESIZING )
{
- USHORT nLineMode = ImplTestLineSize( this, aMousePos );
+ sal_uInt16 nLineMode = ImplTestLineSize( this, aMousePos );
if ( nLineMode )
{
ImplTBDragMgr* pMgr = ImplGetTBDragMgr();
@@ -4657,7 +4659,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
// Dragging starten
pMgr->StartDragging( this, aMousePos, Rectangle( aPos, aSize ),
- nLineMode, FALSE );
+ nLineMode, sal_False );
return;
}
}
@@ -4686,7 +4688,7 @@ void ToolBox::MouseButtonUp( const MouseEvent& rMEvt )
pMgr->EndDragging();
return;
}
- mbCommandDrag = FALSE;
+ mbCommandDrag = sal_False;
DockingWindow::MouseButtonUp( rMEvt );
}
@@ -4717,9 +4719,9 @@ void ToolBox::Paint( const Rectangle& rPaintRect )
if( mpData->mbIsPaintLocked )
return;
if ( rPaintRect == Rectangle( 0, 0, mnDX-1, mnDY-1 ) )
- mbFullPaint = TRUE;
+ mbFullPaint = sal_True;
ImplFormat();
- mbFullPaint = FALSE;
+ mbFullPaint = sal_False;
ImplDrawBackground( this, rPaintRect );
@@ -4736,28 +4738,28 @@ void ToolBox::Paint( const Rectangle& rPaintRect )
if ( mnWinStyle & WB_SCROLL )
{
if ( mnCurLines > mnLines )
- ImplDrawSpin( FALSE, FALSE );
+ ImplDrawSpin( sal_False, sal_False );
}
// NextButton zeichnen
- ImplDrawNext( FALSE );
+ ImplDrawNext( sal_False );
// Buttons zeichnen
- USHORT nHighPos;
+ sal_uInt16 nHighPos;
if ( mnHighItemId )
nHighPos = GetItemPos( mnHighItemId );
else
nHighPos = TOOLBOX_ITEM_NOTFOUND;
- USHORT nCount = (USHORT)mpData->m_aItems.size();
- for( USHORT i = 0; i < nCount; i++ )
+ sal_uInt16 nCount = (sal_uInt16)mpData->m_aItems.size();
+ for( sal_uInt16 i = 0; i < nCount; i++ )
{
ImplToolItem* pItem = &mpData->m_aItems[i];
// Nur malen, wenn Rechteck im PaintRectangle liegt
if ( !pItem->maRect.IsEmpty() && rPaintRect.IsOver( pItem->maRect ) )
{
- BOOL bHighlight = FALSE;
+ sal_Bool bHighlight = sal_False;
if ( i == mnCurPos )
bHighlight = 1;
else if ( i == nHighPos )
@@ -4800,9 +4802,9 @@ void ToolBox::Resize()
{
if ( !mbFormat )
{
- mbFormat = TRUE;
+ mbFormat = sal_True;
if( IsReallyVisible() )
- ImplFormat( TRUE );
+ ImplFormat( sal_True );
}
}
@@ -4834,21 +4836,21 @@ void ToolBox::Resize()
}
// -----------------------------------------------------------------------
-const XubString& ToolBox::ImplGetHelpText( USHORT nItemId ) const
+const XubString& ToolBox::ImplGetHelpText( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
{
- if ( !pItem->maHelpText.Len() && ( pItem->mnHelpId || pItem->maCommandStr.Len() ))
+ if ( !pItem->maHelpText.Len() && ( pItem->maHelpId.getLength() || pItem->maCommandStr.Len() ))
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
if ( pItem->maCommandStr.Len() )
pItem->maHelpText = pHelp->GetHelpText( pItem->maCommandStr, this );
- if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
- pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
+ if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
+ pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
}
@@ -4862,7 +4864,7 @@ const XubString& ToolBox::ImplGetHelpText( USHORT nItemId ) const
void ToolBox::RequestHelp( const HelpEvent& rHEvt )
{
- USHORT nItemId;
+ sal_uInt16 nItemId;
Point aHelpPos;
if( !rHEvt.KeyboardActivated() )
@@ -4914,9 +4916,9 @@ void ToolBox::RequestHelp( const HelpEvent& rHEvt )
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
String aCommand = GetItemCommand( nItemId );
- ULONG nHelpId = GetHelpId( nItemId );
+ rtl::OString aHelpId( GetHelpId( nItemId ) );
- if ( aCommand.Len() || nHelpId )
+ if ( aCommand.Len() || aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
@@ -4924,8 +4926,8 @@ void ToolBox::RequestHelp( const HelpEvent& rHEvt )
{
if ( aCommand.Len() )
pHelp->Start( aCommand, this );
- else if ( nHelpId )
- pHelp->Start( nHelpId, this );
+ else if ( aHelpId.getLength() )
+ pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return;
}
@@ -4963,20 +4965,20 @@ long ToolBox::Notify( NotifyEvent& rNEvt )
{
KeyEvent aKEvt = *rNEvt.GetKeyEvent();
KeyCode aKeyCode = aKEvt.GetKeyCode();
- USHORT nKeyCode = aKeyCode.GetCode();
+ sal_uInt16 nKeyCode = aKeyCode.GetCode();
switch( nKeyCode )
{
case KEY_TAB:
{
// internal TAB cycling only if parent is not a dialog or if we are the ony child
// otherwise the dialog control will take over
- BOOL bNoTabCycling = ( ( ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL) ) == WB_DIALOGCONTROL &&
+ sal_Bool bNoTabCycling = ( ( ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL) ) == WB_DIALOGCONTROL &&
ImplGetParent()->GetChildCount() != 1 );
if( bNoTabCycling && ! (GetStyle() & WB_FORCETABCYCLE) )
return DockingWindow::Notify( rNEvt );
- else if( ImplChangeHighlightUpDn( aKeyCode.IsShift() ? TRUE : FALSE , bNoTabCycling ) )
- return FALSE;
+ else if( ImplChangeHighlightUpDn( aKeyCode.IsShift() ? sal_True : sal_False , bNoTabCycling ) )
+ return sal_False;
else
return DockingWindow::Notify( rNEvt );
}
@@ -4997,9 +4999,9 @@ long ToolBox::Notify( NotifyEvent& rNEvt )
}
else if( (GetGetFocusFlags() & (GETFOCUS_BACKWARD|GETFOCUS_TAB) ) == (GETFOCUS_BACKWARD|GETFOCUS_TAB))
// Shift-TAB was pressed in the parent
- ImplChangeHighlightUpDn( FALSE );
+ ImplChangeHighlightUpDn( sal_False );
else
- ImplChangeHighlightUpDn( TRUE );
+ ImplChangeHighlightUpDn( sal_True );
mnLastFocusItemId = 0;
@@ -5064,7 +5066,7 @@ void ToolBox::Command( const CommandEvent& rCEvt )
// dann mache nichts
if ( (it->meType == TOOLBOXITEM_BUTTON) &&
!it->mbShowWindow )
- mbCommandDrag = TRUE;
+ mbCommandDrag = sal_True;
break;
}
@@ -5088,10 +5090,10 @@ void ToolBox::Command( const CommandEvent& rCEvt )
if ( pData->GetMode() == COMMAND_WHEEL_SCROLL )
{
if ( (mnCurLine > 1) && (pData->GetDelta() > 0) )
- ShowLine( FALSE );
+ ShowLine( sal_False );
else if ( (mnCurLine+mnVisLines-1 < mnCurLines) && (pData->GetDelta() < 0) )
- ShowLine( TRUE );
- ImplDrawSpin( FALSE, FALSE );
+ ShowLine( sal_True );
+ ImplDrawSpin( sal_False, sal_False );
return;
}
}
@@ -5118,19 +5120,19 @@ void ToolBox::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- mbCalc = TRUE;
- mbFormat = TRUE;
- ImplInitSettings( TRUE, FALSE, FALSE );
+ mbCalc = sal_True;
+ mbFormat = sal_True;
+ 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 ); // font, foreground, background
+ ImplInitSettings( sal_False, sal_False, sal_True ); // font, foreground, background
Invalidate();
}
}
@@ -5147,16 +5149,16 @@ void ToolBox::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- mbCalc = TRUE;
- mbFormat = TRUE;
- ImplInitSettings( TRUE, TRUE, TRUE );
+ mbCalc = sal_True;
+ mbFormat = sal_True;
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
}
// -----------------------------------------------------------------------
-BOOL ToolBox::PrepareToggleFloatingMode()
+sal_Bool ToolBox::PrepareToggleFloatingMode()
{
return DockingWindow::PrepareToggleFloatingMode();
}
@@ -5167,27 +5169,27 @@ void ToolBox::ToggleFloatingMode()
{
DockingWindow::ToggleFloatingMode();
- BOOL mbOldHorz = mbHorz;
+ sal_Bool mbOldHorz = mbHorz;
if ( ImplIsFloatingMode() )
{
- mbHorz = TRUE;
+ mbHorz = sal_True;
meAlign = WINDOWALIGN_TOP;
- mbScroll = TRUE;
+ mbScroll = sal_True;
if( mbOldHorz != mbHorz )
- mbCalc = TRUE; // orientation was changed !
+ mbCalc = sal_True; // orientation was changed !
ImplSetMinMaxFloatSize( this );
SetOutputSizePixel( ImplCalcFloatSize( this, mnFloatLines ) );
}
else
{
- mbScroll = (mnWinStyle & WB_SCROLL) ? TRUE : FALSE;
+ mbScroll = (mnWinStyle & WB_SCROLL) ? sal_True : sal_False;
if ( (meAlign == WINDOWALIGN_TOP) || (meAlign == WINDOWALIGN_BOTTOM) )
- mbHorz = TRUE;
+ mbHorz = sal_True;
else
- mbHorz = FALSE;
+ mbHorz = sal_False;
// set focus back to document
ImplGetFrameWindow()->GetWindow( WINDOW_CLIENT )->GrabFocus();
@@ -5197,11 +5199,11 @@ void ToolBox::ToggleFloatingMode()
{
// if orientation changes, the toolbox has to be initialized again
// to update the direction of the gradient
- mbCalc = TRUE;
- ImplInitSettings( TRUE, TRUE, TRUE );
+ mbCalc = sal_True;
+ ImplInitSettings( sal_True, sal_True, sal_True );
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
ImplFormat();
}
@@ -5217,13 +5219,13 @@ void ToolBox::StartDocking()
// -----------------------------------------------------------------------
-BOOL ToolBox::Docking( const Point& rPos, Rectangle& rRect )
+sal_Bool ToolBox::Docking( const Point& rPos, Rectangle& rRect )
{
// Wenn Dragging, dann nicht machen, da vorher schon berechnet
if ( mbDragging )
- return FALSE;
+ return sal_False;
- BOOL bFloatMode = FALSE;
+ sal_Bool bFloatMode = sal_False;
DockingWindow::Docking( rPos, rRect );
@@ -5236,7 +5238,7 @@ BOOL ToolBox::Docking( const Point& rPos, Rectangle& rRect )
// to get a floating mode as result - switch to floating size
// so the calculation only depends on the position of the rectangle, not the current
// docking state of the window
- USHORT nTemp = 0;
+ sal_uInt16 nTemp = 0;
aDockingRect.SetSize( ImplCalcFloatSize( this, nTemp ) );
// in this mode docking is never done by keyboard, so it's OK to use the mouse position
@@ -5271,7 +5273,7 @@ BOOL ToolBox::Docking( const Point& rPos, Rectangle& rRect )
// FloatWindow werden
Rectangle aIntersect = aInRect.GetIntersection( aDockingRect );
if ( aIntersect == aDockingRect )
- bFloatMode = TRUE;
+ bFloatMode = sal_True;
else
{
// docking rectangle is in the "sensible area"
@@ -5325,14 +5327,14 @@ BOOL ToolBox::Docking( const Point& rPos, Rectangle& rRect )
}
}
else
- bFloatMode = TRUE;
+ bFloatMode = sal_True;
if ( bFloatMode )
{
meDockAlign = meAlign;
if ( !mbLastFloatMode )
{
- USHORT nTemp = 0;
+ sal_uInt16 nTemp = 0;
aDockingRect.SetSize( ImplCalcFloatSize( this, nTemp ) );
}
}
@@ -5345,7 +5347,7 @@ BOOL ToolBox::Docking( const Point& rPos, Rectangle& rRect )
// -----------------------------------------------------------------------
-void ToolBox::EndDocking( const Rectangle& rRect, BOOL bFloatMode )
+void ToolBox::EndDocking( const Rectangle& rRect, sal_Bool bFloatMode )
{
if ( !IsDockingCanceled() )
{
@@ -5362,8 +5364,8 @@ void ToolBox::EndDocking( const Rectangle& rRect, BOOL bFloatMode )
void ToolBox::Resizing( Size& rSize )
{
- USHORT nCalcLines;
- USHORT nTemp;
+ sal_uInt16 nCalcLines;
+ sal_uInt16 nTemp;
// Alle Floatinggroessen berechnen
ImplCalcFloatSizes( this );
@@ -5399,20 +5401,20 @@ void ToolBox::Resizing( Size& rSize )
// -----------------------------------------------------------------------
-Size ToolBox::CalcWindowSizePixel( USHORT nCalcLines ) const
+Size ToolBox::CalcWindowSizePixel( sal_uInt16 nCalcLines ) const
{
return ImplCalcSize( this, nCalcLines );
}
-Size ToolBox::CalcWindowSizePixel( USHORT nCalcLines, WindowAlign eAlign ) const
+Size ToolBox::CalcWindowSizePixel( sal_uInt16 nCalcLines, WindowAlign eAlign ) const
{
return ImplCalcSize( this, nCalcLines,
(eAlign == WINDOWALIGN_TOP || eAlign == WINDOWALIGN_BOTTOM) ? TB_CALCMODE_HORZ : TB_CALCMODE_VERT );
}
-USHORT ToolBox::ImplCountLineBreaks( const ToolBox *pThis )
+sal_uInt16 ToolBox::ImplCountLineBreaks( const ToolBox *pThis )
{
- USHORT nLines = 0;
+ sal_uInt16 nLines = 0;
std::vector< ImplToolItem >::const_iterator it = ((ToolBox*)pThis)->mpData->m_aItems.begin();
while ( it != ((ToolBox*)pThis)->mpData->m_aItems.end() )
@@ -5427,19 +5429,19 @@ USHORT ToolBox::ImplCountLineBreaks( const ToolBox *pThis )
Size ToolBox::CalcPopupWindowSizePixel() const
{
// count number of breaks and calc corresponding floating window size
- USHORT nLines = ImplCountLineBreaks( this );
+ sal_uInt16 nLines = ImplCountLineBreaks( this );
if( nLines )
++nLines; // add the first line
else
{
// no breaks found: use quadratic layout
- nLines = (USHORT) ceil( sqrt( (double) GetItemCount() ) );
+ nLines = (sal_uInt16) ceil( sqrt( (double) GetItemCount() ) );
}
- BOOL bPopup = mpData->mbAssumePopupMode;
+ sal_Bool bPopup = mpData->mbAssumePopupMode;
ToolBox *pThis = (ToolBox*) this;
- pThis->mpData->mbAssumePopupMode = TRUE;
+ pThis->mpData->mbAssumePopupMode = sal_True;
Size aSize = CalcFloatingWindowSizePixel( nLines );
@@ -5449,24 +5451,24 @@ Size ToolBox::CalcPopupWindowSizePixel() const
Size ToolBox::CalcFloatingWindowSizePixel() const
{
- USHORT nLines = ImplCountLineBreaks( this );
+ sal_uInt16 nLines = ImplCountLineBreaks( this );
++nLines; // add the first line
return CalcFloatingWindowSizePixel( nLines );
}
-Size ToolBox::CalcFloatingWindowSizePixel( USHORT nCalcLines ) const
+Size ToolBox::CalcFloatingWindowSizePixel( sal_uInt16 nCalcLines ) const
{
- BOOL bFloat = mpData->mbAssumeFloating;
- BOOL bDocking = mpData->mbAssumeDocked;
+ sal_Bool bFloat = mpData->mbAssumeFloating;
+ sal_Bool bDocking = mpData->mbAssumeDocked;
// simulate floating mode and force reformat before calculating
ToolBox *pThis = (ToolBox*) this;
- pThis->mpData->mbAssumeFloating = TRUE;
- pThis->mpData->mbAssumeDocked = FALSE;
+ pThis->mpData->mbAssumeFloating = sal_True;
+ pThis->mpData->mbAssumeDocked = sal_False;
Size aSize = ImplCalcFloatSize( (ToolBox*) this, nCalcLines );
- pThis->mbFormat = TRUE;
+ pThis->mbFormat = sal_True;
pThis->mpData->mbAssumeFloating = bFloat;
pThis->mpData->mbAssumeDocked = bDocking;
@@ -5518,7 +5520,7 @@ Size ToolBox::CalcMinimumWindowSizePixel() const
// -----------------------------------------------------------------------
-void ToolBox::EnableCustomize( BOOL bEnable )
+void ToolBox::EnableCustomize( sal_Bool bEnable )
{
if ( bEnable != mbCustomize )
{
@@ -5548,7 +5550,7 @@ void ToolBox::StartCustomize( const Rectangle& rRect, void* pData )
aMousePos = ScreenToOutputPixel( aPos );
Pointer aPtr;
SetPointer( aPtr );
- pMgr->StartDragging( this, aMousePos, aRect, 0, FALSE, pData );
+ pMgr->StartDragging( this, aMousePos, aRect, 0, sal_False, pData );
}
// -----------------------------------------------------------------------
@@ -5569,7 +5571,7 @@ void ToolBox::EndCustomizeMode()
// -----------------------------------------------------------------------
-BOOL ToolBox::IsCustomizeMode()
+sal_Bool ToolBox::IsCustomizeMode()
{
ImplTBDragMgr* pMgr = ImplGetTBDragMgr();
return pMgr->IsCustomizeMode();
@@ -5586,7 +5588,7 @@ void ToolBox::GetFocus()
void ToolBox::LoseFocus()
{
- ImplChangeHighlight( NULL, TRUE );
+ ImplChangeHighlight( NULL, sal_True );
DockingWindow::LoseFocus();
}
@@ -5594,10 +5596,10 @@ void ToolBox::LoseFocus()
// -----------------------------------------------------------------------
// performs the action associated with an item, ie simulates clicking the item
-void ToolBox::TriggerItem( USHORT nItemId, BOOL bShift, BOOL bCtrl )
+void ToolBox::TriggerItem( sal_uInt16 nItemId, sal_Bool bShift, sal_Bool bCtrl )
{
mnHighItemId = nItemId;
- USHORT nModifier = 0;
+ sal_uInt16 nModifier = 0;
if( bShift )
nModifier |= KEY_SHIFT;
if( bCtrl )
@@ -5609,24 +5611,24 @@ void ToolBox::TriggerItem( USHORT nItemId, BOOL bShift, BOOL bCtrl )
// -----------------------------------------------------------------------
// calls the button's action handler
-// returns TRUE if action was called
-BOOL ToolBox::ImplActivateItem( KeyCode aKeyCode )
+// returns sal_True if action was called
+sal_Bool ToolBox::ImplActivateItem( KeyCode aKeyCode )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if( mnHighItemId )
{
ImplToolItem *pToolItem = ImplGetItem( mnHighItemId );
// #107712#, activate can also be called for disabled entries
if( pToolItem && !pToolItem->mbEnabled )
- return TRUE;
+ return sal_True;
if( pToolItem && pToolItem->mpWindow && HasFocus() )
{
ImplHideFocus();
- mbChangingHighlight = TRUE; // avoid focus change due to loose focus
+ mbChangingHighlight = sal_True; // avoid focus change due to loose focus
pToolItem->mpWindow->ImplControlFocus( GETFOCUS_TAB );
- mbChangingHighlight = FALSE;
+ mbChangingHighlight = sal_False;
}
else
{
@@ -5648,7 +5650,7 @@ BOOL ToolBox::ImplActivateItem( KeyCode aKeyCode )
}
}
mnMouseModifier = aKeyCode.GetModifier();
- mbIsKeyEvent = TRUE;
+ mbIsKeyEvent = sal_True;
Activate();
Click();
@@ -5661,18 +5663,18 @@ BOOL ToolBox::ImplActivateItem( KeyCode aKeyCode )
ImplRemoveDel( &aDelData );
Deactivate();
- mbIsKeyEvent = FALSE;
+ mbIsKeyEvent = sal_False;
mnMouseModifier = 0;
}
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
// -----------------------------------------------------------------------
-BOOL ImplCloseLastPopup( Window *pParent )
+sal_Bool ImplCloseLastPopup( Window *pParent )
{
// close last popup toolbox (see also:
// ImplHandleMouseFloatMode(...) in winproc.cxx )
@@ -5684,23 +5686,23 @@ BOOL ImplCloseLastPopup( Window *pParent )
if( pLastLevelFloat && pLastLevelFloat != pParent )
{
pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
// opens a drop down toolbox item
-// returns TRUE if item was opened
-BOOL ToolBox::ImplOpenItem( KeyCode aKeyCode )
+// returns sal_True if item was opened
+sal_Bool ToolBox::ImplOpenItem( KeyCode aKeyCode )
{
- USHORT nCode = aKeyCode.GetCode();
- BOOL bRet = TRUE;
+ sal_uInt16 nCode = aKeyCode.GetCode();
+ sal_Bool bRet = sal_True;
// arrow keys should work only in the opposite direction of alignment (to not break cursor travelling)
if ( ((nCode == KEY_LEFT || nCode == KEY_RIGHT) && IsHorizontal())
|| ((nCode == KEY_UP || nCode == KEY_DOWN) && !IsHorizontal()) )
- return FALSE;
+ return sal_False;
if( IsMenuEnabled() && mpData->mbMenubuttonSelected )
{
@@ -5720,19 +5722,19 @@ BOOL ToolBox::ImplOpenItem( KeyCode aKeyCode )
mnCurPos = GetItemPos( mnCurItemId );
mnLastFocusItemId = mnCurItemId; // save item id for possible later focus restore
mnMouseModifier = aKeyCode.GetModifier();
- mbIsShift = TRUE;
- mbIsKeyEvent = TRUE;
+ mbIsShift = sal_True;
+ mbIsKeyEvent = sal_True;
Activate();
- mpData->mbDropDownByKeyboard = TRUE;
+ mpData->mbDropDownByKeyboard = sal_True;
GetDropdownClickHdl().Call( this );
- mbIsKeyEvent = FALSE;
- mbIsShift = FALSE;
+ mbIsKeyEvent = sal_False;
+ mbIsShift = sal_False;
mnMouseModifier = 0;
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
@@ -5743,10 +5745,10 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
{
KeyCode aKeyCode = rKEvt.GetKeyCode();
mnKeyModifier = aKeyCode.GetModifier();
- USHORT nCode = aKeyCode.GetCode();
- BOOL bParentIsDialog = ( ( ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL) ) == WB_DIALOGCONTROL );
- BOOL bForwardKey = FALSE;
- BOOL bGrabFocusToDocument = FALSE;
+ sal_uInt16 nCode = aKeyCode.GetCode();
+ sal_Bool bParentIsDialog = ( ( ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL) ) == WB_DIALOGCONTROL );
+ sal_Bool bForwardKey = sal_False;
+ sal_Bool bGrabFocusToDocument = sal_False;
// #107776# we might be destroyed in the keyhandler
ImplDelData aDelData;
@@ -5760,7 +5762,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
if( aKeyCode.GetModifier() ) // allow only pure cursor keys
break;
if( !IsHorizontal() )
- ImplChangeHighlightUpDn( TRUE );
+ ImplChangeHighlightUpDn( sal_True );
else
ImplOpenItem( aKeyCode );
}
@@ -5770,7 +5772,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
if( aKeyCode.GetModifier() ) // allow only pure cursor keys
break;
if( IsHorizontal() )
- ImplChangeHighlightUpDn( TRUE );
+ ImplChangeHighlightUpDn( sal_True );
else
ImplOpenItem( aKeyCode );
}
@@ -5780,7 +5782,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
if( aKeyCode.GetModifier() ) // allow only pure cursor keys
break;
if( !IsHorizontal() )
- ImplChangeHighlightUpDn( FALSE );
+ ImplChangeHighlightUpDn( sal_False );
else
ImplOpenItem( aKeyCode );
}
@@ -5790,7 +5792,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
if( aKeyCode.GetModifier() ) // allow only pure cursor keys
break;
if( IsHorizontal() )
- ImplChangeHighlightUpDn( FALSE );
+ ImplChangeHighlightUpDn( sal_False );
else
ImplOpenItem( aKeyCode );
}
@@ -5802,9 +5804,9 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
mnCurLine = mnCurLine - mnVisLines;
else
mnCurLine = 1;
- mbFormat = TRUE;
+ mbFormat = sal_True;
ImplFormat();
- ImplDrawSpin( FALSE, FALSE );
+ ImplDrawSpin( sal_False, sal_False );
ImplChangeHighlight( ImplGetFirstValidItem( mnCurLine ) );
}
break;
@@ -5815,22 +5817,22 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
mnCurLine = mnCurLine + mnVisLines;
else
mnCurLine = mnCurLines;
- mbFormat = TRUE;
+ mbFormat = sal_True;
ImplFormat();
- ImplDrawSpin( FALSE, FALSE );
+ ImplDrawSpin( sal_False, sal_False );
ImplChangeHighlight( ImplGetFirstValidItem( mnCurLine ) );
}
break;
case KEY_END:
{
ImplChangeHighlight( NULL );
- ImplChangeHighlightUpDn( FALSE );
+ ImplChangeHighlightUpDn( sal_False );
}
break;
case KEY_HOME:
{
ImplChangeHighlight( NULL );
- ImplChangeHighlightUpDn( TRUE );
+ ImplChangeHighlightUpDn( sal_True );
}
break;
case KEY_ESCAPE:
@@ -5863,7 +5865,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
if( !pItem->mbEnabled )
{
Sound::Beep( SOUND_DISABLE, this );
- bGrabFocusToDocument = TRUE;
+ bGrabFocusToDocument = sal_True;
}
}
if( !bGrabFocusToDocument )
@@ -5872,7 +5874,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
break;
default:
{
- USHORT aKeyGroup = aKeyCode.GetGroup();
+ sal_uInt16 aKeyGroup = aKeyCode.GetGroup();
ImplToolItem *pItem = NULL;
if( mnHighItemId )
pItem = ImplGetItem( mnHighItemId );
@@ -5881,9 +5883,9 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
{
Window *pFocusWindow = Application::GetFocusWindow();
ImplHideFocus();
- mbChangingHighlight = TRUE; // avoid focus change due to loose focus
+ mbChangingHighlight = sal_True; // avoid focus change due to loose focus
pItem->mpWindow->ImplControlFocus( GETFOCUS_TAB );
- mbChangingHighlight = FALSE;
+ mbChangingHighlight = sal_False;
if( pFocusWindow != Application::GetFocusWindow() )
Application::GetFocusWindow()->KeyInput( rKEvt );
}
@@ -5893,7 +5895,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
// while the toolbox has the focus
// just forward function and special keys and combinations with Alt-key
if( aKeyGroup == KEYGROUP_FKEYS || aKeyGroup == KEYGROUP_MISC || aKeyCode.IsMod2() )
- bForwardKey = TRUE;
+ bForwardKey = sal_True;
}
}
}
@@ -5905,7 +5907,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
// #107251# move focus away if this toolbox was disabled during keyinput
if( HasFocus() && mpData->mbKeyInputDisabled && (ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL) ) == WB_DIALOGCONTROL)
{
- USHORT n = 0;
+ sal_uInt16 n = 0;
Window *pFocusControl = ImplGetParent()->ImplGetDlgWindow( n, DLGWINDOW_FIRST );
if ( pFocusControl && pFocusControl != this )
pFocusControl->ImplControlFocus( GETFOCUS_INIT );
@@ -5927,10 +5929,10 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
// -----------------------------------------------------------------------
// returns the current toolbox line of the item
-USHORT ToolBox::ImplGetItemLine( ImplToolItem* pCurrentItem )
+sal_uInt16 ToolBox::ImplGetItemLine( ImplToolItem* pCurrentItem )
{
std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin();
- USHORT nLine = 1;
+ sal_uInt16 nLine = 1;
while( it != mpData->m_aItems.end() )
{
if ( it->mbBreak )
@@ -5943,7 +5945,7 @@ USHORT ToolBox::ImplGetItemLine( ImplToolItem* pCurrentItem )
}
// returns the first displayable item in the given line
-ImplToolItem* ToolBox::ImplGetFirstValidItem( USHORT nLine )
+ImplToolItem* ToolBox::ImplGetFirstValidItem( sal_uInt16 nLine )
{
if( !nLine || nLine > mnCurLines )
return NULL;
@@ -5975,7 +5977,7 @@ ImplToolItem* ToolBox::ImplGetFirstValidItem( USHORT nLine )
}
// returns the last displayable item in the given line
-ImplToolItem* ToolBox::ImplGetLastValidItem( USHORT nLine )
+ImplToolItem* ToolBox::ImplGetLastValidItem( sal_uInt16 nLine )
{
if( !nLine || nLine > mnCurLines )
return NULL;
@@ -6009,11 +6011,11 @@ ImplToolItem* ToolBox::ImplGetLastValidItem( USHORT nLine )
// -----------------------------------------------------------------------
-USHORT ToolBox::ImplFindItemPos( const ImplToolItem* pItem, const std::vector< ImplToolItem >& rList )
+sal_uInt16 ToolBox::ImplFindItemPos( const ImplToolItem* pItem, const std::vector< ImplToolItem >& rList )
{
if( pItem )
{
- USHORT nPos;
+ sal_uInt16 nPos;
for( nPos = 0; nPos < rList.size(); ++nPos )
if( &rList[ nPos ] == pItem )
return nPos;
@@ -6021,34 +6023,34 @@ USHORT ToolBox::ImplFindItemPos( const ImplToolItem* pItem, const std::vector< I
return TOOLBOX_ITEM_NOTFOUND;
}
-void ToolBox::ChangeHighlight( USHORT nPos )
+void ToolBox::ChangeHighlight( sal_uInt16 nPos )
{
if ( nPos < GetItemCount() ) {
ImplGrabFocus( 0 );
- ImplChangeHighlight ( ImplGetItem ( GetItemId ( (USHORT) nPos ) ), FALSE );
+ ImplChangeHighlight ( ImplGetItem ( GetItemId ( (sal_uInt16) nPos ) ), sal_False );
}
}
-void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, BOOL bNoGrabFocus )
+void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, sal_Bool bNoGrabFocus )
{
// avoid recursion due to focus change
if( mbChangingHighlight )
return;
- mbChangingHighlight = TRUE;
+ mbChangingHighlight = sal_True;
ImplToolItem* pOldItem = NULL;
if ( mnHighItemId )
{
ImplHideFocus();
- USHORT nPos = GetItemPos( mnHighItemId );
+ sal_uInt16 nPos = GetItemPos( mnHighItemId );
pOldItem = ImplGetItem( mnHighItemId );
// #i89962# ImplDrawItem can cause Invalidate/Update
// which will in turn ImplShowFocus again
// set mnHighItemId to 0 already to prevent this hen/egg problem
mnHighItemId = 0;
- ImplDrawItem( nPos, FALSE );
+ ImplDrawItem( nPos, sal_False );
ImplCallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHTOFF, reinterpret_cast< void* >( nPos ) );
}
@@ -6060,21 +6062,21 @@ void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, BOOL bNoGrabFocus )
if( pItem )
{
- USHORT aPos = ToolBox::ImplFindItemPos( pItem, mpData->m_aItems );
+ sal_uInt16 aPos = ToolBox::ImplFindItemPos( pItem, mpData->m_aItems );
if( aPos != TOOLBOX_ITEM_NOTFOUND)
{
// check for line breaks
- USHORT nLine = ImplGetItemLine( pItem );
+ sal_uInt16 nLine = ImplGetItemLine( pItem );
if( nLine >= mnCurLine + mnVisLines )
{
mnCurLine = nLine - mnVisLines + 1;
- mbFormat = TRUE;
+ mbFormat = sal_True;
}
else if ( nLine < mnCurLine )
{
mnCurLine = nLine;
- mbFormat = TRUE;
+ mbFormat = sal_True;
}
if( mbFormat )
@@ -6099,23 +6101,23 @@ void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, BOOL bNoGrabFocus )
mnCurPos = TOOLBOX_ITEM_NOTFOUND;
}
- mbChangingHighlight = FALSE;
+ mbChangingHighlight = sal_False;
}
// -----------------------------------------------------------------------
// check for keyboard accessible items
-static BOOL ImplIsValidItem( const ImplToolItem* pItem, BOOL bNotClipped )
+static sal_Bool ImplIsValidItem( const ImplToolItem* pItem, sal_Bool bNotClipped )
{
- BOOL bValid = (pItem && pItem->meType == TOOLBOXITEM_BUTTON && pItem->mbVisible && !ImplIsFixedControl( pItem ));
+ sal_Bool bValid = (pItem && pItem->meType == TOOLBOXITEM_BUTTON && pItem->mbVisible && !ImplIsFixedControl( pItem ));
if( bValid && bNotClipped && pItem->IsClipped() )
- bValid = FALSE;
+ bValid = sal_False;
return bValid;
}
// -----------------------------------------------------------------------
-BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
+sal_Bool ToolBox::ImplChangeHighlightUpDn( sal_Bool bUp, sal_Bool bNoCycle )
{
ImplToolItem* pToolItem = ImplGetItem( mnHighItemId );
@@ -6132,13 +6134,13 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
while( it != mpData->m_aItems.begin() )
{
--it;
- if ( ImplIsValidItem( &(*it), TRUE ) )
+ if ( ImplIsValidItem( &(*it), sal_True ) )
{
pItem = &(*it);
break;
}
}
- ImplDrawMenubutton( this, FALSE );
+ ImplDrawMenubutton( this, sal_False );
ImplChangeHighlight( pItem );
}
else
@@ -6147,17 +6149,17 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin();
while( it != mpData->m_aItems.end() )
{
- if ( ImplIsValidItem( &(*it), TRUE ) )
+ if ( ImplIsValidItem( &(*it), sal_True ) )
break;
++it;
}
if( it != mpData->m_aItems.end() )
{
- ImplDrawMenubutton( this, FALSE );
+ ImplDrawMenubutton( this, sal_False );
ImplChangeHighlight( &(*it) );
}
}
- return TRUE;
+ return sal_True;
}
if( bUp )
@@ -6166,7 +6168,7 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin();
while( it != mpData->m_aItems.end() )
{
- if ( ImplIsValidItem( &(*it), FALSE ) )
+ if ( ImplIsValidItem( &(*it), sal_False ) )
break;
++it;
}
@@ -6175,11 +6177,11 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
if( (it != mpData->m_aItems.end() && &(*it) == ImplGetFirstClippedItem( this )) && IsMenuEnabled() )
{
ImplChangeHighlight( NULL );
- ImplDrawMenubutton( this, TRUE );
+ ImplDrawMenubutton( this, sal_True );
}
else
ImplChangeHighlight( (it != mpData->m_aItems.end()) ? &(*it) : NULL );
- return TRUE;
+ return sal_True;
}
else
{
@@ -6189,7 +6191,7 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
if( IsMenuEnabled() && !ImplIsFloatingMode() )
{
ImplChangeHighlight( NULL );
- ImplDrawMenubutton( this, TRUE );
+ ImplDrawMenubutton( this, sal_True );
}
else
{
@@ -6198,7 +6200,7 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
while( it != mpData->m_aItems.begin() )
{
--it;
- if ( ImplIsValidItem( &(*it), FALSE ) )
+ if ( ImplIsValidItem( &(*it), sal_False ) )
{
pItem = &(*it);
break;
@@ -6206,16 +6208,16 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
}
ImplChangeHighlight( pItem );
}
- return TRUE;
+ return sal_True;
}
}
if( pToolItem )
{
- ULONG pos = ToolBox::ImplFindItemPos( pToolItem, mpData->m_aItems );
- ULONG nCount = mpData->m_aItems.size();
+ sal_uLong pos = ToolBox::ImplFindItemPos( pToolItem, mpData->m_aItems );
+ sal_uLong nCount = mpData->m_aItems.size();
- ULONG i=0;
+ sal_uLong i=0;
do
{
if( bUp )
@@ -6223,14 +6225,14 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
if( !pos-- )
{
if( bNoCycle )
- return FALSE;
+ return sal_False;
// highlight the menu button if it is the last item
if( IsMenuEnabled() && !ImplIsFloatingMode() )
{
ImplChangeHighlight( NULL );
- ImplDrawMenubutton( this, TRUE );
- return TRUE;
+ ImplDrawMenubutton( this, sal_True );
+ return sal_True;
}
else
pos = nCount-1;
@@ -6241,14 +6243,14 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
if( ++pos >= nCount )
{
if( bNoCycle )
- return FALSE;
+ return sal_False;
// highlight the menu button if it is the last item
if( IsMenuEnabled() && !ImplIsFloatingMode() )
{
ImplChangeHighlight( NULL );
- ImplDrawMenubutton( this, TRUE );
- return TRUE;
+ ImplDrawMenubutton( this, sal_True );
+ return sal_True;
}
else
pos = 0;
@@ -6257,7 +6259,7 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
pToolItem = &mpData->m_aItems[pos];
- if ( ImplIsValidItem( pToolItem, FALSE ) )
+ if ( ImplIsValidItem( pToolItem, sal_False ) )
break;
} while( ++i < nCount);
@@ -6266,14 +6268,14 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
{
// select the menu button if a clipped item would be selected
ImplChangeHighlight( NULL );
- ImplDrawMenubutton( this, TRUE );
+ ImplDrawMenubutton( this, sal_True );
}
else if( i != nCount )
ImplChangeHighlight( pToolItem );
else
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -6286,7 +6288,7 @@ void ToolBox::ImplShowFocus()
if( pItem->mpWindow )
{
Window *pWin = pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow ? pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow : pItem->mpWindow;
- pWin->ImplGetWindowImpl()->mbDrawSelectionBackground = TRUE;
+ pWin->ImplGetWindowImpl()->mbDrawSelectionBackground = sal_True;
pWin->Invalidate( 0 );
}
}
@@ -6302,7 +6304,7 @@ void ToolBox::ImplHideFocus()
if( pItem->mpWindow )
{
Window *pWin = pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow ? pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow : pItem->mpWindow;
- pWin->ImplGetWindowImpl()->mbDrawSelectionBackground = FALSE;
+ pWin->ImplGetWindowImpl()->mbDrawSelectionBackground = sal_False;
pWin->Invalidate( 0 );
}
}
@@ -6310,7 +6312,7 @@ void ToolBox::ImplHideFocus()
if ( mpData->mbMenubuttonSelected )
{
// remove highlight from menubutton
- ImplDrawMenubutton( this, FALSE );
+ ImplDrawMenubutton( this, sal_False );
}
}
@@ -6330,7 +6332,7 @@ void ToolBox::ImplDisableFlatButtons()
&hkey) )
{
DWORD dwType = 0;
- WIN_BYTE Data[6]; // possible values: "true", "false", "1", "0", DWORD
+ sal_uInt8 Data[6]; // possible values: "true", "false", "1", "0", DWORD
DWORD cbData = sizeof(Data);
if( ERROR_SUCCESS == RegQueryValueEx(hkey, "DisableFlatToolboxButtons",
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index f17c7d0ef87e..37650232fd7f 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -72,17 +72,17 @@ ImplToolBoxPrivateData::ImplToolBoxPrivateData() :
mnMenuButtonWidth = TB_MENUBUTTON_SIZE;
- mbIsLocked = FALSE;
- mbNativeButtons = FALSE;
- mbIsPaintLocked = FALSE;
- mbAssumeDocked = FALSE;
- mbAssumePopupMode = FALSE;
- mbAssumeFloating = FALSE;
- mbKeyInputDisabled = FALSE;
- mbMenubuttonSelected = FALSE;
- mbPageScroll = FALSE;
- mbWillUsePopupMode = FALSE;
- mbDropDownByKeyboard = FALSE;
+ mbIsLocked = sal_False;
+ mbNativeButtons = sal_False;
+ mbIsPaintLocked = sal_False;
+ mbAssumeDocked = sal_False;
+ mbAssumePopupMode = sal_False;
+ mbAssumeFloating = sal_False;
+ mbKeyInputDisabled = sal_False;
+ mbMenubuttonSelected = sal_False;
+ mbPageScroll = sal_False;
+ mbWillUsePopupMode = sal_False;
+ mbDropDownByKeyboard = sal_False;
}
ImplToolBoxPrivateData::~ImplToolBoxPrivateData()
@@ -98,40 +98,38 @@ ImplToolItem::ImplToolItem()
mnId = 0;
mpWindow = NULL;
mpUserData = NULL;
- mnHelpId = 0;
meType = TOOLBOXITEM_BUTTON;
mnBits = 0;
meState = STATE_NOCHECK;
- mbEnabled = TRUE;
- mbVisible = TRUE;
- mbEmptyBtn = TRUE;
- mbShowWindow = FALSE;
- mbBreak = FALSE;
+ mbEnabled = sal_True;
+ mbVisible = sal_True;
+ mbEmptyBtn = sal_True;
+ mbShowWindow = sal_False;
+ mbBreak = sal_False;
mnSepSize = TB_SEP_SIZE;
mnDropDownArrowWidth = TB_DROPDOWNARROWWIDTH;
mnImageAngle = 0;
- mbMirrorMode = FALSE;
- mbVisibleText = FALSE;
+ mbMirrorMode = sal_False;
+ mbVisibleText = sal_False;
}
// -----------------------------------------------------------------------
-ImplToolItem::ImplToolItem( USHORT nItemId, const Image& rImage,
+ImplToolItem::ImplToolItem( sal_uInt16 nItemId, const Image& rImage,
ToolBoxItemBits nItemBits ) :
maImage( rImage )
{
mnId = nItemId;
mpWindow = NULL;
mpUserData = NULL;
- mnHelpId = 0;
meType = TOOLBOXITEM_BUTTON;
mnBits = nItemBits;
meState = STATE_NOCHECK;
- mbEnabled = TRUE;
- mbVisible = TRUE;
- mbEmptyBtn = FALSE;
- mbShowWindow = FALSE;
- mbBreak = FALSE;
+ mbEnabled = sal_True;
+ mbVisible = sal_True;
+ mbEmptyBtn = sal_False;
+ mbShowWindow = sal_False;
+ mbBreak = sal_False;
mnSepSize = TB_SEP_SIZE;
mnDropDownArrowWidth = TB_DROPDOWNARROWWIDTH;
mnImageAngle = 0;
@@ -141,22 +139,21 @@ ImplToolItem::ImplToolItem( USHORT nItemId, const Image& rImage,
// -----------------------------------------------------------------------
-ImplToolItem::ImplToolItem( USHORT nItemId, const XubString& rText,
+ImplToolItem::ImplToolItem( sal_uInt16 nItemId, const XubString& rText,
ToolBoxItemBits nItemBits ) :
maText( rText )
{
mnId = nItemId;
mpWindow = NULL;
mpUserData = NULL;
- mnHelpId = 0;
meType = TOOLBOXITEM_BUTTON;
mnBits = nItemBits;
meState = STATE_NOCHECK;
- mbEnabled = TRUE;
- mbVisible = TRUE;
- mbEmptyBtn = FALSE;
- mbShowWindow = FALSE;
- mbBreak = FALSE;
+ mbEnabled = sal_True;
+ mbVisible = sal_True;
+ mbEmptyBtn = sal_False;
+ mbShowWindow = sal_False;
+ mbBreak = sal_False;
mnSepSize = TB_SEP_SIZE;
mnDropDownArrowWidth = TB_DROPDOWNARROWWIDTH;
mnImageAngle = 0;
@@ -166,7 +163,7 @@ ImplToolItem::ImplToolItem( USHORT nItemId, const XubString& rText,
// -----------------------------------------------------------------------
-ImplToolItem::ImplToolItem( USHORT nItemId, const Image& rImage,
+ImplToolItem::ImplToolItem( sal_uInt16 nItemId, const Image& rImage,
const XubString& rText, ToolBoxItemBits nItemBits ) :
maImage( rImage ),
maText( rText )
@@ -174,15 +171,14 @@ ImplToolItem::ImplToolItem( USHORT nItemId, const Image& rImage,
mnId = nItemId;
mpWindow = NULL;
mpUserData = NULL;
- mnHelpId = 0;
meType = TOOLBOXITEM_BUTTON;
mnBits = nItemBits;
meState = STATE_NOCHECK;
- mbEnabled = TRUE;
- mbVisible = TRUE;
- mbEmptyBtn = FALSE;
- mbShowWindow = FALSE;
- mbBreak = FALSE;
+ mbEnabled = sal_True;
+ mbVisible = sal_True;
+ mbEmptyBtn = sal_False;
+ mbShowWindow = sal_False;
+ mbBreak = sal_False;
mnSepSize = TB_SEP_SIZE;
mnDropDownArrowWidth = TB_DROPDOWNARROWWIDTH;
mnImageAngle = 0;
@@ -203,7 +199,7 @@ ImplToolItem::ImplToolItem( const ImplToolItem& rItem ) :
maQuickHelpText ( rItem.maQuickHelpText ),
maHelpText ( rItem.maHelpText ),
maCommandStr ( rItem.maCommandStr ),
- mnHelpId ( rItem.mnHelpId ),
+ maHelpId ( rItem.maHelpId ),
maRect ( rItem.maRect ),
maCalcRect ( rItem.maCalcRect ),
maItemSize ( rItem.maItemSize ),
@@ -242,7 +238,7 @@ ImplToolItem& ImplToolItem::operator=( const ImplToolItem& rItem )
maQuickHelpText = rItem.maQuickHelpText;
maHelpText = rItem.maHelpText;
maCommandStr = rItem.maCommandStr;
- mnHelpId = rItem.mnHelpId;
+ maHelpId = rItem.maHelpId;
maRect = rItem.maRect;
maCalcRect = rItem.maCalcRect;
mnSepSize = rItem.mnSepSize;
@@ -263,7 +259,7 @@ ImplToolItem& ImplToolItem::operator=( const ImplToolItem& rItem )
// -----------------------------------------------------------------------
-Size ImplToolItem::GetSize( BOOL bHorz, BOOL bCheckMaxWidth, long maxWidth, const Size& rDefaultSize )
+Size ImplToolItem::GetSize( sal_Bool bHorz, sal_Bool bCheckMaxWidth, long maxWidth, const Size& rDefaultSize )
{
Size aSize( rDefaultSize ); // the size of 'standard' toolbox items
// non-standard items are eg windows or buttons with text
@@ -275,13 +271,13 @@ Size ImplToolItem::GetSize( BOOL bHorz, BOOL bCheckMaxWidth, long maxWidth, cons
if ( mpWindow && bHorz )
{
// get size of item window and check if it fits
- // no windows in vertical toolbars (the default is mbShowWindow=FALSE)
+ // no windows in vertical toolbars (the default is mbShowWindow=sal_False)
Size aWinSize = mpWindow->GetSizePixel();
if ( !bCheckMaxWidth || (aWinSize.Width() <= maxWidth) )
{
aSize.Width() = aWinSize.Width();
aSize.Height() = aWinSize.Height();
- mbShowWindow = TRUE;
+ mbShowWindow = sal_True;
}
else
{
@@ -317,27 +313,27 @@ Size ImplToolItem::GetSize( BOOL bHorz, BOOL bCheckMaxWidth, long maxWidth, cons
// -----------------------------------------------------------------------
-void ImplToolItem::DetermineButtonDrawStyle( ButtonType eButtonType, BOOL& rbImage, BOOL& rbText ) const
+void ImplToolItem::DetermineButtonDrawStyle( ButtonType eButtonType, sal_Bool& rbImage, sal_Bool& rbText ) const
{
if ( meType != TOOLBOXITEM_BUTTON )
{
// no button -> draw nothing
- rbImage = rbText = FALSE;
+ rbImage = rbText = sal_False;
return;
}
- BOOL bHasImage;
- BOOL bHasText;
+ sal_Bool bHasImage;
+ sal_Bool bHasText;
// check for image and/or text
if ( !(maImage) )
- bHasImage = FALSE;
+ bHasImage = sal_False;
else
- bHasImage = TRUE;
+ bHasImage = sal_True;
if ( !maText.Len() )
- bHasText = FALSE;
+ bHasText = sal_False;
else
- bHasText = TRUE;
+ bHasText = sal_True;
// prefer images if symbolonly buttons are drawn
// prefer texts if textonly buttons are dreawn
@@ -346,38 +342,38 @@ void ImplToolItem::DetermineButtonDrawStyle( ButtonType eButtonType, BOOL& rbIma
{
if( bHasImage || !bHasText )
{
- rbImage = TRUE;
- rbText = FALSE;
+ rbImage = sal_True;
+ rbText = sal_False;
}
else
{
- rbImage = FALSE;
- rbText = TRUE;
+ rbImage = sal_False;
+ rbText = sal_True;
}
}
else if ( eButtonType == BUTTON_TEXT ) // drawing text only
{
if( bHasText || !bHasImage )
{
- rbImage = FALSE;
- rbText = TRUE;
+ rbImage = sal_False;
+ rbText = sal_True;
}
else
{
- rbImage = TRUE;
- rbText = FALSE;
+ rbImage = sal_True;
+ rbText = sal_False;
}
}
else // drawing icons and text both
{
- rbImage = TRUE;
- rbText = TRUE;
+ rbImage = sal_True;
+ rbText = sal_True;
}
}
// -----------------------------------------------------------------------
-Rectangle ImplToolItem::GetDropDownRect( BOOL bHorz ) const
+Rectangle ImplToolItem::GetDropDownRect( sal_Bool bHorz ) const
{
Rectangle aRect;
if( (mnBits & TIB_DROPDOWN) && !maRect.IsEmpty() )
@@ -395,7 +391,7 @@ Rectangle ImplToolItem::GetDropDownRect( BOOL bHorz ) const
// -----------------------------------------------------------------------
-BOOL ImplToolItem::IsClipped() const
+sal_Bool ImplToolItem::IsClipped() const
{
return ( meType == TOOLBOXITEM_BUTTON && mbVisible && maRect.IsEmpty() );
}
@@ -414,16 +410,16 @@ const XubString& ToolBox::ImplConvertMenuString( const XubString& rStr )
// -----------------------------------------------------------------------
-void ToolBox::ImplInvalidate( BOOL bNewCalc, BOOL bFullPaint )
+void ToolBox::ImplInvalidate( sal_Bool bNewCalc, sal_Bool bFullPaint )
{
ImplUpdateInputEnable();
if ( bNewCalc )
- mbCalc = TRUE;
+ mbCalc = sal_True;
if ( bFullPaint )
{
- mbFormat = TRUE;
+ mbFormat = sal_True;
// Muss ueberhaupt eine neue Ausgabe erfolgen
if ( IsReallyVisible() && IsUpdateMode() )
@@ -437,7 +433,7 @@ void ToolBox::ImplInvalidate( BOOL bNewCalc, BOOL bFullPaint )
{
if ( !mbFormat )
{
- mbFormat = TRUE;
+ mbFormat = sal_True;
// Muss ueberhaupt eine neue Ausgabe erfolgen
if ( IsReallyVisible() && IsUpdateMode() )
@@ -451,7 +447,7 @@ void ToolBox::ImplInvalidate( BOOL bNewCalc, BOOL bFullPaint )
// -----------------------------------------------------------------------
-void ToolBox::ImplUpdateItem( USHORT nIndex )
+void ToolBox::ImplUpdateItem( sal_uInt16 nIndex )
{
// Muss ueberhaupt eine neue Ausgabe erfolgen
if ( IsReallyVisible() && IsUpdateMode() )
@@ -558,10 +554,10 @@ void ToolBox::UserDraw( const UserDrawEvent& )
// -----------------------------------------------------------------------
-void ToolBox::InsertItem( const ResId& rResId, USHORT nPos )
+void ToolBox::InsertItem( const ResId& rResId, sal_uInt16 nPos )
{
- ULONG nObjMask;
- BOOL bImage = FALSE; // Wurde Image gesetzt
+ sal_uLong nObjMask;
+ sal_Bool bImage = sal_False; // Wurde Image gesetzt
// Item anlegen
ImplToolItem aItem;
@@ -570,7 +566,7 @@ void ToolBox::InsertItem( const ResId& rResId, USHORT nPos )
nObjMask = ReadLongRes();
if ( nObjMask & RSC_TOOLBOXITEM_ID )
- aItem.mnId = sal::static_int_cast<USHORT>(ReadLongRes());
+ aItem.mnId = sal::static_int_cast<sal_uInt16>(ReadLongRes());
else
aItem.mnId = 1;
@@ -581,7 +577,7 @@ void ToolBox::InsertItem( const ResId& rResId, USHORT nPos )
aItem.mnBits = (ToolBoxItemBits)ReadLongRes();
if( nObjMask & RSC_TOOLBOXITEM_HELPID )
- aItem.mnHelpId = ReadLongRes();
+ aItem.maHelpId = ReadByteStringRes();
if ( nObjMask & RSC_TOOLBOXITEM_TEXT )
{
@@ -596,22 +592,22 @@ void ToolBox::InsertItem( const ResId& rResId, USHORT nPos )
Bitmap aBmp = Bitmap( ResId( (RSHEADER_TYPE*)GetClassRes(), *rResId.GetResMgr() ) );
IncrementRes( GetObjSizeRes( (RSHEADER_TYPE*)GetClassRes() ) );
aItem.maImage = Image( aBmp, IMAGE_STDBTN_COLOR );
- bImage = TRUE;
+ bImage = sal_True;
}
if ( nObjMask & RSC_TOOLBOXITEM_IMAGE )
{
aItem.maImage = Image( ResId( (RSHEADER_TYPE*)GetClassRes(), *rResId.GetResMgr() ) );
IncrementRes( GetObjSizeRes( (RSHEADER_TYPE*)GetClassRes() ) );
- bImage = TRUE;
+ bImage = sal_True;
}
if ( nObjMask & RSC_TOOLBOXITEM_DISABLE )
- aItem.mbEnabled = !(BOOL)ReadShortRes();
+ aItem.mbEnabled = !(sal_Bool)ReadShortRes();
if ( nObjMask & RSC_TOOLBOXITEM_STATE )
aItem.meState = (TriState)ReadLongRes();
if ( nObjMask & RSC_TOOLBOXITEM_HIDE )
- aItem.mbVisible = !((BOOL)ReadShortRes());
+ aItem.mbVisible = !((sal_Bool)ReadShortRes());
if ( nObjMask & RSC_TOOLBOXITEM_COMMAND )
aItem.maCommandStr = ReadStringRes();
@@ -622,15 +618,15 @@ void ToolBox::InsertItem( const ResId& rResId, USHORT nPos )
aItem.maImage = maImageList.GetImage( aItem.mnId );
// Wenn es sich um ein ButtonItem handelt, die ID ueberpruefen
- BOOL bNewCalc;
+ sal_Bool bNewCalc;
if ( aItem.meType != TOOLBOXITEM_BUTTON )
{
- bNewCalc = FALSE;
+ bNewCalc = sal_False;
aItem.mnId = 0;
}
else
{
- bNewCalc = TRUE;
+ bNewCalc = sal_True;
DBG_ASSERT( aItem.mnId, "ToolBox::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( aItem.mnId ) == TOOLBOX_ITEM_NOTFOUND,
@@ -645,14 +641,14 @@ void ToolBox::InsertItem( const ResId& rResId, USHORT nPos )
ImplInvalidate( bNewCalc );
// Notify
- USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::InsertItem( USHORT nItemId, const Image& rImage,
- ToolBoxItemBits nBits, USHORT nPos )
+void ToolBox::InsertItem( sal_uInt16 nItemId, const Image& rImage,
+ ToolBoxItemBits nBits, sal_uInt16 nPos )
{
DBG_ASSERT( nItemId, "ToolBox::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND,
@@ -662,18 +658,18 @@ void ToolBox::InsertItem( USHORT nItemId, const Image& rImage,
mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), ImplToolItem( nItemId, rImage, nBits ) );
mpData->ImplClearLayoutData();
- ImplInvalidate( TRUE );
+ ImplInvalidate( sal_True );
// Notify
- USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >(nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::InsertItem( USHORT nItemId, const Image& rImage,
+void ToolBox::InsertItem( sal_uInt16 nItemId, const Image& rImage,
const XubString& rText,
- ToolBoxItemBits nBits, USHORT nPos )
+ ToolBoxItemBits nBits, sal_uInt16 nPos )
{
DBG_ASSERT( nItemId, "ToolBox::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND,
@@ -683,17 +679,17 @@ void ToolBox::InsertItem( USHORT nItemId, const Image& rImage,
mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), ImplToolItem( nItemId, rImage, ImplConvertMenuString( rText ), nBits ) );
mpData->ImplClearLayoutData();
- ImplInvalidate( TRUE );
+ ImplInvalidate( sal_True );
// Notify
- USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::InsertItem( USHORT nItemId, const XubString& rText,
- ToolBoxItemBits nBits, USHORT nPos )
+void ToolBox::InsertItem( sal_uInt16 nItemId, const XubString& rText,
+ ToolBoxItemBits nBits, sal_uInt16 nPos )
{
DBG_ASSERT( nItemId, "ToolBox::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND,
@@ -703,17 +699,17 @@ void ToolBox::InsertItem( USHORT nItemId, const XubString& rText,
mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), ImplToolItem( nItemId, ImplConvertMenuString( rText ), nBits ) );
mpData->ImplClearLayoutData();
- ImplInvalidate( TRUE );
+ ImplInvalidate( sal_True );
// Notify
- USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::InsertWindow( USHORT nItemId, Window* pWindow,
- ToolBoxItemBits nBits, USHORT nPos )
+void ToolBox::InsertWindow( sal_uInt16 nItemId, Window* pWindow,
+ ToolBoxItemBits nBits, sal_uInt16 nPos )
{
DBG_ASSERT( nItemId, "ToolBox::InsertWindow(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND,
@@ -731,80 +727,80 @@ void ToolBox::InsertWindow( USHORT nItemId, Window* pWindow,
if ( pWindow )
pWindow->Hide();
- ImplInvalidate( TRUE );
+ ImplInvalidate( sal_True );
// Notify
- USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::InsertSpace( USHORT nPos )
+void ToolBox::InsertSpace( sal_uInt16 nPos )
{
// Item anlegen und in die Liste einfuegen
ImplToolItem aItem;
aItem.meType = TOOLBOXITEM_SPACE;
- aItem.mbEnabled = FALSE;
+ aItem.mbEnabled = sal_False;
mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), aItem );
mpData->ImplClearLayoutData();
- ImplInvalidate( FALSE );
+ ImplInvalidate( sal_False );
// Notify
- USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::InsertSeparator( USHORT nPos, USHORT nPixSize )
+void ToolBox::InsertSeparator( sal_uInt16 nPos, sal_uInt16 nPixSize )
{
// Item anlegen und in die Liste einfuegen
ImplToolItem aItem;
aItem.meType = TOOLBOXITEM_SEPARATOR;
- aItem.mbEnabled = FALSE;
+ aItem.mbEnabled = sal_False;
if ( nPixSize )
aItem.mnSepSize = nPixSize;
mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), aItem );
mpData->ImplClearLayoutData();
- ImplInvalidate( FALSE );
+ ImplInvalidate( sal_False );
// Notify
- USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::InsertBreak( USHORT nPos )
+void ToolBox::InsertBreak( sal_uInt16 nPos )
{
// Item anlegen und in die Liste einfuegen
ImplToolItem aItem;
aItem.meType = TOOLBOXITEM_BREAK;
- aItem.mbEnabled = FALSE;
+ aItem.mbEnabled = sal_False;
mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), aItem );
mpData->ImplClearLayoutData();
- ImplInvalidate( FALSE );
+ ImplInvalidate( sal_False );
// Notify
- USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::RemoveItem( USHORT nPos )
+void ToolBox::RemoveItem( sal_uInt16 nPos )
{
if( nPos < mpData->m_aItems.size() )
{
- BOOL bMustCalc;
+ sal_Bool bMustCalc;
if ( mpData->m_aItems[nPos].meType == TOOLBOXITEM_BUTTON )
- bMustCalc = TRUE;
+ bMustCalc = sal_True;
else
- bMustCalc = FALSE;
+ bMustCalc = sal_False;
if ( mpData->m_aItems[nPos].mpWindow )
mpData->m_aItems[nPos].mpWindow->Hide();
@@ -830,9 +826,9 @@ void ToolBox::RemoveItem( USHORT nPos )
// -----------------------------------------------------------------------
-void ToolBox::MoveItem( USHORT nItemId, USHORT nNewPos )
+void ToolBox::MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos == nNewPos )
return;
@@ -850,14 +846,14 @@ void ToolBox::MoveItem( USHORT nItemId, USHORT nNewPos )
mpData->ImplClearLayoutData();
// ToolBox neu ausgeben
- ImplInvalidate( FALSE );
+ ImplInvalidate( sal_False );
// Notify
if( nPos < nNewPos ) // only send one event, all indices above this item are invalid anyway
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMREMOVED, reinterpret_cast< void* >( nPos ) );
else
{
- USHORT nNewPos2 = sal::static_int_cast<USHORT>(( nNewPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nNewPos);
+ sal_uInt16 nNewPos2 = sal::static_int_cast<sal_uInt16>(( nNewPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nNewPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos2 ) );
}
}
@@ -865,13 +861,13 @@ void ToolBox::MoveItem( USHORT nItemId, USHORT nNewPos )
// -----------------------------------------------------------------------
-void ToolBox::CopyItem( const ToolBox& rToolBox, USHORT nItemId,
- USHORT nNewPos )
+void ToolBox::CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId,
+ sal_uInt16 nNewPos )
{
DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND,
"ToolBox::CopyItem(): ItemId already exists" );
- USHORT nPos = rToolBox.GetItemPos( nItemId );
+ sal_uInt16 nPos = rToolBox.GetItemPos( nItemId );
// Existiert Item
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
@@ -880,15 +876,15 @@ void ToolBox::CopyItem( const ToolBox& rToolBox, USHORT nItemId,
ImplToolItem aNewItem = rToolBox.mpData->m_aItems[nPos];
// Bestimme Daten zuruecksetzen
aNewItem.mpWindow = NULL;
- aNewItem.mbShowWindow = FALSE;
+ aNewItem.mbShowWindow = sal_False;
mpData->m_aItems.insert( (nNewPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nNewPos : mpData->m_aItems.end(), aNewItem );
mpData->ImplClearLayoutData();
// ToolBox neu ausgeben
- ImplInvalidate( FALSE );
+ ImplInvalidate( sal_False );
// Notify
- USHORT nNewPos2 = sal::static_int_cast<USHORT>(( nNewPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nNewPos);
+ sal_uInt16 nNewPos2 = sal::static_int_cast<sal_uInt16>(( nNewPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nNewPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos2 ) );
}
}
@@ -907,10 +903,10 @@ void ToolBox::CopyItems( const ToolBox& rToolBox )
it != mpData->m_aItems.end(); ++it )
{
it->mpWindow = NULL;
- it->mbShowWindow = FALSE;
+ it->mbShowWindow = sal_False;
}
- ImplInvalidate( TRUE, TRUE );
+ ImplInvalidate( sal_True, sal_True );
// Notify
ImplCallEventListeners( VCLEVENT_TOOLBOX_ALLITEMSCHANGED );
@@ -927,7 +923,7 @@ void ToolBox::Clear()
mnCurItemId = 0;
mnHighItemId = 0;
- ImplInvalidate( TRUE, TRUE );
+ ImplInvalidate( sal_True, sal_True );
// Notify
ImplCallEventListeners( VCLEVENT_TOOLBOX_ALLITEMSCHANGED );
@@ -943,7 +939,7 @@ void ToolBox::SetButtonType( ButtonType eNewType )
// Hier besser alles neu ausgeben, da es ansonsten zu Problemen
// mit den per CopyBits kopierten Bereichen geben kann
- ImplInvalidate( TRUE );
+ ImplInvalidate( sal_True );
}
}
@@ -954,8 +950,8 @@ void ToolBox::SetToolboxButtonSize( ToolBoxButtonSize eSize )
if( mpData->meButtonSize != eSize )
{
mpData->meButtonSize = eSize;
- mbCalc = TRUE;
- mbFormat = TRUE;
+ mbCalc = sal_True;
+ mbFormat = sal_True;
}
}
@@ -970,10 +966,10 @@ const Size& ToolBox::GetDefaultImageSize() const
{
static Size aSmallButtonSize( TB_SMALLIMAGESIZE, TB_SMALLIMAGESIZE );
- static ULONG s_nSymbolsStyle = STYLE_SYMBOLS_DEFAULT;
+ static sal_uLong s_nSymbolsStyle = STYLE_SYMBOLS_DEFAULT;
static Size aLargeButtonSize( TB_LARGEIMAGESIZE, TB_LARGEIMAGESIZE );
- ULONG nSymbolsStyle = Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyle();
+ sal_uLong nSymbolsStyle = Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyle();
if ( s_nSymbolsStyle != nSymbolsStyle )
{
s_nSymbolsStyle = nSymbolsStyle;
@@ -1008,13 +1004,13 @@ void ToolBox::SetAlign( WindowAlign eNewAlign )
{
// Setzen, ob Items horizontal oder vertikal angeordnet werden sollen
if ( (eNewAlign == WINDOWALIGN_LEFT) || (eNewAlign == WINDOWALIGN_RIGHT) )
- mbHorz = FALSE;
+ mbHorz = sal_False;
else
- mbHorz = TRUE;
+ mbHorz = sal_True;
// Hier alles neu ausgeben, da sich Border auch aendert
- mbCalc = TRUE;
- mbFormat = TRUE;
+ mbCalc = sal_True;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -1023,7 +1019,7 @@ void ToolBox::SetAlign( WindowAlign eNewAlign )
// -----------------------------------------------------------------------
-void ToolBox::SetLineCount( USHORT nNewLines )
+void ToolBox::SetLineCount( sal_uInt16 nNewLines )
{
if ( !nNewLines )
nNewLines = 1;
@@ -1034,18 +1030,18 @@ void ToolBox::SetLineCount( USHORT nNewLines )
// Hier besser alles neu ausgeben, da es ansonsten zu Problemen
// mit den per CopyBits kopierten Bereichen geben kann
- ImplInvalidate( FALSE );
+ ImplInvalidate( sal_False );
}
}
// -----------------------------------------------------------------------
-void ToolBox::SetPageScroll( BOOL b )
+void ToolBox::SetPageScroll( sal_Bool b )
{
mpData->mbPageScroll = b;
}
-BOOL ToolBox::GetPageScroll()
+sal_Bool ToolBox::GetPageScroll()
{
return mpData->mbPageScroll;
}
@@ -1054,45 +1050,45 @@ BOOL ToolBox::GetPageScroll()
void ToolBox::SetNextToolBox( const XubString& rStr )
{
- BOOL bCalcNew = (!maNextToolBoxStr.Len() != !rStr.Len());
+ sal_Bool bCalcNew = (!maNextToolBoxStr.Len() != !rStr.Len());
maNextToolBoxStr = rStr;
if ( bCalcNew )
- ImplInvalidate( TRUE, FALSE );
+ ImplInvalidate( sal_True, sal_False );
}
// -----------------------------------------------------------------------
-USHORT ToolBox::GetItemCount() const
+sal_uInt16 ToolBox::GetItemCount() const
{
- return (USHORT)mpData->m_aItems.size();
+ return (sal_uInt16)mpData->m_aItems.size();
}
// -----------------------------------------------------------------------
-ToolBoxItemType ToolBox::GetItemType( USHORT nPos ) const
+ToolBoxItemType ToolBox::GetItemType( sal_uInt16 nPos ) const
{
return (nPos < mpData->m_aItems.size()) ? mpData->m_aItems[nPos].meType : TOOLBOXITEM_DONTKNOW;
}
// -----------------------------------------------------------------------
-USHORT ToolBox::GetItemPos( USHORT nItemId ) const
+sal_uInt16 ToolBox::GetItemPos( sal_uInt16 nItemId ) const
{
int nCount = mpData->m_aItems.size();
for( int nPos = 0; nPos < nCount; nPos++ )
if( mpData->m_aItems[nPos].mnId == nItemId )
- return (USHORT)nPos;
+ return (sal_uInt16)nPos;
return TOOLBOX_ITEM_NOTFOUND;
}
// -----------------------------------------------------------------------
-USHORT ToolBox::GetItemPos( const Point& rPos ) const
+sal_uInt16 ToolBox::GetItemPos( const Point& rPos ) const
{
// search the item position on the given point
- USHORT nRet = TOOLBOX_ITEM_NOTFOUND;
- USHORT nPos = 0;
+ sal_uInt16 nRet = TOOLBOX_ITEM_NOTFOUND;
+ sal_uInt16 nPos = 0;
std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin();
while( it != mpData->m_aItems.end() )
{
@@ -1112,14 +1108,14 @@ USHORT ToolBox::GetItemPos( const Point& rPos ) const
// -----------------------------------------------------------------------
-USHORT ToolBox::GetItemId( USHORT nPos ) const
+sal_uInt16 ToolBox::GetItemId( sal_uInt16 nPos ) const
{
return (nPos < mpData->m_aItems.size()) ? mpData->m_aItems[nPos].mnId : 0;
}
// -----------------------------------------------------------------------
-USHORT ToolBox::GetItemId( const Point& rPos ) const
+sal_uInt16 ToolBox::GetItemId( const Point& rPos ) const
{
// Item suchen, das geklickt wurde
std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin();
@@ -1197,25 +1193,25 @@ Point ToolBox::ImplGetPopupPosition( const Rectangle& rRect, const Size& rSize )
}
-Point ToolBox::GetItemPopupPosition( USHORT nItemId, const Size& rSize ) const
+Point ToolBox::GetItemPopupPosition( sal_uInt16 nItemId, const Size& rSize ) const
{
return ImplGetPopupPosition( GetItemRect( nItemId ), rSize );
}
// -----------------------------------------------------------------------
-Rectangle ToolBox::GetItemRect( USHORT nItemId ) const
+Rectangle ToolBox::GetItemRect( sal_uInt16 nItemId ) const
{
if ( mbCalc || mbFormat )
((ToolBox*)this)->ImplFormat();
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
return GetItemPosRect( nPos );
}
// -----------------------------------------------------------------------
-Rectangle ToolBox::GetItemPosRect( USHORT nPos ) const
+Rectangle ToolBox::GetItemPosRect( sal_uInt16 nPos ) const
{
if ( mbCalc || mbFormat )
((ToolBox*)this)->ImplFormat();
@@ -1227,18 +1223,18 @@ Rectangle ToolBox::GetItemPosRect( USHORT nPos ) const
}
// -----------------------------------------------------------------------
-Rectangle ToolBox::GetItemDropDownRect( USHORT nItemId ) const
+Rectangle ToolBox::GetItemDropDownRect( sal_uInt16 nItemId ) const
{
if ( mbCalc || mbFormat )
((ToolBox*)this)->ImplFormat();
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
return GetItemPosDropDownRect( nPos );
}
// -----------------------------------------------------------------------
-Rectangle ToolBox::GetItemPosDropDownRect( USHORT nPos ) const
+Rectangle ToolBox::GetItemPosDropDownRect( sal_uInt16 nPos ) const
{
if ( mbCalc || mbFormat )
((ToolBox*)this)->ImplFormat();
@@ -1256,24 +1252,24 @@ Rectangle ToolBox::GetMenubuttonRect() const
return mpData->maMenubuttonItem.maRect;
}
-BOOL ToolBox::ImplHasExternalMenubutton()
+sal_Bool ToolBox::ImplHasExternalMenubutton()
{
// check if the borderwindow (i.e. the decoration) provides the menu button
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( ImplIsFloatingMode() )
{
// custom menu is placed in the decoration
ImplBorderWindow *pBorderWin = dynamic_cast<ImplBorderWindow*>( GetWindow( WINDOW_BORDER ) );
if( pBorderWin && !pBorderWin->GetMenuRect().IsEmpty() )
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
}
// -----------------------------------------------------------------------
-void ToolBox::SetItemBits( USHORT nItemId, ToolBoxItemBits nBits )
+void ToolBox::SetItemBits( sal_uInt16 nItemId, ToolBoxItemBits nBits )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos < mpData->m_aItems.size() )
{
@@ -1282,15 +1278,15 @@ void ToolBox::SetItemBits( USHORT nItemId, ToolBoxItemBits nBits )
nBits &= TIB_LEFT | TIB_AUTOSIZE | TIB_DROPDOWN;
nOldBits &= TIB_LEFT | TIB_AUTOSIZE | TIB_DROPDOWN;
// trigger reformat when the item width has changed (dropdown arrow)
- BOOL bFormat = (nBits & TIB_DROPDOWN) != (nOldBits & TIB_DROPDOWN);
+ sal_Bool bFormat = (nBits & TIB_DROPDOWN) != (nOldBits & TIB_DROPDOWN);
if ( nBits != nOldBits )
- ImplInvalidate( TRUE, bFormat );
+ ImplInvalidate( sal_True, bFormat );
}
}
// -----------------------------------------------------------------------
-ToolBoxItemBits ToolBox::GetItemBits( USHORT nItemId ) const
+ToolBoxItemBits ToolBox::GetItemBits( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1302,9 +1298,9 @@ ToolBoxItemBits ToolBox::GetItemBits( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetItemData( USHORT nItemId, void* pNewData )
+void ToolBox::SetItemData( sal_uInt16 nItemId, void* pNewData )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos < mpData->m_aItems.size() )
{
@@ -1315,7 +1311,7 @@ void ToolBox::SetItemData( USHORT nItemId, void* pNewData )
// -----------------------------------------------------------------------
-void* ToolBox::GetItemData( USHORT nItemId ) const
+void* ToolBox::GetItemData( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1327,9 +1323,9 @@ void* ToolBox::GetItemData( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetItemImage( USHORT nItemId, const Image& rImage )
+void ToolBox::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
@@ -1340,7 +1336,7 @@ void ToolBox::SetItemImage( USHORT nItemId, const Image& rImage )
Size aOldSize = pItem->maImage.GetSizePixel();
pItem->maImage = rImage;
if ( aOldSize != pItem->maImage.GetSizePixel() )
- ImplInvalidate( TRUE );
+ ImplInvalidate( sal_True );
else
ImplUpdateItem( nPos );
}
@@ -1355,8 +1351,8 @@ void ToolBox::SetImageList( const ImageList& rImageList )
{
maImageList = rImageList;
- USHORT nCount = (USHORT)mpData->m_aItems.size();
- for( USHORT i = 0; i < nCount; i++ )
+ sal_uInt16 nCount = (sal_uInt16)mpData->m_aItems.size();
+ for( sal_uInt16 i = 0; i < nCount; i++ )
{
Image aImage;
if ( mpData->m_aItems[i].mnId )
@@ -1378,9 +1374,9 @@ static Image ImplRotImage( const Image& rImage, long nAngle10 )
return Image( aRotBitmapEx );
}
-void ToolBox::SetItemImageAngle( USHORT nItemId, long nAngle10 )
+void ToolBox::SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
@@ -1402,7 +1398,7 @@ void ToolBox::SetItemImageAngle( USHORT nItemId, long nAngle10 )
if ( !mbCalc )
{
if ( aOldSize != pItem->maImage.GetSizePixel() )
- ImplInvalidate( TRUE );
+ ImplInvalidate( sal_True );
else
ImplUpdateItem( nPos );
}
@@ -1421,9 +1417,9 @@ static Image ImplMirrorImage( const Image& rImage )
return Image( aMirrBitmapEx );
}
-void ToolBox::SetItemImageMirrorMode( USHORT nItemId, BOOL bMirror )
+void ToolBox::SetItemImageMirrorMode( sal_uInt16 nItemId, sal_Bool bMirror )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
@@ -1449,7 +1445,7 @@ void ToolBox::SetItemImageMirrorMode( USHORT nItemId, BOOL bMirror )
// -----------------------------------------------------------------------
-Image ToolBox::GetItemImage( USHORT nItemId ) const
+Image ToolBox::GetItemImage( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1461,7 +1457,7 @@ Image ToolBox::GetItemImage( USHORT nItemId ) const
// -----------------------------------------------------------------------
-long ToolBox::GetItemImageAngle( USHORT nItemId ) const
+long ToolBox::GetItemImageAngle( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1473,32 +1469,32 @@ long ToolBox::GetItemImageAngle( USHORT nItemId ) const
// -----------------------------------------------------------------------
-BOOL ToolBox::GetItemImageMirrorMode( USHORT nItemId ) const
+sal_Bool ToolBox::GetItemImageMirrorMode( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
return pItem->mbMirrorMode;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void ToolBox::SetItemHighImage( USHORT nItemId, const Image& rImage )
+void ToolBox::SetItemHighImage( sal_uInt16 nItemId, const Image& rImage )
{
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
{
DBG_ASSERT( (pItem->maImage.GetSizePixel() == rImage.GetSizePixel()) ||
- ((!rImage) == TRUE), "ToolBox::SetItemHighImage() - ImageSize != HighImageSize" );
+ ((!rImage) == sal_True), "ToolBox::SetItemHighImage() - ImageSize != HighImageSize" );
pItem->maHighImage = rImage;
}
}
// -----------------------------------------------------------------------
-Image ToolBox::GetItemHighImage( USHORT nItemId ) const
+Image ToolBox::GetItemHighImage( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1510,9 +1506,9 @@ Image ToolBox::GetItemHighImage( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetItemText( USHORT nItemId, const XubString& rText )
+void ToolBox::SetItemText( sal_uInt16 nItemId, const XubString& rText )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
@@ -1525,7 +1521,7 @@ void ToolBox::SetItemText( USHORT nItemId, const XubString& rText )
pItem->maText = ImplConvertMenuString( rText );
mpData->ImplClearLayoutData();
if ( nOldWidth != GetCtrlTextWidth( pItem->maText ) )
- ImplInvalidate( TRUE );
+ ImplInvalidate( sal_True );
else
ImplUpdateItem( nPos );
}
@@ -1542,7 +1538,7 @@ void ToolBox::SetItemText( USHORT nItemId, const XubString& rText )
// -----------------------------------------------------------------------
-const XubString& ToolBox::GetItemText( USHORT nItemId ) const
+const XubString& ToolBox::GetItemText( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1554,9 +1550,9 @@ const XubString& ToolBox::GetItemText( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetItemWindow( USHORT nItemId, Window* pNewWindow )
+void ToolBox::SetItemWindow( sal_uInt16 nItemId, Window* pNewWindow )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
@@ -1564,14 +1560,14 @@ void ToolBox::SetItemWindow( USHORT nItemId, Window* pNewWindow )
pItem->mpWindow = pNewWindow;
if ( pNewWindow )
pNewWindow->Hide();
- ImplInvalidate( TRUE );
+ ImplInvalidate( sal_True );
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMWINDOWCHANGED, reinterpret_cast< void* >( nPos ) );
}
}
// -----------------------------------------------------------------------
-Window* ToolBox::GetItemWindow( USHORT nItemId ) const
+Window* ToolBox::GetItemWindow( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1590,7 +1586,7 @@ void ToolBox::StartSelection()
if ( !mbSelection )
{
- mbSelection = TRUE;
+ mbSelection = sal_True;
mnCurPos = TOOLBOX_ITEM_NOTFOUND;
mnCurItemId = 0;
Activate();
@@ -1601,13 +1597,13 @@ void ToolBox::StartSelection()
void ToolBox::EndSelection()
{
- mbCommandDrag = FALSE;
+ mbCommandDrag = sal_False;
if ( mbDrag || mbSelection )
{
// Daten zuruecksetzen
- mbDrag = FALSE;
- mbSelection = FALSE;
+ mbDrag = sal_False;
+ mbSelection = sal_False;
if ( mnCurPos != TOOLBOX_ITEM_NOTFOUND )
ImplDrawItem( mnCurPos );
EndTracking();
@@ -1624,9 +1620,9 @@ void ToolBox::EndSelection()
// -----------------------------------------------------------------------
-void ToolBox::SetItemDown( USHORT nItemId, BOOL bDown, BOOL bRelease )
+void ToolBox::SetItemDown( sal_uInt16 nItemId, sal_Bool bDown, sal_Bool bRelease )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
@@ -1635,7 +1631,7 @@ void ToolBox::SetItemDown( USHORT nItemId, BOOL bDown, BOOL bRelease )
if ( nPos != mnCurPos )
{
mnCurPos = nPos;
- ImplDrawItem( mnCurPos, TRUE );
+ ImplDrawItem( mnCurPos, sal_True );
Flush();
}
}
@@ -1643,7 +1639,7 @@ void ToolBox::SetItemDown( USHORT nItemId, BOOL bDown, BOOL bRelease )
{
if ( nPos == mnCurPos )
{
- ImplDrawItem( mnCurPos, FALSE );
+ ImplDrawItem( mnCurPos, sal_False );
Flush();
mnCurPos = TOOLBOX_ITEM_NOTFOUND;
}
@@ -1653,8 +1649,8 @@ void ToolBox::SetItemDown( USHORT nItemId, BOOL bDown, BOOL bRelease )
{
if ( mbDrag || mbSelection )
{
- mbDrag = FALSE;
- mbSelection = FALSE;
+ mbDrag = sal_False;
+ mbSelection = sal_False;
EndTracking();
ReleaseMouse();
Deactivate();
@@ -1670,21 +1666,21 @@ void ToolBox::SetItemDown( USHORT nItemId, BOOL bDown, BOOL bRelease )
// -----------------------------------------------------------------------
-BOOL ToolBox::IsItemDown( USHORT nItemId ) const
+sal_Bool ToolBox::IsItemDown( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
return (nPos == mnCurPos);
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void ToolBox::SetItemState( USHORT nItemId, TriState eState )
+void ToolBox::SetItemState( sal_uInt16 nItemId, TriState eState )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
@@ -1698,8 +1694,8 @@ void ToolBox::SetItemState( USHORT nItemId, TriState eState )
(pItem->mnBits & TIB_RADIOCHECK) )
{
ImplToolItem* pGroupItem;
- USHORT nGroupPos;
- USHORT nItemCount = GetItemCount();
+ sal_uInt16 nGroupPos;
+ sal_uInt16 nItemCount = GetItemCount();
nGroupPos = nPos;
while ( nGroupPos )
@@ -1744,7 +1740,7 @@ void ToolBox::SetItemState( USHORT nItemId, TriState eState )
// -----------------------------------------------------------------------
-TriState ToolBox::GetItemState( USHORT nItemId ) const
+TriState ToolBox::GetItemState( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1756,15 +1752,15 @@ TriState ToolBox::GetItemState( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::EnableItem( USHORT nItemId, BOOL bEnable )
+void ToolBox::EnableItem( sal_uInt16 nItemId, sal_Bool bEnable )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
ImplToolItem* pItem = &mpData->m_aItems[nPos];
if ( bEnable )
- bEnable = TRUE;
+ bEnable = sal_True;
if ( pItem->mbEnabled != bEnable )
{
pItem->mbEnabled = bEnable;
@@ -1788,21 +1784,21 @@ void ToolBox::EnableItem( USHORT nItemId, BOOL bEnable )
// -----------------------------------------------------------------------
-BOOL ToolBox::IsItemEnabled( USHORT nItemId ) const
+sal_Bool ToolBox::IsItemEnabled( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
return pItem->mbEnabled;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void ToolBox::ShowItem( USHORT nItemId, BOOL bVisible )
+void ToolBox::ShowItem( sal_uInt16 nItemId, sal_Bool bVisible )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
mpData->ImplClearLayoutData();
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
@@ -1811,36 +1807,36 @@ void ToolBox::ShowItem( USHORT nItemId, BOOL bVisible )
if ( pItem->mbVisible != bVisible )
{
pItem->mbVisible = bVisible;
- ImplInvalidate( FALSE );
+ ImplInvalidate( sal_False );
}
}
}
// -----------------------------------------------------------------------
-BOOL ToolBox::IsItemVisible( USHORT nItemId ) const
+sal_Bool ToolBox::IsItemVisible( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
return pItem->mbVisible;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL ToolBox::IsItemReallyVisible( USHORT nItemId ) const
+sal_Bool ToolBox::IsItemReallyVisible( sal_uInt16 nItemId ) const
{
// is the item on the visible area of the toolbox?
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
Rectangle aRect( mnLeftBorder, mnTopBorder, mnDX-mnRightBorder, mnDY-mnBottomBorder );
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem && pItem->mbVisible &&
!pItem->maRect.IsEmpty() && aRect.IsOver( pItem->maRect ) )
{
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -1848,7 +1844,7 @@ BOOL ToolBox::IsItemReallyVisible( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetItemCommand( USHORT nItemId, const XubString& rCommand )
+void ToolBox::SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand )
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1858,7 +1854,7 @@ void ToolBox::SetItemCommand( USHORT nItemId, const XubString& rCommand )
// -----------------------------------------------------------------------
-const XubString& ToolBox::GetItemCommand( USHORT nItemId ) const
+const XubString& ToolBox::GetItemCommand( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1870,7 +1866,7 @@ const XubString& ToolBox::GetItemCommand( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetQuickHelpText( USHORT nItemId, const XubString& rText )
+void ToolBox::SetQuickHelpText( sal_uInt16 nItemId, const XubString& rText )
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1880,7 +1876,7 @@ void ToolBox::SetQuickHelpText( USHORT nItemId, const XubString& rText )
// -----------------------------------------------------------------------
-const XubString& ToolBox::GetQuickHelpText( USHORT nItemId ) const
+const XubString& ToolBox::GetQuickHelpText( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1892,7 +1888,7 @@ const XubString& ToolBox::GetQuickHelpText( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetHelpText( USHORT nItemId, const XubString& rText )
+void ToolBox::SetHelpText( sal_uInt16 nItemId, const XubString& rText )
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1902,31 +1898,38 @@ void ToolBox::SetHelpText( USHORT nItemId, const XubString& rText )
// -----------------------------------------------------------------------
-const XubString& ToolBox::GetHelpText( USHORT nItemId ) const
+const XubString& ToolBox::GetHelpText( sal_uInt16 nItemId ) const
{
return ImplGetHelpText( nItemId );
}
// -----------------------------------------------------------------------
-void ToolBox::SetHelpId( USHORT nItemId, ULONG nHelpId )
+void ToolBox::SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId )
{
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
- pItem->mnHelpId = nHelpId;
+ pItem->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
-ULONG ToolBox::GetHelpId( USHORT nItemId ) const
+rtl::OString ToolBox::GetHelpId( sal_uInt16 nItemId ) const
{
+ rtl::OString aRet;
+
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
- return pItem->mnHelpId;
- else
- return 0;
+ {
+ if ( pItem->maHelpId.getLength() )
+ aRet = pItem->maHelpId;
+ else
+ aRet = ::rtl::OUStringToOString( pItem->maCommandStr, RTL_TEXTENCODING_UTF8 );
+ }
+
+ return aRet;
}
// -----------------------------------------------------------------------
@@ -1936,12 +1939,12 @@ void ToolBox::SetBorder( long nX, long nY )
mnBorderX = nX;
mnBorderY = nY;
- ImplInvalidate( TRUE, TRUE );
+ ImplInvalidate( sal_True, sal_True );
}
// -----------------------------------------------------------------------
-void ToolBox::SetOutStyle( USHORT nNewStyle )
+void ToolBox::SetOutStyle( sal_uInt16 nNewStyle )
{
// always force flat looking toolbars since NWF
nNewStyle |= TOOLBOX_STYLE_FLAT;
@@ -1958,7 +1961,7 @@ void ToolBox::SetOutStyle( USHORT nNewStyle )
mnMaxItemHeight = 1;
}
- ImplInvalidate( TRUE, TRUE );
+ ImplInvalidate( sal_True, sal_True );
}
}
@@ -1966,7 +1969,7 @@ void ToolBox::SetOutStyle( USHORT nNewStyle )
void ToolBox::RecalcItems()
{
- ImplInvalidate( TRUE );
+ ImplInvalidate( sal_True );
}
// -----------------------------------------------------------------------
@@ -1981,11 +1984,11 @@ void ToolBox::ImplUpdateInputEnable()
if( it->mbEnabled )
{
// at least one useful entry
- mpData->mbKeyInputDisabled = FALSE;
+ mpData->mbKeyInputDisabled = sal_False;
return;
}
}
- mpData->mbKeyInputDisabled = TRUE;
+ mpData->mbKeyInputDisabled = sal_True;
}
// -----------------------------------------------------------------------
@@ -1994,14 +1997,14 @@ void ToolBox::ImplFillLayoutData() const
{
mpData->m_pLayoutData = new ToolBoxLayoutData();
- USHORT nCount = (USHORT)mpData->m_aItems.size();
- for( USHORT i = 0; i < nCount; i++ )
+ sal_uInt16 nCount = (sal_uInt16)mpData->m_aItems.size();
+ for( sal_uInt16 i = 0; i < nCount; i++ )
{
ImplToolItem* pItem = &mpData->m_aItems[i];
// Nur malen, wenn Rechteck im PaintRectangle liegt
if ( !pItem->maRect.IsEmpty() )
- const_cast<ToolBox*>(this)->ImplDrawItem( i, FALSE, FALSE, TRUE );
+ const_cast<ToolBox*>(this)->ImplDrawItem( i, sal_False, sal_False, sal_True );
}
}
@@ -2016,14 +2019,14 @@ String ToolBox::GetDisplayText() const
// -----------------------------------------------------------------------
-Rectangle ToolBox::GetCharacterBounds( USHORT nItemID, long nIndex ) const
+Rectangle ToolBox::GetCharacterBounds( sal_uInt16 nItemID, long nIndex ) const
{
long nItemIndex = -1;
if( ! mpData->m_pLayoutData )
ImplFillLayoutData();
if( mpData->m_pLayoutData )
{
- for( ULONG i = 0; i < mpData->m_pLayoutData->m_aLineItemIds.size(); i++ )
+ for( sal_uLong i = 0; i < mpData->m_pLayoutData->m_aLineItemIds.size(); i++ )
{
if( mpData->m_pLayoutData->m_aLineItemIds[i] == nItemID )
{
@@ -2037,7 +2040,7 @@ Rectangle ToolBox::GetCharacterBounds( USHORT nItemID, long nIndex ) const
// -----------------------------------------------------------------------
-long ToolBox::GetIndexForPoint( const Point& rPoint, USHORT& rItemID ) const
+long ToolBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const
{
long nIndex = -1;
rItemID = 0;
@@ -2046,7 +2049,7 @@ long ToolBox::GetIndexForPoint( const Point& rPoint, USHORT& rItemID ) const
if( mpData->m_pLayoutData )
{
nIndex = mpData->m_pLayoutData->GetIndexForPoint( rPoint );
- for( ULONG i = 0; i < mpData->m_pLayoutData->m_aLineIndices.size(); i++ )
+ for( sal_uLong i = 0; i < mpData->m_pLayoutData->m_aLineIndices.size(); i++ )
{
if( mpData->m_pLayoutData->m_aLineIndices[i] <= nIndex &&
(i == mpData->m_pLayoutData->m_aLineIndices.size()-1 || mpData->m_pLayoutData->m_aLineIndices[i+1] > nIndex) )
@@ -2079,12 +2082,12 @@ Pair ToolBox::GetTextStartEnd( long nText ) const
// -----------------------------------------------------------------------
-USHORT ToolBox::GetDisplayItemId( long nText ) const
+sal_uInt16 ToolBox::GetDisplayItemId( long nText ) const
{
- USHORT nItemId = 0;
+ sal_uInt16 nItemId = 0;
if( ! mpData->m_pLayoutData )
ImplFillLayoutData();
- if( mpData->m_pLayoutData && nText >= 0 && (ULONG)nText < mpData->m_pLayoutData->m_aLineItemIds.size() )
+ if( mpData->m_pLayoutData && nText >= 0 && (sal_uLong)nText < mpData->m_pLayoutData->m_aLineItemIds.size() )
nItemId = mpData->m_pLayoutData->m_aLineItemIds[nText];
return nItemId;
}
@@ -2104,7 +2107,7 @@ const Link& ToolBox::GetDropdownClickHdl() const
// -----------------------------------------------------------------------
-void ToolBox::SetMenuType( USHORT aType )
+void ToolBox::SetMenuType( sal_uInt16 aType )
{
if( aType != mpData->maMenuType )
{
@@ -2114,9 +2117,9 @@ void ToolBox::SetMenuType( USHORT aType )
// the menu button may have to be moved into the decoration which changes the layout
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
if( pWrapper )
- pWrapper->ShowTitleButton( TITLE_BUTTON_MENU, ( aType & TOOLBOX_MENUTYPE_CUSTOMIZE) ? TRUE : FALSE );
+ pWrapper->ShowTitleButton( TITLE_BUTTON_MENU, ( aType & TOOLBOX_MENUTYPE_CUSTOMIZE) ? sal_True : sal_False );
- mbFormat = TRUE;
+ mbFormat = sal_True;
ImplFormat();
ImplSetMinMaxFloatSize( this );
}
@@ -2129,12 +2132,12 @@ void ToolBox::SetMenuType( USHORT aType )
}
}
-USHORT ToolBox::GetMenuType() const
+sal_uInt16 ToolBox::GetMenuType() const
{
return mpData->maMenuType;
}
-BOOL ToolBox::IsMenuEnabled() const
+sal_Bool ToolBox::IsMenuEnabled() const
{
return mpData->maMenuType != TOOLBOX_MENUTYPE_NONE;
}
@@ -2156,7 +2159,7 @@ const Link& ToolBox::GetMenuButtonHdl() const
// -----------------------------------------------------------------------
-BOOL ToolBox::ImplHasClippedItems()
+sal_Bool ToolBox::ImplHasClippedItems()
{
// are any items currently clipped ?
ImplFormat();
@@ -2164,10 +2167,10 @@ BOOL ToolBox::ImplHasClippedItems()
while ( it != mpData->m_aItems.end() )
{
if( it->IsClipped() )
- return TRUE;
+ return sal_True;
++it;
}
- return FALSE;
+ return sal_False;
}
void ToolBox::ImplUpdateCustomMenu()
@@ -2178,7 +2181,7 @@ void ToolBox::ImplUpdateCustomMenu()
PopupMenu *pMenu = GetMenu();
- USHORT i = 0;
+ sal_uInt16 i = 0;
// remove old entries
while( i < pMenu->GetItemCount() )
{
@@ -2199,7 +2202,7 @@ void ToolBox::ImplUpdateCustomMenu()
{
if( it->IsClipped() )
{
- USHORT id = it->mnId + TOOLBOX_MENUITEM_START;
+ sal_uInt16 id = it->mnId + TOOLBOX_MENUITEM_START;
pMenu->InsertItem( id, it->maText, it->maImage, 0, 0 );
pMenu->EnableItem( id, it->mbEnabled );
pMenu->CheckItem( id, it->meState == STATE_CHECK );
@@ -2212,9 +2215,9 @@ IMPL_LINK( ToolBox, ImplCustomMenuListener, VclMenuEvent*, pEvent )
{
if( pEvent->GetMenu() == GetMenu() && pEvent->GetId() == VCLEVENT_MENU_SELECT )
{
- USHORT id = GetMenu()->GetItemId( pEvent->GetItemPos() );
+ sal_uInt16 id = GetMenu()->GetItemId( pEvent->GetItemPos() );
if( id >= TOOLBOX_MENUITEM_START )
- TriggerItem( id - TOOLBOX_MENUITEM_START, FALSE, FALSE );
+ TriggerItem( id - TOOLBOX_MENUITEM_START, sal_False, sal_False );
}
return 0;
}
@@ -2262,7 +2265,7 @@ void ToolBox::ImplExecuteCustomMenu()
}
}
- USHORT uId = GetMenu()->Execute( pWin, Rectangle( ImplGetPopupPosition( aMenuRect, Size() ), Size() ),
+ sal_uInt16 uId = GetMenu()->Execute( pWin, Rectangle( ImplGetPopupPosition( aMenuRect, Size() ), Size() ),
POPUPMENU_EXECUTE_DOWN | POPUPMENU_NOMOUSEUPCLOSE );
if ( aDelData.IsDelete() )
@@ -2299,24 +2302,24 @@ void ToolBox::ExecuteCustomMenu()
// -----------------------------------------------------------------------
// checks override first, useful during calculation of sizes
-BOOL ToolBox::ImplIsFloatingMode() const
+sal_Bool ToolBox::ImplIsFloatingMode() const
{
DBG_ASSERT( !(mpData->mbAssumeDocked && mpData->mbAssumeFloating),
"ToolBox::ImplIsFloatingMode(): cannot assume docked and floating" );
if( mpData->mbAssumeDocked )
- return FALSE;
+ return sal_False;
else if( mpData->mbAssumeFloating )
- return TRUE;
+ return sal_True;
else
return IsFloatingMode();
}
// checks override first, useful during calculation of sizes
-BOOL ToolBox::ImplIsInPopupMode() const
+sal_Bool ToolBox::ImplIsInPopupMode() const
{
if( mpData->mbAssumePopupMode )
- return TRUE;
+ return sal_True;
else
{
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
@@ -2326,7 +2329,7 @@ BOOL ToolBox::ImplIsInPopupMode() const
// -----------------------------------------------------------------------
-void ToolBox::Lock( BOOL bLock )
+void ToolBox::Lock( sal_Bool bLock )
{
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
if( !pWrapper )
@@ -2336,8 +2339,8 @@ void ToolBox::Lock( BOOL bLock )
mpData->mbIsLocked = bLock;
if( !ImplIsFloatingMode() )
{
- mbCalc = TRUE;
- mbFormat = TRUE;
+ mbCalc = sal_True;
+ mbFormat = sal_True;
SetSizePixel( CalcWindowSizePixel(1) );
Invalidate();
}
@@ -2346,7 +2349,7 @@ void ToolBox::Lock( BOOL bLock )
// -----------------------------------------------------------------------
-BOOL ToolBox::AlwaysLocked()
+sal_Bool ToolBox::AlwaysLocked()
{
// read config item to determine toolbox behaviour, used for subtoolbars
@@ -2362,35 +2365,35 @@ BOOL ToolBox::AlwaysLocked()
if ( aNode.isValid() )
{
// feature enabled ?
- BOOL bStatesEnabled = BOOL();
+ sal_Bool bStatesEnabled = sal_Bool();
::com::sun::star::uno::Any aValue = aNode.getNodeValue( OUString(RTL_CONSTASCII_USTRINGPARAM("StatesEnabled")) );
if( aValue >>= bStatesEnabled )
{
- if( bStatesEnabled == TRUE )
+ if( bStatesEnabled == sal_True )
{
// now read the locking state
utl::OConfigurationNode aNode2 = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
vcl::unohelper::GetMultiServiceFactory(),
OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.UI.GlobalSettings/Toolbars/States")) ); // note: case sensisitive !
- BOOL bLocked = BOOL();
+ sal_Bool bLocked = sal_Bool();
::com::sun::star::uno::Any aValue2 = aNode2.getNodeValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Locked")) );
if( aValue2 >>= bLocked )
- nAlwaysLocked = (bLocked == TRUE) ? 1 : 0;
+ nAlwaysLocked = (bLocked == sal_True) ? 1 : 0;
}
}
}
}
- return nAlwaysLocked == 1 ? TRUE : FALSE;
+ return nAlwaysLocked == 1 ? sal_True : sal_False;
}
-BOOL ToolBox::WillUsePopupMode() const
+sal_Bool ToolBox::WillUsePopupMode() const
{
return mpData->mbWillUsePopupMode;
}
-void ToolBox::WillUsePopupMode( BOOL b )
+void ToolBox::WillUsePopupMode( sal_Bool b )
{
mpData->mbWillUsePopupMode = b;
}
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index b20a82d1dc7b..5a5379da2ffa 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -34,14 +34,12 @@
#include "vcl/salinst.hxx"
#include "vcl/salgtype.hxx"
#include "vcl/salgdi.hxx"
-#include "vcl/salctrlhandle.hxx"
#include "vcl/unohelp.hxx"
#include "tools/time.hxx"
#include "tools/debug.hxx"
#include "tools/rc.h"
#include "vcl/svdata.hxx"
-#include "vcl/windata.hxx"
#include "vcl/dbggui.hxx"
#include "vcl/outfont.hxx"
#include "vcl/outdev.h"
@@ -65,6 +63,7 @@
#include "unotools/fontcfg.hxx"
#include "vcl/sysdata.hxx"
#include "vcl/sallayout.hxx"
+#include "vcl/salctype.hxx"
#include "vcl/button.hxx" // Button::GetStandardText
#include "vcl/taskpanelist.hxx"
#include "com/sun/star/awt/XWindowPeer.hpp"
@@ -87,7 +86,6 @@
#include "vcl/unowrap.hxx"
#include "vcl/dndlcon.hxx"
#include "vcl/dndevdis.hxx"
-#include "vcl/impbmpconv.hxx"
#include "unotools/confignode.hxx"
#include "vcl/gdimtf.hxx"
#include <sal/macros.h>
@@ -114,12 +112,12 @@ DBG_NAME( Window )
// =======================================================================
-#define IMPL_PAINT_PAINT ((USHORT)0x0001)
-#define IMPL_PAINT_PAINTALL ((USHORT)0x0002)
-#define IMPL_PAINT_PAINTALLCHILDS ((USHORT)0x0004)
-#define IMPL_PAINT_PAINTCHILDS ((USHORT)0x0008)
-#define IMPL_PAINT_ERASE ((USHORT)0x0010)
-#define IMPL_PAINT_CHECKRTL ((USHORT)0x0020)
+#define IMPL_PAINT_PAINT ((sal_uInt16)0x0001)
+#define IMPL_PAINT_PAINTALL ((sal_uInt16)0x0002)
+#define IMPL_PAINT_PAINTALLCHILDS ((sal_uInt16)0x0004)
+#define IMPL_PAINT_PAINTCHILDS ((sal_uInt16)0x0008)
+#define IMPL_PAINT_ERASE ((sal_uInt16)0x0010)
+#define IMPL_PAINT_CHECKRTL ((sal_uInt16)0x0020)
// -----------------------------------------------------------------------
@@ -134,25 +132,21 @@ struct ImplCalcToTopData
Region* mpInvalidateRegion;
};
-struct ImplAccessibleInfos
+ImplAccessibleInfos::ImplAccessibleInfos()
{
- USHORT nAccessibleRole;
- String* pAccessibleName;
- String* pAccessibleDescription;
-
- ImplAccessibleInfos()
- {
- nAccessibleRole = 0xFFFF;
- pAccessibleName = NULL;
- pAccessibleDescription = NULL;
- }
+ nAccessibleRole = 0xFFFF;
+ pAccessibleName = NULL;
+ pAccessibleDescription = NULL;
+ pLabeledByWindow = NULL;
+ pLabelForWindow = NULL;
+ pMemberOfWindow = NULL;
+}
- ~ImplAccessibleInfos()
- {
- delete pAccessibleName;
- delete pAccessibleDescription;
- }
-};
+ImplAccessibleInfos::~ImplAccessibleInfos()
+{
+ delete pAccessibleName;
+ delete pAccessibleDescription;
+}
// -----------------------------------------------------------------------
@@ -268,29 +262,53 @@ bool Window::ImplCheckUIFont( const Font& rFont )
if( ImplGetSVData()->maGDIData.mbNativeFontConfig )
return true;
+ // create a text string using the localized text of important buttons
String aTestText;
- aTestText.Append( Button::GetStandardText( BUTTON_OK ) );
- aTestText.Append( Button::GetStandardText( BUTTON_CANCEL ) );
- aTestText.Append( Button::GetStandardText( BUTTON_YES ) );
- aTestText.Append( Button::GetStandardText( BUTTON_NO ) );
- aTestText.Append( Button::GetStandardText( BUTTON_RETRY ) );
- aTestText.Append( Button::GetStandardText( BUTTON_HELP ) );
- aTestText.Append( Button::GetStandardText( BUTTON_CLOSE ) );
- aTestText.Append( Button::GetStandardText( BUTTON_MORE ) );
- aTestText.Append( Button::GetStandardText( BUTTON_LESS ) );
- aTestText.Append( Button::GetStandardText( BUTTON_ABORT ) );
+ static const StandardButtonType aTestButtons[] =
+ {
+ BUTTON_OK, BUTTON_CANCEL, BUTTON_CLOSE, BUTTON_ABORT,
+ BUTTON_YES, BUTTON_NO, BUTTON_MORE, BUTTON_IGNORE,
+ BUTTON_RETRY, BUTTON_HELP
+ };
+
+ const int nTestButtonCount = sizeof(aTestButtons)/sizeof(*aTestButtons);
+ for( int n = 0; n < nTestButtonCount; ++n )
+ {
+ String aButtonStr = Button::GetStandardText( aTestButtons[n] );
+ // #i115432# ignore mnemonic+accelerator part of each string
+ // TODO: use a string filtering method when it becomes available
+ const int nLen = aButtonStr.Len();
+ bool bInside = false;
+ for( int i = 0; i < nLen; ++i ) {
+ const sal_Unicode c = aButtonStr.GetChar( i );
+ if( (c == '('))
+ bInside = true;
+ if( (c == ')'))
+ bInside = false;
+ if( (c == '~')
+ || (c == '(') || (c == ')')
+ || ((c >= 'A') && (c <= 'Z') && bInside) )
+ aButtonStr.SetChar( i, ' ' );
+ }
+ // append sanitized button text to test string
+ aTestText.Append( aButtonStr );
+ }
- return HasGlyphs( rFont, aTestText ) >= aTestText.Len();
+ const int nFirstChar = HasGlyphs( rFont, aTestText );
+ const bool bUIFontOk = (nFirstChar >= aTestText.Len());
+ return bUIFontOk;
}
// -----------------------------------------------------------------------
-void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
+void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl )
{
StyleSettings aTmpSt( rSettings.GetStyleSettings() );
- aTmpSt.SetHighContrastMode( FALSE );
+ aTmpSt.SetHighContrastMode( sal_False );
rSettings.SetStyleSettings( aTmpSt );
ImplGetFrame()->UpdateSettings( rSettings );
+ // reset default border width for layouters
+ ImplGetSVData()->maAppData.mnDefaultLayoutBorder = -1;
// Verify availability of the configured UI font, otherwise choose "Andale Sans UI"
String aUserInterfaceFont;
@@ -490,7 +508,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
|| rSettings.GetStyleSettings().GetWindowColor().IsDark() )
{
aStyleSettings = rSettings.GetStyleSettings();
- aStyleSettings.SetHighContrastMode( TRUE );
+ aStyleSettings.SetHighContrastMode( sal_True );
aStyleSettings.SetSymbolsStyle( STYLE_SYMBOLS_HICONTRAST );
rSettings.SetStyleSettings( aStyleSettings );
}
@@ -500,7 +518,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
static const char* pEnvHC = getenv( "SAL_FORCE_HC" );
if( pEnvHC && *pEnvHC )
{
- aStyleSettings.SetHighContrastMode( TRUE );
+ aStyleSettings.SetHighContrastMode( sal_True );
aStyleSettings.SetSymbolsStyle( STYLE_SYMBOLS_HICONTRAST );
rSettings.SetStyleSettings( aStyleSettings );
}
@@ -595,6 +613,7 @@ void Window::ImplInitWindowData( WindowType nType )
mpWindowImpl->mpDlgCtrlDownWindow = NULL; // window for dialog control
mpWindowImpl->mpFirstDel = NULL; // Dtor notification list
mpWindowImpl->mpUserData = NULL; // user data
+ mpWindowImpl->mpExtImpl = NULL; // extended implementation data
mpWindowImpl->mpCursor = NULL; // cursor
mpWindowImpl->mpControlFont = NULL; // font propertie
mpWindowImpl->mpVCLXWindow = NULL;
@@ -608,8 +627,6 @@ void Window::ImplInitWindowData( WindowType nType )
mpWindowImpl->mnX = 0; // X-Position to Parent
mpWindowImpl->mnY = 0; // Y-Position to Parent
mpWindowImpl->mnAbsScreenX = 0; // absolute X-position on screen, used for RTL window positioning
- mpWindowImpl->mnHelpId = 0; // help id
- mpWindowImpl->mnUniqId = 0; // unique id
mpWindowImpl->mpChildClipRegion = NULL; // Child-Clip-Region when ClipChildren
mpWindowImpl->mpPaintRegion = NULL; // Paint-ClipRegion
mpWindowImpl->mnStyle = 0; // style (init in ImplInitWindow)
@@ -625,83 +642,83 @@ void Window::ImplInitWindowData( WindowType nType )
mpWindowImpl->mnDlgCtrlFlags = 0; // DialogControl-Flags
mpWindowImpl->mnLockCount = 0; // LockCount
mpWindowImpl->meAlwaysInputMode = AlwaysInputNone; // neither AlwaysEnableInput nor AlwaysDisableInput called
- mpWindowImpl->mbFrame = FALSE; // TRUE: Window is a frame window
- mpWindowImpl->mbBorderWin = FALSE; // TRUE: Window is a border window
- mpWindowImpl->mbOverlapWin = FALSE; // TRUE: Window is a overlap window
- mpWindowImpl->mbSysWin = FALSE; // TRUE: SystemWindow is the base class
- mpWindowImpl->mbDialog = FALSE; // TRUE: Dialog is the base class
- mpWindowImpl->mbDockWin = FALSE; // TRUE: DockingWindow is the base class
- mpWindowImpl->mbFloatWin = FALSE; // TRUE: FloatingWindow is the base class
- mpWindowImpl->mbPushButton = FALSE; // TRUE: PushButton is the base class
- mpWindowImpl->mbToolBox = FALSE; // TRUE: ToolBox is the base class
- mpWindowImpl->mbMenuFloatingWindow= FALSE; // TRUE: MenuFloatingWindow is the base class
- mpWindowImpl->mbToolbarFloatingWindow= FALSE; // TRUE: ImplPopupFloatWin is the base class, used for subtoolbars
- mpWindowImpl->mbSplitter = FALSE; // TRUE: Splitter is the base class
- mpWindowImpl->mbVisible = FALSE; // TRUE: Show( true ) called
- mpWindowImpl->mbOverlapVisible = FALSE; // TRUE: Hide called for visible window from ImplHideAllOverlapWindow()
- mpWindowImpl->mbDisabled = FALSE; // TRUE: Enable( FALSE ) called
- mpWindowImpl->mbInputDisabled = FALSE; // TRUE: EnableInput( FALSE ) called
- mpWindowImpl->mbDropDisabled = FALSE; // TRUE: Drop is enabled
- mpWindowImpl->mbNoUpdate = FALSE; // TRUE: SetUpdateMode( FALSE ) called
- mpWindowImpl->mbNoParentUpdate = FALSE; // TRUE: SetParentUpdateMode( FALSE ) called
- mpWindowImpl->mbActive = FALSE; // TRUE: Window Active
- mpWindowImpl->mbParentActive = FALSE; // TRUE: OverlapActive from Parent
- mpWindowImpl->mbReallyVisible = FALSE; // TRUE: this and all parents to an overlaped window are visible
- mpWindowImpl->mbReallyShown = FALSE; // TRUE: this and all parents to an overlaped window are shown
- mpWindowImpl->mbInInitShow = FALSE; // TRUE: we are in InitShow
- mpWindowImpl->mbChildNotify = FALSE; // TRUE: ChildNotify
- mpWindowImpl->mbChildPtrOverwrite = FALSE; // TRUE: PointerStyle overwrites Child-Pointer
- mpWindowImpl->mbNoPtrVisible = FALSE; // TRUE: ShowPointer( FALSE ) called
- mpWindowImpl->mbMouseMove = FALSE; // TRUE: BaseMouseMove called
- mpWindowImpl->mbPaintFrame = FALSE; // TRUE: Paint is visible, but not painted
- mpWindowImpl->mbInPaint = FALSE; // TRUE: Inside PaintHdl
- mpWindowImpl->mbMouseButtonDown = FALSE; // TRUE: BaseMouseButtonDown called
- mpWindowImpl->mbMouseButtonUp = FALSE; // TRUE: BaseMouseButtonUp called
- mpWindowImpl->mbKeyInput = FALSE; // TRUE: BaseKeyInput called
- mpWindowImpl->mbKeyUp = FALSE; // TRUE: BaseKeyUp called
- mpWindowImpl->mbCommand = FALSE; // TRUE: BaseCommand called
- mpWindowImpl->mbDefPos = TRUE; // TRUE: Position is not Set
- mpWindowImpl->mbDefSize = TRUE; // TRUE: Size is not Set
- mpWindowImpl->mbCallMove = TRUE; // TRUE: Move must be called by Show
- mpWindowImpl->mbCallResize = TRUE; // TRUE: Resize must be called by Show
- mpWindowImpl->mbWaitSystemResize = TRUE; // TRUE: Wait for System-Resize
- mpWindowImpl->mbInitWinClipRegion = TRUE; // TRUE: Calc Window Clip Region
- mpWindowImpl->mbInitChildRegion = FALSE; // TRUE: InitChildClipRegion
- mpWindowImpl->mbWinRegion = FALSE; // TRUE: Window Region
- mpWindowImpl->mbClipChildren = FALSE; // TRUE: Child-Fenster muessen evt. geclippt werden
- mpWindowImpl->mbClipSiblings = FALSE; // TRUE: Nebeneinanderliegende Child-Fenster muessen evt. geclippt werden
- mpWindowImpl->mbChildTransparent = FALSE; // TRUE: Child-Fenster duerfen transparent einschalten (inkl. Parent-CLIPCHILDREN)
- mpWindowImpl->mbPaintTransparent = FALSE; // TRUE: Paints muessen auf Parent ausgeloest werden
- mpWindowImpl->mbMouseTransparent = FALSE; // TRUE: Window is transparent for Mouse
- mpWindowImpl->mbDlgCtrlStart = FALSE; // TRUE: Ab hier eigenes Dialog-Control
- mpWindowImpl->mbFocusVisible = FALSE; // TRUE: Focus Visible
- mpWindowImpl->mbUseNativeFocus = FALSE;
- mpWindowImpl->mbNativeFocusVisible= FALSE; // TRUE: native Focus Visible
- mpWindowImpl->mbInShowFocus = FALSE; // prevent recursion
- mpWindowImpl->mbInHideFocus = FALSE; // prevent recursion
- mpWindowImpl->mbTrackVisible = FALSE; // TRUE: Tracking Visible
- mpWindowImpl->mbControlForeground = FALSE; // TRUE: Foreground-Property set
- mpWindowImpl->mbControlBackground = FALSE; // TRUE: Background-Property set
- mpWindowImpl->mbAlwaysOnTop = FALSE; // TRUE: immer vor allen anderen normalen Fenstern sichtbar
- mpWindowImpl->mbCompoundControl = FALSE; // TRUE: Zusammengesetztes Control => Listener...
- mpWindowImpl->mbCompoundControlHasFocus = FALSE; // TRUE: Zusammengesetztes Control hat irgendwo den Focus
- mpWindowImpl->mbPaintDisabled = FALSE; // TRUE: Paint soll nicht ausgefuehrt werden
- mpWindowImpl->mbAllResize = FALSE; // TRUE: Auch ResizeEvents mit 0,0 schicken
- mpWindowImpl->mbInDtor = FALSE; // TRUE: Wir befinden uns im Window-Dtor
- mpWindowImpl->mbExtTextInput = FALSE; // TRUE: ExtTextInput-Mode is active
- mpWindowImpl->mbInFocusHdl = FALSE; // TRUE: Innerhalb vom GetFocus-Handler
- mpWindowImpl->mbCreatedWithToolkit = FALSE;
- mpWindowImpl->mbSuppressAccessibilityEvents = FALSE; // TRUE: do not send any accessibility events
- mpWindowImpl->mbDrawSelectionBackground = FALSE; // TRUE: draws transparent window background to indicate (toolbox) selection
- mpWindowImpl->mbIsInTaskPaneList = FALSE; // TRUE: window was added to the taskpanelist in the topmost system window
+ mpWindowImpl->mbFrame = sal_False; // sal_True: Window is a frame window
+ mpWindowImpl->mbBorderWin = sal_False; // sal_True: Window is a border window
+ mpWindowImpl->mbOverlapWin = sal_False; // sal_True: Window is a overlap window
+ mpWindowImpl->mbSysWin = sal_False; // sal_True: SystemWindow is the base class
+ mpWindowImpl->mbDialog = sal_False; // sal_True: Dialog is the base class
+ mpWindowImpl->mbDockWin = sal_False; // sal_True: DockingWindow is the base class
+ mpWindowImpl->mbFloatWin = sal_False; // sal_True: FloatingWindow is the base class
+ mpWindowImpl->mbPushButton = sal_False; // sal_True: PushButton is the base class
+ mpWindowImpl->mbToolBox = sal_False; // sal_True: ToolBox is the base class
+ mpWindowImpl->mbMenuFloatingWindow= sal_False; // sal_True: MenuFloatingWindow is the base class
+ mpWindowImpl->mbToolbarFloatingWindow= sal_False; // sal_True: ImplPopupFloatWin is the base class, used for subtoolbars
+ mpWindowImpl->mbSplitter = sal_False; // sal_True: Splitter is the base class
+ mpWindowImpl->mbVisible = sal_False; // sal_True: Show( sal_True ) called
+ mpWindowImpl->mbOverlapVisible = sal_False; // sal_True: Hide called for visible window from ImplHideAllOverlapWindow()
+ mpWindowImpl->mbDisabled = sal_False; // sal_True: Enable( sal_False ) called
+ mpWindowImpl->mbInputDisabled = sal_False; // sal_True: EnableInput( sal_False ) called
+ mpWindowImpl->mbDropDisabled = sal_False; // sal_True: Drop is enabled
+ mpWindowImpl->mbNoUpdate = sal_False; // sal_True: SetUpdateMode( sal_False ) called
+ mpWindowImpl->mbNoParentUpdate = sal_False; // sal_True: SetParentUpdateMode( sal_False ) called
+ mpWindowImpl->mbActive = sal_False; // sal_True: Window Active
+ mpWindowImpl->mbParentActive = sal_False; // sal_True: OverlapActive from Parent
+ mpWindowImpl->mbReallyVisible = sal_False; // sal_True: this and all parents to an overlaped window are visible
+ mpWindowImpl->mbReallyShown = sal_False; // sal_True: this and all parents to an overlaped window are shown
+ mpWindowImpl->mbInInitShow = sal_False; // sal_True: we are in InitShow
+ mpWindowImpl->mbChildNotify = sal_False; // sal_True: ChildNotify
+ mpWindowImpl->mbChildPtrOverwrite = sal_False; // sal_True: PointerStyle overwrites Child-Pointer
+ mpWindowImpl->mbNoPtrVisible = sal_False; // sal_True: ShowPointer( sal_False ) called
+ mpWindowImpl->mbMouseMove = sal_False; // sal_True: BaseMouseMove called
+ mpWindowImpl->mbPaintFrame = sal_False; // sal_True: Paint is visible, but not painted
+ mpWindowImpl->mbInPaint = sal_False; // sal_True: Inside PaintHdl
+ mpWindowImpl->mbMouseButtonDown = sal_False; // sal_True: BaseMouseButtonDown called
+ mpWindowImpl->mbMouseButtonUp = sal_False; // sal_True: BaseMouseButtonUp called
+ mpWindowImpl->mbKeyInput = sal_False; // sal_True: BaseKeyInput called
+ mpWindowImpl->mbKeyUp = sal_False; // sal_True: BaseKeyUp called
+ mpWindowImpl->mbCommand = sal_False; // sal_True: BaseCommand called
+ mpWindowImpl->mbDefPos = sal_True; // sal_True: Position is not Set
+ mpWindowImpl->mbDefSize = sal_True; // sal_True: Size is not Set
+ mpWindowImpl->mbCallMove = sal_True; // sal_True: Move must be called by Show
+ mpWindowImpl->mbCallResize = sal_True; // sal_True: Resize must be called by Show
+ mpWindowImpl->mbWaitSystemResize = sal_True; // sal_True: Wait for System-Resize
+ mpWindowImpl->mbInitWinClipRegion = sal_True; // sal_True: Calc Window Clip Region
+ mpWindowImpl->mbInitChildRegion = sal_False; // sal_True: InitChildClipRegion
+ mpWindowImpl->mbWinRegion = sal_False; // sal_True: Window Region
+ mpWindowImpl->mbClipChildren = sal_False; // sal_True: Child-Fenster muessen evt. geclippt werden
+ mpWindowImpl->mbClipSiblings = sal_False; // sal_True: Nebeneinanderliegende Child-Fenster muessen evt. geclippt werden
+ mpWindowImpl->mbChildTransparent = sal_False; // sal_True: Child-Fenster duerfen transparent einschalten (inkl. Parent-CLIPCHILDREN)
+ mpWindowImpl->mbPaintTransparent = sal_False; // sal_True: Paints muessen auf Parent ausgeloest werden
+ mpWindowImpl->mbMouseTransparent = sal_False; // sal_True: Window is transparent for Mouse
+ mpWindowImpl->mbDlgCtrlStart = sal_False; // sal_True: Ab hier eigenes Dialog-Control
+ mpWindowImpl->mbFocusVisible = sal_False; // sal_True: Focus Visible
+ mpWindowImpl->mbUseNativeFocus = sal_False;
+ mpWindowImpl->mbNativeFocusVisible= sal_False; // sal_True: native Focus Visible
+ mpWindowImpl->mbInShowFocus = sal_False; // prevent recursion
+ mpWindowImpl->mbInHideFocus = sal_False; // prevent recursion
+ mpWindowImpl->mbTrackVisible = sal_False; // sal_True: Tracking Visible
+ mpWindowImpl->mbControlForeground = sal_False; // sal_True: Foreground-Property set
+ mpWindowImpl->mbControlBackground = sal_False; // sal_True: Background-Property set
+ mpWindowImpl->mbAlwaysOnTop = sal_False; // sal_True: immer vor allen anderen normalen Fenstern sichtbar
+ mpWindowImpl->mbCompoundControl = sal_False; // sal_True: Zusammengesetztes Control => Listener...
+ mpWindowImpl->mbCompoundControlHasFocus = sal_False; // sal_True: Zusammengesetztes Control hat irgendwo den Focus
+ mpWindowImpl->mbPaintDisabled = sal_False; // sal_True: Paint soll nicht ausgefuehrt werden
+ mpWindowImpl->mbAllResize = sal_False; // sal_True: Auch ResizeEvents mit 0,0 schicken
+ mpWindowImpl->mbInDtor = sal_False; // sal_True: Wir befinden uns im Window-Dtor
+ mpWindowImpl->mbExtTextInput = sal_False; // sal_True: ExtTextInput-Mode is active
+ mpWindowImpl->mbInFocusHdl = sal_False; // sal_True: Innerhalb vom GetFocus-Handler
+ mpWindowImpl->mbCreatedWithToolkit = sal_False;
+ mpWindowImpl->mbSuppressAccessibilityEvents = sal_False; // sal_True: do not send any accessibility events
+ mpWindowImpl->mbDrawSelectionBackground = sal_False; // sal_True: draws transparent window background to indicate (toolbox) selection
+ mpWindowImpl->mbIsInTaskPaneList = sal_False; // sal_True: window was added to the taskpanelist in the topmost system window
mpWindowImpl->mnNativeBackground = 0; // initialize later, depends on type
- mpWindowImpl->mbCallHandlersDuringInputDisabled = FALSE; // TRUE: call event handlers even if input is disabled
- mpWindowImpl->mbDisableAccessibleLabelForRelation = FALSE; // TRUE: do not set LabelFor relation on accessible objects
- mpWindowImpl->mbDisableAccessibleLabeledByRelation = FALSE; // TRUE: do not set LabeledBy relation on accessible objects
- mpWindowImpl->mbHelpTextDynamic = FALSE; // TRUE: append help id in HELP_DEBUG case
- mpWindowImpl->mbFakeFocusSet = FALSE; // TRUE: pretend as if the window has focus.
+ mpWindowImpl->mbCallHandlersDuringInputDisabled = sal_False; // sal_True: call event handlers even if input is disabled
+ mpWindowImpl->mbDisableAccessibleLabelForRelation = sal_False; // sal_True: do not set LabelFor relation on accessible objects
+ mpWindowImpl->mbDisableAccessibleLabeledByRelation = sal_False; // sal_True: do not set LabeledBy relation on accessible objects
+ mpWindowImpl->mbHelpTextDynamic = sal_False; // sal_True: append help id in HELP_DEBUG case
+ mpWindowImpl->mbFakeFocusSet = sal_False; // sal_True: pretend as if the window has focus.
- mbEnableRTL = Application::GetSettings().GetLayoutRTL(); // TRUE: this outdev will be mirrored if RTL window layout (UI mirroring) is globally active
+ mbEnableRTL = Application::GetSettings().GetLayoutRTL(); // sal_True: this outdev will be mirrored if RTL window layout (UI mirroring) is globally active
}
// -----------------------------------------------------------------------
@@ -728,7 +745,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
if ( !mpWindowImpl->mbFrame && !mpWindowImpl->mbBorderWin && !mpWindowImpl->mpBorderWindow
&& (nStyle & (WB_BORDER | WB_SYSTEMCHILDWINDOW) ) )
{
- USHORT nBorderTypeStyle = 0;
+ sal_uInt16 nBorderTypeStyle = 0;
if( (nStyle & WB_SYSTEMCHILDWINDOW) )
{
// handle WB_SYSTEMCHILDWINDOW
@@ -746,8 +763,8 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
}
else if( !mpWindowImpl->mbFrame && ! pParent )
{
- mpWindowImpl->mbOverlapWin = TRUE;
- mpWindowImpl->mbFrame = TRUE;
+ mpWindowImpl->mbOverlapWin = sal_True;
+ mpWindowImpl->mbFrame = sal_True;
}
// insert window in list
@@ -762,7 +779,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
mpWindowImpl->mpOverlapData->mpSaveBackRgn = NULL;
mpWindowImpl->mpOverlapData->mpNextBackWin = NULL;
mpWindowImpl->mpOverlapData->mnSaveBackSize = 0;
- mpWindowImpl->mpOverlapData->mbSaveBack = FALSE;
+ mpWindowImpl->mpOverlapData->mbSaveBack = sal_False;
mpWindowImpl->mpOverlapData->mnTopLevel = 1;
}
@@ -773,7 +790,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
if ( mpWindowImpl->mbFrame )
{
// create frame
- ULONG nFrameStyle = 0;
+ sal_uLong nFrameStyle = 0;
if ( nStyle & WB_MOVEABLE )
nFrameStyle |= SAL_FRAME_STYLE_MOVEABLE;
@@ -879,21 +896,21 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
mpWindowImpl->mpFrameData->mnMouseCode = 0;
mpWindowImpl->mpFrameData->mnMouseMode = 0;
mpWindowImpl->mpFrameData->meMapUnit = MAP_PIXEL;
- mpWindowImpl->mpFrameData->mbHasFocus = FALSE;
- mpWindowImpl->mpFrameData->mbInMouseMove = FALSE;
- mpWindowImpl->mpFrameData->mbMouseIn = FALSE;
- mpWindowImpl->mpFrameData->mbStartDragCalled = FALSE;
- mpWindowImpl->mpFrameData->mbNeedSysWindow = FALSE;
- mpWindowImpl->mpFrameData->mbMinimized = FALSE;
- mpWindowImpl->mpFrameData->mbStartFocusState = FALSE;
- mpWindowImpl->mpFrameData->mbInSysObjFocusHdl = FALSE;
- mpWindowImpl->mpFrameData->mbInSysObjToTopHdl = FALSE;
- mpWindowImpl->mpFrameData->mbSysObjFocus = FALSE;
+ mpWindowImpl->mpFrameData->mbHasFocus = sal_False;
+ mpWindowImpl->mpFrameData->mbInMouseMove = sal_False;
+ mpWindowImpl->mpFrameData->mbMouseIn = sal_False;
+ mpWindowImpl->mpFrameData->mbStartDragCalled = sal_False;
+ mpWindowImpl->mpFrameData->mbNeedSysWindow = sal_False;
+ mpWindowImpl->mpFrameData->mbMinimized = sal_False;
+ mpWindowImpl->mpFrameData->mbStartFocusState = sal_False;
+ mpWindowImpl->mpFrameData->mbInSysObjFocusHdl = sal_False;
+ mpWindowImpl->mpFrameData->mbInSysObjToTopHdl = sal_False;
+ mpWindowImpl->mpFrameData->mbSysObjFocus = sal_False;
mpWindowImpl->mpFrameData->maPaintTimer.SetTimeout( 30 );
mpWindowImpl->mpFrameData->maPaintTimer.SetTimeoutHdl( LINK( this, Window, ImplHandlePaintHdl ) );
mpWindowImpl->mpFrameData->maResizeTimer.SetTimeout( 50 );
mpWindowImpl->mpFrameData->maResizeTimer.SetTimeoutHdl( LINK( this, Window, ImplHandleResizeTimerHdl ) );
- mpWindowImpl->mpFrameData->mbInternalDragGestureRecognizer = FALSE;
+ mpWindowImpl->mpFrameData->mbInternalDragGestureRecognizer = sal_False;
if ( pRealParent && IsTopWindow() )
{
@@ -938,7 +955,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
// side effect: ImplUpdateGlobalSettings does an ImplGetFrame()->UpdateSettings
ImplUpdateGlobalSettings( *pSVData->maAppData.mpSettings );
OutputDevice::SetSettings( *pSVData->maAppData.mpSettings );
- pSVData->maAppData.mbSettingsInit = TRUE;
+ pSVData->maAppData.mbSettingsInit = sal_True;
}
// If we create a Window with default size, query this
@@ -964,7 +981,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
}
const StyleSettings& rStyleSettings = maSettings.GetStyleSettings();
- USHORT nScreenZoom = rStyleSettings.GetScreenZoom();
+ sal_uInt16 nScreenZoom = rStyleSettings.GetScreenZoom();
mnDPIX = (mpWindowImpl->mpFrameData->mnDPIX*nScreenZoom)/100;
mnDPIY = (mpWindowImpl->mpFrameData->mnDPIY*nScreenZoom)/100;
maFont = rStyleSettings.GetAppFont();
@@ -1025,7 +1042,7 @@ void Window::ImplInsertWindow( Window* pParent )
mpWindowImpl->mpFrameData = pFrameParent->mpWindowImpl->mpFrameData;
mpWindowImpl->mpFrame = pFrameParent->mpWindowImpl->mpFrame;
mpWindowImpl->mpFrameWindow = pFrameParent;
- mpWindowImpl->mbFrame = FALSE;
+ mpWindowImpl->mbFrame = sal_False;
// search overlap window and insert window in list
if ( ImplIsOverlapWindow() )
@@ -1064,7 +1081,7 @@ void Window::ImplInsertWindow( Window* pParent )
// -----------------------------------------------------------------------
-void Window::ImplRemoveWindow( BOOL bRemoveFrameData )
+void Window::ImplRemoveWindow( sal_Bool bRemoveFrameData )
{
// Fenster aus den Listen austragen
if ( !mpWindowImpl->mbFrame )
@@ -1117,7 +1134,7 @@ void Window::ImplRemoveWindow( BOOL bRemoveFrameData )
void Window::ImplCallResize()
{
- mpWindowImpl->mbCallResize = FALSE;
+ mpWindowImpl->mbCallResize = sal_False;
if( GetBackground().IsGradient() )
Invalidate();
@@ -1127,13 +1144,15 @@ void Window::ImplCallResize()
// #88419# Most classes don't call the base class in Resize() and Move(),
// => Call ImpleResize/Move instead of Resize/Move directly...
ImplCallEventListeners( VCLEVENT_WINDOW_RESIZE );
+
+ ImplExtResize();
}
// -----------------------------------------------------------------------
void Window::ImplCallMove()
{
- mpWindowImpl->mbCallMove = FALSE;
+ mpWindowImpl->mbCallMove = sal_False;
if( mpWindowImpl->mbFrame )
{
@@ -1175,20 +1194,14 @@ void Window::ImplCallMove()
// -----------------------------------------------------------------------
-static ULONG ImplAutoHelpID( ResMgr* pResMgr )
+static rtl::OString ImplAutoHelpID( ResMgr* pResMgr )
{
- if ( !Application::IsAutoHelpIdEnabled() )
- return 0;
+ rtl::OString aRet;
- ULONG nHID = 0;
+ if( pResMgr && Application::IsAutoHelpIdEnabled() )
+ aRet = pResMgr->GetAutoHelpId();
- DBG_ASSERT( pResMgr, "No res mgr for auto help id" );
- if( ! pResMgr )
- return 0;
-
- nHID = pResMgr->GetAutoHelpId();
-
- return nHID;
+ return aRet;
}
// -----------------------------------------------------------------------
@@ -1208,25 +1221,26 @@ WinBits Window::ImplInitRes( const ResId& rResId )
void Window::ImplLoadRes( const ResId& rResId )
{
- // newer move this line after IncrementRes
- char* pRes = (char*)GetClassRes();
- pRes += 12;
- sal_uInt32 nHelpId = (sal_uInt32)GetLongRes( (void*)pRes );
- if ( !nHelpId )
- nHelpId = ImplAutoHelpID( rResId.GetResMgr() );
- SetHelpId( nHelpId );
+ sal_uLong nObjMask = ReadLongRes();
- ULONG nObjMask = ReadLongRes();
+ // we need to calculate auto helpids before the resource gets closed
+ // if the resource only contains flags, it will be closed before we try to read a help id
+ // so we always create an auto help id that might be overwritten later
+ // HelpId
+ rtl::OString aHelpId = ImplAutoHelpID( rResId.GetResMgr() );
// ResourceStyle
- ULONG nRSStyle = ReadLongRes();
+ sal_uLong nRSStyle = ReadLongRes();
// WinBits
ReadLongRes();
- // HelpId
- ReadLongRes();
- BOOL bPos = FALSE;
- BOOL bSize = FALSE;
+ if( nObjMask & WINDOW_HELPID )
+ aHelpId = ReadByteStringRes();
+
+ SetHelpId( aHelpId );
+
+ sal_Bool bPos = sal_False;
+ sal_Bool bSize = sal_False;
Point aPos;
Size aSize;
@@ -1235,7 +1249,7 @@ void Window::ImplLoadRes( const ResId& rResId )
// Groessenangabe aus der Resource verwenden
MapUnit ePosMap = MAP_PIXEL;
- bPos = TRUE;
+ bPos = sal_True;
if ( nObjMask & WINDOW_XYMAPMODE )
ePosMap = (MapUnit)ReadLongRes();
@@ -1250,7 +1264,7 @@ void Window::ImplLoadRes( const ResId& rResId )
// Groessenangabe aus der Resource verwenden
MapUnit eSizeMap = MAP_PIXEL;
- bSize = TRUE;
+ bSize = sal_True;
if ( nObjMask & WINDOW_WHMAPMODE )
eSizeMap = (MapUnit)ReadLongRes();
@@ -1276,14 +1290,14 @@ void Window::ImplLoadRes( const ResId& rResId )
SetSizePixel( aSize );
if ( nRSStyle & RSWND_DISABLED )
- Enable( FALSE );
+ Enable( sal_False );
if ( nObjMask & WINDOW_TEXT )
SetText( ReadStringRes() );
if ( nObjMask & WINDOW_HELPTEXT )
{
SetHelpText( ReadStringRes() );
- mpWindowImpl->mbHelpTextDynamic = TRUE;
+ mpWindowImpl->mbHelpTextDynamic = sal_True;
}
if ( nObjMask & WINDOW_QUICKTEXT )
SetQuickHelpText( ReadStringRes() );
@@ -1293,11 +1307,11 @@ void Window::ImplLoadRes( const ResId& rResId )
SetData( (void*)nRes );
}
if ( nObjMask & WINDOW_UNIQUEID )
- SetUniqueId( (ULONG)ReadLongRes() );
+ SetUniqueId( ReadByteStringRes() );
if ( nObjMask & WINDOW_BORDER_STYLE )
{
- USHORT nBorderStyle = (USHORT)ReadLongRes();
+ sal_uInt16 nBorderStyle = (sal_uInt16)ReadLongRes();
SetBorderStyle( nBorderStyle );
}
}
@@ -1318,11 +1332,9 @@ ImplWinData* Window::ImplGetWinData() const
mpWindowImpl->mpWinData->mpFocusRect = NULL;
mpWindowImpl->mpWinData->mpTrackRect = NULL;
mpWindowImpl->mpWinData->mnTrackFlags = 0;
- mpWindowImpl->mpWinData->mnIsTopWindow = (USHORT) ~0; // not initialized yet, 0/1 will indicate TopWindow (see IsTopWindow())
- mpWindowImpl->mpWinData->mbMouseOver = FALSE;
- mpWindowImpl->mpWinData->mbEnableNativeWidget = (pNoNWF && *pNoNWF) ? FALSE : TRUE; // TRUE: try to draw this control with native theme API
- mpWindowImpl->mpWinData->mpSmartHelpId = NULL;
- mpWindowImpl->mpWinData->mpSmartUniqueId = NULL;
+ mpWindowImpl->mpWinData->mnIsTopWindow = (sal_uInt16) ~0; // not initialized yet, 0/1 will indicate TopWindow (see IsTopWindow())
+ mpWindowImpl->mpWinData->mbMouseOver = sal_False;
+ mpWindowImpl->mpWinData->mbEnableNativeWidget = (pNoNWF && *pNoNWF) ? sal_False : sal_True; // sal_True: try to draw this control with native theme API
}
return mpWindowImpl->mpWinData;
@@ -1333,7 +1345,7 @@ ImplWinData* Window::ImplGetWinData() const
SalGraphics* Window::ImplGetFrameGraphics() const
{
if ( mpWindowImpl->mpFrameWindow->mpGraphics )
- mpWindowImpl->mpFrameWindow->mbInitClipRegion = TRUE;
+ mpWindowImpl->mpFrameWindow->mbInitClipRegion = sal_True;
else
mpWindowImpl->mpFrameWindow->ImplGetGraphics();
mpWindowImpl->mpFrameWindow->mpGraphics->ResetClipRegion();
@@ -1363,7 +1375,7 @@ Window* Window::ImplFindWindow( const Point& rFramePos )
if ( !mpWindowImpl->mbVisible )
return NULL;
- USHORT nHitTest = ImplHitTest( rFramePos );
+ sal_uInt16 nHitTest = ImplHitTest( rFramePos );
if ( nHitTest & WINDOW_HITTEST_INSIDE )
{
// und danach gehen wir noch alle Child-Fenster durch
@@ -1387,7 +1399,7 @@ Window* Window::ImplFindWindow( const Point& rFramePos )
// -----------------------------------------------------------------------
-USHORT Window::ImplHitTest( const Point& rFramePos )
+sal_uInt16 Window::ImplHitTest( const Point& rFramePos )
{
Point aFramePos( rFramePos );
if( ImplIsAntiparallel() )
@@ -1407,7 +1419,7 @@ USHORT Window::ImplHitTest( const Point& rFramePos )
return 0;
}
- USHORT nHitTest = WINDOW_HITTEST_INSIDE;
+ sal_uInt16 nHitTest = WINDOW_HITTEST_INSIDE;
if ( mpWindowImpl->mbMouseTransparent )
nHitTest |= WINDOW_HITTEST_TRANSPARENT;
return nHitTest;
@@ -1415,22 +1427,22 @@ USHORT Window::ImplHitTest( const Point& rFramePos )
// -----------------------------------------------------------------------
-BOOL Window::ImplIsRealParentPath( const Window* pWindow ) const
+sal_Bool Window::ImplIsRealParentPath( const Window* pWindow ) const
{
pWindow = pWindow->GetParent();
while ( pWindow )
{
if ( pWindow == this )
- return TRUE;
+ return sal_True;
pWindow = pWindow->GetParent();
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Window::ImplIsChild( const Window* pWindow, BOOL bSystemWindow ) const
+sal_Bool Window::ImplIsChild( const Window* pWindow, sal_Bool bSystemWindow ) const
{
do
{
@@ -1440,19 +1452,19 @@ BOOL Window::ImplIsChild( const Window* pWindow, BOOL bSystemWindow ) const
pWindow = pWindow->ImplGetParent();
if ( pWindow == this )
- return TRUE;
+ return sal_True;
}
while ( pWindow );
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Window::ImplIsWindowOrChild( const Window* pWindow, BOOL bSystemWindow ) const
+sal_Bool Window::ImplIsWindowOrChild( const Window* pWindow, sal_Bool bSystemWindow ) const
{
if ( this == pWindow )
- return TRUE;
+ return sal_True;
return ImplIsChild( pWindow, bSystemWindow );
}
@@ -1482,15 +1494,15 @@ int Window::ImplTestMousePointerSet()
{
// Wenn Mouse gecaptured ist, dann soll MousePointer umgeschaltet werden
if ( IsMouseCaptured() )
- return TRUE;
+ return sal_True;
// Wenn sich Mouse ueber dem Fenster befindet, dann soll MousePointer
// umgeschaltet werden
Rectangle aClientRect( Point( 0, 0 ), GetOutputSizePixel() );
if ( aClientRect.IsInside( GetPointerPosPixel() ) )
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -1498,7 +1510,7 @@ int Window::ImplTestMousePointerSet()
PointerStyle Window::ImplGetMousePointer() const
{
PointerStyle ePointerStyle;
- BOOL bWait = FALSE;
+ sal_Bool bWait = sal_False;
if ( IsEnabled() && IsInputEnabled() && ! IsInModalMode() )
ePointerStyle = GetPointer().GetStyle();
@@ -1518,7 +1530,7 @@ PointerStyle Window::ImplGetMousePointer() const
if ( pWindow->mpWindowImpl->mnWaitCount )
{
ePointerStyle = POINTER_WAIT;
- bWait = TRUE;
+ bWait = sal_True;
}
else
{
@@ -1541,11 +1553,11 @@ PointerStyle Window::ImplGetMousePointer() const
void Window::ImplResetReallyVisible()
{
- BOOL bBecameReallyInvisible = mpWindowImpl->mbReallyVisible;
+ sal_Bool bBecameReallyInvisible = mpWindowImpl->mbReallyVisible;
- mbDevOutput = FALSE;
- mpWindowImpl->mbReallyVisible = FALSE;
- mpWindowImpl->mbReallyShown = FALSE;
+ mbDevOutput = sal_False;
+ mpWindowImpl->mbReallyVisible = sal_False;
+ mpWindowImpl->mbReallyShown = sal_False;
// the SHOW/HIDE events serve as indicators to send child creation/destroy events to the access bridge.
// For this, the data member of the event must not be NULL.
@@ -1582,11 +1594,11 @@ void Window::ImplSetReallyVisible()
if( !mpWindowImpl->mbReallyShown )
ImplCallInitShow();
- BOOL bBecameReallyVisible = !mpWindowImpl->mbReallyVisible;
+ sal_Bool bBecameReallyVisible = !mpWindowImpl->mbReallyVisible;
- mbDevOutput = TRUE;
- mpWindowImpl->mbReallyVisible = TRUE;
- mpWindowImpl->mbReallyShown = TRUE;
+ mbDevOutput = sal_True;
+ mpWindowImpl->mbReallyVisible = sal_True;
+ mpWindowImpl->mbReallyShown = sal_True;
// the SHOW/HIDE events serve as indicators to send child creation/destroy events to the access bridge.
// For this, the data member of the event must not be NULL.
@@ -1618,10 +1630,10 @@ void Window::ImplSetReallyVisible()
void Window::ImplCallInitShow()
{
- mpWindowImpl->mbReallyShown = TRUE;
- mpWindowImpl->mbInInitShow = TRUE;
+ mpWindowImpl->mbReallyShown = sal_True;
+ mpWindowImpl->mbInInitShow = sal_True;
StateChanged( STATE_CHANGE_INITSHOW );
- mpWindowImpl->mbInInitShow = FALSE;
+ mpWindowImpl->mbInInitShow = sal_False;
Window* pWindow = mpWindowImpl->mpFirstOverlap;
while ( pWindow )
@@ -1677,7 +1689,7 @@ void Window::ImplInitResolutionSettings()
if ( mpWindowImpl->mbFrame )
{
const StyleSettings& rStyleSettings = maSettings.GetStyleSettings();
- USHORT nScreenZoom = rStyleSettings.GetScreenZoom();
+ sal_uInt16 nScreenZoom = rStyleSettings.GetScreenZoom();
mnDPIX = (mpWindowImpl->mpFrameData->mnDPIX*nScreenZoom)/100;
mnDPIY = (mpWindowImpl->mpFrameData->mnDPIY*nScreenZoom)/100;
SetPointFont( rStyleSettings.GetAppFont() );
@@ -1703,7 +1715,7 @@ void Window::ImplInitResolutionSettings()
void Window::ImplPointToLogic( Font& rFont ) const
{
Size aSize = rFont.GetSize();
- USHORT nScreenFontZoom = maSettings.GetStyleSettings().GetScreenFontZoom();
+ sal_uInt16 nScreenFontZoom = maSettings.GetStyleSettings().GetScreenFontZoom();
if ( aSize.Width() )
{
@@ -1730,7 +1742,7 @@ void Window::ImplPointToLogic( Font& rFont ) const
void Window::ImplLogicToPoint( Font& rFont ) const
{
Size aSize = rFont.GetSize();
- USHORT nScreenFontZoom = maSettings.GetStyleSettings().GetScreenFontZoom();
+ sal_uInt16 nScreenFontZoom = maSettings.GetStyleSettings().GetScreenFontZoom();
if ( IsMapModeEnabled() )
aSize = LogicToPixel( aSize );
@@ -1754,9 +1766,9 @@ void Window::ImplLogicToPoint( Font& rFont ) const
// -----------------------------------------------------------------------
-BOOL Window::ImplSysObjClip( const Region* pOldRegion )
+sal_Bool Window::ImplSysObjClip( const Region* pOldRegion )
{
- BOOL bUpdate = TRUE;
+ sal_Bool bUpdate = sal_True;
if ( mpWindowImpl->mpSysObj )
{
@@ -1781,7 +1793,7 @@ BOOL Window::ImplSysObjClip( const Region* pOldRegion )
Region aRegion = *pWinChildClipRegion;
Rectangle aWinRect( Point( mnOutOffX, mnOutOffY ), Size( mnOutWidth, mnOutHeight ) );
Region aWinRectRegion( aWinRect );
- USHORT nClipFlags = mpWindowImpl->mpSysObj->GetClipRegionType();
+ sal_uInt16 nClipFlags = mpWindowImpl->mpSysObj->GetClipRegionType();
if ( aRegion == aWinRectRegion )
mpWindowImpl->mpSysObj->ResetClipRegion();
@@ -1800,9 +1812,9 @@ BOOL Window::ImplSysObjClip( const Region* pOldRegion )
long nY;
long nWidth;
long nHeight;
- ULONG nRectCount;
+ sal_uLong nRectCount;
ImplRegionInfo aInfo;
- BOOL bRegionRect;
+ sal_Bool bRegionRect;
nRectCount = aRegion.GetRectCount();
mpWindowImpl->mpSysObj->BeginSetClipRegion( nRectCount );
@@ -1816,7 +1828,7 @@ BOOL Window::ImplSysObjClip( const Region* pOldRegion )
}
}
else
- bVisibleState = FALSE;
+ bVisibleState = sal_False;
}
// Visible-Status updaten
@@ -1880,31 +1892,31 @@ void Window::ImplUpdateSysObjClip()
// -----------------------------------------------------------------------
-BOOL Window::ImplSetClipFlagChilds( BOOL bSysObjOnlySmaller )
+sal_Bool Window::ImplSetClipFlagChilds( sal_Bool bSysObjOnlySmaller )
{
- BOOL bUpdate = TRUE;
+ sal_Bool bUpdate = sal_True;
if ( mpWindowImpl->mpSysObj )
{
Region* pOldRegion = NULL;
if ( bSysObjOnlySmaller && !mpWindowImpl->mbInitWinClipRegion )
pOldRegion = new Region( mpWindowImpl->maWinClipRegion );
- mbInitClipRegion = TRUE;
- mpWindowImpl->mbInitWinClipRegion = TRUE;
+ mbInitClipRegion = sal_True;
+ mpWindowImpl->mbInitWinClipRegion = sal_True;
Window* pWindow = mpWindowImpl->mpFirstChild;
while ( pWindow )
{
if ( !pWindow->ImplSetClipFlagChilds( bSysObjOnlySmaller ) )
- bUpdate = FALSE;
+ bUpdate = sal_False;
pWindow = pWindow->mpWindowImpl->mpNext;
}
if ( !ImplSysObjClip( pOldRegion ) )
{
- mbInitClipRegion = TRUE;
- mpWindowImpl->mbInitWinClipRegion = TRUE;
- bUpdate = FALSE;
+ mbInitClipRegion = sal_True;
+ mpWindowImpl->mbInitWinClipRegion = sal_True;
+ bUpdate = sal_False;
}
if ( pOldRegion )
@@ -1912,14 +1924,14 @@ BOOL Window::ImplSetClipFlagChilds( BOOL bSysObjOnlySmaller )
}
else
{
- mbInitClipRegion = TRUE;
- mpWindowImpl->mbInitWinClipRegion = TRUE;
+ mbInitClipRegion = sal_True;
+ mpWindowImpl->mbInitWinClipRegion = sal_True;
Window* pWindow = mpWindowImpl->mpFirstChild;
while ( pWindow )
{
if ( !pWindow->ImplSetClipFlagChilds( bSysObjOnlySmaller ) )
- bUpdate = FALSE;
+ bUpdate = sal_False;
pWindow = pWindow->mpWindowImpl->mpNext;
}
}
@@ -1928,15 +1940,15 @@ BOOL Window::ImplSetClipFlagChilds( BOOL bSysObjOnlySmaller )
// -----------------------------------------------------------------------
-BOOL Window::ImplSetClipFlagOverlapWindows( BOOL bSysObjOnlySmaller )
+sal_Bool Window::ImplSetClipFlagOverlapWindows( sal_Bool bSysObjOnlySmaller )
{
- BOOL bUpdate = ImplSetClipFlagChilds( bSysObjOnlySmaller );
+ sal_Bool bUpdate = ImplSetClipFlagChilds( bSysObjOnlySmaller );
Window* pWindow = mpWindowImpl->mpFirstOverlap;
while ( pWindow )
{
if ( !pWindow->ImplSetClipFlagOverlapWindows( bSysObjOnlySmaller ) )
- bUpdate = FALSE;
+ bUpdate = sal_False;
pWindow = pWindow->mpWindowImpl->mpNext;
}
@@ -1945,18 +1957,18 @@ BOOL Window::ImplSetClipFlagOverlapWindows( BOOL bSysObjOnlySmaller )
// -----------------------------------------------------------------------
-BOOL Window::ImplSetClipFlag( BOOL bSysObjOnlySmaller )
+sal_Bool Window::ImplSetClipFlag( sal_Bool bSysObjOnlySmaller )
{
if ( !ImplIsOverlapWindow() )
{
- BOOL bUpdate = ImplSetClipFlagChilds( bSysObjOnlySmaller );
+ sal_Bool bUpdate = ImplSetClipFlagChilds( bSysObjOnlySmaller );
Window* pParent = ImplGetParent();
if ( pParent &&
((pParent->GetStyle() & WB_CLIPCHILDREN) || (mpWindowImpl->mnParentClipMode & PARENTCLIPMODE_CLIP)) )
{
- pParent->mbInitClipRegion = TRUE;
- pParent->mpWindowImpl->mbInitChildRegion = TRUE;
+ pParent->mbInitClipRegion = sal_True;
+ pParent->mpWindowImpl->mbInitChildRegion = sal_True;
}
// Schwestern muessen ihre ClipRegion auch neu berechnen
@@ -1966,7 +1978,7 @@ BOOL Window::ImplSetClipFlag( BOOL bSysObjOnlySmaller )
while ( pWindow )
{
if ( !pWindow->ImplSetClipFlagChilds( bSysObjOnlySmaller ) )
- bUpdate = FALSE;
+ bUpdate = sal_False;
pWindow = pWindow->mpWindowImpl->mpNext;
}
}
@@ -2046,7 +2058,7 @@ void Window::ImplExcludeOverlapWindows2( Region& rRegion )
// -----------------------------------------------------------------------
-void Window::ImplClipBoundaries( Region& rRegion, BOOL bThis, BOOL bOverlaps )
+void Window::ImplClipBoundaries( Region& rRegion, sal_Bool bThis, sal_Bool bOverlaps )
{
if ( bThis )
ImplIntersectWindowClipRegion( rRegion );
@@ -2081,21 +2093,21 @@ void Window::ImplClipBoundaries( Region& rRegion, BOOL bThis, BOOL bOverlaps )
// -----------------------------------------------------------------------
-BOOL Window::ImplClipChilds( Region& rRegion )
+sal_Bool Window::ImplClipChilds( Region& rRegion )
{
- BOOL bOtherClip = FALSE;
+ sal_Bool bOtherClip = sal_False;
Window* pWindow = mpWindowImpl->mpFirstChild;
while ( pWindow )
{
if ( pWindow->mpWindowImpl->mbReallyVisible )
{
// ParentClipMode-Flags auswerten
- USHORT nClipMode = pWindow->GetParentClipMode();
+ sal_uInt16 nClipMode = pWindow->GetParentClipMode();
if ( !(nClipMode & PARENTCLIPMODE_NOCLIP) &&
((nClipMode & PARENTCLIPMODE_CLIP) || (GetStyle() & WB_CLIPCHILDREN)) )
pWindow->ImplExcludeWindowRegion( rRegion );
else
- bOtherClip = TRUE;
+ bOtherClip = sal_True;
}
pWindow = pWindow->mpWindowImpl->mpNext;
@@ -2149,13 +2161,13 @@ void Window::ImplInitWinClipRegion()
ImplClipSiblings( mpWindowImpl->maWinClipRegion );
// Clip Parent Boundaries
- ImplClipBoundaries( mpWindowImpl->maWinClipRegion, FALSE, TRUE );
+ ImplClipBoundaries( mpWindowImpl->maWinClipRegion, sal_False, sal_True );
// Clip Children
if ( (GetStyle() & WB_CLIPCHILDREN) || mpWindowImpl->mbClipChildren )
- mpWindowImpl->mbInitChildRegion = TRUE;
+ mpWindowImpl->mbInitChildRegion = sal_True;
- mpWindowImpl->mbInitWinClipRegion = FALSE;
+ mpWindowImpl->mbInitWinClipRegion = sal_False;
}
// -----------------------------------------------------------------------
@@ -2180,7 +2192,7 @@ void Window::ImplInitWinChildClipRegion()
ImplClipChilds( *mpWindowImpl->mpChildClipRegion );
}
- mpWindowImpl->mbInitChildRegion = FALSE;
+ mpWindowImpl->mbInitChildRegion = sal_False;
}
// -----------------------------------------------------------------------
@@ -2261,7 +2273,7 @@ void Window::ImplCalcOverlapRegionOverlaps( const Region& rInterRegion, Region&
// -----------------------------------------------------------------------
void Window::ImplCalcOverlapRegion( const Rectangle& rSourceRect, Region& rRegion,
- BOOL bChilds, BOOL bParent, BOOL bSiblings )
+ sal_Bool bChilds, sal_Bool bParent, sal_Bool bSiblings )
{
Region aRegion( rSourceRect );
if ( mpWindowImpl->mbWinRegion )
@@ -2333,13 +2345,13 @@ void Window::ImplCalcOverlapRegion( const Rectangle& rSourceRect, Region& rRegio
// -----------------------------------------------------------------------
-void Window::ImplCallPaint( const Region* pRegion, USHORT nPaintFlags )
+void Window::ImplCallPaint( const Region* pRegion, sal_uInt16 nPaintFlags )
{
// call PrePaint. PrePaint may add to the invalidate region as well as
// other parameters used below.
PrePaint();
- mpWindowImpl->mbPaintFrame = FALSE;
+ mpWindowImpl->mbPaintFrame = sal_False;
if ( nPaintFlags & IMPL_PAINT_PAINTALLCHILDS )
mpWindowImpl->mnPaintFlags |= IMPL_PAINT_PAINT | IMPL_PAINT_PAINTALLCHILDS | (nPaintFlags & IMPL_PAINT_PAINTALL);
@@ -2393,8 +2405,8 @@ void Window::ImplCallPaint( const Region* pRegion, USHORT nPaintFlags )
if ( mpWindowImpl->mpCursor )
mpWindowImpl->mpCursor->ImplHide();
- mbInitClipRegion = TRUE;
- mpWindowImpl->mbInPaint = TRUE;
+ mbInitClipRegion = sal_True;
+ mpWindowImpl->mbInPaint = sal_True;
// Paint-Region zuruecksetzen
Region aPaintRegion( mpWindowImpl->maInvalidateRegion );
@@ -2434,11 +2446,11 @@ void Window::ImplCallPaint( const Region* pRegion, USHORT nPaintFlags )
if ( mpWindowImpl->mbFocusVisible )
ImplInvertFocus( *(mpWindowImpl->mpWinData->mpFocusRect) );
}
- mpWindowImpl->mbInPaint = FALSE;
- mbInitClipRegion = TRUE;
+ mpWindowImpl->mbInPaint = sal_False;
+ mbInitClipRegion = sal_True;
mpWindowImpl->mpPaintRegion = NULL;
if ( mpWindowImpl->mpCursor )
- mpWindowImpl->mpCursor->ImplShow( FALSE );
+ mpWindowImpl->mpCursor->ImplShow( sal_False );
}
}
else
@@ -2464,7 +2476,7 @@ void Window::ImplCallPaint( const Region* pRegion, USHORT nPaintFlags )
// #98943# draw toolbox selection
if( !aSelectionRect.IsEmpty() )
- DrawSelectionBackground( aSelectionRect, 3, FALSE, TRUE, FALSE );
+ DrawSelectionBackground( aSelectionRect, 3, sal_False, sal_True, sal_False );
if ( pChildRegion )
delete pChildRegion;
@@ -2531,14 +2543,14 @@ IMPL_LINK( Window, ImplHandleResizeTimerHdl, void*, EMPTYARG )
// -----------------------------------------------------------------------
-void Window::ImplInvalidateFrameRegion( const Region* pRegion, USHORT nFlags )
+void Window::ImplInvalidateFrameRegion( const Region* pRegion, sal_uInt16 nFlags )
{
// PAINTCHILDS bei allen Parent-Fenster bis zum ersten OverlapWindow
// setzen
if ( !ImplIsOverlapWindow() )
{
Window* pTempWindow = this;
- USHORT nTranspPaint = IsPaintTransparent() ? IMPL_PAINT_PAINT : 0;
+ sal_uInt16 nTranspPaint = IsPaintTransparent() ? IMPL_PAINT_PAINT : 0;
do
{
pTempWindow = pTempWindow->ImplGetParent();
@@ -2596,7 +2608,7 @@ void Window::ImplInvalidateOverlapFrameRegion( const Region& rRegion )
{
Region aRegion = rRegion;
- ImplClipBoundaries( aRegion, TRUE, TRUE );
+ ImplClipBoundaries( aRegion, sal_True, sal_True );
if ( !aRegion.IsEmpty() )
ImplInvalidateFrameRegion( &aRegion, INVALIDATE_CHILDREN );
@@ -2626,7 +2638,7 @@ void Window::ImplInvalidateParentFrameRegion( Region& rRegion )
// -----------------------------------------------------------------------
-void Window::ImplInvalidate( const Region* pRegion, USHORT nFlags )
+void Window::ImplInvalidate( const Region* pRegion, sal_uInt16 nFlags )
{
// Hintergrund-Sicherung zuruecksetzen
@@ -2634,7 +2646,7 @@ void Window::ImplInvalidate( const Region* pRegion, USHORT nFlags )
ImplInvalidateAllOverlapBackgrounds();
// Feststellen, was neu ausgegeben werden muss
- BOOL bInvalidateAll = !pRegion;
+ sal_Bool bInvalidateAll = !pRegion;
// Transparent-Invalidate beruecksichtigen
Window* pOpaqueWindow = this;
@@ -2647,7 +2659,7 @@ void Window::ImplInvalidate( const Region* pRegion, USHORT nFlags )
{
pOpaqueWindow = pTempWindow;
nFlags |= INVALIDATE_CHILDREN;
- bInvalidateAll = FALSE;
+ bInvalidateAll = sal_False;
break;
}
@@ -2659,7 +2671,7 @@ void Window::ImplInvalidate( const Region* pRegion, USHORT nFlags )
}
// Region zusammenbauen
- USHORT nOrgFlags = nFlags;
+ sal_uInt16 nOrgFlags = nFlags;
if ( !(nFlags & (INVALIDATE_CHILDREN | INVALIDATE_NOCHILDREN)) )
{
if ( GetStyle() & WB_CLIPCHILDREN )
@@ -2668,7 +2680,7 @@ void Window::ImplInvalidate( const Region* pRegion, USHORT nFlags )
nFlags |= INVALIDATE_CHILDREN;
}
if ( (nFlags & INVALIDATE_NOCHILDREN) && mpWindowImpl->mpFirstChild )
- bInvalidateAll = FALSE;
+ bInvalidateAll = sal_False;
if ( bInvalidateAll )
ImplInvalidateFrameRegion( NULL, nFlags );
else
@@ -2687,7 +2699,7 @@ void Window::ImplInvalidate( const Region* pRegion, USHORT nFlags )
else
aRegion.Intersect( *pRegion );
}
- ImplClipBoundaries( aRegion, TRUE, TRUE );
+ ImplClipBoundaries( aRegion, sal_True, sal_True );
if ( nFlags & INVALIDATE_NOCHILDREN )
{
nFlags &= ~INVALIDATE_CHILDREN;
@@ -2714,7 +2726,7 @@ void Window::ImplInvalidate( const Region* pRegion, USHORT nFlags )
void Window::ImplMoveInvalidateRegion( const Rectangle& rRect,
long nHorzScroll, long nVertScroll,
- BOOL bChilds )
+ sal_Bool bChilds )
{
if ( (mpWindowImpl->mnPaintFlags & (IMPL_PAINT_PAINT | IMPL_PAINT_PAINTALL)) == IMPL_PAINT_PAINT )
{
@@ -2729,7 +2741,7 @@ void Window::ImplMoveInvalidateRegion( const Rectangle& rRect,
Window* pWindow = mpWindowImpl->mpFirstChild;
while ( pWindow )
{
- pWindow->ImplMoveInvalidateRegion( rRect, nHorzScroll, nVertScroll, TRUE );
+ pWindow->ImplMoveInvalidateRegion( rRect, nHorzScroll, nVertScroll, sal_True );
pWindow = pWindow->mpWindowImpl->mpNext;
}
}
@@ -2739,7 +2751,7 @@ void Window::ImplMoveInvalidateRegion( const Rectangle& rRect,
void Window::ImplMoveAllInvalidateRegions( const Rectangle& rRect,
long nHorzScroll, long nVertScroll,
- BOOL bChilds )
+ sal_Bool bChilds )
{
// Paint-Region auch verschieben, wenn noch Paints anstehen
ImplMoveInvalidateRegion( rRect, nHorzScroll, nVertScroll, bChilds );
@@ -2767,7 +2779,7 @@ void Window::ImplMoveAllInvalidateRegions( const Rectangle& rRect,
if ( !aPaintAllRegion.IsEmpty() )
{
aPaintAllRegion.Move( nHorzScroll, nVertScroll );
- USHORT nPaintFlags = 0;
+ sal_uInt16 nPaintFlags = 0;
if ( bChilds )
mpWindowImpl->mnPaintFlags |= INVALIDATE_CHILDREN;
ImplInvalidateFrameRegion( &aPaintAllRegion, nPaintFlags );
@@ -2777,7 +2789,7 @@ void Window::ImplMoveAllInvalidateRegions( const Rectangle& rRect,
// -----------------------------------------------------------------------
-void Window::ImplValidateFrameRegion( const Region* pRegion, USHORT nFlags )
+void Window::ImplValidateFrameRegion( const Region* pRegion, sal_uInt16 nFlags )
{
if ( !pRegion )
mpWindowImpl->maInvalidateRegion.SetEmpty();
@@ -2822,11 +2834,11 @@ void Window::ImplValidateFrameRegion( const Region* pRegion, USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::ImplValidate( const Region* pRegion, USHORT nFlags )
+void Window::ImplValidate( const Region* pRegion, sal_uInt16 nFlags )
{
// Region zusammenbauen
- BOOL bValidateAll = !pRegion;
- USHORT nOrgFlags = nFlags;
+ sal_Bool bValidateAll = !pRegion;
+ sal_uInt16 nOrgFlags = nFlags;
if ( !(nFlags & (VALIDATE_CHILDREN | VALIDATE_NOCHILDREN)) )
{
if ( GetStyle() & WB_CLIPCHILDREN )
@@ -2835,7 +2847,7 @@ void Window::ImplValidate( const Region* pRegion, USHORT nFlags )
nFlags |= VALIDATE_CHILDREN;
}
if ( (nFlags & VALIDATE_NOCHILDREN) && mpWindowImpl->mpFirstChild )
- bValidateAll = FALSE;
+ bValidateAll = sal_False;
if ( bValidateAll )
ImplValidateFrameRegion( NULL, nFlags );
else
@@ -2844,7 +2856,7 @@ void Window::ImplValidate( const Region* pRegion, USHORT nFlags )
Region aRegion( aRect );
if ( pRegion )
aRegion.Intersect( *pRegion );
- ImplClipBoundaries( aRegion, TRUE, TRUE );
+ ImplClipBoundaries( aRegion, sal_True, sal_True );
if ( nFlags & VALIDATE_NOCHILDREN )
{
nFlags &= ~VALIDATE_CHILDREN;
@@ -2864,7 +2876,7 @@ void Window::ImplValidate( const Region* pRegion, USHORT nFlags )
// -----------------------------------------------------------------------
void Window::ImplScroll( const Rectangle& rRect,
- long nHorzScroll, long nVertScroll, USHORT nFlags )
+ long nHorzScroll, long nVertScroll, sal_uInt16 nFlags )
{
if ( !IsDeviceOutputNecessary() )
return;
@@ -2882,7 +2894,7 @@ void Window::ImplScroll( const Rectangle& rRect,
if ( mpWindowImpl->mpCursor )
mpWindowImpl->mpCursor->ImplHide();
- USHORT nOrgFlags = nFlags;
+ sal_uInt16 nOrgFlags = nFlags;
if ( !(nFlags & (SCROLL_CHILDREN | SCROLL_NOCHILDREN)) )
{
if ( GetStyle() & WB_CLIPCHILDREN )
@@ -2892,14 +2904,14 @@ void Window::ImplScroll( const Rectangle& rRect,
}
Region aInvalidateRegion;
- BOOL bScrollChilds = (nFlags & SCROLL_CHILDREN) != 0;
- BOOL bErase = (nFlags & SCROLL_NOERASE) == 0;
+ sal_Bool bScrollChilds = (nFlags & SCROLL_CHILDREN) != 0;
+ sal_Bool bErase = (nFlags & SCROLL_NOERASE) == 0;
if ( !mpWindowImpl->mpFirstChild )
- bScrollChilds = FALSE;
+ bScrollChilds = sal_False;
// --- RTL --- check if this window requires special action
- BOOL bReMirror = ( ImplIsAntiparallel() );
+ sal_Bool bReMirror = ( ImplIsAntiparallel() );
Rectangle aRectMirror( rRect );
if( bReMirror )
@@ -2914,7 +2926,7 @@ void Window::ImplScroll( const Rectangle& rRect,
if ( !(nFlags & SCROLL_NOINVALIDATE) )
{
- ImplCalcOverlapRegion( aRectMirror, aInvalidateRegion, !bScrollChilds, TRUE, FALSE );
+ ImplCalcOverlapRegion( aRectMirror, aInvalidateRegion, !bScrollChilds, sal_True, sal_False );
// --- RTL ---
// if the scrolling on the device is performed in the opposite direction
@@ -2924,7 +2936,7 @@ void Window::ImplScroll( const Rectangle& rRect,
if ( !aInvalidateRegion.IsEmpty() )
{
aInvalidateRegion.Move( bReMirror ? -nHorzScroll : nHorzScroll, nVertScroll );
- bErase = TRUE;
+ bErase = sal_True;
}
if ( !(nFlags & SCROLL_NOWINDOWINVALIDATE) )
{
@@ -2946,7 +2958,7 @@ void Window::ImplScroll( const Rectangle& rRect,
aRegion.Exclude( aInvalidateRegion );
- ImplClipBoundaries( aRegion, FALSE, TRUE );
+ ImplClipBoundaries( aRegion, sal_False, sal_True );
if ( !bScrollChilds )
{
if ( nOrgFlags & SCROLL_NOCHILDREN )
@@ -2997,7 +3009,7 @@ void Window::ImplScroll( const Rectangle& rRect,
// so it has to be re-mirrored before calling the Paint-handler
mpWindowImpl->mnPaintFlags |= IMPL_PAINT_CHECKRTL;
- USHORT nPaintFlags = INVALIDATE_CHILDREN;
+ sal_uInt16 nPaintFlags = INVALIDATE_CHILDREN;
if ( !bErase )
nPaintFlags |= INVALIDATE_NOERASE;
if ( !bScrollChilds )
@@ -3027,24 +3039,24 @@ void Window::ImplScroll( const Rectangle& rRect,
Update();
if ( mpWindowImpl->mpCursor )
- mpWindowImpl->mpCursor->ImplShow( FALSE );
+ mpWindowImpl->mpCursor->ImplShow( sal_False );
}
// -----------------------------------------------------------------------
-void Window::ImplUpdateAll( BOOL bOverlapWindows )
+void Window::ImplUpdateAll( sal_Bool bOverlapWindows )
{
if ( !mpWindowImpl->mbReallyVisible )
return;
- BOOL bFlush = FALSE;
+ sal_Bool bFlush = sal_False;
if ( mpWindowImpl->mpFrameWindow->mpWindowImpl->mbPaintFrame )
{
Point aPoint( 0, 0 );
Region aRegion( Rectangle( aPoint, Size( mnOutWidth, mnOutHeight ) ) );
ImplInvalidateOverlapFrameRegion( aRegion );
if ( mpWindowImpl->mbFrame || (mpWindowImpl->mpBorderWindow && mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame) )
- bFlush = TRUE;
+ bFlush = sal_True;
}
// Ein Update wirkt immer auf das OverlapWindow, damit bei spaeteren
@@ -3103,9 +3115,9 @@ void Window::ImplUpdateWindowPtr()
// -----------------------------------------------------------------------
-void Window::ImplUpdateOverlapWindowPtr( BOOL bNewFrame )
+void Window::ImplUpdateOverlapWindowPtr( sal_Bool bNewFrame )
{
- BOOL bVisible = IsVisible();
+ sal_Bool bVisible = IsVisible();
Show( false );
ImplRemoveWindow( bNewFrame );
Window* pRealParent = mpWindowImpl->mpRealParent;
@@ -3132,9 +3144,9 @@ void Window::ImplUpdateOverlapWindowPtr( BOOL bNewFrame )
// -----------------------------------------------------------------------
-BOOL Window::ImplUpdatePos()
+sal_Bool Window::ImplUpdatePos()
{
- BOOL bSysChild = FALSE;
+ sal_Bool bSysChild = sal_False;
if ( ImplIsOverlapWindow() )
{
@@ -3153,12 +3165,12 @@ BOOL Window::ImplUpdatePos()
while ( pChild )
{
if ( pChild->ImplUpdatePos() )
- bSysChild = TRUE;
+ bSysChild = sal_True;
pChild = pChild->mpWindowImpl->mpNext;
}
if ( mpWindowImpl->mpSysObj )
- bSysChild = TRUE;
+ bSysChild = sal_True;
return bSysChild;
}
@@ -3180,11 +3192,11 @@ void Window::ImplUpdateSysObjPos()
// -----------------------------------------------------------------------
void Window::ImplPosSizeWindow( long nX, long nY,
- long nWidth, long nHeight, USHORT nFlags )
+ long nWidth, long nHeight, sal_uInt16 nFlags )
{
- BOOL bNewPos = FALSE;
- BOOL bNewSize = FALSE;
- BOOL bCopyBits = FALSE;
+ sal_Bool bNewPos = sal_False;
+ sal_Bool bNewSize = sal_False;
+ sal_Bool bCopyBits = sal_False;
long nOldOutOffX = mnOutOffX;
long nOldOutOffY = mnOutOffY;
long nOldOutWidth = mnOutWidth;
@@ -3206,17 +3218,17 @@ void Window::ImplPosSizeWindow( long nX, long nY,
if ( mnOutWidth && mnOutHeight && !mpWindowImpl->mbPaintTransparent &&
!mpWindowImpl->mbInitWinClipRegion && !mpWindowImpl->maWinClipRegion.IsEmpty() &&
!HasPaintEvent() )
- bCopyBits = TRUE;
+ bCopyBits = sal_True;
}
- BOOL bnXRecycled = FALSE; // avoid duplicate mirroring in RTL case
+ sal_Bool bnXRecycled = sal_False; // avoid duplicate mirroring in RTL case
if ( nFlags & WINDOW_POSSIZE_WIDTH )
{
if(!( nFlags & WINDOW_POSSIZE_X ))
{
nX = mpWindowImpl->mnX;
nFlags |= WINDOW_POSSIZE_X;
- bnXRecycled = TRUE; // we're using a mnX which was already mirrored in RTL case
+ bnXRecycled = sal_True; // we're using a mnX which was already mirrored in RTL case
}
if ( nWidth < 0 )
@@ -3224,8 +3236,8 @@ void Window::ImplPosSizeWindow( long nX, long nY,
if ( nWidth != mnOutWidth )
{
mnOutWidth = nWidth;
- bNewSize = TRUE;
- bCopyBits = FALSE;
+ bNewSize = sal_True;
+ bCopyBits = sal_False;
}
}
if ( nFlags & WINDOW_POSSIZE_HEIGHT )
@@ -3235,8 +3247,8 @@ void Window::ImplPosSizeWindow( long nX, long nY,
if ( nHeight != mnOutHeight )
{
mnOutHeight = nHeight;
- bNewSize = TRUE;
- bCopyBits = FALSE;
+ bNewSize = sal_True;
+ bCopyBits = sal_False;
}
}
@@ -3286,12 +3298,12 @@ void Window::ImplPosSizeWindow( long nX, long nY,
pOverlapRegion = new Region();
ImplCalcOverlapRegion( Rectangle( Point( mnOutOffX, mnOutOffY ),
Size( mnOutWidth, mnOutHeight ) ),
- *pOverlapRegion, FALSE, TRUE, TRUE );
+ *pOverlapRegion, sal_False, sal_True, sal_True );
}
mpWindowImpl->mnX = nX;
mpWindowImpl->maPos.X() = nOrgX;
mpWindowImpl->mnAbsScreenX = aPtDev.X(); // --- RTL --- (store real screen pos)
- bNewPos = TRUE;
+ bNewPos = sal_True;
}
}
if ( nFlags & WINDOW_POSSIZE_Y )
@@ -3304,11 +3316,11 @@ void Window::ImplPosSizeWindow( long nX, long nY,
pOverlapRegion = new Region();
ImplCalcOverlapRegion( Rectangle( Point( mnOutOffX, mnOutOffY ),
Size( mnOutWidth, mnOutHeight ) ),
- *pOverlapRegion, FALSE, TRUE, TRUE );
+ *pOverlapRegion, sal_False, sal_True, sal_True );
}
mpWindowImpl->mnY = nY;
mpWindowImpl->maPos.Y() = nY;
- bNewPos = TRUE;
+ bNewPos = sal_True;
}
}
@@ -3324,7 +3336,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
*/
if ( bNewPos || bNewSize )
{
- BOOL bUpdateSysObjPos = FALSE;
+ sal_Bool bUpdateSysObjPos = sal_False;
if ( bNewPos )
bUpdateSysObjPos = ImplUpdatePos();
@@ -3351,7 +3363,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
}
else
{
- mpWindowImpl->mpClientWindow->mpWindowImpl->mbCallMove = TRUE;
+ mpWindowImpl->mpClientWindow->mpWindowImpl->mbCallMove = sal_True;
}
}
}
@@ -3377,12 +3389,12 @@ void Window::ImplPosSizeWindow( long nX, long nY,
else
{
if ( bNewPos )
- mpWindowImpl->mbCallMove = TRUE;
+ mpWindowImpl->mbCallMove = sal_True;
if ( bNewSize )
- mpWindowImpl->mbCallResize = TRUE;
+ mpWindowImpl->mbCallResize = sal_True;
}
- BOOL bUpdateSysObjClip = FALSE;
+ sal_Bool bUpdateSysObjClip = sal_False;
if ( IsReallyVisible() )
{
if ( bNewPos || bNewSize )
@@ -3393,7 +3405,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
if ( mpWindowImpl->mpFrameData->mpFirstBackWin )
ImplInvalidateAllOverlapBackgrounds();
// Clip-Flag neu setzen
- bUpdateSysObjClip = !ImplSetClipFlag( TRUE );
+ bUpdateSysObjClip = !ImplSetClipFlag( sal_True );
}
// Fensterinhalt invalidieren ?
@@ -3401,8 +3413,8 @@ void Window::ImplPosSizeWindow( long nX, long nY,
{
if ( bNewPos )
{
- BOOL bInvalidate = FALSE;
- BOOL bParentPaint = TRUE;
+ sal_Bool bInvalidate = sal_False;
+ sal_Bool bParentPaint = sal_True;
if ( !ImplIsOverlapWindow() )
bParentPaint = mpWindowImpl->mpParent->IsPaintEnabled();
if ( bCopyBits && bParentPaint && !HasPaintEvent() )
@@ -3412,7 +3424,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
Size( mnOutWidth, mnOutHeight ) ) );
if ( mpWindowImpl->mbWinRegion )
aRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
- ImplClipBoundaries( aRegion, FALSE, TRUE );
+ ImplClipBoundaries( aRegion, sal_False, sal_True );
if ( !pOverlapRegion->IsEmpty() )
{
pOverlapRegion->Move( mnOutOffX-nOldOutOffX, mnOutOffY-nOldOutOffY );
@@ -3424,7 +3436,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
ImplMoveAllInvalidateRegions( Rectangle( Point( nOldOutOffX, nOldOutOffY ),
Size( nOldOutWidth, nOldOutHeight ) ),
mnOutOffX-nOldOutOffX, mnOutOffY-nOldOutOffY,
- TRUE );
+ sal_True );
SalGraphics* pGraphics = ImplGetFrameGraphics();
if ( pGraphics )
{
@@ -3437,10 +3449,10 @@ void Window::ImplPosSizeWindow( long nX, long nY,
SAL_COPYAREA_WINDOWINVALIDATE, this );
}
else
- bInvalidate = TRUE;
+ bInvalidate = sal_True;
}
else
- bInvalidate = TRUE;
+ bInvalidate = sal_True;
if ( !bInvalidate )
{
if ( !pOverlapRegion->IsEmpty() )
@@ -3448,10 +3460,10 @@ void Window::ImplPosSizeWindow( long nX, long nY,
}
}
else
- bInvalidate = TRUE;
+ bInvalidate = sal_True;
}
else
- bInvalidate = TRUE;
+ bInvalidate = sal_True;
if ( bInvalidate )
ImplInvalidateFrameRegion( NULL, INVALIDATE_CHILDREN );
}
@@ -3463,7 +3475,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
aRegion.Exclude( *pOldRegion );
if ( mpWindowImpl->mbWinRegion )
aRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
- ImplClipBoundaries( aRegion, FALSE, TRUE );
+ ImplClipBoundaries( aRegion, sal_False, sal_True );
if ( !aRegion.IsEmpty() )
ImplInvalidateFrameRegion( &aRegion, INVALIDATE_CHILDREN );
}
@@ -3476,7 +3488,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
Region aRegion( *pOldRegion );
if ( !mpWindowImpl->mbPaintTransparent )
ImplExcludeWindowRegion( aRegion );
- ImplClipBoundaries( aRegion, FALSE, TRUE );
+ ImplClipBoundaries( aRegion, sal_False, sal_True );
if ( !aRegion.IsEmpty() && !mpWindowImpl->mpBorderWindow )
ImplInvalidateParentFrameRegion( aRegion );
}
@@ -3567,7 +3579,7 @@ void Window::ImplCalcChildOverlapToTop( ImplCalcToTopData* pPrevData )
// -----------------------------------------------------------------------
-void Window::ImplToTop( USHORT nFlags )
+void Window::ImplToTop( sal_uInt16 nFlags )
{
DBG_ASSERT( ImplIsOverlapWindow(), "Window::ImplToTop(): Is not a OverlapWindow" );
@@ -3584,7 +3596,7 @@ void Window::ImplToTop( USHORT nFlags )
// do not bring floating windows on the client to top
if( !ImplGetClientWindow() || !(ImplGetClientWindow()->GetStyle() & WB_SYSTEMFLOATWIN) )
{
- USHORT nSysFlags = 0;
+ sal_uInt16 nSysFlags = 0;
if ( nFlags & TOTOP_RESTOREWHENMIN )
nSysFlags |= SAL_FRAME_TOTOP_RESTOREWHENMIN;
if ( nFlags & TOTOP_FOREGROUNDTASK )
@@ -3607,7 +3619,7 @@ void Window::ImplToTop( USHORT nFlags )
mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpLastOverlap = mpWindowImpl->mpPrev;
// AlwaysOnTop beruecksichtigen
- BOOL bOnTop = IsAlwaysOnTopEnabled();
+ sal_Bool bOnTop = IsAlwaysOnTopEnabled();
Window* pNextWin = mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap;
if ( !bOnTop )
{
@@ -3620,7 +3632,7 @@ void Window::ImplToTop( USHORT nFlags )
}
// TopLevel abpruefen
- BYTE nTopLevel = mpWindowImpl->mpOverlapData->mnTopLevel;
+ sal_uInt8 nTopLevel = mpWindowImpl->mpOverlapData->mnTopLevel;
while ( pNextWin )
{
if ( (bOnTop != pNextWin->IsAlwaysOnTopEnabled()) ||
@@ -3661,7 +3673,7 @@ void Window::ImplToTop( USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::ImplStartToTop( USHORT nFlags )
+void Window::ImplStartToTop( sal_uInt16 nFlags )
{
ImplCalcToTopData aStartData;
ImplCalcToTopData* pCurData;
@@ -3716,7 +3728,7 @@ void Window::ImplStartToTop( USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::ImplFocusToTop( USHORT nFlags, BOOL bReallyVisible )
+void Window::ImplFocusToTop( sal_uInt16 nFlags, sal_Bool bReallyVisible )
{
// Soll Focus auch geholt werden?
if ( !(nFlags & TOTOP_NOGRABFOCUS) )
@@ -3735,7 +3747,7 @@ void Window::ImplFocusToTop( USHORT nFlags, BOOL bReallyVisible )
pFocusWindow = pFocusWindow->ImplGetParent();
}
if ( (pFocusWindow->mpWindowImpl->mnActivateMode & ACTIVATE_MODE_GRABFOCUS) &&
- !pFocusWindow->HasChildPathFocus( TRUE ) )
+ !pFocusWindow->HasChildPathFocus( sal_True ) )
pFocusWindow->GrabFocus();
}
@@ -3753,7 +3765,7 @@ void Window::ImplShowAllOverlaps()
if ( pOverlapWindow->mpWindowImpl->mbOverlapVisible )
{
pOverlapWindow->Show( true, SHOW_NOACTIVATE );
- pOverlapWindow->mpWindowImpl->mbOverlapVisible = FALSE;
+ pOverlapWindow->mpWindowImpl->mbOverlapVisible = sal_False;
}
pOverlapWindow = pOverlapWindow->mpWindowImpl->mpNext;
@@ -3769,7 +3781,7 @@ void Window::ImplHideAllOverlaps()
{
if ( pOverlapWindow->IsVisible() )
{
- pOverlapWindow->mpWindowImpl->mbOverlapVisible = TRUE;
+ pOverlapWindow->mpWindowImpl->mbOverlapVisible = sal_True;
pOverlapWindow->Show( false );
}
@@ -3779,24 +3791,24 @@ void Window::ImplHideAllOverlaps()
// -----------------------------------------------------------------------
-void Window::ImplCallMouseMove( USHORT nMouseCode, BOOL bModChanged )
+void Window::ImplCallMouseMove( sal_uInt16 nMouseCode, sal_Bool bModChanged )
{
if ( mpWindowImpl->mpFrameData->mbMouseIn && mpWindowImpl->mpFrameWindow->mpWindowImpl->mbReallyVisible )
{
- ULONG nTime = Time::GetSystemTicks();
+ sal_uLong nTime = Time::GetSystemTicks();
long nX = mpWindowImpl->mpFrameData->mnLastMouseX;
long nY = mpWindowImpl->mpFrameData->mnLastMouseY;
- USHORT nCode = nMouseCode;
- USHORT nMode = mpWindowImpl->mpFrameData->mnMouseMode;
- BOOL bLeave;
+ sal_uInt16 nCode = nMouseCode;
+ sal_uInt16 nMode = mpWindowImpl->mpFrameData->mnMouseMode;
+ sal_Bool bLeave;
// Auf MouseLeave testen
if ( ((nX < 0) || (nY < 0) ||
(nX >= mpWindowImpl->mpFrameWindow->mnOutWidth) ||
(nY >= mpWindowImpl->mpFrameWindow->mnOutHeight)) &&
!ImplGetSVData()->maWinData.mpCaptureWin )
- bLeave = TRUE;
+ bLeave = sal_True;
else
- bLeave = FALSE;
+ bLeave = sal_False;
nMode |= MOUSE_SYNTHETIC;
if ( bModChanged )
nMode |= MOUSE_MODIFIERCHANGED;
@@ -3843,8 +3855,8 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow,
Window* pNewRealWindow;
Window* pOldRealWindow;
Window* pLastRealWindow;
- BOOL bCallActivate = TRUE;
- BOOL bCallDeactivate = TRUE;
+ sal_Bool bCallActivate = sal_True;
+ sal_Bool bCallDeactivate = sal_True;
pOldRealWindow = pOldOverlapWindow->ImplGetWindow();
pNewRealWindow = pNewOverlapWindow->ImplGetWindow();
@@ -3855,7 +3867,7 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow,
!pNewRealWindow->GetActivateMode() )
{
pSVData->maWinData.mpLastDeacWin = pOldOverlapWindow;
- bCallDeactivate = FALSE;
+ bCallDeactivate = sal_False;
}
}
else if ( (pNewRealWindow->GetType() != WINDOW_FLOATINGWINDOW) ||
@@ -3864,15 +3876,15 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow,
if ( pSVData->maWinData.mpLastDeacWin )
{
if ( pSVData->maWinData.mpLastDeacWin == pNewOverlapWindow )
- bCallActivate = FALSE;
+ bCallActivate = sal_False;
else
{
pLastRealWindow = pSVData->maWinData.mpLastDeacWin->ImplGetWindow();
- pSVData->maWinData.mpLastDeacWin->mpWindowImpl->mbActive = FALSE;
+ pSVData->maWinData.mpLastDeacWin->mpWindowImpl->mbActive = sal_False;
pSVData->maWinData.mpLastDeacWin->Deactivate();
if ( pLastRealWindow != pSVData->maWinData.mpLastDeacWin )
{
- pLastRealWindow->mpWindowImpl->mbActive = TRUE;
+ pLastRealWindow->mpWindowImpl->mbActive = sal_True;
pLastRealWindow->Activate();
}
}
@@ -3884,14 +3896,14 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow,
{
if( pOldOverlapWindow->mpWindowImpl->mbActive )
{
- pOldOverlapWindow->mpWindowImpl->mbActive = FALSE;
+ pOldOverlapWindow->mpWindowImpl->mbActive = sal_False;
pOldOverlapWindow->Deactivate();
}
if ( pOldRealWindow != pOldOverlapWindow )
{
if( pOldRealWindow->mpWindowImpl->mbActive )
{
- pOldRealWindow->mpWindowImpl->mbActive = FALSE;
+ pOldRealWindow->mpWindowImpl->mbActive = sal_False;
pOldRealWindow->Deactivate();
}
}
@@ -3900,14 +3912,14 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow,
{
if( ! pNewOverlapWindow->mpWindowImpl->mbActive )
{
- pNewOverlapWindow->mpWindowImpl->mbActive = TRUE;
+ pNewOverlapWindow->mpWindowImpl->mbActive = sal_True;
pNewOverlapWindow->Activate();
}
if ( pNewRealWindow != pNewOverlapWindow )
{
if( ! pNewRealWindow->mpWindowImpl->mbActive )
{
- pNewRealWindow->mpWindowImpl->mbActive = TRUE;
+ pNewRealWindow->mpWindowImpl->mbActive = sal_True;
pNewRealWindow->Activate();
}
}
@@ -3929,7 +3941,7 @@ static bool IsWindowFocused(const WindowImpl& rWinImpl)
}
// -----------------------------------------------------------------------
-void Window::ImplGrabFocus( USHORT nFlags )
+void Window::ImplGrabFocus( sal_uInt16 nFlags )
{
// #143570# no focus for destructing windows
if( mpWindowImpl->mbInDtor )
@@ -3987,13 +3999,13 @@ void Window::ImplGrabFocus( USHORT nFlags )
// which is done using ToTop
ImplSVData* pSVData = ImplGetSVData();
- BOOL bAsyncFocusWaiting = FALSE;
+ sal_Bool bAsyncFocusWaiting = sal_False;
Window *pFrame = pSVData->maWinData.mpFirstFrame;
while( pFrame )
{
if( pFrame != mpWindowImpl->mpFrameWindow && pFrame->mpWindowImpl->mpFrameData->mnFocusId )
{
- bAsyncFocusWaiting = TRUE;
+ bAsyncFocusWaiting = sal_True;
break;
}
pFrame = pFrame->mpWindowImpl->mpFrameData->mpNextFrame;
@@ -4001,7 +4013,7 @@ void Window::ImplGrabFocus( USHORT nFlags )
bool bHasFocus = IsWindowFocused(*mpWindowImpl);
- BOOL bMustNotGrabFocus = FALSE;
+ sal_Bool bMustNotGrabFocus = sal_False;
// #100242#, check parent hierarchy if some floater prohibits grab focus
Window *pParent = this;
@@ -4011,7 +4023,7 @@ void Window::ImplGrabFocus( USHORT nFlags )
// otherwise we cannot set the focus in a floating toolbox
if( ( (pParent->mpWindowImpl->mbFloatWin && ((FloatingWindow*)pParent)->GrabsFocus()) || ( pParent->GetStyle() & WB_SYSTEMFLOATWIN ) ) && !( pParent->GetStyle() & WB_MOVEABLE ) )
{
- bMustNotGrabFocus = TRUE;
+ bMustNotGrabFocus = sal_True;
break;
}
pParent = pParent->mpWindowImpl->mpParent;
@@ -4072,11 +4084,11 @@ void Window::ImplGrabFocus( USHORT nFlags )
{
Window* pNewOverlapWindow = ImplGetFirstOverlapWindow();
Window* pNewRealWindow = pNewOverlapWindow->ImplGetWindow();
- pNewOverlapWindow->mpWindowImpl->mbActive = TRUE;
+ pNewOverlapWindow->mpWindowImpl->mbActive = sal_True;
pNewOverlapWindow->Activate();
if ( pNewRealWindow != pNewOverlapWindow )
{
- pNewRealWindow->mpWindowImpl->mbActive = TRUE;
+ pNewRealWindow->mpWindowImpl->mbActive = sal_True;
pNewRealWindow->Activate();
}
}
@@ -4106,7 +4118,7 @@ void Window::ImplGrabFocus( USHORT nFlags )
{
if ( mpWindowImpl->mpCursor )
mpWindowImpl->mpCursor->ImplShow();
- mpWindowImpl->mbInFocusHdl = TRUE;
+ mpWindowImpl->mbInFocusHdl = sal_True;
mpWindowImpl->mnGetFocusFlags = nFlags;
// if we're changing focus due to closing a popup floating window
// notify the new focus window so it can restore the inner focus
@@ -4123,7 +4135,7 @@ void Window::ImplGrabFocus( USHORT nFlags )
if( !aDogTag.IsDelete() )
{
mpWindowImpl->mnGetFocusFlags = 0;
- mpWindowImpl->mbInFocusHdl = FALSE;
+ mpWindowImpl->mbInFocusHdl = sal_False;
}
}
}
@@ -4243,6 +4255,8 @@ namespace
Window::~Window()
{
+ ImplFreeExtWindowImpl();
+
vcl::LazyDeletor<Window>::Undelete( this );
DBG_DTOR( Window, ImplDbgCheckWindow );
@@ -4254,7 +4268,7 @@ Window::~Window()
// Dispose of the canvas implementation (which, currently, has an
// own wrapper window as a child to this one.
- Reference< rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas );
+ uno::Reference< rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas );
if( xCanvas.is() )
{
uno::Reference < lang::XComponent > xCanvasComponent( xCanvas,
@@ -4263,7 +4277,7 @@ Window::~Window()
xCanvasComponent->dispose();
}
- mpWindowImpl->mbInDtor = TRUE;
+ mpWindowImpl->mbInDtor = sal_True;
ImplCallEventListeners( VCLEVENT_OBJECT_DYING );
@@ -4299,12 +4313,12 @@ Window::~Window()
// deregister drop target listener
if( mpWindowImpl->mpFrameData->mxDropTargetListener.is() )
{
- Reference< XDragGestureRecognizer > xDragGestureRecognizer =
- Reference< XDragGestureRecognizer > (mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY);
+ uno::Reference< XDragGestureRecognizer > xDragGestureRecognizer =
+ uno::Reference< XDragGestureRecognizer > (mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY);
if( xDragGestureRecognizer.is() )
{
xDragGestureRecognizer->removeDragGestureListener(
- Reference< XDragGestureListener > (mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY));
+ uno::Reference< XDragGestureListener > (mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY));
}
mpWindowImpl->mpFrameData->mxDropTarget->removeDropTargetListener( mpWindowImpl->mpFrameData->mxDropTargetListener );
@@ -4312,7 +4326,7 @@ Window::~Window()
}
// shutdown drag and drop for this frame window
- Reference< XComponent > xComponent( mpWindowImpl->mpFrameData->mxDropTarget, UNO_QUERY );
+ uno::Reference< XComponent > xComponent( mpWindowImpl->mpFrameData->mxDropTarget, UNO_QUERY );
// DNDEventDispatcher does not hold a reference of the DropTarget,
// so it's ok if it does not support XComponent
@@ -4326,7 +4340,7 @@ Window::~Window()
}
}
- UnoWrapperBase* pWrapper = Application::GetUnoWrapper( FALSE );
+ UnoWrapperBase* pWrapper = Application::GetUnoWrapper( sal_False );
if ( pWrapper )
pWrapper->WindowDestroyed( this );
@@ -4362,16 +4376,16 @@ Window::~Window()
pSVData->maWinData.mpDefDialogParent = NULL;
#ifdef DBG_UTIL
- if ( TRUE ) // always perform these tests in non-pro versions
+ if ( sal_True ) // always perform these tests in non-pro versions
{
ByteString aErrorStr;
- BOOL bError = FALSE;
+ sal_Bool bError = sal_False;
Window* pTempWin = mpWindowImpl->mpFrameData->mpFirstOverlap;
while ( pTempWin )
{
if ( ImplIsRealParentPath( pTempWin ) )
{
- bError = TRUE;
+ bError = sal_True;
lcl_appendWindowInfo( aErrorStr, *pTempWin );
}
pTempWin = pTempWin->mpWindowImpl->mpNextOverlap;
@@ -4386,13 +4400,13 @@ Window::~Window()
GetpApp()->Abort( String( aTempStr, RTL_TEXTENCODING_UTF8 ) ); // abort in non-pro version, this must be fixed!
}
- bError = FALSE;
+ bError = sal_False;
pTempWin = pSVData->maWinData.mpFirstFrame;
while ( pTempWin )
{
if ( ImplIsRealParentPath( pTempWin ) )
{
- bError = TRUE;
+ bError = sal_True;
lcl_appendWindowInfo( aErrorStr, *pTempWin );
}
pTempWin = pTempWin->mpWindowImpl->mpFrameData->mpNextFrame;
@@ -4499,11 +4513,11 @@ Window::~Window()
}
// check if the focus window is our child
- BOOL bHasFocussedChild = FALSE;
+ sal_Bool bHasFocussedChild = sal_False;
if( pSVData->maWinData.mpFocusWin && ImplIsRealParentPath( pSVData->maWinData.mpFocusWin ) )
{
// #122232#, this must not happen and is an application bug ! but we try some cleanup to hopefully avoid crashes, see below
- bHasFocussedChild = TRUE;
+ bHasFocussedChild = sal_True;
#ifdef DBG_UTIL
ByteString aTempStr( "Window (" );
aTempStr += ByteString( GetText(), RTL_TEXTENCODING_UTF8 );
@@ -4589,18 +4603,18 @@ Window::~Window()
ImplDelData* pDelData = mpWindowImpl->mpFirstDel;
while ( pDelData )
{
- pDelData->mbDel = TRUE;
+ pDelData->mbDel = sal_True;
pDelData->mpWindow = NULL; // #112873# pDel is not associated with a Window anymore
pDelData = pDelData->mpNext;
}
// Fenster aus den Listen austragen
- ImplRemoveWindow( TRUE );
+ ImplRemoveWindow( sal_True );
// de-register as "top window child" at our parent, if necessary
if ( mpWindowImpl->mbFrame )
{
- BOOL bIsTopWindow = mpWindowImpl->mpWinData && ( mpWindowImpl->mpWinData->mnIsTopWindow == 1 );
+ sal_Bool bIsTopWindow = mpWindowImpl->mpWinData && ( mpWindowImpl->mpWinData->mnIsTopWindow == 1 );
if ( mpWindowImpl->mpRealParent && bIsTopWindow )
{
ImplWinData* pParentWinData = mpWindowImpl->mpRealParent->ImplGetWinData();
@@ -4626,10 +4640,6 @@ Window::~Window()
delete mpWindowImpl->mpWinData->mpFocusRect;
if ( mpWindowImpl->mpWinData->mpTrackRect )
delete mpWindowImpl->mpWinData->mpTrackRect;
- if ( mpWindowImpl->mpWinData->mpSmartHelpId )
- delete mpWindowImpl->mpWinData->mpSmartHelpId;
- if ( mpWindowImpl->mpWinData->mpSmartUniqueId )
- delete mpWindowImpl->mpWinData->mpSmartUniqueId;
delete mpWindowImpl->mpWinData;
}
@@ -4683,17 +4693,24 @@ void Window::doLazyDelete()
vcl::LazyDeletor<Window>::Delete( this );
}
-USHORT Window::GetIndicatorState() const
+sal_uInt16 Window::GetIndicatorState() const
{
return mpWindowImpl->mpFrame->GetIndicatorState().mnState;
}
-void Window::SimulateKeyPress( USHORT nKeyCode ) const
+void Window::SimulateKeyPress( sal_uInt16 nKeyCode ) const
{
mpWindowImpl->mpFrame->SimulateKeyPress(nKeyCode);
}
// -----------------------------------------------------------------------
+void Window::InterceptChildWindowKeyDown( sal_Bool bIntercept )
+{
+ if( mpWindowImpl->mpSysObj )
+ mpWindowImpl->mpSysObj->InterceptChildWindowKeyDown( bIntercept );
+}
+
+// -----------------------------------------------------------------------
void Window::MouseMove( const MouseEvent& rMEvt )
{
@@ -4703,7 +4720,7 @@ void Window::MouseMove( const MouseEvent& rMEvt )
NotifyEvent aNEvt( EVENT_MOUSEMOVE, this, &rMEvt );
if ( !Notify( aNEvt ) )
- mpWindowImpl->mbMouseMove = TRUE;
+ mpWindowImpl->mbMouseMove = sal_True;
}
// -----------------------------------------------------------------------
@@ -4716,7 +4733,7 @@ void Window::MouseButtonDown( const MouseEvent& rMEvt )
NotifyEvent aNEvt( EVENT_MOUSEBUTTONDOWN, this, &rMEvt );
if ( !Notify( aNEvt ) )
- mpWindowImpl->mbMouseButtonDown = TRUE;
+ mpWindowImpl->mbMouseButtonDown = sal_True;
}
// -----------------------------------------------------------------------
@@ -4729,7 +4746,7 @@ void Window::MouseButtonUp( const MouseEvent& rMEvt )
NotifyEvent aNEvt( EVENT_MOUSEBUTTONUP, this, &rMEvt );
if ( !Notify( aNEvt ) )
- mpWindowImpl->mbMouseButtonUp = TRUE;
+ mpWindowImpl->mbMouseButtonUp = sal_True;
}
// -----------------------------------------------------------------------
@@ -4742,7 +4759,7 @@ void Window::KeyInput( const KeyEvent& rKEvt )
NotifyEvent aNEvt( EVENT_KEYINPUT, this, &rKEvt );
if ( !Notify( aNEvt ) )
- mpWindowImpl->mbKeyInput = TRUE;
+ mpWindowImpl->mbKeyInput = sal_True;
}
// -----------------------------------------------------------------------
@@ -4755,7 +4772,7 @@ void Window::KeyUp( const KeyEvent& rKEvt )
NotifyEvent aNEvt( EVENT_KEYUP, this, &rKEvt );
if ( !Notify( aNEvt ) )
- mpWindowImpl->mbKeyUp = TRUE;
+ mpWindowImpl->mbKeyUp = sal_True;
}
// -----------------------------------------------------------------------
@@ -4777,7 +4794,13 @@ void Window::Paint( const Rectangle& rRect )
// -----------------------------------------------------------------------
-void Window::Draw( OutputDevice*, const Point&, const Size&, ULONG )
+void Window::PostPaint()
+{
+}
+
+// -----------------------------------------------------------------------
+
+void Window::Draw( OutputDevice*, const Point&, const Size&, sal_uLong )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
}
@@ -4881,29 +4904,18 @@ void Window::RequestHelp( const HelpEvent& rHEvt )
}
else
{
- SmartId aSmartId = GetSmartHelpId();
-
- ULONG nNumHelpId = 0;
- String aStrHelpId;
- if( aSmartId.HasString() )
- aStrHelpId = aSmartId.GetStr();
- if( aSmartId.HasNumeric() )
- nNumHelpId = aSmartId.GetNum();
-
- if ( !nNumHelpId && aStrHelpId.Len() == 0 && ImplGetParent() )
+ String aStrHelpId( rtl::OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
+ if ( aStrHelpId.Len() == 0 && ImplGetParent() )
ImplGetParent()->RequestHelp( rHEvt );
else
{
- if ( !nNumHelpId && aStrHelpId.Len() == 0 )
- nNumHelpId = OOO_HELP_INDEX;
-
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
if( aStrHelpId.Len() > 0 )
pHelp->Start( aStrHelpId, this );
else
- pHelp->Start( nNumHelpId, this );
+ pHelp->Start( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OOO_HELP_INDEX ) ), this );
}
}
}
@@ -4921,7 +4933,7 @@ void Window::Command( const CommandEvent& rCEvt )
NotifyEvent aNEvt( EVENT_COMMAND, this, &rCEvt );
if ( !Notify( aNEvt ) )
- mpWindowImpl->mbCommand = TRUE;
+ mpWindowImpl->mbCommand = sal_True;
}
// -----------------------------------------------------------------------
@@ -4937,7 +4949,7 @@ void Window::Tracking( const TrackingEvent& rTEvt )
// -----------------------------------------------------------------------
-void Window::UserEvent( ULONG, void* )
+void Window::UserEvent( sal_uLong, void* )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
}
@@ -5065,7 +5077,7 @@ long Window::PreNotify( NotifyEvent& rNEvt )
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
}
- long bDone = FALSE;
+ long bDone = sal_False;
if ( mpWindowImpl->mpParent && !ImplIsOverlapWindow() )
bDone = mpWindowImpl->mpParent->PreNotify( rNEvt );
@@ -5073,11 +5085,11 @@ long Window::PreNotify( NotifyEvent& rNEvt )
{
if( rNEvt.GetType() == EVENT_GETFOCUS )
{
- BOOL bCompoundFocusChanged = FALSE;
+ sal_Bool bCompoundFocusChanged = sal_False;
if ( mpWindowImpl->mbCompoundControl && !mpWindowImpl->mbCompoundControlHasFocus && HasChildPathFocus() )
{
- mpWindowImpl->mbCompoundControlHasFocus = TRUE;
- bCompoundFocusChanged = TRUE;
+ mpWindowImpl->mbCompoundControlHasFocus = sal_True;
+ bCompoundFocusChanged = sal_True;
}
if ( bCompoundFocusChanged || ( rNEvt.GetWindow() == this ) )
@@ -5085,11 +5097,11 @@ long Window::PreNotify( NotifyEvent& rNEvt )
}
else if( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
- BOOL bCompoundFocusChanged = FALSE;
+ sal_Bool bCompoundFocusChanged = sal_False;
if ( mpWindowImpl->mbCompoundControl && mpWindowImpl->mbCompoundControlHasFocus && !HasChildPathFocus() )
{
- mpWindowImpl->mbCompoundControlHasFocus = FALSE ;
- bCompoundFocusChanged = TRUE;
+ mpWindowImpl->mbCompoundControlHasFocus = sal_False ;
+ bCompoundFocusChanged = sal_True;
}
if ( bCompoundFocusChanged || ( rNEvt.GetWindow() == this ) )
@@ -5112,7 +5124,7 @@ long Window::Notify( NotifyEvent& rNEvt )
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
}
- long nRet = FALSE;
+ long nRet = sal_False;
// check for docking window
// but do nothing if window is docked and locked
@@ -5122,27 +5134,27 @@ long Window::Notify( NotifyEvent& rNEvt )
if ( rNEvt.GetType() == EVENT_MOUSEBUTTONDOWN )
{
const MouseEvent* pMEvt = rNEvt.GetMouseEvent();
- BOOL bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() );
+ sal_Bool bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() );
if ( pMEvt->IsLeft() )
{
if ( pMEvt->IsMod1() && (pMEvt->GetClicks() == 2) )
{
// ctrl double click toggles floating mode
pWrapper->SetFloatingMode( !pWrapper->IsFloatingMode() );
- return TRUE;
+ return sal_True;
}
else if ( pMEvt->GetClicks() == 1 && bHit)
{
// allow start docking during mouse move
pWrapper->ImplEnableStartDocking();
- return TRUE;
+ return sal_True;
}
}
}
else if ( rNEvt.GetType() == EVENT_MOUSEMOVE )
{
const MouseEvent* pMEvt = rNEvt.GetMouseEvent();
- BOOL bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() );
+ sal_Bool bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() );
if ( pMEvt->IsLeft() )
{
// check if a single click initiated this sequence ( ImplStartDockingEnabled() )
@@ -5159,7 +5171,7 @@ long Window::Notify( NotifyEvent& rNEvt )
}
pWrapper->ImplStartDocking( aPos );
}
- return TRUE;
+ return sal_True;
}
}
else if( rNEvt.GetType() == EVENT_KEYINPUT )
@@ -5177,7 +5189,7 @@ long Window::Notify( NotifyEvent& rNEvt )
*/
if( pWrapper->IsFloatingMode() )
ToTop( TOTOP_GRABFOCUSONLY );
- return TRUE;
+ return sal_True;
}
}
}
@@ -5200,7 +5212,7 @@ long Window::Notify( NotifyEvent& rNEvt )
if ( (rNEvt.GetWindow() == this) && (rNEvt.GetType() == EVENT_GETFOCUS) &&
!(GetStyle() & WB_TABSTOP) && !(mpWindowImpl->mnDlgCtrlFlags & WINDOW_DLGCTRL_WANTFOCUS) )
{
- USHORT n = 0;
+ sal_uInt16 n = 0;
Window* pFirstChild = ImplGetDlgWindow( n, DLGWINDOW_FIRST );
if ( pFirstChild )
pFirstChild->ImplControlFocus();
@@ -5219,7 +5231,7 @@ long Window::Notify( NotifyEvent& rNEvt )
// -----------------------------------------------------------------------
-void Window::ImplCallEventListeners( ULONG nEvent, void* pData )
+void Window::ImplCallEventListeners( sal_uLong nEvent, void* pData )
{
// The implementation was moved to CallEventListeners(),
// because derived classes in svtools must be able to
@@ -5232,7 +5244,7 @@ void Window::ImplCallEventListeners( ULONG nEvent, void* pData )
// -----------------------------------------------------------------------
-void Window::CallEventListeners( ULONG nEvent, void* pData )
+void Window::CallEventListeners( sal_uLong nEvent, void* pData )
{
VclWindowEvent aEvent( this, nEvent, pData );
@@ -5302,25 +5314,25 @@ void Window::RemoveChildEventListener( const Link& rEventListener )
// -----------------------------------------------------------------------
-ULONG Window::PostUserEvent( ULONG nEvent, void* pEventData )
+sal_uLong Window::PostUserEvent( sal_uLong nEvent, void* pEventData )
{
- ULONG nEventId;
+ sal_uLong nEventId;
PostUserEvent( nEventId, nEvent, pEventData );
return nEventId;
}
// -----------------------------------------------------------------------
-ULONG Window::PostUserEvent( const Link& rLink, void* pCaller )
+sal_uLong Window::PostUserEvent( const Link& rLink, void* pCaller )
{
- ULONG nEventId;
+ sal_uLong nEventId;
PostUserEvent( nEventId, rLink, pCaller );
return nEventId;
}
// -----------------------------------------------------------------------
-BOOL Window::PostUserEvent( ULONG& rEventId, ULONG nEvent, void* pEventData )
+sal_Bool Window::PostUserEvent( sal_uLong& rEventId, sal_uLong nEvent, void* pEventData )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5329,23 +5341,23 @@ BOOL Window::PostUserEvent( ULONG& rEventId, ULONG nEvent, void* pEventData )
pSVEvent->mpData = pEventData;
pSVEvent->mpLink = NULL;
pSVEvent->mpWindow = this;
- pSVEvent->mbCall = TRUE;
+ pSVEvent->mbCall = sal_True;
ImplAddDel( &(pSVEvent->maDelData) );
- rEventId = (ULONG)pSVEvent;
+ rEventId = (sal_uLong)pSVEvent;
if ( mpWindowImpl->mpFrame->PostEvent( pSVEvent ) )
- return TRUE;
+ return sal_True;
else
{
rEventId = 0;
ImplRemoveDel( &(pSVEvent->maDelData) );
delete pSVEvent;
- return FALSE;
+ return sal_False;
}
}
// -----------------------------------------------------------------------
-BOOL Window::PostUserEvent( ULONG& rEventId, const Link& rLink, void* pCaller )
+sal_Bool Window::PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5354,23 +5366,23 @@ BOOL Window::PostUserEvent( ULONG& rEventId, const Link& rLink, void* pCaller )
pSVEvent->mpData = pCaller;
pSVEvent->mpLink = new Link( rLink );
pSVEvent->mpWindow = this;
- pSVEvent->mbCall = TRUE;
+ pSVEvent->mbCall = sal_True;
ImplAddDel( &(pSVEvent->maDelData) );
- rEventId = (ULONG)pSVEvent;
+ rEventId = (sal_uLong)pSVEvent;
if ( mpWindowImpl->mpFrame->PostEvent( pSVEvent ) )
- return TRUE;
+ return sal_True;
else
{
rEventId = 0;
ImplRemoveDel( &(pSVEvent->maDelData) );
delete pSVEvent;
- return FALSE;
+ return sal_False;
}
}
// -----------------------------------------------------------------------
-void Window::RemoveUserEvent( ULONG nUserEvent )
+void Window::RemoveUserEvent( sal_uLong nUserEvent )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5387,14 +5399,14 @@ void Window::RemoveUserEvent( ULONG nUserEvent )
pSVEvent->mpWindow = NULL;
}
- pSVEvent->mbCall = FALSE;
+ pSVEvent->mbCall = sal_False;
}
// -----------------------------------------------------------------------
IMPL_LINK( Window, ImplAsyncStateChangedHdl, void*, pState )
{
- StateChanged( (StateChangedType)(ULONG)pState );
+ StateChanged( (StateChangedType)(sal_uLong)pState );
return 0;
}
@@ -5404,28 +5416,28 @@ void Window::PostStateChanged( StateChangedType nState )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- PostUserEvent( LINK( this, Window, ImplAsyncStateChangedHdl ), (void*)(ULONG)nState );
+ PostUserEvent( LINK( this, Window, ImplAsyncStateChangedHdl ), (void*)(sal_uLong)nState );
}
// -----------------------------------------------------------------------
-BOOL Window::IsLocked( BOOL bChilds ) const
+sal_Bool Window::IsLocked( sal_Bool bChilds ) const
{
if ( mpWindowImpl->mnLockCount != 0 )
- return TRUE;
+ return sal_True;
if ( bChilds || mpWindowImpl->mbChildNotify )
{
Window* pChild = mpWindowImpl->mpFirstChild;
while ( pChild )
{
- if ( pChild->IsLocked( TRUE ) )
- return TRUE;
+ if ( pChild->IsLocked( sal_True ) )
+ return sal_True;
pChild = pChild->mpWindowImpl->mpNext;
}
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -5483,7 +5495,7 @@ SystemWindow* Window::GetSystemWindow() const
// -----------------------------------------------------------------------
-void Window::SetBorderStyle( USHORT nBorderStyle )
+void Window::SetBorderStyle( sal_uInt16 nBorderStyle )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5526,7 +5538,7 @@ void Window::SetBorderStyle( USHORT nBorderStyle )
// -----------------------------------------------------------------------
-USHORT Window::GetBorderStyle() const
+sal_uInt16 Window::GetBorderStyle() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5574,7 +5586,7 @@ long Window::CalcTitleWidth() const
// -----------------------------------------------------------------------
-void Window::EnableClipSiblings( BOOL bClipSiblings )
+void Window::EnableClipSiblings( sal_Bool bClipSiblings )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5586,7 +5598,7 @@ void Window::EnableClipSiblings( BOOL bClipSiblings )
// -----------------------------------------------------------------------
-void Window::SetMouseTransparent( BOOL bTransparent )
+void Window::SetMouseTransparent( sal_Bool bTransparent )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5601,7 +5613,7 @@ void Window::SetMouseTransparent( BOOL bTransparent )
// -----------------------------------------------------------------------
-void Window::SetPaintTransparent( BOOL bTransparent )
+void Window::SetPaintTransparent( sal_Bool bTransparent )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5628,7 +5640,7 @@ void Window::SetInputContext( const InputContext& rInputContext )
// -----------------------------------------------------------------------
-void Window::EndExtTextInput( USHORT nFlags )
+void Window::EndExtTextInput( sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5686,24 +5698,24 @@ long Window::GetCursorExtTextInputWidth() const
// -----------------------------------------------------------------------
void Window::SetSettings( const AllSettings& rSettings )
{
- SetSettings( rSettings, FALSE );
+ SetSettings( rSettings, sal_False );
}
-void Window::SetSettings( const AllSettings& rSettings, BOOL bChild )
+void Window::SetSettings( const AllSettings& rSettings, sal_Bool bChild )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
if ( mpWindowImpl->mpBorderWindow )
{
- mpWindowImpl->mpBorderWindow->SetSettings( rSettings, FALSE );
+ mpWindowImpl->mpBorderWindow->SetSettings( rSettings, sal_False );
if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) &&
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow )
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->SetSettings( rSettings, TRUE );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->SetSettings( rSettings, sal_True );
}
AllSettings aOldSettings = maSettings;
OutputDevice::SetSettings( rSettings );
- ULONG nChangeFlags = aOldSettings.GetChangeFlags( rSettings );
+ sal_uLong nChangeFlags = aOldSettings.GetChangeFlags( rSettings );
// AppFont-Aufloesung und DPI-Aufloesung neu berechnen
ImplInitResolutionSettings();
@@ -5727,20 +5739,20 @@ void Window::SetSettings( const AllSettings& rSettings, BOOL bChild )
// -----------------------------------------------------------------------
-void Window::UpdateSettings( const AllSettings& rSettings, BOOL bChild )
+void Window::UpdateSettings( const AllSettings& rSettings, sal_Bool bChild )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
if ( mpWindowImpl->mpBorderWindow )
{
- mpWindowImpl->mpBorderWindow->UpdateSettings( rSettings, FALSE );
+ mpWindowImpl->mpBorderWindow->UpdateSettings( rSettings, sal_False );
if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) &&
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow )
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->UpdateSettings( rSettings, TRUE );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->UpdateSettings( rSettings, sal_True );
}
AllSettings aOldSettings = maSettings;
- ULONG nChangeFlags = maSettings.Update( maSettings.GetWindowUpdate(), rSettings );
+ sal_uLong nChangeFlags = maSettings.Update( maSettings.GetWindowUpdate(), rSettings );
nChangeFlags |= SETTINGS_IN_UPDATE_SETTINGS; // Set this flag so the receiver of the data changed
// event can distinguish between the changing of global
// setting and a local change ( with SetSettings )
@@ -5830,7 +5842,7 @@ Font Window::GetPointFont() const
// -----------------------------------------------------------------------
-void Window::SetParentClipMode( USHORT nMode )
+void Window::SetParentClipMode( sal_uInt16 nMode )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5842,14 +5854,14 @@ void Window::SetParentClipMode( USHORT nMode )
{
mpWindowImpl->mnParentClipMode = nMode;
if ( nMode & PARENTCLIPMODE_CLIP )
- mpWindowImpl->mpParent->mpWindowImpl->mbClipChildren = TRUE;
+ mpWindowImpl->mpParent->mpWindowImpl->mbClipChildren = sal_True;
}
}
}
// -----------------------------------------------------------------------
-USHORT Window::GetParentClipMode() const
+sal_uInt16 Window::GetParentClipMode() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5870,7 +5882,7 @@ void Window::SetWindowRegionPixel()
else if( mpWindowImpl->mbFrame )
{
mpWindowImpl->maWinRegion = Region( REGION_NULL);
- mpWindowImpl->mbWinRegion = FALSE;
+ mpWindowImpl->mbWinRegion = sal_False;
mpWindowImpl->mpFrame->ResetClipRegion();
}
else
@@ -5878,7 +5890,7 @@ void Window::SetWindowRegionPixel()
if ( mpWindowImpl->mbWinRegion )
{
mpWindowImpl->maWinRegion = Region( REGION_NULL );
- mpWindowImpl->mbWinRegion = FALSE;
+ mpWindowImpl->mbWinRegion = sal_False;
ImplSetClipFlag();
if ( IsReallyVisible() )
@@ -5917,9 +5929,9 @@ void Window::SetWindowRegionPixel( const Region& rRegion )
long nY;
long nWidth;
long nHeight;
- ULONG nRectCount;
+ sal_uLong nRectCount;
ImplRegionInfo aInfo;
- BOOL bRegionRect;
+ sal_Bool bRegionRect;
nRectCount = mpWindowImpl->maWinRegion.GetRectCount();
mpWindowImpl->mpFrame->BeginSetClipRegion( nRectCount );
@@ -5944,14 +5956,14 @@ void Window::SetWindowRegionPixel( const Region& rRegion )
if ( mpWindowImpl->mbWinRegion )
{
mpWindowImpl->maWinRegion = Region( REGION_NULL );
- mpWindowImpl->mbWinRegion = FALSE;
+ mpWindowImpl->mbWinRegion = sal_False;
ImplSetClipFlag();
}
}
else
{
mpWindowImpl->maWinRegion = rRegion;
- mpWindowImpl->mbWinRegion = TRUE;
+ mpWindowImpl->mbWinRegion = sal_True;
ImplSetClipFlag();
}
@@ -5983,7 +5995,7 @@ const Region& Window::GetWindowRegionPixel() const
// -----------------------------------------------------------------------
-BOOL Window::IsWindowRegionPixel() const
+sal_Bool Window::IsWindowRegionPixel() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5995,7 +6007,7 @@ BOOL Window::IsWindowRegionPixel() const
// -----------------------------------------------------------------------
-Region Window::GetWindowClipRegionPixel( USHORT nFlags ) const
+Region Window::GetWindowClipRegionPixel( sal_uInt16 nFlags ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -6066,7 +6078,7 @@ void Window::ExpandPaintClipRegion( const Region& rRegion )
if( ! aDevPixRegion.IsEmpty() )
{
mpWindowImpl->mpPaintRegion->Union( aDevPixRegion );
- mbInitClipRegion = TRUE;
+ mbInitClipRegion = sal_True;
}
}
}
@@ -6101,13 +6113,13 @@ void Window::SetParent( Window* pNewParent )
// check if the taskpanelist would change and move the window pointer accordingly
SystemWindow *pSysWin = ImplGetLastSystemWindow(this);
SystemWindow *pNewSysWin = NULL;
- BOOL bChangeTaskPaneList = FALSE;
+ sal_Bool bChangeTaskPaneList = sal_False;
if( pSysWin && pSysWin->ImplIsInTaskPaneList( this ) )
{
pNewSysWin = ImplGetLastSystemWindow( pNewParent );
if( pNewSysWin && pNewSysWin != pSysWin )
{
- bChangeTaskPaneList = TRUE;
+ bChangeTaskPaneList = sal_True;
pSysWin->GetTaskPaneList()->RemoveWindow( this );
}
}
@@ -6136,7 +6148,7 @@ void Window::SetParent( Window* pNewParent )
if ( mpWindowImpl->mbFrame )
mpWindowImpl->mpFrame->SetParent( pNewParent->mpWindowImpl->mpFrame );
- BOOL bVisible = IsVisible();
+ sal_Bool bVisible = IsVisible();
Show( false, SHOW_NOFOCUSCHANGE );
// Testen, ob sich das Overlap-Window aendert
@@ -6154,9 +6166,9 @@ void Window::SetParent( Window* pNewParent )
}
// Fenster in der Hirachie umsetzen
- BOOL bFocusOverlapWin = HasChildPathFocus( TRUE );
- BOOL bFocusWin = HasChildPathFocus();
- BOOL bNewFrame = pNewParent->mpWindowImpl->mpFrameWindow != mpWindowImpl->mpFrameWindow;
+ sal_Bool bFocusOverlapWin = HasChildPathFocus( sal_True );
+ sal_Bool bFocusWin = HasChildPathFocus();
+ sal_Bool bNewFrame = pNewParent->mpWindowImpl->mpFrameWindow != mpWindowImpl->mpFrameWindow;
if ( bNewFrame )
{
if ( mpWindowImpl->mpFrameData->mpFocusWin )
@@ -6178,7 +6190,7 @@ void Window::SetParent( Window* pNewParent )
ImplRemoveWindow( bNewFrame );
ImplInsertWindow( pNewParent );
if ( mpWindowImpl->mnParentClipMode & PARENTCLIPMODE_CLIP )
- pNewParent->mpWindowImpl->mbClipChildren = TRUE;
+ pNewParent->mpWindowImpl->mbClipChildren = sal_True;
ImplUpdateWindowPtr();
if ( ImplUpdatePos() )
ImplUpdateSysObjPos();
@@ -6217,7 +6229,7 @@ void Window::SetParent( Window* pNewParent )
}
// Activate-Status beim naechsten Overlap-Window updaten
- if ( HasChildPathFocus( TRUE ) )
+ if ( HasChildPathFocus( sal_True ) )
ImplCallFocusChangeActivate( pNewOverlapWindow, pOldOverlapWindow );
}
@@ -6258,7 +6270,7 @@ void Window::SetParent( Window* pNewParent )
// -----------------------------------------------------------------------
-void Window::Show( BOOL bVisible, USHORT nFlags )
+void Window::Show( sal_Bool bVisible, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -6267,7 +6279,7 @@ void Window::Show( BOOL bVisible, USHORT nFlags )
ImplDelData aDogTag( this );
- BOOL bRealVisibilityChanged = FALSE;
+ sal_Bool bRealVisibilityChanged = sal_False;
mpWindowImpl->mbVisible = (bVisible != 0);
if ( !bVisible )
@@ -6280,14 +6292,14 @@ void Window::Show( BOOL bVisible, USHORT nFlags )
{
bool bOldUpdate = mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate;
if ( mpWindowImpl->mbNoParentUpdate )
- mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate = TRUE;
+ mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate = sal_True;
mpWindowImpl->mpBorderWindow->Show( false, nFlags );
mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate = bOldUpdate;
}
else if ( mpWindowImpl->mbFrame )
{
- mpWindowImpl->mbSuppressAccessibilityEvents = TRUE;
- mpWindowImpl->mpFrame->Show( FALSE, FALSE );
+ mpWindowImpl->mbSuppressAccessibilityEvents = sal_True;
+ mpWindowImpl->mpFrame->Show( sal_False, sal_False );
}
StateChanged( STATE_CHANGE_VISIBLE );
@@ -6295,12 +6307,12 @@ void Window::Show( BOOL bVisible, USHORT nFlags )
if ( mpWindowImpl->mbReallyVisible )
{
Region aInvRegion( REGION_EMPTY );
- BOOL bSaveBack = FALSE;
+ sal_Bool bSaveBack = sal_False;
if ( ImplIsOverlapWindow() && !mpWindowImpl->mbFrame )
{
if ( ImplRestoreOverlapBackground( aInvRegion ) )
- bSaveBack = TRUE;
+ bSaveBack = sal_True;
}
if ( !bSaveBack )
@@ -6395,7 +6407,7 @@ void Window::Show( BOOL bVisible, USHORT nFlags )
if ( ImplIsOverlapWindow() && !(nFlags & SHOW_NOACTIVATE) )
{
ImplStartToTop(( nFlags & SHOW_FOREGROUNDTASK ) ? TOTOP_FOREGROUNDTASK : 0 );
- ImplFocusToTop( 0, FALSE );
+ ImplFocusToTop( 0, sal_False );
}
// Hintergrund sichern
@@ -6410,7 +6422,7 @@ void Window::Show( BOOL bVisible, USHORT nFlags )
if ( !mpWindowImpl->mbFrame )
{
- USHORT nInvalidateFlags = INVALIDATE_CHILDREN;
+ sal_uInt16 nInvalidateFlags = INVALIDATE_CHILDREN;
if( ! IsPaintTransparent() )
nInvalidateFlags |= INVALIDATE_NOTRANSPARENT;
ImplInvalidate( NULL, nInvalidateFlags );
@@ -6437,11 +6449,11 @@ void Window::Show( BOOL bVisible, USHORT nFlags )
}
//DBG_ASSERT( !mpWindowImpl->mbSuppressAccessibilityEvents, "Window::Show() - Frame reactivated");
- mpWindowImpl->mbSuppressAccessibilityEvents = FALSE;
+ mpWindowImpl->mbSuppressAccessibilityEvents = sal_False;
- mpWindowImpl->mbPaintFrame = TRUE;
- BOOL bNoActivate = (nFlags & (SHOW_NOACTIVATE|SHOW_NOFOCUSCHANGE)) ? TRUE : FALSE;
- mpWindowImpl->mpFrame->Show( TRUE, bNoActivate );
+ mpWindowImpl->mbPaintFrame = sal_True;
+ sal_Bool bNoActivate = (nFlags & (SHOW_NOACTIVATE|SHOW_NOFOCUSCHANGE)) ? sal_True : sal_False;
+ mpWindowImpl->mpFrame->Show( sal_True, bNoActivate );
if( aDogTag.IsDelete() )
return;
@@ -6562,10 +6574,10 @@ void Window::Enable( bool bEnable, bool bChild )
if ( mpWindowImpl->mpBorderWindow )
{
- mpWindowImpl->mpBorderWindow->Enable( bEnable, FALSE );
+ mpWindowImpl->mpBorderWindow->Enable( bEnable, sal_False );
if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) &&
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow )
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->Enable( bEnable, TRUE );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->Enable( bEnable, sal_True );
}
// #i56102# restore app focus win in case the
@@ -6607,7 +6619,7 @@ void Window::Enable( bool bEnable, bool bChild )
void Window::SetCallHandlersOnInputDisabled( bool bCall )
{
- mpWindowImpl->mbCallHandlersDuringInputDisabled = bCall ? TRUE : FALSE;
+ mpWindowImpl->mbCallHandlersDuringInputDisabled = bCall ? sal_True : sal_False;
Window* pChild = mpWindowImpl->mpFirstChild;
while ( pChild )
@@ -6626,17 +6638,17 @@ bool Window::IsCallHandlersOnInputDisabled() const
// -----------------------------------------------------------------------
-void Window::EnableInput( BOOL bEnable, BOOL bChild )
+void Window::EnableInput( sal_Bool bEnable, sal_Bool bChild )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- BOOL bNotify = (bEnable != mpWindowImpl->mbInputDisabled);
+ sal_Bool bNotify = (bEnable != mpWindowImpl->mbInputDisabled);
if ( mpWindowImpl->mpBorderWindow )
{
- mpWindowImpl->mpBorderWindow->EnableInput( bEnable, FALSE );
+ mpWindowImpl->mpBorderWindow->EnableInput( bEnable, sal_False );
if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) &&
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow )
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->EnableInput( bEnable, TRUE );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->EnableInput( bEnable, sal_True );
}
if ( (! bEnable && mpWindowImpl->meAlwaysInputMode != AlwaysInputEnabled) ||
@@ -6694,7 +6706,7 @@ void Window::EnableInput( BOOL bEnable, BOOL bChild )
// -----------------------------------------------------------------------
-void Window::EnableInput( BOOL bEnable, BOOL bChild, BOOL bSysWin,
+void Window::EnableInput( sal_Bool bEnable, sal_Bool bChild, sal_Bool bSysWin,
const Window* pExcludeWindow )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -6710,11 +6722,11 @@ void Window::EnableInput( BOOL bEnable, BOOL bChild, BOOL bSysWin,
while ( pSysWin )
{
// Is Window in the path from this window
- if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( pSysWin, TRUE ) )
+ if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( pSysWin, sal_True ) )
{
// Is Window not in the exclude window path or not the
// exclude window, than change the status
- if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( pSysWin, TRUE ) )
+ if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( pSysWin, sal_True ) )
pSysWin->EnableInput( bEnable, bChild );
}
pSysWin = pSysWin->mpWindowImpl->mpNextOverlap;
@@ -6727,11 +6739,11 @@ void Window::EnableInput( BOOL bEnable, BOOL bChild, BOOL bSysWin,
if( pFrameWin->ImplIsFloatingWindow() )
{
// Is Window in the path from this window
- if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( pFrameWin, TRUE ) )
+ if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( pFrameWin, sal_True ) )
{
// Is Window not in the exclude window path or not the
// exclude window, than change the status
- if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( pFrameWin, TRUE ) )
+ if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( pFrameWin, sal_True ) )
pFrameWin->EnableInput( bEnable, bChild );
}
}
@@ -6746,11 +6758,11 @@ void Window::EnableInput( BOOL bEnable, BOOL bChild, BOOL bSysWin,
while( p != rList.end() )
{
// Is Window in the path from this window
- if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( (*p), TRUE ) )
+ if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( (*p), sal_True ) )
{
// Is Window not in the exclude window path or not the
// exclude window, than change the status
- if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( (*p), TRUE ) )
+ if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( (*p), sal_True ) )
(*p)->EnableInput( bEnable, bChild );
}
p++;
@@ -6761,19 +6773,19 @@ void Window::EnableInput( BOOL bEnable, BOOL bChild, BOOL bSysWin,
// -----------------------------------------------------------------------
-void Window::AlwaysEnableInput( BOOL bAlways, BOOL bChild )
+void Window::AlwaysEnableInput( sal_Bool bAlways, sal_Bool bChild )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
if ( mpWindowImpl->mpBorderWindow )
- mpWindowImpl->mpBorderWindow->AlwaysEnableInput( bAlways, FALSE );
+ mpWindowImpl->mpBorderWindow->AlwaysEnableInput( bAlways, sal_False );
if( bAlways && mpWindowImpl->meAlwaysInputMode != AlwaysInputEnabled )
{
mpWindowImpl->meAlwaysInputMode = AlwaysInputEnabled;
if ( bAlways )
- EnableInput( TRUE, FALSE );
+ EnableInput( sal_True, sal_False );
}
else if( ! bAlways && mpWindowImpl->meAlwaysInputMode == AlwaysInputEnabled )
{
@@ -6793,19 +6805,19 @@ void Window::AlwaysEnableInput( BOOL bAlways, BOOL bChild )
// -----------------------------------------------------------------------
-void Window::AlwaysDisableInput( BOOL bAlways, BOOL bChild )
+void Window::AlwaysDisableInput( sal_Bool bAlways, sal_Bool bChild )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
if ( mpWindowImpl->mpBorderWindow )
- mpWindowImpl->mpBorderWindow->AlwaysDisableInput( bAlways, FALSE );
+ mpWindowImpl->mpBorderWindow->AlwaysDisableInput( bAlways, sal_False );
if( bAlways && mpWindowImpl->meAlwaysInputMode != AlwaysInputDisabled )
{
mpWindowImpl->meAlwaysInputMode = AlwaysInputDisabled;
if ( bAlways )
- EnableInput( FALSE, FALSE );
+ EnableInput( sal_False, sal_False );
}
else if( ! bAlways && mpWindowImpl->meAlwaysInputMode == AlwaysInputDisabled )
{
@@ -6825,7 +6837,7 @@ void Window::AlwaysDisableInput( BOOL bAlways, BOOL bChild )
// -----------------------------------------------------------------------
-void Window::SetActivateMode( USHORT nMode )
+void Window::SetActivateMode( sal_uInt16 nMode )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -6840,9 +6852,9 @@ void Window::SetActivateMode( USHORT nMode )
if ( mpWindowImpl->mnActivateMode )
{
if ( (mpWindowImpl->mbActive || (GetType() == WINDOW_BORDERWINDOW)) &&
- !HasChildPathFocus( TRUE ) )
+ !HasChildPathFocus( sal_True ) )
{
- mpWindowImpl->mbActive = FALSE;
+ mpWindowImpl->mbActive = sal_False;
Deactivate();
}
}
@@ -6850,7 +6862,7 @@ void Window::SetActivateMode( USHORT nMode )
{
if ( !mpWindowImpl->mbActive || (GetType() == WINDOW_BORDERWINDOW) )
{
- mpWindowImpl->mbActive = TRUE;
+ mpWindowImpl->mbActive = sal_True;
Activate();
}
}
@@ -6859,7 +6871,7 @@ void Window::SetActivateMode( USHORT nMode )
// -----------------------------------------------------------------------
-void Window::ToTop( USHORT nFlags )
+void Window::ToTop( sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -6869,7 +6881,7 @@ void Window::ToTop( USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::SetZOrder( Window* pRefWindow, USHORT nFlags )
+void Window::SetZOrder( Window* pRefWindow, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -6987,7 +6999,7 @@ void Window::SetZOrder( Window* pRefWindow, USHORT nFlags )
if ( mpWindowImpl->mbInitWinClipRegion || !mpWindowImpl->maWinClipRegion.IsEmpty() )
{
- BOOL bInitWinClipRegion = mpWindowImpl->mbInitWinClipRegion;
+ sal_Bool bInitWinClipRegion = mpWindowImpl->mbInitWinClipRegion;
ImplSetClipFlag();
// Wenn ClipRegion noch nicht initalisiert wurde, dann
@@ -7046,7 +7058,7 @@ void Window::SetZOrder( Window* pRefWindow, USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::EnableAlwaysOnTop( BOOL bEnable )
+void Window::EnableAlwaysOnTop( sal_Bool bEnable )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7064,16 +7076,16 @@ void Window::EnableAlwaysOnTop( BOOL bEnable )
// -----------------------------------------------------------------------
void Window::SetPosSizePixel( long nX, long nY,
- long nWidth, long nHeight, USHORT nFlags )
+ long nWidth, long nHeight, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- BOOL bHasValidSize = !mpWindowImpl->mbDefSize;
+ sal_Bool bHasValidSize = !mpWindowImpl->mbDefSize;
if ( nFlags & WINDOW_POSSIZE_POS )
- mpWindowImpl->mbDefPos = FALSE;
+ mpWindowImpl->mbDefPos = sal_False;
if ( nFlags & WINDOW_POSSIZE_SIZE )
- mpWindowImpl->mbDefSize = FALSE;
+ mpWindowImpl->mbDefSize = sal_False;
// Oberstes BorderWindow ist das Window, welches positioniert werden soll
Window* pWindow = this;
@@ -7093,7 +7105,7 @@ void Window::SetPosSizePixel( long nX, long nY,
nHeight = pWindow->mnOutHeight;
- USHORT nSysFlags=0;
+ sal_uInt16 nSysFlags=0;
if( nFlags & WINDOW_POSSIZE_WIDTH )
nSysFlags |= SAL_FRAME_POSSIZE_WIDTH;
if( nFlags & WINDOW_POSSIZE_HEIGHT )
@@ -7307,18 +7319,18 @@ Rectangle Window::ImplOutputToUnmirroredAbsoluteScreenPixel( const Rectangle &rR
Rectangle Window::GetWindowExtentsRelative( Window *pRelativeWindow ) const
{
// with decoration
- return ImplGetWindowExtentsRelative( pRelativeWindow, FALSE );
+ return ImplGetWindowExtentsRelative( pRelativeWindow, sal_False );
}
Rectangle Window::GetClientWindowExtentsRelative( Window *pRelativeWindow ) const
{
// without decoration
- return ImplGetWindowExtentsRelative( pRelativeWindow, TRUE );
+ return ImplGetWindowExtentsRelative( pRelativeWindow, sal_True );
}
// -----------------------------------------------------------------------
-Rectangle Window::ImplGetWindowExtentsRelative( Window *pRelativeWindow, BOOL bClientOnly ) const
+Rectangle Window::ImplGetWindowExtentsRelative( Window *pRelativeWindow, sal_Bool bClientOnly ) const
{
SalFrameGeometry g = mpWindowImpl->mpFrame->GetGeometry();
// make sure we use the extent of our border window,
@@ -7348,7 +7360,7 @@ Rectangle Window::ImplGetWindowExtentsRelative( Window *pRelativeWindow, BOOL bC
// -----------------------------------------------------------------------
-void Window::Scroll( long nHorzScroll, long nVertScroll, USHORT nFlags )
+void Window::Scroll( long nHorzScroll, long nVertScroll, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7360,7 +7372,7 @@ void Window::Scroll( long nHorzScroll, long nVertScroll, USHORT nFlags )
// -----------------------------------------------------------------------
void Window::Scroll( long nHorzScroll, long nVertScroll,
- const Rectangle& rRect, USHORT nFlags )
+ const Rectangle& rRect, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7372,7 +7384,7 @@ void Window::Scroll( long nHorzScroll, long nVertScroll,
// -----------------------------------------------------------------------
-void Window::Invalidate( USHORT nFlags )
+void Window::Invalidate( sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7384,7 +7396,7 @@ void Window::Invalidate( USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::Invalidate( const Rectangle& rRect, USHORT nFlags )
+void Window::Invalidate( const Rectangle& rRect, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7401,7 +7413,7 @@ void Window::Invalidate( const Rectangle& rRect, USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::Invalidate( const Region& rRegion, USHORT nFlags )
+void Window::Invalidate( const Region& rRegion, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7420,7 +7432,7 @@ void Window::Invalidate( const Region& rRegion, USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::Validate( USHORT nFlags )
+void Window::Validate( sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7432,7 +7444,7 @@ void Window::Validate( USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::Validate( const Rectangle& rRect, USHORT nFlags )
+void Window::Validate( const Rectangle& rRect, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7449,7 +7461,7 @@ void Window::Validate( const Rectangle& rRect, USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::Validate( const Region& rRegion, USHORT nFlags )
+void Window::Validate( const Region& rRegion, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7468,18 +7480,18 @@ void Window::Validate( const Region& rRegion, USHORT nFlags )
// -----------------------------------------------------------------------
-BOOL Window::HasPaintEvent() const
+sal_Bool Window::HasPaintEvent() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
if ( !mpWindowImpl->mbReallyVisible )
- return FALSE;
+ return sal_False;
if ( mpWindowImpl->mpFrameWindow->mpWindowImpl->mbPaintFrame )
- return TRUE;
+ return sal_True;
if ( mpWindowImpl->mnPaintFlags & IMPL_PAINT_PAINT )
- return TRUE;
+ return sal_True;
if ( !ImplIsOverlapWindow() )
{
@@ -7488,12 +7500,12 @@ BOOL Window::HasPaintEvent() const
{
pTempWindow = pTempWindow->ImplGetParent();
if ( pTempWindow->mpWindowImpl->mnPaintFlags & (IMPL_PAINT_PAINTCHILDS | IMPL_PAINT_PAINTALLCHILDS) )
- return TRUE;
+ return sal_True;
}
while ( !pTempWindow->ImplIsOverlapWindow() );
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -7511,14 +7523,14 @@ void Window::Update()
if ( !mpWindowImpl->mbReallyVisible )
return;
- BOOL bFlush = FALSE;
+ sal_Bool bFlush = sal_False;
if ( mpWindowImpl->mpFrameWindow->mpWindowImpl->mbPaintFrame )
{
Point aPoint( 0, 0 );
Region aRegion( Rectangle( aPoint, Size( mnOutWidth, mnOutHeight ) ) );
ImplInvalidateOverlapFrameRegion( aRegion );
if ( mpWindowImpl->mbFrame || (mpWindowImpl->mpBorderWindow && mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame) )
- bFlush = TRUE;
+ bFlush = sal_True;
}
// Zuerst muessen wir alle Fenster ueberspringen, die Paint-Transparent
@@ -7587,7 +7599,7 @@ void Window::Sync()
// -----------------------------------------------------------------------
-void Window::SetUpdateMode( BOOL bUpdate )
+void Window::SetUpdateMode( sal_Bool bUpdate )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7606,7 +7618,7 @@ void Window::GrabFocus()
// -----------------------------------------------------------------------
-BOOL Window::HasFocus() const
+sal_Bool Window::HasFocus() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7648,7 +7660,7 @@ void Window::SetFakeFocus( bool bFocus )
// -----------------------------------------------------------------------
-BOOL Window::HasChildPathFocus( BOOL bSystemWindow ) const
+sal_Bool Window::HasChildPathFocus( sal_Bool bSystemWindow ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7664,7 +7676,7 @@ BOOL Window::HasChildPathFocus( BOOL bSystemWindow ) const
Window* pFocusWin = ImplGetSVData()->maWinData.mpFocusWin;
if ( pFocusWin )
return ImplIsWindowOrChild( pFocusWin, bSystemWindow );
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -7685,7 +7697,7 @@ void Window::CaptureMouse()
if ( pSVData->maWinData.mpCaptureWin != this )
{
pSVData->maWinData.mpCaptureWin = this;
- mpWindowImpl->mpFrame->CaptureMouse( TRUE );
+ mpWindowImpl->mpFrame->CaptureMouse( sal_True );
}
}
@@ -7703,14 +7715,14 @@ void Window::ReleaseMouse()
if ( pSVData->maWinData.mpCaptureWin == this )
{
pSVData->maWinData.mpCaptureWin = NULL;
- mpWindowImpl->mpFrame->CaptureMouse( FALSE );
+ mpWindowImpl->mpFrame->CaptureMouse( sal_False );
ImplGenerateMouseMove();
}
}
// -----------------------------------------------------------------------
-BOOL Window::IsMouseCaptured() const
+sal_Bool Window::IsMouseCaptured() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7735,7 +7747,7 @@ void Window::SetPointer( const Pointer& rPointer )
// -----------------------------------------------------------------------
-void Window::EnableChildPointerOverwrite( BOOL bOverwrite )
+void Window::EnableChildPointerOverwrite( sal_Bool bOverwrite )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7805,7 +7817,7 @@ Point Window::GetLastPointerPosPixel()
// -----------------------------------------------------------------------
-void Window::ShowPointer( BOOL bVisible )
+void Window::ShowPointer( sal_Bool bVisible )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7844,7 +7856,7 @@ Window::PointerState Window::GetPointerState()
// -----------------------------------------------------------------------
-BOOL Window::IsMouseOver()
+sal_Bool Window::IsMouseOver()
{
return ImplGetWinData()->mbMouseOver;
}
@@ -7922,7 +7934,7 @@ void Window::SetText( const XubString& rStr )
// name change.
if ( IsReallyVisible() )
{
- Window* pWindow = GetLabelFor();
+ Window* pWindow = GetAccessibleRelationLabelFor();
if ( pWindow && pWindow != this )
pWindow->ImplCallEventListeners( VCLEVENT_WINDOW_FRAMETITLECHANGED, &oldTitle );
}
@@ -7982,32 +7994,22 @@ const XubString& Window::GetHelpText() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- SmartId aSmartId = GetSmartHelpId();
-
- ULONG nNumHelpId = 0;
- String aStrHelpId;
- if( aSmartId.HasString() )
- aStrHelpId = aSmartId.GetStr();
- if( aSmartId.HasNumeric() )
- nNumHelpId = aSmartId.GetNum();
+ String aStrHelpId( rtl::OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
bool bStrHelpId = (aStrHelpId.Len() > 0);
- if ( !mpWindowImpl->maHelpText.Len() && (nNumHelpId || bStrHelpId) )
+ if ( !mpWindowImpl->maHelpText.Len() && bStrHelpId )
{
if ( !IsDialog() && (mpWindowImpl->mnType != WINDOW_TABPAGE) && (mpWindowImpl->mnType != WINDOW_FLOATINGWINDOW) )
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
- if( bStrHelpId )
- ((Window*)this)->mpWindowImpl->maHelpText = pHelp->GetHelpText( aStrHelpId, this );
- else
- ((Window*)this)->mpWindowImpl->maHelpText = pHelp->GetHelpText( nNumHelpId, this );
- mpWindowImpl->mbHelpTextDynamic = FALSE;
+ ((Window*)this)->mpWindowImpl->maHelpText = pHelp->GetHelpText( aStrHelpId, this );
+ mpWindowImpl->mbHelpTextDynamic = sal_False;
}
}
}
- else if( mpWindowImpl->mbHelpTextDynamic && (nNumHelpId || bStrHelpId) )
+ else if( mpWindowImpl->mbHelpTextDynamic && bStrHelpId )
{
static const char* pEnv = getenv( "HELP_DEBUG" );
if( pEnv && *pEnv )
@@ -8015,13 +8017,10 @@ const XubString& Window::GetHelpText() const
rtl::OUStringBuffer aTxt( 64+mpWindowImpl->maHelpText.Len() );
aTxt.append( mpWindowImpl->maHelpText );
aTxt.appendAscii( "\n------------------\n" );
- if( bStrHelpId )
- aTxt.append( rtl::OUString( aStrHelpId ) );
- else
- aTxt.append( sal_Int32( nNumHelpId ) );
+ aTxt.append( rtl::OUString( aStrHelpId ) );
mpWindowImpl->maHelpText = aTxt.makeStringAndClear();
}
- mpWindowImpl->mbHelpTextDynamic = FALSE;
+ mpWindowImpl->mbHelpTextDynamic = sal_False;
}
return mpWindowImpl->maHelpText;
@@ -8039,11 +8038,11 @@ Window* Window::FindWindow( const Point& rPos ) const
// -----------------------------------------------------------------------
-USHORT Window::GetChildCount() const
+sal_uInt16 Window::GetChildCount() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- USHORT nChildCount = 0;
+ sal_uInt16 nChildCount = 0;
Window* pChild = mpWindowImpl->mpFirstChild;
while ( pChild )
{
@@ -8056,11 +8055,11 @@ USHORT Window::GetChildCount() const
// -----------------------------------------------------------------------
-Window* Window::GetChild( USHORT nChild ) const
+Window* Window::GetChild( sal_uInt16 nChild ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- USHORT nChildCount = 0;
+ sal_uInt16 nChildCount = 0;
Window* pChild = mpWindowImpl->mpFirstChild;
while ( pChild )
{
@@ -8075,7 +8074,7 @@ Window* Window::GetChild( USHORT nChild ) const
// -----------------------------------------------------------------------
-Window* Window::GetWindow( USHORT nType ) const
+Window* Window::GetWindow( sal_uInt16 nType ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -8167,7 +8166,7 @@ Window* Window::GetWindow( USHORT nType ) const
// -----------------------------------------------------------------------
-BOOL Window::IsChild( const Window* pWindow, BOOL bSystemWindow ) const
+sal_Bool Window::IsChild( const Window* pWindow, sal_Bool bSystemWindow ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
DBG_CHKOBJ( pWindow, Window, ImplDbgCheckWindow );
@@ -8180,22 +8179,22 @@ BOOL Window::IsChild( const Window* pWindow, BOOL bSystemWindow ) const
pWindow = pWindow->ImplGetParent();
if ( pWindow == this )
- return TRUE;
+ return sal_True;
}
while ( pWindow );
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Window::IsWindowOrChild( const Window* pWindow, BOOL bSystemWindow ) const
+sal_Bool Window::IsWindowOrChild( const Window* pWindow, sal_Bool bSystemWindow ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
DBG_CHKOBJ( pWindow, Window, ImplDbgCheckWindow );
if ( this == pWindow )
- return TRUE;
+ return sal_True;
return ImplIsChild( pWindow, bSystemWindow );
}
@@ -8234,7 +8233,7 @@ void Window::SetWindowPeer( ::com::sun::star::uno::Reference< ::com::sun::star::
// -----------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > Window::GetComponentInterface( BOOL bCreate )
+::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > Window::GetComponentInterface( sal_Bool bCreate )
{
if ( !mpWindowImpl->mxWindowPeer.is() && bCreate )
{
@@ -8331,7 +8330,7 @@ void Window::ImplStartDnd()
// -----------------------------------------------------------------------
-Reference< XDropTarget > Window::GetDropTarget()
+uno::Reference< XDropTarget > Window::GetDropTarget()
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -8344,7 +8343,7 @@ Reference< XDropTarget > Window::GetDropTarget()
if( ! mpWindowImpl->mpFrameData->mxDropTarget.is() )
{
// initialization is done in GetDragSource
- Reference< XDragSource > xDragSource = GetDragSource();
+ uno::Reference< XDragSource > xDragSource = GetDragSource();
}
if( mpWindowImpl->mpFrameData->mxDropTarget.is() )
@@ -8360,16 +8359,16 @@ Reference< XDropTarget > Window::GetDropTarget()
mpWindowImpl->mpFrameData->mxDropTarget->addDropTargetListener( mpWindowImpl->mpFrameData->mxDropTargetListener );
// register also as drag gesture listener if directly supported by drag source
- Reference< XDragGestureRecognizer > xDragGestureRecognizer =
- Reference< XDragGestureRecognizer > (mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY);
+ uno::Reference< XDragGestureRecognizer > xDragGestureRecognizer =
+ uno::Reference< XDragGestureRecognizer > (mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY);
if( xDragGestureRecognizer.is() )
{
xDragGestureRecognizer->addDragGestureListener(
- Reference< XDragGestureListener > (mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY));
+ uno::Reference< XDragGestureListener > (mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY));
}
else
- mpWindowImpl->mpFrameData->mbInternalDragGestureRecognizer = TRUE;
+ mpWindowImpl->mpFrameData->mbInternalDragGestureRecognizer = sal_True;
}
@@ -8388,12 +8387,12 @@ Reference< XDropTarget > Window::GetDropTarget()
}
// this object is located in the same process, so there will be no runtime exception
- return Reference< XDropTarget > ( mpWindowImpl->mxDNDListenerContainer, UNO_QUERY );
+ return uno::Reference< XDropTarget > ( mpWindowImpl->mxDNDListenerContainer, UNO_QUERY );
}
// -----------------------------------------------------------------------
-Reference< XDragSource > Window::GetDragSource()
+uno::Reference< XDragSource > Window::GetDragSource()
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -8403,7 +8402,7 @@ Reference< XDragSource > Window::GetDragSource()
{
try
{
- Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory();
+ uno::Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory();
if ( xFactory.is() )
{
const SystemEnvData * pEnvData = GetSystemData();
@@ -8437,10 +8436,10 @@ Reference< XDragSource > Window::GetDragSource()
aDropTargetAL[ 2 ] = makeAny( vcl::createBmpConverter() );
#endif
if( aDragSourceSN.getLength() )
- mpWindowImpl->mpFrameData->mxDragSource = Reference< XDragSource > ( xFactory->createInstanceWithArguments( aDragSourceSN, aDragSourceAL ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxDragSource = uno::Reference< XDragSource > ( xFactory->createInstanceWithArguments( aDragSourceSN, aDragSourceAL ), UNO_QUERY );
if( aDropTargetSN.getLength() )
- mpWindowImpl->mpFrameData->mxDropTarget = Reference< XDropTarget > ( xFactory->createInstanceWithArguments( aDropTargetSN, aDropTargetAL ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxDropTarget = uno::Reference< XDropTarget > ( xFactory->createInstanceWithArguments( aDropTargetSN, aDropTargetAL ), UNO_QUERY );
}
}
}
@@ -8457,12 +8456,12 @@ Reference< XDragSource > Window::GetDragSource()
return mpWindowImpl->mpFrameData->mxDragSource;
}
- return Reference< XDragSource > ();
+ return uno::Reference< XDragSource > ();
}
// -----------------------------------------------------------------------
-void Window::GetDragSourceDropTarget(Reference< XDragSource >& xDragSource, Reference< XDropTarget > &xDropTarget )
+void Window::GetDragSourceDropTarget(uno::Reference< XDragSource >& xDragSource, uno::Reference< XDropTarget > &xDropTarget )
// only for RVP transmission
{
if( mpWindowImpl->mpFrameData )
@@ -8480,14 +8479,14 @@ void Window::GetDragSourceDropTarget(Reference< XDragSource >& xDragSource, Refe
// -----------------------------------------------------------------------
-Reference< XDragGestureRecognizer > Window::GetDragGestureRecognizer()
+uno::Reference< XDragGestureRecognizer > Window::GetDragGestureRecognizer()
{
- return Reference< XDragGestureRecognizer > ( GetDropTarget(), UNO_QUERY );
+ return uno::Reference< XDragGestureRecognizer > ( GetDropTarget(), UNO_QUERY );
}
// -----------------------------------------------------------------------
-Reference< XClipboard > Window::GetClipboard()
+uno::Reference< XClipboard > Window::GetClipboard()
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -8497,19 +8496,19 @@ Reference< XClipboard > Window::GetClipboard()
{
try
{
- Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
+ uno::Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
if( xFactory.is() )
{
- mpWindowImpl->mpFrameData->mxClipboard = Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboardExt")) ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboardExt")) ), UNO_QUERY );
if( !mpWindowImpl->mpFrameData->mxClipboard.is() )
- mpWindowImpl->mpFrameData->mxClipboard = Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboard")) ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboard")) ), UNO_QUERY );
#if defined(UNX) && !defined(QUARTZ) // unix clipboard needs to be initialized
if( mpWindowImpl->mpFrameData->mxClipboard.is() )
{
- Reference< XInitialization > xInit = Reference< XInitialization >( mpWindowImpl->mpFrameData->mxClipboard, UNO_QUERY );
+ uno::Reference< XInitialization > xInit = uno::Reference< XInitialization >( mpWindowImpl->mpFrameData->mxClipboard, UNO_QUERY );
if( xInit.is() )
{
@@ -8541,7 +8540,7 @@ Reference< XClipboard > Window::GetClipboard()
// -----------------------------------------------------------------------
-Reference< XClipboard > Window::GetPrimarySelection()
+uno::Reference< XClipboard > Window::GetPrimarySelection()
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -8551,7 +8550,7 @@ Reference< XClipboard > Window::GetPrimarySelection()
{
try
{
- Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
+ uno::Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
if( xFactory.is() )
{
@@ -8561,16 +8560,16 @@ Reference< XClipboard > Window::GetPrimarySelection()
aArgumentList[ 1 ] = makeAny( OUString(RTL_CONSTASCII_USTRINGPARAM("PRIMARY")) );
aArgumentList[ 2 ] = makeAny( vcl::createBmpConverter() );
- mpWindowImpl->mpFrameData->mxSelection = Reference< XClipboard >( xFactory->createInstanceWithArguments(
+ mpWindowImpl->mpFrameData->mxSelection = uno::Reference< XClipboard >( xFactory->createInstanceWithArguments(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboard")), aArgumentList ), UNO_QUERY );
# else
- static Reference< XClipboard > s_xSelection;
+ static uno::Reference< XClipboard > s_xSelection;
if ( !s_xSelection.is() )
- s_xSelection = Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.GenericClipboardExt")) ), UNO_QUERY );
+ s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.GenericClipboardExt")) ), UNO_QUERY );
if ( !s_xSelection.is() )
- s_xSelection = Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.GenericClipboard")) ), UNO_QUERY );
+ s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.GenericClipboard")) ), UNO_QUERY );
mpWindowImpl->mpFrameData->mxSelection = s_xSelection;
# endif
@@ -8595,7 +8594,7 @@ Reference< XClipboard > Window::GetPrimarySelection()
// Accessibility
// -----------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > Window::GetAccessible( BOOL bCreate )
+::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > Window::GetAccessible( sal_Bool bCreate )
{
// do not optimize hierarchy for the top level border win (ie, when there is no parent)
/* // do not optimize accessible hierarchy at all to better reflect real VCL hierarchy
@@ -8615,7 +8614,7 @@ Reference< XClipboard > Window::GetPrimarySelection()
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > Window::CreateAccessible()
{
- ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc( GetComponentInterface( TRUE ), ::com::sun::star::uno::UNO_QUERY );
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc( GetComponentInterface( sal_True ), ::com::sun::star::uno::UNO_QUERY );
return xAcc;
}
@@ -8625,46 +8624,46 @@ void Window::SetAccessible( ::com::sun::star::uno::Reference< ::com::sun::star::
}
// skip all border windows that are no top level frames
-BOOL Window::ImplIsAccessibleCandidate() const
+sal_Bool Window::ImplIsAccessibleCandidate() const
{
if( !mpWindowImpl->mbBorderWin )
- return TRUE;
+ return sal_True;
else
// #101741 do not check for WB_CLOSEABLE because undecorated floaters (like menues!) are closeable
if( mpWindowImpl->mbFrame && mpWindowImpl->mnStyle & (WB_MOVEABLE | WB_SIZEABLE) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
-BOOL Window::ImplIsAccessibleNativeFrame() const
+sal_Bool Window::ImplIsAccessibleNativeFrame() const
{
if( mpWindowImpl->mbFrame )
// #101741 do not check for WB_CLOSEABLE because undecorated floaters (like menues!) are closeable
if( (mpWindowImpl->mnStyle & (WB_MOVEABLE | WB_SIZEABLE)) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
else
- return FALSE;
+ return sal_False;
}
-USHORT Window::ImplGetAccessibleCandidateChildWindowCount( USHORT nFirstWindowType ) const
+sal_uInt16 Window::ImplGetAccessibleCandidateChildWindowCount( sal_uInt16 nFirstWindowType ) const
{
- USHORT nChildren = 0;
+ sal_uInt16 nChildren = 0;
Window* pChild = GetWindow( nFirstWindowType );
while ( pChild )
{
if( pChild->ImplIsAccessibleCandidate() )
nChildren++;
else
- nChildren = sal::static_int_cast<USHORT>(nChildren + pChild->ImplGetAccessibleCandidateChildWindowCount( WINDOW_FIRSTCHILD ));
+ nChildren = sal::static_int_cast<sal_uInt16>(nChildren + pChild->ImplGetAccessibleCandidateChildWindowCount( WINDOW_FIRSTCHILD ));
pChild = pChild->mpWindowImpl->mpNext;
}
return nChildren;
}
-Window* Window::ImplGetAccessibleCandidateChild( USHORT nChild, USHORT& rChildCount, USHORT nFirstWindowType, BOOL bTopLevel ) const
+Window* Window::ImplGetAccessibleCandidateChild( sal_uInt16 nChild, sal_uInt16& rChildCount, sal_uInt16 nFirstWindowType, sal_Bool bTopLevel ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -8677,7 +8676,7 @@ Window* Window::ImplGetAccessibleCandidateChild( USHORT nChild, USHORT& rChildCo
Window *pTmpChild = pChild;
if( !pChild->ImplIsAccessibleCandidate() )
- pTmpChild = pChild->ImplGetAccessibleCandidateChild( nChild, rChildCount, WINDOW_FIRSTCHILD, FALSE );
+ pTmpChild = pChild->ImplGetAccessibleCandidateChild( nChild, rChildCount, WINDOW_FIRSTCHILD, sal_False );
if ( nChild == rChildCount )
return pTmpChild;
@@ -8730,9 +8729,9 @@ Window* Window::GetAccessibleParentWindow() const
}
/*
-USHORT Window::GetAccessibleChildWindowCount()
+sal_uInt16 Window::GetAccessibleChildWindowCount()
{
- USHORT nChildren = ImplGetAccessibleCandidateChildWindowCount( WINDOW_FIRSTCHILD );
+ sal_uInt16 nChildren = ImplGetAccessibleCandidateChildWindowCount( WINDOW_FIRSTCHILD );
// Search also for SystemWindows.
Window* pOverlap = GetWindow( WINDOW_OVERLAP );
@@ -8742,9 +8741,9 @@ USHORT Window::GetAccessibleChildWindowCount()
}
*/
-USHORT Window::GetAccessibleChildWindowCount()
+sal_uInt16 Window::GetAccessibleChildWindowCount()
{
- USHORT nChildren = 0;
+ sal_uInt16 nChildren = 0;
Window* pChild = mpWindowImpl->mpFirstChild;
while( pChild )
{
@@ -8790,21 +8789,21 @@ USHORT Window::GetAccessibleChildWindowCount()
}
/*
-Window* Window::GetAccessibleChildWindow( USHORT n )
+Window* Window::GetAccessibleChildWindow( sal_uInt16 n )
{
- USHORT nChildCount; // will be set in ImplGetAccessibleCandidateChild(...)
- Window* pChild = ImplGetAccessibleCandidateChild( n, nChildCount, WINDOW_FIRSTCHILD, TRUE );
+ sal_uInt16 nChildCount; // will be set in ImplGetAccessibleCandidateChild(...)
+ Window* pChild = ImplGetAccessibleCandidateChild( n, nChildCount, WINDOW_FIRSTCHILD, sal_True );
if ( !pChild && ( n >= nChildCount ) )
{
Window* pOverlap = GetWindow( WINDOW_OVERLAP );
- pChild = pOverlap->ImplGetAccessibleCandidateChild( n, nChildCount, WINDOW_FIRSTOVERLAP, FALSE );
+ pChild = pOverlap->ImplGetAccessibleCandidateChild( n, nChildCount, WINDOW_FIRSTOVERLAP, sal_False );
}
return pChild;
}
*/
-Window* Window::GetAccessibleChildWindow( USHORT n )
+Window* Window::GetAccessibleChildWindow( sal_uInt16 n )
{
// report the menubarwindow as a the first child of THE workwindow
if( GetType() == WINDOW_WORKWINDOW && ((WorkWindow *) this)->GetMenuBar() )
@@ -8820,7 +8819,7 @@ Window* Window::GetAccessibleChildWindow( USHORT n )
}
// transform n to child number including invisible children
- USHORT nChildren = n;
+ sal_uInt16 nChildren = n;
Window* pChild = mpWindowImpl->mpFirstChild;
while( pChild )
{
@@ -8868,7 +8867,7 @@ Window* Window::GetAccessibleChildWindow( USHORT n )
}
-void Window::SetAccessibleRole( USHORT nRole )
+void Window::SetAccessibleRole( sal_uInt16 nRole )
{
if ( !mpWindowImpl->mpAccessibleInfos )
mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos;
@@ -8877,11 +8876,11 @@ void Window::SetAccessibleRole( USHORT nRole )
mpWindowImpl->mpAccessibleInfos->nAccessibleRole = nRole;
}
-USHORT Window::GetAccessibleRole() const
+sal_uInt16 Window::GetAccessibleRole() const
{
using namespace ::com::sun::star;
- USHORT nRole = mpWindowImpl->mpAccessibleInfos ? mpWindowImpl->mpAccessibleInfos->nAccessibleRole : 0xFFFF;
+ sal_uInt16 nRole = mpWindowImpl->mpAccessibleInfos ? mpWindowImpl->mpAccessibleInfos->nAccessibleRole : 0xFFFF;
if ( nRole == 0xFFFF )
{
switch ( GetType() )
@@ -8983,6 +8982,7 @@ USHORT Window::GetAccessibleRole() const
case WINDOW_HELPTEXTWINDOW: nRole = accessibility::AccessibleRole::TOOL_TIP; break;
+ case WINDOW_RULER: nRole = accessibility::AccessibleRole::RULER; break;
case WINDOW_WINDOW:
case WINDOW_CONTROL:
case WINDOW_BORDERWINDOW:
@@ -9009,7 +9009,7 @@ void Window::SetAccessibleName( const String& rName )
if ( !mpWindowImpl->mpAccessibleInfos )
mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos;
- DBG_ASSERT( !mpWindowImpl->mpAccessibleInfos->pAccessibleName, "AccessibleName already set!" );
+ DBG_ASSERT( !mpWindowImpl->mpAccessibleInfos->pAccessibleName || !rName.Len(), "AccessibleName already set!" );
delete mpWindowImpl->mpAccessibleInfos->pAccessibleName;
mpWindowImpl->mpAccessibleInfos->pAccessibleName = new String( rName );
}
@@ -9050,9 +9050,9 @@ String Window::GetAccessibleName() const
case WINDOW_LISTBOX:
case WINDOW_MULTILISTBOX:
case WINDOW_TREELISTBOX:
-
+ case WINDOW_METRICBOX:
{
- Window *pLabel = GetLabeledBy();
+ Window *pLabel = GetAccessibleRelationLabeledBy();
if ( pLabel && pLabel != this )
aAccessibleName = pLabel->GetText();
}
@@ -9111,7 +9111,28 @@ String Window::GetAccessibleDescription() const
return aAccessibleDescription;
}
-BOOL Window::IsAccessibilityEventsSuppressed( BOOL bTraverseParentPath )
+void Window::SetAccessibleRelationLabeledBy( Window* pLabeledBy )
+{
+ if ( !mpWindowImpl->mpAccessibleInfos )
+ mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos;
+ mpWindowImpl->mpAccessibleInfos->pLabeledByWindow = pLabeledBy;
+}
+
+void Window::SetAccessibleRelationLabelFor( Window* pLabelFor )
+{
+ if ( !mpWindowImpl->mpAccessibleInfos )
+ mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos;
+ mpWindowImpl->mpAccessibleInfos->pLabelForWindow = pLabelFor;
+}
+
+void Window::SetAccessibleRelationMemberOf( Window* pMemberOfWin )
+{
+ if ( !mpWindowImpl->mpAccessibleInfos )
+ mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos;
+ mpWindowImpl->mpAccessibleInfos->pMemberOfWindow = pMemberOfWin;
+}
+
+sal_Bool Window::IsAccessibilityEventsSuppressed( sal_Bool bTraverseParentPath )
{
if( !bTraverseParentPath )
return mpWindowImpl->mbSuppressAccessibilityEvents;
@@ -9121,14 +9142,19 @@ BOOL Window::IsAccessibilityEventsSuppressed( BOOL bTraverseParentPath )
while ( pParent && pParent->mpWindowImpl)
{
if( pParent->mpWindowImpl->mbSuppressAccessibilityEvents )
- return TRUE;
+ return sal_True;
else
pParent = pParent->mpWindowImpl->mpParent; // do not use GetParent() to find borderwindows that are frames
}
- return FALSE;
+ return sal_False;
}
}
+void Window::SetAccessibilityEventsSuppressed(sal_Bool bSuppressed)
+{
+ mpWindowImpl->mbSuppressAccessibilityEvents = bSuppressed;
+}
+
void Window::RecordLayoutData( vcl::ControlLayoutData* pLayout, const Rectangle& rRect )
{
if( ! mpOutDevData )
@@ -9145,9 +9171,9 @@ void Window::RecordLayoutData( vcl::ControlLayoutData* pLayout, const Rectangle&
// returns background color used in this control
// false: could not determine color
-BOOL Window::ImplGetCurrentBackgroundColor( Color& rCol )
+sal_Bool Window::ImplGetCurrentBackgroundColor( Color& rCol )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
switch ( GetType() )
{
@@ -9165,7 +9191,7 @@ BOOL Window::ImplGetCurrentBackgroundColor( Color& rCol )
if( !aWall.IsGradient() && !aWall.IsBitmap() )
rCol = aWall.GetColor();
else
- bRet = FALSE;
+ bRet = sal_False;
}
else
rCol = GetSettings().GetStyleSettings().GetFaceColor();
@@ -9174,21 +9200,21 @@ BOOL Window::ImplGetCurrentBackgroundColor( Color& rCol )
return bRet;
}
-void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly )
+void Window::DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly )
{
DrawSelectionBackground( rRect, highlight, bChecked, bDrawBorder, bDrawExtBorderOnly, 0, NULL, NULL );
}
-void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly, Color* pSelectionTextColor )
+void Window::DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly, Color* pSelectionTextColor )
{
DrawSelectionBackground( rRect, highlight, bChecked, bDrawBorder, bDrawExtBorderOnly, 0, pSelectionTextColor, NULL );
}
void Window::DrawSelectionBackground( const Rectangle& rRect,
- USHORT highlight,
- BOOL bChecked,
- BOOL bDrawBorder,
- BOOL bDrawExtBorderOnly,
+ sal_uInt16 highlight,
+ sal_Bool bChecked,
+ sal_Bool bDrawBorder,
+ sal_Bool bDrawExtBorderOnly,
long nCornerRadius,
Color* pSelectionTextColor,
Color* pPaintColor
@@ -9206,8 +9232,8 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
Color aSelectionBorderCol( pPaintColor ? *pPaintColor : rStyles.GetHighlightColor() );
Color aSelectionFillCol( aSelectionBorderCol );
- BOOL bDark = rStyles.GetFaceColor().IsDark();
- BOOL bBright = ( rStyles.GetFaceColor() == Color( COL_WHITE ) );
+ sal_Bool bDark = rStyles.GetFaceColor().IsDark();
+ sal_Bool bBright = ( rStyles.GetFaceColor() == Color( COL_WHITE ) );
int c1 = aSelectionBorderCol.GetLuminance();
int c2 = GetDisplayBackground().GetColor().GetLuminance();
@@ -9215,7 +9241,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
if( !bDark && !bBright && abs( c2-c1 ) < (pPaintColor ? 40 : 75) )
{
// constrast too low
- USHORT h,s,b;
+ sal_uInt16 h,s,b;
aSelectionFillCol.RGBtoHSB( h, s, b );
if( b > 50 ) b -= 40;
else b += 40;
@@ -9247,13 +9273,13 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
else
SetLineColor();
- USHORT nPercent = 0;
+ sal_uInt16 nPercent = 0;
if( !highlight )
{
if( bDark )
aSelectionFillCol = COL_BLACK;
else
- nPercent = bRoundEdges ? 90 : 80; // just checked (light)
+ nPercent = 80; // just checked (light)
}
else
{
@@ -9268,7 +9294,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
nPercent = 0;
}
else
- nPercent = bRoundEdges ? 50 : 20; // selected, pressed or checked ( very dark )
+ nPercent = bRoundEdges ? 40 : 20; // selected, pressed or checked ( very dark )
}
else if( bChecked || highlight == 1 )
{
@@ -9281,7 +9307,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
nPercent = 0;
}
else
- nPercent = bRoundEdges ? 70 : 35; // selected, pressed or checked ( very dark )
+ nPercent = bRoundEdges ? 60 : 35; // selected, pressed or checked ( very dark )
}
else
{
@@ -9297,7 +9323,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
nPercent = 0;
}
else
- nPercent = bRoundEdges ? 80 : 70; // selected ( dark )
+ nPercent = 70; // selected ( dark )
}
}
@@ -9367,7 +9393,7 @@ Window* Window::GetPreferredKeyInputWindow()
}
-BOOL Window::IsScrollable() const
+sal_Bool Window::IsScrollable() const
{
// check for scrollbars
Window *pChild = mpWindowImpl->mpFirstChild;
@@ -9381,24 +9407,24 @@ BOOL Window::IsScrollable() const
return false;
}
-BOOL Window::IsTopWindow() const
+sal_Bool Window::IsTopWindow() const
{
if ( mpWindowImpl->mbInDtor )
- return FALSE;
+ return sal_False;
// topwindows must be frames or they must have a borderwindow which is a frame
if( !mpWindowImpl->mbFrame && (!mpWindowImpl->mpBorderWindow || (mpWindowImpl->mpBorderWindow && !mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame) ) )
- return FALSE;
+ return sal_False;
ImplGetWinData();
- if( mpWindowImpl->mpWinData->mnIsTopWindow == (USHORT)~0) // still uninitialized
+ if( mpWindowImpl->mpWinData->mnIsTopWindow == (sal_uInt16)~0) // still uninitialized
{
// #113722#, cache result of expensive queryInterface call
Window *pThisWin = (Window*)this;
- Reference< XTopWindow > xTopWindow( pThisWin->GetComponentInterface(), UNO_QUERY );
+ uno::Reference< XTopWindow > xTopWindow( pThisWin->GetComponentInterface(), UNO_QUERY );
pThisWin->mpWindowImpl->mpWinData->mnIsTopWindow = xTopWindow.is() ? 1 : 0;
}
- return mpWindowImpl->mpWinData->mnIsTopWindow == 1 ? TRUE : FALSE;
+ return mpWindowImpl->mpWinData->mnIsTopWindow == 1 ? sal_True : sal_False;
}
void Window::ImplMirrorFramePos( Point &pt ) const
@@ -9407,7 +9433,7 @@ void Window::ImplMirrorFramePos( Point &pt ) const
}
// frame based modal counter (dialogs are not modal to the whole application anymore)
-BOOL Window::IsInModalMode() const
+sal_Bool Window::IsInModalMode() const
{
return (mpWindowImpl->mpFrameWindow->mpWindowImpl->mpFrameData->mnModalMode != 0);
}
@@ -9439,16 +9465,16 @@ void Window::ImplDecModalCount()
pFrameWindow = pParent ? pParent->mpWindowImpl->mpFrameWindow : NULL;
}
}
-BOOL Window::ImplIsInTaskPaneList()
+sal_Bool Window::ImplIsInTaskPaneList()
{
return mpWindowImpl->mbIsInTaskPaneList;
}
-void Window::ImplIsInTaskPaneList( BOOL mbIsInTaskList )
+void Window::ImplIsInTaskPaneList( sal_Bool mbIsInTaskList )
{
mpWindowImpl->mbIsInTaskPaneList = mbIsInTaskList;
}
-void Window::ImplNotifyIconifiedState( BOOL bIconified )
+void Window::ImplNotifyIconifiedState( sal_Bool bIconified )
{
mpWindowImpl->mpFrameWindow->ImplCallEventListeners( bIconified ? VCLEVENT_WINDOW_MINIMIZE : VCLEVENT_WINDOW_NORMALIZE );
// #109206# notify client window as well to have toolkit topwindow listeners notified
@@ -9456,15 +9482,15 @@ void Window::ImplNotifyIconifiedState( BOOL bIconified )
mpWindowImpl->mpFrameWindow->mpWindowImpl->mpClientWindow->ImplCallEventListeners( bIconified ? VCLEVENT_WINDOW_MINIMIZE : VCLEVENT_WINDOW_NORMALIZE );
}
-BOOL Window::HasActiveChildFrame()
+sal_Bool Window::HasActiveChildFrame()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
Window *pFrameWin = ImplGetSVData()->maWinData.mpFirstFrame;
while( pFrameWin )
{
if( pFrameWin != mpWindowImpl->mpFrameWindow )
{
- BOOL bDecorated = FALSE;
+ sal_Bool bDecorated = sal_False;
Window *pChildFrame = pFrameWin->ImplGetWindow();
// #i15285# unfortunately WB_MOVEABLE is the same as WB_TABSTOP which can
// be removed for ToolBoxes to influence the keyboard accessibility
@@ -9476,9 +9502,9 @@ BOOL Window::HasActiveChildFrame()
if( bDecorated || (pFrameWin->mpWindowImpl->mnStyle & (WB_MOVEABLE | WB_SIZEABLE) ) )
if( pChildFrame && pChildFrame->IsVisible() && pChildFrame->IsActive() )
{
- if( ImplIsChild( pChildFrame, TRUE ) )
+ if( ImplIsChild( pChildFrame, sal_True ) )
{
- bRet = TRUE;
+ bRet = sal_True;
break;
}
}
@@ -9493,11 +9519,11 @@ LanguageType Window::GetInputLanguage() const
return mpWindowImpl->mpFrame->GetInputLanguage();
}
-void Window::EnableNativeWidget( BOOL bEnable )
+void Window::EnableNativeWidget( sal_Bool bEnable )
{
static const char* pNoNWF = getenv( "SAL_NO_NWF" );
if( pNoNWF && *pNoNWF )
- bEnable = FALSE;
+ bEnable = sal_False;
if( bEnable != ImplGetWinData()->mbEnableNativeWidget )
{
@@ -9522,7 +9548,7 @@ void Window::EnableNativeWidget( BOOL bEnable )
}
}
-BOOL Window::IsNativeWidgetEnabled() const
+sal_Bool Window::IsNativeWidgetEnabled() const
{
return ImplGetWinData()->mbEnableNativeWidget;
}
@@ -9531,12 +9557,12 @@ BOOL Window::IsNativeWidgetEnabled() const
#include <salframe.h>
#endif
-Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscreenSize,
+uno::Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscreenSize,
bool bFullscreen,
bool bSpriteCanvas ) const
{
// try to retrieve hard reference from weak member
- Reference< rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas );
+ uno::Reference< rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas );
// canvas still valid? Then we're done.
if( xCanvas.is() )
@@ -9575,21 +9601,24 @@ Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscreenSi
aArg[ 2 ] = makeAny( ::com::sun::star::awt::Rectangle( mnOutOffX, mnOutOffY, mnOutWidth, mnOutHeight ) );
aArg[ 3 ] = makeAny( mpWindowImpl->mbAlwaysOnTop ? sal_True : sal_False );
- aArg[ 4 ] = makeAny( Reference< awt::XWindow >(
+ aArg[ 4 ] = makeAny( uno::Reference< awt::XWindow >(
const_cast<Window*>(this)->GetComponentInterface(),
uno::UNO_QUERY ));
- Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory();
+ uno::Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory();
// Create canvas instance with window handle
// =========================================
if ( xFactory.is() )
{
- static Reference<lang::XMultiServiceFactory> xCanvasFactory(
- xFactory->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star."
- "rendering.CanvasFactory") ) ), UNO_QUERY );
+ static ::vcl::DeleteUnoReferenceOnDeinit<lang::XMultiServiceFactory> xStaticCanvasFactory(
+ uno::Reference<lang::XMultiServiceFactory>(
+ xFactory->createInstance(
+ OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.rendering.CanvasFactory") ) ),
+ UNO_QUERY ));
+ uno::Reference<lang::XMultiServiceFactory> xCanvasFactory(xStaticCanvasFactory.get());
+
if(xCanvasFactory.is())
{
#ifdef WNT
@@ -9635,37 +9664,37 @@ Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscreenSi
return xCanvas;
}
-Reference< rendering::XCanvas > Window::GetCanvas() const
+uno::Reference< rendering::XCanvas > Window::GetCanvas() const
{
return ImplGetCanvas( Size(), false, false );
}
-Reference< rendering::XSpriteCanvas > Window::GetSpriteCanvas() const
+uno::Reference< rendering::XSpriteCanvas > Window::GetSpriteCanvas() const
{
- Reference< rendering::XSpriteCanvas > xSpriteCanvas(
+ uno::Reference< rendering::XSpriteCanvas > xSpriteCanvas(
ImplGetCanvas( Size(), false, true ), uno::UNO_QUERY );
return xSpriteCanvas;
}
-Reference< ::com::sun::star::rendering::XSpriteCanvas > Window::GetFullscreenSpriteCanvas( const Size& rFullscreenSize ) const
+uno::Reference< ::com::sun::star::rendering::XSpriteCanvas > Window::GetFullscreenSpriteCanvas( const Size& rFullscreenSize ) const
{
- Reference< rendering::XSpriteCanvas > xSpriteCanvas(
+ uno::Reference< rendering::XSpriteCanvas > xSpriteCanvas(
ImplGetCanvas( rFullscreenSize, true, true ), uno::UNO_QUERY );
return xSpriteCanvas;
}
void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rPos )
{
- BOOL bRVisible = mpWindowImpl->mbReallyVisible;
+ sal_Bool bRVisible = mpWindowImpl->mbReallyVisible;
mpWindowImpl->mbReallyVisible = mpWindowImpl->mbVisible;
- BOOL bDevOutput = mbDevOutput;
- mbDevOutput = TRUE;
+ sal_Bool bDevOutput = mbDevOutput;
+ mbDevOutput = sal_True;
long nOldDPIX = ImplGetDPIX();
long nOldDPIY = ImplGetDPIY();
mnDPIX = i_pTargetOutDev->ImplGetDPIX();
mnDPIY = i_pTargetOutDev->ImplGetDPIY();
- BOOL bOutput = IsOutputEnabled();
+ sal_Bool bOutput = IsOutputEnabled();
EnableOutput();
DBG_ASSERT( GetMapMode().GetMapUnit() == MAP_PIXEL, "MapMode must be PIXEL based" );
@@ -9795,8 +9824,8 @@ void Window::PaintToDevice( OutputDevice* pDev, const Point& rPos, const Size& /
Hide();
}
- BOOL bVisible = mpWindowImpl->mbVisible;
- mpWindowImpl->mbVisible = TRUE;
+ sal_Bool bVisible = mpWindowImpl->mbVisible;
+ mpWindowImpl->mbVisible = sal_True;
if( mpWindowImpl->mpBorderWindow )
mpWindowImpl->mpBorderWindow->ImplPaintToDevice( pDev, rPos );
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index e183e54fad83..e98d51d252c9 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -71,7 +71,7 @@ struct ImplFocusDelData : public ImplDelData
// =======================================================================
-BOOL Window::ImplIsWindowInFront( const Window* pTestWindow ) const
+sal_Bool Window::ImplIsWindowInFront( const Window* pTestWindow ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
DBG_CHKOBJ( pTestWindow, Window, ImplDbgCheckWindow );
@@ -81,11 +81,11 @@ BOOL Window::ImplIsWindowInFront( const Window* pTestWindow ) const
const Window* pTempWindow = pTestWindow;
const Window* pThisWindow = ImplGetFirstOverlapWindow();
if ( pTempWindow == pThisWindow )
- return FALSE;
+ return sal_False;
do
{
if ( pTempWindow == pThisWindow )
- return TRUE;
+ return sal_True;
if ( pTempWindow->mpWindowImpl->mbFrame )
break;
pTempWindow = pTempWindow->mpWindowImpl->mpOverlapWindow;
@@ -95,7 +95,7 @@ BOOL Window::ImplIsWindowInFront( const Window* pTestWindow ) const
do
{
if ( pTempWindow == pTestWindow )
- return FALSE;
+ return sal_False;
if ( pTempWindow->mpWindowImpl->mbFrame )
break;
pTempWindow = pTempWindow->mpWindowImpl->mpOverlapWindow;
@@ -105,8 +105,8 @@ BOOL Window::ImplIsWindowInFront( const Window* pTestWindow ) const
// Fenster auf gleiche Ebene bringen
if ( pThisWindow->mpWindowImpl->mpOverlapWindow != pTestWindow->mpWindowImpl->mpOverlapWindow )
{
- USHORT nThisLevel = 0;
- USHORT nTestLevel = 0;
+ sal_uInt16 nThisLevel = 0;
+ sal_uInt16 nTestLevel = 0;
pTempWindow = pThisWindow;
do
{
@@ -153,12 +153,12 @@ BOOL Window::ImplIsWindowInFront( const Window* pTestWindow ) const
do
{
if ( pTempWindow == pThisWindow )
- return TRUE;
+ return sal_True;
pTempWindow = pTempWindow->mpWindowImpl->mpNext;
}
while ( pTempWindow );
- return FALSE;
+ return sal_False;
}
// =======================================================================
@@ -169,7 +169,7 @@ void Window::ImplSaveOverlapBackground()
if ( !mpWindowImpl->mbFrame )
{
- ULONG nSaveBackSize = mnOutWidth*mnOutHeight;
+ sal_uLong nSaveBackSize = mnOutWidth*mnOutHeight;
if ( nSaveBackSize <= IMPL_MAXSAVEBACKSIZE )
{
if ( nSaveBackSize+mpWindowImpl->mpFrameData->mnAllSaveBackSize <= IMPL_MAXALLSAVEBACKSIZE )
@@ -204,7 +204,7 @@ void Window::ImplSaveOverlapBackground()
// -----------------------------------------------------------------------
-BOOL Window::ImplRestoreOverlapBackground( Region& rInvRegion )
+sal_Bool Window::ImplRestoreOverlapBackground( Region& rInvRegion )
{
if ( mpWindowImpl->mpOverlapData->mpSaveBackDev )
{
@@ -234,10 +234,10 @@ BOOL Window::ImplRestoreOverlapBackground( Region& rInvRegion )
ImplDeleteOverlapBackground();
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -306,7 +306,7 @@ void Window::ImplInvalidateAllOverlapBackgrounds()
// =======================================================================
-Bitmap Window::SnapShot( BOOL bBorder ) const
+Bitmap Window::SnapShot( sal_Bool bBorder ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -348,7 +348,7 @@ void Window::ShowFocus( const Rectangle& rRect )
if( mpWindowImpl->mbInShowFocus )
return;
- mpWindowImpl->mbInShowFocus = TRUE;
+ mpWindowImpl->mbInShowFocus = sal_True;
ImplWinData* pWinData = ImplGetWinData();
@@ -362,7 +362,7 @@ void Window::ShowFocus( const Rectangle& rRect )
{
if ( *(pWinData->mpFocusRect) == rRect )
{
- mpWindowImpl->mbInShowFocus = FALSE;
+ mpWindowImpl->mbInShowFocus = sal_False;
return;
}
@@ -375,18 +375,18 @@ void Window::ShowFocus( const Rectangle& rRect )
pWinData->mpFocusRect = new Rectangle( rRect );
else
*(pWinData->mpFocusRect) = rRect;
- mpWindowImpl->mbFocusVisible = TRUE;
+ mpWindowImpl->mbFocusVisible = sal_True;
}
else
{
if( ! mpWindowImpl->mbNativeFocusVisible )
{
- mpWindowImpl->mbNativeFocusVisible = TRUE;
+ mpWindowImpl->mbNativeFocusVisible = sal_True;
if ( !mpWindowImpl->mbInPaint )
Invalidate();
}
}
- mpWindowImpl->mbInShowFocus = FALSE;
+ mpWindowImpl->mbInShowFocus = sal_False;
}
// -----------------------------------------------------------------------
@@ -397,7 +397,7 @@ void Window::HideFocus()
if( mpWindowImpl->mbInHideFocus )
return;
- mpWindowImpl->mbInHideFocus = TRUE;
+ mpWindowImpl->mbInHideFocus = sal_True;
// native themeing can suggest not to use focus rects
if( ! ( mpWindowImpl->mbUseNativeFocus &&
@@ -405,29 +405,29 @@ void Window::HideFocus()
{
if ( !mpWindowImpl->mbFocusVisible )
{
- mpWindowImpl->mbInHideFocus = FALSE;
+ mpWindowImpl->mbInHideFocus = sal_False;
return;
}
if ( !mpWindowImpl->mbInPaint )
ImplInvertFocus( *(ImplGetWinData()->mpFocusRect) );
- mpWindowImpl->mbFocusVisible = FALSE;
+ mpWindowImpl->mbFocusVisible = sal_False;
}
else
{
if( mpWindowImpl->mbNativeFocusVisible )
{
- mpWindowImpl->mbNativeFocusVisible = FALSE;
+ mpWindowImpl->mbNativeFocusVisible = sal_False;
if ( !mpWindowImpl->mbInPaint )
Invalidate();
}
}
- mpWindowImpl->mbInHideFocus = FALSE;
+ mpWindowImpl->mbInHideFocus = sal_False;
}
// -----------------------------------------------------------------------
-void Window::Invert( const Rectangle& rRect, USHORT nFlags )
+void Window::Invert( const Rectangle& rRect, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -463,14 +463,14 @@ void Window::Invert( const Rectangle& rRect, USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::Invert( const Polygon& rPoly, USHORT nFlags )
+void Window::Invert( const Polygon& rPoly, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
if ( !IsDeviceOutputNecessary() )
return;
- USHORT nPoints = rPoly.GetSize();
+ sal_uInt16 nPoints = rPoly.GetSize();
if ( nPoints < 2 )
return;
@@ -501,7 +501,7 @@ void Window::Invert( const Polygon& rPoly, USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::ShowTracking( const Rectangle& rRect, USHORT nFlags )
+void Window::ShowTracking( const Rectangle& rRect, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -526,7 +526,7 @@ void Window::ShowTracking( const Rectangle& rRect, USHORT nFlags )
else
*(pWinData->mpTrackRect) = rRect;
pWinData->mnTrackFlags = nFlags;
- mpWindowImpl->mbTrackVisible = TRUE;
+ mpWindowImpl->mbTrackVisible = sal_True;
}
// -----------------------------------------------------------------------
@@ -540,13 +540,13 @@ void Window::HideTracking()
ImplWinData* pWinData = ImplGetWinData();
if ( !mpWindowImpl->mbInPaint || !(pWinData->mnTrackFlags & SHOWTRACK_WINDOW) )
InvertTracking( *(pWinData->mpTrackRect), pWinData->mnTrackFlags );
- mpWindowImpl->mbTrackVisible = FALSE;
+ mpWindowImpl->mbTrackVisible = sal_False;
}
}
// -----------------------------------------------------------------------
-void Window::InvertTracking( const Rectangle& rRect, USHORT nFlags )
+void Window::InvertTracking( const Rectangle& rRect, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -587,12 +587,12 @@ void Window::InvertTracking( const Rectangle& rRect, USHORT nFlags )
Point aPoint( mnOutOffX, mnOutOffY );
Region aRegion( Rectangle( aPoint,
Size( mnOutWidth, mnOutHeight ) ) );
- ImplClipBoundaries( aRegion, FALSE, FALSE );
+ ImplClipBoundaries( aRegion, sal_False, sal_False );
ImplSelectClipRegion( aRegion, pGraphics );
}
}
- USHORT nStyle = nFlags & SHOWTRACK_STYLE;
+ sal_uInt16 nStyle = nFlags & SHOWTRACK_STYLE;
if ( nStyle == SHOWTRACK_OBJECT )
pGraphics->Invert( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), SAL_INVERT_TRACKFRAME, this );
else if ( nStyle == SHOWTRACK_SPLIT )
@@ -611,11 +611,11 @@ void Window::InvertTracking( const Rectangle& rRect, USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::InvertTracking( const Polygon& rPoly, USHORT nFlags )
+void Window::InvertTracking( const Polygon& rPoly, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- USHORT nPoints = rPoly.GetSize();
+ sal_uInt16 nPoints = rPoly.GetSize();
if ( nPoints < 2 )
return;
@@ -653,7 +653,7 @@ void Window::InvertTracking( const Polygon& rPoly, USHORT nFlags )
Point aPoint( mnOutOffX, mnOutOffY );
Region aRegion( Rectangle( aPoint,
Size( mnOutWidth, mnOutHeight ) ) );
- ImplClipBoundaries( aRegion, FALSE, FALSE );
+ ImplClipBoundaries( aRegion, sal_False, sal_False );
ImplSelectClipRegion( aRegion, pGraphics );
}
}
@@ -690,7 +690,7 @@ IMPL_LINK( Window, ImplTrackTimerHdl, Timer*, pTimer )
// -----------------------------------------------------------------------
-void Window::StartTracking( USHORT nFlags )
+void Window::StartTracking( sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -721,7 +721,7 @@ void Window::StartTracking( USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::EndTracking( USHORT nFlags )
+void Window::EndTracking( sal_uInt16 nFlags )
{
ImplSVData* pSVData = ImplGetSVData();
@@ -764,7 +764,7 @@ void Window::EndTracking( USHORT nFlags )
// -----------------------------------------------------------------------
-BOOL Window::IsTracking() const
+sal_Bool Window::IsTracking() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -773,7 +773,7 @@ BOOL Window::IsTracking() const
// -----------------------------------------------------------------------
-void Window::StartAutoScroll( USHORT nFlags )
+void Window::StartAutoScroll( sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -810,7 +810,7 @@ void Window::EndAutoScroll()
// -----------------------------------------------------------------------
-BOOL Window::IsAutoScroll() const
+sal_Bool Window::IsAutoScroll() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -836,13 +836,13 @@ void Window::SaveBackground( const Point& rPos, const Size& rSize,
{
const Region aOldClip( rSaveDevice.GetClipRegion() );
const Point aPixOffset( rSaveDevice.LogicToPixel( rDestOff ) );
- const BOOL bMap = rSaveDevice.IsMapModeEnabled();
+ const sal_Bool bMap = rSaveDevice.IsMapModeEnabled();
// move clip region to have the same distance to DestOffset
aClip.Move( aPixOffset.X() - aPixPos.X(), aPixOffset.Y() - aPixPos.Y() );
// set pixel clip region
- rSaveDevice.EnableMapMode( FALSE );
+ rSaveDevice.EnableMapMode( sal_False );
rSaveDevice.SetClipRegion( aClip );
rSaveDevice.EnableMapMode( bMap );
rSaveDevice.DrawOutDev( rDestOff, rSize, rPos, rSize, *this );
@@ -871,13 +871,13 @@ sal_uIntPtr Window::SaveFocus()
// -----------------------------------------------------------------------
-BOOL Window::EndSaveFocus( sal_uIntPtr nSaveId, BOOL bRestore )
+sal_Bool Window::EndSaveFocus( sal_uIntPtr nSaveId, sal_Bool bRestore )
{
if ( !nSaveId )
- return FALSE;
+ return sal_False;
else
{
- BOOL bOK = TRUE;
+ sal_Bool bOK = sal_True;
ImplFocusDelData* pDelData = (ImplFocusDelData*)(void*)nSaveId;
if ( !pDelData->IsDelete() )
{
@@ -940,7 +940,7 @@ void Window::SetZoomedPointFont( const Font& rFont )
long nFontDiff = Abs( GetFont().GetSize().Height()-aMetric.GetSize().Height() );
if ( (aMetric.GetType() == TYPE_RASTER) && (nFontDiff >= 2) )
{
- USHORT nType;
+ sal_uInt16 nType;
if ( aMetric.GetPitch() == PITCH_FIXED )
nType = DEFAULTFONT_FIXED;
else
@@ -1033,7 +1033,7 @@ void Window::SetControlForeground()
if ( mpWindowImpl->mbControlForeground )
{
mpWindowImpl->maControlForeground = Color( COL_TRANSPARENT );
- mpWindowImpl->mbControlForeground = FALSE;
+ mpWindowImpl->mbControlForeground = sal_False;
StateChanged( STATE_CHANGE_CONTROLFOREGROUND );
}
}
@@ -1049,7 +1049,7 @@ void Window::SetControlForeground( const Color& rColor )
if ( mpWindowImpl->mbControlForeground )
{
mpWindowImpl->maControlForeground = Color( COL_TRANSPARENT );
- mpWindowImpl->mbControlForeground = FALSE;
+ mpWindowImpl->mbControlForeground = sal_False;
StateChanged( STATE_CHANGE_CONTROLFOREGROUND );
}
}
@@ -1058,7 +1058,7 @@ void Window::SetControlForeground( const Color& rColor )
if ( mpWindowImpl->maControlForeground != rColor )
{
mpWindowImpl->maControlForeground = rColor;
- mpWindowImpl->mbControlForeground = TRUE;
+ mpWindowImpl->mbControlForeground = sal_True;
StateChanged( STATE_CHANGE_CONTROLFOREGROUND );
}
}
@@ -1073,7 +1073,7 @@ void Window::SetControlBackground()
if ( mpWindowImpl->mbControlBackground )
{
mpWindowImpl->maControlBackground = Color( COL_TRANSPARENT );
- mpWindowImpl->mbControlBackground = FALSE;
+ mpWindowImpl->mbControlBackground = sal_False;
StateChanged( STATE_CHANGE_CONTROLBACKGROUND );
}
}
@@ -1089,7 +1089,7 @@ void Window::SetControlBackground( const Color& rColor )
if ( mpWindowImpl->mbControlBackground )
{
mpWindowImpl->maControlBackground = Color( COL_TRANSPARENT );
- mpWindowImpl->mbControlBackground = FALSE;
+ mpWindowImpl->mbControlBackground = sal_False;
StateChanged( STATE_CHANGE_CONTROLBACKGROUND );
}
}
@@ -1098,7 +1098,7 @@ void Window::SetControlBackground( const Color& rColor )
if ( mpWindowImpl->maControlBackground != rColor )
{
mpWindowImpl->maControlBackground = rColor;
- mpWindowImpl->mbControlBackground = TRUE;
+ mpWindowImpl->mbControlBackground = sal_True;
StateChanged( STATE_CHANGE_CONTROLBACKGROUND );
}
}
@@ -1162,12 +1162,12 @@ long Window::GetDrawPixel( OutputDevice* pDev, long nPixels ) const
// -----------------------------------------------------------------------
-BOOL Window::HandleScrollCommand( const CommandEvent& rCmd,
+sal_Bool Window::HandleScrollCommand( const CommandEvent& rCmd,
ScrollBar* pHScrl, ScrollBar* pVScrl )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( pHScrl || pVScrl )
{
@@ -1175,7 +1175,7 @@ BOOL Window::HandleScrollCommand( const CommandEvent& rCmd,
{
case COMMAND_STARTAUTOSCROLL:
{
- USHORT nFlags = 0;
+ sal_uInt16 nFlags = 0;
if ( pHScrl )
{
if ( (pHScrl->GetVisibleSize() < pHScrl->GetRangeMax()) &&
@@ -1192,7 +1192,7 @@ BOOL Window::HandleScrollCommand( const CommandEvent& rCmd,
if ( nFlags )
{
StartAutoScroll( nFlags );
- bRet = TRUE;
+ bRet = sal_True;
}
}
break;
@@ -1203,7 +1203,7 @@ BOOL Window::HandleScrollCommand( const CommandEvent& rCmd,
if ( pData && (COMMAND_WHEEL_SCROLL == pData->GetMode()) )
{
- ULONG nScrollLines = pData->GetScrollLines();
+ sal_uLong nScrollLines = pData->GetScrollLines();
long nLines;
if ( nScrollLines == COMMAND_WHEEL_PAGESCROLL )
{
@@ -1220,7 +1220,7 @@ BOOL Window::HandleScrollCommand( const CommandEvent& rCmd,
0L,
pData->IsHorz() ? pHScrl : pVScrl,
nLines );
- bRet = TRUE;
+ bRet = sal_True;
}
}
}
@@ -1233,7 +1233,7 @@ BOOL Window::HandleScrollCommand( const CommandEvent& rCmd,
{
ImplHandleScroll( pHScrl, pData->GetDeltaX(),
pVScrl, pData->GetDeltaY() );
- bRet = TRUE;
+ bRet = sal_True;
}
}
break;
@@ -1303,7 +1303,7 @@ DockingManager* Window::GetDockingManager()
return ImplGetDockingManager();
}
-void Window::EnableDocking( BOOL bEnable )
+void Window::EnableDocking( sal_Bool bEnable )
{
// update list of dockable windows
if( bEnable )
@@ -1327,115 +1327,31 @@ Window* Window::ImplGetTopmostFrameWindow()
return pTopmostParent->mpWindowImpl->mpFrameWindow;
}
-// making these Methods out of line to be able to change them lateron without complete rebuild
-// TODO: Set the SmartId in here and remove mpWindowImpl->mnHelpId
-void Window::SetHelpId( ULONG nHelpId )
+void Window::SetHelpId( const rtl::OString& rHelpId )
{
- SetSmartHelpId(SmartId(nHelpId));
+ mpWindowImpl->maHelpId = rHelpId;
}
-ULONG Window::GetHelpId() const
+const rtl::OString& Window::GetHelpId() const
{
- return mpWindowImpl->mnHelpId;
+ return mpWindowImpl->maHelpId;
}
-void Window::SetSmartHelpId( const SmartId& aId, SmartIdUpdateMode aMode )
+void Window::SetUniqueId( const rtl::OString& rUniqueId )
{
- // create SmartId if required
- if ( (aMode == SMART_SET_STR) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasString() ) )
- {
- if ( !ImplGetWinData()->mpSmartHelpId )
- ImplGetWinData()->mpSmartHelpId = new SmartId();
- }
-
- // if we have a SmartId (eather from earlier call or just created) fill with new values
- if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartHelpId )
- ImplGetWinData()->mpSmartHelpId->UpdateId( aId, aMode );
-
- if ( (aMode == SMART_SET_NUM) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasNumeric() ) )
- {
- mpWindowImpl->mnHelpId = aId.GetNum();
- }
-}
-
-SmartId Window::GetSmartHelpId() const
-{
- if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartHelpId )
- {
- if ( mpWindowImpl->mnHelpId || mpWindowImpl->mpWinData->mpSmartHelpId->HasNumeric() )
- mpWindowImpl->mpWinData->mpSmartHelpId->UpdateId( SmartId( mpWindowImpl->mnHelpId ), SMART_SET_NUM );
- return *mpWindowImpl->mpWinData->mpSmartHelpId;
- }
- else
- {
- if ( mpWindowImpl->mnHelpId )
- return SmartId( mpWindowImpl->mnHelpId );
- else
- return SmartId();
- }
-}
-
-
-// making these Methods out of line to be able to change them lateron without complete rebuild
-// TODO: Set the SmartId in here and remove mpWindowImpl->mnUniqId
-void Window::SetUniqueId( ULONG nUniqueId ) { mpWindowImpl->mnUniqId = nUniqueId; }
-ULONG Window::GetUniqueId() const { return mpWindowImpl->mnUniqId; }
-
-
-void Window::SetSmartUniqueId( const SmartId& aId, SmartIdUpdateMode aMode )
-{
- // create SmartId if required
- if ( (aMode == SMART_SET_STR) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasString() ) )
- {
- if ( !ImplGetWinData()->mpSmartUniqueId )
- ImplGetWinData()->mpSmartUniqueId = new SmartId();
- }
-
- // if we have a SmartId (eather from earlier call or just created) fill with new values
- if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartUniqueId )
- ImplGetWinData()->mpSmartUniqueId->UpdateId( aId, aMode );
-
- if ( (aMode == SMART_SET_NUM) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasNumeric() ) )
- mpWindowImpl->mnUniqId = aId.GetNum();
+ mpWindowImpl->maUniqId = rUniqueId;
}
-SmartId Window::GetSmartUniqueId() const
+const rtl::OString& Window::GetUniqueId() const
{
- if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartUniqueId )
- {
- if ( mpWindowImpl->mnUniqId || mpWindowImpl->mpWinData->mpSmartUniqueId->HasNumeric() )
- mpWindowImpl->mpWinData->mpSmartUniqueId->UpdateId( SmartId( mpWindowImpl->mnUniqId ), SMART_SET_NUM );
- return *mpWindowImpl->mpWinData->mpSmartUniqueId;
- }
- else
- {
- if ( mpWindowImpl->mnUniqId )
- return SmartId( mpWindowImpl->mnUniqId );
- else
- return SmartId();
- }
+ return mpWindowImpl->maUniqId;
}
-SmartId Window::GetSmartUniqueOrHelpId() const
+const rtl::OString& Window::GetUniqueOrHelpId() const
{
- if ( ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartHelpId ) || mpWindowImpl->mnHelpId )
- {
- if ( ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartUniqueId ) || mpWindowImpl->mnUniqId )
- {
- SmartId aTemp = GetSmartHelpId();
- aTemp.UpdateId( GetSmartUniqueId() );
- return aTemp;
- }
- else
- return GetSmartHelpId();
- }
- else
- return GetSmartUniqueId();
+ return mpWindowImpl->maUniqId.getLength() ? mpWindowImpl->maUniqId : mpWindowImpl->maHelpId;
}
-
-
-
// --------- old inline methods ---------------
Window* Window::ImplGetWindow()
@@ -1492,47 +1408,47 @@ Window* Window::ImplGetFrameWindow() const
return mpWindowImpl->mpFrameWindow;
}
-BOOL Window::ImplIsDockingWindow() const
+sal_Bool Window::ImplIsDockingWindow() const
{
return mpWindowImpl->mbDockWin;
}
-BOOL Window::ImplIsFloatingWindow() const
+sal_Bool Window::ImplIsFloatingWindow() const
{
return mpWindowImpl->mbFloatWin;
}
-BOOL Window::ImplIsToolbox() const
+sal_Bool Window::ImplIsToolbox() const
{
return mpWindowImpl->mbToolBox;
}
-BOOL Window::ImplIsSplitter() const
+sal_Bool Window::ImplIsSplitter() const
{
return mpWindowImpl->mbSplitter;
}
-BOOL Window::ImplIsPushButton() const
+sal_Bool Window::ImplIsPushButton() const
{
return mpWindowImpl->mbPushButton;
}
-BOOL Window::ImplIsOverlapWindow() const
+sal_Bool Window::ImplIsOverlapWindow() const
{
return mpWindowImpl->mbOverlapWin;
}
-void Window::ImplSetActive( BOOL bActive )
+void Window::ImplSetActive( sal_Bool bActive )
{
mpWindowImpl->mbActive = bActive;
}
-BOOL Window::ImplIsMouseTransparent() const
+sal_Bool Window::ImplIsMouseTransparent() const
{
return mpWindowImpl->mbMouseTransparent;
}
-void Window::ImplSetMouseTransparent( BOOL bTransparent )
+void Window::ImplSetMouseTransparent( sal_Bool bTransparent )
{
mpWindowImpl->mbMouseTransparent = bTransparent;
}
@@ -1563,7 +1479,7 @@ void Window::ImplFrameToOutput( Rectangle& rRect )
rRect.Bottom()-=mnOutOffY;
}
-void Window::SetCompoundControl( BOOL bCompound )
+void Window::SetCompoundControl( sal_Bool bCompound )
{
mpWindowImpl->mbCompoundControl = bCompound;
}
@@ -1607,77 +1523,77 @@ WindowType Window::GetType() const
{
return mpWindowImpl->mnType;
}
-BOOL Window::IsSystemWindow() const
+sal_Bool Window::IsSystemWindow() const
{
return mpWindowImpl->mbSysWin;
}
-BOOL Window::IsDialog() const
+sal_Bool Window::IsDialog() const
{
return mpWindowImpl->mbDialog;
}
-BOOL Window::IsMenuFloatingWindow() const
+sal_Bool Window::IsMenuFloatingWindow() const
{
return mpWindowImpl->mbMenuFloatingWindow;
}
-BOOL Window::IsToolbarFloatingWindow() const
+sal_Bool Window::IsToolbarFloatingWindow() const
{
return mpWindowImpl->mbToolbarFloatingWindow;
}
-void Window::EnableAllResize( BOOL bEnable )
+void Window::EnableAllResize( sal_Bool bEnable )
{
mpWindowImpl->mbAllResize = bEnable;
}
-BOOL Window::IsAllResizeEnabled() const
+sal_Bool Window::IsAllResizeEnabled() const
{
return mpWindowImpl->mbAllResize;
}
-BOOL Window::IsClipSiblingsEnabled() const
+sal_Bool Window::IsClipSiblingsEnabled() const
{
return mpWindowImpl->mbClipSiblings;
}
-void Window::EnableChildTransparentMode( BOOL bEnable )
+void Window::EnableChildTransparentMode( sal_Bool bEnable )
{
mpWindowImpl->mbChildTransparent = bEnable;
}
-BOOL Window::IsChildTransparentModeEnabled() const
+sal_Bool Window::IsChildTransparentModeEnabled() const
{
return mpWindowImpl->mbChildTransparent;
}
-BOOL Window::IsMouseTransparent() const
+sal_Bool Window::IsMouseTransparent() const
{
return mpWindowImpl->mbMouseTransparent;
}
-BOOL Window::IsPaintTransparent() const
+sal_Bool Window::IsPaintTransparent() const
{
return mpWindowImpl->mbPaintTransparent;
}
-void Window::SetDialogControlStart( BOOL bStart )
+void Window::SetDialogControlStart( sal_Bool bStart )
{
mpWindowImpl->mbDlgCtrlStart = bStart;
}
-BOOL Window::IsDialogControlStart() const
+sal_Bool Window::IsDialogControlStart() const
{
return mpWindowImpl->mbDlgCtrlStart;
}
-void Window::SetDialogControlFlags( USHORT nFlags )
+void Window::SetDialogControlFlags( sal_uInt16 nFlags )
{
mpWindowImpl->mnDlgCtrlFlags = nFlags;
}
-USHORT Window::GetDialogControlFlags() const
+sal_uInt16 Window::GetDialogControlFlags() const
{
return mpWindowImpl->mnDlgCtrlFlags;
}
@@ -1687,22 +1603,22 @@ const InputContext& Window::GetInputContext() const
return mpWindowImpl->maInputContext;
}
-BOOL Window::IsExtTextInput() const
+sal_Bool Window::IsExtTextInput() const
{
return mpWindowImpl->mbExtTextInput;
}
-void Window::EnableChildNotify( BOOL bEnable )
+void Window::EnableChildNotify( sal_Bool bEnable )
{
mpWindowImpl->mbChildNotify = bEnable;
}
-BOOL Window::IsChildNotify() const
+sal_Bool Window::IsChildNotify() const
{
return mpWindowImpl->mbChildNotify;
}
-BOOL Window::IsControlFont() const
+sal_Bool Window::IsControlFont() const
{
return (mpWindowImpl->mpControlFont != 0);
}
@@ -1712,7 +1628,7 @@ Color Window::GetControlForeground() const
return mpWindowImpl->maControlForeground;
}
-BOOL Window::IsControlForeground() const
+sal_Bool Window::IsControlForeground() const
{
return mpWindowImpl->mbControlForeground;
}
@@ -1722,12 +1638,12 @@ Color Window::GetControlBackground() const
return mpWindowImpl->maControlBackground;
}
-BOOL Window::IsControlBackground() const
+sal_Bool Window::IsControlBackground() const
{
return mpWindowImpl->mbControlBackground;
}
-BOOL Window::IsInPaint() const
+sal_Bool Window::IsInPaint() const
{
return mpWindowImpl->mbInPaint;
}
@@ -1737,128 +1653,128 @@ Window* Window::GetParent() const
return mpWindowImpl->mpRealParent;
}
-BOOL Window::IsVisible() const
+sal_Bool Window::IsVisible() const
{
return mpWindowImpl->mbVisible;
}
-BOOL Window::IsReallyVisible() const
+sal_Bool Window::IsReallyVisible() const
{
return mpWindowImpl->mbReallyVisible;
}
-BOOL Window::IsParentPathVisible() const
+sal_Bool Window::IsParentPathVisible() const
{
return mpWindowImpl->mbReallyVisible;
}
-BOOL Window::IsReallyShown() const
+sal_Bool Window::IsReallyShown() const
{
return mpWindowImpl->mbReallyShown;
}
-BOOL Window::IsInInitShow() const
+sal_Bool Window::IsInInitShow() const
{
return mpWindowImpl->mbInInitShow;
}
-BOOL Window::IsEnabled() const
+sal_Bool Window::IsEnabled() const
{
return !mpWindowImpl->mbDisabled;
}
-BOOL Window::IsInputEnabled() const
+sal_Bool Window::IsInputEnabled() const
{
return !mpWindowImpl->mbInputDisabled;
}
-BOOL Window::IsAlwaysEnableInput() const
+sal_Bool Window::IsAlwaysEnableInput() const
{
return mpWindowImpl->meAlwaysInputMode == AlwaysInputEnabled;
}
-BOOL Window::IsAlwaysDisableInput() const
+sal_Bool Window::IsAlwaysDisableInput() const
{
return mpWindowImpl->meAlwaysInputMode == AlwaysInputDisabled;
}
-USHORT Window::GetActivateMode() const
+sal_uInt16 Window::GetActivateMode() const
{
return mpWindowImpl->mnActivateMode;
}
-BOOL Window::IsAlwaysOnTopEnabled() const
+sal_Bool Window::IsAlwaysOnTopEnabled() const
{
return mpWindowImpl->mbAlwaysOnTop;
}
-BOOL Window::IsDefaultPos() const
+sal_Bool Window::IsDefaultPos() const
{
return mpWindowImpl->mbDefPos;
}
-BOOL Window::IsDefaultSize() const
+sal_Bool Window::IsDefaultSize() const
{
return mpWindowImpl->mbDefSize;
}
-void Window::EnablePaint( BOOL bEnable )
+void Window::EnablePaint( sal_Bool bEnable )
{
mpWindowImpl->mbPaintDisabled = !bEnable;
}
-BOOL Window::IsPaintEnabled() const
+sal_Bool Window::IsPaintEnabled() const
{
return !mpWindowImpl->mbPaintDisabled;
}
-BOOL Window::IsUpdateMode() const
+sal_Bool Window::IsUpdateMode() const
{
return !mpWindowImpl->mbNoUpdate;
}
-void Window::SetParentUpdateMode( BOOL bUpdate )
+void Window::SetParentUpdateMode( sal_Bool bUpdate )
{
mpWindowImpl->mbNoParentUpdate = !bUpdate;
}
-BOOL Window::IsParentUpdateMode() const
+sal_Bool Window::IsParentUpdateMode() const
{
return !mpWindowImpl->mbNoParentUpdate;
}
-BOOL Window::IsActive() const
+sal_Bool Window::IsActive() const
{
return mpWindowImpl->mbActive;
}
-USHORT Window::GetGetFocusFlags() const
+sal_uInt16 Window::GetGetFocusFlags() const
{
return mpWindowImpl->mnGetFocusFlags;
}
-BOOL Window::IsCompoundControl() const
+sal_Bool Window::IsCompoundControl() const
{
return mpWindowImpl->mbCompoundControl;
}
-BOOL Window::HasCompoundControlFocus() const
+sal_Bool Window::HasCompoundControlFocus() const
{
return mpWindowImpl->mbCompoundControlHasFocus;
}
-BOOL Window::IsChildPointerOverwrite() const
+sal_Bool Window::IsChildPointerOverwrite() const
{
return mpWindowImpl->mbChildPtrOverwrite;
}
-BOOL Window::IsPointerVisible() const
+sal_Bool Window::IsPointerVisible() const
{
return !mpWindowImpl->mbNoPtrVisible;
}
-BOOL Window::IsWait() const
+sal_Bool Window::IsWait() const
{
return (mpWindowImpl->mnWaitCount != 0);
}
@@ -1873,7 +1789,7 @@ const Fraction& Window::GetZoom() const
return mpWindowImpl->maZoom;
}
-BOOL Window::IsZoom() const
+sal_Bool Window::IsZoom() const
{
return mpWindowImpl->maZoom.GetNumerator() != mpWindowImpl->maZoom.GetDenominator();
}
@@ -1881,7 +1797,7 @@ BOOL Window::IsZoom() const
void Window::SetHelpText( const XubString& rHelpText )
{
mpWindowImpl->maHelpText = rHelpText;
- mpWindowImpl->mbHelpTextDynamic = TRUE;
+ mpWindowImpl->mbHelpTextDynamic = sal_True;
}
void Window::SetQuickHelpText( const XubString& rHelpText )
@@ -1904,12 +1820,12 @@ void* Window::GetData() const
return mpWindowImpl->mpUserData;
}
-BOOL Window::IsCreatedWithToolkit() const
+sal_Bool Window::IsCreatedWithToolkit() const
{
return mpWindowImpl->mbCreatedWithToolkit;
}
-void Window::SetCreatedWithToolkit( BOOL b )
+void Window::SetCreatedWithToolkit( sal_Bool b )
{
mpWindowImpl->mbCreatedWithToolkit = b;
diff --git a/vcl/source/window/window4.cxx b/vcl/source/window/window4.cxx
new file mode 100644
index 000000000000..577a573c2015
--- /dev/null
+++ b/vcl/source/window/window4.cxx
@@ -0,0 +1,224 @@
+/*************************************************************************
+ *
+ * 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_vcl.hxx"
+
+#include "vcl/window.hxx"
+#include "vcl/window.h"
+#include "vcl/svdata.hxx"
+#include "vcl/arrange.hxx"
+
+#include "com/sun/star/beans/PropertyValue.hpp"
+
+#include <map>
+#include <vector>
+
+using namespace com::sun::star;
+
+namespace vcl
+{
+ struct ExtWindowImpl
+ {
+ ExtWindowImpl()
+ : mbOwnedByParent( false )
+ {}
+ ~ExtWindowImpl()
+ {}
+
+ boost::shared_ptr< WindowArranger > mxLayout;
+ bool mbOwnedByParent;
+ rtl::OUString maIdentifier;
+ };
+}
+
+void Window::ImplDeleteOwnedChildren()
+{
+ Window* pChild = mpWindowImpl->mpFirstChild;
+ while ( pChild )
+ {
+ Window* pDeleteCandidate = pChild;
+ pChild = pChild->mpWindowImpl->mpNext;
+ vcl::ExtWindowImpl* pDelImpl = pDeleteCandidate->ImplGetExtWindowImpl();
+ if( pDelImpl && pDelImpl->mbOwnedByParent )
+ delete pDeleteCandidate;
+ }
+}
+
+void Window::ImplFreeExtWindowImpl()
+{
+ ImplDeleteOwnedChildren();
+ if( mpWindowImpl )
+ {
+ delete mpWindowImpl->mpExtImpl;
+ mpWindowImpl->mpExtImpl = NULL;
+ }
+}
+
+vcl::ExtWindowImpl* Window::ImplGetExtWindowImpl() const
+{
+ vcl::ExtWindowImpl* pImpl = NULL;
+ if( mpWindowImpl )
+ {
+ if( ! mpWindowImpl->mpExtImpl && ! mpWindowImpl->mbInDtor )
+ mpWindowImpl->mpExtImpl = new vcl::ExtWindowImpl();
+ pImpl = mpWindowImpl->mpExtImpl;
+ }
+ return pImpl;
+}
+
+void Window::ImplExtResize()
+{
+ if( mpWindowImpl && mpWindowImpl->mpExtImpl )
+ {
+ if( mpWindowImpl->mpExtImpl->mxLayout.get() )
+ mpWindowImpl->mpExtImpl->mxLayout->setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
+ }
+}
+
+boost::shared_ptr< vcl::WindowArranger > Window::getLayout()
+{
+ boost::shared_ptr< vcl::WindowArranger > xRet;
+ vcl::ExtWindowImpl* pImpl = ImplGetExtWindowImpl();
+ if( pImpl )
+ {
+ if( ! pImpl->mxLayout.get() )
+ {
+ pImpl->mxLayout.reset( new vcl::LabelColumn() );
+ pImpl->mxLayout->setParentWindow( this );
+ pImpl->mxLayout->setOuterBorder( -1 );
+ }
+ xRet = pImpl->mxLayout;
+ }
+
+ return xRet;
+}
+
+void Window::addWindow( Window* i_pWin, bool i_bTakeOwnership )
+{
+ vcl::ExtWindowImpl* pImpl = ImplGetExtWindowImpl();
+ if( pImpl && i_pWin )
+ {
+ vcl::ExtWindowImpl* pChildImpl = i_pWin->ImplGetExtWindowImpl();
+ if( pChildImpl )
+ {
+ i_pWin->SetParent( this );
+ pChildImpl->mbOwnedByParent = i_bTakeOwnership;
+ }
+ }
+}
+
+Window* Window::removeWindow( Window* i_pWin, Window* i_pNewParent )
+{
+ Window* pRet = NULL;
+ if( i_pWin )
+ {
+ vcl::ExtWindowImpl* pImpl = ImplGetExtWindowImpl();
+ if( pImpl )
+ {
+ vcl::ExtWindowImpl* pChildImpl = i_pWin->ImplGetExtWindowImpl();
+ if( pChildImpl )
+ {
+ if( ! i_pNewParent )
+ pChildImpl->mbOwnedByParent = false;
+ i_pWin->SetParent( i_pNewParent );
+ pRet = i_pWin;
+ }
+ }
+ }
+ return pRet;
+}
+
+Window* Window::findWindow( const rtl::OUString& i_rIdentifier ) const
+{
+ if( getIdentifier() == i_rIdentifier )
+ return const_cast<Window*>(this);
+
+ Window* pChild = mpWindowImpl->mpFirstChild;
+ while ( pChild )
+ {
+ Window* pResult = pChild->findWindow( i_rIdentifier );
+ if( pResult )
+ return pResult;
+ pChild = pChild->mpWindowImpl->mpNext;
+ }
+
+ return NULL;
+}
+
+const rtl::OUString& Window::getIdentifier() const
+{
+ static rtl::OUString aEmptyStr;
+
+ return (mpWindowImpl && mpWindowImpl->mpExtImpl) ? mpWindowImpl->mpExtImpl->maIdentifier : aEmptyStr;
+}
+
+void Window::setIdentifier( const rtl::OUString& i_rIdentifier )
+{
+ vcl::ExtWindowImpl* pImpl = ImplGetExtWindowImpl();
+ if( pImpl )
+ pImpl->maIdentifier = i_rIdentifier;
+}
+
+void Window::setProperties( const uno::Sequence< beans::PropertyValue >& i_rProps )
+{
+ const beans::PropertyValue* pVals = i_rProps.getConstArray();
+ for( sal_Int32 i = 0; i < i_rProps.getLength(); i++ )
+ {
+ if( pVals[i].Name.equalsAscii( "Enabled" ) )
+ {
+ sal_Bool bVal = sal_True;
+ if( pVals[i].Value >>= bVal )
+ Enable( bVal );
+ }
+ else if( pVals[i].Name.equalsAscii( "Visible" ) )
+ {
+ sal_Bool bVal = sal_True;
+ if( pVals[i].Value >>= bVal )
+ Show( bVal );
+ }
+ else if( pVals[i].Name.equalsAscii( "Text" ) )
+ {
+ rtl::OUString aText;
+ if( pVals[i].Value >>= aText )
+ SetText( aText );
+ }
+ }
+}
+
+uno::Sequence< beans::PropertyValue > Window::getProperties() const
+{
+ uno::Sequence< beans::PropertyValue > aProps( 3 );
+ aProps[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Enabled" ) );
+ aProps[0].Value = uno::makeAny( sal_Bool( IsEnabled() ) );
+ aProps[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) );
+ aProps[1].Value = uno::makeAny( sal_Bool( IsVisible() ) );
+ aProps[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ) );
+ aProps[2].Value = uno::makeAny( rtl::OUString( GetText() ) );
+
+ return aProps;
+}
+
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index a7d09cb6dd20..2892bcb00c38 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -38,7 +38,6 @@
#include <unotools/localedatawrapper.hxx>
#include <vcl/svdata.hxx>
#include <vcl/dbggui.hxx>
-#include <vcl/windata.hxx>
#include <vcl/timer.hxx>
#include <vcl/event.hxx>
#include <vcl/sound.hxx>
@@ -129,9 +128,9 @@ long ImplCallEvent( NotifyEvent& rEvt )
// =======================================================================
-static BOOL ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos,
- USHORT nCode, USHORT nSVEvent,
- BOOL bMouseLeave )
+static sal_Bool ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos,
+ sal_uInt16 nCode, sal_uInt16 nSVEvent,
+ sal_Bool bMouseLeave )
{
ImplSVData* pSVData = ImplGetSVData();
@@ -142,21 +141,21 @@ static BOOL ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos,
* #93895# since floats are system windows, coordinates have
* to be converted to float relative for the hittest
*/
- USHORT nHitTest = IMPL_FLOATWIN_HITTEST_OUTSIDE;
+ sal_uInt16 nHitTest = IMPL_FLOATWIN_HITTEST_OUTSIDE;
FloatingWindow* pFloat = pSVData->maWinData.mpFirstFloat->ImplFloatHitTest( pChild, rMousePos, nHitTest );
FloatingWindow* pLastLevelFloat;
- ULONG nPopupFlags;
+ sal_uLong nPopupFlags;
if ( nSVEvent == EVENT_MOUSEMOVE )
{
if ( bMouseLeave )
- return TRUE;
+ return sal_True;
if ( !pFloat || (nHitTest & IMPL_FLOATWIN_HITTEST_RECT) )
{
if ( pSVData->maHelpData.mpHelpWin && !pSVData->maHelpData.mbKeyboardHelp )
ImplDestroyHelpWindow( true );
pChild->ImplGetFrame()->SetPointer( POINTER_ARROW );
- return TRUE;
+ return sal_True;
}
}
else
@@ -172,15 +171,15 @@ static BOOL ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos,
pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
// Erstmal ausgebaut als Hack fuer Bug 53378
// if ( nPopupFlags & FLOATWIN_POPUPMODE_PATHMOUSECANCELCLICK )
-// return FALSE;
+// return sal_False;
// else
- return TRUE;
+ return sal_True;
}
else if ( nHitTest & IMPL_FLOATWIN_HITTEST_RECT )
{
if ( !(pFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOMOUSERECTCLOSE) )
pFloat->ImplSetMouseDown();
- return TRUE;
+ return sal_True;
}
}
else
@@ -191,7 +190,7 @@ static BOOL ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos,
{
if ( pFloat->ImplIsMouseDown() )
pFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL );
- return TRUE;
+ return sal_True;
}
}
else
@@ -201,7 +200,7 @@ static BOOL ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos,
if ( !(nPopupFlags & FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE) )
{
pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
- return TRUE;
+ return sal_True;
}
}
}
@@ -216,21 +215,21 @@ static BOOL ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos,
{
if ( (nPopupFlags & FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE) &&
(nSVEvent == EVENT_MOUSEBUTTONUP) )
- return TRUE;
+ return sal_True;
pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
if ( nPopupFlags & FLOATWIN_POPUPMODE_PATHMOUSECANCELCLICK )
- return FALSE;
+ return sal_False;
else
- return TRUE;
+ return sal_True;
}
else
- return TRUE;
+ return sal_True;
}
}
}
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -242,7 +241,7 @@ static void ImplHandleMouseHelpRequest( Window* pChild, const Point& rMousePos )
!( pSVData->maHelpData.mpHelpWin->IsWindowOrChild( pChild ) ||
pChild->IsWindowOrChild( pSVData->maHelpData.mpHelpWin ) ) )
{
- USHORT nHelpMode = 0;
+ sal_uInt16 nHelpMode = 0;
if ( pSVData->maHelpData.mbQuickHelp )
nHelpMode = HELPMODE_QUICK;
if ( pSVData->maHelpData.mbBalloonHelp )
@@ -252,9 +251,9 @@ static void ImplHandleMouseHelpRequest( Window* pChild, const Point& rMousePos )
if ( pChild->IsInputEnabled() && ! pChild->IsInModalMode() )
{
HelpEvent aHelpEvent( rMousePos, nHelpMode );
- pSVData->maHelpData.mbRequestingHelp = TRUE;
+ pSVData->maHelpData.mbRequestingHelp = sal_True;
pChild->RequestHelp( aHelpEvent );
- pSVData->maHelpData.mbRequestingHelp = FALSE;
+ pSVData->maHelpData.mbRequestingHelp = sal_False;
}
// #104172# do not kill keyboard activated tooltips
else if ( pSVData->maHelpData.mpHelpWin && !pSVData->maHelpData.mbKeyboardHelp)
@@ -278,8 +277,8 @@ static void ImplSetMousePointer( Window* pChild )
// -----------------------------------------------------------------------
-static BOOL ImplCallCommand( Window* pChild, USHORT nEvt, void* pData = NULL,
- BOOL bMouse = FALSE, Point* pPos = NULL )
+static sal_Bool ImplCallCommand( Window* pChild, sal_uInt16 nEvt, void* pData = NULL,
+ sal_Bool bMouse = sal_False, Point* pPos = NULL )
{
Point aPos;
if ( pPos )
@@ -299,24 +298,24 @@ static BOOL ImplCallCommand( Window* pChild, USHORT nEvt, void* pData = NULL,
CommandEvent aCEvt( aPos, nEvt, bMouse, pData );
NotifyEvent aNCmdEvt( EVENT_COMMAND, pChild, &aCEvt );
ImplDelData aDelData( pChild );
- BOOL bPreNotify = (ImplCallPreNotify( aNCmdEvt ) != 0);
+ sal_Bool bPreNotify = (ImplCallPreNotify( aNCmdEvt ) != 0);
if ( aDelData.IsDelete() )
- return FALSE;
+ return sal_False;
if ( !bPreNotify )
{
- pChild->ImplGetWindowImpl()->mbCommand = FALSE;
+ pChild->ImplGetWindowImpl()->mbCommand = sal_False;
pChild->Command( aCEvt );
if( aDelData.IsDelete() )
- return FALSE;
+ return sal_False;
pChild->ImplNotifyKeyMouseCommandEventListeners( aNCmdEvt );
if ( aDelData.IsDelete() )
- return FALSE;
+ return sal_False;
if ( pChild->ImplGetWindowImpl()->mbCommand )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -339,24 +338,24 @@ static long ContextMenuEventLink( void* pCEvent, void* )
if( ! pEv->aDelData.IsDelete() )
{
pEv->pWindow->ImplRemoveDel( &pEv->aDelData );
- ImplCallCommand( pEv->pWindow, COMMAND_CONTEXTMENU, NULL, TRUE, &pEv->aChildPos );
+ ImplCallCommand( pEv->pWindow, COMMAND_CONTEXTMENU, NULL, sal_True, &pEv->aChildPos );
}
delete pEv;
return 0;
}
-long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
- long nX, long nY, ULONG nMsgTime,
- USHORT nCode, USHORT nMode )
+long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouseLeave,
+ long nX, long nY, sal_uLong nMsgTime,
+ sal_uInt16 nCode, sal_uInt16 nMode )
{
ImplSVData* pSVData = ImplGetSVData();
Point aMousePos( nX, nY );
Window* pChild;
long nRet;
- USHORT nClicks;
+ sal_uInt16 nClicks;
ImplFrameData* pWinFrameData = pWindow->ImplGetFrameData();
- USHORT nOldCode = pWinFrameData->mnMouseCode;
+ sal_uInt16 nOldCode = pWinFrameData->mnMouseCode;
// we need a mousemove event, befor we get a mousebuttondown or a
// mousebuttonup event
@@ -379,7 +378,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
if ( (pWinFrameData->mnLastMouseX != nX) ||
(pWinFrameData->mnLastMouseY != nY) )
{
- ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, FALSE, nX, nY, nMsgTime, nCode, nMode );
+ ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, sal_False, nX, nY, nMsgTime, nCode, nMode );
}
}
@@ -392,7 +391,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
pWinFrameData->mnMouseMode = nMode & ~(MOUSE_SYNTHETIC | MOUSE_MODIFIERCHANGED);
if ( bMouseLeave )
{
- pWinFrameData->mbMouseIn = FALSE;
+ pWinFrameData->mbMouseIn = sal_False;
if ( pSVData->maHelpData.mpHelpWin && !pSVData->maHelpData.mbKeyboardHelp )
{
ImplDelData aDelData( pWindow );
@@ -404,7 +403,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
}
}
else
- pWinFrameData->mbMouseIn = TRUE;
+ pWinFrameData->mbMouseIn = sal_True;
DBG_ASSERT( !pSVData->maWinData.mpTrackWin ||
(pSVData->maWinData.mpTrackWin == pSVData->maWinData.mpCaptureWin),
@@ -557,7 +556,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
!(((nMouseY-nDragH) <= pMouseDownWin->ImplGetFrameData()->mnFirstMouseY) &&
((nMouseY+nDragH) >= pMouseDownWin->ImplGetFrameData()->mnFirstMouseY)) )
{
- pMouseDownWin->ImplGetFrameData()->mbStartDragCalled = TRUE;
+ pMouseDownWin->ImplGetFrameData()->mbStartDragCalled = sal_True;
// Check if drag source provides it's own recognizer
if( pMouseDownWin->ImplGetFrameData()->mbInternalDragGestureRecognizer )
@@ -588,7 +587,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
nClicks,
sal_False );
- ULONG nCount = Application::ReleaseSolarMutex();
+ sal_uLong nCount = Application::ReleaseSolarMutex();
// FIXME: where do I get Action from ?
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource > xDragSource = pMouseDownWin->GetDragSource();
@@ -606,7 +605,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
}
}
else
- pMouseDownWin->ImplGetFrameData()->mbStartDragCalled = TRUE;
+ pMouseDownWin->ImplGetFrameData()->mbStartDragCalled = sal_True;
}
// test for mouseleave and mouseenter
@@ -620,8 +619,8 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
NotifyEvent aNLeaveEvt( EVENT_MOUSEMOVE, pMouseMoveWin, &aMLeaveEvt );
ImplDelData aDelData;
ImplDelData aDelData2;
- pWinFrameData->mbInMouseMove = TRUE;
- pMouseMoveWin->ImplGetWinData()->mbMouseOver = FALSE;
+ pWinFrameData->mbInMouseMove = sal_True;
+ pMouseMoveWin->ImplGetWinData()->mbMouseOver = sal_False;
pMouseMoveWin->ImplAddDel( &aDelData );
// Durch MouseLeave kann auch dieses Fenster zerstoert
// werden
@@ -636,7 +635,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
}
pWinFrameData->mpMouseMoveWin = NULL;
- pWinFrameData->mbInMouseMove = FALSE;
+ pWinFrameData->mbInMouseMove = sal_False;
if ( pChild )
{
@@ -654,7 +653,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
}
pWinFrameData->mpMouseMoveWin = pChild;
if( pChild )
- pChild->ImplGetWinData()->mbMouseOver = TRUE;
+ pChild->ImplGetWinData()->mbMouseOver = sal_True;
// MouseLeave
if ( !pChild )
@@ -666,7 +665,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
if ( nSVEvent == EVENT_MOUSEBUTTONDOWN )
{
const MouseSettings& rMSettings = pChild->GetSettings().GetMouseSettings();
- ULONG nDblClkTime = rMSettings.GetDoubleClickTime();
+ sal_uLong nDblClkTime = rMSettings.GetDoubleClickTime();
long nDblClkW = rMSettings.GetDoubleClickWidth();
long nDblClkH = rMSettings.GetDoubleClickHeight();
//long nMouseX = nX;
@@ -683,7 +682,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
((nMouseY+nDblClkH) >= pChild->ImplGetFrameData()->mnFirstMouseY) )
{
pChild->ImplGetFrameData()->mnClickCount++;
- pChild->ImplGetFrameData()->mbStartDragCalled = TRUE;
+ pChild->ImplGetFrameData()->mbStartDragCalled = sal_True;
}
else
{
@@ -722,7 +721,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
if ( !aDelData.IsDelete() )
{
pChild->ImplRemoveDel( &aDelData );
- pChild->ImplGetFrameData()->mbStartDragCalled = TRUE;
+ pChild->ImplGetFrameData()->mbStartDragCalled = sal_True;
}
return 1;
}
@@ -731,15 +730,15 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
}
// call handler
- BOOL bDrag = FALSE;
- BOOL bCallHelpRequest = TRUE;
+ sal_Bool bDrag = sal_False;
+ sal_Bool bCallHelpRequest = sal_True;
DBG_ASSERT( pChild, "ImplHandleMouseEvent: pChild is NULL" );
ImplDelData aDelData;
NotifyEvent aNEvt( nSVEvent, pChild, &aMEvt );
pChild->ImplAddDel( &aDelData );
if ( nSVEvent == EVENT_MOUSEMOVE )
- pChild->ImplGetFrameData()->mbInMouseMove = TRUE;
+ pChild->ImplGetFrameData()->mbInMouseMove = sal_True;
// bring window into foreground on mouseclick
if ( nSVEvent == EVENT_MOUSEBUTTONDOWN )
@@ -769,7 +768,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
(pSVData->maWinData.mnTrackFlags & STARTTRACK_SCROLLREPEAT) )
pSVData->maWinData.mpTrackTimer->Start();
}
- bCallHelpRequest = FALSE;
+ bCallHelpRequest = sal_False;
nRet = 1;
}
else
@@ -780,16 +779,16 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
pChild->ToTop( TOTOP_NOGRABFOCUS );
if( aDelData.IsDelete() )
- bCallHelpRequest = FALSE;
+ bCallHelpRequest = sal_False;
else
{
// if the MouseMove handler changes the help window's visibility
// the HelpRequest handler should not be called anymore
Window* pOldHelpTextWin = pSVData->maHelpData.mpHelpWin;
- pChild->ImplGetWindowImpl()->mbMouseMove = FALSE;
+ pChild->ImplGetWindowImpl()->mbMouseMove = sal_False;
pChild->MouseMove( aMEvt );
if ( pOldHelpTextWin != pSVData->maHelpData.mpHelpWin )
- bCallHelpRequest = FALSE;
+ bCallHelpRequest = sal_False;
}
}
}
@@ -800,7 +799,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
nRet = 1;
else
{
- pChild->ImplGetWindowImpl()->mbMouseButtonDown = FALSE;
+ pChild->ImplGetWindowImpl()->mbMouseButtonDown = sal_False;
pChild->MouseButtonDown( aMEvt );
}
}
@@ -813,7 +812,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
}
else
{
- pChild->ImplGetWindowImpl()->mbMouseButtonUp = FALSE;
+ pChild->ImplGetWindowImpl()->mbMouseButtonUp = sal_False;
pChild->MouseButtonUp( aMEvt );
}
}
@@ -828,7 +827,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
if ( nSVEvent == EVENT_MOUSEMOVE )
- pChild->ImplGetWindowImpl()->mpFrameData->mbInMouseMove = FALSE;
+ pChild->ImplGetWindowImpl()->mpFrameData->mbInMouseMove = sal_False;
if ( nSVEvent == EVENT_MOUSEMOVE )
{
@@ -866,11 +865,11 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
if ( /*(nRet == 0) &&*/ (nClicks == 1) && (nSVEvent == EVENT_MOUSEBUTTONDOWN) &&
(nCode == MOUSE_MIDDLE) )
{
- USHORT nMiddleAction = pChild->GetSettings().GetMouseSettings().GetMiddleButtonAction();
+ sal_uInt16 nMiddleAction = pChild->GetSettings().GetMouseSettings().GetMiddleButtonAction();
if ( nMiddleAction == MOUSE_MIDDLE_AUTOSCROLL )
- nRet = !ImplCallCommand( pChild, COMMAND_STARTAUTOSCROLL, NULL, TRUE, &aChildPos );
+ nRet = !ImplCallCommand( pChild, COMMAND_STARTAUTOSCROLL, NULL, sal_True, &aChildPos );
else if ( nMiddleAction == MOUSE_MIDDLE_PASTESELECTION )
- nRet = !ImplCallCommand( pChild, COMMAND_PASTESELECTION, NULL, TRUE, &aChildPos );
+ nRet = !ImplCallCommand( pChild, COMMAND_PASTESELECTION, NULL, sal_True, &aChildPos );
}
else
{
@@ -879,7 +878,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
if ( (nCode == rMSettings.GetContextMenuCode()) &&
(nClicks == rMSettings.GetContextMenuClicks()) )
{
- BOOL bContextMenu;
+ sal_Bool bContextMenu;
if ( rMSettings.GetContextMenuDown() )
bContextMenu = (nSVEvent == EVENT_MOUSEBUTTONDOWN);
else
@@ -903,7 +902,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
Application::PostUserEvent( Link( pEv, ContextMenuEventLink ) );
}
else
- nRet = ! ImplCallCommand( pChild, COMMAND_CONTEXTMENU, NULL, TRUE, &aChildPos );
+ nRet = ! ImplCallCommand( pChild, COMMAND_CONTEXTMENU, NULL, sal_True, &aChildPos );
}
}
}
@@ -958,20 +957,20 @@ static Window* ImplGetKeyInputWindow( Window* pWindow )
// -----------------------------------------------------------------------
-static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
- USHORT nKeyCode, USHORT nCharCode, USHORT nRepeat, BOOL bForward )
+static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
+ sal_uInt16 nKeyCode, sal_uInt16 nCharCode, sal_uInt16 nRepeat, sal_Bool bForward )
{
ImplSVData* pSVData = ImplGetSVData();
KeyCode aKeyCode( nKeyCode, nKeyCode );
- USHORT nEvCode = aKeyCode.GetCode();
+ sal_uInt16 nEvCode = aKeyCode.GetCode();
// allow application key listeners to remove the key event
- // but make sure we're not forwarding external KeyEvents, (ie where bForward is FALSE)
+ // but make sure we're not forwarding external KeyEvents, (ie where bForward is sal_False)
// becasue those are coming back from the listener itself and MUST be processed
KeyEvent aKeyEvent( (xub_Unicode)nCharCode, aKeyCode, nRepeat );
if( bForward )
{
- USHORT nVCLEvent;
+ sal_uInt16 nVCLEvent;
switch( nSVEvent )
{
case EVENT_KEYINPUT:
@@ -994,11 +993,11 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
if( Application::GetSettings().GetMiscSettings().GetEnableLocalizedDecimalSep() )
{
String aSep( pWindow->GetSettings().GetLocaleDataWrapper().getNumDecimalSep() );
- nCharCode = (USHORT) aSep.GetChar(0);
+ nCharCode = (sal_uInt16) aSep.GetChar(0);
}
}
- BOOL bCtrlF6 = (aKeyCode.GetCode() == KEY_F6) && aKeyCode.IsMod1();
+ sal_Bool bCtrlF6 = (aKeyCode.GetCode() == KEY_F6) && aKeyCode.IsMod1();
// determine last input time
pSVData->maAppData.mnLastInputTime = Time::GetSystemTicks();
@@ -1034,7 +1033,7 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
if ( pSVData->maWinData.mpTrackWin )
{
- USHORT nOrigCode = aKeyCode.GetCode();
+ sal_uInt16 nOrigCode = aKeyCode.GetCode();
if ( (nOrigCode == KEY_ESCAPE) && !(pSVData->maWinData.mnTrackFlags & STARTTRACK_NOKEYCANCEL) )
{
@@ -1044,7 +1043,7 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
FloatingWindow* pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
if ( !(pLastLevelFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOKEYCLOSE) )
{
- USHORT nEscCode = aKeyCode.GetCode();
+ sal_uInt16 nEscCode = aKeyCode.GetCode();
if ( nEscCode == KEY_ESCAPE )
pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
@@ -1067,7 +1066,7 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
FloatingWindow* pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
if ( !(pLastLevelFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOKEYCLOSE) )
{
- USHORT nCode = aKeyCode.GetCode();
+ sal_uInt16 nCode = aKeyCode.GetCode();
if ( (nCode == KEY_ESCAPE) || bCtrlF6)
{
@@ -1102,19 +1101,19 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
KeyEvent aKeyEvt( (xub_Unicode)nCharCode, aKeyCode, nRepeat );
NotifyEvent aNotifyEvt( nSVEvent, pChild, &aKeyEvt );
- BOOL bKeyPreNotify = (ImplCallPreNotify( aNotifyEvt ) != 0);
+ sal_Bool bKeyPreNotify = (ImplCallPreNotify( aNotifyEvt ) != 0);
long nRet = 1;
if ( !bKeyPreNotify && !aDelData.IsDelete() )
{
if ( nSVEvent == EVENT_KEYINPUT )
{
- pChild->ImplGetWindowImpl()->mbKeyInput = FALSE;
+ pChild->ImplGetWindowImpl()->mbKeyInput = sal_False;
pChild->KeyInput( aKeyEvt );
}
else
{
- pChild->ImplGetWindowImpl()->mbKeyUp = FALSE;
+ pChild->ImplGetWindowImpl()->mbKeyUp = sal_False;
pChild->KeyUp( aKeyEvt );
}
// #82968#
@@ -1131,10 +1130,10 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
{
if ( !bKeyPreNotify && pChild->ImplGetWindowImpl()->mbKeyInput )
{
- USHORT nCode = aKeyCode.GetCode();
+ sal_uInt16 nCode = aKeyCode.GetCode();
// #101999# is focus in or below toolbox
- BOOL bToolboxFocus=FALSE;
+ sal_Bool bToolboxFocus=sal_False;
if( (nCode == KEY_F1) && aKeyCode.IsShift() )
{
Window *pWin = pWindow->ImplGetWindowImpl()->mpFrameData->mpFocusWin;
@@ -1142,7 +1141,7 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
{
if( pWin->ImplGetWindowImpl()->mbToolBox )
{
- bToolboxFocus = TRUE;
+ bToolboxFocus = sal_True;
break;
}
else
@@ -1152,7 +1151,7 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
// ContextMenu
if ( (nCode == KEY_CONTEXTMENU) || ((nCode == KEY_F10) && aKeyCode.IsShift() && !aKeyCode.IsMod1() && !aKeyCode.IsMod2() ) )
- nRet = !ImplCallCommand( pChild, COMMAND_CONTEXTMENU, NULL, FALSE );
+ nRet = !ImplCallCommand( pChild, COMMAND_CONTEXTMENU, NULL, sal_False );
else if ( ( (nCode == KEY_F2) && aKeyCode.IsShift() ) || ( (nCode == KEY_F1) && aKeyCode.IsMod1() ) ||
// #101999# no active help when focus in toolbox, simulate BallonHelp instead
( (nCode == KEY_F1) && aKeyCode.IsShift() && bToolboxFocus ) )
@@ -1165,10 +1164,10 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
aPos = pChild->OutputToScreenPixel( aPos );
HelpEvent aHelpEvent( aPos, HELPMODE_BALLOON );
- aHelpEvent.SetKeyboardActivated( TRUE );
- pSVData->maHelpData.mbSetKeyboardHelp = TRUE;
+ aHelpEvent.SetKeyboardActivated( sal_True );
+ pSVData->maHelpData.mbSetKeyboardHelp = sal_True;
pChild->RequestHelp( aHelpEvent );
- pSVData->maHelpData.mbSetKeyboardHelp = FALSE;
+ pSVData->maHelpData.mbSetKeyboardHelp = sal_False;
}
else if ( (nCode == KEY_F1) || (nCode == KEY_HELP) )
{
@@ -1215,7 +1214,7 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
ImplDelData aChildDelData( pChild );
KeyEvent aKEvt( (xub_Unicode)nCharCode, aKeyCode, nRepeat );
NotifyEvent aNEvt( nSVEvent, pChild, &aKEvt );
- BOOL bPreNotify = (ImplCallPreNotify( aNEvt ) != 0);
+ sal_Bool bPreNotify = (ImplCallPreNotify( aNEvt ) != 0);
if ( aChildDelData.IsDelete() )
return 1;
@@ -1223,12 +1222,12 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
{
if ( nSVEvent == EVENT_KEYINPUT )
{
- pChild->ImplGetWindowImpl()->mbKeyInput = FALSE;
+ pChild->ImplGetWindowImpl()->mbKeyInput = sal_False;
pChild->KeyInput( aKEvt );
}
else
{
- pChild->ImplGetWindowImpl()->mbKeyUp = FALSE;
+ pChild->ImplGetWindowImpl()->mbKeyUp = sal_False;
pChild->KeyUp( aKEvt );
}
// #82968#
@@ -1249,8 +1248,8 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
static long ImplHandleExtTextInput( Window* pWindow,
const XubString& rText,
- const USHORT* pTextAttr,
- ULONG nCursorPos, USHORT nCursorFlags )
+ const sal_uInt16* pTextAttr,
+ sal_uLong nCursorPos, sal_uInt16 nCursorFlags )
{
ImplSVData* pSVData = ImplGetSVData();
Window* pChild = NULL;
@@ -1275,7 +1274,7 @@ static long ImplHandleExtTextInput( Window* pWindow,
ImplWinData* pWinData = pChild->ImplGetWinData();
if ( !pChild->ImplGetWindowImpl()->mbExtTextInput )
{
- pChild->ImplGetWindowImpl()->mbExtTextInput = TRUE;
+ pChild->ImplGetWindowImpl()->mbExtTextInput = sal_True;
if ( !pWinData->mpExtOldText )
pWinData->mpExtOldText = new UniString;
else
@@ -1294,7 +1293,7 @@ static long ImplHandleExtTextInput( Window* pWindow,
return 0;
// Test for changes
- BOOL bOnlyCursor = FALSE;
+ sal_Bool bOnlyCursor = sal_False;
xub_StrLen nMinLen = Min( pWinData->mpExtOldText->Len(), rText.Len() );
xub_StrLen nDeltaStart = 0;
while ( nDeltaStart < nMinLen )
@@ -1323,7 +1322,7 @@ static long ImplHandleExtTextInput( Window* pWindow,
}
if ( (nDeltaStart >= nMinLen) &&
(pWinData->mpExtOldText->Len() == rText.Len()) )
- bOnlyCursor = TRUE;
+ bOnlyCursor = sal_True;
// Call Event and store the information
CommandExtTextInputData aData( rText, pTextAttr,
@@ -1338,8 +1337,8 @@ static long ImplHandleExtTextInput( Window* pWindow,
}
if ( pTextAttr )
{
- pWinData->mpExtOldAttrAry = new USHORT[rText.Len()];
- memcpy( pWinData->mpExtOldAttrAry, pTextAttr, rText.Len()*sizeof( USHORT ) );
+ pWinData->mpExtOldAttrAry = new sal_uInt16[rText.Len()];
+ memcpy( pWinData->mpExtOldAttrAry, pTextAttr, rText.Len()*sizeof( sal_uInt16 ) );
}
return !ImplCallCommand( pChild, COMMAND_EXTTEXTINPUT, &aData );
}
@@ -1354,7 +1353,7 @@ static long ImplHandleEndExtTextInput( Window* /* pWindow */ )
if ( pChild )
{
- pChild->ImplGetWindowImpl()->mbExtTextInput = FALSE;
+ pChild->ImplGetWindowImpl()->mbExtTextInput = sal_False;
pSVData->maWinData.mpExtTextInputWin = NULL;
ImplWinData* pWinData = pChild->ImplGetWinData();
if ( pWinData->mpExtOldText )
@@ -1431,26 +1430,26 @@ static long ImplHandleInputContextChange( Window* pWindow, LanguageType eNewLang
// -----------------------------------------------------------------------
-static BOOL ImplCallWheelCommand( Window* pWindow, const Point& rPos,
+static sal_Bool ImplCallWheelCommand( Window* pWindow, const Point& rPos,
const CommandWheelData* pWheelData )
{
Point aCmdMousePos = pWindow->ImplFrameToOutput( rPos );
- CommandEvent aCEvt( aCmdMousePos, COMMAND_WHEEL, TRUE, pWheelData );
+ CommandEvent aCEvt( aCmdMousePos, COMMAND_WHEEL, sal_True, pWheelData );
NotifyEvent aNCmdEvt( EVENT_COMMAND, pWindow, &aCEvt );
ImplDelData aDelData( pWindow );
- BOOL bPreNotify = (ImplCallPreNotify( aNCmdEvt ) != 0);
+ sal_Bool bPreNotify = (ImplCallPreNotify( aNCmdEvt ) != 0);
if ( aDelData.IsDelete() )
- return FALSE;
+ return sal_False;
if ( !bPreNotify )
{
- pWindow->ImplGetWindowImpl()->mbCommand = FALSE;
+ pWindow->ImplGetWindowImpl()->mbCommand = sal_False;
pWindow->Command( aCEvt );
if ( aDelData.IsDelete() )
- return FALSE;
+ return sal_False;
if ( pWindow->ImplGetWindowImpl()->mbCommand )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -1467,8 +1466,8 @@ static long ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv
if( aDogTag.IsDelete() )
return 0;
- USHORT nMode;
- USHORT nCode = rEvt.mnCode;
+ sal_uInt16 nMode;
+ sal_uInt16 nCode = rEvt.mnCode;
bool bHorz = rEvt.mbHorz;
bool bPixel = rEvt.mbDeltaIsPixel;
if ( nCode & KEY_MOD1 )
@@ -1485,7 +1484,7 @@ static long ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv
CommandWheelData aWheelData( rEvt.mnDelta, rEvt.mnNotchDelta, rEvt.mnScrollLines, nMode, nCode, bHorz, bPixel );
Point aMousePos( rEvt.mnX, rEvt.mnY );
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
// first check any floating window ( eg. drop down listboxes)
bool bIsFloat = false;
@@ -1493,7 +1492,7 @@ static long ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv
if ( pSVData->maWinData.mpFirstFloat && !pSVData->maWinData.mpCaptureWin &&
!pSVData->maWinData.mpFirstFloat->ImplIsFloatPopupModeWindow( pWindow ) )
{
- USHORT nHitTest = IMPL_FLOATWIN_HITTEST_OUTSIDE;
+ sal_uInt16 nHitTest = IMPL_FLOATWIN_HITTEST_OUTSIDE;
pMouseWindow = pSVData->maWinData.mpFirstFloat->ImplFloatHitTest( pWindow, aMousePos, nHitTest );
}
// then try the window directly beneath the mouse
@@ -1547,7 +1546,7 @@ static long ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv
FloatingWindow* pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
if( pLastLevelFloat )
{
- ULONG nPopupFlags = pLastLevelFloat->GetPopupModeFlags();
+ sal_uLong nPopupFlags = pLastLevelFloat->GetPopupModeFlags();
if ( nPopupFlags & FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE )
{
pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
@@ -1559,7 +1558,7 @@ static long ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv
}
// -----------------------------------------------------------------------
-#define IMPL_PAINT_CHECKRTL ((USHORT)0x0020)
+#define IMPL_PAINT_CHECKRTL ((sal_uInt16)0x0020)
static void ImplHandlePaint( Window* pWindow, const Rectangle& rBoundRect, bool bImmediateUpdate )
{
@@ -1598,7 +1597,7 @@ static void KillOwnPopups( Window* pWindow )
ImplSVData* pSVData = ImplGetSVData();
Window *pParent = pWindow->ImplGetWindowImpl()->mpFrameWindow;
Window *pChild = pSVData->maWinData.mpFirstFloat;
- if ( pChild && pParent->ImplIsWindowOrChild( pChild, TRUE ) )
+ if ( pChild && pParent->ImplIsWindowOrChild( pChild, sal_True ) )
{
if ( !(pSVData->maWinData.mpFirstFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE) )
pSVData->maWinData.mpFirstFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
@@ -1625,7 +1624,7 @@ void ImplHandleResize( Window* pWindow, long nNewWidth, long nNewHeight )
{
pWindow->mnOutWidth = nNewWidth;
pWindow->mnOutHeight = nNewHeight;
- pWindow->ImplGetWindowImpl()->mbWaitSystemResize = FALSE;
+ pWindow->ImplGetWindowImpl()->mbWaitSystemResize = sal_False;
if ( pWindow->IsReallyVisible() )
pWindow->ImplSetClipFlag();
if ( pWindow->IsVisible() || pWindow->ImplGetWindow()->ImplGetWindowImpl()->mbAllResize ||
@@ -1656,13 +1655,13 @@ void ImplHandleResize( Window* pWindow, long nNewWidth, long nNewHeight )
pWindow->ImplCallResize(); // otherwise menues cannot be positioned
}
else
- pWindow->ImplGetWindowImpl()->mbCallResize = TRUE;
+ pWindow->ImplGetWindowImpl()->mbCallResize = sal_True;
}
}
pWindow->ImplGetWindowImpl()->mpFrameData->mbNeedSysWindow = (nNewWidth < IMPL_MIN_NEEDSYSWIN) ||
(nNewHeight < IMPL_MIN_NEEDSYSWIN);
- BOOL bMinimized = (nNewWidth <= 0) || (nNewHeight <= 0);
+ sal_Bool bMinimized = (nNewWidth <= 0) || (nNewHeight <= 0);
if( bMinimized != pWindow->ImplGetWindowImpl()->mpFrameData->mbMinimized )
pWindow->ImplGetWindowImpl()->mpFrameWindow->ImplNotifyIconifiedState( bMinimized );
pWindow->ImplGetWindowImpl()->mpFrameData->mbMinimized = bMinimized;
@@ -1688,7 +1687,7 @@ static void ImplHandleMove( Window* pWindow )
if ( pWindow->IsVisible() )
pWindow->ImplCallMove();
else
- pWindow->ImplGetWindowImpl()->mbCallMove = TRUE; // make sure the framepos will be updated on the next Show()
+ pWindow->ImplGetWindowImpl()->mbCallMove = sal_True; // make sure the framepos will be updated on the next Show()
if ( pWindow->ImplGetWindowImpl()->mbFrame && pWindow->ImplGetWindowImpl()->mpClientWindow )
pWindow->ImplGetWindowImpl()->mpClientWindow->ImplCallMove(); // notify client to update geometry
@@ -1705,7 +1704,7 @@ static void ImplHandleMoveResize( Window* pWindow, long nNewWidth, long nNewHeig
// -----------------------------------------------------------------------
-static void ImplActivateFloatingWindows( Window* pWindow, BOOL bActive )
+static void ImplActivateFloatingWindows( Window* pWindow, sal_Bool bActive )
{
// Zuerst alle ueberlappenden Fenster ueberpruefen
Window* pTempWindow = pWindow->ImplGetWindowImpl()->mpFirstOverlap;
@@ -1733,7 +1732,7 @@ IMPL_LINK( Window, ImplAsyncFocusHdl, void*, EMPTYARG )
// Wenn Status erhalten geblieben ist, weil wir den Focus in der
// zwischenzeit schon wiederbekommen haben, brauchen wir auch
// nichts machen
- BOOL bHasFocus = ImplGetWindowImpl()->mpFrameData->mbHasFocus || ImplGetWindowImpl()->mpFrameData->mbSysObjFocus;
+ sal_Bool bHasFocus = ImplGetWindowImpl()->mpFrameData->mbHasFocus || ImplGetWindowImpl()->mpFrameData->mbSysObjFocus;
// Dann die zeitverzoegerten Funktionen ausfuehren
if ( bHasFocus )
@@ -1744,21 +1743,21 @@ IMPL_LINK( Window, ImplAsyncFocusHdl, void*, EMPTYARG )
if ( ImplGetWindowImpl()->mpFrameData->mpFocusWin )
{
- BOOL bHandled = FALSE;
+ sal_Bool bHandled = sal_False;
if ( ImplGetWindowImpl()->mpFrameData->mpFocusWin->IsInputEnabled() &&
! ImplGetWindowImpl()->mpFrameData->mpFocusWin->IsInModalMode() )
{
if ( ImplGetWindowImpl()->mpFrameData->mpFocusWin->IsEnabled() )
{
ImplGetWindowImpl()->mpFrameData->mpFocusWin->GrabFocus();
- bHandled = TRUE;
+ bHandled = sal_True;
}
else if( ImplGetWindowImpl()->mpFrameData->mpFocusWin->ImplHasDlgCtrl() )
{
// #109094# if the focus is restored to a disabled dialog control (was disabled meanwhile)
// try to move it to the next control
ImplGetWindowImpl()->mpFrameData->mpFocusWin->ImplDlgCtrlNextWindow();
- bHandled = TRUE;
+ bHandled = sal_True;
}
}
if ( !bHandled )
@@ -1799,11 +1798,11 @@ IMPL_LINK( Window, ImplAsyncFocusHdl, void*, EMPTYARG )
Window* pOldOverlapWindow = pOldFocusWindow->ImplGetFirstOverlapWindow();
Window* pOldRealWindow = pOldOverlapWindow->ImplGetWindow();
- pOldOverlapWindow->ImplGetWindowImpl()->mbActive = FALSE;
+ pOldOverlapWindow->ImplGetWindowImpl()->mbActive = sal_False;
pOldOverlapWindow->Deactivate();
if ( pOldRealWindow != pOldOverlapWindow )
{
- pOldRealWindow->ImplGetWindowImpl()->mbActive = FALSE;
+ pOldRealWindow->ImplGetWindowImpl()->mbActive = sal_False;
pOldRealWindow->Deactivate();
}
}
@@ -1839,7 +1838,7 @@ IMPL_LINK( Window, ImplAsyncFocusHdl, void*, EMPTYARG )
static void ImplHandleGetFocus( Window* pWindow )
{
- pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus = TRUE;
+ pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus = sal_True;
// Focus-Events zeitverzoegert ausfuehren, damit bei SystemChildFenstern
// nicht alles flackert, wenn diese den Focus bekommen
@@ -1883,7 +1882,7 @@ static void ImplHandleLoseFocus( Window* pWindow )
pSVData->maWinData.mpFirstFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
}
- pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus = FALSE;
+ pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus = sal_False;
// Focus-Events zeitverzoegert ausfuehren, damit bei SystemChildFenstern
// nicht alles flackert, wenn diese den Focus bekommen
@@ -2004,9 +2003,9 @@ static void ImplHandleUserEvent( ImplSVEvent* pSVEvent )
// =======================================================================
-static USHORT ImplGetMouseMoveMode( SalMouseEvent* pEvent )
+static sal_uInt16 ImplGetMouseMoveMode( SalMouseEvent* pEvent )
{
- USHORT nMode = 0;
+ sal_uInt16 nMode = 0;
if ( !pEvent->mnCode )
nMode |= MOUSE_SIMPLEMOVE;
if ( (pEvent->mnCode & MOUSE_LEFT) && !(pEvent->mnCode & KEY_MOD1) )
@@ -2018,9 +2017,9 @@ static USHORT ImplGetMouseMoveMode( SalMouseEvent* pEvent )
// -----------------------------------------------------------------------
-static USHORT ImplGetMouseButtonMode( SalMouseEvent* pEvent )
+static sal_uInt16 ImplGetMouseButtonMode( SalMouseEvent* pEvent )
{
- USHORT nMode = 0;
+ sal_uInt16 nMode = 0;
if ( pEvent->mnButton == MOUSE_LEFT )
nMode |= MOUSE_SIMPLECLICK;
if ( (pEvent->mnButton == MOUSE_LEFT) && !(pEvent->mnCode & (MOUSE_MIDDLE | MOUSE_RIGHT)) )
@@ -2038,7 +2037,7 @@ static USHORT ImplGetMouseButtonMode( SalMouseEvent* pEvent )
inline long ImplHandleSalMouseLeave( Window* pWindow, SalMouseEvent* pEvent )
{
- return ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, TRUE,
+ return ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, sal_True,
pEvent->mnX, pEvent->mnY,
pEvent->mnTime, pEvent->mnCode,
ImplGetMouseMoveMode( pEvent ) );
@@ -2048,7 +2047,7 @@ inline long ImplHandleSalMouseLeave( Window* pWindow, SalMouseEvent* pEvent )
inline long ImplHandleSalMouseMove( Window* pWindow, SalMouseEvent* pEvent )
{
- return ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, FALSE,
+ return ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, sal_False,
pEvent->mnX, pEvent->mnY,
pEvent->mnTime, pEvent->mnCode,
ImplGetMouseMoveMode( pEvent ) );
@@ -2058,7 +2057,7 @@ inline long ImplHandleSalMouseMove( Window* pWindow, SalMouseEvent* pEvent )
inline long ImplHandleSalMouseButtonDown( Window* pWindow, SalMouseEvent* pEvent )
{
- return ImplHandleMouseEvent( pWindow, EVENT_MOUSEBUTTONDOWN, FALSE,
+ return ImplHandleMouseEvent( pWindow, EVENT_MOUSEBUTTONDOWN, sal_False,
pEvent->mnX, pEvent->mnY,
pEvent->mnTime,
#ifdef MACOSX
@@ -2073,7 +2072,7 @@ inline long ImplHandleSalMouseButtonDown( Window* pWindow, SalMouseEvent* pEvent
inline long ImplHandleSalMouseButtonUp( Window* pWindow, SalMouseEvent* pEvent )
{
- return ImplHandleMouseEvent( pWindow, EVENT_MOUSEBUTTONUP, FALSE,
+ return ImplHandleMouseEvent( pWindow, EVENT_MOUSEBUTTONUP, sal_False,
pEvent->mnX, pEvent->mnY,
pEvent->mnTime,
#ifdef MACOSX
@@ -2088,12 +2087,12 @@ inline long ImplHandleSalMouseButtonUp( Window* pWindow, SalMouseEvent* pEvent )
static long ImplHandleSalMouseActivate( Window* /*pWindow*/, SalMouseActivateEvent* /*pEvent*/ )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-static long ImplHandleMenuEvent( Window* pWindow, SalMenuEvent* pEvent, USHORT nEvent )
+static long ImplHandleMenuEvent( Window* pWindow, SalMenuEvent* pEvent, sal_uInt16 nEvent )
{
// Find SystemWindow and its Menubar and let it dispatch the command
long nRet = 0;
@@ -2143,11 +2142,11 @@ static void ImplHandleSalKeyMod( Window* pWindow, SalKeyModEvent* pEvent )
if ( pTrackWin )
pWindow = pTrackWin;
#ifdef MACOSX
- USHORT nOldCode = pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD3);
+ sal_uInt16 nOldCode = pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD3);
#else
- USHORT nOldCode = pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2);
+ sal_uInt16 nOldCode = pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2);
#endif
- USHORT nNewCode = pEvent->mnCode;
+ sal_uInt16 nNewCode = pEvent->mnCode;
if ( nOldCode != nNewCode )
{
#ifdef MACOSX
@@ -2155,7 +2154,7 @@ static void ImplHandleSalKeyMod( Window* pWindow, SalKeyModEvent* pEvent )
#else
nNewCode |= pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & ~(KEY_SHIFT | KEY_MOD1 | KEY_MOD2);
#endif
- pWindow->ImplGetWindowImpl()->mpFrameWindow->ImplCallMouseMove( nNewCode, TRUE );
+ pWindow->ImplGetWindowImpl()->mpFrameWindow->ImplCallMouseMove( nNewCode, sal_True );
}
// #105224# send commandevent to allow special treatment of Ctrl-LeftShift/Ctrl-RightShift etc.
@@ -2187,7 +2186,7 @@ static void ImplHandleInputLanguageChange( Window* pWindow )
// -----------------------------------------------------------------------
-static void ImplHandleSalSettings( Window* pWindow, USHORT nEvent )
+static void ImplHandleSalSettings( Window* pWindow, sal_uInt16 nEvent )
{
// Application Notification werden nur fuer das erste Window ausgeloest
ImplSVData* pSVData = ImplGetSVData();
@@ -2207,7 +2206,7 @@ static void ImplHandleSalSettings( Window* pWindow, USHORT nEvent )
}
else
{
- USHORT nType;
+ sal_uInt16 nType;
switch ( nEvent )
{
case SALEVENT_VOLUMECHANGED:
@@ -2221,7 +2220,7 @@ static void ImplHandleSalSettings( Window* pWindow, USHORT nEvent )
nType = DATACHANGED_DISPLAY;
break;
case SALEVENT_FONTCHANGED:
- OutputDevice::ImplUpdateAllFontData( TRUE );
+ OutputDevice::ImplUpdateAllFontData( sal_True );
nType = DATACHANGED_FONTS;
break;
case SALEVENT_DATETIMECHANGED:
@@ -2271,7 +2270,7 @@ static void ImplHandleSalExtTextInputPos( Window* pWindow, SalExtTextInputPosEve
static long ImplHandleShowDialog( Window* pWindow, int nDialogId )
{
if( ! pWindow )
- return FALSE;
+ return sal_False;
if( pWindow->GetType() == WINDOW_BORDERWINDOW )
{
@@ -2335,8 +2334,8 @@ static void ImplHandleSalSurroundingTextRequest( Window *pWindow,
// -----------------------------------------------------------------------
static void ImplHandleSurroundingTextSelectionChange( Window *pWindow,
- ULONG nStart,
- ULONG nEnd )
+ sal_uLong nStart,
+ sal_uLong nEnd )
{
Window* pChild = ImplGetKeyInputWindow( pWindow );
if( pChild )
@@ -2358,7 +2357,7 @@ static void ImplHandleStartReconversion( Window *pWindow )
// -----------------------------------------------------------------------
long ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/,
- USHORT nEvent, const void* pEvent )
+ sal_uInt16 nEvent, const void* pEvent )
{
DBG_TESTSOLARMUTEX();
@@ -2433,28 +2432,28 @@ long ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/,
{
SalKeyEvent* pKeyEvt = (SalKeyEvent*)pEvent;
nRet = ImplHandleKey( pWindow, EVENT_KEYINPUT,
- pKeyEvt->mnCode, pKeyEvt->mnCharCode, pKeyEvt->mnRepeat, TRUE );
+ pKeyEvt->mnCode, pKeyEvt->mnCharCode, pKeyEvt->mnRepeat, sal_True );
}
break;
case SALEVENT_EXTERNALKEYINPUT:
{
KeyEvent* pKeyEvt = (KeyEvent*) pEvent;
nRet = ImplHandleKey( pWindow, EVENT_KEYINPUT,
- pKeyEvt->GetKeyCode().GetFullCode(), pKeyEvt->GetCharCode(), pKeyEvt->GetRepeat(), FALSE );
+ pKeyEvt->GetKeyCode().GetFullCode(), pKeyEvt->GetCharCode(), pKeyEvt->GetRepeat(), sal_False );
}
break;
case SALEVENT_KEYUP:
{
SalKeyEvent* pKeyEvt = (SalKeyEvent*)pEvent;
nRet = ImplHandleKey( pWindow, EVENT_KEYUP,
- pKeyEvt->mnCode, pKeyEvt->mnCharCode, pKeyEvt->mnRepeat, TRUE );
+ pKeyEvt->mnCode, pKeyEvt->mnCharCode, pKeyEvt->mnRepeat, sal_True );
}
break;
case SALEVENT_EXTERNALKEYUP:
{
KeyEvent* pKeyEvt = (KeyEvent*) pEvent;
nRet = ImplHandleKey( pWindow, EVENT_KEYUP,
- pKeyEvt->GetKeyCode().GetFullCode(), pKeyEvt->GetCharCode(), pKeyEvt->GetRepeat(), FALSE );
+ pKeyEvt->GetKeyCode().GetFullCode(), pKeyEvt->GetCharCode(), pKeyEvt->GetRepeat(), sal_False );
}
break;
case SALEVENT_KEYMODCHANGE:
@@ -2541,15 +2540,15 @@ long ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/,
{
// Message-Schleife beenden
Application::Quit();
- return FALSE;
+ return sal_False;
}
else
{
bInQueryExit = false;
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
case SALEVENT_SETTINGSCHANGED:
@@ -2605,7 +2604,7 @@ long ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/,
break;
#ifdef DBG_UTIL
default:
- OSL_TRACE( "ImplWindowFrameProc(): unknown event (%lu)", (ULONG)nEvent );
+ OSL_TRACE( "ImplWindowFrameProc(): unknown event (%lu)", (sal_uLong)nEvent );
break;
#endif
}
diff --git a/vcl/source/window/wpropset.cxx b/vcl/source/window/wpropset.cxx
new file mode 100644
index 000000000000..fcb0c560291e
--- /dev/null
+++ b/vcl/source/window/wpropset.cxx
@@ -0,0 +1,346 @@
+/*************************************************************************
+ *
+ * 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_vcl.hxx"
+
+#include "vcl/wpropset.hxx"
+#include "vcl/window.hxx"
+#include "vcl/vclevent.hxx"
+#include "vcl/svdata.hxx"
+
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/beans/PropertyAttribute.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/beans/XPropertyContainer.hpp"
+#include "com/sun/star/beans/XPropertyAccess.hpp"
+
+#include "cppuhelper/basemutex.hxx"
+#include "cppuhelper/compbase1.hxx"
+
+#include <map>
+
+using namespace vcl;
+using namespace com::sun::star;
+
+/*
+
+TODO:
+- release solarmutex during outside UNO calls
+- in ChildEventListener protect against reentry by using PostUserEvent
+
+*/
+
+class vcl::WindowPropertySetListener :
+ public cppu::BaseMutex,
+ public cppu::WeakComponentImplHelper1< com::sun::star::beans::XPropertyChangeListener >,
+ private boost::noncopyable
+{
+ WindowPropertySet* mpParent;
+ bool mbSuspended;
+public:
+ WindowPropertySetListener( WindowPropertySet* pParent )
+ : cppu::WeakComponentImplHelper1< com::sun::star::beans::XPropertyChangeListener >( m_aMutex )
+ , mpParent( pParent )
+ , mbSuspended( false )
+ {}
+
+ virtual ~WindowPropertySetListener()
+ {
+ }
+
+ using cppu::WeakComponentImplHelperBase::disposing;
+ virtual void SAL_CALL disposing( const lang::EventObject& ) throw()
+ {
+ }
+
+ virtual void SAL_CALL propertyChange( const beans::PropertyChangeEvent& i_rEvent ) throw()
+ {
+ if( ! mbSuspended )
+ mpParent->propertyChange( i_rEvent );
+ }
+
+ void suspend( bool i_bSuspended )
+ {
+ mbSuspended = i_bSuspended;
+ }
+};
+
+class vcl::WindowPropertySetData
+{
+public:
+
+ struct PropertyMapEntry
+ {
+ Window* mpWindow;
+ boost::shared_ptr<WindowArranger> mpLayout;
+ uno::Sequence< beans::PropertyValue > maSavedValues;
+
+ PropertyMapEntry( Window* i_pWindow = NULL,
+ const boost::shared_ptr<WindowArranger>& i_pLayout = boost::shared_ptr<WindowArranger>() )
+ : mpWindow( i_pWindow )
+ , mpLayout( i_pLayout )
+ {}
+
+ uno::Sequence< beans::PropertyValue > getProperties() const
+ {
+ if( mpWindow )
+ return mpWindow->getProperties();
+ else if( mpLayout.get() )
+ return mpLayout->getProperties();
+ return uno::Sequence< beans::PropertyValue >();
+ }
+
+ void setProperties( const uno::Sequence< beans::PropertyValue >& i_rProps ) const
+ {
+ if( mpWindow )
+ mpWindow->setProperties( i_rProps );
+ else if( mpLayout.get() )
+ mpLayout->setProperties( i_rProps );
+ }
+ };
+
+ Window* mpTopWindow;
+ bool mbOwner;
+ std::map< rtl::OUString, PropertyMapEntry > maProperties;
+ uno::Reference< beans::XPropertySet > mxPropSet;
+ uno::Reference< beans::XPropertyAccess > mxPropSetAccess;
+ uno::Reference< beans::XPropertyChangeListener > mxListener;
+ vcl::WindowPropertySetListener* mpListener;
+
+ WindowPropertySetData()
+ : mpTopWindow( NULL )
+ , mbOwner( false )
+ , mpListener( NULL )
+ {}
+
+ ~WindowPropertySetData()
+ {
+ // release layouters, possibly interface properties before destroying
+ // the involved parent to be on the safe side
+ maProperties.clear();
+ if( mbOwner )
+ delete mpTopWindow;
+ }
+};
+
+static rtl::OUString getIdentifiedPropertyName( const rtl::OUString& i_rIdentifier, const rtl::OUString& i_rName )
+{
+ rtl::OUStringBuffer aBuf( i_rIdentifier.getLength() + 1 + i_rName.getLength() );
+ aBuf.append( i_rIdentifier );
+ aBuf.append( sal_Unicode( '#' ) );
+ aBuf.append( i_rName );
+ return aBuf.makeStringAndClear();
+}
+
+static void spliceIdentifiedPropertyName( const rtl::OUString& i_rIdentifiedPropName,
+ rtl::OUString& o_rIdentifier,
+ rtl::OUString& o_rPropName )
+{
+ sal_Int32 nIndex = 0;
+ o_rIdentifier = i_rIdentifiedPropName.getToken( 0, sal_Unicode( '#' ), nIndex );
+ if( nIndex != -1 )
+ o_rPropName = i_rIdentifiedPropName.copy( nIndex );
+ else
+ o_rPropName = rtl::OUString();
+}
+
+WindowPropertySet::WindowPropertySet( Window* i_pTopWindow, bool i_bTakeOwnership )
+: mpImpl( new vcl::WindowPropertySetData )
+{
+ mpImpl->mpTopWindow = i_pTopWindow;
+ mpImpl->mbOwner = i_bTakeOwnership;
+
+ mpImpl->mpTopWindow->AddChildEventListener( LINK( this, WindowPropertySet, ChildEventListener ) );
+
+ mpImpl->mxPropSet = uno::Reference< beans::XPropertySet >(
+ ImplGetSVData()->maAppData.mxMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.beans.PropertyBag" ) ) ),
+ uno::UNO_QUERY );
+ OSL_ENSURE( mpImpl->mxPropSet.is(), "could not create instance of com.sun.star.beans.PropertyBag" );
+ mpImpl->mxPropSetAccess = uno::Reference< beans::XPropertyAccess >( mpImpl->mxPropSet, uno::UNO_QUERY );
+ OSL_ENSURE( mpImpl->mxPropSet.is(), "could not query XPropertyAccess interface" );
+ if( ! mpImpl->mxPropSetAccess.is() )
+ mpImpl->mxPropSet.clear();
+
+ addWindowToSet( i_pTopWindow );
+
+ setupProperties();
+
+ if( mpImpl->mxPropSet.is() )
+ {
+ mpImpl->mxListener.set( mpImpl->mpListener = new WindowPropertySetListener( this ) );
+ }
+}
+
+WindowPropertySet::~WindowPropertySet()
+{
+ mpImpl->mpTopWindow->RemoveChildEventListener( LINK( this, WindowPropertySet, ChildEventListener ) );
+
+ delete mpImpl;
+ mpImpl = NULL;
+}
+
+uno::Reference< beans::XPropertySet > WindowPropertySet::getPropertySet() const
+{
+ return mpImpl->mxPropSet;
+}
+
+void WindowPropertySet::addLayoutToSet( const boost::shared_ptr< WindowArranger >& i_pLayout )
+{
+ if( i_pLayout.get() )
+ {
+ if( i_pLayout->getIdentifier().getLength() )
+ {
+ WindowPropertySetData::PropertyMapEntry& rEntry = mpImpl->maProperties[ i_pLayout->getIdentifier() ];
+ OSL_ENSURE( rEntry.mpWindow == 0 && rEntry.mpLayout.get() == 0, "inserted layout has duplicate name" );
+ rEntry.mpWindow = NULL;
+ rEntry.mpLayout = i_pLayout;
+ rEntry.maSavedValues = i_pLayout->getProperties();
+ }
+ // insert child layouts
+ size_t nChildren = i_pLayout->countElements();
+ for( size_t i = 0; i < nChildren; i++ )
+ addLayoutToSet( i_pLayout->getChild( i ) );
+ }
+}
+
+void WindowPropertySet::addWindowToSet( Window* i_pWindow )
+{
+ if( i_pWindow->getIdentifier().getLength() ) // no name, no properties
+ {
+ WindowPropertySetData::PropertyMapEntry& rEntry = mpImpl->maProperties[ i_pWindow->getIdentifier() ];
+ OSL_ENSURE( rEntry.mpWindow == 0 && rEntry.mpLayout.get() == 0, "inserted window has duplicate name" );
+ rEntry.mpWindow = i_pWindow;
+ rEntry.mpLayout.reset();
+ rEntry.maSavedValues = i_pWindow->getProperties();
+ }
+ addLayoutToSet( i_pWindow->getLayout() );
+
+ Window* pWin = i_pWindow->GetWindow( WINDOW_FIRSTCHILD );
+ while( pWin )
+ {
+ addWindowToSet( pWin );
+ pWin = pWin->GetWindow( WINDOW_NEXT );
+ }
+}
+
+void WindowPropertySet::setupProperties()
+{
+ uno::Reference< beans::XPropertyContainer > xCont( mpImpl->mxPropSet, uno::UNO_QUERY );
+ OSL_ENSURE( xCont.is(), "could not get XPropertyContainer interface" );
+ if( ! xCont.is() )
+ return;
+
+ for( std::map< rtl::OUString, WindowPropertySetData::PropertyMapEntry >::iterator it
+ = mpImpl->maProperties.begin(); it != mpImpl->maProperties.end(); ++it )
+ {
+ uno::Sequence< beans::PropertyValue > aOutsideValues( it->second.maSavedValues );
+ beans::PropertyValue* pVal = aOutsideValues.getArray();
+ for( sal_Int32 i = 0; i < aOutsideValues.getLength(); i++ )
+ {
+ pVal[i].Name = getIdentifiedPropertyName( it->first, pVal[i].Name );
+ xCont->addProperty( pVal[i].Name,
+ beans::PropertyAttribute::BOUND | beans:: PropertyAttribute::CONSTRAINED,
+ pVal[i].Value
+ );
+ }
+ }
+}
+
+void WindowPropertySet::propertyChange( const beans::PropertyChangeEvent& i_rEvent )
+{
+ rtl::OUString aIdentifier, aProperty;
+ spliceIdentifiedPropertyName( i_rEvent.PropertyName, aIdentifier, aProperty );
+ std::map< rtl::OUString, WindowPropertySetData::PropertyMapEntry >::iterator it =
+ mpImpl->maProperties.find( aIdentifier );
+ if( it != mpImpl->maProperties.end() )
+ {
+ uno::Sequence< beans::PropertyValue > aSet( 1 );
+ aSet[0].Name = aProperty;
+ aSet[0].Value = i_rEvent.NewValue;
+ it->second.setProperties( aSet );
+ }
+}
+
+IMPL_LINK( vcl::WindowPropertySet, ChildEventListener, VclWindowEvent*, pEvent )
+{
+ // find window in our properties
+ std::map< rtl::OUString, WindowPropertySetData::PropertyMapEntry >::iterator it
+ = mpImpl->maProperties.find( pEvent->GetWindow()->getIdentifier() );
+ if( it != mpImpl->maProperties.end() ) // this is valid, some unnamed child may have sent an event
+ {
+ sal_uLong nId = pEvent->GetId();
+ // check if anything interesting happened
+ if(
+ // general windowy things
+ nId == VCLEVENT_WINDOW_SHOW ||
+ nId == VCLEVENT_WINDOW_HIDE ||
+ nId == VCLEVENT_WINDOW_ENABLED ||
+ nId == VCLEVENT_WINDOW_DISABLED ||
+ // button thingies
+ nId == VCLEVENT_BUTTON_CLICK ||
+ nId == VCLEVENT_PUSHBUTTON_TOGGLE ||
+ nId == VCLEVENT_RADIOBUTTON_TOGGLE ||
+ nId == VCLEVENT_CHECKBOX_TOGGLE ||
+ // listbox
+ nId == VCLEVENT_LISTBOX_SELECT ||
+ // edit
+ nId == VCLEVENT_EDIT_MODIFY
+ )
+ {
+ WindowPropertySetData::PropertyMapEntry& rEntry = it->second;
+ // collect changes
+ uno::Sequence< beans::PropertyValue > aNewProps( rEntry.getProperties() );
+ uno::Sequence< beans::PropertyValue > aNewPropsOut( aNewProps );
+
+ // translate to identified properties
+ beans::PropertyValue* pValues = aNewPropsOut.getArray();
+ for( sal_Int32 i = 0; i < aNewPropsOut.getLength(); i++ )
+ pValues[i].Name = getIdentifiedPropertyName( it->first, pValues[i].Name );
+
+ // broadcast changes
+ bool bWasVeto = false;
+ mpImpl->mpListener->suspend( true );
+ try
+ {
+ mpImpl->mxPropSetAccess->setPropertyValues( aNewPropsOut );
+ }
+ catch( beans::PropertyVetoException& )
+ {
+ bWasVeto = true;
+ }
+ mpImpl->mpListener->suspend( false );
+
+ if( ! bWasVeto ) // changes accepted ?
+ rEntry.maSavedValues = rEntry.getProperties();
+ else // no, reset
+ rEntry.setProperties( rEntry.maSavedValues );
+ }
+ }
+
+ return 0;
+}
diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx
index 72887ce0f577..38d78fbc9723 100644
--- a/vcl/source/window/wrkwin.cxx
+++ b/vcl/source/window/wrkwin.cxx
@@ -45,8 +45,8 @@
// =======================================================================
-#define WORKWIN_WINDOWSTATE_FULLSCREEN ((ULONG)0x00010000)
-#define WORKWIN_WINDOWSTATE_ALL ((ULONG)0x00FF0000)
+#define WORKWIN_WINDOWSTATE_FULLSCREEN ((sal_uLong)0x00010000)
+#define WORKWIN_WINDOWSTATE_ALL ((sal_uLong)0x00FF0000)
// =======================================================================
@@ -55,17 +55,17 @@ void WorkWindow::ImplInitWorkWindowData()
mnIcon = 0; // Should be removed in the next top level update - now in SystemWindow
mnPresentationFlags = 0;
- mbPresentationMode = FALSE;
- mbPresentationVisible = FALSE;
- mbPresentationFull = FALSE;
- mbFullScreenMode = FALSE;
+ mbPresentationMode = sal_False;
+ mbPresentationVisible = sal_False;
+ mbPresentationFull = sal_False;
+ mbFullScreenMode = sal_False;
}
// -----------------------------------------------------------------------
void WorkWindow::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData )
{
- USHORT nFrameStyle = BORDERWINDOW_STYLE_FRAME;
+ sal_uInt16 nFrameStyle = BORDERWINDOW_STYLE_FRAME;
if ( nStyle & WB_APP )
nFrameStyle |= BORDERWINDOW_STYLE_APP;
@@ -138,7 +138,7 @@ WorkWindow::WorkWindow( Window* pParent, const ::com::sun::star::uno::Any& aSyst
SystemWindow( WINDOW_WORKWINDOW )
{
ImplInitWorkWindowData();
- mbSysChild = TRUE;
+ mbSysChild = sal_True;
ImplInit( pParent, nStyle, aSystemWorkWindowToken );
}
@@ -148,7 +148,7 @@ WorkWindow::WorkWindow( SystemParentData* pParent ) :
SystemWindow( WINDOW_WORKWINDOW )
{
ImplInitWorkWindowData();
- mbSysChild = TRUE;
+ mbSysChild = sal_True;
ImplInit( NULL, 0, pParent );
}
@@ -177,7 +177,7 @@ WorkWindow::~WorkWindow()
// -----------------------------------------------------------------------
-void WorkWindow::ShowFullScreenMode( BOOL bFullScreenMode, sal_Int32 nDisplay )
+void WorkWindow::ShowFullScreenMode( sal_Bool bFullScreenMode, sal_Int32 nDisplay )
{
if ( !mbFullScreenMode == !bFullScreenMode )
return;
@@ -203,34 +203,34 @@ void WorkWindow::ShowFullScreenMode( BOOL bFullScreenMode, sal_Int32 nDisplay )
xCanvasComponent->dispose();
}
- mpWindowImpl->mpFrameWindow->mpWindowImpl->mbWaitSystemResize = TRUE;
+ mpWindowImpl->mpFrameWindow->mpWindowImpl->mbWaitSystemResize = sal_True;
ImplGetFrame()->ShowFullScreen( bFullScreenMode, nDisplay );
}
}
// -----------------------------------------------------------------------
-void WorkWindow::StartPresentationMode( BOOL bPresentation, USHORT nFlags, sal_Int32 nDisplay )
+void WorkWindow::StartPresentationMode( sal_Bool bPresentation, sal_uInt16 nFlags, sal_Int32 nDisplay )
{
if ( !bPresentation == !mbPresentationMode )
return;
if ( bPresentation )
{
- mbPresentationMode = TRUE;
+ mbPresentationMode = sal_True;
mbPresentationVisible = IsVisible();
mbPresentationFull = mbFullScreenMode;
mnPresentationFlags = nFlags;
if ( !(mnPresentationFlags & PRESENTATION_NOFULLSCREEN) )
- ShowFullScreenMode( TRUE, nDisplay );
+ ShowFullScreenMode( sal_True, nDisplay );
if ( !mbSysChild )
{
if ( mnPresentationFlags & PRESENTATION_HIDEALLAPPS )
- mpWindowImpl->mpFrame->SetAlwaysOnTop( TRUE );
+ mpWindowImpl->mpFrame->SetAlwaysOnTop( sal_True );
if ( !(mnPresentationFlags & PRESENTATION_NOAUTOSHOW) )
ToTop();
- mpWindowImpl->mpFrame->StartPresentation( TRUE );
+ mpWindowImpl->mpFrame->StartPresentation( sal_True );
}
if ( !(mnPresentationFlags & PRESENTATION_NOAUTOSHOW) )
@@ -241,22 +241,22 @@ void WorkWindow::StartPresentationMode( BOOL bPresentation, USHORT nFlags, sal_I
Show( mbPresentationVisible );
if ( !mbSysChild )
{
- mpWindowImpl->mpFrame->StartPresentation( FALSE );
+ mpWindowImpl->mpFrame->StartPresentation( sal_False );
if ( mnPresentationFlags & PRESENTATION_HIDEALLAPPS )
- mpWindowImpl->mpFrame->SetAlwaysOnTop( FALSE );
+ mpWindowImpl->mpFrame->SetAlwaysOnTop( sal_False );
}
ShowFullScreenMode( mbPresentationFull, nDisplay );
- mbPresentationMode = FALSE;
- mbPresentationVisible = FALSE;
- mbPresentationFull = FALSE;
+ mbPresentationMode = sal_False;
+ mbPresentationVisible = sal_False;
+ mbPresentationFull = sal_False;
mnPresentationFlags = 0;
}
}
// -----------------------------------------------------------------------
-BOOL WorkWindow::IsMinimized() const
+sal_Bool WorkWindow::IsMinimized() const
{
//return mpWindowImpl->mpFrameData->mbMinimized;
SalFrameState aState;
@@ -266,15 +266,15 @@ BOOL WorkWindow::IsMinimized() const
// -----------------------------------------------------------------------
-BOOL WorkWindow::SetPluginParent( SystemParentData* pParent )
+sal_Bool WorkWindow::SetPluginParent( SystemParentData* pParent )
{
DBG_ASSERT( ! mbPresentationMode && ! mbFullScreenMode, "SetPluginParent in fullscreen or presentation mode !" );
bool bWasDnd = Window::ImplStopDnd();
- BOOL bShown = IsVisible();
- Show( FALSE );
- BOOL bRet = mpWindowImpl->mpFrame->SetPluginParent( pParent );
+ sal_Bool bShown = IsVisible();
+ Show( sal_False );
+ sal_Bool bRet = mpWindowImpl->mpFrame->SetPluginParent( pParent );
Show( bShown );
if( bWasDnd )
@@ -283,7 +283,7 @@ BOOL WorkWindow::SetPluginParent( SystemParentData* pParent )
return bRet;
}
-void WorkWindow::ImplSetFrameState( ULONG aFrameState )
+void WorkWindow::ImplSetFrameState( sal_uLong aFrameState )
{
SalFrameState aState;
aState.mnMask = SAL_FRAMESTATE_MASK_STATE;
@@ -302,9 +302,9 @@ void WorkWindow::Restore()
ImplSetFrameState( SAL_FRAMESTATE_NORMAL );
}
-BOOL WorkWindow::Close()
+sal_Bool WorkWindow::Close()
{
- BOOL bCanClose = SystemWindow::Close();
+ sal_Bool bCanClose = SystemWindow::Close();
// Ist es das Applikationsfenster, dann beende die Applikation
if ( bCanClose && ( ImplGetSVData()->maWinData.mpAppWin == this ) )
@@ -313,14 +313,14 @@ BOOL WorkWindow::Close()
return bCanClose;
}
-void WorkWindow::Maximize( BOOL bMaximize )
+void WorkWindow::Maximize( sal_Bool bMaximize )
{
ImplSetFrameState( bMaximize ? SAL_FRAMESTATE_MAXIMIZED : SAL_FRAMESTATE_NORMAL );
}
-BOOL WorkWindow::IsMaximized() const
+sal_Bool WorkWindow::IsMaximized() const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
SalFrameState aState;
if( mpWindowImpl->mpFrame->GetWindowState( &aState ) )
@@ -328,7 +328,7 @@ BOOL WorkWindow::IsMaximized() const
if( aState.mnState & (SAL_FRAMESTATE_MAXIMIZED |
SAL_FRAMESTATE_MAXIMIZED_HORZ |
SAL_FRAMESTATE_MAXIMIZED_VERT ) )
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
}
diff --git a/vcl/test/canvasbitmaptest.cxx b/vcl/test/canvasbitmaptest.cxx
index 94807c051e59..3763fb5b9d02 100644
--- a/vcl/test/canvasbitmaptest.cxx
+++ b/vcl/test/canvasbitmaptest.cxx
@@ -115,7 +115,7 @@ class TestApp : public Application
{
public:
virtual void Main();
- virtual USHORT Exception( USHORT nError );
+ virtual sal_uInt16 Exception( sal_uInt16 nError );
};
class TestWindow : public Dialog
diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx
index d748998df102..57380897c71e 100644
--- a/vcl/unx/gtk/a11y/atkutil.cxx
+++ b/vcl/unx/gtk/a11y/atkutil.cxx
@@ -572,7 +572,7 @@ static void handle_menu_highlighted(::VclMenuEvent const * pEvent)
try
{
Menu* pMenu = pEvent->GetMenu();
- USHORT nPos = pEvent->GetItemPos();
+ sal_uInt16 nPos = pEvent->GetItemPos();
if( pMenu && nPos != 0xFFFF)
{
diff --git a/vcl/unx/gtk/a11y/atkwindow.cxx b/vcl/unx/gtk/a11y/atkwindow.cxx
index c265f79585e8..1b84026dd281 100644
--- a/vcl/unx/gtk/a11y/atkwindow.cxx
+++ b/vcl/unx/gtk/a11y/atkwindow.cxx
@@ -79,7 +79,7 @@ init_from_window( AtkObject *accessible, Window *pWindow )
*/
case AccessibleRole::WINDOW:
{
- USHORT type = WINDOW_WINDOW;
+ sal_uInt16 type = WINDOW_WINDOW;
bool parentIsMenuFloatingWindow = false;
Window *pParent = pWindow->GetParent();
diff --git a/vcl/unx/gtk/a11y/makefile.mk b/vcl/unx/gtk/a11y/makefile.mk
index 14d3014ddf11..30c6d5e7cfb3 100644
--- a/vcl/unx/gtk/a11y/makefile.mk
+++ b/vcl/unx/gtk/a11y/makefile.mk
@@ -31,10 +31,6 @@ PRJNAME=vcl
TARGET=gtka11y
ENABLE_EXCEPTIONS=TRUE
-# workaround for makedepend hang
-MKDEPENDSOLVER=
-NO_DEFAULT_STL=YES
-
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index da042c00bdfc..bd038cc55966 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -246,14 +246,15 @@ extern "C"
int GtkSalDisplay::GetDefaultMonitorNumber() const
{
+ int n = 0;
GdkScreen* pScreen = gdk_display_get_screen( m_pGdkDisplay, m_nDefaultScreen );
#if GTK_CHECK_VERSION(2,20,0)
- return m_aXineramaScreenIndexMap[gdk_screen_get_primary_monitor(pScreen)];
+ n = gdk_screen_get_primary_monitor(pScreen);
#else
static screen_get_primary_monitor sym_gdk_screen_get_primary_monitor =
(screen_get_primary_monitor)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_screen_get_primary_monitor" );
if (sym_gdk_screen_get_primary_monitor)
- return m_aXineramaScreenIndexMap[sym_gdk_screen_get_primary_monitor(pScreen)];
+ n = sym_gdk_screen_get_primary_monitor( pScreen );
#if GTK_CHECK_VERSION(2,14,0)
//gdk_screen_get_primary_monitor unavailable, take the first laptop monitor
//as the default
@@ -266,6 +267,9 @@ int GtkSalDisplay::GetDefaultMonitorNumber() const
#endif
return 0;
#endif
+ if( n >= 0 && size_t(n) < m_aXineramaScreenIndexMap.size() )
+ n = m_aXineramaScreenIndexMap[n];
+ return n;
}
void GtkSalDisplay::initScreen( int nScreen ) const
@@ -539,7 +543,7 @@ public:
YieldFunc handle );
virtual void Remove( int fd );
- virtual void StartTimer( ULONG nMS );
+ virtual void StartTimer( sal_uLong nMS );
virtual void StopTimer();
virtual void Wakeup();
virtual void PostUserEvent();
@@ -739,7 +743,7 @@ gboolean GtkXLib::timeoutFn(gpointer data)
return FALSE;
}
-void GtkXLib::StartTimer( ULONG nMS )
+void GtkXLib::StartTimer( sal_uLong nMS )
{
m_nTimeoutMS = nMS; // for restarting
diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx
index 159820ec3dbd..abaf97c2a00f 100644
--- a/vcl/unx/gtk/app/gtkinst.cxx
+++ b/vcl/unx/gtk/app/gtkinst.cxx
@@ -40,6 +40,8 @@
#include <rtl/strbuf.hxx>
+#include <rtl/uri.hxx>
+
#if OSL_DEBUG_LEVEL > 1
#include <stdio.h>
#endif
@@ -64,7 +66,7 @@ void GtkHookedYieldMutex::ThreadsEnter()
acquire();
if( !aYieldStack.empty() )
{ /* Previously called ThreadsLeave() */
- ULONG nCount = aYieldStack.front();
+ sal_uLong nCount = aYieldStack.front();
aYieldStack.pop_front();
while( nCount-- > 1 )
acquire();
@@ -187,19 +189,19 @@ GtkInstance::~GtkInstance()
DeInitAtkBridge();
}
-SalFrame* GtkInstance::CreateFrame( SalFrame* pParent, ULONG nStyle )
+SalFrame* GtkInstance::CreateFrame( SalFrame* pParent, sal_uLong nStyle )
{
return new GtkSalFrame( pParent, nStyle );
}
-SalFrame* GtkInstance::CreateChildFrame( SystemParentData* pParentData, ULONG )
+SalFrame* GtkInstance::CreateChildFrame( SystemParentData* pParentData, sal_uLong )
{
SalFrame* pFrame = new GtkSalFrame( pParentData );
return pFrame;
}
-SalObject* GtkInstance::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow )
+SalObject* GtkInstance::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow )
{
// there is no method to set a visual for a GtkWidget
// so we need the X11SalObject in that case
@@ -217,9 +219,25 @@ extern "C"
void GtkInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType)
{
+ rtl::OString sGtkURL;
+ rtl_TextEncoding aSystemEnc = osl_getThreadTextEncoding();
+ if ((aSystemEnc == RTL_TEXTENCODING_UTF8) || (rFileUrl.compareToAscii( "file://", 7 ) != 0))
+ sGtkURL = rtl::OUStringToOString(rFileUrl, RTL_TEXTENCODING_UTF8);
+ else
+ {
+ //Non-utf8 locales are a bad idea if trying to work with non-ascii filenames
+ //Decode %XX components
+ rtl::OUString sDecodedUri = rtl::Uri::decode(rFileUrl.copy(7), rtl_UriDecodeToIuri, RTL_TEXTENCODING_UTF8);
+ //Convert back to system locale encoding
+ rtl::OString sSystemUrl = rtl::OUStringToOString(sDecodedUri, aSystemEnc);
+ //Encode to an escaped ASCII-encoded URI
+ gchar *g_uri = g_filename_to_uri(sSystemUrl.getStr(), NULL, NULL);
+ sGtkURL = rtl::OString(g_uri);
+ g_free(g_uri);
+ }
#if GTK_CHECK_VERSION(2,10,0)
GtkRecentManager *manager = gtk_recent_manager_get_default ();
- gtk_recent_manager_add_item (manager, rtl::OUStringToOString(rFileUrl, RTL_TEXTENCODING_UTF8).getStr());
+ gtk_recent_manager_add_item (manager, sGtkURL);
(void)rMimeType;
#else
static getDefaultFnc sym_gtk_recent_manager_get_default =
@@ -228,10 +246,7 @@ void GtkInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const r
static addItemFnc sym_gtk_recent_manager_add_item =
(addItemFnc)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gtk_recent_manager_add_item");
if (sym_gtk_recent_manager_get_default && sym_gtk_recent_manager_add_item)
- {
- sym_gtk_recent_manager_add_item(sym_gtk_recent_manager_get_default(),
- rtl::OUStringToOString(rFileUrl, RTL_TEXTENCODING_UTF8).getStr());
- }
+ sym_gtk_recent_manager_add_item(sym_gtk_recent_manager_get_default(), sGtkURL);
else
X11SalInstance::AddToRecentDocumentList(rFileUrl, rMimeType);
#endif
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index bb3e878abe06..553ec6c85e0f 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -49,11 +49,11 @@
typedef struct _cairo_font_options cairo_font_options_t;
// initialize statics
-BOOL GtkSalGraphics::bThemeChanged = TRUE;
-BOOL GtkSalGraphics::bNeedPixmapPaint = FALSE;
-BOOL GtkSalGraphics::bGlobalNeedPixmapPaint = FALSE;
-BOOL GtkSalGraphics::bToolbarGripWorkaround = FALSE;
-BOOL GtkSalGraphics::bNeedButtonStyleAsEditBackgroundWorkaround = FALSE;
+sal_Bool GtkSalGraphics::bThemeChanged = sal_True;
+sal_Bool GtkSalGraphics::bNeedPixmapPaint = sal_False;
+sal_Bool GtkSalGraphics::bGlobalNeedPixmapPaint = sal_False;
+sal_Bool GtkSalGraphics::bToolbarGripWorkaround = sal_False;
+sal_Bool GtkSalGraphics::bNeedButtonStyleAsEditBackgroundWorkaround = sal_False;
GtkSalGraphics::~GtkSalGraphics()
{
@@ -271,7 +271,7 @@ public:
{ delete [] pData; m_idx = 0; m_size = n; pData = new NWPixmapCacheData[m_size]; }
int GetSize() const { return m_size; }
- BOOL Find( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap** pPixmap );
+ sal_Bool Find( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap** pPixmap );
void Fill( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap* pPixmap );
void ThemeChanged();
@@ -324,7 +324,7 @@ void NWPixmapCache::ThemeChanged()
pData[i].SetPixmap( NULL );
}
-BOOL NWPixmapCache::Find( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap** pPixmap )
+sal_Bool NWPixmapCache::Find( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap** pPixmap )
{
aState &= ~CTRL_CACHING_ALLOWED; // mask clipping flag
int i;
@@ -337,10 +337,10 @@ BOOL NWPixmapCache::Find( ControlType aType, ControlState aState, const Rectang
pData[i].m_pixmap != NULL )
{
*pPixmap = pData[i].m_pixmap;
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
void NWPixmapCache::Fill( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap* pPixmap )
@@ -485,30 +485,13 @@ void GtkSalGraphics::ResetClipRegion()
X11SalGraphics::ResetClipRegion();
}
-void GtkSalGraphics::BeginSetClipRegion( ULONG nCount )
-{
- m_aClipRegion.SetNull();
- X11SalGraphics::BeginSetClipRegion( nCount );
-}
-
-BOOL GtkSalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeight )
-{
- Rectangle aRect( Point( nX, nY ), Size( nWidth, nHeight ) );
- m_aClipRegion.Union( aRect );
- return X11SalGraphics::unionClipRegion( nX, nY, nWidth, nHeight );
-}
-
-bool GtkSalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- // TODO: implement and advertise OutDevSupport_B2DClip support
- return false;
-}
-
-void GtkSalGraphics::EndSetClipRegion()
+bool GtkSalGraphics::setClipRegion( const Region& i_rClip )
{
+ m_aClipRegion = i_rClip;
+ bool bRet = X11SalGraphics::setClipRegion( m_aClipRegion );
if( m_aClipRegion.IsEmpty() )
m_aClipRegion.SetNull();
- X11SalGraphics::EndSetClipRegion();
+ return bRet;
}
void GtkSalGraphics::copyBits( const SalTwoRect* pPosAry,
@@ -539,10 +522,10 @@ void GtkSalGraphics::copyBits( const SalTwoRect* pPosAry,
/*
* IsNativeControlSupported()
*
- * Returns TRUE if the platform supports native
+ * Returns sal_True if the platform supports native
* drawing of the control defined by nPart
*/
-BOOL GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
+sal_Bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
{
if (
((nType==CTRL_PUSHBUTTON) && (nPart==PART_ENTIRE_CONTROL)) ||
@@ -613,25 +596,25 @@ BOOL GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
)
)
)
- return( TRUE );
- return( FALSE );
+ return( sal_True );
+ return( sal_False );
}
/*
* HitTestNativeControl()
*
- * bIsInside is set to TRUE if aPos is contained within the
+ * bIsInside is set to sal_True if aPos is contained within the
* given part of the control, whose bounding region is
* given by rControlRegion (in VCL frame coordinates).
*
* returns whether bIsInside was really set.
*/
-BOOL GtkSalGraphics::hitTestNativeControl( ControlType nType,
+sal_Bool GtkSalGraphics::hitTestNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
const Point& aPos,
- BOOL& rIsInside )
+ sal_Bool& rIsInside )
{
if ( ( nType == CTRL_SCROLLBAR ) &&
( ( nPart == PART_BUTTON_UP ) ||
@@ -654,7 +637,7 @@ BOOL GtkSalGraphics::hitTestNativeControl( ControlType nType,
Rectangle aForward;
Rectangle aBackward;
- rIsInside = FALSE;
+ rIsInside = sal_False;
ControlPart nCounterPart = 0;
if ( nPart == PART_BUTTON_UP )
@@ -713,17 +696,17 @@ BOOL GtkSalGraphics::hitTestNativeControl( ControlType nType,
if ( has_forward2 )
rIsInside |= aForward.IsInside( aPos );
}
- return ( TRUE );
+ return ( sal_True );
}
if( IsNativeControlSupported(nType, nPart) )
{
rIsInside = rControlRegion.IsInside( aPos );
- return( TRUE );
+ return( sal_True );
}
else
{
- return( FALSE );
+ return( sal_False );
}
}
@@ -737,22 +720,16 @@ BOOL GtkSalGraphics::hitTestNativeControl( ControlType nType,
* aValue: An optional value (tristate/numerical/string)
* rCaption: A caption or title string (like button text etc)
*/
-BOOL GtkSalGraphics::drawNativeControl( ControlType nType,
+sal_Bool GtkSalGraphics::drawNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
const OUString& rCaption )
{
- if( (nType==CTRL_CHECKBOX) && (nPart==PART_ENTIRE_CONTROL) &&
- aValue.getTristateVal() == BUTTONVALUE_MIXED )
- {
- return drawNativeMixedStateCheck( nType, nPart, rControlRegion, nState, aValue, rCaption );
- }
-
- BOOL returnVal = FALSE;
+ sal_Bool returnVal = sal_False;
// get a GC with current clipping region set
- SelectFont();
+ GetFontGC();
// theme changed ?
@@ -762,7 +739,7 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType,
for( unsigned int i = 0; i < gWidgetData.size(); i++ )
if( gWidgetData[i].gNWPixmapCacheList )
gWidgetData[i].gNWPixmapCacheList->ThemeChanged();
- GtkSalGraphics::bThemeChanged = FALSE;
+ GtkSalGraphics::bThemeChanged = sal_False;
}
Rectangle aCtrlRect( rControlRegion );
@@ -789,7 +766,7 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType,
Size( aCtrlRect.GetWidth()+2, aCtrlRect.GetHeight()+2) );
pixmap = NWGetPixmapFromScreen( aPixmapRect );
if( ! pixmap )
- return FALSE;
+ return sal_False;
gdkDrawable = GDK_DRAWABLE( pixmap );
aCtrlRect = Rectangle( Point(1,1), aCtrlRect.GetSize() );
aClip.push_back( aCtrlRect );
@@ -850,7 +827,7 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType,
else if ( (nType==CTRL_TAB_ITEM) || (nType==CTRL_TAB_PANE) || (nType==CTRL_TAB_BODY) || (nType==CTRL_FIXEDBORDER) )
{
if ( nType == CTRL_TAB_BODY )
- returnVal = TRUE;
+ returnVal = sal_True;
else
returnVal = NWPaintGTKTabItem( nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption);
}
@@ -907,61 +884,6 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType,
return( returnVal );
}
-BOOL GtkSalGraphics::drawNativeMixedStateCheck( ControlType nType,
- ControlPart nPart,
- const Rectangle& rControlRegion,
- ControlState nState,
- const ImplControlValue& aValue,
- const OUString& rCaption )
-{
- // need to emulate something for mixed state
-
- // do this via pixmap since some themes don't care for regions
- bool bOldNeedPixmapPaint = bNeedPixmapPaint;
- bNeedPixmapPaint = true;
-
- Rectangle aCtrlRect = rControlRegion;
- BOOL returnVal = FALSE;
- SelectFont();
-
- // draw upper half in off state
- const_cast<ImplControlValue&>(aValue).setTristateVal( BUTTONVALUE_OFF );
- XLIB_Region aRegion = XCreateRegion();
- XRectangle aXRect =
- {
- static_cast<short>(aCtrlRect.Left()),
- static_cast<short>(aCtrlRect.Top()),
- static_cast<unsigned short>(aCtrlRect.GetWidth()),
- static_cast<unsigned short>(aCtrlRect.GetHeight())
- };
- const unsigned short nH = aXRect.height/2;
- aXRect.height -= nH;
- XUnionRectWithRegion( &aXRect, aRegion, aRegion );
- SetClipRegion( pFontGC_, aRegion );
- XDestroyRegion( aRegion );
-
- returnVal = drawNativeControl( nType, nPart, rControlRegion, nState, aValue, rCaption );
-
- if( returnVal )
- {
- // draw lower half in on state
- const_cast<ImplControlValue&>(aValue).setTristateVal( BUTTONVALUE_ON );
- aXRect.y += nH;
- aRegion = XCreateRegion();
- XUnionRectWithRegion( &aXRect, aRegion, aRegion );
- SetClipRegion( pFontGC_, aRegion );
- XDestroyRegion( aRegion );
- returnVal = drawNativeControl( nType, nPart, rControlRegion, nState, aValue, rCaption );
- }
-
- // clean up
- bNeedPixmapPaint = bOldNeedPixmapPaint;
- const_cast<ImplControlValue&>(aValue).setTristateVal( BUTTONVALUE_MIXED );
- SetClipRegion( pFontGC_ );
- return returnVal;
-}
-
-
/*
* DrawNativeControlText()
*
@@ -972,22 +894,22 @@ BOOL GtkSalGraphics::drawNativeMixedStateCheck( ControlType nType,
* aValue: An optional value (tristate/numerical/string)
* rCaption: A caption or title string (like button text etc)
*/
-BOOL GtkSalGraphics::drawNativeControlText( ControlType,
+sal_Bool GtkSalGraphics::drawNativeControlText( ControlType,
ControlPart,
const Rectangle&,
ControlState,
const ImplControlValue&,
const OUString& )
{
- return( FALSE );
+ return( sal_False );
}
/*
* GetNativeControlRegion()
*
- * If the return value is TRUE, rNativeBoundingRegion
- * contains the TRUE bounding region covered by the control
+ * If the return value is sal_True, rNativeBoundingRegion
+ * contains the true bounding region covered by the control
* including any adornment, while rNativeContentRegion contains the area
* within the control that can be safely drawn into without drawing over
* the borders of the control.
@@ -996,7 +918,7 @@ BOOL GtkSalGraphics::drawNativeControlText( ControlType,
* aValue: An optional value (tristate/numerical/string)
* rCaption: A caption or title string (like button text etc)
*/
-BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
+sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -1005,7 +927,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
Rectangle &rNativeBoundingRegion,
Rectangle &rNativeContentRegion )
{
- BOOL returnVal = FALSE;
+ sal_Bool returnVal = sal_False;
if ( (nType==CTRL_PUSHBUTTON) && (nPart==PART_ENTIRE_CONTROL)
&& (rControlRegion.GetWidth() > 16)
@@ -1015,7 +937,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
nState, aValue, rCaption );
rNativeContentRegion = rControlRegion;
- returnVal = TRUE;
+ returnVal = sal_True;
}
if ( (nType==CTRL_COMBOBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) )
{
@@ -1023,7 +945,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
aValue, rCaption );
rNativeContentRegion = rNativeBoundingRegion;
- returnVal = TRUE;
+ returnVal = sal_True;
}
if ( (nType==CTRL_SPINBOX) && ((nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) )
{
@@ -1032,7 +954,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
aValue, rCaption );
rNativeContentRegion = rNativeBoundingRegion;
- returnVal = TRUE;
+ returnVal = sal_True;
}
if ( (nType==CTRL_LISTBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) )
{
@@ -1040,7 +962,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
aValue, rCaption );
rNativeContentRegion = rNativeBoundingRegion;
- returnVal = TRUE;
+ returnVal = sal_True;
}
if ( (nType==CTRL_TOOLBAR) &&
((nPart==PART_DRAW_BACKGROUND_HORZ) ||
@@ -1052,7 +974,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
{
rNativeBoundingRegion = NWGetToolbarRect( m_nScreen, nType, nPart, rControlRegion, nState, aValue, rCaption );
rNativeContentRegion = rNativeBoundingRegion;
- returnVal = TRUE;
+ returnVal = sal_True;
}
if ( (nType==CTRL_SCROLLBAR) && ((nPart==PART_BUTTON_LEFT) || (nPart==PART_BUTTON_RIGHT) ||
(nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN) ) )
@@ -1066,7 +988,6 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
if (!rNativeContentRegion.GetHeight())
rNativeContentRegion.Bottom() = rNativeContentRegion.Top() + 1;
- returnVal = TRUE;
}
if( (nType == CTRL_MENUBAR) && (nPart == PART_ENTIRE_CONTROL) )
{
@@ -1078,7 +999,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
Size( aMenuBarRect.GetWidth(), aReq.height+1 ) );
rNativeBoundingRegion = aMenuBarRect;
rNativeContentRegion = rNativeBoundingRegion;
- returnVal = TRUE;
+ returnVal = sal_True;
}
if( (nType == CTRL_MENU_POPUP) )
{
@@ -1098,7 +1019,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
(rControlRegion.GetHeight()-indicator_size)/2),
Size( indicator_size, indicator_size ) );
rNativeContentRegion = aIndicatorRect;
- returnVal = TRUE;
+ returnVal = sal_True;
}
}
if( (nType == CTRL_RADIOBUTTON || nType == CTRL_CHECKBOX) )
@@ -1117,7 +1038,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
(rControlRegion.GetHeight()-indicator_size)/2),
Size( indicator_size, indicator_size ) );
rNativeContentRegion = aIndicatorRect;
- returnVal = TRUE;
+ returnVal = sal_True;
}
if( (nType == CTRL_EDITBOX || nType == CTRL_SPINBOX) && nPart == PART_ENTIRE_CONTROL )
{
@@ -1131,7 +1052,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
Size( aEditRect.GetWidth(), nHeight ) );
rNativeBoundingRegion = aEditRect;
rNativeContentRegion = rNativeBoundingRegion;
- returnVal = TRUE;
+ returnVal = sal_True;
}
if( (nType == CTRL_SLIDER) && (nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT) )
{
@@ -1155,7 +1076,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
aRect.Right() = aRect.Left() + slider_width - 1;
}
rNativeBoundingRegion = rNativeContentRegion = aRect;
- returnVal = TRUE;
+ returnVal = sal_True;
}
return( returnVal );
@@ -1165,7 +1086,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
/************************************************************************
* Individual control drawing functions
************************************************************************/
-BOOL GtkSalGraphics::NWPaintGTKButton(
+sal_Bool GtkSalGraphics::NWPaintGTKButton(
GdkDrawable* gdkDrawable,
ControlType, ControlPart,
const Rectangle& rControlRectangle,
@@ -1178,7 +1099,7 @@ BOOL GtkSalGraphics::NWPaintGTKButton(
gboolean interiorFocus;
gint focusWidth;
gint focusPad;
- BOOL bDrawFocus = TRUE;
+ sal_Bool bDrawFocus = sal_True;
gint x, y, w, h;
GtkBorder aDefBorder;
GtkBorder* pBorder;
@@ -1209,7 +1130,7 @@ BOOL GtkSalGraphics::NWPaintGTKButton(
// If the button is too small, don't ever draw focus or grab more space
if ( (w < 16) || (h < 16) )
- bDrawFocus = FALSE;
+ bDrawFocus = sal_False;
NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType );
@@ -1256,7 +1177,7 @@ BOOL GtkSalGraphics::NWPaintGTKButton(
}
}
- return( TRUE );
+ return( sal_True );
}
static Rectangle NWGetButtonArea( int nScreen,
@@ -1268,7 +1189,7 @@ static Rectangle NWGetButtonArea( int nScreen,
gint focusPad;
GtkBorder aDefBorder;
GtkBorder * pBorder;
- BOOL bDrawFocus = TRUE;
+ sal_Bool bDrawFocus = sal_True;
Rectangle aRect;
gint x, y, w, h;
@@ -1295,7 +1216,7 @@ static Rectangle NWGetButtonArea( int nScreen,
// If the button is too small, don't ever draw focus or grab more space
if ( (w < 16) || (h < 16) )
- bDrawFocus = FALSE;
+ bDrawFocus = sal_False;
if ( (nState & CTRL_STATE_DEFAULT) && bDrawFocus )
{
@@ -1312,7 +1233,7 @@ static Rectangle NWGetButtonArea( int nScreen,
//-------------------------------------
-BOOL GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable,
+sal_Bool GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable,
ControlType, ControlPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
@@ -1322,7 +1243,7 @@ BOOL GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable,
{
GtkStateType stateType;
GtkShadowType shadowType;
- BOOL isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON);
+ sal_Bool isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON);
gint x, y;
GdkRectangle clipRect;
@@ -1350,7 +1271,7 @@ BOOL GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable,
// intermediate states between active/inactive. Let's hope that
// GtkToggleButtone stays binary compatible.
if (!isChecked)
- GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gRadioWidgetSibling)->active = TRUE;
+ GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gRadioWidgetSibling)->active = sal_True;
GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gRadioWidget)->active = isChecked;
for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it )
@@ -1365,12 +1286,12 @@ BOOL GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable,
x, y, indicator_size, indicator_size );
}
- return( TRUE );
+ return( sal_True );
}
//-------------------------------------
-BOOL GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable,
+sal_Bool GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable,
ControlType, ControlPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
@@ -1380,7 +1301,8 @@ BOOL GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable,
{
GtkStateType stateType;
GtkShadowType shadowType;
- BOOL isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON) ? TRUE : FALSE;
+ bool isChecked = (aValue.getTristateVal() == BUTTONVALUE_ON);
+ bool isInconsistent = (aValue.getTristateVal() == BUTTONVALUE_MIXED);
GdkRectangle clipRect;
gint x,y;
@@ -1395,7 +1317,7 @@ BOOL GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable,
y = rControlRectangle.Top() + (rControlRectangle.GetHeight()-indicator_size)/2;
// Set the shadow based on if checked or not so we get a checkmark.
- shadowType = isChecked ? GTK_SHADOW_IN : GTK_SHADOW_OUT;
+ shadowType = isChecked ? GTK_SHADOW_IN : isInconsistent ? GTK_SHADOW_ETCHED_IN : GTK_SHADOW_OUT;
NWSetWidgetState( gWidgetData[m_nScreen].gCheckWidget, nState, stateType );
GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gCheckWidget)->active = isChecked;
@@ -1411,7 +1333,7 @@ BOOL GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable,
x, y, indicator_size, indicator_size );
}
- return( TRUE );
+ return( sal_True );
}
//-------------------------------------
@@ -1427,7 +1349,7 @@ static void NWCalcArrowRect( const Rectangle& rButton, Rectangle& rArrow )
) );
}
-BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
+sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList&,
ControlState nState,
@@ -1482,7 +1404,7 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
scrollbarRect = pixmapRect;
if ( (scrollbarRect.GetWidth() <= 1) || (scrollbarRect.GetHeight() <= 1) )
- return( TRUE );
+ return( sal_True );
// Grab some button style attributes
gtk_widget_style_get( gWidgetData[m_nScreen].gScrollHorizWidget,
@@ -1594,7 +1516,7 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
thumbRect.Move( (scrollbarRect.GetWidth() - slider_width) / 2, 0 );
}
- BOOL has_slider = ( thumbRect.GetWidth() > 0 && thumbRect.GetHeight() > 0 );
+ sal_Bool has_slider = ( thumbRect.GetWidth() > 0 && thumbRect.GetHeight() > 0 );
scrollbarValues = gtk_range_get_adjustment( GTK_RANGE(scrollbarWidget) );
if ( scrollbarValues == NULL )
@@ -1619,7 +1541,7 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
// painting them directly to the window flickers
pixmap = NWGetPixmapFromScreen( pixmapRect );
if( ! pixmap )
- return FALSE;
+ return sal_False;
x = y = 0;
w = pixmapRect.GetWidth();
@@ -1677,7 +1599,7 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
// ----------------- ARROW 1
NWCalcArrowRect( button11BoundRect, arrowRect );
gtk_paint_arrow( style, gdkDrawable, stateType, shadowType,
- gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button1Type, TRUE,
+ gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button1Type, sal_True,
x+hShim+arrowRect.Left(), y+vShim+arrowRect.Top(),
arrowRect.GetWidth(), arrowRect.GetHeight() );
}
@@ -1692,7 +1614,7 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
// ----------------- ARROW 1
NWCalcArrowRect( button12BoundRect, arrowRect );
gtk_paint_arrow( style, gdkDrawable, stateType, shadowType,
- gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button2Type, TRUE,
+ gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button2Type, sal_True,
x+hShim+arrowRect.Left(), y+vShim+arrowRect.Top(),
arrowRect.GetWidth(), arrowRect.GetHeight() );
}
@@ -1708,7 +1630,7 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
// ----------------- ARROW 2
NWCalcArrowRect( button21BoundRect, arrowRect );
gtk_paint_arrow( style, gdkDrawable, stateType, shadowType,
- gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button1Type, TRUE,
+ gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button1Type, sal_True,
x+hShim+arrowRect.Left(), y+vShim+arrowRect.Top(),
arrowRect.GetWidth(), arrowRect.GetHeight() );
}
@@ -1723,7 +1645,7 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
// ----------------- ARROW 2
NWCalcArrowRect( button22BoundRect, arrowRect );
gtk_paint_arrow( style, gdkDrawable, stateType, shadowType,
- gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button2Type, TRUE,
+ gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button2Type, sal_True,
x+hShim+arrowRect.Left(), y+vShim+arrowRect.Top(),
arrowRect.GetWidth(), arrowRect.GetHeight() );
}
@@ -1731,11 +1653,11 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
if( !NWRenderPixmapToScreen(pixmap, pixmapRect) )
{
g_object_unref( pixmap );
- return( FALSE );
+ return( sal_False );
}
g_object_unref( pixmap );
- return( TRUE );
+ return( sal_True );
}
//---
@@ -1823,7 +1745,7 @@ static Rectangle NWGetScrollButtonRect( int nScreen, ControlPart nPart, Rectangl
//-------------------------------------
-BOOL GtkSalGraphics::NWPaintGTKEditBox( GdkDrawable* gdkDrawable,
+sal_Bool GtkSalGraphics::NWPaintGTKEditBox( GdkDrawable* gdkDrawable,
ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
@@ -1848,7 +1770,7 @@ BOOL GtkSalGraphics::NWPaintGTKEditBox( GdkDrawable* gdkDrawable,
NWPaintOneEditBox( m_nScreen, gdkDrawable, &clipRect, nType, nPart, pixmapRect, nState, aValue, rCaption );
}
- return( TRUE );
+ return( sal_True );
}
@@ -1957,7 +1879,7 @@ static void NWPaintOneEditBox( int nScreen,
//-------------------------------------
-BOOL GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart,
+sal_Bool GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList&,
ControlState nState,
@@ -2008,7 +1930,7 @@ BOOL GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart,
pixmap = NWGetPixmapFromScreen( pixmapRect );
if ( !pixmap )
- return( FALSE );
+ return( sal_False );
upBtnRect = NWGetSpinButtonRect( m_nScreen, nType, upBtnPart, pixmapRect, upBtnState, aValue, rCaption );
downBtnRect = NWGetSpinButtonRect( m_nScreen, nType, downBtnPart, pixmapRect, downBtnState, aValue, rCaption );
@@ -2044,11 +1966,11 @@ BOOL GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart,
if( !NWRenderPixmapToScreen(pixmap, pixmapRect) )
{
g_object_unref( pixmap );
- return( FALSE );
+ return( sal_False );
}
g_object_unref( pixmap );
- return( TRUE );
+ return( sal_True );
}
//---
@@ -2131,7 +2053,7 @@ static void NWPaintOneSpinButton( int nScreen,
arrowRect.setY( buttonRect.Top() + (buttonRect.GetHeight() - arrowRect.GetHeight()) / 2 - 1);
gtk_paint_arrow( gWidgetData[nScreen].gSpinButtonWidget->style, pixmap, stateType, GTK_SHADOW_OUT, NULL, gWidgetData[nScreen].gSpinButtonWidget,
- "spinbutton", (nPart == PART_BUTTON_UP) ? GTK_ARROW_UP : GTK_ARROW_DOWN, TRUE,
+ "spinbutton", (nPart == PART_BUTTON_UP) ? GTK_ARROW_UP : GTK_ARROW_DOWN, sal_True,
(arrowRect.Left() - aAreaRect.Left()), (arrowRect.Top() - aAreaRect.Top()),
arrowRect.GetWidth(), arrowRect.GetHeight() );
}
@@ -2139,7 +2061,7 @@ static void NWPaintOneSpinButton( int nScreen,
//-------------------------------------
-BOOL GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable,
+sal_Bool GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable,
ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
@@ -2207,12 +2129,12 @@ BOOL GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable,
buttonRect.GetWidth(), buttonRect.GetHeight() );
gtk_paint_arrow( gWidgetData[m_nScreen].gArrowWidget->style, gdkDrawable, stateType, shadowType,
- &clipRect, gWidgetData[m_nScreen].gArrowWidget, "arrow", GTK_ARROW_DOWN, TRUE,
+ &clipRect, gWidgetData[m_nScreen].gArrowWidget, "arrow", GTK_ARROW_DOWN, sal_True,
x+(arrowRect.Left() - pixmapRect.Left()), y+(arrowRect.Top() - pixmapRect.Top()),
arrowRect.GetWidth(), arrowRect.GetHeight() );
}
- return( TRUE );
+ return( sal_True );
}
//----
@@ -2272,7 +2194,7 @@ static Rectangle NWGetComboBoxButtonRect( int nScreen,
-BOOL GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart,
+sal_Bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart,
const Rectangle& rControlRectangle,
const clipList&,
ControlState nState,
@@ -2403,14 +2325,14 @@ BOOL GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart,
else
aCachePage.Fill( nType, nState, pixmapRect, pixmap );
- BOOL bSuccess = NWRenderPixmapToScreen(pixmap, pixmapRect);
+ sal_Bool bSuccess = NWRenderPixmapToScreen(pixmap, pixmapRect);
g_object_unref( pixmap );
return bSuccess;
}
//-------------------------------------
-BOOL GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable,
+sal_Bool GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable,
ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
@@ -2501,10 +2423,10 @@ BOOL GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable,
}
}
- return( TRUE );
+ return( sal_True );
}
-BOOL GtkSalGraphics::NWPaintGTKToolbar(
+sal_Bool GtkSalGraphics::NWPaintGTKToolbar(
GdkDrawable* gdkDrawable,
ControlType, ControlPart nPart,
const Rectangle& rControlRectangle,
@@ -2576,12 +2498,18 @@ BOOL GtkSalGraphics::NWPaintGTKToolbar(
{
pButtonWidget = gWidgetData[m_nScreen].gToolbarToggleWidget;
shadowType = GTK_SHADOW_IN;
+ stateType = GTK_STATE_ACTIVE;
// special case stateType value for depressed toggle buttons
// cf. gtk+/gtk/gtktogglebutton.c (gtk_toggle_button_update_state)
- if( ! (nState & (CTRL_STATE_PRESSED|CTRL_STATE_ROLLOVER)) )
- stateType = GTK_STATE_ACTIVE;
+ if( (nState & (CTRL_STATE_ROLLOVER|CTRL_STATE_PRESSED)) )
+ {
+ stateType = GTK_STATE_PRELIGHT;
+ shadowType = GTK_SHADOW_OUT;
+ }
bPaintButton = true;
}
+ else
+ stateType = GTK_STATE_PRELIGHT; // only for bPaintButton = true, in which case always rollver is meant
NWSetWidgetState( pButtonWidget, nState, stateType );
gtk_widget_ensure_style( pButtonWidget );
@@ -2659,12 +2587,12 @@ BOOL GtkSalGraphics::NWPaintGTKToolbar(
}
}
- return( TRUE );
+ return( sal_True );
}
//----
-BOOL GtkSalGraphics::NWPaintGTKMenubar(
+sal_Bool GtkSalGraphics::NWPaintGTKMenubar(
GdkDrawable* gdkDrawable,
ControlType, ControlPart nPart,
const Rectangle& rControlRectangle,
@@ -2747,10 +2675,10 @@ BOOL GtkSalGraphics::NWPaintGTKMenubar(
}
}
- return( TRUE );
+ return( sal_True );
}
-BOOL GtkSalGraphics::NWPaintGTKPopupMenu(
+sal_Bool GtkSalGraphics::NWPaintGTKPopupMenu(
GdkDrawable* gdkDrawable,
ControlType, ControlPart nPart,
const Rectangle& rControlRectangle,
@@ -2762,7 +2690,7 @@ BOOL GtkSalGraphics::NWPaintGTKPopupMenu(
// even crashes) in very old (Fedora Core 4 vintage) gtk's
if (gtk_major_version <= 2 && gtk_minor_version <= 8 &&
nPart == PART_MENU_ITEM && ! (nState & CTRL_STATE_ENABLED) )
- return TRUE;
+ return sal_True;
GtkStateType stateType;
GtkShadowType shadowType;
@@ -2878,10 +2806,10 @@ BOOL GtkSalGraphics::NWPaintGTKPopupMenu(
}
}
- return( TRUE );
+ return( sal_True );
}
-BOOL GtkSalGraphics::NWPaintGTKTooltip(
+sal_Bool GtkSalGraphics::NWPaintGTKTooltip(
GdkDrawable* gdkDrawable,
ControlType, ControlPart,
const Rectangle& rControlRectangle,
@@ -2916,10 +2844,10 @@ BOOL GtkSalGraphics::NWPaintGTKTooltip(
x, y, w, h );
}
- return( TRUE );
+ return( sal_True );
}
-BOOL GtkSalGraphics::NWPaintGTKListNode(
+sal_Bool GtkSalGraphics::NWPaintGTKListNode(
GdkDrawable*,
ControlType, ControlPart,
const Rectangle& rControlRectangle,
@@ -2955,7 +2883,7 @@ BOOL GtkSalGraphics::NWPaintGTKListNode(
GdkPixmap* pixmap = NWGetPixmapFromScreen( aRect );
if( ! pixmap )
- return FALSE;
+ return sal_False;
GdkDrawable* const &pixDrawable = GDK_DRAWABLE( pixmap );
gtk_paint_expander( gWidgetData[m_nScreen].gTreeView->style,
@@ -2967,13 +2895,13 @@ BOOL GtkSalGraphics::NWPaintGTKListNode(
w/2, h/2,
eStyle );
- BOOL bRet = NWRenderPixmapToScreen( pixmap, aRect );
+ sal_Bool bRet = NWRenderPixmapToScreen( pixmap, aRect );
g_object_unref( pixmap );
return bRet;
}
-BOOL GtkSalGraphics::NWPaintGTKProgress(
+sal_Bool GtkSalGraphics::NWPaintGTKProgress(
GdkDrawable*,
ControlType, ControlPart,
const Rectangle& rControlRectangle,
@@ -2991,7 +2919,7 @@ BOOL GtkSalGraphics::NWPaintGTKProgress(
GdkPixmap* pixmap = NWGetPixmapFromScreen( Rectangle( Point( 0, 0 ), Size( w, h ) ) );
if( ! pixmap )
- return FALSE;
+ return sal_False;
GdkDrawable* const &pixDrawable = GDK_DRAWABLE( pixmap );
@@ -3031,13 +2959,13 @@ BOOL GtkSalGraphics::NWPaintGTKProgress(
}
}
- BOOL bRet = NWRenderPixmapToScreen( pixmap, rControlRectangle );
+ sal_Bool bRet = NWRenderPixmapToScreen( pixmap, rControlRectangle );
g_object_unref( pixmap );
return bRet;
}
-BOOL GtkSalGraphics::NWPaintGTKSlider(
+sal_Bool GtkSalGraphics::NWPaintGTKSlider(
GdkDrawable*,
ControlType, ControlPart nPart,
const Rectangle& rControlRectangle,
@@ -3056,7 +2984,7 @@ BOOL GtkSalGraphics::NWPaintGTKSlider(
GdkPixmap* pixmap = NWGetPixmapFromScreen( rControlRectangle );
if( ! pixmap )
- return FALSE;
+ return sal_False;
GdkDrawable* const &pixDrawable = GDK_DRAWABLE( pixmap );
GtkWidget* pWidget = (nPart == PART_TRACK_HORZ_AREA)
@@ -3121,7 +3049,7 @@ BOOL GtkSalGraphics::NWPaintGTKSlider(
}
- BOOL bRet = NWRenderPixmapToScreen( pixmap, rControlRectangle );
+ sal_Bool bRet = NWRenderPixmapToScreen( pixmap, rControlRectangle );
g_object_unref( pixmap );
return bRet;
@@ -3370,9 +3298,9 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
else
{
Color aColor2 = aStyleSet.GetLightColor();
- Color aCheck( (BYTE)(((USHORT)aBackColor.GetRed()+(USHORT)aColor2.GetRed())/2),
- (BYTE)(((USHORT)aBackColor.GetGreen()+(USHORT)aColor2.GetGreen())/2),
- (BYTE)(((USHORT)aBackColor.GetBlue()+(USHORT)aColor2.GetBlue())/2)
+ Color aCheck( (sal_uInt8)(((sal_uInt16)aBackColor.GetRed()+(sal_uInt16)aColor2.GetRed())/2),
+ (sal_uInt8)(((sal_uInt16)aBackColor.GetGreen()+(sal_uInt16)aColor2.GetGreen())/2),
+ (sal_uInt8)(((sal_uInt16)aBackColor.GetBlue()+(sal_uInt16)aColor2.GetBlue())/2)
);
aStyleSet.SetCheckedColor( aCheck );
}
@@ -3408,7 +3336,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
aStyleSet.SetInactiveTabColor( aSelectedBackColor );
// menu disabled entries handling
- aStyleSet.SetSkipDisabledInMenus( TRUE );
+ aStyleSet.SetSkipDisabledInMenus( sal_True );
// menu colors
GtkStyle* pMenuStyle = gtk_widget_get_style( gWidgetData[m_nScreen].gMenuWidget );
GtkStyle* pMenuItemStyle = gtk_rc_get_style( gWidgetData[m_nScreen].gMenuItemMenuWidget );
@@ -3694,17 +3622,18 @@ GdkPixmap* GtkSalGraphics::NWGetPixmapFromScreen( Rectangle srcRect )
* Copy an alpha pixmap to screen using a gc with clipping
************************************************************************/
-BOOL GtkSalGraphics::NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRect )
+sal_Bool GtkSalGraphics::NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRect )
{
// The GC can't be null, otherwise we'd have no clip region
- if( SelectFont() == NULL )
+ GC aFontGC = GetFontGC();
+ if( aFontGC == NULL )
{
std::fprintf(stderr, "salnativewidgets.cxx: no valid GC\n" );
- return( FALSE );
+ return( sal_False );
}
if ( !pPixmap )
- return( FALSE );
+ return( sal_False );
// Copy the background of the screen into a composite pixmap
CopyScreenArea( GetXDisplay(),
@@ -3712,10 +3641,10 @@ BOOL GtkSalGraphics::NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRe
gdk_screen_get_number( gdk_drawable_get_screen( GDK_DRAWABLE(pPixmap) ) ),
gdk_drawable_get_depth( GDK_DRAWABLE(pPixmap) ),
GetDrawable(), m_nScreen, GetVisual().GetDepth(),
- SelectFont(),
+ aFontGC,
0, 0, dstRect.GetWidth(), dstRect.GetHeight(), dstRect.Left(), dstRect.Top() );
- return( TRUE );
+ return( sal_True );
}
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index 776e90d8daff..2ae761aaa1a4 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -85,9 +85,9 @@ using namespace com::sun::star;
int GtkSalFrame::m_nFloats = 0;
-static USHORT GetKeyModCode( guint state )
+static sal_uInt16 GetKeyModCode( guint state )
{
- USHORT nCode = 0;
+ sal_uInt16 nCode = 0;
if( (state & GDK_SHIFT_MASK) )
nCode |= KEY_SHIFT;
if( (state & GDK_CONTROL_MASK) )
@@ -102,9 +102,9 @@ static USHORT GetKeyModCode( guint state )
return nCode;
}
-static USHORT GetMouseModCode( guint state )
+static sal_uInt16 GetMouseModCode( guint state )
{
- USHORT nCode = GetKeyModCode( state );
+ sal_uInt16 nCode = GetKeyModCode( state );
if( (state & GDK_BUTTON1_MASK) )
nCode |= MOUSE_LEFT;
if( (state & GDK_BUTTON2_MASK) )
@@ -115,9 +115,9 @@ static USHORT GetMouseModCode( guint state )
return nCode;
}
-static USHORT GetKeyCode( guint keyval )
+static sal_uInt16 GetKeyCode( guint keyval )
{
- USHORT nCode = 0;
+ sal_uInt16 nCode = 0;
if( keyval >= GDK_0 && keyval <= GDK_9 )
nCode = KEY_0 + (keyval-GDK_0);
else if( keyval >= GDK_KP_0 && keyval <= GDK_KP_9 )
@@ -302,14 +302,14 @@ static USHORT GetKeyCode( guint keyval )
// in the independent part.
struct KeyAlternate
{
- USHORT nKeyCode;
+ sal_uInt16 nKeyCode;
sal_Unicode nCharCode;
KeyAlternate() : nKeyCode( 0 ), nCharCode( 0 ) {}
- KeyAlternate( USHORT nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {}
+ KeyAlternate( sal_uInt16 nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {}
};
inline KeyAlternate
-GetAlternateKeyCode( const USHORT nKeyCode )
+GetAlternateKeyCode( const sal_uInt16 nKeyCode )
{
KeyAlternate aAlternate;
@@ -397,7 +397,7 @@ GtkSalFrame::GraphicsHolder::~GraphicsHolder()
delete pGraphics;
}
-GtkSalFrame::GtkSalFrame( SalFrame* pParent, ULONG nStyle )
+GtkSalFrame::GtkSalFrame( SalFrame* pParent, sal_uLong nStyle )
{
m_nScreen = getDisplay()->GetDefaultScreenNumber();
getDisplay()->registerFrame( this );
@@ -572,7 +572,7 @@ void GtkSalFrame::InitCommon()
m_ePointerStyle = 0xffff;
m_bSetFocusOnMap = false;
- gtk_widget_set_app_paintable( m_pWindow, TRUE );
+ gtk_widget_set_app_paintable( m_pWindow, sal_True );
gtk_widget_set_double_buffered( m_pWindow, FALSE );
gtk_widget_set_redraw_on_allocate( m_pWindow, FALSE );
gtk_widget_add_events( m_pWindow,
@@ -759,7 +759,7 @@ GtkSalFrame *GtkSalFrame::getFromWindow( GtkWindow *pWindow )
return (GtkSalFrame *) g_object_get_data( G_OBJECT( pWindow ), "SalFrame" );
}
-void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle )
+void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle )
{
if( nStyle & SAL_FRAME_STYLE_DEFAULT ) // ensure default style
{
@@ -829,7 +829,7 @@ void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle )
else if( (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) )
{
eType = GDK_WINDOW_TYPE_HINT_TOOLBAR;
- lcl_set_accept_focus( GTK_WINDOW(m_pWindow), FALSE, true );
+ lcl_set_accept_focus( GTK_WINDOW(m_pWindow), sal_False, true );
bNoDecor = true;
}
else if( (nStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE) )
@@ -873,9 +873,9 @@ void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle )
if( bDecoHandling )
{
- gtk_window_set_resizable( GTK_WINDOW(m_pWindow), (nStyle & SAL_FRAME_STYLE_SIZEABLE) ? TRUE : FALSE );
+ gtk_window_set_resizable( GTK_WINDOW(m_pWindow), (nStyle & SAL_FRAME_STYLE_SIZEABLE) ? sal_True : FALSE );
if( ( (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION)) ) )
- lcl_set_accept_focus( GTK_WINDOW(m_pWindow), FALSE, false );
+ lcl_set_accept_focus( GTK_WINDOW(m_pWindow), sal_False, false );
}
}
@@ -1019,10 +1019,10 @@ void GtkSalFrame::ReleaseGraphics( SalGraphics* pGraphics )
}
}
-BOOL GtkSalFrame::PostEvent( void* pData )
+sal_Bool GtkSalFrame::PostEvent( void* pData )
{
getDisplay()->SendInternalEvent( this, pData );
- return TRUE;
+ return sal_True;
}
void GtkSalFrame::SetTitle( const String& rTitle )
@@ -1032,8 +1032,8 @@ void GtkSalFrame::SetTitle( const String& rTitle )
gtk_window_set_title( GTK_WINDOW(m_pWindow), rtl::OUStringToOString( rTitle, RTL_TEXTENCODING_UTF8 ).getStr() );
}
-static inline BYTE *
-getRow( BitmapBuffer *pBuffer, ULONG nRow )
+static inline sal_uInt8 *
+getRow( BitmapBuffer *pBuffer, sal_uLong nRow )
{
if( BMP_SCANLINE_ADJUSTMENT( pBuffer->mnFormat ) == BMP_FORMAT_TOP_DOWN )
return pBuffer->mpBits + nRow * pBuffer->mnScanlineSize;
@@ -1047,11 +1047,11 @@ bitmapToPixbuf( SalBitmap *pSalBitmap, SalBitmap *pSalAlpha )
g_return_val_if_fail( pSalBitmap != NULL, NULL );
g_return_val_if_fail( pSalAlpha != NULL, NULL );
- BitmapBuffer *pBitmap = pSalBitmap->AcquireBuffer( TRUE );
+ BitmapBuffer *pBitmap = pSalBitmap->AcquireBuffer( sal_True );
g_return_val_if_fail( pBitmap != NULL, NULL );
g_return_val_if_fail( pBitmap->mnBitCount == 24, NULL );
- BitmapBuffer *pAlpha = pSalAlpha->AcquireBuffer( TRUE );
+ BitmapBuffer *pAlpha = pSalAlpha->AcquireBuffer( sal_True );
g_return_val_if_fail( pAlpha != NULL, NULL );
g_return_val_if_fail( pAlpha->mnBitCount == 8, NULL );
@@ -1064,8 +1064,8 @@ bitmapToPixbuf( SalBitmap *pSalBitmap, SalBitmap *pSalAlpha )
for( nY = 0; nY < pBitmap->mnHeight; nY++ )
{
- BYTE *pData = getRow( pBitmap, nY );
- BYTE *pAlphaData = getRow( pAlpha, nY );
+ sal_uInt8 *pData = getRow( pBitmap, nY );
+ sal_uInt8 *pAlphaData = getRow( pAlpha, nY );
for( nX = 0; nX < pBitmap->mnWidth; nX++ )
{
@@ -1086,18 +1086,18 @@ bitmapToPixbuf( SalBitmap *pSalBitmap, SalBitmap *pSalAlpha )
}
}
- pSalBitmap->ReleaseBuffer( pBitmap, TRUE );
- pSalAlpha->ReleaseBuffer( pAlpha, TRUE );
+ pSalBitmap->ReleaseBuffer( pBitmap, sal_True );
+ pSalAlpha->ReleaseBuffer( pAlpha, sal_True );
return gdk_pixbuf_new_from_data( pPixbufData,
- GDK_COLORSPACE_RGB, TRUE, 8,
+ GDK_COLORSPACE_RGB, sal_True, 8,
aSize.Width(), aSize.Height(),
aSize.Width() * 4,
(GdkPixbufDestroyNotify) g_free,
NULL );
}
-void GtkSalFrame::SetIcon( USHORT nIcon )
+void GtkSalFrame::SetIcon( sal_uInt16 nIcon )
{
if( (m_nStyle & (SAL_FRAME_STYLE_PLUG|SAL_FRAME_STYLE_SYSTEMCHILD|SAL_FRAME_STYLE_FLOAT|SAL_FRAME_STYLE_INTRO|SAL_FRAME_STYLE_OWNERDRAWDECORATION))
|| ! m_pWindow )
@@ -1109,10 +1109,10 @@ void GtkSalFrame::SetIcon( USHORT nIcon )
GdkPixbuf *pBuf;
GList *pIcons = NULL;
- USHORT nOffsets[2] = { SV_ICON_SMALL_START, SV_ICON_LARGE_START };
- USHORT nIndex;
+ sal_uInt16 nOffsets[2] = { SV_ICON_SMALL_START, SV_ICON_LARGE_START };
+ sal_uInt16 nIndex;
- for( nIndex = 0; nIndex < sizeof(nOffsets)/ sizeof(USHORT); nIndex++ )
+ for( nIndex = 0; nIndex < sizeof(nOffsets)/ sizeof(sal_uInt16); nIndex++ )
{
// #i44723# workaround gcc temporary problem
ResId aResId( nOffsets[nIndex] + nIcon, *ImplGetResMgr() );
@@ -1131,7 +1131,7 @@ void GtkSalFrame::SetIcon( USHORT nIcon )
{
case TRANSPARENT_NONE:
{
- BYTE nTrans = 0;
+ sal_uInt8 nTrans = 0;
aMask = AlphaMask( aBmp.GetSizePixel(), &nTrans );
}
break;
@@ -1271,7 +1271,7 @@ static void initClientId()
}
}
-void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
+void GtkSalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
{
if( m_pWindow )
{
@@ -1305,7 +1305,7 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
* showing the float (cannot grab it to the float
* before show).
*/
- m_pParent->grabPointer( TRUE, TRUE );
+ m_pParent->grabPointer( sal_True, sal_True );
}
guint32 nUserTime = 0;
@@ -1352,7 +1352,7 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
{
m_nFloats++;
if( ! getDisplay()->GetCaptureFrame() && m_nFloats == 1 )
- grabPointer( TRUE, TRUE );
+ grabPointer( sal_True, sal_True );
// #i44068# reset parent's IM context
if( m_pParent )
m_pParent->EndExtTextInput(0);
@@ -1366,7 +1366,7 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
{
m_nFloats--;
if( ! getDisplay()->GetCaptureFrame() && m_nFloats == 0)
- grabPointer( FALSE );
+ grabPointer( sal_False );
}
gtk_widget_hide( m_pWindow );
if( m_pIMHandler )
@@ -1379,7 +1379,7 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
}
}
-void GtkSalFrame::Enable( BOOL /*bEnable*/ )
+void GtkSalFrame::Enable( sal_Bool /*bEnable*/ )
{
// Not implemented by X11SalFrame either
}
@@ -1430,6 +1430,12 @@ void GtkSalFrame::setMinMaxSize()
aHints |= GDK_HINT_MAX_SIZE;
}
}
+ if( m_bFullscreen && m_aMaxSize.Width() && m_aMaxSize.Height() )
+ {
+ aGeo.max_width = m_aMaxSize.Width();
+ aGeo.max_height = m_aMaxSize.Height();
+ aHints |= GDK_HINT_MAX_SIZE;
+ }
if( aHints )
gtk_window_set_geometry_hints( GTK_WINDOW(m_pWindow),
NULL,
@@ -1463,7 +1469,7 @@ void GtkSalFrame::SetMinClientSize( long nWidth, long nHeight )
}
}
-void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags )
+void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags )
{
if( !m_pWindow || isChild( true, false ) )
return;
@@ -1578,7 +1584,7 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState )
if( ! m_pWindow || ! pState || isChild( true, false ) )
return;
- const ULONG nMaxGeometryMask =
+ const sal_uLong nMaxGeometryMask =
SAL_FRAMESTATE_MASK_X | SAL_FRAMESTATE_MASK_Y |
SAL_FRAMESTATE_MASK_WIDTH | SAL_FRAMESTATE_MASK_HEIGHT |
SAL_FRAMESTATE_MASK_MAXIMIZED_X | SAL_FRAMESTATE_MASK_MAXIMIZED_Y |
@@ -1606,7 +1612,7 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState )
else if( pState->mnMask & (SAL_FRAMESTATE_MASK_X | SAL_FRAMESTATE_MASK_Y |
SAL_FRAMESTATE_MASK_WIDTH | SAL_FRAMESTATE_MASK_HEIGHT ) )
{
- USHORT nPosSizeFlags = 0;
+ sal_uInt16 nPosSizeFlags = 0;
long nX = pState->mnX - (m_pParent ? m_pParent->maGeometry.nX : 0);
long nY = pState->mnY - (m_pParent ? m_pParent->maGeometry.nY : 0);
if( pState->mnMask & SAL_FRAMESTATE_MASK_X )
@@ -1645,7 +1651,7 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState )
}
}
-BOOL GtkSalFrame::GetWindowState( SalFrameState* pState )
+sal_Bool GtkSalFrame::GetWindowState( SalFrameState* pState )
{
pState->mnState = SAL_FRAMESTATE_NORMAL;
pState->mnMask = SAL_FRAMESTATE_MASK_STATE;
@@ -1681,7 +1687,7 @@ BOOL GtkSalFrame::GetWindowState( SalFrameState* pState )
SAL_FRAMESTATE_MASK_WIDTH |
SAL_FRAMESTATE_MASK_HEIGHT;
- return TRUE;
+ return sal_True;
}
void GtkSalFrame::moveToScreen( int nScreen )
@@ -1745,13 +1751,13 @@ void GtkSalFrame::SetScreenNumber( unsigned int nNewScreen )
Rectangle aNewScreenRect( pDisp->GetXineramaScreens()[nNewScreen] );
bool bVisible = GTK_WIDGET_MAPPED(m_pWindow);
if( bVisible )
- Show( FALSE );
+ Show( sal_False );
maGeometry.nX = aNewScreenRect.Left() + (maGeometry.nX - aOldScreenRect.Left());
maGeometry.nY = aNewScreenRect.Top() + (maGeometry.nY - aOldScreenRect.Top());
createNewWindow( None, false, m_nScreen );
gtk_window_move( GTK_WINDOW(m_pWindow), maGeometry.nX, maGeometry.nY );
if( bVisible )
- Show( TRUE );
+ Show( sal_True );
maGeometry.nScreenNumber = nNewScreen;
}
else if( sal_Int32(nNewScreen) < pDisp->GetScreenCount() )
@@ -1797,7 +1803,7 @@ void GtkSalFrame::SetApplicationID( const rtl::OUString &rWMClass )
}
}
-void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
+void GtkSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen )
{
if( m_pWindow && ! isChild() )
{
@@ -1811,7 +1817,7 @@ void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
Size( maGeometry.nWidth, maGeometry.nHeight ) );
bool bVisible = GTK_WIDGET_MAPPED(m_pWindow);
if( bVisible )
- Show( FALSE );
+ Show( sal_False );
m_nStyle |= SAL_FRAME_STYLE_PARTIAL_FULLSCREEN;
createNewWindow( None, false, m_nScreen );
Rectangle aNewPosSize;
@@ -1834,11 +1840,11 @@ void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
if( ! getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() )
{
if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) )
- gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE );
+ gtk_window_set_resizable( GTK_WINDOW(m_pWindow), sal_True );
gtk_window_fullscreen( GTK_WINDOW( m_pWindow ) );
}
if( bVisible )
- Show( TRUE );
+ Show( sal_True );
}
else
{
@@ -1846,7 +1852,7 @@ void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
if( ! getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() )
gtk_window_unfullscreen( GTK_WINDOW(m_pWindow) );
if( bVisible )
- Show( FALSE );
+ Show( sal_False );
m_nStyle &= ~SAL_FRAME_STYLE_PARTIAL_FULLSCREEN;
createNewWindow( None, false, m_nScreen );
if( ! m_aRestorePosSize.IsEmpty() )
@@ -1860,7 +1866,7 @@ void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
m_aRestorePosSize = Rectangle();
}
if( bVisible )
- Show( TRUE );
+ Show( sal_True );
}
}
else
@@ -2029,7 +2035,7 @@ dbus_uninhibit_gsm (guint cookie)
}
#endif
-void GtkSalFrame::StartPresentation( BOOL bStart )
+void GtkSalFrame::StartPresentation( sal_Bool bStart )
{
Display *pDisplay = GDK_DISPLAY_XDISPLAY( getGdkDisplay() );
@@ -2066,11 +2072,11 @@ void GtkSalFrame::StartPresentation( BOOL bStart )
}
}
-void GtkSalFrame::SetAlwaysOnTop( BOOL /*bOnTop*/ )
+void GtkSalFrame::SetAlwaysOnTop( sal_Bool /*bOnTop*/ )
{
}
-void GtkSalFrame::ToTop( USHORT nFlags )
+void GtkSalFrame::ToTop( sal_uInt16 nFlags )
{
if( m_pWindow )
{
@@ -2120,13 +2126,13 @@ void GtkSalFrame::SetPointer( PointerStyle ePointerStyle )
// #i80791# use grabPointer the same way as CaptureMouse, respective float grab
if( getDisplay()->MouseCaptured( this ) )
- grabPointer( TRUE, FALSE );
+ grabPointer( sal_True, sal_False );
else if( m_nFloats > 0 )
- grabPointer( TRUE, TRUE );
+ grabPointer( sal_True, sal_True );
}
}
-void GtkSalFrame::grabPointer( BOOL bGrab, BOOL bOwnerEvents )
+void GtkSalFrame::grabPointer( sal_Bool bGrab, sal_Bool bOwnerEvents )
{
static const char* pEnv = getenv( "SAL_NO_MOUSEGRABS" );
@@ -2188,7 +2194,7 @@ void GtkSalFrame::grabPointer( BOOL bGrab, BOOL bOwnerEvents )
}
}
-void GtkSalFrame::CaptureMouse( BOOL bCapture )
+void GtkSalFrame::CaptureMouse( sal_Bool bCapture )
{
getDisplay()->CaptureMouse( bCapture ? this : NULL );
}
@@ -2233,12 +2239,12 @@ void GtkSalFrame::Sync()
gdk_display_sync( getGdkDisplay() );
}
-String GtkSalFrame::GetSymbolKeyName( const String&, USHORT nKeyCode )
+String GtkSalFrame::GetSymbolKeyName( const String&, sal_uInt16 nKeyCode )
{
return getDisplay()->GetKeyName( nKeyCode );
}
-String GtkSalFrame::GetKeyName( USHORT nKeyCode )
+String GtkSalFrame::GetKeyName( sal_uInt16 nKeyCode )
{
return getDisplay()->GetKeyName( nKeyCode );
}
@@ -2272,7 +2278,7 @@ SalFrame::SalIndicatorState GtkSalFrame::GetIndicatorState()
return aState;
}
-void GtkSalFrame::SimulateKeyPress( USHORT nKeyCode )
+void GtkSalFrame::SimulateKeyPress( sal_uInt16 nKeyCode )
{
GetX11SalData()->GetDisplay()->SimulateKeyPress(nKeyCode);
}
@@ -2291,16 +2297,16 @@ void GtkSalFrame::SetInputContext( SalInputContext* pContext )
m_pIMHandler->setInputContext( pContext );
}
-void GtkSalFrame::EndExtTextInput( USHORT nFlags )
+void GtkSalFrame::EndExtTextInput( sal_uInt16 nFlags )
{
if( m_pIMHandler )
m_pIMHandler->endExtTextInput( nFlags );
}
-BOOL GtkSalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& )
+sal_Bool GtkSalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& )
{
// not supported yet
- return FALSE;
+ return sal_False;
}
LanguageType GtkSalFrame::GetInputLanguage()
@@ -2378,7 +2384,7 @@ void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, int nSc
{
bool bWasVisible = GTK_WIDGET_MAPPED(m_pWindow);
if( bWasVisible )
- Show( FALSE );
+ Show( sal_False );
if( nScreen < 0 || nScreen >= getDisplay()->GetScreenCount() )
nScreen = m_nScreen;
@@ -2458,7 +2464,7 @@ void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, int nSc
SetTitle( m_aTitle );
if( bWasVisible )
- Show( TRUE );
+ Show( sal_True );
std::list< GtkSalFrame* > aChildren = m_aChildren;
m_aChildren.clear();
@@ -2482,7 +2488,7 @@ void GtkSalFrame::ResetClipRegion()
gdk_window_shape_combine_region( m_pWindow->window, NULL, 0, 0 );
}
-void GtkSalFrame::BeginSetClipRegion( ULONG )
+void GtkSalFrame::BeginSetClipRegion( sal_uLong )
{
if( m_pRegion )
gdk_region_destroy( m_pRegion );
@@ -2575,7 +2581,7 @@ bool GtkSalFrame::Dispatch( const XEvent* pEvent )
GdkEventFocus aEvent;
aEvent.type = GDK_FOCUS_CHANGE;
aEvent.window = m_pWindow->window;
- aEvent.send_event = TRUE;
+ aEvent.send_event = sal_True;
aEvent.in = (pEvent->xclient.data.l[1] == 1);
signalFocus( m_pWindow, &aEvent, this );
}
@@ -2629,7 +2635,7 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
{
GtkSalFrame* pThis = (GtkSalFrame*)frame;
SalMouseEvent aEvent;
- USHORT nEventType = 0;
+ sal_uInt16 nEventType = 0;
switch( pEvent->type )
{
case GDK_BUTTON_PRESS:
@@ -2639,14 +2645,14 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
nEventType = SALEVENT_MOUSEBUTTONUP;
break;
default:
- return FALSE;
+ return sal_False;
}
switch( pEvent->button )
{
case 1: aEvent.mnButton = MOUSE_LEFT; break;
case 2: aEvent.mnButton = MOUSE_MIDDLE; break;
case 3: aEvent.mnButton = MOUSE_RIGHT; break;
- default: return FALSE;
+ default: return sal_False;
}
aEvent.mnTime = pEvent->time;
aEvent.mnX = (long)pEvent->x_root - pThis->maGeometry.nX;
@@ -2714,7 +2720,7 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
}
}
- return FALSE;
+ return sal_False;
}
gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame )
@@ -2722,7 +2728,7 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame
GtkSalFrame* pThis = (GtkSalFrame*)frame;
GdkEventScroll* pSEvent = (GdkEventScroll*)pEvent;
- static ULONG nLines = 0;
+ static sal_uLong nLines = 0;
if( ! nLines )
{
char* pEnv = getenv( "SAL_WHEELLINES" );
@@ -2734,8 +2740,8 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame
bool bNeg = (pSEvent->direction == GDK_SCROLL_DOWN || pSEvent->direction == GDK_SCROLL_RIGHT );
SalWheelMouseEvent aEvent;
aEvent.mnTime = pSEvent->time;
- aEvent.mnX = (ULONG)pSEvent->x;
- aEvent.mnY = (ULONG)pSEvent->y;
+ aEvent.mnX = (sal_uLong)pSEvent->x;
+ aEvent.mnY = (sal_uLong)pSEvent->y;
aEvent.mnDelta = bNeg ? -120 : 120;
aEvent.mnNotchDelta = bNeg ? -1 : 1;
aEvent.mnScrollLines = nLines;
@@ -2750,7 +2756,7 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame
pThis->CallCallback( SALEVENT_WHEELMOUSE, &aEvent );
- return FALSE;
+ return sal_False;
}
gboolean GtkSalFrame::signalMotion( GtkWidget*, GdkEventMotion* pEvent, gpointer frame )
@@ -2795,7 +2801,7 @@ gboolean GtkSalFrame::signalMotion( GtkWidget*, GdkEventMotion* pEvent, gpointer
}
}
- return TRUE;
+ return sal_True;
}
gboolean GtkSalFrame::signalCrossing( GtkWidget*, GdkEventCrossing* pEvent, gpointer frame )
@@ -2811,7 +2817,7 @@ gboolean GtkSalFrame::signalCrossing( GtkWidget*, GdkEventCrossing* pEvent, gpoi
GTK_YIELD_GRAB();
pThis->CallCallback( (pEvent->type == GDK_ENTER_NOTIFY) ? SALEVENT_MOUSEMOVE : SALEVENT_MOUSELEAVE, &aEvent );
- return TRUE;
+ return sal_True;
}
@@ -2824,7 +2830,7 @@ gboolean GtkSalFrame::signalExpose( GtkWidget*, GdkEventExpose* pEvent, gpointer
GTK_YIELD_GRAB();
pThis->CallCallback( SALEVENT_PAINT, &aEvent );
- return FALSE;
+ return sal_False;
}
gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer frame )
@@ -2861,7 +2867,7 @@ gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer f
if( m_nFloats == 0 )
pThis->CallCallback( pEvent->in ? SALEVENT_GETFOCUS : SALEVENT_LOSEFOCUS, NULL );
- return FALSE;
+ return sal_False;
}
IMPL_LINK( GtkSalFrame, ImplDelayedFullScreenHdl, void*, EMPTYARG )
@@ -2933,7 +2939,7 @@ gboolean GtkSalFrame::signalMap( GtkWidget*, GdkEvent*, gpointer frame )
pThis->CallCallback( SALEVENT_RESIZE, NULL );
- return FALSE;
+ return sal_False;
}
gboolean GtkSalFrame::signalUnmap( GtkWidget*, GdkEvent*, gpointer frame )
@@ -2943,7 +2949,7 @@ gboolean GtkSalFrame::signalUnmap( GtkWidget*, GdkEvent*, gpointer frame )
GTK_YIELD_GRAB();
pThis->CallCallback( SALEVENT_RESIZE, NULL );
- return FALSE;
+ return sal_False;
}
gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gpointer frame )
@@ -2963,7 +2969,7 @@ gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gp
*/
if( (pThis->m_nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) &&
pThis->getDisplay()->GetCaptureFrame() == pThis )
- return FALSE;
+ return sal_False;
// in child case the coordinates are not root coordinates,
@@ -3032,7 +3038,7 @@ gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gp
else if( bSized )
pThis->CallCallback( SALEVENT_RESIZE, NULL );
- return FALSE;
+ return sal_False;
}
gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame )
@@ -3044,7 +3050,7 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame
if( pThis->m_pIMHandler )
{
if( pThis->m_pIMHandler->handleKeyEvent( pEvent ) )
- return TRUE;
+ return sal_True;
}
GTK_YIELD_GRAB();
@@ -3057,7 +3063,7 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame
{
SalKeyModEvent aModEvt;
- USHORT nModCode = GetKeyModCode( pEvent->state );
+ sal_uInt16 nModCode = GetKeyModCode( pEvent->state );
aModEvt.mnModKeyCode = 0; // emit no MODKEYCHANGE events
if( pEvent->type == GDK_KEY_PRESS && !pThis->m_nKeyModifiers )
@@ -3070,8 +3076,8 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame
pThis->m_nKeyModifiers = 0;
}
- USHORT nExtModMask = 0;
- USHORT nModMask = 0;
+ sal_uInt16 nExtModMask = 0;
+ sal_uInt16 nModMask = 0;
// pressing just the ctrl key leads to a keysym of XK_Control but
// the event state does not contain ControlMask. In the release
// event its the other way round: it does contain the Control mask.
@@ -3149,7 +3155,7 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame
if( !aDel.isDeleted() && pThis->m_pIMHandler )
pThis->m_pIMHandler->updateIMSpotLocation();
- return TRUE;
+ return sal_True;
}
gboolean GtkSalFrame::signalDelete( GtkWidget*, GdkEvent*, gpointer frame )
@@ -3159,7 +3165,7 @@ gboolean GtkSalFrame::signalDelete( GtkWidget*, GdkEvent*, gpointer frame )
GTK_YIELD_GRAB();
pThis->CallCallback( SALEVENT_CLOSE, NULL );
- return TRUE;
+ return sal_True;
}
void GtkSalFrame::signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer frame )
@@ -3198,7 +3204,7 @@ void GtkSalFrame::signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer fram
{
// signalize theme changed for NWF caches
// FIXME: should be called only once for a style change
- GtkSalGraphics::bThemeChanged = TRUE;
+ GtkSalGraphics::bThemeChanged = sal_True;
}
}
@@ -3226,7 +3232,7 @@ gboolean GtkSalFrame::signalState( GtkWidget*, GdkEvent* pEvent, gpointer frame
}
#endif
- return FALSE;
+ return sal_False;
}
gboolean GtkSalFrame::signalVisibility( GtkWidget*, GdkEventVisibility* pEvent, gpointer frame )
@@ -3234,7 +3240,7 @@ gboolean GtkSalFrame::signalVisibility( GtkWidget*, GdkEventVisibility* pEvent,
GtkSalFrame* pThis = (GtkSalFrame*)frame;
pThis->m_nVisibility = pEvent->state;
- return FALSE;
+ return sal_False;
}
void GtkSalFrame::signalDestroy( GtkObject* pObj, gpointer frame )
@@ -3324,7 +3330,9 @@ void GtkSalFrame::IMHandler::updateIMSpotLocation()
aArea.y = aPosEvent.mnY;
aArea.width = aPosEvent.mnWidth;
aArea.height = aPosEvent.mnHeight;
+ m_pFrame->getDisplay()->GetXLib()->PushXErrorLevel( true );
gtk_im_context_set_cursor_location( m_pIMContext, &aArea );
+ m_pFrame->getDisplay()->GetXLib()->PopXErrorLevel();
}
void GtkSalFrame::IMHandler::setInputContext( SalInputContext* )
@@ -3348,7 +3356,7 @@ void GtkSalFrame::IMHandler::sendEmptyCommit()
m_pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, NULL );
}
-void GtkSalFrame::IMHandler::endExtTextInput( USHORT /*nFlags*/ )
+void GtkSalFrame::IMHandler::endExtTextInput( sal_uInt16 /*nFlags*/ )
{
gtk_im_context_reset ( m_pIMContext );
@@ -3625,7 +3633,7 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
pThis->m_aInputEvent.mnDeltaStart = 0;
pThis->m_aInputEvent.mbOnlyCursor = False;
- pThis->m_aInputFlags = std::vector<USHORT>( std::max( 1, (int)pThis->m_aInputEvent.maText.Len() ), 0 );
+ pThis->m_aInputFlags = std::vector<sal_uInt16>( std::max( 1, (int)pThis->m_aInputEvent.maText.Len() ), 0 );
PangoAttrIterator *iter = pango_attr_list_get_iterator (pAttrs);
do
@@ -3765,15 +3773,15 @@ gboolean GtkSalFrame::IMHandler::signalIMRetrieveSurrounding( GtkIMContext* pCon
sal_uInt32 nPosition = xText->getCaretPosition();
rtl::OUString sAllText = xText->getText();
if (!sAllText.getLength())
- return FALSE;
+ return sal_False;
rtl::OString sUTF = rtl::OUStringToOString(sAllText, RTL_TEXTENCODING_UTF8);
rtl::OUString sCursorText(sAllText, nPosition);
gtk_im_context_set_surrounding(pContext, sUTF.getStr(), sUTF.getLength(),
rtl::OUStringToOString(sCursorText, RTL_TEXTENCODING_UTF8).getLength());
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
gboolean GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, gint offset, gint nchars,
@@ -3795,10 +3803,10 @@ gboolean GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, gint
nDeleteEnd = xText->getCharacterCount();
xText->deleteText(nDeletePos, nDeleteEnd);
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/window/gtkobject.cxx b/vcl/unx/gtk/window/gtkobject.cxx
index e3d8dd2d2ce0..0853e956b48f 100644
--- a/vcl/unx/gtk/window/gtkobject.cxx
+++ b/vcl/unx/gtk/window/gtkobject.cxx
@@ -40,7 +40,7 @@
#include <plugins/gtk/gtkdata.hxx>
#include <plugins/gtk/gtkinst.hxx>
-GtkSalObject::GtkSalObject( GtkSalFrame* pParent, BOOL bShow )
+GtkSalObject::GtkSalObject( GtkSalFrame* pParent, sal_Bool bShow )
: m_pSocket( NULL ),
m_pRegion( NULL )
{
@@ -111,12 +111,12 @@ void GtkSalObject::ResetClipRegion()
gdk_window_shape_combine_region( m_pSocket->window, NULL, 0, 0 );
}
-USHORT GtkSalObject::GetClipRegionType()
+sal_uInt16 GtkSalObject::GetClipRegionType()
{
return SAL_OBJECT_CLIP_INCLUDERECTS;
}
-void GtkSalObject::BeginSetClipRegion( ULONG )
+void GtkSalObject::BeginSetClipRegion( sal_uLong )
{
if( m_pRegion )
gdk_region_destroy( m_pRegion );
@@ -151,7 +151,7 @@ void GtkSalObject::SetPosSize( long nX, long nY, long nWidth, long nHeight )
}
}
-void GtkSalObject::Show( BOOL bVisible )
+void GtkSalObject::Show( sal_Bool bVisible )
{
if( m_pSocket )
{
@@ -162,7 +162,7 @@ void GtkSalObject::Show( BOOL bVisible )
}
}
-void GtkSalObject::Enable( BOOL )
+void GtkSalObject::Enable( sal_Bool )
{
}
@@ -217,7 +217,7 @@ void GtkSalObject::signalDestroy( GtkObject* pObj, gpointer object )
}
}
-void GtkSalObject::SetForwardKey( BOOL bEnable )
+void GtkSalObject::SetForwardKey( sal_Bool bEnable )
{
printf ("GtkSalObject::SetForwardKey\n");
if( bEnable )
@@ -226,4 +226,8 @@ void GtkSalObject::SetForwardKey( BOOL bEnable )
gtk_widget_set_events( GTK_WIDGET( m_pSocket ), ~(GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE) & gtk_widget_get_events( GTK_WIDGET( m_pSocket ) ) );
}
+void GtkSalObject::InterceptChildWindowKeyDown( sal_Bool /*bIntercept*/ )
+{
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/headless/svpbmp.cxx b/vcl/unx/headless/svpbmp.cxx
index 39f74e742550..2d8309af5eba 100644
--- a/vcl/unx/headless/svpbmp.cxx
+++ b/vcl/unx/headless/svpbmp.cxx
@@ -44,7 +44,7 @@ SvpSalBitmap::~SvpSalBitmap()
}
bool SvpSalBitmap::Create( const Size& rSize,
- USHORT nBitCount,
+ sal_uInt16 nBitCount,
const BitmapPalette& rPalette )
{
sal_uInt32 nFormat = SVP_DEFAULT_BITMAP_FORMAT;
@@ -112,7 +112,7 @@ bool SvpSalBitmap::Create( const SalBitmap& /*rSalBmp*/,
}
bool SvpSalBitmap::Create( const SalBitmap& /*rSalBmp*/,
- USHORT /*nNewBitCount*/ )
+ sal_uInt16 /*nNewBitCount*/ )
{
return false;
}
@@ -139,9 +139,9 @@ Size SvpSalBitmap::GetSize() const
return aSize;
}
-USHORT SvpSalBitmap::GetBitCount() const
+sal_uInt16 SvpSalBitmap::GetBitCount() const
{
- USHORT nDepth = 0;
+ sal_uInt16 nDepth = 0;
if( m_aBitmap.get() )
nDepth = getBitCountFromScanlineFormat( m_aBitmap->getScanlineFormat() );
return nDepth;
@@ -153,7 +153,7 @@ BitmapBuffer* SvpSalBitmap::AcquireBuffer( bool )
if( m_aBitmap.get() )
{
pBuf = new BitmapBuffer();
- USHORT nBitCount = 1;
+ sal_uInt16 nBitCount = 1;
switch( m_aBitmap->getScanlineFormat() )
{
case Format::ONE_BIT_MSB_GREY:
@@ -222,7 +222,7 @@ BitmapBuffer* SvpSalBitmap::AcquireBuffer( bool )
pBuf->mnHeight = aSize.getY();
pBuf->mnScanlineSize = m_aBitmap->getScanlineStride();
pBuf->mnBitCount = nBitCount;
- pBuf->mpBits = (BYTE*)m_aBitmap->getBuffer().get();
+ pBuf->mpBits = (sal_uInt8*)m_aBitmap->getBuffer().get();
if( nBitCount <= 8 )
{
if( m_aBitmap->getScanlineFormat() == Format::EIGHT_BIT_GREY ||
@@ -261,7 +261,7 @@ void SvpSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly )
{
// palette might have changed, clone device (but recycle
// memory)
- USHORT nBitCount = 0;
+ sal_uInt16 nBitCount = 0;
switch( m_aBitmap->getScanlineFormat() )
{
case Format::ONE_BIT_MSB_GREY:
diff --git a/vcl/unx/headless/svpbmp.hxx b/vcl/unx/headless/svpbmp.hxx
index 5ce5f5bff770..695d7226b0f0 100644
--- a/vcl/unx/headless/svpbmp.hxx
+++ b/vcl/unx/headless/svpbmp.hxx
@@ -47,19 +47,19 @@ public:
// SalBitmap
virtual bool Create( const Size& rSize,
- USHORT nBitCount,
+ sal_uInt16 nBitCount,
const BitmapPalette& rPal );
virtual bool Create( const SalBitmap& rSalBmp );
virtual bool Create( const SalBitmap& rSalBmp,
SalGraphics* pGraphics );
virtual bool Create( const SalBitmap& rSalBmp,
- USHORT nNewBitCount );
+ sal_uInt16 nNewBitCount );
virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
Size& rSize,
bool bMask = false );
virtual void Destroy();
virtual Size GetSize() const;
- virtual USHORT GetBitCount() const;
+ virtual sal_uInt16 GetBitCount() const;
virtual BitmapBuffer* AcquireBuffer( bool bReadOnly );
virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly );
diff --git a/vcl/unx/headless/svpdummies.cxx b/vcl/unx/headless/svpdummies.cxx
index 37c92faf92c9..3bf1a4da9cc0 100644
--- a/vcl/unx/headless/svpdummies.cxx
+++ b/vcl/unx/headless/svpdummies.cxx
@@ -51,17 +51,18 @@ SvpSalObject::~SvpSalObject()
}
void SvpSalObject::ResetClipRegion() {}
-USHORT SvpSalObject::GetClipRegionType() { return 0; }
-void SvpSalObject::BeginSetClipRegion( ULONG ) {}
+sal_uInt16 SvpSalObject::GetClipRegionType() { return 0; }
+void SvpSalObject::BeginSetClipRegion( sal_uLong ) {}
void SvpSalObject::UnionClipRegion( long, long, long, long ) {}
void SvpSalObject::EndSetClipRegion() {}
void SvpSalObject::SetPosSize( long, long, long, long ) {}
-void SvpSalObject::Show( BOOL ) {}
-void SvpSalObject::Enable( BOOL ) {}
+void SvpSalObject::Show( sal_Bool ) {}
+void SvpSalObject::Enable( sal_Bool ) {}
void SvpSalObject::GrabFocus() {}
void SvpSalObject::SetBackground() {}
void SvpSalObject::SetBackground( SalColor ) {}
const SystemEnvData* SvpSalObject::GetSystemData() const { return &m_aSystemChildData; }
+void SvpSalObject::InterceptChildWindowKeyDown( sal_Bool ) {}
// SalI18NImeStatus
SvpImeStatus::~SvpImeStatus() {}
diff --git a/vcl/unx/headless/svpdummies.hxx b/vcl/unx/headless/svpdummies.hxx
index 98cf2f5ebb92..86a9382adb96 100644
--- a/vcl/unx/headless/svpdummies.hxx
+++ b/vcl/unx/headless/svpdummies.hxx
@@ -45,20 +45,22 @@ public:
// overload all pure virtual methods
virtual void ResetClipRegion();
- virtual USHORT GetClipRegionType();
- virtual void BeginSetClipRegion( ULONG nRects );
+ virtual sal_uInt16 GetClipRegionType();
+ virtual void BeginSetClipRegion( sal_uLong nRects );
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
virtual void EndSetClipRegion();
virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight );
- virtual void Show( BOOL bVisible );
- virtual void Enable( BOOL nEnable );
+ virtual void Show( sal_Bool bVisible );
+ virtual void Enable( sal_Bool nEnable );
virtual void GrabFocus();
virtual void SetBackground();
virtual void SetBackground( SalColor nSalColor );
virtual const SystemEnvData* GetSystemData() const;
+
+ virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
};
class SvpImeStatus : public SalI18NImeStatus
diff --git a/vcl/unx/headless/svpframe.cxx b/vcl/unx/headless/svpframe.cxx
index ab86c3d851b2..1b8455557fac 100644
--- a/vcl/unx/headless/svpframe.cxx
+++ b/vcl/unx/headless/svpframe.cxx
@@ -40,7 +40,7 @@ SvpSalFrame* SvpSalFrame::s_pFocusFrame = NULL;
SvpSalFrame::SvpSalFrame( SvpSalInstance* pInstance,
SalFrame* pParent,
- ULONG nSalFrameStyle,
+ sal_uLong nSalFrameStyle,
SystemParentData* ) :
m_pInstance( pInstance ),
m_pParent( static_cast<SvpSalFrame*>(pParent) ),
@@ -147,10 +147,10 @@ void SvpSalFrame::ReleaseGraphics( SalGraphics* pGraphics )
delete pSvpGraphics;
}
-BOOL SvpSalFrame::PostEvent( void* pData )
+sal_Bool SvpSalFrame::PostEvent( void* pData )
{
m_pInstance->PostEvent( this, pData, SALEVENT_USEREVENT );
- return TRUE;
+ return sal_True;
}
void SvpSalFrame::PostPaint() const
@@ -166,7 +166,7 @@ void SvpSalFrame::SetTitle( const XubString& )
{
}
-void SvpSalFrame::SetIcon( USHORT )
+void SvpSalFrame::SetIcon( sal_uInt16 )
{
}
@@ -182,7 +182,7 @@ void SvpSalFrame::SetExtendedFrameStyle( SalExtStyle )
{
}
-void SvpSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
+void SvpSalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
{
if( bVisible && ! m_bVisible )
{
@@ -199,7 +199,7 @@ void SvpSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
}
}
-void SvpSalFrame::Enable( BOOL )
+void SvpSalFrame::Enable( sal_Bool )
{
}
@@ -215,7 +215,7 @@ void SvpSalFrame::SetMaxClientSize( long nWidth, long nHeight )
m_nMaxHeight = nHeight;
}
-void SvpSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags )
+void SvpSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags )
{
if( (nFlags & SAL_FRAME_POSSIZE_X) != 0 )
maGeometry.nX = nX;
@@ -312,7 +312,7 @@ void SvpSalFrame::SetWindowState( const SalFrameState *pState )
}
}
-BOOL SvpSalFrame::GetWindowState( SalFrameState* pState )
+sal_Bool SvpSalFrame::GetWindowState( SalFrameState* pState )
{
pState->mnState = SAL_FRAMESTATE_NORMAL;
pState->mnX = maGeometry.nX;
@@ -321,24 +321,24 @@ BOOL SvpSalFrame::GetWindowState( SalFrameState* pState )
pState->mnHeight = maGeometry.nHeight;
pState->mnMask = _FRAMESTATE_MASK_GEOMETRY | SAL_FRAMESTATE_MASK_STATE;
- return TRUE;
+ return sal_True;
}
-void SvpSalFrame::ShowFullScreen( BOOL, sal_Int32 )
+void SvpSalFrame::ShowFullScreen( sal_Bool, sal_Int32 )
{
SetPosSize( 0, 0, VIRTUAL_DESKTOP_WIDTH, VIRTUAL_DESKTOP_HEIGHT,
SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT );
}
-void SvpSalFrame::StartPresentation( BOOL )
+void SvpSalFrame::StartPresentation( sal_Bool )
{
}
-void SvpSalFrame::SetAlwaysOnTop( BOOL )
+void SvpSalFrame::SetAlwaysOnTop( sal_Bool )
{
}
-void SvpSalFrame::ToTop( USHORT )
+void SvpSalFrame::ToTop( sal_uInt16 )
{
GetFocus();
}
@@ -347,7 +347,7 @@ void SvpSalFrame::SetPointer( PointerStyle )
{
}
-void SvpSalFrame::CaptureMouse( BOOL )
+void SvpSalFrame::CaptureMouse( sal_Bool )
{
}
@@ -367,23 +367,23 @@ void SvpSalFrame::SetInputContext( SalInputContext* )
{
}
-void SvpSalFrame::EndExtTextInput( USHORT )
+void SvpSalFrame::EndExtTextInput( sal_uInt16 )
{
}
-String SvpSalFrame::GetKeyName( USHORT )
+String SvpSalFrame::GetKeyName( sal_uInt16 )
{
return String();
}
-String SvpSalFrame::GetSymbolKeyName( const XubString&, USHORT )
+String SvpSalFrame::GetSymbolKeyName( const XubString&, sal_uInt16 )
{
return String();
}
-BOOL SvpSalFrame::MapUnicodeToKeyCode( sal_Unicode, LanguageType, KeyCode& )
+sal_Bool SvpSalFrame::MapUnicodeToKeyCode( sal_Unicode, LanguageType, KeyCode& )
{
- return FALSE;
+ return sal_False;
}
LanguageType SvpSalFrame::GetInputLanguage()
@@ -423,7 +423,7 @@ SalFrame::SalIndicatorState SvpSalFrame::GetIndicatorState()
return aState;
}
-void SvpSalFrame::SimulateKeyPress( USHORT /*nKeyCode*/ )
+void SvpSalFrame::SimulateKeyPress( sal_uInt16 /*nKeyCode*/ )
{
}
@@ -447,7 +447,7 @@ void SvpSalFrame::ResetClipRegion()
{
}
-void SvpSalFrame::BeginSetClipRegion( ULONG )
+void SvpSalFrame::BeginSetClipRegion( sal_uLong )
{
}
diff --git a/vcl/unx/headless/svpframe.hxx b/vcl/unx/headless/svpframe.hxx
index a552eff871b4..be160626957a 100644
--- a/vcl/unx/headless/svpframe.hxx
+++ b/vcl/unx/headless/svpframe.hxx
@@ -41,9 +41,9 @@ class SvpSalGraphics;
class SvpSalFrame : public SalFrame, public SvpElement
{
SvpSalInstance* m_pInstance;
- SvpSalFrame* m_pParent; // pointer to parent frame
+ SvpSalFrame* m_pParent; // pointer to parent frame
std::list< SvpSalFrame* > m_aChildren; // List of child frames
- ULONG m_nStyle;
+ sal_uLong m_nStyle;
bool m_bVisible;
long m_nMinWidth;
long m_nMinHeight;
@@ -59,7 +59,7 @@ class SvpSalFrame : public SalFrame, public SvpElement
public:
SvpSalFrame( SvpSalInstance* pInstance,
SalFrame* pParent,
- ULONG nSalFrameStyle,
+ sal_uLong nSalFrameStyle,
SystemParentData* pSystemParent = NULL );
virtual ~SvpSalFrame();
@@ -74,39 +74,39 @@ public:
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual BOOL PostEvent( void* pData );
+ virtual sal_Bool PostEvent( void* pData );
virtual void SetTitle( const XubString& rTitle );
- virtual void SetIcon( USHORT nIcon );
+ virtual void SetIcon( sal_uInt16 nIcon );
virtual void SetMenu( SalMenu* pMenu );
virtual void DrawMenuBar();
virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle );
- virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE );
- virtual void Enable( BOOL bEnable );
+ virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = sal_False );
+ virtual void Enable( sal_Bool bEnable );
virtual void SetMinClientSize( long nWidth, long nHeight );
virtual void SetMaxClientSize( long nWidth, long nHeight );
- virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags );
+ virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags );
virtual void GetClientSize( long& rWidth, long& rHeight );
virtual void GetWorkArea( Rectangle& rRect );
virtual SalFrame* GetParent() const;
virtual void SetWindowState( const SalFrameState* pState );
- virtual BOOL GetWindowState( SalFrameState* pState );
- virtual void ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay );
- virtual void StartPresentation( BOOL bStart );
- virtual void SetAlwaysOnTop( BOOL bOnTop );
- virtual void ToTop( USHORT nFlags );
+ virtual sal_Bool GetWindowState( SalFrameState* pState );
+ virtual void ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay );
+ virtual void StartPresentation( sal_Bool bStart );
+ virtual void SetAlwaysOnTop( sal_Bool bOnTop );
+ virtual void ToTop( sal_uInt16 nFlags );
virtual void SetPointer( PointerStyle ePointerStyle );
- virtual void CaptureMouse( BOOL bMouse );
+ virtual void CaptureMouse( sal_Bool bMouse );
virtual void SetPointerPos( long nX, long nY );
using SalFrame::Flush;
virtual void Flush();
virtual void Sync();
virtual void SetInputContext( SalInputContext* pContext );
- virtual void EndExtTextInput( USHORT nFlags );
- virtual String GetKeyName( USHORT nKeyCode );
- virtual String GetSymbolKeyName( const XubString& rFontName, USHORT nKeyCode );
- virtual BOOL MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode );
+ virtual void EndExtTextInput( sal_uInt16 nFlags );
+ virtual String GetKeyName( sal_uInt16 nKeyCode );
+ virtual String GetSymbolKeyName( const XubString& rFontName, sal_uInt16 nKeyCode );
+ virtual sal_Bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode );
virtual LanguageType GetInputLanguage();
virtual SalBitmap* SnapShot();
virtual void UpdateSettings( AllSettings& rSettings );
@@ -114,12 +114,12 @@ public:
virtual const SystemEnvData* GetSystemData() const;
virtual SalPointerState GetPointerState();
virtual SalIndicatorState GetIndicatorState();
- virtual void SimulateKeyPress( USHORT nKeyCode );
+ virtual void SimulateKeyPress( sal_uInt16 nKeyCode );
virtual void SetParent( SalFrame* pNewParent );
virtual bool SetPluginParent( SystemParentData* pNewParent );
virtual void SetBackgroundBitmap( SalBitmap* pBitmap );
virtual void ResetClipRegion();
- virtual void BeginSetClipRegion( ULONG nRects );
+ virtual void BeginSetClipRegion( sal_uLong nRects );
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
virtual void EndSetClipRegion();
diff --git a/vcl/unx/headless/svpgdi.cxx b/vcl/unx/headless/svpgdi.cxx
index 9f4df0d29775..8c9a4e42a65a 100644
--- a/vcl/unx/headless/svpgdi.cxx
+++ b/vcl/unx/headless/svpgdi.cxx
@@ -30,6 +30,7 @@
#include "svpbmp.hxx"
#include <vcl/sysdata.hxx>
+#include <vcl/region.h>
#include <basegfx/range/b2drange.hxx>
#include <basegfx/range/b2irange.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
@@ -132,7 +133,7 @@ void SvpSalGraphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY )
rDPIX = rDPIY = 96;
}
-USHORT SvpSalGraphics::GetBitCount() const
+sal_uInt16 SvpSalGraphics::GetBitCount() const
{
return SvpElement::getBitCountFromScanlineFormat( m_aDevice->getScanlineFormat() );
}
@@ -153,11 +154,16 @@ void SvpSalGraphics::ResetClipRegion()
m_aClipMap.reset();
}
-void SvpSalGraphics::BeginSetClipRegion( ULONG n )
+bool SvpSalGraphics::setClipRegion( const Region& i_rClip )
{
- if( n <= 1 )
+ if( i_rClip.IsEmpty() )
+ m_aClipMap.reset();
+ else if( i_rClip.GetRectCount() == 1 )
{
m_aClipMap.reset();
+ Rectangle aBoundRect( i_rClip.GetBoundRect() );
+ m_aDevice = basebmp::subsetBitmapDevice( m_aOrigDevice,
+ basegfx::B2IRange(aBoundRect.Left(),aBoundRect.Top(),aBoundRect.Right(),aBoundRect.Bottom()) );
}
else
{
@@ -165,34 +171,22 @@ void SvpSalGraphics::BeginSetClipRegion( ULONG n )
B2IVector aSize = m_aDevice->getSize();
m_aClipMap = createBitmapDevice( aSize, false, Format::ONE_BIT_MSB_GREY );
m_aClipMap->clear( basebmp::Color(0xFFFFFFFF) );
- }
-}
-BOOL SvpSalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeight )
-{
- if( m_aClipMap )
- {
- B2DPolyPolygon aFull;
- aFull.append( tools::createPolygonFromRect( B2DRectangle( nX, nY, nX+nWidth, nY+nHeight ) ) );
- m_aClipMap->fillPolyPolygon( aFull, basebmp::Color(0), DrawMode_PAINT );
- }
- else
- {
- m_aDevice = basebmp::subsetBitmapDevice( m_aOrigDevice,
- basegfx::B2IRange(nX,nY,nX+nWidth,nY+nHeight) );
+ ImplRegionInfo aInfo;
+ long nX, nY, nW, nH;
+ bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
+ while( bRegionRect )
+ {
+ if ( nW && nH )
+ {
+ B2DPolyPolygon aFull;
+ aFull.append( tools::createPolygonFromRect( B2DRectangle( nX, nY, nX+nW, nY+nH ) ) );
+ m_aClipMap->fillPolyPolygon( aFull, basebmp::Color(0), DrawMode_PAINT );
+ }
+ bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
+ }
}
-
- return TRUE;
-}
-
-bool SvpSalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- // TODO: implement and advertise OutDevSupport_B2DClip support
- return false;
-}
-
-void SvpSalGraphics::EndSetClipRegion()
-{
+ return true;
}
void SvpSalGraphics::SetLineColor()
@@ -310,13 +304,13 @@ void SvpSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight )
dbgOut( m_aDevice );
}
-void SvpSalGraphics::drawPolyLine( ULONG nPoints, const SalPoint* pPtAry )
+void SvpSalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry )
{
if( m_bUseLineColor && nPoints )
{
B2DPolygon aPoly;
aPoly.append( B2DPoint( pPtAry->mnX, pPtAry->mnY ), nPoints );
- for( ULONG i = 1; i < nPoints; i++ )
+ for( sal_uLong i = 1; i < nPoints; i++ )
aPoly.setB2DPoint( i, B2DPoint( pPtAry[i].mnX, pPtAry[i].mnY ) );
aPoly.setClosed( false );
m_aDevice->drawPolygon( aPoly, m_aLineColor, m_aDrawMode, m_aClipMap );
@@ -324,13 +318,13 @@ void SvpSalGraphics::drawPolyLine( ULONG nPoints, const SalPoint* pPtAry )
dbgOut( m_aDevice );
}
-void SvpSalGraphics::drawPolygon( ULONG nPoints, const SalPoint* pPtAry )
+void SvpSalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry )
{
if( ( m_bUseLineColor || m_bUseFillColor ) && nPoints )
{
B2DPolygon aPoly;
aPoly.append( B2DPoint( pPtAry->mnX, pPtAry->mnY ), nPoints );
- for( ULONG i = 1; i < nPoints; i++ )
+ for( sal_uLong i = 1; i < nPoints; i++ )
aPoly.setB2DPoint( i, B2DPoint( pPtAry[i].mnX, pPtAry[i].mnY ) );
if( m_bUseFillColor )
{
@@ -361,7 +355,7 @@ void SvpSalGraphics::drawPolyPolygon( sal_uInt32 nPoly,
PCONSTSALPOINT pPoints = pPtAry[nPolygon];
B2DPolygon aPoly;
aPoly.append( B2DPoint( pPoints->mnX, pPoints->mnY ), nPoints );
- for( ULONG i = 1; i < nPoints; i++ )
+ for( sal_uInt32 i = 1; i < nPoints; i++ )
aPoly.setB2DPoint( i, B2DPoint( pPoints[i].mnX, pPoints[i].mnY ) );
aPolyPoly.append( aPoly );
@@ -389,16 +383,16 @@ bool SvpSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon&, double /*fTrans
return false;
}
-sal_Bool SvpSalGraphics::drawPolyLineBezier( ULONG,
+sal_Bool SvpSalGraphics::drawPolyLineBezier( sal_uLong,
const SalPoint*,
- const BYTE* )
+ const sal_uInt8* )
{
return sal_False;
}
-sal_Bool SvpSalGraphics::drawPolygonBezier( ULONG,
+sal_Bool SvpSalGraphics::drawPolygonBezier( sal_uLong,
const SalPoint*,
- const BYTE* )
+ const sal_uInt8* )
{
return sal_False;
}
@@ -406,7 +400,7 @@ sal_Bool SvpSalGraphics::drawPolygonBezier( ULONG,
sal_Bool SvpSalGraphics::drawPolyPolygonBezier( sal_uInt32,
const sal_uInt32*,
const SalPoint* const*,
- const BYTE* const* )
+ const sal_uInt8* const* )
{
return sal_False;
}
@@ -423,7 +417,7 @@ void SvpSalGraphics::copyArea( long nDestX,
long nSrcY,
long nSrcWidth,
long nSrcHeight,
- USHORT /*nFlags*/ )
+ sal_uInt16 /*nFlags*/ )
{
B2IRange aSrcRect( nSrcX, nSrcY, nSrcX+nSrcWidth, nSrcY+nSrcHeight );
B2IRange aDestRect( nDestX, nDestY, nDestX+nSrcWidth, nDestY+nSrcHeight );
@@ -539,21 +533,21 @@ void SvpSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInv
dbgOut( m_aDevice );
}
-void SvpSalGraphics::invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert /*nFlags*/ )
+void SvpSalGraphics::invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert /*nFlags*/ )
{
// FIXME: handle SAL_INVERT_50 and SAL_INVERT_TRACKFRAME
B2DPolygon aPoly;
aPoly.append( B2DPoint( pPtAry->mnX, pPtAry->mnY ), nPoints );
- for( ULONG i = 1; i < nPoints; i++ )
+ for( sal_uLong i = 1; i < nPoints; i++ )
aPoly.setB2DPoint( i, B2DPoint( pPtAry[i].mnX, pPtAry[i].mnY ) );
aPoly.setClosed( true );
m_aDevice->fillPolyPolygon( B2DPolyPolygon(aPoly), basebmp::Color( 0xffffff ), DrawMode_XOR, m_aClipMap );
dbgOut( m_aDevice );
}
-BOOL SvpSalGraphics::drawEPS( long, long, long, long, void*, ULONG )
+sal_Bool SvpSalGraphics::drawEPS( long, long, long, long, void*, sal_uLong )
{
- return FALSE;
+ return sal_False;
}
SystemFontData SvpSalGraphics::GetSysFontData( int nFallbacklevel ) const
diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx
index b385d3f35b45..0489606e9fce 100644
--- a/vcl/unx/headless/svpgdi.hxx
+++ b/vcl/unx/headless/svpgdi.hxx
@@ -65,20 +65,17 @@ public:
// overload all pure virtual methods
virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
- virtual USHORT GetBitCount() const;
+ virtual sal_uInt16 GetBitCount() const;
virtual long GetGraphicsWidth() const;
virtual void ResetClipRegion();
- virtual void BeginSetClipRegion( ULONG nCount );
- virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
- virtual void EndSetClipRegion();
+ virtual bool setClipRegion( const Region& );
virtual void SetLineColor();
virtual void SetLineColor( SalColor nSalColor );
virtual void SetFillColor();
- virtual void SetFillColor( SalColor nSalColor );
+ virtual void SetFillColor( SalColor nSalColor );
virtual void SetXORMode( bool bSet, bool );
@@ -86,15 +83,15 @@ public:
virtual void SetROPFillColor( SalROPColor nROPColor );
virtual void SetTextColor( SalColor nSalColor );
- virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
+ virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel );
virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
- virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
- virtual ImplFontCharMap* GetImplFontCharMap() const;
+ virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs );
+ virtual const ImplFontCharMap* GetImplFontCharMap() const;
virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
virtual void GetDevFontList( ImplDevFontList* );
virtual void GetDevFontSubstList( OutputDevice* );
virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
- virtual BOOL CreateFontSubset( const rtl::OUString& rToFile,
+ virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData*,
sal_Int32* pGlyphIDs,
sal_uInt8* pEncoding,
@@ -113,8 +110,8 @@ public:
bool bVertical,
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc );
- virtual BOOL GetGlyphBoundRect( long nIndex, Rectangle& );
- virtual BOOL GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
+ virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& );
+ virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
virtual void DrawServerFontLayout( const ServerFontLayout& );
virtual bool supportsOperation( OutDevSupportType ) const;
@@ -124,21 +121,21 @@ public:
virtual void drawRect( long nX, long nY, long nWidth, long nHeight );
virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency );
virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin );
- virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry );
- virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry );
+ virtual void drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry );
+ virtual void drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry );
virtual void drawPolyPolygon( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
PCONSTSALPOINT* pPtAry );
- virtual sal_Bool drawPolyLineBezier( ULONG nPoints,
+ virtual sal_Bool drawPolyLineBezier( sal_uLong nPoints,
const SalPoint* pPtAry,
- const BYTE* pFlgAry );
- virtual sal_Bool drawPolygonBezier( ULONG nPoints,
+ const sal_uInt8* pFlgAry );
+ virtual sal_Bool drawPolygonBezier( sal_uLong nPoints,
const SalPoint* pPtAry,
- const BYTE* pFlgAry );
+ const sal_uInt8* pFlgAry );
virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
- const BYTE* const* pFlgAry );
+ const sal_uInt8* const* pFlgAry );
virtual void copyArea( long nDestX,
long nDestY,
@@ -146,7 +143,7 @@ public:
long nSrcY,
long nSrcWidth,
long nSrcHeight,
- USHORT nFlags );
+ sal_uInt16 nFlags );
virtual void copyBits( const SalTwoRect* pPosAry,
SalGraphics* pSrcGraphics );
virtual void drawBitmap( const SalTwoRect* pPosAry,
@@ -163,9 +160,9 @@ public:
virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight );
virtual SalColor getPixel( long nX, long nY );
virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags );
- virtual void invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags );
+ virtual void invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags );
- virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize );
+ virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize );
virtual SystemGraphicsData GetGraphicsData() const;
virtual SystemFontData GetSysFontData( int nFallbacklevel ) const;
diff --git a/vcl/unx/headless/svpinst.cxx b/vcl/unx/headless/svpinst.cxx
index 10faf81434ba..f4fe1dbdc649 100644
--- a/vcl/unx/headless/svpinst.cxx
+++ b/vcl/unx/headless/svpinst.cxx
@@ -39,7 +39,7 @@
#include <vcl/salframe.hxx>
#include <vcl/svdata.hxx>
-#include <vcl/salatype.hxx>
+#include <vcl/apptypes.hxx>
#include <vcl/saldatabasic.hxx>
#include <vcl/solarmutex.hxx>
#include <sal/types.h>
@@ -124,7 +124,7 @@ SvpSalInstance::~SvpSalInstance()
osl_destroyMutex( m_aEventGuard );
}
-void SvpSalInstance::PostEvent( const SalFrame* pFrame, void* pData, USHORT nEvent )
+void SvpSalInstance::PostEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent )
{
if( osl_acquireMutex( m_aEventGuard ) )
{
@@ -134,7 +134,7 @@ void SvpSalInstance::PostEvent( const SalFrame* pFrame, void* pData, USHORT nEve
Wakeup();
}
-void SvpSalInstance::CancelEvent( const SalFrame* pFrame, void* pData, USHORT nEvent )
+void SvpSalInstance::CancelEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent )
{
if( osl_acquireMutex( m_aEventGuard ) )
{
@@ -194,7 +194,7 @@ inline int operator >= ( const timeval &t1, const timeval &t2 )
return t1.tv_usec >= t2.tv_usec;
return t1.tv_sec > t2.tv_sec;
}
-inline timeval &operator += ( timeval &t1, ULONG t2 )
+inline timeval &operator += ( timeval &t1, sal_uLong t2 )
{
t1.tv_sec += t2 / 1000;
t1.tv_usec += t2 ? (t2 % 1000) * 1000 : 500;
@@ -237,12 +237,12 @@ bool SvpSalInstance::CheckTimeout( bool bExecuteTimers )
return bRet;
}
-SalFrame* SvpSalInstance::CreateChildFrame( SystemParentData* pParent, ULONG nStyle )
+SalFrame* SvpSalInstance::CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle )
{
return new SvpSalFrame( this, NULL, nStyle, pParent );
}
-SalFrame* SvpSalInstance::CreateFrame( SalFrame* pParent, ULONG nStyle )
+SalFrame* SvpSalInstance::CreateFrame( SalFrame* pParent, sal_uLong nStyle )
{
return new SvpSalFrame( this, pParent, nStyle );
}
@@ -252,7 +252,7 @@ void SvpSalInstance::DestroyFrame( SalFrame* pFrame )
delete pFrame;
}
-SalObject* SvpSalInstance::CreateObject( SalFrame*, SystemWindowData*, BOOL )
+SalObject* SvpSalInstance::CreateObject( SalFrame*, SystemWindowData*, sal_Bool )
{
return new SvpSalObject();
}
@@ -264,7 +264,7 @@ void SvpSalInstance::DestroyObject( SalObject* pObject )
SalVirtualDevice* SvpSalInstance::CreateVirtualDevice( SalGraphics*,
long nDX, long nDY,
- USHORT nBitCount, const SystemGraphicsData* )
+ sal_uInt16 nBitCount, const SystemGraphicsData* )
{
SvpSalVirtualDevice* pNew = new SvpSalVirtualDevice( nBitCount );
pNew->SetSize( nDX, nDY );
@@ -301,13 +301,13 @@ osl::SolarMutex* SvpSalInstance::GetYieldMutex()
return &m_aYieldMutex;
}
-ULONG SvpSalInstance::ReleaseYieldMutex()
+sal_uLong SvpSalInstance::ReleaseYieldMutex()
{
if ( m_aYieldMutex.GetThreadId() ==
osl::Thread::getCurrentIdentifier() )
{
- ULONG nCount = m_aYieldMutex.GetAcquireCount();
- ULONG n = nCount;
+ sal_uLong nCount = m_aYieldMutex.GetAcquireCount();
+ sal_uLong n = nCount;
while ( n )
{
m_aYieldMutex.release();
@@ -320,7 +320,7 @@ ULONG SvpSalInstance::ReleaseYieldMutex()
return 0;
}
-void SvpSalInstance::AcquireYieldMutex( ULONG nCount )
+void SvpSalInstance::AcquireYieldMutex( sal_uLong nCount )
{
while ( nCount )
{
@@ -329,13 +329,25 @@ void SvpSalInstance::AcquireYieldMutex( ULONG nCount )
}
}
+bool SvpSalInstance::CheckYieldMutex()
+{
+ bool bRet = true;
+
+ if ( m_aYieldMutex.GetThreadId() != ::osl::Thread::getCurrentIdentifier() )
+ {
+ bRet = false;
+ }
+
+ return bRet;
+}
+
void SvpSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
{
// first, check for already queued events.
// release yield mutex
std::list< SalUserEvent > aEvents;
- ULONG nAcquireCount = ReleaseYieldMutex();
+ sal_uLong nAcquireCount = ReleaseYieldMutex();
if( osl_acquireMutex( m_aEventGuard ) )
{
if( ! m_aUserEvents.empty() )
@@ -414,31 +426,13 @@ void SvpSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
}
}
-bool SvpSalInstance::AnyInput( USHORT nType )
+bool SvpSalInstance::AnyInput( sal_uInt16 nType )
{
if( (nType & INPUT_TIMER) != 0 )
return CheckTimeout( false );
return false;
}
-SalMenu* SvpSalInstance::CreateMenu( BOOL )
-{
- return NULL;
-}
-
-void SvpSalInstance::DestroyMenu( SalMenu* )
-{
-}
-
-SalMenuItem* SvpSalInstance::CreateMenuItem( const SalItemParams* )
-{
- return NULL;
-}
-
-void SvpSalInstance::DestroyMenuItem( SalMenuItem* )
-{
-}
-
SalSession* SvpSalInstance::CreateSalSession()
{
return NULL;
@@ -504,7 +498,7 @@ void SvpSalInstance::StopTimer()
m_nTimeoutMS = 0;
}
-void SvpSalInstance::StartTimer( ULONG nMS )
+void SvpSalInstance::StartTimer( sal_uLong nMS )
{
timeval Timeout (m_aTimeout); // previous timeout.
gettimeofday (&m_aTimeout, 0);
@@ -532,7 +526,7 @@ void SvpSalTimer::Stop()
m_pInstance->StopTimer();
}
-void SvpSalTimer::Start( ULONG nMS )
+void SvpSalTimer::Start( sal_uLong nMS )
{
m_pInstance->StartTimer( nMS );
}
diff --git a/vcl/unx/headless/svpinst.hxx b/vcl/unx/headless/svpinst.hxx
index 622eda072e41..eaffc99978d6 100644
--- a/vcl/unx/headless/svpinst.hxx
+++ b/vcl/unx/headless/svpinst.hxx
@@ -52,7 +52,7 @@
class SvpSalYieldMutex : public ::vcl::SolarMutexObject
{
protected:
- ULONG mnCount;
+ sal_uLong mnCount;
oslThreadIdentifier mnThreadId;
public:
@@ -62,7 +62,7 @@ public:
virtual void release();
virtual sal_Bool tryToAcquire();
- ULONG GetAcquireCount() const { return mnCount; }
+ sal_uLong GetAcquireCount() const { return mnCount; }
oslThreadIdentifier GetThreadId() const { return mnThreadId; }
};
@@ -78,7 +78,7 @@ public:
virtual ~SvpSalTimer();
// overload all pure virtual methods
- virtual void Start( ULONG nMS );
+ virtual void Start( sal_uLong nMS );
virtual void Stop();
};
@@ -89,7 +89,7 @@ class SvpSalFrame;
class SvpSalInstance : public SalInstance
{
timeval m_aTimeout;
- ULONG m_nTimeoutMS;
+ sal_uLong m_nTimeoutMS;
int m_pTimeoutFDS[2];
SvpSalYieldMutex m_aYieldMutex;
@@ -98,9 +98,9 @@ class SvpSalInstance : public SalInstance
{
const SalFrame* m_pFrame;
void* m_pData;
- USHORT m_nEvent;
+ sal_uInt16 m_nEvent;
- SalUserEvent( const SalFrame* pFrame, void* pData, USHORT nEvent = SALEVENT_USEREVENT )
+ SalUserEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent = SALEVENT_USEREVENT )
: m_pFrame( pFrame ),
m_pData( pData ),
m_nEvent( nEvent )
@@ -120,10 +120,10 @@ public:
SvpSalInstance();
virtual ~SvpSalInstance();
- void PostEvent( const SalFrame* pFrame, void* pData, USHORT nEvent );
- void CancelEvent( const SalFrame* pFrame, void* pData, USHORT nEvent );
+ void PostEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent );
+ void CancelEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent );
- void StartTimer( ULONG nMS );
+ void StartTimer( sal_uLong nMS );
void StopTimer();
void Wakeup();
@@ -134,12 +134,12 @@ public:
bool CheckTimeout( bool bExecuteTimers = true );
// Frame
- virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle );
- virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
+ virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle );
+ virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle );
virtual void DestroyFrame( SalFrame* pFrame );
// Object (System Child Window)
- virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE );
+ virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True );
virtual void DestroyObject( SalObject* pObject );
// VirtualDevice
@@ -148,7 +148,7 @@ public:
// pData allows for using a system dependent graphics or device context
virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
long nDX, long nDY,
- USHORT nBitCount, const SystemGraphicsData *pData = NULL );
+ sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL );
virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice );
// Printer
@@ -177,20 +177,15 @@ public:
// YieldMutex
virtual osl::SolarMutex* GetYieldMutex();
- virtual ULONG ReleaseYieldMutex();
- virtual void AcquireYieldMutex( ULONG nCount );
+ virtual sal_uLong ReleaseYieldMutex();
+ virtual void AcquireYieldMutex( sal_uLong nCount );
+ virtual bool CheckYieldMutex();
// wait next event and dispatch
// must returned by UserEvent (SalFrame::PostEvent)
// and timer
virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
- virtual bool AnyInput( USHORT nType );
-
- // Menues
- virtual SalMenu* CreateMenu( BOOL bMenuBar );
- virtual void DestroyMenu( SalMenu* pMenu);
- virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData );
- virtual void DestroyMenuItem( SalMenuItem* pItem );
+ virtual bool AnyInput( sal_uInt16 nType );
// may return NULL to disable session management
virtual SalSession* CreateSalSession();
diff --git a/vcl/unx/headless/svpprn.cxx b/vcl/unx/headless/svpprn.cxx
index dbbfdd8e312e..35ca451e432c 100644
--- a/vcl/unx/headless/svpprn.cxx
+++ b/vcl/unx/headless/svpprn.cxx
@@ -162,7 +162,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
if( rData.getStreamBuffer( pBuffer, nBytes ) )
{
pJobSetup->mnDriverDataLen = nBytes;
- pJobSetup->mpDriverData = (BYTE*)pBuffer;
+ pJobSetup->mpDriverData = (sal_uInt8*)pBuffer;
}
else
{
@@ -302,9 +302,9 @@ String SvpSalInstance::GetDefaultPrinter()
// -----------------------------------------------------------------------
-BOOL SvpSalInfoPrinter::Setup( SalFrame*, ImplJobSetup* )
+sal_Bool SvpSalInfoPrinter::Setup( SalFrame*, ImplJobSetup* )
{
- return FALSE;
+ return sal_False;
}
/*
diff --git a/vcl/unx/headless/svpprn.hxx b/vcl/unx/headless/svpprn.hxx
index 17a1d32915d9..52e8fbad4f54 100644
--- a/vcl/unx/headless/svpprn.hxx
+++ b/vcl/unx/headless/svpprn.hxx
@@ -40,7 +40,7 @@ class PspGraphics;
class SvpSalInfoPrinter : public PspSalInfoPrinter
{
public:
- virtual BOOL Setup( SalFrame* pFrame, ImplJobSetup* pSetupData );
+ virtual sal_Bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData );
};
class SvpSalPrinter : public PspSalPrinter
@@ -48,8 +48,8 @@ class SvpSalPrinter : public PspSalPrinter
public:
SvpSalPrinter( SalInfoPrinter* pInfoPrinter ) : PspSalPrinter(pInfoPrinter) {}
- virtual BOOL StartJob( const XubString* pFileName, const XubString& rJobName,
- const XubString& rAppName, ULONG nCopies, bool bCollate,
+ virtual sal_Bool StartJob( const XubString* pFileName, const XubString& rJobName,
+ const XubString& rAppName, sal_uLong nCopies, bool bCollate,
bool /*bDirect*/, ImplJobSetup* pSetupData )
{
return SvpSalPrinter::StartJob( pFileName, rJobName, rAppName, nCopies, bCollate, false, pSetupData );
diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx
index cc2e2c9e20ac..7200019db9d2 100644
--- a/vcl/unx/headless/svppspgraphics.cxx
+++ b/vcl/unx/headless/svppspgraphics.cxx
@@ -44,6 +44,7 @@
#include "vcl/svapp.hxx"
#include "vcl/salprn.hxx"
#include "vcl/sysdata.hxx"
+#include "vcl/region.h"
#include "basegfx/vector/b2ivector.hxx"
#include "basegfx/point/b2ipoint.hxx"
@@ -205,7 +206,7 @@ void PspGraphics::GetResolution( sal_Int32 &rDPIX, sal_Int32 &rDPIY )
}
}
-USHORT PspGraphics::GetBitCount() const
+sal_uInt16 PspGraphics::GetBitCount() const
{
return m_pPrinterGfx->GetBitCount();
}
@@ -217,28 +218,27 @@ long PspGraphics::GetGraphicsWidth() const
void PspGraphics::ResetClipRegion()
{
- m_pPrinterGfx->ResetClipRegion ();
+ m_pPrinterGfx->ResetClipRegion();
}
-void PspGraphics::BeginSetClipRegion( ULONG n )
+bool PspGraphics::setClipRegion( const Region& i_rClip )
{
- m_pPrinterGfx->BeginSetClipRegion(n);
-}
-
-BOOL PspGraphics::unionClipRegion( long nX, long nY, long nDX, long nDY )
-{
- return (BOOL)m_pPrinterGfx->UnionClipRegion (nX, nY, nDX, nDY);
-}
-
-bool PspGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- // TODO: implement and advertise OutDevSupport_B2DClip support
- return false;
-}
+ // TODO: support polygonal clipregions here
+ m_pPrinterGfx->BeginSetClipRegion( i_rClip.GetRectCount() );
-void PspGraphics::EndSetClipRegion()
-{
- m_pPrinterGfx->EndSetClipRegion ();
+ ImplRegionInfo aInfo;
+ long nX, nY, nW, nH;
+ bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
+ while( bRegionRect )
+ {
+ if ( nW && nH )
+ {
+ m_pPrinterGfx->UnionClipRegion( nX, nY, nW, nH );
+ }
+ bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
+ }
+ m_pPrinterGfx->EndSetClipRegion();
+ return true;
}
void PspGraphics::SetLineColor()
@@ -306,12 +306,12 @@ void PspGraphics::drawRect( long nX, long nY, long nDX, long nDY )
m_pPrinterGfx->DrawRect (Rectangle(Point(nX, nY), Size(nDX, nDY)));
}
-void PspGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry )
+void PspGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry )
{
m_pPrinterGfx->DrawPolyLine (nPoints, (Point*)pPtAry);
}
-void PspGraphics::drawPolygon( ULONG nPoints, const SalPoint* pPtAry )
+void PspGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry )
{
// Point must be equal to SalPoint! see vcl/inc/salgtype.hxx
m_pPrinterGfx->DrawPolygon (nPoints, (Point*)pPtAry);
@@ -330,13 +330,13 @@ bool PspGraphics::drawPolyLine( const ::basegfx::B2DPolygon&, double /*fTranspar
return false;
}
-sal_Bool PspGraphics::drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
+sal_Bool PspGraphics::drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry )
{
m_pPrinterGfx->DrawPolyLineBezier (nPoints, (Point*)pPtAry, pFlgAry);
return sal_True;
}
-sal_Bool PspGraphics::drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
+sal_Bool PspGraphics::drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry )
{
m_pPrinterGfx->DrawPolygonBezier (nPoints, (Point*)pPtAry, pFlgAry);
return sal_True;
@@ -345,10 +345,10 @@ sal_Bool PspGraphics::drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry,
sal_Bool PspGraphics::drawPolyPolygonBezier( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
- const BYTE* const* pFlgAry )
+ const sal_uInt8* const* pFlgAry )
{
// Point must be equal to SalPoint! see vcl/inc/salgtype.hxx
- m_pPrinterGfx->DrawPolyPolygonBezier (nPoly, pPoints, (Point**)pPtAry, (BYTE**)pFlgAry);
+ m_pPrinterGfx->DrawPolyPolygonBezier (nPoly, pPoints, (Point**)pPtAry, (sal_uInt8**)pFlgAry);
return sal_True;
}
@@ -358,13 +358,13 @@ bool PspGraphics::drawPolyPolygon( const basegfx::B2DPolyPolygon&, double /*fTra
return false;
}
-void PspGraphics::invert( ULONG /*nPoints*/,
+void PspGraphics::invert( sal_uLong /*nPoints*/,
const SalPoint* /*pPtAry*/,
SalInvert /*nFlags*/ )
{
DBG_ASSERT( 0, "Error: PrinterGfx::Invert() not implemented" );
}
-BOOL PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize )
+sal_Bool PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize )
{
return m_pPrinterGfx->DrawEPS( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ), pPtr, nSize );
}
@@ -378,7 +378,7 @@ void PspGraphics::copyBits( const SalTwoRect* /*pPosAry*/,
void PspGraphics::copyArea ( long /*nDestX*/, long /*nDestY*/,
long /*nSrcX*/, long /*nSrcY*/,
long /*nSrcWidth*/, long /*nSrcHeight*/,
- USHORT /*nFlags*/ )
+ sal_uInt16 /*nFlags*/ )
{
OSL_FAIL( "Error: PrinterGfx::CopyArea() not implemented" );
}
@@ -684,16 +684,13 @@ void PspGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout )
DrawPrinterLayout( rLayout, *m_pPrinterGfx, true );
}
-ImplFontCharMap* PspGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* PspGraphics::GetImplFontCharMap() const
{
- // TODO: get ImplFontCharMap directly from fonts
if( !m_pServerFont[0] )
return NULL;
- CmapResult aCmapResult;
- if( !m_pServerFont[0]->GetFontCodeRanges( aCmapResult ) )
- return NULL;
- return new ImplFontCharMap( aCmapResult );
+ const ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap();
+ return pIFCMap;
}
bool PspGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
@@ -703,7 +700,7 @@ bool PspGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabiliti
return m_pServerFont[0]->GetFontCapabilities(rFontCapabilities);
}
-USHORT PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel )
+sal_uInt16 PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel )
{
// release all fonts that are to be overridden
for( int i = nFallbackLevel; i < MAX_FALLBACK; ++i )
@@ -828,10 +825,10 @@ void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int )
}
}
-ULONG PspGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData *pKernPairs )
+sal_uLong PspGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPairs )
{
const ::std::list< ::psp::KernPair >& rPairs( m_pPrinterGfx->getKernPairs() );
- ULONG nHavePairs = rPairs.size();
+ sal_uLong nHavePairs = rPairs.size();
if( pKernPairs && nPairs )
{
::std::list< ::psp::KernPair >::const_iterator it;
@@ -850,38 +847,38 @@ ULONG PspGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData *pKernPairs )
return nHavePairs;
}
-BOOL PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
+sal_Bool PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
if( nLevel >= MAX_FALLBACK )
- return FALSE;
+ return sal_False;
ServerFont* pSF = m_pServerFont[ nLevel ];
if( !pSF )
- return FALSE;
+ return sal_False;
nGlyphIndex &= ~GF_FONTMASK;
const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex );
rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() );
- return TRUE;
+ return sal_True;
}
-BOOL PspGraphics::GetGlyphOutline( long nGlyphIndex,
+sal_Bool PspGraphics::GetGlyphOutline( long nGlyphIndex,
::basegfx::B2DPolyPolygon& rB2DPolyPoly )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
if( nLevel >= MAX_FALLBACK )
- return FALSE;
+ return sal_False;
ServerFont* pSF = m_pServerFont[ nLevel ];
if( !pSF )
- return FALSE;
+ return sal_False;
nGlyphIndex &= ~GF_FONTMASK;
if( pSF->GetGlyphOutline( nGlyphIndex, rB2DPolyPoly ) )
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
}
SalLayout* PspGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLevel )
@@ -906,7 +903,7 @@ SalLayout* PspGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLevel
//--------------------------------------------------------------------------
-BOOL PspGraphics::CreateFontSubset(
+sal_Bool PspGraphics::CreateFontSubset(
const rtl::OUString& rToFile,
const ImplFontData* pFont,
sal_Int32* pGlyphIDs,
@@ -1292,9 +1289,9 @@ bool PspGraphics::filterText( const String& rOrig, String& rNewText, xub_StrLen
bool bRet = false;
bool bStarted = false;
bool bStopped = false;
- USHORT nPos;
- USHORT nStart = 0;
- USHORT nStop = rLen;
+ sal_uInt16 nPos;
+ sal_uInt16 nStart = 0;
+ sal_uInt16 nStop = rLen;
String aPhone = rOrig.Copy( nIndex, rLen );
if( ! m_bPhoneCollectionActive )
diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx
index 676e86b32f20..78f36f85295e 100644
--- a/vcl/unx/headless/svppspgraphics.hxx
+++ b/vcl/unx/headless/svppspgraphics.hxx
@@ -87,14 +87,11 @@ public:
// overload all pure virtual methods
virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
- virtual USHORT GetBitCount() const;
+ virtual sal_uInt16 GetBitCount() const;
virtual long GetGraphicsWidth() const;
virtual void ResetClipRegion();
- virtual void BeginSetClipRegion( ULONG nCount );
- virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
- virtual void EndSetClipRegion();
+ virtual bool setClipRegion( const Region& );
virtual void SetLineColor();
virtual void SetLineColor( SalColor nSalColor );
@@ -105,15 +102,15 @@ public:
virtual void SetROPFillColor( SalROPColor nROPColor );
virtual void SetTextColor( SalColor nSalColor );
- virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
+ virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel );
virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
- virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
- virtual ImplFontCharMap* GetImplFontCharMap() const;
+ virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs );
+ virtual const ImplFontCharMap* GetImplFontCharMap() const;
virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
virtual void GetDevFontList( ImplDevFontList* );
virtual void GetDevFontSubstList( OutputDevice* );
virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
- virtual BOOL CreateFontSubset( const rtl::OUString& rToFile,
+ virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData*,
sal_Int32* pGlyphIDs,
sal_uInt8* pEncoding,
@@ -132,8 +129,8 @@ public:
bool bVertical,
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc );
- virtual BOOL GetGlyphBoundRect( long nIndex, Rectangle& );
- virtual BOOL GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
+ virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& );
+ virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
virtual void DrawServerFontLayout( const ServerFontLayout& );
virtual bool supportsOperation( OutDevSupportType ) const;
@@ -141,23 +138,23 @@ public:
virtual void drawPixel( long nX, long nY, SalColor nSalColor );
virtual void drawLine( long nX1, long nY1, long nX2, long nY2 );
virtual void drawRect( long nX, long nY, long nWidth, long nHeight );
- virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry );
- virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry );
+ virtual void drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry );
+ virtual void drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry );
virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency );
virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin );
virtual void drawPolyPolygon( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
PCONSTSALPOINT* pPtAry );
- virtual sal_Bool drawPolyLineBezier( ULONG nPoints,
+ virtual sal_Bool drawPolyLineBezier( sal_uLong nPoints,
const SalPoint* pPtAry,
- const BYTE* pFlgAry );
- virtual sal_Bool drawPolygonBezier( ULONG nPoints,
+ const sal_uInt8* pFlgAry );
+ virtual sal_Bool drawPolygonBezier( sal_uLong nPoints,
const SalPoint* pPtAry,
- const BYTE* pFlgAry );
+ const sal_uInt8* pFlgAry );
virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
- const BYTE* const* pFlgAry );
+ const sal_uInt8* const* pFlgAry );
virtual void copyArea( long nDestX,
long nDestY,
@@ -165,7 +162,7 @@ public:
long nSrcY,
long nSrcWidth,
long nSrcHeight,
- USHORT nFlags );
+ sal_uInt16 nFlags );
virtual void copyBits( const SalTwoRect* pPosAry,
SalGraphics* pSrcGraphics );
virtual void drawBitmap( const SalTwoRect* pPosAry,
@@ -182,9 +179,9 @@ public:
virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight );
virtual SalColor getPixel( long nX, long nY );
virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags );
- virtual void invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags );
+ virtual void invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags );
- virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize );
+ virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize );
virtual bool filterText( const String& rOrigText, String& rNewText, xub_StrLen nIndex, xub_StrLen& rLen, xub_StrLen& rCutStart, xub_StrLen& rCutStop );
virtual SystemGraphicsData GetGraphicsData() const;
diff --git a/vcl/unx/headless/svptext.cxx b/vcl/unx/headless/svptext.cxx
index 07e6497d839a..18e2f4af8c90 100644
--- a/vcl/unx/headless/svptext.cxx
+++ b/vcl/unx/headless/svptext.cxx
@@ -203,7 +203,7 @@ void PspKernInfo::Initialize() const
// ===========================================================================
-USHORT SvpSalGraphics::SetFont( ImplFontSelectData* pIFSD, int nFallbackLevel )
+sal_uInt16 SvpSalGraphics::SetFont( ImplFontSelectData* pIFSD, int nFallbackLevel )
{
// release all no longer needed font resources
for( int i = nFallbackLevel; i < MAX_FALLBACK; ++i )
@@ -253,15 +253,15 @@ void SvpSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe
// ---------------------------------------------------------------------------
-ULONG SvpSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
+sal_uLong SvpSalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs )
{
- ULONG nGotPairs = 0;
+ sal_uLong nGotPairs = 0;
if( m_pServerFont[0] != NULL )
{
ImplKernPairData* pTmpKernPairs = NULL;
nGotPairs = m_pServerFont[0]->GetKernPairs( &pTmpKernPairs );
- for( ULONG i = 0; i < nPairs && i < nGotPairs; ++i )
+ for( sal_uLong i = 0; i < nPairs && i < nGotPairs; ++i )
pKernPairs[ i ] = pTmpKernPairs[ i ];
delete[] pTmpKernPairs;
}
@@ -271,15 +271,13 @@ ULONG SvpSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
// ---------------------------------------------------------------------------
-ImplFontCharMap* SvpSalGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* SvpSalGraphics::GetImplFontCharMap() const
{
if( !m_pServerFont[0] )
return NULL;
- CmapResult aCmapResult;
- if( !m_pServerFont[0]->GetFontCodeRanges( aCmapResult ) )
- return NULL;
- return new ImplFontCharMap( aCmapResult );
+ const ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap();
+ return pIFCMap;
}
bool SvpSalGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
@@ -348,7 +346,7 @@ bool SvpSalGraphics::AddTempDevFont( ImplDevFontList*,
// ---------------------------------------------------------------------------
-BOOL SvpSalGraphics::CreateFontSubset(
+sal_Bool SvpSalGraphics::CreateFontSubset(
const rtl::OUString& rToFile,
const ImplFontData* pFont,
sal_Int32* pGlyphIDs,
@@ -431,39 +429,39 @@ void SvpSalGraphics::GetGlyphWidths( const ImplFontData* pFont,
// ---------------------------------------------------------------------------
-BOOL SvpSalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
+sal_Bool SvpSalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
if( nLevel >= MAX_FALLBACK )
- return FALSE;
+ return sal_False;
ServerFont* pSF = m_pServerFont[ nLevel ];
if( !pSF )
- return FALSE;
+ return sal_False;
nGlyphIndex &= ~GF_FONTMASK;
const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex );
rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() );
- return TRUE;
+ return sal_True;
}
// ---------------------------------------------------------------------------
-BOOL SvpSalGraphics::GetGlyphOutline( long nGlyphIndex, B2DPolyPolygon& rPolyPoly )
+sal_Bool SvpSalGraphics::GetGlyphOutline( long nGlyphIndex, B2DPolyPolygon& rPolyPoly )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
if( nLevel >= MAX_FALLBACK )
- return FALSE;
+ return sal_False;
const ServerFont* pSF = m_pServerFont[ nLevel ];
if( !pSF )
- return FALSE;
+ return sal_False;
nGlyphIndex &= ~GF_FONTMASK;
if( pSF->GetGlyphOutline( nGlyphIndex, rPolyPoly ) )
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
}
// ---------------------------------------------------------------------------
diff --git a/vcl/unx/headless/svpvd.cxx b/vcl/unx/headless/svpvd.cxx
index 2bf9894a1e23..8477da7b3bfc 100644
--- a/vcl/unx/headless/svpvd.cxx
+++ b/vcl/unx/headless/svpvd.cxx
@@ -55,7 +55,7 @@ void SvpSalVirtualDevice::ReleaseGraphics( SalGraphics* pGraphics )
delete pGraphics;
}
-BOOL SvpSalVirtualDevice::SetSize( long nNewDX, long nNewDY )
+sal_Bool SvpSalVirtualDevice::SetSize( long nNewDX, long nNewDY )
{
B2IVector aDevSize( nNewDX, nNewDY );
if( aDevSize.getX() == 0 )
diff --git a/vcl/unx/headless/svpvd.hxx b/vcl/unx/headless/svpvd.hxx
index b30b83642293..c6dde57abd38 100644
--- a/vcl/unx/headless/svpvd.hxx
+++ b/vcl/unx/headless/svpvd.hxx
@@ -38,12 +38,12 @@ class SvpSalGraphics;
class SvpSalVirtualDevice : public SalVirtualDevice, public SvpElement
{
- USHORT m_nBitCount;
+ sal_uInt16 m_nBitCount;
basebmp::BitmapDeviceSharedPtr m_aDevice;
std::list< SvpSalGraphics* > m_aGraphics;
public:
- SvpSalVirtualDevice( USHORT nBitCount ) : SvpElement(), m_nBitCount(nBitCount) {}
+ SvpSalVirtualDevice( sal_uInt16 nBitCount ) : SvpElement(), m_nBitCount(nBitCount) {}
virtual ~SvpSalVirtualDevice();
// SvpElement
@@ -53,7 +53,7 @@ public:
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual BOOL SetSize( long nNewDX, long nNewDY );
+ virtual sal_Bool SetSize( long nNewDX, long nNewDY );
virtual void GetSize( long& rWidth, long& rHeight );
};
diff --git a/vcl/unx/inc/dtint.hxx b/vcl/unx/inc/dtint.hxx
index b6f7aa4b9350..010a0417d89b 100644
--- a/vcl/unx/inc/dtint.hxx
+++ b/vcl/unx/inc/dtint.hxx
@@ -32,19 +32,12 @@
#include <tools/string.hxx>
#include <tools/color.hxx>
#include <vcl/font.hxx>
+#include "svunx.h"
class SalBitmap;
class SalDisplay;
class AllSettings;
-#if !defined(_XLIB_H_) && !defined(_X11_XLIB_H_)
-// forwards from X
-struct Display;
-struct XEvent;
-#define Atom UINT32
-#define XLIB_Window UINT32
-#endif
-
enum DtType {
DtGeneric,
DtCDE
diff --git a/vcl/unx/inc/i18n_cb.hxx b/vcl/unx/inc/i18n_cb.hxx
index 358538390a8d..22aee5aeb41a 100644
--- a/vcl/unx/inc/i18n_cb.hxx
+++ b/vcl/unx/inc/i18n_cb.hxx
@@ -90,7 +90,7 @@ typedef struct {
preedit_status_t eState;
preedit_text_t aText;
SalExtTextInputEvent aInputEv;
- std::vector< USHORT > aInputFlags;
+ std::vector< sal_uInt16 > aInputFlags;
} preedit_data_t;
#endif /* _SAL_I18N_CALLBACK_HXX */
diff --git a/vcl/unx/inc/i18n_ic.hxx b/vcl/unx/inc/i18n_ic.hxx
index e7382ef6ebd8..b038d179f4a2 100644
--- a/vcl/unx/inc/i18n_ic.hxx
+++ b/vcl/unx/inc/i18n_ic.hxx
@@ -76,7 +76,7 @@ public:
void HandleDestroyIM();
int HandleKeyEvent( XKeyEvent *pEvent, SalFrame *pFrame ); // unused
- void EndExtTextInput( USHORT nFlags ); // unused
+ void EndExtTextInput( sal_uInt16 nFlags ); // unused
int CommitStringCallback( sal_Unicode* pText, sal_Size nLength );
int CommitKeyEvent( sal_Unicode* pText, sal_Size nLength );
int UpdateSpotLocation();
diff --git a/vcl/unx/inc/i18n_im.hxx b/vcl/unx/inc/i18n_im.hxx
index cca69a3de223..92931ec6353e 100644
--- a/vcl/unx/inc/i18n_im.hxx
+++ b/vcl/unx/inc/i18n_im.hxx
@@ -57,10 +57,6 @@ public:
Bool FilterEvent( XEvent *pEvent, XLIB_Window window );
Bool AddConnectionWatch (Display *pDisplay, void *pConnectionHandler);
- #ifdef _USE_PRINT_EXTENSION_
- void Invalidate() { mbUseable = False; }
- #endif
-
SalI18N_InputMethod();
~SalI18N_InputMethod();
};
diff --git a/vcl/unx/inc/kde_headers.h b/vcl/unx/inc/kde_headers.h
new file mode 100644
index 000000000000..7ec45fdc383d
--- /dev/null
+++ b/vcl/unx/inc/kde_headers.h
@@ -0,0 +1,98 @@
+/* -*- 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 INCLUDED_VCL_KDE_HEADERS_H
+#define INCLUDED_VCL_KDE_HEADERS_H
+
+/* ********* Suppress warnings if needed */
+#include "sal/config.h"
+
+#include <cstddef>
+
+#if defined __GNUC__
+#pragma GCC system_header
+#endif
+
+
+/* ********* Hack, but needed because of conflicting types... */
+#define Region QtXRegion
+
+
+/* ********* Qt headers */
+#include <qaccessible.h>
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qfont.h>
+#include <qframe.h>
+#include <qlineedit.h>
+#include <qlistview.h>
+#include <qmainwindow.h>
+#include <qmenudata.h>
+#include <qpaintdevice.h>
+#include <qpainter.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qrangecontrol.h>
+#include <qstring.h>
+#include <qtabbar.h>
+#include <qtabwidget.h>
+#include <qtoolbar.h>
+#include <qtoolbutton.h>
+#include <qwidget.h>
+#include <qprogressbar.h>
+
+/* ********* See hack on top of this file */
+#undef Region
+
+
+/* ********* KDE base headers */
+#include <kaboutdata.h>
+#include <kapplication.h>
+#include <kcmdlineargs.h>
+#include <kconfig.h>
+#include <kdeversion.h>
+#include <kemailsettings.h>
+#include <kglobal.h>
+#include <kglobalsettings.h>
+#include <klocale.h>
+#include <kmainwindow.h>
+#include <kmenubar.h>
+#include <kprotocolmanager.h>
+#include <kstartupinfo.h>
+#include <kstyle.h>
+
+
+/* ********* KDE address book connectivity headers */
+#include <kabc/addressbook.h>
+#include <kabc/addressee.h>
+#include <kabc/field.h>
+#include <kabc/stdaddressbook.h>
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/inc/plugins/gtk/gtkdata.hxx b/vcl/unx/inc/plugins/gtk/gtkdata.hxx
index 4f02ea7c5ecf..e4a1bb5e9527 100644
--- a/vcl/unx/inc/plugins/gtk/gtkdata.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkdata.hxx
@@ -60,6 +60,8 @@ class GtkSalDisplay : public SalDisplay
GdkDisplay* m_pGdkDisplay;
GdkCursor *m_aCursors[ POINTER_COUNT ];
bool m_bStartupCompleted;
+ std::vector< int > m_aXineramaScreenIndexMap;
+
GdkCursor* getFromXPM( const unsigned char *pBitmap, const unsigned char *pMask,
int nWidth, int nHeight, int nXHot, int nYHot );
public:
diff --git a/vcl/unx/inc/plugins/gtk/gtkframe.hxx b/vcl/unx/inc/plugins/gtk/gtkframe.hxx
index f63f02bcda0f..010844ec3c78 100644
--- a/vcl/unx/inc/plugins/gtk/gtkframe.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkframe.hxx
@@ -136,7 +136,7 @@ class GtkSalFrame : public SalFrame
bool m_bFocused;
bool m_bPreeditJustChanged;
SalExtTextInputEvent m_aInputEvent;
- std::vector< USHORT > m_aInputFlags;
+ std::vector< sal_uInt16 > m_aInputFlags;
IMHandler( GtkSalFrame* );
~IMHandler();
@@ -145,7 +145,7 @@ class GtkSalFrame : public SalFrame
void deleteIMContext();
void updateIMSpotLocation();
void setInputContext( SalInputContext* pContext );
- void endExtTextInput( USHORT nFlags );
+ void endExtTextInput( sal_uInt16 nFlags );
bool handleKeyEvent( GdkEventKey* pEvent );
void focusChanged( bool bFocusIn );
@@ -169,7 +169,7 @@ class GtkSalFrame : public SalFrame
GdkWindow* m_pForeignTopLevel;
GdkNativeWindow m_aForeignTopLevelWindow;
Pixmap m_hBackgroundPixmap;
- ULONG m_nStyle;
+ sal_uLong m_nStyle;
SalExtStyle m_nExtStyle;
GtkFixed* m_pFixedContainer;
GtkSalFrame* m_pParent;
@@ -177,7 +177,7 @@ class GtkSalFrame : public SalFrame
GdkWindowState m_nState;
SystemEnvData m_aSystemData;
GraphicsHolder m_aGraphics[ nMaxGraphics ];
- USHORT m_nKeyModifiers;
+ sal_uInt16 m_nKeyModifiers;
GdkCursor *m_pCurrentCursor;
GdkVisibilityState m_nVisibility;
PointerStyle m_ePointerStyle;
@@ -201,7 +201,7 @@ class GtkSalFrame : public SalFrame
GdkRegion* m_pRegion;
- void Init( SalFrame* pParent, ULONG nStyle );
+ void Init( SalFrame* pParent, sal_uLong nStyle );
void Init( SystemParentData* pSysData );
void InitCommon();
@@ -253,7 +253,7 @@ class GtkSalFrame : public SalFrame
bool isChild( bool bPlug = true, bool bSysChild = true )
{
- ULONG nMask = 0;
+ sal_uLong nMask = 0;
if( bPlug )
nMask |= SAL_FRAME_STYLE_PLUG;
if( bSysChild )
@@ -274,14 +274,14 @@ class GtkSalFrame : public SalFrame
DECL_LINK( ImplDelayedFullScreenHdl, void* );
public:
- GtkSalFrame( SalFrame* pParent, ULONG nStyle );
+ GtkSalFrame( SalFrame* pParent, sal_uLong nStyle );
GtkSalFrame( SystemParentData* pSysData );
// dispatches an event, returns true if dispatched
// and false else; if true was returned the event should
// be swallowed
bool Dispatch( const XEvent* pEvent );
- void grabPointer( BOOL bGrab, BOOL bOwnerEvents = FALSE );
+ void grabPointer( sal_Bool bGrab, sal_Bool bOwnerEvents = sal_False );
GtkSalDisplay* getDisplay();
GdkDisplay* getGdkDisplay();
@@ -308,41 +308,41 @@ public:
// Event must be destroyed, when Frame is destroyed
// When Event is called, SalInstance::Yield() must be returned
- virtual BOOL PostEvent( void* pData );
+ virtual sal_Bool PostEvent( void* pData );
virtual void SetTitle( const XubString& rTitle );
- virtual void SetIcon( USHORT nIcon );
+ virtual void SetIcon( sal_uInt16 nIcon );
virtual void SetMenu( SalMenu *pSalMenu );
virtual void DrawMenuBar();
virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle );
// Before the window is visible, a resize event
// must be sent with the correct size
- virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE );
- virtual void Enable( BOOL bEnable );
+ virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = sal_False );
+ virtual void Enable( sal_Bool bEnable );
// Set ClientSize and Center the Window to the desktop
// and send/post a resize message
virtual void SetMinClientSize( long nWidth, long nHeight );
virtual void SetMaxClientSize( long nWidth, long nHeight );
- virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags );
+ virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags );
virtual void GetClientSize( long& rWidth, long& rHeight );
virtual void GetWorkArea( Rectangle& rRect );
virtual SalFrame* GetParent() const;
virtual void SetWindowState( const SalFrameState* pState );
- virtual BOOL GetWindowState( SalFrameState* pState );
- virtual void ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay );
+ virtual sal_Bool GetWindowState( SalFrameState* pState );
+ virtual void ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay );
// Enable/Disable ScreenSaver, SystemAgents, ...
- virtual void StartPresentation( BOOL bStart );
+ virtual void StartPresentation( sal_Bool bStart );
// Show Window over all other Windows
- virtual void SetAlwaysOnTop( BOOL bOnTop );
+ virtual void SetAlwaysOnTop( sal_Bool bOnTop );
// Window to top and grab focus
- virtual void ToTop( USHORT nFlags );
+ virtual void ToTop( sal_uInt16 nFlags );
// this function can call with the same
// pointer style
virtual void SetPointer( PointerStyle ePointerStyle );
- virtual void CaptureMouse( BOOL bMouse );
+ virtual void CaptureMouse( sal_Bool bMouse );
virtual void SetPointerPos( long nX, long nY );
// flush output buffer
@@ -352,11 +352,11 @@ public:
virtual void Sync();
virtual void SetInputContext( SalInputContext* pContext );
- virtual void EndExtTextInput( USHORT nFlags );
+ virtual void EndExtTextInput( sal_uInt16 nFlags );
- virtual String GetKeyName( USHORT nKeyCode );
- virtual String GetSymbolKeyName( const XubString& rFontName, USHORT nKeyCode );
- virtual BOOL MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode );
+ virtual String GetKeyName( sal_uInt16 nKeyCode );
+ virtual String GetSymbolKeyName( const XubString& rFontName, sal_uInt16 nKeyCode );
+ virtual sal_Bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode );
// returns the input language used for the last key stroke
// may be LANGUAGE_DONTKNOW if not supported by the OS
@@ -377,7 +377,7 @@ public:
virtual SalIndicatorState GetIndicatorState();
- virtual void SimulateKeyPress( USHORT nKeyCode );
+ virtual void SimulateKeyPress( sal_uInt16 nKeyCode );
// set new parent window
virtual void SetParent( SalFrame* pNewParent );
@@ -395,7 +395,7 @@ public:
// set clip region to none (-> rectangular windows, normal state)
virtual void ResetClipRegion();
// start setting the clipregion consisting of nRects rectangles
- virtual void BeginSetClipRegion( ULONG nRects );
+ virtual void BeginSetClipRegion( sal_uLong nRects );
// add a rectangle to the clip region
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
// done setting up the clipregion
diff --git a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
index 209ba99cd875..4f7d66712ac7 100644
--- a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
@@ -56,34 +56,31 @@ public:
// will be set when UI theme was changed
- static BOOL bThemeChanged;
- static BOOL bNeedPixmapPaint;
- static BOOL bGlobalNeedPixmapPaint;
- static BOOL bToolbarGripWorkaround;
- static BOOL bNeedButtonStyleAsEditBackgroundWorkaround;
+ static sal_Bool bThemeChanged;
+ static sal_Bool bNeedPixmapPaint;
+ static sal_Bool bGlobalNeedPixmapPaint;
+ static sal_Bool bToolbarGripWorkaround;
+ static sal_Bool bNeedButtonStyleAsEditBackgroundWorkaround;
// native widget methods
- virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
- virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
- const Point& aPos, BOOL& rIsInside );
- virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ virtual sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart );
+ virtual sal_Bool hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ const Point& aPos, sal_Bool& rIsInside );
+ virtual sal_Bool drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& rCaption );
- virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ virtual sal_Bool drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& rCaption );
- virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
+ virtual sal_Bool getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const rtl::OUString& rCaption,
Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion );
//helper methods for frame's UpdateSettings
void updateSettings( AllSettings& rSettings );
+ virtual bool setClipRegion( const Region& );
virtual void ResetClipRegion();
- virtual void BeginSetClipRegion( ULONG nCount );
- virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
- virtual void EndSetClipRegion();
// some themes set the background pixmap of our window EVERY time
// a control is painted; but presentation effects need
@@ -96,93 +93,89 @@ protected:
typedef std::list< Rectangle > clipList;
GdkPixmap* NWGetPixmapFromScreen( Rectangle srcRect );
- BOOL NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRect );
+ sal_Bool NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRect );
- BOOL NWPaintGTKButton( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKButton( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKRadio( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKRadio( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKCheck( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKCheck( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKScrollbar( ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKScrollbar( ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKEditBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKEditBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKSpinBox( ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKSpinBox( ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKComboBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKComboBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKTabItem( ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKTabItem( ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKListBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKListBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKToolbar( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKToolbar( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKMenubar( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKMenubar( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKPopupMenu( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKPopupMenu( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKTooltip( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKTooltip( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKProgress( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKProgress( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKSlider( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKSlider( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKListNode( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKListNode( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
-
- BOOL drawNativeMixedStateCheck( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
- ControlState nState, const ImplControlValue& aValue,
- const rtl::OUString& rCaption );
};
#endif // _VCL_GTKGDI_HXX
diff --git a/vcl/unx/inc/plugins/gtk/gtkinst.hxx b/vcl/unx/inc/plugins/gtk/gtkinst.hxx
index 325bf54f7998..07549776e9cf 100644
--- a/vcl/unx/inc/plugins/gtk/gtkinst.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkinst.hxx
@@ -64,7 +64,7 @@ class GtkHookedYieldMutex : public GtkYieldMutex
{
virtual int Grab() { return 0; };
virtual void Ungrab(int ) {};
- std::list<ULONG> aYieldStack;
+ std::list<sal_uLong> aYieldStack;
public:
GtkHookedYieldMutex();
virtual void acquire();
@@ -85,9 +85,9 @@ public:
{}
virtual ~GtkInstance();
- virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
- virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle );
- virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE );
+ virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle );
+ virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle );
+ virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True );
virtual SalSystem* CreateSalSystem();
virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
};
diff --git a/vcl/unx/inc/plugins/gtk/gtkobject.hxx b/vcl/unx/inc/plugins/gtk/gtkobject.hxx
index 143f9a2d19a9..72b33b0e5c3b 100644
--- a/vcl/unx/inc/plugins/gtk/gtkobject.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkobject.hxx
@@ -45,28 +45,29 @@ class GtkSalObject : public SalObject
static gboolean signalFocus( GtkWidget*, GdkEventFocus*, gpointer );
static void signalDestroy( GtkObject*, gpointer );
public:
- GtkSalObject( GtkSalFrame* pParent, BOOL bShow = TRUE );
+ GtkSalObject( GtkSalFrame* pParent, sal_Bool bShow = sal_True );
virtual ~GtkSalObject();
// overload all pure virtual methods
virtual void ResetClipRegion();
- virtual USHORT GetClipRegionType();
- virtual void BeginSetClipRegion( ULONG nRects );
+ virtual sal_uInt16 GetClipRegionType();
+ virtual void BeginSetClipRegion( sal_uLong nRects );
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
virtual void EndSetClipRegion();
virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight );
- virtual void Show( BOOL bVisible );
- virtual void Enable( BOOL nEnable );
+ virtual void Show( sal_Bool bVisible );
+ virtual void Enable( sal_Bool nEnable );
virtual void GrabFocus();
virtual void SetBackground();
virtual void SetBackground( SalColor nSalColor );
- virtual void SetForwardKey( BOOL bEnable );
+ virtual void SetForwardKey( sal_Bool bEnable );
virtual const SystemEnvData* GetSystemData() const;
+ virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
};
#endif // _SV_SALOBJ_H
diff --git a/vcl/unx/inc/plugins/kde/kdedata.hxx b/vcl/unx/inc/plugins/kde/kdedata.hxx
index 458685ea58b0..9125b33f1b20 100644
--- a/vcl/unx/inc/plugins/kde/kdedata.hxx
+++ b/vcl/unx/inc/plugins/kde/kdedata.hxx
@@ -68,14 +68,14 @@ class KDESalFrame : public X11SalFrame
GraphicsHolder m_aGraphics[ nMaxGraphics ];
public:
- KDESalFrame( SalFrame* pParent, ULONG nStyle );
+ KDESalFrame( SalFrame* pParent, sal_uLong );
virtual ~KDESalFrame();
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics *pGraphics );
virtual void updateGraphics( bool bClear );
virtual void UpdateSettings( AllSettings& rSettings );
- virtual void Show( BOOL bVisible, BOOL bNoActivate );
+ virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate );
};
class KDESalInstance : public X11SalInstance
@@ -84,7 +84,7 @@ public:
KDESalInstance( SalYieldMutex* pMutex )
: X11SalInstance( pMutex ) {}
virtual ~KDESalInstance() {}
- virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
+ virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle );
};
class KDEXLib : public SalXLib
diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h
index 1c7c3d51a785..80d1f5fb92cc 100644
--- a/vcl/unx/inc/pspgraphics.h
+++ b/vcl/unx/inc/pspgraphics.h
@@ -84,14 +84,11 @@ public:
// overload all pure virtual methods
virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
- virtual USHORT GetBitCount() const;
+ virtual sal_uInt16 GetBitCount() const;
virtual long GetGraphicsWidth() const;
virtual void ResetClipRegion();
- virtual void BeginSetClipRegion( ULONG nCount );
- virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
- virtual void EndSetClipRegion();
+ virtual bool setClipRegion( const Region& );
virtual void SetLineColor();
virtual void SetLineColor( SalColor nSalColor );
@@ -102,15 +99,15 @@ public:
virtual void SetROPFillColor( SalROPColor nROPColor );
virtual void SetTextColor( SalColor nSalColor );
- virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
+ virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel );
virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
- virtual ULONG GetKernPairs( ULONG nMaxPairs, ImplKernPairData* );
- virtual ImplFontCharMap* GetImplFontCharMap() const;
+ virtual sal_uLong GetKernPairs( sal_uLong nMaxPairs, ImplKernPairData* );
+ virtual const ImplFontCharMap* GetImplFontCharMap() const;
virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
virtual void GetDevFontList( ImplDevFontList* );
virtual void GetDevFontSubstList( OutputDevice* );
virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
- virtual BOOL CreateFontSubset( const rtl::OUString& rToFile,
+ virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData*,
sal_Int32* pGlyphIDs,
sal_uInt8* pEncoding,
@@ -129,8 +126,8 @@ public:
bool bVertical,
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc );
- virtual BOOL GetGlyphBoundRect( long nIndex, Rectangle& );
- virtual BOOL GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
+ virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& );
+ virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
virtual void DrawServerFontLayout( const ServerFontLayout& );
virtual bool supportsOperation( OutDevSupportType ) const;
@@ -138,30 +135,30 @@ public:
virtual void drawPixel( long nX, long nY, SalColor nSalColor );
virtual void drawLine( long nX1, long nY1, long nX2, long nY2 );
virtual void drawRect( long nX, long nY, long nWidth, long nHeight );
- virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry );
- virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry );
+ virtual void drawPolyLine( sal_uIntPtr nPoints, const SalPoint* pPtAry );
+ virtual void drawPolygon( sal_uIntPtr nPoints, const SalPoint* pPtAry );
virtual void drawPolyPolygon( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
PCONSTSALPOINT* pPtAry );
virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency );
virtual bool drawPolyLine( const basegfx::B2DPolygon&, double fTransparency, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin);
- virtual sal_Bool drawPolyLineBezier( ULONG nPoints,
+ virtual sal_Bool drawPolyLineBezier( sal_uIntPtr nPoints,
const SalPoint* pPtAry,
- const BYTE* pFlgAry );
- virtual sal_Bool drawPolygonBezier( ULONG nPoints,
+ const sal_uInt8* pFlgAry );
+ virtual sal_Bool drawPolygonBezier( sal_uIntPtr nPoints,
const SalPoint* pPtAry,
- const BYTE* pFlgAry );
+ const sal_uInt8* pFlgAry );
virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
- const BYTE* const* pFlgAry );
+ const sal_uInt8* const* pFlgAry );
virtual void copyArea( long nDestX,
long nDestY,
long nSrcX,
long nSrcY,
long nSrcWidth,
long nSrcHeight,
- USHORT nFlags );
+ sal_uInt16 nFlags );
virtual void copyBits( const SalTwoRect* pPosAry,
SalGraphics* pSrcGraphics );
virtual void drawBitmap( const SalTwoRect* pPosAry,
@@ -178,9 +175,9 @@ public:
virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight );
virtual SalColor getPixel( long nX, long nY );
virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags );
- virtual void invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags );
+ virtual void invert( sal_uIntPtr nPoints, const SalPoint* pPtAry, SalInvert nFlags );
- virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize );
+ virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uIntPtr nSize );
virtual bool filterText( const String& rOrigText, String& rNewText, xub_StrLen nIndex, xub_StrLen& rLen, xub_StrLen& rCutStart, xub_StrLen& rCutStop );
virtual bool drawAlphaBitmap( const SalTwoRect&,
diff --git a/vcl/unx/inc/salbmp.h b/vcl/unx/inc/salbmp.h
index 1f2dc420cb72..f72f77b9909f 100644
--- a/vcl/unx/inc/salbmp.h
+++ b/vcl/unx/inc/salbmp.h
@@ -52,7 +52,7 @@ class VCL_DLLPUBLIC X11SalBitmap : public SalBitmap
private:
static BitmapBuffer* ImplCreateDIB( const Size& rSize,
- USHORT nBitCount,
+ sal_uInt16 nBitCount,
const BitmapPalette& rPal );
static BitmapBuffer* ImplCreateDIB( Drawable aDrawable,
int nScreen,
@@ -64,7 +64,7 @@ private:
public:
static ImplSalBitmapCache* mpCache;
- static ULONG mnCacheInstCount;
+ static sal_uIntPtr mnCacheInstCount;
static void ImplCreateCache();
static void ImplDestroyCache();
@@ -106,13 +106,13 @@ public:
// overload pure virtual methods
virtual bool Create( const Size& rSize,
- USHORT nBitCount,
+ sal_uInt16 nBitCount,
const BitmapPalette& rPal );
virtual bool Create( const SalBitmap& rSalBmp );
virtual bool Create( const SalBitmap& rSalBmp,
SalGraphics* pGraphics );
virtual bool Create( const SalBitmap& rSalBmp,
- USHORT nNewBitCount );
+ sal_uInt16 nNewBitCount );
virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
Size& rSize,
bool bMask = false );
@@ -120,7 +120,7 @@ public:
virtual void Destroy();
virtual Size GetSize() const;
- virtual USHORT GetBitCount() const;
+ virtual sal_uInt16 GetBitCount() const;
virtual BitmapBuffer* AcquireBuffer( bool bReadOnly );
virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly );
@@ -167,7 +167,7 @@ public:
long ImplGetWidth() const { return maTwoRect.mnDestWidth; }
long ImplGetHeight() const { return maTwoRect.mnDestHeight; }
long ImplGetDepth() const { return mnDepth; }
- ULONG ImplGetMemSize() const { return( ( maTwoRect.mnDestWidth * maTwoRect.mnDestHeight * mnDepth ) >> 3 ); }
+ sal_uIntPtr ImplGetMemSize() const { return( ( maTwoRect.mnDestWidth * maTwoRect.mnDestHeight * mnDepth ) >> 3 ); }
int ImplGetScreen() const { return mnScreen; }
bool ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRect ) const;
@@ -184,14 +184,14 @@ class ImplSalBitmapCache
private:
List maBmpList;
- ULONG mnTotalSize;
+ sal_uIntPtr mnTotalSize;
public:
ImplSalBitmapCache();
~ImplSalBitmapCache();
- void ImplAdd( X11SalBitmap* pBmp, ULONG nMemSize = 0UL, ULONG nFlags = 0UL );
+ void ImplAdd( X11SalBitmap* pBmp, sal_uIntPtr nMemSize = 0UL, sal_uIntPtr nFlags = 0UL );
void ImplRemove( X11SalBitmap* pBmp );
void ImplClear();
};
diff --git a/vcl/unx/inc/saldata.hxx b/vcl/unx/inc/saldata.hxx
index 9544491137fb..e967b0f7e4d0 100644
--- a/vcl/unx/inc/saldata.hxx
+++ b/vcl/unx/inc/saldata.hxx
@@ -56,11 +56,12 @@ typedef unsigned int pthread_t;
class VCL_DLLPUBLIC X11SalData : public SalData
{
protected:
- BOOL bNoExceptions_;
+ sal_Bool bNoExceptions_;
SalXLib *pXLib_;
SalDisplay *m_pSalDisplay;
pthread_t hMainThread_;
rtl::OUString maLocalHostName;
+ rtl::OUString maUnicodeAccumulator;
public:
X11SalData();
@@ -82,11 +83,12 @@ public:
inline SalXLib* GetLib() const { return pXLib_; }
inline pthread_t GetMainThread() const { return hMainThread_; }
- void StartTimer( ULONG nMS );
+ void StartTimer( sal_uLong nMS );
inline void StopTimer();
void Timeout() const;
const rtl::OUString& GetLocalHostName();
+ rtl::OUString& GetUnicodeAccumulator() { return maUnicodeAccumulator; }
static int XErrorHdl( Display*, XErrorEvent* );
static int XIOErrorHdl( Display* );
@@ -109,7 +111,7 @@ inline void X11SalData::XError( Display *pDisplay, XErrorEvent *pEvent ) const
class YieldMutexReleaser
{
- ULONG m_nYieldCount;
+ sal_uLong m_nYieldCount;
public:
inline YieldMutexReleaser();
inline ~YieldMutexReleaser();
diff --git a/vcl/unx/inc/saldisp.hxx b/vcl/unx/inc/saldisp.hxx
index 64eb16a1b313..895f4513800e 100644
--- a/vcl/unx/inc/saldisp.hxx
+++ b/vcl/unx/inc/saldisp.hxx
@@ -149,8 +149,8 @@ public:
Pixel GetTCPixel( SalColor nColor ) const;
SalColor GetTCColor( Pixel nPixel ) const;
- BOOL Convert( int &n0, int &n1, int &n2, int &n3 ); // 32bit
- BOOL Convert( int &n0, int &n1, int &n2 ); // 24bit
+ sal_Bool Convert( int &n0, int &n1, int &n2, int &n3 ); // 32bit
+ sal_Bool Convert( int &n0, int &n1, int &n2 ); // 24bit
};
// -=-= SalColormap =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -160,7 +160,7 @@ class SalColormap
Colormap m_hColormap;
std::vector<SalColor> m_aPalette; // Pseudocolor
SalVisual m_aVisual;
- std::vector<USHORT> m_aLookupTable; // Pseudocolor: 12bit reduction
+ std::vector<sal_uInt16> m_aLookupTable; // Pseudocolor: 12bit reduction
Pixel m_nWhitePixel;
Pixel m_nBlackPixel;
Pixel m_nUsed; // Pseudocolor
@@ -173,7 +173,7 @@ public:
Colormap hColormap,
int nScreen );
SalColormap( const BitmapPalette &rpPalette );
- SalColormap( USHORT nDepth );
+ SalColormap( sal_uInt16 nDepth );
SalColormap();
~SalColormap();
@@ -188,11 +188,11 @@ public:
inline int GetClass() const { return m_aVisual.GetClass(); }
inline int GetScreenNumber() const { return m_nScreen; }
- BOOL GetXPixels( XColor &rColor,
+ sal_Bool GetXPixels( XColor &rColor,
int r,
int g,
int b ) const;
- inline BOOL GetXPixel( XColor &rColor,
+ inline sal_Bool GetXPixel( XColor &rColor,
int r,
int g,
int b ) const;
@@ -209,7 +209,7 @@ class VCL_DLLPUBLIC SalXLib
{
protected:
timeval m_aTimeout;
- ULONG m_nTimeoutMS;
+ sal_uLong m_nTimeoutMS;
int m_pTimeoutFDS[2];
bool m_bHaveSystemChildFrames;
@@ -251,7 +251,7 @@ public:
void PushXErrorLevel( bool bIgnore );
void PopXErrorLevel();
- virtual void StartTimer( ULONG nMS );
+ virtual void StartTimer( sal_uLong nMS );
virtual void StopTimer();
bool CheckTimeout( bool bExecuteTimers = true );
@@ -266,15 +266,10 @@ public:
class SalI18N_InputMethod;
class SalI18N_KeyboardExtension;
-class XlfdStorage;
-class ExtendedFontStruct;
-class ExtendedXlfd;
class AttributeProvider;
class SalUnicodeConverter;
class SalConverterCache;
-typedef ::std::vector< ExtendedFontStruct* > SalFontCache;
-
extern "C" {
struct SnDisplay;
struct SnLauncheeContext;
@@ -331,9 +326,9 @@ public:
{
SalFrame* m_pFrame;
void* m_pData;
- USHORT m_nEvent;
+ sal_uInt16 m_nEvent;
- SalUserEvent( SalFrame* pFrame, void* pData, USHORT nEvent = SALEVENT_USEREVENT )
+ SalUserEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent = SALEVENT_USEREVENT )
: m_pFrame( pFrame ),
m_pData( pData ),
m_nEvent( nEvent )
@@ -346,8 +341,6 @@ protected:
SalI18N_KeyboardExtension *mpKbdExtension;
AttributeProvider *mpFactory;
- XlfdStorage *mpFontList;
- const ExtendedXlfd *mpFallbackFactory;
Display *pDisp_; // X Display
int m_nDefaultScreen; // XDefaultScreen
@@ -355,14 +348,14 @@ protected:
ScreenData m_aInvalidScreenData;
Pair aResolution_; // [dpi]
bool mbExactResolution;
- ULONG nMaxRequestSize_; // [byte]
+ sal_uLong nMaxRequestSize_; // [byte]
srv_vendor_t meServerVendor;
SalWM eWindowManager_;
- ULONG nProperties_; // PROPERTY_SUPPORT, BUG, FEATURE
- BOOL bLocal_; // Server==Client? Init
+ sal_uLong nProperties_; // PROPERTY_SUPPORT, BUG, FEATURE
+ sal_Bool bLocal_; // Server==Client? Init
// in SalDisplay::IsLocal()
- BOOL mbLocalIsValid; // bLocal_ is valid ?
+ sal_Bool mbLocalIsValid; // bLocal_ is valid ?
// until x bytes
oslMutex hEventGuard_;
@@ -371,10 +364,8 @@ protected:
XLIB_Cursor aPointerCache_[POINTER_COUNT];
SalFrame* m_pCapture;
- mutable SalFontCache* m_pFontCache;
-
// Keyboard
- BOOL bNumLockFromXS_; // Num Lock handled by X Server
+ sal_Bool bNumLockFromXS_; // Num Lock handled by X Server
int nNumLockIndex_; // modifier index in modmap
int nNumLockMask_; // keyevent state mask for
KeySym nShiftKeySym_; // first shift modifier
@@ -395,7 +386,6 @@ protected:
mutable XLIB_Time m_nLastUserEventTime; // mutable because changed on first access
- void DestroyFontCache();
virtual long Dispatch( XEvent *pEvent ) = 0;
void InitXinerama();
void InitRandR( XLIB_Window aRoot ) const;
@@ -406,7 +396,7 @@ protected:
void addXineramaScreenUnique( int i, long i_nX, long i_nY, long i_nWidth, long i_nHeight );
public:
static SalDisplay *GetSalDisplay( Display* display );
- static BOOL BestVisual( Display *pDisp,
+ static sal_Bool BestVisual( Display *pDisp,
int nScreen,
XVisualInfo &rVI );
@@ -424,30 +414,22 @@ public:
void Init();
- void SendInternalEvent( SalFrame* pFrame, void* pData, USHORT nEvent = SALEVENT_USEREVENT );
- void CancelInternalEvent( SalFrame* pFrame, void* pData, USHORT nEvent );
+ void SendInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent = SALEVENT_USEREVENT );
+ void CancelInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent );
bool DispatchInternalEvent();
void PrintInfo() const;
void PrintEvent( const ByteString &rComment,
XEvent *pEvent ) const;
- XlfdStorage* GetXlfdList() const;
- ExtendedFontStruct*
- GetFont( const ExtendedXlfd *pFont,
- const Size& rPixelSize, sal_Bool bVertical ) const;
- const ExtendedXlfd*
- GetFallbackFactory()
- { return mpFallbackFactory; }
-
void Beep() const;
void ModifierMapping();
- void SimulateKeyPress( USHORT nKeyCode );
- USHORT GetIndicatorState() const;
+ void SimulateKeyPress( sal_uInt16 nKeyCode );
+ sal_uInt16 GetIndicatorState() const;
String GetKeyNameFromKeySym( KeySym keysym ) const;
- XubString GetKeyName( USHORT nKeyCode ) const;
- USHORT GetKeyCode( KeySym keysym, char*pcPrintable ) const;
+ XubString GetKeyName( sal_uInt16 nKeyCode ) const;
+ sal_uInt16 GetKeyCode( KeySym keysym, char*pcPrintable ) const;
KeySym GetKeySym( XKeyEvent *pEvent,
unsigned char *pPrintable,
int *pLen,
@@ -458,7 +440,7 @@ public:
XLIB_Cursor GetPointer( int ePointerStyle );
virtual int CaptureMouse( SalFrame *pCapture );
- BOOL IsLocal();
+ sal_Bool IsLocal();
void Remove( XEvent *pEvent );
@@ -479,27 +461,27 @@ public:
const Size& GetScreenSize( int nScreen ) const { return getDataForScreen( nScreen ).m_aSize; }
srv_vendor_t GetServerVendor() const { return meServerVendor; }
void SetServerVendor() { meServerVendor = sal_GetServerVendor(pDisp_); }
- BOOL IsDisplay() const { return !!pXLib_; }
+ sal_Bool IsDisplay() const { return !!pXLib_; }
GC GetMonoGC( int nScreen ) const { return getDataForScreen(nScreen).m_aMonoGC; }
GC GetCopyGC( int nScreen ) const { return getDataForScreen(nScreen).m_aCopyGC; }
GC GetAndInvertedGC( int nScreen ) const { return getDataForScreen(nScreen).m_aAndInvertedGC; }
GC GetAndGC( int nScreen ) const { return getDataForScreen(nScreen).m_aAndGC; }
GC GetOrGC( int nScreen ) const { return getDataForScreen(nScreen).m_aOrGC; }
GC GetStippleGC( int nScreen ) const { return getDataForScreen(nScreen).m_aStippleGC; }
- GC GetGC( USHORT nDepth, int nScreen ) const;
+ GC GetGC( sal_uInt16 nDepth, int nScreen ) const;
Pixmap GetInvert50( int nScreen ) const { return getDataForScreen(nScreen).m_hInvert50; }
const SalColormap& GetColormap( int nScreen ) const { return getDataForScreen(nScreen).m_aColormap; }
const SalVisual& GetVisual( int nScreen ) const { return getDataForScreen(nScreen).m_aVisual; }
RenderEntryMap& GetRenderEntries( int nScreen ) const { return getDataForScreen(nScreen).m_aRenderData; }
const Pair &GetResolution() const { return aResolution_; }
bool GetExactResolution() const { return mbExactResolution; }
- ULONG GetProperties() const { return nProperties_; }
- ULONG GetMaxRequestSize() const { return nMaxRequestSize_; }
+ sal_uLong GetProperties() const { return nProperties_; }
+ sal_uLong GetMaxRequestSize() const { return nMaxRequestSize_; }
XLIB_Time GetLastUserEventTime( bool bAlwaysReget = false ) const;
bool XIfEventWithTimeout( XEvent*, XPointer, X_if_predicate, long i_nTimeout = 1000 ) const;
- BOOL MouseCaptured( const SalFrame *pFrameData ) const
+ sal_Bool MouseCaptured( const SalFrame *pFrameData ) const
{ return m_pCapture == pFrameData; }
SalFrame* GetCaptureFrame() const
{ return m_pCapture; }
@@ -525,14 +507,14 @@ public:
const std::list< SalFrame* >& getFrames() const
{ return m_aFrames; }
- BOOL IsNumLockFromXS() const { return bNumLockFromXS_; }
+ sal_Bool IsNumLockFromXS() const { return bNumLockFromXS_; }
std::list< SalObject* >& getSalObjects() { return m_aSalObjects; }
};
// -=-= inlines =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-inline GC SalDisplay::GetGC( USHORT nDepth, int nScreen ) const
+inline GC SalDisplay::GetGC( sal_uInt16 nDepth, int nScreen ) const
{ return 1 == nDepth
? GetMonoGC( nScreen )
: getDataForScreen(nScreen).m_aVisual.GetDepth() == nDepth
@@ -551,7 +533,7 @@ public:
virtual long Dispatch( XEvent *pEvent );
virtual void Yield();
- BOOL IsEvent();
+ sal_Bool IsEvent();
};
/*----------------------------------------------------------
diff --git a/vcl/unx/inc/salframe.h b/vcl/unx/inc/salframe.h
index 5ec3f04355a0..0025afce2ad6 100644
--- a/vcl/unx/inc/salframe.h
+++ b/vcl/unx/inc/salframe.h
@@ -88,23 +88,23 @@ class VCL_DLLPUBLIC X11SalFrame : public SalFrame
X11SalGraphics *pFreeGraphics_; // first free frame graphics
XLIB_Time nReleaseTime_; // timestamp of last key release
- USHORT nKeyCode_; // last key code
- USHORT nKeyState_; // last key state
+ sal_uInt16 nKeyCode_; // last key code
+ sal_uInt16 nKeyState_; // last key state
int nCompose_; // compose state
bool mbSendExtKeyModChange;
- USHORT mnExtKeyMod;
+ sal_uInt16 mnExtKeyMod;
int nShowState_; // show state
int nWidth_; // client width
int nHeight_; // client height
Rectangle maRestorePosSize;
- ULONG nStyle_;
+ sal_uIntPtr nStyle_;
SalExtStyle mnExtStyle;
- BOOL bAlwaysOnTop_;
- BOOL bViewable_;
- BOOL bMapped_;
- BOOL mbInShow;
- BOOL bDefaultPosition_; // client is centered initially
+ sal_Bool bAlwaysOnTop_;
+ sal_Bool bViewable_;
+ sal_Bool bMapped_;
+ sal_Bool mbInShow;
+ sal_Bool bDefaultPosition_; // client is centered initially
bool m_bXEmbed;
int nVisibility_;
int m_nWorkArea;
@@ -177,11 +177,11 @@ class VCL_DLLPUBLIC X11SalFrame : public SalFrame
void updateWMClass();
public:
- X11SalFrame( SalFrame* pParent, ULONG nSalFrameStyle, SystemParentData* pSystemParent = NULL );
+ X11SalFrame( SalFrame* pParent, sal_uIntPtr nSalFrameStyle, SystemParentData* pSystemParent = NULL );
virtual ~X11SalFrame();
long Dispatch( XEvent *pEvent );
- void Init( ULONG nSalFrameStyle, int nScreen = -1,
+ void Init( sal_uIntPtr nSalFrameStyle, int nScreen = -1,
SystemParentData* pParentData = NULL, bool bUseGeometry = false );
SalDisplay* GetDisplay() const { return pDisplay_; }
@@ -194,10 +194,10 @@ public:
XLIB_Window GetStackingWindow() const { return mhStackingWindow; }
long ShutDown() const { return CallCallback( SALEVENT_SHUTDOWN, 0 ); }
long Close() const { return CallCallback( SALEVENT_CLOSE, 0 ); }
- ULONG GetStyle() const { return nStyle_; }
+ sal_uIntPtr GetStyle() const { return nStyle_; }
inline XLIB_Cursor GetCursor() const { return hCursor_; }
- inline BOOL IsCaptured() const { return nCaptured_ == 1; }
+ inline sal_Bool IsCaptured() const { return nCaptured_ == 1; }
#if !defined(__synchronous_extinput__)
void HandleExtTextEvent (XClientMessageEvent *pEvent);
void PostExtTextEvent (sal_uInt16 nExtTextEventType,
@@ -213,6 +213,10 @@ public:
bool isMapped() const { return bMapped_; }
bool hasFocus() const { return mbInputFocus; }
+ void beginUnicodeSequence();
+ bool appendUnicodeSequence( sal_Unicode );
+ bool endUnicodeSequence();
+
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics* pGraphics );
@@ -220,39 +224,39 @@ public:
// call with false to setup graphics with window (GetWindow())
virtual void updateGraphics( bool bClear );
- virtual BOOL PostEvent( void* pData );
+ virtual sal_Bool PostEvent( void* pData );
virtual void SetTitle( const XubString& rTitle );
- virtual void SetIcon( USHORT nIcon );
+ virtual void SetIcon( sal_uInt16 nIcon );
virtual void SetMenu( SalMenu* pMenu );
virtual void DrawMenuBar();
virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle );
- virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE );
- virtual void Enable( BOOL bEnable );
+ virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = sal_False );
+ virtual void Enable( sal_Bool bEnable );
virtual void SetMinClientSize( long nWidth, long nHeight );
virtual void SetMaxClientSize( long nWidth, long nHeight );
- virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags );
+ virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags );
virtual void GetClientSize( long& rWidth, long& rHeight );
virtual void GetWorkArea( Rectangle& rRect );
virtual SalFrame* GetParent() const;
virtual void SetWindowState( const SalFrameState* pState );
- virtual BOOL GetWindowState( SalFrameState* pState );
- virtual void ShowFullScreen( BOOL bFullScreen, sal_Int32 nMonitor );
- virtual void StartPresentation( BOOL bStart );
- virtual void SetAlwaysOnTop( BOOL bOnTop );
- virtual void ToTop( USHORT nFlags );
+ virtual sal_Bool GetWindowState( SalFrameState* pState );
+ virtual void ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nMonitor );
+ virtual void StartPresentation( sal_Bool bStart );
+ virtual void SetAlwaysOnTop( sal_Bool bOnTop );
+ virtual void ToTop( sal_uInt16 nFlags );
virtual void SetPointer( PointerStyle ePointerStyle );
- virtual void CaptureMouse( BOOL bMouse );
+ virtual void CaptureMouse( sal_Bool bMouse );
virtual void SetPointerPos( long nX, long nY );
using SalFrame::Flush;
virtual void Flush();
virtual void Sync();
virtual void SetInputContext( SalInputContext* pContext );
- virtual void EndExtTextInput( USHORT nFlags );
- virtual String GetKeyName( USHORT nKeyCode );
- virtual String GetSymbolKeyName( const XubString& rFontName, USHORT nKeyCode );
- virtual BOOL MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode );
+ virtual void EndExtTextInput( sal_uInt16 nFlags );
+ virtual String GetKeyName( sal_uInt16 nKeyCode );
+ virtual String GetSymbolKeyName( const XubString& rFontName, sal_uInt16 nKeyCode );
+ virtual sal_Bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode );
virtual LanguageType GetInputLanguage();
virtual SalBitmap* SnapShot();
virtual void UpdateSettings( AllSettings& rSettings );
@@ -260,7 +264,7 @@ public:
virtual const SystemEnvData* GetSystemData() const;
virtual SalPointerState GetPointerState();
virtual SalIndicatorState GetIndicatorState();
- virtual void SimulateKeyPress( USHORT nKeyCode );
+ virtual void SimulateKeyPress( sal_uInt16 nKeyCode );
virtual void SetParent( SalFrame* pNewParent );
virtual bool SetPluginParent( SystemParentData* pNewParent );
virtual void SetBackgroundBitmap( SalBitmap* pBitmap );
@@ -272,7 +276,7 @@ public:
// set clip region to none (-> rectangular windows, normal state)
virtual void ResetClipRegion();
// start setting the clipregion consisting of nRects rectangles
- virtual void BeginSetClipRegion( ULONG nRects );
+ virtual void BeginSetClipRegion( sal_uIntPtr nRects );
// add a rectangle to the clip region
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
// done setting up the clipregion
diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h
index 4a9cd11f394d..ab8607aa523c 100644
--- a/vcl/unx/inc/salgdi.h
+++ b/vcl/unx/inc/salgdi.h
@@ -29,18 +29,15 @@
#ifndef _SV_SALGDI_H
#define _SV_SALGDI_H
-
-// -=-= exports -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-class SalFontCacheItem;
-
// -=-= includes -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#include "salstd.hxx"
#include "vcl/salgdi.hxx"
#include "vcl/salgtype.hxx"
#include "tools/fract.hxx"
#include "vcl/dllapi.h"
+#include <vcl/vclenum.hxx>
+#include <vcl/sallayout.hxx>
#include <deque>
-#include "xfont.hxx"
// -=-= forwards -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
struct ImplFontMetricData;
@@ -94,21 +91,20 @@ protected:
CairoFontsCache m_aCairoFontsCache;
XLIB_Region pPaintRegion_;
- XLIB_Region pClipRegion_;
+ XLIB_Region mpClipRegion;
GC pPenGC_; // Pen attributes
SalColor nPenColor_;
Pixel nPenPixel_;
GC pFontGC_; // Font attributes
- ExtendedFontStructRef mXFont[ MAX_FALLBACK ];
ServerFont* mpServerFont[ MAX_FALLBACK ];
SalColor nTextColor_;
Pixel nTextPixel_;
- BOOL bFontVertical_;
+ sal_Bool bFontVertical_;
- BOOL bDisableGraphite_;
+ sal_Bool bDisableGraphite_;
GC pBrushGC_; // Brush attributes
SalColor nBrushColor_;
@@ -123,21 +119,22 @@ protected:
GC pStippleGC_;
GC pTrackingGC_;
- BOOL bWindow_ : 1; // is Window
- BOOL bPrinter_ : 1; // is Printer
- BOOL bVirDev_ : 1; // is VirDev
- BOOL bPenGC_ : 1; // is Pen GC valid
- BOOL bFontGC_ : 1; // is Font GC valid
- BOOL bBrushGC_ : 1; // is Brush GC valid
- BOOL bMonoGC_ : 1; // is Mono GC valid
- BOOL bCopyGC_ : 1; // is Copy GC valid
- BOOL bInvertGC_ : 1; // is Invert GC valid
- BOOL bInvert50GC_ : 1; // is Invert50 GC valid
- BOOL bStippleGC_ : 1; // is Stipple GC valid
- BOOL bTrackingGC_ : 1; // is Tracking GC valid
+ sal_Bool bWindow_ : 1; // is Window
+ sal_Bool bPrinter_ : 1; // is Printer
+ sal_Bool bVirDev_ : 1; // is VirDev
+ sal_Bool bPenGC_ : 1; // is Pen GC valid
+ sal_Bool bFontGC_ : 1; // is Font GC valid
+ sal_Bool bBrushGC_ : 1; // is Brush GC valid
+ sal_Bool bMonoGC_ : 1; // is Mono GC valid
+ sal_Bool bCopyGC_ : 1; // is Copy GC valid
+ sal_Bool bInvertGC_ : 1; // is Invert GC valid
+ sal_Bool bInvert50GC_ : 1; // is Invert50 GC valid
+ sal_Bool bStippleGC_ : 1; // is Stipple GC valid
+ sal_Bool bTrackingGC_ : 1; // is Tracking GC valid
bool bXORMode_ : 1; // is ROP XOR Mode set
- BOOL bDitherBrush_ : 1; // is solid or tile
+ sal_Bool bDitherBrush_ : 1; // is solid or tile
+ using SalGraphics::SetClipRegion;
void SetClipRegion( GC pGC,
XLIB_Region pXReg = NULL ) const;
@@ -148,12 +145,12 @@ protected:
unsigned long nMask = GCGraphicsExposures );
GC SelectPen();
GC SelectBrush();
- void DrawLines( ULONG nPoints,
+ void DrawLines( sal_uIntPtr nPoints,
const SalPolyLine &rPoints,
GC pGC,
bool bClose
);
- BOOL GetDitherPixmap ( SalColor nSalColor );
+ sal_Bool GetDitherPixmap ( SalColor nSalColor );
inline GC GetMonoGC( Pixmap hPixmap );
inline GC GetCopyGC();
@@ -186,7 +183,7 @@ protected:
const SalBitmap &rTransparentBitmap,
SalColor nTransparentColor );
- GC SelectFont();
+ GC GetFontGC();
bool setFont( const ImplFontSelectData* pEntry, int nFallbackLevel );
void drawMaskedBitmap( const SalTwoRect* pPosAry,
@@ -194,9 +191,6 @@ protected:
const SalBitmap& rTransparentBitmap );
protected:
- void DrawStringUCS2MB( ExtendedFontStruct& rFont, const Point&,
- const sal_Unicode* pStr, int nLength );
-
void DrawPrinterString( const SalLayout& );
void DrawServerFontString( const ServerFontLayout& );
@@ -231,15 +225,12 @@ public:
// overload all pure virtual methods
virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
- virtual USHORT GetBitCount() const;
+ virtual sal_uInt16 GetBitCount() const;
virtual long GetGraphicsWidth() const;
virtual long GetGraphicsHeight() const;
virtual void ResetClipRegion();
- virtual void BeginSetClipRegion( ULONG nCount );
- virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
- virtual void EndSetClipRegion();
+ virtual bool setClipRegion( const Region& );
virtual void SetLineColor();
virtual void SetLineColor( SalColor nSalColor );
@@ -253,15 +244,15 @@ public:
virtual void SetROPFillColor( SalROPColor nROPColor );
virtual void SetTextColor( SalColor nSalColor );
- virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
+ virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel );
virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
- virtual ULONG GetKernPairs( ULONG nMaxPairs, ImplKernPairData* );
- virtual ImplFontCharMap* GetImplFontCharMap() const;
+ virtual sal_uLong GetKernPairs( sal_uLong nMaxPairs, ImplKernPairData* );
+ virtual const ImplFontCharMap* GetImplFontCharMap() const;
virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
virtual void GetDevFontList( ImplDevFontList* );
virtual void GetDevFontSubstList( OutputDevice* );
virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
- virtual BOOL CreateFontSubset( const rtl::OUString& rToFile,
+ virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData*,
sal_Int32* pGlyphIDs,
sal_uInt8* pEncoding,
@@ -280,8 +271,8 @@ public:
bool bVertical,
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc );
- virtual BOOL GetGlyphBoundRect( long nIndex, Rectangle& );
- virtual BOOL GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
+ virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& );
+ virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
virtual void DrawServerFontLayout( const ServerFontLayout& );
virtual bool supportsOperation( OutDevSupportType ) const;
@@ -289,9 +280,9 @@ public:
virtual void drawPixel( long nX, long nY, SalColor nSalColor );
virtual void drawLine( long nX1, long nY1, long nX2, long nY2 );
virtual void drawRect( long nX, long nY, long nWidth, long nHeight );
- void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry, bool bClose );
- virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry );
- virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry );
+ void drawPolyLine( sal_uIntPtr nPoints, const SalPoint* pPtAry, bool bClose );
+ virtual void drawPolyLine( sal_uIntPtr nPoints, const SalPoint* pPtAry );
+ virtual void drawPolygon( sal_uIntPtr nPoints, const SalPoint* pPtAry );
virtual void drawPolyPolygon( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
PCONSTSALPOINT* pPtAry );
@@ -300,16 +291,16 @@ public:
virtual bool drawFilledTrapezoids( const ::basegfx::B2DTrapezoid*, int nTrapCount, double fTransparency );
#if 1 // TODO: remove these obselete methods
- virtual sal_Bool drawPolyLineBezier( ULONG nPoints,
+ virtual sal_Bool drawPolyLineBezier( sal_uIntPtr nPoints,
const SalPoint* pPtAry,
- const BYTE* pFlgAry );
- virtual sal_Bool drawPolygonBezier( ULONG nPoints,
+ const sal_uInt8* pFlgAry );
+ virtual sal_Bool drawPolygonBezier( sal_uIntPtr nPoints,
const SalPoint* pPtAry,
- const BYTE* pFlgAry );
+ const sal_uInt8* pFlgAry );
virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
- const BYTE* const* pFlgAry );
+ const sal_uInt8* const* pFlgAry );
#endif
virtual void copyArea( long nDestX,
@@ -318,7 +309,7 @@ public:
long nSrcY,
long nSrcWidth,
long nSrcHeight,
- USHORT nFlags );
+ sal_uInt16 nFlags );
virtual void copyBits( const SalTwoRect* pPosAry,
SalGraphics* pSrcGraphics );
virtual void drawBitmap( const SalTwoRect* pPosAry,
@@ -335,9 +326,9 @@ public:
virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight );
virtual SalColor getPixel( long nX, long nY );
virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags );
- virtual void invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags );
+ virtual void invert( sal_uIntPtr nPoints, const SalPoint* pPtAry, SalInvert nFlags );
- virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize );
+ virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uIntPtr nSize );
virtual bool drawAlphaBitmap( const SalTwoRect&,
const SalBitmap& rSourceBitmap,
@@ -388,19 +379,8 @@ inline Pixel X11SalGraphics::GetPixel( SalColor nSalColor ) const
#ifdef DBG_UTIL
#define stderr0( s ) fprintf( stderr, s )
-#define stderr1( s, a ) fprintf( stderr, s, a )
-#define stderr2( s, a, b ) fprintf( stderr, s, a, b )
-#define stderr3( s, a, b, c ) fprintf( stderr, s, a, b, c )
-#define stdass0( b ) (void)( !(b) \
- ? fprintf( stderr, "\"%s\" (%s line %d)\n", \
- #b, __FILE__, __LINE__ ) \
- : 0 )
#else
#define stderr0( s ) ;
-#define stderr1( s, a ) ;
-#define stderr2( s, a, b ) ;
-#define stderr3( s, a, b, c ) ;
-#define stdass0( b ) ;
#endif
#endif // _SV_SALGDI_H
diff --git a/vcl/unx/inc/salinst.h b/vcl/unx/inc/salinst.h
index 0739902548bd..a571303333b3 100644
--- a/vcl/unx/inc/salinst.h
+++ b/vcl/unx/inc/salinst.h
@@ -39,7 +39,7 @@
class VCL_DLLPUBLIC SalYieldMutex : public vcl::SolarMutexObject
{
protected:
- ULONG mnCount;
+ sal_uIntPtr mnCount;
oslThreadIdentifier mnThreadId;
public:
@@ -49,7 +49,7 @@ public:
virtual void release();
virtual sal_Bool tryToAcquire();
- ULONG GetAcquireCount() const { return mnCount; }
+ sal_uIntPtr GetAcquireCount() const { return mnCount; }
oslThreadIdentifier GetThreadId() const { return mnThreadId; }
};
@@ -67,16 +67,16 @@ public:
{}
virtual ~X11SalInstance();
- virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle );
- virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
+ virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uIntPtr nStyle );
+ virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uIntPtr nStyle );
virtual void DestroyFrame( SalFrame* pFrame );
- virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE );
+ virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True );
virtual void DestroyObject( SalObject* pObject );
virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
long nDX, long nDY,
- USHORT nBitCount, const SystemGraphicsData *pData = NULL );
+ sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL );
virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice );
virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
@@ -97,15 +97,12 @@ public:
virtual SalSession* CreateSalSession();
virtual osl::SolarMutex* GetYieldMutex();
- virtual ULONG ReleaseYieldMutex();
- virtual void AcquireYieldMutex( ULONG nCount );
+ virtual sal_uIntPtr ReleaseYieldMutex();
+ virtual void AcquireYieldMutex( sal_uIntPtr nCount );
+ virtual bool CheckYieldMutex();
virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
- virtual bool AnyInput( USHORT nType );
- virtual SalMenu* CreateMenu( BOOL bMenuBar );
- virtual void DestroyMenu( SalMenu* pMenu);
- virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData );
- virtual void DestroyMenuItem( SalMenuItem* pItem );
+ virtual bool AnyInput( sal_uInt16 nType );
virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
void FillFontPathList( std::list< rtl::OString >& o_rFontPaths );
diff --git a/vcl/unx/inc/salobj.h b/vcl/unx/inc/salobj.h
index 2a09222c365c..577a3675fa3d 100644
--- a/vcl/unx/inc/salobj.h
+++ b/vcl/unx/inc/salobj.h
@@ -42,16 +42,16 @@ public:
SalClipRegion();
~SalClipRegion();
- void BeginSetClipRegion( ULONG nRects );
+ void BeginSetClipRegion( sal_uIntPtr nRects );
void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
XRectangle *EndSetClipRegion() {
return ClipRectangleList; }
void ResetClipRegion() {
numClipRectangles = 0; }
- USHORT GetClipRegionType() {
+ sal_uInt16 GetClipRegionType() {
return nClipRegionType; }
- void SetClipRegionType( USHORT nType ) {
+ void SetClipRegionType( sal_uInt16 nType ) {
nClipRegionType = nType; }
int GetRectangleCount() {
return numClipRectangles; }
@@ -61,7 +61,7 @@ private:
XRectangle* ClipRectangleList;
int numClipRectangles;
int maxClipRectangles;
- USHORT nClipRegionType;
+ sal_uInt16 nClipRegionType;
};
@@ -74,24 +74,24 @@ public:
XLIB_Window maSecondary;
Colormap maColormap;
SalClipRegion maClipRegion;
- BOOL mbVisible;
+ sal_Bool mbVisible;
static VCL_DLLPUBLIC long Dispatch( XEvent* pEvent );
- static VCL_DLLPUBLIC X11SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE );
+ static VCL_DLLPUBLIC X11SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True );
X11SalObject();
virtual ~X11SalObject();
// overload all pure virtual methods
virtual void ResetClipRegion();
- virtual USHORT GetClipRegionType();
- virtual void BeginSetClipRegion( ULONG nRects );
+ virtual sal_uInt16 GetClipRegionType();
+ virtual void BeginSetClipRegion( sal_uIntPtr nRects );
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
virtual void EndSetClipRegion();
virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight );
- virtual void Show( BOOL bVisible );
- virtual void Enable( BOOL nEnable );
+ virtual void Show( sal_Bool bVisible );
+ virtual void Enable( sal_Bool nEnable );
virtual void GrabFocus();
virtual void SetBackground();
@@ -99,6 +99,7 @@ public:
virtual const SystemEnvData* GetSystemData() const;
+ virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
};
#endif // _SV_SALOBJ_H
diff --git a/vcl/unx/inc/salprn.h b/vcl/unx/inc/salprn.h
index 97776d931f6a..b39a4034fa4b 100644
--- a/vcl/unx/inc/salprn.h
+++ b/vcl/unx/inc/salprn.h
@@ -49,16 +49,16 @@ public:
// overload all pure virtual methods
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual BOOL Setup( SalFrame* pFrame, ImplJobSetup* pSetupData );
- virtual BOOL SetPrinterData( ImplJobSetup* pSetupData );
- virtual BOOL SetData( ULONG nFlags, ImplJobSetup* pSetupData );
+ virtual sal_Bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData );
+ virtual sal_Bool SetPrinterData( ImplJobSetup* pSetupData );
+ virtual sal_Bool SetData( sal_uIntPtr nFlags, ImplJobSetup* pSetupData );
virtual void GetPageInfo( const ImplJobSetup* pSetupData,
long& rOutWidth, long& rOutHeight,
long& rPageOffX, long& rPageOffY,
long& rPageWidth, long& rPageHeight );
- virtual ULONG GetCapabilities( const ImplJobSetup* pSetupData, USHORT nType );
- virtual ULONG GetPaperBinCount( const ImplJobSetup* pSetupData );
- virtual String GetPaperBinName( const ImplJobSetup* pSetupData, ULONG nPaperBin );
+ virtual sal_uIntPtr GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType );
+ virtual sal_uIntPtr GetPaperBinCount( const ImplJobSetup* pSetupData );
+ virtual String GetPaperBinName( const ImplJobSetup* pSetupData, sal_uIntPtr nPaperBin );
virtual void InitPaperFormats( const ImplJobSetup* pSetupData );
virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData );
};
@@ -72,11 +72,12 @@ public:
bool m_bFax:1;
bool m_bPdf:1;
bool m_bSwallowFaxNo:1;
+ bool m_bIsPDFWriterJob:1;
PspGraphics* m_pGraphics;
psp::PrinterJob m_aPrintJob;
psp::JobData m_aJobData;
psp::PrinterGfx m_aPrinterGfx;
- ULONG m_nCopies;
+ sal_uIntPtr m_nCopies;
bool m_bCollate;
SalInfoPrinter* m_pInfoPrinter;
@@ -85,18 +86,23 @@ public:
// overload all pure virtual methods
using SalPrinter::StartJob;
- virtual BOOL StartJob( const XubString* pFileName,
+ virtual sal_Bool StartJob( const XubString* pFileName,
const XubString& rJobName,
const XubString& rAppName,
- ULONG nCopies,
+ sal_uIntPtr nCopies,
bool bCollate,
bool bDirect,
ImplJobSetup* pSetupData );
- virtual BOOL EndJob();
- virtual BOOL AbortJob();
- virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData );
- virtual BOOL EndPage();
- virtual ULONG GetErrorCode();
+ virtual sal_Bool StartJob( const String*,
+ const String&,
+ const String&,
+ ImplJobSetup*,
+ vcl::PrinterController& i_rController );
+ virtual sal_Bool EndJob();
+ virtual sal_Bool AbortJob();
+ virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData );
+ virtual sal_Bool EndPage();
+ virtual sal_uIntPtr GetErrorCode();
};
#endif // _SV_SALPRN_H
diff --git a/vcl/unx/inc/saltimer.h b/vcl/unx/inc/saltimer.h
index 7442f307c2c7..9820ba32d40c 100644
--- a/vcl/unx/inc/saltimer.h
+++ b/vcl/unx/inc/saltimer.h
@@ -38,7 +38,7 @@ public:
virtual ~X11SalTimer();
// overload all pure virtual methods
- void Start( ULONG nMS );
+ void Start( sal_uIntPtr nMS );
void Stop();
};
diff --git a/vcl/unx/inc/salunx.h b/vcl/unx/inc/salunx.h
index c0620d812f63..1c331d06b9e8 100644
--- a/vcl/unx/inc/salunx.h
+++ b/vcl/unx/inc/salunx.h
@@ -70,7 +70,7 @@ inline int operator == ( const timeval &t1, const timeval &t2 )
{
if( t1.tv_sec == t2.tv_sec )
return t1.tv_usec == t2.tv_usec;
- return FALSE;
+ return sal_False;
}
inline timeval &operator -= ( timeval &t1, const timeval &t2 )
@@ -97,7 +97,7 @@ inline timeval &operator += ( timeval &t1, const timeval &t2 )
return t1;
}
-inline timeval &operator += ( timeval &t1, ULONG t2 )
+inline timeval &operator += ( timeval &t1, sal_uIntPtr t2 )
{
t1.tv_sec += t2 / 1000;
t1.tv_usec += t2 ? (t2 % 1000) * 1000 : 500;
@@ -115,7 +115,7 @@ inline timeval operator + ( const timeval &t1, const timeval &t2 )
return t0 += t2;
}
-inline timeval operator + ( const timeval &t1, ULONG t2 )
+inline timeval operator + ( const timeval &t1, sal_uIntPtr t2 )
{
timeval t0 = t1;
return t0 += t2;
diff --git a/vcl/unx/inc/salvd.h b/vcl/unx/inc/salvd.h
index e1c2b91d1627..9add5c261bbd 100644
--- a/vcl/unx/inc/salvd.h
+++ b/vcl/unx/inc/salvd.h
@@ -49,17 +49,17 @@ class X11SalVirtualDevice : public SalVirtualDevice
int nDX_;
int nDY_;
- USHORT nDepth_;
- BOOL bGraphics_; // is Graphics used
- BOOL bExternPixmap_;
+ sal_uInt16 nDepth_;
+ sal_Bool bGraphics_; // is Graphics used
+ sal_Bool bExternPixmap_;
public:
X11SalVirtualDevice();
virtual ~X11SalVirtualDevice();
- BOOL Init( SalDisplay *pDisplay,
+ sal_Bool Init( SalDisplay *pDisplay,
long nDX, long nDY,
- USHORT nBitCount,
+ sal_uInt16 nBitCount,
int nScreen,
Pixmap hDrawable = None,
XRenderPictFormat* pXRenderFormat = NULL );
@@ -67,9 +67,9 @@ public:
inline Display *GetXDisplay() const;
inline SalDisplay *GetDisplay() const;
- inline BOOL IsDisplay() const;
+ inline sal_Bool IsDisplay() const;
inline Pixmap GetDrawable() const { return hDrawable_; }
- inline USHORT GetDepth() const { return nDepth_; }
+ inline sal_uInt16 GetDepth() const { return nDepth_; }
int GetWidth() const { return nDX_; }
int GetHeight() const { return nDY_; }
int GetScreenNumber() const { return m_nScreen; }
@@ -78,7 +78,7 @@ public:
virtual void ReleaseGraphics( SalGraphics* pGraphics );
// Set new size, without saving the old contents
- virtual BOOL SetSize( long nNewDX, long nNewDY );
+ virtual sal_Bool SetSize( long nNewDX, long nNewDY );
virtual void GetSize( long& rWidth, long& rHeight );
};
@@ -93,7 +93,7 @@ inline Display *X11SalVirtualDevice::GetXDisplay() const
inline SalDisplay *X11SalVirtualDevice::GetDisplay() const
{ return pDisplay_; }
-inline BOOL X11SalVirtualDevice::IsDisplay() const
+inline sal_Bool X11SalVirtualDevice::IsDisplay() const
{ return pDisplay_->IsDisplay(); }
#endif
diff --git a/vcl/unx/inc/soicon.hxx b/vcl/unx/inc/soicon.hxx
index bf1810640b54..cb3302cb777b 100644
--- a/vcl/unx/inc/soicon.hxx
+++ b/vcl/unx/inc/soicon.hxx
@@ -32,8 +32,8 @@ class SalDisplay;
class SalBitmap;
class Bitmap;
-BOOL SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,
- USHORT nIcon, USHORT iconSize,
+sal_Bool SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,
+ sal_uInt16 nIcon, sal_uInt16 iconSize,
Pixmap& icon_pixmap, Pixmap& icon_mask );
#endif
diff --git a/vcl/unx/inc/wmadaptor.hxx b/vcl/unx/inc/wmadaptor.hxx
index 23235e479e75..c6ef6d98bca8 100644
--- a/vcl/unx/inc/wmadaptor.hxx
+++ b/vcl/unx/inc/wmadaptor.hxx
@@ -164,6 +164,8 @@ protected:
bool m_bLegacyPartialFullscreen;
int m_nWinGravity;
int m_nInitWinGravity;
+ bool m_bWMshouldSwitchWorkspace;
+ bool m_bWMshouldSwitchWorkspaceInit;
WMAdaptor( SalDisplay * )
;
@@ -176,6 +178,7 @@ protected:
*/
virtual bool isValid() const;
+ bool getWMshouldSwitchWorkspace() const;
public:
virtual ~WMAdaptor();
@@ -213,8 +216,9 @@ public:
/*
* attemp to switch the desktop to a certain workarea
+ * if bConsiderWM is true, then on some WMs the call will not result in any action
*/
- void switchToWorkArea( int nWorkArea ) const;
+ void switchToWorkArea( int nWorkArea, bool bConsiderWM = true ) const;
/*
* sets window title
diff --git a/vcl/unx/inc/xfont.hxx b/vcl/unx/inc/xfont.hxx
deleted file mode 100644
index 8fc118808ae3..000000000000
--- a/vcl/unx/inc/xfont.hxx
+++ /dev/null
@@ -1,165 +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 EXTENDED_FONTSTRUCT_HXX
-#define EXTENDED_FONTSTRUCT_HXX
-
-#ifndef _XLIB_H_
-#include <tools/prex.h>
-#include <X11/Xlib.h>
-#include <tools/postx.h>
-#endif
-#include <tools/ref.hxx>
-#include <rtl/tencinfo.h>
-#include <vcl/vclenum.hxx>
-#include <vcl/sallayout.hxx>
-
-typedef unsigned short sal_MultiByte;
-
-class ImplFontMetricData;
-class ExtendedXlfd;
-
-struct VerticalTextItem
-{
- BOOL mbFixed;
- XFontStruct* mpXFontStruct;
- const sal_Unicode* mpString;
- int mnLength;
- int mnTransX;
- int mnTransY;
- int mnFixedAdvance;
- int* mpAdvanceAry;
-
- VerticalTextItem( XFontStruct* pXFontStruct,
- const sal_Unicode* pString,
- int nLength,
- int nTransX,
- int nTransY,
- int nFixedAdvance )
- : mbFixed( TRUE ),
- mpXFontStruct( pXFontStruct ),
- mpString( pString ),
- mnLength( nLength ),
- mnTransX( nTransX ),
- mnTransY( nTransY ),
- mnFixedAdvance( nFixedAdvance )
- {}
-
- VerticalTextItem( XFontStruct* pXFontStruct,
- const sal_Unicode* pString,
- int nLength,
- int nTransX,
- int nTransY,
- int* pAdvanceAry )
- : mbFixed( FALSE ),
- mpXFontStruct( pXFontStruct ),
- mpString( pString ),
- mnLength( nLength ),
- mnTransX( nTransX ),
- mnTransY( nTransY ),
- mpAdvanceAry( pAdvanceAry )
- {}
-
- ~VerticalTextItem()
- {
- if (!mbFixed)
- {
- delete( mpAdvanceAry );
- }
- }
-};
-
-class ExtendedFontStruct : public SvRefBase
-{
- private:
- Display* mpDisplay;
- Size maPixelSize;
- float mfXScale;
- float mfYScale;
- sal_Size mnDefaultWidth;
- sal_Bool mbVertical;
- rtl_TextEncoding mnCachedEncoding;
- rtl_TextEncoding mnAsciiEncoding;
-
- ExtendedXlfd* mpXlfd;
- XFontStruct** mpXFontStruct;
-
- // unicode range cache
- mutable sal_uInt32* mpRangeCodes;
- mutable int mnRangeCount;
-
- int LoadEncoding( rtl_TextEncoding nEncoding );
- FontPitch GetSpacing( rtl_TextEncoding nEncoding );
- bool GetFontBoundingBox( XCharStruct *pCharStruct,
- int *pAscent, int *pDescent ) ;
-
- sal_Size GetDefaultWidth();
- sal_Size GetCharWidth8( sal_Unicode nFrom, sal_Unicode nTo,
- sal_Int32 *pWidthArray,
- rtl_TextEncoding nEncoding );
- sal_Size GetCharWidthUTF16( sal_Unicode nFrom, sal_Unicode nTo,
- sal_Int32 *pWidthArray );
- sal_Size GetCharWidth16( sal_Unicode nFrom, sal_Unicode nTo,
- sal_Int32 *pWidthArray, ExtendedFontStruct *pFallback );
- public:
- ExtendedFontStruct( Display* pDisplay,
- const Size& rPixelSize, sal_Bool bVertical,
- ExtendedXlfd* pXlfd );
- ~ExtendedFontStruct();
- bool Match( const ExtendedXlfd *pXlfd,
- const Size& rPixelSize, sal_Bool bVertical ) const;
- XFontStruct* GetFontStruct( rtl_TextEncoding nEncoding );
- XFontStruct* GetFontStruct( sal_Unicode nChar,
- rtl_TextEncoding *pEncoding );
- bool ToImplFontMetricData( ImplFontMetricData *pMetric );
- rtl_TextEncoding GetAsciiEncoding( int *pAsciiRange = NULL ) const;
- sal_Size GetCharWidth( sal_Unicode,
- sal_Int32* pPhysWidth, sal_Int32* pLogWidth );
- int GetFontCodeRanges( sal_uInt32* pCodePairs ) const;
- bool HasUnicodeChar( sal_Unicode ) const;
-};
-
-// Declaration and Implementation for ExtendedFontStructRef: Add RefCounting
-// to ExtendedFontStruct (it's not possible to separate decl and impl into
-// a separate source file: all ref member functions are inline
-SV_DECL_IMPL_REF( ExtendedFontStruct );
-
-class X11FontLayout : public GenericSalLayout
-{
-public:
- X11FontLayout( ExtendedFontStruct& );
- virtual bool LayoutText( ImplLayoutArgs& );
- virtual void AdjustLayout( ImplLayoutArgs& );
- virtual void DrawText( SalGraphics& ) const;
-
-private:
- ExtendedFontStruct& mrFont;
-};
-
-#endif /* EXTENDED_FONTSTRUCT_HXX */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde/kdedata.cxx b/vcl/unx/kde/kdedata.cxx
index 881f63db1ffc..b87e7a0aea5b 100644
--- a/vcl/unx/kde/kdedata.cxx
+++ b/vcl/unx/kde/kdedata.cxx
@@ -30,7 +30,7 @@
#include "precompiled_vcl.hxx"
#define _SV_SALDATA_CXX
-#include <shell/kde_headers.h>
+#include <kde_headers.h>
#include <unistd.h>
#include <fcntl.h>
@@ -135,7 +135,7 @@ void KDEXLib::Init()
"http://artax.karlin.mff.cuni.cz/~kendy" );
m_nFakeCmdLineArgs = 1;
- USHORT nIdx;
+ sal_uInt16 nIdx;
int nParams = osl_getCommandArgCount();
rtl::OString aDisplay;
rtl::OUString aParam, aBin;
diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx
index 0c7e66ff5282..bf080084ed5b 100644
--- a/vcl/unx/kde/salnativewidgets-kde.cxx
+++ b/vcl/unx/kde/salnativewidgets-kde.cxx
@@ -30,7 +30,7 @@
#include "precompiled_vcl.hxx"
#define _SV_SALNATIVEWIDGETS_KDE_CXX
-#include <shell/kde_headers.h>
+#include <kde_headers.h>
#include <salunx.h>
#include <saldata.hxx>
@@ -239,7 +239,7 @@ class WidgetPainter
@param gc
The graphics context.
*/
- BOOL drawStyledWidget( QWidget *pWidget,
+ sal_Bool drawStyledWidget( QWidget *pWidget,
ControlState nState, const ImplControlValue& aValue,
Display *dpy, XLIB_Window drawable, int nScreen, int nDepth, GC gc,
ControlPart nPart = PART_ENTIRE_CONTROL );
@@ -252,7 +252,7 @@ class WidgetPainter
@return valid push button.
*/
- QPushButton *pushButton( const Rectangle& rControlRegion, BOOL bDefault );
+ QPushButton *pushButton( const Rectangle& rControlRegion, sal_Bool bDefault );
/** 'Get' method for radio button.
@@ -273,7 +273,7 @@ class WidgetPainter
@see pushButton(), m_pEditableComboBox
*/
- QComboBox *comboBox( const Rectangle& rControlRegion, BOOL bEditable );
+ QComboBox *comboBox( const Rectangle& rControlRegion, sal_Bool bEditable );
/** 'Get' method for line edit box.
@@ -310,13 +310,13 @@ class WidgetPainter
@see pushButton()
*/
QScrollBar *scrollBar( const Rectangle& rControlRegion,
- BOOL bHorizontal, const ImplControlValue& aValue );
+ sal_Bool bHorizontal, const ImplControlValue& aValue );
/** 'Get' method for tool bar.
@see pushButton()
*/
- QToolBar *toolBar( const Rectangle& rControlRegion, BOOL bHorizontal );
+ QToolBar *toolBar( const Rectangle& rControlRegion, sal_Bool bHorizontal );
/** 'Get' method for tool button.
@@ -431,13 +431,13 @@ WidgetPainter::~WidgetPainter( void )
delete m_pProgressBar, m_pProgressBar = NULL;
}
-BOOL WidgetPainter::drawStyledWidget( QWidget *pWidget,
+sal_Bool WidgetPainter::drawStyledWidget( QWidget *pWidget,
ControlState nState, const ImplControlValue& aValue,
Display *dpy, XLIB_Window drawable, int nScreen, int nDepth, GC gc,
ControlPart nPart )
{
if ( !pWidget )
- return FALSE;
+ return sal_False;
// Normalize the widget
QPoint qWidgetPos( pWidget->pos() );
@@ -592,7 +592,7 @@ BOOL WidgetPainter::drawStyledWidget( QWidget *pWidget,
pTab = m_pTabMiddle;
}
if ( !pTab )
- return FALSE;
+ return sal_False;
pTab->setRect( qRect );
@@ -780,7 +780,7 @@ BOOL WidgetPainter::drawStyledWidget( QWidget *pWidget,
pWidget->colorGroup(), nStyle );
}
else
- return FALSE;
+ return sal_False;
// Bitblt it to the screen
X11SalGraphics::CopyScreenArea( dpy,
@@ -793,11 +793,11 @@ BOOL WidgetPainter::drawStyledWidget( QWidget *pWidget,
// Restore widget's position
pWidget->move( qWidgetPos );
- return TRUE;
+ return sal_True;
}
QPushButton *WidgetPainter::pushButton( const Rectangle& rControlRegion,
- BOOL bDefault )
+ sal_Bool bDefault )
{
if ( !m_pPushButton )
m_pPushButton = new QPushButton( NULL, "push_button" );
@@ -892,7 +892,7 @@ QCheckBox *WidgetPainter::checkBox( const Rectangle& rControlRegion )
}
QComboBox *WidgetPainter::comboBox( const Rectangle& rControlRegion,
- BOOL bEditable )
+ sal_Bool bEditable )
{
QComboBox *pComboBox = NULL;
if ( bEditable )
@@ -1005,7 +1005,7 @@ QListView *WidgetPainter::listView( const Rectangle& rControlRegion )
}
QScrollBar *WidgetPainter::scrollBar( const Rectangle& rControlRegion,
- BOOL bHorizontal, const ImplControlValue& aValue )
+ sal_Bool bHorizontal, const ImplControlValue& aValue )
{
if ( !m_pScrollBar )
{
@@ -1032,7 +1032,7 @@ QScrollBar *WidgetPainter::scrollBar( const Rectangle& rControlRegion,
return m_pScrollBar;
}
-QToolBar *WidgetPainter::toolBar( const Rectangle& rControlRegion, BOOL bHorizontal )
+QToolBar *WidgetPainter::toolBar( const Rectangle& rControlRegion, sal_Bool bHorizontal )
{
if ( !m_pMainWindow )
m_pMainWindow = new QMainWindow( NULL, "main_window" );
@@ -1173,19 +1173,19 @@ class KDESalGraphics : public X11SalGraphics
public:
KDESalGraphics() {}
virtual ~KDESalGraphics() {}
- virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
- virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart,
+ virtual sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart );
+ virtual sal_Bool hitTestNativeControl( ControlType nType, ControlPart nPart,
const Rectangle& rControlRegion, const Point& aPos,
- BOOL& rIsInside );
- virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart,
+ sal_Bool& rIsInside );
+ virtual sal_Bool drawNativeControl( ControlType nType, ControlPart nPart,
const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue,
const OUString& aCaption );
- virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart,
+ virtual sal_Bool drawNativeControlText( ControlType nType, ControlPart nPart,
const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue,
const OUString& aCaption );
- virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart,
+ virtual sal_Bool getNativeControlRegion( ControlType nType, ControlPart nPart,
const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue,
const OUString& aCaption,
@@ -1200,10 +1200,10 @@ class KDESalGraphics : public X11SalGraphics
@param nPart
Specification of the widget's part if it consists of more than one.
- @return TRUE if the platform supports native drawing of the widget nType
+ @return sal_True if the platform supports native drawing of the widget nType
defined by nPart.
*/
-BOOL KDESalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
+sal_Bool KDESalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
{
return
( (nType == CTRL_PUSHBUTTON) && (nPart == PART_ENTIRE_CONTROL) ) ||
@@ -1235,21 +1235,21 @@ BOOL KDESalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
/** Test whether the position is in the native widget.
- If the return value is TRUE, bIsInside contains information whether
+ If the return value is sal_True, bIsInside contains information whether
aPos was or was not inside the native widget specified by the
nType/nPart combination.
*/
-BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
+sal_Bool KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
const Rectangle& rControlRegion, const Point& rPos,
- BOOL& rIsInside )
+ sal_Bool& rIsInside )
{
if ( nType == CTRL_SCROLLBAR )
{
// make position relative to rControlRegion
Point aPos = rPos - rControlRegion.TopLeft();
- rIsInside = FALSE;
+ rIsInside = sal_False;
- BOOL bHorizontal = ( nPart == PART_BUTTON_LEFT || nPart == PART_BUTTON_RIGHT );
+ sal_Bool bHorizontal = ( nPart == PART_BUTTON_LEFT || nPart == PART_BUTTON_RIGHT );
QScrollBar *pScrollBar = pWidgetPainter->scrollBar( rControlRegion,
bHorizontal, ImplControlValue() );
@@ -1259,10 +1259,10 @@ BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
QStyle::CC_ScrollBar, pScrollBar, QStyle::SC_ScrollBarAddLine );
// There are 2 buttons on the right/bottom side of the scrollbar
- BOOL bTwoSubButtons = FALSE;
+ sal_Bool bTwoSubButtons = sal_False;
// It is a Platinum style scroll bar
- BOOL bPlatinumStyle = FALSE;
+ sal_Bool bPlatinumStyle = sal_False;
// Workaround for Platinum and 3 button style scroll bars.
// It makes the right/down button bigger.
@@ -1272,9 +1272,9 @@ BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
QStyle::CC_ScrollBar, pScrollBar,
QStyle::SC_ScrollBarAddPage ).right() + 1 );
if ( qRectAddLine.width() > qRectSubLine.width() )
- bTwoSubButtons = TRUE;
+ bTwoSubButtons = sal_True;
if ( qRectSubLine.left() > kapp->style().querySubControlMetrics( QStyle::CC_ScrollBar, pScrollBar, QStyle::SC_ScrollBarSubPage ).left() )
- bPlatinumStyle = TRUE;
+ bPlatinumStyle = sal_True;
}
else
{
@@ -1282,16 +1282,16 @@ BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
QStyle::CC_ScrollBar, pScrollBar,
QStyle::SC_ScrollBarAddPage ).bottom() + 1 );
if ( qRectAddLine.height() > qRectSubLine.height() )
- bTwoSubButtons = TRUE;
+ bTwoSubButtons = sal_True;
if ( qRectSubLine.top() > kapp->style().querySubControlMetrics( QStyle::CC_ScrollBar, pScrollBar, QStyle::SC_ScrollBarSubPage ).top() )
- bPlatinumStyle = TRUE;
+ bPlatinumStyle = sal_True;
}
switch ( nPart )
{
case PART_BUTTON_LEFT:
if ( !bPlatinumStyle && qRectSubLine.contains( aPos.getX(), aPos.getY() ) )
- rIsInside = TRUE;
+ rIsInside = sal_True;
else if ( bTwoSubButtons )
{
qRectAddLine.setWidth( qRectAddLine.width() / 2 );
@@ -1301,7 +1301,7 @@ BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
case PART_BUTTON_UP:
if ( !bPlatinumStyle && qRectSubLine.contains( aPos.getX(), aPos.getY() ) )
- rIsInside = TRUE;
+ rIsInside = sal_True;
else if ( bTwoSubButtons )
{
qRectAddLine.setHeight( qRectAddLine.height() / 2 );
@@ -1325,13 +1325,13 @@ BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
// cases PART_TRACK_HORZ_AREA and PART_TRACK_VERT_AREA
default:
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
@@ -1346,12 +1346,12 @@ BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
@param aCaption
A caption or title string (like button text etc.)
*/
-BOOL KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart,
+sal_Bool KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart,
const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue,
const OUString& )
{
- BOOL bReturn = FALSE;
+ sal_Bool bReturn = sal_False;
Display *dpy = GetXDisplay();
XLIB_Window drawable = GetDrawable();
@@ -1381,7 +1381,7 @@ BOOL KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart,
else if ( (nType == CTRL_COMBOBOX) && (nPart == PART_ENTIRE_CONTROL) )
{
bReturn = pWidgetPainter->drawStyledWidget(
- pWidgetPainter->comboBox( rControlRegion, TRUE ),
+ pWidgetPainter->comboBox( rControlRegion, sal_True ),
nState, aValue,
dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
}
@@ -1395,7 +1395,7 @@ BOOL KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart,
else if ( (nType == CTRL_LISTBOX) && (nPart == PART_ENTIRE_CONTROL) )
{
bReturn = pWidgetPainter->drawStyledWidget(
- pWidgetPainter->comboBox( rControlRegion, FALSE ),
+ pWidgetPainter->comboBox( rControlRegion, sal_False ),
nState, aValue,
dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
}
@@ -1488,17 +1488,17 @@ BOOL KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart,
@param aCaption
A caption or title string (like button text etc.)
*/
-BOOL KDESalGraphics::drawNativeControlText( ControlType, ControlPart,
+sal_Bool KDESalGraphics::drawNativeControlText( ControlType, ControlPart,
const Rectangle&, ControlState,
const ImplControlValue&,
const OUString& )
{
- return FALSE;
+ return sal_False;
}
/** Check if the bounding regions match.
- If the return value is TRUE, rNativeBoundingRegion
+ If the return value is sal_True, rNativeBoundingRegion
contains the true bounding region covered by the control
including any adornment, while rNativeContentRegion contains the area
within the control that can be safely drawn into without drawing over
@@ -1513,13 +1513,13 @@ BOOL KDESalGraphics::drawNativeControlText( ControlType, ControlPart,
@param aCaption
A caption or title string (like button text etc.)
*/
-BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart,
+sal_Bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart,
const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue&,
const OUString&,
Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion )
{
- BOOL bReturn = FALSE;
+ sal_Bool bReturn = sal_False;
QRect qBoundingRect = WidgetPainter::region2QRect( rControlRegion );
QRect qRect;
@@ -1541,7 +1541,7 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
QStyle::PM_ButtonDefaultIndicator, pWidget );
qBoundingRect.addCoords( -nIndicatorSize, -nIndicatorSize,
nIndicatorSize, nIndicatorSize );
- bReturn = TRUE;
+ bReturn = sal_True;
}
break;
}
@@ -1556,7 +1556,7 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
qRect.setWidth( kapp->style().pixelMetric( QStyle::PM_ExclusiveIndicatorWidth, pWidget ) );
qRect.setHeight( kapp->style().pixelMetric( QStyle::PM_ExclusiveIndicatorHeight, pWidget ) );
- bReturn = TRUE;
+ bReturn = sal_True;
}
break;
@@ -1569,7 +1569,7 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
qRect.setWidth( kapp->style().pixelMetric( QStyle::PM_IndicatorWidth, pWidget ) );
qRect.setHeight( kapp->style().pixelMetric( QStyle::PM_IndicatorHeight, pWidget ) );
- bReturn = TRUE;
+ bReturn = sal_True;
}
break;
@@ -1586,14 +1586,14 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
QStyle::CC_ComboBox, pWidget,
QStyle::SC_ComboBoxEditField ).right() + 1 );
qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
- bReturn = TRUE;
+ bReturn = sal_True;
break;
case PART_SUB_EDIT:
qRect = kapp->style().querySubControlMetrics(
QStyle::CC_ComboBox, pWidget, QStyle::SC_ComboBoxEditField );
qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
- bReturn = TRUE;
+ bReturn = sal_True;
break;
}
break;
@@ -1606,14 +1606,14 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
case PART_BUTTON_UP:
qRect = kapp->style().querySubControlMetrics(
QStyle::CC_SpinWidget, pWidget, QStyle::SC_SpinWidgetUp );
- bReturn = TRUE;
+ bReturn = sal_True;
qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
break;
case PART_BUTTON_DOWN:
qRect = kapp->style().querySubControlMetrics(
QStyle::CC_SpinWidget, pWidget, QStyle::SC_SpinWidgetDown );
- bReturn = TRUE;
+ bReturn = sal_True;
qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
break;
@@ -1621,7 +1621,7 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
qRect = kapp->style().querySubControlMetrics(
QStyle::CC_SpinWidget, pWidget, QStyle::SC_SpinWidgetEditField );
qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
- bReturn = TRUE;
+ bReturn = sal_True;
break;
}
break;
@@ -1663,7 +1663,7 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
- bReturn = TRUE;
+ bReturn = sal_True;
break;
case PART_BUTTON_RIGHT:
@@ -1684,7 +1684,7 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
- bReturn = TRUE;
+ bReturn = sal_True;
break;
}
break;
@@ -1711,12 +1711,12 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
// KDESalFrame implementation
// -----------------------------------------------------------------------
-KDESalFrame::KDESalFrame( SalFrame* pParent, ULONG nStyle ) :
+KDESalFrame::KDESalFrame( SalFrame* pParent, sal_uLong nStyle ) :
X11SalFrame( pParent, nStyle )
{
}
-void KDESalFrame::Show( BOOL bVisible, BOOL bNoActivate )
+void KDESalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
{
if ( !GetParent() && ! (GetStyle() & SAL_FRAME_STYLE_INTRO) )
{
@@ -1931,9 +1931,9 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
{
Color aColor2 = aStyleSettings.GetLightColor();
aStyleSettings.
- SetCheckedColor( Color( (BYTE)(((USHORT)aBack.GetRed()+(USHORT)aColor2.GetRed())/2),
- (BYTE)(((USHORT)aBack.GetGreen()+(USHORT)aColor2.GetGreen())/2),
- (BYTE)(((USHORT)aBack.GetBlue()+(USHORT)aColor2.GetBlue())/2)
+ SetCheckedColor( Color( (sal_uInt8)(((sal_uInt16)aBack.GetRed()+(sal_uInt16)aColor2.GetRed())/2),
+ (sal_uInt8)(((sal_uInt16)aBack.GetGreen()+(sal_uInt16)aColor2.GetGreen())/2),
+ (sal_uInt8)(((sal_uInt16)aBack.GetBlue()+(sal_uInt16)aColor2.GetBlue())/2)
) );
}
@@ -1968,7 +1968,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
qMainWindow.createGUI( "/dev/null" ); // hack
// Menu
- aStyleSettings.SetSkipDisabledInMenus( TRUE );
+ aStyleSettings.SetSkipDisabledInMenus( sal_True );
KMenuBar *pMenuBar = qMainWindow.menuBar();
if ( pMenuBar )
{
@@ -2089,7 +2089,7 @@ KDESalFrame::GraphicsHolder::~GraphicsHolder()
// -----------------------------------------------------------------------
SalFrame *
-KDESalInstance::CreateFrame( SalFrame *pParent, ULONG nStyle )
+KDESalInstance::CreateFrame( SalFrame *pParent, sal_uLong nStyle )
{
return new KDESalFrame( pParent, nStyle );
}
diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx
index 107a2a2757b8..4aac0e144af0 100644
--- a/vcl/unx/kde4/KDESalFrame.cxx
+++ b/vcl/unx/kde4/KDESalFrame.cxx
@@ -57,7 +57,7 @@
#include <stdio.h>
#endif
-KDESalFrame::KDESalFrame( SalFrame* pParent, ULONG nState ) :
+KDESalFrame::KDESalFrame( SalFrame* pParent, sal_uLong nState ) :
X11SalFrame( pParent, nState )
{
}
@@ -275,9 +275,9 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
{
Color aColor2 = style.GetLightColor();
style.
- SetCheckedColor( Color( (BYTE)(((USHORT)aBack.GetRed()+(USHORT)aColor2.GetRed())/2),
- (BYTE)(((USHORT)aBack.GetGreen()+(USHORT)aColor2.GetGreen())/2),
- (BYTE)(((USHORT)aBack.GetBlue()+(USHORT)aColor2.GetBlue())/2)
+ SetCheckedColor( Color( (BYTE)(((sal_uInt16)aBack.GetRed()+(sal_uInt16)aColor2.GetRed())/2),
+ (BYTE)(((sal_uInt16)aBack.GetGreen()+(sal_uInt16)aColor2.GetGreen())/2),
+ (BYTE)(((sal_uInt16)aBack.GetBlue()+(sal_uInt16)aColor2.GetBlue())/2)
) );
}
diff --git a/vcl/unx/kde4/KDESalFrame.hxx b/vcl/unx/kde4/KDESalFrame.hxx
index 2d9c7f8a7aa0..0ee879f044d4 100644
--- a/vcl/unx/kde4/KDESalFrame.hxx
+++ b/vcl/unx/kde4/KDESalFrame.hxx
@@ -48,7 +48,7 @@ class KDESalFrame : public X11SalFrame
GraphicsHolder m_aGraphics[ nMaxGraphics ];
public:
- KDESalFrame( SalFrame* pParent, ULONG nStyle );
+ KDESalFrame( SalFrame* pParent, sal_uLong nStyle );
virtual ~KDESalFrame();
virtual SalGraphics* GetGraphics();
diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index 1a0e547ead04..26c104c90262 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -859,7 +859,7 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
if( part == PART_BORDER )
{
int nFrameWidth = getFrameWidth();
- USHORT nStyle = val.getNumericVal();
+ sal_uInt16 nStyle = val.getNumericVal();
if( nStyle & FRAME_DRAW_NODRAW )
{
// in this case the question is: how thick would a frame be
diff --git a/vcl/unx/kde4/KDESalInstance.cxx b/vcl/unx/kde4/KDESalInstance.cxx
index 302d20ca9bc4..c63d328e29c3 100644
--- a/vcl/unx/kde4/KDESalInstance.cxx
+++ b/vcl/unx/kde4/KDESalInstance.cxx
@@ -30,7 +30,7 @@
#include "KDESalFrame.hxx"
-SalFrame* KDESalInstance::CreateFrame( SalFrame *pParent, ULONG nState )
+SalFrame* KDESalInstance::CreateFrame( SalFrame *pParent, sal_uLong nState )
{
return new KDESalFrame( pParent, nState );
}
diff --git a/vcl/unx/kde4/KDESalInstance.hxx b/vcl/unx/kde4/KDESalInstance.hxx
index c42fea68ddcf..9f35557061bb 100644
--- a/vcl/unx/kde4/KDESalInstance.hxx
+++ b/vcl/unx/kde4/KDESalInstance.hxx
@@ -38,7 +38,7 @@ class KDESalInstance : public X11SalInstance
public:
KDESalInstance( SalYieldMutex* pMutex ) : X11SalInstance( pMutex ) {}
virtual ~KDESalInstance() {}
- virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
+ virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle );
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index 13c39528b3ae..ce4ea14dadb5 100644
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -131,7 +131,7 @@ void KDEXLib::Init()
//kAboutData->setProgramIconName("OpenOffice");
m_nFakeCmdLineArgs = 2;
- USHORT nIdx;
+ sal_uInt16 nIdx;
int nParams = osl_getCommandArgCount();
rtl::OString aDisplay;
@@ -345,7 +345,7 @@ bool KDEXLib::processYield( bool bWait, bool bHandleAllCurrentEvents )
return wasEvent;
}
-void KDEXLib::StartTimer( ULONG nMS )
+void KDEXLib::StartTimer( sal_uLong nMS )
{
if( eventLoopType == LibreOfficeEventLoop )
return SalXLib::StartTimer( nMS );
diff --git a/vcl/unx/kde4/KDEXLib.hxx b/vcl/unx/kde4/KDEXLib.hxx
index 21a5a45c4628..72848ed4084c 100644
--- a/vcl/unx/kde4/KDEXLib.hxx
+++ b/vcl/unx/kde4/KDEXLib.hxx
@@ -83,7 +83,7 @@ class KDEXLib : public QObject, public SalXLib
virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
virtual void Insert( int fd, void* data, YieldFunc pending, YieldFunc queued, YieldFunc handle );
virtual void Remove( int fd );
- virtual void StartTimer( ULONG nMS );
+ virtual void StartTimer( sal_uLong nMS );
virtual void StopTimer();
virtual void Wakeup();
virtual void PostUserEvent();
diff --git a/vcl/unx/source/app/i18n_cb.cxx b/vcl/unx/source/app/i18n_cb.cxx
index f8f4f57da043..fbbb6eeabbf1 100644
--- a/vcl/unx/source/app/i18n_cb.cxx
+++ b/vcl/unx/source/app/i18n_cb.cxx
@@ -282,12 +282,12 @@ Preedit_UpdateAttributes ( preedit_text_t* ptext, XIMFeedback* feedback,
// Convert the XIM feedback values into appropriate VCL
// SAL_EXTTEXTINPUT_ATTR values
// returns an allocate list of attributes, which must be freed by caller
-USHORT*
-Preedit_FeedbackToSAL ( XIMFeedback* pfeedback, int nlength, std::vector<USHORT>& rSalAttr )
+sal_uInt16*
+Preedit_FeedbackToSAL ( XIMFeedback* pfeedback, int nlength, std::vector<sal_uInt16>& rSalAttr )
{
- USHORT *psalattr;
- USHORT nval;
- USHORT noldval = 0;
+ sal_uInt16 *psalattr;
+ sal_uInt16 nval;
+ sal_uInt16 noldval = 0;
XIMFeedback nfeedback;
// only work with reasonable length
@@ -297,7 +297,7 @@ Preedit_FeedbackToSAL ( XIMFeedback* pfeedback, int nlength, std::vector<USHORT>
psalattr = &rSalAttr[0];
}
else
- return (USHORT*)NULL;
+ return (sal_uInt16*)NULL;
for (int npos = 0; npos < nlength; npos++)
{
diff --git a/vcl/unx/source/app/i18n_ic.cxx b/vcl/unx/source/app/i18n_ic.cxx
index fc43e7b81d0b..9b30ba6a6546 100644
--- a/vcl/unx/source/app/i18n_ic.cxx
+++ b/vcl/unx/source/app/i18n_ic.cxx
@@ -184,7 +184,7 @@ SalI18N_InputContext::SalI18N_InputContext ( SalFrame *pFrame ) :
maClientData.aInputEv.mnCursorPos = 0;
maClientData.aInputEv.mnDeltaStart = 0;
maClientData.aInputEv.mnCursorFlags = 0;
- maClientData.aInputEv.mbOnlyCursor = FALSE;
+ maClientData.aInputEv.mbOnlyCursor = sal_False;
SalI18N_InputMethod *pInputMethod;
pInputMethod = GetX11SalData()->GetDisplay()->GetInputMethod();
@@ -760,7 +760,7 @@ SalI18N_InputContext::SetLanguage(LanguageType)
}
void
-SalI18N_InputContext::EndExtTextInput( USHORT /*nFlags*/ )
+SalI18N_InputContext::EndExtTextInput( sal_uInt16 /*nFlags*/ )
{
if ( mbUseable && (maContext != NULL) && maClientData.pFrame )
{
diff --git a/vcl/unx/source/app/i18n_status.cxx b/vcl/unx/source/app/i18n_status.cxx
index b609081cc68c..bfea280dc687 100644
--- a/vcl/unx/source/app/i18n_status.cxx
+++ b/vcl/unx/source/app/i18n_status.cxx
@@ -102,7 +102,7 @@ class XIMStatusWindow : public StatusWindow
// for delayed showing
bool m_bDelayedShow;
I18NStatus::ShowReason m_eDelayedReason;
- ULONG m_nDelayedEvent;
+ sal_uLong m_nDelayedEvent;
// for toggling
bool m_bOn;
@@ -165,7 +165,7 @@ void XIMStatusWindow::layout()
m_aStatusText.SetPosSizePixel( Point( 1, 1 ), aControlSize );
m_aStatusText.SetFont( aFont );
- m_aStatusText.Show( TRUE );
+ m_aStatusText.Show( sal_True );
if (m_bAnchoredAtRight && IsVisible())
{
@@ -257,7 +257,7 @@ void XIMStatusWindow::setPosition( SalFrame* pParent )
{
setText( String() );
m_pLastParent = pParent;
- Show( FALSE, SHOW_NOACTIVATE );
+ Show( sal_False, SHOW_NOACTIVATE );
}
if( IsVisible() )
{
@@ -359,7 +359,7 @@ IIIMPStatusWindow::IIIMPStatusWindow( SalFrame* pParent, bool bOn ) :
m_aStatusBtn.SetSelectHdl( LINK( this, IIIMPStatusWindow, SelectHdl ) );
m_aStatusBtn.SetPopupMenu( &m_aMenu );
- m_aStatusBtn.Show( TRUE );
+ m_aStatusBtn.Show( sal_True );
const ::std::vector< I18NStatus::ChoiceData >& rChoices( I18NStatus::get().getChoices() );
int i = 1;
@@ -384,7 +384,7 @@ IIIMPStatusWindow::IIIMPStatusWindow( SalFrame* pParent, bool bOn ) :
else
fprintf( stderr, "Warning: could not reposition status window since no frame\n" );
#endif
- EnableAlwaysOnTop( TRUE );
+ EnableAlwaysOnTop( sal_True );
}
IIIMPStatusWindow::~IIIMPStatusWindow()
diff --git a/vcl/unx/source/app/saldata.cxx b/vcl/unx/source/app/saldata.cxx
index c2dcb090cfc4..d8d54ddcc081 100644
--- a/vcl/unx/source/app/saldata.cxx
+++ b/vcl/unx/source/app/saldata.cxx
@@ -410,7 +410,7 @@ void SalXLib::Init()
sal_uInt32 nParams = osl_getCommandArgCount();
rtl::OUString aParam;
rtl::OString aDisplay;
- for (USHORT i=0; i<nParams; i++)
+ for (sal_uInt16 i=0; i<nParams; i++)
{
osl_getCommandArg(i, &aParam.pData);
if (aParam.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("-display")))
@@ -427,8 +427,8 @@ void SalXLib::Init()
* the clipboard build another connection
* to the xserver using $DISPLAY
*/
- rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("DISPLAY"));
- osl_setEnvironment(envVar.pData, aParam.pData);
+ rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("DISPLAY"));
+ osl_setEnvironment(envVar.pData, aParam.pData);
}
break;
}
diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx
index 4bc379846edf..3ba82446c13e 100644
--- a/vcl/unx/source/app/saldisp.cxx
+++ b/vcl/unx/source/app/saldisp.cxx
@@ -213,7 +213,7 @@ static int sal_significantBits( Pixel nMask )
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-static BOOL sal_GetVisualInfo( Display *pDisplay, XID nVID, XVisualInfo &rVI )
+static sal_Bool sal_GetVisualInfo( Display *pDisplay, XID nVID, XVisualInfo &rVI )
{
int nInfos;
XVisualInfo aTemplate;
@@ -223,25 +223,25 @@ static BOOL sal_GetVisualInfo( Display *pDisplay, XID nVID, XVisualInfo &rVI )
pInfos = XGetVisualInfo( pDisplay, VisualIDMask, &aTemplate, &nInfos );
if( !pInfos )
- return FALSE;
+ return sal_False;
rVI = *pInfos;
XFree( pInfos );
DBG_ASSERT( rVI.visualid == nVID,
"sal_GetVisualInfo: could not get correct visual by visualId" );
- return TRUE;
+ return sal_True;
}
// ---------------------------------------------------------------------------
// check wether displaystring is in format N.M or N. or just N
// with N and M beeing natural numbers
-static BOOL
+static sal_Bool
sal_IsDisplayNumber( const char *pDisplayString )
{
if ( ! isdigit(*pDisplayString) )
- return FALSE;
+ return sal_False;
while ( isdigit(*(++pDisplayString)) )
; /* do nothing */
@@ -255,12 +255,12 @@ sal_IsDisplayNumber( const char *pDisplayString )
}
// check whether host1 and host2 point to the same ip address
-static BOOL
+static sal_Bool
sal_EqualHosts( const OUString& Host1, const OUString& Host2)
{
oslSocketAddr pHostAddr1;
oslSocketAddr pHostAddr2;
- BOOL bEqualAddress = FALSE;
+ sal_Bool bEqualAddress = sal_False;
if ( Host1.toChar() >= '0' && Host1.toChar() <= '9' )
pHostAddr1 = osl_createInetSocketAddr( Host1.pData, 0 );
@@ -273,7 +273,7 @@ sal_EqualHosts( const OUString& Host1, const OUString& Host2)
pHostAddr2 = osl_resolveHostname( Host2.pData );
if( pHostAddr1 && pHostAddr2 )
- bEqualAddress = osl_isEqualSocketAddr( pHostAddr1, pHostAddr2 ) ? TRUE : FALSE;
+ bEqualAddress = osl_isEqualSocketAddr( pHostAddr1, pHostAddr2 ) ? sal_True : sal_False;
if( pHostAddr1 )
osl_destroySocketAddr( pHostAddr1 );
@@ -283,14 +283,14 @@ sal_EqualHosts( const OUString& Host1, const OUString& Host2)
return bEqualAddress;
}
-static BOOL
+static sal_Bool
sal_IsLocalDisplay( Display *pDisplay )
{
const char *pDisplayString = DisplayString( pDisplay );
// no string, no idea
if ( pDisplayString == NULL || pDisplayString[ 0 ] == '\0')
- return FALSE;
+ return sal_False;
// check for ":x.y"
if ( pDisplayString[ 0 ] == ':' )
@@ -314,7 +314,7 @@ sal_IsLocalDisplay( Display *pDisplay )
// compare local hostname to displaystring, both may be ip address or
// hostname
- BOOL bEqual = FALSE;
+ sal_Bool bEqual = sal_False;
char *pDisplayHost = strdup( pDisplayString );
char *pPtr = strrchr( pDisplayHost, ':' );
@@ -339,14 +339,14 @@ sal_IsLocalDisplay( Display *pDisplay )
// since it is not called very often and sal_IsLocalDisplay() is relative
// expensive bLocal_ is initialized on first call
-BOOL SalDisplay::IsLocal()
+sal_Bool SalDisplay::IsLocal()
{
if ( ! mbLocalIsValid )
{
bLocal_ = sal_IsLocalDisplay( pDisp_ );
- mbLocalIsValid = TRUE;
+ mbLocalIsValid = sal_True;
}
- return (BOOL)bLocal_;
+ return (sal_Bool)bLocal_;
}
// ---------------------------------------------------------------------------
@@ -375,11 +375,6 @@ sal_GetServerVendor( Display *p_display )
{ vendor_none, NULL, 0 },
};
-#ifdef _USE_PRINT_EXTENSION_
- if ( ! XSalIsDisplay( p_display ) )
- return vendor_xprinter;
-#endif
-
// handle regular server vendors
char *p_name = ServerVendor( p_display );
vendor_t *p_vendor;
@@ -411,7 +406,7 @@ static sal_Bool sal_IsTrustedSolaris (Display *p_display)
// -=-= SalDisplay -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-BOOL SalDisplay::BestVisual( Display *pDisplay,
+sal_Bool SalDisplay::BestVisual( Display *pDisplay,
int nScreen,
XVisualInfo &rVI )
{
@@ -436,51 +431,51 @@ BOOL SalDisplay::BestVisual( Display *pDisplay,
int i;
for( i = 0; i < nVisuals; i++ )
{
- BOOL bUsable = FALSE;
+ sal_Bool bUsable = sal_False;
int nTrueColor = 1;
if ( pVInfos[i].screen != nScreen )
{
- bUsable = FALSE;
+ bUsable = sal_False;
}
else
if( pVInfos[i].c_class == TrueColor )
{
nTrueColor = 2048;
if( pVInfos[i].depth == 24 )
- bUsable = TRUE;
-#ifdef TRUECOLOR8
+ bUsable = sal_True;
+#ifdef sal_TrueCOLOR8
else if( pVInfos[i].depth == 8 )
{
nTrueColor = -1; // strongly discourage 8 bit true color
- bUsable = TRUE;
+ bUsable = sal_True;
}
#endif
-#ifdef TRUECOLOR15
+#ifdef sal_TrueCOLOR15
else if( pVInfos[i].depth == 15 )
- bUsable = TRUE;
+ bUsable = sal_True;
#endif
-#ifdef TRUECOLOR16
+#ifdef sal_TrueCOLOR16
else if( pVInfos[i].depth == 16 )
- bUsable = TRUE;
+ bUsable = sal_True;
#endif
-#ifdef TRUECOLOR32
+#ifdef sal_TrueCOLOR32
else if( pVInfos[i].depth == 32 )
{
nTrueColor = 256;
// we do not have use for an alpha channel
// better use a 24 or 16 bit truecolor visual if possible
- bUsable = TRUE;
+ bUsable = sal_True;
}
#endif
}
else if( pVInfos[i].c_class == PseudoColor )
{
if( pVInfos[i].depth <= 8 )
- bUsable = TRUE;
+ bUsable = sal_True;
#ifdef PSEUDOCOLOR12
else if( pVInfos[i].depth == 12 )
- bUsable = TRUE;
+ bUsable = sal_True;
#endif
}
pWeight[ i ] = bUsable ? nTrueColor*pVInfos[i].depth : -1024;
@@ -508,7 +503,6 @@ BOOL SalDisplay::BestVisual( Display *pDisplay,
SalDisplay::SalDisplay( Display *display ) :
mpInputMethod( NULL ),
- mpFallbackFactory ( NULL ),
pDisp_( display ),
m_pWMAdaptor( NULL ),
m_pDtIntegrator( NULL ),
@@ -557,7 +551,6 @@ void SalDisplay::doDestruct()
m_pDtIntegrator = NULL;
X11SalBitmap::ImplDestroyCache();
X11SalGraphics::releaseGlyphPeer();
- DestroyFontCache();
if( IsDisplay() )
{
@@ -650,7 +643,7 @@ fd
GetSalData()->m_pInstance->GetYieldMutex()->acquire();
pDisplay->Yield();
GetSalData()->m_pInstance->GetYieldMutex()->release();
- return TRUE;
+ return sal_True;
}
SalX11Display::SalX11Display( Display *display )
@@ -818,8 +811,6 @@ void SalDisplay::Init()
eWindowManager_ = otherwm;
nProperties_ = PROPERTY_DEFAULT;
hEventGuard_ = NULL;
- m_pFontCache = NULL;
- mpFontList = (XlfdStorage*)NULL;
mpFactory = (AttributeProvider*)NULL;
m_pCapture = NULL;
m_bXinerama = false;
@@ -859,9 +850,9 @@ void SalDisplay::Init()
X11SalBitmap::ImplCreateCache();
hEventGuard_ = osl_createMutex();
- bLocal_ = FALSE; /* dont care, initialize later by
+ bLocal_ = sal_False; /* dont care, initialize later by
calling SalDisplay::IsLocal() */
- mbLocalIsValid = FALSE; /* bLocal_ is not yet initialized */
+ mbLocalIsValid = sal_False; /* bLocal_ is not yet initialized */
// - - - - - - - - - - Synchronize - - - - - - - - - - - - -
if( getenv( "SAL_SYNCHRONIZE" ) )
@@ -1079,7 +1070,7 @@ unsigned int GetKeySymMask(Display* dpy, KeySym nKeySym)
}
-void SalDisplay::SimulateKeyPress( USHORT nKeyCode )
+void SalDisplay::SimulateKeyPress( sal_uInt16 nKeyCode )
{
if (nKeyCode == KEY_CAPSLOCK)
{
@@ -1098,10 +1089,10 @@ void SalDisplay::SimulateKeyPress( USHORT nKeyCode )
}
}
-USHORT SalDisplay::GetIndicatorState() const
+sal_uInt16 SalDisplay::GetIndicatorState() const
{
unsigned int _state = 0;
- USHORT nState = 0;
+ sal_uInt16 nState = 0;
XkbGetIndicatorState(pDisp_, XkbUseCoreKbd, &_state);
if ((_state & 0x00000001))
@@ -1182,7 +1173,7 @@ void SalDisplay::ModifierMapping()
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-XubString SalDisplay::GetKeyName( USHORT nKeyCode ) const
+XubString SalDisplay::GetKeyName( sal_uInt16 nKeyCode ) const
{
String aStrMap;
String aCustomKeyName;
@@ -1383,27 +1374,27 @@ XubString SalDisplay::GetKeyName( USHORT nKeyCode ) const
#define IsISOKey( n ) (0x0000FE00==((n)&0xFFFFFF00))
#endif
-USHORT SalDisplay::GetKeyCode( KeySym keysym, char*pcPrintable ) const
+sal_uInt16 SalDisplay::GetKeyCode( KeySym keysym, char*pcPrintable ) const
{
- USHORT nKey = 0;
+ sal_uInt16 nKey = 0;
if( XK_a <= keysym && XK_z >= keysym )
- nKey = (USHORT)(KEY_A + (keysym - XK_a));
+ nKey = (sal_uInt16)(KEY_A + (keysym - XK_a));
else if( XK_A <= keysym && XK_Z >= keysym )
- nKey = (USHORT)(KEY_A + (keysym - XK_A));
+ nKey = (sal_uInt16)(KEY_A + (keysym - XK_A));
else if( XK_0 <= keysym && XK_9 >= keysym )
- nKey = (USHORT)(KEY_0 + (keysym - XK_0));
+ nKey = (sal_uInt16)(KEY_0 + (keysym - XK_0));
else if( IsModifierKey( keysym ) )
;
else if( IsKeypadKey( keysym ) )
{
if( (keysym >= XK_KP_0) && (keysym <= XK_KP_9) )
{
- nKey = (USHORT)(KEY_0 + (keysym - XK_KP_0));
+ nKey = (sal_uInt16)(KEY_0 + (keysym - XK_KP_0));
*pcPrintable = '0' + nKey - KEY_0;
}
else if( IsPFKey( keysym ) )
- nKey = (USHORT)(KEY_F1 + (keysym - XK_KP_F1));
+ nKey = (sal_uInt16)(KEY_F1 + (keysym - XK_KP_F1));
else switch( keysym )
{
case XK_KP_Space:
@@ -1482,7 +1473,7 @@ USHORT SalDisplay::GetKeyCode( KeySym keysym, char*pcPrintable ) const
if( bNumLockFromXS_ )
{
if( keysym >= XK_F1 && keysym <= XK_F26 )
- nKey = (USHORT)(KEY_F1 + keysym - XK_F1);
+ nKey = (sal_uInt16)(KEY_F1 + keysym - XK_F1);
}
else switch( keysym )
{
@@ -1551,7 +1542,7 @@ USHORT SalDisplay::GetKeyCode( KeySym keysym, char*pcPrintable ) const
break;
default:
if( keysym >= XK_F1 && keysym <= XK_F26 )
- nKey = (USHORT)(KEY_F1 + keysym - XK_F1);
+ nKey = (sal_uInt16)(KEY_F1 + keysym - XK_F1);
break;
}
}
@@ -2258,7 +2249,7 @@ int SalDisplay::CaptureMouse( SalFrame *pCapture )
// Events
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void SalDisplay::SendInternalEvent( SalFrame* pFrame, void* pData, USHORT nEvent )
+void SalDisplay::SendInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent )
{
if( osl_acquireMutex( hEventGuard_ ) )
{
@@ -2274,7 +2265,7 @@ void SalDisplay::SendInternalEvent( SalFrame* pFrame, void* pData, USHORT nEvent
}
}
-void SalDisplay::CancelInternalEvent( SalFrame* pFrame, void* pData, USHORT nEvent )
+void SalDisplay::CancelInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent )
{
if( osl_acquireMutex( hEventGuard_ ) )
{
@@ -2301,29 +2292,29 @@ void SalDisplay::CancelInternalEvent( SalFrame* pFrame, void* pData, USHORT nEve
}
}
-BOOL SalX11Display::IsEvent()
+sal_Bool SalX11Display::IsEvent()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( osl_acquireMutex( hEventGuard_ ) )
{
if( m_aUserEvents.begin() != m_aUserEvents.end() )
- bRet = TRUE;
+ bRet = sal_True;
osl_releaseMutex( hEventGuard_ );
}
if( bRet || XEventsQueued( pDisp_, QueuedAlready ) )
- return TRUE;
+ return sal_True;
XFlush( pDisp_ );
- return FALSE;
+ return sal_False;
}
bool SalDisplay::DispatchInternalEvent()
{
SalFrame* pFrame = NULL;
void* pData = NULL;
- USHORT nEvent = 0;
+ sal_uInt16 nEvent = 0;
if( osl_acquireMutex( hEventGuard_ ) )
{
@@ -2676,6 +2667,7 @@ void SalDisplay::PrintInfo() const
fprintf( stderr, "\tProperties \t0x%lX\n", GetProperties() );
if( eWindowManager_ != otherwm )
fprintf( stderr, "\tWindowmanager \t%d\n", eWindowManager_ );
+ fprintf( stderr, "\tWMName \t%s\n", rtl::OUStringToOString( getWMAdaptor()->getWindowManagerName(), osl_getThreadTextEncoding() ).getStr() );
}
fprintf( stderr, "Screen\n" );
fprintf( stderr, "\tResolution/Size \t%ld*%ld %ld*%ld %.1lf\"\n",
@@ -2957,14 +2949,14 @@ SalVisual::~SalVisual()
#define SALCOLOR RGB
#define SALCOLORREVERSE BGR
-BOOL SalVisual::Convert( int &n0, int &n1, int &n2, int &n3 )
+sal_Bool SalVisual::Convert( int &n0, int &n1, int &n2, int &n3 )
{
int n;
switch( GetMode() )
{
case other:
- return FALSE;
+ return sal_False;
case SALCOLOR:
break;
case SALCOLORREVERSE:
@@ -2989,17 +2981,17 @@ BOOL SalVisual::Convert( int &n0, int &n1, int &n2, int &n3 )
fprintf( stderr, "SalVisual::Convert %d\n", GetMode() );
abort();
}
- return TRUE;
+ return sal_True;
}
-BOOL SalVisual::Convert( int &n0, int &n1, int &n2 )
+sal_Bool SalVisual::Convert( int &n0, int &n1, int &n2 )
{
int n;
switch( GetMode() )
{
case other:
- return FALSE;
+ return sal_False;
case SALCOLOR:
break;
case RBG:
@@ -3033,7 +3025,7 @@ BOOL SalVisual::Convert( int &n0, int &n1, int &n2 )
fprintf( stderr, "SalVisual::Convert %d\n", GetMode() );
abort();
}
- return TRUE;
+ return sal_True;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -3200,7 +3192,7 @@ SalColormap::SalColormap()
}
// TrueColor
-SalColormap::SalColormap( USHORT nDepth )
+SalColormap::SalColormap( sal_uInt16 nDepth )
: m_pDisplay( GetX11SalData()->GetDisplay() ),
m_hColormap( None ),
m_nWhitePixel( (1 << nDepth) - 1 ),
@@ -3350,14 +3342,14 @@ void SalColormap::GetPalette()
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-static USHORT sal_Lookup( const std::vector<SalColor>& rPalette,
+static sal_uInt16 sal_Lookup( const std::vector<SalColor>& rPalette,
int r, int g, int b,
Pixel nUsed )
{
- USHORT nPixel = 0;
+ sal_uInt16 nPixel = 0;
int nBest = ColorDiff( rPalette[0], r, g, b );
- for( USHORT i = 1; i < nUsed; i++ )
+ for( sal_uInt16 i = 1; i < nUsed; i++ )
{
int n = ColorDiff( rPalette[i], r, g, b );
@@ -3375,7 +3367,7 @@ static USHORT sal_Lookup( const std::vector<SalColor>& rPalette,
void SalColormap::GetLookupTable()
{
- m_aLookupTable = std::vector<USHORT>(16*16*16);
+ m_aLookupTable = std::vector<sal_uInt16>(16*16*16);
int i = 0;
for( int r = 0; r < 256; r += 17 )
@@ -3425,7 +3417,7 @@ SalColor SalColormap::GetColor( Pixel nPixel ) const
return MAKE_SALCOLOR( aColor.red>>8, aColor.green>>8, aColor.blue>>8 );
}
-inline BOOL SalColormap::GetXPixel( XColor &rColor,
+inline sal_Bool SalColormap::GetXPixel( XColor &rColor,
int r,
int g,
int b ) const
@@ -3436,15 +3428,15 @@ inline BOOL SalColormap::GetXPixel( XColor &rColor,
return XAllocColor( GetXDisplay(), m_hColormap, &rColor );
}
-BOOL SalColormap::GetXPixels( XColor &rColor,
+sal_Bool SalColormap::GetXPixels( XColor &rColor,
int r,
int g,
int b ) const
{
if( !GetXPixel( rColor, r, g, b ) )
- return FALSE;
+ return sal_False;
if( rColor.pixel & 1 )
- return TRUE;
+ return sal_True;
return GetXPixel( rColor, r^0xFF, g^0xFF, b^0xFF );
}
@@ -3532,9 +3524,9 @@ Pixel SalColormap::GetPixel( SalColor nSalColor ) const
}
// Colormatching ueber Palette
- USHORT r = SALCOLOR_RED ( nSalColor );
- USHORT g = SALCOLOR_GREEN( nSalColor );
- USHORT b = SALCOLOR_BLUE ( nSalColor );
+ sal_uInt16 r = SALCOLOR_RED ( nSalColor );
+ sal_uInt16 g = SALCOLOR_GREEN( nSalColor );
+ sal_uInt16 b = SALCOLOR_BLUE ( nSalColor );
return m_aLookupTable[ (((r+8)/17) << 8)
+ (((g+8)/17) << 4)
+ ((b+8)/17) ];
diff --git a/vcl/unx/source/app/salinst.cxx b/vcl/unx/source/app/salinst.cxx
index 57f8d891a8a6..9b83ceb45413 100644
--- a/vcl/unx/source/app/salinst.cxx
+++ b/vcl/unx/source/app/salinst.cxx
@@ -46,7 +46,7 @@
#include "sm.hxx"
#include "vcl/salwtype.hxx"
-#include "vcl/salatype.hxx"
+#include "vcl/apptypes.hxx"
#include "vcl/helper.hxx"
#include <tools/solarmutex.hxx>
#include "osl/mutex.hxx"
@@ -151,8 +151,8 @@ X11SalInstance::~X11SalInstance()
struct PredicateReturn
{
- USHORT nType;
- BOOL bRet;
+ sal_uInt16 nType;
+ sal_Bool bRet;
};
extern "C" {
@@ -163,7 +163,7 @@ Bool ImplPredicateEvent( Display *, XEvent *pEvent, char *pData )
if ( pPre->bRet )
return False;
- USHORT nType;
+ sal_uInt16 nType;
switch( pEvent->type )
{
@@ -189,29 +189,29 @@ Bool ImplPredicateEvent( Display *, XEvent *pEvent, char *pData )
}
if ( (nType & pPre->nType) || ( ! nType && (pPre->nType & INPUT_OTHER) ) )
- pPre->bRet = TRUE;
+ pPre->bRet = sal_True;
return False;
}
}
-bool X11SalInstance::AnyInput(USHORT nType)
+bool X11SalInstance::AnyInput(sal_uInt16 nType)
{
X11SalData *pSalData = GetX11SalData();
Display *pDisplay = pSalData->GetDisplay()->GetDisplay();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( (nType & INPUT_TIMER) &&
pSalData->GetDisplay()->GetXLib()->CheckTimeout( false ) )
{
- bRet = TRUE;
+ bRet = sal_True;
}
else if (XPending(pDisplay) )
{
PredicateReturn aInput;
XEvent aEvent;
- aInput.bRet = FALSE;
+ aInput.bRet = sal_False;
aInput.nType = nType;
XCheckIfEvent(pDisplay, &aEvent, ImplPredicateEvent,
@@ -229,14 +229,14 @@ osl::SolarMutex* X11SalInstance::GetYieldMutex()
// -----------------------------------------------------------------------
-ULONG X11SalInstance::ReleaseYieldMutex()
+sal_uLong X11SalInstance::ReleaseYieldMutex()
{
SalYieldMutex* pYieldMutex = mpSalYieldMutex;
if ( pYieldMutex->GetThreadId() ==
osl::Thread::getCurrentIdentifier() )
{
- ULONG nCount = pYieldMutex->GetAcquireCount();
- ULONG n = nCount;
+ sal_uLong nCount = pYieldMutex->GetAcquireCount();
+ sal_uLong n = nCount;
while ( n )
{
pYieldMutex->release();
@@ -251,7 +251,7 @@ ULONG X11SalInstance::ReleaseYieldMutex()
// -----------------------------------------------------------------------
-void X11SalInstance::AcquireYieldMutex( ULONG nCount )
+void X11SalInstance::AcquireYieldMutex( sal_uLong nCount )
{
SalYieldMutex* pYieldMutex = mpSalYieldMutex;
while ( nCount )
@@ -261,6 +261,23 @@ void X11SalInstance::AcquireYieldMutex( ULONG nCount )
}
}
+// -----------------------------------------------------------------------
+
+bool X11SalInstance::CheckYieldMutex()
+{
+ bool bRet = true;
+
+ SalYieldMutex* pYieldMutex = mpSalYieldMutex;
+ if ( pYieldMutex->GetThreadId() != osl::Thread::getCurrentIdentifier() )
+ {
+ bRet = false;
+ }
+
+ return bRet;
+}
+
+// -----------------------------------------------------------------------
+
void X11SalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
{ GetX11SalData()->GetLib()->Yield( bWait, bHandleAllCurrentEvents ); }
@@ -272,14 +289,14 @@ void* X11SalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturn
return pDisplay ? (void*)pDisplay : (void*)"";
}
-SalFrame *X11SalInstance::CreateFrame( SalFrame *pParent, ULONG nSalFrameStyle )
+SalFrame *X11SalInstance::CreateFrame( SalFrame *pParent, sal_uLong nSalFrameStyle )
{
SalFrame *pFrame = new X11SalFrame( pParent, nSalFrameStyle );
return pFrame;
}
-SalFrame* X11SalInstance::CreateChildFrame( SystemParentData* pParentData, ULONG nStyle )
+SalFrame* X11SalInstance::CreateChildFrame( SystemParentData* pParentData, sal_uLong nStyle )
{
SalFrame* pFrame = new X11SalFrame( NULL, nStyle, pParentData );
diff --git a/vcl/unx/source/app/salsys.cxx b/vcl/unx/source/app/salsys.cxx
index 8024e35cdb12..0b4ca3e84f0e 100644
--- a/vcl/unx/source/app/salsys.cxx
+++ b/vcl/unx/source/app/salsys.cxx
@@ -153,13 +153,13 @@ int X11SalSystem::ShowNativeDialog( const String& rTitle, const String& rMessage
aWarn.SetText( rTitle );
aWarn.Clear();
- USHORT nButton = 0;
+ sal_uInt16 nButton = 0;
for( std::list< String >::const_iterator it = rButtons.begin(); it != rButtons.end(); ++it )
{
- aWarn.AddButton( *it, nButton+1, nButton == (USHORT)nDefButton ? BUTTONDIALOG_DEFBUTTON : 0 );
+ aWarn.AddButton( *it, nButton+1, nButton == (sal_uInt16)nDefButton ? BUTTONDIALOG_DEFBUTTON : 0 );
nButton++;
}
- aWarn.SetFocusButton( (USHORT)nDefButton+1 );
+ aWarn.SetFocusButton( (sal_uInt16)nDefButton+1 );
nRet = ((int)aWarn.Execute()) - 1;
diff --git a/vcl/unx/source/app/saltimer.cxx b/vcl/unx/source/app/saltimer.cxx
index b02ced3a6411..885aeb7c38e7 100644
--- a/vcl/unx/source/app/saltimer.cxx
+++ b/vcl/unx/source/app/saltimer.cxx
@@ -59,7 +59,7 @@ void SalXLib::StopTimer()
m_nTimeoutMS = 0;
}
-void SalXLib::StartTimer( ULONG nMS )
+void SalXLib::StartTimer( sal_uLong nMS )
{
timeval Timeout (m_aTimeout); // previous timeout.
gettimeofday (&m_aTimeout, 0);
@@ -90,7 +90,7 @@ void X11SalTimer::Stop()
GetX11SalData()->GetLib()->StopTimer();
}
-void X11SalTimer::Start( ULONG nMS )
+void X11SalTimer::Start( sal_uLong nMS )
{
GetX11SalData()->GetLib()->StartTimer( nMS );
}
diff --git a/vcl/unx/source/app/sm.cxx b/vcl/unx/source/app/sm.cxx
index 6e2b2a3babfa..6bfd09fc4f5d 100644
--- a/vcl/unx/source/app/sm.cxx
+++ b/vcl/unx/source/app/sm.cxx
@@ -151,7 +151,7 @@ extern "C" void SAL_CALL ICEConnectionWorker( void* );
class ICEConnectionObserver
{
friend void SAL_CALL ICEConnectionWorker(void*);
- static BOOL bIsWatching;
+ static sal_Bool bIsWatching;
static void ICEWatchProc( IceConn connection, IcePointer client_data,
Bool opening, IcePointer* watch_data );
@@ -177,7 +177,7 @@ public:
SmcConn SessionManagerClient::aSmcConnection = NULL;
ByteString SessionManagerClient::aClientID;
-BOOL ICEConnectionObserver::bIsWatching = FALSE;
+sal_Bool ICEConnectionObserver::bIsWatching = sal_False;
struct pollfd* ICEConnectionObserver::pFilehandles = NULL;
IceConn* ICEConnectionObserver::pConnections = NULL;
int ICEConnectionObserver::nConnections = 0;
@@ -609,7 +609,7 @@ void ICEConnectionObserver::activate()
{
nWakeupFiles[0] = nWakeupFiles[1] = 0;
ICEMutex = osl_createMutex();
- bIsWatching = TRUE;
+ bIsWatching = sal_True;
#ifdef USE_SM_EXTENSION
/*
* Default handlers call exit, we don't care that strongly if something
@@ -627,7 +627,7 @@ void ICEConnectionObserver::deactivate()
if( bIsWatching )
{
lock();
- bIsWatching = FALSE;
+ bIsWatching = sal_False;
#ifdef USE_SM_EXTENSION
IceRemoveConnectionWatch( ICEWatchProc, NULL );
IceSetErrorHandler( origErrorHandler );
diff --git a/vcl/unx/source/app/soicon.cxx b/vcl/unx/source/app/soicon.cxx
index 21e4eabedfb8..54240f8eef45 100644
--- a/vcl/unx/source/app/soicon.cxx
+++ b/vcl/unx/source/app/soicon.cxx
@@ -42,13 +42,13 @@
#include <salbmp.h>
#include <vcl/svids.hrc>
-BOOL SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,USHORT nIcon, USHORT iconSize,
+sal_Bool SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,sal_uInt16 nIcon, sal_uInt16 iconSize,
Pixmap& icon_pixmap, Pixmap& icon_mask)
{
if( ! ImplGetResMgr() )
- return FALSE;
+ return sal_False;
- USHORT nIconSizeOffset;
+ sal_uInt16 nIconSizeOffset;
if( iconSize >= 48 )
nIconSizeOffset = SV_ICON_SIZE48_START;
@@ -57,11 +57,11 @@ BOOL SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,USHORT nIcon, USHORT
else if( iconSize >= 16 )
nIconSizeOffset = SV_ICON_SIZE16_START;
else
- return FALSE;
+ return sal_False;
BitmapEx aIcon( ResId(nIconSizeOffset + nIcon, *ImplGetResMgr()));
- if( TRUE == aIcon.IsEmpty() )
- return FALSE;
+ if( sal_True == aIcon.IsEmpty() )
+ return sal_False;
SalTwoRect aRect;
aRect.mnSrcX = 0; aRect.mnSrcY = 0;
@@ -109,7 +109,7 @@ BOOL SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,USHORT nIcon, USHORT
XFreeGC( pDisplay->GetDisplay(), aMonoGC );
}
- return TRUE;
+ return sal_True;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/app/wmadaptor.cxx b/vcl/unx/source/app/wmadaptor.cxx
index 725ec7d65733..e03f357998ce 100644
--- a/vcl/unx/source/app/wmadaptor.cxx
+++ b/vcl/unx/source/app/wmadaptor.cxx
@@ -32,22 +32,23 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#include <sal/alloca.h>
-#include <wmadaptor.hxx>
-#include <saldisp.hxx>
-#include <saldata.hxx>
-#include <salframe.h>
-#include <vcl/salgdi.hxx>
-#include <osl/thread.h>
-#include <rtl/locale.h>
-#include <osl/process.h>
+#include "sal/alloca.h"
+#include "wmadaptor.hxx"
+#include "saldisp.hxx"
+#include "saldata.hxx"
+#include "salframe.h"
+#include "vcl/salgdi.hxx"
+#include "osl/thread.h"
+#include "rtl/locale.h"
+#include "osl/process.h"
#include <sal/macros.h>
+#include "vcl/configsettings.hxx"
-#include <tools/prex.h>
+#include "tools/prex.h"
#include <X11/X.h>
#include <X11/Xatom.h>
#include <X11/Xresource.h>
-#include <tools/postx.h>
+#include "tools/postx.h"
#if OSL_DEBUG_LEVEL > 1
#include <stdio.h>
@@ -240,7 +241,9 @@ WMAdaptor::WMAdaptor( SalDisplay* pDisplay ) :
m_bEnableAlwaysOnTopWorks( false ),
m_bLegacyPartialFullscreen( false ),
m_nWinGravity( StaticGravity ),
- m_nInitWinGravity( StaticGravity )
+ m_nInitWinGravity( StaticGravity ),
+ m_bWMshouldSwitchWorkspace( true ),
+ m_bWMshouldSwitchWorkspaceInit( false )
{
Atom aRealType = None;
int nFormat = 8;
@@ -967,6 +970,30 @@ bool WMAdaptor::getNetWmName()
return bNetWM;
}
+bool WMAdaptor::getWMshouldSwitchWorkspace() const
+{
+ if( ! m_bWMshouldSwitchWorkspaceInit )
+ {
+ WMAdaptor * pWMA = const_cast<WMAdaptor*>(this);
+
+ pWMA->m_bWMshouldSwitchWorkspace = true;
+ vcl::SettingsConfigItem* pItem = vcl::SettingsConfigItem::get();
+ rtl::OUString aSetting( pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WM" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ShouldSwitchWorkspace" ) ) ) );
+ if( aSetting.getLength() == 0 )
+ {
+ if( m_aWMName.EqualsAscii( "awesome" ) )
+ {
+ pWMA->m_bWMshouldSwitchWorkspace = false;
+ }
+ }
+ else
+ pWMA->m_bWMshouldSwitchWorkspace = aSetting.toBoolean();
+ pWMA->m_bWMshouldSwitchWorkspaceInit = true;
+ }
+ return m_bWMshouldSwitchWorkspace;
+}
+
/*
* WMAdaptor::isValid()
*/
@@ -2340,8 +2367,11 @@ int WMAdaptor::getWindowWorkArea( XLIB_Window aWindow ) const
* WMAdaptor::getCurrentWorkArea
*/
// fixme: multi screen case
-void WMAdaptor::switchToWorkArea( int nWorkArea ) const
+void WMAdaptor::switchToWorkArea( int nWorkArea, bool bConsiderWM ) const
{
+ if( bConsiderWM && ! getWMshouldSwitchWorkspace() )
+ return;
+
if( m_aWMAtoms[ NET_CURRENT_DESKTOP ] )
{
XEvent aEvent;
diff --git a/vcl/unx/source/dtrans/X11_clipboard.hxx b/vcl/unx/source/dtrans/X11_clipboard.hxx
index ed493a33ba2e..73240d8715e6 100644
--- a/vcl/unx/source/dtrans/X11_clipboard.hxx
+++ b/vcl/unx/source/dtrans/X11_clipboard.hxx
@@ -51,12 +51,12 @@ namespace x11 {
>,
public SelectionAdaptor
{
- Reference< ::com::sun::star::datatransfer::XTransferable > m_aContents;
- Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner > m_aOwner;
+ com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > m_aContents;
+ com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner > m_aOwner;
SelectionManager& m_rSelectionManager;
- Reference< ::com::sun::star::lang::XInitialization > m_xSelectionManager;
- ::std::list< Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener > > m_aListeners;
+ com::sun::star::uno::Reference< ::com::sun::star::lang::XInitialization > m_xSelectionManager;
+ ::std::list< com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener > > m_aListeners;
Atom m_aSelection;
protected:
@@ -97,12 +97,12 @@ namespace x11 {
* XClipboard
*/
- virtual Reference< ::com::sun::star::datatransfer::XTransferable > SAL_CALL getContents()
+ virtual com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > SAL_CALL getContents()
throw(RuntimeException);
virtual void SAL_CALL setContents(
- const Reference< ::com::sun::star::datatransfer::XTransferable >& xTrans,
- const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner )
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTrans,
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner )
throw(RuntimeException);
virtual ::rtl::OUString SAL_CALL getName()
@@ -119,27 +119,27 @@ namespace x11 {
* XClipboardNotifier
*/
virtual void SAL_CALL addClipboardListener(
- const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
throw(RuntimeException);
virtual void SAL_CALL removeClipboardListener(
- const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
throw(RuntimeException);
/*
* SelectionAdaptor
*/
- virtual Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable();
+ virtual com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable();
virtual void clearTransferable();
virtual void fireContentsChanged();
- virtual Reference< XInterface > getReference() throw();
+ virtual com::sun::star::uno::Reference< XInterface > getReference() throw();
};
// ------------------------------------------------------------------------
Sequence< ::rtl::OUString > SAL_CALL X11Clipboard_getSupportedServiceNames();
- Reference< XInterface > SAL_CALL X11Clipboard_createInstance(
- const Reference< ::com::sun::star::lang::XMultiServiceFactory > & xMultiServiceFactory);
+ com::sun::star::uno::Reference< XInterface > SAL_CALL X11Clipboard_createInstance(
+ const com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xMultiServiceFactory);
// ------------------------------------------------------------------------
diff --git a/vcl/unx/source/dtrans/X11_dndcontext.hxx b/vcl/unx/source/dtrans/X11_dndcontext.hxx
index 5c47e6a465a2..bca708eb24c7 100644
--- a/vcl/unx/source/dtrans/X11_dndcontext.hxx
+++ b/vcl/unx/source/dtrans/X11_dndcontext.hxx
@@ -52,7 +52,7 @@ namespace x11 {
XLIB_Window m_aDropWindow;
XLIB_Time m_nTimestamp;
SelectionManager& m_rManager;
- Reference< XInterface > m_xManagerRef;
+ com::sun::star::uno::Reference< XInterface > m_xManagerRef;
public:
DropTargetDropContext( XLIB_Window, XLIB_Time, SelectionManager& );
virtual ~DropTargetDropContext();
@@ -71,7 +71,7 @@ namespace x11 {
XLIB_Window m_aDropWindow;
XLIB_Time m_nTimestamp;
SelectionManager& m_rManager;
- Reference< XInterface > m_xManagerRef;
+ com::sun::star::uno::Reference< XInterface > m_xManagerRef;
public:
DropTargetDragContext( XLIB_Window, XLIB_Time, SelectionManager& );
virtual ~DropTargetDragContext();
@@ -89,7 +89,7 @@ namespace x11 {
XLIB_Window m_aDropWindow;
XLIB_Time m_nTimestamp;
SelectionManager& m_rManager;
- Reference< XInterface > m_xManagerRef;
+ com::sun::star::uno::Reference< XInterface > m_xManagerRef;
public:
DragSourceContext( XLIB_Window, XLIB_Time, SelectionManager& );
virtual ~DragSourceContext();
diff --git a/vcl/unx/source/dtrans/X11_selection.cxx b/vcl/unx/source/dtrans/X11_selection.cxx
index 06dbcc62282e..23584694cad2 100644
--- a/vcl/unx/source/dtrans/X11_selection.cxx
+++ b/vcl/unx/source/dtrans/X11_selection.cxx
@@ -82,6 +82,12 @@
EnterWindowMask |\
LeaveWindowMask
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
using namespace com::sun::star::datatransfer;
using namespace com::sun::star::datatransfer::dnd;
using namespace com::sun::star::lang;
@@ -283,7 +289,8 @@ SelectionManager::SelectionManager() :
m_nXdndActionMove( None ),
m_nXdndActionLink( None ),
m_nXdndActionAsk( None ),
- m_nXdndActionPrivate( None )
+ m_nXdndActionPrivate( None ),
+ m_bShutDown( false )
{
m_aDropEnterEvent.data.l[0] = None;
m_aDragRunning.reset();
@@ -625,7 +632,7 @@ OString SelectionManager::convertToCompound( const OUString& rText )
// ------------------------------------------------------------------------
bool SelectionManager::convertData(
- const Reference< XTransferable >& xTransferable,
+ const css::uno::Reference< XTransferable >& xTransferable,
Atom nType,
Atom nSelection,
int& rFormat,
@@ -1515,7 +1522,7 @@ bool SelectionManager::sendData( SelectionAdaptor* pAdaptor,
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "trying bitmap conversion\n" );
#endif
- Reference<XBitmap> xBM( new BmpTransporter( aData ) );
+ css::uno::Reference<XBitmap> xBM( new BmpTransporter( aData ) );
Sequence<Any> aArgs(2), aOutArgs;
Sequence<sal_Int16> aOutIndex;
aArgs.getArray()[0] = makeAny( xBM );
@@ -1662,7 +1669,7 @@ bool SelectionManager::handleSelectionRequest( XSelectionRequestEvent& rRequest
if( pAdaptor &&
XGetSelectionOwner( m_pDisplay, rRequest.selection ) == m_aWindow )
{
- Reference< XTransferable > xTrans( pAdaptor->getTransferable() );
+ css::uno::Reference< XTransferable > xTrans( pAdaptor->getTransferable() );
if( rRequest.target == m_nTARGETSAtom )
{
// someone requests our types
@@ -1831,7 +1838,7 @@ bool SelectionManager::handleSelectionRequest( XSelectionRequestEvent& rRequest
dsde.DropAction = DNDConstants::ACTION_NONE;
dsde.DropSuccess = sal_False;
}
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_xDragSourceListener.clear();
aGuard.clear();
if( xListener.is() )
@@ -2352,7 +2359,7 @@ void SelectionManager::dropComplete( sal_Bool bSuccess, XLIB_Window aDropWindow,
dsde.DragSource = static_cast< XDragSource* >(this);
dsde.DropAction = getUserDragAction();
dsde.DropSuccess = bSuccess;
- Reference< XDragSourceListener > xListener = m_xDragSourceListener;
+ css::uno::Reference< XDragSourceListener > xListener = m_xDragSourceListener;
m_xDragSourceListener.clear();
aGuard.clear();
@@ -2436,7 +2443,7 @@ void SelectionManager::sendDragStatus( Atom nDropAction )
dsde.DropAction = m_nSourceActions;
dsde.UserAction = getUserDragAction();
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
// caution: do not change anything after this
aGuard.clear();
if( xListener.is() )
@@ -2697,7 +2704,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
dsde.DragSource = static_cast< XDragSource* >(this);
dsde.DropAction = m_nTargetAcceptAction;
dsde.DropSuccess = m_bDropSuccess;
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_xDragSourceListener.clear();
aGuard.clear();
xListener->dragDropEnd( dsde );
@@ -2763,7 +2770,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
dsde.DragSource = static_cast< XDragSource* >(this);
dsde.DropAction = DNDConstants::ACTION_NONE;
dsde.DropSuccess = sal_False;
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_xDragSourceListener.clear();
aGuard.clear();
xListener->dragDropEnd( dsde );
@@ -2889,7 +2896,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
m_nDropTimeout = time( NULL );
// HACK :-)
aGuard.clear();
- static_cast< X11Clipboard* >( pAdaptor )->setContents( m_xDragSourceTransferable, Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >() );
+ static_cast< X11Clipboard* >( pAdaptor )->setContents( m_xDragSourceTransferable, css::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >() );
aGuard.reset();
bCancel = false;
}
@@ -2904,7 +2911,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
dsde.DragSource = static_cast< XDragSource* >(this);
dsde.DropAction = DNDConstants::ACTION_NONE;
dsde.DropSuccess = sal_False;
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_xDragSourceListener.clear();
aGuard.clear();
xListener->dragDropEnd( dsde );
@@ -3058,7 +3065,7 @@ void SelectionManager::updateDragWindow( int nX, int nY, XLIB_Window aRoot )
{
osl::ResettableMutexGuard aGuard( m_aMutex );
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_nLastDragX = nX;
m_nLastDragY = nY;
@@ -3218,8 +3225,8 @@ void SelectionManager::startDrag(
sal_Int8 sourceActions,
sal_Int32,
sal_Int32,
- const Reference< XTransferable >& transferable,
- const Reference< XDragSourceListener >& listener
+ const css::uno::Reference< XTransferable >& transferable,
+ const css::uno::Reference< XDragSourceListener >& listener
) throw()
{
#if OSL_DEBUG_LEVEL > 1
@@ -3503,8 +3510,8 @@ void SelectionManager::dragDoDispatch()
{
osl::ClearableMutexGuard aGuard(m_aMutex);
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
- Reference< XTransferable > xTransferable( m_xDragSourceTransferable );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XTransferable > xTransferable( m_xDragSourceTransferable );
m_xDragSourceListener.clear();
m_xDragSourceTransferable.clear();
@@ -3774,10 +3781,10 @@ void SelectionManager::run( void* pThis )
timeval aLast;
gettimeofday( &aLast, 0 );
- Reference< XMultiServiceFactory > xFact( ::comphelper::getProcessServiceFactory() );
+ css::uno::Reference< XMultiServiceFactory > xFact( ::comphelper::getProcessServiceFactory() );
if( xFact.is() )
{
- Reference< XDesktop > xDesktop( xFact->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), UNO_QUERY );
+ css::uno::Reference< XDesktop > xDesktop( xFact->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), UNO_QUERY );
if( xDesktop.is() )
xDesktop->addTerminateListener(This);
}
@@ -3792,7 +3799,7 @@ void SelectionManager::run( void* pThis )
if( (aNow.tv_sec - aLast.tv_sec) > 0 )
{
osl::ClearableMutexGuard aGuard(This->m_aMutex);
- std::list< std::pair< SelectionAdaptor*, Reference< XInterface > > > aChangeList;
+ std::list< std::pair< SelectionAdaptor*, css::uno::Reference< XInterface > > > aChangeList;
for( boost::unordered_map< Atom, Selection* >::iterator it = This->m_aSelections.begin(); it != This->m_aSelections.end(); ++it )
{
@@ -3802,7 +3809,7 @@ void SelectionManager::run( void* pThis )
if( aOwner != it->second->m_aLastOwner )
{
it->second->m_aLastOwner = aOwner;
- std::pair< SelectionAdaptor*, Reference< XInterface > >
+ std::pair< SelectionAdaptor*, css::uno::Reference< XInterface > >
aKeep( it->second->m_pAdaptor, it->second->m_pAdaptor->getReference() );
aChangeList.push_back( aKeep );
}
@@ -3825,6 +3832,11 @@ void SelectionManager::run( void* pThis )
void SelectionManager::shutdown() throw()
{
osl::ResettableMutexGuard aGuard(m_aMutex);
+ if( m_bShutDown )
+ {
+ return;
+ }
+ m_bShutDown = true;
// stop dispatching
if( m_aThread )
{
@@ -3914,7 +3926,7 @@ void SAL_CALL SelectionManager::queryTermination( const ::com::sun::star::lang::
void SAL_CALL SelectionManager::notifyTermination( const ::com::sun::star::lang::EventObject& rEvent )
throw( ::com::sun::star::uno::RuntimeException )
{
- Reference< XDesktop > xDesktop( rEvent.Source, UNO_QUERY );
+ css::uno::Reference< XDesktop > xDesktop( rEvent.Source, UNO_QUERY );
if( xDesktop.is() == sal_True )
xDesktop->removeTerminateListener( this );
#if OSL_DEBUG_LEVEL > 1
@@ -4047,7 +4059,7 @@ void SelectionManager::deregisterDropTarget( XLIB_Window aWindow )
dsde.DragSource = static_cast< XDragSource* >(this);
dsde.DropAction = DNDConstants::ACTION_NONE;
dsde.DropSuccess = sal_False;
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_xDragSourceListener.clear();
aGuard.clear();
xListener->dragDropEnd( dsde );
@@ -4058,7 +4070,7 @@ void SelectionManager::deregisterDropTarget( XLIB_Window aWindow )
* SelectionAdaptor
*/
-Reference< XTransferable > SelectionManager::getTransferable() throw()
+css::uno::Reference< XTransferable > SelectionManager::getTransferable() throw()
{
return m_xDragSourceTransferable;
}
@@ -4078,9 +4090,9 @@ void SelectionManager::fireContentsChanged() throw()
// ------------------------------------------------------------------------
-Reference< XInterface > SelectionManager::getReference() throw()
+css::uno::Reference< XInterface > SelectionManager::getReference() throw()
{
- return Reference< XInterface >( static_cast<OWeakObject*>(this) );
+ return css::uno::Reference< XInterface >( static_cast<OWeakObject*>(this) );
}
// ------------------------------------------------------------------------
@@ -4111,7 +4123,7 @@ void SelectionManagerHolder::initialize( const Sequence< Any >& arguments ) thro
if( arguments.getLength() > 0 )
{
- Reference< XDisplayConnection > xConn;
+ css::uno::Reference< XDisplayConnection > xConn;
arguments.getConstArray()[0] >>= xConn;
if( xConn.is() )
{
@@ -4146,8 +4158,8 @@ sal_Int32 SelectionManagerHolder::getDefaultCursor( sal_Int8 dragAction ) throw(
void SelectionManagerHolder::startDrag(
const ::com::sun::star::datatransfer::dnd::DragGestureEvent& trigger,
sal_Int8 sourceActions, sal_Int32 cursor, sal_Int32 image,
- const Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
- const Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
+ const css::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
+ const css::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
) throw()
{
if( m_xRealDragSource.is() )
diff --git a/vcl/unx/source/dtrans/X11_selection.hxx b/vcl/unx/source/dtrans/X11_selection.hxx
index 28ff488c5627..42158e99802b 100644
--- a/vcl/unx/source/dtrans/X11_selection.hxx
+++ b/vcl/unx/source/dtrans/X11_selection.hxx
@@ -65,10 +65,10 @@ namespace x11 {
class SelectionAdaptor
{
public:
- virtual Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable() = 0;
+ virtual com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable() = 0;
virtual void clearTransferable() = 0;
virtual void fireContentsChanged() = 0;
- virtual Reference< XInterface > getReference() = 0;
+ virtual com::sun::star::uno::Reference< XInterface > getReference() = 0;
// returns a reference that will keep the SelectionAdaptor alive until the
// refernce is released
};
@@ -86,9 +86,9 @@ namespace x11 {
sal_Int8 m_nDefaultActions;
XLIB_Window m_aTargetWindow;
class SelectionManager* m_pSelectionManager;
- Reference< ::com::sun::star::datatransfer::dnd::XDragSource >
+ com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >
m_xSelectionManager;
- ::std::list< Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener > >
+ ::std::list< com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener > >
m_aListeners;
DropTarget();
@@ -104,8 +104,8 @@ namespace x11 {
virtual void SAL_CALL initialize( const Sequence< Any >& args ) throw ( ::com::sun::star::uno::Exception );
// XDropTarget
- virtual void SAL_CALL addDropTargetListener( const Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw();
- virtual void SAL_CALL removeDropTargetListener( const Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw();
+ virtual void SAL_CALL addDropTargetListener( const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw();
+ virtual void SAL_CALL removeDropTargetListener( const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw();
virtual sal_Bool SAL_CALL isActive() throw();
virtual void SAL_CALL setActive( sal_Bool active ) throw();
virtual sal_Int8 SAL_CALL getDefaultActions() throw();
@@ -126,7 +126,7 @@ namespace x11 {
>
{
::osl::Mutex m_aMutex;
- Reference< ::com::sun::star::datatransfer::dnd::XDragSource >
+ com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >
m_xRealDragSource;
public:
SelectionManagerHolder();
@@ -147,8 +147,8 @@ namespace x11 {
virtual void SAL_CALL startDrag(
const ::com::sun::star::datatransfer::dnd::DragGestureEvent& trigger,
sal_Int8 sourceActions, sal_Int32 cursor, sal_Int32 image,
- const Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
- const Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
) throw();
};
@@ -259,9 +259,9 @@ namespace x11 {
oslThread m_aDragExecuteThread;
::osl::Condition m_aDragRunning;
XLIB_Window m_aWindow;
- Reference< ::com::sun::star::awt::XDisplayConnection >
+ com::sun::star::uno::Reference< ::com::sun::star::awt::XDisplayConnection >
m_xDisplayConnection;
- Reference< com::sun::star::script::XInvocation >
+ com::sun::star::uno::Reference< com::sun::star::script::XInvocation >
m_xBitmapConverter;
sal_Int32 m_nSelectionTimeout;
XLIB_Time m_nSelectionTimestamp;
@@ -284,7 +284,7 @@ namespace x11 {
XLIB_Time m_nDropTime;
sal_Int8 m_nLastDropAction;
// XTransferable for Xdnd with foreign drag source
- Reference< ::com::sun::star::datatransfer::XTransferable >
+ com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >
m_xDropTransferable;
int m_nLastX, m_nLastY;
XLIB_Time m_nDropTimestamp;
@@ -302,9 +302,9 @@ namespace x11 {
XLIB_Window m_aDropProxy;
XLIB_Window m_aDragSourceWindow;
// XTransferable for Xdnd when we are drag source
- Reference< ::com::sun::star::datatransfer::XTransferable >
+ com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >
m_xDragSourceTransferable;
- Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >
+ com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >
m_xDragSourceListener;
// root coordinates
int m_nLastDragX, m_nLastDragY;
@@ -382,6 +382,7 @@ namespace x11 {
// since this leads to deadlocks in different Xlib implentations
// (XFree as well as Xsun) use an own mutex instead
::osl::Mutex m_aMutex;
+ bool m_bShutDown;
SelectionManager();
~SelectionManager();
@@ -408,7 +409,7 @@ namespace x11 {
bool getPasteData( Atom selection, Atom type, Sequence< sal_Int8 >& rData );
// returns true if conversion was successful
- bool convertData( const Reference< ::com::sun::star::datatransfer::XTransferable >& xTransferable,
+ bool convertData( const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTransferable,
Atom nType,
Atom nSelection,
int & rFormat,
@@ -493,15 +494,15 @@ namespace x11 {
virtual void SAL_CALL startDrag(
const ::com::sun::star::datatransfer::dnd::DragGestureEvent& trigger,
sal_Int8 sourceActions, sal_Int32 cursor, sal_Int32 image,
- const Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
- const Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
) throw();
// SelectionAdaptor for XdndSelection Drag (we are drag source)
- virtual Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable() throw();
+ virtual com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable() throw();
virtual void clearTransferable() throw();
virtual void fireContentsChanged() throw();
- virtual Reference< XInterface > getReference() throw();
+ virtual com::sun::star::uno::Reference< XInterface > getReference() throw();
// XEventListener
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( ::com::sun::star::uno::RuntimeException );
diff --git a/vcl/unx/source/dtrans/X11_service.cxx b/vcl/unx/source/dtrans/X11_service.cxx
index 215fb1a20011..7397f25e2c76 100644
--- a/vcl/unx/source/dtrans/X11_service.cxx
+++ b/vcl/unx/source/dtrans/X11_service.cxx
@@ -40,6 +40,12 @@
#include <cppuhelper/factory.hxx>
#include <cppuhelper/compbase1.hxx>
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
using namespace cppu;
using namespace com::sun::star::lang;
using namespace com::sun::star::datatransfer::clipboard;
@@ -71,7 +77,7 @@ Sequence< OUString > SAL_CALL x11::Xdnd_dropTarget_getSupportedServiceNames()
// ------------------------------------------------------------------------
-Reference< XInterface > X11SalInstance::CreateClipboard( const Sequence< Any >& arguments )
+css::uno::Reference< XInterface > X11SalInstance::CreateClipboard( const Sequence< Any >& arguments )
{
static boost::unordered_map< OUString, ::boost::unordered_map< Atom, Reference< XClipboard > >, ::rtl::OUStringHash > m_aInstances;
@@ -82,7 +88,7 @@ Reference< XInterface > X11SalInstance::CreateClipboard( const Sequence< Any >&
// by SelectionManager.initialize() if no display connection is given.
if( arguments.getLength() > 0 )
{
- Reference< XDisplayConnection > xConn;
+ css::uno::Reference< XDisplayConnection > xConn;
arguments.getConstArray()[0] >>= xConn;
if( xConn.is() )
@@ -109,8 +115,8 @@ Reference< XInterface > X11SalInstance::CreateClipboard( const Sequence< Any >&
nSelection = rManager.getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("CLIPBOARD")) );
}
- ::boost::unordered_map< Atom, Reference< XClipboard > >& rMap( m_aInstances[ aDisplayName ] );
- ::boost::unordered_map< Atom, Reference< XClipboard > >::iterator it = rMap.find( nSelection );
+ ::boost::unordered_map< Atom, css::uno::Reference< XClipboard > >& rMap( m_aInstances[ aDisplayName ] );
+ ::boost::unordered_map< Atom, css::uno::Reference< XClipboard > >::iterator it = rMap.find( nSelection );
if( it != rMap.end() )
return it->second;
@@ -122,16 +128,16 @@ Reference< XInterface > X11SalInstance::CreateClipboard( const Sequence< Any >&
// ------------------------------------------------------------------------
-Reference< XInterface > X11SalInstance::CreateDragSource()
+css::uno::Reference< XInterface > X11SalInstance::CreateDragSource()
{
- return Reference < XInterface >( ( OWeakObject * ) new SelectionManagerHolder() );
+ return css::uno::Reference < XInterface >( ( OWeakObject * ) new SelectionManagerHolder() );
}
// ------------------------------------------------------------------------
-Reference< XInterface > X11SalInstance::CreateDropTarget()
+css::uno::Reference< XInterface > X11SalInstance::CreateDropTarget()
{
- return Reference < XInterface >( ( OWeakObject * ) new DropTarget() );
+ return css::uno::Reference < XInterface >( ( OWeakObject * ) new DropTarget() );
}
diff --git a/vcl/unx/source/dtrans/X11_transferable.hxx b/vcl/unx/source/dtrans/X11_transferable.hxx
index cff20e52fe48..683faa0a7f87 100644
--- a/vcl/unx/source/dtrans/X11_transferable.hxx
+++ b/vcl/unx/source/dtrans/X11_transferable.hxx
@@ -43,10 +43,10 @@ namespace x11 {
::osl::Mutex m_aMutex;
SelectionManager& m_rManager;
- Reference< XInterface > m_xCreator;
+ com::sun::star::uno::Reference< XInterface > m_xCreator;
Atom m_aSelection;
public:
- X11Transferable( SelectionManager& rManager, const Reference< XInterface >& xCreator, Atom selection = None );
+ X11Transferable( SelectionManager& rManager, const com::sun::star::uno::Reference< XInterface >& xCreator, Atom selection = None );
virtual ~X11Transferable();
/*
diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx
index 602a82430cdb..bcf0e14e9160 100644
--- a/vcl/unx/source/fontmanager/fontconfig.cxx
+++ b/vcl/unx/source/fontmanager/fontconfig.cxx
@@ -133,16 +133,20 @@ class FontCfgWrapper
FcResult (*m_pFcPatternGetBool)(const FcPattern*,const char*,int,FcBool*);
void (*m_pFcDefaultSubstitute)(FcPattern *);
FcPattern* (*m_pFcFontSetMatch)(FcConfig*,FcFontSet**, int, FcPattern*,FcResult*);
+ FcPattern* (*m_pFcFontMatch)(FcConfig*,FcPattern*,FcResult*);
FcBool (*m_pFcConfigAppFontAddFile)(FcConfig*, const FcChar8*);
FcBool (*m_pFcConfigAppFontAddDir)(FcConfig*, const FcChar8*);
FcBool (*m_pFcConfigParseAndLoad)(FcConfig*,const FcChar8*,FcBool);
-
FcBool (*m_pFcConfigSubstitute)(FcConfig*,FcPattern*,FcMatchKind);
+
+ FcPattern* (*m_pFcPatternDuplicate)(const FcPattern*);
FcBool (*m_pFcPatternAddInteger)(FcPattern*,const char*,int);
FcBool (*m_pFcPatternAddDouble)(FcPattern*,const char*,double);
FcBool (*m_pFcPatternAddBool)(FcPattern*,const char*,FcBool);
FcBool (*m_pFcPatternAddCharSet)(FcPattern*,const char*,const FcCharSet*);
FcBool (*m_pFcPatternAddString)(FcPattern*,const char*,const FcChar8*);
+ FcBool (*m_pFcPatternDel)(FcPattern*,const char*);
+
FT_UInt (*m_pFcFreeTypeCharIndex)(FT_Face,FcChar32);
FcBool (*m_pFcPatternAddFTFace)(FcPattern*,const char*,const FT_Face);
@@ -249,8 +253,13 @@ public:
{ m_pFcDefaultSubstitute( pPattern ); }
FcPattern* FcFontSetMatch( FcConfig* pConfig, FcFontSet **ppFontSet, int nset, FcPattern* pPattern, FcResult* pResult )
{ return m_pFcFontSetMatch ? m_pFcFontSetMatch( pConfig, ppFontSet, nset, pPattern, pResult ) : 0; }
+ FcPattern* FcFontMatch( FcConfig* pConfig, FcPattern* pPattern, FcResult* pResult )
+ { return m_pFcFontMatch( pConfig, pPattern, pResult ); }
FcBool FcConfigSubstitute( FcConfig* pConfig, FcPattern* pPattern, FcMatchKind eKind )
{ return m_pFcConfigSubstitute( pConfig, pPattern, eKind ); }
+
+ FcPattern* FcPatternDuplicate( const FcPattern* pPattern ) const
+ { return m_pFcPatternDuplicate( pPattern ); }
FcBool FcPatternAddInteger( FcPattern* pPattern, const char* pObject, int nValue )
{ return m_pFcPatternAddInteger( pPattern, pObject, nValue ); }
FcBool FcPatternAddDouble( FcPattern* pPattern, const char* pObject, double nValue )
@@ -261,6 +270,9 @@ public:
{ return m_pFcPatternAddBool( pPattern, pObject, nValue ); }
FcBool FcPatternAddCharSet(FcPattern* pPattern,const char* pObject,const FcCharSet*pCharSet)
{ return m_pFcPatternAddCharSet(pPattern,pObject,pCharSet); }
+ FcBool FcPatternDel(FcPattern* pPattern, const char* object)
+ { return m_pFcPatternDel( pPattern, object); }
+
FT_UInt FcFreeTypeCharIndex( FT_Face face, FcChar32 ucs4 )
{ return m_pFcFreeTypeCharIndex ? m_pFcFreeTypeCharIndex( face, ucs4 ) : 0; }
FcBool FcPatternAddFTFace( FcPattern* pPattern, const char* pObject, const FT_Face nValue )
@@ -366,8 +378,13 @@ FontCfgWrapper::FontCfgWrapper()
loadSymbol( "FcDefaultSubstitute" );
m_pFcFontSetMatch = (FcPattern*(*)(FcConfig*,FcFontSet**,int,FcPattern*,FcResult*))
loadSymbol( "FcFontSetMatch" );
+ m_pFcFontMatch = (FcPattern*(*)(FcConfig*,FcPattern*,FcResult*))
+ loadSymbol( "FcFontMatch" );
m_pFcConfigSubstitute = (FcBool(*)(FcConfig*,FcPattern*,FcMatchKind))
loadSymbol( "FcConfigSubstitute" );
+
+ m_pFcPatternDuplicate = (FcPattern*(*)(const FcPattern*))
+ loadSymbol( "FcPatternDuplicate" );
m_pFcPatternAddInteger = (FcBool(*)(FcPattern*,const char*,int))
loadSymbol( "FcPatternAddInteger" );
m_pFcPatternAddDouble = (FcBool(*)(FcPattern*,const char*,double))
@@ -378,6 +395,9 @@ FontCfgWrapper::FontCfgWrapper()
loadSymbol( "FcPatternAddCharSet" );
m_pFcPatternAddString = (FcBool(*)(FcPattern*,const char*,const FcChar8*))
loadSymbol( "FcPatternAddString" );
+ m_pFcPatternDel = (FcBool(*)(FcPattern*,const char*))
+ loadSymbol( "FcPatternDel" );
+
m_pFcFreeTypeCharIndex = (FT_UInt(*)(FT_Face,FcChar32))
loadSymbol( "FcFreeTypeCharIndex" );
m_pFcPatternAddFTFace = (FcBool(*)(FcPattern*,const char*,const FT_Face))
@@ -422,13 +442,16 @@ FontCfgWrapper::FontCfgWrapper()
m_pFcConfigAppFontAddFile &&
m_pFcConfigAppFontAddDir &&
m_pFcConfigParseAndLoad &&
+ m_pFcFontMatch &&
m_pFcDefaultSubstitute &&
m_pFcConfigSubstitute &&
+ m_pFcPatternDuplicate &&
m_pFcPatternAddInteger &&
m_pFcPatternAddDouble &&
m_pFcPatternAddCharSet &&
m_pFcPatternAddBool &&
- m_pFcPatternAddString
+ m_pFcPatternAddString &&
+ m_pFcPatternDel
) )
{
osl_unloadModule( (oslModule)m_pLib );
@@ -459,18 +482,44 @@ void FontCfgWrapper::addFontSet( FcSetName eSetName )
if( !pOrig )
return;
+ // filter the font sets to remove obsolete or duplicate faces
for( int i = 0; i < pOrig->nfont; ++i )
{
- FcBool outline = false;
- FcPattern *pOutlinePattern = pOrig->fonts[i];
- FcResult eOutRes =
- FcPatternGetBool( pOutlinePattern, FC_OUTLINE, 0, &outline );
- if( (eOutRes != FcResultMatch) || (outline != FcTrue) )
+ FcPattern* pOrigPattern = pOrig->fonts[i];
+ // #i115131# ignore non-outline fonts
+ FcBool bOutline = FcFalse;
+ FcResult eOutRes = FcPatternGetBool( pOrigPattern, FC_OUTLINE, 0, &bOutline );
+ if( (eOutRes != FcResultMatch) || (bOutline == FcFalse) )
continue;
- FcPatternReference(pOutlinePattern);
- FcFontSetAdd(m_pOutlineSet, pOutlinePattern);
+ // create a pattern to find eventually better alternatives
+ FcPattern* pBetterPattern = pOrigPattern;
+ if( m_nFcVersion > 20400 ) // #i115204# avoid trouble with old FC versions
+ {
+ FcPattern* pTestPattern = FcPatternDuplicate( pOrigPattern );
+ FcPatternAddBool( pTestPattern, FC_OUTLINE, FcTrue );
+ // TODO: ignore all attributes that are not interesting for finding dupes
+ // e.g. by using pattern->ImplFontAttr->pattern conversion
+ FcPatternDel( pTestPattern, FC_FONTVERSION );
+ FcPatternDel( pTestPattern, FC_CHARSET );
+ FcPatternDel( pTestPattern, FC_FILE );
+ // find the font face for the dupe-search pattern
+ FcResult eFcResult = FcResultMatch;
+ pBetterPattern = FcFontMatch( FcConfigGetCurrent(), pTestPattern, &eFcResult );
+ FcPatternDestroy( pTestPattern );
+ if( eFcResult != FcResultMatch )
+ continue;
+ // #i115131# double check results and eventually ignore them
+ eOutRes = FcPatternGetBool( pBetterPattern, FC_OUTLINE, 0, &bOutline );
+ if( (eOutRes != FcResultMatch) || (bOutline == FcFalse) )
+ continue;
+ }
+ // insert best found pattern for the dupe-search pattern
+ // TODO: skip inserting patterns that are already known in the target fontset
+ FcPatternReference( pBetterPattern );
+ FcFontSetAdd( m_pOutlineSet, pBetterPattern );
}
- // TODO: FcFontSetDestroy( pOrig );
+
+ // TODO?: FcFontSetDestroy( pOrig );
#else
(void)eSetName; // prevent compiler warning about unused parameter
#endif
@@ -750,7 +799,7 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_map<rtl::OString, i
);
#endif
- OSL_ASSERT(eOutRes != FcResultMatch || outline);
+// OSL_ASSERT(eOutRes != FcResultMatch || outline);
// only outline fonts are usable to psprint anyway
if( eOutRes == FcResultMatch && ! outline )
@@ -780,7 +829,10 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_map<rtl::OString, i
#endif
}
if( aFonts.empty() )
+ {
+ // TODO: remove fonts unusable to psprint from fontset
continue;
+ }
int nFamilyName = m_pAtoms->getAtom( ATOM_FAMILYNAME, OStringToOUString( OString( (sal_Char*)family ), RTL_TEXTENCODING_UTF8 ), sal_True );
PrintFont* pUpdate = aFonts.front();
@@ -1127,6 +1179,7 @@ ImplFontOptions* PrintFontManager::getFontOptions(
const FastPrintFontInfo& rInfo, int nSize, void (*subcallback)(void*)) const
{
#ifndef ENABLE_FONTCONFIG
+ (void)rInfo;(void)nSize;(void)subcallback;(void)rOptions;
return NULL;
#else // ENABLE_FONTCONFIG
FontCfgWrapper& rWrapper = FontCfgWrapper::get();
diff --git a/vcl/unx/source/fontmanager/fontmanager.cxx b/vcl/unx/source/fontmanager/fontmanager.cxx
index 9292fe12531d..cd5fbda449e0 100644
--- a/vcl/unx/source/fontmanager/fontmanager.cxx
+++ b/vcl/unx/source/fontmanager/fontmanager.cxx
@@ -90,6 +90,12 @@
#define PRINTER_METRICDIR "fontmetric"
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
using namespace vcl;
using namespace utl;
using namespace psp;
@@ -3968,10 +3974,10 @@ bool PrintFontManager::readOverrideMetrics()
if( ! m_aOverrideFonts.empty() )
return false;
- Reference< XMultiServiceFactory > xFact( comphelper::getProcessServiceFactory() );
+ css::uno::Reference< XMultiServiceFactory > xFact( comphelper::getProcessServiceFactory() );
if( !xFact.is() )
return false;
- Reference< XMaterialHolder > xMat(
+ css::uno::Reference< XMaterialHolder > xMat(
xFact->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.psprint.CompatMetricOverride" ) ) ),
UNO_QUERY );
if( !xMat.is() )
diff --git a/vcl/unx/source/gdi/cdeint.cxx b/vcl/unx/source/gdi/cdeint.cxx
index 5c7b092d5fd5..fd81e05c0644 100644
--- a/vcl/unx/source/gdi/cdeint.cxx
+++ b/vcl/unx/source/gdi/cdeint.cxx
@@ -232,9 +232,9 @@ void CDEIntegrator::GetSystemLook( AllSettings& rSettings )
{
// calculate Checked color
Color aColor2 = aStyleSettings.GetLightColor();
- BYTE nRed = (BYTE)(((USHORT)aColors[1].GetRed() + (USHORT)aColor2.GetRed())/2);
- BYTE nGreen = (BYTE)(((USHORT)aColors[1].GetGreen() + (USHORT)aColor2.GetGreen())/2);
- BYTE nBlue = (BYTE)(((USHORT)aColors[1].GetBlue() + (USHORT)aColor2.GetBlue())/2);
+ sal_uInt8 nRed = (sal_uInt8)(((sal_uInt16)aColors[1].GetRed() + (sal_uInt16)aColor2.GetRed())/2);
+ sal_uInt8 nGreen = (sal_uInt8)(((sal_uInt16)aColors[1].GetGreen() + (sal_uInt16)aColor2.GetGreen())/2);
+ sal_uInt8 nBlue = (sal_uInt8)(((sal_uInt16)aColors[1].GetBlue() + (sal_uInt16)aColor2.GetBlue())/2);
aStyleSettings.SetCheckedColor( Color( nRed, nGreen, nBlue ) );
}
}
diff --git a/vcl/unx/source/gdi/gcach_xpeer.cxx b/vcl/unx/source/gdi/gcach_xpeer.cxx
index a0ac583cb39d..8cbf67ffe6dc 100644
--- a/vcl/unx/source/gdi/gcach_xpeer.cxx
+++ b/vcl/unx/source/gdi/gcach_xpeer.cxx
@@ -466,13 +466,13 @@ Pixmap X11GlyphPeer::GetPixmap( ServerFont& rServerFont, int nGlyphIndex, int nR
if( rServerFont.GetGlyphBitmap1( nGlyphIndex, maRawBitmap ) )
{
// #94666# circumvent bug in some X11 systems, e.g. XF410.LynxEM.v163
- ULONG nPixmapWidth = 8 * maRawBitmap.mnScanlineSize - 1;
+ sal_uLong nPixmapWidth = 8 * maRawBitmap.mnScanlineSize - 1;
nPixmapWidth = Max( nPixmapWidth, maRawBitmap.mnWidth );
rGlyphData.SetSize( Size( nPixmapWidth, maRawBitmap.mnHeight ) );
rGlyphData.SetOffset( +maRawBitmap.mnXOffset, +maRawBitmap.mnYOffset );
- const ULONG nBytes = maRawBitmap.mnHeight * maRawBitmap.mnScanlineSize;
+ const sal_uLong nBytes = maRawBitmap.mnHeight * maRawBitmap.mnScanlineSize;
if( nBytes > 0 )
{
// conversion table LSB<->MSB (for XCreatePixmapFromData)
@@ -622,7 +622,7 @@ Glyph X11GlyphPeer::GetGlyphId( ServerFont& rServerFont, int nGlyphIndex )
GlyphSet aGlyphSet = GetGlyphSet( rServerFont, -1 );
aGlyphId = nGlyphIndex & 0x00FFFFFF;
- const ULONG nBytes = maRawBitmap.mnScanlineSize * maRawBitmap.mnHeight;
+ const sal_uLong nBytes = maRawBitmap.mnScanlineSize * maRawBitmap.mnHeight;
XRenderPeer::GetInstance().AddGlyph( aGlyphSet, aGlyphId,
aGlyphInfo, (char*)maRawBitmap.mpBits, nBytes );
mnBytesUsed += nBytes;
diff --git a/vcl/unx/source/gdi/makefile.mk b/vcl/unx/source/gdi/makefile.mk
index 8afbcec8224c..ef5a8726fedc 100644
--- a/vcl/unx/source/gdi/makefile.mk
+++ b/vcl/unx/source/gdi/makefile.mk
@@ -47,42 +47,25 @@ dummy:
.ELSE # "$(GUIBASE)"!="unx"
SLOFILES= \
- $(SLO)$/dtint.obj \
- $(SLO)$/gcach_xpeer.obj \
- $(SLO)$/pspgraphics.obj \
+ $(SLO)$/salgdi2.obj \
$(SLO)$/salbmp.obj \
- $(SLO)$/salcvt.obj \
$(SLO)$/salgdi.obj \
- $(SLO)$/salgdi2.obj \
- $(SLO)$/salgdi3.obj \
$(SLO)$/salvd.obj \
- $(SLO)$/xfont.obj \
- $(SLO)$/xlfd_attr.obj \
- $(SLO)$/xlfd_extd.obj \
- $(SLO)$/xlfd_smpl.obj \
- $(SLO)$/xrender_peer.obj
-
-EXCEPTIONSFILES=\
$(SLO)$/dtint.obj \
- $(SLO)$/gcach_xpeer.obj \
- $(SLO)$/pspgraphics.obj \
- $(SLO)$/salbmp.obj \
$(SLO)$/salcvt.obj \
+ $(SLO)$/salgdi3.obj \
+ $(SLO)$/gcach_xpeer.obj \
+ $(SLO)$/xrender_peer.obj \
+ $(SLO)$/pspgraphics.obj
+
+EXCEPTIONSFILES=\
$(SLO)$/salgdi.obj \
- $(SLO)$/salgdi2.obj \
+ $(SLO)$/salbmp.obj \
$(SLO)$/salgdi3.obj \
- $(SLO)$/salvd.obj \
- $(SLO)$/xfont.obj \
- $(SLO)$/xlfd_attr.obj \
- $(SLO)$/xlfd_extd.obj
-
-.IF "$(USE_XPRINT)" == "TRUE"
-CFLAGS+=-D_USE_PRINT_EXTENSION_=1
-SLOFILES+=$(SLO)$/xprintext.obj
-.ELSE
+ $(SLO)$/salcvt.obj
+
SLOFILES+=$(SLO)$/salprnpsp.obj
EXCEPTIONSFILES+=$(SLO)$/salprnpsp.obj
-.ENDIF
.IF "$(OS)"=="SOLARIS"
SLOFILES+=$(SLO)$/cdeint.obj
diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx
index 5fe67ec32e26..a4289496fa14 100644
--- a/vcl/unx/source/gdi/pspgraphics.cxx
+++ b/vcl/unx/source/gdi/pspgraphics.cxx
@@ -42,6 +42,7 @@
#include "vcl/svapp.hxx"
#include "vcl/salprn.hxx"
#include "vcl/sysdata.hxx"
+#include "vcl/region.h"
#include <stdlib.h>
#include <unistd.h>
@@ -281,7 +282,7 @@ void PspGraphics::GetResolution( sal_Int32 &rDPIX, sal_Int32 &rDPIY )
}
}
-USHORT PspGraphics::GetBitCount() const
+sal_uInt16 PspGraphics::GetBitCount() const
{
return m_pPrinterGfx->GetBitCount();
}
@@ -293,28 +294,27 @@ long PspGraphics::GetGraphicsWidth() const
void PspGraphics::ResetClipRegion()
{
- m_pPrinterGfx->ResetClipRegion ();
+ m_pPrinterGfx->ResetClipRegion();
}
-void PspGraphics::BeginSetClipRegion( ULONG n )
+bool PspGraphics::setClipRegion( const Region& i_rClip )
{
- m_pPrinterGfx->BeginSetClipRegion(n);
-}
-
-BOOL PspGraphics::unionClipRegion( long nX, long nY, long nDX, long nDY )
-{
- return (BOOL)m_pPrinterGfx->UnionClipRegion (nX, nY, nDX, nDY);
-}
-
-bool PspGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- // TODO: implement and advertise OutDevSupport_B2DClip support
- return false;
-}
+ // TODO: support polygonal clipregions here
+ m_pPrinterGfx->BeginSetClipRegion( i_rClip.GetRectCount() );
-void PspGraphics::EndSetClipRegion()
-{
- m_pPrinterGfx->EndSetClipRegion ();
+ ImplRegionInfo aInfo;
+ long nX, nY, nW, nH;
+ bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
+ while( bRegionRect )
+ {
+ if ( nW && nH )
+ {
+ m_pPrinterGfx->UnionClipRegion( nX, nY, nW, nH );
+ }
+ bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
+ }
+ m_pPrinterGfx->EndSetClipRegion();
+ return true;
}
void PspGraphics::SetLineColor()
@@ -382,12 +382,12 @@ void PspGraphics::drawRect( long nX, long nY, long nDX, long nDY )
m_pPrinterGfx->DrawRect (Rectangle(Point(nX, nY), Size(nDX, nDY)));
}
-void PspGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry )
+void PspGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry )
{
m_pPrinterGfx->DrawPolyLine (nPoints, (Point*)pPtAry);
}
-void PspGraphics::drawPolygon( ULONG nPoints, const SalPoint* pPtAry )
+void PspGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry )
{
// Point must be equal to SalPoint! see vcl/inc/salgtype.hxx
m_pPrinterGfx->DrawPolygon (nPoints, (Point*)pPtAry);
@@ -412,13 +412,13 @@ bool PspGraphics::drawPolyLine( const basegfx::B2DPolygon&, double /*fTransparen
return false;
}
-sal_Bool PspGraphics::drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
+sal_Bool PspGraphics::drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry )
{
m_pPrinterGfx->DrawPolyLineBezier (nPoints, (Point*)pPtAry, pFlgAry);
return sal_True;
}
-sal_Bool PspGraphics::drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
+sal_Bool PspGraphics::drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry )
{
m_pPrinterGfx->DrawPolygonBezier (nPoints, (Point*)pPtAry, pFlgAry);
return sal_True;
@@ -427,20 +427,20 @@ sal_Bool PspGraphics::drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry,
sal_Bool PspGraphics::drawPolyPolygonBezier( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
- const BYTE* const* pFlgAry )
+ const sal_uInt8* const* pFlgAry )
{
// Point must be equal to SalPoint! see vcl/inc/salgtype.hxx
- m_pPrinterGfx->DrawPolyPolygonBezier (nPoly, pPoints, (Point**)pPtAry, (BYTE**)pFlgAry);
+ m_pPrinterGfx->DrawPolyPolygonBezier (nPoly, pPoints, (Point**)pPtAry, (sal_uInt8**)pFlgAry);
return sal_True;
}
-void PspGraphics::invert( ULONG,
+void PspGraphics::invert( sal_uLong,
const SalPoint*,
SalInvert )
{
DBG_ASSERT( 0, "Error: PrinterGfx::Invert() not implemented" );
}
-BOOL PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize )
+sal_Bool PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize )
{
return m_pPrinterGfx->DrawEPS( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ), pPtr, nSize );
}
@@ -451,7 +451,7 @@ void PspGraphics::copyBits( const SalTwoRect*,
OSL_FAIL( "Error: PrinterGfx::CopyBits() not implemented" );
}
-void PspGraphics::copyArea ( long,long,long,long,long,long,USHORT )
+void PspGraphics::copyArea ( long,long,long,long,long,long,sal_uInt16 )
{
OSL_FAIL( "Error: PrinterGfx::CopyArea() not implemented" );
}
@@ -770,16 +770,13 @@ void PspGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout )
DrawPrinterLayout( rLayout, *m_pPrinterGfx, true );
}
-ImplFontCharMap* PspGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* PspGraphics::GetImplFontCharMap() const
{
- // TODO: get ImplFontCharMap directly from fonts
if( !m_pServerFont[0] )
return NULL;
- CmapResult aCmapResult;
- if( !m_pServerFont[0]->GetFontCodeRanges( aCmapResult ) )
- return NULL;
- return new ImplFontCharMap( aCmapResult );
+ const ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap();
+ return pIFCMap;
}
bool PspGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
@@ -789,7 +786,7 @@ bool PspGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabiliti
return m_pServerFont[0]->GetFontCapabilities(rFontCapabilities);
}
-USHORT PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel )
+sal_uInt16 PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel )
{
// release all fonts that are to be overridden
for( int i = nFallbackLevel; i < MAX_FALLBACK; ++i )
@@ -920,10 +917,10 @@ void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int )
}
}
-ULONG PspGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData *pKernPairs )
+sal_uLong PspGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPairs )
{
const ::std::list< ::psp::KernPair >& rPairs( m_pPrinterGfx->getKernPairs() );
- ULONG nHavePairs = rPairs.size();
+ sal_uLong nHavePairs = rPairs.size();
if( pKernPairs && nPairs )
{
::std::list< ::psp::KernPair >::const_iterator it;
@@ -942,38 +939,38 @@ ULONG PspGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData *pKernPairs )
return nHavePairs;
}
-BOOL PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
+sal_Bool PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
if( nLevel >= MAX_FALLBACK )
- return FALSE;
+ return sal_False;
ServerFont* pSF = m_pServerFont[ nLevel ];
if( !pSF )
- return FALSE;
+ return sal_False;
nGlyphIndex &= ~GF_FONTMASK;
const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex );
rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() );
- return TRUE;
+ return sal_True;
}
-BOOL PspGraphics::GetGlyphOutline( long nGlyphIndex,
+sal_Bool PspGraphics::GetGlyphOutline( long nGlyphIndex,
::basegfx::B2DPolyPolygon& rB2DPolyPoly )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
if( nLevel >= MAX_FALLBACK )
- return FALSE;
+ return sal_False;
ServerFont* pSF = m_pServerFont[ nLevel ];
if( !pSF )
- return FALSE;
+ return sal_False;
nGlyphIndex &= ~GF_FONTMASK;
if( pSF->GetGlyphOutline( nGlyphIndex, rB2DPolyPoly ) )
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
}
SalLayout* PspGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLevel )
@@ -1008,7 +1005,7 @@ SalLayout* PspGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLevel
//--------------------------------------------------------------------------
-BOOL PspGraphics::CreateFontSubset(
+sal_Bool PspGraphics::CreateFontSubset(
const rtl::OUString& rToFile,
const ImplFontData* pFont,
sal_Int32* pGlyphIDs,
@@ -1403,9 +1400,9 @@ bool PspGraphics::filterText( const String& rOrig, String& rNewText, xub_StrLen
bool bRet = false;
bool bStarted = false;
bool bStopped = false;
- USHORT nPos;
- USHORT nStart = 0;
- USHORT nStop = rLen;
+ sal_uInt16 nPos;
+ sal_uInt16 nStart = 0;
+ sal_uInt16 nStop = rLen;
String aPhone = rOrig.Copy( nIndex, rLen );
if( ! m_bPhoneCollectionActive )
diff --git a/vcl/unx/source/gdi/salbmp.cxx b/vcl/unx/source/gdi/salbmp.cxx
index 134a4f80b1a9..c60192b8466e 100644
--- a/vcl/unx/source/gdi/salbmp.cxx
+++ b/vcl/unx/source/gdi/salbmp.cxx
@@ -66,7 +66,7 @@ SalBitmap* X11SalInstance::CreateSalBitmap()
}
ImplSalBitmapCache* X11SalBitmap::mpCache = NULL;
-ULONG X11SalBitmap::mnCacheInstCount = 0;
+sal_uLong X11SalBitmap::mnCacheInstCount = 0;
// -----------------------------------------------------------------------------
@@ -112,7 +112,7 @@ void X11SalBitmap::ImplRemovedFromCache()
// -----------------------------------------------------------------------------
-BitmapBuffer* X11SalBitmap::ImplCreateDIB( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal )
+BitmapBuffer* X11SalBitmap::ImplCreateDIB( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal )
{
DBG_ASSERT( nBitCount == 1 || nBitCount == 4 || nBitCount == 8 || nBitCount == 16 || nBitCount == 24, "Unsupported BitCount!" );
@@ -131,7 +131,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( const Size& rSize, USHORT nBitCount,
if( pDIB )
{
- const USHORT nColors = ( nBitCount <= 8 ) ? ( 1 << nBitCount ) : 0;
+ const sal_uInt16 nColors = ( nBitCount <= 8 ) ? ( 1 << nBitCount ) : 0;
pDIB->mnFormat = BMP_FORMAT_BOTTOM_UP;
@@ -172,7 +172,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( const Size& rSize, USHORT nBitCount,
try
{
- pDIB->mpBits = new BYTE[ pDIB->mnScanlineSize * pDIB->mnHeight ];
+ pDIB->mpBits = new sal_uInt8[ pDIB->mnScanlineSize * pDIB->mnHeight ];
}
catch(std::bad_alloc&)
{
@@ -218,7 +218,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable,
{
const SalTwoRect aTwoRect = { 0, 0, nWidth, nHeight, 0, 0, nWidth, nHeight };
BitmapBuffer aSrcBuf;
- ULONG nDstFormat = BMP_FORMAT_BOTTOM_UP;
+ sal_uLong nDstFormat = BMP_FORMAT_BOTTOM_UP;
const BitmapPalette* pDstPal = NULL;
aSrcBuf.mnFormat = BMP_FORMAT_TOP_DOWN;
@@ -226,7 +226,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable,
aSrcBuf.mnHeight = nHeight;
aSrcBuf.mnBitCount = pImage->bits_per_pixel;
aSrcBuf.mnScanlineSize = pImage->bytes_per_line;
- aSrcBuf.mpBits = (BYTE*) pImage->data;
+ aSrcBuf.mpBits = (sal_uInt8*) pImage->data;
pImage->red_mask = pSalDisp->GetVisual( nScreen ).red_mask;
pImage->green_mask = pSalDisp->GetVisual( nScreen ).green_mask;
@@ -310,7 +310,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable,
rPal.SetEntryCount( 256 );
pDstPal = &rPal;
- for( USHORT i = 0; i < 256; i++ )
+ for( sal_uInt16 i = 0; i < 256; i++ )
{
BitmapColor& rBmpCol = rPal[ i ];
@@ -323,12 +323,12 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable,
else if( aSrcBuf.mnBitCount <= 8 )
{
const SalColormap& rColMap = pSalDisp->GetColormap( nScreen );
- const USHORT nCols = Min( (ULONG)rColMap.GetUsed(), (ULONG)(1 << nDrawableDepth) );
+ const sal_uInt16 nCols = Min( (sal_uLong)rColMap.GetUsed(), (sal_uLong)(1 << nDrawableDepth) );
rPal.SetEntryCount( nCols );
pDstPal = &rPal;
- for( USHORT i = 0; i < nCols; i++ )
+ for( sal_uInt16 i = 0; i < nCols; i++ )
{
const SalColor nColor( rColMap.GetColor( i ) );
BitmapColor& rBmpCol = rPal[ i ];
@@ -383,7 +383,7 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long
if( pImage )
{
BitmapBuffer* pDstBuf;
- ULONG nDstFormat = BMP_FORMAT_TOP_DOWN;
+ sal_uLong nDstFormat = BMP_FORMAT_TOP_DOWN;
BitmapPalette* pPal = NULL;
ColorMask* pMask = NULL;
@@ -451,7 +451,7 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long
{
pPal = new BitmapPalette( 256 );
- for( USHORT i = 0; i < 256; i++ )
+ for( sal_uInt16 i = 0; i < 256; i++ )
{
BitmapColor& rBmpCol = (*pPal)[ i ];
@@ -464,11 +464,11 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long
else if( pImage->depth <= 8 )
{
const SalColormap& rColMap = pSalDisp->GetColormap( nScreen );
- const USHORT nCols = Min( (ULONG)rColMap.GetUsed(), (ULONG)(1 << pImage->depth) );
+ const sal_uInt16 nCols = Min( (sal_uLong)rColMap.GetUsed(), (sal_uLong)(1 << pImage->depth) );
pPal = new BitmapPalette( nCols );
- for( USHORT i = 0; i < nCols; i++ )
+ for( sal_uInt16 i = 0; i < nCols; i++ )
{
const SalColor nColor( rColMap.GetColor( i ) );
BitmapColor& rBmpCol = (*pPal)[ i ];
@@ -718,7 +718,7 @@ void X11SalBitmap::ImplDraw( Drawable aDrawable,
// -----------------------------------------------------------------------------
-bool X11SalBitmap::Create( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal )
+bool X11SalBitmap::Create( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal )
{
Destroy();
mpDIB = ImplCreateDIB( rSize, nBitCount, rPal );
@@ -741,7 +741,7 @@ bool X11SalBitmap::Create( const SalBitmap& rSSalBmp )
// TODO: get rid of this when BitmapBuffer gets copy constructor
try
{
- mpDIB->mpBits = new BYTE[ mpDIB->mnScanlineSize * mpDIB->mnHeight ];
+ mpDIB->mpBits = new sal_uInt8[ mpDIB->mnScanlineSize * mpDIB->mnHeight ];
}
catch( std::bad_alloc& )
{
@@ -767,14 +767,14 @@ bool X11SalBitmap::Create( const SalBitmap& rSSalBmp )
bool X11SalBitmap::Create( const SalBitmap&, SalGraphics* )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------------
-bool X11SalBitmap::Create( const SalBitmap&, USHORT )
+bool X11SalBitmap::Create( const SalBitmap&, sal_uInt16 )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------------
@@ -837,9 +837,9 @@ Size X11SalBitmap::GetSize() const
// -----------------------------------------------------------------------------
-USHORT X11SalBitmap::GetBitCount() const
+sal_uInt16 X11SalBitmap::GetBitCount() const
{
- USHORT nBitCount;
+ sal_uInt16 nBitCount;
if( mpDIB )
nBitCount = mpDIB->mnBitCount;
@@ -1016,7 +1016,7 @@ ImplSalDDB::~ImplSalDDB()
bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRect ) const
{
- bool bRet = FALSE;
+ bool bRet = sal_False;
if( ( maPixmap != 0 ) && ( ( mnDepth == nDepth ) || ( 1 == mnDepth ) ) && nScreen == mnScreen)
{
@@ -1025,7 +1025,7 @@ bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRe
rTwoRect.mnDestWidth == maTwoRect.mnDestWidth && rTwoRect.mnDestHeight == maTwoRect.mnDestHeight )
{
// absolutely indentically
- bRet = TRUE;
+ bRet = sal_True;
}
else if( rTwoRect.mnSrcWidth == rTwoRect.mnDestWidth && rTwoRect.mnSrcHeight == rTwoRect.mnDestHeight &&
maTwoRect.mnSrcWidth == maTwoRect.mnDestWidth && maTwoRect.mnSrcHeight == maTwoRect.mnDestHeight &&
@@ -1033,7 +1033,7 @@ bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRe
( rTwoRect.mnSrcX + rTwoRect.mnSrcWidth ) <= ( maTwoRect.mnSrcX + maTwoRect.mnSrcWidth ) &&
( rTwoRect.mnSrcY + rTwoRect.mnSrcHeight ) <= ( maTwoRect.mnSrcY + maTwoRect.mnSrcHeight ) )
{
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -1080,10 +1080,10 @@ void ImplSalDDB::ImplDraw( Drawable aSrcDrawable, long nSrcDrawableDepth,
struct ImplBmpObj
{
X11SalBitmap* mpBmp;
- ULONG mnMemSize;
- ULONG mnFlags;
+ sal_uLong mnMemSize;
+ sal_uLong mnFlags;
- ImplBmpObj( X11SalBitmap* pBmp, ULONG nMemSize, ULONG nFlags ) :
+ ImplBmpObj( X11SalBitmap* pBmp, sal_uLong nMemSize, sal_uLong nFlags ) :
mpBmp( pBmp ), mnMemSize( nMemSize ), mnFlags( nFlags ) {}
};
@@ -1103,14 +1103,14 @@ ImplSalBitmapCache::~ImplSalBitmapCache()
// -----------------------------------------------------------------------------
-void ImplSalBitmapCache::ImplAdd( X11SalBitmap* pBmp, ULONG nMemSize, ULONG nFlags )
+void ImplSalBitmapCache::ImplAdd( X11SalBitmap* pBmp, sal_uLong nMemSize, sal_uLong nFlags )
{
ImplBmpObj* pObj;
- bool bFound = FALSE;
+ bool bFound = sal_False;
for( pObj = (ImplBmpObj*) maBmpList.Last(); pObj && !bFound; pObj = (ImplBmpObj*) maBmpList.Prev() )
if( pObj->mpBmp == pBmp )
- bFound = TRUE;
+ bFound = sal_True;
mnTotalSize += nMemSize;
diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx
index 38c760af2661..4d3141fc9ded 100644
--- a/vcl/unx/source/gdi/salgdi.cxx
+++ b/vcl/unx/source/gdi/salgdi.cxx
@@ -41,6 +41,7 @@
#include "vcl/printergfx.hxx"
#include "vcl/jobdata.hxx"
+#include "vcl/region.h"
#include "tools/debug.hxx"
@@ -68,21 +69,21 @@ class SalPolyLine
XPoint Points_[STATIC_POINTS];
XPoint *pFirst_;
public:
- inline SalPolyLine( ULONG nPoints );
- inline SalPolyLine( ULONG nPoints, const SalPoint *p );
+ inline SalPolyLine( sal_uLong nPoints );
+ inline SalPolyLine( sal_uLong nPoints, const SalPoint *p );
inline ~SalPolyLine();
- inline XPoint &operator [] ( ULONG n ) const
+ inline XPoint &operator [] ( sal_uLong n ) const
{ return pFirst_[n]; }
};
-inline SalPolyLine::SalPolyLine( ULONG nPoints )
+inline SalPolyLine::SalPolyLine( sal_uLong nPoints )
: pFirst_( nPoints+1 > STATIC_POINTS ? new XPoint[nPoints+1] : Points_ )
{}
-inline SalPolyLine::SalPolyLine( ULONG nPoints, const SalPoint *p )
+inline SalPolyLine::SalPolyLine( sal_uLong nPoints, const SalPoint *p )
: pFirst_( nPoints+1 > STATIC_POINTS ? new XPoint[nPoints+1] : Points_ )
{
- for( ULONG i = 0; i < nPoints; i++ )
+ for( sal_uLong i = 0; i < nPoints; i++ )
{
pFirst_[i].x = (short)p[i].mnX;
pFirst_[i].y = (short)p[i].mnY;
@@ -105,7 +106,7 @@ X11SalGraphics::X11SalGraphics()
m_aXRenderPicture = 0;
m_pXRenderFormat = NULL;
- pClipRegion_ = NULL;
+ mpClipRegion = NULL;
pPaintRegion_ = NULL;
pPenGC_ = NULL;
@@ -114,10 +115,7 @@ X11SalGraphics::X11SalGraphics()
pFontGC_ = NULL;
for( int i = 0; i < MAX_FALLBACK; ++i )
- {
- mXFont[i] = NULL;
mpServerFont[i] = NULL;
- }
nTextPixel_ = 0;
nTextColor_ = MAKE_SALCOLOR( 0x00, 0x00, 0x00 ); // Black
@@ -125,7 +123,7 @@ X11SalGraphics::X11SalGraphics()
#ifdef ENABLE_GRAPHITE
// check if graphite fonts have been disabled
static const char* pDisableGraphiteStr = getenv( "SAL_DISABLE_GRAPHITE" );
- bDisableGraphite_ = pDisableGraphiteStr ? (pDisableGraphiteStr[0]!='0') : FALSE;
+ bDisableGraphite_ = pDisableGraphiteStr ? (pDisableGraphiteStr[0]!='0') : sal_False;
#endif
pBrushGC_ = NULL;
@@ -141,20 +139,20 @@ X11SalGraphics::X11SalGraphics()
pStippleGC_ = NULL;
pTrackingGC_ = NULL;
- bWindow_ = FALSE;
- bPrinter_ = FALSE;
- bVirDev_ = FALSE;
- bPenGC_ = FALSE;
- bFontGC_ = FALSE;
- bBrushGC_ = FALSE;
- bMonoGC_ = FALSE;
- bCopyGC_ = FALSE;
- bInvertGC_ = FALSE;
- bInvert50GC_ = FALSE;
- bStippleGC_ = FALSE;
- bTrackingGC_ = FALSE;
- bXORMode_ = FALSE;
- bDitherBrush_ = FALSE;
+ bWindow_ = sal_False;
+ bPrinter_ = sal_False;
+ bVirDev_ = sal_False;
+ bPenGC_ = sal_False;
+ bFontGC_ = sal_False;
+ bBrushGC_ = sal_False;
+ bMonoGC_ = sal_False;
+ bCopyGC_ = sal_False;
+ bInvertGC_ = sal_False;
+ bInvert50GC_ = sal_False;
+ bStippleGC_ = sal_False;
+ bTrackingGC_ = sal_False;
+ bXORMode_ = sal_False;
+ bDitherBrush_ = sal_False;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -171,7 +169,7 @@ void X11SalGraphics::freeResources()
Display *pDisplay = GetXDisplay();
DBG_ASSERT( !pPaintRegion_, "pPaintRegion_" );
- if( pClipRegion_ ) XDestroyRegion( pClipRegion_ ), pClipRegion_ = None;
+ if( mpClipRegion ) XDestroyRegion( mpClipRegion ), mpClipRegion = None;
if( hBrush_ ) XFreePixmap( pDisplay, hBrush_ ), hBrush_ = None;
if( pPenGC_ ) XFreeGC( pDisplay, pPenGC_ ), pPenGC_ = None;
@@ -230,7 +228,7 @@ void X11SalGraphics::Init( SalFrame *pFrame, Drawable aTarget, int nScreen )
m_nScreen = nScreen;
SetDrawable( aTarget, nScreen );
- bWindow_ = TRUE;
+ bWindow_ = sal_True;
m_pFrame = pFrame;
m_pVDev = NULL;
}
@@ -249,8 +247,8 @@ void X11SalGraphics::SetClipRegion( GC pGC, XLIB_Region pXReg ) const
int n = 0;
XLIB_Region Regions[3];
- if( pClipRegion_ )
- Regions[n++] = pClipRegion_;
+ if( mpClipRegion )
+ Regions[n++] = mpClipRegion;
if( pXReg && !XEmptyRegion( pXReg ) )
Regions[n++] = pXReg;
@@ -292,7 +290,7 @@ GC X11SalGraphics::SelectPen()
XSetForeground( pDisplay, pPenGC_, nPenPixel_ );
XSetFunction ( pDisplay, pPenGC_, bXORMode_ ? GXxor : GXcopy );
SetClipRegion( pPenGC_ );
- bPenGC_ = TRUE;
+ bPenGC_ = sal_True;
}
return pPenGC_;
@@ -323,13 +321,8 @@ GC X11SalGraphics::SelectBrush()
{
XSetFillStyle ( pDisplay, pBrushGC_, FillSolid );
XSetForeground( pDisplay, pBrushGC_, nBrushPixel_ );
- #if defined(_USE_PRINT_EXTENSION_)
- XSetBackground( pDisplay, pBrushGC_,
- WhitePixel(pDisplay, DefaultScreen(pDisplay)) );
- #else
if( bPrinter_ )
XSetTile( pDisplay, pBrushGC_, None );
- #endif
}
else
{
@@ -344,7 +337,7 @@ GC X11SalGraphics::SelectBrush()
XSetFunction ( pDisplay, pBrushGC_, bXORMode_ ? GXxor : GXcopy );
SetClipRegion( pBrushGC_ );
- bBrushGC_ = TRUE;
+ bBrushGC_ = sal_True;
}
return pBrushGC_;
@@ -376,26 +369,26 @@ GC X11SalGraphics::GetTrackingGC()
if( !bTrackingGC_ )
{
SetClipRegion( pTrackingGC_ );
- bTrackingGC_ = TRUE;
+ bTrackingGC_ = sal_True;
}
return pTrackingGC_;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::DrawLines( ULONG nPoints,
+void X11SalGraphics::DrawLines( sal_uLong nPoints,
const SalPolyLine &rPoints,
GC pGC,
bool bClose
)
{
// errechne wie viele Linien XWindow auf einmal zeichnen kann
- ULONG nMaxLines = (GetDisplay()->GetMaxRequestSize() - sizeof(xPolyPointReq))
+ sal_uLong nMaxLines = (GetDisplay()->GetMaxRequestSize() - sizeof(xPolyPointReq))
/ sizeof(xPoint);
if( nMaxLines > nPoints ) nMaxLines = nPoints;
// gebe alle Linien aus, die XWindows zeichnen kann.
- ULONG n;
+ sal_uLong n;
for( n = 0; nPoints - n > nMaxLines; n += nMaxLines - 1 )
XDrawLines( GetXDisplay(),
GetDrawable(),
@@ -439,24 +432,24 @@ BOOL X11SalGraphics::GetDitherPixmap( SalColor nSalColor )
// test for correct depth (8bit)
if( GetColormap().GetVisual().GetDepth() != 8 )
- return FALSE;
+ return sal_False;
char pBits[64];
char *pBitsPtr = pBits;
// Set the pallette-entries for the dithering tile
- UINT8 nSalColorRed = SALCOLOR_RED ( nSalColor );
- UINT8 nSalColorGreen = SALCOLOR_GREEN ( nSalColor );
- UINT8 nSalColorBlue = SALCOLOR_BLUE ( nSalColor );
+ sal_uInt8 nSalColorRed = SALCOLOR_RED ( nSalColor );
+ sal_uInt8 nSalColorGreen = SALCOLOR_GREEN ( nSalColor );
+ sal_uInt8 nSalColorBlue = SALCOLOR_BLUE ( nSalColor );
for( int nY = 0; nY < 8; nY++ )
{
for( int nX = 0; nX < 8; nX++ )
{
short nMagic = nOrdDither8Bit[nY][nX];
- UINT8 nR = P_DELTA * DMAP( nSalColorRed, nMagic );
- UINT8 nG = P_DELTA * DMAP( nSalColorGreen, nMagic );
- UINT8 nB = P_DELTA * DMAP( nSalColorBlue, nMagic );
+ sal_uInt8 nR = P_DELTA * DMAP( nSalColorRed, nMagic );
+ sal_uInt8 nG = P_DELTA * DMAP( nSalColorGreen, nMagic );
+ sal_uInt8 nB = P_DELTA * DMAP( nSalColorBlue, nMagic );
*pBitsPtr++ = GetColormap().GetPixel( MAKE_SALCOLOR( nR, nG, nB ) );
}
@@ -496,7 +489,7 @@ BOOL X11SalGraphics::GetDitherPixmap( SalColor nSalColor )
pImage->data = NULL;
XDestroyImage( pImage );
- return TRUE;
+ return sal_True;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -531,7 +524,7 @@ void X11SalGraphics::GetResolution( sal_Int32 &rDPIX, sal_Int32 &rDPIY ) // cons
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-USHORT X11SalGraphics::GetBitCount() const
+sal_uInt16 X11SalGraphics::GetBitCount() const
{
return GetVisual().GetDepth();
}
@@ -561,73 +554,64 @@ long X11SalGraphics::GetGraphicsHeight() const
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void X11SalGraphics::ResetClipRegion()
{
- if( pClipRegion_ )
+ if( mpClipRegion )
{
- bPenGC_ = FALSE;
- bFontGC_ = FALSE;
- bBrushGC_ = FALSE;
- bMonoGC_ = FALSE;
- bCopyGC_ = FALSE;
- bInvertGC_ = FALSE;
- bInvert50GC_ = FALSE;
- bStippleGC_ = FALSE;
- bTrackingGC_ = FALSE;
-
- XDestroyRegion( pClipRegion_ );
- pClipRegion_ = NULL;
+ bPenGC_ = sal_False;
+ bFontGC_ = sal_False;
+ bBrushGC_ = sal_False;
+ bMonoGC_ = sal_False;
+ bCopyGC_ = sal_False;
+ bInvertGC_ = sal_False;
+ bInvert50GC_ = sal_False;
+ bStippleGC_ = sal_False;
+ bTrackingGC_ = sal_False;
+
+ XDestroyRegion( mpClipRegion );
+ mpClipRegion = NULL;
}
}
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::BeginSetClipRegion( ULONG )
-{
- if( pClipRegion_ )
- XDestroyRegion( pClipRegion_ );
- pClipRegion_ = XCreateRegion();
-}
-
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-BOOL X11SalGraphics::unionClipRegion( long nX, long nY, long nDX, long nDY )
+bool X11SalGraphics::setClipRegion( const Region& i_rClip )
{
- if (!nDX || !nDY)
- return TRUE;
-
- XRectangle aRect;
- aRect.x = (short)nX;
- aRect.y = (short)nY;
- aRect.width = (unsigned short)nDX;
- aRect.height = (unsigned short)nDY;
-
- XUnionRectWithRegion( &aRect, pClipRegion_, pClipRegion_ );
-
- return TRUE;
-}
+ if( mpClipRegion )
+ XDestroyRegion( mpClipRegion );
+ mpClipRegion = XCreateRegion();
+
+ ImplRegionInfo aInfo;
+ long nX, nY, nW, nH;
+ bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
+ while( bRegionRect )
+ {
+ if ( nW && nH )
+ {
+ XRectangle aRect;
+ aRect.x = (short)nX;
+ aRect.y = (short)nY;
+ aRect.width = (unsigned short)nW;
+ aRect.height = (unsigned short)nH;
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-bool X11SalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- // TODO: implement and advertise OutDevSupport_B2DClip support
- return false;
-}
+ XUnionRectWithRegion( &aRect, mpClipRegion, mpClipRegion );
+ }
+ bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
+ }
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::EndSetClipRegion()
-{
- bPenGC_ = FALSE;
- bFontGC_ = FALSE;
- bBrushGC_ = FALSE;
- bMonoGC_ = FALSE;
- bCopyGC_ = FALSE;
- bInvertGC_ = FALSE;
- bInvert50GC_ = FALSE;
- bStippleGC_ = FALSE;
- bTrackingGC_ = FALSE;
-
- if( XEmptyRegion( pClipRegion_ ) )
+ // done, invalidate GCs
+ bPenGC_ = sal_False;
+ bFontGC_ = sal_False;
+ bBrushGC_ = sal_False;
+ bMonoGC_ = sal_False;
+ bCopyGC_ = sal_False;
+ bInvertGC_ = sal_False;
+ bInvert50GC_ = sal_False;
+ bStippleGC_ = sal_False;
+ bTrackingGC_ = sal_False;
+
+ if( XEmptyRegion( mpClipRegion ) )
{
- XDestroyRegion( pClipRegion_ );
- pClipRegion_= NULL;
+ XDestroyRegion( mpClipRegion );
+ mpClipRegion= NULL;
}
+ return true;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -636,7 +620,7 @@ void X11SalGraphics::SetLineColor()
if( nPenColor_ != SALCOLOR_NONE )
{
nPenColor_ = SALCOLOR_NONE;
- bPenGC_ = FALSE;
+ bPenGC_ = sal_False;
}
}
@@ -647,7 +631,7 @@ void X11SalGraphics::SetLineColor( SalColor nSalColor )
{
nPenColor_ = nSalColor;
nPenPixel_ = GetPixel( nSalColor );
- bPenGC_ = FALSE;
+ bPenGC_ = sal_False;
}
}
@@ -656,9 +640,9 @@ void X11SalGraphics::SetFillColor()
{
if( nBrushColor_ != SALCOLOR_NONE )
{
- bDitherBrush_ = FALSE;
+ bDitherBrush_ = sal_False;
nBrushColor_ = SALCOLOR_NONE;
- bBrushGC_ = FALSE;
+ bBrushGC_ = sal_False;
}
}
@@ -667,7 +651,7 @@ void X11SalGraphics::SetFillColor( SalColor nSalColor )
{
if( nBrushColor_ != nSalColor )
{
- bDitherBrush_ = FALSE;
+ bDitherBrush_ = sal_False;
nBrushColor_ = nSalColor;
nBrushPixel_ = GetPixel( nSalColor );
if( TrueColor != GetColormap().GetVisual().GetClass()
@@ -689,7 +673,7 @@ void X11SalGraphics::SetFillColor( SalColor nSalColor )
&& nSalColor != MAKE_SALCOLOR( 0xFF, 0xFF, 0x00 ) // light brown
&& nSalColor != MAKE_SALCOLOR( 0xFF, 0xFF, 0xFF ) )
bDitherBrush_ = GetDitherPixmap(nSalColor);
- bBrushGC_ = FALSE;
+ bBrushGC_ = sal_False;
}
}
@@ -709,7 +693,7 @@ void X11SalGraphics::SetROPLineColor( SalROPColor nROPColor )
break;
}
nPenColor_ = GetColormap().GetColor( nPenPixel_ );
- bPenGC_ = FALSE;
+ bPenGC_ = sal_False;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -727,9 +711,9 @@ void X11SalGraphics::SetROPFillColor( SalROPColor nROPColor )
nBrushPixel_ = (Pixel)(1 << GetVisual().GetDepth()) - 1;
break;
}
- bDitherBrush_ = FALSE;
+ bDitherBrush_ = sal_False;
nBrushColor_ = GetColormap().GetColor( nBrushPixel_ );
- bBrushGC_ = FALSE;
+ bBrushGC_ = sal_False;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -738,14 +722,15 @@ void X11SalGraphics::SetXORMode( bool bSet, bool )
if( !bXORMode_ == bSet )
{
bXORMode_ = bSet;
- bPenGC_ = FALSE;
- bBrushGC_ = FALSE;
- bMonoGC_ = FALSE;
- bCopyGC_ = FALSE;
- bInvertGC_ = FALSE;
- bInvert50GC_ = FALSE;
- bStippleGC_ = FALSE;
- bTrackingGC_ = FALSE;
+ bPenGC_ = sal_False;
+ bFontGC_ = sal_False;
+ bBrushGC_ = sal_False;
+ bMonoGC_ = sal_False;
+ bCopyGC_ = sal_False;
+ bInvertGC_ = sal_False;
+ bInvert50GC_ = sal_False;
+ bStippleGC_ = sal_False;
+ bTrackingGC_ = sal_False;
}
}
@@ -821,13 +806,13 @@ void X11SalGraphics::drawRect( long nX, long nY, long nDX, long nDY )
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry )
+void X11SalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry )
{
drawPolyLine( nPoints, pPtAry, false );
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry, bool bClose )
+void X11SalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry, bool bClose )
{
if( nPenColor_ != 0xFFFFFFFF )
{
@@ -838,7 +823,7 @@ void X11SalGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry, bool b
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::drawPolygon( ULONG nPoints, const SalPoint* pPtAry )
+void X11SalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry )
{
if( nPoints == 0 )
return;
@@ -911,7 +896,7 @@ void X11SalGraphics::drawPolyPolygon( sal_uInt32 nPoly,
{
if( nBrushColor_ != SALCOLOR_NONE )
{
- ULONG i, n;
+ sal_uInt32 i, n;
XLIB_Region pXRegA = NULL;
for( i = 0; i < nPoly; i++ ) {
@@ -938,7 +923,7 @@ void X11SalGraphics::drawPolyPolygon( sal_uInt32 nPoly,
GC pGC = SelectBrush();
SetClipRegion( pGC, pXRegA ); // ??? doppelt
XDestroyRegion( pXRegA );
- bBrushGC_ = FALSE;
+ bBrushGC_ = sal_False;
XFillRectangle( GetXDisplay(),
GetDrawable(),
@@ -948,20 +933,20 @@ void X11SalGraphics::drawPolyPolygon( sal_uInt32 nPoly,
}
if( nPenColor_ != SALCOLOR_NONE )
- for( ULONG i = 0; i < nPoly; i++ )
+ for( sal_uInt32 i = 0; i < nPoly; i++ )
drawPolyLine( pPoints[i], pPtAry[i], true );
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-sal_Bool X11SalGraphics::drawPolyLineBezier( ULONG, const SalPoint*, const BYTE* )
+sal_Bool X11SalGraphics::drawPolyLineBezier( sal_uLong, const SalPoint*, const BYTE* )
{
return sal_False;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-sal_Bool X11SalGraphics::drawPolygonBezier( ULONG, const SalPoint*, const BYTE* )
+sal_Bool X11SalGraphics::drawPolygonBezier( sal_uLong, const SalPoint*, const BYTE* )
{
return sal_False;
}
@@ -976,7 +961,7 @@ sal_Bool X11SalGraphics::drawPolyPolygonBezier( sal_uInt32, const sal_uInt32*,
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::invert( ULONG nPoints,
+void X11SalGraphics::invert( sal_uLong nPoints,
const SalPoint* pPtAry,
SalInvert nFlags )
{
@@ -1003,9 +988,9 @@ void X11SalGraphics::invert( ULONG nPoints,
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-BOOL X11SalGraphics::drawEPS( long,long,long,long,void*,ULONG )
+BOOL X11SalGraphics::drawEPS( long,long,long,long,void*,sal_uLong )
{
- return FALSE;
+ return sal_False;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -1067,22 +1052,22 @@ bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rOrigPoly
// nothing to do for empty polypolygons
const int nOrigPolyCount = rOrigPolyPoly.count();
if( nOrigPolyCount <= 0 )
- return TRUE;
+ return sal_True;
// nothing to do if everything is transparent
if( (nBrushColor_ == SALCOLOR_NONE)
&& (nPenColor_ == SALCOLOR_NONE) )
- return TRUE;
+ return sal_True;
// cannot handle pencolor!=brushcolor yet
if( (nPenColor_ != SALCOLOR_NONE)
&& (nPenColor_ != nBrushColor_) )
- return FALSE;
+ return sal_False;
// TODO: remove the env-variable when no longer needed
static const char* pRenderEnv = getenv( "SAL_DISABLE_RENDER_POLY" );
if( pRenderEnv )
- return FALSE;
+ return sal_False;
// snap to raster if requested
basegfx::B2DPolyPolygon aPolyPoly = rOrigPolyPoly;
@@ -1165,8 +1150,8 @@ bool X11SalGraphics::drawFilledTrapezoids( const ::basegfx::B2DTrapezoid* pB2DTr
// set clipping
// TODO: move into GetXRenderPicture?
- if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
- rRenderPeer.SetPictureClipRegion( aDstPic, pClipRegion_ );
+ if( mpClipRegion && !XEmptyRegion( mpClipRegion ) )
+ rRenderPeer.SetPictureClipRegion( aDstPic, mpClipRegion );
// render the trapezoids
const XRenderPictFormat* pMaskFormat = rRenderPeer.GetStandardFormatA8();
@@ -1213,14 +1198,17 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, double
basegfx::tools::createLineTrapezoidFromB2DPolygon( aB2DTrapVector, aPolygon, rLineWidth.getX() );
// draw tesselation result
- const int nTrapCount = aB2DTrapVector.size();
- if( !nTrapCount )
- return true;
- const bool bDrawOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency );
+ if( ! aB2DTrapVector.empty() )
+ {
+ const int nTrapCount = aB2DTrapVector.size();
+ const bool bDrawOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency );
- // restore the original brush GC
- nBrushColor_ = aKeepBrushColor;
- return bDrawOk;
+ // restore the original brush GC
+ nBrushColor_ = aKeepBrushColor;
+ return bDrawOk;
+ }
+ else
+ return true;
}
// get the area polygon for the line polygon
diff --git a/vcl/unx/source/gdi/salgdi2.cxx b/vcl/unx/source/gdi/salgdi2.cxx
index 7e8b4abc5905..7e3735d8acd6 100644
--- a/vcl/unx/source/gdi/salgdi2.cxx
+++ b/vcl/unx/source/gdi/salgdi2.cxx
@@ -136,7 +136,7 @@ inline GC X11SalGraphics::GetMonoGC( Pixmap hPixmap )
if( !bMonoGC_ )
{
SetClipRegion( pMonoGC_ );
- bMonoGC_ = TRUE;
+ bMonoGC_ = sal_True;
}
return pMonoGC_;
@@ -153,7 +153,7 @@ inline GC X11SalGraphics::GetCopyGC()
if( !bCopyGC_ )
{
SetClipRegion( pCopyGC_ );
- bCopyGC_ = TRUE;
+ bCopyGC_ = sal_True;
}
return pCopyGC_;
}
@@ -171,7 +171,7 @@ GC X11SalGraphics::GetInvertGC()
if( !bInvertGC_ )
{
SetClipRegion( pInvertGC_ );
- bInvertGC_ = TRUE;
+ bInvertGC_ = sal_True;
}
return pInvertGC_;
}
@@ -219,7 +219,7 @@ GC X11SalGraphics::GetInvert50GC()
if( !bInvert50GC_ )
{
SetClipRegion( pInvert50GC_ );
- bInvert50GC_ = TRUE;
+ bInvert50GC_ = sal_True;
}
return pInvert50GC_;
}
@@ -237,7 +237,7 @@ inline GC X11SalGraphics::GetStippleGC()
{
XSetFunction( GetXDisplay(), pStippleGC_, bXORMode_ ? GXxor : GXcopy );
SetClipRegion( pStippleGC_ );
- bStippleGC_ = TRUE;
+ bStippleGC_ = sal_True;
}
return pStippleGC_;
@@ -294,8 +294,8 @@ int X11SalGraphics::Clip( int &nX,
&& RectangleOut == Clip( pPaintRegion_, nX, nY, nDX, nDY, nSrcX, nSrcY ) )
return RectangleOut;
- if( pClipRegion_
- && RectangleOut == Clip( pClipRegion_, nX, nY, nDX, nDY, nSrcX, nSrcY ) )
+ if( mpClipRegion
+ && RectangleOut == Clip( mpClipRegion, nX, nY, nDX, nDY, nSrcX, nSrcY ) )
return RectangleOut;
int nPaint;
@@ -309,9 +309,9 @@ int X11SalGraphics::Clip( int &nX,
nPaint = RectangleIn;
int nClip;
- if( pClipRegion_ )
+ if( mpClipRegion )
{
- nClip = XRectInRegion( pClipRegion_, nX, nY, nDX, nDY );
+ nClip = XRectInRegion( mpClipRegion, nX, nY, nDX, nDY );
if( RectangleOut == nClip )
return RectangleOut;
}
@@ -594,7 +594,7 @@ void X11SalGraphics::copyBits( const SalTwoRect *pPosAry,
void X11SalGraphics::copyArea ( long nDestX, long nDestY,
long nSrcX, long nSrcY,
long nSrcWidth, long nSrcHeight,
- USHORT )
+ sal_uInt16 )
{
SalTwoRect aPosAry;
@@ -647,11 +647,11 @@ void X11SalGraphics::drawBitmap( const SalTwoRect* pPosAry,
DBG_ASSERT( !bPrinter_, "Drawing of transparent bitmaps on printer devices is strictly forbidden" );
// decide if alpha masking or transparency masking is needed
- BitmapBuffer* pAlphaBuffer = const_cast<SalBitmap&>(rMaskBitmap).AcquireBuffer( TRUE );
+ BitmapBuffer* pAlphaBuffer = const_cast<SalBitmap&>(rMaskBitmap).AcquireBuffer( sal_True );
if( pAlphaBuffer != NULL )
{
int nMaskFormat = pAlphaBuffer->mnFormat;
- const_cast<SalBitmap&>(rMaskBitmap).ReleaseBuffer( pAlphaBuffer, TRUE );
+ const_cast<SalBitmap&>(rMaskBitmap).ReleaseBuffer( pAlphaBuffer, sal_True );
if( nMaskFormat == BMP_FORMAT_8BIT_PAL )
drawAlphaBitmap( *pPosAry, rSrcBitmap, rMaskBitmap );
}
@@ -672,7 +672,7 @@ void X11SalGraphics::drawMaskedBitmap( const SalTwoRect* pPosAry,
// figure work mode depth. If this is a VDev Drawable, use its
// bitdepth to create pixmaps for, otherwise, XCopyArea will
// refuse to work.
- const USHORT nDepth( m_pVDev ?
+ const sal_uInt16 nDepth( m_pVDev ?
m_pVDev->GetDepth() :
pSalDisp->GetVisual( m_nScreen ).GetDepth() );
Pixmap aFG( XCreatePixmap( pXDisp, aDrawable, pPosAry->mnDestWidth,
@@ -731,8 +731,8 @@ void X11SalGraphics::drawMaskedBitmap( const SalTwoRect* pPosAry,
DBG_TESTTRANS( aBG );
// #105055# Disable XOR temporarily
- BOOL bOldXORMode( bXORMode_ );
- bXORMode_ = FALSE;
+ sal_Bool bOldXORMode( bXORMode_ );
+ bXORMode_ = sal_False;
// copy pixmap #2 (result) to background
XCopyArea( pXDisp, aBG, aDrawable, GetCopyGC(),
@@ -820,7 +820,7 @@ bool X11SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
// TODO: use SalX11Bitmap functionality and caching for the Alpha Pixmap
// problem is that they don't provide an 8bit Pixmap on a non-8bit display
- BitmapBuffer* pAlphaBuffer = const_cast<SalBitmap&>(rAlphaBmp).AcquireBuffer( TRUE );
+ BitmapBuffer* pAlphaBuffer = const_cast<SalBitmap&>(rAlphaBmp).AcquireBuffer( sal_True );
// an XImage needs its data top_down
// TODO: avoid wrongly oriented images in upper layers!
@@ -865,7 +865,7 @@ bool X11SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
if( pAlphaBits != (char*)pAlphaBuffer->mpBits )
delete[] pAlphaBits;
- const_cast<SalBitmap&>(rAlphaBmp).ReleaseBuffer( pAlphaBuffer, TRUE );
+ const_cast<SalBitmap&>(rAlphaBmp).ReleaseBuffer( pAlphaBuffer, sal_True );
XRenderPictureAttributes aAttr;
aAttr.repeat = true;
@@ -874,8 +874,8 @@ bool X11SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
return false;
// set clipping
- if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
- rPeer.SetPictureClipRegion( aDstPic, pClipRegion_ );
+ if( mpClipRegion && !XEmptyRegion( mpClipRegion ) )
+ rPeer.SetPictureClipRegion( aDstPic, mpClipRegion );
// paint source * mask over destination picture
rPeer.CompositePicture( PictOpOver, aSrcPic, aAlphaPic, aDstPic,
@@ -1031,7 +1031,7 @@ SalBitmap *X11SalGraphics::getBitmap( long nX, long nY, long nDX, long nDY )
}
X11SalBitmap* pSalBitmap = new X11SalBitmap;
- USHORT nBitCount = GetBitCount();
+ sal_uInt16 nBitCount = GetBitCount();
if( &GetDisplay()->GetColormap( m_nScreen ) != &GetColormap() )
nBitCount = 1;
diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx
index 5dacaf8022d7..342bd99de324 100644
--- a/vcl/unx/source/gdi/salgdi3.cxx
+++ b/vcl/unx/source/gdi/salgdi3.cxx
@@ -47,11 +47,7 @@
#include "salgdi.h"
#include "pspgraphics.h"
#include "salvd.h"
-#include "xfont.hxx"
#include <vcl/sysdata.hxx>
-#include "xlfd_attr.hxx"
-#include "xlfd_smpl.hxx"
-#include "xlfd_extd.hxx"
#include "salcvt.hxx"
#include "vcl/printergfx.hxx"
@@ -112,385 +108,6 @@ struct _XRegion
BOX extents;
};
using ::rtl::OUString;
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-// ----------------------------------------------------------------------------
-//
-// manage X11 fonts and self rastered fonts
-//
-// ----------------------------------------------------------------------------
-
-#ifndef _USE_PRINT_EXTENSION_
-
-class FontLookup
-{
- public:
-
- struct hash;
- struct equal;
- typedef ::boost::unordered_set< FontLookup,
- FontLookup::hash,
- FontLookup::equal > fl_hashset;
-
- private:
-
- rtl::OString maName;
- FontWeight mnWeight;
- FontItalic mnItalic;
- sal_Bool mbDisplay;
-
- public:
-
- FontLookup ( ::std::list< psp::fontID >::iterator& it,
- const psp::PrintFontManager& rMgr );
- FontLookup (const Xlfd& rFont);
- FontLookup (const FontLookup &rRef) :
- maName (rRef.maName),
- mnWeight (rRef.mnWeight),
- mnItalic (rRef.mnItalic),
- mbDisplay(rRef.mbDisplay)
- {}
- ~FontLookup ()
- {}
-
- static void BuildSet (fl_hashset& rSet);
- static bool InSet (const fl_hashset& rSet, const Xlfd& rXfld);
- bool InSet (const fl_hashset& rSet) const;
-
- bool operator== (const FontLookup &rRef) const
- {
- return (abs(mnWeight - rRef.mnWeight) < 2)
- && (mnItalic == rRef.mnItalic)
- && (maName == rRef.maName)
- && (mbDisplay== rRef.mbDisplay);
- }
- FontLookup& operator= (const FontLookup &rRef)
- {
- mnWeight = rRef.mnWeight;
- mnItalic = rRef.mnItalic;
- maName = rRef.maName;
- mbDisplay= rRef.mbDisplay;
-
- return *this;
- }
- size_t Hash() const
- {
- return maName.hashCode ();
- }
-
- struct equal
- {
- bool operator()(const FontLookup &r1, const FontLookup &r2) const
- {
- return r1 == r2;
- }
- };
- struct hash
- {
- size_t operator()(const FontLookup &rArg) const
- {
- return rArg.Hash();
- }
- };
-};
-
-FontLookup::FontLookup ( ::std::list< psp::fontID >::iterator& it,
- const psp::PrintFontManager& rMgr )
-{
- psp::FastPrintFontInfo aInfo;
- if (rMgr.getFontFastInfo (*it, aInfo))
- {
- mnItalic = PspGraphics::ToFontItalic (aInfo.m_eItalic);
- mnWeight = PspGraphics::ToFontWeight (aInfo.m_eWeight);
- mbDisplay= aInfo.m_eType == psp::fonttype::Builtin
- || aInfo.m_eType == psp::fonttype::Unknown ? False : True;
- maName = rtl::OUStringToOString
- ( aInfo.m_aFamilyName,
- RTL_TEXTENCODING_ISO_8859_1).toAsciiLowerCase();
-
- sal_Int32 n_length = maName.getLength();
- const sal_Char* p_from = maName.getStr();
- sal_Char* p_to = (sal_Char*)alloca (n_length + 1);
-
- sal_Int32 i, j;
- for (i = 0, j = 0; i < n_length; i++)
- {
- if ( p_from[i] != ' ' )
- p_to[j++] = p_from[i];
- }
- maName = rtl::OString (p_to, j);
- if (mnItalic == ITALIC_OBLIQUE)
- mnItalic = ITALIC_NORMAL;
- }
- else
- {
- mnItalic = ITALIC_DONTKNOW;
- mnWeight = WEIGHT_DONTKNOW;
- mbDisplay= False;
- }
-}
-
-FontLookup::FontLookup (const Xlfd& rFont)
-{
- AttributeProvider* pFactory = rFont.mpFactory;
- Attribute* pAttr;
-
- pAttr = pFactory->RetrieveSlant (rFont.mnSlant);
- mnItalic = (FontItalic)pAttr->GetValue();
- pAttr = pFactory->RetrieveWeight (rFont.mnWeight);
- mnWeight = (FontWeight)pAttr->GetValue();
- pAttr = pFactory->RetrieveFamily (rFont.mnFamily);
- maName = pAttr->GetKey();
-
- if (mnItalic == ITALIC_OBLIQUE)
- mnItalic = ITALIC_NORMAL;
-
- mbDisplay = True;
-}
-
-void
-FontLookup::BuildSet (FontLookup::fl_hashset &rSet)
-{
- ::std::list< psp::fontID > aIdList;
-
- psp::PrintFontManager& rMgr = psp::PrintFontManager::get();
- rMgr.getFontList( aIdList, NULL, false );
-
- ::std::list< psp::fontID >::iterator it;
- for (it = aIdList.begin(); it != aIdList.end(); ++it)
- {
- FontLookup aItem (it, rMgr);
- rSet.insert (aItem);
- }
-}
-
-bool
-FontLookup::InSet (const FontLookup::fl_hashset& rSet) const
-{
- fl_hashset::const_iterator it = rSet.find(*this);
- return it == rSet.end() ? false : true;
-}
-
-bool
-FontLookup::InSet (const FontLookup::fl_hashset& rSet, const Xlfd& rXlfd)
-{
- FontLookup aNeedle (rXlfd);
- return aNeedle.InSet (rSet);
-}
-
-#endif
-
-// ----------------------------------------------------------------------------
-//
-// SalDisplay
-//
-// ----------------------------------------------------------------------------
-
-XlfdStorage*
-SalDisplay::GetXlfdList() const
-{
- if ( mpFontList != NULL )
- {
- return mpFontList;
- }
- else
- {
- const_cast<SalDisplay*>(this)->mpFactory = new AttributeProvider;
- const_cast<SalDisplay*>(this)->mpFontList = new XlfdStorage;
- const_cast<SalDisplay*>(this)->mpFallbackFactory = new VirtualXlfd;
-
- int i, nFontCount;
- const int nMaxCount = 64 * 1024 - 1;
- Display *pDisplay = GetDisplay();
- char **ppFontList = XListFonts(pDisplay, "-*", nMaxCount, &nFontCount);
-
- //
- // create a list of simple Xlfd font information
- //
-
- Xlfd *pXlfdList = (Xlfd*)malloc( nFontCount * sizeof(Xlfd) );
- int nXlfdCount = 0;
-
- for ( i = 0; i < nFontCount; i++ )
- {
- if ( pXlfdList[ nXlfdCount ].FromString(ppFontList[i], mpFactory) )
- ++nXlfdCount;
- }
-
- XFreeFontNames( ppFontList );
-
- mpFactory->AddClassification();
- // add some pretty print description
- mpFactory->AddAnnotation();
- // misc feature checking
- mpFactory->TagFeature();
-
- // sort according to font style
- qsort( pXlfdList, nXlfdCount, sizeof(Xlfd), XlfdCompare );
-
-#ifndef _USE_PRINT_EXTENSION_
- // create a list of fonts already managed by the fontmanager
- FontLookup::fl_hashset aSet;
- FontLookup::BuildSet (aSet);
-#endif
-
- //
- // create a font list with merged encoding information
- //
-
- BitmapXlfdStorage aBitmapList;
- ScalableXlfd *pScalableFont = NULL;
-
- int nFrom = 0;
- for ( i = 0; i < nXlfdCount; i++ )
- {
- // exclude openlook glyph and cursor
- Attribute *pAttr = mpFactory->RetrieveFamily(pXlfdList[i].mnFamily);
- if ( pAttr->HasFeature( XLFD_FEATURE_OL_GLYPH
- | XLFD_FEATURE_OL_CURSOR) )
- continue;
- // exclude fonts with unknown encoding
- if ( pXlfdList[i].GetEncoding() == RTL_TEXTENCODING_DONTKNOW )
- continue;
- // exclude "interface system" and "interface user"
- if (pAttr->HasFeature( XLFD_FEATURE_APPLICATION_FONT ) )
- continue;
- // exclude fonts already managed by fontmanager, anyway keep
- // gui fonts: they are candidates for GetInterfaceFont ()
- if (pXlfdList[i].Fonttype() == eTypeScalable)
- ((VirtualXlfd*)mpFallbackFactory)->FilterInterfaceFont (pXlfdList + i);
-#ifndef _USE_PRINT_EXTENSION_
- if (FontLookup::InSet (aSet, pXlfdList[i]))
- continue;
-#endif
- Bool bSameOutline = pXlfdList[i].SameFontoutline(pXlfdList + nFrom);
- XlfdFonttype eType = pXlfdList[i].Fonttype();
-
- // flush the old merged font list if the name doesn't match any more
- if ( !bSameOutline )
- {
- mpFontList->Add( pScalableFont );
- mpFontList->Add( &aBitmapList );
- pScalableFont = NULL;
- aBitmapList.Reset();
- }
-
- // merge the font or generate a new one
- switch( eType )
- {
- case eTypeScalable:
- if ( pScalableFont == NULL )
- pScalableFont = new ScalableXlfd;
- pScalableFont->AddEncoding(pXlfdList + i);
- break;
-
- case eTypeBitmap:
- aBitmapList.AddBitmapFont( pXlfdList + i );
- break;
-
- case eTypeScalableBitmap:
- // ignore scaled X11 bitmap fonts because they look too ugly
- default:
- break;
- }
-
- nFrom = i;
- }
-
- // flush the merged list into the global list
- mpFontList->Add( pScalableFont );
- mpFontList->Add( &aBitmapList );
- if (mpFallbackFactory->NumEncodings() > 0)
- mpFontList->Add( mpFallbackFactory );
- // cleanup the list of simple font information
- if ( pXlfdList != NULL )
- free( pXlfdList );
-
- return mpFontList;
- }
-}
-
-// ---------------------------------------------------------------------------
-
-ExtendedFontStruct*
-SalDisplay::GetFont( const ExtendedXlfd *pRequestedFont,
- const Size& rPixelSize, sal_Bool bVertical ) const
-{
- // TODO: either get rid of X11 fonts or get rid of the non-hashmapped cache
- if( !m_pFontCache )
- {
- m_pFontCache = new SalFontCache();
- }
- else
- {
- ExtendedFontStruct *pItem;
- for ( size_t i = 0, n = m_pFontCache->size(); i < n; ++i )
- {
- pItem = (*m_pFontCache)[ i ];
- if ( pItem->Match(pRequestedFont, rPixelSize, bVertical) )
- {
- if( i > 0 )
- {
- m_pFontCache->erase( m_pFontCache->begin() + i );
- m_pFontCache->insert( m_pFontCache->begin(), pItem );
- }
- return pItem;
- }
- }
- }
-
- // before we expand the cache, we look for very old and unused items
- if( m_pFontCache->size() >= 64 )
- {
- ExtendedFontStruct *pItem;
- for ( size_t i = m_pFontCache->size(); i > 0; )
- {
- pItem = (*m_pFontCache)[ --i ];
- if( 1 == pItem->GetRefCount() )
- {
- m_pFontCache->erase( m_pFontCache->begin() + i );
- pItem->ReleaseRef();
- if( m_pFontCache->size() < 64 )
- break;
- }
- }
- }
-
- ExtendedFontStruct *pItem = new ExtendedFontStruct( GetDisplay(),
- rPixelSize, bVertical,
- const_cast<ExtendedXlfd*>(pRequestedFont) );
- m_pFontCache->insert( m_pFontCache->begin(), pItem );
- pItem->AddRef();
-
- return pItem;
-}
-
-// ---------------------------------------------------------------------------
-
-void
-SalDisplay::DestroyFontCache()
-{
- if( m_pFontCache )
- {
- for ( size_t i = 0, n = m_pFontCache->size(); i < n; ++i ) {
- delete (*m_pFontCache)[ i ];
- }
- }
- if( mpFontList )
- {
- mpFontList->Dispose();
- delete mpFontList;
- }
- if ( mpFactory )
- {
- delete mpFactory;
- }
-
- m_pFontCache = (SalFontCache*)NULL;
- mpFontList = (XlfdStorage*)NULL;
- mpFactory = (AttributeProvider*)NULL;
-}
-
// ===========================================================================
// PspKernInfo allows on-demand-querying of psprint provided kerning info (#i29881#)
@@ -530,7 +147,7 @@ void PspKernInfo::Initialize() const
// ----------------------------------------------------------------------------
GC
-X11SalGraphics::SelectFont()
+X11SalGraphics::GetFontGC()
{
Display *pDisplay = GetXDisplay();
@@ -541,24 +158,16 @@ X11SalGraphics::SelectFont()
values.fill_rule = EvenOddRule; // Pict import/ Gradient
values.graphics_exposures = False;
values.foreground = nTextPixel_;
-#ifdef _USE_PRINT_EXTENSION_
- values.background = xColormap_->GetWhitePixel();
- pFontGC_ = XCreateGC( pDisplay, hDrawable_,
- GCSubwindowMode | GCFillRule
- | GCGraphicsExposures | GCBackground | GCForeground,
- &values );
-#else
pFontGC_ = XCreateGC( pDisplay, hDrawable_,
GCSubwindowMode | GCFillRule
| GCGraphicsExposures | GCForeground,
&values );
-#endif
}
if( !bFontGC_ )
{
XSetForeground( pDisplay, pFontGC_, nTextPixel_ );
SetClipRegion( pFontGC_ );
- bFontGC_ = TRUE;
+ bFontGC_ = sal_True;
}
return pFontGC_;
@@ -571,8 +180,6 @@ bool X11SalGraphics::setFont( const ImplFontSelectData *pEntry, int nFallbackLev
// release all no longer needed font resources
for( int i = nFallbackLevel; i < MAX_FALLBACK; ++i )
{
- mXFont[i] = NULL; // ->ReleaseRef()
-
if( mpServerFont[i] != NULL )
{
// old server side font is no longer referenced
@@ -591,18 +198,6 @@ bool X11SalGraphics::setFont( const ImplFontSelectData *pEntry, int nFallbackLev
if( !pEntry->mpFontData )
return false;
- // handle the request for a native X11-font
- if( ImplX11FontData::CheckFontData( *pEntry->mpFontData ) )
- {
- const ImplX11FontData* pRequestedFont = static_cast<const ImplX11FontData*>( pEntry->mpFontData );
- const ExtendedXlfd& rX11Font = pRequestedFont->GetExtendedXlfd();
-
- Size aReqSize( pEntry->mnWidth, pEntry->mnHeight );
- mXFont[ nFallbackLevel ] = GetDisplay()->GetFont( &rX11Font, aReqSize, bFontVertical_ );
- bFontGC_ = FALSE;
- return true;
- }
-
// handle the request for a non-native X11-font => use the GlyphCache
ServerFont* pServerFont = GlyphCache::GetInstance().CacheFont( *pEntry );
if( pServerFont != NULL )
@@ -650,83 +245,6 @@ void ImplServerFontEntry::HandleFontOptions( void )
//--------------------------------------------------------------------------
-inline sal_Unicode SwapBytes( const sal_Unicode nIn )
-{
- return ((nIn >> 8) & 0x00ff) | ((nIn & 0x00ff) << 8);
-}
-
-// draw string in a specific multibyte encoding
-static void
-ConvertTextItem16( XTextItem16* pTextItem, rtl_TextEncoding nEncoding )
-{
- if ( (pTextItem == NULL) || (pTextItem->nchars <= 0) )
- return;
-
- SalConverterCache* pCvt = SalConverterCache::GetInstance();
- // convert the string into the font encoding
- sal_Size nSize;
- sal_Size nBufferSize = pTextItem->nchars * 2;
- sal_Char *pBuffer = (sal_Char*)alloca( nBufferSize );
-
- nSize = pCvt->ConvertStringUTF16( (sal_Unicode*)pTextItem->chars, pTextItem->nchars,
- pBuffer, nBufferSize, nEncoding);
-
- sal_Char *pTextChars = (sal_Char*)pTextItem->chars;
- unsigned int n = 0, m = 0;
-
- if ( nEncoding == RTL_TEXTENCODING_GB_2312
- || nEncoding == RTL_TEXTENCODING_GBT_12345
- || nEncoding == RTL_TEXTENCODING_GBK
- || nEncoding == RTL_TEXTENCODING_BIG5 )
- {
- // GB and Big5 needs special treatment since chars can be single or
- // double byte: encoding is
- // [ 0x00 - 0x7f ] | [ 0x81 - 0xfe ] [ 0x40 - 0x7e 0x80 - 0xfe ]
- while ( n < nSize )
- {
- if ( (unsigned char)pBuffer[ n ] < 0x80 )
- {
- pTextChars[ m++ ] = 0x0;
- pTextChars[ m++ ] = pBuffer[ n++ ];
- }
- else
- {
- pTextChars[ m++ ] = pBuffer[ n++ ];
- pTextChars[ m++ ] = pBuffer[ n++ ];
- }
- }
- pTextItem->nchars = m / 2;
- }
- else
- if ( pCvt->IsSingleByteEncoding(nEncoding) )
- {
- // Single Byte encoding has to be padded
- while ( n < nSize )
- {
- pTextChars[ m++ ] = 0x0;
- pTextChars[ m++ ] = pBuffer[ n++ ];
- }
- pTextItem->nchars = nSize;
- }
- else
- {
- while ( n < nSize )
- {
- pTextChars[ m++ ] = pBuffer[ n++ ];
- }
- pTextItem->nchars = nSize / 2;
- }
-
- // XXX FIXME
- if ( (nEncoding == RTL_TEXTENCODING_GB_2312)
- || (nEncoding == RTL_TEXTENCODING_EUC_KR) )
- {
- for (unsigned int n_char = 0; n_char < m; n_char++ )
- pTextChars[ n_char ] &= 0x7F;
- }
-}
-
-//--------------------------------------------------------------------------
namespace {
class CairoWrapper
@@ -993,16 +511,16 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout )
if (const void *pOptions = Application::GetSettings().GetStyleSettings().GetCairoFontOptions())
rCairo.set_font_options( cr, pOptions);
- if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
- {
- for (long i = 0; i < pClipRegion_->numRects; ++i)
+ if( mpClipRegion && !XEmptyRegion( mpClipRegion ) )
{
+ for (long i = 0; i < mpClipRegion->numRects; ++i)
+ {
rCairo.rectangle(cr,
- pClipRegion_->rects[i].x1,
- pClipRegion_->rects[i].y1,
- pClipRegion_->rects[i].x2 - pClipRegion_->rects[i].x1,
- pClipRegion_->rects[i].y2 - pClipRegion_->rects[i].y1);
- }
+ mpClipRegion->rects[i].x1,
+ mpClipRegion->rects[i].y1,
+ mpClipRegion->rects[i].x2 - mpClipRegion->rects[i].x1,
+ mpClipRegion->rects[i].y2 - mpClipRegion->rects[i].y1);
+ }
rCairo.clip(cr);
}
@@ -1091,8 +609,8 @@ void X11SalGraphics::DrawServerAAFontString( const ServerFontLayout& rLayout )
// set clipping
// TODO: move into GetXRenderPicture()?
- if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
- rRenderPeer.SetPictureClipRegion( aDstPic, pClipRegion_ );
+ if( mpClipRegion && !XEmptyRegion( mpClipRegion ) )
+ rRenderPeer.SetPictureClipRegion( aDstPic, mpClipRegion );
ServerFont& rFont = rLayout.GetServerFont();
X11GlyphPeer& rGlyphPeer = X11GlyphCache::GetInstance().GetPeer();
@@ -1175,10 +693,10 @@ bool X11SalGraphics::DrawServerAAForcedString( const ServerFontLayout& rLayout )
else if( m_pVDev )
nWidth = m_pVDev->GetWidth(), nHeight = m_pVDev->GetHeight();
- if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
+ if( mpClipRegion && !XEmptyRegion( mpClipRegion ) )
{
// get bounding box
- XClipBox( pClipRegion_, &aXRect );
+ XClipBox( mpClipRegion, &aXRect );
// clip with window
if( aXRect.x < 0 ) aXRect.x = 0;
@@ -1271,7 +789,7 @@ bool X11SalGraphics::DrawServerAAForcedString( const ServerFontLayout& rLayout )
}
// prepare context
- GC nGC = SelectFont();
+ GC nGC = GetFontGC();
XGCValues aGCVal;
XGetGCValues( pDisplay, nGC, GCForeground, &aGCVal );
@@ -1358,7 +876,7 @@ void X11SalGraphics::DrawServerSimpleFontString( const ServerFontLayout& rSalLay
X11GlyphPeer& rGlyphPeer = X11GlyphCache::GetInstance().GetPeer();
Display* pDisplay = GetXDisplay();
- GC nGC = SelectFont();
+ GC nGC = GetFontGC();
XGCValues aGCVal;
aGCVal.fill_style = FillStippled;
@@ -1421,71 +939,13 @@ void X11SalGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout )
//--------------------------------------------------------------------------
-void X11SalGraphics::DrawStringUCS2MB( ExtendedFontStruct& rFont,
- const Point& rPoint, const sal_Unicode* pStr, int nLength )
+const ImplFontCharMap* X11SalGraphics::GetImplFontCharMap() const
{
- Display* pDisplay = GetXDisplay();
- GC nGC = SelectFont();
-
- if( rFont.GetAsciiEncoding() == RTL_TEXTENCODING_UNICODE )
- {
- // plain Unicode, can handle all chars and can be handled straight forward
- XFontStruct* pFontStruct = rFont.GetFontStruct( RTL_TEXTENCODING_UNICODE );
- if( !pFontStruct )
- return;
-
- XSetFont( pDisplay, nGC, pFontStruct->fid );
-
- #ifdef OSL_LITENDIAN
- sal_Unicode *pBuffer = (sal_Unicode*)alloca( nLength * sizeof(sal_Unicode) );
- for ( int i = 0; i < nLength; i++ )
- pBuffer[ i ] = SwapBytes(pStr[ i ]) ;
- #else
- sal_Unicode *pBuffer = const_cast<sal_Unicode*>(pStr);
- #endif
-
- XDrawString16( pDisplay, hDrawable_, nGC, rPoint.X(), rPoint.Y(), (XChar2b*)pBuffer, nLength );
- }
- else
- {
- XTextItem16 *pTextItem = (XTextItem16*)alloca( nLength * sizeof(XTextItem16) );
- XChar2b *pMBChar = (XChar2b*)pStr;
- int nItem = 0;
-
- DBG_ASSERT( nLength<=1, "#i49902# DrawStringUCS2MB with nLength>1 => problems with XOrg6.8.[0123]");
-
- for( int nChar = 0; nChar < nLength; ++nChar )
- {
- rtl_TextEncoding nEnc;
- XFontStruct* pFontStruct = rFont.GetFontStruct( pStr[nChar], &nEnc );
- if( !pFontStruct )
- continue;
-
- pTextItem[ nItem ].chars = pMBChar + nChar;
- pTextItem[ nItem ].delta = 0;
- pTextItem[ nItem ].font = pFontStruct->fid;
- pTextItem[ nItem ].nchars = 1;
-
- ConvertTextItem16( &pTextItem[ nItem ], nEnc );
- ++nItem;
- }
-
- XDrawText16( pDisplay, hDrawable_, nGC, rPoint.X(), rPoint.Y(), pTextItem, nItem );
- }
-}
-
-//--------------------------------------------------------------------------
-
-ImplFontCharMap* X11SalGraphics::GetImplFontCharMap() const
-{
- // TODO: get ImplFontCharMap directly from fonts
if( !mpServerFont[0] )
return NULL;
- CmapResult aCmapResult;
- if( !mpServerFont[0]->GetFontCodeRanges( aCmapResult ) )
- return NULL;
- return new ImplFontCharMap( aCmapResult );
+ const ImplFontCharMap* pIFCMap = mpServerFont[0]->GetImplFontCharMap();
+ return pIFCMap;
}
bool X11SalGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rGetImplFontCapabilities) const
@@ -1501,9 +961,9 @@ bool X11SalGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rGetImplFont
//
// ----------------------------------------------------------------------------
-USHORT X11SalGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel )
+sal_uInt16 X11SalGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel )
{
- USHORT nRetVal = 0;
+ sal_uInt16 nRetVal = 0;
if( !setFont( pEntry, nFallbackLevel ) )
nRetVal |= SAL_SETFONT_BADFONT;
if( bPrinter_ || (mpServerFont[ nFallbackLevel ] != NULL) )
@@ -1520,7 +980,7 @@ X11SalGraphics::SetTextColor( SalColor nSalColor )
{
nTextColor_ = nSalColor;
nTextPixel_ = GetPixel( nSalColor );
- bFontGC_ = FALSE;
+ bFontGC_ = sal_False;
}
}
@@ -1567,15 +1027,6 @@ void RegisterFontSubstitutors( ImplDevFontList* );
void X11SalGraphics::GetDevFontList( ImplDevFontList *pList )
{
- // allow disabling of native X11 fonts
- static const char* pEnableX11FontStr = getenv( "SAL_ENABLE_NATIVE_XFONTS" );
- if( pEnableX11FontStr && (pEnableX11FontStr[0] != '0') )
- {
- // announce X11 fonts
- XlfdStorage* pX11FontList = GetDisplay()->GetXlfdList();
- pX11FontList->AnnounceFonts( pList );
- }
-
// prepare the GlyphCache using psprint's font infos
X11GlyphCache& rGC = X11GlyphCache::GetInstance();
@@ -1756,25 +1207,19 @@ X11SalGraphics::GetFontMetric( ImplFontMetricData *pMetric, int nFallbackLevel )
long rDummyFactor;
mpServerFont[nFallbackLevel]->FetchFontMetric( *pMetric, rDummyFactor );
}
- else if( mXFont[nFallbackLevel] != NULL )
- {
- mXFont[nFallbackLevel]->ToImplFontMetricData( pMetric );
- if ( bFontVertical_ )
- pMetric->mnOrientation = 0;
- }
}
// ---------------------------------------------------------------------------
-ULONG
-X11SalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData *pKernPairs )
+sal_uLong
+X11SalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPairs )
{
if( ! bPrinter_ )
{
if( mpServerFont[0] != NULL )
{
ImplKernPairData* pTmpKernPairs;
- ULONG nGotPairs = mpServerFont[0]->GetKernPairs( &pTmpKernPairs );
+ sal_uLong nGotPairs = mpServerFont[0]->GetKernPairs( &pTmpKernPairs );
for( unsigned int i = 0; i < nPairs && i < nGotPairs; ++i )
pKernPairs[ i ] = pTmpKernPairs[ i ];
delete[] pTmpKernPairs;
@@ -1786,40 +1231,40 @@ X11SalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData *pKernPairs )
// ---------------------------------------------------------------------------
-BOOL X11SalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
+sal_Bool X11SalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
if( nLevel >= MAX_FALLBACK )
- return FALSE;
+ return sal_False;
ServerFont* pSF = mpServerFont[ nLevel ];
if( !pSF )
- return FALSE;
+ return sal_False;
nGlyphIndex &= ~GF_FONTMASK;
const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex );
rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() );
- return TRUE;
+ return sal_True;
}
// ---------------------------------------------------------------------------
-BOOL X11SalGraphics::GetGlyphOutline( long nGlyphIndex,
+sal_Bool X11SalGraphics::GetGlyphOutline( long nGlyphIndex,
::basegfx::B2DPolyPolygon& rPolyPoly )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
if( nLevel >= MAX_FALLBACK )
- return FALSE;
+ return sal_False;
ServerFont* pSF = mpServerFont[ nLevel ];
if( !pSF )
- return FALSE;
+ return sal_False;
nGlyphIndex &= ~GF_FONTMASK;
if( pSF->GetGlyphOutline( nGlyphIndex, rPolyPoly ) )
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
}
//--------------------------------------------------------------------------
@@ -1842,10 +1287,6 @@ SalLayout* X11SalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLe
#endif
pLayout = new ServerFontLayout( *mpServerFont[ nFallbackLevel ] );
}
- else if( mXFont[ nFallbackLevel ] )
- pLayout = new X11FontLayout( *mXFont[ nFallbackLevel ] );
- else
- pLayout = NULL;
return pLayout;
}
@@ -1877,7 +1318,7 @@ SystemFontData X11SalGraphics::GetSysFontData( int nFallbacklevel ) const
//--------------------------------------------------------------------------
-BOOL X11SalGraphics::CreateFontSubset(
+sal_Bool X11SalGraphics::CreateFontSubset(
const rtl::OUString& rToFile,
const ImplFontData* pFont,
sal_Int32* pGlyphIDs,
@@ -1909,7 +1350,6 @@ BOOL X11SalGraphics::CreateFontSubset(
const void* X11SalGraphics::GetEmbedFontData( const ImplFontData* pFont, const sal_Ucs* pUnicodes, sal_Int32* pWidths, FontSubsetInfo& rInfo, long* pDataLen )
{
-#ifndef _USE_PRINT_EXTENSION_
// in this context the pFont->GetFontId() is a valid PSP
// font since they are the only ones left after the PDF
// export has filtered its list of subsettable fonts (for
@@ -1917,25 +1357,19 @@ const void* X11SalGraphics::GetEmbedFontData( const ImplFontData* pFont, const s
// be to have the GlyphCache search for the ImplFontData pFont
psp::fontID aFont = pFont->GetFontId();
return PspGraphics::DoGetEmbedFontData( aFont, pUnicodes, pWidths, rInfo, pDataLen );
-#else
- return NULL;
-#endif
}
//--------------------------------------------------------------------------
void X11SalGraphics::FreeEmbedFontData( const void* pData, long nLen )
{
-#ifndef _USE_PRINT_EXTENSION_
PspGraphics::DoFreeEmbedFontData( pData, nLen );
-#endif
}
//--------------------------------------------------------------------------
const Ucs2SIntMap* X11SalGraphics::GetFontEncodingVector( const ImplFontData* pFont, const Ucs2OStrMap** pNonEncoded )
{
-#ifndef _USE_PRINT_EXTENSION_
// in this context the pFont->GetFontId() is a valid PSP
// font since they are the only ones left after the PDF
// export has filtered its list of subsettable fonts (for
@@ -1943,9 +1377,6 @@ const Ucs2SIntMap* X11SalGraphics::GetFontEncodingVector( const ImplFontData* pF
// be to have the GlyphCache search for the ImplFontData pFont
psp::fontID aFont = pFont->GetFontId();
return PspGraphics::DoGetFontEncodingVector( aFont, pNonEncoded );
-#else
- return NULL;
-#endif
}
//--------------------------------------------------------------------------
diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx
index 6f94b5d90018..9951367d2e70 100644
--- a/vcl/unx/source/gdi/salprnpsp.cxx
+++ b/vcl/unx/source/gdi/salprnpsp.cxx
@@ -55,6 +55,8 @@
#include "vcl/svapp.hxx"
#include "vcl/jobset.h"
#include "vcl/print.h"
+#include "vcl/print.hxx"
+#include "vcl/pdfwriter.hxx"
#include "vcl/salptype.hxx"
#include "vcl/printerinfomanager.hxx"
@@ -62,7 +64,10 @@
#include "osl/module.h"
+#include <com/sun/star/beans/PropertyValue.hpp>
+
using namespace psp;
+using namespace com::sun::star;
using ::rtl::OUString;
using ::rtl::OUStringHash;
@@ -214,7 +219,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
if( rData.getStreamBuffer( pBuffer, nBytes ) )
{
pJobSetup->mnDriverDataLen = nBytes;
- pJobSetup->mpDriverData = (BYTE*)pBuffer;
+ pJobSetup->mpDriverData = (sal_uInt8*)pBuffer;
}
else
{
@@ -589,15 +594,15 @@ void PspSalInfoPrinter::ReleaseGraphics( SalGraphics* pGraphics )
// -----------------------------------------------------------------------
-BOOL PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup )
+sal_Bool PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup )
{
if( ! pFrame || ! pJobSetup )
- return FALSE;
+ return sal_False;
getPaLib();
if( ! pSetupFunction )
- return FALSE;
+ return sal_False;
PrinterInfoManager& rManager = PrinterInfoManager::get();
@@ -617,14 +622,14 @@ BOOL PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup )
void* pBuffer = NULL;
aInfo.getStreamBuffer( pBuffer, nBytes );
pJobSetup->mnDriverDataLen = nBytes;
- pJobSetup->mpDriverData = (BYTE*)pBuffer;
+ pJobSetup->mpDriverData = (sal_uInt8*)pBuffer;
// copy everything to job setup
copyJobDataToJobSetup( pJobSetup, aInfo );
JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, m_aJobData );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -634,7 +639,7 @@ BOOL PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup )
// data should be merged into the driver data
// If pJobSetup->mpDriverData IS NULL, then the driver defaults
// should be merged into the independent data
-BOOL PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup )
+sal_Bool PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup )
{
// set/clear backwards compatibility flag
bool bStrictSO52Compatibility = false;
@@ -653,7 +658,7 @@ BOOL PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup )
copyJobDataToJobSetup( pJobSetup, m_aJobData );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -662,8 +667,8 @@ BOOL PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup )
// and sets the new independ data in pJobSetup
// Only the data must be changed, where the bit
// in nGetDataFlags is set
-BOOL PspSalInfoPrinter::SetData(
- ULONG nSetDataFlags,
+sal_Bool PspSalInfoPrinter::SetData(
+ sal_uLong nSetDataFlags,
ImplJobSetup* pJobSetup )
{
JobData aData;
@@ -701,7 +706,7 @@ BOOL PspSalInfoPrinter::SetData(
}
if( ! ( pKey && pValue && aData.m_aContext.setValue( pKey, pValue, false ) == pValue ) )
- return FALSE;
+ return sal_False;
}
// merge paperbin if necessary
@@ -761,10 +766,10 @@ BOOL PspSalInfoPrinter::SetData(
m_aJobData = aData;
copyJobDataToJobSetup( pJobSetup, aData );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -813,7 +818,7 @@ void PspSalInfoPrinter::GetPageInfo(
// -----------------------------------------------------------------------
-ULONG PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup )
+sal_uLong PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup )
{
if( ! pJobSetup )
return 0;
@@ -827,7 +832,7 @@ ULONG PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup )
// -----------------------------------------------------------------------
-String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, ULONG nPaperBin )
+String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, sal_uLong nPaperBin )
{
JobData aData;
JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
@@ -836,7 +841,7 @@ String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, ULONG
if( aData.m_pParser )
{
const PPDKey* pKey = aData.m_pParser ? aData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) ): NULL;
- if( ! pKey || nPaperBin >= (ULONG)pKey->countValues() )
+ if( ! pKey || nPaperBin >= (sal_uLong)pKey->countValues() )
aRet = aData.m_pParser->getDefaultInputSlot();
else
{
@@ -851,7 +856,7 @@ String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, ULONG
// -----------------------------------------------------------------------
-ULONG PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, USHORT nType )
+sal_uLong PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal_uInt16 nType )
{
switch( nType )
{
@@ -885,9 +890,26 @@ ULONG PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, USHORT
case PRINTER_CAPABILITIES_FAX:
return PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "fax" ) ? 1 : 0;
case PRINTER_CAPABILITIES_PDF:
- return PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "pdf" ) ? 1 : 0;
+ if( PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "pdf" ) )
+ return 1;
+ else
+ {
+ // see if the PPD contains a value to set Collate to True
+ JobData aData = PrinterInfoManager::get().getPrinterInfo( pJobSetup->maPrinterName );
+ if( pJobSetup->mpDriverData )
+ JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
+ return aData.m_nPDFDevice > 0 ? 1 : 0;
+ }
case PRINTER_CAPABILITIES_EXTERNALDIALOG:
return PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "external_dialog" ) ? 1 : 0;
+ case PRINTER_CAPABILITIES_USEPULLMODEL:
+ {
+ // see if the PPD contains a value to set Collate to True
+ JobData aData = PrinterInfoManager::get().getPrinterInfo( pJobSetup->maPrinterName );
+ if( pJobSetup->mpDriverData )
+ JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
+ return aData.m_nPDFDevice > 0 ? 1 : 0;
+ }
default: break;
};
return 0;
@@ -903,6 +925,7 @@ ULONG PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, USHORT
: m_bFax( false ),
m_bPdf( false ),
m_bSwallowFaxNo( false ),
+ m_bIsPDFWriterJob( false ),
m_pGraphics( NULL ),
m_nCopies( 1 ),
m_bCollate( false ),
@@ -927,11 +950,11 @@ static String getTmpName()
return aSys;
}
-BOOL PspSalPrinter::StartJob(
+sal_Bool PspSalPrinter::StartJob(
const XubString* pFileName,
const XubString& rJobName,
const XubString& rAppName,
- ULONG nCopies,
+ sal_uLong nCopies,
bool bCollate,
bool bDirect,
ImplJobSetup* pJobSetup )
@@ -1007,29 +1030,35 @@ BOOL PspSalPrinter::StartJob(
}
m_aPrinterGfx.setStrictSO52Compatibility( bStrictSO52Compatibility );
- return m_aPrintJob.StartJob( m_aTmpFile.Len() ? m_aTmpFile : m_aFileName, nMode, rJobName, rAppName, m_aJobData, &m_aPrinterGfx, bDirect ) ? TRUE : FALSE;
+ return m_aPrintJob.StartJob( m_aTmpFile.Len() ? m_aTmpFile : m_aFileName, nMode, rJobName, rAppName, m_aJobData, &m_aPrinterGfx, bDirect ) ? sal_True : sal_False;
}
// -----------------------------------------------------------------------
-BOOL PspSalPrinter::EndJob()
+sal_Bool PspSalPrinter::EndJob()
{
- BOOL bSuccess = m_aPrintJob.EndJob();
-
- if( bSuccess )
+ sal_Bool bSuccess = sal_False;
+ if( m_bIsPDFWriterJob )
+ bSuccess = sal_True;
+ else
{
- // check for fax
- if( m_bFax )
- {
+ bSuccess = m_aPrintJob.EndJob();
- const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
- // sendAFax removes the file after use
- bSuccess = sendAFax( m_aFaxNr, m_aTmpFile, rInfo.m_aCommand );
- }
- else if( m_bPdf )
+ if( bSuccess )
{
- const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
- bSuccess = createPdf( m_aFileName, m_aTmpFile, rInfo.m_aCommand );
+ // check for fax
+ if( m_bFax )
+ {
+
+ const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
+ // sendAFax removes the file after use
+ bSuccess = sendAFax( m_aFaxNr, m_aTmpFile, rInfo.m_aCommand );
+ }
+ else if( m_bPdf )
+ {
+ const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
+ bSuccess = createPdf( m_aFileName, m_aTmpFile, rInfo.m_aCommand );
+ }
}
}
GetSalData()->m_pInstance->jobEndedPrinterUpdate();
@@ -1038,16 +1067,16 @@ BOOL PspSalPrinter::EndJob()
// -----------------------------------------------------------------------
-BOOL PspSalPrinter::AbortJob()
+sal_Bool PspSalPrinter::AbortJob()
{
- BOOL bAbort = m_aPrintJob.AbortJob() ? TRUE : FALSE;
+ sal_Bool bAbort = m_aPrintJob.AbortJob() ? sal_True : sal_False;
GetSalData()->m_pInstance->jobEndedPrinterUpdate();
return bAbort;
}
// -----------------------------------------------------------------------
-SalGraphics* PspSalPrinter::StartPage( ImplJobSetup* pJobSetup, BOOL )
+SalGraphics* PspSalPrinter::StartPage( ImplJobSetup* pJobSetup, sal_Bool )
{
JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, m_aJobData );
m_pGraphics = new PspGraphics( &m_aJobData, &m_aPrinterGfx, m_bFax ? &m_aFaxNr : NULL, m_bSwallowFaxNo, m_pInfoPrinter );
@@ -1068,20 +1097,286 @@ SalGraphics* PspSalPrinter::StartPage( ImplJobSetup* pJobSetup, BOOL )
// -----------------------------------------------------------------------
-BOOL PspSalPrinter::EndPage()
+sal_Bool PspSalPrinter::EndPage()
{
sal_Bool bResult = m_aPrintJob.EndPage();
m_aPrinterGfx.Clear();
- return bResult ? TRUE : FALSE;
+ return bResult ? sal_True : sal_False;
}
// -----------------------------------------------------------------------
-ULONG PspSalPrinter::GetErrorCode()
+sal_uLong PspSalPrinter::GetErrorCode()
{
return 0;
}
+// -----------------------------------------------------------------------
+
+struct PDFNewJobParameters
+{
+ Size maPageSize;
+ sal_uInt16 mnPaperBin;
+
+ PDFNewJobParameters( const Size& i_rSize = Size(),
+ sal_uInt16 i_nPaperBin = 0xffff )
+ : maPageSize( i_rSize ), mnPaperBin( i_nPaperBin ) {}
+
+ bool operator!=(const PDFNewJobParameters& rComp ) const
+ {
+ Size aCompLSSize( rComp.maPageSize.Height(), rComp.maPageSize.Width() );
+ return
+ (maPageSize != rComp.maPageSize && maPageSize != aCompLSSize)
+ || mnPaperBin != rComp.mnPaperBin
+ ;
+ }
+
+ bool operator==(const PDFNewJobParameters& rComp) const
+ {
+ return ! this->operator!=(rComp);
+ }
+};
+
+struct PDFPrintFile
+{
+ rtl::OUString maTmpURL;
+ PDFNewJobParameters maParameters;
+
+ PDFPrintFile( const rtl::OUString& i_rURL, const PDFNewJobParameters& i_rNewParameters )
+ : maTmpURL( i_rURL )
+ , maParameters( i_rNewParameters ) {}
+};
+
+sal_Bool PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobName, const String& i_rAppName,
+ ImplJobSetup* i_pSetupData, vcl::PrinterController& i_rController )
+{
+ OSL_TRACE( "StartJob with controller: pFilename = %s", i_pFileName ? rtl::OUStringToOString( *i_pFileName, RTL_TEXTENCODING_UTF8 ).getStr() : "<nil>" );
+ // mark for endjob
+ m_bIsPDFWriterJob = true;
+ // reset IsLastPage
+ i_rController.setLastPage( sal_False );
+
+ // update job data
+ if( i_pSetupData )
+ JobData::constructFromStreamBuffer( i_pSetupData->mpDriverData, i_pSetupData->mnDriverDataLen, m_aJobData );
+
+ OSL_ASSERT( m_aJobData.m_nPDFDevice > 0 );
+ m_aJobData.m_nPDFDevice = 1;
+
+ // possibly create one job for collated output
+ sal_Bool bSinglePrintJobs = sal_False;
+ beans::PropertyValue* pSingleValue = i_rController.getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintCollateAsSingleJobs" ) ) );
+ if( pSingleValue )
+ {
+ pSingleValue->Value >>= bSinglePrintJobs;
+ }
+
+ int nCopies = i_rController.getPrinter()->GetCopyCount();
+ bool bCollate = i_rController.getPrinter()->IsCollateCopy();
+
+ // notify start of real print job
+ i_rController.jobStarted();
+
+ // setup PDFWriter context
+ vcl::PDFWriter::PDFWriterContext aContext;
+ aContext.Version = vcl::PDFWriter::PDF_1_4;
+ aContext.Tagged = false;
+ aContext.EmbedStandardFonts = true;
+ aContext.DocumentLocale = Application::GetSettings().GetLocale();
+ aContext.ColorMode = i_rController.getPrinter()->GetPrinterOptions().IsConvertToGreyscales()
+ ? vcl::PDFWriter::DrawGreyscale : vcl::PDFWriter::DrawColor;
+
+ // prepare doc info
+ aContext.DocumentInfo.Title = i_rJobName;
+ aContext.DocumentInfo.Creator = i_rAppName;
+ aContext.DocumentInfo.Producer = i_rAppName;
+
+ // define how we handle metafiles in PDFWriter
+ vcl::PDFWriter::PlayMetafileContext aMtfContext;
+ aMtfContext.m_bOnlyLosslessCompression = true;
+
+ boost::shared_ptr<vcl::PDFWriter> pWriter;
+ std::vector< PDFPrintFile > aPDFFiles;
+ boost::shared_ptr<Printer> pPrinter( i_rController.getPrinter() );
+ int nAllPages = i_rController.getFilteredPageCount();
+ i_rController.createProgressDialog();
+ bool bAborted = false;
+ PDFNewJobParameters aLastParm;
+
+ aContext.DPIx = pPrinter->ImplGetDPIX();
+ aContext.DPIy = pPrinter->ImplGetDPIY();
+ for( int nPage = 0; nPage < nAllPages && ! bAborted; nPage++ )
+ {
+ if( nPage == nAllPages-1 )
+ i_rController.setLastPage( sal_True );
+
+ // get the page's metafile
+ GDIMetaFile aPageFile;
+ vcl::PrinterController::PageSize aPageSize = i_rController.getFilteredPageFile( nPage, aPageFile );
+ if( i_rController.isProgressCanceled() )
+ {
+ bAborted = true;
+ if( nPage != nAllPages-1 )
+ {
+ i_rController.createProgressDialog();
+ i_rController.setLastPage( sal_True );
+ i_rController.getFilteredPageFile( nPage, aPageFile );
+ }
+ }
+ else
+ {
+ pPrinter->SetMapMode( MapMode( MAP_100TH_MM ) );
+ pPrinter->SetPaperSizeUser( aPageSize.aSize, true );
+ PDFNewJobParameters aNewParm( pPrinter->GetPaperSize(), pPrinter->GetPaperBin() );
+
+ // create PDF writer on demand
+ // either on first page
+ // or on paper format change - cups does not support multiple paper formats per job (yet?)
+ // so we need to start a new job to get a new paper format from the printer
+ // orientation switches (that is switch of height and width) is handled transparently by CUPS
+ if( ! pWriter ||
+ (aNewParm != aLastParm && ! i_pFileName ) )
+ {
+ if( pWriter )
+ {
+ pWriter->Emit();
+ }
+ // produce PDF file
+ OUString aPDFUrl;
+ if( i_pFileName )
+ aPDFUrl = *i_pFileName;
+ else
+ osl_createTempFile( NULL, NULL, &aPDFUrl.pData );
+ // normalize to file URL
+ if( aPDFUrl.compareToAscii( "file:", 5 ) != 0 )
+ {
+ // this is not a file URL, but it should
+ // form it into a osl friendly file URL
+ rtl::OUString aTmp;
+ osl_getFileURLFromSystemPath( aPDFUrl.pData, &aTmp.pData );
+ aPDFUrl = aTmp;
+ }
+ // save current file and paper format
+ aLastParm = aNewParm;
+ aPDFFiles.push_back( PDFPrintFile( aPDFUrl, aNewParm ) );
+ // update context
+ aContext.URL = aPDFUrl;
+
+ // create and initialize PDFWriter
+ #if defined __SUNPRO_CC
+ #pragma disable_warn
+ #endif
+ pWriter.reset( new vcl::PDFWriter( aContext, uno::Reference< beans::XMaterialHolder >() ) );
+ #if defined __SUNPRO_CC
+ #pragma enable_warn
+ #endif
+ }
+
+ pWriter->NewPage( TenMuToPt( aNewParm.maPageSize.Width() ),
+ TenMuToPt( aNewParm.maPageSize.Height() ),
+ vcl::PDFWriter::Portrait );
+
+ pWriter->PlayMetafile( aPageFile, aMtfContext, NULL );
+ }
+ }
+
+ // emit the last file
+ if( pWriter )
+ pWriter->Emit();
+
+ // handle collate, copy count and multiple jobs correctly
+ int nOuterJobs = 1;
+ if( bSinglePrintJobs )
+ {
+ nOuterJobs = nCopies;
+ m_aJobData.m_nCopies = 1;
+ }
+ else
+ {
+ if( bCollate )
+ {
+ if( aPDFFiles.size() == 1 && pPrinter->HasSupport( SUPPORT_COLLATECOPY ) )
+ {
+ m_aJobData.setCollate( true );
+ m_aJobData.m_nCopies = nCopies;
+ }
+ else
+ {
+ nOuterJobs = nCopies;
+ m_aJobData.m_nCopies = 1;
+ }
+ }
+ else
+ {
+ m_aJobData.setCollate( false );
+ m_aJobData.m_nCopies = nCopies;
+ }
+ }
+
+ // spool files
+ if( ! i_pFileName && ! bAborted )
+ {
+ bool bFirstJob = true;
+ for( int nCurJob = 0; nCurJob < nOuterJobs; nCurJob++ )
+ {
+ for( size_t i = 0; i < aPDFFiles.size(); i++ )
+ {
+ oslFileHandle pFile = NULL;
+ osl_openFile( aPDFFiles[i].maTmpURL.pData, &pFile, osl_File_OpenFlag_Read );
+ if( pFile )
+ {
+ osl_setFilePos( pFile, osl_Pos_Absolut, 0 );
+ std::vector< char > buffer( 0x10000, 0 );
+ // update job data with current page size
+ Size aPageSize( aPDFFiles[i].maParameters.maPageSize );
+ m_aJobData.setPaper( TenMuToPt( aPageSize.Width() ), TenMuToPt( aPageSize.Height() ) );
+ // update job data with current paperbin
+ m_aJobData.setPaperBin( aPDFFiles[i].maParameters.mnPaperBin );
+
+ // spool current file
+ FILE* fp = PrinterInfoManager::get().startSpool( pPrinter->GetName(), i_rController.isDirectPrint() );
+ if( fp )
+ {
+ sal_uInt64 nBytesRead = 0;
+ do
+ {
+ osl_readFile( pFile, &buffer[0], buffer.size(), &nBytesRead );
+ if( nBytesRead > 0 )
+ fwrite( &buffer[0], 1, nBytesRead, fp );
+ } while( nBytesRead == buffer.size() );
+ rtl::OUStringBuffer aBuf( i_rJobName.Len() + 8 );
+ aBuf.append( i_rJobName );
+ if( i > 0 || nCurJob > 0 )
+ {
+ aBuf.append( sal_Unicode(' ') );
+ aBuf.append( sal_Int32( i + nCurJob * aPDFFiles.size() ) );
+ }
+ PrinterInfoManager::get().endSpool( pPrinter->GetName(), aBuf.makeStringAndClear(), fp, m_aJobData, bFirstJob );
+ bFirstJob = false;
+ }
+ }
+ osl_closeFile( pFile );
+ }
+ }
+ }
+
+ // job has been spooled
+ i_rController.setJobState( bAborted ? view::PrintableState_JOB_ABORTED : view::PrintableState_JOB_SPOOLED );
+
+ // clean up the temporary PDF files
+ if( ! i_pFileName || bAborted )
+ {
+ for( size_t i = 0; i < aPDFFiles.size(); i++ )
+ {
+ osl_removeFile( aPDFFiles[i].maTmpURL.pData );
+ OSL_TRACE( "removed print PDF file %s\n", rtl::OUStringToOString( aPDFFiles[i].maTmpURL, RTL_TEXTENCODING_UTF8 ).getStr() );
+ }
+ }
+
+ return sal_True;
+}
+
+
namespace x11
{
class PrinterUpdate
diff --git a/vcl/unx/source/gdi/salvd.cxx b/vcl/unx/source/gdi/salvd.cxx
index ce8421f14f49..c6797cc6418c 100644
--- a/vcl/unx/source/gdi/salvd.cxx
+++ b/vcl/unx/source/gdi/salvd.cxx
@@ -45,7 +45,7 @@
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
SalVirtualDevice* X11SalInstance::CreateVirtualDevice( SalGraphics* pGraphics,
long nDX, long nDY,
- USHORT nBitCount, const SystemGraphicsData *pData )
+ sal_uInt16 nBitCount, const SystemGraphicsData *pData )
{
X11SalVirtualDevice *pVDev = new X11SalVirtualDevice();
if( !nBitCount && pGraphics )
@@ -127,14 +127,14 @@ void X11SalGraphics::Init( X11SalVirtualDevice *pDevice, SalColormap* pColormap,
m_pFrame = NULL;
bWindow_ = pDisplay->IsDisplay();
- bVirDev_ = TRUE;
+ bVirDev_ = sal_True;
}
// -=-= SalVirDevData / SalVirtualDevice -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-BOOL X11SalVirtualDevice::Init( SalDisplay *pDisplay,
+sal_Bool X11SalVirtualDevice::Init( SalDisplay *pDisplay,
long nDX, long nDY,
- USHORT nBitCount,
+ sal_uInt16 nBitCount,
int nScreen,
Pixmap hDrawable,
XRenderPictFormat* pXRenderFormat )
@@ -171,12 +171,12 @@ BOOL X11SalVirtualDevice::Init( SalDisplay *pDisplay,
else
{
hDrawable_ = hDrawable;
- bExternPixmap_ = TRUE;
+ bExternPixmap_ = sal_True;
}
pGraphics_->Init( this, pColormap, bDeleteColormap );
- return hDrawable_ != None ? TRUE : FALSE;
+ return hDrawable_ != None ? sal_True : sal_False;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -188,8 +188,8 @@ X11SalVirtualDevice::X11SalVirtualDevice()
nDX_ = 0;
nDY_ = 0;
nDepth_ = 0;
- bGraphics_ = FALSE;
- bExternPixmap_ = FALSE;
+ bGraphics_ = sal_False;
+ bExternPixmap_ = sal_False;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -209,18 +209,18 @@ SalGraphics* X11SalVirtualDevice::GetGraphics()
return NULL;
if( pGraphics_ )
- bGraphics_ = TRUE;
+ bGraphics_ = sal_True;
return pGraphics_;
}
void X11SalVirtualDevice::ReleaseGraphics( SalGraphics* )
-{ bGraphics_ = FALSE; }
+{ bGraphics_ = sal_False; }
-BOOL X11SalVirtualDevice::SetSize( long nDX, long nDY )
+sal_Bool X11SalVirtualDevice::SetSize( long nDX, long nDY )
{
if( bExternPixmap_ )
- return FALSE;
+ return sal_False;
// #144688#
// the X protocol request CreatePixmap puts an upper bound
@@ -230,7 +230,7 @@ BOOL X11SalVirtualDevice::SetSize( long nDX, long nDY )
// 16 bit truncation here without noticing.
if( nDX < 0 || nDX > 65535 ||
nDY < 0 || nDY > 65535 )
- return FALSE;
+ return sal_False;
if( !nDX ) nDX = 1;
if( !nDY ) nDY = 1;
@@ -249,7 +249,7 @@ BOOL X11SalVirtualDevice::SetSize( long nDX, long nDY )
nDX_ = 1;
nDY_ = 1;
}
- return FALSE;
+ return sal_False;
}
if( GetDrawable() )
@@ -262,7 +262,7 @@ BOOL X11SalVirtualDevice::SetSize( long nDX, long nDY )
if( pGraphics_ )
InitGraphics( this );
- return TRUE;
+ return sal_True;
}
void X11SalVirtualDevice::GetSize( long& rWidth, long& rHeight )
diff --git a/vcl/unx/source/gdi/xfont.cxx b/vcl/unx/source/gdi/xfont.cxx
deleted file mode 100644
index 0408a4ab7511..000000000000
--- a/vcl/unx/source/gdi/xfont.cxx
+++ /dev/null
@@ -1,763 +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_vcl.hxx"
-
-#include <salunx.h>
-#include "xfont.hxx"
-#include "xlfd_extd.hxx"
-#include "salcvt.hxx"
-#include <tools/string.hxx>
-#include <vcl/outfont.hxx>
-#include <saldisp.hxx>
-#include <salgdi.h>
-
-// for GetMirroredChar
-#include <vcl/svapp.hxx>
-
-#if OSL_DEBUG_LEVEL > 1
-#include <cstdio>
-#endif
-
-#include <algorithm>
-
-#define VCLASS_ROTATE 0
-#define VCLASS_ROTATE_REVERSE 1
-#define VCLASS_TRANSFORM1 2
-#define VCLASS_TRANSFORM2 3
-#define VCLASS_CJK 4
-#define VCLASS_DONTKNOW 5
-#define VCLASS_FONT_NUM 2 // Other than rotate and rotate_reverse,
- // don't have spacial font
-
-// Select the max size of a font, which is token for real
-// This routine is (and should be) called only once, the result should be
-// stored in some static variable
-
-static int GetMaxFontHeight()
-{
- static int nMaxFontHeight = 0;
- if( nMaxFontHeight <= 0 )
- {
- const char *pFontHeight = getenv ("SAL_MAXFONTHEIGHT");
- if( pFontHeight )
- nMaxFontHeight = atoi( pFontHeight );
- static const int DEFAULT_MAXFONTHEIGHT = 250;
- if (nMaxFontHeight <= 20)
- nMaxFontHeight = DEFAULT_MAXFONTHEIGHT;
- }
-
- return nMaxFontHeight;
-}
-
-
-ExtendedFontStruct::ExtendedFontStruct( Display* pDisplay, const Size& rPixelSize,
- sal_Bool bVertical, ExtendedXlfd* pXlfd ) :
- mpDisplay( pDisplay ),
- maPixelSize( rPixelSize ),
- mfXScale(1.0), mfYScale(1.0),
- mbVertical( bVertical ),
- mnCachedEncoding( RTL_TEXTENCODING_DONTKNOW ),
- mpXlfd( pXlfd ),
- mpRangeCodes(NULL),
- mnRangeCount(-1)
-{
- if( !maPixelSize.Width() )
- maPixelSize.Width() = maPixelSize.Height();
- mnAsciiEncoding = GetAsciiEncoding (NULL);
- mnDefaultWidth = GetDefaultWidth();
-
- mpXFontStruct = (XFontStruct**)calloc( mpXlfd->NumEncodings(),
- sizeof(XFontStruct*) );
-}
-
-ExtendedFontStruct::~ExtendedFontStruct()
-{
- delete[] mpRangeCodes;
-
- for ( int nIdx = 0; nIdx < mpXlfd->NumEncodings(); nIdx++ )
- if ( mpXFontStruct[nIdx] != NULL )
- XFreeFont( mpDisplay, mpXFontStruct[nIdx] );
-
- free(mpXFontStruct);
-}
-
-rtl_TextEncoding
-ExtendedFontStruct::GetAsciiEncoding( int *pAsciiRange ) const
-{
- return mpXlfd->GetAsciiEncoding( pAsciiRange );
-}
-
-FontPitch
-ExtendedFontStruct::GetSpacing( rtl_TextEncoding nEncoding )
-{
- return mpXlfd->GetPitch( nEncoding );
-}
-
-static XFontStruct*
-LoadXFont (Display* pDisplay, const char* pFontName)
-{
- XFontStruct* pFont = XLoadQueryFont (pDisplay, pFontName);
- if ((pFont != NULL) && (pFont->fid == 0))
- pFont->fid = XLoadFont(pDisplay, pFontName);
-
- return pFont;
-}
-
-int
-ExtendedFontStruct::LoadEncoding( rtl_TextEncoding nEncoding )
-{
- int nIdx = mpXlfd->GetEncodingIdx( nEncoding );
- if ( (nIdx < 0) || (mpXFontStruct[ nIdx ] != NULL) )
- return nIdx;
-
- // limit font height that gets requested from the XServer
- int nReqPixelHeight = maPixelSize.Height();
- if( nReqPixelHeight > GetMaxFontHeight() )
- nReqPixelHeight = GetMaxFontHeight();
- else if( nReqPixelHeight < 2 )
- nReqPixelHeight = 2;
-
- // get the X11 font from a matching XLFD
- ByteString aFontName;
- mpXlfd->ToString( aFontName, nReqPixelHeight, nEncoding );
- mpXFontStruct[ nIdx ] = LoadXFont( mpDisplay, aFontName.GetBuffer() );
- if (mpXFontStruct[nIdx] == NULL)
- mpXFontStruct[nIdx] = LoadXFont( mpDisplay, "fixed" );
-
- // calculate correction factors to improve matching
- // the selected font size to the used bitmap font
- int nRealPixelSize = mpXlfd->GetPixelSize();
- if( !nRealPixelSize ) // check for scalable mpXlfd
- nRealPixelSize = nReqPixelHeight;
- if( nRealPixelSize && (nRealPixelSize != maPixelSize.Width()) )
- mfXScale = (float)maPixelSize.Width() / nRealPixelSize;
- if( nRealPixelSize && (nRealPixelSize != maPixelSize.Height()) )
- mfYScale = (float)maPixelSize.Height() / nRealPixelSize;
-
- return nIdx;
-}
-
-XFontStruct*
-ExtendedFontStruct::GetFontStruct( rtl_TextEncoding nEncoding )
-{
- int nIdx = LoadEncoding( nEncoding );
- return nIdx < 0 ? NULL : mpXFontStruct[nIdx] ;
-}
-
-bool
-ExtendedFontStruct::GetFontBoundingBox( XCharStruct *pCharStruct,
- int *pAscent, int *pDescent )
-{
- pCharStruct->lbearing = 0;
- pCharStruct->rbearing = 0;
- pCharStruct->width = 0;
- pCharStruct->ascent = 0;
- pCharStruct->descent = 0;
-
- *pAscent = 0;
- *pDescent = 0;
-
- int nIdx;
-
- // check if there is at least one encoding already loaded
- bool bEmpty = true;
- for ( nIdx = 0; nIdx < mpXlfd->NumEncodings(); nIdx++ )
- bEmpty &= (mpXFontStruct[nIdx] == NULL);
- if ( bEmpty )
- LoadEncoding( mpXlfd->GetAsciiEncoding() );
-
- // get the max bounding box from all font structs
- for ( nIdx = 0; nIdx < mpXlfd->NumEncodings(); nIdx++ )
- if ( mpXFontStruct[ nIdx ] != NULL )
- {
- *pAscent = std::max( mpXFontStruct[nIdx]->ascent, *pAscent );
- *pDescent = std::max( mpXFontStruct[nIdx]->descent, *pDescent );
-
- XCharStruct* pMaxBounds = &(mpXFontStruct[nIdx]->max_bounds);
-
- pCharStruct->lbearing = std::max( pMaxBounds->lbearing,
- pCharStruct->lbearing );
- pCharStruct->rbearing = std::max( pMaxBounds->rbearing,
- pCharStruct->rbearing );
- pCharStruct->width = std::max( pMaxBounds->width,
- pCharStruct->width );
- pCharStruct->ascent = std::max( pMaxBounds->ascent,
- pCharStruct->ascent );
- pCharStruct->descent = std::max( pMaxBounds->descent,
- pCharStruct->descent );
- }
-
- // apply correction factors to better match selected size to available size
- if( mfYScale != 1.0 )
- {
- *pAscent = int(*pAscent * mfYScale);
- *pDescent = int(*pDescent * mfYScale);
- pCharStruct->ascent = (short int)(pCharStruct->ascent * mfYScale);
- pCharStruct->descent = (short int)(pCharStruct->descent * mfYScale);
- }
- if( mfXScale != 1.0 )
- {
- pCharStruct->lbearing = (short int)(pCharStruct->lbearing * mfXScale);
- pCharStruct->rbearing = (short int)(pCharStruct->rbearing * mfXScale);
- pCharStruct->width = (short int)(pCharStruct->width * mfXScale);
- }
-
- return (pCharStruct->width > 0);
-}
-
-bool
-ExtendedFontStruct::ToImplFontMetricData(ImplFontMetricData *pFontMetric)
-{
- pFontMetric->mnOrientation = 0;
- pFontMetric->mnSlant = 0;
- pFontMetric->mbDevice = true;
- pFontMetric->mbScalableFont = mpXlfd->IsScalable();
- pFontMetric->mbKernableFont = false;
- pFontMetric->mbSymbolFlag= mpXlfd->IsSymbolFont();
- pFontMetric->meFamily = mpXlfd->GetFamilyType();
- pFontMetric->meWeight = mpXlfd->GetWeight();
- pFontMetric->mePitch = mpXlfd->GetPitch();
- pFontMetric->meItalic = mpXlfd->GetSlant();
-
- int nAscent, nDescent;
- XCharStruct aBoundingBox;
- if ( GetFontBoundingBox(&aBoundingBox, &nAscent, &nDescent) )
- {
- pFontMetric->mnWidth = aBoundingBox.width;
- pFontMetric->mnAscent = aBoundingBox.ascent;
- pFontMetric->mnDescent = aBoundingBox.descent;
- pFontMetric->mnIntLeading = std::max(0, aBoundingBox.ascent - nAscent
- + aBoundingBox.descent - nDescent );
- pFontMetric->mnExtLeading = 0; // TODO!!!
- return true;
- }
- else
- {
- return false;
- }
-}
-
-bool
-ExtendedFontStruct::Match( const ExtendedXlfd *pXlfd,
- const Size& rPixelSize, sal_Bool bVertical ) const
-{
- if( mpXlfd != pXlfd )
- return false;
-
- if( bVertical != mbVertical )
- return FALSE;
-
- if( rPixelSize.Height() != maPixelSize.Height() )
- return FALSE;
-
- long nReqWidth = rPixelSize.Width();
- if( !nReqWidth )
- nReqWidth = rPixelSize.Height();
- if( nReqWidth != maPixelSize.Width() )
- return FALSE;
-
- return true;
-}
-
-// Get an appropriate x-font that contains a glyph for the given unicode
-// code point.
-// This routine is designed to be called for each character in a text.
-// It first checks the given encoding to optimize for the fact that two
-// adjacent characters in a text most probably have the same encoding
-// In the first call initialize pEncodingInOut to dontknow, this causes
-// EncodingHasChar() to fail and thus bootstraps the encoding, otherwise
-// make sure that the initial value of pFontInOut matches the encoding and
-// that the encoding is valid for the font.
-XFontStruct*
-ExtendedFontStruct::GetFontStruct( sal_Unicode nChar, rtl_TextEncoding *pEncoding )
-{
- SalConverterCache *pCvt = SalConverterCache::GetInstance();
-
- if ( pCvt->EncodingHasChar(mnAsciiEncoding, nChar) )
- {
- *pEncoding = mnAsciiEncoding;
- return GetFontStruct (mnAsciiEncoding);
- }
- else
- if ( pCvt->EncodingHasChar(mnCachedEncoding, nChar) )
- {
- *pEncoding = mnCachedEncoding;
- return GetFontStruct (mnCachedEncoding);
- }
- else
- {
- for ( int nIdx = 0; nIdx < mpXlfd->NumEncodings(); nIdx++ )
- {
- rtl_TextEncoding nEnc = mpXlfd->GetEncoding(nIdx);
- if ( (nEnc != mnCachedEncoding) && (nEnc != mnAsciiEncoding)
- && pCvt->EncodingHasChar(nEnc, nChar))
- {
- mnCachedEncoding = nEnc;
- *pEncoding = mnCachedEncoding;
- return GetFontStruct (mnCachedEncoding);
- }
- }
- }
-
- *pEncoding = RTL_TEXTENCODING_DONTKNOW;
- return NULL;
-}
-
-// ---------------------------------------------------------------------------
-// utility functions to handle xfontstruct information, this is all to
-// calculate charwidth information
-// ---------------------------------------------------------------------------
-
-static bool
-CharExists( const XCharStruct* pChar )
-{
- if ( pChar == NULL )
- return false;
-
- return pChar->width
- || pChar->ascent || pChar->descent
- || pChar->lbearing || pChar->rbearing;
-}
-
-// this relies on non-null per_char information in the fontstruct
-static XCharStruct*
-GetCharinfo( const XFontStruct *pXFontStruct, sal_MultiByte nChar )
-{
- unsigned int nRow = nChar >> 8;
- unsigned int nCol = nChar & 0xFF;
-
- unsigned int nMinRow = pXFontStruct->min_byte1;
- unsigned int nMaxRow = pXFontStruct->max_byte1;
- unsigned int nMinCol = pXFontStruct->min_char_or_byte2;
- unsigned int nMaxCol = pXFontStruct->max_char_or_byte2;
-
- if ( nRow >= nMinRow && nRow <= nMaxRow
- && nCol >= nMinCol && nCol <= nMaxCol )
- {
- return &pXFontStruct->per_char[
- (nRow-nMinRow) * (nMaxCol-nMinCol+1) + (nCol-nMinCol) ];
- }
-
- return NULL;
-}
-
-static sal_Size
-QueryCharWidth16( Display* pDisplay, XLIB_Font nFontID, sal_MultiByte nChar,
- sal_Size nDefaultWidth )
-{
- int nDirection, nFontAscent, nFontDescent;
- XCharStruct aBoundingBox;
-
- XQueryTextExtents16( pDisplay, nFontID, (XChar2b*)&nChar, 1,
- &nDirection, &nFontAscent, &nFontDescent, &aBoundingBox );
-
- return CharExists( &aBoundingBox ) ? aBoundingBox.width : nDefaultWidth;
-}
-
-sal_Size
-ExtendedFontStruct::GetDefaultWidth()
-{
- return (maPixelSize.Width() + 1) / 2;
-}
-
-// Handle single byte fonts which do not require conversion, this exploits
-// the fact that unicode equals latin1 or ansi1252 in the range [0..0xff] and
-// is compatible with iso8859-X at least in the range to 0x7f
-sal_Size
-ExtendedFontStruct::GetCharWidth8( sal_Unicode nFrom, sal_Unicode nTo,
- sal_Int32* pWidthArray, rtl_TextEncoding nEncoding )
-{
- if ( !(nFrom <= nTo) )
- return 0;
-
- XFontStruct* pXFontStruct = GetFontStruct( nEncoding );
- if ( pXFontStruct == NULL )
- return 0;
-
- // query the font metrics
- if ( (pXFontStruct->max_bounds.width == pXFontStruct->min_bounds.width)
- || (pXFontStruct->per_char == NULL) )
- {
- // fixed width font
- for ( int nIdx = nFrom; nIdx <= nTo; nIdx++, pWidthArray++ )
- *pWidthArray = pXFontStruct->max_bounds.width;
- }
- else
- {
- // variable width font
- int nMinChar = pXFontStruct->min_char_or_byte2;
- int nMaxChar = pXFontStruct->max_char_or_byte2;
-
- int nIdx = nFrom;
-
- for ( ; nIdx < std::min((int)nTo, nMinChar); nIdx++, pWidthArray++ )
- *pWidthArray = mnDefaultWidth;
- for ( ; nIdx <= std::min((int)nTo, nMaxChar); nIdx++, pWidthArray++ )
- {
- XCharStruct* pChar = &(pXFontStruct->per_char[nIdx - nMinChar]);
- *pWidthArray = CharExists(pChar) ? pChar->width : mnDefaultWidth;
- }
- for ( ; nIdx <= nTo; nIdx++, pWidthArray++ )
- *pWidthArray = mnDefaultWidth;
- }
-
- // return amount of handled chars
- return nTo - nFrom + 1;
-}
-
-// Handle utf16 encoded fonts, which do not require conversion
-sal_Size
-ExtendedFontStruct::GetCharWidthUTF16( sal_Unicode nFrom, sal_Unicode nTo,
- sal_Int32* pWidthArray )
-{
- if ( !(nFrom <= nTo) )
- return 0;
-
- XFontStruct* pXFontStruct = GetFontStruct( RTL_TEXTENCODING_UNICODE );
- FontPitch nSpacing = mpXlfd->GetPitch( RTL_TEXTENCODING_UNICODE );
-
- if ( pXFontStruct == NULL )
- return 0;
-
- // query the font metrics
- if ( nSpacing == PITCH_VARIABLE
- && pXFontStruct->per_char == NULL)
- {
- // get per_char information from the server
- for ( sal_Int32 nIdx = nFrom; nIdx <= nTo; nIdx++, pWidthArray++ )
- *pWidthArray = QueryCharWidth16( mpDisplay, pXFontStruct->fid,
- nIdx, mnDefaultWidth );
- }
- else
- if ( (pXFontStruct->max_bounds.width == pXFontStruct->min_bounds.width)
- || (pXFontStruct->per_char == NULL) )
- {
- // really a fixed width font
- for ( sal_Int32 nIdx = nFrom; nIdx <= nTo; nIdx++, pWidthArray++ )
- *pWidthArray = pXFontStruct->max_bounds.width;
- }
- else
- {
- // get per_char information from the xfontstruct
- for ( sal_Int32 nIdx = nFrom; nIdx <= nTo; nIdx++, pWidthArray++ )
- {
- XCharStruct* pChar = GetCharinfo( pXFontStruct, nIdx );
- *pWidthArray = CharExists(pChar) ? pChar->width : mnDefaultWidth;
- }
- }
-
- // return amount of handled chars
- return nTo - nFrom + 1;
-}
-
-// handle non unicode fonts that are converted into encoding matching the
-// font in fontstruct, 8 and 16 bit fonts are handled the same way
-sal_Size
-ExtendedFontStruct::GetCharWidth16( sal_Unicode nFrom, sal_Unicode nTo,
- sal_Int32* pWidthArray, ExtendedFontStruct *pFallback )
-{
- if ( nFrom > nTo )
- return 0;
-
- sal_Char pBuffer[64];
-
- SalConverterCache *pCvt = SalConverterCache::GetInstance();
- for ( sal_Int32 nIdx = nFrom ; nIdx <= nTo ; nIdx++, pWidthArray++ )
- {
- FontPitch nSpacing;
- sal_Size nSize;
- sal_Unicode nUniIdx = (sal_Unicode)nIdx;
-
- // get a matching fontstruct
- rtl_TextEncoding nEnc;
- XFontStruct *pFont;
-
- if ( (pFont = GetFontStruct(nUniIdx, &nEnc)) != NULL )
- {
- nSpacing = GetSpacing( nEnc );
- }
- else
- if ( (pFallback != NULL)
- && ((pFont = pFallback->GetFontStruct(nUniIdx, &nEnc)) != NULL) )
- {
- nSpacing = pFallback->GetSpacing( nEnc );
- }
- else
- if ( (pFallback != NULL)
- && ((pFont = pFallback->GetFontStruct(nUniIdx = '?', &nEnc)) != NULL) )
- {
- nSpacing = pFallback->GetSpacing( nEnc );
- }
- else
- {
- // TODO What should the default value be?
- nSpacing = PITCH_FIXED;
- }
-
- if ( pFont )
- {
- nSize = pCvt->ConvertStringUTF16(&nUniIdx, 1, pBuffer, sizeof(pBuffer), nEnc);
- // XXX FIXME
- if ((nEnc == RTL_TEXTENCODING_GB_2312) || (nEnc == RTL_TEXTENCODING_EUC_KR))
- {
- for (unsigned int n_char = 0; n_char < nSize; n_char++ )
- pBuffer[ n_char ] &= 0x7F;
- }
- }
-
- // query font metrics
- if ( pFont && (nSize == 1 || nSize == 2) )
- {
- sal_MultiByte nChar = (nSize == 1) ? (unsigned char)pBuffer[0] :
- ((sal_MultiByte)pBuffer[0] << 8) + (sal_MultiByte)pBuffer[1];
-
- if ( nSpacing == PITCH_VARIABLE
- && pFont->per_char == NULL)
- {
- // get per_char information from the x-server
- *pWidthArray = QueryCharWidth16( mpDisplay, pFont->fid,
- nChar, mnDefaultWidth );
- }
- else
- if ( (pFont->max_bounds.width == pFont->min_bounds.width)
- || (pFont->per_char == NULL) )
- {
- // fixed width font
- *pWidthArray = pFont->max_bounds.width;
- }
- else
- {
- // get per_char information from the xfontstruct
- XCharStruct* pChar = GetCharinfo( pFont, nChar );
- *pWidthArray = CharExists(pChar) ? pChar->width : mnDefaultWidth;
- }
- }
- else
- {
- // conversion error
- *pWidthArray = mnDefaultWidth;
- }
- }
-
- // return amount of handled chars
- return nTo - nFrom + 1;
-}
-
-sal_Size
-ExtendedFontStruct::GetCharWidth( sal_Unicode cChar, sal_Int32 *pPhysicalWidth,
- sal_Int32 *pLogicalWidth )
-{
- sal_Size nConverted = 0;
-
- // dispatch querying of metrics to most promising encoding candidate
- int nAsciiRange;
- rtl_TextEncoding nEncoding = mpXlfd->GetAsciiEncoding(&nAsciiRange);
- if ( nEncoding == RTL_TEXTENCODING_UNICODE )
- {
- // if we have a unicode encoded system font than we get the charwidth
- // straight forward
- nConverted = GetCharWidthUTF16( cChar, cChar, pPhysicalWidth );
- }
- else
- {
- if ( cChar < nAsciiRange )
- {
- // optimize the most frequent case, requesting only the latin1
- // chars which are mappable to a single encoding
- nConverted = GetCharWidth8( cChar, cChar, pPhysicalWidth, nEncoding );
- }
-
- // if further requests are pending, then the according unicode
- // codepoint has to be dispatched to one of the system fonts and
- // converted to this fonts encoding
- nConverted += GetCharWidth16( cChar + nConverted, cChar,
- pPhysicalWidth + nConverted, NULL );
- }
-
- // convert physical width to logical width, apply correction factor if needed
- *pLogicalWidth = *pPhysicalWidth;
- if( mfXScale != 1.0 )
- *pLogicalWidth = sal_Int32(*pLogicalWidth * mfXScale);
-
- return nConverted;
-}
-
-bool ExtendedFontStruct::HasUnicodeChar( sal_Unicode cChar ) const
-{
- // #i18818# return false if there are no known encodings
- if( !mnRangeCount )
- return false;
-
- // init unicode range cache if needed
- if( mnRangeCount < 0 )
- {
- mnRangeCount = mpXlfd->GetFontCodeRanges( NULL );
- if( !mnRangeCount )
- return false;
- mpRangeCodes = new sal_uInt32[ 2*mnRangeCount ];
- mpXlfd->GetFontCodeRanges( mpRangeCodes );
- // TODO: make sure everything is sorted
- }
-
- // binary search in unicode ranges
- int nLower = 0;
- int nMid = mnRangeCount;
- int nUpper = 2 * mnRangeCount - 1;
- while( nLower < nUpper )
- {
- if( cChar >= mpRangeCodes[ nMid ] )
- nLower = nMid;
- else
- nUpper = nMid - 1;
- nMid = (nLower + nUpper + 1) / 2;
- }
- if( (nMid == 0) && (cChar < mpRangeCodes[0]) )
- return false;
- return (nMid & 1) ? false: true;
-}
-
-int ExtendedFontStruct::GetFontCodeRanges( sal_uInt32* pCodePairs ) const
-{
- // make sure unicode range cache is initialized
- HasUnicodeChar(0);
-
- // transfer range pairs if requested
- if( pCodePairs )
- {
- for( int i = 0; i < 2*mnRangeCount; ++i )
- pCodePairs[i] = mpRangeCodes[i];
- }
-
- return mnRangeCount;
-}
-
-// =======================================================================
-
-X11FontLayout::X11FontLayout( ExtendedFontStruct& rFont )
-: mrFont( rFont )
-{}
-
-// -----------------------------------------------------------------------
-
-bool X11FontLayout::LayoutText( ImplLayoutArgs& rArgs )
-{
- Point aNewPos( 0, 0 );
- bool bRightToLeft;
- int nCharPos;
-
- for( nCharPos = -1; rArgs.GetNextPos( &nCharPos, &bRightToLeft ); )
- {
- sal_UCS4 cChar = rArgs.mpStr[ nCharPos ];
- if( bRightToLeft )
- cChar = GetMirroredChar( cChar );
- int nGlyphIndex = cChar | GF_ISCHAR;
-
- // check if the font supports the char
- if( !mrFont.HasUnicodeChar( cChar ) )
- {
- // try to replace the failing char using the same font
- const char* pApproxUTF8 = GetAutofallback( cChar );
- cChar = 0;
- if( pApproxUTF8 )
- {
- String aApproxStr( pApproxUTF8, RTL_TEXTENCODING_UTF8 );
- if( aApproxStr.Len() == 1 )
- {
- // TODO: support Autofallback for len>1
- sal_Unicode cApprox = aApproxStr.GetChar( 0 );
- if( mrFont.HasUnicodeChar( cApprox ) )
- nGlyphIndex = (cChar = cApprox) | GF_ISCHAR;
- }
- }
- // request fallback glyph if necessary
- if( !cChar )
- {
- rArgs.NeedFallback( nCharPos, bRightToLeft );
- if( rArgs.mnFlags & SAL_LAYOUT_FOR_FALLBACK )
- nGlyphIndex = 0; // drop NotDef fallback glyphs
- }
- }
-
- sal_Int32 nPhysGlyphWidth, nLogGlyphWidth;
- mrFont.GetCharWidth( cChar, &nPhysGlyphWidth, &nLogGlyphWidth );
- int nGlyphFlags = (nPhysGlyphWidth > 0) ? 0 : GlyphItem::IS_IN_CLUSTER;
- if( bRightToLeft )
- nGlyphFlags |= GlyphItem::IS_RTL_GLYPH;
- GlyphItem aGI( nCharPos, nGlyphIndex, aNewPos, nGlyphFlags, nPhysGlyphWidth );
- aGI.mnNewWidth = nLogGlyphWidth;
- AppendGlyph( aGI );
-
- aNewPos.X() += nLogGlyphWidth;
- }
-
- return (nCharPos >= 0);
-}
-
-// -----------------------------------------------------------------------
-
-void X11FontLayout::AdjustLayout( ImplLayoutArgs& rArgs )
-{
- GenericSalLayout::AdjustLayout( rArgs );
- SetOrientation( 0 ); // X11 fonts are to be rotated in upper layers
-}
-
-// -----------------------------------------------------------------------
-
-void X11FontLayout::DrawText( SalGraphics& rSalGraphics ) const
-{
- static const int MAXGLYPHS = 160;
- int nMaxGlyphs = GetOrientation() ? 1 : MAXGLYPHS;
-
- // workaround for #i49902# similar to #b6228733 with XDrawText items
- // => output each item separately for non-unicode font encodings!
- // this is done here instead of in DrawStringUCS2MB() because
- // it needs the item positions and they are easily available here
- if( mrFont.GetAsciiEncoding() != RTL_TEXTENCODING_UNICODE )
- nMaxGlyphs = 1;
-
- Point aPos;
- sal_GlyphId aGlyphAry[ MAXGLYPHS ];
- sal_Unicode pStr[ MAXGLYPHS ];
- for( int nStart=0;;)
- {
- int nGlyphCount = GetNextGlyphs( nMaxGlyphs, aGlyphAry, aPos, nStart );
- if( !nGlyphCount )
- break;
-
- for( int i = 0; i < nGlyphCount; ++i )
- pStr[ i ] = aGlyphAry[ i ] & GF_IDXMASK;
-
- static_cast<X11SalGraphics&>(rSalGraphics).DrawStringUCS2MB( mrFont, aPos, pStr, nGlyphCount );
- }
-}
-
-// =======================================================================
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/gdi/xlfd_attr.cxx b/vcl/unx/source/gdi/xlfd_attr.cxx
deleted file mode 100644
index f8b2adab0456..000000000000
--- a/vcl/unx/source/gdi/xlfd_attr.cxx
+++ /dev/null
@@ -1,698 +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_vcl.hxx"
-#include <memory>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sal/alloca.h>
-#include <sal/macros.h>
-#include "xlfd_attr.hxx"
-#include <rtl/tencinfo.h>
-#include <vcl/vclenum.hxx>
-
-// ---------------------------------------------------------------------------
-//
-//
-// Attribute is a container for simple name value pairs
-// eg. ( "times", FAMILY_ROMAN ) or ( "demi bold", WEIGHT_SEMIBOLD )
-// enriched with an annotation which is a pretty-printed version of the
-// string, i.e. "itc avant garde" would get an annotation of "Itc Avant Garde"
-//
-//
-// ---------------------------------------------------------------------------
-
-// release the stored string
-void
-Attribute::Release()
-{
- if ( mpAnnotation != NULL )
- delete mpAnnotation;
- if ( mpKeyName != NULL )
- delete mpKeyName;
- if ( mpName != NULL )
- free( (void*)mpName );
-}
-
-// get a private copy of the given argument
-void
-Attribute::SetName( const char *p, int nLen )
-{
- mpName = (char*)malloc( nLen + 1 );
- mnLength = nLen;
- memcpy( (void*)mpName, p, mnLength );
- ((char*)mpName)[ mnLength ] = '\0';
-}
-
-// Compare whether two strings a equal for the first nLen bytes
-// i.e. arial == arialnarrow
-int
-Attribute::Compare( const char *p, int nLen )
-{
- return strncmp( mpName, p, nLen );
-}
-
-// Get a all lowercase name with all blanks removed
-const rtl::OString&
-Attribute::GetKey ()
-{
- static rtl::OString aEmptyStr;
-
- if (mpKeyName != NULL)
- return *mpKeyName;
- if (mnLength == 0)
- return aEmptyStr;
-
- sal_Char* pBuffer = (sal_Char*)alloca (mnLength);
-
- sal_Int32 i, j;
- for (i = 0, j = 0; i < mnLength; i++)
- {
- if ( mpName[i] != ' ' )
- pBuffer[j++] = mpName[i];
- }
- mpKeyName = new rtl::OString(pBuffer, j);
-
- return *mpKeyName;
-}
-
-void
-Attribute::InitKey ()
-{
- mpKeyName = NULL;
-}
-
-// Compare two strings, they have to be equal for nLen bytes, after nLen
-// bytes both strings have to be terminated either by '\0' or by '-'
-// this is for comparing a string being a substring in a Xlfd with a
-// zeroterminated string
-Bool
-Attribute::ExactMatch( const char *p, int nLen )
-{
- Bool bMatch;
- if ( nLen > 0 )
- bMatch = Compare( p, nLen ) == 0;
- else
- bMatch = True;
- if ( bMatch )
- {
- char c1 = p[ nLen ];
- char c2 = mpName[ nLen ];
- bMatch = (c1 == '-' || c1 == '\0') && (c2 == '-' || c2 == '\0');
- }
-
- return bMatch;
-}
-
-void
-Attribute::TagFeature( unsigned short nFeature )
-{
- if ( (nFeature & XLFD_FEATURE_NARROW)
- && (strstr(mpName, "narrow") != NULL) )
- {
- mnFeature |= XLFD_FEATURE_NARROW;
- }
-
- if ( (nFeature & XLFD_FEATURE_OL_CURSOR)
- && (strcmp(mpName, "open look cursor") == 0) )
- {
- mnFeature |= XLFD_FEATURE_OL_CURSOR;
- }
-
- if ( (nFeature & XLFD_FEATURE_OL_GLYPH)
- && (strcmp(mpName, "open look glyph") == 0) )
- {
- mnFeature |= XLFD_FEATURE_OL_GLYPH;
- }
-
- if ( (nFeature & XLFD_FEATURE_APPLICATION_FONT)
- && ( (strcmp(mpName, "interface user") == 0)
- || (strcmp(mpName, "interface system") == 0)))
- {
- mnFeature |= XLFD_FEATURE_APPLICATION_FONT;
- }
-
- if (nFeature & XLFD_FEATURE_INTERFACE_FONT)
- {
- // european
- if (strcmp(mpName, "arial") == 0)
- mnFeature |= (XLFD_FEATURE_INTERFACE_FONT | XLFD_FEATURE_HQ | XLFD_FEATURE_MQ);
- else
- if (strcmp(mpName, "helvetica") == 0)
- mnFeature |= (XLFD_FEATURE_INTERFACE_FONT | XLFD_FEATURE_HQ);
- else
- if ( (strcmp(mpName, "lucidux sans") == 0)
- || (strcmp(mpName, "luxi sans") == 0))
- mnFeature |= (XLFD_FEATURE_INTERFACE_FONT | XLFD_FEATURE_MQ | XLFD_FEATURE_LQ);
- else
- if (strcmp(mpName, "charter") == 0)
- mnFeature |= (XLFD_FEATURE_INTERFACE_FONT | XLFD_FEATURE_MQ);
- else
- // japanese
- if ( (strcmp(mpName, "hg mincho l") == 0) /* Solaris: jisx0208 jisx0201 */
- || (strcmp(mpName, "heiseimin") == 0) /* Solaris: jisx0212 */
- || (strcmp(mpName, "minchol") == 0) /* TurboLinux */
- || (strcmp(mpName, "mincho") == 0)) /* Redhat 6.2 JP */
- {
- mnFeature |= XLFD_FEATURE_INTERFACE_FONT;
- }
- else
- // chinese
- if ( (strcmp(mpName, "kai") == 0) /* Solaris */
- || (strcmp(mpName, "ar pl mingti2l big5") == 0)) /* TurboLinux */
- {
- mnFeature |= XLFD_FEATURE_INTERFACE_FONT;
- }
- else
- // korean
- if ( (strcmp(mpName, "myeongjo") == 0)) /* Solaris */
- {
- mnFeature |= XLFD_FEATURE_INTERFACE_FONT;
- }
- }
-
- if ( nFeature & XLFD_FEATURE_REDUNDANTSTYLE )
- {
- switch ( mpName[0] )
- {
- case '\0':
- mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE;
- break;
-
- case 'b':
- if ( (strcmp(mpName, "bold") == 0)
- || (strcmp(mpName, "bold italic") == 0)
- || (strcmp(mpName, "bold sans") == 0) )
- mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE;
- break;
-
- case 'd':
- if ( (strcmp(mpName, "demi") == 0)
- || (strcmp(mpName, "demi italic") == 0) )
- mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE;
- break;
-
- case 'i':
- if ( strcmp(mpName, "italic") == 0 )
- mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE;
- break;
-
- case 's':
- if ( (strcmp(mpName, "sans") == 0)
- || (strcmp(mpName, "serif") == 0) )
- mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE;
- break;
- }
- }
-}
-
-// given Attribute classifications, strings have to be in alphabetical
-// order, since they are treated by binary search algorithm
-
-#define InitializeAttributeWith( p, a ) p, sizeof(p) - 1, a, 0, NULL, NULL
-
-const Attribute pFamilyAttribute[] = {
- { InitializeAttributeWith( "arial", FAMILY_SWISS ) },
- { InitializeAttributeWith( "arioso", FAMILY_SCRIPT ) },
- { InitializeAttributeWith( "avant garde", FAMILY_SWISS ) },
- { InitializeAttributeWith( "avantgarde", FAMILY_SWISS ) },
- { InitializeAttributeWith( "bembo", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "bookman", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "conga", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "courier", FAMILY_MODERN ) },
- { InitializeAttributeWith( "curl", FAMILY_SCRIPT ) },
- { InitializeAttributeWith( "fixed", FAMILY_MODERN ) },
- { InitializeAttributeWith( "gill", FAMILY_SWISS ) },
- { InitializeAttributeWith( "helmet", FAMILY_MODERN ) },
- { InitializeAttributeWith( "helvetica", FAMILY_SWISS ) },
- { InitializeAttributeWith( "international", FAMILY_MODERN ) },
- { InitializeAttributeWith( "lucida", FAMILY_SWISS ) },
- { InitializeAttributeWith( "new century schoolbook", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "palatino", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "roman", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "sans serif", FAMILY_SWISS ) },
- { InitializeAttributeWith( "sansserif", FAMILY_SWISS ) },
- { InitializeAttributeWith( "serf", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "serif", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "times", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "utopia", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "zapf chancery", FAMILY_SCRIPT ) },
- { InitializeAttributeWith( "zapfchancery", FAMILY_SCRIPT ) }
-};
-
-const Attribute pWeightAttribute[] = {
- { InitializeAttributeWith( "black", WEIGHT_BLACK ) },
- { InitializeAttributeWith( "bold", WEIGHT_BOLD ) },
- { InitializeAttributeWith( "book", WEIGHT_LIGHT ) },
- { InitializeAttributeWith( "demi", WEIGHT_SEMIBOLD ) },
- { InitializeAttributeWith( "demi bold", WEIGHT_SEMIBOLD ) },
- { InitializeAttributeWith( "demibold", WEIGHT_SEMIBOLD ) },
- { InitializeAttributeWith( "light", WEIGHT_LIGHT ) },
- { InitializeAttributeWith( "medium", WEIGHT_MEDIUM ) },
- { InitializeAttributeWith( "normal", WEIGHT_NORMAL ) },
- { InitializeAttributeWith( "regular", WEIGHT_NORMAL ) },
- { InitializeAttributeWith( "roman", WEIGHT_NORMAL ) },
- { InitializeAttributeWith( "semicondensed", WEIGHT_LIGHT ) },
- { InitializeAttributeWith( "ultrabold", WEIGHT_ULTRABOLD ) }
-};
-
-const Attribute pSlantAttribute[] = {
- { InitializeAttributeWith( "i", ITALIC_NORMAL ) },
- { InitializeAttributeWith( "o", ITALIC_OBLIQUE ) },
- { InitializeAttributeWith( "r", ITALIC_NONE ) }
-};
-
-const Attribute pSetwidthAttribute[] = {
- { InitializeAttributeWith( "bold", WIDTH_SEMI_EXPANDED ) },
- { InitializeAttributeWith( "condensed", WIDTH_CONDENSED ) },
- { InitializeAttributeWith( "double wide", WIDTH_ULTRA_EXPANDED ) },
- { InitializeAttributeWith( "expanded", WIDTH_EXPANDED ) },
- { InitializeAttributeWith( "extracondensed", WIDTH_EXTRA_CONDENSED ) },
- { InitializeAttributeWith( "extraexpanded", WIDTH_EXTRA_EXPANDED ) },
- { InitializeAttributeWith( "medium", WIDTH_NORMAL ) },
- { InitializeAttributeWith( "narrow", WIDTH_CONDENSED ) },
- { InitializeAttributeWith( "normal", WIDTH_NORMAL ) },
- { InitializeAttributeWith( "semicondensed", WIDTH_SEMI_CONDENSED ) },
- { InitializeAttributeWith( "semiexpanded", WIDTH_SEMI_EXPANDED ) },
- { InitializeAttributeWith( "ultracondensed", WIDTH_ULTRA_CONDENSED ) },
- { InitializeAttributeWith( "ultraexpanded", WIDTH_ULTRA_EXPANDED ) },
- { InitializeAttributeWith( "wide", WIDTH_EXPANDED ) }
-};
-
-const Attribute pEnhancedCharsetAttribute[] = {
- { InitializeAttributeWith( "iso8859-1", RTL_TEXTENCODING_MS_1252 ) },
- { InitializeAttributeWith( "iso8859_1", RTL_TEXTENCODING_MS_1252 ) }
-};
-
-// -------------------------------------------------------------------------
-//
-// String handling utility functions
-//
-// -------------------------------------------------------------------------
-
-
-void
-AppendAttribute( Attribute *pAttribute, ByteString &rString )
-{
- if ( pAttribute == NULL )
- return ;
-
- int nLength = pAttribute->GetLength();
- char *pBuffer = (char*)alloca( nLength + 1);
-
- pBuffer[ 0 ] = '-';
- memcpy( pBuffer + 1, pAttribute->GetName(), nLength );
- rString.Append( pBuffer, nLength + 1);
-}
-
-//
-// Prettify the font name: make each leading character of a fontname
-// uppercase. For example
-// times new roman -> Times New Roman
-//
-
-static void
-ToUpper( char *pCharacter )
-{
- // replace [a,z] with [A,Z]
- if ( (*pCharacter >= 97) && (*pCharacter <= 122) )
- *pCharacter -= 32;
-}
-
-static String*
-Capitalize( const char *pStr, int nLength )
-{
- char *pCopy = (char*)alloca( nLength + 1 );
- char *pPtr = pCopy;
- memcpy( pPtr, pStr, nLength + 1 );
-
- // loop over string data and uppercase first char and all chars
- // following a space (other white space would be unexpected here)
- char nPreviousChar = ' ';
- while ( *pPtr )
- {
- if ( nPreviousChar == ' ' )
- ToUpper( pPtr );
- nPreviousChar = *pPtr++;
- }
-
- return new String( pCopy, RTL_TEXTENCODING_ISO_8859_1 );
-}
-
-String*
-AnnotateString( const Attribute& rAttribute )
-{
- return Capitalize(rAttribute.GetName(), rAttribute.GetLength());
-}
-
-String*
-AnnotateSlant( const Attribute& rAttribute )
-{
- const char* pStr = rAttribute.GetName();
- int nLen = rAttribute.GetLength();
-
- static const struct {
- const char *pFrom; const char *pTo;
- } pTranslation[] = {
- { "r", "Roman" },
- { "o", "Oblique" },
- { "i", "Italic" },
- { "ri", "Reverse Italic" },
- { "ro", "Reverse Oblique" },
- { "ot", "Other" }
- };
-
- for ( unsigned int i = 0; i < SAL_N_ELEMENTS(pTranslation); i++ )
- if ( strcmp(pStr, pTranslation[i].pFrom) == 0 )
- {
- return new String( pTranslation[i].pTo,
- RTL_TEXTENCODING_ISO_8859_1 );
- }
-
- return Capitalize(pStr, nLen);
-}
-
-String*
-AnnotateNone( const Attribute& )
-{
- return new String();
-}
-
-// ---------------------------------------------------------------------------
-//
-//
-// manage global lists of Attributes
-// since XListFonts does never list more than 64K fonts this storage does
-// handle array size and indices with unsigned short values for low
-// memory consumption
-//
-//
-// ---------------------------------------------------------------------------
-
-AttributeStorage::AttributeStorage( unsigned short nDefaultValue ) :
- mpList( NULL ),
- mnSize( 0 ),
- mnCount( 0 ),
- mnLastmatch( 0 ),
- mnDefaultValue( nDefaultValue )
-{
-}
-
-AttributeStorage::~AttributeStorage()
-{
- if ( mpList != NULL )
- {
- for ( int i = 0; i < mnCount; i++ )
- mpList[i].Release();
- free( mpList );
- }
-}
-
-#if OSL_DEBUG_LEVEL > 1
-void
-AttributeStorage::Dump()
-{
- fprintf(stderr, "AttributeStorage: size=%i, used=%i\n", mnSize, mnCount);
- for ( int i = 0; i < mnCount; i++ )
- {
- ByteString aAnnotation = ByteString(
- mpList[i].GetAnnotation(),
- RTL_TEXTENCODING_ISO_8859_1 );
- fprintf(stderr, "\t%4i: <%s><len=%i><val=%i><%s>\n", i, mpList[i].GetName(),
- mpList[i].GetLength(), mpList[i].GetValue(),
- aAnnotation.GetBuffer() );
- }
- fprintf(stderr, "\n");
-}
-#endif
-
-Attribute*
-AttributeStorage::Retrieve( unsigned short nIndex ) const
-{
- return nIndex < mnCount ? &mpList[ nIndex ] : (Attribute*)NULL ;
-}
-
-// pClassification contains a list of name-value pairs. If names in
-// the AttributeStorage match those in the pClassification then
-// the according value is copied. Matching means match for the length
-// of the string in pClassification (i.e. arial matches arialnarrow)
-// the strings in pClassification must be in alphabetical order, all
-// strings Lowercase
-void
-AttributeStorage::AddClassification( Attribute *pClassification,
- unsigned short nNum )
-{
- for ( int i = 0; i < mnCount; i++ )
- {
- unsigned int nLower = 0;
- unsigned int nUpper = nNum;
- unsigned int nCurrent;
- int nComparison = 1;
- Attribute *pHaystack = 0, *pNeedle;
-
- pNeedle = &mpList[ i ];
-
- // binary search
- while ( nLower < nUpper )
- {
- nCurrent = (nLower + nUpper) / 2;
- pHaystack = &pClassification[ nCurrent ];
- nComparison = pNeedle->Compare( pHaystack->GetName(),
- pHaystack->GetLength() );
- if (nComparison < 0)
- nUpper = nCurrent;
- else
- if (nComparison > 0)
- nLower = nCurrent + 1;
- else
- break;
- }
-
- // if there's a match store the according classification in the
- // Attribute storage, otherwise do nothing since defaults are
- // already provided in AttributeStorage::Insert()
- if ( nComparison == 0 )
- pNeedle->SetValue( pHaystack->GetValue() );
- }
-}
-
-void
-AttributeStorage::AddClassification( AttributeClassifierT Classify )
-{
- for ( int i = 0; i < mnCount; i++ )
- {
- Attribute& rCurrent = mpList[i] ;
- int nValue = Classify( rCurrent.GetName() );
- rCurrent.SetValue( nValue );
- }
-}
-
-void
-AttributeStorage::AddAnnotation( AttributeAnnotatorT Annotate )
-{
- for ( int i = 0; i < mnCount; i++ )
- {
- String* pAnnotation = Annotate( mpList[i] );
- mpList[i].SetAnnotation( pAnnotation );
- }
-}
-
-void
-AttributeStorage::TagFeature( unsigned short nFeature )
-{
- for ( int i = 0; i < mnCount; i++ )
- mpList[i].TagFeature( nFeature );
-}
-
-// Enlarge the list of Attributes
-void
-AttributeStorage::Enlarge()
-{
- if ( mnSize == 0 )
- {
- mnSize = 8;
- mpList = (Attribute*) malloc( mnSize * sizeof(Attribute) );
- }
- else
- {
- mnSize = mnSize < 32768 ? (mnSize * 2) : 65535;
- Attribute* pTemp;
- pTemp = (Attribute*) realloc( mpList, mnSize * sizeof(Attribute) );
- if (pTemp)
- {
- mpList = pTemp;
- }
- else
- {
- throw std::bad_alloc();
- }
- }
-}
-
-// nLength is the length as it would be reported by strlen(3)
-// for an null-terminated string. if a string is part of a Xlfd
-// the field separator '-' is taken as '\0'
-// the AttributeStorage itself is NOT sorted to make sure that the
-// leased keys are still valid
-unsigned short
-AttributeStorage::Insert( const char *pString, int nLength )
-{
- // check whether the last match is still equal to the current
- // string since XListFonts lists fonts in sets of similar fontnames
- if ( mnLastmatch < mnCount )
- {
- if ( mpList[mnLastmatch].ExactMatch(pString, nLength) )
- return mnLastmatch;
- }
-
- // otherwise search in list
- for ( int i = 0; i < mnCount; i++ )
- {
- if ( mpList[i].ExactMatch(pString, nLength) )
- return mnLastmatch = i;
- }
-
- // if still not found we have to Insert the new string
- if ( mnSize == mnCount )
- Enlarge();
- mpList[mnCount].SetName( pString, nLength );
- mpList[mnCount].SetValue( mnDefaultValue );
- mpList[mnCount].SetAnnotation( NULL );
- mpList[mnCount].SetFeature( XLFD_FEATURE_NONE );
- mpList[mnCount].InitKey( );
- mnLastmatch = mnCount;
- mnCount = mnCount < 65535 ? mnCount + 1 : mnCount;
-
- return mnLastmatch;
-}
-
-
-// ---------------------------------------------------------------------------
-//
-//
-// Attribute provider is a frame for a set of AttributeStorages.
-//
-//
-// ---------------------------------------------------------------------------
-
-AttributeProvider::AttributeProvider ()
-{
- mpField[eXLFDFoundry ] = new AttributeStorage(0);
- mpField[eXLFDFamilyName ] = new AttributeStorage(FAMILY_DONTKNOW);
- mpField[eXLFDWeightName ] = new AttributeStorage(WEIGHT_NORMAL);
- mpField[eXLFDSlant ] = new AttributeStorage(ITALIC_NONE);
- mpField[eXLFDSetwidthName] = new AttributeStorage(WIDTH_NORMAL);
- mpField[eXLFDAddstyleName] = new AttributeStorage(RTL_TEXTENCODING_DONTKNOW);
- mpField[eXLFDCharset ] = new AttributeStorage(RTL_TEXTENCODING_DONTKNOW);
-}
-
-AttributeProvider::~AttributeProvider()
-{
- for ( int i = 0; i < eXLFDMaxEntry; i++ )
- delete mpField[ i ];
-}
-
-#if OSL_DEBUG_LEVEL > 1
-void
-AttributeProvider::Dump()
-{
- for ( int i = 0; i < eXLFDMaxEntry; i++ )
- mpField[ i ]->Dump();
-}
-#endif
-
-extern "C" rtl_TextEncoding
-GetTextEncodingFromAddStylename( const sal_Char *pAddStylename )
-{
- int nBufferLength = strlen( pAddStylename ) + 1;
- sal_Char *pBuffer = (sal_Char*)alloca( nBufferLength );
- for ( int i = 0; i < nBufferLength; i++ )
- pBuffer[i] = pAddStylename[i] == '_' ? '-' : pAddStylename[i] ;
-
- return rtl_getTextEncodingFromUnixCharset( pBuffer );
-}
-
-
-// classification information is needed before sorting because of course the
-// classification is the sort criteria
-void
-AttributeProvider::AddClassification()
-{
- /* mpField[ eXLFDFoundry ] doesn't need classification */
- mpField[ eXLFDFamilyName ]->AddClassification(
- (Attribute*)pFamilyAttribute,
- SAL_N_ELEMENTS(pFamilyAttribute) );
- mpField[ eXLFDWeightName ]->AddClassification(
- (Attribute*)pWeightAttribute,
- SAL_N_ELEMENTS(pWeightAttribute) );
- mpField[ eXLFDSlant ]->AddClassification(
- (Attribute*)pSlantAttribute,
- SAL_N_ELEMENTS(pSlantAttribute) );
- mpField[ eXLFDSetwidthName ]->AddClassification(
- (Attribute*)pSetwidthAttribute,
- SAL_N_ELEMENTS(pSetwidthAttribute) );
- mpField[ eXLFDAddstyleName ]->AddClassification(
- GetTextEncodingFromAddStylename );
- mpField[ eXLFDCharset ]->AddClassification(
- rtl_getTextEncodingFromUnixCharset );
-}
-
-// add some pretty print description
-void
-AttributeProvider::AddAnnotation()
-{
- mpField[ eXLFDFoundry ]->AddAnnotation( AnnotateNone );
- mpField[ eXLFDFamilyName ]->AddAnnotation( AnnotateString );
- mpField[ eXLFDWeightName ]->AddAnnotation( AnnotateString );
- mpField[ eXLFDSlant ]->AddAnnotation( AnnotateSlant );
- mpField[ eXLFDSetwidthName ]->AddAnnotation( AnnotateString );
- mpField[ eXLFDAddstyleName ]->AddAnnotation( AnnotateNone );
- mpField[ eXLFDCharset ]->AddAnnotation( AnnotateNone );
-}
-
-// this is the misc or any section: dirty hacks for dirty xlfd usage
-void
-AttributeProvider::TagFeature()
-{
- mpField[ eXLFDFamilyName ]->TagFeature(
- XLFD_FEATURE_OL_GLYPH
- | XLFD_FEATURE_OL_CURSOR
- | XLFD_FEATURE_NARROW
- | XLFD_FEATURE_INTERFACE_FONT
- | XLFD_FEATURE_APPLICATION_FONT);
-
- mpField[ eXLFDSetwidthName ]->TagFeature(
- XLFD_FEATURE_NARROW );
-
- mpField[ eXLFDAddstyleName ]->TagFeature(
- XLFD_FEATURE_REDUNDANTSTYLE );
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/gdi/xlfd_attr.hxx b/vcl/unx/source/gdi/xlfd_attr.hxx
deleted file mode 100644
index 18386a314e4b..000000000000
--- a/vcl/unx/source/gdi/xlfd_attr.hxx
+++ /dev/null
@@ -1,230 +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 XLFD_ATTRIBUTE_HXX
-#define XLFD_ATTRIBUTE_HXX
-
-#include <salunx.h>
-#include <tools/string.hxx>
-
-
-struct Attribute {
-
- const char* mpName;
- unsigned short mnLength;
- unsigned short mnValue;
- unsigned short mnFeature;
- String* mpAnnotation;
- rtl::OString* mpKeyName;
-
- const char* GetName() const
- { return mpName; }
- unsigned short GetValue() const
- { return mnValue; }
- unsigned short GetLength() const
- { return mnLength; }
- Bool HasFeature( unsigned short nFeature ) const
- { return ((mnFeature & nFeature) != 0); }
- const String &GetAnnotation() const
- { return *mpAnnotation; }
- const rtl::OString&
- GetKey();
- void InitKey();
-
- void SetName( const char *p, int nLen );
- void SetValue( unsigned short nIn )
- { mnValue = nIn; }
- void SetAnnotation( String *pString )
- { mpAnnotation = pString; }
- void SetFeature( unsigned short nFeature )
- { mnFeature = nFeature; }
- void TagFeature( unsigned short nFeature );
-
- int Compare( const char *p, int nLen );
- Bool ExactMatch( const char *p, int nLen );
- void Release();
-};
-
-
-void
-AppendAttribute( Attribute *pAttribute, ByteString &rString );
-
-
-typedef String*(*AttributeAnnotatorT)(const Attribute &rAttribute);
-extern "C" {
-typedef rtl_TextEncoding(*AttributeClassifierT)(const char* pStr);
-}
-
-#define XLFD_FEATURE_NONE 0x0000
-#define XLFD_FEATURE_NARROW 0x0001
-#define XLFD_FEATURE_OL_GLYPH 0x0002
-#define XLFD_FEATURE_OL_CURSOR 0x0004
-#define XLFD_FEATURE_REDUNDANTSTYLE 0x0008
-#define XLFD_FEATURE_APPLICATION_FONT 0x0010
-
-#define XLFD_FEATURE_INTERFACE_FONT 0x0020
-#define XLFD_FEATURE_LQ 0x0040
-#define XLFD_FEATURE_MQ 0x0080
-#define XLFD_FEATURE_HQ 0x0100
-
-// ---------------------------------------------------------------------------
-//
-//
-// manage global lists of Attributes
-// since XListFonts does never list more than 64K fonts this storage does
-// handle array size and indices with unsigned short values for low
-// memory consumption
-//
-//
-// ---------------------------------------------------------------------------
-
-class AttributeStorage {
-
- private:
-
- Attribute* mpList;
- unsigned short mnSize;
- unsigned short mnCount;
- unsigned short mnLastmatch;
- unsigned short mnDefaultValue;
-
- void Enlarge();
- AttributeStorage();
-
- public:
-
- AttributeStorage( unsigned short nDefaultValue );
- ~AttributeStorage();
- unsigned short Insert( const char *pString, int nLength );
- Attribute* Retrieve( unsigned short nIndex ) const ;
- void AddClassification( Attribute *pClassification,
- unsigned short nNum );
- void AddClassification( AttributeClassifierT Classify );
- void TagFeature( unsigned short nFeature );
- void AddAnnotation( AttributeAnnotatorT Annotate );
- #if OSL_DEBUG_LEVEL > 1
- void Dump();
- #endif
-};
-
-
-// ---------------------------------------------------------------------------
-//
-//
-// Attribute provider is a frame for a set of AttributeStorages. For XLFD
-// interpretation and efficient storage, AttributeStorages for foundry,
-// family_name, weight_name, slant, setwidth_name, add_style_name and combined
-// charset_registry and charset_encoding are used. pixel_size, point_size,
-// resolution_x and resolution_y are stored as numbers. please note that this
-// does not allow storage of matrix-enhanced fonts. spacing is stored as
-// a char, since only the 'm', 'c' and 'p' types are defined.
-//
-//
-// ---------------------------------------------------------------------------
-
-enum eXLFDAttributeT {
- eXLFDFoundry = 0,
- eXLFDFamilyName,
- eXLFDWeightName,
- eXLFDSlant,
- eXLFDSetwidthName,
- eXLFDAddstyleName,
- eXLFDCharset,
- eXLFDMaxEntry
-};
-
-class AttributeProvider {
-
- private:
-
- AttributeStorage* mpField[ eXLFDMaxEntry ];
-
- AttributeStorage* GetField( eXLFDAttributeT eXLFDField )
- { return mpField[ eXLFDField]; }
- public:
-
- AttributeProvider ();
- ~AttributeProvider ();
-
- void AddClassification();
- void AddAnnotation();
- void TagFeature();
- #if OSL_DEBUG_LEVEL > 1
- void Dump();
- #endif
-
- // these are just shortcuts or proxies for the most common used
- // AttributeStorage functionality
- AttributeStorage* GetFoundry()
- { return GetField(eXLFDFoundry); }
- AttributeStorage* GetFamily()
- { return GetField(eXLFDFamilyName); }
- AttributeStorage* GetWeight()
- { return GetField(eXLFDWeightName); }
- AttributeStorage* GetSlant()
- { return GetField(eXLFDSlant); }
- AttributeStorage* GetSetwidth()
- { return GetField(eXLFDSetwidthName); }
- AttributeStorage* GetAddstyle()
- { return GetField(eXLFDAddstyleName); }
- AttributeStorage* GetCharset()
- { return GetField(eXLFDCharset); }
-
- Attribute* RetrieveFoundry( unsigned short nIndex )
- { return GetFoundry()->Retrieve(nIndex); }
- Attribute* RetrieveFamily( unsigned short nIndex )
- { return GetFamily()->Retrieve(nIndex); }
- Attribute* RetrieveWeight( unsigned short nIndex )
- { return GetWeight()->Retrieve(nIndex); }
- Attribute* RetrieveSlant( unsigned short nIndex )
- { return GetSlant()->Retrieve(nIndex); }
- Attribute* RetrieveSetwidth( unsigned short nIndex )
- { return GetSetwidth()->Retrieve(nIndex); }
- Attribute* RetrieveAddstyle( unsigned short nIndex )
- { return GetAddstyle()->Retrieve(nIndex); }
- Attribute* RetrieveCharset( unsigned short nIndex )
- { return GetCharset()->Retrieve(nIndex); }
-
- unsigned short InsertFoundry( const char *pString, int nLength )
- { return GetFoundry()->Insert(pString, nLength); }
- unsigned short InsertFamily( const char *pString, int nLength )
- { return GetFamily()->Insert(pString, nLength); }
- unsigned short InsertWeight( const char *pString, int nLength )
- { return GetWeight()->Insert(pString, nLength); }
- unsigned short InsertSlant( const char *pString, int nLength )
- { return GetSlant()->Insert(pString, nLength); }
- unsigned short InsertSetwidth( const char *pString, int nLength )
- { return GetSetwidth()->Insert(pString, nLength);}
- unsigned short InsertAddstyle( const char *pString, int nLength )
- { return GetAddstyle()->Insert(pString, nLength);}
- unsigned short InsertCharset( const char *pString, int nLength )
- { return GetCharset()->Insert(pString, nLength); }
-};
-
-#endif /* XLFD_ATTRIBUTE_HXX */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/gdi/xlfd_extd.cxx b/vcl/unx/source/gdi/xlfd_extd.cxx
deleted file mode 100644
index 6d691de88a79..000000000000
--- a/vcl/unx/source/gdi/xlfd_extd.cxx
+++ /dev/null
@@ -1,1002 +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_vcl.hxx"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "xlfd_attr.hxx"
-#include "xlfd_smpl.hxx"
-#include "xlfd_extd.hxx"
-#include <vcl/outfont.hxx>
-#include <rtl/alloc.h>
-
-#include <rtl/tencinfo.h>
-
-#include <set>
-
-// --------------------------------------------------------------------------
-
-ImplX11FontData::ImplX11FontData( const ExtendedXlfd& rXlfd, int nHeight )
-: ImplFontData( rXlfd, X11IFD_MAGIC ),
- mrXlfd( rXlfd )
-{
- mnHeight = nHeight;
- mnWidth = 0;
-}
-
-ImplFontEntry* ImplX11FontData::CreateFontInstance( ImplFontSelectData& rFSD ) const
-{
- ImplFontEntry* pEntry = new ImplFontEntry( rFSD );
- return pEntry;
-}
-
-sal_IntPtr ImplX11FontData::GetFontId() const
-{
- return reinterpret_cast<sal_IntPtr>(&mrXlfd);
-}
-
-// --------------------------------------------------------------------------
-//
-// classes for Xlfd handling that contain more than a single encoding.
-// Members that may vary through different encodings are stored in
-// a mpEncodingInfo member. There are three different classes:
-// true scalable fonts (truetype and type1) scalable bitmap fonts
-// (the ugly ones) and bitmap fonts. The ExtendedXlfd stores all the members
-// that are specific to a font outline
-// ( e.g. adobe-times-roman-medium-r-normal- X -p- X )
-// and specifies the interface.
-//
-// --------------------------------------------------------------------------
-
-ExtendedXlfd::EncodingInfo&
-ExtendedXlfd::EncodingInfo::operator= ( const Xlfd *pXlfd )
-{
- mcSpacing = pXlfd->mcSpacing;
- mnResolutionX = pXlfd->mnResolutionX;
- mnResolutionY = pXlfd->mnResolutionY;
- mnAddstyle = pXlfd->mnAddstyle;
- mnCharset = pXlfd->mnCharset;
- mnEncoding = pXlfd->GetEncoding();
-
- return *this;
-}
-
-// ------ base class --------------------------------------------------------
-
-ExtendedXlfd::ExtendedXlfd( bool bScalable )
-: mbScalable( bScalable ),
- mnEncodings( 0 ),
- mnEncCapacity( 0 ),
- mpEncodingInfo( NULL )
-{
- mbOrientation = false;
- mbDevice = false;
- mbSubsettable = false;
- mbEmbeddable = false;
-
- mnQuality = -1;
-}
-
-ExtendedXlfd::~ExtendedXlfd()
-{
- if ( mnEncodings != 0 )
- rtl_freeMemory( mpEncodingInfo );
-}
-
-inline void*
-Realloc( void *pPtr, sal_Size nSize )
-{
- return rtl_reallocateMemory( pPtr, nSize );
-}
-
-int
-ExtendedXlfd::GetEncodingIdx( rtl_TextEncoding nEncoding ) const
-{
- for ( int i = 0; i < mnEncodings; i++ )
- if ( nEncoding == mpEncodingInfo[i].mnEncoding )
- return i;
- return -1;
-}
-
-bool
-ExtendedXlfd::HasEncoding( rtl_TextEncoding nEncoding ) const
-{
- return !(GetEncodingIdx( nEncoding ) < 0) ;
-}
-
-rtl_TextEncoding
-ExtendedXlfd::GetEncoding( int i ) const
-{
- if ( i < mnEncodings && i >= 0 )
- return mpEncodingInfo[i].mnEncoding;
-
- return RTL_TEXTENCODING_DONTKNOW;
-}
-
-rtl_TextEncoding
-ExtendedXlfd::GetEncoding() const
-{
- return mnEncodings == 1 ? mpEncodingInfo[0].mnEncoding : RTL_TEXTENCODING_DONTKNOW;
-}
-
-// query the most unicode / Ascii compatible font: either one of the fonts
-// is utf16 encoded or there's a single byte font which is unicode
-// compatible for the first 256 chars (latin1) or for at least 128
-// chars (most latin-X encodings, cyrillic encodings)
-rtl_TextEncoding
-ExtendedXlfd::GetAsciiEncoding( int *pAsciiRange ) const
-{
- rtl_TextEncoding nBestEncoding = RTL_TEXTENCODING_DONTKNOW;
- int nLargestRange = 0x0000;
-
- for ( int i = 0; i < mnEncodings && nLargestRange < 0xffff; i++ )
- {
- rtl_TextEncoding nCurEncoding = mpEncodingInfo[i].mnEncoding;
- switch ( nCurEncoding )
- {
- case RTL_TEXTENCODING_UNICODE:
- nLargestRange = 0xffff;
- nBestEncoding = nCurEncoding;
- break;
-
- case RTL_TEXTENCODING_ISO_8859_1:
- case RTL_TEXTENCODING_MS_1252:
- nLargestRange = 0x00ff;
- nBestEncoding = nCurEncoding;
- break;
-
- case RTL_TEXTENCODING_ISO_8859_2:
- case RTL_TEXTENCODING_ISO_8859_4:
- case RTL_TEXTENCODING_ISO_8859_5:
- case RTL_TEXTENCODING_ISO_8859_6:
- case RTL_TEXTENCODING_ISO_8859_7:
- case RTL_TEXTENCODING_ISO_8859_8:
- case RTL_TEXTENCODING_ISO_8859_9:
- case RTL_TEXTENCODING_ISO_8859_13:
- case RTL_TEXTENCODING_ISO_8859_15:
- case RTL_TEXTENCODING_MS_1251:
- case RTL_TEXTENCODING_KOI8_R:
- case RTL_TEXTENCODING_JIS_X_0201:
- if ( nLargestRange < 0x0080 )
- {
- nLargestRange = 0x0080;
- nBestEncoding = nCurEncoding;
- }
- break;
-
- default:
- if ( nLargestRange == 0x0000 )
- {
- nBestEncoding = nCurEncoding;
- }
- break;
- }
- }
-
- if ( pAsciiRange != NULL )
- *pAsciiRange = nLargestRange;
-
- return nBestEncoding;
-}
-
-bool
-ExtendedXlfd::AddEncoding( const Xlfd *pXlfd )
-{
- rtl_TextEncoding nEncoding = pXlfd->GetEncoding();
- if ( HasEncoding(nEncoding) )
- return false;
-
- if ( mnEncodings == 0 )
- {
- // bootstrap
- mnFoundry = pXlfd->mnFoundry;
- mnFamily = pXlfd->mnFamily;
- mnWeight = pXlfd->mnWeight;
- mnSlant = pXlfd->mnSlant;
- mnSetwidth = pXlfd->mnSetwidth;
- mpFactory = pXlfd->mpFactory;
-
- Attribute *pFamilyAttr = mpFactory->RetrieveFamily( mnFamily );
- Attribute *pWeightAttr = mpFactory->RetrieveWeight( mnWeight );
- Attribute *pWidthAttr = mpFactory->RetrieveSetwidth( mnSetwidth );
- Attribute *pSlantAttr = mpFactory->RetrieveSlant( mnSlant );
-
- meFamily = GetFamilyType();
- meWeight = GetWeight();
- meItalic = GetSlant();
- meWidthType = GetWidthType();
- mbSymbolFlag= (GetEncoding() == RTL_TEXTENCODING_SYMBOL);
- mePitch = GetPitch();
-
- maName = pFamilyAttr->GetAnnotation();
-
- // the helvetica narrow hack
- if ( ! pFamilyAttr->HasFeature(XLFD_FEATURE_NARROW)
- && pWidthAttr->HasFeature(XLFD_FEATURE_NARROW) )
- {
- static const String aNarrow( RTL_CONSTASCII_USTRINGPARAM(" Narrow") );
- maName += aNarrow;
- }
-
- // stylename = weight + slant + width
- // XXX Fix me: there may be a space missing between them
- if ( meWeight != WEIGHT_NORMAL )
- maStyleName += pWeightAttr->GetAnnotation();
- if ( meItalic != ITALIC_NONE )
- maStyleName += pSlantAttr->GetAnnotation();
- if ( (meWidthType != WIDTH_NORMAL)
- && (! pWidthAttr->HasFeature(XLFD_FEATURE_NARROW)) )
- maStyleName += pWidthAttr->GetAnnotation();
- }
-
- if( mnEncodings <= mnEncCapacity )
- {
- mnEncCapacity += mnEncodings + 4;
- mpEncodingInfo = (EncodingInfo*)Realloc( mpEncodingInfo, mnEncCapacity * sizeof(EncodingInfo) );
- }
-
- mpEncodingInfo[ mnEncodings ] = pXlfd;
- mnEncodings += 1;
- return true;
-}
-
-void
-ExtendedXlfd::ToString( ByteString &rString,
- unsigned short /*nPixelSize*/, rtl_TextEncoding /*nEncoding*/ ) const
-{
- AppendAttribute( mpFactory->RetrieveFoundry(mnFoundry), rString );
- AppendAttribute( mpFactory->RetrieveFamily(mnFamily), rString );
- AppendAttribute( mpFactory->RetrieveWeight(mnWeight), rString );
- AppendAttribute( mpFactory->RetrieveSlant(mnSlant), rString );
- AppendAttribute( mpFactory->RetrieveSetwidth(mnSetwidth), rString );
-}
-
-void
-ExtendedXlfd::ToString( ByteString &rString,
- unsigned short /*nPixelSize*/, char* /*pMatricsString*/, rtl_TextEncoding /*nEncoding*/ ) const
-{
- AppendAttribute( mpFactory->RetrieveFoundry(mnFoundry), rString );
- AppendAttribute( mpFactory->RetrieveFamily(mnFamily), rString );
- AppendAttribute( mpFactory->RetrieveWeight(mnWeight), rString );
- AppendAttribute( mpFactory->RetrieveSlant(mnSlant), rString );
- AppendAttribute( mpFactory->RetrieveSetwidth(mnSetwidth), rString );
-}
-
-static FontPitch GetPitchFromX11Pitch( const char cSpacing )
-{
- switch ( cSpacing )
- {
- case 'c': // fall through
- case 'm': return PITCH_FIXED;
- case 'p': return PITCH_VARIABLE;
- default: return PITCH_DONTKNOW;
- }
-}
-
-// you must not call any of the ExtendedXlfd::GetXXX() functions if the
-// ExtendedXlfd is really empty (i.e. mnEncodings is zero)
-
-FontPitch ExtendedXlfd::GetPitch() const
-{
- if( mnEncodings > 1 )
- return PITCH_VARIABLE;
- if( mnEncodings == 1 )
- return GetPitchFromX11Pitch( mpEncodingInfo[0].mcSpacing );
- return PITCH_DONTKNOW;
-}
-
-FontPitch ExtendedXlfd::GetPitch( rtl_TextEncoding nEncoding ) const
-{
- for ( int nIdx = 0; nIdx < mnEncodings; nIdx++ )
- if ( mpEncodingInfo[nIdx].mnEncoding == nEncoding )
- return GetPitchFromX11Pitch( mpEncodingInfo[nIdx].mcSpacing );
- return PITCH_DONTKNOW;
-}
-
-FontFamily ExtendedXlfd::GetFamilyType() const
-{
- Attribute *pFamilyAttr= mpFactory->RetrieveFamily(mnFamily);
- return (FontFamily)pFamilyAttr->GetValue();
-}
-
-FontWeight ExtendedXlfd::GetWeight() const
-{
- Attribute *pWeightAttr = mpFactory->RetrieveWeight(mnWeight);
- return (FontWeight)pWeightAttr->GetValue();
-}
-
-FontItalic ExtendedXlfd::GetSlant() const
-{
- Attribute *pSlantAttr = mpFactory->RetrieveSlant(mnSlant);
- return (FontItalic)pSlantAttr->GetValue();
-}
-
-FontWidth ExtendedXlfd::GetWidthType() const
-{
- Attribute *pWidthAttr = mpFactory->RetrieveSetwidth(mnSetwidth);
- return (FontWidth)pWidthAttr->GetValue();
-}
-
-class CodeRange
-{
-public:
- CodeRange( int nMin, int nEnd ) : mnMin( nMin ), mnEnd( nEnd ) {}
-
- sal_uInt32 GetMin() const { return mnMin; }
- sal_uInt32 GetEnd() const { return mnEnd; }
-
- bool operator<( const CodeRange& r ) const
- { return (mnMin<r.mnMin) || ((mnMin==r.mnMin) && (mnEnd<r.mnEnd)); }
-
-private:
- sal_uInt32 mnMin, mnEnd;
-};
-
-
-int ExtendedXlfd::GetFontCodeRanges( sal_uInt32* pCodePairs ) const
-{
- bool bHasUnicode = false;
- bool bHasUnknownEncoding = false;
-
- // approximate unicode ranges from encodings
- typedef std::set<CodeRange> RangeSet;
- RangeSet aRangeSet;
-
- for( unsigned short i = 0; i < mnEncodings; ++i )
- {
- // TODO: move encoding -> unicode range mapping to RTL
- // NOTE: for now only some are VERY roughly approximated
- const rtl_TextEncoding eEncoding = mpEncodingInfo[i].mnEncoding;
- switch( mpEncodingInfo[i].mnEncoding )
- {
- case RTL_TEXTENCODING_SYMBOL: // postscript symbol encoding
- aRangeSet.insert( CodeRange( 0x0020, 0x0100 ) ); // symbol aliasing
- aRangeSet.insert( CodeRange( 0xF020, 0xF100 ) );
- break;
-
- case RTL_TEXTENCODING_ISO_8859_15:
- aRangeSet.insert( CodeRange( 0x20AC, 0x20AD ) ); // Euro currency symbol
- // fall through
- case RTL_TEXTENCODING_APPLE_ROMAN:
- case RTL_TEXTENCODING_ISO_8859_1:
- case RTL_TEXTENCODING_MS_1252:
- case RTL_TEXTENCODING_IBM_437:
- case RTL_TEXTENCODING_IBM_852:
- aRangeSet.insert( CodeRange( 0x0020, 0x0080 ) );
- aRangeSet.insert( CodeRange( 0x00A0, 0x0100 ) );
- break;
-
- // Traditional, Simplified, Japanese
- case RTL_TEXTENCODING_APPLE_CHINSIMP:
- case RTL_TEXTENCODING_APPLE_CHINTRAD:
- case RTL_TEXTENCODING_APPLE_JAPANESE:
- case RTL_TEXTENCODING_SHIFT_JIS:
- case RTL_TEXTENCODING_GB_2312:
- case RTL_TEXTENCODING_GBT_12345:
- case RTL_TEXTENCODING_GBK:
- case RTL_TEXTENCODING_BIG5:
- case RTL_TEXTENCODING_EUC_JP:
- case RTL_TEXTENCODING_EUC_CN:
- case RTL_TEXTENCODING_EUC_TW:
- case RTL_TEXTENCODING_ISO_2022_JP:
- case RTL_TEXTENCODING_ISO_2022_CN:
- case RTL_TEXTENCODING_GB_18030:
- case RTL_TEXTENCODING_BIG5_HKSCS:
- case RTL_TEXTENCODING_JIS_X_0201:
- case RTL_TEXTENCODING_JIS_X_0208:
- case RTL_TEXTENCODING_JIS_X_0212:
- case RTL_TEXTENCODING_MS_932:
- case RTL_TEXTENCODING_MS_936:
- case RTL_TEXTENCODING_MS_950:
- aRangeSet.insert( CodeRange( 0x3000, 0xA000 ) );
- aRangeSet.insert( CodeRange( 0xF900, 0xFB00 ) );
- break;
-
- // Korean
- case RTL_TEXTENCODING_APPLE_KOREAN:
- case RTL_TEXTENCODING_MS_949:
- case RTL_TEXTENCODING_MS_1361:
- case RTL_TEXTENCODING_EUC_KR:
- case RTL_TEXTENCODING_ISO_2022_KR:
- aRangeSet.insert( CodeRange( 0x1100, 0x1200 ) );
- aRangeSet.insert( CodeRange( 0x3130, 0x3190 ) );
- aRangeSet.insert( CodeRange( 0xAC00, 0xD7A4 ) );
- break;
-
- // unknown encoding
- case RTL_TEXTENCODING_DONTKNOW:
- bHasUnknownEncoding = true;
- break;
-
- // Unicode
- case RTL_TEXTENCODING_UNICODE:
- case RTL_TEXTENCODING_UTF7:
- case RTL_TEXTENCODING_UTF8:
- bHasUnicode = true;
- break;
-
- // misc 8bit encodings
- default:
- if( !rtl_isOctetTextEncoding( eEncoding ) )
- bHasUnknownEncoding = true;
- else
- {
- // use the unicode converter to get the coverage of an 8bit encoding
- rtl_TextToUnicodeConverter aConverter = rtl_createTextToUnicodeConverter( eEncoding );
- rtl_UnicodeToTextContext aCvtContext = rtl_createTextToUnicodeContext( aConverter );
- if( !aConverter || !aCvtContext )
- bHasUnknownEncoding = true;
- else
- {
- sal_Char cCharsInp[ 0x100 ];
- for( int j = 0x20; j < 0x080; ++j )
- cCharsInp[ j-0x20 ] = j;
- for( int j = 0xA0; j < 0x100; ++j )
- cCharsInp[ j-0x40 ] = j;
-
- sal_Unicode cCharsOut[ 0x100 ];
- sal_uInt32 nCvtInfo;
- sal_Size nSrcCvtBytes;
- int nOutLen = rtl_convertTextToUnicode(
- aConverter, aCvtContext,
- cCharsInp, 0xC0,
- cCharsOut, sizeof(cCharsOut)/sizeof(*cCharsOut),
- RTL_TEXTTOUNICODE_FLAGS_INVALID_IGNORE
- | RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE,
- &nCvtInfo, &nSrcCvtBytes );
-
- for( int j = 0; j < nOutLen; ++j )
- aRangeSet.insert( CodeRange( cCharsOut[j], cCharsOut[j]+1 ) );
-
- rtl_destroyTextToUnicodeConverter( aCvtContext );
- rtl_destroyTextToUnicodeConverter( aConverter );
- }
- }
- break;
- }
- }
-
- // unicode encoded fonts usually do not cover the entire unicode range
- // => only use them to determine coverage when no other encodings are available
- if( aRangeSet.empty() && (bHasUnicode || bHasUnknownEncoding) )
- {
- if( pCodePairs )
- {
- pCodePairs[0] = 0x0020;
- pCodePairs[1] = 0xD800;
- pCodePairs[2] = 0xE000;
- pCodePairs[3] = 0xFFFE;
- }
- return 2;
- }
-
- if( aRangeSet.empty() )
- return 0;
-
- // sort and merge the code pairs
- sal_uInt32* pDst = pCodePairs;
- RangeSet::const_iterator it = aRangeSet.begin();
- for( sal_uInt32 nEnd = 0; it != aRangeSet.end(); ++it )
- {
- // check overlap with to previous range
- const CodeRange& rSrc = *it;
- if( nEnd < rSrc.GetMin() )
- {
- nEnd = rSrc.GetEnd();
- if( pCodePairs )
- {
- pDst[0] = rSrc.GetMin();
- pDst[1] = rSrc.GetEnd();
- }
- pDst += 2;
- }
- else
- {
- // merge overlapping ranges
- if( nEnd < rSrc.GetEnd() )
- {
- nEnd = rSrc.GetEnd();
- if( pCodePairs )
- pDst[-1] = nEnd;
- }
- }
- }
-
- int nRangeCount = (pDst - pCodePairs) / 2;
- return nRangeCount;
-}
-
-// ------ class to handle scalable bitmap fonts ------------------------------
-
-ScalableBitmapXlfd::ScalableBitmapXlfd()
-: ExtendedXlfd( true )
-{}
-
-ScalableBitmapXlfd::~ScalableBitmapXlfd()
-{}
-
-void
-ScalableBitmapXlfd::ToString( ByteString &rString,
- unsigned short nPixelSize, rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtendedXlfd::ToString( rString, nPixelSize, nEncoding );
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
-
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
-
- rString += '-';
- rString += ByteString::CreateFromInt32( nPixelSize );
- rString += "-0-";
- rString += ByteString::CreateFromInt32( rInfo.mnResolutionX );
- rString += '-';
- rString += ByteString::CreateFromInt32( rInfo.mnResolutionY );
- rString += '-';
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-0";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-void
-ScalableBitmapXlfd::ToString( ByteString &rString,
- unsigned short nPixelSize, char *pMatricsString, rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtendedXlfd::ToString( rString, nPixelSize, nEncoding );
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
-
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
-
- rString += "-*-";
- char pTmp[256];
- snprintf( pTmp, sizeof(pTmp), pMatricsString, nPixelSize, nPixelSize );
- rString += pTmp;
- rString += "-*-*-";
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-*";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-ImplFontData* ScalableBitmapXlfd::GetImplFontData() const
-{
- ImplX11FontData* pFontData = new ImplX11FontData( *this, 0 );
- pFontData->mnQuality= 0;
- return pFontData;
-}
-
-// ------ class to handle true bitmap fonts ----------------------------------
-
-void
-BitmapXlfd::ToString( ByteString &rString,
- unsigned short nPixelSize, char *pMatricsString, rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtendedXlfd::ToString( rString, nPixelSize, nEncoding );
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
-
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
-
- rString += "-*-";
- char pTmp[256];
- snprintf( pTmp, sizeof(pTmp), pMatricsString, nPixelSize, nPixelSize );
- rString += pTmp;
- rString += "-*-*-";
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-*";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-BitmapXlfd::BitmapXlfd( )
-: ExtendedXlfd( false )
-{}
-
-BitmapXlfd::~BitmapXlfd( )
-{}
-
-bool
-BitmapXlfd::AddEncoding( const Xlfd *pXlfd )
-{
- if ( mnEncodings == 0 )
- {
- mnPixelSize = pXlfd->mnPixelSize;
- mnPointSize = pXlfd->mnPointSize;
- mnAverageWidth = pXlfd->mnAverageWidth;
- }
-
- return ExtendedXlfd::AddEncoding( pXlfd );
-}
-
-void
-BitmapXlfd::ToString( ByteString &rString,
- unsigned short nPixelSize, rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtendedXlfd::ToString( rString, nPixelSize, nEncoding );
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
- rString += '-';
- rString += ByteString::CreateFromInt32( mnPixelSize );
- rString += "-*-*-*-";
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-*";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-ImplFontData* BitmapXlfd::GetImplFontData() const
-{
- ImplX11FontData* pFontData = new ImplX11FontData( *this, mnPixelSize );
- pFontData->mnQuality= 100;
- return pFontData;
-}
-
-// ------ class to handle true scalable fonts --------------------------------
-
-ScalableXlfd::ScalableXlfd()
-: ExtendedXlfd( true )
-{}
-
-ScalableXlfd::~ScalableXlfd()
-{}
-
-void
-ScalableXlfd::ToString( ByteString &rString,
- unsigned short nPixelSize, rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtendedXlfd::ToString( rString, nPixelSize, nEncoding);
-
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
-
- rString += '-';
- rString += ByteString::CreateFromInt32( nPixelSize );
- rString += "-0-0-0-";
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-0";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-void
-ScalableXlfd::ToString( ByteString &rString,
- unsigned short nPixelSize, char* pMatricsString, rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtendedXlfd::ToString( rString, nPixelSize, nEncoding);
-
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
-
- rString += "-*-";
- char pTmp[256];
- snprintf( pTmp, sizeof(pTmp), pMatricsString, nPixelSize, nPixelSize );
- rString += pTmp;
- rString += "-*-*-";
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-*";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-ImplFontData* ScalableXlfd::GetImplFontData() const
-{
- ImplX11FontData* pFontData = new ImplX11FontData( *this, 0 );
- pFontData->mnQuality= 200;
- return pFontData;
-}
-
-/* ------- virtual fonts for user interface ------------------------------- */
-
-VirtualXlfd::ExtEncodingInfo&
-VirtualXlfd::ExtEncodingInfo::operator= ( const Xlfd *pXlfd )
-{
- mnFoundry = pXlfd->mnFoundry;
- mnFamily = pXlfd->mnFamily;
- mnWeight = pXlfd->mnWeight;
- mnSlant = pXlfd->mnSlant;
- mnSetwidth = pXlfd->mnSetwidth;
-
- return *this;
-}
-
-VirtualXlfd::VirtualXlfd()
-: ExtendedXlfd( true ),
- mnExtCapacity(0),
- mpExtEncodingInfo(NULL)
-{
- mnFoundry = 0;
- mnFamily = 0;
- mnWeight = 0;
- mnSlant = 0;
- mnSetwidth = 0;
-}
-
-VirtualXlfd::~VirtualXlfd()
-{
- if ( mpExtEncodingInfo != NULL )
- rtl_freeMemory( mpExtEncodingInfo );
-}
-
-int
-VirtualXlfd::GetFontQuality (unsigned short nFamily)
-{
- Attribute *pFamily = mpFactory->RetrieveFamily(nFamily);
- int nQuality = 0;
-
- if (pFamily->HasFeature(XLFD_FEATURE_HQ))
- nQuality += 16;
- if (pFamily->HasFeature(XLFD_FEATURE_MQ))
- nQuality += 8;
- if (pFamily->HasFeature(XLFD_FEATURE_LQ))
- nQuality += 4;
- return nQuality;
-}
-
-bool
-VirtualXlfd::AddEncoding( const Xlfd *pXlfd )
-{
- // add new font
- bool bRC = ExtendedXlfd::AddEncoding( pXlfd );
-
- int nIdx;
- if( bRC )
- {
- // new encoding => append the new pXlfd
- nIdx = mnEncodings - 1;
- if( nIdx >= mnExtCapacity )
- {
- mnExtCapacity = mnEncCapacity;
- mpExtEncodingInfo = (ExtEncodingInfo*)Realloc( mpExtEncodingInfo,
- mnExtCapacity * sizeof(ExtEncodingInfo) );
- }
- }
- else
- {
- // existing encoding => check if the new pXlfd is better
- rtl_TextEncoding nEncoding = pXlfd->GetEncoding();
- nIdx = GetEncodingIdx( nEncoding );
-
- int nOldQuality = GetFontQuality( mpExtEncodingInfo[nIdx].mnFamily );
- int nNewQuality = GetFontQuality( pXlfd->mnFamily );
- if( nOldQuality >= nNewQuality )
- return false;
- }
-
- mpExtEncodingInfo[ nIdx ] = pXlfd;
- return true;
-}
-
-void
-VirtualXlfd::FilterInterfaceFont (const Xlfd *pXlfd)
-{
- Attribute *pAttr;
- AttributeProvider *pFactory = pXlfd->mpFactory;
-
- if (! pXlfd->Fonttype() == TYPE_SCALABLE)
- return;
- pAttr = pFactory->RetrieveFamily(pXlfd->mnFamily);
- if (! pAttr->HasFeature(XLFD_FEATURE_INTERFACE_FONT))
- return;
- pAttr = pFactory->RetrieveSlant(pXlfd->mnSlant);
- if (! (FontItalic)pAttr->GetValue() == ITALIC_NONE)
- return;
- pAttr = pFactory->RetrieveSetwidth(pXlfd->mnSetwidth);
- if (pAttr->HasFeature(XLFD_FEATURE_NARROW))
- return;
- pAttr = pFactory->RetrieveWeight(pXlfd->mnWeight);
- FontWeight eWeight = (FontWeight)pAttr->GetValue();
- if ((eWeight != WEIGHT_NORMAL) && (eWeight != WEIGHT_MEDIUM))
- return;
-
- AddEncoding (pXlfd);
-}
-
-void
-VirtualXlfd::ToString( ByteString &rString, unsigned short nPixelSize,
- rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtEncodingInfo &rExtInfo = mpExtEncodingInfo[ nIdx ];
-
- AppendAttribute( mpFactory->RetrieveFoundry(rExtInfo.mnFoundry), rString );
- AppendAttribute( mpFactory->RetrieveFamily(rExtInfo.mnFamily), rString );
- AppendAttribute( mpFactory->RetrieveWeight(rExtInfo.mnWeight), rString );
- AppendAttribute( mpFactory->RetrieveSlant(rExtInfo.mnSlant), rString );
- AppendAttribute( mpFactory->RetrieveSetwidth(rExtInfo.mnSetwidth), rString );
-
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
-
- rString += '-';
- rString += ByteString::CreateFromInt32( nPixelSize );
- rString += "-0-0-0-";
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-0";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-void
-VirtualXlfd::ToString( ByteString &rString, unsigned short nPixelSize,
- char* pMatricsString, rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtEncodingInfo &rExtInfo = mpExtEncodingInfo[ nIdx ];
-
- AppendAttribute( mpFactory->RetrieveFoundry(rExtInfo.mnFoundry), rString );
- AppendAttribute( mpFactory->RetrieveFamily(rExtInfo.mnFamily), rString );
- AppendAttribute( mpFactory->RetrieveWeight(rExtInfo.mnWeight), rString );
- AppendAttribute( mpFactory->RetrieveSlant(rExtInfo.mnSlant), rString );
- AppendAttribute( mpFactory->RetrieveSetwidth(rExtInfo.mnSetwidth), rString );
-
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
-
- rString += "-*-";
- char pTmp[256];
- snprintf( pTmp, sizeof(pTmp), pMatricsString, nPixelSize, nPixelSize );
- rString += pTmp;
- rString += "-*-*-";
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-*";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-ImplFontData* VirtualXlfd::GetImplFontData() const
-{
- ImplX11FontData* pFontData = new ImplX11FontData( *this, 0 );
-
- // family name
- static const String aFontName( RTL_CONSTASCII_USTRINGPARAM("Interface User") );
- pFontData->maName = aFontName;
- // pFontData->maStyleName = aStyleName;
- pFontData->meFamily = FAMILY_SWISS;
- pFontData->meWeight = WEIGHT_NORMAL;
- pFontData->meItalic = ITALIC_NONE;
- pFontData->meWidthType = WIDTH_NORMAL;
- pFontData->mePitch = PITCH_VARIABLE;
-
- pFontData->mbSymbolFlag = false;
- pFontData->mbOrientation= false;
- pFontData->mbDevice = true;
- pFontData->mnQuality = 100;
-
- return pFontData;
-}
-
-// ------ font list -------------------------------------------------------
-
-XlfdStorage::XlfdStorage()
-{
- maXlfdList.reserve( 256 );
-}
-
-void
-XlfdStorage::Dispose()
-{
- XlfdList::const_iterator it = maXlfdList.begin();
- for(; it != maXlfdList.end(); ++it )
- delete *it;
- maXlfdList.clear();
-}
-
-void
-XlfdStorage::Reset()
-{
- maXlfdList.clear();
-}
-
-void
-XlfdStorage::Add( const ExtendedXlfd* pXlfd )
-{
- if ( pXlfd != NULL )
- maXlfdList.push_back( pXlfd );
-}
-
-void
-XlfdStorage::Add( const XlfdStorage* pXlfd )
-{
- if ( !pXlfd || pXlfd->maXlfdList.empty() )
- return;
-
- maXlfdList.reserve( maXlfdList.size() + pXlfd->maXlfdList.size() );
- XlfdList::const_iterator it = pXlfd->maXlfdList.begin();
- for(; it != pXlfd->maXlfdList.end(); ++it )
- maXlfdList.push_back( *it );
-}
-
-void XlfdStorage::AnnounceFonts( ImplDevFontList* pList ) const
-{
- XlfdList::const_iterator it = maXlfdList.begin();
- for(; it != maXlfdList.end(); ++it )
- {
- const ExtendedXlfd* pXlfd = *it;
- ImplFontData* pFontData = pXlfd->GetImplFontData();
- pList->Add( pFontData );
- }
-}
-
-// ------ bitmap font list --------------------------------------------------
-
-void
-BitmapXlfdStorage::AddBitmapFont( const Xlfd *pXlfd )
-{
- if ( pXlfd == NULL )
- return;
-
- int nPixelSize = pXlfd->mnPixelSize;
- XlfdList::const_iterator it = maXlfdList.begin();
- for(; it != maXlfdList.end(); ++it )
- {
- BitmapXlfd* pBitmapXlfd = (BitmapXlfd*)*it;
- if( nPixelSize == pBitmapXlfd->GetPixelSize() )
- {
- // we need to add an encoding to an existing bitmap font
- pBitmapXlfd->AddEncoding( pXlfd );
- return;
- }
- }
-
- // we have a new bitmap font
- BitmapXlfd* pBitmapXlfd = new BitmapXlfd;
- pBitmapXlfd->AddEncoding( pXlfd );
- Add( pBitmapXlfd );
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/gdi/xlfd_extd.hxx b/vcl/unx/source/gdi/xlfd_extd.hxx
deleted file mode 100644
index 306b9be74967..000000000000
--- a/vcl/unx/source/gdi/xlfd_extd.hxx
+++ /dev/null
@@ -1,271 +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 XLFD_EXTENDED_HXX
-#define XLFD_EXTENDED_HXX
-
-#include <salunx.h>
-#include <vcl/vclenum.hxx>
-#include <vcl/outfont.hxx>
-
-#include <vector>
-
-class Xlfd;
-class AttributeProvider;
-class ImplDevFontList;
-class ByteString;
-
-// --------------------------------------------------------------------------
-//
-// classes for Xlfd handling that contain more than a single encoding.
-// Members that may vary through different encodings are stored in
-// a mpEncodingInfo member. There are three different classes:
-// true scalable fonts (truetype and type1) scalable bitmap fonts
-// (the ugly ones) and bitmap fonts. The ExtendedXlfd stores all the members
-// that are specific to a font outline
-// ( e.g. adobe-times-roman-medium-r-normal- * -p- * )
-// and specifies the interface.
-//
-// --------------------------------------------------------------------------
-
-// base class
-
-class ExtendedXlfd : public ImplDevFontAttributes
-{
- public:
- ExtendedXlfd( bool bScalable );
- virtual ~ExtendedXlfd();
- virtual bool AddEncoding( const Xlfd* );
- bool HasEncoding( rtl_TextEncoding ) const;
- int GetEncodingIdx( rtl_TextEncoding nEncoding ) const;
- unsigned short NumEncodings() const
- { return mnEncodings; }
- virtual int GetPixelSize() const
- { return 0; }
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- rtl_TextEncoding nEncoding ) const ;
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- char* pMatricsString,
- rtl_TextEncoding nEncoding ) const;
-
- virtual ImplFontData* GetImplFontData() const = 0;
- bool IsScalable() const { return mbScalable; }
- virtual FontFamily GetFamilyType() const;
- virtual FontWeight GetWeight() const;
- virtual FontItalic GetSlant() const;
- virtual FontWidth GetWidthType() const;
- virtual FontPitch GetPitch() const;
- virtual FontPitch GetPitch( rtl_TextEncoding ) const;
- rtl_TextEncoding GetAsciiEncoding( int *pAsciiRange = NULL ) const;
- rtl_TextEncoding GetEncoding() const;
- rtl_TextEncoding GetEncoding( int i ) const;
-
- int GetFontCodeRanges( sal_uInt32* pCodePairs ) const;
-
- protected:
- AttributeProvider* mpFactory;
-
- public:
- unsigned short mnFoundry;
- unsigned short mnFamily;
- unsigned short mnWeight;
- unsigned short mnSlant;
- unsigned short mnSetwidth;
- bool mbScalable;
-
- protected:
- unsigned short mnEncodings;
- unsigned short mnEncCapacity;
- struct EncodingInfo {
- unsigned char mcSpacing;
- unsigned short mnResolutionX;
- unsigned short mnResolutionY;
- unsigned short mnAddstyle;
- unsigned short mnCharset;
- rtl_TextEncoding mnEncoding;
-
- EncodingInfo& operator= ( const Xlfd *pXlfd );
- } *mpEncodingInfo;
-};
-
-// class to handle scalable bitmap fonts
-
-class ScalableBitmapXlfd : public ExtendedXlfd {
-
- public:
- ScalableBitmapXlfd();
- virtual ~ScalableBitmapXlfd();
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- rtl_TextEncoding nEncoding ) const;
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- char* pMatricsString,
- rtl_TextEncoding nEncoding ) const;
-
- virtual ImplFontData* GetImplFontData() const ;
-};
-
-// class to handle true bitmap fonts
-
-class ScalableXlfd;
-
-class BitmapXlfd : public ExtendedXlfd {
-
- public:
- BitmapXlfd();
- ~BitmapXlfd();
- bool AddEncoding( const Xlfd* );
- virtual int GetPixelSize() const
- { return mnPixelSize; }
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- rtl_TextEncoding nEncoding ) const;
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- char* pMatricsString,
- rtl_TextEncoding nEncoding ) const;
- virtual ImplFontData* GetImplFontData() const ;
- protected:
-
- unsigned short mnPixelSize;
- unsigned short mnPointSize;
- unsigned short mnAverageWidth;
-};
-
-// class to handle true scalable fonts
-
-class ScalableXlfd : public ExtendedXlfd {
-
- friend class BitmapXlfd;
-
- public:
- ScalableXlfd();
- virtual ~ScalableXlfd();
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- rtl_TextEncoding nEncoding ) const;
-
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- char* pMatricsString,
- rtl_TextEncoding nEncoding ) const;
- virtual ImplFontData* GetImplFontData() const ;
-};
-
-// class to maintain a list of fonts ( bitmap and scalable )
-
-class XlfdStorage {
-
- public:
- XlfdStorage();
-
- void Dispose();
- void Reset();
-
- void Add( const ExtendedXlfd *pXlfd );
- void Add( const XlfdStorage *pXlfd );
- void AnnounceFonts( ImplDevFontList* ) const;
-
- protected:
-
- typedef ::std::vector<const ExtendedXlfd*> XlfdList;
- XlfdList maXlfdList;
-};
-
-// list of fonts specific for bitmap fonts
-
-class BitmapXlfdStorage : public XlfdStorage {
-
- public:
-
- void AddBitmapFont( const Xlfd *pXlfd );
-};
-
-
-/* Virtual font for User Interface */
-
-class VirtualXlfd : public ExtendedXlfd
-{
- private:
-
- int GetFontQuality (unsigned short nFamily);
-
- public:
- VirtualXlfd();
- virtual ~VirtualXlfd();
- virtual bool AddEncoding( const Xlfd* );
- void FilterInterfaceFont (const Xlfd *pXlfd);
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- rtl_TextEncoding nEncoding ) const ;
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- char* pMatricsString,
- rtl_TextEncoding nEncoding ) const;
-
- virtual ImplFontData* GetImplFontData() const ;
- protected:
-
- unsigned short mnExtCapacity;
- struct ExtEncodingInfo {
- unsigned short mnFoundry;
- unsigned short mnFamily;
- unsigned short mnWeight;
- unsigned short mnSlant;
- unsigned short mnSetwidth;
-
- ExtEncodingInfo& operator= ( const Xlfd *pXlfd );
- } *mpExtEncodingInfo;
-
- friend class ExtEncodingInfo;
-};
-
-
-// class to describe a X11 physically available font face
-
-class ImplX11FontData : public ImplFontData
-{
-private:
- enum { X11IFD_MAGIC = 0x111FDA1C };
- const ExtendedXlfd& mrXlfd;
-
-public:
- ImplX11FontData( const ExtendedXlfd&, int nHeight );
- const ExtendedXlfd& GetExtendedXlfd() const { return mrXlfd; }
- virtual ImplFontData* Clone() const { return new ImplX11FontData( *this ); }
- virtual ImplFontEntry* CreateFontInstance( ImplFontSelectData& ) const;
- virtual sal_IntPtr GetFontId() const;
-
- static bool CheckFontData( const ImplFontData& r ) { return r.CheckMagic( X11IFD_MAGIC ); }
-};
-
-#endif /* XLFD_EXTENDED_HXX */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/gdi/xlfd_smpl.cxx b/vcl/unx/source/gdi/xlfd_smpl.cxx
deleted file mode 100644
index d9100a794c72..000000000000
--- a/vcl/unx/source/gdi/xlfd_smpl.cxx
+++ /dev/null
@@ -1,270 +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_vcl.hxx"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "xlfd_attr.hxx"
-#include "xlfd_smpl.hxx"
-
-// --------------------------------------------------------------------------
-//
-//
-// broken down structure equivalent to a Xlfd string
-//
-//
-// --------------------------------------------------------------------------
-
-Xlfd::Xlfd()
-{
-}
-
-// XlfdCompare abi has to be qsort(3) compatible, the sorting result must
-// guarantee that fonts with SameFontoutline() are successive
-// XlfdCompare relies on vFrom->mpFactory eq vTo->mpFactory. Since comparing
-// Xlfd's is done by comparing attributes there is no way around this.
-extern "C" int
-XlfdCompare( const void *vFrom, const void *vTo )
-{
- const Xlfd *pFrom = (Xlfd*)vFrom;
- const Xlfd *pTo = (Xlfd*)vTo;
-
- // Compare outline description
- if ( pFrom->mnFoundry != pTo->mnFoundry )
- return (int)pFrom->mnFoundry - (int)pTo->mnFoundry;
- if ( pFrom->mnFamily != pTo->mnFamily )
- return (int)pFrom->mnFamily - (int)pTo->mnFamily;
- if ( pFrom->mnWeight != pTo->mnWeight )
- return (int)pFrom->mnWeight - (int)pTo->mnWeight;
- if ( pFrom->mnSlant != pTo->mnSlant )
- return (int)pFrom->mnSlant - (int)pTo->mnSlant;
- if ( pFrom->mnSetwidth != pTo->mnSetwidth )
- return (int)pFrom->mnSetwidth - (int)pTo->mnSetwidth;
-
- // Addstyle name is futile tricky. it may contain encoding information
- // (like "ansi_1251") which Compares equal, or it may contain style
- // information (like "serif") which Compares unequal, anyway if the font
- // is "interface user" or "interface system" then compare equal anyway to
- // build fontsets as large as possible
- if ( pFrom->mnAddstyle == pTo->mnAddstyle )
- return 0;
-
- AttributeProvider *pFactory = pFrom->mpFactory;
- Attribute *pFamily = pFactory->RetrieveFamily( pFrom->mnFamily );
- if ( pFamily->HasFeature(XLFD_FEATURE_APPLICATION_FONT) )
- return 0;
-
- Attribute *pFromAddStyle = pFactory->RetrieveAddstyle( pFrom->mnAddstyle );
- Attribute *pToAddStyle = pFactory->RetrieveAddstyle( pTo->mnAddstyle );
-
- // if both addstyles denote encodings or if one denotes an
- // encoding and the other denotes a style which really
- // duplicates weight and slant information
-
- int nFromCompare = (pFromAddStyle->GetValue() != RTL_TEXTENCODING_DONTKNOW)
- || (pFromAddStyle->HasFeature(XLFD_FEATURE_REDUNDANTSTYLE)) ?
- -1 : pFrom->mnAddstyle;
- int nToCompare = (pToAddStyle->GetValue() != RTL_TEXTENCODING_DONTKNOW)
- || (pToAddStyle->HasFeature(XLFD_FEATURE_REDUNDANTSTYLE)) ?
- -1 : pTo->mnAddstyle;
-
- return nFromCompare - nToCompare;
-}
-
-// check whether two fonts are identical as appearance is concerned
-// this does not Compare the actual scaling of two fonts
-Bool
-Xlfd::SameFontoutline( const Xlfd* pComparedTo ) const
-{
- void* pThis = (void*)this;
- return XlfdCompare( (void*)pThis, (void*)pComparedTo ) == 0 ;
-}
-
-unsigned short
-Xlfd::GetEncoding() const
-{
- Attribute *pAddstyle = mpFactory->RetrieveAddstyle( mnAddstyle );
- if ( pAddstyle->GetValue() != RTL_TEXTENCODING_DONTKNOW )
- return pAddstyle->GetValue();
-
- Attribute *pEncoding = mpFactory->RetrieveCharset( mnCharset );
- return pEncoding->GetValue();
-}
-
-XlfdFonttype
-Xlfd::Fonttype() const
-{
- if ( (mnAverageWidth == 0) && (mnPixelSize == 0) && (mnPointSize == 0) )
- {
- return (mnResolutionX == 0)
- && (mnResolutionY == 0) ? eTypeScalable : eTypeScalableBitmap;
- }
-
- return eTypeBitmap;
-}
-
-void
-Advance( const char** pFrom, const char** pTo )
-{
- const char *pTmp = *pTo;
-
- for( ; (*pTmp != '\0') && (*pTmp++ != '-'); )
- {}
- *pFrom = *pTo;
- *pTo = pTmp;
-}
-
-Bool
-Xlfd::IsConformant (const char* pXlfd) const
-{
- // X FontNameRegistry prefix "-"
- if (*pXlfd++ != '-')
- return False;
-
- // All Xlfd FontName fields are defined
- int nNumFields = 1;
- while (*pXlfd != '\0')
- {
- if (*pXlfd++ == '-')
- nNumFields++;
- }
- // enough entries ?
- if (nNumFields != 14)
- return False;
- // and the last one is not empty as well ?
- if (*(pXlfd - 1) == '-')
- return False;
-
- return True;
-}
-
-// this is the real workhorse function. Since this is called for every font
-// in the fontpath it has to be as fast a possible
-Bool
-Xlfd::FromString( const char* pXlfdstring, AttributeProvider *pFactory )
-{
- if (!IsConformant(pXlfdstring))
- return False;
-
- const char* pFrom = pXlfdstring + 1;
- const char* pTo = pFrom;
- mpFactory = pFactory;
-
- Advance( &pFrom, &pTo ); //-foundry-*
- mnFoundry = mpFactory->InsertFoundry( pFrom, pTo - pFrom - 1 );
-
- Advance( &pFrom, &pTo ); // -*-family-*
- mnFamily = mpFactory->InsertFamily( pFrom, pTo - pFrom - 1 );
-
- Advance( &pFrom, &pTo ); // -*-*-weight-*
- mnWeight = mpFactory->InsertWeight( pFrom, pTo - pFrom - 1 );
-
- Advance( &pFrom, &pTo ); //-*-*-*-slant-*
- mnSlant = mpFactory->InsertSlant( pFrom, pTo - pFrom - 1 );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-setwidth-*
- mnSetwidth = mpFactory->InsertSetwidth( pFrom, pTo - pFrom - 1 );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-Addstyle-*
- mnAddstyle = mpFactory->InsertAddstyle( pFrom, pTo - pFrom - 1 );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-height-*
- mnPixelSize = atoi( pFrom );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-pt height-*
- mnPointSize = atoi( pFrom );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-x resolution-*
- mnResolutionX = atoi( pFrom );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-*-y resolution-*
- mnResolutionY = atoi( pFrom );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-*-*-spacing-*
- mcSpacing = pFrom == pTo ? '\0' : *pFrom;
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-*-*-*-average-*
- mnAverageWidth = atoi( pFrom );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-*-*-*-*-registry-encoding
- const char* pTmp = pFrom;
- Advance( &pTmp, &pTo );
- mnCharset = mpFactory->InsertCharset( pFrom, pTo - pFrom );
-
- // sanity check whether we have really found a valid XLFD, if not
- // throw away the whole font, since we have no idea what parts of
- // the XLFD contains the error.
- if ( !(pTo > pFrom) )
- return False;
-
- // a non-empty family name is essential, since otherwise the font
- // would match the "default font" #52299#
- Attribute* pFamily = mpFactory->RetrieveFamily( mnFamily );
- const char* pFamilyName = pFamily->GetName();
- if ( pFamilyName[0] == '\0' )
- return False;
-
- // well done
- return True;
-}
-
-#if OSL_DEBUG_LEVEL > 1
-// pure debug for now: this is only to inspect/pretty print a Xlfd struct
-const char*
-Xlfd::ToString( ByteString &rString ) const
-{
- AppendAttribute( mpFactory->RetrieveFoundry(mnFoundry), rString );
- AppendAttribute( mpFactory->RetrieveFamily(mnFamily), rString );
- AppendAttribute( mpFactory->RetrieveWeight(mnWeight), rString );
- AppendAttribute( mpFactory->RetrieveSlant(mnSlant), rString );
- AppendAttribute( mpFactory->RetrieveSetwidth(mnSetwidth), rString );
- AppendAttribute( mpFactory->RetrieveAddstyle(mnAddstyle), rString );
-
- rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnPixelSize ) );
- rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnPointSize ) );
- rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnResolutionX ) );
- rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnResolutionY ) );
- rString.Append("-"); rString.Append( (char)mcSpacing );
- rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnAverageWidth ) );
-
- AppendAttribute( mpFactory->RetrieveCharset(mnCharset), rString );
-
- return rString.GetBuffer() ;
-}
-
-void
-Xlfd::Dump() const
-{
- ByteString aString;
- fprintf(stderr, "Xlfd: %s\n", ToString(aString) );
-}
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/gdi/xlfd_smpl.hxx b/vcl/unx/source/gdi/xlfd_smpl.hxx
deleted file mode 100644
index a412d332fd9b..000000000000
--- a/vcl/unx/source/gdi/xlfd_smpl.hxx
+++ /dev/null
@@ -1,94 +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 XLFD_SIMPLE_HXX
-#define XLFD_SIMPLE_HXX
-
-#include <salunx.h>
-#include <vcl/vclenum.hxx>
-#include <tools/string.hxx>
-
-class AttributeProvider;
-
-// --------------------------------------------------------------------------
-//
-//
-// broken down structure equivalent to a Xlfd string
-//
-//
-// --------------------------------------------------------------------------
-
-enum XlfdFonttype {
- eTypeUnknown = TYPE_DONTKNOW,
- eTypeBitmap = TYPE_RASTER,
- eTypeScalableBitmap = TYPE_VECTOR,
- eTypeScalable = TYPE_SCALABLE
-};
-
-class Xlfd {
-
- public:
-
- unsigned short mnFoundry;
- unsigned short mnFamily;
- unsigned short mnWeight;
- unsigned short mnSlant;
- unsigned short mnSetwidth;
- unsigned short mnAddstyle;
- unsigned short mnPixelSize;
- unsigned short mnPointSize;
- unsigned short mnResolutionX;
- unsigned short mnResolutionY;
- unsigned char mcSpacing;
- unsigned short mnAverageWidth;
- unsigned short mnCharset;
-
- // all foundry, family, weight ... information referres
- // to this factory
- AttributeProvider *mpFactory;
-
- Bool IsConformant( const char* pXlfdstring ) const;
-
- public:
- Xlfd();
- Bool FromString( const char* pXlfdstring,
- AttributeProvider *pFactory );
- Bool SameFontoutline( const Xlfd *pComparedTo ) const ;
- XlfdFonttype Fonttype() const ;
- unsigned short GetEncoding() const ;
- #if OSL_DEBUG_LEVEL > 1
- const char* ToString( ByteString &rString ) const ;
- void Dump() const;
- #endif
-};
-
-extern "C" int
-XlfdCompare( const void *vFrom, const void *vTo );
-
-#endif /* XLFD_SIMPLE_HXX */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/plugadapt/salplug.cxx b/vcl/unx/source/plugadapt/salplug.cxx
index eecb026087e1..c27646cf1fd7 100644
--- a/vcl/unx/source/plugadapt/salplug.cxx
+++ b/vcl/unx/source/plugadapt/salplug.cxx
@@ -37,6 +37,7 @@
#include "vcl/salinst.hxx"
#include "saldata.hxx"
+#include "vcl/printerinfomanager.hxx"
#include <cstdio>
#include <unistd.h>
@@ -294,12 +295,14 @@ const OUString& SalGetDesktopEnvironment()
SalData::SalData() :
m_pInstance(NULL),
- m_pPlugin(NULL)
+ m_pPlugin(NULL),
+ m_pPIManager(NULL)
{
}
SalData::~SalData()
{
+ psp::PrinterInfoManager::release();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/printer/cupsmgr.cxx b/vcl/unx/source/printer/cupsmgr.cxx
index 13652ae23924..655181294190 100644
--- a/vcl/unx/source/printer/cupsmgr.cxx
+++ b/vcl/unx/source/printer/cupsmgr.cxx
@@ -530,12 +530,18 @@ void CUPSManager::initialize()
// introduced in dests with 1.2
// this is needed to check for %%IncludeFeature support
// (#i65684#, #i65491#)
+ bool bUsePDF = false;
cups_dest_t* pDest = ((cups_dest_t*)m_pDests);
const char* pOpt = m_pCUPSWrapper->cupsGetOption( "printer-info",
pDest->num_options,
pDest->options );
if( pOpt )
+ {
m_bUseIncludeFeature = true;
+ bUsePDF = true;
+ if( m_aGlobalDefaults.m_nPSLevel == 0 && m_aGlobalDefaults.m_nPDFDevice == 0 )
+ m_aGlobalDefaults.m_nPDFDevice = 1;
+ }
// do not send include JobPatch; CUPS will insert that itself
// TODO: currently unknwon which versions of CUPS insert JobPatches
// so currently it is assumed CUPS = don't insert JobPatch files
@@ -599,6 +605,8 @@ void CUPSManager::initialize()
aPrinter.m_aInfo.m_pParser = c_it->second.getParser();
aPrinter.m_aInfo.m_aContext = c_it->second;
}
+ if( bUsePDF && aPrinter.m_aInfo.m_nPSLevel == 0 && aPrinter.m_aInfo.m_nPDFDevice == 0 )
+ aPrinter.m_aInfo.m_nPDFDevice = 1;
aPrinter.m_aInfo.m_aDriverName = aBuf.makeStringAndClear();
aPrinter.m_bModified = false;
@@ -832,8 +840,15 @@ void CUPSManager::setupJobContextData(
FILE* CUPSManager::startSpool( const OUString& rPrintername, bool bQuickCommand )
{
+ OSL_TRACE( "endSpool: %s, %s",
+ rtl::OUStringToOString( rPrintername, RTL_TEXTENCODING_UTF8 ).getStr(),
+ bQuickCommand ? "true" : "false" );
+
if( m_aCUPSDestMap.find( rPrintername ) == m_aCUPSDestMap.end() )
+ {
+ OSL_TRACE( "defer to PrinterInfoManager::startSpool" );
return PrinterInfoManager::startSpool( rPrintername, bQuickCommand );
+ }
#ifdef ENABLE_CUPS
OUString aTmpURL, aTmpFile;
@@ -856,7 +871,7 @@ struct less_ppd_key : public ::std::binary_function<double, double, bool>
{ return left->getOrderDependency() < right->getOrderDependency(); }
};
-void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, int& rNumOptions, void** rOptions ) const
+void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner, int& rNumOptions, void** rOptions ) const
{
rNumOptions = 0;
*rOptions = NULL;
@@ -886,10 +901,26 @@ void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, int& rNumOpt
}
}
}
+
+ if( rJob.m_nPDFDevice > 0 && rJob.m_nCopies > 1 )
+ {
+ rtl::OString aVal( rtl::OString::valueOf( sal_Int32( rJob.m_nCopies ) ) );
+ rNumOptions = m_pCUPSWrapper->cupsAddOption( "copies", aVal.getStr(), rNumOptions, (cups_option_t**)rOptions );
+ }
+ if( ! bBanner )
+ {
+ rNumOptions = m_pCUPSWrapper->cupsAddOption( "job-sheets", "none", rNumOptions, (cups_option_t**)rOptions );
+ }
}
-int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData )
+int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner )
{
+ OSL_TRACE( "endSpool: %s, %s, copy count = %d",
+ rtl::OUStringToOString( rPrintername, RTL_TEXTENCODING_UTF8 ).getStr(),
+ rtl::OUStringToOString( rJobTitle, RTL_TEXTENCODING_UTF8 ).getStr(),
+ rDocumentJobData.m_nCopies
+ );
+
int nJobID = 0;
osl::MutexGuard aGuard( m_aCUPSMutex );
@@ -897,7 +928,10 @@ int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTit
boost::unordered_map< OUString, int, OUStringHash >::iterator dest_it =
m_aCUPSDestMap.find( rPrintername );
if( dest_it == m_aCUPSDestMap.end() )
- return PrinterInfoManager::endSpool( rPrintername, rJobTitle, pFile, rDocumentJobData );
+ {
+ OSL_TRACE( "defer to PrinterInfoManager::endSpool" );
+ return PrinterInfoManager::endSpool( rPrintername, rJobTitle, pFile, rDocumentJobData, bBanner );
+ }
#ifdef ENABLE_CUPS
boost::unordered_map< FILE*, OString, FPtrHash >::const_iterator it = m_aSpoolFiles.find( pFile );
@@ -909,7 +943,7 @@ int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTit
// setup cups options
int nNumOptions = 0;
cups_option_t* pOptions = NULL;
- getOptionsFromDocumentSetup( rDocumentJobData, nNumOptions, (void**)&pOptions );
+ getOptionsFromDocumentSetup( rDocumentJobData, bBanner, nNumOptions, (void**)&pOptions );
cups_dest_t* pDest = ((cups_dest_t*)m_pDests) + dest_it->second;
nJobID = m_pCUPSWrapper->cupsPrintFile( pDest->name,
diff --git a/vcl/unx/source/printer/jobdata.cxx b/vcl/unx/source/printer/jobdata.cxx
index ae5dd71c43ed..0982b219bade 100644
--- a/vcl/unx/source/printer/jobdata.cxx
+++ b/vcl/unx/source/printer/jobdata.cxx
@@ -51,6 +51,7 @@ JobData& JobData::operator=(const JobData& rRight)
m_pParser = rRight.m_pParser;
m_aContext = rRight.m_aContext;
m_nPSLevel = rRight.m_nPSLevel;
+ m_nPDFDevice = rRight.m_nPDFDevice;
m_nColorDevice = rRight.m_nColorDevice;
if( ! m_pParser && m_aPrinterName.getLength() )
@@ -83,6 +84,34 @@ void JobData::setCollate( bool bCollate )
}
}
+bool JobData::setPaper( int i_nWidth, int i_nHeight )
+{
+ bool bSuccess = false;
+ if( m_pParser )
+ {
+ rtl::OUString aPaper( m_pParser->matchPaper( i_nWidth, i_nHeight ) );
+
+ const PPDKey* pKey = m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) );
+ const PPDValue* pValue = pKey ? pKey->getValueCaseInsensitive( aPaper ) : NULL;
+
+ bSuccess = pKey && pValue && m_aContext.setValue( pKey, pValue, false );
+ }
+ return bSuccess;
+}
+
+bool JobData::setPaperBin( int i_nPaperBin )
+{
+ bool bSuccess = false;
+ if( m_pParser )
+ {
+ const PPDKey* pKey = m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) );
+ const PPDValue* pValue = pKey ? pKey->getValue( i_nPaperBin ) : NULL;
+
+ bSuccess = pKey && pValue && m_aContext.setValue( pKey, pValue, false );
+ }
+ return bSuccess;
+}
+
bool JobData::getStreamBuffer( void*& pData, int& bytes )
{
// consistency checks
@@ -128,13 +157,17 @@ bool JobData::getStreamBuffer( void*& pData, int& bytes )
aLine += ByteString::CreateFromInt32( m_nPSLevel );
aStream.WriteLine( aLine );
+ aLine = "pdfdevice=";
+ aLine += ByteString::CreateFromInt32( m_nPDFDevice );
+ aStream.WriteLine( aLine );
+
aLine = "colordevice=";
aLine += ByteString::CreateFromInt32( m_nColorDevice );
aStream.WriteLine( aLine );
// now append the PPDContext stream buffer
aStream.WriteLine( "PPDContexData" );
- ULONG nBytes;
+ sal_uLong nBytes;
void* pContextBuffer = m_aContext.getStreamableBuffer( nBytes );
if( nBytes )
aStream.Write( pContextBuffer, nBytes );
@@ -158,6 +191,7 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa
bool bColorDepth = false;
bool bColorDevice = false;
bool bPSLevel = false;
+ bool bPDFDevice = false;
while( ! aStream.IsEof() )
{
aStream.ReadLine( aLine );
@@ -202,6 +236,11 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa
bPSLevel = true;
rJobData.m_nPSLevel = aLine.Copy( 8 ).ToInt32();
}
+ else if( aLine.CompareTo( "pdfdevice=", 10 ) == COMPARE_EQUAL )
+ {
+ bPDFDevice = true;
+ rJobData.m_nPDFDevice = aLine.Copy( 10 ).ToInt32();
+ }
else if( aLine.Equals( "PPDContexData" ) )
{
if( bPrinter )
@@ -222,7 +261,7 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa
}
}
- return bVersion && bPrinter && bOrientation && bCopies && bContext && bMargin && bPSLevel && bColorDevice && bColorDepth;
+ return bVersion && bPrinter && bOrientation && bCopies && bContext && bMargin && bPSLevel && bPDFDevice && bColorDevice && bColorDepth;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/printer/ppdparser.cxx b/vcl/unx/source/printer/ppdparser.cxx
index 22e17aa774d9..30d4598568d2 100644
--- a/vcl/unx/source/printer/ppdparser.cxx
+++ b/vcl/unx/source/printer/ppdparser.cxx
@@ -340,7 +340,7 @@ void PPDDecompressStream::Open( const rtl::OUString& i_rFile )
mpFileStream->Seek( 0 );
// check for compress'ed or gzip'ed file
- ULONG nCompressMethod = 0;
+ sal_uLong nCompressMethod = 0;
if( aLine.Len() > 1 && static_cast<unsigned char>(aLine.GetChar( 0 )) == 0x1f )
{
if( static_cast<unsigned char>(aLine.GetChar( 1 )) == 0x8b ) // check for gzip
@@ -436,51 +436,53 @@ void PPDParser::scanPPDDir( const String& rDir )
PPDCache &rPPDCache = thePPDCache::get();
osl::Directory aDir( rDir );
- aDir.open();
- osl::DirectoryItem aItem;
-
- INetURLObject aPPDDir(rDir);
- while( aDir.getNextItem( aItem ) == osl::FileBase::E_None )
+ if ( aDir.open() == osl::FileBase::E_None )
{
- osl::FileStatus aStatus( FileStatusMask_FileName );
- if( aItem.getFileStatus( aStatus ) == osl::FileBase::E_None )
+ osl::DirectoryItem aItem;
+
+ INetURLObject aPPDDir(rDir);
+ while( aDir.getNextItem( aItem ) == osl::FileBase::E_None )
{
- rtl::OUStringBuffer aURLBuf( rDir.Len() + 64 );
- aURLBuf.append( rDir );
- aURLBuf.append( sal_Unicode( '/' ) );
- aURLBuf.append( aStatus.getFileName() );
+ osl::FileStatus aStatus( FileStatusMask_FileName );
+ if( aItem.getFileStatus( aStatus ) == osl::FileBase::E_None )
+ {
+ rtl::OUStringBuffer aURLBuf( rDir.Len() + 64 );
+ aURLBuf.append( rDir );
+ aURLBuf.append( sal_Unicode( '/' ) );
+ aURLBuf.append( aStatus.getFileName() );
- rtl::OUString aFileURL, aFileName;
- osl::FileStatus::Type eType = osl::FileStatus::Unknown;
+ rtl::OUString aFileURL, aFileName;
+ osl::FileStatus::Type eType = osl::FileStatus::Unknown;
- if( resolveLink( aURLBuf.makeStringAndClear(), aFileURL, aFileName, eType ) == osl::FileBase::E_None )
- {
- if( eType == osl::FileStatus::Regular )
+ if( resolveLink( aURLBuf.makeStringAndClear(), aFileURL, aFileName, eType ) == osl::FileBase::E_None )
{
- INetURLObject aPPDFile = aPPDDir;
- aPPDFile.Append( aFileName );
-
- // match extension
- for( int nSuffix = 0; nSuffix < nSuffixes; nSuffix++ )
+ if( eType == osl::FileStatus::Regular )
{
- if( aFileName.getLength() > pSuffixes[nSuffix].nSuffixLen )
+ INetURLObject aPPDFile = aPPDDir;
+ aPPDFile.Append( aFileName );
+
+ // match extension
+ for( int nSuffix = 0; nSuffix < nSuffixes; nSuffix++ )
{
- if( aFileName.endsWithIgnoreAsciiCaseAsciiL( pSuffixes[nSuffix].pSuffix, pSuffixes[nSuffix].nSuffixLen ) )
+ if( aFileName.getLength() > pSuffixes[nSuffix].nSuffixLen )
{
+ if( aFileName.endsWithIgnoreAsciiCaseAsciiL( pSuffixes[nSuffix].pSuffix, pSuffixes[nSuffix].nSuffixLen ) )
+ {
(*rPPDCache.pAllPPDFiles)[ aFileName.copy( 0, aFileName.getLength() - pSuffixes[nSuffix].nSuffixLen ) ] = aPPDFile.PathToFileName();
- break;
+ break;
+ }
}
}
}
- }
- else if( eType == osl::FileStatus::Directory )
- {
- scanPPDDir( aFileURL );
+ else if( eType == osl::FileStatus::Directory )
+ {
+ scanPPDDir( aFileURL );
+ }
}
}
}
+ aDir.close();
}
- aDir.close();
}
void PPDParser::initPPDFiles()
@@ -1130,7 +1132,7 @@ void PPDParser::parse( ::std::list< ByteString >& rLines )
m_pTranslator->insertValue( aUniKey, aOption, aValue, aValueTranslation, aTransLocale );
// eventually update query and remove from option list
- if( bQuery && pKey->m_bQueryValue == FALSE )
+ if( bQuery && pKey->m_bQueryValue == sal_False )
{
pKey->m_aQueryValue = *pValue;
pKey->m_bQueryValue = true;
@@ -1145,7 +1147,7 @@ void PPDParser::parse( ::std::list< ByteString >& rLines )
if( aLine.CompareTo( "*Default", 8 ) == COMPARE_EQUAL )
{
String aKey( aLine.Copy( 8 ), RTL_TEXTENCODING_MS_1252 );
- USHORT nPos = aKey.Search( ':' );
+ sal_uInt16 nPos = aKey.Search( ':' );
if( nPos != STRING_NOTFOUND )
{
aKey.Erase( nPos );
@@ -1433,7 +1435,7 @@ String PPDParser::getSlot( int nSlot ) const
if( nSlot > 0 && nSlot < m_pInputSlots->countValues() )
return m_pInputSlots->getValue( nSlot )->m_aOption;
else if( m_pInputSlots->countValues() > 0 )
- return m_pInputSlots->getValue( (ULONG)0 )->m_aOption;
+ return m_pInputSlots->getValue( (sal_uLong)0 )->m_aOption;
return String();
}
@@ -1446,7 +1448,7 @@ String PPDParser::getSlotCommand( int nSlot ) const
if( nSlot > 0 && nSlot < m_pInputSlots->countValues() )
return m_pInputSlots->getValue( nSlot )->m_aValue;
else if( m_pInputSlots->countValues() > 0 )
- return m_pInputSlots->getValue( (ULONG)0 )->m_aValue;
+ return m_pInputSlots->getValue( (sal_uLong)0 )->m_aValue;
return String();
}
@@ -1473,7 +1475,7 @@ String PPDParser::getPaperDimension( int nPaperDimension ) const
if( nPaperDimension > 0 && nPaperDimension < m_pPaperDimensions->countValues() )
return m_pPaperDimensions->getValue( nPaperDimension )->m_aOption;
else if( m_pPaperDimensions->countValues() > 0 )
- return m_pPaperDimensions->getValue( (ULONG)0 )->m_aOption;
+ return m_pPaperDimensions->getValue( (sal_uLong)0 )->m_aOption;
return String();
}
@@ -1486,7 +1488,7 @@ String PPDParser::getPaperDimensionCommand( int nPaperDimension ) const
if( nPaperDimension > 0 && nPaperDimension < m_pPaperDimensions->countValues() )
return m_pPaperDimensions->getValue( nPaperDimension )->m_aValue;
else if( m_pPaperDimensions->countValues() > 0 )
- return m_pPaperDimensions->getValue( (ULONG)0 )->m_aValue;
+ return m_pPaperDimensions->getValue( (sal_uLong)0 )->m_aValue;
return String();
}
@@ -1595,7 +1597,7 @@ String PPDParser::getDuplex( int nDuplex ) const
if( nDuplex > 0 && nDuplex < m_pDuplexTypes->countValues() )
return m_pDuplexTypes->getValue( nDuplex )->m_aOption;
else if( m_pDuplexTypes->countValues() > 0 )
- return m_pDuplexTypes->getValue( (ULONG)0 )->m_aOption;
+ return m_pDuplexTypes->getValue( (sal_uLong)0 )->m_aOption;
return String();
}
@@ -1608,7 +1610,7 @@ String PPDParser::getDuplexCommand( int nDuplex ) const
if( nDuplex > 0 && nDuplex < m_pDuplexTypes->countValues() )
return m_pDuplexTypes->getValue( nDuplex )->m_aValue;
else if( m_pDuplexTypes->countValues() > 0 )
- return m_pDuplexTypes->getValue( (ULONG)0 )->m_aValue;
+ return m_pDuplexTypes->getValue( (sal_uLong)0 )->m_aValue;
return String();
}
@@ -2050,7 +2052,7 @@ void PPDContext::getUnconstrainedValues( const PPDKey* pKey, ::std::list< const
// -------------------------------------------------------------------
-void* PPDContext::getStreamableBuffer( ULONG& rBytes ) const
+void* PPDContext::getStreamableBuffer( sal_uLong& rBytes ) const
{
rBytes = 0;
if( ! m_aCurrentValues.size() )
@@ -2096,7 +2098,7 @@ void* PPDContext::getStreamableBuffer( ULONG& rBytes ) const
// -------------------------------------------------------------------
-void PPDContext::rebuildFromStreamBuffer( void* pBuffer, ULONG nBytes )
+void PPDContext::rebuildFromStreamBuffer( void* pBuffer, sal_uLong nBytes )
{
if( ! m_pParser )
return;
diff --git a/vcl/unx/source/printer/printerinfomanager.cxx b/vcl/unx/source/printer/printerinfomanager.cxx
index 68223d6fdf8f..e4634ab0c8b5 100644
--- a/vcl/unx/source/printer/printerinfomanager.cxx
+++ b/vcl/unx/source/printer/printerinfomanager.cxx
@@ -36,6 +36,7 @@
#include "cupsmgr.hxx"
#include "vcl/fontmanager.hxx"
#include "vcl/strhelper.hxx"
+#include "saldata.hxx"
#include "tools/urlobj.hxx"
#include "tools/stream.hxx"
@@ -100,20 +101,28 @@ namespace psp
PrinterInfoManager& PrinterInfoManager::get()
{
- static boost::scoped_ptr<PrinterInfoManager> pManager;
+ SalData* pSalData = GetSalData();
- if (!pManager)
+ if( ! pSalData->m_pPIManager )
{
- pManager.reset(CUPSManager::tryLoadCUPS());
- if (!pManager)
- pManager.reset(new PrinterInfoManager());
- pManager->initialize();
-# if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "PrinterInfoManager::get create Manager of type %d\n", pManager->getType() );
-# endif
+ pSalData->m_pPIManager = CUPSManager::tryLoadCUPS();
+ if( ! pSalData->m_pPIManager )
+ pSalData->m_pPIManager = new PrinterInfoManager();
+
+ pSalData->m_pPIManager->initialize();
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "PrinterInfoManager::get create Manager of type %d\n", pSalData->m_pPIManager->getType() );
+#endif
}
- return *pManager;
+ return *pSalData->m_pPIManager;
+}
+
+void PrinterInfoManager::release()
+{
+ SalData* pSalData = GetSalData();
+ delete pSalData->m_pPIManager;
+ pSalData->m_pPIManager = NULL;
}
// -----------------------------------------------------------------
@@ -136,6 +145,9 @@ PrinterInfoManager::PrinterInfoManager( Type eType ) :
PrinterInfoManager::~PrinterInfoManager()
{
delete m_pQueueInfo;
+ #if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "PrinterInfoManager: destroyed Manager of type %d\n", getType() );
+ #endif
}
// -----------------------------------------------------------------
@@ -289,6 +301,10 @@ void PrinterInfoManager::initialize()
if( aValue.Len() )
m_aGlobalDefaults.m_nPSLevel = aValue.ToInt32();
+ aValue = aConfig.ReadKey( "PDFDevice" );
+ if( aValue.Len() )
+ m_aGlobalDefaults.m_nPDFDevice = aValue.ToInt32();
+
aValue = aConfig.ReadKey( "PerformFontSubstitution" );
if( aValue.Len() )
{
@@ -320,7 +336,7 @@ void PrinterInfoManager::initialize()
m_aGlobalDefaults.m_aContext.
setValue( pKey,
aValue.Equals( "*nil" ) ? NULL : pKey->getValue( String( aValue, RTL_TEXTENCODING_ISO_8859_1 ) ),
- TRUE );
+ sal_True );
}
}
else if( aKey.Len() > 10 && aKey.CompareTo("SubstFont_", 10 ) == COMPARE_EQUAL )
@@ -500,6 +516,10 @@ void PrinterInfoManager::initialize()
if( aValue.Len() )
aPrinter.m_aInfo.m_nPSLevel = aValue.ToInt32();
+ aValue = aConfig.ReadKey( "PDFDevice" );
+ if( aValue.Len() )
+ aPrinter.m_aInfo.m_nPDFDevice = aValue.ToInt32();
+
aValue = aConfig.ReadKey( "PerformFontSubstitution" );
if( ! aValue.Equals( "0" ) && ! aValue.EqualsIgnoreCaseAscii( "false" ) )
aPrinter.m_aInfo.m_bPerformFontSubstitution = true;
@@ -521,7 +541,7 @@ void PrinterInfoManager::initialize()
aPrinter.m_aInfo.m_aContext.
setValue( pKey,
aValue.Equals( "*nil" ) ? NULL : pKey->getValue( String( aValue, RTL_TEXTENCODING_ISO_8859_1 ) ),
- TRUE );
+ sal_True );
}
}
else if( aKey.Len() > 10 && aKey.CompareTo("SubstFont_", 10 ) == COMPARE_EQUAL )
@@ -630,7 +650,7 @@ const PrinterInfo& PrinterInfoManager::getPrinterInfo( const OUString& rPrinter
static PrinterInfo aEmptyInfo;
::boost::unordered_map< OUString, Printer, OUStringHash >::const_iterator it = m_aPrinters.find( rPrinter );
- DBG_ASSERT( it != m_aPrinters.end(), "Do not ask for info about nonexistant printers" );
+ DBG_ASSERT( it != m_aPrinters.end(), "Do not ask for info about nonexistent printers" );
return it != m_aPrinters.end() ? it->second.m_aInfo : aEmptyInfo;
}
@@ -764,6 +784,7 @@ bool PrinterInfoManager::writePrinterConfig()
pConfig->WriteKey( "Copies", ByteString::CreateFromInt32( it->second.m_aInfo.m_nCopies ) );
pConfig->WriteKey( "Orientation", it->second.m_aInfo.m_eOrientation == orientation::Landscape ? "Landscape" : "Portrait" );
pConfig->WriteKey( "PSLevel", ByteString::CreateFromInt32( it->second.m_aInfo.m_nPSLevel ) );
+ pConfig->WriteKey( "PDFDevice", ByteString::CreateFromInt32( it->second.m_aInfo.m_nPDFDevice ) );
pConfig->WriteKey( "ColorDevice", ByteString::CreateFromInt32( it->second.m_aInfo.m_nColorDevice ) );
pConfig->WriteKey( "ColorDepth", ByteString::CreateFromInt32( it->second.m_aInfo.m_nColorDepth ) );
aValue = ByteString::CreateFromInt32( it->second.m_aInfo.m_nLeftMarginAdjust );
@@ -851,9 +872,10 @@ bool PrinterInfoManager::addPrinter( const OUString& rPrinterName, const OUStrin
m_aPrinters[ rPrinterName ] = aPrinter;
bSuccess = true;
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "new printer %s, level = %d, colordevice = %d, depth = %d\n",
+ fprintf( stderr, "new printer %s, level = %d, pdfdevice = %d, colordevice = %d, depth = %d\n",
OUStringToOString( rPrinterName, osl_getThreadTextEncoding() ).getStr(),
m_aPrinters[rPrinterName].m_aInfo.m_nPSLevel,
+ m_aPrinters[rPrinterName].m_aInfo.m_nPDFDevice,
m_aPrinters[rPrinterName].m_aInfo.m_nColorDevice,
m_aPrinters[rPrinterName].m_aInfo.m_nColorDepth );
#endif
@@ -1101,7 +1123,7 @@ FILE* PrinterInfoManager::startSpool( const OUString& rPrintername, bool bQuickC
return popen (aShellCommand.getStr(), "w");
}
-int PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* pFile, const JobData& /*rDocumentJobData*/ )
+int PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* pFile, const JobData& /*rDocumentJobData*/, bool /*bBanner*/ )
{
return (0 == pclose( pFile ));
}
@@ -1172,7 +1194,11 @@ SystemQueueInfo::SystemQueueInfo() :
SystemQueueInfo::~SystemQueueInfo()
{
- terminate();
+ static const char* pNoSyncDetection = getenv( "SAL_DISABLE_SYNCHRONOUS_PRINTER_DETECTION" );
+ if( ! pNoSyncDetection || !*pNoSyncDetection )
+ join();
+ else
+ terminate();
}
bool SystemQueueInfo::hasChanged() const
diff --git a/vcl/unx/source/printergfx/common_gfx.cxx b/vcl/unx/source/printergfx/common_gfx.cxx
index 14d3a98d69b2..fc366aab838f 100644
--- a/vcl/unx/source/printergfx/common_gfx.cxx
+++ b/vcl/unx/source/printergfx/common_gfx.cxx
@@ -528,9 +528,9 @@ PrinterGfx::DrawPolyPolygon (sal_uInt32 nPoly, const sal_uInt32* pSizes, const P
*/
void
-PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const BYTE* pFlgAry)
+PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const sal_uInt8* pFlgAry)
{
- const sal_uInt32 nBezString = 1024;
+ const sal_uInt32 nBezString= 1024;
sal_Char pString[nBezString];
if ( nPoints > 1 && maLineColor.Is() && pPath )
@@ -579,7 +579,7 @@ PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const BY
}
void
-PrinterGfx::DrawPolygonBezier (sal_uInt32 nPoints, const Point* pPath, const BYTE* pFlgAry)
+PrinterGfx::DrawPolygonBezier (sal_uInt32 nPoints, const Point* pPath, const sal_uInt8* pFlgAry)
{
const sal_uInt32 nBezString = 1024;
sal_Char pString[nBezString];
@@ -635,7 +635,7 @@ PrinterGfx::DrawPolygonBezier (sal_uInt32 nPoints, const Point* pPath, const BYT
}
void
-PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints, const Point* const * pPtAry, const BYTE* const* pFlgAry)
+PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints, const Point* const * pPtAry, const sal_uInt8* const* pFlgAry)
{
const sal_uInt32 nBezString = 1024;
sal_Char pString[nBezString];
diff --git a/vcl/unx/source/printergfx/printerjob.cxx b/vcl/unx/source/printergfx/printerjob.cxx
index 4ca5965e5b34..7df531975c57 100644
--- a/vcl/unx/source/printergfx/printerjob.cxx
+++ b/vcl/unx/source/printergfx/printerjob.cxx
@@ -347,7 +347,8 @@ PrinterJob::~PrinterJob ()
delete mpJobTrailer;
// XXX should really call osl::remove routines
- removeSpoolDir (maSpoolDirName);
+ if( maSpoolDirName.getLength() )
+ removeSpoolDir (maSpoolDirName);
// osl::Directory::remove (maSpoolDirName);
}
@@ -415,7 +416,7 @@ PrinterJob::StartJob (
rtl::OUString aFilterWS;
// Creator (this application)
- aFilterWS = WhitespaceToSpace( rAppName, FALSE );
+ aFilterWS = WhitespaceToSpace( rAppName, sal_False );
WritePS (mpJobHeader, "%%Creator: (");
WritePS (mpJobHeader, aFilterWS);
WritePS (mpJobHeader, ")\n");
@@ -453,14 +454,14 @@ PrinterJob::StartJob (
* use the filename, if it contains only ascii
* else omit %%Title
*/
- aFilterWS = WhitespaceToSpace( rJobName, FALSE );
+ aFilterWS = WhitespaceToSpace( rJobName, sal_False );
rtl::OUString aTitle( aFilterWS );
if( ! isAscii( aTitle ) )
{
sal_Int32 nIndex = 0;
while( nIndex != -1 )
aTitle = rFileName.getToken( 0, '/', nIndex );
- aTitle = WhitespaceToSpace( aTitle, FALSE );
+ aTitle = WhitespaceToSpace( aTitle, sal_False );
if( ! isAscii( aTitle ) )
aTitle = rtl::OUString();
}
@@ -501,6 +502,10 @@ PrinterJob::StartJob (
sal_Bool
PrinterJob::EndJob ()
{
+ // no pages ? that really means no print job
+ if( maPageList.empty() )
+ return sal_False;
+
// write document setup (done here because it
// includes the accumulated fonts
if( mpJobHeader )
@@ -616,7 +621,7 @@ PrinterJob::EndJob ()
{
PrinterInfoManager& rPrinterInfoManager = PrinterInfoManager::get();
if (0 == rPrinterInfoManager.endSpool( m_aLastJobData.m_aPrinterName,
- maJobTitle, pDestFILE, m_aDocumentJobData ))
+ maJobTitle, pDestFILE, m_aDocumentJobData, true ))
{
bSuccess = sal_False;
}
diff --git a/vcl/unx/source/window/makefile.mk b/vcl/unx/source/window/makefile.mk
index 808b712903f3..c5cd95ba6b1c 100644
--- a/vcl/unx/source/window/makefile.mk
+++ b/vcl/unx/source/window/makefile.mk
@@ -48,7 +48,7 @@ dummy:
.ELSE # "$(GUIBASE)"!="unx"
SLOFILES= \
- $(SLO)/FWS.obj $(SLO)/salframe.obj $(SLO)/salobj.obj $(SLO)/salmenu.obj
+ $(SLO)/FWS.obj $(SLO)/salframe.obj $(SLO)/salobj.obj
.ENDIF # "$(GUIBASE)"!="unx"
diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx
index 5068724f7da4..9a5d149f14fd 100644
--- a/vcl/unx/source/window/salframe.cxx
+++ b/vcl/unx/source/window/salframe.cxx
@@ -211,7 +211,7 @@ void X11SalFrame::askForXEmbedFocus( sal_Int32 i_nTimeCode )
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::Init( ULONG nSalFrameStyle, int nScreen, SystemParentData* pParentData, bool bUseGeometry )
+void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData* pParentData, bool bUseGeometry )
{
if( nScreen < 0 || nScreen >= GetDisplay()->GetScreenCount() )
nScreen = GetDisplay()->GetDefaultScreenNumber();
@@ -484,8 +484,8 @@ void X11SalFrame::Init( ULONG nSalFrameStyle, int nScreen, SystemParentData* pPa
}
nShowState_ = SHOWSTATE_UNKNOWN;
- bViewable_ = TRUE;
- bMapped_ = FALSE;
+ bViewable_ = sal_True;
+ bMapped_ = sal_False;
nVisibility_ = VisibilityFullyObscured;
mhWindow = XCreateWindow( GetXDisplay(),
aFrameParent,
@@ -647,7 +647,7 @@ void X11SalFrame::Init( ULONG nSalFrameStyle, int nScreen, SystemParentData* pPa
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-X11SalFrame::X11SalFrame( SalFrame *pParent, ULONG nSalFrameStyle, SystemParentData* pSystemParent )
+X11SalFrame::X11SalFrame( SalFrame *pParent, sal_uLong nSalFrameStyle, SystemParentData* pSystemParent )
{
X11SalData* pSalData = GetX11SalData();
@@ -687,16 +687,16 @@ X11SalFrame::X11SalFrame( SalFrame *pParent, ULONG nSalFrameStyle, SystemParentD
nHeight_ = 0;
nStyle_ = 0;
mnExtStyle = 0;
- bAlwaysOnTop_ = FALSE;
+ bAlwaysOnTop_ = sal_False;
- // set bViewable_ to TRUE: hack GetClientSize to report something
+ // set bViewable_ to sal_True: hack GetClientSize to report something
// different to 0/0 before first map
- bViewable_ = TRUE;
- bMapped_ = FALSE;
- bDefaultPosition_ = TRUE;
+ bViewable_ = sal_True;
+ bMapped_ = sal_False;
+ bDefaultPosition_ = sal_True;
nVisibility_ = VisibilityFullyObscured;
m_nWorkArea = 0;
- mbInShow = FALSE;
+ mbInShow = sal_False;
m_bXEmbed = false;
nScreenSaversTimeout_ = 0;
@@ -791,10 +791,10 @@ X11SalFrame::~X11SalFrame()
XSelectInput( GetXDisplay(), GetShellWindow(), 0 );
XSelectInput( GetXDisplay(), GetWindow(), 0 );
- ShowFullScreen( FALSE, 0 );
+ ShowFullScreen( sal_False, 0 );
if( bMapped_ )
- Show( FALSE );
+ Show( sal_False );
if( mpInputContext )
{
@@ -951,14 +951,14 @@ void X11SalFrame::updateGraphics( bool bClear )
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::Enable( BOOL /*bEnable*/ )
+void X11SalFrame::Enable( sal_Bool /*bEnable*/ )
{
// NYI: enable/disable frame
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::SetIcon( USHORT nIcon )
+void X11SalFrame::SetIcon( sal_uInt16 nIcon )
{
if ( ! IsChildWindow() )
{
@@ -1060,7 +1060,7 @@ void X11SalFrame::SetIcon( USHORT nIcon )
}
pHints = &Hints;
- BOOL bOk = SelectAppIconPixmap( GetDisplay(), m_nScreen,
+ sal_Bool bOk = SelectAppIconPixmap( GetDisplay(), m_nScreen,
nIcon, iconSize,
pHints->icon_pixmap, pHints->icon_mask );
if ( !bOk )
@@ -1133,7 +1133,7 @@ void X11SalFrame::SetMinClientSize( long nWidth, long nHeight )
// Show + Pos (x,y,z) + Size (width,height)
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate )
+void X11SalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
{
if( ( bVisible && bMapped_ )
|| ( !bVisible && !bMapped_ ) )
@@ -1151,7 +1151,7 @@ void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate )
setXEmbedInfo();
if( bVisible )
{
- mbInShow = TRUE;
+ mbInShow = sal_True;
if( ! (nStyle_ & SAL_FRAME_STYLE_INTRO) )
{
// hide all INTRO frames
@@ -1163,12 +1163,12 @@ void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate )
if( pFrame->nStyle_ & SAL_FRAME_STYLE_INTRO )
{
if( pFrame->bMapped_ )
- const_cast<X11SalFrame*>(pFrame)->Show( FALSE );
+ const_cast<X11SalFrame*>(pFrame)->Show( sal_False );
}
}
}
- // update NET_WM_STATE which may have been deleted due to earlier Show(FALSE)
+ // update NET_WM_STATE which may have been deleted due to earlier Show(sal_False)
if( nShowState_ == SHOWSTATE_HIDDEN )
GetDisplay()->getWMAdaptor()->frameIsMapping( this );
@@ -1177,7 +1177,7 @@ void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate )
* with the basic dialogue editor,
* which shows a frame and instantly hides it again. After that the
* editor window is shown and the WM takes this as an opportunity
- * to show our hidden transient frame also. So Show( FALSE ) must
+ * to show our hidden transient frame also. So Show( sal_False ) must
* withdraw the frame AND delete the WM_TRANSIENT_FOR property.
* In case the frame is shown again, the transient hint must be restored here.
*/
@@ -1310,7 +1310,7 @@ void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate )
* plugged windows don't necessarily get the
* focus on show because the parent may already be mapped
* and have the focus. So try to set the focus
- * to the child on Show(TRUE)
+ * to the child on Show(sal_True)
*/
if( (nStyle_ & SAL_FRAME_STYLE_PLUG) && ! m_bXEmbed )
XSetInputFocus( GetXDisplay(),
@@ -1358,7 +1358,7 @@ void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate )
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::ToTop( USHORT nFlags )
+void X11SalFrame::ToTop( sal_uInt16 nFlags )
{
if( ( nFlags & SAL_FRAME_TOTOP_RESTOREWHENMIN )
&& ! ( nStyle_ & SAL_FRAME_STYLE_FLOAT )
@@ -1576,7 +1576,7 @@ void X11SalFrame::updateScreenNumber()
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags )
+void X11SalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags )
{
if( nStyle_ & SAL_FRAME_STYLE_PLUG )
return;
@@ -1622,7 +1622,7 @@ void X11SalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, USHOR
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::SetAlwaysOnTop( BOOL bOnTop )
+void X11SalFrame::SetAlwaysOnTop( sal_Bool bOnTop )
{
if( ! IsOverrideRedirect() )
{
@@ -1803,7 +1803,7 @@ void X11SalFrame::SetWindowState( const SalFrameState *pState )
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-BOOL X11SalFrame::GetWindowState( SalFrameState* pState )
+sal_Bool X11SalFrame::GetWindowState( SalFrameState* pState )
{
if( SHOWSTATE_MINIMIZED == nShowState_ )
pState->mnState = SAL_FRAMESTATE_MINIMIZED;
@@ -1842,7 +1842,7 @@ BOOL X11SalFrame::GetWindowState( SalFrameState* pState )
pState->mnMask |= _FRAMESTATE_MASK_MAXIMIZED_GEOMETRY;
}
- return TRUE;
+ return sal_True;
}
// ----------------------------------------------------------------------------
@@ -2161,22 +2161,22 @@ void X11SalFrame::SetScreenNumber( unsigned int nNewScreen )
Rectangle aNewScreenRect( GetDisplay()->GetXineramaScreens()[nNewScreen] );
bool bVisible = bMapped_;
if( bVisible )
- Show( FALSE );
+ Show( sal_False );
maGeometry.nX = aNewScreenRect.Left() + (maGeometry.nX - aOldScreenRect.Left());
maGeometry.nY = aNewScreenRect.Top() + (maGeometry.nY - aOldScreenRect.Top());
createNewWindow( None, m_nScreen );
if( bVisible )
- Show( TRUE );
+ Show( sal_True );
maGeometry.nScreenNumber = nNewScreen;
}
else if( sal_Int32(nNewScreen) < GetDisplay()->GetScreenCount() )
{
bool bVisible = bMapped_;
if( bVisible )
- Show( FALSE );
+ Show( sal_False );
createNewWindow( None, nNewScreen );
if( bVisible )
- Show( TRUE );
+ Show( sal_True );
maGeometry.nScreenNumber = nNewScreen;
}
}
@@ -2210,7 +2210,7 @@ void X11SalFrame::updateWMClass()
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
+void X11SalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen )
{
if( GetDisplay()->IsXinerama() && GetDisplay()->GetXineramaScreens().size() > 1 )
{
@@ -2228,7 +2228,7 @@ void X11SalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
nStyle_ |= SAL_FRAME_STYLE_PARTIAL_FULLSCREEN;
bool bVisible = bMapped_;
if( bVisible )
- Show( FALSE );
+ Show( sal_False );
maGeometry.nX = aRect.Left();
maGeometry.nY = aRect.Top();
maGeometry.nWidth = aRect.GetWidth();
@@ -2241,7 +2241,7 @@ void X11SalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
else
GetDisplay()->getWMAdaptor()->showFullScreen( this, true );
if( bVisible )
- Show(TRUE);
+ Show(sal_True);
}
else
@@ -2252,14 +2252,14 @@ void X11SalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
Rectangle aRect = maRestorePosSize;
maRestorePosSize = Rectangle();
if( bVisible )
- Show( FALSE );
+ Show( sal_False );
createNewWindow( None, m_nScreen );
if( !aRect.IsEmpty() )
SetPosSize( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(),
SAL_FRAME_POSSIZE_X | SAL_FRAME_POSSIZE_Y |
SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT );
if( bVisible )
- Show( TRUE );
+ Show( sal_True );
}
}
else
@@ -2272,12 +2272,12 @@ void X11SalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
if( mbFullScreen )
pDisplay_->getWMAdaptor()->showFullScreen( this, false );
if( bVisible )
- Show( FALSE );
+ Show( sal_False );
createNewWindow( None, nScreen );
if( mbFullScreen )
pDisplay_->getWMAdaptor()->showFullScreen( this, true );
if( bVisible )
- Show( TRUE );
+ Show( sal_True );
}
if( mbFullScreen == (bool)bFullScreen )
return;
@@ -2362,7 +2362,7 @@ MessageToXAutoLock( Display *p_display, int n_message )
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::StartPresentation( BOOL bStart )
+void X11SalFrame::StartPresentation( sal_Bool bStart )
{
I18NStatus::get().show( !bStart, I18NStatus::presentation );
if ( bStart )
@@ -2380,7 +2380,7 @@ void X11SalFrame::StartPresentation( BOOL bStart )
static bool DPMSExtensionAvailable =
#if !defined(SOLARIS) && !defined(AIX)
(DPMSQueryExtension(GetXDisplay(), &dummy, &dummy) != 0);
- static XLIB_BOOL DPMSEnabled = false;
+ static sal_Bool DPMSEnabled = false;
#else
false;
bool DPMSEnabled = false;
@@ -2559,10 +2559,10 @@ X11SalFrame::HandleExtTextEvent (XClientMessageEvent *pEvent)
// PostEvent
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-BOOL X11SalFrame::PostEvent( void *pData )
+sal_Bool X11SalFrame::PostEvent( void *pData )
{
GetDisplay()->SendInternalEvent( this, pData );
- return TRUE;
+ return sal_True;
}
// Title
@@ -2634,7 +2634,7 @@ void X11SalFrame::SetInputContext( SalInputContext* pContext )
// -----------------------------------------------------------------------
-void X11SalFrame::EndExtTextInput( USHORT nFlags )
+void X11SalFrame::EndExtTextInput( sal_uInt16 nFlags )
{
if (mpInputContext != NULL)
mpInputContext->EndExtTextInput( nFlags );
@@ -2642,20 +2642,20 @@ void X11SalFrame::EndExtTextInput( USHORT nFlags )
// -----------------------------------------------------------------------
-XubString X11SalFrame::GetKeyName( USHORT nKeyCode )
+XubString X11SalFrame::GetKeyName( sal_uInt16 nKeyCode )
{
return GetDisplay()->GetKeyName( nKeyCode );
}
-XubString X11SalFrame::GetSymbolKeyName( const XubString&, USHORT nKeyCode )
+XubString X11SalFrame::GetSymbolKeyName( const XubString&, sal_uInt16 nKeyCode )
{
return GetKeyName( nKeyCode );
}
-BOOL X11SalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& )
+sal_Bool X11SalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& )
{
// not supported yet
- return FALSE;
+ return sal_False;
}
LanguageType X11SalFrame::GetInputLanguage()
@@ -2683,7 +2683,7 @@ void X11SalFrame::UpdateSettings( AllSettings& rSettings )
pIntegrator->GetSystemLook( rSettings );
}
-void X11SalFrame::CaptureMouse( BOOL bCapture )
+void X11SalFrame::CaptureMouse( sal_Bool bCapture )
{
nCaptured_ = pDisplay_->CaptureMouse( bCapture ? this : NULL );
}
@@ -2714,7 +2714,7 @@ void X11SalFrame::createNewWindow( XLIB_Window aNewParent, int nScreen )
{
bool bWasVisible = bMapped_;
if( bWasVisible )
- Show( FALSE );
+ Show( sal_False );
if( nScreen < 0 || nScreen >= GetDisplay()->GetScreenCount() )
nScreen = m_nScreen;
@@ -2783,7 +2783,7 @@ void X11SalFrame::createNewWindow( XLIB_Window aNewParent, int nScreen )
}
if( bWasVisible )
- Show( TRUE );
+ Show( sal_True );
std::list< X11SalFrame* > aChildren = maChildren;
for( std::list< X11SalFrame* >::iterator it = aChildren.begin(); it != aChildren.end(); ++it )
@@ -2819,9 +2819,9 @@ void X11SalFrame::Beep( SoundType eSoundType ) // not fully suported
// Event Handling
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-static USHORT sal_GetCode( int state )
+static sal_uInt16 sal_GetCode( int state )
{
- USHORT nCode = 0;
+ sal_uInt16 nCode = 0;
if( state & Button1Mask )
nCode |= MOUSE_LEFT;
@@ -2874,7 +2874,7 @@ SalFrame::SalIndicatorState X11SalFrame::GetIndicatorState()
return aState;
}
-void X11SalFrame::SimulateKeyPress( USHORT nKeyCode )
+void X11SalFrame::SimulateKeyPress( sal_uInt16 nKeyCode )
{
GetX11SalData()->GetDisplay()->SimulateKeyPress(nKeyCode);
}
@@ -2882,7 +2882,7 @@ void X11SalFrame::SimulateKeyPress( USHORT nKeyCode )
long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
{
SalMouseEvent aMouseEvt;
- USHORT nEvent = 0;
+ sal_uInt16 nEvent = 0;
bool bClosePopups = false;
if( nVisibleFloats && pEvent->type == EnterNotify )
@@ -3005,7 +3005,7 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
}
if( ! bInside )
{
- // need not take care of the XUngrabPointer in Show( FALSE )
+ // need not take care of the XUngrabPointer in Show( sal_False )
// because XUngrabPointer does not produce errors if pointer
// is not grabbed
XUngrabPointer( GetXDisplay(), CurrentTime );
@@ -3089,7 +3089,7 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
if( pEvent->type == ButtonRelease )
return 0;
- static ULONG nLines = 0;
+ static sal_uLong nLines = 0;
if( ! nLines )
{
char* pEnv = getenv( "SAL_WHEELLINES" );
@@ -3151,14 +3151,14 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
// in the independent part.
struct KeyAlternate
{
- USHORT nKeyCode;
+ sal_uInt16 nKeyCode;
sal_Unicode nCharCode;
KeyAlternate() : nKeyCode( 0 ), nCharCode( 0 ) {}
- KeyAlternate( USHORT nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {}
+ KeyAlternate( sal_uInt16 nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {}
};
inline KeyAlternate
-GetAlternateKeyCode( const USHORT nKeyCode )
+GetAlternateKeyCode( const sal_uInt16 nKeyCode )
{
KeyAlternate aAlternate;
@@ -3171,6 +3171,100 @@ GetAlternateKeyCode( const USHORT nKeyCode )
return aAlternate;
}
+void X11SalFrame::beginUnicodeSequence()
+{
+ rtl::OUString& rSeq( GetX11SalData()->GetUnicodeAccumulator() );
+ DeletionListener aDeleteWatch( this );
+
+ if( rSeq.getLength() )
+ endUnicodeSequence();
+
+ rSeq = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "u" ) );
+
+ if( ! aDeleteWatch.isDeleted() )
+ {
+ sal_uInt16 nTextAttr = SAL_EXTTEXTINPUT_ATTR_UNDERLINE;
+ SalExtTextInputEvent aEv;
+ aEv.mnTime = 0;
+ aEv.maText = rSeq;
+ aEv.mpTextAttr = &nTextAttr;
+ aEv.mnCursorPos = 0;
+ aEv.mnDeltaStart = 0;
+ aEv.mnCursorFlags = 0;
+ aEv.mbOnlyCursor = sal_False;
+
+ CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv);
+ }
+}
+
+bool X11SalFrame::appendUnicodeSequence( sal_Unicode c )
+{
+ bool bRet = false;
+ rtl::OUString& rSeq( GetX11SalData()->GetUnicodeAccumulator() );
+ if( rSeq.getLength() > 0 )
+ {
+ // range check
+ if( (c >= sal_Unicode('0') && c <= sal_Unicode('9')) ||
+ (c >= sal_Unicode('a') && c <= sal_Unicode('f')) ||
+ (c >= sal_Unicode('A') && c <= sal_Unicode('F')) )
+ {
+ rtl::OUStringBuffer aBuf( rSeq.getLength() + 1 );
+ aBuf.append( rSeq );
+ aBuf.append( c );
+ rSeq = aBuf.makeStringAndClear();
+ std::vector<sal_uInt16> attribs( rSeq.getLength(), SAL_EXTTEXTINPUT_ATTR_UNDERLINE );
+
+ SalExtTextInputEvent aEv;
+ aEv.mnTime = 0;
+ aEv.maText = rSeq;
+ aEv.mpTextAttr = &attribs[0];
+ aEv.mnCursorPos = 0;
+ aEv.mnDeltaStart = 0;
+ aEv.mnCursorFlags = 0;
+ aEv.mbOnlyCursor = sal_False;
+
+ CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv);
+ bRet = true;
+ }
+ else
+ bRet = endUnicodeSequence();
+ }
+ else
+ endUnicodeSequence();
+ return bRet;
+}
+
+bool X11SalFrame::endUnicodeSequence()
+{
+ rtl::OUString& rSeq( GetX11SalData()->GetUnicodeAccumulator() );
+
+ DeletionListener aDeleteWatch( this );
+ if( rSeq.getLength() > 1 && rSeq.getLength() < 6 )
+ {
+ // cut the "u"
+ rtl::OUString aNumbers( rSeq.copy( 1 ) );
+ sal_Int32 nValue = aNumbers.toInt32( 16 );
+ if( nValue >= 32 )
+ {
+ sal_uInt16 nTextAttr = SAL_EXTTEXTINPUT_ATTR_UNDERLINE;
+ SalExtTextInputEvent aEv;
+ aEv.mnTime = 0;
+ aEv.maText = rtl::OUString( sal_Unicode(nValue) );
+ aEv.mpTextAttr = &nTextAttr;
+ aEv.mnCursorPos = 0;
+ aEv.mnDeltaStart = 0;
+ aEv.mnCursorFlags = 0;
+ aEv.mbOnlyCursor = sal_False;
+ CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv);
+ }
+ }
+ bool bWasInput = rSeq.getLength() > 0;
+ rSeq = rtl::OUString();
+ if( bWasInput && ! aDeleteWatch.isDeleted() )
+ CallCallback(SALEVENT_ENDEXTTEXTINPUT, NULL);
+ return bWasInput;
+}
+
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
{
@@ -3205,8 +3299,8 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
}
SalKeyEvent aKeyEvt;
- USHORT nKeyCode;
- USHORT nModCode = 0;
+ sal_uInt16 nKeyCode;
+ sal_uInt16 nModCode = 0;
char aDummy;
if( pEvent->state & ShiftMask )
@@ -3216,6 +3310,9 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
if( pEvent->state & Mod1Mask )
nModCode |= KEY_MOD2;
+ if( nModCode != (KEY_SHIFT|KEY_MOD1) )
+ endUnicodeSequence();
+
if( nKeySym == XK_Shift_L || nKeySym == XK_Shift_R
|| nKeySym == XK_Control_L || nKeySym == XK_Control_R
|| nKeySym == XK_Alt_L || nKeySym == XK_Alt_R
@@ -3236,8 +3333,8 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
// the event state does not contain ControlMask. In the release
// event its the other way round: it does contain the Control mask.
// The modifier mode therefore has to be adapted manually.
- USHORT nExtModMask = 0;
- USHORT nModMask = 0;
+ sal_uInt16 nExtModMask = 0;
+ sal_uInt16 nModMask = 0;
switch( nKeySym )
{
case XK_Control_L:
@@ -3320,6 +3417,33 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
if( !nKeyCode && !nLen && !nKeyString)
return 0;
+ DeletionListener aDeleteWatch( this );
+
+ if( nModCode == (KEY_SHIFT | KEY_MOD1) && pEvent->type == XLIB_KeyPress )
+ {
+ sal_uInt16 nSeqKeyCode = pDisplay_->GetKeyCode( nUnmodifiedKeySym, &aDummy );
+ if( nSeqKeyCode == KEY_U )
+ {
+ beginUnicodeSequence();
+ return 1;
+ }
+ else if( nSeqKeyCode >= KEY_0 && nSeqKeyCode <= KEY_9 )
+ {
+ if( appendUnicodeSequence( sal_Unicode( '0' ) + sal_Unicode(nSeqKeyCode - KEY_0) ) )
+ return 1;
+ }
+ else if( nSeqKeyCode >= KEY_A && nSeqKeyCode <= KEY_F )
+ {
+ if( appendUnicodeSequence( sal_Unicode( 'a' ) + sal_Unicode(nSeqKeyCode - KEY_A) ) )
+ return 1;
+ }
+ else
+ endUnicodeSequence();
+ }
+
+ if( aDeleteWatch.isDeleted() )
+ return 0;
+
rtl_TextEncoding nEncoding;
if (mpInputContext != NULL && mpInputContext->IsMultiLingual() )
@@ -3378,8 +3502,6 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
nSize = 0;
}
- DeletionListener aDeleteWatch( this );
-
if ( mpInputContext != NULL
&& mpInputContext->UseContext()
&& KeyRelease != pEvent->type
@@ -3474,9 +3596,7 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent )
if( FocusIn == pEvent->type )
{
-#ifndef _USE_PRINT_EXTENSION_
GetSalData()->m_pInstance->updatePrinterUpdate();
-#endif
mbInputFocus = True;
ImplSVData* pSVData = ImplGetSVData();
@@ -3486,7 +3606,7 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent )
if ((mpParent != NULL && nStyle_ == 0)
&& pSVData->maWinData.mpFirstFloat )
{
- ULONG nMode = pSVData->maWinData.mpFirstFloat->GetPopupModeFlags();
+ sal_uLong nMode = pSVData->maWinData.mpFirstFloat->GetPopupModeFlags();
pSVData->maWinData.mpFirstFloat->SetPopupModeFlags(
nMode & ~(FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE));
}
@@ -3509,7 +3629,7 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent )
long X11SalFrame::HandleExposeEvent( XEvent *pEvent )
{
XRectangle aRect = { 0, 0, 0, 0 };
- USHORT nCount = 0;
+ sal_uInt16 nCount = 0;
if( pEvent->type == Expose )
{
@@ -3738,9 +3858,9 @@ long X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent )
XLIB_Window hWM_Parent;
XLIB_Window hRoot, *Children, hDummy;
unsigned int nChildren;
- BOOL bNone = pDisplay_->GetProperties()
+ sal_Bool bNone = pDisplay_->GetProperties()
& PROPERTY_SUPPORT_WM_Parent_Pixmap_None;
- BOOL bAccessParentWindow = ! (pDisplay_->GetProperties()
+ sal_Bool bAccessParentWindow = ! (pDisplay_->GetProperties()
& PROPERTY_FEATURE_TrustedSolaris);
static const char* pDisableStackingCheck = getenv( "SAL_DISABLE_STACKING_CHECK" );
@@ -3769,8 +3889,8 @@ long X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent )
hWM_Parent = GetShellWindow();
break;
}
- /* this sometimes happens if a Show(TRUE) is
- * immediately followed by Show(FALSE) (which is braindead anyway)
+ /* this sometimes happens if a Show(sal_True) is
+ * immediately followed by Show(sal_False) (which is braindead anyway)
*/
if( hDummy == hWM_Parent )
hDummy = hRoot;
@@ -4116,7 +4236,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
if( -1 == nCaptured_ )
{
- CaptureMouse( TRUE );
+ CaptureMouse( sal_True );
#ifdef DBG_UTIL
if( -1 != nCaptured_ )
pDisplay_->PrintEvent( "Captured", pEvent );
@@ -4187,9 +4307,9 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
XUnmapWindow( GetXDisplay(), GetShellWindow() );
break;
}
- bMapped_ = TRUE;
- bViewable_ = TRUE;
- nRet = TRUE;
+ bMapped_ = sal_True;
+ bViewable_ = sal_True;
+ nRet = sal_True;
if ( mpInputContext != NULL )
mpInputContext->Map( this );
CallCallback( SALEVENT_RESIZE, NULL );
@@ -4277,7 +4397,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
RestackChildren();
- mbInShow = FALSE;
+ mbInShow = sal_False;
m_bSetFocusOnMap = false;
}
break;
@@ -4285,9 +4405,9 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
case UnmapNotify:
if( pEvent->xunmap.window == GetShellWindow() )
{
- bMapped_ = FALSE;
- bViewable_ = FALSE;
- nRet = TRUE;
+ bMapped_ = sal_False;
+ bViewable_ = sal_False;
+ nRet = sal_True;
if ( mpInputContext != NULL )
mpInputContext->Unmap( this );
CallCallback( SALEVENT_RESIZE, NULL );
@@ -4302,7 +4422,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
case VisibilityNotify:
nVisibility_ = pEvent->xvisibility.state;
- nRet = TRUE;
+ nRet = sal_True;
if( bAlwaysOnTop_
&& bMapped_
&& ! GetDisplay()->getWMAdaptor()->isAlwaysOnTopOK()
@@ -4401,7 +4521,7 @@ void X11SalFrame::ResetClipRegion()
op, ordering );
}
-void X11SalFrame::BeginSetClipRegion( ULONG nRects )
+void X11SalFrame::BeginSetClipRegion( sal_uLong nRects )
{
if( m_pClipRectangles )
delete [] m_pClipRectangles;
diff --git a/vcl/unx/source/window/salmenu.cxx b/vcl/unx/source/window/salmenu.cxx
deleted file mode 100644
index a5622a48ba70..000000000000
--- a/vcl/unx/source/window/salmenu.cxx
+++ /dev/null
@@ -1,134 +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_vcl.hxx"
-
-
-#include <saldata.hxx>
-#include <salinst.h>
-#include <salmenu.h>
-
-
-// =======================================================================
-
-// X11SalInst factory methods
-
-SalMenu* X11SalInstance::CreateMenu( BOOL /*bMenuBar*/ )
-{
- return NULL; // no support for native menues
-}
-
-void X11SalInstance::DestroyMenu( SalMenu* pSalMenu )
-{
- delete pSalMenu;
-}
-
-
-SalMenuItem* X11SalInstance::CreateMenuItem( const SalItemParams* )
-{
- return NULL; // no support for native menues
-}
-
-void X11SalInstance::DestroyMenuItem( SalMenuItem* pSalMenuItem )
-{
- delete pSalMenuItem;
-}
-
-
-// =======================================================================
-
-
-/*
- * X11SalMenu
- */
-
-
-X11SalMenu::~X11SalMenu()
-{
-}
-
-BOOL X11SalMenu::VisibleMenuBar()
-{
- return FALSE;
-}
-
-void X11SalMenu::SetFrame( const SalFrame* )
-{
-}
-
-void X11SalMenu::InsertItem( SalMenuItem*, unsigned )
-{
-}
-
-void X11SalMenu::RemoveItem( unsigned )
-{
-}
-
-void X11SalMenu::SetSubMenu( SalMenuItem*, SalMenu*, unsigned )
-{
-}
-
-void X11SalMenu::CheckItem( unsigned, BOOL )
-{
-}
-
-void X11SalMenu::EnableItem( unsigned, BOOL )
-{
-}
-
-void X11SalMenu::SetItemImage( unsigned, SalMenuItem*, const Image& )
-{
-}
-
-void X11SalMenu::SetItemText( unsigned, SalMenuItem*, const XubString& )
-{
-}
-
-void X11SalMenu::SetAccelerator( unsigned, SalMenuItem*, const KeyCode&, const XubString& )
-{
-}
-
-void X11SalMenu::GetSystemMenuData( SystemMenuData* )
-{
-}
-
-// =======================================================================
-
-/*
- * SalMenuItem
- */
-
-
-X11SalMenuItem::~X11SalMenuItem()
-{
-}
-
-// -------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/window/salobj.cxx b/vcl/unx/source/window/salobj.cxx
index 6704077b1ec4..07cbcf115d5e 100644
--- a/vcl/unx/source/window/salobj.cxx
+++ b/vcl/unx/source/window/salobj.cxx
@@ -52,12 +52,12 @@
// =======================================================================
// SalInstance member to create and destroy a SalObject
-SalObject* X11SalInstance::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow )
+SalObject* X11SalInstance::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow )
{
return X11SalObject::CreateObject( pParent, pWindowData, bShow );
}
-X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow )
+X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow )
{
int error_base, event_base;
X11SalObject* pObject = new X11SalObject();
@@ -149,7 +149,7 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p
pVisual,
CWEventMask|CWColormap, &aAttribs );
XSync( pDisp, False );
- BOOL bWasXError = pSalDisp->GetXLib()->HasXErrorOccurred();
+ sal_Bool bWasXError = pSalDisp->GetXLib()->HasXErrorOccurred();
pSalDisp->GetXLib()->PopXErrorLevel();
if( bWasXError )
{
@@ -176,7 +176,7 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p
pObjData->pAppContext = NULL;
XSync(pDisp, False);
- BOOL bWasXError = pSalDisp->GetXLib()->HasXErrorOccurred();
+ sal_Bool bWasXError = pSalDisp->GetXLib()->HasXErrorOccurred();
pSalDisp->GetXLib()->PopXErrorLevel();
if( bWasXError )
{
@@ -216,7 +216,7 @@ SalClipRegion::~SalClipRegion()
void
-SalClipRegion::BeginSetClipRegion( ULONG nRects )
+SalClipRegion::BeginSetClipRegion( sal_uLong nRects )
{
if (ClipRectangleList)
delete [] ClipRectangleList;
@@ -321,7 +321,7 @@ X11SalObject::ResetClipRegion()
void
-X11SalObject::BeginSetClipRegion( ULONG nRectCount )
+X11SalObject::BeginSetClipRegion( sal_uLong nRectCount )
{
maClipRegion.BeginSetClipRegion ( nRectCount );
}
@@ -372,7 +372,7 @@ X11SalObject::EndSetClipRegion()
}
-USHORT
+sal_uInt16
X11SalObject::GetClipRegionType()
{
return maClipRegion.GetClipRegionType();
@@ -396,7 +396,7 @@ X11SalObject::SetPosSize( long nX, long nY, long nWidth, long nHeight )
void
-X11SalObject::Show( BOOL bVisible )
+X11SalObject::Show( sal_Bool bVisible )
{
if ( ! maSystemChildData.aWindow )
return;
@@ -417,7 +417,7 @@ X11SalObject::Show( BOOL bVisible )
// -----------------------------------------------------------------------
-void X11SalObject::Enable( BOOL )
+void X11SalObject::Enable( sal_Bool )
{
}
@@ -451,9 +451,9 @@ const SystemChildData* X11SalObject::GetSystemData() const
return &maSystemChildData;
}
-static USHORT sal_GetCode( int state )
+static sal_uInt16 sal_GetCode( int state )
{
- USHORT nCode = 0;
+ sal_uInt16 nCode = 0;
if( state & Button1Mask )
nCode |= MOUSE_LEFT;
@@ -509,7 +509,7 @@ long X11SalObject::Dispatch( XEvent* pEvent )
aEvt.mnTime = pEvent->xbutton.time;
aEvt.mnCode = sal_GetCode( pEvent->xbutton.state );
aEvt.mnButton = 0;
- USHORT nEvent = 0;
+ sal_uInt16 nEvent = 0;
if( pEvent->type == ButtonPress ||
pEvent->type == ButtonRelease )
{
@@ -534,10 +534,10 @@ long X11SalObject::Dispatch( XEvent* pEvent )
switch( pEvent->type )
{
case UnmapNotify:
- pObject->mbVisible = FALSE;
+ pObject->mbVisible = sal_False;
return 1;
case MapNotify:
- pObject->mbVisible = TRUE;
+ pObject->mbVisible = sal_True;
return 1;
case ButtonPress:
pObject->CallCallback( SALOBJ_EVENT_TOTOP, NULL );
@@ -557,4 +557,10 @@ long X11SalObject::Dispatch( XEvent* pEvent )
return 0;
}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+// -----------------------------------------------------------------------
+
+void X11SalObject::InterceptChildWindowKeyDown( sal_Bool /*bIntercept*/ )
+{
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/vcl/util/makefile.mk b/vcl/util/makefile.mk
index a67095f90188..713d28a43846 100755
--- a/vcl/util/makefile.mk
+++ b/vcl/util/makefile.mk
@@ -125,7 +125,6 @@ HXXDEPNLST= $(INC)$/vcl$/accel.hxx \
$(INC)$/vcl$/virdev.hxx \
$(INC)$/vcl$/wall.hxx \
$(INC)$/vcl$/waitobj.hxx \
- $(INC)$/vcl$/wintypes.hxx \
$(INC)$/vcl$/window.hxx \
$(INC)$/vcl$/wrkwin.hxx
@@ -306,7 +305,7 @@ SHL2STDLIBS=\
# prepare linking of Xinerama
.IF "$(USE_XINERAMA)" != "NO"
-.IF "$(OS)"=="MACOSX"
+.IF "$(OS)"=="MACOSX" || "$(OS)$(CPU)" == "LINUXX"
XINERAMALIBS=-lXinerama
.ELSE
.IF "$(OS)" != "SOLARIS" || "$(USE_XINERAMA_VERSION)" == "Xorg"
@@ -391,6 +390,9 @@ SHL4STDLIBS+= $(XRANDR_LIBS)
.IF "$(ENABLE_KDE)" != ""
.IF "$(KDE_ROOT)"!=""
EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib
+.IF "$(OS)$(CPU)" == "LINUXX"
+EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib64
+.ENDIF
.ENDIF
LIB5TARGET=$(SLB)$/ikde_plug_
LIB5FILES=$(SLB)$/kdeplug.lib
@@ -452,3 +454,16 @@ SHL6STDLIBS+=$(KDE4_LIBS) $(KDE_GLIB_LIBS)
.INCLUDE : target.mk
+ALLTAR : $(MISC)/vcl.component
+
+.IF "$(OS)" == "MACOSX"
+my_platform = .macosx
+.ELIF "$(OS)" == "WNT"
+my_platform = .windows
+.END
+
+$(MISC)/vcl.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ vcl.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt vcl$(my_platform).component
diff --git a/vcl/util/target.pmk b/vcl/util/target.pmk
index 3144acc4bc05..8ec15475bc90 100644
--- a/vcl/util/target.pmk
+++ b/vcl/util/target.pmk
@@ -37,8 +37,3 @@ ONLYDLL .SETDIR=$(PRJ)$/util: $(SLOFILES)
dmake debug=t prjpch=t linkinc=t compinc=t ..$/$(OUTPATH)$/bin$/sv$(DLLPOSTFIX).dll
@echo "READY"
-.IF "$(USE_XPRINT)"!="TRUE"
-.ELSE
-CFLAGS+=-D_USE_PRINT_EXTENSION_=1
-.ENDIF
-
diff --git a/vcl/util/vcl.component b/vcl/util/vcl.component
new file mode 100644
index 000000000000..da20fc916c32
--- /dev/null
+++ b/vcl/util/vcl.component
@@ -0,0 +1,49 @@
+<?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.datatransfer.X11ClipboardSupport">
+ <service name="com.sun.star.datatransfer.clipboard.SystemClipboard"/>
+ </implementation>
+ <implementation name="com.sun.star.datatransfer.dnd.XdndDropTarget">
+ <service name="com.sun.star.datatransfer.dnd.X11DropTarget"/>
+ </implementation>
+ <implementation name="com.sun.star.datatransfer.dnd.XdndSupport">
+ <service name="com.sun.star.datatransfer.dnd.X11DragSource"/>
+ </implementation>
+ <implementation name="com.sun.star.frame.VCLSessionManagerClient">
+ <service name="com.sun.star.frame.SessionManagerClient"/>
+ </implementation>
+ <implementation name="vcl::DisplayAccess">
+ <service name="com.sun.star.awt.DisplayAccess"/>
+ </implementation>
+ <implementation name="vcl::FontIdentificator">
+ <service name="com.sun.star.awt.FontIdentificator"/>
+ </implementation>
+</component>
diff --git a/vcl/util/vcl.macosx.component b/vcl/util/vcl.macosx.component
new file mode 100644
index 000000000000..3aabcd8c7050
--- /dev/null
+++ b/vcl/util/vcl.macosx.component
@@ -0,0 +1,49 @@
+<?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.datatransfer.dnd.OleDragSource_V1">
+ <service name="com.sun.star.datatransfer.dnd.OleDragSource"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.datatransfer.dnd.OleDropTarget_V1">
+ <service name="com.sun.star.datatransfer.dnd.OleDropTarget"/>
+ </implementation>
+ <implementation name="com.sun.star.datatransfer.clipboard.AquaClipboard">
+ <service name="com.sun.star.datatransfer.clipboard.SystemClipboard"/>
+ </implementation>
+ <implementation name="com.sun.star.frame.VCLSessionManagerClient">
+ <service name="com.sun.star.frame.SessionManagerClient"/>
+ </implementation>
+ <implementation name="vcl::DisplayAccess">
+ <service name="com.sun.star.awt.DisplayAccess"/>
+ </implementation>
+ <implementation name="vcl::FontIdentificator">
+ <service name="com.sun.star.awt.FontIdentificator"/>
+ </implementation>
+</component>
diff --git a/vcl/util/vcl.windows.component b/vcl/util/vcl.windows.component
new file mode 100644
index 000000000000..72f7ace9f251
--- /dev/null
+++ b/vcl/util/vcl.windows.component
@@ -0,0 +1,40 @@
+<?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.frame.VCLSessionManagerClient">
+ <service name="com.sun.star.frame.SessionManagerClient"/>
+ </implementation>
+ <implementation name="vcl::DisplayAccess">
+ <service name="com.sun.star.awt.DisplayAccess"/>
+ </implementation>
+ <implementation name="vcl::FontIdentificator">
+ <service name="com.sun.star.awt.FontIdentificator"/>
+ </implementation>
+</component>
diff --git a/vcl/win/inc/salbmp.h b/vcl/win/inc/salbmp.h
index 466dadce0c46..9ae4b4bef2ca 100644
--- a/vcl/win/inc/salbmp.h
+++ b/vcl/win/inc/salbmp.h
@@ -50,16 +50,16 @@ private:
Size maSize;
HGLOBAL mhDIB;
HBITMAP mhDDB;
- USHORT mnBitCount;
+ sal_uInt16 mnBitCount;
public:
HGLOBAL ImplGethDIB() const { return mhDIB; }
HBITMAP ImplGethDDB() const { return mhDDB; }
- static HGLOBAL ImplCreateDIB( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal );
+ static HGLOBAL ImplCreateDIB( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal );
static HANDLE ImplCopyDIBOrDDB( HANDLE hHdl, bool bDIB );
- static USHORT ImplGetDIBColorCount( HGLOBAL hDIB );
+ static sal_uInt16 ImplGetDIBColorCount( HGLOBAL hDIB );
static void ImplDecodeRLEBuffer( const BYTE* pSrcBuf, BYTE* pDstBuf,
const Size& rSizePixel, bool bRLE4 );
@@ -71,10 +71,10 @@ public:
public:
bool Create( HANDLE hBitmap, bool bDIB, bool bCopyHandle );
- virtual bool Create( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal );
+ virtual bool Create( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal );
virtual bool Create( const SalBitmap& rSalBmpImpl );
virtual bool Create( const SalBitmap& rSalBmpImpl, SalGraphics* pGraphics );
- virtual bool Create( const SalBitmap& rSalBmpImpl, USHORT nNewBitCount );
+ virtual bool Create( const SalBitmap& rSalBmpImpl, sal_uInt16 nNewBitCount );
virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
Size& rSize,
bool bMask = false );
@@ -82,7 +82,7 @@ public:
virtual void Destroy();
virtual Size GetSize() const { return maSize; }
- virtual USHORT GetBitCount() const { return mnBitCount; }
+ virtual sal_uInt16 GetBitCount() const { return mnBitCount; }
virtual BitmapBuffer* AcquireBuffer( bool bReadOnly );
virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly );
diff --git a/vcl/win/inc/saldata.hxx b/vcl/win/inc/saldata.hxx
index 4c87484a5398..95aa8f5434f2 100644
--- a/vcl/win/inc/saldata.hxx
+++ b/vcl/win/inc/saldata.hxx
@@ -34,6 +34,8 @@
#include <vcl/salwtype.hxx>
#include <wincomp.hxx>
+#include "osl/module.h"
+
#include <set> // for hMenu validation
#include <map>
@@ -47,6 +49,8 @@ class Font;
struct HDCCache;
struct TempFontItem;
+typedef HRESULT (WINAPI *DwmIsCompositionEnabled_ptr)(BOOL*);
+
// --------------------
// - Standard-Defines -
// --------------------
@@ -85,7 +89,7 @@ public:
void initKeyCodeMap();
// checks if the menuhandle was created by VCL
- BOOL IsKnownMenuHandle( HMENU hMenu );
+ sal_Bool IsKnownMenuHandle( HMENU hMenu );
public:
HINSTANCE mhInst; // default instance handle
@@ -98,12 +102,12 @@ public:
long* mpDitherDiff; // Dither mapping table
BYTE* mpDitherLow; // Dither mapping table
BYTE* mpDitherHigh; // Dither mapping table
- ULONG mnTimerMS; // Current Time (in MS) of the Timer
- ULONG mnTimerOrgMS; // Current Original Time (in MS)
+ sal_uLong mnTimerMS; // Current Time (in MS) of the Timer
+ sal_uLong mnTimerOrgMS; // Current Original Time (in MS)
DWORD mnNextTimerTime;
DWORD mnLastEventTime;
UINT mnTimerId; // windows timer id
- BOOL mbInTimerProc; // timer event is currently being dispatched
+ sal_Bool mbInTimerProc; // timer event is currently being dispatched
HHOOK mhSalObjMsgHook; // hook to get interesting msg for SalObject
HWND mhWantLeaveMsg; // window handle, that want a MOUSELEAVE message
AutoTimer* mpMouseLeaveTimer; // Timer for MouseLeave Test
@@ -119,25 +123,28 @@ public:
COLORREF maStockBrushColorAry[MAX_STOCKBRUSH];
HPEN mhStockPenAry[MAX_STOCKPEN];
HBRUSH mhStockBrushAry[MAX_STOCKBRUSH];
- USHORT mnStockPenCount; // count of static pens
- USHORT mnStockBrushCount; // count of static brushes
+ sal_uInt16 mnStockPenCount; // count of static pens
+ sal_uInt16 mnStockBrushCount; // count of static brushes
WPARAM mnSalObjWantKeyEvt; // KeyEvent, welcher vom SalObj-Hook verarbeitet werden soll
BYTE mnCacheDCInUse; // count of CacheDC in use
- BOOL mbObjClassInit; // is SALOBJECTCLASS initialised
- BOOL mbInPalChange; // is in WM_QUERYNEWPALETTE
+ sal_Bool mbObjClassInit; // is SALOBJECTCLASS initialised
+ sal_Bool mbInPalChange; // is in WM_QUERYNEWPALETTE
DWORD mnAppThreadId; // Id from Applikation-Thread
- WIN_BOOL mbScrSvrEnabled; // ScreenSaver enabled
+ BOOL mbScrSvrEnabled; // ScreenSaver enabled
int mnSageStatus; // status of Sage-DLL (DISABLE_AGENT == nicht vorhanden)
SysAgt_Enable_PROC mpSageEnableProc; // funktion to deactivate the system agent
SalIcon* mpFirstIcon; // icon cache, points to first icon, NULL if none
TempFontItem* mpTempFontItem;
- BOOL mbThemeChanged; // true if visual theme was changed: throw away theme handles
+ sal_Bool mbThemeChanged; // true if visual theme was changed: throw away theme handles
+ sal_Bool mbThemeMenuSupport;
// for GdiPlus GdiplusStartup/GdiplusShutdown
ULONG_PTR gdiplusToken;
std::set< HMENU > mhMenuSet; // keeps track of menu handles created by VCL, used by IsKnownMenuHandle()
- std::map< UINT,USHORT > maVKMap; // map some dynamic VK_* entries
+ std::map< UINT,sal_uInt16 > maVKMap; // map some dynamic VK_* entries
+ oslModule maDwmLib;
+ DwmIsCompositionEnabled_ptr mpDwmIsCompositionEnabled;
};
inline void SetSalData( SalData* pData ) { ImplGetSVData()->mpSalData = (void*)pData; }
@@ -154,8 +161,8 @@ struct SalShlData
UINT mnWheelScrollLines; // WheelScrollLines
UINT mnWheelScrollChars; // WheelScrollChars
UINT mnWheelMsgId; // Wheel-Message-Id fuer W95
- WIN_BOOL mbWXP; // Windows XP
- WIN_BOOL mbWPrinter; // true: use unicode printer functions
+ BOOL mbWXP; // Windows XP
+ BOOL mbWPrinter; // true: use unicode printer functions
// false: use anis compat printer functions
OSVERSIONINFO maVersionInfo;
};
@@ -182,8 +189,8 @@ struct HDCCache
};
void ImplClearHDCCache( SalData* pData );
-HDC ImplGetCachedDC( ULONG nID, HBITMAP hBmp = 0 );
-void ImplReleaseCachedDC( ULONG nID );
+HDC ImplGetCachedDC( sal_uLong nID, HBITMAP hBmp = 0 );
+void ImplReleaseCachedDC( sal_uLong nID );
bool ImplAddTempFont( SalData&, const String& rFontFileURL );
void ImplReleaseTempFonts( SalData& );
@@ -194,7 +201,7 @@ void ImplReleaseTempFonts( SalData& );
HCURSOR ImplLoadSalCursor( int nId );
HBITMAP ImplLoadSalBitmap( int nId );
-BOOL ImplLoadSalIcon( int nId, HICON& rIcon, HICON& rSmallIcon );
+sal_Bool ImplLoadSalIcon( int nId, HICON& rIcon, HICON& rSmallIcon );
// SALGDI.CXX
void ImplInitSalGDI();
@@ -206,11 +213,12 @@ void ImplFreeSalGDI();
// \\WIN\SOURCE\APP\SALINST.CXX
void ImplSalYieldMutexAcquireWithWait();
-BOOL ImplSalYieldMutexTryToAcquire();
+sal_Bool ImplSalYieldMutexTryToAcquire();
void ImplSalYieldMutexAcquire();
void ImplSalYieldMutexRelease();
-ULONG ImplSalReleaseYieldMutex();
-void ImplSalAcquireYieldMutex( ULONG nCount );
+sal_uLong ImplSalReleaseYieldMutex();
+void ImplSalAcquireYieldMutex( sal_uLong nCount );
+sal_Bool ImplInterceptChildWindowKeyDown( MSG& rMsg );
// \\WIN\SOURCE\WINDOW\SALFRAME.CXX
LRESULT CALLBACK SalFrameWndProcA( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam );
@@ -221,16 +229,16 @@ void CALLBACK SalTimerProc( HWND hWnd, UINT nMsg, UINT_PTR nId, DWORD nTime )
// \WIN\SOURCE\WINDOW\SALFRAME.CXX
void SalTestMouseLeave();
-BOOL ImplWriteLastError( DWORD lastError, const char *szApiCall );
+sal_Bool ImplWriteLastError( DWORD lastError, const char *szApiCall );
// \WIN\SOURCE\WINDOW\SALFRAME.CXX
long ImplHandleSalObjKeyMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam );
long ImplHandleSalObjSysCharMsg( HWND hWnd, WPARAM wParam, LPARAM lParam );
-BOOL ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, LRESULT& rlResult );
+sal_Bool ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, LRESULT& rlResult );
// \WIN\SOURCE\WINDOW\SALOBJ.CXX
WinSalObject* ImplFindSalObject( HWND hWndChild );
-BOOL ImplSalPreDispatchMsg( MSG* pMsg );
+sal_Bool ImplSalPreDispatchMsg( MSG* pMsg );
void ImplSalPostDispatchMsg( MSG* pMsg, LRESULT nDispatchResult );
// \WIN\SOURCE\GDI\SALGDI3.CXX
@@ -240,7 +248,7 @@ bool ImplIsFontAvailable( HDC hDC, const UniString& rName );
// \WIN\SOURCE\APP\SALDATA.CXX
rtl_TextEncoding ImplSalGetSystemEncoding();
-ByteString ImplSalGetWinAnsiString( const UniString& rStr, BOOL bFileName = FALSE );
+ByteString ImplSalGetWinAnsiString( const UniString& rStr, sal_Bool bFileName = FALSE );
UniString ImplSalGetUniString( const sal_Char* pStr, xub_StrLen nLen = STRING_LEN );
int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 );
@@ -339,10 +347,10 @@ int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 );
// -----------------
// A/W-Wrapper
-WIN_BOOL ImplPostMessage( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam );
-WIN_BOOL ImplSendMessage( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam );
-WIN_BOOL ImplGetMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax );
-WIN_BOOL ImplPeekMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg );
+BOOL ImplPostMessage( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam );
+BOOL ImplSendMessage( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam );
+BOOL ImplGetMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax );
+BOOL ImplPeekMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg );
LONG ImplDispatchMessage( CONST MSG *lpMsg );
inline void SetWindowPtr( HWND hWnd, WinSalFrame* pThis )
diff --git a/vcl/win/inc/salframe.h b/vcl/win/inc/salframe.h
index 49a1b50c14e2..d3e7516f17f3 100644
--- a/vcl/win/inc/salframe.h
+++ b/vcl/win/inc/salframe.h
@@ -63,33 +63,33 @@ public:
int mnFullScreenShowState; // fullscreen restore show state
UINT mnInputLang; // current Input Language
UINT mnInputCodePage; // current Input CodePage
- ULONG mnStyle; // style
- BOOL mbGraphics; // is Graphics used
- BOOL mbCaption; // has window a caption
- BOOL mbBorder; // has window a border
- BOOL mbFixBorder; // has window a fixed border
- BOOL mbSizeBorder; // has window a sizeable border
- BOOL mbNoIcon; // is an window without an icon
- BOOL mbFloatWin; // is a FloatingWindow
- BOOL mbFullScreen; // TRUE: in full screen mode
- BOOL mbPresentation; // TRUE: Presentation Mode running
- BOOL mbInShow; // innerhalb eines Show-Aufrufs
- BOOL mbRestoreMaximize; // Restore-Maximize
- BOOL mbInMoveMsg; // Move-Message wird verarbeitet
- BOOL mbInSizeMsg; // Size-Message wird verarbeitet
- BOOL mbFullScreenToolWin; // WS_EX_TOOLWINDOW reset in FullScreenMode
- BOOL mbDefPos; // default-position
- BOOL mbOverwriteState; // TRUE: WindowState darf umgesetzt werden
- BOOL mbIME; // TRUE: We are in IME Mode
- BOOL mbHandleIME; // TRUE: Wir handeln die IME-Messages
- BOOL mbSpezIME; // TRUE: Spez IME
- BOOL mbAtCursorIME; // TRUE: Wir behandeln nur einige IME-Messages
- BOOL mbCandidateMode; // TRUE: Wir befinden uns im Candidate-Modus
- static BOOL mbInReparent; // TRUE: ignore focus lost and gain due to reparenting
+ sal_uIntPtr mnStyle; // style
+ sal_Bool mbGraphics; // is Graphics used
+ sal_Bool mbCaption; // has window a caption
+ sal_Bool mbBorder; // has window a border
+ sal_Bool mbFixBorder; // has window a fixed border
+ sal_Bool mbSizeBorder; // has window a sizeable border
+ sal_Bool mbNoIcon; // is an window without an icon
+ sal_Bool mbFloatWin; // is a FloatingWindow
+ sal_Bool mbFullScreen; // TRUE: in full screen mode
+ sal_Bool mbPresentation; // TRUE: Presentation Mode running
+ sal_Bool mbInShow; // innerhalb eines Show-Aufrufs
+ sal_Bool mbRestoreMaximize; // Restore-Maximize
+ sal_Bool mbInMoveMsg; // Move-Message wird verarbeitet
+ sal_Bool mbInSizeMsg; // Size-Message wird verarbeitet
+ sal_Bool mbFullScreenToolWin; // WS_EX_TOOLWINDOW reset in FullScreenMode
+ sal_Bool mbDefPos; // default-position
+ sal_Bool mbOverwriteState; // TRUE: WindowState darf umgesetzt werden
+ sal_Bool mbIME; // TRUE: We are in IME Mode
+ sal_Bool mbHandleIME; // TRUE: Wir handeln die IME-Messages
+ sal_Bool mbSpezIME; // TRUE: Spez IME
+ sal_Bool mbAtCursorIME; // TRUE: Wir behandeln nur einige IME-Messages
+ sal_Bool mbCandidateMode; // TRUE: Wir befinden uns im Candidate-Modus
+ static sal_Bool mbInReparent; // TRUE: ignore focus lost and gain due to reparenting
RGNDATA* mpClipRgnData;
RECT* mpNextClipRect;
- BOOL mbFirstClipRect;
+ sal_Bool mbFirstClipRect;
sal_Int32 mnDisplay; // Display used for Fullscreen, 0 is primary monitor
void updateScreenNumber();
@@ -99,37 +99,37 @@ public:
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual BOOL PostEvent( void* pData );
+ virtual sal_Bool PostEvent( void* pData );
virtual void SetTitle( const XubString& rTitle );
- virtual void SetIcon( USHORT nIcon );
+ virtual void SetIcon( sal_uInt16 nIcon );
virtual void SetMenu( SalMenu* pSalMenu );
virtual void DrawMenuBar();
virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle );
- virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE );
- virtual void Enable( BOOL bEnable );
+ virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = FALSE );
+ virtual void Enable( sal_Bool bEnable );
virtual void SetMinClientSize( long nWidth, long nHeight );
virtual void SetMaxClientSize( long nWidth, long nHeight );
- virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags );
+ virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags );
virtual void GetClientSize( long& rWidth, long& rHeight );
virtual void GetWorkArea( Rectangle& rRect );
virtual SalFrame* GetParent() const;
virtual void SetWindowState( const SalFrameState* pState );
- virtual BOOL GetWindowState( SalFrameState* pState );
- virtual void ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay );
- virtual void StartPresentation( BOOL bStart );
- virtual void SetAlwaysOnTop( BOOL bOnTop );
- virtual void ToTop( USHORT nFlags );
+ virtual sal_Bool GetWindowState( SalFrameState* pState );
+ virtual void ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay );
+ virtual void StartPresentation( sal_Bool bStart );
+ virtual void SetAlwaysOnTop( sal_Bool bOnTop );
+ virtual void ToTop( sal_uInt16 nFlags );
virtual void SetPointer( PointerStyle ePointerStyle );
- virtual void CaptureMouse( BOOL bMouse );
+ virtual void CaptureMouse( sal_Bool bMouse );
virtual void SetPointerPos( long nX, long nY );
using SalFrame::Flush;
virtual void Flush();
virtual void Sync();
virtual void SetInputContext( SalInputContext* pContext );
- virtual void EndExtTextInput( USHORT nFlags );
- virtual String GetKeyName( USHORT nKeyCode );
- virtual String GetSymbolKeyName( const XubString& rFontName, USHORT nKeyCode );
- virtual BOOL MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode );
+ virtual void EndExtTextInput( sal_uInt16 nFlags );
+ virtual String GetKeyName( sal_uInt16 nKeyCode );
+ virtual String GetSymbolKeyName( const XubString& rFontName, sal_uInt16 nKeyCode );
+ virtual sal_Bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode );
virtual LanguageType GetInputLanguage();
virtual SalBitmap* SnapShot();
virtual void UpdateSettings( AllSettings& rSettings );
@@ -137,14 +137,14 @@ public:
virtual const SystemEnvData* GetSystemData() const;
virtual SalPointerState GetPointerState();
virtual SalIndicatorState GetIndicatorState();
- virtual void SimulateKeyPress( USHORT nKeyCode );
+ virtual void SimulateKeyPress( sal_uInt16 nKeyCode );
virtual void SetParent( SalFrame* pNewParent );
virtual bool SetPluginParent( SystemParentData* pNewParent );
virtual void SetBackgroundBitmap( SalBitmap* );
virtual void SetScreenNumber( unsigned int );
virtual void SetApplicationID( const rtl::OUString &rApplicationID );
virtual void ResetClipRegion();
- virtual void BeginSetClipRegion( ULONG nRects );
+ virtual void BeginSetClipRegion( sal_uIntPtr nRects );
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
virtual void EndSetClipRegion();
};
diff --git a/vcl/win/inc/salgdi.h b/vcl/win/inc/salgdi.h
index 951e0c8d7690..a23963f81e7b 100644
--- a/vcl/win/inc/salgdi.h
+++ b/vcl/win/inc/salgdi.h
@@ -83,10 +83,10 @@ private:
class ImplWinFontData : public ImplFontData
{
public:
- ImplWinFontData( const ImplDevFontAttributes&,
- int nFontHeight, WIN_BYTE eWinCharSet,
- WIN_BYTE nPitchAndFamily );
- ~ImplWinFontData();
+ explicit ImplWinFontData( const ImplDevFontAttributes&,
+ int nFontHeight, BYTE eWinCharSet,
+ BYTE nPitchAndFamily );
+ virtual ~ImplWinFontData();
virtual ImplFontData* Clone() const;
virtual ImplFontEntry* CreateFontInstance( ImplFontSelectData& ) const;
@@ -96,8 +96,8 @@ public:
bool HasChar( sal_uInt32 cChar ) const;
- WIN_BYTE GetCharSet() const { return meWinCharSet; }
- WIN_BYTE GetPitchAndFamily() const { return mnPitchAndFamily; }
+ BYTE GetCharSet() const { return meWinCharSet; }
+ BYTE GetPitchAndFamily() const { return mnPitchAndFamily; }
bool IsGlyphApiDisabled() const { return mbDisableGlyphApi; }
bool SupportsKorean() const { return mbHasKoreanRange; }
bool SupportsCJK() const { return mbHasCJKSupport; }
@@ -109,7 +109,7 @@ public:
const gr_face* GraphiteFace() const;
#endif
- ImplFontCharMap* GetImplFontCharMap() const;
+ const ImplFontCharMap* GetImplFontCharMap() const;
bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
const Ucs2SIntMap* GetEncodingVector() const { return mpEncodingVector; }
void SetEncodingVector( const Ucs2SIntMap* pNewVec ) const
@@ -138,8 +138,8 @@ private:
// TODO: get rid of the members below needed to work with the Win9x non-unicode API
BYTE* mpFontCharSets; // all Charsets for the current font (used on W98 for kerning)
BYTE mnFontCharSetCount; // Number of Charsets of the current font; 0 - if not queried
- WIN_BYTE meWinCharSet;
- WIN_BYTE mnPitchAndFamily;
+ BYTE meWinCharSet;
+ BYTE mnPitchAndFamily;
bool mbAliasSymbolsHigh;
bool mbAliasSymbolsLow;
private:
@@ -158,9 +158,9 @@ public:
#endif // GNG_VERT_HACK
};
-// -------------------
-// - SalGraphicsData -
-// -------------------
+// ------------------
+// - WinSalGraphics -
+// ------------------
class WinSalGraphics : public SalGraphics
{
@@ -184,24 +184,22 @@ public:
COLORREF mnTextColor; // TextColor
RGNDATA* mpClipRgnData; // ClipRegion-Data
RGNDATA* mpStdClipRgnData; // Cache Standard-ClipRegion-Data
- RECT* mpNextClipRect; // Naechstes ClipRegion-Rect
- BOOL mbFirstClipRect; // Flag for first cliprect to insert
LOGFONTA* mpLogFont; // LOG-Font which is currently selected (only W9x)
ImplFontAttrCache* mpFontAttrCache; // Cache font attributes from files in so/share/fonts
BYTE* mpFontCharSets; // All Charsets for the current font
BYTE mnFontCharSetCount; // Number of Charsets of the current font; 0 - if not queried
- BOOL mbFontKernInit; // FALSE: FontKerns must be queried
+ sal_Bool mbFontKernInit; // FALSE: FontKerns must be queried
KERNINGPAIR* mpFontKernPairs; // Kerning Pairs of the current Font
- ULONG mnFontKernPairCount;// Number of Kerning Pairs of the current Font
+ sal_uIntPtr mnFontKernPairCount;// Number of Kerning Pairs of the current Font
int mnPenWidth; // Linienbreite
- BOOL mbStockPen; // is Pen a stockpen
- BOOL mbStockBrush; // is Brush a stcokbrush
- BOOL mbPen; // is Pen (FALSE == NULL_PEN)
- BOOL mbBrush; // is Brush (FALSE == NULL_BRUSH)
- BOOL mbPrinter; // is Printer
- BOOL mbVirDev; // is VirDev
- BOOL mbWindow; // is Window
- BOOL mbScreen; // is Screen compatible
+ sal_Bool mbStockPen; // is Pen a stockpen
+ sal_Bool mbStockBrush; // is Brush a stcokbrush
+ sal_Bool mbPen; // is Pen (FALSE == NULL_PEN)
+ sal_Bool mbBrush; // is Brush (FALSE == NULL_BRUSH)
+ sal_Bool mbPrinter; // is Printer
+ sal_Bool mbVirDev; // is VirDev
+ sal_Bool mbWindow; // is Window
+ sal_Bool mbScreen; // is Screen compatible
bool mbXORMode; // _every_ output with RasterOp XOR
// remember RGB values for SetLineColor/SetFillColor
@@ -211,29 +209,28 @@ public:
HFONT ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFontScale, HFONT& o_rOldFont );
public:
- WinSalGraphics();
+ explicit WinSalGraphics();
virtual ~WinSalGraphics();
protected:
- virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
+ virtual bool setClipRegion( const Region& );
// draw --> LineColor and FillColor and RasterOp and ClipRegion
virtual void drawPixel( long nX, long nY );
virtual void drawPixel( long nX, long nY, SalColor nSalColor );
virtual void drawLine( long nX1, long nY1, long nX2, long nY2 );
virtual void drawRect( long nX, long nY, long nWidth, long nHeight );
- virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry );
- virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry );
+ virtual void drawPolyLine( sal_uIntPtr nPoints, const SalPoint* pPtAry );
+ virtual void drawPolygon( sal_uIntPtr nPoints, const SalPoint* pPtAry );
virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry );
virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency );
virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin );
- virtual sal_Bool drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry );
- virtual sal_Bool drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry );
+ virtual sal_Bool drawPolyLineBezier( sal_uIntPtr nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry );
+ virtual sal_Bool drawPolygonBezier( sal_uIntPtr nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry );
virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, const BYTE* const* pFlgAry );
// CopyArea --> No RasterOp, but ClipRegion
virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,
- long nSrcHeight, USHORT nFlags );
+ long nSrcHeight, sal_uInt16 nFlags );
// CopyBits and DrawBitmap --> RasterOp and ClipRegion
// CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
@@ -254,20 +251,20 @@ protected:
// invert --> ClipRegion (only Windows or VirDevs)
virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags);
- virtual void invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags );
+ virtual void invert( sal_uIntPtr nPoints, const SalPoint* pPtAry, SalInvert nFlags );
- virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize );
+ virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uIntPtr nSize );
// native widget rendering methods that require mirroring
- virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
- const Point& aPos, BOOL& rIsInside );
- virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ virtual sal_Bool hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ const Point& aPos, sal_Bool& rIsInside );
+ virtual sal_Bool drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ virtual sal_Bool drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
+ virtual sal_Bool getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const rtl::OUString& aCaption,
Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion );
@@ -282,17 +279,12 @@ public:
// get device resolution
virtual void GetResolution( long& rDPIX, long& rDPIY );
// get the depth of the device
- virtual USHORT GetBitCount() const;
+ virtual sal_uInt16 GetBitCount() const;
// get the width of the device
virtual long GetGraphicsWidth() const;
// set the clip region to empty
virtual void ResetClipRegion();
- // begin setting the clip region, add rectangles to the
- // region with the UnionClipRegion call
- virtual void BeginSetClipRegion( ULONG nCount );
- // all rectangles were added and the clip region should be set now
- virtual void EndSetClipRegion();
// set the line color to transparent (= don't draw lines)
virtual void SetLineColor();
@@ -312,14 +304,14 @@ public:
// set the text color to a specific color
virtual void SetTextColor( SalColor nSalColor );
// set the font
- virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
+ virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel );
// get the current font's etrics
virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
// get kernign pairs of the current font
// return only PairCount if (pKernPairs == NULL)
- virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
+ virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs );
// get the repertoire of the current font
- virtual ImplFontCharMap* GetImplFontCharMap() const;
+ virtual const ImplFontCharMap* GetImplFontCharMap() const;
// get the layout capabilities of the current font
virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rGetFontCapabilities) const;
// graphics must fill supplied font list
@@ -340,7 +332,7 @@ public:
// rInfo: additional outgoing information
// implementation note: encoding 0 with glyph id 0 should be added implicitly
// as "undefined character"
- virtual BOOL CreateFontSubset( const rtl::OUString& rToFile,
+ virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData*,
long* pGlyphIDs,
sal_uInt8* pEncoding,
@@ -378,33 +370,33 @@ public:
Ucs2UIntMap& rUnicodeEnc );
virtual int GetMinKashidaWidth();
- virtual BOOL GetGlyphBoundRect( long nIndex, Rectangle& );
- virtual BOOL GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
+ virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& );
+ virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
virtual void DrawServerFontLayout( const ServerFontLayout& );
virtual bool supportsOperation( OutDevSupportType ) const;
// Query the platform layer for control support
- virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
+ virtual sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart );
virtual SystemGraphicsData GetGraphicsData() const;
virtual SystemFontData GetSysFontData( int nFallbacklevel ) const;
};
// Init/Deinit Graphics
-void ImplSalInitGraphics( WinSalGraphics* mpData );
-void ImplSalDeInitGraphics( WinSalGraphics* mpData );
+void ImplSalInitGraphics( WinSalGraphics* );
+void ImplSalDeInitGraphics( WinSalGraphics* );
void ImplUpdateSysColorEntries();
int ImplIsSysColorEntry( SalColor nSalColor );
-void ImplGetLogFontFromFontSelect( HDC hDC, const ImplFontSelectData*,
+void ImplGetLogFontFromFontSelect( HDC, const ImplFontSelectData*,
LOGFONTW&, bool bTestVerticalAvail );
// -----------
// - Defines -
// -----------
-#define MAX_64KSALPOINTS ((((USHORT)0xFFFF)-8)/sizeof(POINTS))
+#define MAX_64KSALPOINTS ((((sal_uInt16)0xFFFF)-8)/sizeof(POINTS))
// -----------
// - Inlines -
@@ -431,6 +423,8 @@ inline bool ImplWinFontData::HasChar( sal_uInt32 cChar ) const
cChar -= 0xF000;
else if( mbAliasSymbolsHigh && (cChar <= 0xFF) )
cChar += 0xF000;
+ else
+ return false;
return mpUnicodeMap->HasChar( cChar );
}
diff --git a/vcl/win/inc/salinst.h b/vcl/win/inc/salinst.h
index 3b8c32708789..524cf3aca141 100644
--- a/vcl/win/inc/salinst.h
+++ b/vcl/win/inc/salinst.h
@@ -45,19 +45,19 @@ public:
HWND mhComWnd; // window, for communication (between threads and the main thread)
SalYieldMutex* mpSalYieldMutex; // Sal-Yield-Mutex
osl::Mutex* mpSalWaitMutex; // Sal-Wait-Mutex
- USHORT mnYieldWaitCount; // Wait-Count
+ sal_uInt16 mnYieldWaitCount; // Wait-Count
public:
WinSalInstance();
virtual ~WinSalInstance();
- virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle );
- virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
+ virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uIntPtr nStyle );
+ virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uIntPtr nStyle );
virtual void DestroyFrame( SalFrame* pFrame );
- virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE );
+ virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True );
virtual void DestroyObject( SalObject* pObject );
virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
long nDX, long nDY,
- USHORT nBitCount, const SystemGraphicsData *pData );
+ sal_uInt16 nBitCount, const SystemGraphicsData *pData );
virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice );
virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
@@ -74,13 +74,15 @@ public:
virtual SalSystem* CreateSalSystem();
virtual SalBitmap* CreateSalBitmap();
virtual osl::SolarMutex* GetYieldMutex();
- virtual ULONG ReleaseYieldMutex();
- virtual void AcquireYieldMutex( ULONG nCount );
+ virtual sal_uIntPtr ReleaseYieldMutex();
+ virtual void AcquireYieldMutex( sal_uIntPtr nCount );
+ virtual bool CheckYieldMutex();
+
virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
- virtual bool AnyInput( USHORT nType );
- virtual SalMenu* CreateMenu( BOOL bMenuBar );
+ virtual bool AnyInput( sal_uInt16 nType );
+ virtual SalMenu* CreateMenu( sal_Bool bMenuBar, Menu* );
virtual void DestroyMenu( SalMenu* );
- virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData );
+ virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData );
virtual void DestroyMenuItem( SalMenuItem* );
virtual SalSession* CreateSalSession();
virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
@@ -93,10 +95,10 @@ public:
// - Prototypen -
// --------------
-SalFrame* ImplSalCreateFrame( WinSalInstance* pInst, HWND hWndParent, ULONG nSalFrameStyle );
+SalFrame* ImplSalCreateFrame( WinSalInstance* pInst, HWND hWndParent, sal_uIntPtr nSalFrameStyle );
SalObject* ImplSalCreateObject( WinSalInstance* pInst, WinSalFrame* pParent );
-HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, BOOL bAsChild );
-void ImplSalStartTimer( ULONG nMS, BOOL bMutex = FALSE );
+HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, sal_Bool bAsChild );
+void ImplSalStartTimer( sal_uIntPtr nMS, sal_Bool bMutex = sal_False );
void ImplSalPrinterAbortJobAsync( HDC hPrnDC );
#endif // _SV_SALINST_H
diff --git a/vcl/win/inc/salmenu.h b/vcl/win/inc/salmenu.h
index 5e821837101f..59160dc8a8bc 100644
--- a/vcl/win/inc/salmenu.h
+++ b/vcl/win/inc/salmenu.h
@@ -39,22 +39,22 @@ class WinSalMenu : public SalMenu
public:
WinSalMenu();
virtual ~WinSalMenu();
- virtual BOOL VisibleMenuBar(); // must return TRUE to actually DISPLAY native menu bars
+ virtual sal_Bool VisibleMenuBar(); // must return TRUE to actually DISPLAY native menu bars
// otherwise only menu messages are processed (eg, OLE on Windows)
virtual void InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos );
virtual void RemoveItem( unsigned nPos );
virtual void SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos );
virtual void SetFrame( const SalFrame* pFrame );
- virtual void CheckItem( unsigned nPos, BOOL bCheck );
- virtual void EnableItem( unsigned nPos, BOOL bEnable );
+ virtual void CheckItem( unsigned nPos, sal_Bool bCheck );
+ virtual void EnableItem( unsigned nPos, sal_Bool bEnable );
virtual void SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const XubString& rText );
virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage );
virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const XubString& rKeyName );
virtual void GetSystemMenuData( SystemMenuData* pData );
HMENU mhMenu; // the menu handle
- BOOL mbMenuBar; // true for menu bars
+ sal_Bool mbMenuBar; // true for menu bars
HWND mhWnd; // the window handle where the menubar is attached, may be NULL
WinSalMenu *mpParentMenu; // the parent menu
};
diff --git a/vcl/win/inc/salobj.h b/vcl/win/inc/salobj.h
index 31fb8769b959..d96b5f4a93df 100644
--- a/vcl/win/inc/salobj.h
+++ b/vcl/win/inc/salobj.h
@@ -46,7 +46,8 @@ public:
RGNDATA* mpClipRgnData; // ClipRegion-Data
RGNDATA* mpStdClipRgnData; // Cache Standard-ClipRegion-Data
RECT* mpNextClipRect; // Naechstes ClipRegion-Rect
- BOOL mbFirstClipRect; // Flag for first cliprect to insert
+ sal_Bool mbFirstClipRect; // Flag for first cliprect to insert
+ sal_Bool mbInterceptChildWindowKeyDown; // Intercept the KeyDown event sent to system child window
WinSalObject* mpNextObject; // pointer to next object
@@ -54,17 +55,18 @@ public:
virtual ~WinSalObject();
virtual void ResetClipRegion();
- virtual USHORT GetClipRegionType();
- virtual void BeginSetClipRegion( ULONG nRects );
+ virtual sal_uInt16 GetClipRegionType();
+ virtual void BeginSetClipRegion( sal_uIntPtr nRects );
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
virtual void EndSetClipRegion();
virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight );
- virtual void Show( BOOL bVisible );
- virtual void Enable( BOOL nEnable );
+ virtual void Show( sal_Bool bVisible );
+ virtual void Enable( sal_Bool nEnable );
virtual void GrabFocus();
virtual void SetBackground();
virtual void SetBackground( SalColor nSalColor );
virtual const SystemEnvData* GetSystemData() const;
+ virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
};
#endif // _SV_SALOBJ_H
diff --git a/vcl/win/inc/salprn.h b/vcl/win/inc/salprn.h
index 55b421a9cba9..123af2f79a90 100644
--- a/vcl/win/inc/salprn.h
+++ b/vcl/win/inc/salprn.h
@@ -37,7 +37,7 @@
// -----------------
// WNT3
-#define SAL_DRIVERDATA_SYSSIGN ((ULONG)0x574E5433)
+#define SAL_DRIVERDATA_SYSSIGN ((sal_uIntPtr)0x574E5433)
#define SAL_DRIVERDATA_VERSION_A 1
#define SAL_DRIVERDATA_VERSION_W 2
@@ -45,9 +45,9 @@
struct SalDriverData
{
- ULONG mnSysSignature;
- USHORT mnVersion;
- USHORT mnDriverOffset;
+ sal_uIntPtr mnSysSignature;
+ sal_uInt16 mnVersion;
+ sal_uInt16 mnDriverOffset;
BYTE maDriverData[1];
};
@@ -67,23 +67,23 @@ public:
XubString maDeviceName; // printer device name
XubString maPortName; // printer port name
HDC mhDC; // printer hdc
- BOOL mbGraphics; // is Graphics used
+ sal_Bool mbGraphics; // is Graphics used
public:
WinSalInfoPrinter();
virtual ~WinSalInfoPrinter();
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual BOOL Setup( SalFrame* pFrame, ImplJobSetup* pSetupData );
- virtual BOOL SetPrinterData( ImplJobSetup* pSetupData );
- virtual BOOL SetData( ULONG nFlags, ImplJobSetup* pSetupData );
+ virtual sal_Bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData );
+ virtual sal_Bool SetPrinterData( ImplJobSetup* pSetupData );
+ virtual sal_Bool SetData( sal_uIntPtr nFlags, ImplJobSetup* pSetupData );
virtual void GetPageInfo( const ImplJobSetup* pSetupData,
long& rOutWidth, long& rOutHeight,
long& rPageOffX, long& rPageOffY,
long& rPageWidth, long& rPageHeight );
- virtual ULONG GetCapabilities( const ImplJobSetup* pSetupData, USHORT nType );
- virtual ULONG GetPaperBinCount( const ImplJobSetup* pSetupData );
- virtual String GetPaperBinName( const ImplJobSetup* pSetupData, ULONG nPaperBin );
+ virtual sal_uIntPtr GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType );
+ virtual sal_uIntPtr GetPaperBinCount( const ImplJobSetup* pSetupData );
+ virtual String GetPaperBinName( const ImplJobSetup* pSetupData, sal_uIntPtr nPaperBin );
virtual void InitPaperFormats( const ImplJobSetup* pSetupData );
virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData );
};
@@ -99,10 +99,10 @@ public:
WinSalInfoPrinter* mpInfoPrinter; // pointer to the compatible InfoPrinter
WinSalPrinter* mpNextPrinter; // next printing printer
HDC mhDC; // printer hdc
- ULONG mnError; // Error Code
- ULONG mnCopies; // Kopien
- BOOL mbCollate; // Sortierte Kopien
- BOOL mbAbort; // Job Aborted
+ sal_uIntPtr mnError; // Error Code
+ sal_uIntPtr mnCopies; // Kopien
+ sal_Bool mbCollate; // Sortierte Kopien
+ sal_Bool mbAbort; // Job Aborted
bool mbValid;
@@ -111,18 +111,18 @@ public:
virtual ~WinSalPrinter();
using SalPrinter::StartJob;
- virtual BOOL StartJob( const XubString* pFileName,
+ virtual sal_Bool StartJob( const XubString* pFileName,
const XubString& rJobName,
const XubString& rAppName,
- ULONG nCopies,
+ sal_uIntPtr nCopies,
bool bCollate,
bool bDirect,
ImplJobSetup* pSetupData );
- virtual BOOL EndJob();
- virtual BOOL AbortJob();
- virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData );
- virtual BOOL EndPage();
- virtual ULONG GetErrorCode();
+ virtual sal_Bool EndJob();
+ virtual sal_Bool AbortJob();
+ virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData );
+ virtual sal_Bool EndPage();
+ virtual sal_uIntPtr GetErrorCode();
void markInvalid();
bool isValid() const { return mbValid; }
diff --git a/vcl/win/inc/salsys.h b/vcl/win/inc/salsys.h
index 159a6ce1a2d1..806c6b9df812 100644
--- a/vcl/win/inc/salsys.h
+++ b/vcl/win/inc/salsys.h
@@ -84,7 +84,7 @@ public:
const std::vector<DisplayMonitor>& getMonitors()
{ initMonitors(); return m_aMonitors;}
- BOOL handleMonitorCallback( sal_IntPtr /*HMONITOR*/,
+ sal_Bool handleMonitorCallback( sal_IntPtr /*HMONITOR*/,
sal_IntPtr /*HDC*/,
sal_IntPtr /*LPRECT*/ );
};
diff --git a/vcl/win/inc/saltimer.h b/vcl/win/inc/saltimer.h
index 82ec8d2f387b..41839ad2f0c2 100644
--- a/vcl/win/inc/saltimer.h
+++ b/vcl/win/inc/saltimer.h
@@ -38,7 +38,7 @@ public:
virtual ~WinSalTimer();
// overload all pure virtual methods
- void Start( ULONG nMS );
+ void Start( sal_uIntPtr nMS );
void Stop();
};
diff --git a/vcl/win/inc/salvd.h b/vcl/win/inc/salvd.h
index 6203e286ec0c..4e7416cf2b97 100644
--- a/vcl/win/inc/salvd.h
+++ b/vcl/win/inc/salvd.h
@@ -46,16 +46,16 @@ public:
HBITMAP mhDefBmp; // Default Bitmap
WinSalGraphics* mpGraphics; // current VirDev graphics
WinSalVirtualDevice* mpNext; // next VirDev
- USHORT mnBitCount; // BitCount (0 or 1)
- BOOL mbGraphics; // is Graphics used
- BOOL mbForeignDC; // uses a foreign DC instead of a bitmap
+ sal_uInt16 mnBitCount; // BitCount (0 or 1)
+ sal_Bool mbGraphics; // is Graphics used
+ sal_Bool mbForeignDC; // uses a foreign DC instead of a bitmap
WinSalVirtualDevice();
virtual ~WinSalVirtualDevice();
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual BOOL SetSize( long nNewDX, long nNewDY );
+ virtual sal_Bool SetSize( long nNewDX, long nNewDY );
virtual void GetSize( long& rWidth, long& rHeight );
};
diff --git a/vcl/win/inc/wincomp.hxx b/vcl/win/inc/wincomp.hxx
index f1d99ddd6e30..ab399453884c 100644
--- a/vcl/win/inc/wincomp.hxx
+++ b/vcl/win/inc/wincomp.hxx
@@ -128,17 +128,17 @@ inline DWORD GetWindowExStyle( HWND hWnd )
return GetWindowLong( hWnd, GWL_EXSTYLE );
}
-inline WIN_BOOL IsMinimized( HWND hWnd )
+inline BOOL IsMinimized( HWND hWnd )
{
return IsIconic( hWnd );
}
-inline WIN_BOOL IsMaximized( HWND hWnd )
+inline BOOL IsMaximized( HWND hWnd )
{
return IsZoomed( hWnd );
}
-inline void SetWindowFont( HWND hWnd, HFONT hFont, WIN_BOOL bRedraw )
+inline void SetWindowFont( HWND hWnd, HFONT hFont, BOOL bRedraw )
{
SendMessage( hWnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM((UINT)bRedraw,0) );
}
diff --git a/vcl/win/source/app/saldata.cxx b/vcl/win/source/app/saldata.cxx
index 260fdd561f4f..374c7b4922b3 100644
--- a/vcl/win/source/app/saldata.cxx
+++ b/vcl/win/source/app/saldata.cxx
@@ -55,7 +55,7 @@ rtl_TextEncoding ImplSalGetSystemEncoding()
// -----------------------------------------------------------------------
-ByteString ImplSalGetWinAnsiString( const UniString& rStr, BOOL bFileName )
+ByteString ImplSalGetWinAnsiString( const UniString& rStr, sal_Bool bFileName )
{
rtl_TextEncoding eEncoding = ImplSalGetSystemEncoding();
if ( bFileName )
@@ -118,28 +118,28 @@ int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 )
// =======================================================================
-WIN_BOOL ImplPostMessage( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
+BOOL ImplPostMessage( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
{
return PostMessageW( hWnd, nMsg, wParam, lParam );
}
// -----------------------------------------------------------------------
-WIN_BOOL ImplSendMessage( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
+BOOL ImplSendMessage( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
{
return SendMessageW( hWnd, nMsg, wParam, lParam );
}
// -----------------------------------------------------------------------
-WIN_BOOL ImplGetMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax )
+BOOL ImplGetMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax )
{
return GetMessageW( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax );
}
// -----------------------------------------------------------------------
-WIN_BOOL ImplPeekMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg )
+BOOL ImplPeekMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg )
{
return PeekMessageW( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg );
}
diff --git a/vcl/win/source/app/salinfo.cxx b/vcl/win/source/app/salinfo.cxx
index e25d1b8a52e4..020e555d8498 100644
--- a/vcl/win/source/app/salinfo.cxx
+++ b/vcl/win/source/app/salinfo.cxx
@@ -71,7 +71,7 @@ WinSalSystem::~WinSalSystem()
// -----------------------------------------------------------------------
-static WIN_BOOL CALLBACK ImplEnumMonitorProc( HMONITOR hMonitor,
+static BOOL CALLBACK ImplEnumMonitorProc( HMONITOR hMonitor,
HDC hDC,
LPRECT lpRect,
LPARAM dwData )
@@ -82,7 +82,7 @@ static WIN_BOOL CALLBACK ImplEnumMonitorProc( HMONITOR hMonitor,
reinterpret_cast<sal_IntPtr>(lpRect) );
}
-BOOL WinSalSystem::handleMonitorCallback( sal_IntPtr hMonitor, sal_IntPtr, sal_IntPtr )
+sal_Bool WinSalSystem::handleMonitorCallback( sal_IntPtr hMonitor, sal_IntPtr, sal_IntPtr )
{
MONITORINFOEXW aInfo;
aInfo.cbSize = sizeof( aInfo );
@@ -107,7 +107,7 @@ BOOL WinSalSystem::handleMonitorCallback( sal_IntPtr hMonitor, sal_IntPtr, sal_I
m_nPrimary = it->second;
}
}
- return TRUE;
+ return sal_True;
}
void WinSalSystem::clearMonitors()
diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx
index 5e3999e83d7b..e0935a6d956a 100644
--- a/vcl/win/source/app/salinst.cxx
+++ b/vcl/win/source/app/salinst.cxx
@@ -48,7 +48,7 @@
#include <salobj.h>
#include <vcl/salsys.hxx>
#include <saltimer.h>
-#include <vcl/salatype.hxx>
+#include <vcl/apptypes.hxx>
#include <salbmp.h>
#include <vcl/salimestatus.hxx>
#include <vcl/timer.hxx>
@@ -68,12 +68,10 @@
#pragma warning( disable: 4917 )
#endif
-#define ULONG WIN_ULONG
#include <GdiPlus.h>
#include <GdiPlusEnums.h>
#include <GdiPlusColor.h>
#include <Shlobj.h>
-#undef ULONG
#if defined _MSC_VER
#pragma warning(pop)
@@ -111,7 +109,7 @@ class SalYieldMutex : public vcl::SolarMutexObject
{
public: // for ImplSalYield()
WinSalInstance* mpInstData;
- ULONG mnCount;
+ sal_uLong mnCount;
DWORD mnThreadId;
public:
@@ -121,7 +119,7 @@ public:
virtual void SAL_CALL release();
virtual sal_Bool SAL_CALL tryToAcquire();
- ULONG GetAcquireCount( ULONG nThreadId );
+ sal_uLong GetAcquireCount( sal_uLong nThreadId );
};
// -----------------------------------------------------------------------
@@ -200,7 +198,7 @@ sal_Bool SAL_CALL SalYieldMutex::tryToAcquire()
// -----------------------------------------------------------------------
-ULONG SalYieldMutex::GetAcquireCount( ULONG nThreadId )
+sal_uLong SalYieldMutex::GetAcquireCount( sal_uLong nThreadId )
{
if ( nThreadId == mnThreadId )
return mnCount;
@@ -226,7 +224,7 @@ void ImplSalYieldMutexAcquireWithWait()
{
// Wenn wir den Mutex nicht bekommen, muessen wir solange
// warten, bis wir Ihn bekommen
- BOOL bAcquire = FALSE;
+ sal_Bool bAcquire = FALSE;
do
{
if ( pInst->mpSalYieldMutex->tryToAcquire() )
@@ -259,7 +257,7 @@ void ImplSalYieldMutexAcquireWithWait()
// -----------------------------------------------------------------------
-BOOL ImplSalYieldMutexTryToAcquire()
+sal_Bool ImplSalYieldMutexTryToAcquire()
{
WinSalInstance* pInst = GetSalData()->mpFirstInstance;
if ( pInst )
@@ -291,15 +289,15 @@ void ImplSalYieldMutexRelease()
// -----------------------------------------------------------------------
-ULONG ImplSalReleaseYieldMutex()
+sal_uLong ImplSalReleaseYieldMutex()
{
WinSalInstance* pInst = GetSalData()->mpFirstInstance;
if ( !pInst )
return 0;
SalYieldMutex* pYieldMutex = pInst->mpSalYieldMutex;
- ULONG nCount = pYieldMutex->GetAcquireCount( GetCurrentThreadId() );
- ULONG n = nCount;
+ sal_uLong nCount = pYieldMutex->GetAcquireCount( GetCurrentThreadId() );
+ sal_uLong n = nCount;
while ( n )
{
pYieldMutex->release();
@@ -311,7 +309,7 @@ ULONG ImplSalReleaseYieldMutex()
// -----------------------------------------------------------------------
-void ImplSalAcquireYieldMutex( ULONG nCount )
+void ImplSalAcquireYieldMutex( sal_uLong nCount )
{
WinSalInstance* pInst = GetSalData()->mpFirstInstance;
if ( !pInst )
@@ -327,10 +325,9 @@ void ImplSalAcquireYieldMutex( ULONG nCount )
// -----------------------------------------------------------------------
-#ifdef DBG_UTIL
-
-void ImplDbgTestSolarMutex()
+bool WinSalInstance::CheckYieldMutex()
{
+ bool bRet = true;
SalData* pSalData = GetSalData();
DWORD nCurThreadId = GetCurrentThreadId();
if ( pSalData->mnAppThreadId != nCurThreadId )
@@ -340,7 +337,7 @@ void ImplDbgTestSolarMutex()
SalYieldMutex* pYieldMutex = pSalData->mpFirstInstance->mpSalYieldMutex;
if ( pYieldMutex->mnThreadId != nCurThreadId )
{
- OSL_FAIL( "SolarMutex not locked, and not thread save code in VCL is called from outside of the main thread" );
+ bRet = false;
}
}
}
@@ -351,14 +348,13 @@ void ImplDbgTestSolarMutex()
SalYieldMutex* pYieldMutex = pSalData->mpFirstInstance->mpSalYieldMutex;
if ( pYieldMutex->mnThreadId != nCurThreadId )
{
- OSL_FAIL( "SolarMutex not locked in the main thread" );
+ bRet = false;
}
}
}
+ return bRet;
}
-#endif
-
// =======================================================================
void SalData::initKeyCodeMap()
@@ -443,9 +439,12 @@ SalData::SalData()
mpFirstIcon = 0; // icon cache, points to first icon, NULL if none
mpTempFontItem = 0;
mbThemeChanged = FALSE; // true if visual theme was changed: throw away theme handles
+ mbThemeMenuSupport = FALSE;
// init with NULL
gdiplusToken = 0;
+ maDwmLib = 0;
+ mpDwmIsCompositionEnabled = 0;
initKeyCodeMap();
@@ -569,8 +568,7 @@ SalInstance* CreateSalInstance()
return NULL;
}
- HWND hComWnd;
- hComWnd = CreateWindowExW( WS_EX_TOOLWINDOW, SAL_COM_CLASSNAMEW,
+ HWND hComWnd = CreateWindowExW( WS_EX_TOOLWINDOW, SAL_COM_CLASSNAMEW,
L"", WS_POPUP, 0, 0, 0, 0, 0, 0,
pSalData->mhInst, NULL );
if ( !hComWnd )
@@ -638,14 +636,14 @@ osl::SolarMutex* WinSalInstance::GetYieldMutex()
// -----------------------------------------------------------------------
-ULONG WinSalInstance::ReleaseYieldMutex()
+sal_uLong WinSalInstance::ReleaseYieldMutex()
{
return ImplSalReleaseYieldMutex();
}
// -----------------------------------------------------------------------
-void WinSalInstance::AcquireYieldMutex( ULONG nCount )
+void WinSalInstance::AcquireYieldMutex( sal_uLong nCount )
{
ImplSalAcquireYieldMutex( nCount );
}
@@ -667,7 +665,7 @@ static void ImplSalDispatchMessage( MSG* pMsg )
// -----------------------------------------------------------------------
-void ImplSalYield( BOOL bWait, BOOL bHandleAllCurrentEvents )
+void ImplSalYield( sal_Bool bWait, sal_Bool bHandleAllCurrentEvents )
{
MSG aMsg;
bool bWasMsg = false, bOneEvent = false;
@@ -677,8 +675,12 @@ void ImplSalYield( BOOL bWait, BOOL bHandleAllCurrentEvents )
{
if ( ImplPeekMessage( &aMsg, 0, 0, 0, PM_REMOVE ) )
{
- TranslateMessage( &aMsg );
- ImplSalDispatchMessage( &aMsg );
+ if ( !ImplInterceptChildWindowKeyDown( aMsg ) )
+ {
+ TranslateMessage( &aMsg );
+ ImplSalDispatchMessage( &aMsg );
+ }
+
bOneEvent = bWasMsg = true;
}
else
@@ -689,8 +691,11 @@ void ImplSalYield( BOOL bWait, BOOL bHandleAllCurrentEvents )
{
if ( ImplGetMessage( &aMsg, 0, 0, 0 ) )
{
- TranslateMessage( &aMsg );
- ImplSalDispatchMessage( &aMsg );
+ if ( !ImplInterceptChildWindowKeyDown( aMsg ) )
+ {
+ TranslateMessage( &aMsg );
+ ImplSalDispatchMessage( &aMsg );
+ }
}
}
}
@@ -702,8 +707,8 @@ void WinSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
SalYieldMutex* pYieldMutex = mpSalYieldMutex;
SalData* pSalData = GetSalData();
DWORD nCurThreadId = GetCurrentThreadId();
- ULONG nCount = pYieldMutex->GetAcquireCount( nCurThreadId );
- ULONG n = nCount;
+ sal_uLong nCount = pYieldMutex->GetAcquireCount( nCurThreadId );
+ sal_uLong n = nCount;
while ( n )
{
pYieldMutex->release();
@@ -760,7 +765,7 @@ LRESULT CALLBACK SalComWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lPar
rDef = FALSE;
break;
case SAL_MSG_THREADYIELD:
- ImplSalYield( (BOOL)wParam, (BOOL)lParam );
+ ImplSalYield( (sal_Bool)wParam, (sal_Bool)lParam );
rDef = FALSE;
break;
// If we get this message, because another GetMessage() call
@@ -775,11 +780,11 @@ LRESULT CALLBACK SalComWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lPar
rDef = FALSE;
break;
case SAL_MSG_STARTTIMER:
- ImplSalStartTimer( (ULONG) lParam, FALSE );
+ ImplSalStartTimer( (sal_uLong) lParam, FALSE );
rDef = FALSE;
break;
case SAL_MSG_CREATEFRAME:
- nRet = (LRESULT)ImplSalCreateFrame( GetSalData()->mpFirstInstance, (HWND)lParam, (ULONG)wParam );
+ nRet = (LRESULT)ImplSalCreateFrame( GetSalData()->mpFirstInstance, (HWND)lParam, (sal_uLong)wParam );
rDef = FALSE;
break;
case SAL_MSG_RECREATEHWND:
@@ -894,7 +899,7 @@ LRESULT CALLBACK SalComWndProcW( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lPa
// -----------------------------------------------------------------------
-bool WinSalInstance::AnyInput( USHORT nType )
+bool WinSalInstance::AnyInput( sal_uInt16 nType )
{
MSG aMsg;
@@ -976,7 +981,7 @@ bool WinSalInstance::AnyInput( USHORT nType )
// -----------------------------------------------------------------------
-void SalTimer::Start( ULONG nMS )
+void SalTimer::Start( sal_uLong nMS )
{
// Um auf Main-Thread umzuschalten
SalData* pSalData = GetSalData();
@@ -993,7 +998,7 @@ void SalTimer::Start( ULONG nMS )
// -----------------------------------------------------------------------
-SalFrame* WinSalInstance::CreateChildFrame( SystemParentData* pSystemParentData, ULONG nSalFrameStyle )
+SalFrame* WinSalInstance::CreateChildFrame( SystemParentData* pSystemParentData, sal_uLong nSalFrameStyle )
{
// Um auf Main-Thread umzuschalten
return (SalFrame*)ImplSendMessage( mhComWnd, SAL_MSG_CREATEFRAME, nSalFrameStyle, (LPARAM)pSystemParentData->hWnd );
@@ -1001,7 +1006,7 @@ SalFrame* WinSalInstance::CreateChildFrame( SystemParentData* pSystemParentData,
// -----------------------------------------------------------------------
-SalFrame* WinSalInstance::CreateFrame( SalFrame* pParent, ULONG nSalFrameStyle )
+SalFrame* WinSalInstance::CreateFrame( SalFrame* pParent, sal_uLong nSalFrameStyle )
{
// Um auf Main-Thread umzuschalten
HWND hWndParent;
@@ -1023,7 +1028,7 @@ void WinSalInstance::DestroyFrame( SalFrame* pFrame )
SalObject* WinSalInstance::CreateObject( SalFrame* pParent,
SystemWindowData* /*pWindowData*/, // SystemWindowData meaningless on Windows
- BOOL /*bShow*/ )
+ sal_Bool /*bShow*/ )
{
// Um auf Main-Thread umzuschalten
return (SalObject*)ImplSendMessage( mhComWnd, SAL_MSG_CREATEOBJECT, 0, (LPARAM)static_cast<WinSalFrame*>(pParent) );
diff --git a/vcl/win/source/app/salshl.cxx b/vcl/win/source/app/salshl.cxx
index 136474e67f73..5dcc4b67da4e 100644
--- a/vcl/win/source/app/salshl.cxx
+++ b/vcl/win/source/app/salshl.cxx
@@ -44,15 +44,15 @@ extern "C"
{
#ifdef __MINGW32__
-BOOL WINAPI DllMain( HINSTANCE hInst, DWORD nReason, LPVOID pReserved )
+sal_Bool WINAPI DllMain( HINSTANCE hInst, DWORD nReason, LPVOID pReserved )
#else
#ifdef ICC
int _CRT_init(void);
#else
-WIN_BOOL WINAPI _CRT_INIT( HINSTANCE hInst, DWORD nReason, LPVOID pReserved );
+BOOL WINAPI _CRT_INIT( HINSTANCE hInst, DWORD nReason, LPVOID pReserved );
#endif
-WIN_BOOL WINAPI LibMain( HINSTANCE hInst, DWORD nReason, LPVOID pReserved )
+BOOL WINAPI LibMain( HINSTANCE hInst, DWORD nReason, LPVOID pReserved )
#endif
{
// Unsere DLL-Initialisierung
@@ -103,7 +103,7 @@ HBITMAP ImplLoadSalBitmap( int nId )
// -----------------------------------------------------------------------
-BOOL ImplLoadSalIcon( int nId, HICON& rIcon, HICON& rSmallIcon )
+sal_Bool ImplLoadSalIcon( int nId, HICON& rIcon, HICON& rSmallIcon )
{
DBG_ASSERT( aSalShlData.mhInst, "no DLL instance handle" );
diff --git a/vcl/win/source/app/saltimer.cxx b/vcl/win/source/app/saltimer.cxx
index 2f57bf810bd0..29caaef3a5c3 100644
--- a/vcl/win/source/app/saltimer.cxx
+++ b/vcl/win/source/app/saltimer.cxx
@@ -43,7 +43,7 @@
// =======================================================================
-void ImplSalStartTimer( ULONG nMS, BOOL bMutex )
+void ImplSalStartTimer( sal_uLong nMS, sal_Bool bMutex )
{
SalData* pSalData = GetSalData();
@@ -52,7 +52,7 @@ void ImplSalStartTimer( ULONG nMS, BOOL bMutex )
if ( !bMutex )
pSalData->mnTimerOrgMS = nMS;
- // Periode darf nicht zu gross sein, da Windows mit USHORT arbeitet
+ // Periode darf nicht zu gross sein, da Windows mit sal_uInt16 arbeitet
if ( nMS > MAX_SYSPERIOD )
nMS = MAX_SYSPERIOD;
@@ -71,7 +71,7 @@ WinSalTimer::~WinSalTimer()
{
}
-void WinSalTimer::Start( ULONG nMS )
+void WinSalTimer::Start( sal_uLong nMS )
{
// switch to main thread
SalData* pSalData = GetSalData();
diff --git a/vcl/win/source/gdi/salbmp.cxx b/vcl/win/source/gdi/salbmp.cxx
index b201bf7c19b9..4c61358d727a 100644
--- a/vcl/win/source/gdi/salbmp.cxx
+++ b/vcl/win/source/gdi/salbmp.cxx
@@ -120,7 +120,7 @@ bool WinSalBitmap::Create( HANDLE hBitmap, bool bDIB, bool bCopyHandle )
// ------------------------------------------------------------------
-bool WinSalBitmap::Create( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal )
+bool WinSalBitmap::Create( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal )
{
bool bRet = FALSE;
@@ -213,7 +213,7 @@ bool WinSalBitmap::Create( const SalBitmap& rSSalBmp, SalGraphics* pSGraphics )
// ------------------------------------------------------------------
-bool WinSalBitmap::Create( const SalBitmap& rSSalBmp, USHORT nNewBitCount )
+bool WinSalBitmap::Create( const SalBitmap& rSSalBmp, sal_uInt16 nNewBitCount )
{
bool bRet = FALSE;
@@ -285,9 +285,9 @@ void WinSalBitmap::Destroy()
// ------------------------------------------------------------------
-USHORT WinSalBitmap::ImplGetDIBColorCount( HGLOBAL hDIB )
+sal_uInt16 WinSalBitmap::ImplGetDIBColorCount( HGLOBAL hDIB )
{
- USHORT nColors = 0;
+ sal_uInt16 nColors = 0;
if( hDIB )
{
@@ -299,7 +299,7 @@ USHORT WinSalBitmap::ImplGetDIBColorCount( HGLOBAL hDIB )
if( pBIH->biBitCount <= 8 )
{
if ( pBIH->biClrUsed )
- nColors = (USHORT) pBIH->biClrUsed;
+ nColors = (sal_uInt16) pBIH->biClrUsed;
else
nColors = 1 << pBIH->biBitCount;
}
@@ -315,7 +315,7 @@ USHORT WinSalBitmap::ImplGetDIBColorCount( HGLOBAL hDIB )
// ------------------------------------------------------------------
-HGLOBAL WinSalBitmap::ImplCreateDIB( const Size& rSize, USHORT nBits, const BitmapPalette& rPal )
+HGLOBAL WinSalBitmap::ImplCreateDIB( const Size& rSize, sal_uInt16 nBits, const BitmapPalette& rPal )
{
DBG_ASSERT( nBits == 1 || nBits == 4 || nBits == 8 || nBits == 16 || nBits == 24, "Unsupported BitCount!" );
@@ -323,8 +323,8 @@ HGLOBAL WinSalBitmap::ImplCreateDIB( const Size& rSize, USHORT nBits, const Bitm
if ( rSize.Width() && rSize.Height() )
{
- const ULONG nImageSize = AlignedWidth4Bytes( nBits * rSize.Width() ) * rSize.Height();
- const USHORT nColors = ( nBits <= 8 ) ? ( 1 << nBits ) : 0;
+ const sal_uLong nImageSize = AlignedWidth4Bytes( nBits * rSize.Width() ) * rSize.Height();
+ const sal_uInt16 nColors = ( nBits <= 8 ) ? ( 1 << nBits ) : 0;
hDIB = GlobalAlloc( GHND, sizeof( BITMAPINFOHEADER ) + nColors * sizeof( RGBQUAD ) + nImageSize );
@@ -347,7 +347,7 @@ HGLOBAL WinSalBitmap::ImplCreateDIB( const Size& rSize, USHORT nBits, const Bitm
if ( nColors )
{
- const USHORT nMinCount = Min( nColors, rPal.GetEntryCount() );
+ const sal_uInt16 nMinCount = Min( nColors, rPal.GetEntryCount() );
if( nMinCount )
memcpy( pBI->bmiColors, rPal.ImplGetColorBuffer(), nMinCount * sizeof( RGBQUAD ) );
@@ -368,7 +368,7 @@ HANDLE WinSalBitmap::ImplCopyDIBOrDDB( HANDLE hHdl, bool bDIB )
if ( bDIB && hHdl )
{
- const ULONG nSize = GlobalSize( hHdl );
+ const sal_uLong nSize = GlobalSize( hHdl );
if ( (hCopy = GlobalAlloc( GHND, nSize )) != 0 )
{
@@ -426,8 +426,8 @@ BitmapBuffer* WinSalBitmap::AcquireBuffer( bool /*bReadOnly*/ )
{
PBITMAPINFO pNewBI = (PBITMAPINFO) GlobalLock( hNewDIB );
PBITMAPINFOHEADER pNewBIH = (PBITMAPINFOHEADER) pNewBI;
- const USHORT nColorCount = ImplGetDIBColorCount( hNewDIB );
- const ULONG nOffset = *(DWORD*) pBI + nColorCount * sizeof( RGBQUAD );
+ const sal_uInt16 nColorCount = ImplGetDIBColorCount( hNewDIB );
+ const sal_uLong nOffset = *(DWORD*) pBI + nColorCount * sizeof( RGBQUAD );
BYTE* pOldBits = (PBYTE) pBI + nOffset;
BYTE* pNewBits = (PBYTE) pNewBI + nOffset;
@@ -460,11 +460,11 @@ BitmapBuffer* WinSalBitmap::AcquireBuffer( bool /*bReadOnly*/ )
pBuffer->mnWidth = maSize.Width();
pBuffer->mnHeight = maSize.Height();
pBuffer->mnScanlineSize = AlignedWidth4Bytes( maSize.Width() * pBIH->biBitCount );
- pBuffer->mnBitCount = (USHORT) pBIH->biBitCount;
+ pBuffer->mnBitCount = (sal_uInt16) pBIH->biBitCount;
if( pBuffer->mnBitCount <= 8 )
{
- const USHORT nPalCount = ImplGetDIBColorCount( mhDIB );
+ const sal_uInt16 nPalCount = ImplGetDIBColorCount( mhDIB );
pBuffer->maPalette.SetEntryCount( nPalCount );
memcpy( pBuffer->maPalette.ImplGetColorBuffer(), pBI->bmiColors, nPalCount * sizeof( RGBQUAD ) );
@@ -472,7 +472,7 @@ BitmapBuffer* WinSalBitmap::AcquireBuffer( bool /*bReadOnly*/ )
}
else if( ( pBIH->biBitCount == 16 ) || ( pBIH->biBitCount == 32 ) )
{
- ULONG nOffset = 0UL;
+ sal_uLong nOffset = 0UL;
if( pBIH->biCompression == BI_BITFIELDS )
{
@@ -516,9 +516,9 @@ void WinSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly )
if( !bReadOnly && !!pBuffer->maPalette )
{
PBITMAPINFO pBI = (PBITMAPINFO) GlobalLock( mhDIB );
- const USHORT nCount = pBuffer->maPalette.GetEntryCount();
-
- memcpy( pBI->bmiColors, pBuffer->maPalette.ImplGetColorBuffer(), nCount * sizeof( RGBQUAD ) );
+ const sal_uInt16 nCount = pBuffer->maPalette.GetEntryCount();
+ const sal_uInt16 nDIBColorCount = ImplGetDIBColorCount( mhDIB );
+ memcpy( pBI->bmiColors, pBuffer->maPalette.ImplGetColorBuffer(), Min( nDIBColorCount, nCount ) * sizeof( RGBQUAD ) );
GlobalUnlock( mhDIB );
}
@@ -537,12 +537,12 @@ void WinSalBitmap::ImplDecodeRLEBuffer( const BYTE* pSrcBuf, BYTE* pDstBuf,
HPBYTE pRLE = (HPBYTE) pSrcBuf;
HPBYTE pDIB = (HPBYTE) pDstBuf;
HPBYTE pRow = (HPBYTE) pDstBuf;
- ULONG nWidthAl = AlignedWidth4Bytes( rSizePixel.Width() * ( bRLE4 ? 4UL : 8UL ) );
+ sal_uLong nWidthAl = AlignedWidth4Bytes( rSizePixel.Width() * ( bRLE4 ? 4UL : 8UL ) );
HPBYTE pLast = pDIB + rSizePixel.Height() * nWidthAl - 1;
- ULONG nCountByte;
- ULONG nRunByte;
- ULONG nX = 0;
- ULONG i;
+ sal_uLong nCountByte;
+ sal_uLong nRunByte;
+ sal_uLong nX = 0;
+ sal_uLong i;
BYTE cTmp;
bool bEndDecoding = FALSE;
diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx
index cac65c8c229b..1e5a4c49eba2 100644
--- a/vcl/win/source/gdi/salgdi.cxx
+++ b/vcl/win/source/gdi/salgdi.cxx
@@ -38,7 +38,10 @@
#include <tools/debug.hxx>
#include <salframe.h>
#include <tools/poly.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
#include <rtl/strbuf.hxx>
+#include <vcl/region.h>
using ::rtl::OStringBuffer;
// =======================================================================
@@ -187,7 +190,7 @@ void ImplInitSalGDI()
HBITMAP hBmpOld = (HBITMAP) ::SelectObject( hMemDC, hMemBmp );
HBRUSH hMemBrush = ::CreateSolidBrush( PALETTERGB( 175, 171, 169 ) );
HBRUSH hBrushOld = (HBRUSH) ::SelectObject( hMemDC, hMemBrush );
- BOOL bDither16 = TRUE;
+ sal_Bool bDither16 = TRUE;
::PatBlt( hMemDC, 0, 0, 8, 8, PATCOPY );
const COLORREF aCol( ::GetPixel( hMemDC, 0, 0 ) );
@@ -238,13 +241,13 @@ void ImplInitSalGDI()
BYTE nR, nG, nB;
PALETTEENTRY* pPalEntry;
LOGPALETTE* pLogPal;
- const USHORT nDitherPalCount = DITHER_PAL_COUNT;
- ULONG nTotalCount = DITHER_MAX_SYSCOLOR + nDitherPalCount + DITHER_EXTRA_COLORS;
+ const sal_uInt16 nDitherPalCount = DITHER_PAL_COUNT;
+ sal_uLong nTotalCount = DITHER_MAX_SYSCOLOR + nDitherPalCount + DITHER_EXTRA_COLORS;
// create logical palette
pLogPal = (LOGPALETTE*) new char[ sizeof( LOGPALETTE ) + ( nTotalCount * sizeof( PALETTEENTRY ) ) ];
pLogPal->palVersion = 0x0300;
- pLogPal->palNumEntries = (USHORT) nTotalCount;
+ pLogPal->palNumEntries = (sal_uInt16) nTotalCount;
pPalEntry = pLogPal->palPalEntry;
// Standard colors
@@ -402,7 +405,7 @@ static int ImplIsPaletteEntry( BYTE nRed, BYTE nGreen, BYTE nBlue )
PALETTEENTRY* pPalEntry = aImplSalSysPalEntryAry;
// standard palette color?
- for ( USHORT i = 0; i < DITHER_MAX_SYSCOLOR; i++, pPalEntry++ )
+ for ( sal_uInt16 i = 0; i < DITHER_MAX_SYSCOLOR; i++, pPalEntry++ )
{
if( pPalEntry->peRed == nRed && pPalEntry->peGreen == nGreen && pPalEntry->peBlue == nBlue )
return TRUE;
@@ -546,7 +549,7 @@ void ImplSalDeInitGraphics( WinSalGraphics* pData )
// =======================================================================
-HDC ImplGetCachedDC( ULONG nID, HBITMAP hBmp )
+HDC ImplGetCachedDC( sal_uLong nID, HBITMAP hBmp )
{
SalData* pSalData = GetSalData();
HDCCache* pC = &pSalData->mpHDCCache[ nID ];
@@ -580,7 +583,7 @@ HDC ImplGetCachedDC( ULONG nID, HBITMAP hBmp )
// =======================================================================
-void ImplReleaseCachedDC( ULONG nID )
+void ImplReleaseCachedDC( sal_uLong nID )
{
SalData* pSalData = GetSalData();
HDCCache* pC = &pSalData->mpHDCCache[ nID ];
@@ -593,7 +596,7 @@ void ImplReleaseCachedDC( ULONG nID )
void ImplClearHDCCache( SalData* pData )
{
- for( ULONG i = 0; i < CACHESIZE_HDC; i++ )
+ for( sal_uLong i = 0; i < CACHESIZE_HDC; i++ )
{
HDCCache* pC = &pData->mpHDCCache[ i ];
@@ -616,21 +619,21 @@ void ImplClearHDCCache( SalData* pData )
// might also contain bezier control points for the PolyDraw() GDI method
// Make sure pWinPointAry and pWinFlagAry are big enough
void ImplPreparePolyDraw( bool bCloseFigures,
- ULONG nPoly,
+ sal_uLong nPoly,
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
const BYTE* const* pFlgAry,
POINT* pWinPointAry,
BYTE* pWinFlagAry )
{
- ULONG nCurrPoly;
+ sal_uLong nCurrPoly;
for( nCurrPoly=0; nCurrPoly<nPoly; ++nCurrPoly )
{
const POINT* pCurrPoint = reinterpret_cast<const POINT*>( *pPtAry++ );
const BYTE* pCurrFlag = *pFlgAry++;
const sal_uInt32 nCurrPoints = *pPoints++;
const bool bHaveFlagArray( pCurrFlag );
- ULONG nCurrPoint;
+ sal_uLong nCurrPoint;
if( nCurrPoints )
{
@@ -686,11 +689,11 @@ void ImplPreparePolyDraw( bool bCloseFigures,
// =======================================================================
// #100127# draw an array of points which might also contain bezier control points
-void ImplRenderPath( HDC hdc, ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
+void ImplRenderPath( HDC hdc, sal_uLong nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
{
if( nPoints )
{
- USHORT i;
+ sal_uInt16 i;
// TODO: profile whether the following options are faster:
// a) look ahead and draw consecutive bezier or line segments by PolyBezierTo/PolyLineTo resp.
// b) convert our flag array to window's and use PolyDraw
@@ -801,9 +804,9 @@ void WinSalGraphics::GetResolution( long& rDPIX, long& rDPIY )
// -----------------------------------------------------------------------
-USHORT WinSalGraphics::GetBitCount() const
+sal_uInt16 WinSalGraphics::GetBitCount() const
{
- return (USHORT)GetDeviceCaps( mhDC, BITSPIXEL );
+ return (sal_uInt16)GetDeviceCaps( mhDC, BITSPIXEL );
}
// -----------------------------------------------------------------------
@@ -845,7 +848,7 @@ void WinSalGraphics::ResetClipRegion()
// -----------------------------------------------------------------------
-void WinSalGraphics::BeginSetClipRegion( ULONG nRectCount )
+bool WinSalGraphics::setClipRegion( const Region& i_rClip )
{
if ( mhRegion )
{
@@ -853,123 +856,143 @@ void WinSalGraphics::BeginSetClipRegion( ULONG nRectCount )
mhRegion = 0;
}
- ULONG nRectBufSize = sizeof(RECT)*nRectCount;
- if ( nRectCount < SAL_CLIPRECT_COUNT )
+ if( i_rClip.HasPolyPolygon() )
{
- if ( !mpStdClipRgnData )
- mpStdClipRgnData = (RGNDATA*)new BYTE[sizeof(RGNDATA)-1+(SAL_CLIPRECT_COUNT*sizeof(RECT))];
- mpClipRgnData = mpStdClipRgnData;
+ // TODO: ConvertToB2DPolyPolygon actually is kind of const, just it does not advertise it in the header
+ basegfx::B2DPolyPolygon aPolyPolygon( const_cast<Region&>(i_rClip).ConvertToB2DPolyPolygon() );
+ const sal_uInt32 nCount(aPolyPolygon.count());
+
+ if( nCount )
+ {
+ std::vector< POINT > aPolyPoints;
+ aPolyPoints.reserve( 1024 );
+ std::vector< INT > aPolyCounts( nCount, 0 );
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ basegfx::B2DPolygon aPoly( aPolyPolygon.getB2DPolygon(a) );
+ aPoly = basegfx::tools::adaptiveSubdivideByDistance( aPoly, 1 );
+ const sal_uInt32 nPoints = aPoly.count();
+ aPolyCounts[a] = nPoints;
+ for( sal_uInt32 b = 0; b < nPoints; b++ )
+ {
+ basegfx::B2DPoint aPt( aPoly.getB2DPoint( b ) );
+ POINT aPOINT;
+ aPOINT.x = (LONG)aPt.getX();
+ aPOINT.y = (LONG)aPt.getY();
+ aPolyPoints.push_back( aPOINT );
+ }
+ }
+ mhRegion = CreatePolyPolygonRgn( &aPolyPoints[0], &aPolyCounts[0], nCount, ALTERNATE );
+ }
}
else
- mpClipRgnData = (RGNDATA*)new BYTE[sizeof(RGNDATA)-1+nRectBufSize];
- mpClipRgnData->rdh.dwSize = sizeof( RGNDATAHEADER );
- mpClipRgnData->rdh.iType = RDH_RECTANGLES;
- mpClipRgnData->rdh.nCount = nRectCount;
- mpClipRgnData->rdh.nRgnSize = nRectBufSize;
- SetRectEmpty( &(mpClipRgnData->rdh.rcBound) );
- mpNextClipRect = (RECT*)(&(mpClipRgnData->Buffer));
- mbFirstClipRect = TRUE;
-}
-
-
-// -----------------------------------------------------------------------
-
-BOOL WinSalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeight )
-{
- if ( nWidth && nHeight )
{
- RECT* pRect = mpNextClipRect;
- RECT* pBoundRect = &(mpClipRgnData->rdh.rcBound);
- long nRight = nX + nWidth;
- long nBottom = nY + nHeight;
+ sal_uLong nRectCount = i_rClip.GetRectCount();
- if ( mbFirstClipRect )
+ sal_uLong nRectBufSize = sizeof(RECT)*nRectCount;
+ if ( nRectCount < SAL_CLIPRECT_COUNT )
{
- pBoundRect->left = nX;
- pBoundRect->top = nY;
- pBoundRect->right = nRight;
- pBoundRect->bottom = nBottom;
- mbFirstClipRect = FALSE;
+ if ( !mpStdClipRgnData )
+ mpStdClipRgnData = (RGNDATA*)new BYTE[sizeof(RGNDATA)-1+(SAL_CLIPRECT_COUNT*sizeof(RECT))];
+ mpClipRgnData = mpStdClipRgnData;
}
else
+ mpClipRgnData = (RGNDATA*)new BYTE[sizeof(RGNDATA)-1+nRectBufSize];
+ mpClipRgnData->rdh.dwSize = sizeof( RGNDATAHEADER );
+ mpClipRgnData->rdh.iType = RDH_RECTANGLES;
+ mpClipRgnData->rdh.nCount = nRectCount;
+ mpClipRgnData->rdh.nRgnSize = nRectBufSize;
+ RECT* pBoundRect = &(mpClipRgnData->rdh.rcBound);
+ SetRectEmpty( pBoundRect );
+ RECT* pNextClipRect = (RECT*)(&(mpClipRgnData->Buffer));
+ bool bFirstClipRect = true;
+
+ ImplRegionInfo aInfo;
+ long nX, nY, nW, nH;
+ bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
+ while( bRegionRect )
{
- if ( nX < pBoundRect->left )
- pBoundRect->left = (int)nX;
-
- if ( nY < pBoundRect->top )
- pBoundRect->top = (int)nY;
-
- if ( nRight > pBoundRect->right )
- pBoundRect->right = (int)nRight;
-
- if ( nBottom > pBoundRect->bottom )
- pBoundRect->bottom = (int)nBottom;
- }
-
- pRect->left = (int)nX;
- pRect->top = (int)nY;
- pRect->right = (int)nRight;
- pRect->bottom = (int)nBottom;
- mpNextClipRect++;
- }
- else
- {
- mpClipRgnData->rdh.nCount--;
- mpClipRgnData->rdh.nRgnSize -= sizeof( RECT );
- }
-
- return TRUE;
-}
+ if ( nW && nH )
+ {
+ long nRight = nX + nW;
+ long nBottom = nY + nH;
-// -----------------------------------------------------------------------
+ if ( bFirstClipRect )
+ {
+ pBoundRect->left = nX;
+ pBoundRect->top = nY;
+ pBoundRect->right = nRight;
+ pBoundRect->bottom = nBottom;
+ bFirstClipRect = false;
+ }
+ else
+ {
+ if ( nX < pBoundRect->left )
+ pBoundRect->left = (int)nX;
-bool WinSalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- // TODO: implement and advertise OutDevSupport_B2DClip support
- return false;
-}
+ if ( nY < pBoundRect->top )
+ pBoundRect->top = (int)nY;
-// -----------------------------------------------------------------------
+ if ( nRight > pBoundRect->right )
+ pBoundRect->right = (int)nRight;
-void WinSalGraphics::EndSetClipRegion()
-{
- // create clip region from ClipRgnData
- if ( mpClipRgnData->rdh.nCount == 1 )
- {
- RECT* pRect = &(mpClipRgnData->rdh.rcBound);
- mhRegion = CreateRectRgn( pRect->left, pRect->top,
- pRect->right, pRect->bottom );
- }
- else
- {
- ULONG nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER);
- mhRegion = ExtCreateRegion( NULL, nSize, mpClipRgnData );
+ if ( nBottom > pBoundRect->bottom )
+ pBoundRect->bottom = (int)nBottom;
+ }
- // if ExtCreateRegion(...) is not supported
- if( !mhRegion )
+ pNextClipRect->left = (int)nX;
+ pNextClipRect->top = (int)nY;
+ pNextClipRect->right = (int)nRight;
+ pNextClipRect->bottom = (int)nBottom;
+ pNextClipRect++;
+ }
+ else
+ {
+ mpClipRgnData->rdh.nCount--;
+ mpClipRgnData->rdh.nRgnSize -= sizeof( RECT );
+ }
+ bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
+ }
+ // create clip region from ClipRgnData
+ if ( mpClipRgnData->rdh.nCount == 1 )
{
- RGNDATAHEADER* pHeader = (RGNDATAHEADER*) mpClipRgnData;
+ RECT* pRect = &(mpClipRgnData->rdh.rcBound);
+ mhRegion = CreateRectRgn( pRect->left, pRect->top,
+ pRect->right, pRect->bottom );
+ }
+ else if( mpClipRgnData->rdh.nCount > 1 )
+ {
+ sal_uLong nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER);
+ mhRegion = ExtCreateRegion( NULL, nSize, mpClipRgnData );
- if( pHeader->nCount )
+ // if ExtCreateRegion(...) is not supported
+ if( !mhRegion )
{
- RECT* pRect = (RECT*) mpClipRgnData->Buffer;
- mhRegion = CreateRectRgn( pRect->left, pRect->top, pRect->right, pRect->bottom );
- pRect++;
+ RGNDATAHEADER* pHeader = (RGNDATAHEADER*) mpClipRgnData;
- for( ULONG n = 1; n < pHeader->nCount; n++, pRect++ )
+ if( pHeader->nCount )
{
- HRGN hRgn = CreateRectRgn( pRect->left, pRect->top, pRect->right, pRect->bottom );
- CombineRgn( mhRegion, mhRegion, hRgn, RGN_OR );
- DeleteRegion( hRgn );
+ RECT* pRect = (RECT*) mpClipRgnData->Buffer;
+ mhRegion = CreateRectRgn( pRect->left, pRect->top, pRect->right, pRect->bottom );
+ pRect++;
+
+ for( sal_uLong n = 1; n < pHeader->nCount; n++, pRect++ )
+ {
+ HRGN hRgn = CreateRectRgn( pRect->left, pRect->top, pRect->right, pRect->bottom );
+ CombineRgn( mhRegion, mhRegion, hRgn, RGN_OR );
+ DeleteRegion( hRgn );
+ }
}
}
- }
- if ( mpClipRgnData != mpStdClipRgnData )
- delete [] mpClipRgnData;
+ if ( mpClipRgnData != mpStdClipRgnData )
+ delete [] mpClipRgnData;
+ }
}
- SelectClipRgn( mhDC, mhRegion );
+ if( mhRegion )
+ SelectClipRgn( mhDC, mhRegion );
+ return mhRegion != 0;
}
// -----------------------------------------------------------------------
@@ -1004,14 +1027,14 @@ void WinSalGraphics::SetLineColor( SalColor nSalColor )
SALCOLOR_GREEN( nSalColor ),
SALCOLOR_BLUE( nSalColor ) );
HPEN hNewPen = 0;
- BOOL bStockPen = FALSE;
+ sal_Bool bStockPen = FALSE;
// search for stock pen (only screen, because printer have problems,
// when we use stock objects)
if ( !mbPrinter )
{
SalData* pSalData = GetSalData();
- for ( USHORT i = 0; i < pSalData->mnStockPenCount; i++ )
+ for ( sal_uInt16 i = 0; i < pSalData->mnStockPenCount; i++ )
{
if ( nPenColor == pSalData->maStockPenColorAry[i] )
{
@@ -1088,13 +1111,13 @@ void WinSalGraphics::SetFillColor( SalColor nSalColor )
BYTE nBlue = SALCOLOR_BLUE( nSalColor );
COLORREF nBrushColor = PALETTERGB( nRed, nGreen, nBlue );
HBRUSH hNewBrush = 0;
- BOOL bStockBrush = FALSE;
+ sal_Bool bStockBrush = FALSE;
// search for stock brush (only screen, because printer have problems,
// when we use stock objects)
if ( !mbPrinter )
{
- for ( USHORT i = 0; i < pSalData->mnStockBrushCount; i++ )
+ for ( sal_uInt16 i = 0; i < pSalData->mnStockBrushCount; i++ )
{
if ( nBrushColor == pSalData->maStockBrushColorAry[ i ] )
{
@@ -1314,7 +1337,7 @@ void WinSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight )
// -----------------------------------------------------------------------
-void WinSalGraphics::drawPolyLine( ULONG nPoints, const SalPoint* pPtAry )
+void WinSalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry )
{
// Unter NT koennen wir das Array direkt weiterreichen
DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ),
@@ -1329,7 +1352,7 @@ void WinSalGraphics::drawPolyLine( ULONG nPoints, const SalPoint* pPtAry )
// -----------------------------------------------------------------------
-void WinSalGraphics::drawPolygon( ULONG nPoints, const SalPoint* pPtAry )
+void WinSalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry )
{
// Unter NT koennen wir das Array direkt weiterreichen
DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ),
@@ -1417,7 +1440,7 @@ void WinSalGraphics::drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoint
// -----------------------------------------------------------------------
-sal_Bool WinSalGraphics::drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
+sal_Bool WinSalGraphics::drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
{
#ifdef USE_GDI_BEZIERS
// Unter NT koennen wir das Array direkt weiterreichen
@@ -1434,7 +1457,7 @@ sal_Bool WinSalGraphics::drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtA
// -----------------------------------------------------------------------
-sal_Bool WinSalGraphics::drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
+sal_Bool WinSalGraphics::drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
{
#ifdef USE_GDI_BEZIERS
// Unter NT koennen wir das Array direkt weiterreichen
@@ -1494,7 +1517,7 @@ sal_Bool WinSalGraphics::drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt
DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ),
"WinSalGraphics::DrawPolyPolygonBezier(): POINT != SalPoint" );
- ULONG nCurrPoly, nTotalPoints;
+ sal_uLong nCurrPoly, nTotalPoints;
const sal_uInt32* pCurrPoints = pPoints;
for( nCurrPoly=0, nTotalPoints=0; nCurrPoly<nPoly; ++nCurrPoly )
nTotalPoints += *pCurrPoints++;
@@ -1547,11 +1570,11 @@ sal_Bool WinSalGraphics::drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt
#define POSTSCRIPT_BOUNDINGSEARCH 0x1000 // we only try to get the BoundingBox
// in the first 4096 bytes
-static BYTE* ImplSearchEntry( BYTE* pSource, BYTE* pDest, ULONG nComp, ULONG nSize )
+static BYTE* ImplSearchEntry( BYTE* pSource, BYTE* 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 ) )
@@ -1564,9 +1587,9 @@ static BYTE* ImplSearchEntry( BYTE* pSource, BYTE* pDest, ULONG nComp, ULONG nSi
return NULL;
}
-static BOOL ImplGetBoundingBox( double* nNumb, BYTE* pSource, ULONG nSize )
+static sal_Bool ImplGetBoundingBox( double* nNumb, BYTE* pSource, sal_uLong nSize )
{
- BOOL bRetValue = FALSE;
+ sal_Bool bRetValue = FALSE;
BYTE* pDest = ImplSearchEntry( pSource, (BYTE*)"%%BoundingBox:", nSize, 14 );
if ( pDest )
{
@@ -1581,9 +1604,9 @@ static BOOL ImplGetBoundingBox( double* nNumb, BYTE* pSource, ULONG nSize )
for ( i = 0; ( i < 4 ) && nSizeLeft; i++ )
{
int nDivision = 1;
- BOOL bDivision = FALSE;
- BOOL bNegative = FALSE;
- BOOL bValid = TRUE;
+ sal_Bool bDivision = FALSE;
+ sal_Bool bNegative = FALSE;
+ sal_Bool bValid = TRUE;
while ( ( --nSizeLeft ) && ( *pDest == ' ' ) || ( *pDest == 0x9 ) ) pDest++;
BYTE nByte = *pDest;
@@ -1626,9 +1649,9 @@ static BOOL ImplGetBoundingBox( double* nNumb, BYTE* pSource, ULONG nSize )
return bRetValue;
}
-BOOL WinSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize )
+sal_Bool WinSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize )
{
- BOOL bRetValue = FALSE;
+ sal_Bool bRetValue = FALSE;
if ( mbPrinter )
{
@@ -1642,7 +1665,7 @@ BOOL WinSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void*
{
OStringBuffer aBuf( POSTSCRIPT_BUFSIZE );
- // reserve place for a USHORT
+ // reserve place for a sal_uInt16
aBuf.append( "aa" );
// #107797# Write out EPS encapsulation header
@@ -1720,7 +1743,7 @@ BOOL WinSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void*
// #107797# Write out buffer
// ----------------------------------------------------------------------------------
- *((USHORT*)aBuf.getStr()) = (USHORT)( aBuf.getLength() - 2 );
+ *((sal_uInt16*)aBuf.getStr()) = (sal_uInt16)( aBuf.getLength() - 2 );
Escape ( mhDC, nEscape, aBuf.getLength(), (LPTSTR)aBuf.getStr(), 0 );
@@ -1728,7 +1751,7 @@ BOOL WinSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void*
// ----------------------------------------------------------------------------------
double dM11 = nWidth / ( nBoundingBox[2] - nBoundingBox[0] );
double dM22 = nHeight / (nBoundingBox[1] - nBoundingBox[3] );
- // reserve a USHORT again
+ // reserve a sal_uInt16 again
aBuf.setLength( 2 );
aBuf.append( "\n\n[" );
aBuf.append( dM11 );
@@ -1740,14 +1763,14 @@ BOOL WinSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void*
aBuf.append( nY - ( dM22 * nBoundingBox[3] ) );
aBuf.append( "] concat\n"
"%%BeginDocument:\n" );
- *((USHORT*)aBuf.getStr()) = (USHORT)( aBuf.getLength() - 2 );
+ *((sal_uInt16*)aBuf.getStr()) = (sal_uInt16)( aBuf.getLength() - 2 );
Escape ( mhDC, nEscape, aBuf.getLength(), (LPTSTR)aBuf.getStr(), 0 );
// #107797# Write out actual EPS content
// ----------------------------------------------------------------------------------
- ULONG nToDo = nSize;
- ULONG nDoNow;
+ sal_uLong nToDo = nSize;
+ sal_uLong nDoNow;
while ( nToDo )
{
nDoNow = nToDo;
@@ -1755,9 +1778,9 @@ BOOL WinSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void*
nDoNow = POSTSCRIPT_BUFSIZE - 2;
// the following is based on the string buffer allocation
// of size POSTSCRIPT_BUFSIZE at construction time of aBuf
- *((USHORT*)aBuf.getStr()) = (USHORT)nDoNow;
+ *((sal_uInt16*)aBuf.getStr()) = (sal_uInt16)nDoNow;
memcpy( (void*)(aBuf.getStr() + 2), (BYTE*)pPtr + nSize - nToDo, nDoNow );
- ULONG nResult = Escape ( mhDC, nEscape, nDoNow + 2, (LPTSTR)aBuf.getStr(), 0 );
+ sal_uLong nResult = Escape ( mhDC, nEscape, nDoNow + 2, (LPTSTR)aBuf.getStr(), 0 );
if (!nResult )
break;
nToDo -= nResult;
@@ -1766,13 +1789,13 @@ BOOL WinSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void*
// #107797# Write out EPS encapsulation footer
// ----------------------------------------------------------------------------------
- // reserve a USHORT again
+ // reserve a sal_uInt16 again
aBuf.setLength( 2 );
aBuf.append( "%%EndDocument\n"
"count op_count_salWin sub {pop} repeat\n"
"countdictstack dict_count_salWin sub {end} repeat\n"
"b4_Inc_state_salWin restore\n\n" );
- *((USHORT*)aBuf.getStr()) = (USHORT)( aBuf.getLength() - 2 );
+ *((sal_uInt16*)aBuf.getStr()) = (sal_uInt16)( aBuf.getLength() - 2 );
Escape ( mhDC, nEscape, aBuf.getLength(), (LPTSTR)aBuf.getStr(), 0 );
bRetValue = TRUE;
}
diff --git a/vcl/win/source/gdi/salgdi2.cxx b/vcl/win/source/gdi/salgdi2.cxx
index b066258c3dac..90123100c7ee 100644
--- a/vcl/win/source/gdi/salgdi2.cxx
+++ b/vcl/win/source/gdi/salgdi2.cxx
@@ -50,6 +50,9 @@ bool WinSalGraphics::supportsOperation( OutDevSupportType eType ) const
case OutDevSupport_TransparentRect:
bRet = mbVirDev || mbWindow;
break;
+ case OutDevSupport_B2DClip:
+ bRet = true;
+ break;
case OutDevSupport_B2DDraw:
bRet = bAllowForTest;
default: break;
@@ -146,7 +149,7 @@ void ImplCalcOutSideRgn( const RECT& rSrcRect,
void WinSalGraphics::copyArea( long nDestX, long nDestY,
long nSrcX, long nSrcY,
long nSrcWidth, long nSrcHeight,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
bool bRestoreClipRgn = false;
HRGN hOldClipRgn = 0;
@@ -343,14 +346,14 @@ void WinSalGraphics::copyArea( long nDestX, long nDestY,
void ImplDrawBitmap( HDC hDC,
const SalTwoRect* pPosAry, const WinSalBitmap& rSalBitmap,
- BOOL bPrinter, int nDrawMode )
+ sal_Bool bPrinter, int nDrawMode )
{
if( hDC )
{
HGLOBAL hDrawDIB;
HBITMAP hDrawDDB = rSalBitmap.ImplGethDDB();
WinSalBitmap* pTmpSalBmp = NULL;
- BOOL bPrintDDB = ( bPrinter && hDrawDDB );
+ sal_Bool bPrintDDB = ( bPrinter && hDrawDDB );
if( bPrintDDB )
{
@@ -384,7 +387,7 @@ void ImplDrawBitmap( HDC hDC,
HDC hBmpDC = ImplGetCachedDC( CACHED_HDC_DRAW, hDrawDDB );
COLORREF nOldBkColor = RGB(0xFF,0xFF,0xFF);
COLORREF nOldTextColor = RGB(0,0,0);
- BOOL bMono = ( rSalBitmap.GetBitCount() == 1 );
+ sal_Bool bMono = ( rSalBitmap.GetBitCount() == 1 );
if( bMono )
{
@@ -666,7 +669,7 @@ SalBitmap* WinSalGraphics::getBitmap( long nX, long nY, long nDX, long nDY )
HDC hDC = mhDC;
HBITMAP hBmpBitmap = CreateCompatibleBitmap( hDC, nDX, nDY );
HDC hBmpDC = ImplGetCachedDC( CACHED_HDC_1, hBmpBitmap );
- BOOL bRet;
+ sal_Bool bRet;
DWORD err = 0;
bRet = BitBlt( hBmpDC, 0, 0, (int) nDX, (int) nDY, hDC, (int) nX, (int) nY, SRCCOPY ) ? TRUE : FALSE;
@@ -753,7 +756,7 @@ void WinSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInv
// -----------------------------------------------------------------------
-void WinSalGraphics::invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nSalFlags )
+void WinSalGraphics::invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nSalFlags )
{
HPEN hPen;
HPEN hOldPen;
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index 567ecc8b734b..355cae79377b 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -127,7 +127,7 @@ private:
FontAttrMap aFontAttributes;
rtl::OUString aCacheFileName;
String aBaseURL;
- BOOL bModified;
+ sal_Bool bModified;
protected:
String OptimizeURL( const String& rURL ) const;
@@ -532,9 +532,10 @@ bool WinGlyphFallbackSubstititution::HasMissingChars( const ImplFontData* pFace,
// avoid fonts with unknown CMAP subtables for glyph fallback
if( !pCharMap || pCharMap->IsDefaultMap() )
return false;
+ pCharMap->AddReference();
int nMatchCount = 0;
- // static const int nMaxMatchCount = 1; // TODO: check more missing characters?
+ // static const int nMaxMatchCount = 1; // TODO: tolerate more missing characters?
const sal_Int32 nStrLen = rMissingChars.getLength();
for( sal_Int32 nStrIdx = 0; nStrIdx < nStrLen; ++nStrIdx )
{
@@ -542,6 +543,7 @@ bool WinGlyphFallbackSubstititution::HasMissingChars( const ImplFontData* pFace,
nMatchCount += pCharMap->HasChar( uChar );
break; // for now
}
+ pCharMap->DeReference();
const bool bHasMatches = (nMatchCount > 0);
return bHasMatches;
@@ -643,7 +645,7 @@ static CharSet ImplCharSetToSal( BYTE nCharSet )
if ( nCharSet == OEM_CHARSET )
{
- UINT nCP = (USHORT)GetOEMCP();
+ UINT nCP = (sal_uInt16)GetOEMCP();
switch ( nCP )
{
// It is unclear why these two (undefined?) code page numbers are
@@ -1192,7 +1194,7 @@ const void * GrFontData::getTable(unsigned int name, size_t *len) const
#endif
ImplWinFontData::ImplWinFontData( const ImplDevFontAttributes& rDFS,
- int nHeight, WIN_BYTE eWinCharSet, WIN_BYTE nPitchAndFamily )
+ int nHeight, BYTE eWinCharSet, BYTE nPitchAndFamily )
: ImplFontData( rDFS, 0 ),
meWinCharSet( eWinCharSet ),
mnPitchAndFamily( nPitchAndFamily ),
@@ -1350,11 +1352,10 @@ bool ImplWinFontData::IsGSUBstituted( sal_UCS4 cChar ) const
// -----------------------------------------------------------------------
-ImplFontCharMap* ImplWinFontData::GetImplFontCharMap() const
+const ImplFontCharMap* ImplWinFontData::GetImplFontCharMap() const
{
if( !mpUnicodeMap )
return NULL;
- mpUnicodeMap->AddReference();
return mpUnicodeMap;
}
@@ -1434,6 +1435,7 @@ void ImplWinFontData::ReadCmapTable( HDC hDC ) const
if( !mpUnicodeMap )
mpUnicodeMap = ImplFontCharMap::GetDefaultMap( bIsSymbolFont );
+ mpUnicodeMap->AddReference();
}
void ImplWinFontData::GetFontCapabilities( HDC hDC ) const
@@ -1512,8 +1514,6 @@ int CALLBACK SalEnumQueryFontProcExW( const ENUMLOGFONTEXW*,
bool ImplIsFontAvailable( HDC hDC, const UniString& rName )
{
- bool bAvailable = false;
-
// Test, if Font available
LOGFONTW aLogFont;
memset( &aLogFont, 0, sizeof( aLogFont ) );
@@ -1525,6 +1525,7 @@ bool ImplIsFontAvailable( HDC hDC, const UniString& rName )
memcpy( aLogFont.lfFaceName, rName.GetBuffer(), nNameLen*sizeof( wchar_t ) );
aLogFont.lfFaceName[nNameLen] = 0;
+ bool bAvailable = false;
EnumFontFamiliesExW( hDC, &aLogFont, (FONTENUMPROCW)SalEnumQueryFontProcExW,
(LPARAM)(void*)&bAvailable, 0 );
@@ -1679,7 +1680,7 @@ HFONT WinSalGraphics::ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFont
return hNewFont;
}
-USHORT WinSalGraphics::SetFont( ImplFontSelectData* pFont, int nFallbackLevel )
+sal_uInt16 WinSalGraphics::SetFont( ImplFontSelectData* pFont, int nFallbackLevel )
{
// return early if there is no new font
if( !pFont )
@@ -1868,12 +1869,12 @@ static void ImplGetAllFontCharSets( WinSalGraphics* pData )
static void ImplAddKerningPairs( WinSalGraphics* pData )
{
- ULONG nPairs = ::GetKerningPairsA( pData->mhDC, 0, NULL );
+ sal_uLong nPairs = ::GetKerningPairsA( pData->mhDC, 0, NULL );
if ( !nPairs )
return;
CHARSETINFO aInfo;
- if ( !TranslateCharsetInfo( (DWORD*)(ULONG)GetTextCharset( pData->mhDC ), &aInfo, TCI_SRCCHARSET ) )
+ if ( !TranslateCharsetInfo( (DWORD*)(sal_uLong)GetTextCharset( pData->mhDC ), &aInfo, TCI_SRCCHARSET ) )
return;
if ( !pData->mpFontKernPairs )
@@ -1888,15 +1889,15 @@ static void ImplAddKerningPairs( WinSalGraphics* pData )
}
UINT nCP = aInfo.ciACP;
- ULONG nOldPairs = pData->mnFontKernPairCount;
+ sal_uLong nOldPairs = pData->mnFontKernPairCount;
KERNINGPAIR* pTempPair = pData->mpFontKernPairs+pData->mnFontKernPairCount;
nPairs = ::GetKerningPairsA( pData->mhDC, nPairs, pTempPair );
- for ( ULONG i = 0; i < nPairs; i++ )
+ for ( sal_uLong i = 0; i < nPairs; i++ )
{
unsigned char aBuf[2];
wchar_t nChar;
int nLen;
- BOOL bAdd = TRUE;
+ sal_Bool bAdd = TRUE;
// None-ASCII?, then we must convert the char
if ( (pTempPair->wFirst > 125) || (pTempPair->wFirst == 92) )
@@ -1940,7 +1941,7 @@ static void ImplAddKerningPairs( WinSalGraphics* pData )
// TODO: get rid of linear search!
KERNINGPAIR* pTempPair2 = pData->mpFontKernPairs;
- for ( ULONG j = 0; j < nOldPairs; j++ )
+ for ( sal_uLong j = 0; j < nOldPairs; j++ )
{
if ( (pTempPair2->wFirst == pTempPair->wFirst) &&
(pTempPair2->wSecond == pTempPair->wSecond) )
@@ -1965,7 +1966,7 @@ static void ImplAddKerningPairs( WinSalGraphics* pData )
// -----------------------------------------------------------------------
-ULONG WinSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
+sal_uLong WinSalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs )
{
DBG_ASSERT( sizeof( KERNINGPAIR ) == sizeof( ImplKernPairData ),
"WinSalGraphics::GetKernPairs(): KERNINGPAIR != ImplKernPairData" );
@@ -1983,17 +1984,17 @@ ULONG WinSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
int nCount = ::GetKerningPairsW( mhDC, 0, NULL );
if( nCount )
{
-#ifdef GCP_KERN_HACK
+ #ifdef GCP_KERN_HACK
pPairs = new KERNINGPAIR[ nCount+1 ];
mpFontKernPairs = pPairs;
mnFontKernPairCount = nCount;
::GetKerningPairsW( mhDC, nCount, pPairs );
-#else // GCP_KERN_HACK
+ #else // GCP_KERN_HACK
pPairs = pKernPairs;
nCount = (nCount < nPairs) : nCount : nPairs;
::GetKerningPairsW( mhDC, nCount, pPairs );
return nCount;
-#endif // GCP_KERN_HACK
+ #endif // GCP_KERN_HACK
}
mbFontKernInit = FALSE;
@@ -2017,7 +2018,7 @@ ULONG WinSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
// -----------------------------------------------------------------------
-ImplFontCharMap* WinSalGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* WinSalGraphics::GetImplFontCharMap() const
{
if( !mpWinFontData[0] )
return ImplFontCharMap::GetDefaultMap();
@@ -2393,8 +2394,8 @@ bool WinSalGraphics::AddTempDevFont( ImplDevFontList* pFontList,
*/
ImplWinFontData* pFontData = new ImplWinFontData( aDFA, 0,
- sal::static_int_cast<WIN_BYTE>(nPreferedCharSet),
- sal::static_int_cast<WIN_BYTE>(TMPF_VECTOR|TMPF_TRUETYPE) );
+ sal::static_int_cast<BYTE>(nPreferedCharSet),
+ sal::static_int_cast<BYTE>(TMPF_VECTOR|TMPF_TRUETYPE) );
pFontData->SetFontId( reinterpret_cast<sal_IntPtr>(pFontData) );
pFontList->Add( pFontData );
return true;
@@ -2505,7 +2506,7 @@ void WinSalGraphics::GetDevFontSubstList( OutputDevice* )
// -----------------------------------------------------------------------
-BOOL WinSalGraphics::GetGlyphBoundRect( long nIndex, Rectangle& rRect )
+sal_Bool WinSalGraphics::GetGlyphBoundRect( long nIndex, Rectangle& rRect )
{
HDC hDC = mhDC;
@@ -2522,9 +2523,7 @@ BOOL WinSalGraphics::GetGlyphBoundRect( long nIndex, Rectangle& rRect )
GLYPHMETRICS aGM;
aGM.gmptGlyphOrigin.x = aGM.gmptGlyphOrigin.y = 0;
aGM.gmBlackBoxX = aGM.gmBlackBoxY = 0;
- DWORD nSize = GDI_ERROR;
- nSize = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGM, 0, NULL, &aMat );
-
+ DWORD nSize = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGM, 0, NULL, &aMat );
if( nSize == GDI_ERROR )
return false;
@@ -2539,12 +2538,11 @@ BOOL WinSalGraphics::GetGlyphBoundRect( long nIndex, Rectangle& rRect )
// -----------------------------------------------------------------------
-BOOL WinSalGraphics::GetGlyphOutline( long nIndex,
+sal_Bool WinSalGraphics::GetGlyphOutline( long nIndex,
::basegfx::B2DPolyPolygon& rB2DPolyPoly )
{
rB2DPolyPoly.clear();
- BOOL bRet = FALSE;
HDC hDC = mhDC;
// use unity matrix
@@ -2558,164 +2556,160 @@ BOOL WinSalGraphics::GetGlyphOutline( long nIndex,
nIndex &= GF_IDXMASK;
GLYPHMETRICS aGlyphMetrics;
- DWORD nSize1 = GDI_ERROR;
- nSize1 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGlyphMetrics, 0, NULL, &aMat );
-
+ const DWORD nSize1 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGlyphMetrics, 0, NULL, &aMat );
if( !nSize1 ) // blank glyphs are ok
- bRet = TRUE;
- else if( nSize1 != GDI_ERROR )
+ return TRUE;
+ else if( nSize1 == GDI_ERROR )
+ return FALSE;
+
+ BYTE* pData = new BYTE[ nSize1 ];
+ const DWORD nSize2 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags,
+ &aGlyphMetrics, nSize1, pData, &aMat );
+
+ if( nSize1 != nSize2 )
+ return FALSE;
+
+ // TODO: avoid tools polygon by creating B2DPolygon directly
+ int nPtSize = 512;
+ Point* pPoints = new Point[ nPtSize ];
+ BYTE* pFlags = new BYTE[ nPtSize ];
+
+ TTPOLYGONHEADER* pHeader = (TTPOLYGONHEADER*)pData;
+ while( (BYTE*)pHeader < pData+nSize2 )
{
- BYTE* pData = new BYTE[ nSize1 ];
- DWORD nSize2;
- nSize2 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags,
- &aGlyphMetrics, nSize1, pData, &aMat );
+ // only outline data is interesting
+ if( pHeader->dwType != TT_POLYGON_TYPE )
+ break;
- if( nSize1 == nSize2 )
- {
- bRet = TRUE;
+ // get start point; next start points are end points
+ // of previous segment
+ sal_uInt16 nPnt = 0;
- int nPtSize = 512;
- Point* pPoints = new Point[ nPtSize ];
- BYTE* pFlags = new BYTE[ nPtSize ];
+ long nX = IntTimes256FromFixed( pHeader->pfxStart.x );
+ long nY = IntTimes256FromFixed( pHeader->pfxStart.y );
+ pPoints[ nPnt ] = Point( nX, nY );
+ pFlags[ nPnt++ ] = POLY_NORMAL;
- TTPOLYGONHEADER* pHeader = (TTPOLYGONHEADER*)pData;
- while( (BYTE*)pHeader < pData+nSize2 )
+ bool bHasOfflinePoints = false;
+ TTPOLYCURVE* pCurve = (TTPOLYCURVE*)( pHeader + 1 );
+ pHeader = (TTPOLYGONHEADER*)( (BYTE*)pHeader + pHeader->cb );
+ while( (BYTE*)pCurve < (BYTE*)pHeader )
+ {
+ int nNeededSize = nPnt + 16 + 3 * pCurve->cpfx;
+ if( nPtSize < nNeededSize )
{
- // only outline data is interesting
- if( pHeader->dwType != TT_POLYGON_TYPE )
- break;
-
- // get start point; next start points are end points
- // of previous segment
- USHORT nPnt = 0;
-
- long nX = IntTimes256FromFixed( pHeader->pfxStart.x );
- long nY = IntTimes256FromFixed( pHeader->pfxStart.y );
- pPoints[ nPnt ] = Point( nX, nY );
- pFlags[ nPnt++ ] = POLY_NORMAL;
-
- bool bHasOfflinePoints = false;
- TTPOLYCURVE* pCurve = (TTPOLYCURVE*)( pHeader + 1 );
- pHeader = (TTPOLYGONHEADER*)( (BYTE*)pHeader + pHeader->cb );
- while( (BYTE*)pCurve < (BYTE*)pHeader )
+ Point* pOldPoints = pPoints;
+ BYTE* pOldFlags = pFlags;
+ nPtSize = 2 * nNeededSize;
+ pPoints = new Point[ nPtSize ];
+ pFlags = new BYTE[ nPtSize ];
+ for( sal_uInt16 i = 0; i < nPnt; ++i )
{
- int nNeededSize = nPnt + 16 + 3 * pCurve->cpfx;
- if( nPtSize < nNeededSize )
- {
- Point* pOldPoints = pPoints;
- BYTE* pOldFlags = pFlags;
- nPtSize = 2 * nNeededSize;
- pPoints = new Point[ nPtSize ];
- pFlags = new BYTE[ nPtSize ];
- for( USHORT i = 0; i < nPnt; ++i )
- {
- pPoints[ i ] = pOldPoints[ i ];
- pFlags[ i ] = pOldFlags[ i ];
- }
- delete[] pOldPoints;
- delete[] pOldFlags;
- }
+ pPoints[ i ] = pOldPoints[ i ];
+ pFlags[ i ] = pOldFlags[ i ];
+ }
+ delete[] pOldPoints;
+ delete[] pOldFlags;
+ }
- int i = 0;
- if( TT_PRIM_LINE == pCurve->wType )
+ int i = 0;
+ if( TT_PRIM_LINE == pCurve->wType )
+ {
+ while( i < pCurve->cpfx )
+ {
+ nX = IntTimes256FromFixed( pCurve->apfx[ i ].x );
+ nY = IntTimes256FromFixed( pCurve->apfx[ i ].y );
+ ++i;
+ pPoints[ nPnt ] = Point( nX, nY );
+ pFlags[ nPnt ] = POLY_NORMAL;
+ ++nPnt;
+ }
+ }
+ else if( TT_PRIM_QSPLINE == pCurve->wType )
+ {
+ bHasOfflinePoints = true;
+ while( i < pCurve->cpfx )
+ {
+ // get control point of quadratic bezier spline
+ nX = IntTimes256FromFixed( pCurve->apfx[ i ].x );
+ nY = IntTimes256FromFixed( pCurve->apfx[ i ].y );
+ ++i;
+ Point aControlP( nX, nY );
+
+ // calculate first cubic control point
+ // P0 = 1/3 * (PBeg + 2 * PQControl)
+ nX = pPoints[ nPnt-1 ].X() + 2 * aControlP.X();
+ nY = pPoints[ nPnt-1 ].Y() + 2 * aControlP.Y();
+ pPoints[ nPnt+0 ] = Point( (2*nX+3)/6, (2*nY+3)/6 );
+ pFlags[ nPnt+0 ] = POLY_CONTROL;
+
+ // calculate endpoint of segment
+ nX = IntTimes256FromFixed( pCurve->apfx[ i ].x );
+ nY = IntTimes256FromFixed( pCurve->apfx[ i ].y );
+
+ if ( i+1 >= pCurve->cpfx )
{
- while( i < pCurve->cpfx )
- {
- nX = IntTimes256FromFixed( pCurve->apfx[ i ].x );
- nY = IntTimes256FromFixed( pCurve->apfx[ i ].y );
- ++i;
- pPoints[ nPnt ] = Point( nX, nY );
- pFlags[ nPnt ] = POLY_NORMAL;
- ++nPnt;
- }
+ // endpoint is either last point in segment => advance
+ ++i;
}
- else if( TT_PRIM_QSPLINE == pCurve->wType )
+ else
{
- bHasOfflinePoints = true;
- while( i < pCurve->cpfx )
- {
- // get control point of quadratic bezier spline
- nX = IntTimes256FromFixed( pCurve->apfx[ i ].x );
- nY = IntTimes256FromFixed( pCurve->apfx[ i ].y );
- ++i;
- Point aControlP( nX, nY );
-
- // calculate first cubic control point
- // P0 = 1/3 * (PBeg + 2 * PQControl)
- nX = pPoints[ nPnt-1 ].X() + 2 * aControlP.X();
- nY = pPoints[ nPnt-1 ].Y() + 2 * aControlP.Y();
- pPoints[ nPnt+0 ] = Point( (2*nX+3)/6, (2*nY+3)/6 );
- pFlags[ nPnt+0 ] = POLY_CONTROL;
-
- // calculate endpoint of segment
- nX = IntTimes256FromFixed( pCurve->apfx[ i ].x );
- nY = IntTimes256FromFixed( pCurve->apfx[ i ].y );
-
- if ( i+1 >= pCurve->cpfx )
- {
- // endpoint is either last point in segment => advance
- ++i;
- }
- else
- {
- // or endpoint is the middle of two control points
- nX += IntTimes256FromFixed( pCurve->apfx[ i-1 ].x );
- nY += IntTimes256FromFixed( pCurve->apfx[ i-1 ].y );
- nX = (nX + 1) / 2;
- nY = (nY + 1) / 2;
- // no need to advance, because the current point
- // is the control point in next bezier spline
- }
-
- pPoints[ nPnt+2 ] = Point( nX, nY );
- pFlags[ nPnt+2 ] = POLY_NORMAL;
-
- // calculate second cubic control point
- // P1 = 1/3 * (PEnd + 2 * PQControl)
- nX = pPoints[ nPnt+2 ].X() + 2 * aControlP.X();
- nY = pPoints[ nPnt+2 ].Y() + 2 * aControlP.Y();
- pPoints[ nPnt+1 ] = Point( (2*nX+3)/6, (2*nY+3)/6 );
- pFlags[ nPnt+1 ] = POLY_CONTROL;
-
- nPnt += 3;
- }
+ // or endpoint is the middle of two control points
+ nX += IntTimes256FromFixed( pCurve->apfx[ i-1 ].x );
+ nY += IntTimes256FromFixed( pCurve->apfx[ i-1 ].y );
+ nX = (nX + 1) / 2;
+ nY = (nY + 1) / 2;
+ // no need to advance, because the current point
+ // is the control point in next bezier spline
}
- // next curve segment
- pCurve = (TTPOLYCURVE*)&pCurve->apfx[ i ];
- }
+ pPoints[ nPnt+2 ] = Point( nX, nY );
+ pFlags[ nPnt+2 ] = POLY_NORMAL;
- // end point is start point for closed contour
- // disabled, because Polygon class closes the contour itself
- // pPoints[nPnt++] = pPoints[0];
- // #i35928#
- // Added again, but add only when not yet closed
- if(pPoints[nPnt - 1] != pPoints[0])
- {
- if( bHasOfflinePoints )
- pFlags[nPnt] = pFlags[0];
+ // calculate second cubic control point
+ // P1 = 1/3 * (PEnd + 2 * PQControl)
+ nX = pPoints[ nPnt+2 ].X() + 2 * aControlP.X();
+ nY = pPoints[ nPnt+2 ].Y() + 2 * aControlP.Y();
+ pPoints[ nPnt+1 ] = Point( (2*nX+3)/6, (2*nY+3)/6 );
+ pFlags[ nPnt+1 ] = POLY_CONTROL;
- pPoints[nPnt++] = pPoints[0];
+ nPnt += 3;
}
+ }
- // convert y-coordinates W32 -> VCL
- for( int i = 0; i < nPnt; ++i )
- pPoints[i].Y() = -pPoints[i].Y();
+ // next curve segment
+ pCurve = (TTPOLYCURVE*)&pCurve->apfx[ i ];
+ }
- // insert into polypolygon
- Polygon aPoly( nPnt, pPoints, (bHasOfflinePoints ? pFlags : NULL) );
- // convert to B2DPolyPolygon
- // TODO: get rid of the intermediate PolyPolygon
- rB2DPolyPoly.append( aPoly.getB2DPolygon() );
- }
+ // end point is start point for closed contour
+ // disabled, because Polygon class closes the contour itself
+ // pPoints[nPnt++] = pPoints[0];
+ // #i35928#
+ // Added again, but add only when not yet closed
+ if(pPoints[nPnt - 1] != pPoints[0])
+ {
+ if( bHasOfflinePoints )
+ pFlags[nPnt] = pFlags[0];
- delete[] pPoints;
- delete[] pFlags;
+ pPoints[nPnt++] = pPoints[0];
}
- delete[] pData;
+ // convert y-coordinates W32 -> VCL
+ for( int i = 0; i < nPnt; ++i )
+ pPoints[i].Y() = -pPoints[i].Y();
+
+ // insert into polypolygon
+ Polygon aPoly( nPnt, pPoints, (bHasOfflinePoints ? pFlags : NULL) );
+ // convert to B2DPolyPolygon
+ // TODO: get rid of the intermediate PolyPolygon
+ rB2DPolyPoly.append( aPoly.getB2DPolygon() );
}
+ delete[] pPoints;
+ delete[] pFlags;
+
+ delete[] pData;
+
// rescaling needed for the PolyPolygon conversion
if( rB2DPolyPoly.count() )
{
@@ -2723,7 +2717,7 @@ BOOL WinSalGraphics::GetGlyphOutline( long nIndex,
rB2DPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix(fFactor, fFactor));
}
- return bRet;
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -2786,7 +2780,7 @@ int ScopedTrueTypeFont::open(void * pBuffer, sal_uInt32 nLen,
return OpenTTFontBuffer(pBuffer, nLen, nFaceNum, &m_pFont);
}
-BOOL WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
+sal_Bool WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData* pFont, long* pGlyphIDs, sal_uInt8* pEncoding,
sal_Int32* pGlyphWidths, int nGlyphCount, FontSubsetInfo& rInfo )
{
@@ -2804,8 +2798,6 @@ BOOL WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
ImplDoSetFont( &aIFSD, fScale, hOldFont );
ImplWinFontData* pWinFontData = (ImplWinFontData*)aIFSD.mpFontData;
- pWinFontData->UpdateFromHDC( mhDC );
-/*const*/ ImplFontCharMap* pImplFontCharMap = pWinFontData->GetImplFontCharMap();
#if OSL_DEBUG_LEVEL > 1
// get font metrics
@@ -2828,6 +2820,10 @@ BOOL WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
const RawFontData aRawCffData( mhDC, nCffTag );
if( aRawCffData.get() )
{
+ pWinFontData->UpdateFromHDC( mhDC );
+ const ImplFontCharMap* pCharMap = pWinFontData->GetImplFontCharMap();
+ pCharMap->AddReference();
+
long nRealGlyphIds[ 256 ];
for( int i = 0; i < nGlyphCount; ++i )
{
@@ -2835,13 +2831,15 @@ BOOL WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
// TODO: use GDI's GetGlyphIndices instead? Does it handle GSUB properly?
sal_uInt32 nGlyphIdx = pGlyphIDs[i] & GF_IDXMASK;
if( pGlyphIDs[i] & GF_ISCHAR ) // remaining pseudo-glyphs need to be translated
- nGlyphIdx = pImplFontCharMap->GetGlyphIndex( nGlyphIdx );
+ nGlyphIdx = pCharMap->GetGlyphIndex( nGlyphIdx );
if( (pGlyphIDs[i] & (GF_ROTMASK|GF_GSUB)) != 0) // TODO: vertical substitution
{/*####*/}
nRealGlyphIds[i] = nGlyphIdx;
}
+ pCharMap->DeReference(); // TODO: and and use a RAII object
+
// provide a font subset from the CFF-table
FILE* pOutFile = fopen( aToFile.GetBuffer(), "wb" );
rInfo.LoadFont( FontSubsetInfo::CFF_FONT, aRawCffData.get(), aRawCffData.size() );
@@ -2879,7 +2877,7 @@ BOOL WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
// subset TTF-glyphs and get their properties
// take care that subset fonts require the NotDef glyph in pos 0
int nOrigCount = nGlyphCount;
- USHORT aShortIDs[ 256 ];
+ sal_uInt16 aShortIDs[ 256 ];
sal_uInt8 aTempEncs[ 256 ];
int nNotDef=-1, i;
@@ -2899,7 +2897,7 @@ BOOL WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
nGlyphIdx = ::MapChar( aSftTTF.get(), cChar, bVertical );
}
}
- aShortIDs[i] = static_cast<USHORT>( nGlyphIdx );
+ aShortIDs[i] = static_cast<sal_uInt16>( nGlyphIdx );
if( !nGlyphIdx )
if( nNotDef < 0 )
nNotDef = i; // first NotDef glyph found
@@ -2970,7 +2968,7 @@ const void* WinSalGraphics::GetEmbedFontData( const ImplFontData* pFont,
nFNLen--;
if( nFNLen == 0 )
*pDataLen = 0;
- rInfo.m_aPSName = String( reinterpret_cast<const sal_Unicode*>(aFaceName), sal::static_int_cast<USHORT>(nFNLen) );
+ rInfo.m_aPSName = String( reinterpret_cast<const sal_Unicode*>(aFaceName), sal::static_int_cast<sal_uInt16>(nFNLen) );
rInfo.m_nAscent = +aTm.tmAscent;
rInfo.m_nDescent = -aTm.tmDescent;
rInfo.m_aFontBBox = Rectangle( Point( -aTm.tmOverhang, -aTm.tmDescent ),
@@ -3082,8 +3080,9 @@ void WinSalGraphics::GetGlyphWidths( const ImplFontData* pFont,
rUnicodeEnc.clear();
}
const ImplWinFontData* pWinFont = static_cast<const ImplWinFontData*>(pFont);
- ImplFontCharMap* pMap = pWinFont->GetImplFontCharMap();
+ const ImplFontCharMap* pMap = pWinFont->GetImplFontCharMap();
DBG_ASSERT( pMap && pMap->GetCharCount(), "no map" );
+ pMap->AddReference();
int nCharCount = pMap->GetCharCount();
sal_uInt32 nChar = pMap->GetFirstChar();
@@ -3099,6 +3098,8 @@ void WinSalGraphics::GetGlyphWidths( const ImplFontData* pFont,
}
nChar = pMap->GetNextChar( nChar );
}
+
+ pMap->DeReference(); // TODO: and and use a RAII object
}
}
else if( pFont->IsEmbeddable() )
diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index 446b98892f6d..ccd378750580 100644
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -80,7 +80,7 @@ private:
public:
VisualStylesAPI();
~VisualStylesAPI();
- BOOL IsAvailable() { return (mhModule != NULL); }
+ sal_Bool IsAvailable() { return (mhModule != NULL); }
HTHEME OpenThemeData( HWND hwnd, LPCWSTR pszClassList );
HRESULT CloseThemeData( HTHEME hTheme );
@@ -190,6 +190,8 @@ void SalData::deInitNWF( void )
++iter;
}
aThemeMap.clear();
+ if( maDwmLib )
+ osl_unloadModule( maDwmLib );
}
static HTHEME getThemeHandle( HWND hWnd, LPCWSTR name )
@@ -217,7 +219,7 @@ static HTHEME getThemeHandle( HWND hWnd, LPCWSTR name )
* Returns TRUE if the platform supports native
* drawing of the control defined by nPart
*/
-BOOL WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
+sal_Bool WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
{
HTHEME hTheme = NULL;
@@ -288,6 +290,22 @@ BOOL WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
case CTRL_MENUBAR:
if( nPart == PART_ENTIRE_CONTROL )
hTheme = getThemeHandle( mhWnd, L"Rebar");
+ else if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nPart == PART_MENU_ITEM )
+ hTheme = getThemeHandle( mhWnd, L"Menu" );
+ }
+ break;
+ case CTRL_MENU_POPUP:
+ if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nPart == PART_ENTIRE_CONTROL ||
+ nPart == PART_MENU_ITEM ||
+ nPart == PART_MENU_ITEM_CHECK_MARK ||
+ nPart == PART_MENU_ITEM_RADIO_MARK ||
+ nPart == PART_MENU_SEPARATOR )
+ hTheme = getThemeHandle( mhWnd, L"Menu" );
+ }
break;
case CTRL_PROGRESS:
if( nPart == PART_ENTIRE_CONTROL )
@@ -317,16 +335,16 @@ BOOL WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
* aPos was or was not inside the native widget specified by the
* nType/nPart combination.
*/
-BOOL WinSalGraphics::hitTestNativeControl( ControlType,
+sal_Bool WinSalGraphics::hitTestNativeControl( ControlType,
ControlPart,
const Rectangle&,
const Point&,
- BOOL& )
+ sal_Bool& )
{
return FALSE;
}
-BOOL ImplDrawTheme( HTHEME hTheme, HDC hDC, int iPart, int iState, RECT rc, const OUString& aStr)
+sal_Bool ImplDrawTheme( HTHEME hTheme, HDC hDC, int iPart, int iState, RECT rc, const OUString& aStr)
{
HRESULT hr = vsAPI.DrawThemeBackground( hTheme, hDC, iPart, iState, &rc, 0);
@@ -421,7 +439,7 @@ void ImplConvertSpinbuttonValues( int nControlPart, const ControlState& rState,
// ----
-BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
+sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
ControlType nType,
ControlPart nPart,
ControlState nState,
@@ -558,7 +576,7 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
if( aValue.getType() == CTRL_SPINBUTTONS )
{
const SpinbuttonValue *pValue = static_cast<const SpinbuttonValue*>(&aValue);
- BOOL bOk = FALSE;
+ sal_Bool bOk = sal_False;
RECT rect;
ImplConvertSpinbuttonValues( pValue->mnUpperPart, pValue->mnUpperState, pValue->maUpperRect, &iPart, &iState, &rect );
@@ -583,7 +601,7 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
if( aValue.getType() == CTRL_SPINBUTTONS )
{
const SpinbuttonValue *pValue = static_cast<const SpinbuttonValue*>(&aValue);
- BOOL bOk = FALSE;
+ sal_Bool bOk = sal_False;
RECT rect;
ImplConvertSpinbuttonValues( pValue->mnUpperPart, pValue->mnUpperState, pValue->maUpperRect, &iPart, &iState, &rect );
@@ -688,7 +706,7 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
if( nType == CTRL_RADIOBUTTON )
{
iPart = BP_RADIOBUTTON;
- BOOL bChecked = ( aValue.getTristateVal() == BUTTONVALUE_ON );
+ sal_Bool bChecked = ( aValue.getTristateVal() == BUTTONVALUE_ON );
if( nState & CTRL_STATE_PRESSED )
iState = bChecked ? RBS_CHECKEDPRESSED : RBS_UNCHECKEDPRESSED;
@@ -834,7 +852,7 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
if( nPart == PART_BUTTON )
{
iPart = TP_BUTTON;
- BOOL bChecked = ( aValue.getTristateVal() == BUTTONVALUE_ON );
+ sal_Bool bChecked = ( aValue.getTristateVal() == BUTTONVALUE_ON );
if( !(nState & CTRL_STATE_ENABLED) )
//iState = TS_DISABLED;
// disabled buttons are typically not painted at all but we need visual
@@ -869,15 +887,23 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
if( nType == CTRL_MENUBAR )
{
- if( nPart != PART_ENTIRE_CONTROL )
- return FALSE;
-
- if( aValue.getType() == CTRL_MENUBAR )
+ if( nPart == PART_ENTIRE_CONTROL )
{
- const MenubarValue *pValue = static_cast<const MenubarValue*>(&aValue);
- rc.bottom += pValue->maTopDockingAreaHeight; // extend potential gradient to cover docking area as well
+ if( aValue.getType() == CTRL_MENUBAR )
+ {
+ const MenubarValue *pValue = static_cast<const MenubarValue*>(&aValue);
+ rc.bottom += pValue->maTopDockingAreaHeight; // extend potential gradient to cover docking area as well
+ }
+ return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
+ }
+ else if( nPart == PART_MENU_ITEM )
+ {
+ if( (nState & CTRL_STATE_ENABLED) )
+ iState = (nState & CTRL_STATE_SELECTED) ? MBI_HOT : MBI_NORMAL;
+ else
+ iState = (nState & CTRL_STATE_SELECTED) ? MBI_DISABLEDHOT : MBI_DISABLED;
+ return ImplDrawTheme( hTheme, hDC, MENU_BARITEM, iState, rc, aCaption );
}
- return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
}
if( nType == CTRL_PROGRESS )
@@ -956,6 +982,69 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption );
}
+ if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nType == CTRL_MENU_POPUP )
+ {
+ if( nPart == PART_ENTIRE_CONTROL )
+ {
+ RECT aGutterRC = rc;
+ aGutterRC.left += aValue.getNumericVal();
+ aGutterRC.right = aGutterRC.left+3;
+ return
+ ImplDrawTheme( hTheme, hDC, MENU_POPUPBACKGROUND, 0, rc, aCaption ) &&
+ ImplDrawTheme( hTheme, hDC, MENU_POPUPGUTTER, 0, aGutterRC, aCaption )
+ ;
+ }
+ else if( nPart == PART_MENU_ITEM )
+ {
+ if( (nState & CTRL_STATE_ENABLED) )
+ iState = (nState & CTRL_STATE_SELECTED) ? MPI_HOT : MPI_NORMAL;
+ else
+ iState = (nState & CTRL_STATE_SELECTED) ? MPI_DISABLEDHOT : MPI_DISABLED;
+ return ImplDrawTheme( hTheme, hDC, MENU_POPUPITEM, iState, rc, aCaption );
+ }
+ else if( nPart == PART_MENU_ITEM_CHECK_MARK || nPart == PART_MENU_ITEM_RADIO_MARK )
+ {
+ if( (nState & CTRL_STATE_PRESSED) )
+ {
+ RECT aBGRect = rc;
+ if( aValue.getType() == CTRL_MENU_POPUP )
+ {
+ const MenupopupValue& rMVal( static_cast<const MenupopupValue&>(aValue) );
+ aBGRect.left = rMVal.maItemRect.Left();
+ aBGRect.top = rMVal.maItemRect.Top();
+ aBGRect.bottom = rMVal.maItemRect.Bottom()+1; // see below in drawNativeControl
+ aBGRect.right = rMVal.getNumericVal();
+
+ // FIXME: magic
+ aBGRect.left += 1; aBGRect.top += 1; aBGRect.bottom +=1;
+ }
+ iState = (nState & CTRL_STATE_ENABLED) ? MCB_NORMAL : MCB_DISABLED;
+ ImplDrawTheme( hTheme, hDC, MENU_POPUPCHECKBACKGROUND, iState, aBGRect, aCaption );
+ if( nPart == PART_MENU_ITEM_CHECK_MARK )
+ iState = (nState & CTRL_STATE_ENABLED) ? MC_CHECKMARKNORMAL : MC_CHECKMARKDISABLED;
+ else
+ iState = (nState & CTRL_STATE_ENABLED) ? MC_BULLETNORMAL : MC_BULLETDISABLED;
+ return ImplDrawTheme( hTheme, hDC, MENU_POPUPCHECK, iState, rc, aCaption );
+ }
+ else
+ return true; // unchecked: do nothing
+ }
+ else if( nPart == PART_MENU_SEPARATOR )
+ {
+ rc.left += aValue.getNumericVal(); // adjust for gutter position
+ Rectangle aRect( ImplGetThemeRect( hTheme, hDC,
+ MENU_POPUPSEPARATOR, 0, Rectangle( rc.left, rc.top, rc.right, rc.bottom ) ) );
+ // center the separator inside the passed rectangle
+ long nDY = ((rc.bottom - rc.top + 1) - aRect.GetHeight()) / 2;
+ rc.top += nDY;
+ rc.bottom = rc.top+aRect.GetHeight()-1;
+ return ImplDrawTheme( hTheme, hDC, MENU_POPUPSEPARATOR, 0, rc, aCaption );
+ }
+ }
+ }
+
return false;
}
@@ -968,14 +1057,14 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
* aValue: An optional value (tristate/numerical/string)
* aCaption: A caption or title string (like button text etc)
*/
-BOOL WinSalGraphics::drawNativeControl( ControlType nType,
+sal_Bool WinSalGraphics::drawNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
const OUString& aCaption )
{
- BOOL bOk = false;
+ sal_Bool bOk = false;
HTHEME hTheme = NULL;
switch( nType )
@@ -1029,6 +1118,11 @@ BOOL WinSalGraphics::drawNativeControl( ControlType nType,
case CTRL_MENUBAR:
if( nPart == PART_ENTIRE_CONTROL )
hTheme = getThemeHandle( mhWnd, L"Rebar");
+ else if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nPart == PART_MENU_ITEM )
+ hTheme = getThemeHandle( mhWnd, L"Menu" );
+ }
break;
case CTRL_PROGRESS:
if( nPart == PART_ENTIRE_CONTROL )
@@ -1042,6 +1136,16 @@ BOOL WinSalGraphics::drawNativeControl( ControlType nType,
if( nPart == PART_TRACK_HORZ_AREA || nPart == PART_TRACK_VERT_AREA )
hTheme = getThemeHandle( mhWnd, L"Trackbar" );
break;
+ case CTRL_MENU_POPUP:
+ if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nPart == PART_ENTIRE_CONTROL || nPart == PART_MENU_ITEM ||
+ nPart == PART_MENU_ITEM_CHECK_MARK || nPart == PART_MENU_ITEM_RADIO_MARK ||
+ nPart == PART_MENU_SEPARATOR
+ )
+ hTheme = getThemeHandle( mhWnd, L"Menu" );
+ }
+ break;
default:
hTheme = NULL;
break;
@@ -1085,7 +1189,7 @@ BOOL WinSalGraphics::drawNativeControl( ControlType nType,
* aValue: An optional value (tristate/numerical/string)
* aCaption: A caption or title string (like button text etc)
*/
-BOOL WinSalGraphics::drawNativeControlText( ControlType,
+sal_Bool WinSalGraphics::drawNativeControlText( ControlType,
ControlPart,
const Rectangle&,
ControlState,
@@ -1109,7 +1213,7 @@ BOOL WinSalGraphics::drawNativeControlText( ControlType,
* aValue: An optional value (tristate/numerical/string)
* aCaption: A caption or title string (like button text etc)
*/
-BOOL WinSalGraphics::getNativeControlRegion( ControlType nType,
+sal_Bool WinSalGraphics::getNativeControlRegion( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -1118,7 +1222,7 @@ BOOL WinSalGraphics::getNativeControlRegion( ControlType nType,
Rectangle &rNativeBoundingRegion,
Rectangle &rNativeContentRegion )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = FALSE;
HDC hDC = GetDC( mhWnd );
if( nType == CTRL_TOOLBAR )
@@ -1198,7 +1302,7 @@ BOOL WinSalGraphics::getNativeControlRegion( ControlType nType,
HTHEME hTheme = getThemeHandle( mhWnd, L"Edit");
if( hTheme )
{
- // get borderr size
+ // get border size
Rectangle aBoxRect( rControlRegion );
Rectangle aRect( ImplGetThemeRect( hTheme, hDC, EP_BACKGROUNDWITHBORDER,
EBWBS_HOT, aBoxRect ) );
@@ -1227,6 +1331,29 @@ BOOL WinSalGraphics::getNativeControlRegion( ControlType nType,
}
}
+ if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nType == CTRL_MENU_POPUP )
+ {
+ if( nPart == PART_MENU_ITEM_CHECK_MARK ||
+ nPart == PART_MENU_ITEM_RADIO_MARK )
+ {
+ HTHEME hTheme = getThemeHandle( mhWnd, L"Menu");
+ Rectangle aBoxRect( rControlRegion );
+ Rectangle aRect( ImplGetThemeRect( hTheme, hDC,
+ MENU_POPUPCHECK,
+ MC_CHECKMARKNORMAL,
+ aBoxRect ) );
+ if( aBoxRect.GetWidth() && aBoxRect.GetHeight() )
+ {
+ rNativeContentRegion = aRect;
+ rNativeBoundingRegion = rNativeContentRegion;
+ bRet = TRUE;
+ }
+ }
+ }
+ }
+
if( nType == CTRL_SLIDER && ( (nPart == PART_THUMB_HORZ) || (nPart == PART_THUMB_VERT) ) )
{
HTHEME hTheme = getThemeHandle( mhWnd, L"Trackbar");
diff --git a/vcl/win/source/gdi/salprn.cxx b/vcl/win/source/gdi/salprn.cxx
index 16c7439fbbdd..b233f97a15ee 100644
--- a/vcl/win/source/gdi/salprn.cxx
+++ b/vcl/win/source/gdi/salprn.cxx
@@ -94,6 +94,7 @@
#endif
+using namespace com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::ui::dialogs;
@@ -129,9 +130,9 @@ static LPDEVMODEW SAL_DEVMODE_W( const ImplJobSetup* pSetupData )
// =======================================================================
-static ULONG ImplWinQueueStatusToSal( DWORD nWinStatus )
+static sal_uLong ImplWinQueueStatusToSal( DWORD nWinStatus )
{
- ULONG nStatus = 0;
+ sal_uLong nStatus = 0;
if ( nWinStatus & PRINTER_STATUS_PAUSED )
nStatus |= QUEUE_STATUS_PAUSED;
if ( nWinStatus & PRINTER_STATUS_ERROR )
@@ -193,7 +194,7 @@ static void getPrinterQueueInfoOldStyle( ImplPrnQueueList* pList )
DWORD n;
DWORD nBytes = 0;
DWORD nInfoPrn2;
- BOOL bFound = FALSE;
+ sal_Bool bFound = FALSE;
PRINTER_INFO_2* pWinInfo2 = NULL;
PRINTER_INFO_2* pGetInfo2;
EnumPrintersA( PRINTER_ENUM_LOCAL, NULL, 2, NULL, 0, &nBytes, &nInfoPrn2 );
@@ -263,7 +264,7 @@ static void getPrinterQueueInfoOldStyle( ImplPrnQueueList* pList )
pTmp = pPortName;
while ( *pTmp != ',' )
pTmp++;
- XubString aDriver( ImplSalGetUniString( pPortName, (USHORT)(pTmp-pPortName) ) );
+ XubString aDriver( ImplSalGetUniString( pPortName, (sal_uInt16)(pTmp-pPortName) ) );
pPortName = pTmp;
// get port names
@@ -274,11 +275,11 @@ static void getPrinterQueueInfoOldStyle( ImplPrnQueueList* pList )
while ( *pTmp && (*pTmp != ',') )
pTmp++;
- String aPortName( ImplSalGetUniString( pPortName, (USHORT)(pTmp-pPortName) ) );
+ String aPortName( ImplSalGetUniString( pPortName, (sal_uInt16)(pTmp-pPortName) ) );
// create new entry
// look up if printer was already found in first loop
- BOOL bAdd = TRUE;
+ sal_Bool bAdd = TRUE;
if ( pWinInfo2 )
{
pGetInfo2 = pWinInfo2;
@@ -447,7 +448,7 @@ void WinSalInstance::DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo )
XubString WinSalInstance::GetDefaultPrinter()
{
static bool bGetDefPrtAPI = true;
- static BOOL(WINAPI*pGetDefaultPrinter)(LPWSTR,LPDWORD) = NULL;
+ static sal_Bool(WINAPI*pGetDefaultPrinter)(LPWSTR,LPDWORD) = NULL;
// try to use GetDefaultPrinter API (not available prior to W2000)
if( bGetDefPrtAPI )
{
@@ -464,7 +465,7 @@ XubString WinSalInstance::GetDefaultPrinter()
pFunc = osl_getFunctionSymbol( pLib, queryFuncName.pData );
}
- pGetDefaultPrinter = (BOOL(WINAPI*)(LPWSTR,LPDWORD)) pFunc;
+ pGetDefaultPrinter = (sal_Bool(WINAPI*)(LPWSTR,LPDWORD)) pFunc;
}
}
if( pGetDefaultPrinter )
@@ -534,8 +535,8 @@ static DWORD ImplDeviceCaps( WinSalInfoPrinter* pPrinter, WORD nCaps,
// -----------------------------------------------------------------------
-static BOOL ImplTestSalJobSetup( WinSalInfoPrinter* pPrinter,
- ImplJobSetup* pSetupData, BOOL bDelete )
+static sal_Bool ImplTestSalJobSetup( WinSalInfoPrinter* pPrinter,
+ ImplJobSetup* pSetupData, sal_Bool bDelete )
{
if ( pSetupData && pSetupData->mpDriverData )
{
@@ -659,8 +660,8 @@ static BOOL ImplTestSalJobSetup( WinSalInfoPrinter* pPrinter,
// -----------------------------------------------------------------------
-static BOOL ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData,
- BOOL bIn, WinSalFrame* pVisibleDlgParent )
+static sal_Bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData,
+ sal_Bool bIn, WinSalFrame* pVisibleDlgParent )
{
ByteString aPrinterNameA = ImplSalGetWinAnsiString( pPrinter->maDeviceName, TRUE );
HANDLE hPrn;
@@ -683,7 +684,7 @@ static BOOL ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
LONG nSysJobSize = -1;
HWND hWnd = 0;
DWORD nMode = DM_OUT_BUFFER;
- ULONG nDriverDataLen = 0;
+ sal_uLong nDriverDataLen = 0;
SalDriverData* pOutBuffer = NULL;
BYTE* pInBuffer = NULL;
@@ -709,7 +710,7 @@ static BOOL ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
pOutBuffer->mnSysSignature = SAL_DRIVERDATA_SYSSIGN;
pOutBuffer->mnVersion = aSalShlData.mbWPrinter ? SAL_DRIVERDATA_VERSION_W : SAL_DRIVERDATA_VERSION_A;
// calculate driver data offset including structure padding
- pOutBuffer->mnDriverOffset = sal::static_int_cast<USHORT>(
+ pOutBuffer->mnDriverOffset = sal::static_int_cast<sal_uInt16>(
(char*)pOutBuffer->maDriverData -
(char*)pOutBuffer );
@@ -728,7 +729,7 @@ static BOOL ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
}
// Release mutex, in the other case we don't get paints and so on
- ULONG nMutexCount=0;
+ sal_uLong nMutexCount=0;
if ( pVisibleDlgParent )
nMutexCount = ImplSalReleaseYieldMutex();
@@ -808,7 +809,7 @@ static BOOL ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
#define CHOOSE_DEVMODE(i)\
(pDevModeW ? pDevModeW->i : pDevModeA->i)
-static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData, ULONG nFlags )
+static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData, sal_uLong nFlags )
{
if ( !pSetupData || !pSetupData->mpDriverData )
return;
@@ -827,7 +828,7 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
// PaperBin
if ( nFlags & SAL_JOBSET_PAPERBIN )
{
- ULONG nCount = ImplDeviceCaps( pPrinter, DC_BINS, NULL, pSetupData );
+ sal_uLong nCount = ImplDeviceCaps( pPrinter, DC_BINS, NULL, pSetupData );
if ( nCount && (nCount != GDI_ERROR) )
{
@@ -836,11 +837,11 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
pSetupData->mnPaperBin = 0;
// search the right bin and assign index to mnPaperBin
- for( ULONG i = 0; i < nCount; i++ )
+ for( sal_uLong i = 0; i < nCount; i++ )
{
if( CHOOSE_DEVMODE(dmDefaultSource) == pBins[ i ] )
{
- pSetupData->mnPaperBin = (USHORT)i;
+ pSetupData->mnPaperBin = (sal_uInt16)i;
break;
}
}
@@ -859,9 +860,9 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
}
else
{
- ULONG nPaperCount = ImplDeviceCaps( pPrinter, DC_PAPERS, NULL, pSetupData );
+ sal_uLong nPaperCount = ImplDeviceCaps( pPrinter, DC_PAPERS, NULL, pSetupData );
WORD* pPapers = NULL;
- ULONG nPaperSizeCount = ImplDeviceCaps( pPrinter, DC_PAPERSIZE, NULL, pSetupData );
+ sal_uLong nPaperSizeCount = ImplDeviceCaps( pPrinter, DC_PAPERSIZE, NULL, pSetupData );
POINT* pPaperSizes = NULL;
if ( nPaperCount && (nPaperCount != GDI_ERROR) )
{
@@ -875,7 +876,7 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
}
if( nPaperSizeCount == nPaperCount && pPaperSizes && pPapers )
{
- for( ULONG i = 0; i < nPaperCount; i++ )
+ for( sal_uLong i = 0; i < nPaperCount; i++ )
{
if( pPapers[ i ] == CHOOSE_DEVMODE(dmPaperSize) )
{
@@ -1076,7 +1077,7 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
// -----------------------------------------------------------------------
-static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData, ULONG nFlags )
+static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData, sal_uLong nFlags )
{
if ( !pSetupData || !pSetupData->mpDriverData )
return;
@@ -1096,7 +1097,7 @@ static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
// PaperBin
if ( nFlags & SAL_JOBSET_PAPERBIN )
{
- ULONG nCount = ImplDeviceCaps( pPrinter, DC_BINS, NULL, pSetupData );
+ sal_uLong nCount = ImplDeviceCaps( pPrinter, DC_BINS, NULL, pSetupData );
if ( nCount && (nCount != GDI_ERROR) )
{
@@ -1274,9 +1275,9 @@ static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
default:
{
short nPaper = 0;
- ULONG nPaperCount = ImplDeviceCaps( pPrinter, DC_PAPERS, NULL, pSetupData );
+ sal_uLong nPaperCount = ImplDeviceCaps( pPrinter, DC_PAPERS, NULL, pSetupData );
WORD* pPapers = NULL;
- ULONG nPaperSizeCount = ImplDeviceCaps( pPrinter, DC_PAPERSIZE, NULL, pSetupData );
+ sal_uLong nPaperSizeCount = ImplDeviceCaps( pPrinter, DC_PAPERSIZE, NULL, pSetupData );
POINT* pPaperSizes = NULL;
DWORD nLandscapeAngle = ImplDeviceCaps( pPrinter, DC_ORIENTATION, NULL, pSetupData );
if ( nPaperCount && (nPaperCount != GDI_ERROR) )
@@ -1293,7 +1294,7 @@ static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
{
PaperInfo aInfo(pSetupData->mnPaperWidth, pSetupData->mnPaperHeight);
// compare paper formats and select a good match
- for ( ULONG i = 0; i < nPaperCount; i++ )
+ for ( sal_uLong i = 0; i < nPaperCount; i++ )
{
if ( aInfo.sloppyEqual(PaperInfo(pPaperSizes[i].x*10, pPaperSizes[i].y*10)))
{
@@ -1308,7 +1309,7 @@ static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
if ( !nPaper && nLandscapeAngle != 0 )
{
PaperInfo aRotatedInfo(pSetupData->mnPaperHeight, pSetupData->mnPaperWidth);
- for ( ULONG i = 0; i < nPaperCount; i++ )
+ for ( sal_uLong i = 0; i < nPaperCount; i++ )
{
if ( aRotatedInfo.sloppyEqual(PaperInfo(pPaperSizes[i].x*10, pPaperSizes[i].y*10)) )
{
@@ -1464,7 +1465,7 @@ static WinSalGraphics* ImplCreateSalPrnGraphics( HDC hDC )
// -----------------------------------------------------------------------
-static BOOL ImplUpdateSalPrnIC( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData )
+static sal_Bool ImplUpdateSalPrnIC( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData )
{
HDC hNewDC = ImplCreateSalPrnIC( pPrinter, pSetupData );
if ( !hNewDC )
@@ -1624,7 +1625,7 @@ void WinSalInfoPrinter::ReleaseGraphics( SalGraphics* )
// -----------------------------------------------------------------------
-BOOL WinSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pSetupData )
+sal_Bool WinSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pSetupData )
{
if ( ImplUpdateSalJobSetup( this, pSetupData, TRUE, static_cast<WinSalFrame*>(pFrame) ) )
{
@@ -1637,7 +1638,7 @@ BOOL WinSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pSetupData )
// -----------------------------------------------------------------------
-BOOL WinSalInfoPrinter::SetPrinterData( ImplJobSetup* pSetupData )
+sal_Bool WinSalInfoPrinter::SetPrinterData( ImplJobSetup* pSetupData )
{
if ( !ImplTestSalJobSetup( this, pSetupData, FALSE ) )
return FALSE;
@@ -1646,7 +1647,7 @@ BOOL WinSalInfoPrinter::SetPrinterData( ImplJobSetup* pSetupData )
// -----------------------------------------------------------------------
-BOOL WinSalInfoPrinter::SetData( ULONG nFlags, ImplJobSetup* pSetupData )
+sal_Bool WinSalInfoPrinter::SetData( sal_uLong nFlags, ImplJobSetup* pSetupData )
{
ImplJobSetupToDevMode( this, pSetupData, nFlags );
if ( ImplUpdateSalJobSetup( this, pSetupData, TRUE, NULL ) )
@@ -1660,7 +1661,7 @@ BOOL WinSalInfoPrinter::SetData( ULONG nFlags, ImplJobSetup* pSetupData )
// -----------------------------------------------------------------------
-ULONG WinSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pSetupData )
+sal_uLong WinSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pSetupData )
{
DWORD nRet = ImplDeviceCaps( this, DC_BINS, NULL, pSetupData );
if ( nRet && (nRet != GDI_ERROR) )
@@ -1671,7 +1672,7 @@ ULONG WinSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pSetupData )
// -----------------------------------------------------------------------
-XubString WinSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pSetupData, ULONG nPaperBin )
+XubString WinSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pSetupData, sal_uLong nPaperBin )
{
XubString aPaperBinName;
@@ -1701,7 +1702,7 @@ XubString WinSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pSetupData, UL
// -----------------------------------------------------------------------
-ULONG WinSalInfoPrinter::GetCapabilities( const ImplJobSetup* pSetupData, USHORT nType )
+sal_uLong WinSalInfoPrinter::GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType )
{
DWORD nRet;
@@ -1783,11 +1784,11 @@ void WinSalInstance::DestroyPrinter( SalPrinter* pPrinter )
// =======================================================================
-WIN_BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ )
+BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ )
{
SalData* pSalData = GetSalData();
WinSalPrinter* pPrinter;
- BOOL bWhile = TRUE;
+ sal_Bool bWhile = TRUE;
int i = 0;
do
@@ -1796,8 +1797,11 @@ WIN_BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ )
MSG aMsg;
if ( ImplPeekMessage( &aMsg, 0, 0, 0, PM_REMOVE ) )
{
- TranslateMessage( &aMsg );
- ImplDispatchMessage( &aMsg );
+ if ( !ImplInterceptChildWindowKeyDown( aMsg ) )
+ {
+ TranslateMessage( &aMsg );
+ ImplDispatchMessage( &aMsg );
+ }
i++;
if ( i > 15 )
bWhile = FALSE;
@@ -1824,19 +1828,19 @@ WIN_BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ )
// -----------------------------------------------------------------------
-static LPDEVMODEA ImplSalSetCopies( LPDEVMODEA pDevMode, ULONG nCopies, BOOL bCollate )
+static LPDEVMODEA ImplSalSetCopies( LPDEVMODEA pDevMode, sal_uLong nCopies, sal_Bool bCollate )
{
LPDEVMODEA pNewDevMode = pDevMode;
if ( pDevMode && (nCopies > 1) )
{
if ( nCopies > 32765 )
nCopies = 32765;
- ULONG nDevSize = pDevMode->dmSize+pDevMode->dmDriverExtra;
+ sal_uLong nDevSize = pDevMode->dmSize+pDevMode->dmDriverExtra;
pNewDevMode = (LPDEVMODEA)rtl_allocateMemory( nDevSize );
memcpy( pNewDevMode, pDevMode, nDevSize );
pDevMode = pNewDevMode;
pDevMode->dmFields |= DM_COPIES;
- pDevMode->dmCopies = (short)(USHORT)nCopies;
+ pDevMode->dmCopies = (short)(sal_uInt16)nCopies;
pDevMode->dmFields |= DM_COLLATE;
if ( bCollate )
pDevMode->dmCollate = DMCOLLATE_TRUE;
@@ -1847,19 +1851,19 @@ static LPDEVMODEA ImplSalSetCopies( LPDEVMODEA pDevMode, ULONG nCopies, BOOL bCo
return pNewDevMode;
}
-static LPDEVMODEW ImplSalSetCopies( LPDEVMODEW pDevMode, ULONG nCopies, BOOL bCollate )
+static LPDEVMODEW ImplSalSetCopies( LPDEVMODEW pDevMode, sal_uLong nCopies, sal_Bool bCollate )
{
LPDEVMODEW pNewDevMode = pDevMode;
if ( pDevMode && (nCopies > 1) )
{
if ( nCopies > 32765 )
nCopies = 32765;
- ULONG nDevSize = pDevMode->dmSize+pDevMode->dmDriverExtra;
+ sal_uLong nDevSize = pDevMode->dmSize+pDevMode->dmDriverExtra;
pNewDevMode = (LPDEVMODEW)rtl_allocateMemory( nDevSize );
memcpy( pNewDevMode, pDevMode, nDevSize );
pDevMode = pNewDevMode;
pDevMode->dmFields |= DM_COPIES;
- pDevMode->dmCopies = (short)(USHORT)nCopies;
+ pDevMode->dmCopies = (short)(sal_uInt16)nCopies;
pDevMode->dmFields |= DM_COLLATE;
if ( bCollate )
pDevMode->dmCollate = DMCOLLATE_TRUE;
@@ -1952,10 +1956,10 @@ static int lcl_StartDocA( HDC hDC, DOCINFOA* pInfo, WinSalPrinter* pPrt )
return nRet;
}
-BOOL WinSalPrinter::StartJob( const XubString* pFileName,
+sal_Bool WinSalPrinter::StartJob( const XubString* pFileName,
const XubString& rJobName,
const XubString&,
- ULONG nCopies,
+ sal_uLong nCopies,
bool bCollate,
bool /*bDirect*/,
ImplJobSetup* pSetupData )
@@ -2044,7 +2048,7 @@ BOOL WinSalPrinter::StartJob( const XubString* pFileName,
// Wegen Telocom Balloon Fax-Treiber, der uns unsere Messages
// ansonsten oefters schickt, versuchen wir vorher alle
// zu verarbeiten und dann eine Dummy-Message reinstellen
- BOOL bWhile = TRUE;
+ sal_Bool bWhile = TRUE;
int i = 0;
do
{
@@ -2052,8 +2056,12 @@ BOOL WinSalPrinter::StartJob( const XubString* pFileName,
MSG aMsg;
if ( ImplPeekMessage( &aMsg, 0, 0, 0, PM_REMOVE ) )
{
- TranslateMessage( &aMsg );
- ImplDispatchMessage( &aMsg );
+ if ( !ImplInterceptChildWindowKeyDown( aMsg ) )
+ {
+ TranslateMessage( &aMsg );
+ ImplDispatchMessage( &aMsg );
+ }
+
i++;
if ( i > 15 )
bWhile = FALSE;
@@ -2069,16 +2077,16 @@ BOOL WinSalPrinter::StartJob( const XubString* pFileName,
if( mpInfoPrinter->maPortName.EqualsIgnoreCaseAscii( "FILE:" ) && !(pFileName && pFileName->Len()) )
{
- Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
+ uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
if( xFactory.is() )
{
- Reference< XFilePicker > xFilePicker( xFactory->createInstance(
+ uno::Reference< XFilePicker > xFilePicker( xFactory->createInstance(
OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) ) ),
UNO_QUERY );
DBG_ASSERT( xFilePicker.is(), "could not get FilePicker service" );
- Reference< XInitialization > xInit( xFilePicker, UNO_QUERY );
- Reference< XFilterManager > xFilterMgr( xFilePicker, UNO_QUERY );
+ uno::Reference< XInitialization > xInit( xFilePicker, UNO_QUERY );
+ uno::Reference< XFilterManager > xFilterMgr( xFilePicker, UNO_QUERY );
if( xInit.is() && xFilePicker.is() && xFilterMgr.is() )
{
Sequence< Any > aServiceType( 1 );
@@ -2172,7 +2180,7 @@ BOOL WinSalPrinter::StartJob( const XubString* pFileName,
// -----------------------------------------------------------------------
-BOOL WinSalPrinter::EndJob()
+sal_Bool WinSalPrinter::EndJob()
{
DWORD err = 0;
HDC hDC = mhDC;
@@ -2192,7 +2200,7 @@ BOOL WinSalPrinter::EndJob()
// call, however the real solution is supposed to be the threading
// framework yet to come.
SalData* pSalData = GetSalData();
- ULONG nAcquire = pSalData->mpFirstInstance->ReleaseYieldMutex();
+ sal_uLong nAcquire = pSalData->mpFirstInstance->ReleaseYieldMutex();
CATCH_DRIVER_EX_BEGIN;
if( ::EndDoc( hDC ) <= 0 )
err = GetLastError();
@@ -2208,7 +2216,7 @@ BOOL WinSalPrinter::EndJob()
// -----------------------------------------------------------------------
-BOOL WinSalPrinter::AbortJob()
+sal_Bool WinSalPrinter::AbortJob()
{
mbAbort = TRUE;
@@ -2265,7 +2273,7 @@ void ImplSalPrinterAbortJobAsync( HDC hPrnDC )
// -----------------------------------------------------------------------
-SalGraphics* WinSalPrinter::StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData )
+SalGraphics* WinSalPrinter::StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData )
{
if( ! isValid() || mhDC == 0 )
return NULL;
@@ -2320,7 +2328,7 @@ SalGraphics* WinSalPrinter::StartPage( ImplJobSetup* pSetupData, BOOL bNewJobDat
// -----------------------------------------------------------------------
-BOOL WinSalPrinter::EndPage()
+sal_Bool WinSalPrinter::EndPage()
{
HDC hDC = mhDC;
if ( hDC && mpGraphics )
@@ -2350,7 +2358,7 @@ BOOL WinSalPrinter::EndPage()
// -----------------------------------------------------------------------
-ULONG WinSalPrinter::GetErrorCode()
+sal_uLong WinSalPrinter::GetErrorCode()
{
return mnError;
}
diff --git a/vcl/win/source/gdi/salvd.cxx b/vcl/win/source/gdi/salvd.cxx
index a076409aa0ea..40b13dc9bf17 100644
--- a/vcl/win/source/gdi/salvd.cxx
+++ b/vcl/win/source/gdi/salvd.cxx
@@ -39,7 +39,7 @@
// =======================================================================
static HBITMAP ImplCreateVirDevBitmap( HDC hDC, long nDX, long nDY,
- USHORT nBitCount )
+ sal_uInt16 nBitCount )
{
HBITMAP hBitmap;
@@ -79,14 +79,14 @@ static HBITMAP ImplCreateVirDevBitmap( HDC hDC, long nDX, long nDY,
SalVirtualDevice* WinSalInstance::CreateVirtualDevice( SalGraphics* pSGraphics,
long nDX, long nDY,
- USHORT nBitCount,
+ sal_uInt16 nBitCount,
const SystemGraphicsData* pData )
{
WinSalGraphics* pGraphics = static_cast<WinSalGraphics*>(pSGraphics);
HDC hDC = NULL;
HBITMAP hBmp = NULL;
- BOOL bOk = FALSE;
+ sal_Bool bOk = FALSE;
if( pData )
{
@@ -227,7 +227,7 @@ void WinSalVirtualDevice::ReleaseGraphics( SalGraphics* )
// -----------------------------------------------------------------------
-BOOL WinSalVirtualDevice::SetSize( long nDX, long nDY )
+sal_Bool WinSalVirtualDevice::SetSize( long nDX, long nDY )
{
if( mbForeignDC || !mhBmp )
return TRUE; // ???
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index d0d71d4d100c..1c47b21d550d 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -58,11 +58,9 @@
#define USE_UNISCRIBE
#ifdef USE_UNISCRIBE
-#define ULONG WIN_ULONG
#include <Usp10.h>
#include <ShLwApi.h>
#include <winver.h>
-#undef ULONG
#endif // USE_UNISCRIBE
#include <boost/unordered_map.hpp>
@@ -245,13 +243,11 @@ HFONT WinLayout::DisableFontScaling() const
if( mfFontScale == 1.0 )
return 0;
- HFONT hHugeFont = 0;
LOGFONTW aLogFont;
::GetObjectW( mhFont, sizeof(LOGFONTW), &aLogFont);
aLogFont.lfHeight = (LONG)(mfFontScale * aLogFont.lfHeight);
aLogFont.lfWidth = (LONG)(mfFontScale * aLogFont.lfWidth);
- hHugeFont = ::CreateFontIndirectW( &aLogFont);
-
+ HFONT hHugeFont = ::CreateFontIndirectW( &aLogFont);
if( !hHugeFont )
return 0;
@@ -661,57 +657,31 @@ void SimpleWinLayout::DrawText( SalGraphics& rGraphics ) const
Point aPos = GetDrawPosition( Point( mnBaseAdv, 0 ) );
- // #108267#, limit the number of glyphs to avoid paint errors
- UINT limitedGlyphCount = Min( 8192, mnGlyphCount );
- if( mnDrawOptions )
- {
- // #108267#, break up into glyph portions of a limited size required by Win32 API
- const unsigned int maxGlyphCount = 8192;
- UINT numGlyphPortions = mnGlyphCount / maxGlyphCount;
- UINT remainingGlyphs = mnGlyphCount % maxGlyphCount;
-
- if( numGlyphPortions )
- {
- // #108267#,#109387# break up string into smaller chunks
- // the output positions will be updated by windows (SetTextAlign)
- unsigned int i,n;
- POINT oldPos;
- UINT oldTa = ::GetTextAlign( aHDC );
- ::SetTextAlign( aHDC, (oldTa & ~TA_NOUPDATECP) | TA_UPDATECP );
- ::MoveToEx( aHDC, aPos.X(), aPos.Y(), &oldPos );
- for( i=n=0; n<numGlyphPortions; n++, i+=maxGlyphCount )
- ::ExtTextOutW( aHDC, 0, 0, mnDrawOptions, NULL,
- mpOutGlyphs+i, maxGlyphCount, mpGlyphAdvances+i );
+ // #108267#, break up into glyph portions of a limited size required by Win32 API
+ const unsigned int maxGlyphCount = 8192;
+ UINT numGlyphPortions = mnGlyphCount / maxGlyphCount;
+ UINT remainingGlyphs = mnGlyphCount % maxGlyphCount;
+
+ if( numGlyphPortions )
+ {
+ // #108267#,#109387# break up string into smaller chunks
+ // the output positions will be updated by windows (SetTextAlign)
+ POINT oldPos;
+ UINT oldTa = ::GetTextAlign( aHDC );
+ ::SetTextAlign( aHDC, (oldTa & ~TA_NOUPDATECP) | TA_UPDATECP );
+ ::MoveToEx( aHDC, aPos.X(), aPos.Y(), &oldPos );
+ unsigned int i = 0;
+ for( unsigned int n = 0; n < numGlyphPortions; ++n, i+=maxGlyphCount )
::ExtTextOutW( aHDC, 0, 0, mnDrawOptions, NULL,
- mpOutGlyphs+i, remainingGlyphs, mpGlyphAdvances+i );
- ::MoveToEx( aHDC, oldPos.x, oldPos.y, (LPPOINT) NULL);
- ::SetTextAlign( aHDC, oldTa );
- }
- else
- ::ExtTextOutW( aHDC, aPos.X(), aPos.Y(), mnDrawOptions, NULL,
- mpOutGlyphs, mnGlyphCount, mpGlyphAdvances );
+ mpOutGlyphs+i, maxGlyphCount, mpGlyphAdvances+i );
+ ::ExtTextOutW( aHDC, 0, 0, mnDrawOptions, NULL,
+ mpOutGlyphs+i, remainingGlyphs, mpGlyphAdvances+i );
+ ::MoveToEx( aHDC, oldPos.x, oldPos.y, (LPPOINT) NULL);
+ ::SetTextAlign( aHDC, oldTa );
}
else
- {
- // #108267#, On Win9x, we get paint errors when drawing huge strings, even when
- // split into pieces (see above), seems to be a problem in the internal text clipping
- // so we just cut off the string
- if( !mpGlyphOrigAdvs )
- ::ExtTextOutW( aHDC, aPos.X(), aPos.Y(), 0, NULL,
- mpOutGlyphs, limitedGlyphCount, NULL );
- else
- {
- // workaround for problem in #106259#
- long nXPos = mnBaseAdv;
- for( unsigned int i = 0; i < limitedGlyphCount; ++i )
- {
- ::ExtTextOutW( aHDC, aPos.X(), aPos.Y(), 0, NULL,
- mpOutGlyphs+i, 1, NULL );
- nXPos += mpGlyphAdvances[ i ];
- aPos = GetDrawPosition( Point( nXPos, 0 ) );
- }
- }
- }
+ ::ExtTextOutW( aHDC, aPos.X(), aPos.Y(), mnDrawOptions, NULL,
+ mpOutGlyphs, mnGlyphCount, mpGlyphAdvances );
if( hOrigFont )
DeleteFont( SelectFont( aHDC, hOrigFont ) );
@@ -1240,7 +1210,7 @@ static bool InitUSP()
DWORD nHandle;
DWORD nBufSize = ::GetFileVersionInfoSizeW( const_cast<LPWSTR>(reinterpret_cast<LPCWSTR>(pModuleFileCStr)), &nHandle );
char* pBuffer = (char*)alloca( nBufSize );
- WIN_BOOL bRC = ::GetFileVersionInfoW( const_cast<LPWSTR>(reinterpret_cast<LPCWSTR>(pModuleFileCStr)), nHandle, nBufSize, pBuffer );
+ BOOL bRC = ::GetFileVersionInfoW( const_cast<LPWSTR>(reinterpret_cast<LPCWSTR>(pModuleFileCStr)), nHandle, nBufSize, pBuffer );
VS_FIXEDFILEINFO* pFixedFileInfo = NULL;
UINT nFixedFileSize = 0;
if( bRC )
@@ -2061,6 +2031,13 @@ void UniscribeLayout::MoveGlyph( int nStartx8, long nNewXPos )
// move the visual item by having an offset
pVI->mnXOffset += nDelta;
}
+ // move subsequent items - this often isn't necessary because subsequent
+ // moves will correct subsequent items. However, if there is a contiguous
+ // range not involving fallback which spans items, this will be needed
+ while (++pVI - mpVisualItems < mnItemCount)
+ {
+ pVI->mnXOffset += nDelta;
+ }
}
// -----------------------------------------------------------------------
@@ -2341,6 +2318,10 @@ void UniscribeLayout::GetCaretPositions( int nMaxIdx, long* pCaretXArray ) const
if( rVisualItem.IsEmpty() )
continue;
+ if (mnLayoutFlags & SAL_LAYOUT_FOR_FALLBACK)
+ {
+ nXPos = rVisualItem.mnXOffset;
+ }
// get glyph positions
// TODO: handle when rVisualItem's glyph range is only partially used
for( i = rVisualItem.mnMinGlyphPos; i < rVisualItem.mnEndGlyphPos; ++i )
@@ -2374,13 +2355,17 @@ void UniscribeLayout::GetCaretPositions( int nMaxIdx, long* pCaretXArray ) const
}
}
- // fixup unknown character positions to neighbor
- for( i = 0; i < nMaxIdx; ++i )
+ if (!(mnLayoutFlags & SAL_LAYOUT_FOR_FALLBACK))
{
- if( pCaretXArray[ i ] >= 0 )
- nXPos = pCaretXArray[ i ];
- else
- pCaretXArray[ i ] = nXPos;
+ nXPos = 0;
+ // fixup unknown character positions to neighbor
+ for( i = 0; i < nMaxIdx; ++i )
+ {
+ if( pCaretXArray[ i ] >= 0 )
+ nXPos = pCaretXArray[ i ];
+ else
+ pCaretXArray[ i ] = nXPos;
+ }
}
}
diff --git a/vcl/win/source/src/ase.cur b/vcl/win/source/src/ase.cur
index 7634a7d34a7b..7634a7d34a7b 100755..100644
--- a/vcl/win/source/src/ase.cur
+++ b/vcl/win/source/src/ase.cur
Binary files differ
diff --git a/vcl/win/source/src/asn.cur b/vcl/win/source/src/asn.cur
index e444e42bf37e..e444e42bf37e 100755..100644
--- a/vcl/win/source/src/asn.cur
+++ b/vcl/win/source/src/asn.cur
Binary files differ
diff --git a/vcl/win/source/src/asne.cur b/vcl/win/source/src/asne.cur
index e92cc65e7eb1..e92cc65e7eb1 100755..100644
--- a/vcl/win/source/src/asne.cur
+++ b/vcl/win/source/src/asne.cur
Binary files differ
diff --git a/vcl/win/source/src/asns.cur b/vcl/win/source/src/asns.cur
index 04d0b09c353e..04d0b09c353e 100755..100644
--- a/vcl/win/source/src/asns.cur
+++ b/vcl/win/source/src/asns.cur
Binary files differ
diff --git a/vcl/win/source/src/asnswe.cur b/vcl/win/source/src/asnswe.cur
index a0e25b16de1f..a0e25b16de1f 100755..100644
--- a/vcl/win/source/src/asnswe.cur
+++ b/vcl/win/source/src/asnswe.cur
Binary files differ
diff --git a/vcl/win/source/src/asnw.cur b/vcl/win/source/src/asnw.cur
index 20322bc97b16..20322bc97b16 100755..100644
--- a/vcl/win/source/src/asnw.cur
+++ b/vcl/win/source/src/asnw.cur
Binary files differ
diff --git a/vcl/win/source/src/ass.cur b/vcl/win/source/src/ass.cur
index 7166636a1a77..7166636a1a77 100755..100644
--- a/vcl/win/source/src/ass.cur
+++ b/vcl/win/source/src/ass.cur
Binary files differ
diff --git a/vcl/win/source/src/asse.cur b/vcl/win/source/src/asse.cur
index 8cb71234b0a9..8cb71234b0a9 100755..100644
--- a/vcl/win/source/src/asse.cur
+++ b/vcl/win/source/src/asse.cur
Binary files differ
diff --git a/vcl/win/source/src/assw.cur b/vcl/win/source/src/assw.cur
index fddaf3f57cbf..fddaf3f57cbf 100755..100644
--- a/vcl/win/source/src/assw.cur
+++ b/vcl/win/source/src/assw.cur
Binary files differ
diff --git a/vcl/win/source/src/asw.cur b/vcl/win/source/src/asw.cur
index 0ccac50f4596..0ccac50f4596 100755..100644
--- a/vcl/win/source/src/asw.cur
+++ b/vcl/win/source/src/asw.cur
Binary files differ
diff --git a/vcl/win/source/src/aswe.cur b/vcl/win/source/src/aswe.cur
index c238b7e10aef..c238b7e10aef 100755..100644
--- a/vcl/win/source/src/aswe.cur
+++ b/vcl/win/source/src/aswe.cur
Binary files differ
diff --git a/vcl/win/source/src/chain.cur b/vcl/win/source/src/chain.cur
index 02abb7ab714f..02abb7ab714f 100755..100644
--- a/vcl/win/source/src/chain.cur
+++ b/vcl/win/source/src/chain.cur
Binary files differ
diff --git a/vcl/win/source/src/chainnot.cur b/vcl/win/source/src/chainnot.cur
index 938ece03f329..938ece03f329 100755..100644
--- a/vcl/win/source/src/chainnot.cur
+++ b/vcl/win/source/src/chainnot.cur
Binary files differ
diff --git a/vcl/win/source/src/timemove.cur b/vcl/win/source/src/timemove.cur
index 319b6edc5774..319b6edc5774 100755..100644
--- a/vcl/win/source/src/timemove.cur
+++ b/vcl/win/source/src/timemove.cur
Binary files differ
diff --git a/vcl/win/source/src/timesize.cur b/vcl/win/source/src/timesize.cur
index 1ec23de05b71..1ec23de05b71 100755..100644
--- a/vcl/win/source/src/timesize.cur
+++ b/vcl/win/source/src/timesize.cur
Binary files differ
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index 4548427addef..15be14eac5be 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -96,6 +96,7 @@ using ::std::max;
#include <time.h>
using ::rtl::OUString;
+using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
@@ -120,8 +121,8 @@ void MyOutputDebugString( char *s) { OutputDebugString( s ); }
// misssing prototypes and constants for LayeredWindows
extern "C" {
- //WINUSERAPI BOOL WINAPI SetLayeredWindowAttributes(HWND,COLORREF,BYTE,DWORD);
- typedef BOOL ( WINAPI * SetLayeredWindowAttributes_Proc_T ) (HWND,COLORREF,BYTE,DWORD);
+ //WINUSERAPI sal_Bool WINAPI SetLayeredWindowAttributes(HWND,COLORREF,BYTE,DWORD);
+ typedef sal_Bool ( WINAPI * SetLayeredWindowAttributes_Proc_T ) (HWND,COLORREF,BYTE,DWORD);
static SetLayeredWindowAttributes_Proc_T lpfnSetLayeredWindowAttributes;
};
@@ -129,7 +130,7 @@ extern "C" {
const unsigned int WM_USER_SYSTEM_WINDOW_ACTIVATED = RegisterWindowMessageA("SYSTEM_WINDOW_ACTIVATED");
-BOOL WinSalFrame::mbInReparent = FALSE;
+sal_Bool WinSalFrame::mbInReparent = FALSE;
// =======================================================================
@@ -160,7 +161,7 @@ static void ImplSaveFrameState( WinSalFrame* pFrame )
// Position, Groesse und Status fuer GetWindowState() merken
if ( !pFrame->mbFullScreen )
{
- BOOL bVisible = (GetWindowStyle( pFrame->mhWnd ) & WS_VISIBLE) != 0;
+ sal_Bool bVisible = (GetWindowStyle( pFrame->mhWnd ) & WS_VISIBLE) != 0;
if ( IsIconic( pFrame->mhWnd ) )
{
pFrame->maState.mnState |= SAL_FRAMESTATE_MINIMIZED;
@@ -344,13 +345,13 @@ void ImplSalGetWorkArea( HWND hWnd, RECT *pRect, const RECT *pParentRect )
// =======================================================================
SalFrame* ImplSalCreateFrame( WinSalInstance* pInst,
- HWND hWndParent, ULONG nSalFrameStyle )
+ HWND hWndParent, sal_uLong nSalFrameStyle )
{
WinSalFrame* pFrame = new WinSalFrame;
HWND hWnd;
DWORD nSysStyle = 0;
DWORD nExSysStyle = 0;
- BOOL bSubFrame = FALSE;
+ sal_Bool bSubFrame = FALSE;
if( getenv( "SAL_SYNCHRONIZE" ) ) // no buffering of drawing commands
GdiSetBatchLimit( 1 );
@@ -583,11 +584,11 @@ SalFrame* ImplSalCreateFrame( WinSalInstance* pInst,
// helper that only creates the HWND
// to allow for easy reparenting of system windows, (i.e. destroy and create new)
-HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, BOOL bAsChild )
+HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, sal_Bool bAsChild )
{
HINSTANCE hInstance = GetSalData()->mhInst;
- ULONG nSysStyle = GetWindowLong( oldhWnd, GWL_STYLE );
- ULONG nExSysStyle = GetWindowLong( oldhWnd, GWL_EXSTYLE );
+ sal_uLong nSysStyle = GetWindowLong( oldhWnd, GWL_STYLE );
+ sal_uLong nExSysStyle = GetWindowLong( oldhWnd, GWL_EXSTYLE );
if( bAsChild )
{
@@ -606,7 +607,7 @@ HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, BOOL bAsChild )
// Uebersetzungstabelle von System-Keycodes in StarView-Keycodes
#define KEY_TAB_SIZE 146
-static USHORT aImplTranslateKeyTab[KEY_TAB_SIZE] =
+static sal_uInt16 aImplTranslateKeyTab[KEY_TAB_SIZE] =
{
// StarView-Code System-Code Index
0, // 0
@@ -863,11 +864,11 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame,
try
{
- Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
- Reference< XIndexAccess > xMultiMon( xFactory->createInstance(OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.DisplayAccess" ) ) ), UNO_QUERY_THROW );
+ uno::Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
+ uno::Reference< XIndexAccess > xMultiMon( xFactory->createInstance(OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.DisplayAccess" ) ) ), UNO_QUERY_THROW );
if( (pFrame->mnDisplay >= 0) && (pFrame->mnDisplay < xMultiMon->getCount()) )
{
- Reference< XPropertySet > xMonitor( xMultiMon->getByIndex( pFrame->mnDisplay ), UNO_QUERY_THROW );
+ uno::Reference< XPropertySet > xMonitor( xMultiMon->getByIndex( pFrame->mnDisplay ), UNO_QUERY_THROW );
com::sun::star::awt::Rectangle aRect;
if( xMonitor->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ScreenArea" ) ) ) >>= aRect )
{
@@ -903,7 +904,7 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame,
// -----------------------------------------------------------------------
-static void ImplSalFrameFullScreenPos( WinSalFrame* pFrame, BOOL bAlways = FALSE )
+static void ImplSalFrameFullScreenPos( WinSalFrame* pFrame, sal_Bool bAlways = FALSE )
{
if ( bAlways || !IsIconic( pFrame->mhWnd ) )
{
@@ -1167,9 +1168,9 @@ void WinSalFrame::ReleaseGraphics( SalGraphics* pGraphics )
// -----------------------------------------------------------------------
-BOOL WinSalFrame::PostEvent( void* pData )
+sal_Bool WinSalFrame::PostEvent( void* pData )
{
- return (BOOL)ImplPostMessage( mhWnd, SAL_MSG_USEREVENT, 0, (LPARAM)pData );
+ return (sal_Bool)ImplPostMessage( mhWnd, SAL_MSG_USEREVENT, 0, (LPARAM)pData );
}
// -----------------------------------------------------------------------
@@ -1187,7 +1188,7 @@ void WinSalFrame::SetTitle( const XubString& rTitle )
// -----------------------------------------------------------------------
-void WinSalFrame::SetIcon( USHORT nIcon )
+void WinSalFrame::SetIcon( sal_uInt16 nIcon )
{
// If we have a window without an Icon (for example a dialog), ignore this call
if ( mbNoIcon )
@@ -1244,7 +1245,7 @@ SalFrame* WinSalFrame::GetParent() const
// -----------------------------------------------------------------------
-static void ImplSalShow( HWND hWnd, BOOL bVisible, BOOL bNoActivate )
+static void ImplSalShow( HWND hWnd, sal_Bool bVisible, sal_Bool bNoActivate )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
if ( !pFrame )
@@ -1329,7 +1330,7 @@ void WinSalFrame::SetExtendedFrameStyle( SalExtStyle )
// -----------------------------------------------------------------------
-void WinSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
+void WinSalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
{
// Post this Message to the window, because this only works
// in the thread of the window, which has create this window.
@@ -1342,7 +1343,7 @@ void WinSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
// -----------------------------------------------------------------------
-void WinSalFrame::Enable( BOOL bEnable )
+void WinSalFrame::Enable( sal_Bool bEnable )
{
EnableWindow( mhWnd, bEnable );
}
@@ -1364,9 +1365,9 @@ void WinSalFrame::SetMaxClientSize( long nWidth, long nHeight )
// -----------------------------------------------------------------------
void WinSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
- BOOL bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
+ sal_Bool bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
if ( !bVisible )
{
Window *pClientWin = GetWindow()->ImplGetClientWindow();
@@ -1381,7 +1382,7 @@ void WinSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
ShowWindow( mhWnd, SW_RESTORE );
}
- USHORT nEvent = 0;
+ sal_uInt16 nEvent = 0;
UINT nPosSize = 0;
RECT aClientRect, aWindowRect;
GetClientRect( mhWnd, &aClientRect ); // x,y always 0,0, but width and height without border
@@ -1533,7 +1534,7 @@ void WinSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
// Adjust Window in the screen
- BOOL bCheckOffScreen = TRUE;
+ sal_Bool bCheckOffScreen = TRUE;
// but don't do this for floaters or ownerdraw windows that are currently moved interactively
if( (mnStyle & SAL_FRAME_STYLE_FLOAT) && !(mnStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) )
@@ -1576,7 +1577,7 @@ void WinSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
// -----------------------------------------------------------------------
-static void ImplSetParentFrame( WinSalFrame* pThis, HWND hNewParentWnd, BOOL bAsChild )
+static void ImplSetParentFrame( WinSalFrame* pThis, HWND hNewParentWnd, sal_Bool bAsChild )
{
// save hwnd, will be overwritten in WM_CREATE during createwindow
HWND hWndOld = pThis->mhWnd;
@@ -1609,8 +1610,8 @@ static void ImplSetParentFrame( WinSalFrame* pThis, HWND hNewParentWnd, BOOL bAs
pObject = pObject->mpNextObject;
}
- BOOL bNeedGraphics = pThis->mbGraphics;
- BOOL bNeedCacheDC = FALSE;
+ sal_Bool bNeedGraphics = pThis->mbGraphics;
+ sal_Bool bNeedCacheDC = FALSE;
HFONT hFont = NULL;
HPEN hPen = NULL;
@@ -1850,8 +1851,8 @@ void WinSalFrame::SetWindowState( const SalFrameState* pState )
GetWindowPlacement( mhWnd, &aPlacement );
// Status setzen
- BOOL bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
- BOOL bUpdateHiddenFramePos = FALSE;
+ sal_Bool bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
+ sal_Bool bUpdateHiddenFramePos = FALSE;
if ( !bVisible )
{
aPlacement.showCmd = SW_HIDE;
@@ -1932,7 +1933,7 @@ void WinSalFrame::SetWindowState( const SalFrameState* pState )
// -----------------------------------------------------------------------
-BOOL WinSalFrame::GetWindowState( SalFrameState* pState )
+sal_Bool WinSalFrame::GetWindowState( SalFrameState* pState )
{
if ( maState.mnWidth && maState.mnHeight )
{
@@ -1986,7 +1987,7 @@ void WinSalFrame::SetApplicationID( const rtl::OUString &/*rApplicationID*/ )
// -----------------------------------------------------------------------
-void WinSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay )
+void WinSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay )
{
if ( (mbFullScreen == bFullScreen) && (!bFullScreen || (mnDisplay == nDisplay)) )
return;
@@ -2019,7 +2020,7 @@ void WinSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay )
{
// wenn ShowState wieder hergestellt werden muss, hiden wir zuerst
// das Fenster, damit es nicht so sehr flackert
- BOOL bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
+ sal_Bool bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
if ( bVisible && (mnShowState != mnFullScreenShowState) )
ShowWindow( mhWnd, SW_HIDE );
@@ -2051,7 +2052,7 @@ void WinSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay )
// -----------------------------------------------------------------------
-void WinSalFrame::StartPresentation( BOOL bStart )
+void WinSalFrame::StartPresentation( sal_Bool bStart )
{
if ( mbPresentation == bStart )
return;
@@ -2106,7 +2107,7 @@ void WinSalFrame::StartPresentation( BOOL bStart )
// -----------------------------------------------------------------------
-void WinSalFrame::SetAlwaysOnTop( BOOL bOnTop )
+void WinSalFrame::SetAlwaysOnTop( sal_Bool bOnTop )
{
HWND hWnd;
if ( bOnTop )
@@ -2118,7 +2119,7 @@ void WinSalFrame::SetAlwaysOnTop( BOOL bOnTop )
// -----------------------------------------------------------------------
-static void ImplSalToTop( HWND hWnd, USHORT nFlags )
+static void ImplSalToTop( HWND hWnd, sal_uInt16 nFlags )
{
WinSalFrame* pToTopFrame = GetWindowPtr( hWnd );
if( pToTopFrame && (pToTopFrame->mnStyle & SAL_FRAME_STYLE_SYSTEMCHILD) != 0 )
@@ -2174,7 +2175,7 @@ static void ImplSalToTop( HWND hWnd, USHORT nFlags )
// -----------------------------------------------------------------------
-void WinSalFrame::ToTop( USHORT nFlags )
+void WinSalFrame::ToTop( sal_uInt16 nFlags )
{
nFlags &= ~SAL_FRAME_TOTOP_GRABFOCUS; // this flag is not needed on win32
// Post this Message to the window, because this only works
@@ -2325,7 +2326,7 @@ void WinSalFrame::SetPointer( PointerStyle ePointerStyle )
// -----------------------------------------------------------------------
-void WinSalFrame::CaptureMouse( BOOL bCapture )
+void WinSalFrame::CaptureMouse( sal_Bool bCapture )
{
// Send this Message to the window, because CaptureMouse() only work
// in the thread of the window, which has create this window
@@ -2367,7 +2368,7 @@ void WinSalFrame::Sync()
static void ImplSalFrameSetInputContext( HWND hWnd, const SalInputContext* pContext )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
- BOOL bIME = (pContext->mnOptions & SAL_INPUTCONTEXT_TEXT) != 0;
+ sal_Bool bIME = (pContext->mnOptions & SAL_INPUTCONTEXT_TEXT) != 0;
if ( bIME )
{
if ( !pFrame->mbIME )
@@ -2434,7 +2435,7 @@ void WinSalFrame::SetInputContext( SalInputContext* pContext )
// -----------------------------------------------------------------------
-static void ImplSalFrameEndExtTextInput( HWND hWnd, USHORT nFlags )
+static void ImplSalFrameEndExtTextInput( HWND hWnd, sal_uInt16 nFlags )
{
HIMC hIMC = ImmGetContext( hWnd );
if ( hIMC )
@@ -2452,7 +2453,7 @@ static void ImplSalFrameEndExtTextInput( HWND hWnd, USHORT nFlags )
// -----------------------------------------------------------------------
-void WinSalFrame::EndExtTextInput( USHORT nFlags )
+void WinSalFrame::EndExtTextInput( sal_uInt16 nFlags )
{
// Must be called in the main thread!
ImplSendMessage( mhWnd, SAL_MSG_ENDEXTTEXTINPUT, (WPARAM)nFlags, 0 );
@@ -2523,7 +2524,7 @@ static void ImplGetKeyNameText( LONG lParam, sal_Unicode* pBuf,
// -----------------------------------------------------------------------
-XubString WinSalFrame::GetKeyName( USHORT nKeyCode )
+XubString WinSalFrame::GetKeyName( sal_uInt16 nKeyCode )
{
static const int nMaxKeyLen = 350;
sal_Unicode aKeyBuf[ nMaxKeyLen ];
@@ -2533,26 +2534,26 @@ XubString WinSalFrame::GetKeyName( USHORT nKeyCode )
if ( nKeyCode & KEY_MOD1 )
{
nSysCode = MapVirtualKey( VK_CONTROL, 0 );
- nSysCode = (nSysCode << 16) | (((ULONG)1) << 25);
+ nSysCode = (nSysCode << 16) | (((sal_uLong)1) << 25);
ImplGetKeyNameText( nSysCode, aKeyBuf, nKeyBufLen, nMaxKeyLen, "Ctrl" );
}
if ( nKeyCode & KEY_MOD2 )
{
nSysCode = MapVirtualKey( VK_MENU, 0 );
- nSysCode = (nSysCode << 16) | (((ULONG)1) << 25);
+ nSysCode = (nSysCode << 16) | (((sal_uLong)1) << 25);
ImplGetKeyNameText( nSysCode, aKeyBuf, nKeyBufLen, nMaxKeyLen, "Alt" );
}
if ( nKeyCode & KEY_SHIFT )
{
nSysCode = MapVirtualKey( VK_SHIFT, 0 );
- nSysCode = (nSysCode << 16) | (((ULONG)1) << 25);
+ nSysCode = (nSysCode << 16) | (((sal_uLong)1) << 25);
ImplGetKeyNameText( nSysCode, aKeyBuf, nKeyBufLen, nMaxKeyLen, "Shift" );
}
- USHORT nCode = nKeyCode & 0x0FFF;
- ULONG nSysCode2 = 0;
+ sal_uInt16 nCode = nKeyCode & 0x0FFF;
+ sal_uLong nSysCode2 = 0;
sal_Char* pReplace = NULL;
sal_Unicode cSVCode = 0;
sal_Char aFBuf[4];
@@ -2591,42 +2592,42 @@ XubString WinSalFrame::GetKeyName( USHORT nKeyCode )
{
case KEY_DOWN:
nSysCode = VK_DOWN;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Down";
break;
case KEY_UP:
nSysCode = VK_UP;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Up";
break;
case KEY_LEFT:
nSysCode = VK_LEFT;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Left";
break;
case KEY_RIGHT:
nSysCode = VK_RIGHT;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Right";
break;
case KEY_HOME:
nSysCode = VK_HOME;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Home";
break;
case KEY_END:
nSysCode = VK_END;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "End";
break;
case KEY_PAGEUP:
nSysCode = VK_PRIOR;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Page Up";
break;
case KEY_PAGEDOWN:
nSysCode = VK_NEXT;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Page Down";
break;
case KEY_RETURN:
@@ -2651,12 +2652,12 @@ XubString WinSalFrame::GetKeyName( USHORT nKeyCode )
break;
case KEY_INSERT:
nSysCode = VK_INSERT;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Insert";
break;
case KEY_DELETE:
nSysCode = VK_DELETE;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Delete";
break;
@@ -2720,12 +2721,12 @@ XubString WinSalFrame::GetKeyName( USHORT nKeyCode )
if( !nKeyBufLen )
return XubString();
- return XubString( aKeyBuf, sal::static_int_cast< USHORT >(nKeyBufLen) );
+ return XubString( aKeyBuf, sal::static_int_cast< sal_uInt16 >(nKeyBufLen) );
}
// -----------------------------------------------------------------------
-XubString WinSalFrame::GetSymbolKeyName( const XubString&, USHORT nKeyCode )
+XubString WinSalFrame::GetSymbolKeyName( const XubString&, sal_uInt16 nKeyCode )
{
return GetKeyName( nKeyCode );
}
@@ -2803,6 +2804,29 @@ static long ImplA2I( const BYTE* pStr )
}
// -----------------------------------------------------------------------
+static HRESULT WINAPI backwardCompatibleDwmIsCompositionEnabled( BOOL* pOut )
+{
+ *pOut = FALSE;
+ return S_OK;
+}
+
+static BOOL ImplDwmIsCompositionEnabled()
+{
+ SalData* pSalData = GetSalData();
+ if( ! pSalData->mpDwmIsCompositionEnabled )
+ {
+ rtl::OUString aLibraryName( RTL_CONSTASCII_USTRINGPARAM( "Dwmapi.dll" ) );
+ pSalData->maDwmLib = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT );
+ if( pSalData->maDwmLib )
+ pSalData->mpDwmIsCompositionEnabled = (DwmIsCompositionEnabled_ptr)osl_getAsciiFunctionSymbol( pSalData->maDwmLib, "DwmIsCompositionEnabled" );
+ if( ! pSalData->mpDwmIsCompositionEnabled ) // something failed
+ pSalData->mpDwmIsCompositionEnabled = backwardCompatibleDwmIsCompositionEnabled;
+ }
+ BOOL aResult = FALSE;
+ HRESULT nError = pSalData->mpDwmIsCompositionEnabled( &aResult );
+ return nError == S_OK && aResult;
+}
+
void WinSalFrame::UpdateSettings( AllSettings& rSettings )
{
@@ -2828,34 +2852,30 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
&nType, aValueBuf, &nValueSize ) == ERROR_SUCCESS )
{
if ( nType == REG_SZ )
- aMouseSettings.SetMenuDelay( (ULONG)ImplA2I( aValueBuf ) );
+ aMouseSettings.SetMenuDelay( (sal_uLong)ImplA2I( aValueBuf ) );
}
RegCloseKey( hRegKey );
}
StyleSettings aStyleSettings = rSettings.GetStyleSettings();
- BOOL bCompBorder = (aStyleSettings.GetOptions() & (STYLE_OPTION_MACSTYLE | STYLE_OPTION_UNIXSTYLE)) == 0;
// TODO: once those options vanish: just set bCompBorder to TRUE
// to have the system colors read
aStyleSettings.SetScrollBarSize( GetSystemMetrics( SM_CXVSCROLL ) );
aStyleSettings.SetSpinSize( GetSystemMetrics( SM_CXVSCROLL ) );
aStyleSettings.SetCursorBlinkTime( GetCaretBlinkTime() );
- if ( bCompBorder )
- {
- aStyleSettings.SetFloatTitleHeight( GetSystemMetrics( SM_CYSMCAPTION ) );
- aStyleSettings.SetTitleHeight( GetSystemMetrics( SM_CYCAPTION ) );
- aStyleSettings.SetActiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVEBORDER ) ) );
- aStyleSettings.SetDeactiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVEBORDER ) ) );
- aStyleSettings.SetActiveColor2( ImplWinColorToSal( GetSysColor( COLOR_GRADIENTACTIVECAPTION ) ) );
- aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_GRADIENTINACTIVECAPTION ) ) );
- aStyleSettings.SetFaceColor( ImplWinColorToSal( GetSysColor( COLOR_3DFACE ) ) );
- aStyleSettings.SetInactiveTabColor( aStyleSettings.GetFaceColor() );
- aStyleSettings.SetLightColor( ImplWinColorToSal( GetSysColor( COLOR_3DHILIGHT ) ) );
- aStyleSettings.SetLightBorderColor( ImplWinColorToSal( GetSysColor( COLOR_3DLIGHT ) ) );
- aStyleSettings.SetShadowColor( ImplWinColorToSal( GetSysColor( COLOR_3DSHADOW ) ) );
- aStyleSettings.SetDarkShadowColor( ImplWinColorToSal( GetSysColor( COLOR_3DDKSHADOW ) ) );
- }
+ aStyleSettings.SetFloatTitleHeight( GetSystemMetrics( SM_CYSMCAPTION ) );
+ aStyleSettings.SetTitleHeight( GetSystemMetrics( SM_CYCAPTION ) );
+ aStyleSettings.SetActiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVEBORDER ) ) );
+ aStyleSettings.SetDeactiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVEBORDER ) ) );
+ aStyleSettings.SetActiveColor2( ImplWinColorToSal( GetSysColor( COLOR_GRADIENTACTIVECAPTION ) ) );
+ aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_GRADIENTINACTIVECAPTION ) ) );
+ aStyleSettings.SetFaceColor( ImplWinColorToSal( GetSysColor( COLOR_3DFACE ) ) );
+ aStyleSettings.SetInactiveTabColor( aStyleSettings.GetFaceColor() );
+ aStyleSettings.SetLightColor( ImplWinColorToSal( GetSysColor( COLOR_3DHILIGHT ) ) );
+ aStyleSettings.SetLightBorderColor( ImplWinColorToSal( GetSysColor( COLOR_3DLIGHT ) ) );
+ aStyleSettings.SetShadowColor( ImplWinColorToSal( GetSysColor( COLOR_3DSHADOW ) ) );
+ aStyleSettings.SetDarkShadowColor( ImplWinColorToSal( GetSysColor( COLOR_3DDKSHADOW ) ) );
aStyleSettings.SetWorkspaceColor( ImplWinColorToSal( GetSysColor( COLOR_APPWORKSPACE ) ) );
aStyleSettings.SetHelpColor( ImplWinColorToSal( GetSysColor( COLOR_INFOBK ) ) );
aStyleSettings.SetHelpTextColor( ImplWinColorToSal( GetSysColor( COLOR_INFOTEXT ) ) );
@@ -2877,37 +2897,52 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
aStyleSettings.SetHighlightTextColor( ImplWinColorToSal( GetSysColor( COLOR_HIGHLIGHTTEXT ) ) );
aStyleSettings.SetMenuHighlightColor( aStyleSettings.GetHighlightColor() );
aStyleSettings.SetMenuHighlightTextColor( aStyleSettings.GetHighlightTextColor() );
- if ( bCompBorder )
- {
- aStyleSettings.SetMenuColor( ImplWinColorToSal( GetSysColor( COLOR_MENU ) ) );
- aStyleSettings.SetMenuBarColor( aStyleSettings.GetMenuColor() );
- aStyleSettings.SetMenuBorderColor( aStyleSettings.GetLightBorderColor() ); // overriden below for flat menus
- aStyleSettings.SetUseFlatBorders( FALSE );
- aStyleSettings.SetUseFlatMenues( FALSE );
- aStyleSettings.SetMenuTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) );
- aStyleSettings.SetMenuBarTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) );
- aStyleSettings.SetActiveColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVECAPTION ) ) );
- aStyleSettings.SetActiveTextColor( ImplWinColorToSal( GetSysColor( COLOR_CAPTIONTEXT ) ) );
- aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVECAPTION ) ) );
- aStyleSettings.SetDeactiveTextColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVECAPTIONTEXT ) ) );
- if ( aSalShlData.mbWXP )
+
+ ImplSVData* pSVData = ImplGetSVData();
+ pSVData->maNWFData.mnMenuFormatExtraBorder = 0;
+ pSVData->maNWFData.maMenuBarHighlightTextColor = Color( COL_TRANSPARENT );
+ GetSalData()->mbThemeMenuSupport = FALSE;
+ aStyleSettings.SetMenuColor( ImplWinColorToSal( GetSysColor( COLOR_MENU ) ) );
+ aStyleSettings.SetMenuBarColor( aStyleSettings.GetMenuColor() );
+ aStyleSettings.SetMenuBorderColor( aStyleSettings.GetLightBorderColor() ); // overriden below for flat menus
+ aStyleSettings.SetUseFlatBorders( FALSE );
+ aStyleSettings.SetUseFlatMenues( FALSE );
+ aStyleSettings.SetMenuTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) );
+ aStyleSettings.SetMenuBarTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) );
+ aStyleSettings.SetActiveColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVECAPTION ) ) );
+ aStyleSettings.SetActiveTextColor( ImplWinColorToSal( GetSysColor( COLOR_CAPTIONTEXT ) ) );
+ aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVECAPTION ) ) );
+ aStyleSettings.SetDeactiveTextColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVECAPTIONTEXT ) ) );
+ if ( aSalShlData.mbWXP )
+ {
+ // only xp supports a different menu bar color
+ long bFlatMenues = 0;
+ SystemParametersInfo( SPI_GETFLATMENU, 0, &bFlatMenues, 0);
+ if( bFlatMenues )
{
- // only xp supports a different menu bar color
- long bFlatMenues = 0;
- SystemParametersInfo( SPI_GETFLATMENU, 0, &bFlatMenues, 0);
- if( bFlatMenues )
- {
- aStyleSettings.SetUseFlatMenues( TRUE );
- aStyleSettings.SetMenuBarColor( ImplWinColorToSal( GetSysColor( COLOR_MENUBAR ) ) );
- aStyleSettings.SetMenuHighlightColor( ImplWinColorToSal( GetSysColor( COLOR_MENUHILIGHT ) ) );
- aStyleSettings.SetMenuBorderColor( ImplWinColorToSal( GetSysColor( COLOR_3DSHADOW ) ) );
-
- // flat borders for our controls etc. as well in this mode (ie, no 3d borders)
- // this is not active in the classic style appearance
- aStyleSettings.SetUseFlatBorders( TRUE );
- }
+ aStyleSettings.SetUseFlatMenues( TRUE );
+ aStyleSettings.SetMenuBarColor( ImplWinColorToSal( GetSysColor( COLOR_MENUBAR ) ) );
+ aStyleSettings.SetMenuHighlightColor( ImplWinColorToSal( GetSysColor( COLOR_MENUHILIGHT ) ) );
+ aStyleSettings.SetMenuBorderColor( ImplWinColorToSal( GetSysColor( COLOR_3DSHADOW ) ) );
+
+ // flat borders for our controls etc. as well in this mode (ie, no 3d borders)
+ // this is not active in the classic style appearance
+ aStyleSettings.SetUseFlatBorders( TRUE );
}
}
+ // check if vista or newer runs
+ // in Aero theme (and similar ?) the menu text color does not change
+ // for selected items; also on WinXP and earlier menus are not themed
+ if( aSalShlData.maVersionInfo.dwMajorVersion >= 6 &&
+ ImplDwmIsCompositionEnabled()
+ )
+ {
+ // in aero menuitem highlight text is drawn in the same color as normal
+ aStyleSettings.SetMenuHighlightTextColor( aStyleSettings.GetMenuTextColor() );
+ pSVData->maNWFData.mnMenuFormatExtraBorder = 2;
+ pSVData->maNWFData.maMenuBarHighlightTextColor = aStyleSettings.GetMenuTextColor();
+ GetSalData()->mbThemeMenuSupport = TRUE;
+ }
// Bei hellgrau geben wir die Farbe vor, damit es besser aussieht
if ( aStyleSettings.GetFaceColor() == COL_LIGHTGRAY )
aStyleSettings.SetCheckedColor( Color( 0xCC, 0xCC, 0xCC ) );
@@ -2916,9 +2951,9 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
// Checked-Color berechnen
Color aColor1 = aStyleSettings.GetFaceColor();
Color aColor2 = aStyleSettings.GetLightColor();
- BYTE nRed = (BYTE)(((USHORT)aColor1.GetRed() + (USHORT)aColor2.GetRed())/2);
- BYTE nGreen = (BYTE)(((USHORT)aColor1.GetGreen() + (USHORT)aColor2.GetGreen())/2);
- BYTE nBlue = (BYTE)(((USHORT)aColor1.GetBlue() + (USHORT)aColor2.GetBlue())/2);
+ BYTE nRed = (BYTE)(((sal_uInt16)aColor1.GetRed() + (sal_uInt16)aColor2.GetRed())/2);
+ BYTE nGreen = (BYTE)(((sal_uInt16)aColor1.GetGreen() + (sal_uInt16)aColor2.GetGreen())/2);
+ BYTE nBlue = (BYTE)(((sal_uInt16)aColor1.GetBlue() + (sal_uInt16)aColor2.GetBlue())/2);
aStyleSettings.SetCheckedColor( Color( nRed, nGreen, nBlue ) );
}
@@ -2998,10 +3033,10 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
aStyleSettings.SetInfoFont( aAppFont );
aStyleSettings.SetToolFont( aAppFont );
- WIN_BOOL bDragFull;
+ BOOL bDragFull;
if ( SystemParametersInfo( SPI_GETDRAGFULLWINDOWS, 0, &bDragFull, 0 ) )
{
- ULONG nDragFullOptions = aStyleSettings.GetDragFullOptions();
+ sal_uLong nDragFullOptions = aStyleSettings.GetDragFullOptions();
if ( bDragFull )
nDragFullOptions |= DRAGFULL_OPTION_WINDOWMOVE | DRAGFULL_OPTION_WINDOWSIZE | DRAGFULL_OPTION_DOCKING | DRAGFULL_OPTION_SPLIT;
else
@@ -3024,7 +3059,7 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
{
if ( nType == REG_SZ )
{
- nValue = (ULONG)ImplA2I( aValueBuf );
+ nValue = (sal_uLong)ImplA2I( aValueBuf );
if ( (nValue > 1000) && (nValue < 10000) )
{
MiscSettings aMiscSettings = rSettings.GetMiscSettings();
@@ -3055,7 +3090,7 @@ SalBitmap* WinSalFrame::SnapShot()
HDC hDC = GetWindowDC( mhWnd );
HBITMAP hBmpBitmap = CreateCompatibleBitmap( hDC, nDX, nDY );
HDC hBmpDC = ImplGetCachedDC( CACHED_HDC_1, hBmpBitmap );
- BOOL bRet;
+ sal_Bool bRet;
bRet = BitBlt( hBmpDC, 0, 0, nDX, nDY, hDC, 0, 0, SRCCOPY ) ? TRUE : FALSE;
ImplReleaseCachedDC( CACHED_HDC_1 );
@@ -3143,7 +3178,7 @@ SalFrame::SalIndicatorState WinSalFrame::GetIndicatorState()
return aState;
}
-void WinSalFrame::SimulateKeyPress( USHORT nKeyCode )
+void WinSalFrame::SimulateKeyPress( sal_uInt16 nKeyCode )
{
BYTE nVKey = 0;
switch (nKeyCode)
@@ -3175,11 +3210,11 @@ void WinSalFrame::ResetClipRegion()
// -----------------------------------------------------------------------
-void WinSalFrame::BeginSetClipRegion( ULONG nRects )
+void WinSalFrame::BeginSetClipRegion( sal_uLong nRects )
{
if( mpClipRgnData )
delete [] (BYTE*)mpClipRgnData;
- ULONG nRectBufSize = sizeof(RECT)*nRects;
+ sal_uLong nRectBufSize = sizeof(RECT)*nRects;
mpClipRgnData = (RGNDATA*)new BYTE[sizeof(RGNDATA)-1+nRectBufSize];
mpClipRgnData->rdh.dwSize = sizeof( RGNDATAHEADER );
mpClipRgnData->rdh.iType = RDH_RECTANGLES;
@@ -3251,7 +3286,7 @@ void WinSalFrame::EndSetClipRegion()
}
else
{
- ULONG nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER);
+ sal_uLong nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER);
hRegion = ExtCreateRegion( NULL, nSize, mpClipRgnData );
}
delete [] (BYTE*)mpClipRgnData;
@@ -3296,8 +3331,8 @@ static long ImplHandleMouseMsg( HWND hWnd, UINT nMsg,
}
SalMouseEvent aMouseEvt;
long nRet;
- USHORT nEvent = 0;
- BOOL bCall = TRUE;
+ sal_uInt16 nEvent = 0;
+ sal_Bool bCall = TRUE;
aMouseEvt.mnX = (short)LOWORD( lParam );
aMouseEvt.mnY = (short)HIWORD( lParam );
@@ -3531,9 +3566,9 @@ static long ImplHandleWheelMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lPar
// -----------------------------------------------------------------------
-static USHORT ImplSalGetKeyCode( WPARAM wParam )
+static sal_uInt16 ImplSalGetKeyCode( WPARAM wParam )
{
- USHORT nKeyCode;
+ sal_uInt16 nKeyCode;
// convert KeyCode
if ( wParam < KEY_TAB_SIZE )
@@ -3541,7 +3576,7 @@ static USHORT ImplSalGetKeyCode( WPARAM wParam )
else
{
SalData* pSalData = GetSalData();
- std::map< UINT, USHORT >::const_iterator it = pSalData->maVKMap.find( (UINT)wParam );
+ std::map< UINT, sal_uInt16 >::const_iterator it = pSalData->maVKMap.find( (UINT)wParam );
if( it != pSalData->maVKMap.end() )
nKeyCode = it->second;
else
@@ -3555,7 +3590,7 @@ static USHORT ImplSalGetKeyCode( WPARAM wParam )
static UINT ImplStrToNum( const sal_Char* pStr )
{
- USHORT n = 0;
+ sal_uInt16 n = 0;
// Solange es sich um eine Ziffer handelt, String umwandeln
while( (*pStr >= 48) && (*pStr <= 57) )
@@ -3572,7 +3607,7 @@ static UINT ImplStrToNum( const sal_Char* pStr )
static void ImplUpdateInputLang( WinSalFrame* pFrame )
{
- BOOL bLanguageChange = FALSE;
+ sal_Bool bLanguageChange = FALSE;
UINT nLang = LOWORD( GetKeyboardLayout( 0 ) );
if ( nLang && nLang != pFrame->mnInputLang )
{
@@ -3612,9 +3647,9 @@ LanguageType WinSalFrame::GetInputLanguage()
// -----------------------------------------------------------------------
-BOOL WinSalFrame::MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode )
+sal_Bool WinSalFrame::MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = FALSE;
HKL hkl = 0;
// just use the passed language identifier, do not try to load additional keyboard support
@@ -3654,14 +3689,14 @@ BOOL WinSalFrame::MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangT
static long ImplHandleKeyMsg( HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam, LRESULT& rResult )
{
- static BOOL bIgnoreCharMsg = FALSE;
+ static sal_Bool bIgnoreCharMsg = FALSE;
static WPARAM nDeadChar = 0;
static WPARAM nLastVKChar = 0;
- static USHORT nLastChar = 0;
- static USHORT nLastModKeyCode = 0;
+ static sal_uInt16 nLastChar = 0;
+ static sal_uInt16 nLastModKeyCode = 0;
static bool bWaitForModKeyRelease = false;
- USHORT nRepeat = LOWORD( lParam )-1;
- USHORT nModCode = 0;
+ sal_uInt16 nRepeat = LOWORD( lParam )-1;
+ sal_uInt16 nModCode = 0;
// Key wurde evtl. durch SysChild an uns weitergeleitet und
// darf somit dann nicht doppelt verarbeitet werden
@@ -3721,11 +3756,11 @@ static long ImplHandleKeyMsg( HWND hWnd, UINT nMsg,
SalKeyEvent aKeyEvt;
if ( (wParam >= '0') && (wParam <= '9') )
- aKeyEvt.mnCode = sal::static_int_cast<USHORT>(KEYGROUP_NUM + wParam - '0');
+ aKeyEvt.mnCode = sal::static_int_cast<sal_uInt16>(KEYGROUP_NUM + wParam - '0');
else if ( (wParam >= 'A') && (wParam <= 'Z') )
- aKeyEvt.mnCode = sal::static_int_cast<USHORT>(KEYGROUP_ALPHA + wParam - 'A');
+ aKeyEvt.mnCode = sal::static_int_cast<sal_uInt16>(KEYGROUP_ALPHA + wParam - 'A');
else if ( (wParam >= 'a') && (wParam <= 'z') )
- aKeyEvt.mnCode = sal::static_int_cast<USHORT>(KEYGROUP_ALPHA + wParam - 'a');
+ aKeyEvt.mnCode = sal::static_int_cast<sal_uInt16>(KEYGROUP_ALPHA + wParam - 'a');
else if ( wParam == 0x0D ) // RETURN
aKeyEvt.mnCode = KEY_RETURN;
else if ( wParam == 0x1B ) // ESCAPE
@@ -3793,7 +3828,7 @@ static long ImplHandleKeyMsg( HWND hWnd, UINT nMsg,
aModEvt.mnCode = nModCode;
aModEvt.mnModKeyCode = 0; // no command events will be sent if this member is 0
- USHORT tmpCode = 0;
+ sal_uInt16 tmpCode = 0;
if( GetKeyState( VK_LSHIFT ) & 0x8000 )
tmpCode |= MODKEY_LSHIFT;
if( GetKeyState( VK_RSHIFT ) & 0x8000 )
@@ -3827,11 +3862,11 @@ static long ImplHandleKeyMsg( HWND hWnd, UINT nMsg,
else
{
SalKeyEvent aKeyEvt;
- USHORT nEvent;
+ sal_uInt16 nEvent;
MSG aCharMsg;
- WIN_BOOL bCharPeek = FALSE;
+ BOOL bCharPeek = FALSE;
UINT nCharMsg = WM_CHAR;
- BOOL bKeyUp = (nMsg == WM_KEYUP) || (nMsg == WM_SYSKEYUP);
+ sal_Bool bKeyUp = (nMsg == WM_KEYUP) || (nMsg == WM_SYSKEYUP);
nLastModKeyCode = 0; // make sure no modkey messages are sent if they belong to a hotkey (see above)
aKeyEvt.mnCharCode = 0;
@@ -3946,8 +3981,8 @@ long ImplHandleSalObjKeyMsg( HWND hWnd, UINT nMsg,
if ( !pFrame )
return 0;
- USHORT nRepeat = LOWORD( lParam )-1;
- USHORT nModCode = 0;
+ sal_uInt16 nRepeat = LOWORD( lParam )-1;
+ sal_uInt16 nModCode = 0;
// determine modifiers
if ( GetKeyState( VK_SHIFT ) & 0x8000 )
@@ -3960,8 +3995,8 @@ long ImplHandleSalObjKeyMsg( HWND hWnd, UINT nMsg,
if ( (wParam != VK_SHIFT) && (wParam != VK_CONTROL) && (wParam != VK_MENU) )
{
SalKeyEvent aKeyEvt;
- USHORT nEvent;
- BOOL bKeyUp = (nMsg == WM_KEYUP) || (nMsg == WM_SYSKEYUP);
+ sal_uInt16 nEvent;
+ sal_Bool bKeyUp = (nMsg == WM_KEYUP) || (nMsg == WM_SYSKEYUP);
// convert KeyCode
aKeyEvt.mnCode = ImplSalGetKeyCode( wParam );
@@ -3996,9 +4031,9 @@ long ImplHandleSalObjSysCharMsg( HWND hWnd, WPARAM wParam, LPARAM lParam )
if ( !pFrame )
return 0;
- USHORT nRepeat = LOWORD( lParam )-1;
- USHORT nModCode = 0;
- USHORT cKeyCode = (USHORT)wParam;
+ sal_uInt16 nRepeat = LOWORD( lParam )-1;
+ sal_uInt16 nModCode = 0;
+ sal_uInt16 cKeyCode = (sal_uInt16)wParam;
// determine modifiers
if ( GetKeyState( VK_SHIFT ) & 0x8000 )
@@ -4030,7 +4065,7 @@ long ImplHandleSalObjSysCharMsg( HWND hWnd, WPARAM wParam, LPARAM lParam )
static bool ImplHandlePaintMsg( HWND hWnd )
{
- BOOL bMutex = FALSE;
+ sal_Bool bMutex = FALSE;
if ( ImplSalYieldMutexTryToAcquire() )
bMutex = TRUE;
@@ -4386,7 +4421,7 @@ static long ImplHandleShutDownMsg( HWND hWnd )
static void ImplHandleSettingsChangeMsg( HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam )
{
- USHORT nSalEvent = SALEVENT_SETTINGSCHANGED;
+ sal_uInt16 nSalEvent = SALEVENT_SETTINGSCHANGED;
if ( nMsg == WM_DEVMODECHANGE )
nSalEvent = SALEVENT_PRINTERCHANGED;
@@ -4482,7 +4517,7 @@ static void ImplHandleForcePalette( HWND hWnd )
// -----------------------------------------------------------------------
-static LRESULT ImplHandlePalette( BOOL bFrame, HWND hWnd, UINT nMsg,
+static LRESULT ImplHandlePalette( sal_Bool bFrame, HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam, int& rDef )
{
SalData* pSalData = GetSalData();
@@ -4500,7 +4535,7 @@ static LRESULT ImplHandlePalette( BOOL bFrame, HWND hWnd, UINT nMsg,
return 0;
}
- BOOL bReleaseMutex = FALSE;
+ sal_Bool bReleaseMutex = FALSE;
if ( (nMsg == WM_QUERYNEWPALETTE) || (nMsg == WM_PALETTECHANGED) )
{
// Da Windows diese Messages auch sendet, muss hier auch die
@@ -4519,8 +4554,8 @@ static LRESULT ImplHandlePalette( BOOL bFrame, HWND hWnd, UINT nMsg,
HDC hDC;
HPALETTE hOldPal;
UINT nCols;
- BOOL bStdDC;
- BOOL bUpdate;
+ sal_Bool bStdDC;
+ sal_Bool bUpdate;
pSalData->mbInPalChange = TRUE;
@@ -4713,7 +4748,7 @@ static int ImplHandleMinMax( HWND hWnd, LPARAM lParam )
// the pointer is stored in every item, so if no position
// is specified we just use the first item (ie, pos=0)
// if bByPosition is FALSE then nPos denotes a menu id instead of a position
-static WinSalMenuItem* ImplGetSalMenuItem( HMENU hMenu, UINT nPos, BOOL bByPosition=TRUE )
+static WinSalMenuItem* ImplGetSalMenuItem( HMENU hMenu, UINT nPos, sal_Bool bByPosition=TRUE )
{
DWORD err=0;
@@ -4868,9 +4903,9 @@ static int ImplDrawItem(HWND, WPARAM wParam, LPARAM lParam )
COLORREF clrPrevText, clrPrevBkgnd;
HFONT hfntOld;
HBRUSH hbrOld;
- BOOL fChecked = (pDI->itemState & ODS_CHECKED) ? TRUE : FALSE;
- BOOL fSelected = (pDI->itemState & ODS_SELECTED) ? TRUE : FALSE;
- BOOL fDisabled = (pDI->itemState & (ODS_DISABLED | ODS_GRAYED)) ? TRUE : FALSE;
+ sal_Bool fChecked = (pDI->itemState & ODS_CHECKED) ? TRUE : FALSE;
+ sal_Bool fSelected = (pDI->itemState & ODS_SELECTED) ? TRUE : FALSE;
+ sal_Bool fDisabled = (pDI->itemState & (ODS_DISABLED | ODS_GRAYED)) ? TRUE : FALSE;
// Set the appropriate foreground and background colors.
RECT aRect = pDI->rcItem;
@@ -5014,7 +5049,7 @@ static int ImplHandleMenuActivate( HWND hWnd, WPARAM wParam, LPARAM )
HMENU hMenu = (HMENU) wParam;
// WORD nPos = LOWORD (lParam);
- // BOOL bWindowMenu = (BOOL) HIWORD(lParam);
+ // sal_Bool bWindowMenu = (sal_Bool) HIWORD(lParam);
// Send activate and deactivate together, so we have not keep track of opened menues
// this will be enough to have the menues updated correctly
@@ -5049,7 +5084,7 @@ static int ImplHandleMenuSelect( HWND hWnd, WPARAM wParam, LPARAM lParam )
if( !GetSalData()->IsKnownMenuHandle( hMenu ) )
return 0;
- BOOL bByPosition = FALSE;
+ sal_Bool bByPosition = FALSE;
if( nFlags & MF_POPUP )
bByPosition = TRUE;
@@ -5149,8 +5184,8 @@ static int ImplHandleSysCommand( HWND hWnd, WPARAM wParam, LPARAM lParam )
if ( pFrame->mbFullScreen )
{
- WIN_BOOL bMaximize = IsZoomed( pFrame->mhWnd );
- WIN_BOOL bMinimize = IsIconic( pFrame->mhWnd );
+ BOOL bMaximize = IsZoomed( pFrame->mhWnd );
+ BOOL bMinimize = IsIconic( pFrame->mhWnd );
if ( (nCommand == SC_SIZE) ||
(!bMinimize && (nCommand == SC_MOVE)) ||
(!bMaximize && (nCommand == SC_MAXIMIZE)) ||
@@ -5214,7 +5249,7 @@ static int ImplHandleSysCommand( HWND hWnd, WPARAM wParam, LPARAM lParam )
if ( ((cKeyCode >= 48) && (cKeyCode <= 57)) ||
((cKeyCode >= 97) && (cKeyCode <= 122)) )
{
- USHORT nModCode = 0;
+ sal_uInt16 nModCode = 0;
if ( GetKeyState( VK_SHIFT ) & 0x8000 )
nModCode |= KEY_SHIFT;
if ( GetKeyState( VK_CONTROL ) & 0x8000 )
@@ -5303,9 +5338,9 @@ static void ImplUpdateIMECursorPos( WinSalFrame* pFrame, HIMC hIMC )
// -----------------------------------------------------------------------
-static BOOL ImplHandleIMEStartComposition( HWND hWnd )
+static sal_Bool ImplHandleIMEStartComposition( HWND hWnd )
{
- BOOL bDef = TRUE;
+ sal_Bool bDef = TRUE;
ImplSalYieldMutexAcquireWithWait();
@@ -5333,10 +5368,10 @@ static BOOL ImplHandleIMEStartComposition( HWND hWnd )
// -----------------------------------------------------------------------
-static BOOL ImplHandleIMECompositionInput( WinSalFrame* pFrame,
+static sal_Bool ImplHandleIMECompositionInput( WinSalFrame* pFrame,
HIMC hIMC, LPARAM lParam )
{
- BOOL bDef = TRUE;
+ sal_Bool bDef = TRUE;
// Init Event
SalExtTextInputEvent aEvt;
@@ -5377,7 +5412,7 @@ static BOOL ImplHandleIMECompositionInput( WinSalFrame* pFrame,
{
bDef = FALSE;
- USHORT* pSalAttrAry = NULL;
+ sal_uInt16* pSalAttrAry = NULL;
LONG nTextLen = ImmGetCompositionStringW( hIMC, GCS_COMPSTR, 0, 0 ) / sizeof( WCHAR );
if ( nTextLen > 0 )
{
@@ -5386,23 +5421,23 @@ static BOOL ImplHandleIMECompositionInput( WinSalFrame* pFrame,
aEvt.maText = XubString( reinterpret_cast<const xub_Unicode*>(pTextBuf), (xub_StrLen)nTextLen );
delete [] pTextBuf;
- WIN_BYTE* pAttrBuf = NULL;
+ BYTE* pAttrBuf = NULL;
LONG nAttrLen = ImmGetCompositionStringW( hIMC, GCS_COMPATTR, 0, 0 );
if ( nAttrLen > 0 )
{
- pAttrBuf = new WIN_BYTE[nAttrLen];
+ pAttrBuf = new BYTE[nAttrLen];
ImmGetCompositionStringW( hIMC, GCS_COMPATTR, pAttrBuf, nAttrLen );
}
if ( pAttrBuf )
{
xub_StrLen nTextLen = aEvt.maText.Len();
- pSalAttrAry = new USHORT[nTextLen];
- memset( pSalAttrAry, 0, nTextLen*sizeof( USHORT ) );
+ pSalAttrAry = new sal_uInt16[nTextLen];
+ memset( pSalAttrAry, 0, nTextLen*sizeof( sal_uInt16 ) );
for ( xub_StrLen i = 0; (i < nTextLen) && (i < nAttrLen); i++ )
{
- WIN_BYTE nWinAttr = pAttrBuf[i];
- USHORT nSalAttr;
+ BYTE nWinAttr = pAttrBuf[i];
+ sal_uInt16 nSalAttr;
if ( nWinAttr == ATTR_TARGET_CONVERTED )
{
nSalAttr = SAL_EXTTEXTINPUT_ATTR_BOLDUNDERLINE;
@@ -5465,9 +5500,9 @@ static BOOL ImplHandleIMECompositionInput( WinSalFrame* pFrame,
// -----------------------------------------------------------------------
-static BOOL ImplHandleIMEComposition( HWND hWnd, LPARAM lParam )
+static sal_Bool ImplHandleIMEComposition( HWND hWnd, LPARAM lParam )
{
- BOOL bDef = TRUE;
+ sal_Bool bDef = TRUE;
ImplSalYieldMutexAcquireWithWait();
WinSalFrame* pFrame = GetWindowPtr( hWnd );
@@ -5513,9 +5548,9 @@ static BOOL ImplHandleIMEComposition( HWND hWnd, LPARAM lParam )
// -----------------------------------------------------------------------
-static BOOL ImplHandleIMEEndComposition( HWND hWnd )
+static sal_Bool ImplHandleIMEEndComposition( HWND hWnd )
{
- BOOL bDef = TRUE;
+ sal_Bool bDef = TRUE;
ImplSalYieldMutexAcquireWithWait();
@@ -5701,8 +5736,8 @@ static LRESULT ImplHandleIMEConfirmReconvertString( HWND hWnd, LPARAM lParam )
pFrame->CallCallback( SALEVENT_SURROUNDINGTEXTREQUEST, (void*)&aEvt );
- ULONG nTmpStart = pReconvertString->dwCompStrOffset / sizeof(WCHAR);
- ULONG nTmpEnd = nTmpStart + pReconvertString->dwCompStrLen;
+ sal_uLong nTmpStart = pReconvertString->dwCompStrOffset / sizeof(WCHAR);
+ sal_uLong nTmpEnd = nTmpStart + pReconvertString->dwCompStrLen;
if( nTmpStart != aEvt.mnStart || nTmpEnd != aEvt.mnEnd )
{
@@ -6090,11 +6125,11 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP
rDef = FALSE;
break;
case SAL_MSG_TOTOP:
- ImplSalToTop( hWnd, (USHORT)wParam );
+ ImplSalToTop( hWnd, (sal_uInt16)wParam );
rDef = FALSE;
break;
case SAL_MSG_SHOW:
- ImplSalShow( hWnd, (BOOL)wParam, (BOOL)lParam );
+ ImplSalShow( hWnd, (sal_Bool)wParam, (sal_Bool)lParam );
rDef = FALSE;
break;
case SAL_MSG_SETINPUTCONTEXT:
@@ -6102,7 +6137,7 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP
rDef = FALSE;
break;
case SAL_MSG_ENDEXTTEXTINPUT:
- ImplSalFrameEndExtTextInput( hWnd, (USHORT)(ULONG)(void*)wParam );
+ ImplSalFrameEndExtTextInput( hWnd, (sal_uInt16)(sal_uLong)(void*)wParam );
rDef = FALSE;
break;
@@ -6269,11 +6304,11 @@ LRESULT CALLBACK SalFrameWndProcW( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM l
// -----------------------------------------------------------------------
-BOOL ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, LRESULT& rlResult )
+sal_Bool ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, LRESULT& rlResult )
{
// handle all messages concerning all frames so they get processed only once
// Must work for Unicode and none Unicode
- BOOL bResult = FALSE;
+ sal_Bool bResult = FALSE;
if ( (nMsg == WM_PALETTECHANGED) || (nMsg == SAL_MSG_POSTPALCHANGED) )
{
int bDef = TRUE;
@@ -6292,7 +6327,7 @@ BOOL ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, LR
// -----------------------------------------------------------------------
-BOOL ImplWriteLastError( DWORD lastError, const char *szApiCall )
+sal_Bool ImplWriteLastError( DWORD lastError, const char *szApiCall )
{
static int first=1;
// if VCL_LOGFILE_ENABLED is set, Win32 API error messages can be written
@@ -6300,7 +6335,7 @@ BOOL ImplWriteLastError( DWORD lastError, const char *szApiCall )
static char *logEnabled = getenv("VCL_LOGFILE_ENABLED");
if( logEnabled )
{
- BOOL bSuccess = FALSE;
+ sal_Bool bSuccess = FALSE;
static char *szTmp = getenv("TMP");
if( !szTmp || !*szTmp )
szTmp = getenv("TEMP");
diff --git a/vcl/win/source/window/salmenu.cxx b/vcl/win/source/window/salmenu.cxx
index e86e3f27903d..d92039194f7a 100644
--- a/vcl/win/source/window/salmenu.cxx
+++ b/vcl/win/source/window/salmenu.cxx
@@ -48,7 +48,7 @@ static DWORD myerr=0;
// =======================================================================
-BOOL SalData::IsKnownMenuHandle( HMENU hMenu )
+sal_Bool SalData::IsKnownMenuHandle( HMENU hMenu )
{
if( mhMenuSet.find( hMenu ) == mhMenuSet.end() )
return FALSE;
@@ -60,7 +60,7 @@ BOOL SalData::IsKnownMenuHandle( HMENU hMenu )
// WinSalInst factory methods
-SalMenu* WinSalInstance::CreateMenu( BOOL bMenuBar )
+SalMenu* WinSalInstance::CreateMenu( sal_Bool bMenuBar, Menu* )
{
WinSalMenu *pSalMenu = new WinSalMenu();
@@ -169,7 +169,7 @@ WinSalMenu::~WinSalMenu()
::DestroyMenu( mhMenu );
}
-BOOL WinSalMenu::VisibleMenuBar()
+sal_Bool WinSalMenu::VisibleMenuBar()
{
// The Win32 implementation never shows a native
// menubar. Thus, native menues are only visible
@@ -295,13 +295,13 @@ void WinSalMenu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsig
}
}
-void WinSalMenu::CheckItem( unsigned nPos, BOOL bCheck )
+void WinSalMenu::CheckItem( unsigned nPos, sal_Bool bCheck )
{
if( -1 != ::CheckMenuItem( mhMenu, nPos, MF_BYPOSITION|(bCheck ? MF_CHECKED : MF_UNCHECKED) ) )
ImplDrawMenuBar( this );
}
-void WinSalMenu::EnableItem( unsigned nPos, BOOL bEnable )
+void WinSalMenu::EnableItem( unsigned nPos, sal_Bool bEnable )
{
if( -1 != ::EnableMenuItem( mhMenu, nPos, MF_BYPOSITION|(bEnable ? MF_ENABLED : (MF_DISABLED|MF_GRAYED) ) ) )
ImplDrawMenuBar( this );
diff --git a/vcl/win/source/window/salobj.cxx b/vcl/win/source/window/salobj.cxx
index bfa365af7ba2..5e034564d4cf 100644
--- a/vcl/win/source/window/salobj.cxx
+++ b/vcl/win/source/window/salobj.cxx
@@ -38,10 +38,11 @@
#include <salframe.h>
#include <salobj.h>
#include <tools/debug.hxx>
+#include <vcl/svapp.hxx>
// =======================================================================
-static BOOL ImplIsSysWindowOrChild( HWND hWndParent, HWND hWndChild )
+static sal_Bool ImplIsSysWindowOrChild( HWND hWndParent, HWND hWndChild )
{
if ( hWndParent == hWndChild )
return TRUE;
@@ -102,6 +103,46 @@ WinSalFrame* ImplFindSalObjectFrame( HWND hWnd )
// -----------------------------------------------------------------------
+sal_Bool ImplInterceptChildWindowKeyDown( MSG& rMsg )
+{
+ sal_Bool bResult = sal_False;
+ if ( rMsg.message == WM_KEYDOWN )
+ {
+ wchar_t pClassName[10];
+ sal_Int32 nLen = GetClassNameW( rMsg.hwnd, pClassName, 10 );
+ if ( !( nLen == 9 && wcsncmp( pClassName, SAL_OBJECT_CLASSNAMEW, nLen ) == 0 ) )
+ {
+ // look for the first SalObject in the parent hierarchy
+ HWND hWin = rMsg.hwnd;
+ HWND hLastOLEWindow = hWin;
+ WinSalObject* pSalObj = NULL;
+ do
+ {
+ hLastOLEWindow = hWin;
+ hWin = ::GetParent( hWin );
+ if ( hWin )
+ {
+ nLen = GetClassNameW( hWin, pClassName, 10 );
+ if ( nLen == 9 && wcsncmp( pClassName, SAL_OBJECT_CLASSNAMEW, nLen ) == 0 )
+ pSalObj = GetSalObjWindowPtr( hWin );
+ }
+ } while( hWin && !pSalObj );
+
+ if ( pSalObj && pSalObj->mbInterceptChildWindowKeyDown && pSalObj->maSysData.hWnd )
+ {
+ bResult = ( 1 == ImplSendMessage( pSalObj->maSysData.hWnd, rMsg.message, rMsg.wParam, rMsg.lParam ) );
+ }
+ }
+ }
+
+ return bResult;
+}
+
+// -----------------------------------------------------------------------
+
+
+// -----------------------------------------------------------------------
+
LRESULT CALLBACK SalSysMsgProc( int nCode, WPARAM wParam, LPARAM lParam )
{
// Used for Unicode and none Unicode
@@ -160,7 +201,7 @@ LRESULT CALLBACK SalSysMsgProc( int nCode, WPARAM wParam, LPARAM lParam )
// -----------------------------------------------------------------------
-BOOL ImplSalPreDispatchMsg( MSG* pMsg )
+sal_Bool ImplSalPreDispatchMsg( MSG* pMsg )
{
// Used for Unicode and none Unicode
SalData* pSalData = GetSalData();
@@ -185,7 +226,7 @@ BOOL ImplSalPreDispatchMsg( MSG* pMsg )
// SysKeys werden als WM_SYSCOMMAND verarbeitet
// Char-Events verarbeiten wir nicht, da wir nur
// Accelerator relevante Keys verarbeiten wollen
- BOOL bWantedKeyCode = FALSE;
+ sal_Bool bWantedKeyCode = FALSE;
// A-Z, 0-9 nur in Verbindung mit Control-Taste
if ( ((pMsg->wParam >= 65) && (pMsg->wParam <= 90)) ||
((pMsg->wParam >= 48) && (pMsg->wParam <= 57)) )
@@ -213,13 +254,13 @@ BOOL ImplSalPreDispatchMsg( MSG* pMsg )
{
pSalData->mnSalObjWantKeyEvt = 0;
- USHORT nKeyCode = LOWORD( pMsg->wParam );
+ sal_uInt16 nKeyCode = LOWORD( pMsg->wParam );
// Nur 0-9 und A-Z
if ( ((nKeyCode >= 48) && (nKeyCode <= 57)) ||
((nKeyCode >= 65) && (nKeyCode <= 90)) ||
((nKeyCode >= 97) && (nKeyCode <= 122)) )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = FALSE;
ImplSalYieldMutexAcquireWithWait();
pObject = ImplFindSalObject( pMsg->hwnd );
if ( pObject )
@@ -337,7 +378,7 @@ LRESULT CALLBACK SalSysObjWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM l
{
pSysObj = GetSalObjWindowPtr( hWnd );
HWND hFocusWnd = ::GetFocus();
- USHORT nEvent;
+ sal_uInt16 nEvent;
if ( hFocusWnd && ImplIsSysWindowOrChild( hWnd, hFocusWnd ) )
nEvent = SALOBJ_EVENT_GETFOCUS;
else
@@ -612,6 +653,7 @@ WinSalObject::WinSalObject()
mhLastFocusWnd = 0;
maSysData.nSize = sizeof( SystemEnvData );
mpStdClipRgnData = NULL;
+ mbInterceptChildWindowKeyDown = sal_False;
// Insert object in objectlist
mpNextObject = pSalData->mpFirstObject;
@@ -671,16 +713,16 @@ void WinSalObject::ResetClipRegion()
// -----------------------------------------------------------------------
-USHORT WinSalObject::GetClipRegionType()
+sal_uInt16 WinSalObject::GetClipRegionType()
{
return SAL_OBJECT_CLIP_INCLUDERECTS;
}
// -----------------------------------------------------------------------
-void WinSalObject::BeginSetClipRegion( ULONG nRectCount )
+void WinSalObject::BeginSetClipRegion( sal_uLong nRectCount )
{
- ULONG nRectBufSize = sizeof(RECT)*nRectCount;
+ sal_uLong nRectBufSize = sizeof(RECT)*nRectCount;
if ( nRectCount < SAL_CLIPRECT_COUNT )
{
if ( !mpStdClipRgnData )
@@ -752,7 +794,7 @@ void WinSalObject::EndSetClipRegion()
}
else
{
- ULONG nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER);
+ sal_uLong nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER);
hRegion = ExtCreateRegion( NULL, nSize, mpClipRgnData );
if ( mpClipRgnData != mpStdClipRgnData )
delete [] (BYTE*)mpClipRgnData;
@@ -766,8 +808,8 @@ void WinSalObject::EndSetClipRegion()
void WinSalObject::SetPosSize( long nX, long nY, long nWidth, long nHeight )
{
- ULONG nStyle = 0;
- BOOL bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
+ sal_uLong nStyle = 0;
+ sal_Bool bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
if ( bVisible )
{
ShowWindow( mhWnd, SW_HIDE );
@@ -780,7 +822,7 @@ void WinSalObject::SetPosSize( long nX, long nY, long nWidth, long nHeight )
// -----------------------------------------------------------------------
-void WinSalObject::Show( BOOL bVisible )
+void WinSalObject::Show( sal_Bool bVisible )
{
if ( bVisible )
ShowWindow( mhWnd, SW_SHOWNORMAL );
@@ -790,7 +832,7 @@ void WinSalObject::Show( BOOL bVisible )
// -----------------------------------------------------------------------
-void WinSalObject::Enable( BOOL bEnable )
+void WinSalObject::Enable( sal_Bool bEnable )
{
EnableWindow( mhWnd, bEnable );
}
@@ -826,4 +868,11 @@ const SystemEnvData* WinSalObject::GetSystemData() const
return &maSysData;
}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+// -----------------------------------------------------------------------
+
+void WinSalObject::InterceptChildWindowKeyDown( sal_Bool bIntercept )
+{
+ mbInterceptChildWindowKeyDown = bIntercept;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/vcl/workben/makefile.mk b/vcl/workben/makefile.mk
index 66bca942f74c..d52737507a20 100644
--- a/vcl/workben/makefile.mk
+++ b/vcl/workben/makefile.mk
@@ -34,6 +34,8 @@ TARGETTYPE=GUI
ENABLE_EXCEPTIONS=TRUE
+my_components = i18npool i18nsearch
+
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
@@ -132,16 +134,18 @@ APP5STDLIBS+=-lsocket
.ENDIF
.INCLUDE : target.mk
-.IF "$(L10N_framework)"==""
-ALLTAR : $(BIN)$/applicat.rdb
+ALLTAR : $(BIN)/applicat.rdb $(BIN)/types.rdb
+$(BIN)/applicat.rdb .ERRREMOVE : $(SOLARENV)/bin/packcomponents.xslt \
+ $(MISC)/applicat.input $(my_components:^"$(SOLARXMLDIR)/":+".component")
+ $(XSLTPROC) --nonet --stringparam prefix $(SOLARXMLDIR)/ -o $@ \
+ $(SOLARENV)/bin/packcomponents.xslt $(MISC)/applicat.input
-$(BIN)$/applicat.rdb : makefile.mk $(UNOUCRRDB)
- rm -f $@
- $(GNUCOPY) $(UNOUCRRDB) $@
- cd $(BIN) && \
- $(REGCOMP) -register -r applicat.rdb \
- -c i18nsearch.uno$(DLLPOST) \
- -c i18npool.uno$(DLLPOST)
-.ENDIF
+$(MISC)/applicat.input :
+ echo \
+ '<list>$(my_components:^"<filename>":+".component</filename>")</list>' \
+ > $@
+
+$(BIN)/types.rdb : $(SOLARBINDIR)/types.rdb
+ $(COPY) $< $@
diff --git a/vcl/workben/outdevgrind.cxx b/vcl/workben/outdevgrind.cxx
index 0d38ff519987..e86db3ed7821 100644
--- a/vcl/workben/outdevgrind.cxx
+++ b/vcl/workben/outdevgrind.cxx
@@ -75,7 +75,7 @@ class GrindApp : public Application
{
public:
virtual int Main();
- virtual USHORT Exception( USHORT nError );
+ virtual sal_uInt16 Exception( sal_uInt16 nError );
};
class TestWindow : public Dialog
@@ -154,7 +154,7 @@ void setupMethodStubs( functor_vector_type& res )
const Wallpaper aWallpaper( aWhiteColor );
GDIMetaFile aMtf;
- aMtf.AddAction( new MetaFillColorAction(Color(COL_RED),TRUE) );
+ aMtf.AddAction( new MetaFillColorAction(Color(COL_RED),sal_True) );
aMtf.AddAction( new MetaRectAction(aRect) );
/* void DrawText( const Point& rStartPt, const XubString& rStr,
@@ -166,7 +166,7 @@ void setupMethodStubs( functor_vector_type& res )
// boost::bind(
// &OutputDevice::DrawText,
// _1,
-// aPt1, aString, (USHORT)0, aString.Len(), (MetricVector*)0, (String*)0, (vcl::ITextLayout*)0 ));
+// aPt1, aString, (sal_uInt16)0, aString.Len(), (MetricVector*)0, (String*)0, (vcl::ITextLayout*)0 ));
/* void DrawTextArray( const Point& rStartPt, const XubString& rStr,
const sal_Int32* pDXAry = NULL,
@@ -178,7 +178,7 @@ void setupMethodStubs( functor_vector_type& res )
boost::bind(
&OutputDevice::DrawTextArray,
_1,
- aPt1, aString, (const sal_Int32*)0, (USHORT)0, aString.Len() ));
+ aPt1, aString, (const sal_Int32*)0, (sal_uInt16)0, aString.Len() ));
/* void DrawPixel( const Point& rPt, const Color& rColor ); */
add(res,
@@ -257,12 +257,12 @@ void setupMethodStubs( functor_vector_type& res )
aRect ));
/* void DrawRect( const Rectangle& rRect,
- ULONG nHorzRount, ULONG nVertRound );
+ sal_uLong nHorzRount, sal_uLong nVertRound );
*/
add(res,
"DrawRect(round corners)",
boost::bind(
- (void (OutputDevice::*)( const Rectangle&, ULONG nHorzRount, ULONG nVertRound ))(
+ (void (OutputDevice::*)( const Rectangle&, sal_uLong nHorzRount, sal_uLong nVertRound ))(
&OutputDevice::DrawRect),
_1,
aRect2,
@@ -353,14 +353,14 @@ void setupMethodStubs( functor_vector_type& res )
/* void CopyArea( const Point& rDestPt,
const Point& rSrcPt, const Size& rSrcSize,
- USHORT nFlags = 0 );
+ sal_uInt16 nFlags = 0 );
*/
add(res,
"CopyArea",
boost::bind(
&OutputDevice::CopyArea,
_1,
- aPt1,aPt3,aRect2.GetSize(),(USHORT)0 ));
+ aPt1,aPt3,aRect2.GetSize(),(sal_uInt16)0 ));
/* void DrawBitmap( const Point& rDestPt,
const Bitmap& rBitmap );
@@ -697,20 +697,20 @@ void setupMethodStubs( functor_vector_type& res )
aPt1,aRect.GetSize(),aPt3,aRect2.GetSize(),aBitmap,aBlackColor ));
/* void DrawImage( const Point& rPos,
- const Image& rImage, USHORT nStyle = 0 );
+ const Image& rImage, sal_uInt16 nStyle = 0 );
*/
add(res,
"DrawImage",
boost::bind(
(void (OutputDevice::*)( const Point&,
const Image&,
- USHORT nStyle ))(
+ sal_uInt16 nStyle ))(
&OutputDevice::DrawImage),
_1,
- aPt1,aImage,(USHORT)0 ));
+ aPt1,aImage,(sal_uInt16)0 ));
/* void DrawImage( const Point& rPos, const Size& rSize,
- const Image& rImage, USHORT nStyle = 0 );
+ const Image& rImage, sal_uInt16 nStyle = 0 );
*/
add(res,
"DrawImage(scaled)",
@@ -718,10 +718,10 @@ void setupMethodStubs( functor_vector_type& res )
(void (OutputDevice::*)( const Point&,
const Size&,
const Image&,
- USHORT nStyle ))(
+ sal_uInt16 nStyle ))(
&OutputDevice::DrawImage),
_1,
- aPt1,aRect.GetSize(),aImage,(USHORT)0 ));
+ aPt1,aRect.GetSize(),aImage,(sal_uInt16)0 ));
/* void DrawGradient( const Rectangle& rRect, const Gradient& rGradient ); */
add(res,
@@ -757,15 +757,15 @@ void setupMethodStubs( functor_vector_type& res )
_1,
aRect2,aWallpaper ));
- /* void DrawWaveLine( const Point& rStartPos, const Point& rEndPos, USHORT nStyle ); */
+ /* void DrawWaveLine( const Point& rStartPos, const Point& rEndPos, sal_uInt16 nStyle ); */
add(res,
"DrawWaveLine",
boost::bind(
&OutputDevice::DrawWaveLine,
_1,
- aPt1,aPt2,(USHORT)WAVE_NORMAL ));
+ aPt1,aPt2,(sal_uInt16)WAVE_NORMAL ));
- /* void DrawGrid( const Rectangle& rRect, const Size& rDist, ULONG nFlags ); */
+ /* void DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLong nFlags ); */
add(res,
"DrawGrid",
boost::bind(
@@ -774,15 +774,15 @@ void setupMethodStubs( functor_vector_type& res )
aRect,Size(10,20),GRID_HORZLINES|GRID_VERTLINES ));
/* void DrawTransparent( const PolyPolygon& rPolyPoly,
- USHORT nTransparencePercent );
+ sal_uInt16 nTransparencePercent );
*/
add(res,
"DrawTransparent",
boost::bind(
- (void (OutputDevice::*)( const PolyPolygon&, USHORT ))(
+ (void (OutputDevice::*)( const PolyPolygon&, sal_uInt16 ))(
&OutputDevice::DrawTransparent),
_1,
- aPoly3,(USHORT)50 ));
+ aPoly3,(sal_uInt16)50 ));
/* void DrawTransparent( const GDIMetaFile& rMtf,
const Point& rPos, const Size& rSize,
@@ -903,7 +903,7 @@ void TestWindow::Paint( const Rectangle& )
fflush( stdout );
}
-USHORT GrindApp::Exception( USHORT nError )
+sal_uInt16 GrindApp::Exception( sal_uInt16 nError )
{
switch( nError & EXC_MAJORTYPE )
{
@@ -919,7 +919,7 @@ int GrindApp::Main()
{
bool bHelp = false;
- for( USHORT i = 0; i < GetCommandLineParamCount(); i++ )
+ for( sal_uInt16 i = 0; i < GetCommandLineParamCount(); i++ )
{
::rtl::OUString aParam = GetCommandLineParam( i );
diff --git a/vcl/workben/svdem.cxx b/vcl/workben/svdem.cxx
index 2067fbe696ce..4898aed1a995 100644
--- a/vcl/workben/svdem.cxx
+++ b/vcl/workben/svdem.cxx
@@ -56,7 +56,7 @@ SAL_IMPLEMENT_MAIN()
tools::extendApplicationEnvironment();
Reference< XMultiServiceFactory > xMS;
- xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
+ xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
InitVCL( xMS );
::Main();
diff --git a/vcl/workben/svpclient.cxx b/vcl/workben/svpclient.cxx
index 39f97c476051..47af3aaa8e30 100644
--- a/vcl/workben/svpclient.cxx
+++ b/vcl/workben/svpclient.cxx
@@ -147,7 +147,7 @@ public:
void Paint( const Rectangle& rRect );
void Resize();
- BOOL Close();
+ sal_Bool Close();
void parseList( const rtl::OString& rList );
rtl::OString processCommand( const rtl::OString& rCommand );
@@ -196,9 +196,9 @@ MyWin::MyWin( Window* pParent, WinBits nWinStyle ) :
m_aQuitButton.Show();
}
-BOOL MyWin::Close()
+sal_Bool MyWin::Close()
{
- BOOL bRet = WorkWindow::Close();
+ sal_Bool bRet = WorkWindow::Close();
if( bRet )
Application::Quit();
return bRet;
@@ -279,7 +279,7 @@ IMPL_LINK( MyWin, QuitHdl, Button*, )
IMPL_LINK( MyWin, SelectHdl, ListBox*, )
{
String aEntry = m_aSvpBitmaps.GetSelectEntry();
- USHORT nPos = aEntry.SearchAscii( ": " );
+ sal_uInt16 nPos = aEntry.SearchAscii( ": " );
if( nPos != STRING_NOTFOUND )
{
OStringBuffer aCommand( 64 );
@@ -298,7 +298,7 @@ IMPL_LINK( MyWin, SelectHdl, ListBox*, )
aFixedSize.Width() += 10;
aFixedSize.Height() += 10;
m_aImage.SetSizePixel( aFixedSize );
- m_aImage.SetBitmap( BitmapEx( aBitmap ) );
+ m_aImage.SetImage( Image( BitmapEx( aBitmap ) ) );
}
return 0;
}
diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx
index d5c736b74450..545c2aedf6ee 100644
--- a/vcl/workben/svptest.cxx
+++ b/vcl/workben/svptest.cxx
@@ -64,7 +64,7 @@ SAL_IMPLEMENT_MAIN()
tools::extendApplicationEnvironment();
Reference< XMultiServiceFactory > xMS;
- xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
+ xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
InitVCL( xMS );
::Main();
@@ -191,7 +191,7 @@ static Point project( const Point& rPoint )
static Color approachColor( const Color& rFrom, const Color& rTo )
{
Color aColor;
- UINT8 nDiff;
+ sal_uInt8 nDiff;
// approach red
if( rFrom.GetRed() < rTo.GetRed() )
{
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index a4da3f11c966..547660fa1e1e 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -61,7 +61,7 @@ SAL_IMPLEMENT_MAIN()
tools::extendApplicationEnvironment();
Reference< XMultiServiceFactory > xMS;
- xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
+ xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
InitVCL( xMS );
::Main();